From 940bd51f8952745c8ff12137441092958e4cf353 Mon Sep 17 00:00:00 2001 From: Louis Acresti Date: Sun, 18 Aug 2013 02:26:33 -0400 Subject: [PATCH 01/69] fixes #4 for realz --- WTF/WTF.xcodeproj/project.pbxproj | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/WTF/WTF.xcodeproj/project.pbxproj b/WTF/WTF.xcodeproj/project.pbxproj index 0a6eb6f6..a6a92363 100644 --- a/WTF/WTF.xcodeproj/project.pbxproj +++ b/WTF/WTF.xcodeproj/project.pbxproj @@ -1754,6 +1754,7 @@ baseConfigurationReference = 5D247B7314689C4700E78B76 /* WTF.xcconfig */; buildSettings = { DEBUG_DEFINES = "$(DEBUG_DEFINES_debug)"; + GCC_TREAT_WARNINGS_AS_ERRORS = NO; }; name = Debug; }; @@ -1761,6 +1762,7 @@ isa = XCBuildConfiguration; baseConfigurationReference = 5D247B7314689C4700E78B76 /* WTF.xcconfig */; buildSettings = { + GCC_TREAT_WARNINGS_AS_ERRORS = NO; }; name = Release; }; @@ -1775,6 +1777,7 @@ isa = XCBuildConfiguration; baseConfigurationReference = 5D247B7314689C4700E78B76 /* WTF.xcconfig */; buildSettings = { + GCC_TREAT_WARNINGS_AS_ERRORS = NO; }; name = Production; }; @@ -1791,6 +1794,7 @@ "$(GCC_PREPROCESSOR_DEFINITIONS)", "UCONFIG_NO_COLLATION=1", ); + GCC_TREAT_WARNINGS_AS_ERRORS = NO; IPHONEOS_DEPLOYMENT_TARGET = 5.0; PRODUCT_NAME = WTF; SDKROOT = iphoneos; @@ -1810,6 +1814,7 @@ "$(GCC_PREPROCESSOR_DEFINITIONS)", "UCONFIG_NO_COLLATION=1", ); + GCC_TREAT_WARNINGS_AS_ERRORS = NO; IPHONEOS_DEPLOYMENT_TARGET = 5.0; PRODUCT_NAME = WTF; SDKROOT = iphoneos; @@ -1829,6 +1834,7 @@ "$(GCC_PREPROCESSOR_DEFINITIONS)", "UCONFIG_NO_COLLATION=1", ); + GCC_TREAT_WARNINGS_AS_ERRORS = NO; IPHONEOS_DEPLOYMENT_TARGET = 5.0; PRODUCT_NAME = WTF; SDKROOT = iphoneos; @@ -1898,6 +1904,7 @@ B6E69982166BD499005EF4B1 /* Production */, ); defaultConfigurationIsVisible = 0; + defaultConfigurationName = Production; }; /* End XCConfigurationList section */ }; From 3895c677252911a3a079551a272e5ff09bc5dcfe Mon Sep 17 00:00:00 2001 From: Dominic Szablewski Date: Tue, 5 Nov 2013 12:15:28 +0100 Subject: [PATCH 02/69] Webkit SVN Tag 538.4 --- JavaScriptCore/API/APICallbackFunction.h | 109 + JavaScriptCore/API/APICast.h | 47 +- JavaScriptCore/API/APIShims.h | 60 +- JavaScriptCore/API/JSAPIWrapperObject.h | 60 + JavaScriptCore/API/JSAPIWrapperObject.mm | 112 + JavaScriptCore/API/JSBase.cpp | 69 +- JavaScriptCore/API/JSBase.h | 15 +- JavaScriptCore/API/JSBasePrivate.h | 2 + JavaScriptCore/API/JSCTestRunnerUtils.cpp | 48 + JavaScriptCore/API/JSCTestRunnerUtils.h | 39 + JavaScriptCore/API/JSCallbackConstructor.cpp | 54 +- JavaScriptCore/API/JSCallbackConstructor.h | 16 +- JavaScriptCore/API/JSCallbackFunction.cpp | 54 +- JavaScriptCore/API/JSCallbackFunction.h | 23 +- JavaScriptCore/API/JSCallbackObject.cpp | 36 +- JavaScriptCore/API/JSCallbackObject.h | 66 +- .../API/JSCallbackObjectFunctions.h | 422 +- JavaScriptCore/API/JSClassRef.cpp | 79 +- JavaScriptCore/API/JSClassRef.h | 36 +- JavaScriptCore/API/JSContext.h | 133 + JavaScriptCore/API/JSContext.mm | 289 + .../API/JSContextInternal.h | 73 +- JavaScriptCore/API/JSContextRef.cpp | 205 +- JavaScriptCore/API/JSContextRef.h | 8 + JavaScriptCore/API/JSContextRefPrivate.h | 57 +- JavaScriptCore/API/JSExport.h | 130 + JavaScriptCore/API/JSManagedValue.h | 70 + JavaScriptCore/API/JSManagedValue.mm | 250 + JavaScriptCore/API/JSObjectRef.cpp | 213 +- JavaScriptCore/API/JSProfilerPrivate.cpp | 8 +- JavaScriptCore/API/JSScriptRef.cpp | 151 + JavaScriptCore/API/JSScriptRefPrivate.h | 99 + JavaScriptCore/API/JSStringRef.cpp | 15 +- JavaScriptCore/API/JSStringRefCF.cpp | 20 +- JavaScriptCore/API/JSStringRefPrivate.h | 41 + JavaScriptCore/API/JSValue.h | 310 + JavaScriptCore/API/JSValue.mm | 1132 + JavaScriptCore/API/JSValueInternal.h | 58 + JavaScriptCore/API/JSValueRef.cpp | 161 +- JavaScriptCore/API/JSValueRef.h | 2 +- JavaScriptCore/API/JSVirtualMachine.h | 62 + JavaScriptCore/API/JSVirtualMachine.mm | 256 + JavaScriptCore/API/JSVirtualMachineInternal.h | 57 + .../API/JSWeakObjectMapRefPrivate.cpp | 22 +- JavaScriptCore/API/JSWrapperMap.h | 47 + JavaScriptCore/API/JSWrapperMap.mm | 597 + JavaScriptCore/API/JavaScriptCore.h | 10 + JavaScriptCore/API/ObjCCallbackFunction.h | 83 + JavaScriptCore/API/ObjCCallbackFunction.mm | 709 + JavaScriptCore/API/ObjcRuntimeExtras.h | 231 + JavaScriptCore/API/OpaqueJSString.cpp | 36 +- JavaScriptCore/API/OpaqueJSString.h | 39 +- JavaScriptCore/API/WebKitAvailability.h | 2 + .../tests/CurrentThisInsideBlockGetterTest.h | 38 + .../tests/CurrentThisInsideBlockGetterTest.mm | 125 + JavaScriptCore/API/tests/JSNode.c | 1 - JavaScriptCore/API/tests/JSNodeList.c | 1 - JavaScriptCore/API/tests/minidom.c | 2 +- JavaScriptCore/API/tests/testapi.c | 381 +- JavaScriptCore/API/tests/testapi.js | 4 + JavaScriptCore/API/tests/testapi.mm | 1132 + JavaScriptCore/CMakeLists.txt | 541 +- JavaScriptCore/ChangeLog | 71601 +--------------- JavaScriptCore/ChangeLog-2012-05-22 | 70902 +++++++++++++++ JavaScriptCore/ChangeLog-2012-10-02 | 20888 +++++ JavaScriptCore/ChangeLog-2013-04-24 | 29044 +++++++ JavaScriptCore/ChangeLog-2013-10-13 | 29141 +++++++ JavaScriptCore/Configurations/Base.xcconfig | 131 +- .../Configurations/CompilerVersion.xcconfig | 82 - .../Configurations/DebugRelease.xcconfig | 33 +- .../Configurations/FeatureDefines.xcconfig | 163 +- JavaScriptCore/Configurations/JSC.xcconfig | 7 +- .../Configurations/JavaScriptCore.xcconfig | 15 +- .../Configurations/LLVMForJSC.xcconfig | 44 + .../Configurations/ToolExecutable.xcconfig | 23 +- .../Configurations/Version.xcconfig | 21 +- JavaScriptCore/Configurations/iOS.xcconfig | 1 + JavaScriptCore/DerivedSources.make | 29 +- JavaScriptCore/DerivedSources.pri | 81 - .../JavaScriptCore/JSCTestRunnerUtils.h | 1 + JavaScriptCore/GNUmakefile.am | 76 +- JavaScriptCore/GNUmakefile.list.am | 709 +- JavaScriptCore/Info.plist | 2 +- JavaScriptCore/JSCTypedArrayStubs.h | 203 - JavaScriptCore/JavaScriptCore.gir.in | 12 + JavaScriptCore/JavaScriptCore.gyp/.gitignore | 5 - .../JavaScriptCore.gyp/JavaScriptCore.gyp | 102 - JavaScriptCore/JavaScriptCore.gypi | 586 - JavaScriptCore/JavaScriptCore.order | 7222 +- JavaScriptCore/JavaScriptCore.pri | 47 - JavaScriptCore/JavaScriptCore.pro | 19 - .../JavaScriptCore.vcproj/JavaScriptCore.make | 41 - .../JavaScriptCore.vcproj/JavaScriptCore.sln | 143 - .../JavaScriptCore/JavaScriptCore.def | 382 - .../JavaScriptCore/JavaScriptCore.vcproj | 2288 - .../JavaScriptCore/JavaScriptCoreCF.vsprops | 11 - .../JavaScriptCoreCFLite.vsprops | 11 - .../JavaScriptCoreCommon.vsprops | 20 - .../JavaScriptCoreDebug.vsprops | 8 - .../JavaScriptCoreDebugAll.vsprops | 8 - .../JavaScriptCoreDebugCairoCFLite.vsprops | 8 - .../JavaScriptCoreGenerated.vcproj | 104 - .../JavaScriptCoreGeneratedCommon.vsprops | 14 - .../JavaScriptCoreGeneratedDebug.vsprops | 8 - .../JavaScriptCoreGeneratedDebugAll.vsprops | 8 - ...criptCoreGeneratedDebugCairoCFLite.vsprops | 8 - .../JavaScriptCoreGeneratedProduction.vsprops | 8 - .../JavaScriptCoreGeneratedRelease.vsprops | 8 - ...iptCoreGeneratedReleaseCairoCFLite.vsprops | 8 - .../JavaScriptCoreGeneratedReleasePGO.vsprops | 8 - .../JavaScriptCorePGOOptimize.vsprops | 15 - .../JavaScriptCorePostBuild.cmd | 2 - .../JavaScriptCore/JavaScriptCorePreLink.cmd | 9 - .../JavaScriptCoreProduction.vsprops | 8 - .../JavaScriptCoreRelease.vsprops | 8 - .../JavaScriptCoreReleaseCairoCFLite.vsprops | 8 - .../JavaScriptCoreReleasePGO.vsprops | 16 - .../JavaScriptCoreReleasePGOOptimize.vsprops | 12 - .../JavaScriptCoreSubmit.sln | 80 - .../JavaScriptCore.vcproj/jsc/jsc.vcproj | 473 - .../jsc/jscCommon.vsprops | 20 - .../jsc/jscDebug.vsprops | 8 - .../jsc/jscDebugAll.vsprops | 8 - .../jsc/jscDebugCairoCFLite.vsprops | 8 - .../jsc/jscPostBuild.cmd | 25 - .../JavaScriptCore.vcproj/jsc/jscPreLink.cmd | 9 - .../jsc/jscProduction.vsprops | 8 - .../jsc/jscRelease.vsprops | 8 - .../jsc/jscReleaseCairoCFLite.vsprops | 8 - .../jsc/jscReleasePGO.vsprops | 12 - .../testRegExp/testRegExp.vcproj | 473 - .../testRegExp/testRegExpCommon.vsprops | 20 - .../testRegExp/testRegExpDebug.vsprops | 8 - .../testRegExp/testRegExpDebugAll.vsprops | 8 - .../testRegExpDebugCairoCFLite.vsprops | 8 - .../testRegExp/testRegExpPostBuild.cmd | 25 - .../testRegExp/testRegExpPreLink.cmd | 9 - .../testRegExp/testRegExpProduction.vsprops | 8 - .../testRegExp/testRegExpRelease.vsprops | 8 - .../testRegExpReleaseCairoCFLite.vsprops | 8 - .../testRegExp/testRegExpReleasePGO.vsprops | 12 - .../testapi/testapi.vcproj | 448 - .../testapi/testapiCommon.vsprops | 21 - .../testapi/testapiDebug.vsprops | 8 - .../testapi/testapiDebugAll.vsprops | 8 - .../testapi/testapiDebugCairoCFLite.vsprops | 8 - .../testapi/testapiPreLink.cmd | 9 - .../testapi/testapiProduction.vsprops | 8 - .../testapi/testapiRelease.vsprops | 8 - .../testapi/testapiReleaseCairoCFLite.vsprops | 8 - .../JavaScriptCore.make | 55 + .../JavaScriptCore.resources/Info.plist | 2 +- .../JavaScriptCore.vcxproj/JavaScriptCore.sln | 311 + .../JavaScriptCore.submit.sln | 122 + .../JavaScriptCore.vcxproj | 1308 + .../JavaScriptCore.vcxproj.filters | 3044 + .../JavaScriptCoreCF.props | 12 + .../JavaScriptCoreCFLite.props | 12 + .../JavaScriptCoreCommon.props | 19 + .../JavaScriptCoreDebug.props | 16 + .../JavaScriptCoreDebugCFLite.props | 16 + .../JavaScriptCoreGenerated.make | 4 +- .../JavaScriptCoreGenerated.vcxproj | 214 + .../JavaScriptCoreGenerated.vcxproj.filters | 9 + .../JavaScriptCoreGeneratedCommon.props | 11 + .../JavaScriptCoreGeneratedDebug.props | 15 + .../JavaScriptCoreGeneratedProduction.props | 13 + .../JavaScriptCoreGeneratedRelease.props | 13 + .../JavaScriptCorePostBuild.cmd | 2 + .../JavaScriptCorePreBuild.cmd | 0 .../JavaScriptCorePreLink.cmd} | 0 .../JavaScriptCoreProduction.props | 14 + .../JavaScriptCoreRelease.props | 16 + .../JavaScriptCoreReleaseCFLite.props | 16 + .../LLInt/LLIntAssembly/LLIntAssembly.make | 8 + .../LLInt/LLIntAssembly/LLIntAssembly.vcxproj | 271 + .../LLIntAssembly/build-LLIntAssembly.sh | 26 + .../LLIntDesiredOffsets.make | 9 + .../LLIntDesiredOffsets.vcxproj | 257 + .../build-LLIntDesiredOffsets.sh | 25 + .../LLIntOffsetsExtractor.vcxproj | 199 + .../LLIntOffsetsExtractorCommon.props | 19 + .../LLIntOffsetsExtractorDebug.props | 9 + .../LLIntOffsetsExtractorProduction.props | 13 + .../LLIntOffsetsExtractorRelease.props | 15 + .../build-generated-files.sh | 9 +- .../copy-files.cmd | 11 +- .../JavaScriptCore.vcxproj/jsc/jsc.vcxproj | 310 + .../jsc/jsc.vcxproj.filters | 11 + .../jsc/jscCommon.props | 22 + .../JavaScriptCore.vcxproj/jsc/jscDebug.props | 13 + .../jsc/jscPostBuild.cmd | 1 + .../jsc/jscPreBuild.cmd | 0 .../JavaScriptCore.vcxproj/jsc/jscPreLink.cmd | 0 .../jsc/jscProduction.props | 13 + .../jsc/jscRelease.props | 13 + .../JavaScriptCore.vcxproj/resource.h | 14 + .../testRegExp/testRegExp.vcxproj | 317 + .../testRegExp/testRegExp.vcxproj.filters | 11 + .../testRegExp/testRegExpCommon.props | 17 + .../testRegExp/testRegExpDebug.props | 17 + .../testRegExp/testRegExpPostBuild.cmd | 3 + .../testRegExp/testRegExpPreBuild.cmd | 0 .../testRegExp/testRegExpPreLink.cmd | 0 .../testRegExp/testRegExpProduction.props | 12 + .../testRegExp/testRegExpRelease.props | 12 + .../testapi/testapi.vcxproj | 287 + .../testapi/testapi.vcxproj.filters | 12 + .../testapi/testapiCommon.props | 17 + .../testapi/testapiCommonCFLite.props | 17 + .../testapi/testapiDebug.props | 14 + .../testapi/testapiDebugCFLite.props | 14 + .../testapi/testapiPostBuild.cmd | 0 .../testapi/testapiPreBuild.cmd | 0 .../testapi/testapiPreLink.cmd | 0 .../testapi/testapiProduction.props | 12 + .../testapi/testapiRelease.props | 12 + .../testapi/testapiReleaseCFLite.props | 12 + .../JavaScriptCore.xcodeproj/project.pbxproj | 5181 +- JavaScriptCore/KeywordLookupGenerator.py | 15 +- JavaScriptCore/PlatformBlackBerry.cmake | 10 +- JavaScriptCore/PlatformEfl.cmake | 25 +- JavaScriptCore/PlatformWinCE.cmake | 20 - JavaScriptCore/Target.pri | 256 - JavaScriptCore/assembler/ARM64Assembler.h | 3509 + JavaScriptCore/assembler/ARMAssembler.cpp | 200 +- JavaScriptCore/assembler/ARMAssembler.h | 778 +- JavaScriptCore/assembler/ARMv7Assembler.h | 492 +- .../assembler/AbstractMacroAssembler.h | 409 +- JavaScriptCore/assembler/AssemblerBuffer.h | 25 +- .../AssemblerBufferWithConstantPool.h | 82 +- JavaScriptCore/assembler/CodeLocation.h | 17 + JavaScriptCore/assembler/LinkBuffer.cpp | 272 + JavaScriptCore/assembler/LinkBuffer.h | 256 +- JavaScriptCore/assembler/MIPSAssembler.h | 327 +- .../MacroAssembler.cpp} | 20 +- JavaScriptCore/assembler/MacroAssembler.h | 664 +- .../assembler/MacroAssemblerARM.cpp | 96 +- JavaScriptCore/assembler/MacroAssemblerARM.h | 819 +- .../assembler/MacroAssemblerARM64.h | 2650 + .../assembler/MacroAssemblerARMv7.cpp | 102 + .../assembler/MacroAssemblerARMv7.h | 247 +- .../assembler/MacroAssemblerCodeRef.h | 58 +- JavaScriptCore/assembler/MacroAssemblerMIPS.h | 1083 +- JavaScriptCore/assembler/MacroAssemblerSH4.h | 1532 +- JavaScriptCore/assembler/MacroAssemblerX86.h | 139 +- .../assembler/MacroAssemblerX86Common.cpp | 83 + .../assembler/MacroAssemblerX86Common.h | 142 +- .../assembler/MacroAssemblerX86_64.h | 405 +- JavaScriptCore/assembler/RepatchBuffer.h | 60 +- JavaScriptCore/assembler/SH4Assembler.h | 384 +- JavaScriptCore/assembler/X86Assembler.h | 361 +- .../bytecode/ArrayAllocationProfile.cpp | 57 + .../bytecode/ArrayAllocationProfile.h | 81 + JavaScriptCore/bytecode/ArrayProfile.cpp | 152 + JavaScriptCore/bytecode/ArrayProfile.h | 205 + JavaScriptCore/bytecode/ByValInfo.h | 193 + JavaScriptCore/bytecode/BytecodeConventions.h | 2 +- JavaScriptCore/bytecode/CallLinkInfo.cpp | 11 +- JavaScriptCore/bytecode/CallLinkInfo.h | 23 +- JavaScriptCore/bytecode/CallLinkStatus.cpp | 105 +- JavaScriptCore/bytecode/CallLinkStatus.h | 84 +- JavaScriptCore/bytecode/CodeBlock.cpp | 3378 +- JavaScriptCore/bytecode/CodeBlock.h | 2292 +- JavaScriptCore/bytecode/CodeBlockHash.cpp | 68 + JavaScriptCore/bytecode/CodeBlockHash.h | 81 + .../CodeBlockJettisoningWatchpoint.cpp | 48 + .../bytecode/CodeBlockJettisoningWatchpoint.h | 57 + .../bytecode/CodeBlockWithJITType.h | 56 + JavaScriptCore/bytecode/CodeOrigin.cpp | 129 + JavaScriptCore/bytecode/CodeOrigin.h | 156 +- JavaScriptCore/bytecode/CodeType.cpp | 52 + JavaScriptCore/bytecode/CodeType.h | 22 +- JavaScriptCore/bytecode/DFGExitProfile.cpp | 36 +- JavaScriptCore/bytecode/DFGExitProfile.h | 92 +- JavaScriptCore/bytecode/DataFormat.h | 112 +- .../bytecode/DeferredCompilationCallback.cpp | 35 + .../bytecode/DeferredCompilationCallback.h | 50 + JavaScriptCore/bytecode/EvalCodeCache.h | 30 +- JavaScriptCore/bytecode/ExecutionCounter.cpp | 25 +- JavaScriptCore/bytecode/ExecutionCounter.h | 19 +- JavaScriptCore/bytecode/ExitKind.cpp | 116 + JavaScriptCore/bytecode/ExitKind.h | 82 + JavaScriptCore/bytecode/ExpressionRangeInfo.h | 71 +- JavaScriptCore/bytecode/GetByIdStatus.cpp | 223 +- JavaScriptCore/bytecode/GetByIdStatus.h | 43 +- .../bytecode/InlineCallFrameSet.cpp | 40 + JavaScriptCore/bytecode/InlineCallFrameSet.h | 56 + JavaScriptCore/bytecode/Instruction.h | 247 +- JavaScriptCore/bytecode/JumpTable.h | 21 +- .../bytecode/LazyOperandValueProfile.cpp | 36 +- .../bytecode/LazyOperandValueProfile.h | 42 +- .../bytecode/MethodCallLinkStatus.h | 87 - .../bytecode/MethodOfGettingAValueProfile.cpp | 18 +- .../bytecode/MethodOfGettingAValueProfile.h | 2 +- .../bytecode/ObjectAllocationProfile.h | 142 + JavaScriptCore/bytecode/Opcode.cpp | 24 +- JavaScriptCore/bytecode/Opcode.h | 410 +- JavaScriptCore/bytecode/Operands.h | 176 +- JavaScriptCore/bytecode/OperandsInlines.h | 53 + .../bytecode/PolymorphicAccessStructureList.h | 139 + .../bytecode/PolymorphicPutByIdList.cpp | 6 +- .../bytecode/PolymorphicPutByIdList.h | 27 +- .../bytecode/PreciseJumpTargets.cpp | 122 + .../PreciseJumpTargets.h} | 19 +- JavaScriptCore/bytecode/PredictedType.cpp | 283 - JavaScriptCore/bytecode/PredictedType.h | 259 - ...ProfiledCodeBlockJettisoningWatchpoint.cpp | 56 + .../ProfiledCodeBlockJettisoningWatchpoint.h | 65 + JavaScriptCore/bytecode/PutByIdStatus.cpp | 182 +- JavaScriptCore/bytecode/PutByIdStatus.h | 43 +- JavaScriptCore/bytecode/ReduceWhitespace.cpp | 54 + JavaScriptCore/bytecode/ReduceWhitespace.h | 38 + JavaScriptCore/bytecode/SamplingTool.cpp | 72 +- JavaScriptCore/bytecode/SamplingTool.h | 38 +- JavaScriptCore/bytecode/SpecialPointer.cpp | 45 + JavaScriptCore/bytecode/SpecialPointer.h | 62 + JavaScriptCore/bytecode/SpeculatedType.cpp | 395 + JavaScriptCore/bytecode/SpeculatedType.h | 387 + JavaScriptCore/bytecode/StructureSet.h | 60 +- .../StructureStubClearingWatchpoint.cpp | 80 + .../StructureStubClearingWatchpoint.h | 109 + JavaScriptCore/bytecode/StructureStubInfo.cpp | 15 +- JavaScriptCore/bytecode/StructureStubInfo.h | 487 +- JavaScriptCore/bytecode/UnlinkedCodeBlock.cpp | 393 + JavaScriptCore/bytecode/UnlinkedCodeBlock.h | 695 + JavaScriptCore/bytecode/ValueProfile.h | 43 +- JavaScriptCore/bytecode/ValueRecovery.cpp | 135 + JavaScriptCore/bytecode/ValueRecovery.h | 206 +- JavaScriptCore/bytecode/VirtualRegister.h | 73 +- JavaScriptCore/bytecode/Watchpoint.cpp | 108 + JavaScriptCore/bytecode/Watchpoint.h | 227 + .../bytecompiler/BytecodeGenerator.cpp | 1607 +- .../bytecompiler/BytecodeGenerator.h | 387 +- JavaScriptCore/bytecompiler/Label.h | 8 + JavaScriptCore/bytecompiler/LabelScope.h | 67 +- JavaScriptCore/bytecompiler/NodesCodegen.cpp | 1490 +- JavaScriptCore/bytecompiler/RegisterID.h | 26 +- .../bytecompiler/StaticPropertyAnalysis.h | 67 + .../bytecompiler/StaticPropertyAnalyzer.h | 170 + JavaScriptCore/config.h | 31 +- JavaScriptCore/create_hash_table | 18 +- JavaScriptCore/create_jit_stubs | 36 +- JavaScriptCore/create_regex_tables | 8 +- JavaScriptCore/debugger/Debugger.cpp | 76 +- JavaScriptCore/debugger/Debugger.h | 88 +- .../debugger/DebuggerActivation.cpp | 44 +- JavaScriptCore/debugger/DebuggerActivation.h | 58 +- JavaScriptCore/debugger/DebuggerCallFrame.cpp | 168 +- JavaScriptCore/debugger/DebuggerCallFrame.h | 69 +- JavaScriptCore/dfg/DFGAbstractHeap.cpp | 71 + JavaScriptCore/dfg/DFGAbstractHeap.h | 312 + JavaScriptCore/dfg/DFGAbstractInterpreter.h | 193 + .../dfg/DFGAbstractInterpreterInlines.h | 1724 + JavaScriptCore/dfg/DFGAbstractState.cpp | 1219 - JavaScriptCore/dfg/DFGAbstractValue.cpp | 280 + JavaScriptCore/dfg/DFGAbstractValue.h | 635 +- JavaScriptCore/dfg/DFGAdjacencyList.h | 61 +- JavaScriptCore/dfg/DFGAllocator.h | 241 + JavaScriptCore/dfg/DFGAnalysis.h | 75 + JavaScriptCore/dfg/DFGArgumentPosition.h | 89 +- .../dfg/DFGArgumentsSimplificationPhase.cpp | 862 + .../dfg/DFGArgumentsSimplificationPhase.h | 49 + JavaScriptCore/dfg/DFGArrayMode.cpp | 583 + JavaScriptCore/dfg/DFGArrayMode.h | 485 + .../dfg/DFGArrayifySlowPathGenerator.h | 167 + JavaScriptCore/dfg/DFGAtTailAbstractState.cpp | 57 + JavaScriptCore/dfg/DFGAtTailAbstractState.h | 75 + .../dfg/DFGBackwardsPropagationPhase.cpp | 404 + ...Phase.h => DFGBackwardsPropagationPhase.h} | 16 +- JavaScriptCore/dfg/DFGBasicBlock.cpp | 124 + JavaScriptCore/dfg/DFGBasicBlock.h | 138 +- JavaScriptCore/dfg/DFGBasicBlockInlines.h | 61 + JavaScriptCore/dfg/DFGBinarySwitch.cpp | 196 + JavaScriptCore/dfg/DFGBinarySwitch.h | 142 + JavaScriptCore/dfg/DFGBlockInsertionSet.cpp | 102 + JavaScriptCore/dfg/DFGBlockInsertionSet.h | 63 + .../DFGBranchDirection.h} | 91 +- JavaScriptCore/dfg/DFGByteCodeCache.h | 185 - JavaScriptCore/dfg/DFGByteCodeParser.cpp | 3548 +- JavaScriptCore/dfg/DFGByteCodeParser.h | 6 +- JavaScriptCore/dfg/DFGCCallHelpers.h | 573 - JavaScriptCore/dfg/DFGCFAPhase.cpp | 112 +- JavaScriptCore/dfg/DFGCFAPhase.h | 2 +- .../dfg/DFGCFGSimplificationPhase.cpp | 431 + .../dfg/DFGCFGSimplificationPhase.h | 52 + JavaScriptCore/dfg/DFGCPSRethreadingPhase.cpp | 497 + JavaScriptCore/dfg/DFGCPSRethreadingPhase.h | 50 + JavaScriptCore/dfg/DFGCSEPhase.cpp | 1437 +- JavaScriptCore/dfg/DFGCSEPhase.h | 6 +- .../DFGCallArrayAllocatorSlowPathGenerator.h | 128 + JavaScriptCore/dfg/DFGCapabilities.cpp | 218 +- JavaScriptCore/dfg/DFGCapabilities.h | 240 +- JavaScriptCore/dfg/DFGClobberSet.cpp | 162 + JavaScriptCore/dfg/DFGClobberSet.h | 125 + JavaScriptCore/dfg/DFGClobberize.cpp | 54 + JavaScriptCore/dfg/DFGClobberize.h | 702 + JavaScriptCore/dfg/DFGCommon.cpp | 111 + JavaScriptCore/dfg/DFGCommon.h | 300 +- JavaScriptCore/dfg/DFGCommonData.cpp | 78 + JavaScriptCore/dfg/DFGCommonData.h | 110 + JavaScriptCore/dfg/DFGCompilationKey.cpp | 44 + JavaScriptCore/dfg/DFGCompilationKey.h | 110 + JavaScriptCore/dfg/DFGCompilationMode.cpp | 54 + JavaScriptCore/dfg/DFGCompilationMode.h | 49 + .../dfg/DFGConstantFoldingPhase.cpp | 431 + JavaScriptCore/dfg/DFGConstantFoldingPhase.h | 48 + JavaScriptCore/dfg/DFGCorrectableJumpPoint.h | 159 - .../dfg/DFGCriticalEdgeBreakingPhase.cpp | 98 + .../dfg/DFGCriticalEdgeBreakingPhase.h | 47 + JavaScriptCore/dfg/DFGDCEPhase.cpp | 244 + JavaScriptCore/dfg/DFGDCEPhase.h | 49 + JavaScriptCore/dfg/DFGDesiredIdentifiers.cpp | 77 + JavaScriptCore/dfg/DFGDesiredIdentifiers.h | 67 + .../dfg/DFGDesiredStructureChains.cpp | 56 +- .../dfg/DFGDesiredStructureChains.h | 54 +- JavaScriptCore/dfg/DFGDesiredTransitions.cpp | 75 + JavaScriptCore/dfg/DFGDesiredTransitions.h | 73 + JavaScriptCore/dfg/DFGDesiredWatchpoints.cpp | 70 + JavaScriptCore/dfg/DFGDesiredWatchpoints.h | 217 + .../dfg/DFGDesiredWeakReferences.cpp | 61 + JavaScriptCore/dfg/DFGDesiredWeakReferences.h | 60 + .../dfg/DFGDesiredWriteBarriers.cpp | 87 + JavaScriptCore/dfg/DFGDesiredWriteBarriers.h | 102 + JavaScriptCore/dfg/DFGDisassembler.cpp | 174 + JavaScriptCore/dfg/DFGDisassembler.h | 104 + JavaScriptCore/dfg/DFGDominators.cpp | 134 + JavaScriptCore/dfg/DFGDominators.h | 73 + JavaScriptCore/dfg/DFGDoubleFormatState.h | 4 +- JavaScriptCore/dfg/DFGDriver.cpp | 129 +- JavaScriptCore/dfg/DFGDriver.h | 24 +- JavaScriptCore/dfg/DFGEdge.cpp | 50 + JavaScriptCore/dfg/DFGEdge.h | 173 +- JavaScriptCore/dfg/DFGEdgeDominates.h | 79 + JavaScriptCore/dfg/DFGEdgeUsesStructure.h | 67 + JavaScriptCore/dfg/DFGFPRInfo.h | 167 - ...leJumpPoint.cpp => DFGFailedFinalizer.cpp} | 26 +- JavaScriptCore/dfg/DFGFailedFinalizer.h | 51 + JavaScriptCore/dfg/DFGFiltrationResult.h | 45 + JavaScriptCore/dfg/DFGFinalizer.cpp | 47 + JavaScriptCore/dfg/DFGFinalizer.h | 61 + JavaScriptCore/dfg/DFGFixupPhase.cpp | 1778 +- JavaScriptCore/dfg/DFGFixupPhase.h | 2 +- JavaScriptCore/dfg/DFGFlushFormat.cpp | 66 + JavaScriptCore/dfg/DFGFlushFormat.h | 130 + .../dfg/DFGFlushLivenessAnalysisPhase.cpp | 208 + .../dfg/DFGFlushLivenessAnalysisPhase.h | 48 + JavaScriptCore/dfg/DFGFlushedAt.cpp | 48 + JavaScriptCore/dfg/DFGFlushedAt.h | 81 + JavaScriptCore/dfg/DFGGenerationInfo.h | 251 +- JavaScriptCore/dfg/DFGGraph.cpp | 726 +- JavaScriptCore/dfg/DFGGraph.h | 862 +- .../dfg/DFGInPlaceAbstractState.cpp | 470 + ...tractState.h => DFGInPlaceAbstractState.h} | 134 +- JavaScriptCore/dfg/DFGInlineCacheWrapper.h | 59 + .../dfg/DFGInlineCacheWrapperInlines.h | 48 + JavaScriptCore/dfg/DFGInsertionSet.h | 66 +- .../DFGInvalidationPointInjectionPhase.cpp | 114 + .../dfg/DFGInvalidationPointInjectionPhase.h | 47 + JavaScriptCore/dfg/DFGJITCode.cpp | 184 + JavaScriptCore/dfg/DFGJITCode.h | 135 + JavaScriptCore/dfg/DFGJITCompiler.cpp | 419 +- JavaScriptCore/dfg/DFGJITCompiler.h | 357 +- JavaScriptCore/dfg/DFGJITFinalizer.cpp | 83 + JavaScriptCore/dfg/DFGJITFinalizer.h | 61 + JavaScriptCore/dfg/DFGJumpReplacement.cpp | 46 + JavaScriptCore/dfg/DFGJumpReplacement.h | 55 + JavaScriptCore/dfg/DFGLICMPhase.cpp | 278 + JavaScriptCore/dfg/DFGLICMPhase.h | 48 + JavaScriptCore/dfg/DFGLazyJSValue.cpp | 142 + JavaScriptCore/dfg/DFGLazyJSValue.h | 133 + .../dfg/DFGLivenessAnalysisPhase.cpp | 166 + JavaScriptCore/dfg/DFGLivenessAnalysisPhase.h | 48 + JavaScriptCore/dfg/DFGLongLivedState.cpp | 49 + JavaScriptCore/dfg/DFGLongLivedState.h | 55 + .../dfg/DFGLoopPreHeaderCreationPhase.cpp | 117 + .../dfg/DFGLoopPreHeaderCreationPhase.h | 61 + JavaScriptCore/dfg/DFGMergeMode.h | 47 + JavaScriptCore/dfg/DFGMinifiedGraph.h | 70 + JavaScriptCore/dfg/DFGMinifiedID.h | 110 + JavaScriptCore/dfg/DFGMinifiedNode.cpp | 57 + JavaScriptCore/dfg/DFGMinifiedNode.h | 135 + JavaScriptCore/dfg/DFGNaturalLoops.cpp | 218 + JavaScriptCore/dfg/DFGNaturalLoops.h | 174 + JavaScriptCore/dfg/DFGNode.cpp | 97 + JavaScriptCore/dfg/DFGNode.h | 1030 +- JavaScriptCore/dfg/DFGNodeAllocator.h | 51 + JavaScriptCore/dfg/DFGNodeFlags.cpp | 118 +- JavaScriptCore/dfg/DFGNodeFlags.h | 91 +- JavaScriptCore/dfg/DFGNodeType.h | 272 +- .../dfg/DFGOSRAvailabilityAnalysisPhase.cpp | 135 + .../dfg/DFGOSRAvailabilityAnalysisPhase.h | 50 + JavaScriptCore/dfg/DFGOSREntry.cpp | 151 +- JavaScriptCore/dfg/DFGOSREntry.h | 18 +- .../dfg/DFGOSREntrypointCreationPhase.cpp | 151 + .../dfg/DFGOSREntrypointCreationPhase.h | 54 + JavaScriptCore/dfg/DFGOSRExit.cpp | 81 +- JavaScriptCore/dfg/DFGOSRExit.h | 80 +- JavaScriptCore/dfg/DFGOSRExitBase.cpp | 87 + .../dfg/{DFGRepatch.h => DFGOSRExitBase.h} | 66 +- .../dfg/DFGOSRExitCompilationInfo.h | 50 + JavaScriptCore/dfg/DFGOSRExitCompiler.cpp | 145 +- JavaScriptCore/dfg/DFGOSRExitCompiler.h | 13 +- .../dfg/DFGOSRExitCompiler32_64.cpp | 881 +- JavaScriptCore/dfg/DFGOSRExitCompiler64.cpp | 816 +- .../dfg/DFGOSRExitCompilerCommon.cpp | 188 + JavaScriptCore/dfg/DFGOSRExitCompilerCommon.h | 47 + .../dfg/DFGOSRExitJumpPlaceholder.cpp | 51 + .../dfg/DFGOSRExitJumpPlaceholder.h | 71 + JavaScriptCore/dfg/DFGOSRExitPreparation.cpp | 61 + JavaScriptCore/dfg/DFGOSRExitPreparation.h | 53 + JavaScriptCore/dfg/DFGOperations.cpp | 1665 +- JavaScriptCore/dfg/DFGOperations.h | 329 +- JavaScriptCore/dfg/DFGPhase.cpp | 15 +- JavaScriptCore/dfg/DFGPhase.h | 24 +- JavaScriptCore/dfg/DFGPlan.cpp | 367 + JavaScriptCore/dfg/DFGPlan.h | 113 + .../dfg/DFGPredictionInjectionPhase.cpp | 103 + .../dfg/DFGPredictionInjectionPhase.h | 48 + .../dfg/DFGPredictionPropagationPhase.cpp | 891 +- .../dfg/DFGPredictionPropagationPhase.h | 7 +- .../dfg/DFGRedundantPhiEliminationPhase.cpp | 176 - JavaScriptCore/dfg/DFGRegisterBank.h | 68 +- JavaScriptCore/dfg/DFGRepatch.cpp | 917 - JavaScriptCore/dfg/DFGSSAConversionPhase.cpp | 453 + JavaScriptCore/dfg/DFGSSAConversionPhase.h | 103 + JavaScriptCore/dfg/DFGSafeToExecute.h | 293 + .../DFGSaneStringGetByValSlowPathGenerator.h | 97 + JavaScriptCore/dfg/DFGScoreBoard.h | 69 +- .../dfg/DFGSilentRegisterSavePlan.h | 131 + JavaScriptCore/dfg/DFGSlowPathGenerator.h | 496 + JavaScriptCore/dfg/DFGSpeculativeJIT.cpp | 7632 +- JavaScriptCore/dfg/DFGSpeculativeJIT.h | 2836 +- JavaScriptCore/dfg/DFGSpeculativeJIT32_64.cpp | 4883 +- JavaScriptCore/dfg/DFGSpeculativeJIT64.cpp | 5268 +- JavaScriptCore/dfg/DFGStackLayoutPhase.cpp | 271 + JavaScriptCore/dfg/DFGStackLayoutPhase.h | 47 + .../dfg/DFGStructureAbstractValue.h | 344 + JavaScriptCore/dfg/DFGThunks.cpp | 47 +- JavaScriptCore/dfg/DFGThunks.h | 4 +- .../dfg/DFGTierUpCheckInjectionPhase.cpp | 101 + .../dfg/DFGTierUpCheckInjectionPhase.h | 47 + .../DFGToFTLDeferredCompilationCallback.cpp | 91 + .../dfg/DFGToFTLDeferredCompilationCallback.h | 65 + ...ForOSREntryDeferredCompilationCallback.cpp | 87 + ...TLForOSREntryDeferredCompilationCallback.h | 65 + .../dfg/DFGTypeCheckHoistingPhase.cpp | 622 + .../dfg/DFGTypeCheckHoistingPhase.h | 50 + JavaScriptCore/dfg/DFGUnificationPhase.cpp | 94 + JavaScriptCore/dfg/DFGUnificationPhase.h | 49 + JavaScriptCore/dfg/DFGUseKind.cpp | 107 + JavaScriptCore/dfg/DFGUseKind.h | 195 + JavaScriptCore/dfg/DFGValidate.cpp | 488 + JavaScriptCore/dfg/DFGValidate.h | 47 + JavaScriptCore/dfg/DFGValueRecoveryOverride.h | 57 + JavaScriptCore/dfg/DFGValueSource.cpp | 75 + JavaScriptCore/dfg/DFGValueSource.h | 228 + JavaScriptCore/dfg/DFGVariableAccessData.h | 236 +- .../dfg/DFGVariableAccessDataDump.cpp | 78 + .../dfg/DFGVariableAccessDataDump.h | 56 + JavaScriptCore/dfg/DFGVariableEvent.cpp | 93 + JavaScriptCore/dfg/DFGVariableEvent.h | 281 + JavaScriptCore/dfg/DFGVariableEventStream.cpp | 290 + JavaScriptCore/dfg/DFGVariableEventStream.h | 66 + JavaScriptCore/dfg/DFGVariadicFunction.h | 57 + .../dfg/DFGVirtualRegisterAllocationPhase.cpp | 110 +- .../dfg/DFGVirtualRegisterAllocationPhase.h | 2 +- .../dfg/DFGWatchpointCollectionPhase.cpp | 198 + .../dfg/DFGWatchpointCollectionPhase.h | 46 + JavaScriptCore/dfg/DFGWorklist.cpp | 289 + JavaScriptCore/dfg/DFGWorklist.h | 108 + .../disassembler/ARM64/A64DOpcode.cpp | 1132 + .../disassembler/ARM64/A64DOpcode.h | 692 + .../disassembler/ARM64Disassembler.cpp | 57 + .../disassembler/ARMv7/ARMv7DOpcode.cpp | 1565 + .../disassembler/ARMv7/ARMv7DOpcode.h | 1142 + .../disassembler/ARMv7Disassembler.cpp | 55 + JavaScriptCore/disassembler/Disassembler.cpp | 43 + JavaScriptCore/disassembler/Disassembler.h | 54 + .../disassembler/LLVMDisassembler.cpp | 131 + .../disassembler/LLVMDisassembler.h | 46 + .../disassembler/UDis86Disassembler.cpp | 63 + .../disassembler/UDis86Disassembler.h | 46 + .../disassembler/X86Disassembler.cpp | 73 + .../disassembler/udis86/differences.txt | 24 + JavaScriptCore/disassembler/udis86/itab.py | 360 + .../disassembler/udis86/optable.xml | 8959 ++ .../disassembler/udis86/ud_opcode.py | 235 + .../disassembler/udis86/ud_optable.py | 103 + JavaScriptCore/disassembler/udis86/udis86.c | 182 + JavaScriptCore/disassembler/udis86/udis86.h | 33 + .../disassembler/udis86/udis86_decode.c | 1141 + .../disassembler/udis86/udis86_decode.h | 258 + .../disassembler/udis86/udis86_extern.h | 88 + .../disassembler/udis86/udis86_input.c | 262 + .../disassembler/udis86/udis86_input.h | 67 + .../disassembler/udis86/udis86_itab_holder.c | 33 + .../disassembler/udis86/udis86_syn-att.c | 263 + .../disassembler/udis86/udis86_syn-intel.c | 278 + .../disassembler/udis86/udis86_syn.c | 86 + .../disassembler/udis86/udis86_syn.h | 47 + .../disassembler/udis86/udis86_types.h | 238 + JavaScriptCore/ftl/FTLAbbreviatedTypes.h | 53 + JavaScriptCore/ftl/FTLAbbreviations.h | 294 + JavaScriptCore/ftl/FTLAbstractHeap.cpp | 201 + JavaScriptCore/ftl/FTLAbstractHeap.h | 234 + .../ftl/FTLAbstractHeapRepository.cpp | 73 + .../ftl/FTLAbstractHeapRepository.h | 114 + JavaScriptCore/ftl/FTLCArgumentGetter.cpp | 85 + JavaScriptCore/ftl/FTLCArgumentGetter.h | 151 + JavaScriptCore/ftl/FTLCapabilities.cpp | 307 + JavaScriptCore/ftl/FTLCapabilities.h | 50 + JavaScriptCore/ftl/FTLCommonValues.cpp | 72 + JavaScriptCore/ftl/FTLCommonValues.h | 86 + JavaScriptCore/ftl/FTLCompile.cpp | 357 + JavaScriptCore/ftl/FTLCompile.h | 44 + JavaScriptCore/ftl/FTLExitArgument.cpp | 41 + JavaScriptCore/ftl/FTLExitArgument.h | 93 + .../ftl/FTLExitArgumentForOperand.cpp | 41 + .../ftl/FTLExitArgumentForOperand.h | 74 + JavaScriptCore/ftl/FTLExitArgumentList.h | 45 + JavaScriptCore/ftl/FTLExitThunkGenerator.cpp | 72 + JavaScriptCore/ftl/FTLExitThunkGenerator.h | 60 + JavaScriptCore/ftl/FTLExitValue.cpp | 75 + JavaScriptCore/ftl/FTLExitValue.h | 206 + JavaScriptCore/ftl/FTLFail.cpp | 50 + JavaScriptCore/ftl/FTLFail.h | 44 + JavaScriptCore/ftl/FTLForOSREntryJITCode.cpp | 54 + JavaScriptCore/ftl/FTLForOSREntryJITCode.h | 73 + JavaScriptCore/ftl/FTLFormattedValue.h | 85 + JavaScriptCore/ftl/FTLGeneratedFunction.h | 37 + JavaScriptCore/ftl/FTLInlineCacheDescriptor.h | 74 + JavaScriptCore/ftl/FTLInlineCacheSize.cpp | 72 + JavaScriptCore/ftl/FTLInlineCacheSize.h | 41 + JavaScriptCore/ftl/FTLIntrinsicRepository.cpp | 65 + JavaScriptCore/ftl/FTLIntrinsicRepository.h | 118 + JavaScriptCore/ftl/FTLJITCode.cpp | 129 + JavaScriptCore/ftl/FTLJITCode.h | 85 + JavaScriptCore/ftl/FTLJITFinalizer.cpp | 121 + JavaScriptCore/ftl/FTLJITFinalizer.h | 67 + JavaScriptCore/ftl/FTLLink.cpp | 189 + JavaScriptCore/ftl/FTLLink.h | 44 + JavaScriptCore/ftl/FTLLocation.cpp | 217 + JavaScriptCore/ftl/FTLLocation.h | 210 + JavaScriptCore/ftl/FTLLowerDFGToLLVM.cpp | 3772 + JavaScriptCore/ftl/FTLLowerDFGToLLVM.h | 45 + JavaScriptCore/ftl/FTLLoweredNodeValue.h | 78 + JavaScriptCore/ftl/FTLOSREntry.cpp | 100 + JavaScriptCore/ftl/FTLOSREntry.h | 49 + JavaScriptCore/ftl/FTLOSRExit.cpp | 104 + JavaScriptCore/ftl/FTLOSRExit.h | 182 + .../ftl/FTLOSRExitCompilationInfo.h | 55 + JavaScriptCore/ftl/FTLOSRExitCompiler.cpp | 379 + JavaScriptCore/ftl/FTLOSRExitCompiler.h | 48 + JavaScriptCore/ftl/FTLOutput.cpp | 51 + JavaScriptCore/ftl/FTLOutput.h | 411 + JavaScriptCore/ftl/FTLSaveRestore.cpp | 102 + JavaScriptCore/ftl/FTLSaveRestore.h | 59 + JavaScriptCore/ftl/FTLSlowPathCall.cpp | 169 + JavaScriptCore/ftl/FTLSlowPathCall.h | 68 + JavaScriptCore/ftl/FTLSlowPathCallKey.cpp | 41 + JavaScriptCore/ftl/FTLSlowPathCallKey.h | 126 + JavaScriptCore/ftl/FTLStackMaps.cpp | 184 + JavaScriptCore/ftl/FTLStackMaps.h | 105 + JavaScriptCore/ftl/FTLState.cpp | 82 + JavaScriptCore/ftl/FTLState.h | 73 + JavaScriptCore/ftl/FTLSwitchCase.h | 58 + JavaScriptCore/ftl/FTLThunks.cpp | 211 + JavaScriptCore/ftl/FTLThunks.h | 85 + JavaScriptCore/ftl/FTLTypedPointer.h | 71 + JavaScriptCore/ftl/FTLValueFormat.cpp | 134 + JavaScriptCore/ftl/FTLValueFormat.h | 70 + JavaScriptCore/ftl/FTLValueFromBlock.h | 64 + JavaScriptCore/ftl/FTLValueSource.cpp | 70 + JavaScriptCore/ftl/FTLValueSource.h | 110 + JavaScriptCore/gyp/JavaScriptCore.gyp | 227 - .../gyp/generate-derived-sources.sh | 9 - JavaScriptCore/gyp/generate-dtrace-header.sh | 9 - JavaScriptCore/gyp/gtk.gyp | 18 - JavaScriptCore/gyp/run-if-exists.sh | 5 - JavaScriptCore/gyp/update-info-plist.sh | 4 - JavaScriptCore/heap/BlockAllocator.cpp | 109 +- JavaScriptCore/heap/BlockAllocator.h | 251 +- JavaScriptCore/heap/CardSet.h | 91 - JavaScriptCore/heap/CodeBlockSet.cpp | 109 + JavaScriptCore/heap/CodeBlockSet.h | 78 + JavaScriptCore/heap/ConservativeRoots.cpp | 64 +- JavaScriptCore/heap/ConservativeRoots.h | 8 +- JavaScriptCore/heap/CopiedAllocator.h | 114 +- JavaScriptCore/heap/CopiedBlock.h | 234 +- JavaScriptCore/heap/CopiedBlockInlines.h | 58 + JavaScriptCore/heap/CopiedSpace.cpp | 244 +- JavaScriptCore/heap/CopiedSpace.h | 54 +- .../heap/CopiedSpaceInlineMethods.h | 172 - JavaScriptCore/heap/CopiedSpaceInlines.h | 179 + JavaScriptCore/heap/CopyToken.h | 40 + .../JSGlobalThis.cpp => heap/CopyVisitor.cpp} | 54 +- JavaScriptCore/heap/CopyVisitor.h | 62 + JavaScriptCore/heap/CopyVisitorInlines.h | 106 + JavaScriptCore/heap/CopyWorkList.h | 190 + JavaScriptCore/heap/DFGCodeBlocks.cpp | 106 - JavaScriptCore/heap/DFGCodeBlocks.h | 99 - JavaScriptCore/heap/DeferGC.cpp | 35 + JavaScriptCore/heap/DeferGC.h | 101 + JavaScriptCore/heap/GCAssertions.h | 20 +- JavaScriptCore/heap/GCIncomingRefCounted.h | 115 + .../heap/GCIncomingRefCountedInlines.h | 130 + JavaScriptCore/heap/GCIncomingRefCountedSet.h | 59 + .../heap/GCIncomingRefCountedSetInlines.h | 92 + JavaScriptCore/heap/GCThread.cpp | 138 + JavaScriptCore/heap/GCThread.h | 63 + JavaScriptCore/heap/GCThreadSharedData.cpp | 204 + JavaScriptCore/heap/GCThreadSharedData.h | 124 + JavaScriptCore/heap/Handle.h | 9 +- JavaScriptCore/heap/HandleBlock.h | 73 + JavaScriptCore/heap/HandleBlockInlines.h | 74 + JavaScriptCore/heap/HandleSet.cpp | 36 +- JavaScriptCore/heap/HandleSet.h | 108 +- JavaScriptCore/heap/HandleStack.cpp | 2 +- JavaScriptCore/heap/HandleStack.h | 2 - JavaScriptCore/heap/HandleTypes.h | 2 +- JavaScriptCore/heap/Heap.cpp | 704 +- JavaScriptCore/heap/Heap.h | 273 +- JavaScriptCore/heap/HeapBlock.h | 38 +- JavaScriptCore/heap/HeapIterationScope.h | 58 + JavaScriptCore/heap/HeapOperation.h | 35 + JavaScriptCore/heap/HeapRootVisitor.h | 1 + JavaScriptCore/heap/HeapStatistics.cpp | 257 + JavaScriptCore/heap/HeapStatistics.h | 61 + JavaScriptCore/heap/HeapTimer.cpp | 181 + JavaScriptCore/heap/HeapTimer.h | 88 + JavaScriptCore/heap/IncrementalSweeper.cpp | 177 + JavaScriptCore/heap/IncrementalSweeper.h | 68 + JavaScriptCore/heap/JITStubRoutineSet.cpp | 126 + JavaScriptCore/heap/JITStubRoutineSet.h | 100 + JavaScriptCore/heap/ListableHandler.h | 12 +- JavaScriptCore/heap/Local.h | 24 +- JavaScriptCore/heap/LocalScope.h | 8 +- JavaScriptCore/heap/MachineStackMarker.cpp | 65 +- JavaScriptCore/heap/MachineStackMarker.h | 12 +- JavaScriptCore/heap/MarkStack.cpp | 533 +- JavaScriptCore/heap/MarkStack.h | 466 +- JavaScriptCore/heap/MarkStackInlines.h | 119 + JavaScriptCore/heap/MarkedAllocator.cpp | 95 +- JavaScriptCore/heap/MarkedAllocator.h | 94 +- JavaScriptCore/heap/MarkedBlock.cpp | 150 +- JavaScriptCore/heap/MarkedBlock.h | 320 +- JavaScriptCore/heap/MarkedSpace.cpp | 287 +- JavaScriptCore/heap/MarkedSpace.h | 175 +- JavaScriptCore/heap/PassWeak.h | 223 - JavaScriptCore/heap/Region.h | 319 + JavaScriptCore/heap/SlotVisitor.cpp | 374 + JavaScriptCore/heap/SlotVisitor.h | 154 +- JavaScriptCore/heap/SlotVisitorInlines.h | 247 + JavaScriptCore/heap/Strong.h | 17 +- JavaScriptCore/heap/StrongInlines.h | 14 +- JavaScriptCore/heap/SuperRegion.cpp | 82 + JavaScriptCore/heap/SuperRegion.h | 58 + JavaScriptCore/heap/VTableSpectrum.cpp | 3 +- JavaScriptCore/heap/Weak.cpp | 41 + JavaScriptCore/heap/Weak.h | 166 +- JavaScriptCore/heap/WeakBlock.cpp | 40 +- JavaScriptCore/heap/WeakBlock.h | 49 +- JavaScriptCore/heap/WeakImpl.h | 4 +- JavaScriptCore/heap/WeakInlines.h | 171 + JavaScriptCore/heap/WeakSet.cpp | 56 +- JavaScriptCore/heap/WeakSet.h | 79 +- JavaScriptCore/heap/WeakSetInlines.h | 14 +- JavaScriptCore/icu/unicode/localpointer.h | 300 + JavaScriptCore/icu/unicode/parseerr.h | 6 +- JavaScriptCore/icu/unicode/platform.h | 310 +- JavaScriptCore/icu/unicode/ptypes.h | 92 + JavaScriptCore/icu/unicode/putil.h | 19 +- JavaScriptCore/icu/unicode/uchar.h | 742 +- JavaScriptCore/icu/unicode/ucnv.h | 290 +- JavaScriptCore/icu/unicode/ucnv_err.h | 25 +- JavaScriptCore/icu/unicode/ucol.h | 344 +- JavaScriptCore/icu/unicode/uconfig.h | 55 +- JavaScriptCore/icu/unicode/uenum.h | 47 +- JavaScriptCore/icu/unicode/uiter.h | 10 +- JavaScriptCore/icu/unicode/uloc.h | 305 +- JavaScriptCore/icu/unicode/umachine.h | 109 +- JavaScriptCore/icu/unicode/unorm.h | 38 +- JavaScriptCore/icu/unicode/unorm2.h | 391 + JavaScriptCore/icu/unicode/urename.h | 3625 +- JavaScriptCore/icu/unicode/uscript.h | 156 +- JavaScriptCore/icu/unicode/uset.h | 471 +- JavaScriptCore/icu/unicode/ustring.h | 428 +- JavaScriptCore/icu/unicode/utf.h | 31 +- JavaScriptCore/icu/unicode/utf16.h | 33 +- JavaScriptCore/icu/unicode/utf8.h | 118 +- JavaScriptCore/icu/unicode/utypes.h | 168 +- JavaScriptCore/icu/unicode/uvernum.h | 138 + JavaScriptCore/icu/unicode/uversion.h | 215 +- JavaScriptCore/interpreter/AbstractPC.cpp | 17 +- JavaScriptCore/interpreter/AbstractPC.h | 19 +- JavaScriptCore/interpreter/CachedCall.h | 4 +- JavaScriptCore/interpreter/CallFrame.cpp | 166 +- JavaScriptCore/interpreter/CallFrame.h | 327 +- JavaScriptCore/interpreter/CallFrameClosure.h | 13 +- JavaScriptCore/interpreter/CallFrameInlines.h | 143 + JavaScriptCore/interpreter/Interpreter.cpp | 5493 +- JavaScriptCore/interpreter/Interpreter.h | 239 +- JavaScriptCore/interpreter/JSStack.cpp | 151 + JavaScriptCore/interpreter/JSStack.h | 183 + JavaScriptCore/interpreter/JSStackInlines.h | 233 + JavaScriptCore/interpreter/Register.h | 67 +- JavaScriptCore/interpreter/RegisterFile.cpp | 107 - JavaScriptCore/interpreter/RegisterFile.h | 123 - JavaScriptCore/interpreter/StackVisitor.cpp | 474 + JavaScriptCore/interpreter/StackVisitor.h | 150 + JavaScriptCore/interpreter/VMInspector.cpp | 573 + JavaScriptCore/interpreter/VMInspector.h | 89 + .../AssemblyHelpers.cpp} | 51 +- .../AssemblyHelpers.h} | 314 +- JavaScriptCore/jit/CCallHelpers.h | 1500 + JavaScriptCore/jit/ClosureCallStubRoutine.cpp | 63 + JavaScriptCore/jit/ClosureCallStubRoutine.h | 66 + JavaScriptCore/jit/CompactJITCodeMap.h | 3 +- JavaScriptCore/jit/ExecutableAllocator.cpp | 29 +- JavaScriptCore/jit/ExecutableAllocator.h | 129 +- .../jit/ExecutableAllocatorFixedVMPool.cpp | 60 +- JavaScriptCore/jit/FPRInfo.h | 406 + JavaScriptCore/jit/GCAwareJITStubRoutine.cpp | 128 + JavaScriptCore/jit/GCAwareJITStubRoutine.h | 127 + .../{dfg/DFGGPRInfo.h => jit/GPRInfo.h} | 357 +- JavaScriptCore/jit/HostCallReturnValue.cpp | 6 +- JavaScriptCore/jit/HostCallReturnValue.h | 22 +- JavaScriptCore/jit/JIT.cpp | 544 +- JavaScriptCore/jit/JIT.h | 772 +- JavaScriptCore/jit/JITArithmetic.cpp | 533 +- JavaScriptCore/jit/JITArithmetic32_64.cpp | 364 +- JavaScriptCore/jit/JITCall.cpp | 226 +- JavaScriptCore/jit/JITCall32_64.cpp | 175 +- JavaScriptCore/jit/JITCode.cpp | 172 + JavaScriptCore/jit/JITCode.h | 303 +- JavaScriptCore/jit/JITDisassembler.cpp | 168 + JavaScriptCore/jit/JITDisassembler.h | 92 + JavaScriptCore/jit/JITDriver.h | 120 - JavaScriptCore/jit/JITExceptions.cpp | 36 +- JavaScriptCore/jit/JITExceptions.h | 21 +- .../jit/JITInlineCacheGenerator.cpp | 174 + JavaScriptCore/jit/JITInlineCacheGenerator.h | 130 + JavaScriptCore/jit/JITInlineMethods.h | 1071 - JavaScriptCore/jit/JITInlines.h | 1252 + JavaScriptCore/jit/JITOpcodes.cpp | 1281 +- JavaScriptCore/jit/JITOpcodes32_64.cpp | 1117 +- JavaScriptCore/jit/JITOperationWrappers.h | 413 + JavaScriptCore/jit/JITOperations.cpp | 1816 + JavaScriptCore/jit/JITOperations.h | 283 + JavaScriptCore/jit/JITPropertyAccess.cpp | 1718 +- JavaScriptCore/jit/JITPropertyAccess32_64.cpp | 1401 +- JavaScriptCore/jit/JITStubCall.h | 275 - .../JITStubRoutine.cpp} | 22 +- JavaScriptCore/jit/JITStubRoutine.h | 164 + JavaScriptCore/jit/JITStubs.cpp | 3435 +- JavaScriptCore/jit/JITStubs.h | 450 +- JavaScriptCore/jit/JITStubsARM.h | 450 + JavaScriptCore/jit/JITStubsARM64.h | 141 + JavaScriptCore/jit/JITStubsARMv7.h | 516 + JavaScriptCore/jit/JITStubsMIPS.h | 179 + JavaScriptCore/jit/JITStubsMSVC64.asm | 88 + JavaScriptCore/jit/JITStubsSH4.h | 125 + JavaScriptCore/jit/JITStubsX86.h | 284 + JavaScriptCore/jit/JITStubsX86Common.h | 148 + JavaScriptCore/jit/JITStubsX86_64.h | 264 + JavaScriptCore/jit/JITThunks.cpp | 116 + JavaScriptCore/jit/JITThunks.h | 82 + .../JITToDFGDeferredCompilationCallback.cpp | 71 + .../jit/JITToDFGDeferredCompilationCallback.h | 58 + JavaScriptCore/jit/JITWriteBarrier.h | 24 +- JavaScriptCore/jit/JSInterfaceJIT.h | 214 +- JavaScriptCore/jit/RegisterSet.cpp | 105 + JavaScriptCore/jit/RegisterSet.h | 136 + JavaScriptCore/jit/Repatch.cpp | 1442 + JavaScriptCore/jit/Repatch.h | 69 + JavaScriptCore/jit/ScratchRegisterAllocator.h | 198 + JavaScriptCore/jit/SlowPathCall.h | 99 + JavaScriptCore/jit/SpecializedThunkJIT.h | 70 +- JavaScriptCore/jit/TempRegisterSet.cpp | 51 + JavaScriptCore/jit/TempRegisterSet.h | 210 + JavaScriptCore/jit/ThunkGenerator.h | 44 + JavaScriptCore/jit/ThunkGenerators.cpp | 870 +- JavaScriptCore/jit/ThunkGenerators.h | 53 +- JavaScriptCore/jit/UnusedPointer.h | 37 + JavaScriptCore/jsc.cpp | 486 +- JavaScriptCore/jsc.pro | 37 - JavaScriptCore/llint/LLIntCLoop.cpp | 76 + .../{LLIntEntrypoints.h => LLIntCLoop.h} | 47 +- JavaScriptCore/llint/LLIntCommon.h | 11 +- JavaScriptCore/llint/LLIntData.cpp | 114 +- JavaScriptCore/llint/LLIntData.h | 98 +- JavaScriptCore/llint/LLIntEntrypoint.cpp | 124 + JavaScriptCore/llint/LLIntEntrypoint.h | 48 + JavaScriptCore/llint/LLIntEntrypoints.cpp | 88 - JavaScriptCore/llint/LLIntExceptions.cpp | 41 +- JavaScriptCore/llint/LLIntExceptions.h | 17 +- JavaScriptCore/llint/LLIntOfflineAsmConfig.h | 78 +- .../llint/LLIntOffsetsExtractor.cpp | 12 +- JavaScriptCore/llint/LLIntOpcode.h | 81 + JavaScriptCore/llint/LLIntSlowPaths.cpp | 1077 +- JavaScriptCore/llint/LLIntSlowPaths.h | 224 +- JavaScriptCore/llint/LLIntThunks.cpp | 38 +- JavaScriptCore/llint/LLIntThunks.h | 14 +- JavaScriptCore/llint/LowLevelInterpreter.asm | 368 +- JavaScriptCore/llint/LowLevelInterpreter.cpp | 514 + JavaScriptCore/llint/LowLevelInterpreter.h | 39 +- .../llint/LowLevelInterpreter32_64.asm | 1283 +- .../llint/LowLevelInterpreter64.asm | 1765 +- JavaScriptCore/llvm/InitializeLLVM.cpp | 59 + JavaScriptCore/llvm/InitializeLLVM.h | 44 + JavaScriptCore/llvm/InitializeLLVMMac.mm | 57 + JavaScriptCore/llvm/InitializeLLVMPOSIX.cpp | 53 + JavaScriptCore/llvm/InitializeLLVMPOSIX.h | 42 + .../llvm/LLVMAPI.cpp | 18 +- JavaScriptCore/llvm/LLVMAPI.h | 52 + JavaScriptCore/llvm/LLVMAPIFunctions.h | 637 + JavaScriptCore/llvm/LLVMHeaders.h | 64 + JavaScriptCore/llvm/library/LLVMAnchor.cpp | 35 + JavaScriptCore/llvm/library/LLVMExports.cpp | 51 + JavaScriptCore/llvm/library/LLVMOverrides.cpp | 33 + JavaScriptCore/llvm/library/config_llvm.h | 28 + JavaScriptCore/offlineasm/arm.rb | 587 + JavaScriptCore/offlineasm/arm64.rb | 791 + JavaScriptCore/offlineasm/armv7.rb | 1006 - JavaScriptCore/offlineasm/asm.rb | 132 +- JavaScriptCore/offlineasm/ast.rb | 43 +- JavaScriptCore/offlineasm/backends.rb | 32 +- JavaScriptCore/offlineasm/cloop.rb | 1123 + JavaScriptCore/offlineasm/config.rb | 57 + .../offlineasm/generate_offset_extractor.rb | 5 +- JavaScriptCore/offlineasm/instructions.rb | 112 +- JavaScriptCore/offlineasm/mips.rb | 894 + JavaScriptCore/offlineasm/offsets.rb | 27 +- JavaScriptCore/offlineasm/opt.rb | 1 + JavaScriptCore/offlineasm/parser.rb | 79 +- JavaScriptCore/offlineasm/registers.rb | 2 + JavaScriptCore/offlineasm/risc.rb | 730 + JavaScriptCore/offlineasm/self_hash.rb | 1 + JavaScriptCore/offlineasm/settings.rb | 1 + JavaScriptCore/offlineasm/sh4.rb | 916 + JavaScriptCore/offlineasm/transform.rb | 15 + JavaScriptCore/offlineasm/x86.rb | 501 +- JavaScriptCore/os-win32/WinMain.cpp | 81 - JavaScriptCore/os-win32/inttypes.h | 5 - JavaScriptCore/os-win32/stdint.h | 67 - JavaScriptCore/parser/ASTBuilder.h | 735 +- JavaScriptCore/parser/Lexer.cpp | 401 +- JavaScriptCore/parser/Lexer.h | 154 +- JavaScriptCore/parser/NodeConstructors.h | 664 +- JavaScriptCore/parser/Nodes.cpp | 97 +- JavaScriptCore/parser/Nodes.h | 988 +- JavaScriptCore/parser/Parser.cpp | 1480 +- JavaScriptCore/parser/Parser.h | 633 +- JavaScriptCore/parser/ParserArena.h | 28 +- JavaScriptCore/parser/ParserError.h | 110 + JavaScriptCore/parser/ParserModes.h | 56 + JavaScriptCore/parser/ParserTokens.h | 73 +- JavaScriptCore/parser/ResultType.h | 20 +- JavaScriptCore/parser/SourceCode.cpp | 42 + JavaScriptCore/parser/SourceCode.h | 57 +- JavaScriptCore/parser/SourceProvider.cpp | 57 + JavaScriptCore/parser/SourceProvider.h | 73 +- JavaScriptCore/parser/SourceProviderCache.cpp | 11 +- JavaScriptCore/parser/SourceProviderCache.h | 12 +- .../parser/SourceProviderCacheItem.h | 114 +- JavaScriptCore/parser/SyntaxChecker.h | 190 +- JavaScriptCore/profiler/CallIdentifier.h | 10 +- .../{Profiler.cpp => LegacyProfiler.cpp} | 65 +- .../profiler/{Profiler.h => LegacyProfiler.h} | 65 +- JavaScriptCore/profiler/Profile.cpp | 20 +- JavaScriptCore/profiler/Profile.h | 10 +- JavaScriptCore/profiler/ProfileGenerator.cpp | 67 +- JavaScriptCore/profiler/ProfileGenerator.h | 7 +- JavaScriptCore/profiler/ProfileNode.cpp | 20 +- JavaScriptCore/profiler/ProfileNode.h | 16 +- JavaScriptCore/profiler/ProfilerBytecode.cpp | 45 + JavaScriptCore/profiler/ProfilerBytecode.h | 65 + .../profiler/ProfilerBytecodeSequence.cpp | 91 + .../profiler/ProfilerBytecodeSequence.h | 65 + .../ProfilerBytecodes.cpp} | 65 +- JavaScriptCore/profiler/ProfilerBytecodes.h | 63 + .../profiler/ProfilerCompilation.cpp | 134 + JavaScriptCore/profiler/ProfilerCompilation.h | 88 + .../profiler/ProfilerCompilationKind.cpp | 52 + .../profiler/ProfilerCompilationKind.h | 47 + .../profiler/ProfilerCompiledBytecode.cpp | 56 + .../profiler/ProfilerCompiledBytecode.h | 55 + JavaScriptCore/profiler/ProfilerDatabase.cpp | 186 + JavaScriptCore/profiler/ProfilerDatabase.h | 108 + .../profiler/ProfilerExecutionCounter.h | 50 + JavaScriptCore/profiler/ProfilerOSRExit.cpp | 60 + JavaScriptCore/profiler/ProfilerOSRExit.h | 61 + .../profiler/ProfilerOSRExitSite.cpp | 46 + JavaScriptCore/profiler/ProfilerOSRExitSite.h | 52 + JavaScriptCore/profiler/ProfilerOrigin.cpp | 57 + JavaScriptCore/profiler/ProfilerOrigin.h | 120 + .../profiler/ProfilerOriginStack.cpp | 111 + JavaScriptCore/profiler/ProfilerOriginStack.h | 102 + .../profiler/ProfilerProfiledBytecodes.cpp | 56 + .../profiler/ProfilerProfiledBytecodes.h | 51 + JavaScriptCore/runtime/ArgList.cpp | 10 +- JavaScriptCore/runtime/ArgList.h | 280 +- JavaScriptCore/runtime/Arguments.cpp | 330 +- JavaScriptCore/runtime/Arguments.h | 371 +- JavaScriptCore/runtime/ArrayBuffer.cpp | 63 + .../runtime}/ArrayBuffer.h | 82 +- .../runtime}/ArrayBufferView.cpp | 34 +- .../runtime}/ArrayBufferView.h | 110 +- JavaScriptCore/runtime/ArrayConstructor.cpp | 49 +- JavaScriptCore/runtime/ArrayConstructor.h | 52 +- JavaScriptCore/runtime/ArrayConventions.h | 108 + .../runtime/ArrayIteratorConstructor.cpp | 42 + .../runtime/ArrayIteratorConstructor.h | 63 + .../runtime/ArrayIteratorPrototype.cpp | 55 + .../runtime/ArrayIteratorPrototype.h | 61 + JavaScriptCore/runtime/ArrayPrototype.cpp | 492 +- JavaScriptCore/runtime/ArrayPrototype.h | 40 +- JavaScriptCore/runtime/ArrayStorage.h | 102 + .../runtime/BatchedTransitionOptimizer.h | 38 +- JavaScriptCore/runtime/BigInteger.h | 2 +- JavaScriptCore/runtime/BooleanConstructor.cpp | 24 +- JavaScriptCore/runtime/BooleanConstructor.h | 48 +- JavaScriptCore/runtime/BooleanObject.cpp | 16 +- JavaScriptCore/runtime/BooleanObject.h | 52 +- JavaScriptCore/runtime/BooleanPrototype.cpp | 38 +- JavaScriptCore/runtime/BooleanPrototype.h | 46 +- JavaScriptCore/runtime/Butterfly.h | 175 + JavaScriptCore/runtime/ButterflyInlines.h | 216 + .../runtime/CachedTranscendentalFunction.h | 6 +- JavaScriptCore/runtime/CallData.cpp | 2 +- JavaScriptCore/runtime/CallData.h | 44 +- JavaScriptCore/runtime/ClassInfo.h | 213 +- JavaScriptCore/runtime/CodeCache.cpp | 160 + JavaScriptCore/runtime/CodeCache.h | 263 + .../runtime/CodeSpecializationKind.cpp | 47 + .../runtime/CodeSpecializationKind.h | 17 + JavaScriptCore/runtime/CommonIdentifiers.cpp | 25 +- JavaScriptCore/runtime/CommonIdentifiers.h | 90 +- JavaScriptCore/runtime/CommonSlowPaths.cpp | 483 + JavaScriptCore/runtime/CommonSlowPaths.h | 267 +- .../runtime/CommonSlowPathsExceptions.cpp | 46 + .../runtime/CommonSlowPathsExceptions.h | 44 + JavaScriptCore/runtime/CompilationResult.cpp | 53 + JavaScriptCore/runtime/CompilationResult.h | 71 + JavaScriptCore/runtime/Completion.cpp | 30 +- JavaScriptCore/runtime/Completion.h | 11 +- JavaScriptCore/runtime/ConcurrentJITLock.h | 123 + JavaScriptCore/runtime/ConstructData.cpp | 1 + JavaScriptCore/runtime/ConstructData.h | 6 +- JavaScriptCore/runtime/DataView.cpp | 60 + JavaScriptCore/runtime/DataView.h | 102 + JavaScriptCore/runtime/DateConstructor.cpp | 105 +- JavaScriptCore/runtime/DateConstructor.h | 20 +- JavaScriptCore/runtime/DateConversion.cpp | 182 +- JavaScriptCore/runtime/DateConversion.h | 81 +- JavaScriptCore/runtime/DateInstance.cpp | 38 +- JavaScriptCore/runtime/DateInstance.h | 30 +- JavaScriptCore/runtime/DateInstanceCache.h | 6 +- JavaScriptCore/runtime/DatePrototype.cpp | 421 +- JavaScriptCore/runtime/DatePrototype.h | 20 +- JavaScriptCore/runtime/DumpContext.cpp | 45 + JavaScriptCore/runtime/DumpContext.h | 48 + JavaScriptCore/runtime/Error.cpp | 79 +- JavaScriptCore/runtime/Error.h | 53 +- JavaScriptCore/runtime/ErrorConstructor.cpp | 35 +- JavaScriptCore/runtime/ErrorConstructor.h | 16 +- JavaScriptCore/runtime/ErrorInstance.cpp | 20 +- JavaScriptCore/runtime/ErrorInstance.h | 28 +- JavaScriptCore/runtime/ErrorPrototype.cpp | 35 +- JavaScriptCore/runtime/ErrorPrototype.h | 19 +- JavaScriptCore/runtime/ExceptionHelpers.cpp | 125 +- JavaScriptCore/runtime/ExceptionHelpers.h | 57 +- JavaScriptCore/runtime/Executable.cpp | 828 +- JavaScriptCore/runtime/Executable.h | 1138 +- JavaScriptCore/runtime/ExecutionHarness.h | 72 - JavaScriptCore/runtime/Float32Array.h | 34 + JavaScriptCore/runtime/Float64Array.h | 34 + .../runtime/FunctionConstructor.cpp | 51 +- JavaScriptCore/runtime/FunctionConstructor.h | 20 +- .../runtime/FunctionExecutableDump.cpp | 49 + .../runtime/FunctionExecutableDump.h | 49 + JavaScriptCore/runtime/FunctionPrototype.cpp | 57 +- JavaScriptCore/runtime/FunctionPrototype.h | 16 +- JavaScriptCore/runtime/GCActivityCallback.cpp | 139 +- JavaScriptCore/runtime/GCActivityCallback.h | 63 +- .../runtime/GCActivityCallbackBlackBerry.cpp | 58 + .../runtime/GCActivityCallbackCF.cpp | 190 - .../runtime/GenericTypedArrayView.h | 118 + .../runtime/GenericTypedArrayViewInlines.h | 110 + JavaScriptCore/runtime/GetterSetter.cpp | 45 +- JavaScriptCore/runtime/GetterSetter.h | 22 +- JavaScriptCore/runtime/Identifier.cpp | 151 +- JavaScriptCore/runtime/Identifier.h | 94 +- JavaScriptCore/runtime/IndexingHeader.h | 135 + .../runtime/IndexingHeaderInlines.h | 64 + JavaScriptCore/runtime/IndexingType.cpp | 126 + JavaScriptCore/runtime/IndexingType.h | 159 + .../runtime/InitializeThreading.cpp | 17 +- JavaScriptCore/runtime/Int16Array.h | 34 + JavaScriptCore/runtime/Int32Array.h | 34 + JavaScriptCore/runtime/Int8Array.h | 34 + .../runtime}/IntegralTypedArrayBase.h | 23 +- .../runtime/IntendedStructureChain.cpp | 141 + .../runtime/IntendedStructureChain.h | 70 + JavaScriptCore/runtime/InternalFunction.cpp | 36 +- JavaScriptCore/runtime/InternalFunction.h | 24 +- JavaScriptCore/runtime/Intrinsic.h | 5 + JavaScriptCore/runtime/JSAPIValueWrapper.cpp | 3 +- JavaScriptCore/runtime/JSAPIValueWrapper.h | 21 +- JavaScriptCore/runtime/JSActivation.cpp | 209 +- JavaScriptCore/runtime/JSActivation.h | 172 +- JavaScriptCore/runtime/JSArray.cpp | 2271 +- JavaScriptCore/runtime/JSArray.h | 621 +- JavaScriptCore/runtime/JSArrayBuffer.cpp | 129 + JavaScriptCore/runtime/JSArrayBuffer.h | 76 + .../runtime/JSArrayBufferConstructor.cpp | 112 + .../runtime/JSArrayBufferConstructor.h | 58 + .../runtime/JSArrayBufferPrototype.cpp | 105 + .../runtime/JSArrayBufferPrototype.h | 52 + JavaScriptCore/runtime/JSArrayBufferView.cpp | 221 + JavaScriptCore/runtime/JSArrayBufferView.h | 189 + .../runtime/JSArrayBufferViewInlines.h | 81 + JavaScriptCore/runtime/JSArrayIterator.cpp | 168 + JavaScriptCore/runtime/JSArrayIterator.h | 93 + JavaScriptCore/runtime/JSBoundFunction.cpp | 57 +- JavaScriptCore/runtime/JSBoundFunction.h | 16 +- .../runtime/{JSValue.cpp => JSCJSValue.cpp} | 149 +- JavaScriptCore/runtime/JSCJSValue.h | 517 + JavaScriptCore/runtime/JSCJSValueInlines.h | 857 + JavaScriptCore/runtime/JSCell.cpp | 111 +- JavaScriptCore/runtime/JSCell.h | 477 +- JavaScriptCore/runtime/JSCellInlines.h | 202 + JavaScriptCore/runtime/JSDataView.cpp | 121 + JavaScriptCore/runtime/JSDataView.h | 77 + .../runtime/JSDataViewPrototype.cpp | 249 + JavaScriptCore/runtime/JSDataViewPrototype.h | 56 + JavaScriptCore/runtime/JSDateMath.cpp | 136 +- JavaScriptCore/runtime/JSDateMath.h | 95 +- JavaScriptCore/runtime/JSDestructibleObject.h | 45 + JavaScriptCore/runtime/JSExportMacros.h | 6 +- JavaScriptCore/runtime/JSFloat32Array.h | 32 + JavaScriptCore/runtime/JSFloat64Array.h | 32 + JavaScriptCore/runtime/JSFunction.cpp | 354 +- JavaScriptCore/runtime/JSFunction.h | 122 +- JavaScriptCore/runtime/JSFunctionInlines.h | 69 + .../runtime/JSGenericTypedArrayView.h | 270 + .../JSGenericTypedArrayViewConstructor.h | 58 + ...SGenericTypedArrayViewConstructorInlines.h | 165 + .../runtime/JSGenericTypedArrayViewInlines.h | 555 + .../JSGenericTypedArrayViewPrototype.h | 54 + .../JSGenericTypedArrayViewPrototypeInlines.h | 168 + JavaScriptCore/runtime/JSGlobalData.cpp | 503 - JavaScriptCore/runtime/JSGlobalObject.cpp | 794 +- JavaScriptCore/runtime/JSGlobalObject.h | 919 +- .../runtime/JSGlobalObjectFunctions.cpp | 154 +- .../runtime/JSGlobalObjectFunctions.h | 58 +- JavaScriptCore/runtime/JSInt16Array.h | 32 + JavaScriptCore/runtime/JSInt32Array.h | 32 + JavaScriptCore/runtime/JSInt8Array.h | 32 + JavaScriptCore/runtime/JSLock.cpp | 298 +- JavaScriptCore/runtime/JSLock.h | 57 +- JavaScriptCore/runtime/JSMap.cpp | 51 + JavaScriptCore/runtime/JSMap.h | 77 + JavaScriptCore/runtime/JSNameScope.cpp | 83 + JavaScriptCore/runtime/JSNameScope.h | 90 + JavaScriptCore/runtime/JSNotAnObject.cpp | 19 +- JavaScriptCore/runtime/JSNotAnObject.h | 27 +- JavaScriptCore/runtime/JSONObject.cpp | 283 +- JavaScriptCore/runtime/JSONObject.h | 24 +- JavaScriptCore/runtime/JSObject.cpp | 2301 +- JavaScriptCore/runtime/JSObject.h | 1669 +- JavaScriptCore/runtime/JSPromise.cpp | 245 + JavaScriptCore/runtime/JSPromise.h | 96 + JavaScriptCore/runtime/JSPromiseCallback.cpp | 196 + JavaScriptCore/runtime/JSPromiseCallback.h | 93 + .../runtime/JSPromiseConstructor.cpp | 187 + JavaScriptCore/runtime/JSPromiseConstructor.h | 61 + JavaScriptCore/runtime/JSPromisePrototype.cpp | 185 + JavaScriptCore/runtime/JSPromisePrototype.h | 57 + JavaScriptCore/runtime/JSPromiseResolver.cpp | 203 + JavaScriptCore/runtime/JSPromiseResolver.h | 78 + .../runtime/JSPromiseResolverConstructor.cpp | 78 + .../runtime/JSPromiseResolverConstructor.h | 60 + .../runtime/JSPromiseResolverPrototype.cpp | 124 + .../runtime/JSPromiseResolverPrototype.h | 57 + .../runtime/JSPropertyNameIterator.cpp | 31 +- .../runtime/JSPropertyNameIterator.h | 52 +- JavaScriptCore/runtime/JSProxy.cpp | 127 + JavaScriptCore/runtime/JSProxy.h | 93 + JavaScriptCore/runtime/JSScope.cpp | 164 + JavaScriptCore/runtime/JSScope.h | 255 + ...hecker.h => JSSegmentedVariableObject.cpp} | 85 +- .../runtime/JSSegmentedVariableObject.h | 101 + JavaScriptCore/runtime/JSSet.cpp | 50 + JavaScriptCore/runtime/JSSet.h | 78 + .../runtime/JSStaticScopeObject.cpp | 95 - JavaScriptCore/runtime/JSStaticScopeObject.h | 84 - JavaScriptCore/runtime/JSString.cpp | 98 +- JavaScriptCore/runtime/JSString.h | 388 +- JavaScriptCore/runtime/JSStringBuilder.h | 11 +- JavaScriptCore/runtime/JSStringJoiner.cpp | 32 +- JavaScriptCore/runtime/JSStringJoiner.h | 27 +- .../runtime/JSSymbolTableObject.cpp | 75 + JavaScriptCore/runtime/JSSymbolTableObject.h | 178 + JavaScriptCore/runtime/JSType.h | 13 +- JavaScriptCore/runtime/JSTypeInfo.h | 19 +- .../runtime/JSTypedArrayConstructors.cpp | 50 + .../runtime/JSTypedArrayConstructors.h | 48 + .../runtime/JSTypedArrayPrototypes.cpp | 48 + .../runtime/JSTypedArrayPrototypes.h | 46 + JavaScriptCore/runtime/JSTypedArrays.cpp | 54 + JavaScriptCore/runtime/JSTypedArrays.h | 48 + JavaScriptCore/runtime/JSUint16Array.h | 32 + JavaScriptCore/runtime/JSUint32Array.h | 32 + JavaScriptCore/runtime/JSUint8Array.h | 32 + JavaScriptCore/runtime/JSUint8ClampedArray.h | 32 + JavaScriptCore/runtime/JSValue.h | 483 - JavaScriptCore/runtime/JSValueInlineMethods.h | 499 - JavaScriptCore/runtime/JSVariableObject.cpp | 66 +- JavaScriptCore/runtime/JSVariableObject.h | 139 +- JavaScriptCore/runtime/JSWeakMap.cpp | 50 + .../runtime/{JSGlobalThis.h => JSWeakMap.h} | 63 +- JavaScriptCore/runtime/JSWithScope.cpp | 46 + JavaScriptCore/runtime/JSWithScope.h | 91 + JavaScriptCore/runtime/JSWrapperObject.cpp | 13 +- JavaScriptCore/runtime/JSWrapperObject.h | 40 +- JavaScriptCore/runtime/LiteralParser.cpp | 155 +- JavaScriptCore/runtime/LiteralParser.h | 16 +- JavaScriptCore/runtime/Lookup.cpp | 25 +- JavaScriptCore/runtime/Lookup.h | 148 +- JavaScriptCore/runtime/MapConstructor.cpp | 73 + JavaScriptCore/runtime/MapConstructor.h | 65 + JavaScriptCore/runtime/MapData.cpp | 254 + JavaScriptCore/runtime/MapData.h | 220 + JavaScriptCore/runtime/MapPrototype.cpp | 169 + JavaScriptCore/runtime/MapPrototype.h | 61 + JavaScriptCore/runtime/MathObject.cpp | 513 +- JavaScriptCore/runtime/MathObject.h | 18 +- JavaScriptCore/runtime/MemoryStatistics.cpp | 8 +- JavaScriptCore/runtime/MemoryStatistics.h | 2 +- JavaScriptCore/runtime/NameConstructor.cpp | 69 + JavaScriptCore/runtime/NameConstructor.h | 65 + JavaScriptCore/runtime/NameInstance.cpp | 47 + JavaScriptCore/runtime/NameInstance.h | 77 + JavaScriptCore/runtime/NamePrototype.cpp | 81 + JavaScriptCore/runtime/NamePrototype.h | 64 + .../runtime/NativeErrorConstructor.cpp | 36 +- .../runtime/NativeErrorConstructor.h | 28 +- .../runtime/NativeErrorPrototype.cpp | 18 +- JavaScriptCore/runtime/NativeErrorPrototype.h | 10 +- JavaScriptCore/runtime/NumberConstructor.cpp | 58 +- JavaScriptCore/runtime/NumberConstructor.h | 21 +- JavaScriptCore/runtime/NumberObject.cpp | 18 +- JavaScriptCore/runtime/NumberObject.h | 18 +- JavaScriptCore/runtime/NumberPrototype.cpp | 86 +- JavaScriptCore/runtime/NumberPrototype.h | 19 +- JavaScriptCore/runtime/NumericStrings.h | 22 +- JavaScriptCore/runtime/ObjectConstructor.cpp | 173 +- JavaScriptCore/runtime/ObjectConstructor.h | 45 +- JavaScriptCore/runtime/ObjectPrototype.cpp | 148 +- JavaScriptCore/runtime/ObjectPrototype.h | 27 +- JavaScriptCore/runtime/Operations.cpp | 30 +- JavaScriptCore/runtime/Operations.h | 557 +- JavaScriptCore/runtime/Options.cpp | 334 +- JavaScriptCore/runtime/Options.h | 280 +- JavaScriptCore/runtime/PrivateName.h | 53 + JavaScriptCore/runtime/PropertyDescriptor.cpp | 12 +- JavaScriptCore/runtime/PropertyDescriptor.h | 12 +- JavaScriptCore/runtime/PropertyMapHashTable.h | 168 +- JavaScriptCore/runtime/PropertyName.h | 149 + JavaScriptCore/runtime/PropertyNameArray.cpp | 2 +- JavaScriptCore/runtime/PropertyNameArray.h | 40 +- JavaScriptCore/runtime/PropertyOffset.h | 148 + JavaScriptCore/runtime/PropertySlot.cpp | 13 +- JavaScriptCore/runtime/PropertySlot.h | 410 +- .../{StorageBarrier.h => PropertyStorage.h} | 47 +- JavaScriptCore/runtime/PropertyTable.cpp | 148 + JavaScriptCore/runtime/Protect.h | 2 +- JavaScriptCore/runtime/PrototypeMap.cpp | 75 + JavaScriptCore/runtime/PrototypeMap.h | 65 + JavaScriptCore/runtime/PutDirectIndexMode.h | 36 + JavaScriptCore/runtime/PutPropertySlot.h | 16 +- JavaScriptCore/runtime/RegExp.cpp | 95 +- JavaScriptCore/runtime/RegExp.h | 40 +- JavaScriptCore/runtime/RegExpCache.cpp | 41 +- JavaScriptCore/runtime/RegExpCache.h | 12 +- JavaScriptCore/runtime/RegExpCachedResult.cpp | 18 +- JavaScriptCore/runtime/RegExpCachedResult.h | 14 +- JavaScriptCore/runtime/RegExpConstructor.cpp | 111 +- JavaScriptCore/runtime/RegExpConstructor.h | 39 +- JavaScriptCore/runtime/RegExpKey.h | 24 +- JavaScriptCore/runtime/RegExpMatchesArray.cpp | 43 +- JavaScriptCore/runtime/RegExpMatchesArray.h | 47 +- JavaScriptCore/runtime/RegExpObject.cpp | 144 +- JavaScriptCore/runtime/RegExpObject.h | 40 +- JavaScriptCore/runtime/RegExpPrototype.cpp | 41 +- JavaScriptCore/runtime/RegExpPrototype.h | 17 +- JavaScriptCore/runtime/Reject.h | 44 + JavaScriptCore/runtime/SamplingCounter.cpp | 6 +- JavaScriptCore/runtime/ScopeChain.cpp | 85 - JavaScriptCore/runtime/ScopeChain.h | 172 - JavaScriptCore/runtime/SetConstructor.cpp | 88 + JavaScriptCore/runtime/SetConstructor.h | 65 + JavaScriptCore/runtime/SetPrototype.cpp | 154 + JavaScriptCore/runtime/SetPrototype.h | 61 + .../SimpleTypedArrayController.cpp} | 37 +- .../runtime/SimpleTypedArrayController.h | 56 + JavaScriptCore/runtime/SmallStrings.cpp | 47 +- JavaScriptCore/runtime/SmallStrings.h | 37 +- .../runtime/SparseArrayValueMap.cpp | 187 + JavaScriptCore/runtime/SparseArrayValueMap.h | 139 + .../runtime/StrictEvalActivation.cpp | 17 +- JavaScriptCore/runtime/StrictEvalActivation.h | 20 +- JavaScriptCore/runtime/StringConstructor.cpp | 42 +- JavaScriptCore/runtime/StringConstructor.h | 21 +- JavaScriptCore/runtime/StringObject.cpp | 84 +- JavaScriptCore/runtime/StringObject.h | 45 +- JavaScriptCore/runtime/StringPrototype.cpp | 449 +- JavaScriptCore/runtime/StringPrototype.h | 25 +- .../runtime/StringRecursionChecker.cpp | 5 +- .../runtime/StringRecursionChecker.h | 16 +- JavaScriptCore/runtime/Structure.cpp | 844 +- JavaScriptCore/runtime/Structure.h | 736 +- JavaScriptCore/runtime/StructureChain.cpp | 11 +- JavaScriptCore/runtime/StructureChain.h | 29 +- JavaScriptCore/runtime/StructureInlines.h | 252 + JavaScriptCore/runtime/StructureRareData.cpp | 84 + JavaScriptCore/runtime/StructureRareData.h | 76 + .../runtime/StructureRareDataInlines.h | 60 + .../runtime/StructureTransitionTable.h | 84 +- JavaScriptCore/runtime/SymbolTable.cpp | 105 + JavaScriptCore/runtime/SymbolTable.h | 494 +- JavaScriptCore/runtime/TestRunnerUtils.cpp | 95 + JavaScriptCore/runtime/TestRunnerUtils.h | 41 + JavaScriptCore/runtime/TimeoutChecker.cpp | 142 - JavaScriptCore/runtime/ToNativeFromValue.h | 54 + JavaScriptCore/runtime/TypedArrayAdaptors.h | 220 + .../runtime}/TypedArrayBase.h | 32 +- .../runtime/TypedArrayController.cpp | 35 + JavaScriptCore/runtime/TypedArrayController.h | 49 + JavaScriptCore/runtime/TypedArrayInlines.h | 37 + JavaScriptCore/runtime/TypedArrayType.cpp | 143 + JavaScriptCore/runtime/TypedArrayType.h | 161 + JavaScriptCore/runtime/TypedArrays.h | 47 + JavaScriptCore/runtime/UString.cpp | 475 - JavaScriptCore/runtime/UString.h | 284 - JavaScriptCore/runtime/UStringConcatenate.h | 141 - JavaScriptCore/runtime/Uint16Array.h | 34 + JavaScriptCore/runtime/Uint16WithFraction.h | 2 +- JavaScriptCore/runtime/Uint32Array.h | 34 + JavaScriptCore/runtime/Uint8Array.h | 34 + JavaScriptCore/runtime/Uint8ClampedArray.h | 34 + JavaScriptCore/runtime/VM.cpp | 753 + .../runtime/{JSGlobalData.h => VM.h} | 395 +- JavaScriptCore/runtime/VMStackBounds.h | 71 + JavaScriptCore/runtime/Watchdog.cpp | 199 + JavaScriptCore/runtime/Watchdog.h | 116 + JavaScriptCore/runtime/WatchdogMac.cpp | 72 + JavaScriptCore/runtime/WatchdogNone.cpp | 50 + JavaScriptCore/runtime/WeakGCMap.h | 161 +- JavaScriptCore/runtime/WeakMapConstructor.cpp | 64 + JavaScriptCore/runtime/WeakMapConstructor.h | 65 + JavaScriptCore/runtime/WeakMapData.cpp | 144 + JavaScriptCore/runtime/WeakMapData.h | 91 + JavaScriptCore/runtime/WeakMapPrototype.cpp | 124 + JavaScriptCore/runtime/WeakMapPrototype.h | 61 + JavaScriptCore/runtime/WeakRandom.h | 3 + JavaScriptCore/runtime/WriteBarrier.h | 74 +- JavaScriptCore/shell/CMakeLists.txt | 39 +- JavaScriptCore/shell/PlatformBlackBerry.cmake | 11 +- JavaScriptCore/shell/PlatformEfl.cmake | 9 +- JavaScriptCore/shell/PlatformGTK.cmake | 3 + JavaScriptCore/shell/PlatformWinCE.cmake | 3 - JavaScriptCore/testRegExp.cpp | 92 +- JavaScriptCore/tests/mozilla/expected.html | 268 +- .../mozilla/js1_2/function/function-001-n.js | 2 +- .../mozilla/js1_2/function/tostring-1.js | 29 +- .../mozilla/js1_2/function/tostring-2.js | 57 +- .../mozilla/js1_3/Script/function-001-n.js | 2 +- .../mozilla/js1_3/regress/function-001-n.js | 2 +- .../mozilla/js1_4/Functions/function-001.js | 6 +- .../mozilla/js1_6/Array/regress-304828.js | 10 +- JavaScriptCore/tests/mozilla/jsDriver.pl | 54 +- .../tests/mozilla/mozilla-tests.yaml | 2255 + JavaScriptCore/tools/CodeProfile.cpp | 14 +- JavaScriptCore/tools/CodeProfile.h | 3 +- JavaScriptCore/tools/ProfileTreeNode.h | 22 +- JavaScriptCore/tools/TieredMMapArray.h | 3 +- JavaScriptCore/wscript | 93 - JavaScriptCore/yarr/YarrCanonicalizeUCS2.cpp | 34 +- JavaScriptCore/yarr/YarrCanonicalizeUCS2.h | 22 +- JavaScriptCore/yarr/YarrInterpreter.cpp | 76 +- JavaScriptCore/yarr/YarrInterpreter.h | 27 +- JavaScriptCore/yarr/YarrJIT.cpp | 123 +- JavaScriptCore/yarr/YarrJIT.h | 9 +- JavaScriptCore/yarr/YarrParser.h | 12 +- JavaScriptCore/yarr/YarrPattern.cpp | 96 +- JavaScriptCore/yarr/YarrPattern.h | 74 +- JavaScriptCore/yarr/YarrSyntaxChecker.cpp | 2 +- JavaScriptCore/yarr/YarrSyntaxChecker.h | 4 +- JavaScriptCore/yarr/yarr.pri | 18 - WTF/CMakeLists.txt | 2 +- WTF/ChangeLog | 4904 +- WTF/ChangeLog-2013-10-13 | 23837 +++++ WTF/Configurations/Base.xcconfig | 93 +- WTF/Configurations/CompilerVersion.xcconfig | 77 - WTF/Configurations/CopyWTFHeaders.xcconfig | 25 + WTF/Configurations/DebugRelease.xcconfig | 27 +- WTF/Configurations/WTF.xcconfig | 3 +- WTF/Configurations/iOS.xcconfig | 1 + WTF/GNUmakefile.am | 11 +- WTF/GNUmakefile.list.am | 126 +- WTF/WTF.gyp/.gitignore | 5 - WTF/WTF.gyp/WTF.gyp | 188 - WTF/WTF.gypi | 240 - WTF/WTF.pri | 52 - WTF/WTF.pro | 258 - WTF/WTF.vcproj/WTF.make | 16 - WTF/WTF.vcproj/WTF.sln | 49 - WTF/WTF.vcproj/WTF.vcproj | 1210 - WTF/WTF.vcproj/WTFCommon.vsprops | 20 - WTF/WTF.vcproj/WTFDebug.vsprops | 8 - WTF/WTF.vcproj/WTFDebugAll.vsprops | 8 - WTF/WTF.vcproj/WTFDebugCairoCFLite.vsprops | 8 - WTF/WTF.vcproj/WTFGenerated.make | 13 - WTF/WTF.vcproj/WTFGenerated.vcproj | 95 - WTF/WTF.vcproj/WTFGeneratedCommon.vsprops | 14 - WTF/WTF.vcproj/WTFGeneratedDebug.vsprops | 8 - WTF/WTF.vcproj/WTFGeneratedDebugAll.vsprops | 8 - .../WTFGeneratedDebugCairoCFLite.vsprops | 8 - WTF/WTF.vcproj/WTFGeneratedProduction.vsprops | 8 - WTF/WTF.vcproj/WTFGeneratedRelease.vsprops | 8 - .../WTFGeneratedReleaseCairoCFLite.vsprops | 8 - WTF/WTF.vcproj/WTFProduction.vsprops | 8 - WTF/WTF.vcproj/WTFRelease.vsprops | 8 - WTF/WTF.vcproj/WTFReleaseCairoCFLite.vsprops | 8 - WTF/WTF.vcxproj/WTF.make | 31 + WTF/WTF.vcxproj/WTF.submit.sln | 56 + WTF/WTF.vcxproj/WTF.vcxproj | 725 + WTF/WTF.vcxproj/WTF.vcxproj.filters | 674 + WTF/WTF.vcxproj/WTFCFLite.props | 12 + WTF/WTF.vcxproj/WTFCommon.props | 29 + WTF/WTF.vcxproj/WTFCoreFoundation.props | 10 + WTF/WTF.vcxproj/WTFDebug.props | 15 + WTF/WTF.vcxproj/WTFDebugWinCairo.props | 15 + WTF/WTF.vcxproj/WTFGenerated.make | 25 + WTF/WTF.vcxproj/WTFGenerated.vcxproj | 241 + WTF/WTF.vcxproj/WTFGenerated.vcxproj.filters | 9 + WTF/WTF.vcxproj/WTFGeneratedCommon.props | 22 + WTF/WTF.vcxproj/WTFGeneratedDebug.props | 13 + WTF/WTF.vcxproj/WTFGeneratedProduction.props | 13 + WTF/WTF.vcxproj/WTFGeneratedRelease.props | 12 + .../WTFPostBuild.cmd | 0 .../WTFPreBuild.cmd | 0 WTF/WTF.vcxproj/WTFProduction.props | 14 + WTF/WTF.vcxproj/WTFRelease.props | 14 + WTF/WTF.vcxproj/WTFReleaseWinCairo.props | 14 + .../build-generated-files.sh | 3 +- .../copy-files.cmd | 11 +- ...work-around-vs-dependency-tracking-bugs.py | 8 +- WTF/WTF.xcodeproj/project.pbxproj | 1283 +- WTF/config.h | 14 +- WTF/icu/unicode/bytestream.h | 252 + WTF/icu/unicode/localpointer.h | 300 + WTF/icu/unicode/parseerr.h | 6 +- WTF/icu/unicode/platform.h | 310 +- WTF/icu/unicode/ptypes.h | 92 + WTF/icu/unicode/putil.h | 19 +- WTF/icu/unicode/rep.h | 259 + WTF/icu/unicode/std_string.h | 78 + WTF/icu/unicode/strenum.h | 271 + WTF/icu/unicode/stringpiece.h | 224 + WTF/icu/unicode/uchar.h | 742 +- WTF/icu/unicode/ucnv.h | 290 +- WTF/icu/unicode/ucnv_err.h | 25 +- WTF/icu/unicode/ucol.h | 344 +- WTF/icu/unicode/uconfig.h | 55 +- WTF/icu/unicode/uenum.h | 47 +- WTF/icu/unicode/uiter.h | 10 +- WTF/icu/unicode/uloc.h | 305 +- WTF/icu/unicode/umachine.h | 109 +- WTF/icu/unicode/unistr.h | 4440 + WTF/icu/unicode/unorm.h | 38 +- WTF/icu/unicode/unorm2.h | 391 + WTF/icu/unicode/uobject.h | 352 + WTF/icu/unicode/urename.h | 3625 +- WTF/icu/unicode/uscript.h | 156 +- WTF/icu/unicode/uset.h | 471 +- WTF/icu/unicode/ustring.h | 428 +- WTF/icu/unicode/utf.h | 31 +- WTF/icu/unicode/utf16.h | 33 +- WTF/icu/unicode/utf8.h | 118 +- WTF/icu/unicode/utypes.h | 168 +- WTF/icu/unicode/uvernum.h | 138 + WTF/icu/unicode/uversion.h | 215 +- WTF/wscript | 66 - WTF/wtf/AVLTree.h | 4 +- WTF/wtf/Alignment.h | 63 - WTF/wtf/AlwaysInline.h | 23 - WTF/wtf/ArrayBuffer.cpp | 78 - WTF/wtf/Assertions.cpp | 175 +- WTF/wtf/Assertions.h | 202 +- WTF/wtf/Atomics.cpp | 110 + WTF/wtf/Atomics.h | 229 +- WTF/wtf/{PassTraits.h => AutodrainedPool.h} | 56 +- .../wtf/AutodrainedPoolMac.mm | 37 +- WTF/wtf/Bag.h | 109 + WTF/wtf/BagToHashMap.h | 50 + WTF/wtf/BitArray.h | 62 + WTF/wtf/BitVector.cpp | 80 +- WTF/wtf/BitVector.h | 111 +- WTF/wtf/Bitmap.h | 65 +- WTF/wtf/BloomFilter.h | 4 +- WTF/wtf/BoundsCheckedPointer.h | 1 - WTF/wtf/BumpPointerAllocator.h | 6 +- .../MainThreadChromium.cpp => ByteOrder.h} | 74 +- WTF/wtf/ByteSpinLock.h | 71 + WTF/wtf/CMakeLists.txt | 145 +- WTF/wtf/CheckedArithmetic.h | 72 +- WTF/wtf/CheckedBoolean.h | 15 +- WTF/wtf/CommaPrinter.h | 61 + WTF/wtf/CompilationThread.cpp | 67 + WTF/wtf/CompilationThread.h | 61 + WTF/wtf/Compiler.h | 183 +- WTF/wtf/Compression.cpp | 179 + WTF/wtf/Compression.h | 149 + WTF/wtf/CryptographicallyRandomNumber.cpp | 10 +- WTF/wtf/CryptographicallyRandomNumber.h | 4 - WTF/wtf/CurrentTime.cpp | 172 +- WTF/wtf/CurrentTime.h | 24 +- WTF/wtf/DataLog.cpp | 80 +- WTF/wtf/DataLog.h | 100 +- WTF/wtf/DateMath.cpp | 181 +- WTF/wtf/DateMath.h | 65 +- WTF/wtf/DecimalNumber.cpp | 8 +- WTF/wtf/DecimalNumber.h | 14 +- WTF/wtf/DeferrableRefCounted.h | 124 + WTF/wtf/Deque.h | 165 +- WTF/wtf/DisallowCType.h | 10 + WTF/wtf/EnumClass.h | 134 + WTF/wtf/ExportMacros.h | 97 +- WTF/wtf/FastAllocBase.h | 427 - WTF/wtf/FastBitVector.h | 180 + WTF/wtf/FastMalloc.cpp | 1503 +- WTF/wtf/FastMalloc.h | 56 +- WTF/wtf/FeatureDefines.h | 888 + WTF/wtf/FilePrintStream.cpp | 64 + WTF/wtf/FilePrintStream.h | 62 + WTF/wtf/FixedArray.h | 4 +- WTF/wtf/FlipBytes.h | 119 + WTF/wtf/Float32Array.h | 108 - WTF/wtf/Float64Array.h | 108 - WTF/wtf/Forward.h | 86 +- WTF/wtf/FunctionDispatcher.cpp | 39 + WTF/wtf/FunctionDispatcher.h | 46 + WTF/wtf/Functional.h | 121 +- WTF/wtf/GregorianDateTime.cpp | 86 + WTF/wtf/GregorianDateTime.h | 128 + WTF/wtf/HashCountedSet.h | 40 +- WTF/wtf/HashFunctions.h | 62 +- WTF/wtf/HashIterators.h | 28 +- WTF/wtf/HashMap.h | 829 +- WTF/wtf/HashSet.h | 155 +- WTF/wtf/HashTable.cpp | 32 +- WTF/wtf/HashTable.h | 342 +- WTF/wtf/HashTraits.h | 367 +- WTF/wtf/HexNumber.h | 26 +- WTF/wtf/InlineASM.h | 31 +- WTF/wtf/Insertion.h | 78 + WTF/wtf/Int16Array.h | 93 - WTF/wtf/Int32Array.h | 92 - WTF/wtf/Int8Array.h | 94 - WTF/wtf/ListDump.h | 130 + WTF/wtf/ListHashSet.h | 1450 +- WTF/wtf/ListRefPtr.h | 61 - WTF/wtf/Locker.h | 25 +- WTF/wtf/MD5.cpp | 40 - WTF/wtf/MainThread.cpp | 33 +- WTF/wtf/MainThread.h | 32 +- WTF/wtf/MallocPtr.h | 108 + WTF/wtf/MallocZoneSupport.h | 73 - WTF/wtf/MathExtras.h | 243 +- WTF/wtf/MediaTime.cpp | 391 + WTF/wtf/MediaTime.h | 120 + WTF/wtf/MessageQueue.h | 92 +- WTF/wtf/MetaAllocator.cpp | 37 +- WTF/wtf/MetaAllocator.h | 3 +- WTF/wtf/MetaAllocatorHandle.h | 34 +- WTF/wtf/NeverDestroyed.h | 85 + WTF/wtf/NoLock.h | 48 + WTF/wtf/NonCopyingSort.h | 89 - WTF/wtf/Noncopyable.h | 19 +- WTF/wtf/NullPtr.cpp | 34 - WTF/wtf/NullPtr.h | 56 - WTF/wtf/NumberOfCores.cpp | 5 +- WTF/wtf/NumberOfCores.h | 2 +- WTF/wtf/OSAllocator.h | 10 +- WTF/wtf/OSAllocatorPosix.cpp | 53 +- WTF/wtf/OSAllocatorWin.cpp | 4 + WTF/wtf/OSRandomSource.cpp | 2 - WTF/wtf/OSRandomSource.h | 3 - WTF/wtf/ObjcRuntimeExtras.h | 49 + WTF/wtf/OwnArrayPtr.h | 157 - WTF/wtf/OwnPtr.h | 48 +- WTF/wtf/OwnPtrCommon.h | 46 +- WTF/wtf/PackedIntVector.h | 5 +- WTF/wtf/PageAllocation.h | 1 - WTF/wtf/PageAllocationAligned.cpp | 10 +- WTF/wtf/PageAllocationAligned.h | 4 +- WTF/wtf/PassOwnArrayPtr.h | 169 - WTF/wtf/PassOwnPtr.h | 20 +- WTF/wtf/PassRef.h | 223 + WTF/wtf/PassRefPtr.h | 50 +- WTF/wtf/Platform.h | 701 +- WTF/wtf/PlatformBlackBerry.cmake | 11 +- WTF/wtf/PlatformEfl.cmake | 44 +- WTF/wtf/PlatformGTK.cmake | 18 + WTF/wtf/PlatformWin.cmake | 15 + WTF/wtf/PlatformWinCE.cmake | 28 - WTF/wtf/PrintStream.cpp | 143 + WTF/wtf/PrintStream.h | 399 + WTF/wtf/ProcessID.h | 55 + WTF/wtf/RAMSize.cpp | 94 + WTF/wtf/RAMSize.h | 37 + WTF/wtf/RandomNumber.cpp | 31 +- WTF/wtf/RandomNumber.h | 6 +- WTF/wtf/RandomNumberSeed.h | 17 +- WTF/wtf/{url/api/URLString.h => RawPointer.h} | 51 +- WTF/wtf/Ref.h | 80 + WTF/wtf/RefCounted.h | 74 +- WTF/wtf/RefCountedArray.h | 33 +- WTF/wtf/RefCountedLeakCounter.cpp | 6 +- WTF/wtf/RefCountedLeakCounter.h | 2 +- WTF/wtf/RefPtr.h | 95 +- WTF/wtf/RefPtrHashMap.h | 122 +- WTF/wtf/RetainPtr.h | 244 +- .../{qt/MainThreadQt.cpp => RunLoopTimer.h} | 82 +- WTF/wtf/RunLoopTimerCF.cpp | 92 + WTF/wtf/SHA1.cpp | 59 +- WTF/wtf/SHA1.h | 19 +- WTF/wtf/SaturatedArithmetic.h | 66 + WTF/wtf/SchedulePair.h | 94 + WTF/wtf/SchedulePairCF.cpp | 45 + WTF/wtf/{Complex.h => SchedulePairMac.mm} | 25 +- WTF/wtf/SegmentedVector.h | 80 +- WTF/wtf/SentinelLinkedList.h | 17 +- WTF/wtf/SixCharacterHash.cpp | 76 + WTF/wtf/SixCharacterHash.h | 48 + WTF/wtf/SizeLimits.cpp | 31 +- WTF/wtf/Spectrum.h | 6 +- WTF/wtf/StackBounds.cpp | 176 +- WTF/wtf/StackBounds.h | 62 +- WTF/wtf/StackStats.cpp | 309 + WTF/wtf/StackStats.h | 151 + WTF/wtf/StaticConstructors.h | 10 - WTF/wtf/StdLibExtras.h | 349 +- WTF/wtf/StreamBuffer.h | 118 + WTF/wtf/StringExtras.h | 7 - WTF/wtf/StringHashDumpContext.h | 122 + WTF/wtf/StringHasher.h | 225 +- WTF/wtf/StringPrintStream.cpp | 126 + WTF/wtf/StringPrintStream.h | 117 + WTF/wtf/TCPageMap.h | 82 +- WTF/wtf/TCSpinLock.h | 192 +- WTF/wtf/TCSystemAlloc.cpp | 26 +- WTF/wtf/ThreadFunctionInvocation.h | 2 + WTF/wtf/ThreadIdentifierDataPthreads.cpp | 6 +- WTF/wtf/ThreadRestrictionVerifier.h | 42 +- WTF/wtf/ThreadSafeRefCounted.h | 25 +- WTF/wtf/ThreadSpecific.h | 53 + WTF/wtf/ThreadSpecificWin.cpp | 97 +- WTF/wtf/Threading.cpp | 18 +- .../{wx/MainThreadWx.cpp => ThreadingOnce.h} | 66 +- WTF/wtf/ThreadingPrimitives.h | 45 +- WTF/wtf/ThreadingPthreads.cpp | 260 +- WTF/wtf/ThreadingWin.cpp | 34 +- WTF/wtf/TriState.h | 50 + WTF/wtf/TypeTraits.cpp | 155 - WTF/wtf/TypeTraits.h | 435 - WTF/wtf/Uint16Array.h | 94 - WTF/wtf/Uint32Array.h | 94 - WTF/wtf/Uint8Array.h | 94 - WTF/wtf/Uint8ClampedArray.h | 124 - WTF/wtf/UniStdExtras.h | 54 + WTF/wtf/UnusedParam.h | 37 - WTF/wtf/Vector.h | 2002 +- WTF/wtf/VectorTraits.h | 23 +- WTF/wtf/WTFThreadData.cpp | 29 +- WTF/wtf/WTFThreadData.h | 45 +- WTF/wtf/WeakPtr.h | 145 + WTF/wtf/WindowsExtras.h | 80 + WTF/wtf/blackberry/MainThreadBlackBerry.cpp | 5 +- WTF/wtf/chromium/ChromiumThreading.h | 44 - WTF/wtf/dtoa.cpp | 24 +- WTF/wtf/dtoa.h | 8 +- WTF/wtf/dtoa/bignum-dtoa.cc | 14 +- WTF/wtf/dtoa/bignum-dtoa.h | 2 +- WTF/wtf/dtoa/bignum.cc | 26 +- WTF/wtf/dtoa/bignum.h | 6 +- WTF/wtf/dtoa/cached-powers.cc | 5 +- WTF/wtf/dtoa/cached-powers.h | 2 +- WTF/wtf/dtoa/double-conversion.cc | 7 +- WTF/wtf/dtoa/double-conversion.h | 6 +- WTF/wtf/dtoa/fast-dtoa.cc | 14 +- WTF/wtf/dtoa/fast-dtoa.h | 2 +- WTF/wtf/dtoa/fixed-dtoa.cc | 17 +- WTF/wtf/dtoa/fixed-dtoa.h | 2 +- WTF/wtf/dtoa/strtod.cc | 32 +- WTF/wtf/dtoa/strtod.h | 2 +- WTF/wtf/dtoa/utils.h | 27 +- WTF/wtf/efl/OwnPtrEfl.cpp | 26 +- WTF/wtf/efl/RefPtrEfl.cpp | 48 + .../wtf/efl/RefPtrEfl.h | 24 +- WTF/wtf/gobject/GMutexLocker.h | 72 + WTF/wtf/gobject/GOwnPtr.cpp | 4 +- WTF/wtf/gobject/GOwnPtr.h | 4 +- WTF/wtf/gobject/GRefPtr.cpp | 65 +- WTF/wtf/gobject/GRefPtr.h | 17 +- WTF/wtf/gobject/GTypedefs.h | 8 + WTF/wtf/gobject/GlibUtilities.cpp | 5 + WTF/wtf/gtk/MainThreadGtk.cpp | 2 +- WTF/wtf/ios/WebCoreThread.cpp | 31 + WTF/wtf/ios/WebCoreThread.h | 41 + WTF/wtf/mac/MainThreadMac.mm | 69 +- WTF/wtf/nix/FeatureDefinesNix.h | 293 + WTF/wtf/nix/PlatformNix.h | 63 + WTF/wtf/qt/StringQt.cpp | 73 - WTF/wtf/qt/UtilsQt.h | 37 - WTF/wtf/qt/compat/QGuiApplication | 1 - WTF/wtf/qt/compat/qguiapplication.h | 35 - WTF/wtf/text/ASCIIFastPath.h | 100 +- WTF/wtf/text/AtomicString.cpp | 277 +- WTF/wtf/text/AtomicString.h | 105 +- WTF/wtf/text/AtomicStringImpl.h | 17 + WTF/wtf/text/AtomicStringTable.cpp | 62 + WTF/wtf/text/AtomicStringTable.h | 48 + WTF/wtf/text/Base64.cpp | 216 + WTF/wtf/text/Base64.h | 92 + WTF/wtf/text/CString.cpp | 84 +- WTF/wtf/text/CString.h | 45 +- WTF/wtf/text/ConversionMode.h | 45 + WTF/wtf/text/IntegerToStringConversion.h | 86 + WTF/wtf/text/StringBuffer.h | 13 +- WTF/wtf/text/StringBuilder.cpp | 78 +- WTF/wtf/text/StringBuilder.h | 59 +- WTF/wtf/text/StringConcatenate.h | 46 +- WTF/wtf/text/StringHash.h | 77 +- WTF/wtf/text/StringImpl.cpp | 1117 +- WTF/wtf/text/StringImpl.h | 684 +- WTF/wtf/text/StringOperators.h | 28 +- WTF/wtf/text/StringStatics.cpp | 40 +- WTF/wtf/text/WTFString.cpp | 460 +- WTF/wtf/text/WTFString.h | 370 +- WTF/wtf/threads/BinarySemaphore.h | 12 +- WTF/wtf/unicode/CharacterNames.h | 8 +- WTF/wtf/unicode/Collator.h | 5 +- WTF/wtf/unicode/CollatorDefault.cpp | 4 +- WTF/wtf/unicode/UTF8.cpp | 23 +- WTF/wtf/unicode/UTF8.h | 12 +- WTF/wtf/unicode/Unicode.h | 12 +- WTF/wtf/unicode/glib/UnicodeGLib.cpp | 192 - WTF/wtf/unicode/glib/UnicodeGLib.h | 244 - WTF/wtf/unicode/icu/CollatorICU.cpp | 22 +- WTF/wtf/unicode/icu/UnicodeIcu.h | 204 - WTF/wtf/unicode/qt4/UnicodeQt4.h | 377 - WTF/wtf/unicode/wchar/UnicodeWchar.cpp | 114 + WTF/wtf/unicode/wchar/UnicodeWchar.h | 132 + WTF/wtf/unicode/wince/UnicodeWinCE.cpp | 181 - WTF/wtf/unicode/wince/UnicodeWinCE.h | 178 - WTF/wtf/url/api/ParsedURL.cpp | 113 - WTF/wtf/url/src/RawURLBuffer.h | 74 - WTF/wtf/url/src/URLBuffer.h | 140 - WTF/wtf/url/src/URLCharacterTypes.cpp | 177 - WTF/wtf/url/src/URLCharacterTypes.h | 65 - WTF/wtf/url/src/URLComponent.h | 81 - WTF/wtf/url/src/URLEscape.cpp | 43 - WTF/wtf/url/src/URLEscape.h | 53 - WTF/wtf/url/src/URLParser.h | 579 - WTF/wtf/url/src/URLQueryCanonicalizer.h | 109 - WTF/wtf/url/src/URLSegments.cpp | 114 - WTF/wtf/url/src/URLSegments.h | 109 - WTF/wtf/win/GDIObject.h | 131 + WTF/wtf/win/MainThreadWin.cpp | 28 +- WTF/wtf/wince/FastMallocWinCE.h | 175 - WTF/wtf/wince/MemoryManager.cpp | 171 - WTF/wtf/wince/MemoryManager.h | 80 - WTF/wtf/wx/StringWx.cpp | 84 - 1788 files changed, 427037 insertions(+), 174590 deletions(-) create mode 100644 JavaScriptCore/API/APICallbackFunction.h create mode 100644 JavaScriptCore/API/JSAPIWrapperObject.h create mode 100644 JavaScriptCore/API/JSAPIWrapperObject.mm create mode 100644 JavaScriptCore/API/JSCTestRunnerUtils.cpp create mode 100644 JavaScriptCore/API/JSCTestRunnerUtils.h create mode 100644 JavaScriptCore/API/JSContext.h create mode 100644 JavaScriptCore/API/JSContext.mm rename WTF/wtf/url/api/ParsedURL.h => JavaScriptCore/API/JSContextInternal.h (50%) create mode 100644 JavaScriptCore/API/JSExport.h create mode 100644 JavaScriptCore/API/JSManagedValue.h create mode 100644 JavaScriptCore/API/JSManagedValue.mm create mode 100644 JavaScriptCore/API/JSScriptRef.cpp create mode 100644 JavaScriptCore/API/JSScriptRefPrivate.h create mode 100644 JavaScriptCore/API/JSStringRefPrivate.h create mode 100644 JavaScriptCore/API/JSValue.h create mode 100644 JavaScriptCore/API/JSValue.mm create mode 100644 JavaScriptCore/API/JSValueInternal.h create mode 100644 JavaScriptCore/API/JSVirtualMachine.h create mode 100644 JavaScriptCore/API/JSVirtualMachine.mm create mode 100644 JavaScriptCore/API/JSVirtualMachineInternal.h create mode 100644 JavaScriptCore/API/JSWrapperMap.h create mode 100644 JavaScriptCore/API/JSWrapperMap.mm create mode 100644 JavaScriptCore/API/ObjCCallbackFunction.h create mode 100644 JavaScriptCore/API/ObjCCallbackFunction.mm create mode 100644 JavaScriptCore/API/ObjcRuntimeExtras.h create mode 100644 JavaScriptCore/API/tests/CurrentThisInsideBlockGetterTest.h create mode 100644 JavaScriptCore/API/tests/CurrentThisInsideBlockGetterTest.mm create mode 100644 JavaScriptCore/API/tests/testapi.mm create mode 100644 JavaScriptCore/ChangeLog-2012-05-22 create mode 100644 JavaScriptCore/ChangeLog-2012-10-02 create mode 100644 JavaScriptCore/ChangeLog-2013-04-24 create mode 100644 JavaScriptCore/ChangeLog-2013-10-13 delete mode 100644 JavaScriptCore/Configurations/CompilerVersion.xcconfig create mode 100644 JavaScriptCore/Configurations/LLVMForJSC.xcconfig create mode 100644 JavaScriptCore/Configurations/iOS.xcconfig delete mode 100644 JavaScriptCore/DerivedSources.pri create mode 100644 JavaScriptCore/ForwardingHeaders/JavaScriptCore/JSCTestRunnerUtils.h delete mode 100644 JavaScriptCore/JSCTypedArrayStubs.h create mode 100644 JavaScriptCore/JavaScriptCore.gir.in delete mode 100644 JavaScriptCore/JavaScriptCore.gyp/.gitignore delete mode 100644 JavaScriptCore/JavaScriptCore.gyp/JavaScriptCore.gyp delete mode 100644 JavaScriptCore/JavaScriptCore.gypi delete mode 100644 JavaScriptCore/JavaScriptCore.pri delete mode 100644 JavaScriptCore/JavaScriptCore.pro delete mode 100644 JavaScriptCore/JavaScriptCore.vcproj/JavaScriptCore.make delete mode 100644 JavaScriptCore/JavaScriptCore.vcproj/JavaScriptCore.sln delete mode 100755 JavaScriptCore/JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def delete mode 100644 JavaScriptCore/JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj delete mode 100644 JavaScriptCore/JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCoreCF.vsprops delete mode 100644 JavaScriptCore/JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCoreCFLite.vsprops delete mode 100644 JavaScriptCore/JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCoreCommon.vsprops delete mode 100644 JavaScriptCore/JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCoreDebug.vsprops delete mode 100644 JavaScriptCore/JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCoreDebugAll.vsprops delete mode 100644 JavaScriptCore/JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCoreDebugCairoCFLite.vsprops delete mode 100644 JavaScriptCore/JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCoreGenerated.vcproj delete mode 100644 JavaScriptCore/JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCoreGeneratedCommon.vsprops delete mode 100644 JavaScriptCore/JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCoreGeneratedDebug.vsprops delete mode 100644 JavaScriptCore/JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCoreGeneratedDebugAll.vsprops delete mode 100644 JavaScriptCore/JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCoreGeneratedDebugCairoCFLite.vsprops delete mode 100644 JavaScriptCore/JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCoreGeneratedProduction.vsprops delete mode 100644 JavaScriptCore/JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCoreGeneratedRelease.vsprops delete mode 100644 JavaScriptCore/JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCoreGeneratedReleaseCairoCFLite.vsprops delete mode 100644 JavaScriptCore/JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCoreGeneratedReleasePGO.vsprops delete mode 100644 JavaScriptCore/JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCorePGOOptimize.vsprops delete mode 100644 JavaScriptCore/JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCorePostBuild.cmd delete mode 100644 JavaScriptCore/JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCorePreLink.cmd delete mode 100644 JavaScriptCore/JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCoreProduction.vsprops delete mode 100644 JavaScriptCore/JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCoreRelease.vsprops delete mode 100644 JavaScriptCore/JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCoreReleaseCairoCFLite.vsprops delete mode 100644 JavaScriptCore/JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCoreReleasePGO.vsprops delete mode 100644 JavaScriptCore/JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCoreReleasePGOOptimize.vsprops delete mode 100644 JavaScriptCore/JavaScriptCore.vcproj/JavaScriptCoreSubmit.sln delete mode 100644 JavaScriptCore/JavaScriptCore.vcproj/jsc/jsc.vcproj delete mode 100644 JavaScriptCore/JavaScriptCore.vcproj/jsc/jscCommon.vsprops delete mode 100644 JavaScriptCore/JavaScriptCore.vcproj/jsc/jscDebug.vsprops delete mode 100644 JavaScriptCore/JavaScriptCore.vcproj/jsc/jscDebugAll.vsprops delete mode 100644 JavaScriptCore/JavaScriptCore.vcproj/jsc/jscDebugCairoCFLite.vsprops delete mode 100644 JavaScriptCore/JavaScriptCore.vcproj/jsc/jscPostBuild.cmd delete mode 100644 JavaScriptCore/JavaScriptCore.vcproj/jsc/jscPreLink.cmd delete mode 100644 JavaScriptCore/JavaScriptCore.vcproj/jsc/jscProduction.vsprops delete mode 100644 JavaScriptCore/JavaScriptCore.vcproj/jsc/jscRelease.vsprops delete mode 100644 JavaScriptCore/JavaScriptCore.vcproj/jsc/jscReleaseCairoCFLite.vsprops delete mode 100644 JavaScriptCore/JavaScriptCore.vcproj/jsc/jscReleasePGO.vsprops delete mode 100755 JavaScriptCore/JavaScriptCore.vcproj/testRegExp/testRegExp.vcproj delete mode 100755 JavaScriptCore/JavaScriptCore.vcproj/testRegExp/testRegExpCommon.vsprops delete mode 100755 JavaScriptCore/JavaScriptCore.vcproj/testRegExp/testRegExpDebug.vsprops delete mode 100755 JavaScriptCore/JavaScriptCore.vcproj/testRegExp/testRegExpDebugAll.vsprops delete mode 100755 JavaScriptCore/JavaScriptCore.vcproj/testRegExp/testRegExpDebugCairoCFLite.vsprops delete mode 100755 JavaScriptCore/JavaScriptCore.vcproj/testRegExp/testRegExpPostBuild.cmd delete mode 100755 JavaScriptCore/JavaScriptCore.vcproj/testRegExp/testRegExpPreLink.cmd delete mode 100755 JavaScriptCore/JavaScriptCore.vcproj/testRegExp/testRegExpProduction.vsprops delete mode 100755 JavaScriptCore/JavaScriptCore.vcproj/testRegExp/testRegExpRelease.vsprops delete mode 100755 JavaScriptCore/JavaScriptCore.vcproj/testRegExp/testRegExpReleaseCairoCFLite.vsprops delete mode 100755 JavaScriptCore/JavaScriptCore.vcproj/testRegExp/testRegExpReleasePGO.vsprops delete mode 100644 JavaScriptCore/JavaScriptCore.vcproj/testapi/testapi.vcproj delete mode 100644 JavaScriptCore/JavaScriptCore.vcproj/testapi/testapiCommon.vsprops delete mode 100644 JavaScriptCore/JavaScriptCore.vcproj/testapi/testapiDebug.vsprops delete mode 100644 JavaScriptCore/JavaScriptCore.vcproj/testapi/testapiDebugAll.vsprops delete mode 100644 JavaScriptCore/JavaScriptCore.vcproj/testapi/testapiDebugCairoCFLite.vsprops delete mode 100644 JavaScriptCore/JavaScriptCore.vcproj/testapi/testapiPreLink.cmd delete mode 100644 JavaScriptCore/JavaScriptCore.vcproj/testapi/testapiProduction.vsprops delete mode 100644 JavaScriptCore/JavaScriptCore.vcproj/testapi/testapiRelease.vsprops delete mode 100644 JavaScriptCore/JavaScriptCore.vcproj/testapi/testapiReleaseCairoCFLite.vsprops create mode 100644 JavaScriptCore/JavaScriptCore.vcxproj/JavaScriptCore.make rename JavaScriptCore/{JavaScriptCore.vcproj => JavaScriptCore.vcxproj}/JavaScriptCore.resources/Info.plist (92%) create mode 100644 JavaScriptCore/JavaScriptCore.vcxproj/JavaScriptCore.sln create mode 100644 JavaScriptCore/JavaScriptCore.vcxproj/JavaScriptCore.submit.sln create mode 100644 JavaScriptCore/JavaScriptCore.vcxproj/JavaScriptCore.vcxproj create mode 100644 JavaScriptCore/JavaScriptCore.vcxproj/JavaScriptCore.vcxproj.filters create mode 100644 JavaScriptCore/JavaScriptCore.vcxproj/JavaScriptCoreCF.props create mode 100644 JavaScriptCore/JavaScriptCore.vcxproj/JavaScriptCoreCFLite.props create mode 100644 JavaScriptCore/JavaScriptCore.vcxproj/JavaScriptCoreCommon.props create mode 100644 JavaScriptCore/JavaScriptCore.vcxproj/JavaScriptCoreDebug.props create mode 100644 JavaScriptCore/JavaScriptCore.vcxproj/JavaScriptCoreDebugCFLite.props rename JavaScriptCore/{JavaScriptCore.vcproj/JavaScriptCore => JavaScriptCore.vcxproj}/JavaScriptCoreGenerated.make (74%) create mode 100644 JavaScriptCore/JavaScriptCore.vcxproj/JavaScriptCoreGenerated.vcxproj create mode 100644 JavaScriptCore/JavaScriptCore.vcxproj/JavaScriptCoreGenerated.vcxproj.filters create mode 100644 JavaScriptCore/JavaScriptCore.vcxproj/JavaScriptCoreGeneratedCommon.props create mode 100644 JavaScriptCore/JavaScriptCore.vcxproj/JavaScriptCoreGeneratedDebug.props create mode 100644 JavaScriptCore/JavaScriptCore.vcxproj/JavaScriptCoreGeneratedProduction.props create mode 100644 JavaScriptCore/JavaScriptCore.vcxproj/JavaScriptCoreGeneratedRelease.props create mode 100644 JavaScriptCore/JavaScriptCore.vcxproj/JavaScriptCorePostBuild.cmd rename JavaScriptCore/{JavaScriptCore.vcproj/JavaScriptCore => JavaScriptCore.vcxproj}/JavaScriptCorePreBuild.cmd (100%) rename JavaScriptCore/{AllInOneFile.cpp => JavaScriptCore.vcxproj/JavaScriptCorePreLink.cmd} (100%) create mode 100644 JavaScriptCore/JavaScriptCore.vcxproj/JavaScriptCoreProduction.props create mode 100644 JavaScriptCore/JavaScriptCore.vcxproj/JavaScriptCoreRelease.props create mode 100644 JavaScriptCore/JavaScriptCore.vcxproj/JavaScriptCoreReleaseCFLite.props create mode 100644 JavaScriptCore/JavaScriptCore.vcxproj/LLInt/LLIntAssembly/LLIntAssembly.make create mode 100644 JavaScriptCore/JavaScriptCore.vcxproj/LLInt/LLIntAssembly/LLIntAssembly.vcxproj create mode 100644 JavaScriptCore/JavaScriptCore.vcxproj/LLInt/LLIntAssembly/build-LLIntAssembly.sh create mode 100644 JavaScriptCore/JavaScriptCore.vcxproj/LLInt/LLIntDesiredOffsets/LLIntDesiredOffsets.make create mode 100644 JavaScriptCore/JavaScriptCore.vcxproj/LLInt/LLIntDesiredOffsets/LLIntDesiredOffsets.vcxproj create mode 100644 JavaScriptCore/JavaScriptCore.vcxproj/LLInt/LLIntDesiredOffsets/build-LLIntDesiredOffsets.sh create mode 100644 JavaScriptCore/JavaScriptCore.vcxproj/LLInt/LLIntOffsetsExtractor/LLIntOffsetsExtractor.vcxproj create mode 100644 JavaScriptCore/JavaScriptCore.vcxproj/LLInt/LLIntOffsetsExtractor/LLIntOffsetsExtractorCommon.props create mode 100644 JavaScriptCore/JavaScriptCore.vcxproj/LLInt/LLIntOffsetsExtractor/LLIntOffsetsExtractorDebug.props create mode 100644 JavaScriptCore/JavaScriptCore.vcxproj/LLInt/LLIntOffsetsExtractor/LLIntOffsetsExtractorProduction.props create mode 100644 JavaScriptCore/JavaScriptCore.vcxproj/LLInt/LLIntOffsetsExtractor/LLIntOffsetsExtractorRelease.props rename JavaScriptCore/{JavaScriptCore.vcproj/JavaScriptCore => JavaScriptCore.vcxproj}/build-generated-files.sh (85%) mode change 100755 => 100644 rename JavaScriptCore/{JavaScriptCore.vcproj/JavaScriptCore => JavaScriptCore.vcxproj}/copy-files.cmd (76%) create mode 100644 JavaScriptCore/JavaScriptCore.vcxproj/jsc/jsc.vcxproj create mode 100644 JavaScriptCore/JavaScriptCore.vcxproj/jsc/jsc.vcxproj.filters create mode 100644 JavaScriptCore/JavaScriptCore.vcxproj/jsc/jscCommon.props create mode 100644 JavaScriptCore/JavaScriptCore.vcxproj/jsc/jscDebug.props create mode 100644 JavaScriptCore/JavaScriptCore.vcxproj/jsc/jscPostBuild.cmd rename JavaScriptCore/{JavaScriptCore.vcproj => JavaScriptCore.vcxproj}/jsc/jscPreBuild.cmd (100%) rename WTF/wtf/ThreadingNone.cpp => JavaScriptCore/JavaScriptCore.vcxproj/jsc/jscPreLink.cmd (100%) create mode 100644 JavaScriptCore/JavaScriptCore.vcxproj/jsc/jscProduction.props create mode 100644 JavaScriptCore/JavaScriptCore.vcxproj/jsc/jscRelease.props create mode 100644 JavaScriptCore/JavaScriptCore.vcxproj/resource.h create mode 100644 JavaScriptCore/JavaScriptCore.vcxproj/testRegExp/testRegExp.vcxproj create mode 100644 JavaScriptCore/JavaScriptCore.vcxproj/testRegExp/testRegExp.vcxproj.filters create mode 100644 JavaScriptCore/JavaScriptCore.vcxproj/testRegExp/testRegExpCommon.props create mode 100644 JavaScriptCore/JavaScriptCore.vcxproj/testRegExp/testRegExpDebug.props create mode 100644 JavaScriptCore/JavaScriptCore.vcxproj/testRegExp/testRegExpPostBuild.cmd rename JavaScriptCore/{JavaScriptCore.vcproj => JavaScriptCore.vcxproj}/testRegExp/testRegExpPreBuild.cmd (100%) mode change 100755 => 100644 create mode 100644 JavaScriptCore/JavaScriptCore.vcxproj/testRegExp/testRegExpPreLink.cmd create mode 100644 JavaScriptCore/JavaScriptCore.vcxproj/testRegExp/testRegExpProduction.props create mode 100644 JavaScriptCore/JavaScriptCore.vcxproj/testRegExp/testRegExpRelease.props create mode 100644 JavaScriptCore/JavaScriptCore.vcxproj/testapi/testapi.vcxproj create mode 100644 JavaScriptCore/JavaScriptCore.vcxproj/testapi/testapi.vcxproj.filters create mode 100644 JavaScriptCore/JavaScriptCore.vcxproj/testapi/testapiCommon.props create mode 100644 JavaScriptCore/JavaScriptCore.vcxproj/testapi/testapiCommonCFLite.props create mode 100644 JavaScriptCore/JavaScriptCore.vcxproj/testapi/testapiDebug.props create mode 100644 JavaScriptCore/JavaScriptCore.vcxproj/testapi/testapiDebugCFLite.props rename JavaScriptCore/{JavaScriptCore.vcproj => JavaScriptCore.vcxproj}/testapi/testapiPostBuild.cmd (100%) rename JavaScriptCore/{JavaScriptCore.vcproj => JavaScriptCore.vcxproj}/testapi/testapiPreBuild.cmd (100%) create mode 100644 JavaScriptCore/JavaScriptCore.vcxproj/testapi/testapiPreLink.cmd create mode 100644 JavaScriptCore/JavaScriptCore.vcxproj/testapi/testapiProduction.props create mode 100644 JavaScriptCore/JavaScriptCore.vcxproj/testapi/testapiRelease.props create mode 100644 JavaScriptCore/JavaScriptCore.vcxproj/testapi/testapiReleaseCFLite.props delete mode 100644 JavaScriptCore/PlatformWinCE.cmake delete mode 100644 JavaScriptCore/Target.pri create mode 100644 JavaScriptCore/assembler/ARM64Assembler.h create mode 100644 JavaScriptCore/assembler/LinkBuffer.cpp rename JavaScriptCore/{bytecode/GlobalResolveInfo.h => assembler/MacroAssembler.cpp} (79%) create mode 100644 JavaScriptCore/assembler/MacroAssemblerARM64.h create mode 100644 JavaScriptCore/assembler/MacroAssemblerARMv7.cpp create mode 100644 JavaScriptCore/assembler/MacroAssemblerX86Common.cpp create mode 100644 JavaScriptCore/bytecode/ArrayAllocationProfile.cpp create mode 100644 JavaScriptCore/bytecode/ArrayAllocationProfile.h create mode 100644 JavaScriptCore/bytecode/ArrayProfile.cpp create mode 100644 JavaScriptCore/bytecode/ArrayProfile.h create mode 100644 JavaScriptCore/bytecode/ByValInfo.h create mode 100644 JavaScriptCore/bytecode/CodeBlockHash.cpp create mode 100644 JavaScriptCore/bytecode/CodeBlockHash.h create mode 100644 JavaScriptCore/bytecode/CodeBlockJettisoningWatchpoint.cpp create mode 100644 JavaScriptCore/bytecode/CodeBlockJettisoningWatchpoint.h create mode 100644 JavaScriptCore/bytecode/CodeBlockWithJITType.h create mode 100644 JavaScriptCore/bytecode/CodeOrigin.cpp create mode 100644 JavaScriptCore/bytecode/CodeType.cpp create mode 100644 JavaScriptCore/bytecode/DeferredCompilationCallback.cpp create mode 100644 JavaScriptCore/bytecode/DeferredCompilationCallback.h create mode 100644 JavaScriptCore/bytecode/ExitKind.cpp create mode 100644 JavaScriptCore/bytecode/ExitKind.h create mode 100644 JavaScriptCore/bytecode/InlineCallFrameSet.cpp create mode 100644 JavaScriptCore/bytecode/InlineCallFrameSet.h delete mode 100644 JavaScriptCore/bytecode/MethodCallLinkStatus.h create mode 100644 JavaScriptCore/bytecode/ObjectAllocationProfile.h create mode 100644 JavaScriptCore/bytecode/OperandsInlines.h create mode 100644 JavaScriptCore/bytecode/PolymorphicAccessStructureList.h create mode 100644 JavaScriptCore/bytecode/PreciseJumpTargets.cpp rename JavaScriptCore/{runtime/UStringBuilder.h => bytecode/PreciseJumpTargets.h} (77%) delete mode 100644 JavaScriptCore/bytecode/PredictedType.cpp delete mode 100644 JavaScriptCore/bytecode/PredictedType.h create mode 100644 JavaScriptCore/bytecode/ProfiledCodeBlockJettisoningWatchpoint.cpp create mode 100644 JavaScriptCore/bytecode/ProfiledCodeBlockJettisoningWatchpoint.h create mode 100644 JavaScriptCore/bytecode/ReduceWhitespace.cpp create mode 100644 JavaScriptCore/bytecode/ReduceWhitespace.h create mode 100644 JavaScriptCore/bytecode/SpecialPointer.cpp create mode 100644 JavaScriptCore/bytecode/SpecialPointer.h create mode 100644 JavaScriptCore/bytecode/SpeculatedType.cpp create mode 100644 JavaScriptCore/bytecode/SpeculatedType.h create mode 100644 JavaScriptCore/bytecode/StructureStubClearingWatchpoint.cpp create mode 100644 JavaScriptCore/bytecode/StructureStubClearingWatchpoint.h create mode 100644 JavaScriptCore/bytecode/UnlinkedCodeBlock.cpp create mode 100644 JavaScriptCore/bytecode/UnlinkedCodeBlock.h create mode 100644 JavaScriptCore/bytecode/ValueRecovery.cpp create mode 100644 JavaScriptCore/bytecode/Watchpoint.cpp create mode 100644 JavaScriptCore/bytecode/Watchpoint.h create mode 100644 JavaScriptCore/bytecompiler/StaticPropertyAnalysis.h create mode 100644 JavaScriptCore/bytecompiler/StaticPropertyAnalyzer.h create mode 100644 JavaScriptCore/dfg/DFGAbstractHeap.cpp create mode 100644 JavaScriptCore/dfg/DFGAbstractHeap.h create mode 100644 JavaScriptCore/dfg/DFGAbstractInterpreter.h create mode 100644 JavaScriptCore/dfg/DFGAbstractInterpreterInlines.h delete mode 100644 JavaScriptCore/dfg/DFGAbstractState.cpp create mode 100644 JavaScriptCore/dfg/DFGAbstractValue.cpp create mode 100644 JavaScriptCore/dfg/DFGAllocator.h create mode 100644 JavaScriptCore/dfg/DFGAnalysis.h create mode 100644 JavaScriptCore/dfg/DFGArgumentsSimplificationPhase.cpp create mode 100644 JavaScriptCore/dfg/DFGArgumentsSimplificationPhase.h create mode 100644 JavaScriptCore/dfg/DFGArrayMode.cpp create mode 100644 JavaScriptCore/dfg/DFGArrayMode.h create mode 100644 JavaScriptCore/dfg/DFGArrayifySlowPathGenerator.h create mode 100644 JavaScriptCore/dfg/DFGAtTailAbstractState.cpp create mode 100644 JavaScriptCore/dfg/DFGAtTailAbstractState.h create mode 100644 JavaScriptCore/dfg/DFGBackwardsPropagationPhase.cpp rename JavaScriptCore/dfg/{DFGRedundantPhiEliminationPhase.h => DFGBackwardsPropagationPhase.h} (79%) create mode 100644 JavaScriptCore/dfg/DFGBasicBlock.cpp create mode 100644 JavaScriptCore/dfg/DFGBasicBlockInlines.h create mode 100644 JavaScriptCore/dfg/DFGBinarySwitch.cpp create mode 100644 JavaScriptCore/dfg/DFGBinarySwitch.h create mode 100644 JavaScriptCore/dfg/DFGBlockInsertionSet.cpp create mode 100644 JavaScriptCore/dfg/DFGBlockInsertionSet.h rename JavaScriptCore/{bytecode/MethodCallLinkInfo.h => dfg/DFGBranchDirection.h} (51%) delete mode 100644 JavaScriptCore/dfg/DFGByteCodeCache.h delete mode 100644 JavaScriptCore/dfg/DFGCCallHelpers.h create mode 100644 JavaScriptCore/dfg/DFGCFGSimplificationPhase.cpp create mode 100644 JavaScriptCore/dfg/DFGCFGSimplificationPhase.h create mode 100644 JavaScriptCore/dfg/DFGCPSRethreadingPhase.cpp create mode 100644 JavaScriptCore/dfg/DFGCPSRethreadingPhase.h create mode 100644 JavaScriptCore/dfg/DFGCallArrayAllocatorSlowPathGenerator.h create mode 100644 JavaScriptCore/dfg/DFGClobberSet.cpp create mode 100644 JavaScriptCore/dfg/DFGClobberSet.h create mode 100644 JavaScriptCore/dfg/DFGClobberize.cpp create mode 100644 JavaScriptCore/dfg/DFGClobberize.h create mode 100644 JavaScriptCore/dfg/DFGCommon.cpp create mode 100644 JavaScriptCore/dfg/DFGCommonData.cpp create mode 100644 JavaScriptCore/dfg/DFGCommonData.h create mode 100644 JavaScriptCore/dfg/DFGCompilationKey.cpp create mode 100644 JavaScriptCore/dfg/DFGCompilationKey.h create mode 100644 JavaScriptCore/dfg/DFGCompilationMode.cpp create mode 100644 JavaScriptCore/dfg/DFGCompilationMode.h create mode 100644 JavaScriptCore/dfg/DFGConstantFoldingPhase.cpp create mode 100644 JavaScriptCore/dfg/DFGConstantFoldingPhase.h delete mode 100644 JavaScriptCore/dfg/DFGCorrectableJumpPoint.h create mode 100644 JavaScriptCore/dfg/DFGCriticalEdgeBreakingPhase.cpp create mode 100644 JavaScriptCore/dfg/DFGCriticalEdgeBreakingPhase.h create mode 100644 JavaScriptCore/dfg/DFGDCEPhase.cpp create mode 100644 JavaScriptCore/dfg/DFGDCEPhase.h create mode 100644 JavaScriptCore/dfg/DFGDesiredIdentifiers.cpp create mode 100644 JavaScriptCore/dfg/DFGDesiredIdentifiers.h rename WTF/wtf/win/OwnPtrWin.cpp => JavaScriptCore/dfg/DFGDesiredStructureChains.cpp (66%) rename WTF/wtf/StringExtras.cpp => JavaScriptCore/dfg/DFGDesiredStructureChains.h (64%) create mode 100644 JavaScriptCore/dfg/DFGDesiredTransitions.cpp create mode 100644 JavaScriptCore/dfg/DFGDesiredTransitions.h create mode 100644 JavaScriptCore/dfg/DFGDesiredWatchpoints.cpp create mode 100644 JavaScriptCore/dfg/DFGDesiredWatchpoints.h create mode 100644 JavaScriptCore/dfg/DFGDesiredWeakReferences.cpp create mode 100644 JavaScriptCore/dfg/DFGDesiredWeakReferences.h create mode 100644 JavaScriptCore/dfg/DFGDesiredWriteBarriers.cpp create mode 100644 JavaScriptCore/dfg/DFGDesiredWriteBarriers.h create mode 100644 JavaScriptCore/dfg/DFGDisassembler.cpp create mode 100644 JavaScriptCore/dfg/DFGDisassembler.h create mode 100644 JavaScriptCore/dfg/DFGDominators.cpp create mode 100644 JavaScriptCore/dfg/DFGDominators.h create mode 100644 JavaScriptCore/dfg/DFGEdge.cpp create mode 100644 JavaScriptCore/dfg/DFGEdgeDominates.h create mode 100644 JavaScriptCore/dfg/DFGEdgeUsesStructure.h delete mode 100644 JavaScriptCore/dfg/DFGFPRInfo.h rename JavaScriptCore/dfg/{DFGCorrectableJumpPoint.cpp => DFGFailedFinalizer.cpp} (81%) create mode 100644 JavaScriptCore/dfg/DFGFailedFinalizer.h create mode 100644 JavaScriptCore/dfg/DFGFiltrationResult.h create mode 100644 JavaScriptCore/dfg/DFGFinalizer.cpp create mode 100644 JavaScriptCore/dfg/DFGFinalizer.h create mode 100644 JavaScriptCore/dfg/DFGFlushFormat.cpp create mode 100644 JavaScriptCore/dfg/DFGFlushFormat.h create mode 100644 JavaScriptCore/dfg/DFGFlushLivenessAnalysisPhase.cpp create mode 100644 JavaScriptCore/dfg/DFGFlushLivenessAnalysisPhase.h create mode 100644 JavaScriptCore/dfg/DFGFlushedAt.cpp create mode 100644 JavaScriptCore/dfg/DFGFlushedAt.h create mode 100644 JavaScriptCore/dfg/DFGInPlaceAbstractState.cpp rename JavaScriptCore/dfg/{DFGAbstractState.h => DFGInPlaceAbstractState.h} (54%) create mode 100644 JavaScriptCore/dfg/DFGInlineCacheWrapper.h create mode 100644 JavaScriptCore/dfg/DFGInlineCacheWrapperInlines.h create mode 100644 JavaScriptCore/dfg/DFGInvalidationPointInjectionPhase.cpp create mode 100644 JavaScriptCore/dfg/DFGInvalidationPointInjectionPhase.h create mode 100644 JavaScriptCore/dfg/DFGJITCode.cpp create mode 100644 JavaScriptCore/dfg/DFGJITCode.h create mode 100644 JavaScriptCore/dfg/DFGJITFinalizer.cpp create mode 100644 JavaScriptCore/dfg/DFGJITFinalizer.h create mode 100644 JavaScriptCore/dfg/DFGJumpReplacement.cpp create mode 100644 JavaScriptCore/dfg/DFGJumpReplacement.h create mode 100644 JavaScriptCore/dfg/DFGLICMPhase.cpp create mode 100644 JavaScriptCore/dfg/DFGLICMPhase.h create mode 100644 JavaScriptCore/dfg/DFGLazyJSValue.cpp create mode 100644 JavaScriptCore/dfg/DFGLazyJSValue.h create mode 100644 JavaScriptCore/dfg/DFGLivenessAnalysisPhase.cpp create mode 100644 JavaScriptCore/dfg/DFGLivenessAnalysisPhase.h create mode 100644 JavaScriptCore/dfg/DFGLongLivedState.cpp create mode 100644 JavaScriptCore/dfg/DFGLongLivedState.h create mode 100644 JavaScriptCore/dfg/DFGLoopPreHeaderCreationPhase.cpp create mode 100644 JavaScriptCore/dfg/DFGLoopPreHeaderCreationPhase.h create mode 100644 JavaScriptCore/dfg/DFGMergeMode.h create mode 100644 JavaScriptCore/dfg/DFGMinifiedGraph.h create mode 100644 JavaScriptCore/dfg/DFGMinifiedID.h create mode 100644 JavaScriptCore/dfg/DFGMinifiedNode.cpp create mode 100644 JavaScriptCore/dfg/DFGMinifiedNode.h create mode 100644 JavaScriptCore/dfg/DFGNaturalLoops.cpp create mode 100644 JavaScriptCore/dfg/DFGNaturalLoops.h create mode 100644 JavaScriptCore/dfg/DFGNode.cpp create mode 100644 JavaScriptCore/dfg/DFGNodeAllocator.h create mode 100644 JavaScriptCore/dfg/DFGOSRAvailabilityAnalysisPhase.cpp create mode 100644 JavaScriptCore/dfg/DFGOSRAvailabilityAnalysisPhase.h create mode 100644 JavaScriptCore/dfg/DFGOSREntrypointCreationPhase.cpp create mode 100644 JavaScriptCore/dfg/DFGOSREntrypointCreationPhase.h create mode 100644 JavaScriptCore/dfg/DFGOSRExitBase.cpp rename JavaScriptCore/dfg/{DFGRepatch.h => DFGOSRExitBase.h} (51%) create mode 100644 JavaScriptCore/dfg/DFGOSRExitCompilationInfo.h create mode 100644 JavaScriptCore/dfg/DFGOSRExitCompilerCommon.cpp create mode 100644 JavaScriptCore/dfg/DFGOSRExitCompilerCommon.h create mode 100644 JavaScriptCore/dfg/DFGOSRExitJumpPlaceholder.cpp create mode 100644 JavaScriptCore/dfg/DFGOSRExitJumpPlaceholder.h create mode 100644 JavaScriptCore/dfg/DFGOSRExitPreparation.cpp create mode 100644 JavaScriptCore/dfg/DFGOSRExitPreparation.h create mode 100644 JavaScriptCore/dfg/DFGPlan.cpp create mode 100644 JavaScriptCore/dfg/DFGPlan.h create mode 100644 JavaScriptCore/dfg/DFGPredictionInjectionPhase.cpp create mode 100644 JavaScriptCore/dfg/DFGPredictionInjectionPhase.h delete mode 100644 JavaScriptCore/dfg/DFGRedundantPhiEliminationPhase.cpp delete mode 100644 JavaScriptCore/dfg/DFGRepatch.cpp create mode 100644 JavaScriptCore/dfg/DFGSSAConversionPhase.cpp create mode 100644 JavaScriptCore/dfg/DFGSSAConversionPhase.h create mode 100644 JavaScriptCore/dfg/DFGSafeToExecute.h create mode 100644 JavaScriptCore/dfg/DFGSaneStringGetByValSlowPathGenerator.h create mode 100644 JavaScriptCore/dfg/DFGSilentRegisterSavePlan.h create mode 100644 JavaScriptCore/dfg/DFGSlowPathGenerator.h create mode 100644 JavaScriptCore/dfg/DFGStackLayoutPhase.cpp create mode 100644 JavaScriptCore/dfg/DFGStackLayoutPhase.h create mode 100644 JavaScriptCore/dfg/DFGStructureAbstractValue.h create mode 100644 JavaScriptCore/dfg/DFGTierUpCheckInjectionPhase.cpp create mode 100644 JavaScriptCore/dfg/DFGTierUpCheckInjectionPhase.h create mode 100644 JavaScriptCore/dfg/DFGToFTLDeferredCompilationCallback.cpp create mode 100644 JavaScriptCore/dfg/DFGToFTLDeferredCompilationCallback.h create mode 100644 JavaScriptCore/dfg/DFGToFTLForOSREntryDeferredCompilationCallback.cpp create mode 100644 JavaScriptCore/dfg/DFGToFTLForOSREntryDeferredCompilationCallback.h create mode 100644 JavaScriptCore/dfg/DFGTypeCheckHoistingPhase.cpp create mode 100644 JavaScriptCore/dfg/DFGTypeCheckHoistingPhase.h create mode 100644 JavaScriptCore/dfg/DFGUnificationPhase.cpp create mode 100644 JavaScriptCore/dfg/DFGUnificationPhase.h create mode 100644 JavaScriptCore/dfg/DFGUseKind.cpp create mode 100644 JavaScriptCore/dfg/DFGUseKind.h create mode 100644 JavaScriptCore/dfg/DFGValidate.cpp create mode 100644 JavaScriptCore/dfg/DFGValidate.h create mode 100644 JavaScriptCore/dfg/DFGValueRecoveryOverride.h create mode 100644 JavaScriptCore/dfg/DFGValueSource.cpp create mode 100644 JavaScriptCore/dfg/DFGValueSource.h create mode 100644 JavaScriptCore/dfg/DFGVariableAccessDataDump.cpp create mode 100644 JavaScriptCore/dfg/DFGVariableAccessDataDump.h create mode 100644 JavaScriptCore/dfg/DFGVariableEvent.cpp create mode 100644 JavaScriptCore/dfg/DFGVariableEvent.h create mode 100644 JavaScriptCore/dfg/DFGVariableEventStream.cpp create mode 100644 JavaScriptCore/dfg/DFGVariableEventStream.h create mode 100644 JavaScriptCore/dfg/DFGVariadicFunction.h create mode 100644 JavaScriptCore/dfg/DFGWatchpointCollectionPhase.cpp create mode 100644 JavaScriptCore/dfg/DFGWatchpointCollectionPhase.h create mode 100644 JavaScriptCore/dfg/DFGWorklist.cpp create mode 100644 JavaScriptCore/dfg/DFGWorklist.h create mode 100644 JavaScriptCore/disassembler/ARM64/A64DOpcode.cpp create mode 100644 JavaScriptCore/disassembler/ARM64/A64DOpcode.h create mode 100644 JavaScriptCore/disassembler/ARM64Disassembler.cpp create mode 100644 JavaScriptCore/disassembler/ARMv7/ARMv7DOpcode.cpp create mode 100644 JavaScriptCore/disassembler/ARMv7/ARMv7DOpcode.h create mode 100644 JavaScriptCore/disassembler/ARMv7Disassembler.cpp create mode 100644 JavaScriptCore/disassembler/Disassembler.cpp create mode 100644 JavaScriptCore/disassembler/Disassembler.h create mode 100644 JavaScriptCore/disassembler/LLVMDisassembler.cpp create mode 100644 JavaScriptCore/disassembler/LLVMDisassembler.h create mode 100644 JavaScriptCore/disassembler/UDis86Disassembler.cpp create mode 100644 JavaScriptCore/disassembler/UDis86Disassembler.h create mode 100644 JavaScriptCore/disassembler/X86Disassembler.cpp create mode 100644 JavaScriptCore/disassembler/udis86/differences.txt create mode 100644 JavaScriptCore/disassembler/udis86/itab.py create mode 100644 JavaScriptCore/disassembler/udis86/optable.xml create mode 100644 JavaScriptCore/disassembler/udis86/ud_opcode.py create mode 100644 JavaScriptCore/disassembler/udis86/ud_optable.py create mode 100644 JavaScriptCore/disassembler/udis86/udis86.c create mode 100644 JavaScriptCore/disassembler/udis86/udis86.h create mode 100644 JavaScriptCore/disassembler/udis86/udis86_decode.c create mode 100644 JavaScriptCore/disassembler/udis86/udis86_decode.h create mode 100644 JavaScriptCore/disassembler/udis86/udis86_extern.h create mode 100644 JavaScriptCore/disassembler/udis86/udis86_input.c create mode 100644 JavaScriptCore/disassembler/udis86/udis86_input.h create mode 100644 JavaScriptCore/disassembler/udis86/udis86_itab_holder.c create mode 100644 JavaScriptCore/disassembler/udis86/udis86_syn-att.c create mode 100644 JavaScriptCore/disassembler/udis86/udis86_syn-intel.c create mode 100644 JavaScriptCore/disassembler/udis86/udis86_syn.c create mode 100644 JavaScriptCore/disassembler/udis86/udis86_syn.h create mode 100644 JavaScriptCore/disassembler/udis86/udis86_types.h create mode 100644 JavaScriptCore/ftl/FTLAbbreviatedTypes.h create mode 100644 JavaScriptCore/ftl/FTLAbbreviations.h create mode 100644 JavaScriptCore/ftl/FTLAbstractHeap.cpp create mode 100644 JavaScriptCore/ftl/FTLAbstractHeap.h create mode 100644 JavaScriptCore/ftl/FTLAbstractHeapRepository.cpp create mode 100644 JavaScriptCore/ftl/FTLAbstractHeapRepository.h create mode 100644 JavaScriptCore/ftl/FTLCArgumentGetter.cpp create mode 100644 JavaScriptCore/ftl/FTLCArgumentGetter.h create mode 100644 JavaScriptCore/ftl/FTLCapabilities.cpp create mode 100644 JavaScriptCore/ftl/FTLCapabilities.h create mode 100644 JavaScriptCore/ftl/FTLCommonValues.cpp create mode 100644 JavaScriptCore/ftl/FTLCommonValues.h create mode 100644 JavaScriptCore/ftl/FTLCompile.cpp create mode 100644 JavaScriptCore/ftl/FTLCompile.h create mode 100644 JavaScriptCore/ftl/FTLExitArgument.cpp create mode 100644 JavaScriptCore/ftl/FTLExitArgument.h create mode 100644 JavaScriptCore/ftl/FTLExitArgumentForOperand.cpp create mode 100644 JavaScriptCore/ftl/FTLExitArgumentForOperand.h create mode 100644 JavaScriptCore/ftl/FTLExitArgumentList.h create mode 100644 JavaScriptCore/ftl/FTLExitThunkGenerator.cpp create mode 100644 JavaScriptCore/ftl/FTLExitThunkGenerator.h create mode 100644 JavaScriptCore/ftl/FTLExitValue.cpp create mode 100644 JavaScriptCore/ftl/FTLExitValue.h create mode 100644 JavaScriptCore/ftl/FTLFail.cpp create mode 100644 JavaScriptCore/ftl/FTLFail.h create mode 100644 JavaScriptCore/ftl/FTLForOSREntryJITCode.cpp create mode 100644 JavaScriptCore/ftl/FTLForOSREntryJITCode.h create mode 100644 JavaScriptCore/ftl/FTLFormattedValue.h create mode 100644 JavaScriptCore/ftl/FTLGeneratedFunction.h create mode 100644 JavaScriptCore/ftl/FTLInlineCacheDescriptor.h create mode 100644 JavaScriptCore/ftl/FTLInlineCacheSize.cpp create mode 100644 JavaScriptCore/ftl/FTLInlineCacheSize.h create mode 100644 JavaScriptCore/ftl/FTLIntrinsicRepository.cpp create mode 100644 JavaScriptCore/ftl/FTLIntrinsicRepository.h create mode 100644 JavaScriptCore/ftl/FTLJITCode.cpp create mode 100644 JavaScriptCore/ftl/FTLJITCode.h create mode 100644 JavaScriptCore/ftl/FTLJITFinalizer.cpp create mode 100644 JavaScriptCore/ftl/FTLJITFinalizer.h create mode 100644 JavaScriptCore/ftl/FTLLink.cpp create mode 100644 JavaScriptCore/ftl/FTLLink.h create mode 100644 JavaScriptCore/ftl/FTLLocation.cpp create mode 100644 JavaScriptCore/ftl/FTLLocation.h create mode 100644 JavaScriptCore/ftl/FTLLowerDFGToLLVM.cpp create mode 100644 JavaScriptCore/ftl/FTLLowerDFGToLLVM.h create mode 100644 JavaScriptCore/ftl/FTLLoweredNodeValue.h create mode 100644 JavaScriptCore/ftl/FTLOSREntry.cpp create mode 100644 JavaScriptCore/ftl/FTLOSREntry.h create mode 100644 JavaScriptCore/ftl/FTLOSRExit.cpp create mode 100644 JavaScriptCore/ftl/FTLOSRExit.h create mode 100644 JavaScriptCore/ftl/FTLOSRExitCompilationInfo.h create mode 100644 JavaScriptCore/ftl/FTLOSRExitCompiler.cpp create mode 100644 JavaScriptCore/ftl/FTLOSRExitCompiler.h create mode 100644 JavaScriptCore/ftl/FTLOutput.cpp create mode 100644 JavaScriptCore/ftl/FTLOutput.h create mode 100644 JavaScriptCore/ftl/FTLSaveRestore.cpp create mode 100644 JavaScriptCore/ftl/FTLSaveRestore.h create mode 100644 JavaScriptCore/ftl/FTLSlowPathCall.cpp create mode 100644 JavaScriptCore/ftl/FTLSlowPathCall.h create mode 100644 JavaScriptCore/ftl/FTLSlowPathCallKey.cpp create mode 100644 JavaScriptCore/ftl/FTLSlowPathCallKey.h create mode 100644 JavaScriptCore/ftl/FTLStackMaps.cpp create mode 100644 JavaScriptCore/ftl/FTLStackMaps.h create mode 100644 JavaScriptCore/ftl/FTLState.cpp create mode 100644 JavaScriptCore/ftl/FTLState.h create mode 100644 JavaScriptCore/ftl/FTLSwitchCase.h create mode 100644 JavaScriptCore/ftl/FTLThunks.cpp create mode 100644 JavaScriptCore/ftl/FTLThunks.h create mode 100644 JavaScriptCore/ftl/FTLTypedPointer.h create mode 100644 JavaScriptCore/ftl/FTLValueFormat.cpp create mode 100644 JavaScriptCore/ftl/FTLValueFormat.h create mode 100644 JavaScriptCore/ftl/FTLValueFromBlock.h create mode 100644 JavaScriptCore/ftl/FTLValueSource.cpp create mode 100644 JavaScriptCore/ftl/FTLValueSource.h delete mode 100644 JavaScriptCore/gyp/JavaScriptCore.gyp delete mode 100755 JavaScriptCore/gyp/generate-derived-sources.sh delete mode 100755 JavaScriptCore/gyp/generate-dtrace-header.sh delete mode 100644 JavaScriptCore/gyp/gtk.gyp delete mode 100755 JavaScriptCore/gyp/run-if-exists.sh delete mode 100755 JavaScriptCore/gyp/update-info-plist.sh delete mode 100644 JavaScriptCore/heap/CardSet.h create mode 100644 JavaScriptCore/heap/CodeBlockSet.cpp create mode 100644 JavaScriptCore/heap/CodeBlockSet.h create mode 100644 JavaScriptCore/heap/CopiedBlockInlines.h delete mode 100644 JavaScriptCore/heap/CopiedSpaceInlineMethods.h create mode 100644 JavaScriptCore/heap/CopiedSpaceInlines.h create mode 100644 JavaScriptCore/heap/CopyToken.h rename JavaScriptCore/{runtime/JSGlobalThis.cpp => heap/CopyVisitor.cpp} (55%) create mode 100644 JavaScriptCore/heap/CopyVisitor.h create mode 100644 JavaScriptCore/heap/CopyVisitorInlines.h create mode 100644 JavaScriptCore/heap/CopyWorkList.h delete mode 100644 JavaScriptCore/heap/DFGCodeBlocks.cpp delete mode 100644 JavaScriptCore/heap/DFGCodeBlocks.h create mode 100644 JavaScriptCore/heap/DeferGC.cpp create mode 100644 JavaScriptCore/heap/DeferGC.h create mode 100644 JavaScriptCore/heap/GCIncomingRefCounted.h create mode 100644 JavaScriptCore/heap/GCIncomingRefCountedInlines.h create mode 100644 JavaScriptCore/heap/GCIncomingRefCountedSet.h create mode 100644 JavaScriptCore/heap/GCIncomingRefCountedSetInlines.h create mode 100644 JavaScriptCore/heap/GCThread.cpp create mode 100644 JavaScriptCore/heap/GCThread.h create mode 100644 JavaScriptCore/heap/GCThreadSharedData.cpp create mode 100644 JavaScriptCore/heap/GCThreadSharedData.h create mode 100644 JavaScriptCore/heap/HandleBlock.h create mode 100644 JavaScriptCore/heap/HandleBlockInlines.h create mode 100644 JavaScriptCore/heap/HeapIterationScope.h create mode 100644 JavaScriptCore/heap/HeapOperation.h create mode 100644 JavaScriptCore/heap/HeapStatistics.cpp create mode 100644 JavaScriptCore/heap/HeapStatistics.h create mode 100644 JavaScriptCore/heap/HeapTimer.cpp create mode 100644 JavaScriptCore/heap/HeapTimer.h create mode 100644 JavaScriptCore/heap/IncrementalSweeper.cpp create mode 100644 JavaScriptCore/heap/IncrementalSweeper.h create mode 100644 JavaScriptCore/heap/JITStubRoutineSet.cpp create mode 100644 JavaScriptCore/heap/JITStubRoutineSet.h create mode 100644 JavaScriptCore/heap/MarkStackInlines.h delete mode 100644 JavaScriptCore/heap/PassWeak.h create mode 100644 JavaScriptCore/heap/Region.h create mode 100644 JavaScriptCore/heap/SlotVisitor.cpp create mode 100644 JavaScriptCore/heap/SlotVisitorInlines.h create mode 100644 JavaScriptCore/heap/SuperRegion.cpp create mode 100644 JavaScriptCore/heap/SuperRegion.h create mode 100644 JavaScriptCore/heap/Weak.cpp create mode 100644 JavaScriptCore/heap/WeakInlines.h create mode 100644 JavaScriptCore/icu/unicode/localpointer.h create mode 100644 JavaScriptCore/icu/unicode/ptypes.h create mode 100644 JavaScriptCore/icu/unicode/unorm2.h create mode 100644 JavaScriptCore/icu/unicode/uvernum.h create mode 100644 JavaScriptCore/interpreter/CallFrameInlines.h create mode 100644 JavaScriptCore/interpreter/JSStack.cpp create mode 100644 JavaScriptCore/interpreter/JSStack.h create mode 100644 JavaScriptCore/interpreter/JSStackInlines.h delete mode 100644 JavaScriptCore/interpreter/RegisterFile.cpp delete mode 100644 JavaScriptCore/interpreter/RegisterFile.h create mode 100644 JavaScriptCore/interpreter/StackVisitor.cpp create mode 100644 JavaScriptCore/interpreter/StackVisitor.h create mode 100644 JavaScriptCore/interpreter/VMInspector.cpp create mode 100644 JavaScriptCore/interpreter/VMInspector.h rename JavaScriptCore/{dfg/DFGAssemblyHelpers.cpp => jit/AssemblyHelpers.cpp} (72%) rename JavaScriptCore/{dfg/DFGAssemblyHelpers.h => jit/AssemblyHelpers.h} (51%) create mode 100644 JavaScriptCore/jit/CCallHelpers.h create mode 100644 JavaScriptCore/jit/ClosureCallStubRoutine.cpp create mode 100644 JavaScriptCore/jit/ClosureCallStubRoutine.h create mode 100644 JavaScriptCore/jit/FPRInfo.h create mode 100644 JavaScriptCore/jit/GCAwareJITStubRoutine.cpp create mode 100644 JavaScriptCore/jit/GCAwareJITStubRoutine.h rename JavaScriptCore/{dfg/DFGGPRInfo.h => jit/GPRInfo.h} (50%) create mode 100644 JavaScriptCore/jit/JITCode.cpp create mode 100644 JavaScriptCore/jit/JITDisassembler.cpp create mode 100644 JavaScriptCore/jit/JITDisassembler.h delete mode 100644 JavaScriptCore/jit/JITDriver.h create mode 100644 JavaScriptCore/jit/JITInlineCacheGenerator.cpp create mode 100644 JavaScriptCore/jit/JITInlineCacheGenerator.h delete mode 100644 JavaScriptCore/jit/JITInlineMethods.h create mode 100644 JavaScriptCore/jit/JITInlines.h create mode 100644 JavaScriptCore/jit/JITOperationWrappers.h create mode 100644 JavaScriptCore/jit/JITOperations.cpp create mode 100644 JavaScriptCore/jit/JITOperations.h delete mode 100644 JavaScriptCore/jit/JITStubCall.h rename JavaScriptCore/{bytecode/MethodCallLinkInfo.cpp => jit/JITStubRoutine.cpp} (75%) create mode 100644 JavaScriptCore/jit/JITStubRoutine.h create mode 100644 JavaScriptCore/jit/JITStubsARM.h create mode 100644 JavaScriptCore/jit/JITStubsARM64.h create mode 100644 JavaScriptCore/jit/JITStubsARMv7.h create mode 100644 JavaScriptCore/jit/JITStubsMIPS.h create mode 100644 JavaScriptCore/jit/JITStubsMSVC64.asm create mode 100644 JavaScriptCore/jit/JITStubsSH4.h create mode 100644 JavaScriptCore/jit/JITStubsX86.h create mode 100644 JavaScriptCore/jit/JITStubsX86Common.h create mode 100644 JavaScriptCore/jit/JITStubsX86_64.h create mode 100644 JavaScriptCore/jit/JITThunks.cpp create mode 100644 JavaScriptCore/jit/JITThunks.h create mode 100644 JavaScriptCore/jit/JITToDFGDeferredCompilationCallback.cpp create mode 100644 JavaScriptCore/jit/JITToDFGDeferredCompilationCallback.h create mode 100644 JavaScriptCore/jit/RegisterSet.cpp create mode 100644 JavaScriptCore/jit/RegisterSet.h create mode 100644 JavaScriptCore/jit/Repatch.cpp create mode 100644 JavaScriptCore/jit/Repatch.h create mode 100644 JavaScriptCore/jit/ScratchRegisterAllocator.h create mode 100644 JavaScriptCore/jit/SlowPathCall.h create mode 100644 JavaScriptCore/jit/TempRegisterSet.cpp create mode 100644 JavaScriptCore/jit/TempRegisterSet.h create mode 100644 JavaScriptCore/jit/ThunkGenerator.h create mode 100644 JavaScriptCore/jit/UnusedPointer.h delete mode 100644 JavaScriptCore/jsc.pro create mode 100644 JavaScriptCore/llint/LLIntCLoop.cpp rename JavaScriptCore/llint/{LLIntEntrypoints.h => LLIntCLoop.h} (62%) create mode 100644 JavaScriptCore/llint/LLIntEntrypoint.cpp create mode 100644 JavaScriptCore/llint/LLIntEntrypoint.h delete mode 100644 JavaScriptCore/llint/LLIntEntrypoints.cpp create mode 100644 JavaScriptCore/llint/LLIntOpcode.h create mode 100644 JavaScriptCore/llvm/InitializeLLVM.cpp create mode 100644 JavaScriptCore/llvm/InitializeLLVM.h create mode 100644 JavaScriptCore/llvm/InitializeLLVMMac.mm create mode 100644 JavaScriptCore/llvm/InitializeLLVMPOSIX.cpp create mode 100644 JavaScriptCore/llvm/InitializeLLVMPOSIX.h rename WTF/wtf/NotFound.h => JavaScriptCore/llvm/LLVMAPI.cpp (84%) create mode 100644 JavaScriptCore/llvm/LLVMAPI.h create mode 100644 JavaScriptCore/llvm/LLVMAPIFunctions.h create mode 100644 JavaScriptCore/llvm/LLVMHeaders.h create mode 100644 JavaScriptCore/llvm/library/LLVMAnchor.cpp create mode 100644 JavaScriptCore/llvm/library/LLVMExports.cpp create mode 100644 JavaScriptCore/llvm/library/LLVMOverrides.cpp create mode 100644 JavaScriptCore/llvm/library/config_llvm.h create mode 100644 JavaScriptCore/offlineasm/arm.rb create mode 100644 JavaScriptCore/offlineasm/arm64.rb delete mode 100644 JavaScriptCore/offlineasm/armv7.rb create mode 100644 JavaScriptCore/offlineasm/cloop.rb create mode 100644 JavaScriptCore/offlineasm/config.rb create mode 100644 JavaScriptCore/offlineasm/mips.rb create mode 100644 JavaScriptCore/offlineasm/risc.rb create mode 100644 JavaScriptCore/offlineasm/sh4.rb delete mode 100644 JavaScriptCore/os-win32/WinMain.cpp delete mode 100644 JavaScriptCore/os-win32/stdint.h create mode 100644 JavaScriptCore/parser/ParserError.h create mode 100644 JavaScriptCore/parser/ParserModes.h create mode 100644 JavaScriptCore/parser/SourceCode.cpp create mode 100644 JavaScriptCore/parser/SourceProvider.cpp rename JavaScriptCore/profiler/{Profiler.cpp => LegacyProfiler.cpp} (73%) rename JavaScriptCore/profiler/{Profiler.h => LegacyProfiler.h} (53%) create mode 100644 JavaScriptCore/profiler/ProfilerBytecode.cpp create mode 100644 JavaScriptCore/profiler/ProfilerBytecode.h create mode 100644 JavaScriptCore/profiler/ProfilerBytecodeSequence.cpp create mode 100644 JavaScriptCore/profiler/ProfilerBytecodeSequence.h rename JavaScriptCore/{bytecode/MethodCallLinkStatus.cpp => profiler/ProfilerBytecodes.cpp} (50%) create mode 100644 JavaScriptCore/profiler/ProfilerBytecodes.h create mode 100644 JavaScriptCore/profiler/ProfilerCompilation.cpp create mode 100644 JavaScriptCore/profiler/ProfilerCompilation.h create mode 100644 JavaScriptCore/profiler/ProfilerCompilationKind.cpp create mode 100644 JavaScriptCore/profiler/ProfilerCompilationKind.h create mode 100644 JavaScriptCore/profiler/ProfilerCompiledBytecode.cpp create mode 100644 JavaScriptCore/profiler/ProfilerCompiledBytecode.h create mode 100644 JavaScriptCore/profiler/ProfilerDatabase.cpp create mode 100644 JavaScriptCore/profiler/ProfilerDatabase.h create mode 100644 JavaScriptCore/profiler/ProfilerExecutionCounter.h create mode 100644 JavaScriptCore/profiler/ProfilerOSRExit.cpp create mode 100644 JavaScriptCore/profiler/ProfilerOSRExit.h create mode 100644 JavaScriptCore/profiler/ProfilerOSRExitSite.cpp create mode 100644 JavaScriptCore/profiler/ProfilerOSRExitSite.h create mode 100644 JavaScriptCore/profiler/ProfilerOrigin.cpp create mode 100644 JavaScriptCore/profiler/ProfilerOrigin.h create mode 100644 JavaScriptCore/profiler/ProfilerOriginStack.cpp create mode 100644 JavaScriptCore/profiler/ProfilerOriginStack.h create mode 100644 JavaScriptCore/profiler/ProfilerProfiledBytecodes.cpp create mode 100644 JavaScriptCore/profiler/ProfilerProfiledBytecodes.h create mode 100644 JavaScriptCore/runtime/ArrayBuffer.cpp rename {WTF/wtf => JavaScriptCore/runtime}/ArrayBuffer.h (78%) rename {WTF/wtf => JavaScriptCore/runtime}/ArrayBufferView.cpp (78%) rename {WTF/wtf => JavaScriptCore/runtime}/ArrayBufferView.h (69%) create mode 100644 JavaScriptCore/runtime/ArrayConventions.h create mode 100644 JavaScriptCore/runtime/ArrayIteratorConstructor.cpp create mode 100644 JavaScriptCore/runtime/ArrayIteratorConstructor.h create mode 100644 JavaScriptCore/runtime/ArrayIteratorPrototype.cpp create mode 100644 JavaScriptCore/runtime/ArrayIteratorPrototype.h create mode 100644 JavaScriptCore/runtime/ArrayStorage.h create mode 100644 JavaScriptCore/runtime/Butterfly.h create mode 100644 JavaScriptCore/runtime/ButterflyInlines.h create mode 100644 JavaScriptCore/runtime/CodeCache.cpp create mode 100644 JavaScriptCore/runtime/CodeCache.h create mode 100644 JavaScriptCore/runtime/CodeSpecializationKind.cpp create mode 100644 JavaScriptCore/runtime/CommonSlowPaths.cpp create mode 100644 JavaScriptCore/runtime/CommonSlowPathsExceptions.cpp create mode 100644 JavaScriptCore/runtime/CommonSlowPathsExceptions.h create mode 100644 JavaScriptCore/runtime/CompilationResult.cpp create mode 100644 JavaScriptCore/runtime/CompilationResult.h create mode 100644 JavaScriptCore/runtime/ConcurrentJITLock.h create mode 100644 JavaScriptCore/runtime/DataView.cpp create mode 100644 JavaScriptCore/runtime/DataView.h create mode 100644 JavaScriptCore/runtime/DumpContext.cpp create mode 100644 JavaScriptCore/runtime/DumpContext.h delete mode 100644 JavaScriptCore/runtime/ExecutionHarness.h create mode 100644 JavaScriptCore/runtime/Float32Array.h create mode 100644 JavaScriptCore/runtime/Float64Array.h create mode 100644 JavaScriptCore/runtime/FunctionExecutableDump.cpp create mode 100644 JavaScriptCore/runtime/FunctionExecutableDump.h create mode 100644 JavaScriptCore/runtime/GCActivityCallbackBlackBerry.cpp delete mode 100644 JavaScriptCore/runtime/GCActivityCallbackCF.cpp create mode 100644 JavaScriptCore/runtime/GenericTypedArrayView.h create mode 100644 JavaScriptCore/runtime/GenericTypedArrayViewInlines.h create mode 100644 JavaScriptCore/runtime/IndexingHeader.h create mode 100644 JavaScriptCore/runtime/IndexingHeaderInlines.h create mode 100644 JavaScriptCore/runtime/IndexingType.cpp create mode 100644 JavaScriptCore/runtime/IndexingType.h create mode 100644 JavaScriptCore/runtime/Int16Array.h create mode 100644 JavaScriptCore/runtime/Int32Array.h create mode 100644 JavaScriptCore/runtime/Int8Array.h rename {WTF/wtf => JavaScriptCore/runtime}/IntegralTypedArrayBase.h (82%) create mode 100644 JavaScriptCore/runtime/IntendedStructureChain.cpp create mode 100644 JavaScriptCore/runtime/IntendedStructureChain.h create mode 100644 JavaScriptCore/runtime/JSArrayBuffer.cpp create mode 100644 JavaScriptCore/runtime/JSArrayBuffer.h create mode 100644 JavaScriptCore/runtime/JSArrayBufferConstructor.cpp create mode 100644 JavaScriptCore/runtime/JSArrayBufferConstructor.h create mode 100644 JavaScriptCore/runtime/JSArrayBufferPrototype.cpp create mode 100644 JavaScriptCore/runtime/JSArrayBufferPrototype.h create mode 100644 JavaScriptCore/runtime/JSArrayBufferView.cpp create mode 100644 JavaScriptCore/runtime/JSArrayBufferView.h create mode 100644 JavaScriptCore/runtime/JSArrayBufferViewInlines.h create mode 100644 JavaScriptCore/runtime/JSArrayIterator.cpp create mode 100644 JavaScriptCore/runtime/JSArrayIterator.h rename JavaScriptCore/runtime/{JSValue.cpp => JSCJSValue.cpp} (64%) create mode 100644 JavaScriptCore/runtime/JSCJSValue.h create mode 100644 JavaScriptCore/runtime/JSCJSValueInlines.h create mode 100644 JavaScriptCore/runtime/JSCellInlines.h create mode 100644 JavaScriptCore/runtime/JSDataView.cpp create mode 100644 JavaScriptCore/runtime/JSDataView.h create mode 100644 JavaScriptCore/runtime/JSDataViewPrototype.cpp create mode 100644 JavaScriptCore/runtime/JSDataViewPrototype.h create mode 100644 JavaScriptCore/runtime/JSDestructibleObject.h create mode 100644 JavaScriptCore/runtime/JSFloat32Array.h create mode 100644 JavaScriptCore/runtime/JSFloat64Array.h create mode 100644 JavaScriptCore/runtime/JSFunctionInlines.h create mode 100644 JavaScriptCore/runtime/JSGenericTypedArrayView.h create mode 100644 JavaScriptCore/runtime/JSGenericTypedArrayViewConstructor.h create mode 100644 JavaScriptCore/runtime/JSGenericTypedArrayViewConstructorInlines.h create mode 100644 JavaScriptCore/runtime/JSGenericTypedArrayViewInlines.h create mode 100644 JavaScriptCore/runtime/JSGenericTypedArrayViewPrototype.h create mode 100644 JavaScriptCore/runtime/JSGenericTypedArrayViewPrototypeInlines.h delete mode 100644 JavaScriptCore/runtime/JSGlobalData.cpp create mode 100644 JavaScriptCore/runtime/JSInt16Array.h create mode 100644 JavaScriptCore/runtime/JSInt32Array.h create mode 100644 JavaScriptCore/runtime/JSInt8Array.h create mode 100644 JavaScriptCore/runtime/JSMap.cpp create mode 100644 JavaScriptCore/runtime/JSMap.h create mode 100644 JavaScriptCore/runtime/JSNameScope.cpp create mode 100644 JavaScriptCore/runtime/JSNameScope.h create mode 100644 JavaScriptCore/runtime/JSPromise.cpp create mode 100644 JavaScriptCore/runtime/JSPromise.h create mode 100644 JavaScriptCore/runtime/JSPromiseCallback.cpp create mode 100644 JavaScriptCore/runtime/JSPromiseCallback.h create mode 100644 JavaScriptCore/runtime/JSPromiseConstructor.cpp create mode 100644 JavaScriptCore/runtime/JSPromiseConstructor.h create mode 100644 JavaScriptCore/runtime/JSPromisePrototype.cpp create mode 100644 JavaScriptCore/runtime/JSPromisePrototype.h create mode 100644 JavaScriptCore/runtime/JSPromiseResolver.cpp create mode 100644 JavaScriptCore/runtime/JSPromiseResolver.h create mode 100644 JavaScriptCore/runtime/JSPromiseResolverConstructor.cpp create mode 100644 JavaScriptCore/runtime/JSPromiseResolverConstructor.h create mode 100644 JavaScriptCore/runtime/JSPromiseResolverPrototype.cpp create mode 100644 JavaScriptCore/runtime/JSPromiseResolverPrototype.h create mode 100644 JavaScriptCore/runtime/JSProxy.cpp create mode 100644 JavaScriptCore/runtime/JSProxy.h create mode 100644 JavaScriptCore/runtime/JSScope.cpp create mode 100644 JavaScriptCore/runtime/JSScope.h rename JavaScriptCore/runtime/{TimeoutChecker.h => JSSegmentedVariableObject.cpp} (50%) create mode 100644 JavaScriptCore/runtime/JSSegmentedVariableObject.h create mode 100644 JavaScriptCore/runtime/JSSet.cpp create mode 100644 JavaScriptCore/runtime/JSSet.h create mode 100644 JavaScriptCore/runtime/JSSymbolTableObject.cpp create mode 100644 JavaScriptCore/runtime/JSSymbolTableObject.h create mode 100644 JavaScriptCore/runtime/JSTypedArrayConstructors.cpp create mode 100644 JavaScriptCore/runtime/JSTypedArrayConstructors.h create mode 100644 JavaScriptCore/runtime/JSTypedArrayPrototypes.cpp create mode 100644 JavaScriptCore/runtime/JSTypedArrayPrototypes.h create mode 100644 JavaScriptCore/runtime/JSTypedArrays.cpp create mode 100644 JavaScriptCore/runtime/JSTypedArrays.h create mode 100644 JavaScriptCore/runtime/JSUint16Array.h create mode 100644 JavaScriptCore/runtime/JSUint32Array.h create mode 100644 JavaScriptCore/runtime/JSUint8Array.h create mode 100644 JavaScriptCore/runtime/JSUint8ClampedArray.h delete mode 100644 JavaScriptCore/runtime/JSValue.h delete mode 100644 JavaScriptCore/runtime/JSValueInlineMethods.h create mode 100644 JavaScriptCore/runtime/JSWeakMap.cpp rename JavaScriptCore/runtime/{JSGlobalThis.h => JSWeakMap.h} (55%) create mode 100644 JavaScriptCore/runtime/JSWithScope.cpp create mode 100644 JavaScriptCore/runtime/JSWithScope.h create mode 100644 JavaScriptCore/runtime/MapConstructor.cpp create mode 100644 JavaScriptCore/runtime/MapConstructor.h create mode 100644 JavaScriptCore/runtime/MapData.cpp create mode 100644 JavaScriptCore/runtime/MapData.h create mode 100644 JavaScriptCore/runtime/MapPrototype.cpp create mode 100644 JavaScriptCore/runtime/MapPrototype.h create mode 100644 JavaScriptCore/runtime/NameConstructor.cpp create mode 100644 JavaScriptCore/runtime/NameConstructor.h create mode 100644 JavaScriptCore/runtime/NameInstance.cpp create mode 100644 JavaScriptCore/runtime/NameInstance.h create mode 100644 JavaScriptCore/runtime/NamePrototype.cpp create mode 100644 JavaScriptCore/runtime/NamePrototype.h create mode 100644 JavaScriptCore/runtime/PrivateName.h create mode 100644 JavaScriptCore/runtime/PropertyName.h create mode 100644 JavaScriptCore/runtime/PropertyOffset.h rename JavaScriptCore/runtime/{StorageBarrier.h => PropertyStorage.h} (53%) create mode 100644 JavaScriptCore/runtime/PropertyTable.cpp create mode 100644 JavaScriptCore/runtime/PrototypeMap.cpp create mode 100644 JavaScriptCore/runtime/PrototypeMap.h create mode 100644 JavaScriptCore/runtime/PutDirectIndexMode.h create mode 100644 JavaScriptCore/runtime/Reject.h delete mode 100644 JavaScriptCore/runtime/ScopeChain.cpp delete mode 100644 JavaScriptCore/runtime/ScopeChain.h create mode 100644 JavaScriptCore/runtime/SetConstructor.cpp create mode 100644 JavaScriptCore/runtime/SetConstructor.h create mode 100644 JavaScriptCore/runtime/SetPrototype.cpp create mode 100644 JavaScriptCore/runtime/SetPrototype.h rename JavaScriptCore/{assembler/MacroAssemblerSH4.cpp => runtime/SimpleTypedArrayController.cpp} (64%) create mode 100644 JavaScriptCore/runtime/SimpleTypedArrayController.h create mode 100644 JavaScriptCore/runtime/SparseArrayValueMap.cpp create mode 100644 JavaScriptCore/runtime/SparseArrayValueMap.h create mode 100644 JavaScriptCore/runtime/StructureInlines.h create mode 100644 JavaScriptCore/runtime/StructureRareData.cpp create mode 100644 JavaScriptCore/runtime/StructureRareData.h create mode 100644 JavaScriptCore/runtime/StructureRareDataInlines.h create mode 100644 JavaScriptCore/runtime/SymbolTable.cpp create mode 100644 JavaScriptCore/runtime/TestRunnerUtils.cpp create mode 100644 JavaScriptCore/runtime/TestRunnerUtils.h delete mode 100644 JavaScriptCore/runtime/TimeoutChecker.cpp create mode 100644 JavaScriptCore/runtime/ToNativeFromValue.h create mode 100644 JavaScriptCore/runtime/TypedArrayAdaptors.h rename {WTF/wtf => JavaScriptCore/runtime}/TypedArrayBase.h (86%) create mode 100644 JavaScriptCore/runtime/TypedArrayController.cpp create mode 100644 JavaScriptCore/runtime/TypedArrayController.h create mode 100644 JavaScriptCore/runtime/TypedArrayInlines.h create mode 100644 JavaScriptCore/runtime/TypedArrayType.cpp create mode 100644 JavaScriptCore/runtime/TypedArrayType.h create mode 100644 JavaScriptCore/runtime/TypedArrays.h delete mode 100644 JavaScriptCore/runtime/UString.cpp delete mode 100644 JavaScriptCore/runtime/UString.h delete mode 100644 JavaScriptCore/runtime/UStringConcatenate.h create mode 100644 JavaScriptCore/runtime/Uint16Array.h create mode 100644 JavaScriptCore/runtime/Uint32Array.h create mode 100644 JavaScriptCore/runtime/Uint8Array.h create mode 100644 JavaScriptCore/runtime/Uint8ClampedArray.h create mode 100644 JavaScriptCore/runtime/VM.cpp rename JavaScriptCore/runtime/{JSGlobalData.h => VM.h} (51%) create mode 100644 JavaScriptCore/runtime/VMStackBounds.h create mode 100644 JavaScriptCore/runtime/Watchdog.cpp create mode 100644 JavaScriptCore/runtime/Watchdog.h create mode 100644 JavaScriptCore/runtime/WatchdogMac.cpp create mode 100644 JavaScriptCore/runtime/WatchdogNone.cpp create mode 100644 JavaScriptCore/runtime/WeakMapConstructor.cpp create mode 100644 JavaScriptCore/runtime/WeakMapConstructor.h create mode 100644 JavaScriptCore/runtime/WeakMapData.cpp create mode 100644 JavaScriptCore/runtime/WeakMapData.h create mode 100644 JavaScriptCore/runtime/WeakMapPrototype.cpp create mode 100644 JavaScriptCore/runtime/WeakMapPrototype.h create mode 100644 JavaScriptCore/shell/PlatformGTK.cmake delete mode 100644 JavaScriptCore/shell/PlatformWinCE.cmake create mode 100644 JavaScriptCore/tests/mozilla/mozilla-tests.yaml delete mode 100644 JavaScriptCore/wscript delete mode 100644 JavaScriptCore/yarr/yarr.pri create mode 100644 WTF/ChangeLog-2013-10-13 delete mode 100644 WTF/Configurations/CompilerVersion.xcconfig create mode 100644 WTF/Configurations/CopyWTFHeaders.xcconfig create mode 100644 WTF/Configurations/iOS.xcconfig delete mode 100644 WTF/WTF.gyp/.gitignore delete mode 100644 WTF/WTF.gyp/WTF.gyp delete mode 100644 WTF/WTF.gypi delete mode 100644 WTF/WTF.pri delete mode 100644 WTF/WTF.pro delete mode 100644 WTF/WTF.vcproj/WTF.make delete mode 100644 WTF/WTF.vcproj/WTF.sln delete mode 100644 WTF/WTF.vcproj/WTF.vcproj delete mode 100644 WTF/WTF.vcproj/WTFCommon.vsprops delete mode 100644 WTF/WTF.vcproj/WTFDebug.vsprops delete mode 100644 WTF/WTF.vcproj/WTFDebugAll.vsprops delete mode 100644 WTF/WTF.vcproj/WTFDebugCairoCFLite.vsprops delete mode 100644 WTF/WTF.vcproj/WTFGenerated.make delete mode 100644 WTF/WTF.vcproj/WTFGenerated.vcproj delete mode 100644 WTF/WTF.vcproj/WTFGeneratedCommon.vsprops delete mode 100644 WTF/WTF.vcproj/WTFGeneratedDebug.vsprops delete mode 100644 WTF/WTF.vcproj/WTFGeneratedDebugAll.vsprops delete mode 100644 WTF/WTF.vcproj/WTFGeneratedDebugCairoCFLite.vsprops delete mode 100644 WTF/WTF.vcproj/WTFGeneratedProduction.vsprops delete mode 100644 WTF/WTF.vcproj/WTFGeneratedRelease.vsprops delete mode 100644 WTF/WTF.vcproj/WTFGeneratedReleaseCairoCFLite.vsprops delete mode 100644 WTF/WTF.vcproj/WTFProduction.vsprops delete mode 100644 WTF/WTF.vcproj/WTFRelease.vsprops delete mode 100644 WTF/WTF.vcproj/WTFReleaseCairoCFLite.vsprops create mode 100644 WTF/WTF.vcxproj/WTF.make create mode 100644 WTF/WTF.vcxproj/WTF.submit.sln create mode 100644 WTF/WTF.vcxproj/WTF.vcxproj create mode 100644 WTF/WTF.vcxproj/WTF.vcxproj.filters create mode 100644 WTF/WTF.vcxproj/WTFCFLite.props create mode 100644 WTF/WTF.vcxproj/WTFCommon.props create mode 100644 WTF/WTF.vcxproj/WTFCoreFoundation.props create mode 100644 WTF/WTF.vcxproj/WTFDebug.props create mode 100644 WTF/WTF.vcxproj/WTFDebugWinCairo.props create mode 100644 WTF/WTF.vcxproj/WTFGenerated.make create mode 100644 WTF/WTF.vcxproj/WTFGenerated.vcxproj create mode 100644 WTF/WTF.vcxproj/WTFGenerated.vcxproj.filters create mode 100644 WTF/WTF.vcxproj/WTFGeneratedCommon.props create mode 100644 WTF/WTF.vcxproj/WTFGeneratedDebug.props create mode 100644 WTF/WTF.vcxproj/WTFGeneratedProduction.props create mode 100644 WTF/WTF.vcxproj/WTFGeneratedRelease.props rename WTF/{WTF.vcproj => WTF.vcxproj}/WTFPostBuild.cmd (100%) rename WTF/{WTF.vcproj => WTF.vcxproj}/WTFPreBuild.cmd (100%) create mode 100644 WTF/WTF.vcxproj/WTFProduction.props create mode 100644 WTF/WTF.vcxproj/WTFRelease.props create mode 100644 WTF/WTF.vcxproj/WTFReleaseWinCairo.props rename WTF/{WTF.vcproj => WTF.vcxproj}/build-generated-files.sh (78%) mode change 100755 => 100644 rename WTF/{WTF.vcproj => WTF.vcxproj}/copy-files.cmd (67%) rename WTF/{WTF.vcproj => WTF.vcxproj}/work-around-vs-dependency-tracking-bugs.py (92%) create mode 100644 WTF/icu/unicode/bytestream.h create mode 100644 WTF/icu/unicode/localpointer.h create mode 100644 WTF/icu/unicode/ptypes.h create mode 100644 WTF/icu/unicode/rep.h create mode 100644 WTF/icu/unicode/std_string.h create mode 100644 WTF/icu/unicode/strenum.h create mode 100644 WTF/icu/unicode/stringpiece.h create mode 100644 WTF/icu/unicode/unistr.h create mode 100644 WTF/icu/unicode/unorm2.h create mode 100644 WTF/icu/unicode/uobject.h create mode 100644 WTF/icu/unicode/uvernum.h delete mode 100644 WTF/wscript delete mode 100644 WTF/wtf/Alignment.h delete mode 100644 WTF/wtf/AlwaysInline.h delete mode 100644 WTF/wtf/ArrayBuffer.cpp create mode 100644 WTF/wtf/Atomics.cpp rename WTF/wtf/{PassTraits.h => AutodrainedPool.h} (62%) rename JavaScriptCore/runtime/Terminator.h => WTF/wtf/AutodrainedPoolMac.mm (74%) create mode 100644 WTF/wtf/Bag.h create mode 100644 WTF/wtf/BagToHashMap.h create mode 100644 WTF/wtf/BitArray.h rename WTF/wtf/{chromium/MainThreadChromium.cpp => ByteOrder.h} (53%) create mode 100644 WTF/wtf/ByteSpinLock.h create mode 100644 WTF/wtf/CommaPrinter.h create mode 100644 WTF/wtf/CompilationThread.cpp create mode 100644 WTF/wtf/CompilationThread.h create mode 100644 WTF/wtf/Compression.cpp create mode 100644 WTF/wtf/Compression.h create mode 100644 WTF/wtf/DeferrableRefCounted.h create mode 100644 WTF/wtf/EnumClass.h delete mode 100644 WTF/wtf/FastAllocBase.h create mode 100644 WTF/wtf/FastBitVector.h create mode 100644 WTF/wtf/FeatureDefines.h create mode 100644 WTF/wtf/FilePrintStream.cpp create mode 100644 WTF/wtf/FilePrintStream.h create mode 100644 WTF/wtf/FlipBytes.h delete mode 100644 WTF/wtf/Float32Array.h delete mode 100644 WTF/wtf/Float64Array.h create mode 100644 WTF/wtf/FunctionDispatcher.cpp create mode 100644 WTF/wtf/FunctionDispatcher.h create mode 100644 WTF/wtf/GregorianDateTime.cpp create mode 100644 WTF/wtf/GregorianDateTime.h create mode 100644 WTF/wtf/Insertion.h delete mode 100644 WTF/wtf/Int16Array.h delete mode 100644 WTF/wtf/Int32Array.h delete mode 100644 WTF/wtf/Int8Array.h create mode 100644 WTF/wtf/ListDump.h delete mode 100644 WTF/wtf/ListRefPtr.h create mode 100644 WTF/wtf/MallocPtr.h delete mode 100644 WTF/wtf/MallocZoneSupport.h create mode 100644 WTF/wtf/MediaTime.cpp create mode 100644 WTF/wtf/MediaTime.h create mode 100644 WTF/wtf/NeverDestroyed.h create mode 100644 WTF/wtf/NoLock.h delete mode 100644 WTF/wtf/NonCopyingSort.h delete mode 100644 WTF/wtf/NullPtr.cpp delete mode 100644 WTF/wtf/NullPtr.h create mode 100644 WTF/wtf/ObjcRuntimeExtras.h delete mode 100644 WTF/wtf/OwnArrayPtr.h delete mode 100644 WTF/wtf/PassOwnArrayPtr.h create mode 100644 WTF/wtf/PassRef.h create mode 100644 WTF/wtf/PlatformGTK.cmake create mode 100644 WTF/wtf/PlatformWin.cmake delete mode 100644 WTF/wtf/PlatformWinCE.cmake create mode 100644 WTF/wtf/PrintStream.cpp create mode 100644 WTF/wtf/PrintStream.h create mode 100644 WTF/wtf/ProcessID.h create mode 100644 WTF/wtf/RAMSize.cpp create mode 100644 WTF/wtf/RAMSize.h rename WTF/wtf/{url/api/URLString.h => RawPointer.h} (71%) create mode 100644 WTF/wtf/Ref.h rename WTF/wtf/{qt/MainThreadQt.cpp => RunLoopTimer.h} (53%) create mode 100644 WTF/wtf/RunLoopTimerCF.cpp create mode 100644 WTF/wtf/SaturatedArithmetic.h create mode 100644 WTF/wtf/SchedulePair.h create mode 100644 WTF/wtf/SchedulePairCF.cpp rename WTF/wtf/{Complex.h => SchedulePairMac.mm} (78%) create mode 100644 WTF/wtf/SixCharacterHash.cpp create mode 100644 WTF/wtf/SixCharacterHash.h create mode 100644 WTF/wtf/StackStats.cpp create mode 100644 WTF/wtf/StackStats.h create mode 100644 WTF/wtf/StreamBuffer.h create mode 100644 WTF/wtf/StringHashDumpContext.h create mode 100644 WTF/wtf/StringPrintStream.cpp create mode 100644 WTF/wtf/StringPrintStream.h rename WTF/wtf/{wx/MainThreadWx.cpp => ThreadingOnce.h} (68%) create mode 100644 WTF/wtf/TriState.h delete mode 100644 WTF/wtf/TypeTraits.cpp delete mode 100644 WTF/wtf/TypeTraits.h delete mode 100644 WTF/wtf/Uint16Array.h delete mode 100644 WTF/wtf/Uint32Array.h delete mode 100644 WTF/wtf/Uint8Array.h delete mode 100644 WTF/wtf/Uint8ClampedArray.h create mode 100644 WTF/wtf/UniStdExtras.h delete mode 100644 WTF/wtf/UnusedParam.h create mode 100644 WTF/wtf/WeakPtr.h create mode 100644 WTF/wtf/WindowsExtras.h delete mode 100644 WTF/wtf/chromium/ChromiumThreading.h create mode 100644 WTF/wtf/efl/RefPtrEfl.cpp rename JavaScriptCore/runtime/ScopeChainMark.h => WTF/wtf/efl/RefPtrEfl.h (69%) create mode 100644 WTF/wtf/gobject/GMutexLocker.h create mode 100644 WTF/wtf/ios/WebCoreThread.cpp create mode 100644 WTF/wtf/ios/WebCoreThread.h create mode 100644 WTF/wtf/nix/FeatureDefinesNix.h create mode 100644 WTF/wtf/nix/PlatformNix.h delete mode 100644 WTF/wtf/qt/StringQt.cpp delete mode 100644 WTF/wtf/qt/UtilsQt.h delete mode 100644 WTF/wtf/qt/compat/QGuiApplication delete mode 100644 WTF/wtf/qt/compat/qguiapplication.h create mode 100644 WTF/wtf/text/AtomicStringTable.cpp create mode 100644 WTF/wtf/text/AtomicStringTable.h create mode 100644 WTF/wtf/text/Base64.cpp create mode 100644 WTF/wtf/text/Base64.h create mode 100644 WTF/wtf/text/ConversionMode.h create mode 100644 WTF/wtf/text/IntegerToStringConversion.h delete mode 100644 WTF/wtf/unicode/glib/UnicodeGLib.cpp delete mode 100644 WTF/wtf/unicode/glib/UnicodeGLib.h delete mode 100644 WTF/wtf/unicode/qt4/UnicodeQt4.h create mode 100644 WTF/wtf/unicode/wchar/UnicodeWchar.cpp create mode 100644 WTF/wtf/unicode/wchar/UnicodeWchar.h delete mode 100644 WTF/wtf/unicode/wince/UnicodeWinCE.cpp delete mode 100644 WTF/wtf/unicode/wince/UnicodeWinCE.h delete mode 100644 WTF/wtf/url/api/ParsedURL.cpp delete mode 100644 WTF/wtf/url/src/RawURLBuffer.h delete mode 100644 WTF/wtf/url/src/URLBuffer.h delete mode 100644 WTF/wtf/url/src/URLCharacterTypes.cpp delete mode 100644 WTF/wtf/url/src/URLCharacterTypes.h delete mode 100644 WTF/wtf/url/src/URLComponent.h delete mode 100644 WTF/wtf/url/src/URLEscape.cpp delete mode 100644 WTF/wtf/url/src/URLEscape.h delete mode 100644 WTF/wtf/url/src/URLParser.h delete mode 100644 WTF/wtf/url/src/URLQueryCanonicalizer.h delete mode 100644 WTF/wtf/url/src/URLSegments.cpp delete mode 100644 WTF/wtf/url/src/URLSegments.h create mode 100644 WTF/wtf/win/GDIObject.h delete mode 100644 WTF/wtf/wince/FastMallocWinCE.h delete mode 100644 WTF/wtf/wince/MemoryManager.cpp delete mode 100644 WTF/wtf/wince/MemoryManager.h delete mode 100644 WTF/wtf/wx/StringWx.cpp diff --git a/JavaScriptCore/API/APICallbackFunction.h b/JavaScriptCore/API/APICallbackFunction.h new file mode 100644 index 00000000..65c519b7 --- /dev/null +++ b/JavaScriptCore/API/APICallbackFunction.h @@ -0,0 +1,109 @@ +/* + * Copyright (C) 2013 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. + */ + +#ifndef APICallbackFunction_h +#define APICallbackFunction_h + +#include "APICast.h" +#include "APIShims.h" +#include "Error.h" +#include "JSCallbackConstructor.h" +#include + +namespace JSC { + +struct APICallbackFunction { + +template static EncodedJSValue JSC_HOST_CALL call(ExecState*); +template static EncodedJSValue JSC_HOST_CALL construct(ExecState*); + +}; + +template +EncodedJSValue JSC_HOST_CALL APICallbackFunction::call(ExecState* exec) +{ + JSContextRef execRef = toRef(exec); + JSObjectRef functionRef = toRef(exec->callee()); + JSObjectRef thisObjRef = toRef(jsCast(exec->hostThisValue().toThis(exec, NotStrictMode))); + + int argumentCount = static_cast(exec->argumentCount()); + Vector arguments; + arguments.reserveInitialCapacity(argumentCount); + for (int i = 0; i < argumentCount; i++) + arguments.uncheckedAppend(toRef(exec, exec->uncheckedArgument(i))); + + JSValueRef exception = 0; + JSValueRef result; + { + APICallbackShim callbackShim(exec); + result = jsCast(toJS(functionRef))->functionCallback()(execRef, functionRef, thisObjRef, argumentCount, arguments.data(), &exception); + } + if (exception) + exec->vm().throwException(exec, toJS(exec, exception)); + + // result must be a valid JSValue. + if (!result) + return JSValue::encode(jsUndefined()); + + return JSValue::encode(toJS(exec, result)); +} + +template +EncodedJSValue JSC_HOST_CALL APICallbackFunction::construct(ExecState* exec) +{ + JSObject* constructor = exec->callee(); + JSContextRef ctx = toRef(exec); + JSObjectRef constructorRef = toRef(constructor); + + JSObjectCallAsConstructorCallback callback = jsCast(constructor)->constructCallback(); + if (callback) { + size_t argumentCount = exec->argumentCount(); + Vector arguments; + arguments.reserveInitialCapacity(argumentCount); + for (size_t i = 0; i < argumentCount; ++i) + arguments.uncheckedAppend(toRef(exec, exec->uncheckedArgument(i))); + + JSValueRef exception = 0; + JSObjectRef result; + { + APICallbackShim callbackShim(exec); + result = callback(ctx, constructorRef, argumentCount, arguments.data(), &exception); + } + if (exception) { + exec->vm().throwException(exec, toJS(exec, exception)); + return JSValue::encode(toJS(exec, exception)); + } + // result must be a valid JSValue. + if (!result) + return throwVMTypeError(exec); + return JSValue::encode(toJS(result)); + } + + return JSValue::encode(toJS(JSObjectMake(ctx, jsCast(constructor)->classRef(), 0))); +} + +} // namespace JSC + +#endif // APICallbackFunction_h diff --git a/JavaScriptCore/API/APICast.h b/JavaScriptCore/API/APICast.h index f019a7a4..6526d890 100644 --- a/JavaScriptCore/API/APICast.h +++ b/JavaScriptCore/API/APICast.h @@ -27,14 +27,14 @@ #define APICast_h #include "JSAPIValueWrapper.h" +#include "JSCJSValue.h" +#include "JSCJSValueInlines.h" #include "JSGlobalObject.h" -#include "JSValue.h" -#include namespace JSC { class ExecState; class PropertyNameArray; - class JSGlobalData; + class VM; class JSObject; class JSValue; } @@ -63,46 +63,63 @@ inline JSC::ExecState* toJS(JSGlobalContextRef c) inline JSC::JSValue toJS(JSC::ExecState* exec, JSValueRef v) { ASSERT_UNUSED(exec, exec); - ASSERT(v); #if USE(JSVALUE32_64) JSC::JSCell* jsCell = reinterpret_cast(const_cast(v)); if (!jsCell) - return JSC::JSValue(); + return JSC::jsNull(); + JSC::JSValue result; if (jsCell->isAPIValueWrapper()) - return JSC::jsCast(jsCell)->value(); - return jsCell; + result = JSC::jsCast(jsCell)->value(); + else + result = jsCell; #else - return JSC::JSValue::decode(reinterpret_cast(const_cast(v))); + JSC::JSValue result = JSC::JSValue::decode(reinterpret_cast(const_cast(v))); #endif + if (!result) + return JSC::jsNull(); + if (result.isCell()) + RELEASE_ASSERT(result.asCell()->methodTable()); + return result; } inline JSC::JSValue toJSForGC(JSC::ExecState* exec, JSValueRef v) { ASSERT_UNUSED(exec, exec); - ASSERT(v); #if USE(JSVALUE32_64) JSC::JSCell* jsCell = reinterpret_cast(const_cast(v)); if (!jsCell) return JSC::JSValue(); - return jsCell; + JSC::JSValue result = jsCell; #else - return JSC::JSValue::decode(reinterpret_cast(const_cast(v))); + JSC::JSValue result = JSC::JSValue::decode(reinterpret_cast(const_cast(v))); #endif + if (result && result.isCell()) + RELEASE_ASSERT(result.asCell()->methodTable()); + return result; } -inline JSC::JSObject* toJS(JSObjectRef o) +// Used in JSObjectGetPrivate as that may be called during finalization +inline JSC::JSObject* uncheckedToJS(JSObjectRef o) { return reinterpret_cast(o); } +inline JSC::JSObject* toJS(JSObjectRef o) +{ + JSC::JSObject* object = uncheckedToJS(o); + if (object) + RELEASE_ASSERT(object->methodTable()); + return object; +} + inline JSC::PropertyNameArray* toJS(JSPropertyNameAccumulatorRef a) { return reinterpret_cast(a); } -inline JSC::JSGlobalData* toJS(JSContextGroupRef g) +inline JSC::VM* toJS(JSContextGroupRef g) { - return reinterpret_cast(const_cast(g)); + return reinterpret_cast(const_cast(g)); } inline JSValueRef toRef(JSC::ExecState* exec, JSC::JSValue v) @@ -145,7 +162,7 @@ inline JSPropertyNameAccumulatorRef toRef(JSC::PropertyNameArray* l) return reinterpret_cast(l); } -inline JSContextGroupRef toRef(JSC::JSGlobalData* g) +inline JSContextGroupRef toRef(JSC::VM* g) { return reinterpret_cast(g); } diff --git a/JavaScriptCore/API/APIShims.h b/JavaScriptCore/API/APIShims.h index e1589f6a..c57693ed 100644 --- a/JavaScriptCore/API/APIShims.h +++ b/JavaScriptCore/API/APIShims.h @@ -28,39 +28,29 @@ #include "CallFrame.h" #include "GCActivityCallback.h" +#include "IncrementalSweeper.h" #include "JSLock.h" #include namespace JSC { class APIEntryShimWithoutLock { -public: - enum RefGlobalDataTag { DontRefGlobalData = 0, RefGlobalData }; - protected: - APIEntryShimWithoutLock(JSGlobalData* globalData, bool registerThread, RefGlobalDataTag shouldRefGlobalData) - : m_shouldRefGlobalData(shouldRefGlobalData) - , m_globalData(globalData) - , m_entryIdentifierTable(wtfThreadData().setCurrentIdentifierTable(globalData->identifierTable)) + APIEntryShimWithoutLock(VM* vm, bool registerThread) + : m_vm(vm) + , m_entryIdentifierTable(wtfThreadData().setCurrentIdentifierTable(vm->identifierTable)) { - if (shouldRefGlobalData) - m_globalData->ref(); - UNUSED_PARAM(registerThread); if (registerThread) - globalData->heap.machineThreads().addCurrentThread(); - m_globalData->heap.activityCallback()->synchronize(); + vm->heap.machineThreads().addCurrentThread(); } ~APIEntryShimWithoutLock() { wtfThreadData().setCurrentIdentifierTable(m_entryIdentifierTable); - if (m_shouldRefGlobalData) - m_globalData->deref(); } protected: - RefGlobalDataTag m_shouldRefGlobalData; - JSGlobalData* m_globalData; + RefPtr m_vm; IdentifierTable* m_entryIdentifierTable; }; @@ -68,57 +58,45 @@ class APIEntryShim : public APIEntryShimWithoutLock { public: // Normal API entry APIEntryShim(ExecState* exec, bool registerThread = true) - : APIEntryShimWithoutLock(&exec->globalData(), registerThread, RefGlobalData) + : APIEntryShimWithoutLock(&exec->vm(), registerThread) + , m_lockHolder(exec->vm().exclusiveThread ? 0 : exec) { - init(); } - // This constructor is necessary for HeapTimer to prevent it from accidentally resurrecting - // the ref count of a "dead" JSGlobalData. - APIEntryShim(JSGlobalData* globalData, RefGlobalDataTag refGlobalData, bool registerThread = true) - : APIEntryShimWithoutLock(globalData, registerThread, refGlobalData) + // JSPropertyNameAccumulator only has a vm. + APIEntryShim(VM* vm, bool registerThread = true) + : APIEntryShimWithoutLock(vm, registerThread) + , m_lockHolder(vm->exclusiveThread ? 0 : vm) { - init(); - } - - // JSPropertyNameAccumulator only has a globalData. - APIEntryShim(JSGlobalData* globalData, bool registerThread = true) - : APIEntryShimWithoutLock(globalData, registerThread, RefGlobalData) - { - init(); } ~APIEntryShim() { - m_globalData->timeoutChecker.stop(); - m_globalData->apiLock().unlock(); + // Destroying our JSLockHolder should also destroy the VM. + m_vm.clear(); } private: - void init() - { - m_globalData->apiLock().lock(); - m_globalData->timeoutChecker.start(); - } + JSLockHolder m_lockHolder; }; class APICallbackShim { public: APICallbackShim(ExecState* exec) - : m_dropAllLocks(exec) - , m_globalData(&exec->globalData()) + : m_dropAllLocks(exec->vm().exclusiveThread ? 0 : exec) + , m_vm(&exec->vm()) { wtfThreadData().resetCurrentIdentifierTable(); } ~APICallbackShim() { - wtfThreadData().setCurrentIdentifierTable(m_globalData->identifierTable); + wtfThreadData().setCurrentIdentifierTable(m_vm->identifierTable); } private: JSLock::DropAllLocks m_dropAllLocks; - JSGlobalData* m_globalData; + VM* m_vm; }; } diff --git a/JavaScriptCore/API/JSAPIWrapperObject.h b/JavaScriptCore/API/JSAPIWrapperObject.h new file mode 100644 index 00000000..90903977 --- /dev/null +++ b/JavaScriptCore/API/JSAPIWrapperObject.h @@ -0,0 +1,60 @@ +/* + * Copyright (C) 2013 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. + */ + +#ifndef JSAPIWrapperObject_h +#define JSAPIWrapperObject_h + +#include "JSBase.h" +#include "JSDestructibleObject.h" +#include "WeakReferenceHarvester.h" + +#if JSC_OBJC_API_ENABLED + +namespace JSC { + +class JSAPIWrapperObject : public JSDestructibleObject { +public: + typedef JSDestructibleObject Base; + + void finishCreation(VM&); + static void visitChildren(JSCell*, JSC::SlotVisitor&); + + void* wrappedObject() { return m_wrappedObject; } + void setWrappedObject(void*); + +protected: + static const unsigned StructureFlags = OverridesVisitChildren | Base::StructureFlags; + + JSAPIWrapperObject(VM&, Structure*); + +private: + void* m_wrappedObject; +}; + +} // namespace JSC + +#endif // JSC_OBJC_API_ENABLED + +#endif // JSAPIWrapperObject_h diff --git a/JavaScriptCore/API/JSAPIWrapperObject.mm b/JavaScriptCore/API/JSAPIWrapperObject.mm new file mode 100644 index 00000000..09dade8b --- /dev/null +++ b/JavaScriptCore/API/JSAPIWrapperObject.mm @@ -0,0 +1,112 @@ +/* + * Copyright (C) 2013 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. + */ + +#include "config.h" +#include "JSAPIWrapperObject.h" + +#include "JSCJSValueInlines.h" +#include "JSCallbackObject.h" +#include "JSCellInlines.h" +#include "JSVirtualMachineInternal.h" +#include "SlotVisitorInlines.h" +#include "Structure.h" +#include "StructureInlines.h" + +#if JSC_OBJC_API_ENABLED + +class JSAPIWrapperObjectHandleOwner : public JSC::WeakHandleOwner { +public: + virtual void finalize(JSC::Handle, void*) OVERRIDE; + virtual bool isReachableFromOpaqueRoots(JSC::Handle, void* context, JSC::SlotVisitor&) OVERRIDE; +}; + +static JSAPIWrapperObjectHandleOwner* jsAPIWrapperObjectHandleOwner() +{ + DEFINE_STATIC_LOCAL(JSAPIWrapperObjectHandleOwner, jsWrapperObjectHandleOwner, ()); + return &jsWrapperObjectHandleOwner; +} + +void JSAPIWrapperObjectHandleOwner::finalize(JSC::Handle handle, void*) +{ + JSC::JSAPIWrapperObject* wrapperObject = JSC::jsCast(handle.get().asCell()); + if (!wrapperObject->wrappedObject()) + return; + [static_cast(wrapperObject->wrappedObject()) release]; + JSC::WeakSet::deallocate(JSC::WeakImpl::asWeakImpl(handle.slot())); +} + +bool JSAPIWrapperObjectHandleOwner::isReachableFromOpaqueRoots(JSC::Handle handle, void*, JSC::SlotVisitor& visitor) +{ + JSC::JSAPIWrapperObject* wrapperObject = JSC::jsCast(handle.get().asCell()); + // We use the JSGlobalObject when processing weak handles to prevent the situation where using + // the same Objective-C object in multiple global objects keeps all of the global objects alive. + if (!wrapperObject->wrappedObject()) + return false; + return JSC::Heap::isMarked(wrapperObject->structure()->globalObject()) && visitor.containsOpaqueRoot(wrapperObject->wrappedObject()); +} + +namespace JSC { + +template <> const ClassInfo JSCallbackObject::s_info = { "JSAPIWrapperObject", &Base::s_info, 0, 0, CREATE_METHOD_TABLE(JSCallbackObject) }; + +template<> const bool JSCallbackObject::needsDestruction = true; + +template <> +Structure* JSCallbackObject::createStructure(VM& vm, JSGlobalObject* globalObject, JSValue proto) +{ + return Structure::create(vm, globalObject, proto, TypeInfo(ObjectType, StructureFlags), &s_info); +} + +JSAPIWrapperObject::JSAPIWrapperObject(VM& vm, Structure* structure) + : Base(vm, structure) + , m_wrappedObject(0) +{ +} + +void JSAPIWrapperObject::finishCreation(VM& vm) +{ + Base::finishCreation(vm); + WeakSet::allocate(this, jsAPIWrapperObjectHandleOwner(), 0); // Balanced in JSAPIWrapperObjectHandleOwner::finalize. +} + +void JSAPIWrapperObject::setWrappedObject(void* wrappedObject) +{ + ASSERT(!m_wrappedObject); + m_wrappedObject = [static_cast(wrappedObject) retain]; +} + +void JSAPIWrapperObject::visitChildren(JSCell* cell, JSC::SlotVisitor& visitor) +{ + JSAPIWrapperObject* thisObject = JSC::jsCast(cell); + COMPILE_ASSERT(StructureFlags & OverridesVisitChildren, OverridesVisitChildrenWithoutSettingFlag); + Base::visitChildren(cell, visitor); + + if (thisObject->wrappedObject()) + scanExternalObjectGraph(cell->structure()->globalObject()->vm(), visitor, thisObject->wrappedObject()); +} + +} // namespace JSC + +#endif // JSC_OBJC_API_ENABLED diff --git a/JavaScriptCore/API/JSBase.cpp b/JavaScriptCore/API/JSBase.cpp index d0ffa311..4a77da22 100644 --- a/JavaScriptCore/API/JSBase.cpp +++ b/JavaScriptCore/API/JSBase.cpp @@ -29,20 +29,25 @@ #include "APICast.h" #include "APIShims.h" +#include "CallFrame.h" +#include "Completion.h" +#include "InitializeThreading.h" +#include "JSGlobalObject.h" +#include "JSLock.h" +#include "JSObject.h" #include "OpaqueJSString.h" +#include "Operations.h" #include "SourceCode.h" -#include -#include -#include -#include -#include -#include #include using namespace JSC; JSValueRef JSEvaluateScript(JSContextRef ctx, JSStringRef script, JSObjectRef thisObject, JSStringRef sourceURL, int startingLineNumber, JSValueRef* exception) { + if (!ctx) { + ASSERT_NOT_REACHED(); + return 0; + } ExecState* exec = toJS(ctx); APIEntryShim entryShim(exec); @@ -50,10 +55,10 @@ JSValueRef JSEvaluateScript(JSContextRef ctx, JSStringRef script, JSObjectRef th // evaluate sets "this" to the global object if it is NULL JSGlobalObject* globalObject = exec->dynamicGlobalObject(); - SourceCode source = makeSource(script->ustring(), sourceURL->ustring(), TextPosition(OrdinalNumber::fromOneBasedInt(startingLineNumber), OrdinalNumber::first())); + SourceCode source = makeSource(script->string(), sourceURL->string(), TextPosition(OrdinalNumber::fromOneBasedInt(startingLineNumber), OrdinalNumber::first())); JSValue evaluationException; - JSValue returnValue = evaluate(globalObject->globalExec(), globalObject->globalScopeChain(), source, jsThisObject, &evaluationException); + JSValue returnValue = evaluate(globalObject->globalExec(), source, jsThisObject, &evaluationException); if (evaluationException) { if (exception) @@ -70,10 +75,14 @@ JSValueRef JSEvaluateScript(JSContextRef ctx, JSStringRef script, JSObjectRef th bool JSCheckScriptSyntax(JSContextRef ctx, JSStringRef script, JSStringRef sourceURL, int startingLineNumber, JSValueRef* exception) { + if (!ctx) { + ASSERT_NOT_REACHED(); + return false; + } ExecState* exec = toJS(ctx); APIEntryShim entryShim(exec); - SourceCode source = makeSource(script->ustring(), sourceURL->ustring(), TextPosition(OrdinalNumber::fromOneBasedInt(startingLineNumber), OrdinalNumber::first())); + SourceCode source = makeSource(script->string(), sourceURL->string(), TextPosition(OrdinalNumber::fromOneBasedInt(startingLineNumber), OrdinalNumber::first())); JSValue syntaxException; bool isValidSyntax = checkSyntax(exec->dynamicGlobalObject()->globalExec(), source, &syntaxException); @@ -100,12 +109,50 @@ void JSGarbageCollect(JSContextRef ctx) ExecState* exec = toJS(ctx); APIEntryShim entryShim(exec, false); - exec->globalData().heap.reportAbandonedObjectGraph(); + exec->vm().heap.reportAbandonedObjectGraph(); } void JSReportExtraMemoryCost(JSContextRef ctx, size_t size) { + if (!ctx) { + ASSERT_NOT_REACHED(); + return; + } ExecState* exec = toJS(ctx); APIEntryShim entryShim(exec); - exec->globalData().heap.reportExtraMemoryCost(size); + exec->vm().heap.reportExtraMemoryCost(size); } + +extern "C" JS_EXPORT void JSSynchronousGarbageCollectForDebugging(JSContextRef); + +void JSSynchronousGarbageCollectForDebugging(JSContextRef ctx) +{ + if (!ctx) + return; + + ExecState* exec = toJS(ctx); + APIEntryShim entryShim(exec); + exec->vm().heap.collectAllGarbage(); +} + +void JSDisableGCTimer(void) +{ + GCActivityCallback::s_shouldCreateGCTimer = false; +} + +#if PLATFORM(IOS) +// FIXME: Expose symbols to tell dyld where to find JavaScriptCore on older versions of +// iOS (< 7.0). We should remove these symbols once we no longer need to support such +// versions of iOS. See for more details. +JS_EXPORT extern const char iosInstallName43 __asm("$ld$install_name$os4.3$/System/Library/PrivateFrameworks/JavaScriptCore.framework/JavaScriptCore"); +JS_EXPORT extern const char iosInstallName50 __asm("$ld$install_name$os5.0$/System/Library/PrivateFrameworks/JavaScriptCore.framework/JavaScriptCore"); +JS_EXPORT extern const char iosInstallName51 __asm("$ld$install_name$os5.1$/System/Library/PrivateFrameworks/JavaScriptCore.framework/JavaScriptCore"); +JS_EXPORT extern const char iosInstallName60 __asm("$ld$install_name$os6.0$/System/Library/PrivateFrameworks/JavaScriptCore.framework/JavaScriptCore"); +JS_EXPORT extern const char iosInstallName61 __asm("$ld$install_name$os6.1$/System/Library/PrivateFrameworks/JavaScriptCore.framework/JavaScriptCore"); + +const char iosInstallName43 = 0; +const char iosInstallName50 = 0; +const char iosInstallName51 = 0; +const char iosInstallName60 = 0; +const char iosInstallName61 = 0; +#endif diff --git a/JavaScriptCore/API/JSBase.h b/JavaScriptCore/API/JSBase.h index fed54fe2..10eecf33 100644 --- a/JavaScriptCore/API/JSBase.h +++ b/JavaScriptCore/API/JSBase.h @@ -30,6 +30,10 @@ #include #endif +#ifdef __OBJC__ +#import +#endif + /* JavaScript engine interface */ /*! @typedef JSContextGroupRef A group that associates JavaScript contexts with one another. Contexts in the same group may share and exchange JavaScript objects. */ @@ -71,7 +75,7 @@ typedef struct OpaqueJSValue* JSObjectRef; #elif defined(__GNUC__) && !defined(__CC_ARM) && !defined(__ARMCC__) #define JS_EXPORT __attribute__((visibility("default"))) #elif defined(WIN32) || defined(_WIN32) || defined(_WIN32_WCE) || defined(__CC_ARM) || defined(__ARMCC__) -#if defined(BUILDING_JavaScriptCore) || defined(BUILDING_WTF) +#if defined(BUILDING_JavaScriptCore) || defined(STATICALLY_LINKED_WITH_JavaScriptCore) #define JS_EXPORT __declspec(dllexport) #else #define JS_EXPORT __declspec(dllimport) @@ -135,4 +139,13 @@ JS_EXPORT void JSGarbageCollect(JSContextRef ctx); } #endif +/* Enable the Objective-C API for platforms with a modern runtime. */ +#if !defined(JSC_OBJC_API_ENABLED) +#ifndef JSC_OBJC_API_AVAILABLE_MAC_OS_X_1080 +#define JSC_OBJC_API_ENABLED (defined(__clang__) && defined(__APPLE__) && defined(__MAC_OS_X_VERSION_MIN_REQUIRED) && __MAC_OS_X_VERSION_MIN_REQUIRED >= 1090 && !defined(__i386__)) +#else +#define JSC_OBJC_API_ENABLED (defined(__clang__) && defined(__APPLE__) && defined(__MAC_OS_X_VERSION_MIN_REQUIRED) && __MAC_OS_X_VERSION_MIN_REQUIRED >= 1080 && !defined(__i386__)) +#endif +#endif + #endif /* JSBase_h */ diff --git a/JavaScriptCore/API/JSBasePrivate.h b/JavaScriptCore/API/JSBasePrivate.h index befa3164..9cd85e0d 100644 --- a/JavaScriptCore/API/JSBasePrivate.h +++ b/JavaScriptCore/API/JSBasePrivate.h @@ -45,6 +45,8 @@ region. */ JS_EXPORT void JSReportExtraMemoryCost(JSContextRef ctx, size_t size) AVAILABLE_IN_WEBKIT_VERSION_4_0; +JS_EXPORT void JSDisableGCTimer(void); + #ifdef __cplusplus } #endif diff --git a/JavaScriptCore/API/JSCTestRunnerUtils.cpp b/JavaScriptCore/API/JSCTestRunnerUtils.cpp new file mode 100644 index 00000000..2e93ac11 --- /dev/null +++ b/JavaScriptCore/API/JSCTestRunnerUtils.cpp @@ -0,0 +1,48 @@ +/* + * Copyright (C) 2013 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 "JSCTestRunnerUtils.h" + +#include "APICast.h" +#include "Operations.h" +#include "TestRunnerUtils.h" + +namespace JSC { + +JSValueRef numberOfDFGCompiles(JSContextRef context, JSValueRef theFunctionValueRef) +{ + ExecState* exec= toJS(context); + return toRef(exec, numberOfDFGCompiles(toJS(exec, theFunctionValueRef))); +} + +JSValueRef setNeverInline(JSContextRef context, JSValueRef theFunctionValueRef) +{ + ExecState* exec= toJS(context); + return toRef(exec, setNeverInline(toJS(exec, theFunctionValueRef))); +} + +} // namespace JSC + diff --git a/JavaScriptCore/API/JSCTestRunnerUtils.h b/JavaScriptCore/API/JSCTestRunnerUtils.h new file mode 100644 index 00000000..aaecdd5c --- /dev/null +++ b/JavaScriptCore/API/JSCTestRunnerUtils.h @@ -0,0 +1,39 @@ +/* + * Copyright (C) 2013 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. + */ + +#ifndef JSCTestRunnerUtils_h +#define JSCTestRunnerUtils_h + +#include +#include + +namespace JSC { + +JS_EXPORT_PRIVATE JSValueRef numberOfDFGCompiles(JSContextRef, JSValueRef theFunction); +JS_EXPORT_PRIVATE JSValueRef setNeverInline(JSContextRef, JSValueRef theFunction); + +} // namespace JSC + +#endif // JSCTestRunnerUtils_h diff --git a/JavaScriptCore/API/JSCallbackConstructor.cpp b/JavaScriptCore/API/JSCallbackConstructor.cpp index c8b4c065..8ea97a44 100644 --- a/JavaScriptCore/API/JSCallbackConstructor.cpp +++ b/JavaScriptCore/API/JSCallbackConstructor.cpp @@ -26,20 +26,22 @@ #include "config.h" #include "JSCallbackConstructor.h" -#include "APIShims.h" +#include "APICallbackFunction.h" #include "APICast.h" -#include -#include -#include -#include +#include "APIShims.h" +#include "Error.h" +#include "JSGlobalObject.h" +#include "JSLock.h" +#include "ObjectPrototype.h" +#include "Operations.h" #include namespace JSC { -const ClassInfo JSCallbackConstructor::s_info = { "CallbackConstructor", &JSNonFinalObject::s_info, 0, 0, CREATE_METHOD_TABLE(JSCallbackConstructor) }; +const ClassInfo JSCallbackConstructor::s_info = { "CallbackConstructor", &Base::s_info, 0, 0, CREATE_METHOD_TABLE(JSCallbackConstructor) }; JSCallbackConstructor::JSCallbackConstructor(JSGlobalObject* globalObject, Structure* structure, JSClassRef jsClass, JSObjectCallAsConstructorCallback callback) - : JSNonFinalObject(globalObject->globalData(), structure) + : JSDestructibleObject(globalObject->vm(), structure) , m_class(jsClass) , m_callback(callback) { @@ -47,8 +49,8 @@ JSCallbackConstructor::JSCallbackConstructor(JSGlobalObject* globalObject, Struc void JSCallbackConstructor::finishCreation(JSGlobalObject* globalObject, JSClassRef jsClass) { - Base::finishCreation(globalObject->globalData()); - ASSERT(inherits(&s_info)); + Base::finishCreation(globalObject->vm()); + ASSERT(inherits(info())); if (m_class) JSClassRetain(jsClass); } @@ -61,42 +63,12 @@ JSCallbackConstructor::~JSCallbackConstructor() void JSCallbackConstructor::destroy(JSCell* cell) { - jsCast(cell)->JSCallbackConstructor::~JSCallbackConstructor(); -} - -static EncodedJSValue JSC_HOST_CALL constructJSCallback(ExecState* exec) -{ - JSObject* constructor = exec->callee(); - JSContextRef ctx = toRef(exec); - JSObjectRef constructorRef = toRef(constructor); - - JSObjectCallAsConstructorCallback callback = jsCast(constructor)->callback(); - if (callback) { - int argumentCount = static_cast(exec->argumentCount()); - Vector arguments(argumentCount); - for (int i = 0; i < argumentCount; i++) - arguments[i] = toRef(exec, exec->argument(i)); - - JSValueRef exception = 0; - JSObjectRef result; - { - APICallbackShim callbackShim(exec); - result = callback(ctx, constructorRef, argumentCount, arguments.data(), &exception); - } - if (exception) - throwError(exec, toJS(exec, exception)); - // result must be a valid JSValue. - if (!result) - return throwVMTypeError(exec); - return JSValue::encode(toJS(result)); - } - - return JSValue::encode(toJS(JSObjectMake(ctx, jsCast(constructor)->classRef(), 0))); + static_cast(cell)->JSCallbackConstructor::~JSCallbackConstructor(); } ConstructType JSCallbackConstructor::getConstructData(JSCell*, ConstructData& constructData) { - constructData.native.function = constructJSCallback; + constructData.native.function = APICallbackFunction::construct; return ConstructTypeHost; } diff --git a/JavaScriptCore/API/JSCallbackConstructor.h b/JavaScriptCore/API/JSCallbackConstructor.h index 25fde132..7eedb52e 100644 --- a/JavaScriptCore/API/JSCallbackConstructor.h +++ b/JavaScriptCore/API/JSCallbackConstructor.h @@ -27,13 +27,13 @@ #define JSCallbackConstructor_h #include "JSObjectRef.h" -#include +#include "runtime/JSDestructibleObject.h" namespace JSC { -class JSCallbackConstructor : public JSNonFinalObject { +class JSCallbackConstructor : public JSDestructibleObject { public: - typedef JSNonFinalObject Base; + typedef JSDestructibleObject Base; static JSCallbackConstructor* create(ExecState* exec, JSGlobalObject* globalObject, Structure* structure, JSClassRef classRef, JSObjectCallAsConstructorCallback callback) { @@ -46,11 +46,11 @@ class JSCallbackConstructor : public JSNonFinalObject { static void destroy(JSCell*); JSClassRef classRef() const { return m_class; } JSObjectCallAsConstructorCallback callback() const { return m_callback; } - static const ClassInfo s_info; + DECLARE_INFO; - static Structure* createStructure(JSGlobalData& globalData, JSGlobalObject* globalObject, JSValue proto) + static Structure* createStructure(VM& vm, JSGlobalObject* globalObject, JSValue proto) { - return Structure::create(globalData, globalObject, proto, TypeInfo(ObjectType, StructureFlags), &s_info); + return Structure::create(vm, globalObject, proto, TypeInfo(ObjectType, StructureFlags), info()); } protected: @@ -59,8 +59,12 @@ class JSCallbackConstructor : public JSNonFinalObject { static const unsigned StructureFlags = ImplementsHasInstance | JSObject::StructureFlags; private: + friend struct APICallbackFunction; + static ConstructType getConstructData(JSCell*, ConstructData&); + JSObjectCallAsConstructorCallback constructCallback() { return m_callback; } + JSClassRef m_class; JSObjectCallAsConstructorCallback m_callback; }; diff --git a/JavaScriptCore/API/JSCallbackFunction.cpp b/JavaScriptCore/API/JSCallbackFunction.cpp index d287ab77..1996991f 100644 --- a/JavaScriptCore/API/JSCallbackFunction.cpp +++ b/JavaScriptCore/API/JSCallbackFunction.cpp @@ -26,65 +26,47 @@ #include "config.h" #include "JSCallbackFunction.h" -#include "APIShims.h" +#include "APICallbackFunction.h" #include "APICast.h" +#include "APIShims.h" #include "CodeBlock.h" +#include "Error.h" #include "ExceptionHelpers.h" -#include "JSFunction.h" #include "FunctionPrototype.h" -#include -#include +#include "JSFunction.h" +#include "JSGlobalObject.h" +#include "JSLock.h" +#include "Operations.h" #include namespace JSC { -ASSERT_CLASS_FITS_IN_CELL(JSCallbackFunction); -ASSERT_HAS_TRIVIAL_DESTRUCTOR(JSCallbackFunction); +STATIC_ASSERT_IS_TRIVIALLY_DESTRUCTIBLE(JSCallbackFunction); const ClassInfo JSCallbackFunction::s_info = { "CallbackFunction", &InternalFunction::s_info, 0, 0, CREATE_METHOD_TABLE(JSCallbackFunction) }; -JSCallbackFunction::JSCallbackFunction(JSGlobalObject* globalObject, JSObjectCallAsFunctionCallback callback) - : InternalFunction(globalObject, globalObject->callbackFunctionStructure()) +JSCallbackFunction::JSCallbackFunction(VM& vm, Structure* structure, JSObjectCallAsFunctionCallback callback) + : InternalFunction(vm, structure) , m_callback(callback) { } -void JSCallbackFunction::finishCreation(JSGlobalData& globalData, const Identifier& name) +void JSCallbackFunction::finishCreation(VM& vm, const String& name) { - Base::finishCreation(globalData, name); - ASSERT(inherits(&s_info)); + Base::finishCreation(vm, name); + ASSERT(inherits(info())); } -EncodedJSValue JSCallbackFunction::call(ExecState* exec) +JSCallbackFunction* JSCallbackFunction::create(VM& vm, JSGlobalObject* globalObject, JSObjectCallAsFunctionCallback callback, const String& name) { - JSContextRef execRef = toRef(exec); - JSObjectRef functionRef = toRef(exec->callee()); - JSObjectRef thisObjRef = toRef(exec->hostThisValue().toThisObject(exec)); - - int argumentCount = static_cast(exec->argumentCount()); - Vector arguments(argumentCount); - for (int i = 0; i < argumentCount; i++) - arguments[i] = toRef(exec, exec->argument(i)); - - JSValueRef exception = 0; - JSValueRef result; - { - APICallbackShim callbackShim(exec); - result = jsCast(toJS(functionRef))->m_callback(execRef, functionRef, thisObjRef, argumentCount, arguments.data(), &exception); - } - if (exception) - throwError(exec, toJS(exec, exception)); - - // result must be a valid JSValue. - if (!result) - return JSValue::encode(jsUndefined()); - - return JSValue::encode(toJS(exec, result)); + JSCallbackFunction* function = new (NotNull, allocateCell(vm.heap)) JSCallbackFunction(vm, globalObject->callbackFunctionStructure(), callback); + function->finishCreation(vm, name); + return function; } CallType JSCallbackFunction::getCallData(JSCell*, CallData& callData) { - callData.native.function = call; + callData.native.function = APICallbackFunction::call; return CallTypeHost; } diff --git a/JavaScriptCore/API/JSCallbackFunction.h b/JavaScriptCore/API/JSCallbackFunction.h index fec4136f..dff18de5 100644 --- a/JavaScriptCore/API/JSCallbackFunction.h +++ b/JavaScriptCore/API/JSCallbackFunction.h @@ -32,33 +32,28 @@ namespace JSC { class JSCallbackFunction : public InternalFunction { -protected: - JSCallbackFunction(JSGlobalObject*, JSObjectCallAsFunctionCallback); - void finishCreation(JSGlobalData&, const Identifier& name); - + friend struct APICallbackFunction; public: typedef InternalFunction Base; - static JSCallbackFunction* create(ExecState* exec, JSGlobalObject* globalObject, JSObjectCallAsFunctionCallback callback, const Identifier& name) - { - JSCallbackFunction* function = new (NotNull, allocateCell(*exec->heap())) JSCallbackFunction(globalObject, callback); - function->finishCreation(exec->globalData(), name); - return function; - } + static JSCallbackFunction* create(VM&, JSGlobalObject*, JSObjectCallAsFunctionCallback, const String& name); - static const ClassInfo s_info; + DECLARE_INFO; // InternalFunction mish-mashes constructor and function behavior -- we should // refactor the code so this override isn't necessary - static Structure* createStructure(JSGlobalData& globalData, JSGlobalObject* globalObject, JSValue proto) + static Structure* createStructure(VM& vm, JSGlobalObject* globalObject, JSValue proto) { - return Structure::create(globalData, globalObject, proto, TypeInfo(ObjectType, StructureFlags), &s_info); + return Structure::create(vm, globalObject, proto, TypeInfo(ObjectType, StructureFlags), info()); } private: + JSCallbackFunction(VM&, Structure*, JSObjectCallAsFunctionCallback); + void finishCreation(VM&, const String& name); + static CallType getCallData(JSCell*, CallData&); - static EncodedJSValue JSC_HOST_CALL call(ExecState*); + JSObjectCallAsFunctionCallback functionCallback() { return m_callback; } JSObjectCallAsFunctionCallback m_callback; }; diff --git a/JavaScriptCore/API/JSCallbackObject.cpp b/JavaScriptCore/API/JSCallbackObject.cpp index 68c26824..94713da3 100644 --- a/JavaScriptCore/API/JSCallbackObject.cpp +++ b/JavaScriptCore/API/JSCallbackObject.cpp @@ -28,39 +28,43 @@ #include "JSCallbackObject.h" #include "Heap.h" +#include "Operations.h" #include namespace JSC { -ASSERT_CLASS_FITS_IN_CELL(JSCallbackObject); -ASSERT_CLASS_FITS_IN_CELL(JSCallbackObject); - // Define the two types of JSCallbackObjects we support. -template <> const ClassInfo JSCallbackObject::s_info = { "CallbackObject", &JSNonFinalObject::s_info, 0, 0, CREATE_METHOD_TABLE(JSCallbackObject) }; -template <> const ClassInfo JSCallbackObject::s_info = { "CallbackGlobalObject", &JSGlobalObject::s_info, 0, 0, CREATE_METHOD_TABLE(JSCallbackObject) }; +template <> const ClassInfo JSCallbackObject::s_info = { "CallbackObject", &Base::s_info, 0, 0, CREATE_METHOD_TABLE(JSCallbackObject) }; +template <> const ClassInfo JSCallbackObject::s_info = { "CallbackGlobalObject", &Base::s_info, 0, 0, CREATE_METHOD_TABLE(JSCallbackObject) }; + +template<> const bool JSCallbackObject::needsDestruction = true; +template<> const bool JSCallbackObject::needsDestruction = false; + +template<> +JSCallbackObject* JSCallbackObject::create(VM& vm, JSClassRef classRef, Structure* structure) +{ + JSCallbackObject* callbackObject = new (NotNull, allocateCell>(vm.heap)) JSCallbackObject(vm, classRef, structure); + callbackObject->finishCreation(vm); + vm.heap.addFinalizer(callbackObject, destroy); + return callbackObject; +} template <> -Structure* JSCallbackObject::createStructure(JSGlobalData& globalData, JSGlobalObject* globalObject, JSValue proto) +Structure* JSCallbackObject::createStructure(VM& vm, JSGlobalObject* globalObject, JSValue proto) { - return Structure::create(globalData, globalObject, proto, TypeInfo(ObjectType, StructureFlags), &s_info); + return Structure::create(vm, globalObject, proto, TypeInfo(ObjectType, StructureFlags), info()); } template <> -Structure* JSCallbackObject::createStructure(JSGlobalData& globalData, JSGlobalObject* globalObject, JSValue proto) +Structure* JSCallbackObject::createStructure(VM& vm, JSGlobalObject* globalObject, JSValue proto) { - return Structure::create(globalData, globalObject, proto, TypeInfo(GlobalObjectType, StructureFlags), &s_info); -} - -template -void JSCallbackObject::destroy(JSCell* cell) -{ - jsCast(cell)->JSCallbackObject::~JSCallbackObject(); + return Structure::create(vm, globalObject, proto, TypeInfo(GlobalObjectType, StructureFlags), info()); } void JSCallbackObjectData::finalize(Handle handle, void* context) { JSClassRef jsClass = static_cast(context); - JSObjectRef thisRef = toRef(asObject(handle.get())); + JSObjectRef thisRef = toRef(static_cast(handle.get().asCell())); for (; jsClass; jsClass = jsClass->parentClass) if (JSObjectFinalizeCallback finalize = jsClass->finalize) diff --git a/JavaScriptCore/API/JSCallbackObject.h b/JavaScriptCore/API/JSCallbackObject.h index 9aca0c7e..510164d9 100644 --- a/JavaScriptCore/API/JSCallbackObject.h +++ b/JavaScriptCore/API/JSCallbackObject.h @@ -42,7 +42,7 @@ struct JSCallbackObjectData : WeakHandleOwner { JSClassRetain(jsClass); } - ~JSCallbackObjectData() + virtual ~JSCallbackObjectData() { JSClassRelease(jsClass); } @@ -54,11 +54,11 @@ struct JSCallbackObjectData : WeakHandleOwner { return m_privateProperties->getPrivateProperty(propertyName); } - void setPrivateProperty(JSGlobalData& globalData, JSCell* owner, const Identifier& propertyName, JSValue value) + void setPrivateProperty(VM& vm, JSCell* owner, const Identifier& propertyName, JSValue value) { if (!m_privateProperties) m_privateProperties = adoptPtr(new JSPrivatePropertyMap); - m_privateProperties->setPrivateProperty(globalData, owner, propertyName, value); + m_privateProperties->setPrivateProperty(vm, owner, propertyName, value); } void deletePrivateProperty(const Identifier& propertyName) @@ -83,13 +83,13 @@ struct JSCallbackObjectData : WeakHandleOwner { PrivatePropertyMap::const_iterator location = m_propertyMap.find(propertyName.impl()); if (location == m_propertyMap.end()) return JSValue(); - return location->second.get(); + return location->value.get(); } - void setPrivateProperty(JSGlobalData& globalData, JSCell* owner, const Identifier& propertyName, JSValue value) + void setPrivateProperty(VM& vm, JSCell* owner, const Identifier& propertyName, JSValue value) { WriteBarrier empty; - m_propertyMap.add(propertyName.impl(), empty).iterator->second.set(globalData, owner, value); + m_propertyMap.add(propertyName.impl(), empty).iterator->value.set(vm, owner, value); } void deletePrivateProperty(const Identifier& propertyName) @@ -100,8 +100,8 @@ struct JSCallbackObjectData : WeakHandleOwner { void visitChildren(SlotVisitor& visitor) { for (PrivatePropertyMap::iterator ptr = m_propertyMap.begin(); ptr != m_propertyMap.end(); ++ptr) { - if (ptr->second) - visitor.append(&ptr->second); + if (ptr->value) + visitor.append(&ptr->value); } } @@ -110,7 +110,7 @@ struct JSCallbackObjectData : WeakHandleOwner { PrivatePropertyMap m_propertyMap; }; OwnPtr m_privateProperties; - virtual void finalize(Handle, void*); + virtual void finalize(Handle, void*) OVERRIDE; }; @@ -118,10 +118,10 @@ template class JSCallbackObject : public Parent { protected: JSCallbackObject(ExecState*, Structure*, JSClassRef, void* data); - JSCallbackObject(JSGlobalData&, JSClassRef, Structure*); + JSCallbackObject(VM&, JSClassRef, Structure*); void finishCreation(ExecState*); - void finishCreation(JSGlobalData&); + void finishCreation(VM&); public: typedef Parent Base; @@ -133,31 +133,32 @@ class JSCallbackObject : public Parent { callbackObject->finishCreation(exec); return callbackObject; } - static JSCallbackObject* create(JSGlobalData& globalData, JSClassRef classRef, Structure* structure) + static JSCallbackObject* create(VM&, JSClassRef, Structure*); + + static const bool needsDestruction; + static void destroy(JSCell* cell) { - JSCallbackObject* callbackObject = new (NotNull, allocateCell(globalData.heap)) JSCallbackObject(globalData, classRef, structure); - callbackObject->finishCreation(globalData); - return callbackObject; + static_cast(cell)->JSCallbackObject::~JSCallbackObject(); } void setPrivate(void* data); void* getPrivate(); - static const ClassInfo s_info; + DECLARE_INFO; JSClassRef classRef() const { return m_callbackObjectData->jsClass; } bool inherits(JSClassRef) const; - static Structure* createStructure(JSGlobalData&, JSGlobalObject*, JSValue); + static Structure* createStructure(VM&, JSGlobalObject*, JSValue); JSValue getPrivateProperty(const Identifier& propertyName) const { return m_callbackObjectData->getPrivateProperty(propertyName); } - void setPrivateProperty(JSGlobalData& globalData, const Identifier& propertyName, JSValue value) + void setPrivateProperty(VM& vm, const Identifier& propertyName, JSValue value) { - m_callbackObjectData->setPrivateProperty(globalData, this, propertyName, value); + m_callbackObjectData->setPrivateProperty(vm, this, propertyName, value); } void deletePrivateProperty(const Identifier& propertyName) @@ -168,26 +169,25 @@ class JSCallbackObject : public Parent { using Parent::methodTable; protected: - static const unsigned StructureFlags = ProhibitsPropertyCaching | OverridesGetOwnPropertySlot | ImplementsHasInstance | OverridesHasInstance | OverridesVisitChildren | OverridesGetPropertyNames | Parent::StructureFlags; + static const unsigned StructureFlags = ProhibitsPropertyCaching | OverridesGetOwnPropertySlot | InterceptsGetOwnPropertySlotByIndexEvenWhenLengthIsNotZero | ImplementsHasInstance | OverridesHasInstance | OverridesVisitChildren | OverridesGetPropertyNames | Parent::StructureFlags; private: - static UString className(const JSObject*); - - static void destroy(JSCell*); + static String className(const JSObject*); static JSValue defaultValue(const JSObject*, ExecState*, PreferredPrimitiveType); - static bool getOwnPropertySlot(JSCell*, ExecState*, const Identifier&, PropertySlot&); - static bool getOwnPropertyDescriptor(JSObject*, ExecState*, const Identifier&, PropertyDescriptor&); + static bool getOwnPropertySlot(JSObject*, ExecState*, PropertyName, PropertySlot&); + static bool getOwnPropertySlotByIndex(JSObject*, ExecState*, unsigned propertyName, PropertySlot&); - static void put(JSCell*, ExecState*, const Identifier&, JSValue, PutPropertySlot&); + static void put(JSCell*, ExecState*, PropertyName, JSValue, PutPropertySlot&); + static void putByIndex(JSCell*, ExecState*, unsigned, JSValue, bool shouldThrow); - static bool deleteProperty(JSCell*, ExecState*, const Identifier&); + static bool deleteProperty(JSCell*, ExecState*, PropertyName); static bool deletePropertyByIndex(JSCell*, ExecState*, unsigned); - static bool hasInstance(JSObject*, ExecState*, JSValue, JSValue proto); + static bool customHasInstance(JSObject*, ExecState*, JSValue); - static void getOwnPropertyNames(JSObject*, ExecState*, PropertyNameArray&, EnumerationMode); + static void getOwnNonIndexPropertyNames(JSObject*, ExecState*, PropertyNameArray&, EnumerationMode); static ConstructType getConstructData(JSCell*, ConstructData&); static CallType getCallData(JSCell*, CallData&); @@ -195,7 +195,7 @@ class JSCallbackObject : public Parent { static void visitChildren(JSCell* cell, SlotVisitor& visitor) { JSCallbackObject* thisObject = jsCast(cell); - ASSERT_GC_OBJECT_INHERITS((static_cast(thisObject)), &JSCallbackObject::s_info); + ASSERT_GC_OBJECT_INHERITS((static_cast(thisObject)), JSCallbackObject::info()); COMPILE_ASSERT(StructureFlags & OverridesVisitChildren, OverridesVisitChildrenWithoutSettingFlag); ASSERT(thisObject->Parent::structure()->typeInfo().overridesVisitChildren()); Parent::visitChildren(thisObject, visitor); @@ -209,9 +209,9 @@ class JSCallbackObject : public Parent { static EncodedJSValue JSC_HOST_CALL call(ExecState*); static EncodedJSValue JSC_HOST_CALL construct(ExecState*); - JSValue getStaticValue(ExecState*, const Identifier&); - static JSValue staticFunctionGetter(ExecState*, JSValue, const Identifier&); - static JSValue callbackGetter(ExecState*, JSValue, const Identifier&); + JSValue getStaticValue(ExecState*, PropertyName); + static JSValue staticFunctionGetter(ExecState*, JSValue, PropertyName); + static JSValue callbackGetter(ExecState*, JSValue, PropertyName); OwnPtr m_callbackObjectData; }; diff --git a/JavaScriptCore/API/JSCallbackObjectFunctions.h b/JavaScriptCore/API/JSCallbackObjectFunctions.h index b909dde7..83992d3f 100644 --- a/JavaScriptCore/API/JSCallbackObjectFunctions.h +++ b/JavaScriptCore/API/JSCallbackObjectFunctions.h @@ -45,13 +45,13 @@ namespace JSC { template inline JSCallbackObject* JSCallbackObject::asCallbackObject(JSValue value) { - ASSERT(asObject(value)->inherits(&s_info)); + ASSERT(asObject(value)->inherits(info())); return jsCast(asObject(value)); } template JSCallbackObject::JSCallbackObject(ExecState* exec, Structure* structure, JSClassRef jsClass, void* data) - : Parent(exec->globalData(), structure) + : Parent(exec->vm(), structure) , m_callbackObjectData(adoptPtr(new JSCallbackObjectData(data, jsClass))) { } @@ -59,8 +59,8 @@ JSCallbackObject::JSCallbackObject(ExecState* exec, Structure* structure // Global object constructor. // FIXME: Move this into a separate JSGlobalCallbackObject class derived from this one. template -JSCallbackObject::JSCallbackObject(JSGlobalData& globalData, JSClassRef jsClass, Structure* structure) - : Parent(globalData, structure) +JSCallbackObject::JSCallbackObject(VM& vm, JSClassRef jsClass, Structure* structure) + : Parent(vm, structure) , m_callbackObjectData(adoptPtr(new JSCallbackObjectData(0, jsClass))) { } @@ -68,18 +68,18 @@ JSCallbackObject::JSCallbackObject(JSGlobalData& globalData, JSClassRef template void JSCallbackObject::finishCreation(ExecState* exec) { - Base::finishCreation(exec->globalData()); - ASSERT(Parent::inherits(&s_info)); + Base::finishCreation(exec->vm()); + ASSERT(Parent::inherits(info())); init(exec); } // This is just for Global object, so we can assume that Base::finishCreation is JSGlobalObject::finishCreation. template -void JSCallbackObject::finishCreation(JSGlobalData& globalData) +void JSCallbackObject::finishCreation(VM& vm) { - ASSERT(Parent::inherits(&s_info)); + ASSERT(Parent::inherits(info())); ASSERT(Parent::isGlobalObject()); - Base::finishCreation(globalData); + Base::finishCreation(vm); init(jsCast(this)->globalExec()); } @@ -111,10 +111,10 @@ void JSCallbackObject::init(ExecState* exec) } template -UString JSCallbackObject::className(const JSObject* object) +String JSCallbackObject::className(const JSObject* object) { const JSCallbackObject* thisObject = jsCast(object); - UString thisClassName = thisObject->classRef()->className(); + String thisClassName = thisObject->classRef()->className(); if (!thisClassName.isEmpty()) return thisClassName; @@ -122,64 +122,72 @@ UString JSCallbackObject::className(const JSObject* object) } template -bool JSCallbackObject::getOwnPropertySlot(JSCell* cell, ExecState* exec, const Identifier& propertyName, PropertySlot& slot) +bool JSCallbackObject::getOwnPropertySlot(JSObject* object, ExecState* exec, PropertyName propertyName, PropertySlot& slot) { - JSCallbackObject* thisObject = jsCast(cell); + JSCallbackObject* thisObject = jsCast(object); JSContextRef ctx = toRef(exec); JSObjectRef thisRef = toRef(thisObject); RefPtr propertyNameRef; - for (JSClassRef jsClass = thisObject->classRef(); jsClass; jsClass = jsClass->parentClass) { - // optional optimization to bypass getProperty in cases when we only need to know if the property exists - if (JSObjectHasPropertyCallback hasProperty = jsClass->hasProperty) { - if (!propertyNameRef) - propertyNameRef = OpaqueJSString::create(propertyName.ustring()); - APICallbackShim callbackShim(exec); - if (hasProperty(ctx, thisRef, propertyNameRef.get())) { - slot.setCustom(thisObject, callbackGetter); - return true; - } - } else if (JSObjectGetPropertyCallback getProperty = jsClass->getProperty) { - if (!propertyNameRef) - propertyNameRef = OpaqueJSString::create(propertyName.ustring()); - JSValueRef exception = 0; - JSValueRef value; - { + if (StringImpl* name = propertyName.publicName()) { + for (JSClassRef jsClass = thisObject->classRef(); jsClass; jsClass = jsClass->parentClass) { + // optional optimization to bypass getProperty in cases when we only need to know if the property exists + if (JSObjectHasPropertyCallback hasProperty = jsClass->hasProperty) { + if (!propertyNameRef) + propertyNameRef = OpaqueJSString::create(name); APICallbackShim callbackShim(exec); - value = getProperty(ctx, thisRef, propertyNameRef.get(), &exception); - } - if (exception) { - throwError(exec, toJS(exec, exception)); - slot.setValue(jsUndefined()); - return true; - } - if (value) { - slot.setValue(toJS(exec, value)); - return true; - } - } - - if (OpaqueJSClassStaticValuesTable* staticValues = jsClass->staticValues(exec)) { - if (staticValues->contains(propertyName.impl())) { - JSValue value = thisObject->getStaticValue(exec, propertyName); + if (hasProperty(ctx, thisRef, propertyNameRef.get())) { + slot.setCustom(thisObject, ReadOnly | DontEnum, callbackGetter); + return true; + } + } else if (JSObjectGetPropertyCallback getProperty = jsClass->getProperty) { + if (!propertyNameRef) + propertyNameRef = OpaqueJSString::create(name); + JSValueRef exception = 0; + JSValueRef value; + { + APICallbackShim callbackShim(exec); + value = getProperty(ctx, thisRef, propertyNameRef.get(), &exception); + } + if (exception) { + exec->vm().throwException(exec, toJS(exec, exception)); + slot.setValue(thisObject, ReadOnly | DontEnum, jsUndefined()); + return true; + } if (value) { - slot.setValue(value); + slot.setValue(thisObject, ReadOnly | DontEnum, toJS(exec, value)); return true; } } - } - - if (OpaqueJSClassStaticFunctionsTable* staticFunctions = jsClass->staticFunctions(exec)) { - if (staticFunctions->contains(propertyName.impl())) { - slot.setCustom(thisObject, staticFunctionGetter); - return true; + + if (OpaqueJSClassStaticValuesTable* staticValues = jsClass->staticValues(exec)) { + if (staticValues->contains(name)) { + JSValue value = thisObject->getStaticValue(exec, propertyName); + if (value) { + slot.setValue(thisObject, ReadOnly | DontEnum, value); + return true; + } + } + } + + if (OpaqueJSClassStaticFunctionsTable* staticFunctions = jsClass->staticFunctions(exec)) { + if (staticFunctions->contains(name)) { + slot.setCustom(thisObject, ReadOnly | DontEnum, staticFunctionGetter); + return true; + } } } } - + return Parent::getOwnPropertySlot(thisObject, exec, propertyName, slot); } +template +bool JSCallbackObject::getOwnPropertySlotByIndex(JSObject* object, ExecState* exec, unsigned propertyName, PropertySlot& slot) +{ + return object->methodTable()->getOwnPropertySlot(object, exec, Identifier::from(exec, propertyName), slot); +} + template JSValue JSCallbackObject::defaultValue(const JSObject* object, ExecState* exec, PreferredPrimitiveType hint) { @@ -193,7 +201,7 @@ JSValue JSCallbackObject::defaultValue(const JSObject* object, ExecState JSValueRef exception = 0; JSValueRef result = convertToType(ctx, thisRef, jsHint, &exception); if (exception) { - throwError(exec, toJS(exec, exception)); + exec->vm().throwException(exec, toJS(exec, exception)); return jsUndefined(); } if (result) @@ -205,38 +213,78 @@ JSValue JSCallbackObject::defaultValue(const JSObject* object, ExecState } template -bool JSCallbackObject::getOwnPropertyDescriptor(JSObject* object, ExecState* exec, const Identifier& propertyName, PropertyDescriptor& descriptor) +void JSCallbackObject::put(JSCell* cell, ExecState* exec, PropertyName propertyName, JSValue value, PutPropertySlot& slot) { - JSCallbackObject* thisObject = jsCast(object); - PropertySlot slot; - if (thisObject->methodTable()->getOwnPropertySlot(thisObject, exec, propertyName, slot)) { - // Ideally we should return an access descriptor, but returning a value descriptor is better than nothing. - JSValue value = slot.getValue(exec, propertyName); - if (!exec->hadException()) - descriptor.setValue(value); - // We don't know whether the property is configurable, but assume it is. - descriptor.setConfigurable(true); - // We don't know whether the property is enumerable (we could call getOwnPropertyNames() to find out), but assume it isn't. - descriptor.setEnumerable(false); - return true; + JSCallbackObject* thisObject = jsCast(cell); + JSContextRef ctx = toRef(exec); + JSObjectRef thisRef = toRef(thisObject); + RefPtr propertyNameRef; + JSValueRef valueRef = toRef(exec, value); + + if (StringImpl* name = propertyName.publicName()) { + for (JSClassRef jsClass = thisObject->classRef(); jsClass; jsClass = jsClass->parentClass) { + if (JSObjectSetPropertyCallback setProperty = jsClass->setProperty) { + if (!propertyNameRef) + propertyNameRef = OpaqueJSString::create(name); + JSValueRef exception = 0; + bool result; + { + APICallbackShim callbackShim(exec); + result = setProperty(ctx, thisRef, propertyNameRef.get(), valueRef, &exception); + } + if (exception) + exec->vm().throwException(exec, toJS(exec, exception)); + if (result || exception) + return; + } + + if (OpaqueJSClassStaticValuesTable* staticValues = jsClass->staticValues(exec)) { + if (StaticValueEntry* entry = staticValues->get(name)) { + if (entry->attributes & kJSPropertyAttributeReadOnly) + return; + if (JSObjectSetPropertyCallback setProperty = entry->setProperty) { + JSValueRef exception = 0; + bool result; + { + APICallbackShim callbackShim(exec); + result = setProperty(ctx, thisRef, entry->propertyNameRef.get(), valueRef, &exception); + } + if (exception) + exec->vm().throwException(exec, toJS(exec, exception)); + if (result || exception) + return; + } + } + } + + if (OpaqueJSClassStaticFunctionsTable* staticFunctions = jsClass->staticFunctions(exec)) { + if (StaticFunctionEntry* entry = staticFunctions->get(name)) { + if (entry->attributes & kJSPropertyAttributeReadOnly) + return; + thisObject->JSCallbackObject::putDirect(exec->vm(), propertyName, value); // put as override property + return; + } + } + } } - return Parent::getOwnPropertyDescriptor(thisObject, exec, propertyName, descriptor); + return Parent::put(thisObject, exec, propertyName, value, slot); } template -void JSCallbackObject::put(JSCell* cell, ExecState* exec, const Identifier& propertyName, JSValue value, PutPropertySlot& slot) +void JSCallbackObject::putByIndex(JSCell* cell, ExecState* exec, unsigned propertyIndex, JSValue value, bool shouldThrow) { JSCallbackObject* thisObject = jsCast(cell); JSContextRef ctx = toRef(exec); JSObjectRef thisRef = toRef(thisObject); RefPtr propertyNameRef; JSValueRef valueRef = toRef(exec, value); - + Identifier propertyName = Identifier::from(exec, propertyIndex); + for (JSClassRef jsClass = thisObject->classRef(); jsClass; jsClass = jsClass->parentClass) { if (JSObjectSetPropertyCallback setProperty = jsClass->setProperty) { if (!propertyNameRef) - propertyNameRef = OpaqueJSString::create(propertyName.ustring()); + propertyNameRef = OpaqueJSString::create(propertyName.impl()); JSValueRef exception = 0; bool result; { @@ -244,86 +292,85 @@ void JSCallbackObject::put(JSCell* cell, ExecState* exec, const Identifi result = setProperty(ctx, thisRef, propertyNameRef.get(), valueRef, &exception); } if (exception) - throwError(exec, toJS(exec, exception)); + exec->vm().throwException(exec, toJS(exec, exception)); if (result || exception) return; } - + if (OpaqueJSClassStaticValuesTable* staticValues = jsClass->staticValues(exec)) { if (StaticValueEntry* entry = staticValues->get(propertyName.impl())) { if (entry->attributes & kJSPropertyAttributeReadOnly) return; if (JSObjectSetPropertyCallback setProperty = entry->setProperty) { - if (!propertyNameRef) - propertyNameRef = OpaqueJSString::create(propertyName.ustring()); JSValueRef exception = 0; bool result; { APICallbackShim callbackShim(exec); - result = setProperty(ctx, thisRef, propertyNameRef.get(), valueRef, &exception); + result = setProperty(ctx, thisRef, entry->propertyNameRef.get(), valueRef, &exception); } if (exception) - throwError(exec, toJS(exec, exception)); + exec->vm().throwException(exec, toJS(exec, exception)); if (result || exception) return; } } } - + if (OpaqueJSClassStaticFunctionsTable* staticFunctions = jsClass->staticFunctions(exec)) { if (StaticFunctionEntry* entry = staticFunctions->get(propertyName.impl())) { if (entry->attributes & kJSPropertyAttributeReadOnly) return; - thisObject->JSCallbackObject::putDirect(exec->globalData(), propertyName, value); // put as override property - return; + break; } } } - - return Parent::put(thisObject, exec, propertyName, value, slot); + + return Parent::putByIndex(thisObject, exec, propertyIndex, value, shouldThrow); } template -bool JSCallbackObject::deleteProperty(JSCell* cell, ExecState* exec, const Identifier& propertyName) +bool JSCallbackObject::deleteProperty(JSCell* cell, ExecState* exec, PropertyName propertyName) { JSCallbackObject* thisObject = jsCast(cell); JSContextRef ctx = toRef(exec); JSObjectRef thisRef = toRef(thisObject); RefPtr propertyNameRef; - for (JSClassRef jsClass = thisObject->classRef(); jsClass; jsClass = jsClass->parentClass) { - if (JSObjectDeletePropertyCallback deleteProperty = jsClass->deleteProperty) { - if (!propertyNameRef) - propertyNameRef = OpaqueJSString::create(propertyName.ustring()); - JSValueRef exception = 0; - bool result; - { - APICallbackShim callbackShim(exec); - result = deleteProperty(ctx, thisRef, propertyNameRef.get(), &exception); + if (StringImpl* name = propertyName.publicName()) { + for (JSClassRef jsClass = thisObject->classRef(); jsClass; jsClass = jsClass->parentClass) { + if (JSObjectDeletePropertyCallback deleteProperty = jsClass->deleteProperty) { + if (!propertyNameRef) + propertyNameRef = OpaqueJSString::create(name); + JSValueRef exception = 0; + bool result; + { + APICallbackShim callbackShim(exec); + result = deleteProperty(ctx, thisRef, propertyNameRef.get(), &exception); + } + if (exception) + exec->vm().throwException(exec, toJS(exec, exception)); + if (result || exception) + return true; } - if (exception) - throwError(exec, toJS(exec, exception)); - if (result || exception) - return true; - } - - if (OpaqueJSClassStaticValuesTable* staticValues = jsClass->staticValues(exec)) { - if (StaticValueEntry* entry = staticValues->get(propertyName.impl())) { - if (entry->attributes & kJSPropertyAttributeDontDelete) - return false; - return true; + + if (OpaqueJSClassStaticValuesTable* staticValues = jsClass->staticValues(exec)) { + if (StaticValueEntry* entry = staticValues->get(name)) { + if (entry->attributes & kJSPropertyAttributeDontDelete) + return false; + return true; + } } - } - - if (OpaqueJSClassStaticFunctionsTable* staticFunctions = jsClass->staticFunctions(exec)) { - if (StaticFunctionEntry* entry = staticFunctions->get(propertyName.impl())) { - if (entry->attributes & kJSPropertyAttributeDontDelete) - return false; - return true; + + if (OpaqueJSClassStaticFunctionsTable* staticFunctions = jsClass->staticFunctions(exec)) { + if (StaticFunctionEntry* entry = staticFunctions->get(name)) { + if (entry->attributes & kJSPropertyAttributeDontDelete) + return false; + return true; + } } } } - + return Parent::deleteProperty(thisObject, exec, propertyName); } @@ -356,10 +403,11 @@ EncodedJSValue JSCallbackObject::construct(ExecState* exec) for (JSClassRef jsClass = jsCast*>(constructor)->classRef(); jsClass; jsClass = jsClass->parentClass) { if (JSObjectCallAsConstructorCallback callAsConstructor = jsClass->callAsConstructor) { - int argumentCount = static_cast(exec->argumentCount()); - Vector arguments(argumentCount); - for (int i = 0; i < argumentCount; i++) - arguments[i] = toRef(exec, exec->argument(i)); + size_t argumentCount = exec->argumentCount(); + Vector arguments; + arguments.reserveInitialCapacity(argumentCount); + for (size_t i = 0; i < argumentCount; ++i) + arguments.uncheckedAppend(toRef(exec, exec->uncheckedArgument(i))); JSValueRef exception = 0; JSObject* result; { @@ -367,17 +415,17 @@ EncodedJSValue JSCallbackObject::construct(ExecState* exec) result = toJS(callAsConstructor(execRef, constructorRef, argumentCount, arguments.data(), &exception)); } if (exception) - throwError(exec, toJS(exec, exception)); + exec->vm().throwException(exec, toJS(exec, exception)); return JSValue::encode(result); } } - ASSERT_NOT_REACHED(); // getConstructData should prevent us from reaching here + RELEASE_ASSERT_NOT_REACHED(); // getConstructData should prevent us from reaching here return JSValue::encode(JSValue()); } template -bool JSCallbackObject::hasInstance(JSObject* object, ExecState* exec, JSValue value, JSValue) +bool JSCallbackObject::customHasInstance(JSObject* object, ExecState* exec, JSValue value) { JSCallbackObject* thisObject = jsCast(object); JSContextRef execRef = toRef(exec); @@ -393,7 +441,7 @@ bool JSCallbackObject::hasInstance(JSObject* object, ExecState* exec, JS result = hasInstance(execRef, thisRef, valueRef, &exception); } if (exception) - throwError(exec, toJS(exec, exception)); + exec->vm().throwException(exec, toJS(exec, exception)); return result; } } @@ -418,14 +466,15 @@ EncodedJSValue JSCallbackObject::call(ExecState* exec) { JSContextRef execRef = toRef(exec); JSObjectRef functionRef = toRef(exec->callee()); - JSObjectRef thisObjRef = toRef(exec->hostThisValue().toThisObject(exec)); + JSObjectRef thisObjRef = toRef(jsCast(exec->hostThisValue().toThis(exec, NotStrictMode))); for (JSClassRef jsClass = jsCast*>(toJS(functionRef))->classRef(); jsClass; jsClass = jsClass->parentClass) { if (JSObjectCallAsFunctionCallback callAsFunction = jsClass->callAsFunction) { - int argumentCount = static_cast(exec->argumentCount()); - Vector arguments(argumentCount); - for (int i = 0; i < argumentCount; i++) - arguments[i] = toRef(exec, exec->argument(i)); + size_t argumentCount = exec->argumentCount(); + Vector arguments; + arguments.reserveInitialCapacity(argumentCount); + for (size_t i = 0; i < argumentCount; ++i) + arguments.uncheckedAppend(toRef(exec, exec->uncheckedArgument(i))); JSValueRef exception = 0; JSValue result; { @@ -433,17 +482,17 @@ EncodedJSValue JSCallbackObject::call(ExecState* exec) result = toJS(exec, callAsFunction(execRef, functionRef, thisObjRef, argumentCount, arguments.data(), &exception)); } if (exception) - throwError(exec, toJS(exec, exception)); + exec->vm().throwException(exec, toJS(exec, exception)); return JSValue::encode(result); } } - ASSERT_NOT_REACHED(); // getCallData should prevent us from reaching here + RELEASE_ASSERT_NOT_REACHED(); // getCallData should prevent us from reaching here return JSValue::encode(JSValue()); } template -void JSCallbackObject::getOwnPropertyNames(JSObject* object, ExecState* exec, PropertyNameArray& propertyNames, EnumerationMode mode) +void JSCallbackObject::getOwnNonIndexPropertyNames(JSObject* object, ExecState* exec, PropertyNameArray& propertyNames, EnumerationMode mode) { JSCallbackObject* thisObject = jsCast(object); JSContextRef execRef = toRef(exec); @@ -459,8 +508,8 @@ void JSCallbackObject::getOwnPropertyNames(JSObject* object, ExecState* typedef OpaqueJSClassStaticValuesTable::const_iterator iterator; iterator end = staticValues->end(); for (iterator it = staticValues->begin(); it != end; ++it) { - StringImpl* name = it->first.get(); - StaticValueEntry* entry = it->second.get(); + StringImpl* name = it->key.get(); + StaticValueEntry* entry = it->value.get(); if (entry->getProperty && (!(entry->attributes & kJSPropertyAttributeDontEnum) || (mode == IncludeDontEnumProperties))) propertyNames.add(Identifier(exec, name)); } @@ -470,15 +519,15 @@ void JSCallbackObject::getOwnPropertyNames(JSObject* object, ExecState* typedef OpaqueJSClassStaticFunctionsTable::const_iterator iterator; iterator end = staticFunctions->end(); for (iterator it = staticFunctions->begin(); it != end; ++it) { - StringImpl* name = it->first.get(); - StaticFunctionEntry* entry = it->second.get(); + StringImpl* name = it->key.get(); + StaticFunctionEntry* entry = it->value.get(); if (!(entry->attributes & kJSPropertyAttributeDontEnum) || (mode == IncludeDontEnumProperties)) propertyNames.add(Identifier(exec, name)); } } } - Parent::getOwnPropertyNames(thisObject, exec, propertyNames, mode); + Parent::getOwnNonIndexPropertyNames(thisObject, exec, propertyNames, mode); } template @@ -496,44 +545,46 @@ void* JSCallbackObject::getPrivate() template bool JSCallbackObject::inherits(JSClassRef c) const { - for (JSClassRef jsClass = classRef(); jsClass; jsClass = jsClass->parentClass) + for (JSClassRef jsClass = classRef(); jsClass; jsClass = jsClass->parentClass) { if (jsClass == c) return true; - + } return false; } template -JSValue JSCallbackObject::getStaticValue(ExecState* exec, const Identifier& propertyName) +JSValue JSCallbackObject::getStaticValue(ExecState* exec, PropertyName propertyName) { JSObjectRef thisRef = toRef(this); - RefPtr propertyNameRef; - for (JSClassRef jsClass = classRef(); jsClass; jsClass = jsClass->parentClass) - if (OpaqueJSClassStaticValuesTable* staticValues = jsClass->staticValues(exec)) - if (StaticValueEntry* entry = staticValues->get(propertyName.impl())) - if (JSObjectGetPropertyCallback getProperty = entry->getProperty) { - if (!propertyNameRef) - propertyNameRef = OpaqueJSString::create(propertyName.ustring()); - JSValueRef exception = 0; - JSValueRef value; - { - APICallbackShim callbackShim(exec); - value = getProperty(toRef(exec), thisRef, propertyNameRef.get(), &exception); + if (StringImpl* name = propertyName.publicName()) { + for (JSClassRef jsClass = classRef(); jsClass; jsClass = jsClass->parentClass) { + if (OpaqueJSClassStaticValuesTable* staticValues = jsClass->staticValues(exec)) { + if (StaticValueEntry* entry = staticValues->get(name)) { + if (JSObjectGetPropertyCallback getProperty = entry->getProperty) { + JSValueRef exception = 0; + JSValueRef value; + { + APICallbackShim callbackShim(exec); + value = getProperty(toRef(exec), thisRef, entry->propertyNameRef.get(), &exception); + } + if (exception) { + exec->vm().throwException(exec, toJS(exec, exception)); + return jsUndefined(); + } + if (value) + return toJS(exec, value); } - if (exception) { - throwError(exec, toJS(exec, exception)); - return jsUndefined(); - } - if (value) - return toJS(exec, value); } + } + } + } return JSValue(); } template -JSValue JSCallbackObject::staticFunctionGetter(ExecState* exec, JSValue slotParent, const Identifier& propertyName) +JSValue JSCallbackObject::staticFunctionGetter(ExecState* exec, JSValue slotParent, PropertyName propertyName) { JSCallbackObject* thisObj = asCallbackObject(slotParent); @@ -541,50 +592,55 @@ JSValue JSCallbackObject::staticFunctionGetter(ExecState* exec, JSValue PropertySlot slot2(thisObj); if (Parent::getOwnPropertySlot(thisObj, exec, propertyName, slot2)) return slot2.getValue(exec, propertyName); - - for (JSClassRef jsClass = thisObj->classRef(); jsClass; jsClass = jsClass->parentClass) { - if (OpaqueJSClassStaticFunctionsTable* staticFunctions = jsClass->staticFunctions(exec)) { - if (StaticFunctionEntry* entry = staticFunctions->get(propertyName.impl())) { - if (JSObjectCallAsFunctionCallback callAsFunction = entry->callAsFunction) { - - JSObject* o = JSCallbackFunction::create(exec, thisObj->globalObject(), callAsFunction, propertyName); - thisObj->putDirect(exec->globalData(), propertyName, o, entry->attributes); - return o; + + if (StringImpl* name = propertyName.publicName()) { + for (JSClassRef jsClass = thisObj->classRef(); jsClass; jsClass = jsClass->parentClass) { + if (OpaqueJSClassStaticFunctionsTable* staticFunctions = jsClass->staticFunctions(exec)) { + if (StaticFunctionEntry* entry = staticFunctions->get(name)) { + if (JSObjectCallAsFunctionCallback callAsFunction = entry->callAsFunction) { + VM& vm = exec->vm(); + JSObject* o = JSCallbackFunction::create(vm, thisObj->globalObject(), callAsFunction, name); + thisObj->putDirect(vm, propertyName, o, entry->attributes); + return o; + } } } } } - - return throwError(exec, createReferenceError(exec, "Static function property defined with NULL callAsFunction callback.")); + + return exec->vm().throwException(exec, createReferenceError(exec, ASCIILiteral("Static function property defined with NULL callAsFunction callback."))); } template -JSValue JSCallbackObject::callbackGetter(ExecState* exec, JSValue slotParent, const Identifier& propertyName) +JSValue JSCallbackObject::callbackGetter(ExecState* exec, JSValue slotParent, PropertyName propertyName) { JSCallbackObject* thisObj = asCallbackObject(slotParent); JSObjectRef thisRef = toRef(thisObj); RefPtr propertyNameRef; - for (JSClassRef jsClass = thisObj->classRef(); jsClass; jsClass = jsClass->parentClass) - if (JSObjectGetPropertyCallback getProperty = jsClass->getProperty) { - if (!propertyNameRef) - propertyNameRef = OpaqueJSString::create(propertyName.ustring()); - JSValueRef exception = 0; - JSValueRef value; - { - APICallbackShim callbackShim(exec); - value = getProperty(toRef(exec), thisRef, propertyNameRef.get(), &exception); - } - if (exception) { - throwError(exec, toJS(exec, exception)); - return jsUndefined(); + if (StringImpl* name = propertyName.publicName()) { + for (JSClassRef jsClass = thisObj->classRef(); jsClass; jsClass = jsClass->parentClass) { + if (JSObjectGetPropertyCallback getProperty = jsClass->getProperty) { + if (!propertyNameRef) + propertyNameRef = OpaqueJSString::create(name); + JSValueRef exception = 0; + JSValueRef value; + { + APICallbackShim callbackShim(exec); + value = getProperty(toRef(exec), thisRef, propertyNameRef.get(), &exception); + } + if (exception) { + exec->vm().throwException(exec, toJS(exec, exception)); + return jsUndefined(); + } + if (value) + return toJS(exec, value); } - if (value) - return toJS(exec, value); } - - return throwError(exec, createReferenceError(exec, "hasProperty callback returned true for a property that doesn't exist.")); + } + + return exec->vm().throwException(exec, createReferenceError(exec, ASCIILiteral("hasProperty callback returned true for a property that doesn't exist."))); } } // namespace JSC diff --git a/JavaScriptCore/API/JSClassRef.cpp b/JavaScriptCore/API/JSClassRef.cpp index 08fa5c5e..544c359b 100644 --- a/JavaScriptCore/API/JSClassRef.cpp +++ b/JavaScriptCore/API/JSClassRef.cpp @@ -27,12 +27,13 @@ #include "JSClassRef.h" #include "APICast.h" +#include "Identifier.h" +#include "InitializeThreading.h" #include "JSCallbackObject.h" +#include "JSGlobalObject.h" #include "JSObjectRef.h" -#include -#include -#include -#include +#include "ObjectPrototype.h" +#include "Operations.h" #include #include @@ -42,20 +43,6 @@ using namespace WTF::Unicode; const JSClassDefinition kJSClassDefinitionEmpty = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; -static inline UString tryCreateStringFromUTF8(const char* string) -{ - if (!string) - return UString(); - - size_t length = strlen(string); - Vector buffer(length); - UChar* p = buffer.data(); - if (conversionOK != convertUTF8ToUTF16(&string, string + length, &p, p + length)) - return UString(); - - return UString(buffer.data(), p - buffer.data()); -} - OpaqueJSClass::OpaqueJSClass(const JSClassDefinition* definition, OpaqueJSClass* protoClass) : parentClass(definition->parentClass) , prototypeClass(0) @@ -70,16 +57,16 @@ OpaqueJSClass::OpaqueJSClass(const JSClassDefinition* definition, OpaqueJSClass* , callAsConstructor(definition->callAsConstructor) , hasInstance(definition->hasInstance) , convertToType(definition->convertToType) - , m_className(tryCreateStringFromUTF8(definition->className)) + , m_className(String::fromUTF8(definition->className)) { initializeThreading(); if (const JSStaticValue* staticValue = definition->staticValues) { m_staticValues = adoptPtr(new OpaqueJSClassStaticValuesTable); while (staticValue->name) { - UString valueName = tryCreateStringFromUTF8(staticValue->name); + String valueName = String::fromUTF8(staticValue->name); if (!valueName.isNull()) - m_staticValues->set(valueName.impl(), adoptPtr(new StaticValueEntry(staticValue->getProperty, staticValue->setProperty, staticValue->attributes))); + m_staticValues->set(valueName.impl(), std::make_unique(staticValue->getProperty, staticValue->setProperty, staticValue->attributes, valueName)); ++staticValue; } } @@ -87,9 +74,9 @@ OpaqueJSClass::OpaqueJSClass(const JSClassDefinition* definition, OpaqueJSClass* if (const JSStaticFunction* staticFunction = definition->staticFunctions) { m_staticFunctions = adoptPtr(new OpaqueJSClassStaticFunctionsTable); while (staticFunction->name) { - UString functionName = tryCreateStringFromUTF8(staticFunction->name); + String functionName = String::fromUTF8(staticFunction->name); if (!functionName.isNull()) - m_staticFunctions->set(functionName.impl(), adoptPtr(new StaticFunctionEntry(staticFunction->callAsFunction, staticFunction->attributes))); + m_staticFunctions->set(functionName.impl(), std::make_unique(staticFunction->callAsFunction, staticFunction->attributes)); ++staticFunction; } } @@ -107,13 +94,13 @@ OpaqueJSClass::~OpaqueJSClass() if (m_staticValues) { OpaqueJSClassStaticValuesTable::const_iterator end = m_staticValues->end(); for (OpaqueJSClassStaticValuesTable::const_iterator it = m_staticValues->begin(); it != end; ++it) - ASSERT(!it->first->isIdentifier()); + ASSERT(!it->key->isIdentifier()); } if (m_staticFunctions) { OpaqueJSClassStaticFunctionsTable::const_iterator end = m_staticFunctions->end(); for (OpaqueJSClassStaticFunctionsTable::const_iterator it = m_staticFunctions->begin(); it != end; ++it) - ASSERT(!it->first->isIdentifier()); + ASSERT(!it->key->isIdentifier()); } #endif @@ -140,40 +127,41 @@ PassRefPtr OpaqueJSClass::create(const JSClassDefinition* clientD return adoptRef(new OpaqueJSClass(&definition, protoClass.get())); } -OpaqueJSClassContextData::OpaqueJSClassContextData(JSC::JSGlobalData&, OpaqueJSClass* jsClass) +OpaqueJSClassContextData::OpaqueJSClassContextData(JSC::VM&, OpaqueJSClass* jsClass) : m_class(jsClass) { if (jsClass->m_staticValues) { - staticValues = adoptPtr(new OpaqueJSClassStaticValuesTable); + staticValues = std::make_unique(); OpaqueJSClassStaticValuesTable::const_iterator end = jsClass->m_staticValues->end(); for (OpaqueJSClassStaticValuesTable::const_iterator it = jsClass->m_staticValues->begin(); it != end; ++it) { - ASSERT(!it->first->isIdentifier()); - staticValues->add(StringImpl::create(it->first->characters(), it->first->length()), adoptPtr(new StaticValueEntry(it->second->getProperty, it->second->setProperty, it->second->attributes))); + ASSERT(!it->key->isIdentifier()); + String valueName = it->key->isolatedCopy(); + staticValues->add(valueName.impl(), std::make_unique(it->value->getProperty, it->value->setProperty, it->value->attributes, valueName)); } } if (jsClass->m_staticFunctions) { - staticFunctions = adoptPtr(new OpaqueJSClassStaticFunctionsTable); + staticFunctions = std::make_unique(); OpaqueJSClassStaticFunctionsTable::const_iterator end = jsClass->m_staticFunctions->end(); for (OpaqueJSClassStaticFunctionsTable::const_iterator it = jsClass->m_staticFunctions->begin(); it != end; ++it) { - ASSERT(!it->first->isIdentifier()); - staticFunctions->add(StringImpl::create(it->first->characters(), it->first->length()), adoptPtr(new StaticFunctionEntry(it->second->callAsFunction, it->second->attributes))); + ASSERT(!it->key->isIdentifier()); + staticFunctions->add(it->key->isolatedCopy(), std::make_unique(it->value->callAsFunction, it->value->attributes)); } } } OpaqueJSClassContextData& OpaqueJSClass::contextData(ExecState* exec) { - OwnPtr& contextData = exec->globalData().opaqueJSClassData.add(this, nullptr).iterator->second; + std::unique_ptr& contextData = exec->lexicalGlobalObject()->opaqueJSClassData().add(this, nullptr).iterator->value; if (!contextData) - contextData = adoptPtr(new OpaqueJSClassContextData(exec->globalData(), this)); + contextData = std::make_unique(exec->vm(), this); return *contextData; } -UString OpaqueJSClass::className() +String OpaqueJSClass::className() { // Make a deep copy, so that the caller has no chance to put the original into IdentifierTable. - return UString(m_className.characters(), m_className.length()); + return m_className.isolatedCopy(); } OpaqueJSClassStaticValuesTable* OpaqueJSClass::staticValues(JSC::ExecState* exec) @@ -209,13 +197,16 @@ JSObject* OpaqueJSClass::prototype(ExecState* exec) OpaqueJSClassContextData& jsClassData = contextData(exec); - if (!jsClassData.cachedPrototype) { - // Recursive, but should be good enough for our purposes - jsClassData.cachedPrototype = PassWeak(JSCallbackObject::create(exec, exec->lexicalGlobalObject(), exec->lexicalGlobalObject()->callbackObjectStructure(), prototypeClass, &jsClassData), 0); // set jsClassData as the object's private data, so it can clear our reference on destruction - if (parentClass) { - if (JSObject* prototype = parentClass->prototype(exec)) - jsClassData.cachedPrototype->setPrototype(exec->globalData(), prototype); - } + if (JSObject* prototype = jsClassData.cachedPrototype.get()) + return prototype; + + // Recursive, but should be good enough for our purposes + JSObject* prototype = JSCallbackObject::create(exec, exec->lexicalGlobalObject(), exec->lexicalGlobalObject()->callbackObjectStructure(), prototypeClass, &jsClassData); // set jsClassData as the object's private data, so it can clear our reference on destruction + if (parentClass) { + if (JSObject* parentPrototype = parentClass->prototype(exec)) + prototype->setPrototype(exec->vm(), parentPrototype); } - return jsClassData.cachedPrototype.get(); + + jsClassData.cachedPrototype = Weak(prototype); + return prototype; } diff --git a/JavaScriptCore/API/JSClassRef.h b/JavaScriptCore/API/JSClassRef.h index 82c7ab3f..f979f3b2 100644 --- a/JavaScriptCore/API/JSClassRef.h +++ b/JavaScriptCore/API/JSClassRef.h @@ -26,25 +26,25 @@ #ifndef JSClassRef_h #define JSClassRef_h -#include "JSObjectRef.h" - -#include "Weak.h" -#include "JSObject.h" +#include "OpaqueJSString.h" #include "Protect.h" -#include "UString.h" +#include "Weak.h" +#include #include +#include struct StaticValueEntry { WTF_MAKE_FAST_ALLOCATED; public: - StaticValueEntry(JSObjectGetPropertyCallback _getProperty, JSObjectSetPropertyCallback _setProperty, JSPropertyAttributes _attributes) - : getProperty(_getProperty), setProperty(_setProperty), attributes(_attributes) + StaticValueEntry(JSObjectGetPropertyCallback _getProperty, JSObjectSetPropertyCallback _setProperty, JSPropertyAttributes _attributes, String& propertyName) + : getProperty(_getProperty), setProperty(_setProperty), attributes(_attributes), propertyNameRef(OpaqueJSString::create(propertyName)) { } JSObjectGetPropertyCallback getProperty; JSObjectSetPropertyCallback setProperty; JSPropertyAttributes attributes; + RefPtr propertyNameRef; }; struct StaticFunctionEntry { @@ -59,8 +59,8 @@ struct StaticFunctionEntry { JSPropertyAttributes attributes; }; -typedef HashMap, OwnPtr > OpaqueJSClassStaticValuesTable; -typedef HashMap, OwnPtr > OpaqueJSClassStaticFunctionsTable; +typedef HashMap, std::unique_ptr> OpaqueJSClassStaticValuesTable; +typedef HashMap, std::unique_ptr> OpaqueJSClassStaticFunctionsTable; struct OpaqueJSClass; @@ -69,27 +69,27 @@ struct OpaqueJSClass; struct OpaqueJSClassContextData { WTF_MAKE_NONCOPYABLE(OpaqueJSClassContextData); WTF_MAKE_FAST_ALLOCATED; public: - OpaqueJSClassContextData(JSC::JSGlobalData&, OpaqueJSClass*); + OpaqueJSClassContextData(JSC::VM&, OpaqueJSClass*); // It is necessary to keep OpaqueJSClass alive because of the following rare scenario: - // 1. A class is created and used, so its context data is stored in JSGlobalData hash map. + // 1. A class is created and used, so its context data is stored in VM hash map. // 2. The class is released, and when all JS objects that use it are collected, OpaqueJSClass // is deleted (that's the part prevented by this RefPtr). // 3. Another class is created at the same address. - // 4. When it is used, the old context data is found in JSGlobalData and used. + // 4. When it is used, the old context data is found in VM and used. RefPtr m_class; - OwnPtr staticValues; - OwnPtr staticFunctions; + std::unique_ptr staticValues; + std::unique_ptr staticFunctions; JSC::Weak cachedPrototype; }; struct OpaqueJSClass : public ThreadSafeRefCounted { static PassRefPtr create(const JSClassDefinition*); static PassRefPtr createNoAutomaticPrototype(const JSClassDefinition*); - ~OpaqueJSClass(); + JS_EXPORT_PRIVATE ~OpaqueJSClass(); - JSC::UString className(); + String className(); OpaqueJSClassStaticValuesTable* staticValues(JSC::ExecState*); OpaqueJSClassStaticFunctionsTable* staticFunctions(JSC::ExecState*); JSC::JSObject* prototype(JSC::ExecState*); @@ -118,8 +118,8 @@ struct OpaqueJSClass : public ThreadSafeRefCounted { OpaqueJSClassContextData& contextData(JSC::ExecState*); - // UStrings in these data members should not be put into any IdentifierTable. - JSC::UString m_className; + // Strings in these data members should not be put into any IdentifierTable. + String m_className; OwnPtr m_staticValues; OwnPtr m_staticFunctions; }; diff --git a/JavaScriptCore/API/JSContext.h b/JavaScriptCore/API/JSContext.h new file mode 100644 index 00000000..3834f89e --- /dev/null +++ b/JavaScriptCore/API/JSContext.h @@ -0,0 +1,133 @@ +/* + * Copyright (C) 2013 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. + */ + +#ifndef JSContext_h +#define JSContext_h + +#include + +#if JSC_OBJC_API_ENABLED + +@class JSVirtualMachine, JSValue; + +// An instance of JSContext represents a JavaScript execution environment. All +// JavaScript execution takes place within a context. +// JSContext is also used to manage the life-cycle of objects within the +// JavaScript virtual machine. Every instance of JSValue is associated with a +// JSContext via a strong reference. The JSValue will keep the JSContext it +// references alive so long as the JSValue remains alive. When all of the JSValues +// that reference a particular JSContext have been deallocated the JSContext +// will be deallocated unless it has been previously retained. + +#ifndef JSC_OBJC_API_AVAILABLE_MAC_OS_X_1080 +NS_CLASS_AVAILABLE(10_9, 7_0) +#else +OBJC_VISIBLE +#endif +@interface JSContext : NSObject + +// Create a JSContext. +- (id)init; +// Create a JSContext in the specified virtual machine. +- (id)initWithVirtualMachine:(JSVirtualMachine *)virtualMachine; + +// Evaluate a string of JavaScript code. +- (JSValue *)evaluateScript:(NSString *)script; + +// This method retrieves the global object of the JavaScript execution context. +// Instances of JSContext originating from WebKit will return a reference to the +// WindowProxy object. +- (JSValue *)globalObject; + +// This method may be called from within an Objective-C block or method invoked +// as a callback from JavaScript to retrieve the callback's context. Outside of +// a callback from JavaScript this method will return nil. ++ (JSContext *)currentContext; +// This method may be called from within an Objective-C block or method invoked +// as a callback from JavaScript to retrieve the callback's this value. Outside +// of a callback from JavaScript this method will return nil. ++ (JSValue *)currentThis; +// This method may be called from within an Objective-C block or method invoked +// as a callback from JavaScript to retrieve the callback's arguments, objects +// in the returned array are instances of JSValue. Outside of a callback from +// JavaScript this method will return nil. ++ (NSArray *)currentArguments; + +// The "exception" property may be used to throw an exception to JavaScript. +// Before a callback is made from JavaScript to an Objective-C block or method, +// the prior value of the exception property will be preserved and the property +// will be set to nil. After the callback has completed the new value of the +// exception property will be read, and prior value restored. If the new value +// of exception is not nil, the callback will result in that value being thrown. +// This property may also be used to check for uncaught exceptions arising from +// API function calls (since the default behaviour of "exceptionHandler" is to +// assign an uncaught exception to this property). +// If a JSValue originating from a different JSVirtualMachine than this context +// is assigned to this property, an Objective-C exception will be raised. +@property(retain) JSValue *exception; + +// If a call to an API function results in an uncaught JavaScript exception, the +// "exceptionHandler" block will be invoked. The default implementation for the +// exception handler will store the exception to the exception property on +// context. As a consequence the default behaviour is for unhandled exceptions +// occurring within a callback from JavaScript to be rethrown upon return. +// Setting this value to nil will result in all uncaught exceptions thrown from +// the API being silently consumed. +@property(copy) void(^exceptionHandler)(JSContext *context, JSValue *exception); + +// All instances of JSContext are associated with a single JSVirtualMachine. The +// virtual machine provides an "object space" or set of execution resources. +@property(readonly, retain) JSVirtualMachine *virtualMachine; + +@end + +// Instances of JSContext implement the following methods in order to enable +// support for subscript access by key and index, for example: +// +// JSContext *context; +// JSValue *v = context[@"X"]; // Get value for "X" from the global object. +// context[@"Y"] = v; // Assign 'v' to "Y" on the global object. +// +// An object key passed as a subscript will be converted to a JavaScript value, +// and then the value converted to a string used to resolve a property of the +// global object. +@interface JSContext(SubscriptSupport) + +- (JSValue *)objectForKeyedSubscript:(id)key; +- (void)setObject:(id)object forKeyedSubscript:(NSObject *)key; + +@end + +// These functions are for bridging between the C API and the Objective-C API. +@interface JSContext(JSContextRefSupport) +// Creates a JSContext, wrapping its C API counterpart. ++ (JSContext *)contextWithJSGlobalContextRef:(JSGlobalContextRef)jsGlobalContextRef; +// Returns the C API counterpart wrapped by a JSContext. +- (JSGlobalContextRef)JSGlobalContextRef; +@end + +#endif + +#endif // JSContext_h diff --git a/JavaScriptCore/API/JSContext.mm b/JavaScriptCore/API/JSContext.mm new file mode 100644 index 00000000..bc8fc1ab --- /dev/null +++ b/JavaScriptCore/API/JSContext.mm @@ -0,0 +1,289 @@ +/* + * Copyright (C) 2013 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" + +#import "APICast.h" +#import "APIShims.h" +#import "JSContextInternal.h" +#import "JSGlobalObject.h" +#import "JSValueInternal.h" +#import "JSVirtualMachineInternal.h" +#import "JSWrapperMap.h" +#import "JavaScriptCore.h" +#import "ObjcRuntimeExtras.h" +#import "Operations.h" +#import "StrongInlines.h" +#import + +#if JSC_OBJC_API_ENABLED + +@implementation JSContext { + JSVirtualMachine *m_virtualMachine; + JSGlobalContextRef m_context; + JSWrapperMap *m_wrapperMap; + JSC::Strong m_exception; +} + +@synthesize exceptionHandler; + +- (JSGlobalContextRef)JSGlobalContextRef +{ + return m_context; +} + +- (id)init +{ + return [self initWithVirtualMachine:[[[JSVirtualMachine alloc] init] autorelease]]; +} + +- (id)initWithVirtualMachine:(JSVirtualMachine *)virtualMachine +{ + self = [super init]; + if (!self) + return nil; + + m_virtualMachine = [virtualMachine retain]; + m_context = JSGlobalContextCreateInGroup(getGroupFromVirtualMachine(virtualMachine), 0); + m_wrapperMap = [[JSWrapperMap alloc] initWithContext:self]; + + self.exceptionHandler = ^(JSContext *context, JSValue *exceptionValue) { + context.exception = exceptionValue; + }; + + [m_virtualMachine addContext:self forGlobalContextRef:m_context]; + + return self; +} + +- (void)dealloc +{ + [m_wrapperMap release]; + JSGlobalContextRelease(m_context); + [m_virtualMachine release]; + [self.exceptionHandler release]; + [super dealloc]; +} + +- (JSValue *)evaluateScript:(NSString *)script +{ + JSValueRef exceptionValue = 0; + JSStringRef scriptJS = JSStringCreateWithCFString((CFStringRef)script); + JSValueRef result = JSEvaluateScript(m_context, scriptJS, 0, 0, 0, &exceptionValue); + JSStringRelease(scriptJS); + + if (exceptionValue) + return [self valueFromNotifyException:exceptionValue]; + + return [JSValue valueWithJSValueRef:result inContext:self]; +} + +- (void)setException:(JSValue *)value +{ + if (value) + m_exception.set(toJS(m_context)->vm(), toJS(JSValueToObject(m_context, valueInternalValue(value), 0))); + else + m_exception.clear(); +} + +- (JSValue *)exception +{ + if (!m_exception) + return nil; + return [JSValue valueWithJSValueRef:toRef(m_exception.get()) inContext:self]; +} + +- (JSWrapperMap *)wrapperMap +{ + return m_wrapperMap; +} + +- (JSValue *)globalObject +{ + return [JSValue valueWithJSValueRef:JSContextGetGlobalObject(m_context) inContext:self]; +} + ++ (JSContext *)currentContext +{ + WTFThreadData& threadData = wtfThreadData(); + CallbackData *entry = (CallbackData *)threadData.m_apiData; + return entry ? entry->context : nil; +} + ++ (JSValue *)currentThis +{ + WTFThreadData& threadData = wtfThreadData(); + CallbackData *entry = (CallbackData *)threadData.m_apiData; + if (!entry) + return nil; + return [JSValue valueWithJSValueRef:entry->thisValue inContext:[JSContext currentContext]]; +} + ++ (NSArray *)currentArguments +{ + WTFThreadData& threadData = wtfThreadData(); + CallbackData *entry = (CallbackData *)threadData.m_apiData; + + if (!entry) + return nil; + + if (!entry->currentArguments) { + JSContext *context = [JSContext currentContext]; + size_t count = entry->argumentCount; + JSValue * argumentArray[count]; + for (size_t i =0; i < count; ++i) + argumentArray[i] = [JSValue valueWithJSValueRef:entry->arguments[i] inContext:context]; + entry->currentArguments = [[NSArray alloc] initWithObjects:argumentArray count:count]; + } + + return entry->currentArguments; +} + +- (JSVirtualMachine *)virtualMachine +{ + return m_virtualMachine; +} + +@end + +@implementation JSContext(SubscriptSupport) + +- (JSValue *)objectForKeyedSubscript:(id)key +{ + return [self globalObject][key]; +} + +- (void)setObject:(id)object forKeyedSubscript:(NSObject *)key +{ + [self globalObject][key] = object; +} + +@end + +@implementation JSContext(Internal) + +- (id)initWithGlobalContextRef:(JSGlobalContextRef)context +{ + self = [super init]; + if (!self) + return nil; + + JSC::JSGlobalObject* globalObject = toJS(context)->lexicalGlobalObject(); + m_virtualMachine = [[JSVirtualMachine virtualMachineWithContextGroupRef:toRef(&globalObject->vm())] retain]; + ASSERT(m_virtualMachine); + m_context = JSGlobalContextRetain(context); + m_wrapperMap = [[JSWrapperMap alloc] initWithContext:self]; + + self.exceptionHandler = ^(JSContext *context, JSValue *exceptionValue) { + context.exception = exceptionValue; + }; + + [m_virtualMachine addContext:self forGlobalContextRef:m_context]; + + return self; +} + +- (void)notifyException:(JSValueRef)exceptionValue +{ + self.exceptionHandler(self, [JSValue valueWithJSValueRef:exceptionValue inContext:self]); +} + +- (JSValue *)valueFromNotifyException:(JSValueRef)exceptionValue +{ + [self notifyException:exceptionValue]; + return [JSValue valueWithUndefinedInContext:self]; +} + +- (BOOL)boolFromNotifyException:(JSValueRef)exceptionValue +{ + [self notifyException:exceptionValue]; + return NO; +} + +- (void)beginCallbackWithData:(CallbackData *)callbackData thisValue:(JSValueRef)thisValue argumentCount:(size_t)argumentCount arguments:(const JSValueRef *)arguments +{ + WTFThreadData& threadData = wtfThreadData(); + [self retain]; + CallbackData *prevStack = (CallbackData *)threadData.m_apiData; + *callbackData = (CallbackData){ prevStack, self, [self.exception retain], thisValue, argumentCount, arguments, nil }; + threadData.m_apiData = callbackData; + self.exception = nil; +} + +- (void)endCallbackWithData:(CallbackData *)callbackData +{ + WTFThreadData& threadData = wtfThreadData(); + self.exception = callbackData->preservedException; + [callbackData->preservedException release]; + [callbackData->currentArguments release]; + threadData.m_apiData = callbackData->next; + [self release]; +} + +- (JSValue *)wrapperForObjCObject:(id)object +{ + // Lock access to m_wrapperMap + JSC::JSLockHolder lock(toJS(m_context)); + return [m_wrapperMap jsWrapperForObject:object]; +} + +- (JSValue *)wrapperForJSObject:(JSValueRef)value +{ + JSC::JSLockHolder lock(toJS(m_context)); + return [m_wrapperMap objcWrapperForJSValueRef:value]; +} + ++ (JSContext *)contextWithJSGlobalContextRef:(JSGlobalContextRef)globalContext +{ + JSVirtualMachine *virtualMachine = [JSVirtualMachine virtualMachineWithContextGroupRef:toRef(&toJS(globalContext)->vm())]; + JSContext *context = [virtualMachine contextForGlobalContextRef:globalContext]; + if (!context) + context = [[[JSContext alloc] initWithGlobalContextRef:globalContext] autorelease]; + return context; +} + +@end + +WeakContextRef::WeakContextRef(JSContext *context) +{ + objc_initWeak(&m_weakContext, context); +} + +WeakContextRef::~WeakContextRef() +{ + objc_destroyWeak(&m_weakContext); +} + +JSContext * WeakContextRef::get() +{ + return objc_loadWeak(&m_weakContext); +} + +void WeakContextRef::set(JSContext *context) +{ + objc_storeWeak(&m_weakContext, context); +} + +#endif diff --git a/WTF/wtf/url/api/ParsedURL.h b/JavaScriptCore/API/JSContextInternal.h similarity index 50% rename from WTF/wtf/url/api/ParsedURL.h rename to JavaScriptCore/API/JSContextInternal.h index 2bb3330c..d7300f54 100644 --- a/WTF/wtf/url/api/ParsedURL.h +++ b/JavaScriptCore/API/JSContextInternal.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2010 Google, Inc. All Rights Reserved. + * Copyright (C) 2013 Apple Inc. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -20,55 +20,60 @@ * 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. + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -#ifndef ParsedURL_h -#define ParsedURL_h +#ifndef JSContextInternal_h +#define JSContextInternal_h -#if USE(WTFURL) +#import -#include -#include +#if JSC_OBJC_API_ENABLED -namespace WTF { +#import -class URLComponent; +struct CallbackData { + CallbackData *next; + JSContext *context; + JSValue *preservedException; + JSValueRef thisValue; + size_t argumentCount; + const JSValueRef *arguments; + NSArray *currentArguments; +}; -// ParsedURL represents a valid URL decomposed by components. -class ParsedURL { +class WeakContextRef { public: - // FIXME: Add a method for parsing non-canonicalized URLs. - ParsedURL() { }; - WTF_EXPORT_PRIVATE explicit ParsedURL(const String&); + WeakContextRef(JSContext * = nil); + ~WeakContextRef(); - WTF_EXPORT_PRIVATE ParsedURL isolatedCopy() const; + JSContext * get(); + void set(JSContext *); - bool isValid() const { return !m_spec.string().isEmpty(); } +private: + JSContext *m_weakContext; +}; - // Return a URL component or a null String if the component is undefined for the URL. - WTF_EXPORT_PRIVATE String scheme() const; - WTF_EXPORT_PRIVATE String username() const; - WTF_EXPORT_PRIVATE String password() const; - WTF_EXPORT_PRIVATE String host() const; - WTF_EXPORT_PRIVATE String port() const; - WTF_EXPORT_PRIVATE String path() const; - WTF_EXPORT_PRIVATE String query() const; - WTF_EXPORT_PRIVATE String fragment() const; +@class JSWrapperMap; - WTF_EXPORT_PRIVATE String baseAsString() const; +@interface JSContext(Internal) - URLString spec() { return m_spec; } +- (id)initWithGlobalContextRef:(JSGlobalContextRef)context; -private: - inline String segment(const URLComponent&) const; +- (void)notifyException:(JSValueRef)exception; +- (JSValue *)valueFromNotifyException:(JSValueRef)exception; +- (BOOL)boolFromNotifyException:(JSValueRef)exception; - URLString m_spec; - URLSegments m_segments; -}; +- (void)beginCallbackWithData:(CallbackData *)callbackData thisValue:(JSValueRef)thisValue argumentCount:(size_t)argumentCount arguments:(const JSValueRef *)arguments; +- (void)endCallbackWithData:(CallbackData *)callbackData; + +- (JSValue *)wrapperForObjCObject:(id)object; +- (JSValue *)wrapperForJSObject:(JSValueRef)value; -} +@property (readonly, retain) JSWrapperMap *wrapperMap; -#endif // USE(WTFURL) +@end #endif + +#endif // JSContextInternal_h diff --git a/JavaScriptCore/API/JSContextRef.cpp b/JavaScriptCore/API/JSContextRef.cpp index 7a57287d..2ed8241e 100644 --- a/JavaScriptCore/API/JSContextRef.cpp +++ b/JavaScriptCore/API/JSContextRef.cpp @@ -28,14 +28,17 @@ #include "JSContextRefPrivate.h" #include "APICast.h" +#include "CallFrame.h" +#include "CallFrameInlines.h" #include "InitializeThreading.h" -#include -#include #include "JSCallbackObject.h" #include "JSClassRef.h" #include "JSGlobalObject.h" #include "JSObject.h" -#include "UStringBuilder.h" +#include "Operations.h" +#include "SourceProvider.h" +#include "StackVisitor.h" +#include #include #if OS(DARWIN) @@ -54,7 +57,7 @@ using namespace JSC; JSContextGroupRef JSContextGroupCreate() { initializeThreading(); - return toRef(JSGlobalData::createContextGroup(ThreadStackTypeSmall).leakRef()); + return toRef(VM::createContextGroup().leakRef()); } JSContextGroupRef JSContextGroupRetain(JSContextGroupRef group) @@ -65,7 +68,44 @@ JSContextGroupRef JSContextGroupRetain(JSContextGroupRef group) void JSContextGroupRelease(JSContextGroupRef group) { - toJS(group)->deref(); + IdentifierTable* savedIdentifierTable; + VM& vm = *toJS(group); + + { + JSLockHolder lock(vm); + savedIdentifierTable = wtfThreadData().setCurrentIdentifierTable(vm.identifierTable); + vm.deref(); + } + + wtfThreadData().setCurrentIdentifierTable(savedIdentifierTable); +} + +static bool internalScriptTimeoutCallback(ExecState* exec, void* callbackPtr, void* callbackData) +{ + JSShouldTerminateCallback callback = reinterpret_cast(callbackPtr); + JSContextRef contextRef = toRef(exec); + ASSERT(callback); + return callback(contextRef, callbackData); +} + +void JSContextGroupSetExecutionTimeLimit(JSContextGroupRef group, double limit, JSShouldTerminateCallback callback, void* callbackData) +{ + VM& vm = *toJS(group); + APIEntryShim entryShim(&vm); + Watchdog& watchdog = vm.watchdog; + if (callback) { + void* callbackPtr = reinterpret_cast(callback); + watchdog.setTimeLimit(vm, limit, internalScriptTimeoutCallback, callbackPtr, callbackData); + } else + watchdog.setTimeLimit(vm, limit); +} + +void JSContextGroupClearExecutionTimeLimit(JSContextGroupRef group) +{ + VM& vm = *toJS(group); + APIEntryShim entryShim(&vm); + Watchdog& watchdog = vm.watchdog; + watchdog.setTimeLimit(vm, std::numeric_limits::infinity()); } // From the API's perspective, a global context remains alive iff it has been JSGlobalContextRetained. @@ -75,10 +115,10 @@ JSGlobalContextRef JSGlobalContextCreate(JSClassRef globalObjectClass) initializeThreading(); #if OS(DARWIN) - // If the application was linked before JSGlobalContextCreate was changed to use a unique JSGlobalData, + // If the application was linked before JSGlobalContextCreate was changed to use a unique VM, // we use a shared one for backwards compatibility. if (NSVersionOfLinkTimeLibrary("JavaScriptCore") <= webkitFirstVersionWithConcurrentGlobalContexts) { - return JSGlobalContextCreateInGroup(toRef(&JSGlobalData::sharedInstance()), globalObjectClass); + return JSGlobalContextCreateInGroup(toRef(&VM::sharedInstance()), globalObjectClass); } #endif // OS(DARWIN) @@ -89,22 +129,23 @@ JSGlobalContextRef JSGlobalContextCreateInGroup(JSContextGroupRef group, JSClass { initializeThreading(); - RefPtr globalData = group ? PassRefPtr(toJS(group)) : JSGlobalData::createContextGroup(ThreadStackTypeSmall); + RefPtr vm = group ? PassRefPtr(toJS(group)) : VM::createContextGroup(); - APIEntryShim entryShim(globalData.get(), false); - globalData->makeUsableFromMultipleThreads(); + APIEntryShim entryShim(vm.get(), false); + vm->makeUsableFromMultipleThreads(); if (!globalObjectClass) { - JSGlobalObject* globalObject = JSGlobalObject::create(*globalData, JSGlobalObject::createStructure(*globalData, jsNull())); + JSGlobalObject* globalObject = JSGlobalObject::create(*vm, JSGlobalObject::createStructure(*vm, jsNull())); + globalObject->setGlobalThis(*vm, JSProxy::create(*vm, JSProxy::createStructure(*vm, globalObject, globalObject->prototype()), globalObject)); return JSGlobalContextRetain(toGlobalRef(globalObject->globalExec())); } - JSGlobalObject* globalObject = JSCallbackObject::create(*globalData, globalObjectClass, JSCallbackObject::createStructure(*globalData, 0, jsNull())); + JSGlobalObject* globalObject = JSCallbackObject::create(*vm, globalObjectClass, JSCallbackObject::createStructure(*vm, 0, jsNull())); ExecState* exec = globalObject->globalExec(); JSValue prototype = globalObjectClass->prototype(exec); if (!prototype) prototype = jsNull(); - globalObject->resetPrototype(*globalData, prototype); + globalObject->resetPrototype(*vm, prototype); return JSGlobalContextRetain(toGlobalRef(exec)); } @@ -113,9 +154,9 @@ JSGlobalContextRef JSGlobalContextRetain(JSGlobalContextRef ctx) ExecState* exec = toJS(ctx); APIEntryShim entryShim(exec); - JSGlobalData& globalData = exec->globalData(); + VM& vm = exec->vm(); gcProtect(exec->dynamicGlobalObject()); - globalData.ref(); + vm.ref(); return ctx; } @@ -126,13 +167,13 @@ void JSGlobalContextRelease(JSGlobalContextRef ctx) { JSLockHolder lock(exec); - JSGlobalData& globalData = exec->globalData(); - savedIdentifierTable = wtfThreadData().setCurrentIdentifierTable(globalData.identifierTable); + VM& vm = exec->vm(); + savedIdentifierTable = wtfThreadData().setCurrentIdentifierTable(vm.identifierTable); bool protectCountIsZero = Heap::heap(exec->dynamicGlobalObject())->unprotect(exec->dynamicGlobalObject()); if (protectCountIsZero) - globalData.heap.reportAbandonedObjectGraph(); - globalData.deref(); + vm.heap.reportAbandonedObjectGraph(); + vm.deref(); } wtfThreadData().setCurrentIdentifierTable(savedIdentifierTable); @@ -140,80 +181,102 @@ void JSGlobalContextRelease(JSGlobalContextRef ctx) JSObjectRef JSContextGetGlobalObject(JSContextRef ctx) { + if (!ctx) { + ASSERT_NOT_REACHED(); + return 0; + } ExecState* exec = toJS(ctx); APIEntryShim entryShim(exec); - // It is necessary to call toThisObject to get the wrapper object when used with WebCore. - return toRef(exec->lexicalGlobalObject()->methodTable()->toThisObject(exec->lexicalGlobalObject(), exec)); + return toRef(jsCast(exec->lexicalGlobalObject()->methodTable()->toThis(exec->lexicalGlobalObject(), exec, NotStrictMode))); } JSContextGroupRef JSContextGetGroup(JSContextRef ctx) { + if (!ctx) { + ASSERT_NOT_REACHED(); + return 0; + } ExecState* exec = toJS(ctx); - return toRef(&exec->globalData()); + return toRef(&exec->vm()); } JSGlobalContextRef JSContextGetGlobalContext(JSContextRef ctx) { + if (!ctx) { + ASSERT_NOT_REACHED(); + return 0; + } ExecState* exec = toJS(ctx); APIEntryShim entryShim(exec); return toGlobalRef(exec->lexicalGlobalObject()->globalExec()); } - + +class BacktraceFunctor { +public: + BacktraceFunctor(StringBuilder& builder, unsigned remainingCapacityForFrameCapture) + : m_builder(builder) + , m_remainingCapacityForFrameCapture(remainingCapacityForFrameCapture) + { + } + + StackVisitor::Status operator()(StackVisitor& visitor) + { + if (m_remainingCapacityForFrameCapture) { + // If callee is unknown, but we've not added any frame yet, we should + // still add the frame, because something called us, and gave us arguments. + JSObject* callee = visitor->callee(); + if (!callee && visitor->index()) + return StackVisitor::Done; + + StringBuilder& builder = m_builder; + if (!builder.isEmpty()) + builder.append('\n'); + builder.append('#'); + builder.appendNumber(visitor->index()); + builder.append(' '); + builder.append(visitor->functionName()); + builder.appendLiteral("() at "); + builder.append(visitor->sourceURL()); + if (visitor->isJSFrame()) { + builder.append(':'); + unsigned lineNumber; + unsigned unusedColumn; + visitor->computeLineAndColumn(lineNumber, unusedColumn); + builder.appendNumber(lineNumber); + } + + if (!callee) + return StackVisitor::Done; + + m_remainingCapacityForFrameCapture--; + return StackVisitor::Continue; + } + return StackVisitor::Done; + } + +private: + StringBuilder& m_builder; + unsigned m_remainingCapacityForFrameCapture; +}; + JSStringRef JSContextCreateBacktrace(JSContextRef ctx, unsigned maxStackSize) { + if (!ctx) { + ASSERT_NOT_REACHED(); + return 0; + } ExecState* exec = toJS(ctx); JSLockHolder lock(exec); + StringBuilder builder; + CallFrame* frame = exec->vm().topCallFrame; - unsigned count = 0; - UStringBuilder builder; - CallFrame* callFrame = exec; - UString functionName; - if (exec->callee()) { - if (asObject(exec->callee())->inherits(&InternalFunction::s_info)) { - functionName = asInternalFunction(exec->callee())->name(exec); - builder.append("#0 "); - builder.append(functionName); - builder.append("() "); - count++; - } - } - while (true) { - ASSERT(callFrame); - int signedLineNumber; - intptr_t sourceID; - UString urlString; - JSValue function; - - UString levelStr = UString::number(count); - - exec->interpreter()->retrieveLastCaller(callFrame, signedLineNumber, sourceID, urlString, function); - - if (function) - functionName = jsCast(function)->name(exec); - else { - // Caller is unknown, but if frame is empty we should still add the frame, because - // something called us, and gave us arguments. - if (count) - break; - } - unsigned lineNumber = signedLineNumber >= 0 ? signedLineNumber : 0; - if (!builder.isEmpty()) - builder.append("\n"); - builder.append("#"); - builder.append(levelStr); - builder.append(" "); - builder.append(functionName); - builder.append("() at "); - builder.append(urlString); - builder.append(":"); - builder.append(UString::number(lineNumber)); - if (!function || ++count == maxStackSize) - break; - callFrame = callFrame->callerFrame(); - } - return OpaqueJSString::create(builder.toUString()).leakRef(); + ASSERT(maxStackSize); + BacktraceFunctor functor(builder, maxStackSize); + frame->iterate(functor); + + return OpaqueJSString::create(builder.toString()).leakRef(); } diff --git a/JavaScriptCore/API/JSContextRef.h b/JavaScriptCore/API/JSContextRef.h index c5c8a71e..7705955c 100644 --- a/JavaScriptCore/API/JSContextRef.h +++ b/JavaScriptCore/API/JSContextRef.h @@ -125,6 +125,14 @@ JS_EXPORT JSObjectRef JSContextGetGlobalObject(JSContextRef ctx); */ JS_EXPORT JSContextGroupRef JSContextGetGroup(JSContextRef ctx) AVAILABLE_IN_WEBKIT_VERSION_4_0; +/*! +@function +@abstract Gets the global context of a JavaScript execution context. +@param ctx The JSContext whose global context you want to get. +@result ctx's global context. +*/ +JS_EXPORT JSGlobalContextRef JSContextGetGlobalContext(JSContextRef ctx) CF_AVAILABLE(10_7, 4_0); + #ifdef __cplusplus } #endif diff --git a/JavaScriptCore/API/JSContextRefPrivate.h b/JavaScriptCore/API/JSContextRefPrivate.h index 4f77aead..e8fe0791 100644 --- a/JavaScriptCore/API/JSContextRefPrivate.h +++ b/JavaScriptCore/API/JSContextRefPrivate.h @@ -38,15 +38,6 @@ extern "C" { #endif -/*! -@function -@abstract Gets the global context of a JavaScript execution context. -@param ctx The JSContext whose global context you want to get. -@result ctx's global context. -*/ -JS_EXPORT JSGlobalContextRef JSContextGetGlobalContext(JSContextRef ctx); - - /*! @function @abstract Gets a Backtrace for the existing context @@ -55,6 +46,54 @@ JS_EXPORT JSGlobalContextRef JSContextGetGlobalContext(JSContextRef ctx); */ JS_EXPORT JSStringRef JSContextCreateBacktrace(JSContextRef ctx, unsigned maxStackSize) AVAILABLE_IN_WEBKIT_VERSION_4_0; + +/*! +@typedef JSShouldTerminateCallback +@abstract The callback invoked when script execution has exceeded the allowed + time limit previously specified via JSContextGroupSetExecutionTimeLimit. +@param ctx The execution context to use. +@param context User specified context data previously passed to + JSContextGroupSetExecutionTimeLimit. +@discussion If you named your function Callback, you would declare it like this: + + bool Callback(JSContextRef ctx, void* context); + + If you return true, the timed out script will terminate. + If you return false, the script will run for another period of the allowed + time limit specified via JSContextGroupSetExecutionTimeLimit. + + Within this callback function, you may call JSContextGroupSetExecutionTimeLimit + to set a new time limit, or JSContextGroupClearExecutionTimeLimit to cancel the + timeout. +*/ +typedef bool +(*JSShouldTerminateCallback) (JSContextRef ctx, void* context); + +/*! +@function +@abstract Sets the script execution time limit. +@param group The JavaScript context group that this time limit applies to. +@param limit The time limit of allowed script execution time in seconds. +@param callback The callback function that will be invoked when the time limit + has been reached. This will give you a chance to decide if you want to + terminate the script or not. If you pass a NULL callback, the script will be + terminated unconditionally when the time limit has been reached. +@param context User data that you can provide to be passed back to you + in your callback. + + In order to guarantee that the execution time limit will take effect, you will + need to call JSContextGroupSetExecutionTimeLimit before you start executing + any scripts. +*/ +JS_EXPORT void JSContextGroupSetExecutionTimeLimit(JSContextGroupRef, double limit, JSShouldTerminateCallback, void* context) AVAILABLE_IN_WEBKIT_VERSION_4_0; + +/*! +@function +@abstract Clears the script execution time limit. +@param group The JavaScript context group that the time limit is cleared on. +*/ +JS_EXPORT void JSContextGroupClearExecutionTimeLimit(JSContextGroupRef) AVAILABLE_IN_WEBKIT_VERSION_4_0; + #ifdef __cplusplus } #endif diff --git a/JavaScriptCore/API/JSExport.h b/JavaScriptCore/API/JSExport.h new file mode 100644 index 00000000..96e9fec3 --- /dev/null +++ b/JavaScriptCore/API/JSExport.h @@ -0,0 +1,130 @@ +/* + * Copyright (C) 2013 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. + */ + +#import + +#if JSC_OBJC_API_ENABLED + +// When a JavaScript value is created from an instance of an Objective-C class +// for which no copying conversion is specified a JavaScript wrapper object will +// be created. +// +// In JavaScript inheritance is supported via a chain of prototype objects, and +// for each Objective-C class (and per JSContext) an object appropriate for use +// as a prototype will be provided. For the class NSObject the prototype object +// will be the JavaScript context's Object Prototype. For all other Objective-C +// classes a Prototype object will be created. The Prototype object for a given +// Objective-C class will have its internal [Prototype] property set to point to +// the Prototype object of the Objective-C class's superclass. As such the +// prototype chain for a JavaScript wrapper object will reflect the wrapped +// Objective-C type's inheritance hierarchy. +// +// In addition to the Prototype object a JavaScript Constructor object will also +// be produced for each Objective-C class. The Constructor object has a property +// named 'prototype' that references the Prototype object, and the Prototype +// object has a property named 'constructor' that references the Constructor. +// The Constructor object is not callable. +// +// By default no methods or properties of the Objective-C class will be exposed +// to JavaScript, however methods and properties may explicitly be exported. +// For each protocol that a class conforms to, if the protocol incorporates the +// protocol JSExport, then the protocol will be interpreted as a list of methods +// and properties to be exported to JavaScript. +// +// For each instance method being exported, a corresponding JavaScript function +// will be assigned as a property of the Prototype object, for each Objective-C +// property being exported a JavaScript accessor property will be created on the +// Prototype, and for each class method exported a JavaScript function will be +// created on the Constructor object. For example: +// +// @protocol MyClassJavaScriptMethods +// - (void)foo; +// @end +// +// @interface MyClass : NSObject +// - (void)foo; +// - (void)bar; +// @end +// +// Data properties that are created on the prototype or constructor objects have +// the attributes: writable:true, enumerable:false, configurable:true. Accessor +// properties have the attributes: enumerable:false and configurable:true. +// +// If an instance of MyClass is converted to a JavaScript value, the resulting +// wrapper object will (via its prototype) export the method "foo" to JavaScript, +// since the class conforms to the MyClassJavaScriptMethods protocol, and this +// protocol incorporates JSExport. "bar" will not be exported. +// +// Properties, arguments, and return values of the following types are +// supported: +// +// Primitive numbers: signed values of up to 32-bits are converted in a manner +// consistent with valueWithInt32/toInt32, unsigned values of up to 32-bits +// are converted in a manner consistent with valueWithUInt32/toUInt32, all +// other numeric values are converted consistently with valueWithDouble/ +// toDouble. +// BOOL: values are converted consistently with valueWithBool/toBool. +// id: values are converted consistently with valueWithObject/toObject. +// : - where the type is a pointer to a specified Objective-C +// class, conversion is consistent with valueWithObjectOfClass/toObject. +// struct types: C struct types are supported, where JSValue provides support +// for the given type. Support is built in for CGPoint, NSRange, CGRect, and +// CGSize. +// block types: In addition to support provided by valueWithObject/toObject for +// block types, if a JavaScript Function is passed as an argument, where the +// type required is a block with a void return value (and where the block's +// arguments are all of supported types), then a special adaptor block +// will be created, allowing the JavaScript function to be used in the place +// of a block. +// +// For any interface that conforms to JSExport the normal copying conversion for +// built in types will be inhibited - so, for example, if an instance that +// derives from NSString but conforms to JSExport is passed to valueWithObject: +// then a wrapper object for the Objective-C object will be returned rather than +// a JavaScript string primitive. +@protocol JSExport +@end + +// When a selector that takes one or more arguments is converted to a JavaScript +// property name, by default a property name will be generated by performing the +// following conversion: +// - All colons are removed from the selector +// - Any lowercase letter that had followed a colon will be capitalized. +// Under the default conversion a selector "doFoo:withBar:" will be exported as +// "doFooWithBar". The default conversion may be overriden using the JSExportAs +// macro, for example to export a method "doFoo:withBar:" as "doFoo": +// +// @protocol MyClassJavaScriptMethods +// JSExportAs(doFoo, +// - (void)doFoo:(id)foo withBar:(id)bar +// ); +// @end +// +// Note that the JSExport macro may only be applied to a selector that takes one +// or more argument. +#define JSExportAs(PropertyName, Selector) \ + @optional Selector __JS_EXPORT_AS__##PropertyName:(id)argument; @required Selector + +#endif diff --git a/JavaScriptCore/API/JSManagedValue.h b/JavaScriptCore/API/JSManagedValue.h new file mode 100644 index 00000000..3a03b335 --- /dev/null +++ b/JavaScriptCore/API/JSManagedValue.h @@ -0,0 +1,70 @@ +/* + * Copyright (C) 2013 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. + */ + +#ifndef JSManagedValue_h +#define JSManagedValue_h + +#import + +#if JSC_OBJC_API_ENABLED + +@class JSValue; +@class JSContext; + +// JSManagedValue represents a "conditionally retained" JSValue. +// "Conditionally retained" means that as long as either the JSManagedValue +// JavaScript value is reachable through the JavaScript object graph +// or the JSManagedValue object is reachable through the external Objective-C +// object graph as reported to the JSVirtualMachine using +// addManagedReference:withOwner:, the corresponding JavaScript value will +// be retained. However, if neither of these conditions are true, the +// corresponding JSValue will be released and set to nil. +// +// The primary use case for JSManagedValue is for safely referencing JSValues +// from the Objective-C heap. It is incorrect to store a JSValue into an +// Objective-C heap object, as this can very easily create a reference cycle, +// keeping the entire JSContext alive. +#ifndef JSC_OBJC_API_AVAILABLE_MAC_OS_X_1080 +NS_CLASS_AVAILABLE(10_9, 7_0) +#else +OBJC_VISIBLE +#endif +@interface JSManagedValue : NSObject + +// Convenience method for creating JSManagedValues from JSValues. ++ (JSManagedValue *)managedValueWithValue:(JSValue *)value; + +// Create a JSManagedValue. +- (id)initWithValue:(JSValue *)value; + +// Get the JSValue to which this JSManagedValue refers. If the JavaScript value has been collected, +// this method returns nil. +- (JSValue *)value; + +@end + +#endif // JSC_OBJC_API_ENABLED + +#endif // JSManagedValue_h diff --git a/JavaScriptCore/API/JSManagedValue.mm b/JavaScriptCore/API/JSManagedValue.mm new file mode 100644 index 00000000..6013303a --- /dev/null +++ b/JavaScriptCore/API/JSManagedValue.mm @@ -0,0 +1,250 @@ +/* + * Copyright (C) 2013 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. + */ + + +#import "config.h" +#import "JSManagedValue.h" + +#if JSC_OBJC_API_ENABLED + +#import "APICast.h" +#import "Heap.h" +#import "JSContextInternal.h" +#import "JSValueInternal.h" +#import "Weak.h" +#import "WeakHandleOwner.h" +#import "ObjcRuntimeExtras.h" +#import "Operations.h" + +class JSManagedValueHandleOwner : public JSC::WeakHandleOwner { +public: + virtual void finalize(JSC::Handle, void* context) OVERRIDE; + virtual bool isReachableFromOpaqueRoots(JSC::Handle, void* context, JSC::SlotVisitor&) OVERRIDE; +}; + +static JSManagedValueHandleOwner* managedValueHandleOwner() +{ + DEFINE_STATIC_LOCAL(JSManagedValueHandleOwner, jsManagedValueHandleOwner, ()); + return &jsManagedValueHandleOwner; +} + +class WeakValueRef { +public: + WeakValueRef() + : m_tag(NotSet) + { + } + + ~WeakValueRef() + { + clear(); + } + + void clear() + { + switch (m_tag) { + case NotSet: + return; + case Primitive: + u.m_primitive = JSC::JSValue(); + return; + case Object: + u.m_object.clear(); + return; + case String: + u.m_string.clear(); + return; + } + RELEASE_ASSERT_NOT_REACHED(); + } + + bool isClear() const + { + switch (m_tag) { + case NotSet: + return true; + case Primitive: + return !u.m_primitive; + case Object: + return !u.m_object; + case String: + return !u.m_string; + } + RELEASE_ASSERT_NOT_REACHED(); + } + + bool isSet() const { return m_tag != NotSet; } + bool isPrimitive() const { return m_tag == Primitive; } + bool isObject() const { return m_tag == Object; } + bool isString() const { return m_tag == String; } + + void setPrimitive(JSC::JSValue primitive) + { + ASSERT(!isSet()); + ASSERT(!u.m_primitive); + ASSERT(primitive.isPrimitive()); + m_tag = Primitive; + u.m_primitive = primitive; + } + + void setObject(JSC::JSObject* object, void* context) + { + ASSERT(!isSet()); + ASSERT(!u.m_object); + m_tag = Object; + JSC::Weak weak(object, managedValueHandleOwner(), context); + u.m_object.swap(weak); + } + + void setString(JSC::JSString* string, void* context) + { + ASSERT(!isSet()); + ASSERT(!u.m_object); + m_tag = String; + JSC::Weak weak(string, managedValueHandleOwner(), context); + u.m_string.swap(weak); + } + + JSC::JSObject* object() + { + ASSERT(isObject()); + return u.m_object.get(); + } + + JSC::JSValue primitive() + { + ASSERT(isPrimitive()); + return u.m_primitive; + } + + JSC::JSString* string() + { + ASSERT(isString()); + return u.m_string.get(); + } + +private: + enum WeakTypeTag { NotSet, Primitive, Object, String }; + WeakTypeTag m_tag; + union WeakValueUnion { + public: + WeakValueUnion () + : m_primitive(JSC::JSValue()) + { + } + + ~WeakValueUnion() + { + ASSERT(!m_primitive); + } + + JSC::JSValue m_primitive; + JSC::Weak m_object; + JSC::Weak m_string; + } u; +}; + +@implementation JSManagedValue { + JSC::Weak m_globalObject; + WeakValueRef m_weakValue; +} + ++ (JSManagedValue *)managedValueWithValue:(JSValue *)value +{ + return [[[self alloc] initWithValue:value] autorelease]; +} + +- (id)init +{ + return [self initWithValue:nil]; +} + +- (id)initWithValue:(JSValue *)value +{ + self = [super init]; + if (!self) + return nil; + + if (!value) + return self; + + JSC::ExecState* exec = toJS([value.context JSGlobalContextRef]); + JSC::JSGlobalObject* globalObject = exec->lexicalGlobalObject(); + JSC::Weak weak(globalObject, managedValueHandleOwner(), self); + m_globalObject.swap(weak); + + JSC::JSValue jsValue = toJS(exec, [value JSValueRef]); + if (jsValue.isObject()) + m_weakValue.setObject(JSC::jsCast(jsValue.asCell()), self); + else if (jsValue.isString()) + m_weakValue.setString(JSC::jsCast(jsValue.asCell()), self); + else + m_weakValue.setPrimitive(jsValue); + return self; +} + +- (JSValue *)value +{ + if (!m_globalObject) + return nil; + if (m_weakValue.isClear()) + return nil; + JSC::ExecState* exec = m_globalObject->globalExec(); + JSContext *context = [JSContext contextWithJSGlobalContextRef:toGlobalRef(exec)]; + JSC::JSValue value; + if (m_weakValue.isPrimitive()) + value = m_weakValue.primitive(); + else if (m_weakValue.isString()) + value = m_weakValue.string(); + else + value = m_weakValue.object(); + return [JSValue valueWithJSValueRef:toRef(exec, value) inContext:context]; +} + +- (void)disconnectValue +{ + m_globalObject.clear(); + m_weakValue.clear(); +} + +@end + +@interface JSManagedValue (PrivateMethods) +- (void)disconnectValue; +@end + +bool JSManagedValueHandleOwner::isReachableFromOpaqueRoots(JSC::Handle, void* context, JSC::SlotVisitor& visitor) +{ + JSManagedValue *managedValue = static_cast(context); + return visitor.containsOpaqueRoot(managedValue); +} + +void JSManagedValueHandleOwner::finalize(JSC::Handle, void* context) +{ + JSManagedValue *managedValue = static_cast(context); + [managedValue disconnectValue]; +} + +#endif // JSC_OBJC_API_ENABLED diff --git a/JavaScriptCore/API/JSObjectRef.cpp b/JavaScriptCore/API/JSObjectRef.cpp index e01214d5..52e3a306 100644 --- a/JavaScriptCore/API/JSObjectRef.cpp +++ b/JavaScriptCore/API/JSObjectRef.cpp @@ -29,12 +29,15 @@ #include "JSObjectRefPrivate.h" #include "APICast.h" +#include "ButterflyInlines.h" #include "CodeBlock.h" +#include "CopiedSpaceInlines.h" #include "DateConstructor.h" #include "ErrorConstructor.h" #include "FunctionConstructor.h" #include "Identifier.h" #include "InitializeThreading.h" +#include "JSAPIWrapperObject.h" #include "JSArray.h" #include "JSCallbackConstructor.h" #include "JSCallbackFunction.h" @@ -46,7 +49,9 @@ #include "JSRetainPtr.h" #include "JSString.h" #include "JSValueRef.h" +#include "ObjectConstructor.h" #include "ObjectPrototype.h" +#include "Operations.h" #include "PropertyNameArray.h" #include "RegExpConstructor.h" @@ -75,31 +80,40 @@ void JSClassRelease(JSClassRef jsClass) JSObjectRef JSObjectMake(JSContextRef ctx, JSClassRef jsClass, void* data) { + if (!ctx) { + ASSERT_NOT_REACHED(); + return 0; + } ExecState* exec = toJS(ctx); APIEntryShim entryShim(exec); if (!jsClass) return toRef(constructEmptyObject(exec)); - JSCallbackObject* object = JSCallbackObject::create(exec, exec->lexicalGlobalObject(), exec->lexicalGlobalObject()->callbackObjectStructure(), jsClass, data); + JSCallbackObject* object = JSCallbackObject::create(exec, exec->lexicalGlobalObject(), exec->lexicalGlobalObject()->callbackObjectStructure(), jsClass, data); if (JSObject* prototype = jsClass->prototype(exec)) - object->setPrototype(exec->globalData(), prototype); + object->setPrototype(exec->vm(), prototype); return toRef(object); } JSObjectRef JSObjectMakeFunctionWithCallback(JSContextRef ctx, JSStringRef name, JSObjectCallAsFunctionCallback callAsFunction) { + if (!ctx) { + ASSERT_NOT_REACHED(); + return 0; + } ExecState* exec = toJS(ctx); APIEntryShim entryShim(exec); - - Identifier nameID = name ? name->identifier(&exec->globalData()) : Identifier(exec, "anonymous"); - - return toRef(JSCallbackFunction::create(exec, exec->lexicalGlobalObject(), callAsFunction, nameID)); + return toRef(JSCallbackFunction::create(exec->vm(), exec->lexicalGlobalObject(), callAsFunction, name ? name->string() : ASCIILiteral("anonymous"))); } JSObjectRef JSObjectMakeConstructor(JSContextRef ctx, JSClassRef jsClass, JSObjectCallAsConstructorCallback callAsConstructor) { + if (!ctx) { + ASSERT_NOT_REACHED(); + return 0; + } ExecState* exec = toJS(ctx); APIEntryShim entryShim(exec); @@ -108,23 +122,27 @@ JSObjectRef JSObjectMakeConstructor(JSContextRef ctx, JSClassRef jsClass, JSObje jsPrototype = exec->lexicalGlobalObject()->objectPrototype(); JSCallbackConstructor* constructor = JSCallbackConstructor::create(exec, exec->lexicalGlobalObject(), exec->lexicalGlobalObject()->callbackConstructorStructure(), jsClass, callAsConstructor); - constructor->putDirect(exec->globalData(), exec->propertyNames().prototype, jsPrototype, DontEnum | DontDelete | ReadOnly); + constructor->putDirect(exec->vm(), exec->propertyNames().prototype, jsPrototype, DontEnum | DontDelete | ReadOnly); return toRef(constructor); } JSObjectRef JSObjectMakeFunction(JSContextRef ctx, JSStringRef name, unsigned parameterCount, const JSStringRef parameterNames[], JSStringRef body, JSStringRef sourceURL, int startingLineNumber, JSValueRef* exception) { + if (!ctx) { + ASSERT_NOT_REACHED(); + return 0; + } ExecState* exec = toJS(ctx); APIEntryShim entryShim(exec); - Identifier nameID = name ? name->identifier(&exec->globalData()) : Identifier(exec, "anonymous"); + Identifier nameID = name ? name->identifier(&exec->vm()) : Identifier(exec, "anonymous"); MarkedArgumentBuffer args; for (unsigned i = 0; i < parameterCount; i++) - args.append(jsString(exec, parameterNames[i]->ustring())); - args.append(jsString(exec, body->ustring())); + args.append(jsString(exec, parameterNames[i]->string())); + args.append(jsString(exec, body->string())); - JSObject* result = constructFunction(exec, exec->lexicalGlobalObject(), args, nameID, sourceURL->ustring(), TextPosition(OrdinalNumber::fromOneBasedInt(startingLineNumber), OrdinalNumber::first())); + JSObject* result = constructFunction(exec, exec->lexicalGlobalObject(), args, nameID, sourceURL->string(), TextPosition(OrdinalNumber::fromOneBasedInt(startingLineNumber), OrdinalNumber::first())); if (exec->hadException()) { if (exception) *exception = toRef(exec, exec->exception()); @@ -136,6 +154,10 @@ JSObjectRef JSObjectMakeFunction(JSContextRef ctx, JSStringRef name, unsigned pa JSObjectRef JSObjectMakeArray(JSContextRef ctx, size_t argumentCount, const JSValueRef arguments[], JSValueRef* exception) { + if (!ctx) { + ASSERT_NOT_REACHED(); + return 0; + } ExecState* exec = toJS(ctx); APIEntryShim entryShim(exec); @@ -145,9 +167,9 @@ JSObjectRef JSObjectMakeArray(JSContextRef ctx, size_t argumentCount, const JSVa for (size_t i = 0; i < argumentCount; ++i) argList.append(toJS(exec, arguments[i])); - result = constructArray(exec, argList); + result = constructArray(exec, static_cast(0), argList); } else - result = constructEmptyArray(exec); + result = constructEmptyArray(exec, 0); if (exec->hadException()) { if (exception) @@ -161,6 +183,10 @@ JSObjectRef JSObjectMakeArray(JSContextRef ctx, size_t argumentCount, const JSVa JSObjectRef JSObjectMakeDate(JSContextRef ctx, size_t argumentCount, const JSValueRef arguments[], JSValueRef* exception) { + if (!ctx) { + ASSERT_NOT_REACHED(); + return 0; + } ExecState* exec = toJS(ctx); APIEntryShim entryShim(exec); @@ -181,6 +207,10 @@ JSObjectRef JSObjectMakeDate(JSContextRef ctx, size_t argumentCount, const JSVal JSObjectRef JSObjectMakeError(JSContextRef ctx, size_t argumentCount, const JSValueRef arguments[], JSValueRef* exception) { + if (!ctx) { + ASSERT_NOT_REACHED(); + return 0; + } ExecState* exec = toJS(ctx); APIEntryShim entryShim(exec); @@ -200,6 +230,10 @@ JSObjectRef JSObjectMakeError(JSContextRef ctx, size_t argumentCount, const JSVa JSObjectRef JSObjectMakeRegExp(JSContextRef ctx, size_t argumentCount, const JSValueRef arguments[], JSValueRef* exception) { + if (!ctx) { + ASSERT_NOT_REACHED(); + return 0; + } ExecState* exec = toJS(ctx); APIEntryShim entryShim(exec); @@ -220,6 +254,10 @@ JSObjectRef JSObjectMakeRegExp(JSContextRef ctx, size_t argumentCount, const JSV JSValueRef JSObjectGetPrototype(JSContextRef ctx, JSObjectRef object) { + if (!ctx) { + ASSERT_NOT_REACHED(); + return 0; + } ExecState* exec = toJS(ctx); APIEntryShim entryShim(exec); @@ -229,33 +267,45 @@ JSValueRef JSObjectGetPrototype(JSContextRef ctx, JSObjectRef object) void JSObjectSetPrototype(JSContextRef ctx, JSObjectRef object, JSValueRef value) { + if (!ctx) { + ASSERT_NOT_REACHED(); + return; + } ExecState* exec = toJS(ctx); APIEntryShim entryShim(exec); JSObject* jsObject = toJS(object); JSValue jsValue = toJS(exec, value); - jsObject->setPrototypeWithCycleCheck(exec->globalData(), jsValue.isObject() ? jsValue : jsNull()); + jsObject->setPrototypeWithCycleCheck(exec, jsValue.isObject() ? jsValue : jsNull()); } bool JSObjectHasProperty(JSContextRef ctx, JSObjectRef object, JSStringRef propertyName) { + if (!ctx) { + ASSERT_NOT_REACHED(); + return false; + } ExecState* exec = toJS(ctx); APIEntryShim entryShim(exec); JSObject* jsObject = toJS(object); - return jsObject->hasProperty(exec, propertyName->identifier(&exec->globalData())); + return jsObject->hasProperty(exec, propertyName->identifier(&exec->vm())); } JSValueRef JSObjectGetProperty(JSContextRef ctx, JSObjectRef object, JSStringRef propertyName, JSValueRef* exception) { + if (!ctx) { + ASSERT_NOT_REACHED(); + return 0; + } ExecState* exec = toJS(ctx); APIEntryShim entryShim(exec); JSObject* jsObject = toJS(object); - JSValue jsValue = jsObject->get(exec, propertyName->identifier(&exec->globalData())); + JSValue jsValue = jsObject->get(exec, propertyName->identifier(&exec->vm())); if (exec->hadException()) { if (exception) *exception = toRef(exec, exec->exception()); @@ -266,16 +316,21 @@ JSValueRef JSObjectGetProperty(JSContextRef ctx, JSObjectRef object, JSStringRef void JSObjectSetProperty(JSContextRef ctx, JSObjectRef object, JSStringRef propertyName, JSValueRef value, JSPropertyAttributes attributes, JSValueRef* exception) { + if (!ctx) { + ASSERT_NOT_REACHED(); + return; + } ExecState* exec = toJS(ctx); APIEntryShim entryShim(exec); JSObject* jsObject = toJS(object); - Identifier name(propertyName->identifier(&exec->globalData())); + Identifier name(propertyName->identifier(&exec->vm())); JSValue jsValue = toJS(exec, value); - if (attributes && !jsObject->hasProperty(exec, name)) - jsObject->methodTable()->putDirectVirtual(jsObject, exec, name, jsValue, attributes); - else { + if (attributes && !jsObject->hasProperty(exec, name)) { + PropertyDescriptor desc(jsValue, attributes); + jsObject->methodTable()->defineOwnProperty(jsObject, exec, name, desc, false); + } else { PutPropertySlot slot; jsObject->methodTable()->put(jsObject, exec, name, jsValue, slot); } @@ -289,6 +344,10 @@ void JSObjectSetProperty(JSContextRef ctx, JSObjectRef object, JSStringRef prope JSValueRef JSObjectGetPropertyAtIndex(JSContextRef ctx, JSObjectRef object, unsigned propertyIndex, JSValueRef* exception) { + if (!ctx) { + ASSERT_NOT_REACHED(); + return 0; + } ExecState* exec = toJS(ctx); APIEntryShim entryShim(exec); @@ -306,6 +365,10 @@ JSValueRef JSObjectGetPropertyAtIndex(JSContextRef ctx, JSObjectRef object, unsi void JSObjectSetPropertyAtIndex(JSContextRef ctx, JSObjectRef object, unsigned propertyIndex, JSValueRef value, JSValueRef* exception) { + if (!ctx) { + ASSERT_NOT_REACHED(); + return; + } ExecState* exec = toJS(ctx); APIEntryShim entryShim(exec); @@ -322,12 +385,16 @@ void JSObjectSetPropertyAtIndex(JSContextRef ctx, JSObjectRef object, unsigned p bool JSObjectDeleteProperty(JSContextRef ctx, JSObjectRef object, JSStringRef propertyName, JSValueRef* exception) { + if (!ctx) { + ASSERT_NOT_REACHED(); + return false; + } ExecState* exec = toJS(ctx); APIEntryShim entryShim(exec); JSObject* jsObject = toJS(object); - bool result = jsObject->methodTable()->deleteProperty(jsObject, exec, propertyName->identifier(&exec->globalData())); + bool result = jsObject->methodTable()->deleteProperty(jsObject, exec, propertyName->identifier(&exec->vm())); if (exec->hadException()) { if (exception) *exception = toRef(exec, exec->exception()); @@ -338,28 +405,38 @@ bool JSObjectDeleteProperty(JSContextRef ctx, JSObjectRef object, JSStringRef pr void* JSObjectGetPrivate(JSObjectRef object) { - JSObject* jsObject = toJS(object); + JSObject* jsObject = uncheckedToJS(object); - if (jsObject->inherits(&JSCallbackObject::s_info)) + if (jsObject->inherits(JSCallbackObject::info())) return jsCast*>(jsObject)->getPrivate(); - if (jsObject->inherits(&JSCallbackObject::s_info)) - return jsCast*>(jsObject)->getPrivate(); + if (jsObject->inherits(JSCallbackObject::info())) + return jsCast*>(jsObject)->getPrivate(); +#if JSC_OBJC_API_ENABLED + if (jsObject->inherits(JSCallbackObject::info())) + return jsCast*>(jsObject)->getPrivate(); +#endif return 0; } bool JSObjectSetPrivate(JSObjectRef object, void* data) { - JSObject* jsObject = toJS(object); + JSObject* jsObject = uncheckedToJS(object); - if (jsObject->inherits(&JSCallbackObject::s_info)) { + if (jsObject->inherits(JSCallbackObject::info())) { jsCast*>(jsObject)->setPrivate(data); return true; } - if (jsObject->inherits(&JSCallbackObject::s_info)) { - jsCast*>(jsObject)->setPrivate(data); + if (jsObject->inherits(JSCallbackObject::info())) { + jsCast*>(jsObject)->setPrivate(data); + return true; + } +#if JSC_OBJC_API_ENABLED + if (jsObject->inherits(JSCallbackObject::info())) { + jsCast*>(jsObject)->setPrivate(data); return true; } +#endif return false; } @@ -370,11 +447,15 @@ JSValueRef JSObjectGetPrivateProperty(JSContextRef ctx, JSObjectRef object, JSSt APIEntryShim entryShim(exec); JSObject* jsObject = toJS(object); JSValue result; - Identifier name(propertyName->identifier(&exec->globalData())); - if (jsObject->inherits(&JSCallbackObject::s_info)) + Identifier name(propertyName->identifier(&exec->vm())); + if (jsObject->inherits(JSCallbackObject::info())) result = jsCast*>(jsObject)->getPrivateProperty(name); - else if (jsObject->inherits(&JSCallbackObject::s_info)) - result = jsCast*>(jsObject)->getPrivateProperty(name); + else if (jsObject->inherits(JSCallbackObject::info())) + result = jsCast*>(jsObject)->getPrivateProperty(name); +#if JSC_OBJC_API_ENABLED + else if (jsObject->inherits(JSCallbackObject::info())) + result = jsCast*>(jsObject)->getPrivateProperty(name); +#endif return toRef(exec, result); } @@ -384,15 +465,21 @@ bool JSObjectSetPrivateProperty(JSContextRef ctx, JSObjectRef object, JSStringRe APIEntryShim entryShim(exec); JSObject* jsObject = toJS(object); JSValue jsValue = value ? toJS(exec, value) : JSValue(); - Identifier name(propertyName->identifier(&exec->globalData())); - if (jsObject->inherits(&JSCallbackObject::s_info)) { - jsCast*>(jsObject)->setPrivateProperty(exec->globalData(), name, jsValue); + Identifier name(propertyName->identifier(&exec->vm())); + if (jsObject->inherits(JSCallbackObject::info())) { + jsCast*>(jsObject)->setPrivateProperty(exec->vm(), name, jsValue); return true; } - if (jsObject->inherits(&JSCallbackObject::s_info)) { - jsCast*>(jsObject)->setPrivateProperty(exec->globalData(), name, jsValue); + if (jsObject->inherits(JSCallbackObject::info())) { + jsCast*>(jsObject)->setPrivateProperty(exec->vm(), name, jsValue); return true; } +#if JSC_OBJC_API_ENABLED + if (jsObject->inherits(JSCallbackObject::info())) { + jsCast*>(jsObject)->setPrivateProperty(exec->vm(), name, jsValue); + return true; + } +#endif return false; } @@ -401,20 +488,28 @@ bool JSObjectDeletePrivateProperty(JSContextRef ctx, JSObjectRef object, JSStrin ExecState* exec = toJS(ctx); APIEntryShim entryShim(exec); JSObject* jsObject = toJS(object); - Identifier name(propertyName->identifier(&exec->globalData())); - if (jsObject->inherits(&JSCallbackObject::s_info)) { + Identifier name(propertyName->identifier(&exec->vm())); + if (jsObject->inherits(JSCallbackObject::info())) { jsCast*>(jsObject)->deletePrivateProperty(name); return true; } - if (jsObject->inherits(&JSCallbackObject::s_info)) { - jsCast*>(jsObject)->deletePrivateProperty(name); + if (jsObject->inherits(JSCallbackObject::info())) { + jsCast*>(jsObject)->deletePrivateProperty(name); return true; } +#if JSC_OBJC_API_ENABLED + if (jsObject->inherits(JSCallbackObject::info())) { + jsCast*>(jsObject)->deletePrivateProperty(name); + return true; + } +#endif return false; } bool JSObjectIsFunction(JSContextRef, JSObjectRef object) { + if (!object) + return false; CallData callData; JSCell* cell = toJS(object); return cell->methodTable()->getCallData(cell, callData) != CallTypeNone; @@ -425,6 +520,9 @@ JSValueRef JSObjectCallAsFunction(JSContextRef ctx, JSObjectRef object, JSObject ExecState* exec = toJS(ctx); APIEntryShim entryShim(exec); + if (!object) + return 0; + JSObject* jsObject = toJS(object); JSObject* jsThisObject = toJS(thisObject); @@ -452,6 +550,8 @@ JSValueRef JSObjectCallAsFunction(JSContextRef ctx, JSObjectRef object, JSObject bool JSObjectIsConstructor(JSContextRef, JSObjectRef object) { + if (!object) + return false; JSObject* jsObject = toJS(object); ConstructData constructData; return jsObject->methodTable()->getConstructData(jsObject, constructData) != ConstructTypeNone; @@ -462,6 +562,9 @@ JSObjectRef JSObjectCallAsConstructor(JSContextRef ctx, JSObjectRef object, size ExecState* exec = toJS(ctx); APIEntryShim entryShim(exec); + if (!object) + return 0; + JSObject* jsObject = toJS(object); ConstructData constructData; @@ -485,33 +588,37 @@ JSObjectRef JSObjectCallAsConstructor(JSContextRef ctx, JSObjectRef object, size struct OpaqueJSPropertyNameArray { WTF_MAKE_FAST_ALLOCATED; public: - OpaqueJSPropertyNameArray(JSGlobalData* globalData) + OpaqueJSPropertyNameArray(VM* vm) : refCount(0) - , globalData(globalData) + , vm(vm) { } unsigned refCount; - JSGlobalData* globalData; - Vector > array; + VM* vm; + Vector> array; }; JSPropertyNameArrayRef JSObjectCopyPropertyNames(JSContextRef ctx, JSObjectRef object) { + if (!ctx) { + ASSERT_NOT_REACHED(); + return 0; + } JSObject* jsObject = toJS(object); ExecState* exec = toJS(ctx); APIEntryShim entryShim(exec); - JSGlobalData* globalData = &exec->globalData(); + VM* vm = &exec->vm(); - JSPropertyNameArrayRef propertyNames = new OpaqueJSPropertyNameArray(globalData); - PropertyNameArray array(globalData); + JSPropertyNameArrayRef propertyNames = new OpaqueJSPropertyNameArray(vm); + PropertyNameArray array(vm); jsObject->methodTable()->getPropertyNames(jsObject, exec, array, ExcludeDontEnumProperties); size_t size = array.size(); propertyNames->array.reserveInitialCapacity(size); for (size_t i = 0; i < size; ++i) - propertyNames->array.append(JSRetainPtr(Adopt, OpaqueJSString::create(array[i].ustring()).leakRef())); + propertyNames->array.uncheckedAppend(JSRetainPtr(Adopt, OpaqueJSString::create(array[i].string()).leakRef())); return JSPropertyNameArrayRetain(propertyNames); } @@ -525,7 +632,7 @@ JSPropertyNameArrayRef JSPropertyNameArrayRetain(JSPropertyNameArrayRef array) void JSPropertyNameArrayRelease(JSPropertyNameArrayRef array) { if (--array->refCount == 0) { - APIEntryShim entryShim(array->globalData, false); + APIEntryShim entryShim(array->vm, false); delete array; } } @@ -543,6 +650,6 @@ JSStringRef JSPropertyNameArrayGetNameAtIndex(JSPropertyNameArrayRef array, size void JSPropertyNameAccumulatorAddName(JSPropertyNameAccumulatorRef array, JSStringRef propertyName) { PropertyNameArray* propertyNames = toJS(array); - APIEntryShim entryShim(propertyNames->globalData()); - propertyNames->add(propertyName->identifier(propertyNames->globalData())); + APIEntryShim entryShim(propertyNames->vm()); + propertyNames->add(propertyName->identifier(propertyNames->vm())); } diff --git a/JavaScriptCore/API/JSProfilerPrivate.cpp b/JavaScriptCore/API/JSProfilerPrivate.cpp index ea277f05..0405b4b2 100644 --- a/JavaScriptCore/API/JSProfilerPrivate.cpp +++ b/JavaScriptCore/API/JSProfilerPrivate.cpp @@ -27,20 +27,20 @@ #include "JSProfilerPrivate.h" #include "APICast.h" +#include "LegacyProfiler.h" #include "OpaqueJSString.h" -#include "Profiler.h" using namespace JSC; void JSStartProfiling(JSContextRef ctx, JSStringRef title) { - Profiler::profiler()->startProfiling(toJS(ctx), title->ustring()); + LegacyProfiler::profiler()->startProfiling(toJS(ctx), title->string()); } void JSEndProfiling(JSContextRef ctx, JSStringRef title) { ExecState* exec = toJS(ctx); - Profiler* profiler = Profiler::profiler(); - profiler->stopProfiling(exec, title->ustring()); + LegacyProfiler* profiler = LegacyProfiler::profiler(); + profiler->stopProfiling(exec, title->string()); } diff --git a/JavaScriptCore/API/JSScriptRef.cpp b/JavaScriptCore/API/JSScriptRef.cpp new file mode 100644 index 00000000..9ba82a6f --- /dev/null +++ b/JavaScriptCore/API/JSScriptRef.cpp @@ -0,0 +1,151 @@ +/* + * Copyright (C) 2012 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. + */ + +#include "config.h" + +#include "APICast.h" +#include "APIShims.h" +#include "Completion.h" +#include "JSBasePrivate.h" +#include "VM.h" +#include "JSScriptRefPrivate.h" +#include "OpaqueJSString.h" +#include "Operations.h" +#include "Parser.h" +#include "SourceCode.h" +#include "SourceProvider.h" + +using namespace JSC; + +struct OpaqueJSScript : public SourceProvider { +public: + static WTF::PassRefPtr create(VM* vm, const String& url, int startingLineNumber, const String& source) + { + return WTF::adoptRef(new OpaqueJSScript(vm, url, startingLineNumber, source)); + } + + virtual const String& source() const OVERRIDE + { + return m_source; + } + + VM* vm() const { return m_vm; } + +private: + OpaqueJSScript(VM* vm, const String& url, int startingLineNumber, const String& source) + : SourceProvider(url, TextPosition(OrdinalNumber::fromOneBasedInt(startingLineNumber), OrdinalNumber::first())) + , m_vm(vm) + , m_source(source) + { + } + + virtual ~OpaqueJSScript() { } + + VM* m_vm; + String m_source; +}; + +static bool parseScript(VM* vm, const SourceCode& source, ParserError& error) +{ + return JSC::parse(vm, source, 0, Identifier(), JSParseNormal, JSParseProgramCode, error); +} + +extern "C" { + +JSScriptRef JSScriptCreateReferencingImmortalASCIIText(JSContextGroupRef contextGroup, JSStringRef url, int startingLineNumber, const char* source, size_t length, JSStringRef* errorMessage, int* errorLine) +{ + VM* vm = toJS(contextGroup); + APIEntryShim entryShim(vm); + for (size_t i = 0; i < length; i++) { + if (!isASCII(source[i])) + return 0; + } + + RefPtr result = OpaqueJSScript::create(vm, url->string(), startingLineNumber, String(StringImpl::createFromLiteral(source, length))); + + ParserError error; + if (!parseScript(vm, SourceCode(result), error)) { + if (errorMessage) + *errorMessage = OpaqueJSString::create(error.m_message).leakRef(); + if (errorLine) + *errorLine = error.m_line; + return 0; + } + + return result.release().leakRef(); +} + +JSScriptRef JSScriptCreateFromString(JSContextGroupRef contextGroup, JSStringRef url, int startingLineNumber, JSStringRef source, JSStringRef* errorMessage, int* errorLine) +{ + VM* vm = toJS(contextGroup); + APIEntryShim entryShim(vm); + + RefPtr result = OpaqueJSScript::create(vm, url->string(), startingLineNumber, source->string()); + + ParserError error; + if (!parseScript(vm, SourceCode(result), error)) { + if (errorMessage) + *errorMessage = OpaqueJSString::create(error.m_message).leakRef(); + if (errorLine) + *errorLine = error.m_line; + return 0; + } + + return result.release().leakRef(); +} + +void JSScriptRetain(JSScriptRef script) +{ + APIEntryShim entryShim(script->vm()); + script->ref(); +} + +void JSScriptRelease(JSScriptRef script) +{ + APIEntryShim entryShim(script->vm()); + script->deref(); +} + +JSValueRef JSScriptEvaluate(JSContextRef context, JSScriptRef script, JSValueRef thisValueRef, JSValueRef* exception) +{ + ExecState* exec = toJS(context); + APIEntryShim entryShim(exec); + if (script->vm() != &exec->vm()) { + RELEASE_ASSERT_NOT_REACHED(); + return 0; + } + JSValue internalException; + JSValue thisValue = thisValueRef ? toJS(exec, thisValueRef) : jsUndefined(); + JSValue result = evaluate(exec, SourceCode(script), thisValue, &internalException); + if (internalException) { + if (exception) + *exception = toRef(exec, internalException); + return 0; + } + ASSERT(result); + return toRef(exec, result); +} + +} diff --git a/JavaScriptCore/API/JSScriptRefPrivate.h b/JavaScriptCore/API/JSScriptRefPrivate.h new file mode 100644 index 00000000..e1992052 --- /dev/null +++ b/JavaScriptCore/API/JSScriptRefPrivate.h @@ -0,0 +1,99 @@ +/* + * Copyright (C) 2012 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. + */ + +#ifndef JSScriptRefPrivate_h +#define JSScriptRefPrivate_h + +#include +#include +#include + +/*! @typedef JSScriptRef A JavaScript script reference. */ +typedef struct OpaqueJSScript* JSScriptRef; + +#ifdef __cplusplus +extern "C" { +#endif + +/*! + @function + @abstract Creates a script reference from an ascii string, without copying or taking ownership of the string + @param contextGroup The context group the script is to be used in. + @param url The source url to be reported in errors and exceptions. + @param startingLineNumber An integer value specifying the script's starting line number in the file located at sourceURL. This is only used when reporting exceptions. + @param source The source string. This is required to be pure ASCII and to never be deallocated. + @param length The length of the source string. + @param errorMessage A pointer to a JSStringRef in which to store the parse error message if the source is not valid. Pass NULL if you do not care to store an error message. + @param errorLine A pointer to an int in which to store the line number of a parser error. Pass NULL if you do not care to store an error line. + @result A JSScriptRef for the provided source, or NULL if any non-ASCII character is found in source or if the source is not a valid JavaScript program. Ownership follows the Create Rule. + @discussion Use this function to create a reusable script reference with a constant + buffer as the backing string. The source string must outlive the global context. + */ +JS_EXPORT JSScriptRef JSScriptCreateReferencingImmortalASCIIText(JSContextGroupRef contextGroup, JSStringRef url, int startingLineNumber, const char* source, size_t length, JSStringRef* errorMessage, int* errorLine); + +/*! + @function + @abstract Creates a script reference from a string + @param contextGroup The context group the script is to be used in. + @param url The source url to be reported in errors and exceptions. + @param startingLineNumber An integer value specifying the script's starting line number in the file located at sourceURL. This is only used when reporting exceptions. + @param source The source string. + @param errorMessage A pointer to a JSStringRef in which to store the parse error message if the source is not valid. Pass NULL if you do not care to store an error message. + @param errorLine A pointer to an int in which to store the line number of a parser error. Pass NULL if you do not care to store an error line. + @result A JSScriptRef for the provided source, or NULL is the source is not a valid JavaScript program. Ownership follows the Create Rule. + */ +JS_EXPORT JSScriptRef JSScriptCreateFromString(JSContextGroupRef contextGroup, JSStringRef url, int startingLineNumber, JSStringRef source, JSStringRef* errorMessage, int* errorLine); + +/*! + @function + @abstract Retains a JavaScript script. + @param script The script to retain. + */ +JS_EXPORT void JSScriptRetain(JSScriptRef script); + +/*! + @function + @abstract Releases a JavaScript script. + @param script The script to release. + */ +JS_EXPORT void JSScriptRelease(JSScriptRef script); + +/*! + @function + @abstract Evaluates a JavaScript script. + @param ctx The execution context to use. + @param script The JSScript to evaluate. + @param thisValue The value to use as "this" when evaluating the script. + @param exception A pointer to a JSValueRef in which to store an exception, if any. Pass NULL if you do not care to store an exception. + @result The JSValue that results from evaluating script, or NULL if an exception is thrown. + */ +JS_EXPORT JSValueRef JSScriptEvaluate(JSContextRef ctx, JSScriptRef script, JSValueRef thisValue, JSValueRef* exception); + + +#ifdef __cplusplus +} +#endif + +#endif /* JSScriptRefPrivate_h */ diff --git a/JavaScriptCore/API/JSStringRef.cpp b/JavaScriptCore/API/JSStringRef.cpp index ea31da66..a03afed5 100644 --- a/JavaScriptCore/API/JSStringRef.cpp +++ b/JavaScriptCore/API/JSStringRef.cpp @@ -25,6 +25,7 @@ #include "config.h" #include "JSStringRef.h" +#include "JSStringRefPrivate.h" #include "InitializeThreading.h" #include "OpaqueJSString.h" @@ -46,14 +47,24 @@ JSStringRef JSStringCreateWithUTF8CString(const char* string) size_t length = strlen(string); Vector buffer(length); UChar* p = buffer.data(); - if (conversionOK == convertUTF8ToUTF16(&string, string + length, &p, p + length)) + bool sourceIsAllASCII; + const LChar* stringStart = reinterpret_cast(string); + if (conversionOK == convertUTF8ToUTF16(&string, string + length, &p, p + length, &sourceIsAllASCII)) { + if (sourceIsAllASCII) + return OpaqueJSString::create(stringStart, length).leakRef(); return OpaqueJSString::create(buffer.data(), p - buffer.data()).leakRef(); + } } - // Null string. return OpaqueJSString::create().leakRef(); } +JSStringRef JSStringCreateWithCharactersNoCopy(const JSChar* chars, size_t numChars) +{ + initializeThreading(); + return OpaqueJSString::create(StringImpl::createWithoutCopying(chars, numChars)).leakRef(); +} + JSStringRef JSStringRetain(JSStringRef string) { string->ref(); diff --git a/JavaScriptCore/API/JSStringRefCF.cpp b/JavaScriptCore/API/JSStringRefCF.cpp index 0877a13e..50593f19 100644 --- a/JavaScriptCore/API/JSStringRefCF.cpp +++ b/JavaScriptCore/API/JSStringRefCF.cpp @@ -28,11 +28,10 @@ #include "APICast.h" #include "InitializeThreading.h" +#include "JSCJSValue.h" #include "JSStringRef.h" #include "OpaqueJSString.h" -#include -#include -#include +#include JSStringRef JSStringCreateWithCFString(CFStringRef string) { @@ -42,16 +41,25 @@ JSStringRef JSStringCreateWithCFString(CFStringRef string) // it can hold. () size_t length = CFStringGetLength(string); if (length) { - OwnArrayPtr buffer = adoptArrayPtr(new UniChar[length]); + Vector lcharBuffer(length); + CFIndex usedBufferLength; + CFIndex convertedSize = CFStringGetBytes(string, CFRangeMake(0, length), kCFStringEncodingISOLatin1, 0, false, lcharBuffer.data(), length, &usedBufferLength); + if (static_cast(convertedSize) == length && static_cast(usedBufferLength) == length) + return OpaqueJSString::create(lcharBuffer.data(), length).leakRef(); + + auto buffer = std::make_unique(length); CFStringGetCharacters(string, CFRangeMake(0, length), buffer.get()); COMPILE_ASSERT(sizeof(UniChar) == sizeof(UChar), unichar_and_uchar_must_be_same_size); return OpaqueJSString::create(reinterpret_cast(buffer.get()), length).leakRef(); - } else { - return OpaqueJSString::create(0, 0).leakRef(); } + + return OpaqueJSString::create(reinterpret_cast(""), 0).leakRef(); } CFStringRef JSStringCopyCFString(CFAllocatorRef alloc, JSStringRef string) { + if (!string->length()) + return CFSTR(""); + return CFStringCreateWithCharacters(alloc, reinterpret_cast(string->characters()), string->length()); } diff --git a/JavaScriptCore/API/JSStringRefPrivate.h b/JavaScriptCore/API/JSStringRefPrivate.h new file mode 100644 index 00000000..f1db806e --- /dev/null +++ b/JavaScriptCore/API/JSStringRefPrivate.h @@ -0,0 +1,41 @@ +/* + * Copyright (C) 2013 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. + */ + +#ifndef JSStringRefPrivate_h +#define JSStringRefPrivate_h + +#include + +#ifdef __cplusplus +extern "C" { +#endif + +JS_EXPORT JSStringRef JSStringCreateWithCharactersNoCopy(const JSChar* chars, size_t numChars); + +#ifdef __cplusplus +} +#endif + +#endif /* JSStringRefPrivate_h */ diff --git a/JavaScriptCore/API/JSValue.h b/JavaScriptCore/API/JSValue.h new file mode 100644 index 00000000..b7971b26 --- /dev/null +++ b/JavaScriptCore/API/JSValue.h @@ -0,0 +1,310 @@ +/* + * Copyright (C) 2013 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. + */ + +#ifndef JSValue_h +#define JSValue_h + +#if JSC_OBJC_API_ENABLED + +@class JSContext; + +// A JSValue is a reference to a value within the JavaScript object space of a +// JSVirtualMachine. All instances of JSValue originate from a JSContext and +// hold a strong reference to this JSContext. As long as any value associated with +// a particular JSContext is retained, that JSContext will remain alive. +// Where an instance method is invoked upon a JSValue, and this returns another +// JSValue, the returned JSValue will originate from the same JSContext as the +// JSValue on which the method was invoked. +// +// For all methods taking arguments of type id, arguments will be converted +// into a JavaScript value according to the conversion specified below. +// All JavaScript values are associated with a particular JSVirtualMachine +// (the associated JSVirtualMachine is available indirectly via the context +// property). An instance of JSValue may only be passed as an argument to +// methods on instances of JSValue and JSContext that belong to the same +// JSVirtualMachine - passing a JSValue to a method on an object originating +// from a different JSVirtualMachine will result in an Objective-C exception +// being raised. +// +// Conversion between Objective-C and JavaScript types. +// +// When converting between JavaScript values and Objective-C objects a copy is +// performed. Values of types listed below are copied to the corresponding +// types on conversion in each direction. For NSDictionaries, entries in the +// dictionary that are keyed by strings are copied onto a JavaScript object. +// For dictionaries and arrays, conversion is recursive, with the same object +// conversion being applied to all entries in the collection. +// +// Objective-C type | JavaScript type +// --------------------+--------------------- +// nil | undefined +// NSNull | null +// NSString | string +// NSNumber | number, boolean +// NSDictionary | Object object +// NSArray | Array object +// NSDate | Date object +// NSBlock * | Function object * +// id ** | Wrapper object ** +// Class *** | Constructor object *** +// +// * Instances of NSBlock with supported arguments types will be presented to +// JavaScript as a callable Function object. For more information on supported +// argument types see JSExport.h. If a JavaScript Function originating from an +// Objective-C block is converted back to an Objective-C object the block will +// be returned. All other JavaScript functions will be converted in the same +// manner as a JavaScript object of type Object. +// +// ** For Objective-C instances that do not derive from the set of types listed +// above, a wrapper object to provide a retaining handle to the Objective-C +// instance from JavaScript. For more information on these wrapper objects, see +// JSExport.h. When a JavaScript wrapper object is converted back to Objective-C +// the Objective-C instance being retained by the wrapper is returned. +// +// *** For Objective-C Class objects a constructor object containing exported +// class methods will be returned. See JSExport.h for more information on +// constructor objects. + +#ifndef JSC_OBJC_API_AVAILABLE_MAC_OS_X_1080 +NS_CLASS_AVAILABLE(10_9, 7_0) +#else +OBJC_VISIBLE +#endif +@interface JSValue : NSObject + +// Create a JSValue by converting an Objective-C object. ++ (JSValue *)valueWithObject:(id)value inContext:(JSContext *)context; +// Create a JavaScript value from an Objective-C primitive type. ++ (JSValue *)valueWithBool:(BOOL)value inContext:(JSContext *)context; ++ (JSValue *)valueWithDouble:(double)value inContext:(JSContext *)context; ++ (JSValue *)valueWithInt32:(int32_t)value inContext:(JSContext *)context; ++ (JSValue *)valueWithUInt32:(uint32_t)value inContext:(JSContext *)context; +// Create a JavaScript value in this context. ++ (JSValue *)valueWithNewObjectInContext:(JSContext *)context; ++ (JSValue *)valueWithNewArrayInContext:(JSContext *)context; ++ (JSValue *)valueWithNewRegularExpressionFromPattern:(NSString *)pattern flags:(NSString *)flags inContext:(JSContext *)context; ++ (JSValue *)valueWithNewErrorFromMessage:(NSString *)message inContext:(JSContext *)context; ++ (JSValue *)valueWithNullInContext:(JSContext *)context; ++ (JSValue *)valueWithUndefinedInContext:(JSContext *)context; + +// Convert this value to a corresponding Objective-C object, according to the +// conversion specified above. +- (id)toObject; +// Convert this value to a corresponding Objective-C object, if the result is +// not of the specified class then nil will be returned. +- (id)toObjectOfClass:(Class)expectedClass; +// The value is copied to a boolean according to the conversion specified by the +// JavaScript language. +- (BOOL)toBool; +// The value is copied to a number according to the conversion specified by the +// JavaScript language. +- (double)toDouble; +// The value is copied to an integer according to the conversion specified by +// the JavaScript language. +- (int32_t)toInt32; +// The value is copied to an integer according to the conversion specified by +// the JavaScript language. +- (uint32_t)toUInt32; +// If the value is a boolean, a NSNumber value of @YES or @NO will be returned. +// For all other types the value will be copied to a number according to the +// conversion specified by the JavaScript language. +- (NSNumber *)toNumber; +// The value is copied to a string according to the conversion specified by the +// JavaScript language. +- (NSString *)toString; +// The value is converted to a number representing a time interval since 1970, +// and a new NSDate instance is returned. +- (NSDate *)toDate; +// If the value is null or undefined then nil is returned. +// If the value is not an object then a JavaScript TypeError will be thrown. +// The property "length" is read from the object, converted to an unsigned +// integer, and an NSArray of this size is allocated. Properties corresponding +// to indicies within the array bounds will be copied to the array, with +// Objective-C objects converted to equivalent JSValues as specified. +- (NSArray *)toArray; +// If the value is null or undefined then nil is returned. +// If the value is not an object then a JavaScript TypeError will be thrown. +// All enumerable properties of the object are copied to the dictionary, with +// Objective-C objects converted to equivalent JSValues as specified. +- (NSDictionary *)toDictionary; + +// Access a property from the value. This method will return the JavaScript value +// 'undefined' if the property does not exist. +- (JSValue *)valueForProperty:(NSString *)property; +// Set a property on the value. +- (void)setValue:(id)value forProperty:(NSString *)property; +// Delete a property from the value, returns YES if deletion is successful. +- (BOOL)deleteProperty:(NSString *)property; +// Returns YES if property is present on the value. +// This method has the same function as the JavaScript operator "in". +- (BOOL)hasProperty:(NSString *)property; +// This method may be used to create a data or accessor property on an object; +// this method operates in accordance with the Object.defineProperty method in +// the JavaScript language. +- (void)defineProperty:(NSString *)property descriptor:(id)descriptor; + +// Access an indexed property from the value. This method will return the +// JavaScript value 'undefined' if no property exists at that index. +- (JSValue *)valueAtIndex:(NSUInteger)index; +// Set an indexed property on the value. For JSValues that are JavaScript arrays, +// indices greater than UINT_MAX - 1 will not affect the length of the array. +- (void)setValue:(id)value atIndex:(NSUInteger)index; + +// All JavaScript values are precisely one of these types. +- (BOOL)isUndefined; +- (BOOL)isNull; +- (BOOL)isBoolean; +- (BOOL)isNumber; +- (BOOL)isString; +- (BOOL)isObject; + +// This method has the same function as the JavaScript operator "===". +- (BOOL)isEqualToObject:(id)value; +// This method has the same function as the JavaScript operator "==". +- (BOOL)isEqualWithTypeCoercionToObject:(id)value; +// This method has the same function as the JavaScript operator "instanceof". +- (BOOL)isInstanceOf:(id)value; + +// Call this value as a function passing the specified arguments. +- (JSValue *)callWithArguments:(NSArray *)arguments; +// Call this value as a constructor passing the specified arguments. +- (JSValue *)constructWithArguments:(NSArray *)arguments; +// Access the property named "method" from this value; call the value resulting +// from the property access as a function, passing this value as the "this" +// value, and the specified arguments. +- (JSValue *)invokeMethod:(NSString *)method withArguments:(NSArray *)arguments; + +// The JSContext that this value originates from. +@property(readonly, retain) JSContext *context; + +@end + +// Objective-C methods exported to JavaScript may have argument and/or return +// values of struct types, provided that conversion to and from the struct is +// supported by JSValue. Support is provided for any types where JSValue +// contains both a class method "valueWith:inContext:", and and instance +// method "to" - where the string "" in these selector names match, +// with the first argument to the former being of the same struct type as the +// return type of the latter. +// Support is provided for structs of type CGPoint, NSRange, CGRect and CGSize. +@interface JSValue(StructSupport) + +// This method returns a newly allocated JavaScript object containing properties +// named "x" and "y", with values from the CGPoint. ++ (JSValue *)valueWithPoint:(CGPoint)point inContext:(JSContext *)context; +// This method returns a newly allocated JavaScript object containing properties +// named "location" and "length", with values from the NSRange. ++ (JSValue *)valueWithRange:(NSRange)range inContext:(JSContext *)context; +// This method returns a newly allocated JavaScript object containing properties +// named "x", "y", "width", and "height", with values from the CGRect. ++ (JSValue *)valueWithRect:(CGRect)rect inContext:(JSContext *)context; +// This method returns a newly allocated JavaScript object containing properties +// named "width" and "height", with values from the CGSize. ++ (JSValue *)valueWithSize:(CGSize)size inContext:(JSContext *)context; + +// Convert a value to type CGPoint by reading properties named "x" and "y" from +// this value, and converting the results to double. +- (CGPoint)toPoint; +// Convert a value to type NSRange by accessing properties named "location" and +// "length" from this value converting the results to double. +- (NSRange)toRange; +// Convert a value to type CGRect by reading properties named "x", "y", "width", +// and "height" from this value, and converting the results to double. +- (CGRect)toRect; +// Convert a value to type CGSize by accessing properties named "width" and +// "height" from this value converting the results to double. +- (CGSize)toSize; + +@end + +// Instances of JSValue implement the following methods in order to enable +// support for subscript access by key and index, for example: +// +// JSValue *objectA, *objectB; +// JSValue *v1 = object[@"X"]; // Get value for property "X" from 'object'. +// JSValue *v2 = object[42]; // Get value for index 42 from 'object'. +// object[@"Y"] = v1; // Assign 'v1' to property "Y" of 'object'. +// object[101] = v2; // Assign 'v2' to index 101 of 'object'. +// +// An object key passed as a subscript will be converted to a JavaScript value, +// and then the value converted to a string used as a property name. +@interface JSValue(SubscriptSupport) + +- (JSValue *)objectForKeyedSubscript:(id)key; +- (JSValue *)objectAtIndexedSubscript:(NSUInteger)index; +- (void)setObject:(id)object forKeyedSubscript:(NSObject *)key; +- (void)setObject:(id)object atIndexedSubscript:(NSUInteger)index; + +@end + +// These functions are for bridging between the C API and the Objective-C API. +@interface JSValue(JSValueRefSupport) +// Creates a JSValue, wrapping its C API counterpart. ++ (JSValue *)valueWithJSValueRef:(JSValueRef)value inContext:(JSContext *)context; +// Returns the C API counterpart wrapped by a JSContext. +- (JSValueRef)JSValueRef; +@end + +#ifdef __cplusplus +extern "C" { +#endif + +// These keys may assist in creating a property descriptor for use with the +// defineProperty method on JSValue. +// Property descriptors must fit one of three descriptions: +// Data Descriptor: +// - A descriptor containing one or both of the keys "value" and "writable", +// and optionally containing one or both of the keys "enumerable" and +// "configurable". A data descriptor may not contain either the "get" or +// "set" key. +// A data descriptor may be used to create or modify the attributes of a +// data property on an object (replacing any existing accessor property). +// Accessor Descriptor: +// - A descriptor containing one or both of the keys "get" and "set", and +// optionally containing one or both of the keys "enumerable" and +// "configurable". An accessor descriptor may not contain either the "value" +// or "writable" key. +// An accessor descriptor may be used to create or modify the attributes of +// an accessor property on an object (replacing any existing data property). +// Generic Descriptor: +// - A descriptor containing one or both of the keys "enumerable" and +// "configurable". A generic descriptor may not contain any of the keys +// "value", " writable", "get", or "set". +// A generic descriptor may be used to modify the attributes of an existing +// data or accessor property, or to create a new data property. +JS_EXPORT extern NSString * const JSPropertyDescriptorWritableKey; +JS_EXPORT extern NSString * const JSPropertyDescriptorEnumerableKey; +JS_EXPORT extern NSString * const JSPropertyDescriptorConfigurableKey; +JS_EXPORT extern NSString * const JSPropertyDescriptorValueKey; +JS_EXPORT extern NSString * const JSPropertyDescriptorGetKey; +JS_EXPORT extern NSString * const JSPropertyDescriptorSetKey; + +#ifdef __cplusplus +} // extern "C" +#endif + +#endif + +#endif // JSValue_h diff --git a/JavaScriptCore/API/JSValue.mm b/JavaScriptCore/API/JSValue.mm new file mode 100644 index 00000000..95c129e4 --- /dev/null +++ b/JavaScriptCore/API/JSValue.mm @@ -0,0 +1,1132 @@ +/* + * Copyright (C) 2013 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" + +#import "APICast.h" +#import "APIShims.h" +#import "DateInstance.h" +#import "Error.h" +#import "JavaScriptCore.h" +#import "JSContextInternal.h" +#import "JSVirtualMachineInternal.h" +#import "JSValueInternal.h" +#import "JSWrapperMap.h" +#import "ObjcRuntimeExtras.h" +#import "Operations.h" +#import "JSCJSValue.h" +#import +#import +#import +#import +#import +#import +#import + +#if JSC_OBJC_API_ENABLED + +NSString * const JSPropertyDescriptorWritableKey = @"writable"; +NSString * const JSPropertyDescriptorEnumerableKey = @"enumerable"; +NSString * const JSPropertyDescriptorConfigurableKey = @"configurable"; +NSString * const JSPropertyDescriptorValueKey = @"value"; +NSString * const JSPropertyDescriptorGetKey = @"get"; +NSString * const JSPropertyDescriptorSetKey = @"set"; + +@implementation JSValue { + JSValueRef m_value; +} + +- (JSValueRef)JSValueRef +{ + return m_value; +} + ++ (JSValue *)valueWithObject:(id)value inContext:(JSContext *)context +{ + return [JSValue valueWithJSValueRef:objectToValue(context, value) inContext:context]; +} + ++ (JSValue *)valueWithBool:(BOOL)value inContext:(JSContext *)context +{ + return [JSValue valueWithJSValueRef:JSValueMakeBoolean([context JSGlobalContextRef], value) inContext:context]; +} + ++ (JSValue *)valueWithDouble:(double)value inContext:(JSContext *)context +{ + return [JSValue valueWithJSValueRef:JSValueMakeNumber([context JSGlobalContextRef], value) inContext:context]; +} + ++ (JSValue *)valueWithInt32:(int32_t)value inContext:(JSContext *)context +{ + return [JSValue valueWithJSValueRef:JSValueMakeNumber([context JSGlobalContextRef], value) inContext:context]; +} + ++ (JSValue *)valueWithUInt32:(uint32_t)value inContext:(JSContext *)context +{ + return [JSValue valueWithJSValueRef:JSValueMakeNumber([context JSGlobalContextRef], value) inContext:context]; +} + ++ (JSValue *)valueWithNewObjectInContext:(JSContext *)context +{ + return [JSValue valueWithJSValueRef:JSObjectMake([context JSGlobalContextRef], 0, 0) inContext:context]; +} + ++ (JSValue *)valueWithNewArrayInContext:(JSContext *)context +{ + return [JSValue valueWithJSValueRef:JSObjectMakeArray([context JSGlobalContextRef], 0, NULL, 0) inContext:context]; +} + ++ (JSValue *)valueWithNewRegularExpressionFromPattern:(NSString *)pattern flags:(NSString *)flags inContext:(JSContext *)context +{ + JSStringRef patternString = JSStringCreateWithCFString((CFStringRef)pattern); + JSStringRef flagsString = JSStringCreateWithCFString((CFStringRef)flags); + JSValueRef arguments[2] = { JSValueMakeString([context JSGlobalContextRef], patternString), JSValueMakeString([context JSGlobalContextRef], flagsString) }; + JSStringRelease(patternString); + JSStringRelease(flagsString); + + return [JSValue valueWithJSValueRef:JSObjectMakeRegExp([context JSGlobalContextRef], 2, arguments, 0) inContext:context]; +} + ++ (JSValue *)valueWithNewErrorFromMessage:(NSString *)message inContext:(JSContext *)context +{ + JSStringRef string = JSStringCreateWithCFString((CFStringRef)message); + JSValueRef argument = JSValueMakeString([context JSGlobalContextRef], string); + JSStringRelease(string); + + return [JSValue valueWithJSValueRef:JSObjectMakeError([context JSGlobalContextRef], 1, &argument, 0) inContext:context]; +} + ++ (JSValue *)valueWithNullInContext:(JSContext *)context +{ + return [JSValue valueWithJSValueRef:JSValueMakeNull([context JSGlobalContextRef]) inContext:context]; +} + ++ (JSValue *)valueWithUndefinedInContext:(JSContext *)context +{ + return [JSValue valueWithJSValueRef:JSValueMakeUndefined([context JSGlobalContextRef]) inContext:context]; +} + +- (id)toObject +{ + return valueToObject(_context, m_value); +} + +- (id)toObjectOfClass:(Class)expectedClass +{ + id result = [self toObject]; + return [result isKindOfClass:expectedClass] ? result : nil; +} + +- (BOOL)toBool +{ + return JSValueToBoolean([_context JSGlobalContextRef], m_value); +} + +- (double)toDouble +{ + JSValueRef exception = 0; + double result = JSValueToNumber([_context JSGlobalContextRef], m_value, &exception); + if (exception) { + [_context notifyException:exception]; + return std::numeric_limits::quiet_NaN(); + } + + return result; +} + +- (int32_t)toInt32 +{ + return JSC::toInt32([self toDouble]); +} + +- (uint32_t)toUInt32 +{ + return JSC::toUInt32([self toDouble]); +} + +- (NSNumber *)toNumber +{ + JSValueRef exception = 0; + id result = valueToNumber([_context JSGlobalContextRef], m_value, &exception); + if (exception) + [_context notifyException:exception]; + return result; +} + +- (NSString *)toString +{ + JSValueRef exception = 0; + id result = valueToString([_context JSGlobalContextRef], m_value, &exception); + if (exception) + [_context notifyException:exception]; + return result; +} + +- (NSDate *)toDate +{ + JSValueRef exception = 0; + id result = valueToDate([_context JSGlobalContextRef], m_value, &exception); + if (exception) + [_context notifyException:exception]; + return result; +} + +- (NSArray *)toArray +{ + JSValueRef exception = 0; + id result = valueToArray([_context JSGlobalContextRef], m_value, &exception); + if (exception) + [_context notifyException:exception]; + return result; +} + +- (NSDictionary *)toDictionary +{ + JSValueRef exception = 0; + id result = valueToDictionary([_context JSGlobalContextRef], m_value, &exception); + if (exception) + [_context notifyException:exception]; + return result; +} + +- (JSValue *)valueForProperty:(NSString *)propertyName +{ + JSValueRef exception = 0; + JSObjectRef object = JSValueToObject([_context JSGlobalContextRef], m_value, &exception); + if (exception) + return [_context valueFromNotifyException:exception]; + + JSStringRef name = JSStringCreateWithCFString((CFStringRef)propertyName); + JSValueRef result = JSObjectGetProperty([_context JSGlobalContextRef], object, name, &exception); + JSStringRelease(name); + if (exception) + return [_context valueFromNotifyException:exception]; + + return [JSValue valueWithJSValueRef:result inContext:_context]; +} + +- (void)setValue:(id)value forProperty:(NSString *)propertyName +{ + JSValueRef exception = 0; + JSObjectRef object = JSValueToObject([_context JSGlobalContextRef], m_value, &exception); + if (exception) { + [_context notifyException:exception]; + return; + } + + JSStringRef name = JSStringCreateWithCFString((CFStringRef)propertyName); + JSObjectSetProperty([_context JSGlobalContextRef], object, name, objectToValue(_context, value), 0, &exception); + JSStringRelease(name); + if (exception) { + [_context notifyException:exception]; + return; + } +} + +- (BOOL)deleteProperty:(NSString *)propertyName +{ + JSValueRef exception = 0; + JSObjectRef object = JSValueToObject([_context JSGlobalContextRef], m_value, &exception); + if (exception) + return [_context boolFromNotifyException:exception]; + + JSStringRef name = JSStringCreateWithCFString((CFStringRef)propertyName); + BOOL result = JSObjectDeleteProperty([_context JSGlobalContextRef], object, name, &exception); + JSStringRelease(name); + if (exception) + return [_context boolFromNotifyException:exception]; + + return result; +} + +- (BOOL)hasProperty:(NSString *)propertyName +{ + JSValueRef exception = 0; + JSObjectRef object = JSValueToObject([_context JSGlobalContextRef], m_value, &exception); + if (exception) + return [_context boolFromNotifyException:exception]; + + JSStringRef name = JSStringCreateWithCFString((CFStringRef)propertyName); + BOOL result = JSObjectHasProperty([_context JSGlobalContextRef], object, name); + JSStringRelease(name); + return result; +} + +- (void)defineProperty:(NSString *)property descriptor:(id)descriptor +{ + [[_context globalObject][@"Object"] invokeMethod:@"defineProperty" withArguments:@[ self, property, descriptor ]]; +} + +- (JSValue *)valueAtIndex:(NSUInteger)index +{ + // Properties that are higher than an unsigned value can hold are converted to a double then inserted as a normal property. + // Indices that are bigger than the max allowed index size (UINT_MAX - 1) will be handled internally in get(). + if (index != (unsigned)index) + return [self valueForProperty:[[JSValue valueWithDouble:index inContext:_context] toString]]; + + JSValueRef exception = 0; + JSObjectRef object = JSValueToObject([_context JSGlobalContextRef], m_value, &exception); + if (exception) + return [_context valueFromNotifyException:exception]; + + JSValueRef result = JSObjectGetPropertyAtIndex([_context JSGlobalContextRef], object, (unsigned)index, &exception); + if (exception) + return [_context valueFromNotifyException:exception]; + + return [JSValue valueWithJSValueRef:result inContext:_context]; +} + +- (void)setValue:(id)value atIndex:(NSUInteger)index +{ + // Properties that are higher than an unsigned value can hold are converted to a double, then inserted as a normal property. + // Indices that are bigger than the max allowed index size (UINT_MAX - 1) will be handled internally in putByIndex(). + if (index != (unsigned)index) + return [self setValue:value forProperty:[[JSValue valueWithDouble:index inContext:_context] toString]]; + + JSValueRef exception = 0; + JSObjectRef object = JSValueToObject([_context JSGlobalContextRef], m_value, &exception); + if (exception) { + [_context notifyException:exception]; + return; + } + + JSObjectSetPropertyAtIndex([_context JSGlobalContextRef], object, (unsigned)index, objectToValue(_context, value), &exception); + if (exception) { + [_context notifyException:exception]; + return; + } +} + +- (BOOL)isUndefined +{ + return JSValueIsUndefined([_context JSGlobalContextRef], m_value); +} + +- (BOOL)isNull +{ + return JSValueIsNull([_context JSGlobalContextRef], m_value); +} + +- (BOOL)isBoolean +{ + return JSValueIsBoolean([_context JSGlobalContextRef], m_value); +} + +- (BOOL)isNumber +{ + return JSValueIsNumber([_context JSGlobalContextRef], m_value); +} + +- (BOOL)isString +{ + return JSValueIsString([_context JSGlobalContextRef], m_value); +} + +- (BOOL)isObject +{ + return JSValueIsObject([_context JSGlobalContextRef], m_value); +} + +- (BOOL)isEqualToObject:(id)value +{ + return JSValueIsStrictEqual([_context JSGlobalContextRef], m_value, objectToValue(_context, value)); +} + +- (BOOL)isEqualWithTypeCoercionToObject:(id)value +{ + JSValueRef exception = 0; + BOOL result = JSValueIsEqual([_context JSGlobalContextRef], m_value, objectToValue(_context, value), &exception); + if (exception) + return [_context boolFromNotifyException:exception]; + + return result; +} + +- (BOOL)isInstanceOf:(id)value +{ + JSValueRef exception = 0; + JSObjectRef constructor = JSValueToObject([_context JSGlobalContextRef], objectToValue(_context, value), &exception); + if (exception) + return [_context boolFromNotifyException:exception]; + + BOOL result = JSValueIsInstanceOfConstructor([_context JSGlobalContextRef], m_value, constructor, &exception); + if (exception) + return [_context boolFromNotifyException:exception]; + + return result; +} + +- (JSValue *)callWithArguments:(NSArray *)argumentArray +{ + NSUInteger argumentCount = [argumentArray count]; + JSValueRef arguments[argumentCount]; + for (unsigned i = 0; i < argumentCount; ++i) + arguments[i] = objectToValue(_context, [argumentArray objectAtIndex:i]); + + JSValueRef exception = 0; + JSObjectRef object = JSValueToObject([_context JSGlobalContextRef], m_value, &exception); + if (exception) + return [_context valueFromNotifyException:exception]; + + JSValueRef result = JSObjectCallAsFunction([_context JSGlobalContextRef], object, 0, argumentCount, arguments, &exception); + if (exception) + return [_context valueFromNotifyException:exception]; + + return [JSValue valueWithJSValueRef:result inContext:_context]; +} + +- (JSValue *)constructWithArguments:(NSArray *)argumentArray +{ + NSUInteger argumentCount = [argumentArray count]; + JSValueRef arguments[argumentCount]; + for (unsigned i = 0; i < argumentCount; ++i) + arguments[i] = objectToValue(_context, [argumentArray objectAtIndex:i]); + + JSValueRef exception = 0; + JSObjectRef object = JSValueToObject([_context JSGlobalContextRef], m_value, &exception); + if (exception) + return [_context valueFromNotifyException:exception]; + + JSObjectRef result = JSObjectCallAsConstructor([_context JSGlobalContextRef], object, argumentCount, arguments, &exception); + if (exception) + return [_context valueFromNotifyException:exception]; + + return [JSValue valueWithJSValueRef:result inContext:_context]; +} + +- (JSValue *)invokeMethod:(NSString *)method withArguments:(NSArray *)arguments +{ + NSUInteger argumentCount = [arguments count]; + JSValueRef argumentArray[argumentCount]; + for (unsigned i = 0; i < argumentCount; ++i) + argumentArray[i] = objectToValue(_context, [arguments objectAtIndex:i]); + + JSValueRef exception = 0; + JSObjectRef thisObject = JSValueToObject([_context JSGlobalContextRef], m_value, &exception); + if (exception) + return [_context valueFromNotifyException:exception]; + + JSStringRef name = JSStringCreateWithCFString((CFStringRef)method); + JSValueRef function = JSObjectGetProperty([_context JSGlobalContextRef], thisObject, name, &exception); + JSStringRelease(name); + if (exception) + return [_context valueFromNotifyException:exception]; + + JSObjectRef object = JSValueToObject([_context JSGlobalContextRef], function, &exception); + if (exception) + return [_context valueFromNotifyException:exception]; + + JSValueRef result = JSObjectCallAsFunction([_context JSGlobalContextRef], object, thisObject, argumentCount, argumentArray, &exception); + if (exception) + return [_context valueFromNotifyException:exception]; + + return [JSValue valueWithJSValueRef:result inContext:_context]; +} + +@end + +@implementation JSValue(StructSupport) + +- (CGPoint)toPoint +{ + return (CGPoint){ + static_cast([self[@"x"] toDouble]), + static_cast([self[@"y"] toDouble]) + }; +} + +- (NSRange)toRange +{ + return (NSRange){ + [[self[@"location"] toNumber] unsignedIntegerValue], + [[self[@"length"] toNumber] unsignedIntegerValue] + }; +} + +- (CGRect)toRect +{ + return (CGRect){ + [self toPoint], + [self toSize] + }; +} + +- (CGSize)toSize +{ + return (CGSize){ + static_cast([self[@"width"] toDouble]), + static_cast([self[@"height"] toDouble]) + }; +} + ++ (JSValue *)valueWithPoint:(CGPoint)point inContext:(JSContext *)context +{ + return [JSValue valueWithObject:@{ + @"x":@(point.x), + @"y":@(point.y) + } inContext:context]; +} + ++ (JSValue *)valueWithRange:(NSRange)range inContext:(JSContext *)context +{ + return [JSValue valueWithObject:@{ + @"location":@(range.location), + @"length":@(range.length) + } inContext:context]; +} + ++ (JSValue *)valueWithRect:(CGRect)rect inContext:(JSContext *)context +{ + return [JSValue valueWithObject:@{ + @"x":@(rect.origin.x), + @"y":@(rect.origin.y), + @"width":@(rect.size.width), + @"height":@(rect.size.height) + } inContext:context]; +} + ++ (JSValue *)valueWithSize:(CGSize)size inContext:(JSContext *)context +{ + return [JSValue valueWithObject:@{ + @"width":@(size.width), + @"height":@(size.height) + } inContext:context]; +} + +@end + +@implementation JSValue(SubscriptSupport) + +- (JSValue *)objectForKeyedSubscript:(id)key +{ + if (![key isKindOfClass:[NSString class]]) { + key = [[JSValue valueWithObject:key inContext:_context] toString]; + if (!key) + return [JSValue valueWithUndefinedInContext:_context]; + } + + return [self valueForProperty:(NSString *)key]; +} + +- (JSValue *)objectAtIndexedSubscript:(NSUInteger)index +{ + return [self valueAtIndex:index]; +} + +- (void)setObject:(id)object forKeyedSubscript:(NSObject *)key +{ + if (![key isKindOfClass:[NSString class]]) { + key = [[JSValue valueWithObject:key inContext:_context] toString]; + if (!key) + return; + } + + [self setValue:object forProperty:(NSString *)key]; +} + +- (void)setObject:(id)object atIndexedSubscript:(NSUInteger)index +{ + [self setValue:object atIndex:index]; +} + +@end + +inline bool isDate(JSObjectRef object, JSGlobalContextRef context) +{ + JSC::APIEntryShim entryShim(toJS(context)); + return toJS(object)->inherits(JSC::DateInstance::info()); +} + +inline bool isArray(JSObjectRef object, JSGlobalContextRef context) +{ + JSC::APIEntryShim entryShim(toJS(context)); + return toJS(object)->inherits(JSC::JSArray::info()); +} + +@implementation JSValue(Internal) + +enum ConversionType { + ContainerNone, + ContainerArray, + ContainerDictionary +}; + +class JSContainerConvertor { +public: + struct Task { + JSValueRef js; + id objc; + ConversionType type; + }; + + JSContainerConvertor(JSGlobalContextRef context) + : m_context(context) + { + } + + id convert(JSValueRef property); + void add(Task); + Task take(); + bool isWorkListEmpty() const { return !m_worklist.size(); } + +private: + JSGlobalContextRef m_context; + HashMap m_objectMap; + Vector m_worklist; +}; + +inline id JSContainerConvertor::convert(JSValueRef value) +{ + HashMap::iterator iter = m_objectMap.find(value); + if (iter != m_objectMap.end()) + return iter->value; + + Task result = valueToObjectWithoutCopy(m_context, value); + if (result.js) + add(result); + return result.objc; +} + +void JSContainerConvertor::add(Task task) +{ + m_objectMap.add(task.js, task.objc); + if (task.type != ContainerNone) + m_worklist.append(task); +} + +JSContainerConvertor::Task JSContainerConvertor::take() +{ + ASSERT(!isWorkListEmpty()); + Task last = m_worklist.last(); + m_worklist.removeLast(); + return last; +} + +static JSContainerConvertor::Task valueToObjectWithoutCopy(JSGlobalContextRef context, JSValueRef value) +{ + if (!JSValueIsObject(context, value)) { + id primitive; + if (JSValueIsBoolean(context, value)) + primitive = JSValueToBoolean(context, value) ? @YES : @NO; + else if (JSValueIsNumber(context, value)) { + // Normalize the number, so it will unique correctly in the hash map - + // it's nicer not to leak this internal implementation detail! + value = JSValueMakeNumber(context, JSValueToNumber(context, value, 0)); + primitive = [NSNumber numberWithDouble:JSValueToNumber(context, value, 0)]; + } else if (JSValueIsString(context, value)) { + // Would be nice to unique strings, too. + JSStringRef jsstring = JSValueToStringCopy(context, value, 0); + NSString * stringNS = (NSString *)JSStringCopyCFString(kCFAllocatorDefault, jsstring); + JSStringRelease(jsstring); + primitive = [stringNS autorelease]; + } else if (JSValueIsNull(context, value)) + primitive = [NSNull null]; + else { + ASSERT(JSValueIsUndefined(context, value)); + primitive = nil; + } + return (JSContainerConvertor::Task){ value, primitive, ContainerNone }; + } + + JSObjectRef object = JSValueToObject(context, value, 0); + + if (id wrapped = tryUnwrapObjcObject(context, object)) + return (JSContainerConvertor::Task){ object, wrapped, ContainerNone }; + + if (isDate(object, context)) + return (JSContainerConvertor::Task){ object, [NSDate dateWithTimeIntervalSince1970:JSValueToNumber(context, object, 0)], ContainerNone }; + + if (isArray(object, context)) + return (JSContainerConvertor::Task){ object, [NSMutableArray array], ContainerArray }; + + return (JSContainerConvertor::Task){ object, [NSMutableDictionary dictionary], ContainerDictionary }; +} + +static id containerValueToObject(JSGlobalContextRef context, JSContainerConvertor::Task task) +{ + ASSERT(task.type != ContainerNone); + JSContainerConvertor convertor(context); + convertor.add(task); + ASSERT(!convertor.isWorkListEmpty()); + + do { + JSContainerConvertor::Task current = convertor.take(); + ASSERT(JSValueIsObject(context, current.js)); + JSObjectRef js = JSValueToObject(context, current.js, 0); + + if (current.type == ContainerArray) { + ASSERT([current.objc isKindOfClass:[NSMutableArray class]]); + NSMutableArray *array = (NSMutableArray *)current.objc; + + JSStringRef lengthString = JSStringCreateWithUTF8CString("length"); + unsigned length = JSC::toUInt32(JSValueToNumber(context, JSObjectGetProperty(context, js, lengthString, 0), 0)); + JSStringRelease(lengthString); + + for (unsigned i = 0; i < length; ++i) { + id objc = convertor.convert(JSObjectGetPropertyAtIndex(context, js, i, 0)); + [array addObject:objc ? objc : [NSNull null]]; + } + } else { + ASSERT([current.objc isKindOfClass:[NSMutableDictionary class]]); + NSMutableDictionary *dictionary = (NSMutableDictionary *)current.objc; + + JSPropertyNameArrayRef propertyNameArray = JSObjectCopyPropertyNames(context, js); + size_t length = JSPropertyNameArrayGetCount(propertyNameArray); + + for (size_t i = 0; i < length; ++i) { + JSStringRef propertyName = JSPropertyNameArrayGetNameAtIndex(propertyNameArray, i); + if (id objc = convertor.convert(JSObjectGetProperty(context, js, propertyName, 0))) + dictionary[[(NSString *)JSStringCopyCFString(kCFAllocatorDefault, propertyName) autorelease]] = objc; + } + + JSPropertyNameArrayRelease(propertyNameArray); + } + + } while (!convertor.isWorkListEmpty()); + + return task.objc; +} + +id valueToObject(JSContext *context, JSValueRef value) +{ + JSContainerConvertor::Task result = valueToObjectWithoutCopy([context JSGlobalContextRef], value); + if (result.type == ContainerNone) + return result.objc; + return containerValueToObject([context JSGlobalContextRef], result); +} + +id valueToNumber(JSGlobalContextRef context, JSValueRef value, JSValueRef* exception) +{ + ASSERT(!*exception); + if (id wrapped = tryUnwrapObjcObject(context, value)) { + if ([wrapped isKindOfClass:[NSNumber class]]) + return wrapped; + } + + if (JSValueIsBoolean(context, value)) + return JSValueToBoolean(context, value) ? @YES : @NO; + + double result = JSValueToNumber(context, value, exception); + return [NSNumber numberWithDouble:*exception ? std::numeric_limits::quiet_NaN() : result]; +} + +id valueToString(JSGlobalContextRef context, JSValueRef value, JSValueRef* exception) +{ + ASSERT(!*exception); + if (id wrapped = tryUnwrapObjcObject(context, value)) { + if ([wrapped isKindOfClass:[NSString class]]) + return wrapped; + } + + JSStringRef jsstring = JSValueToStringCopy(context, value, exception); + if (*exception) { + ASSERT(!jsstring); + return nil; + } + + NSString *stringNS = CFBridgingRelease(JSStringCopyCFString(kCFAllocatorDefault, jsstring)); + JSStringRelease(jsstring); + return stringNS; +} + +id valueToDate(JSGlobalContextRef context, JSValueRef value, JSValueRef* exception) +{ + ASSERT(!*exception); + if (id wrapped = tryUnwrapObjcObject(context, value)) { + if ([wrapped isKindOfClass:[NSDate class]]) + return wrapped; + } + + double result = JSValueToNumber(context, value, exception); + return *exception ? nil : [NSDate dateWithTimeIntervalSince1970:result]; +} + +id valueToArray(JSGlobalContextRef context, JSValueRef value, JSValueRef* exception) +{ + ASSERT(!*exception); + if (id wrapped = tryUnwrapObjcObject(context, value)) { + if ([wrapped isKindOfClass:[NSArray class]]) + return wrapped; + } + + if (JSValueIsObject(context, value)) + return containerValueToObject(context, (JSContainerConvertor::Task){ value, [NSMutableArray array], ContainerArray}); + + if (!(JSValueIsNull(context, value) || JSValueIsUndefined(context, value))) + *exception = toRef(JSC::createTypeError(toJS(context), "Cannot convert primitive to NSArray")); + return nil; +} + +id valueToDictionary(JSGlobalContextRef context, JSValueRef value, JSValueRef* exception) +{ + ASSERT(!*exception); + if (id wrapped = tryUnwrapObjcObject(context, value)) { + if ([wrapped isKindOfClass:[NSDictionary class]]) + return wrapped; + } + + if (JSValueIsObject(context, value)) + return containerValueToObject(context, (JSContainerConvertor::Task){ value, [NSMutableDictionary dictionary], ContainerDictionary}); + + if (!(JSValueIsNull(context, value) || JSValueIsUndefined(context, value))) + *exception = toRef(JSC::createTypeError(toJS(context), "Cannot convert primitive to NSDictionary")); + return nil; +} + +class ObjcContainerConvertor { +public: + struct Task { + id objc; + JSValueRef js; + ConversionType type; + }; + + ObjcContainerConvertor(JSContext *context) + : m_context(context) + { + } + + JSValueRef convert(id object); + void add(Task); + Task take(); + bool isWorkListEmpty() const { return !m_worklist.size(); } + +private: + JSContext *m_context; + HashMap m_objectMap; + Vector m_worklist; +}; + +JSValueRef ObjcContainerConvertor::convert(id object) +{ + ASSERT(object); + + auto it = m_objectMap.find(object); + if (it != m_objectMap.end()) + return it->value; + + ObjcContainerConvertor::Task task = objectToValueWithoutCopy(m_context, object); + add(task); + return task.js; +} + +void ObjcContainerConvertor::add(ObjcContainerConvertor::Task task) +{ + m_objectMap.add(task.objc, task.js); + if (task.type != ContainerNone) + m_worklist.append(task); +} + +ObjcContainerConvertor::Task ObjcContainerConvertor::take() +{ + ASSERT(!isWorkListEmpty()); + Task last = m_worklist.last(); + m_worklist.removeLast(); + return last; +} + +inline bool isNSBoolean(id object) +{ + ASSERT([@YES class] == [@NO class]); + ASSERT([@YES class] != [NSNumber class]); + ASSERT([[@YES class] isSubclassOfClass:[NSNumber class]]); + return [object isKindOfClass:[@YES class]]; +} + +static ObjcContainerConvertor::Task objectToValueWithoutCopy(JSContext *context, id object) +{ + JSGlobalContextRef contextRef = [context JSGlobalContextRef]; + + if (!object) + return (ObjcContainerConvertor::Task){ object, JSValueMakeUndefined(contextRef), ContainerNone }; + + if (!class_conformsToProtocol(object_getClass(object), getJSExportProtocol())) { + if ([object isKindOfClass:[NSArray class]]) + return (ObjcContainerConvertor::Task){ object, JSObjectMakeArray(contextRef, 0, NULL, 0), ContainerArray }; + + if ([object isKindOfClass:[NSDictionary class]]) + return (ObjcContainerConvertor::Task){ object, JSObjectMake(contextRef, 0, 0), ContainerDictionary }; + + if ([object isKindOfClass:[NSNull class]]) + return (ObjcContainerConvertor::Task){ object, JSValueMakeNull(contextRef), ContainerNone }; + + if ([object isKindOfClass:[JSValue class]]) + return (ObjcContainerConvertor::Task){ object, ((JSValue *)object)->m_value, ContainerNone }; + + if ([object isKindOfClass:[NSString class]]) { + JSStringRef string = JSStringCreateWithCFString((CFStringRef)object); + JSValueRef js = JSValueMakeString(contextRef, string); + JSStringRelease(string); + return (ObjcContainerConvertor::Task){ object, js, ContainerNone }; + } + + if ([object isKindOfClass:[NSNumber class]]) { + if (isNSBoolean(object)) + return (ObjcContainerConvertor::Task){ object, JSValueMakeBoolean(contextRef, [object boolValue]), ContainerNone }; + return (ObjcContainerConvertor::Task){ object, JSValueMakeNumber(contextRef, [object doubleValue]), ContainerNone }; + } + + if ([object isKindOfClass:[NSDate class]]) { + JSValueRef argument = JSValueMakeNumber(contextRef, [object timeIntervalSince1970]); + JSObjectRef result = JSObjectMakeDate(contextRef, 1, &argument, 0); + return (ObjcContainerConvertor::Task){ object, result, ContainerNone }; + } + + if ([object isKindOfClass:[JSManagedValue class]]) { + JSValue *value = [static_cast(object) value]; + if (!value) + return (ObjcContainerConvertor::Task) { object, JSValueMakeUndefined(contextRef), ContainerNone }; + return (ObjcContainerConvertor::Task){ object, value->m_value, ContainerNone }; + } + } + + return (ObjcContainerConvertor::Task){ object, valueInternalValue([context wrapperForObjCObject:object]), ContainerNone }; +} + +JSValueRef objectToValue(JSContext *context, id object) +{ + JSGlobalContextRef contextRef = [context JSGlobalContextRef]; + + ObjcContainerConvertor::Task task = objectToValueWithoutCopy(context, object); + if (task.type == ContainerNone) + return task.js; + + ObjcContainerConvertor convertor(context); + convertor.add(task); + ASSERT(!convertor.isWorkListEmpty()); + + do { + ObjcContainerConvertor::Task current = convertor.take(); + ASSERT(JSValueIsObject(contextRef, current.js)); + JSObjectRef js = JSValueToObject(contextRef, current.js, 0); + + if (current.type == ContainerArray) { + ASSERT([current.objc isKindOfClass:[NSArray class]]); + NSArray *array = (NSArray *)current.objc; + NSUInteger count = [array count]; + for (NSUInteger index = 0; index < count; ++index) + JSObjectSetPropertyAtIndex(contextRef, js, index, convertor.convert([array objectAtIndex:index]), 0); + } else { + ASSERT(current.type == ContainerDictionary); + ASSERT([current.objc isKindOfClass:[NSDictionary class]]); + NSDictionary *dictionary = (NSDictionary *)current.objc; + for (id key in [dictionary keyEnumerator]) { + if ([key isKindOfClass:[NSString class]]) { + JSStringRef propertyName = JSStringCreateWithCFString((CFStringRef)key); + JSObjectSetProperty(contextRef, js, propertyName, convertor.convert([dictionary objectForKey:key]), 0, 0); + JSStringRelease(propertyName); + } + } + } + + } while (!convertor.isWorkListEmpty()); + + return task.js; +} + +JSValueRef valueInternalValue(JSValue * value) +{ + return value->m_value; +} + ++ (JSValue *)valueWithJSValueRef:(JSValueRef)value inContext:(JSContext *)context +{ + return [context wrapperForJSObject:value]; +} + +- (JSValue *)init +{ + return nil; +} + +- (JSValue *)initWithValue:(JSValueRef)value inContext:(JSContext *)context +{ + if (!value || !context) + return nil; + + self = [super init]; + if (!self) + return nil; + + _context = [context retain]; + m_value = value; + JSValueProtect([_context JSGlobalContextRef], m_value); + return self; +} + +struct StructTagHandler { + SEL typeToValueSEL; + SEL valueToTypeSEL; +}; +typedef HashMap StructHandlers; + +static StructHandlers* createStructHandlerMap() +{ + StructHandlers* structHandlers = new StructHandlers(); + + size_t valueWithXinContextLength = strlen("valueWithX:inContext:"); + size_t toXLength = strlen("toX"); + + // Step 1: find all valueWith:inContext: class methods in JSValue. + forEachMethodInClass(object_getClass([JSValue class]), ^(Method method){ + SEL selector = method_getName(method); + const char* name = sel_getName(selector); + size_t nameLength = strlen(name); + // Check for valueWith:context: + if (nameLength < valueWithXinContextLength || memcmp(name, "valueWith", 9) || memcmp(name + nameLength - 11, ":inContext:", 11)) + return; + // Check for [ id, SEL, , ] + if (method_getNumberOfArguments(method) != 4) + return; + char idType[3]; + // Check 2nd argument type is "@" + char* secondType = method_copyArgumentType(method, 3); + if (strcmp(secondType, "@") != 0) { + free(secondType); + return; + } + free(secondType); + // Check result type is also "@" + method_getReturnType(method, idType, 3); + if (strcmp(idType, "@") != 0) + return; + char* type = method_copyArgumentType(method, 2); + structHandlers->add(StringImpl::create(type), (StructTagHandler){ selector, 0 }); + free(type); + }); + + // Step 2: find all to instance methods in JSValue. + forEachMethodInClass([JSValue class], ^(Method method){ + SEL selector = method_getName(method); + const char* name = sel_getName(selector); + size_t nameLength = strlen(name); + // Check for to + if (nameLength < toXLength || memcmp(name, "to", 2)) + return; + // Check for [ id, SEL ] + if (method_getNumberOfArguments(method) != 2) + return; + // Try to find a matching valueWith:context: method. + char* type = method_copyReturnType(method); + + StructHandlers::iterator iter = structHandlers->find(type); + free(type); + if (iter == structHandlers->end()) + return; + StructTagHandler& handler = iter->value; + + // check that strlen() == strlen() + const char* valueWithName = sel_getName(handler.typeToValueSEL); + size_t valueWithLength = strlen(valueWithName); + if (valueWithLength - valueWithXinContextLength != nameLength - toXLength) + return; + // Check that == + if (memcmp(valueWithName + 9, name + 2, nameLength - toXLength - 1)) + return; + handler.valueToTypeSEL = selector; + }); + + // Step 3: clean up - remove entries where we found prospective valueWith:inContext: conversions, but no matching to methods. + typedef HashSet RemoveSet; + RemoveSet removeSet; + for (StructHandlers::iterator iter = structHandlers->begin(); iter != structHandlers->end(); ++iter) { + StructTagHandler& handler = iter->value; + if (!handler.valueToTypeSEL) + removeSet.add(iter->key); + } + + for (RemoveSet::iterator iter = removeSet.begin(); iter != removeSet.end(); ++iter) + structHandlers->remove(*iter); + + return structHandlers; +} + +static StructTagHandler* handerForStructTag(const char* encodedType) +{ + static SpinLock handerForStructTagLock = SPINLOCK_INITIALIZER; + SpinLockHolder lockHolder(&handerForStructTagLock); + + static StructHandlers* structHandlers = createStructHandlerMap(); + + StructHandlers::iterator iter = structHandlers->find(encodedType); + if (iter == structHandlers->end()) + return 0; + return &iter->value; +} + ++ (SEL)selectorForStructToValue:(const char *)structTag +{ + StructTagHandler* handler = handerForStructTag(structTag); + return handler ? handler->typeToValueSEL : nil; +} + ++ (SEL)selectorForValueToStruct:(const char *)structTag +{ + StructTagHandler* handler = handerForStructTag(structTag); + return handler ? handler->valueToTypeSEL : nil; +} + +- (void)dealloc +{ + JSValueUnprotect([_context JSGlobalContextRef], m_value); + [_context release]; + _context = nil; + [super dealloc]; +} + +- (NSString *)description +{ + if (id wrapped = tryUnwrapObjcObject([_context JSGlobalContextRef], m_value)) + return [wrapped description]; + return [self toString]; +} + +NSInvocation *typeToValueInvocationFor(const char* encodedType) +{ + SEL selector = [JSValue selectorForStructToValue:encodedType]; + if (!selector) + return 0; + + const char* methodTypes = method_getTypeEncoding(class_getClassMethod([JSValue class], selector)); + NSInvocation *invocation = [NSInvocation invocationWithMethodSignature:[NSMethodSignature signatureWithObjCTypes:methodTypes]]; + [invocation setSelector:selector]; + return invocation; +} + +NSInvocation *valueToTypeInvocationFor(const char* encodedType) +{ + SEL selector = [JSValue selectorForValueToStruct:encodedType]; + if (!selector) + return 0; + + const char* methodTypes = method_getTypeEncoding(class_getInstanceMethod([JSValue class], selector)); + NSInvocation *invocation = [NSInvocation invocationWithMethodSignature:[NSMethodSignature signatureWithObjCTypes:methodTypes]]; + [invocation setSelector:selector]; + return invocation; +} + +@end + +#endif diff --git a/JavaScriptCore/API/JSValueInternal.h b/JavaScriptCore/API/JSValueInternal.h new file mode 100644 index 00000000..4f1a8f69 --- /dev/null +++ b/JavaScriptCore/API/JSValueInternal.h @@ -0,0 +1,58 @@ +/* + * Copyright (C) 2013 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. + */ + +#ifndef JSValueInternal_h +#define JSValueInternal_h + +#import +#import + +#if JSC_OBJC_API_ENABLED + +@interface JSValue(Internal) + +JSValueRef valueInternalValue(JSValue *); + +- (JSValue *)initWithValue:(JSValueRef)value inContext:(JSContext *)context; + +JSValueRef objectToValue(JSContext *, id); +id valueToObject(JSContext *, JSValueRef); +id valueToNumber(JSGlobalContextRef, JSValueRef, JSValueRef* exception); +id valueToString(JSGlobalContextRef, JSValueRef, JSValueRef* exception); +id valueToDate(JSGlobalContextRef, JSValueRef, JSValueRef* exception); +id valueToArray(JSGlobalContextRef, JSValueRef, JSValueRef* exception); +id valueToDictionary(JSGlobalContextRef, JSValueRef, JSValueRef* exception); + ++ (SEL)selectorForStructToValue:(const char *)structTag; ++ (SEL)selectorForValueToStruct:(const char *)structTag; + +@end + +NSInvocation *typeToValueInvocationFor(const char* encodedType); +NSInvocation *valueToTypeInvocationFor(const char* encodedType); + +#endif + +#endif // JSValueInternal_h diff --git a/JavaScriptCore/API/JSValueRef.cpp b/JavaScriptCore/API/JSValueRef.cpp index 9b7268a2..eb99f5dd 100644 --- a/JavaScriptCore/API/JSValueRef.cpp +++ b/JavaScriptCore/API/JSValueRef.cpp @@ -28,26 +28,45 @@ #include "APICast.h" #include "APIShims.h" +#include "JSAPIWrapperObject.h" +#include "JSCJSValue.h" #include "JSCallbackObject.h" - -#include -#include -#include -#include -#include -#include -#include -#include +#include "JSGlobalObject.h" +#include "JSONObject.h" +#include "JSString.h" +#include "LiteralParser.h" +#include "Operations.h" +#include "Protect.h" #include #include +#include #include // for std::min +#if PLATFORM(MAC) +#include +#endif + using namespace JSC; +#if PLATFORM(MAC) +static bool evernoteHackNeeded() +{ + static const int32_t webkitLastVersionWithEvernoteHack = 35133959; + static bool hackNeeded = CFEqual(CFBundleGetIdentifier(CFBundleGetMainBundle()), CFSTR("com.evernote.Evernote")) + && NSVersionOfLinkTimeLibrary("JavaScriptCore") <= webkitLastVersionWithEvernoteHack; + + return hackNeeded; +} +#endif + ::JSType JSValueGetType(JSContextRef ctx, JSValueRef value) { + if (!ctx) { + ASSERT_NOT_REACHED(); + return kJSTypeUndefined; + } ExecState* exec = toJS(ctx); APIEntryShim entryShim(exec); @@ -69,6 +88,10 @@ ::JSType JSValueGetType(JSContextRef ctx, JSValueRef value) bool JSValueIsUndefined(JSContextRef ctx, JSValueRef value) { + if (!ctx) { + ASSERT_NOT_REACHED(); + return false; + } ExecState* exec = toJS(ctx); APIEntryShim entryShim(exec); @@ -78,6 +101,10 @@ bool JSValueIsUndefined(JSContextRef ctx, JSValueRef value) bool JSValueIsNull(JSContextRef ctx, JSValueRef value) { + if (!ctx) { + ASSERT_NOT_REACHED(); + return false; + } ExecState* exec = toJS(ctx); APIEntryShim entryShim(exec); @@ -87,6 +114,10 @@ bool JSValueIsNull(JSContextRef ctx, JSValueRef value) bool JSValueIsBoolean(JSContextRef ctx, JSValueRef value) { + if (!ctx) { + ASSERT_NOT_REACHED(); + return false; + } ExecState* exec = toJS(ctx); APIEntryShim entryShim(exec); @@ -96,6 +127,10 @@ bool JSValueIsBoolean(JSContextRef ctx, JSValueRef value) bool JSValueIsNumber(JSContextRef ctx, JSValueRef value) { + if (!ctx) { + ASSERT_NOT_REACHED(); + return false; + } ExecState* exec = toJS(ctx); APIEntryShim entryShim(exec); @@ -105,6 +140,10 @@ bool JSValueIsNumber(JSContextRef ctx, JSValueRef value) bool JSValueIsString(JSContextRef ctx, JSValueRef value) { + if (!ctx) { + ASSERT_NOT_REACHED(); + return false; + } ExecState* exec = toJS(ctx); APIEntryShim entryShim(exec); @@ -114,6 +153,10 @@ bool JSValueIsString(JSContextRef ctx, JSValueRef value) bool JSValueIsObject(JSContextRef ctx, JSValueRef value) { + if (!ctx) { + ASSERT_NOT_REACHED(); + return false; + } ExecState* exec = toJS(ctx); APIEntryShim entryShim(exec); @@ -123,22 +166,34 @@ bool JSValueIsObject(JSContextRef ctx, JSValueRef value) bool JSValueIsObjectOfClass(JSContextRef ctx, JSValueRef value, JSClassRef jsClass) { + if (!ctx || !jsClass) { + ASSERT_NOT_REACHED(); + return false; + } ExecState* exec = toJS(ctx); APIEntryShim entryShim(exec); JSValue jsValue = toJS(exec, value); if (JSObject* o = jsValue.getObject()) { - if (o->inherits(&JSCallbackObject::s_info)) + if (o->inherits(JSCallbackObject::info())) return jsCast*>(o)->inherits(jsClass); - if (o->inherits(&JSCallbackObject::s_info)) - return jsCast*>(o)->inherits(jsClass); + if (o->inherits(JSCallbackObject::info())) + return jsCast*>(o)->inherits(jsClass); +#if JSC_OBJC_API_ENABLED + if (o->inherits(JSCallbackObject::info())) + return jsCast*>(o)->inherits(jsClass); +#endif } return false; } bool JSValueIsEqual(JSContextRef ctx, JSValueRef a, JSValueRef b, JSValueRef* exception) { + if (!ctx) { + ASSERT_NOT_REACHED(); + return false; + } ExecState* exec = toJS(ctx); APIEntryShim entryShim(exec); @@ -156,6 +211,10 @@ bool JSValueIsEqual(JSContextRef ctx, JSValueRef a, JSValueRef b, JSValueRef* ex bool JSValueIsStrictEqual(JSContextRef ctx, JSValueRef a, JSValueRef b) { + if (!ctx) { + ASSERT_NOT_REACHED(); + return false; + } ExecState* exec = toJS(ctx); APIEntryShim entryShim(exec); @@ -167,6 +226,10 @@ bool JSValueIsStrictEqual(JSContextRef ctx, JSValueRef a, JSValueRef b) bool JSValueIsInstanceOfConstructor(JSContextRef ctx, JSValueRef value, JSObjectRef constructor, JSValueRef* exception) { + if (!ctx) { + ASSERT_NOT_REACHED(); + return false; + } ExecState* exec = toJS(ctx); APIEntryShim entryShim(exec); @@ -175,7 +238,7 @@ bool JSValueIsInstanceOfConstructor(JSContextRef ctx, JSValueRef value, JSObject JSObject* jsConstructor = toJS(constructor); if (!jsConstructor->structure()->typeInfo().implementsHasInstance()) return false; - bool result = jsConstructor->methodTable()->hasInstance(jsConstructor, exec, jsValue, jsConstructor->get(exec, exec->propertyNames().prototype)); // false if an exception is thrown + bool result = jsConstructor->hasInstance(exec, jsValue); // false if an exception is thrown if (exec->hadException()) { if (exception) *exception = toRef(exec, exec->exception()); @@ -186,6 +249,10 @@ bool JSValueIsInstanceOfConstructor(JSContextRef ctx, JSValueRef value, JSObject JSValueRef JSValueMakeUndefined(JSContextRef ctx) { + if (!ctx) { + ASSERT_NOT_REACHED(); + return 0; + } ExecState* exec = toJS(ctx); APIEntryShim entryShim(exec); @@ -194,6 +261,10 @@ JSValueRef JSValueMakeUndefined(JSContextRef ctx) JSValueRef JSValueMakeNull(JSContextRef ctx) { + if (!ctx) { + ASSERT_NOT_REACHED(); + return 0; + } ExecState* exec = toJS(ctx); APIEntryShim entryShim(exec); @@ -202,6 +273,10 @@ JSValueRef JSValueMakeNull(JSContextRef ctx) JSValueRef JSValueMakeBoolean(JSContextRef ctx, bool value) { + if (!ctx) { + ASSERT_NOT_REACHED(); + return 0; + } ExecState* exec = toJS(ctx); APIEntryShim entryShim(exec); @@ -210,45 +285,62 @@ JSValueRef JSValueMakeBoolean(JSContextRef ctx, bool value) JSValueRef JSValueMakeNumber(JSContextRef ctx, double value) { + if (!ctx) { + ASSERT_NOT_REACHED(); + return 0; + } ExecState* exec = toJS(ctx); APIEntryShim entryShim(exec); // Our JSValue representation relies on a standard bit pattern for NaN. NaNs // generated internally to JavaScriptCore naturally have that representation, // but an external NaN might not. - if (isnan(value)) - value = std::numeric_limits::quiet_NaN(); + if (std::isnan(value)) + value = QNaN; return toRef(exec, jsNumber(value)); } JSValueRef JSValueMakeString(JSContextRef ctx, JSStringRef string) { + if (!ctx) { + ASSERT_NOT_REACHED(); + return 0; + } ExecState* exec = toJS(ctx); APIEntryShim entryShim(exec); - return toRef(exec, jsString(exec, string->ustring())); + return toRef(exec, jsString(exec, string->string())); } JSValueRef JSValueMakeFromJSONString(JSContextRef ctx, JSStringRef string) { + if (!ctx) { + ASSERT_NOT_REACHED(); + return 0; + } ExecState* exec = toJS(ctx); APIEntryShim entryShim(exec); - UString str = string->ustring(); - if (str.is8Bit()) { - LiteralParser parser(exec, str.characters8(), str.length(), StrictJSON); + String str = string->string(); + unsigned length = str.length(); + if (length && str.is8Bit()) { + LiteralParser parser(exec, str.characters8(), length, StrictJSON); return toRef(exec, parser.tryLiteralParse()); } - LiteralParser parser(exec, str.characters16(), str.length(), StrictJSON); + LiteralParser parser(exec, str.characters(), length, StrictJSON); return toRef(exec, parser.tryLiteralParse()); } JSStringRef JSValueCreateJSONString(JSContextRef ctx, JSValueRef apiValue, unsigned indent, JSValueRef* exception) { + if (!ctx) { + ASSERT_NOT_REACHED(); + return 0; + } ExecState* exec = toJS(ctx); APIEntryShim entryShim(exec); JSValue value = toJS(exec, apiValue); - UString result = JSONStringify(exec, value, indent); + String result = JSONStringify(exec, value, indent); if (exception) *exception = 0; if (exec->hadException()) { @@ -262,6 +354,10 @@ JSStringRef JSValueCreateJSONString(JSContextRef ctx, JSValueRef apiValue, unsig bool JSValueToBoolean(JSContextRef ctx, JSValueRef value) { + if (!ctx) { + ASSERT_NOT_REACHED(); + return false; + } ExecState* exec = toJS(ctx); APIEntryShim entryShim(exec); @@ -271,6 +367,10 @@ bool JSValueToBoolean(JSContextRef ctx, JSValueRef value) double JSValueToNumber(JSContextRef ctx, JSValueRef value, JSValueRef* exception) { + if (!ctx) { + ASSERT_NOT_REACHED(); + return QNaN; + } ExecState* exec = toJS(ctx); APIEntryShim entryShim(exec); @@ -281,13 +381,17 @@ double JSValueToNumber(JSContextRef ctx, JSValueRef value, JSValueRef* exception if (exception) *exception = toRef(exec, exec->exception()); exec->clearException(); - number = std::numeric_limits::quiet_NaN(); + number = QNaN; } return number; } JSStringRef JSValueToStringCopy(JSContextRef ctx, JSValueRef value, JSValueRef* exception) { + if (!ctx) { + ASSERT_NOT_REACHED(); + return 0; + } ExecState* exec = toJS(ctx); APIEntryShim entryShim(exec); @@ -305,6 +409,10 @@ JSStringRef JSValueToStringCopy(JSContextRef ctx, JSValueRef value, JSValueRef* JSObjectRef JSValueToObject(JSContextRef ctx, JSValueRef value, JSValueRef* exception) { + if (!ctx) { + ASSERT_NOT_REACHED(); + return 0; + } ExecState* exec = toJS(ctx); APIEntryShim entryShim(exec); @@ -322,6 +430,10 @@ JSObjectRef JSValueToObject(JSContextRef ctx, JSValueRef value, JSValueRef* exce void JSValueProtect(JSContextRef ctx, JSValueRef value) { + if (!ctx) { + ASSERT_NOT_REACHED(); + return; + } ExecState* exec = toJS(ctx); APIEntryShim entryShim(exec); @@ -331,6 +443,11 @@ void JSValueProtect(JSContextRef ctx, JSValueRef value) void JSValueUnprotect(JSContextRef ctx, JSValueRef value) { +#if PLATFORM(MAC) + if ((!value || !ctx) && evernoteHackNeeded()) + return; +#endif + ExecState* exec = toJS(ctx); APIEntryShim entryShim(exec); diff --git a/JavaScriptCore/API/JSValueRef.h b/JavaScriptCore/API/JSValueRef.h index 4186db82..125e4028 100644 --- a/JavaScriptCore/API/JSValueRef.h +++ b/JavaScriptCore/API/JSValueRef.h @@ -63,7 +63,7 @@ extern "C" { @param value The JSValue whose type you want to obtain. @result A value of type JSType that identifies value's type. */ -JS_EXPORT JSType JSValueGetType(JSContextRef ctx, JSValueRef value); +JS_EXPORT JSType JSValueGetType(JSContextRef ctx, JSValueRef); /*! @function diff --git a/JavaScriptCore/API/JSVirtualMachine.h b/JavaScriptCore/API/JSVirtualMachine.h new file mode 100644 index 00000000..de3c5ea5 --- /dev/null +++ b/JavaScriptCore/API/JSVirtualMachine.h @@ -0,0 +1,62 @@ +/* + * Copyright (C) 2013 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. + */ + +#import + +#if JSC_OBJC_API_ENABLED + +// An instance of JSVirtualMachine represents a single JavaScript "object space" +// or set of execution resources. Thread safety is supported by locking the +// virtual machine, with concurrent JavaScript execution supported by allocating +// separate instances of JSVirtualMachine. + +#ifndef JSC_OBJC_API_AVAILABLE_MAC_OS_X_1080 +NS_CLASS_AVAILABLE(10_9, 7_0) +#else +OBJC_VISIBLE +#endif +@interface JSVirtualMachine : NSObject + +// Create a new JSVirtualMachine. +- (id)init; + +// addManagedReference:withOwner and removeManagedReference:withOwner allow +// clients of JSVirtualMachine to make the JavaScript runtime aware of +// arbitrary external Objective-C object graphs. The runtime can then use +// this information to retain any JavaScript values that are referenced +// from somewhere in said object graph. +// +// For correct behavior clients must make their external object graphs +// reachable from within the JavaScript runtime. If an Objective-C object is +// reachable from within the JavaScript runtime, all managed references +// transitively reachable from it as recorded with +// addManagedReference:withOwner: will be scanned by the garbage collector. +// +- (void)addManagedReference:(id)object withOwner:(id)owner; +- (void)removeManagedReference:(id)object withOwner:(id)owner; + +@end + +#endif diff --git a/JavaScriptCore/API/JSVirtualMachine.mm b/JavaScriptCore/API/JSVirtualMachine.mm new file mode 100644 index 00000000..62ec8020 --- /dev/null +++ b/JavaScriptCore/API/JSVirtualMachine.mm @@ -0,0 +1,256 @@ +/* + * Copyright (C) 2013 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" + +#import "JavaScriptCore.h" + +#if JSC_OBJC_API_ENABLED + +#import "APICast.h" +#import "APIShims.h" +#import "JSVirtualMachine.h" +#import "JSVirtualMachineInternal.h" +#import "JSWrapperMap.h" +#import "SlotVisitorInlines.h" + +static NSMapTable *globalWrapperCache = 0; + +static Mutex& wrapperCacheLock() +{ + DEFINE_STATIC_LOCAL(Mutex, mutex, ()); + return mutex; +} + +static void initWrapperCache() +{ + ASSERT(!globalWrapperCache); + NSPointerFunctionsOptions keyOptions = NSPointerFunctionsOpaqueMemory | NSPointerFunctionsOpaquePersonality; + NSPointerFunctionsOptions valueOptions = NSPointerFunctionsWeakMemory | NSPointerFunctionsObjectPersonality; + globalWrapperCache = [[NSMapTable alloc] initWithKeyOptions:keyOptions valueOptions:valueOptions capacity:0]; +} + +static NSMapTable *wrapperCache() +{ + if (!globalWrapperCache) + initWrapperCache(); + return globalWrapperCache; +} + +@interface JSVMWrapperCache : NSObject ++ (void)addWrapper:(JSVirtualMachine *)wrapper forJSContextGroupRef:(JSContextGroupRef)group; ++ (JSVirtualMachine *)wrapperForJSContextGroupRef:(JSContextGroupRef)group; +@end + +@implementation JSVMWrapperCache + ++ (void)addWrapper:(JSVirtualMachine *)wrapper forJSContextGroupRef:(JSContextGroupRef)group +{ + MutexLocker locker(wrapperCacheLock()); + NSMapInsert(wrapperCache(), group, wrapper); +} + ++ (JSVirtualMachine *)wrapperForJSContextGroupRef:(JSContextGroupRef)group +{ + MutexLocker locker(wrapperCacheLock()); + return static_cast(NSMapGet(wrapperCache(), group)); +} + +@end + +@implementation JSVirtualMachine { + JSContextGroupRef m_group; + NSMapTable *m_contextCache; + NSMapTable *m_externalObjectGraph; +} + +- (id)init +{ + JSContextGroupRef group = JSContextGroupCreate(); + self = [self initWithContextGroupRef:group]; + // The extra JSContextGroupRetain is balanced here. + JSContextGroupRelease(group); + return self; +} + +- (id)initWithContextGroupRef:(JSContextGroupRef)group +{ + self = [super init]; + if (!self) + return nil; + + m_group = JSContextGroupRetain(group); + + NSPointerFunctionsOptions keyOptions = NSPointerFunctionsOpaqueMemory | NSPointerFunctionsOpaquePersonality; + NSPointerFunctionsOptions valueOptions = NSPointerFunctionsWeakMemory | NSPointerFunctionsObjectPersonality; + m_contextCache = [[NSMapTable alloc] initWithKeyOptions:keyOptions valueOptions:valueOptions capacity:0]; + + NSPointerFunctionsOptions weakIDOptions = NSPointerFunctionsWeakMemory | NSPointerFunctionsObjectPersonality; + NSPointerFunctionsOptions strongIDOptions = NSPointerFunctionsStrongMemory | NSPointerFunctionsObjectPersonality; + m_externalObjectGraph = [[NSMapTable alloc] initWithKeyOptions:weakIDOptions valueOptions:strongIDOptions capacity:0]; + + [JSVMWrapperCache addWrapper:self forJSContextGroupRef:group]; + + return self; +} + +- (void)dealloc +{ + JSContextGroupRelease(m_group); + [m_contextCache release]; + [m_externalObjectGraph release]; + [super dealloc]; +} + +static id getInternalObjcObject(id object) +{ + if ([object isKindOfClass:[JSManagedValue class]]) { + JSValue* value = [static_cast(object) value]; + id temp = tryUnwrapObjcObject([value.context JSGlobalContextRef], [value JSValueRef]); + if (temp) + return temp; + return object; + } + + if ([object isKindOfClass:[JSValue class]]) { + JSValue *value = static_cast(object); + object = tryUnwrapObjcObject([value.context JSGlobalContextRef], [value JSValueRef]); + } + + return object; +} + +- (void)addManagedReference:(id)object withOwner:(id)owner +{ + object = getInternalObjcObject(object); + owner = getInternalObjcObject(owner); + + if (!object || !owner) + return; + + JSC::APIEntryShim shim(toJS(m_group)); + + NSMapTable *ownedObjects = [m_externalObjectGraph objectForKey:owner]; + if (!ownedObjects) { + NSPointerFunctionsOptions weakIDOptions = NSPointerFunctionsWeakMemory | NSPointerFunctionsObjectPersonality; + NSPointerFunctionsOptions integerOptions = NSPointerFunctionsOpaqueMemory | NSPointerFunctionsIntegerPersonality; + ownedObjects = [[NSMapTable alloc] initWithKeyOptions:weakIDOptions valueOptions:integerOptions capacity:1]; + + [m_externalObjectGraph setObject:ownedObjects forKey:owner]; + [ownedObjects release]; + } + NSMapInsert(ownedObjects, object, reinterpret_cast(reinterpret_cast(NSMapGet(ownedObjects, object)) + 1)); +} + +- (void)removeManagedReference:(id)object withOwner:(id)owner +{ + object = getInternalObjcObject(object); + owner = getInternalObjcObject(owner); + + if (!object || !owner) + return; + + JSC::APIEntryShim shim(toJS(m_group)); + + NSMapTable *ownedObjects = [m_externalObjectGraph objectForKey:owner]; + if (!ownedObjects) + return; + + size_t count = reinterpret_cast(NSMapGet(ownedObjects, object)); + if (count > 1) { + NSMapInsert(ownedObjects, object, reinterpret_cast(count - 1)); + return; + } + + if (count == 1) + NSMapRemove(ownedObjects, object); + + if (![ownedObjects count]) + [m_externalObjectGraph removeObjectForKey:owner]; +} + +@end + +@implementation JSVirtualMachine(Internal) + +JSContextGroupRef getGroupFromVirtualMachine(JSVirtualMachine *virtualMachine) +{ + return virtualMachine->m_group; +} + ++ (JSVirtualMachine *)virtualMachineWithContextGroupRef:(JSContextGroupRef)group +{ + JSVirtualMachine *virtualMachine = [JSVMWrapperCache wrapperForJSContextGroupRef:group]; + if (!virtualMachine) + virtualMachine = [[[JSVirtualMachine alloc] initWithContextGroupRef:group] autorelease]; + return virtualMachine; +} + +- (JSContext *)contextForGlobalContextRef:(JSGlobalContextRef)globalContext +{ + return static_cast(NSMapGet(m_contextCache, globalContext)); +} + +- (void)addContext:(JSContext *)wrapper forGlobalContextRef:(JSGlobalContextRef)globalContext +{ + NSMapInsert(m_contextCache, globalContext, wrapper); +} + +- (NSMapTable *)externalObjectGraph +{ + return m_externalObjectGraph; +} + +@end + +void scanExternalObjectGraph(JSC::VM& vm, JSC::SlotVisitor& visitor, void* root) +{ + @autoreleasepool { + JSVirtualMachine *virtualMachine = [JSVMWrapperCache wrapperForJSContextGroupRef:toRef(&vm)]; + if (!virtualMachine) + return; + NSMapTable *externalObjectGraph = [virtualMachine externalObjectGraph]; + Vector stack; + stack.append(root); + while (!stack.isEmpty()) { + void* nextRoot = stack.last(); + stack.removeLast(); + if (visitor.containsOpaqueRootTriState(nextRoot) == TrueTriState) + continue; + visitor.addOpaqueRoot(nextRoot); + + NSMapTable *ownedObjects = [externalObjectGraph objectForKey:static_cast(nextRoot)]; + id ownedObject; + NSEnumerator *enumerator = [ownedObjects keyEnumerator]; + while ((ownedObject = [enumerator nextObject])) { + ASSERT(reinterpret_cast(NSMapGet(ownedObjects, ownedObject)) == 1); + stack.append(static_cast(ownedObject)); + } + } + } +} + +#endif + diff --git a/JavaScriptCore/API/JSVirtualMachineInternal.h b/JavaScriptCore/API/JSVirtualMachineInternal.h new file mode 100644 index 00000000..72922656 --- /dev/null +++ b/JavaScriptCore/API/JSVirtualMachineInternal.h @@ -0,0 +1,57 @@ +/* + * Copyright (C) 2013 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. + */ + +#ifndef JSVirtualMachineInternal_h +#define JSVirtualMachineInternal_h + +#import + +#if JSC_OBJC_API_ENABLED + +namespace JSC { +class VM; +class SlotVisitor; +} + +#if defined(__OBJC__) +@interface JSVirtualMachine(Internal) + +JSContextGroupRef getGroupFromVirtualMachine(JSVirtualMachine *); + ++ (JSVirtualMachine *)virtualMachineWithContextGroupRef:(JSContextGroupRef)group; + +- (JSContext *)contextForGlobalContextRef:(JSGlobalContextRef)globalContext; +- (void)addContext:(JSContext *)wrapper forGlobalContextRef:(JSGlobalContextRef)globalContext; + +- (NSMapTable *)externalObjectGraph; + +@end +#endif // defined(__OBJC__) + +void scanExternalObjectGraph(JSC::VM&, JSC::SlotVisitor&, void* root); + +#endif + +#endif // JSVirtualMachineInternal_h diff --git a/JavaScriptCore/API/JSWeakObjectMapRefPrivate.cpp b/JavaScriptCore/API/JSWeakObjectMapRefPrivate.cpp index bdd56f60..6f9e457e 100644 --- a/JavaScriptCore/API/JSWeakObjectMapRefPrivate.cpp +++ b/JavaScriptCore/API/JSWeakObjectMapRefPrivate.cpp @@ -28,9 +28,11 @@ #include "APICast.h" #include "APIShims.h" +#include "JSCJSValue.h" #include "JSCallbackObject.h" -#include "JSValue.h" #include "JSWeakObjectMapRefInternal.h" +#include "Operations.h" +#include "Weak.h" #include #include @@ -52,17 +54,25 @@ JSWeakObjectMapRef JSWeakObjectMapCreate(JSContextRef context, void* privateData void JSWeakObjectMapSet(JSContextRef ctx, JSWeakObjectMapRef map, void* key, JSObjectRef object) { + if (!ctx) { + ASSERT_NOT_REACHED(); + return; + } ExecState* exec = toJS(ctx); APIEntryShim entryShim(exec); JSObject* obj = toJS(object); if (!obj) return; - ASSERT(obj->inherits(&JSCallbackObject::s_info) || obj->inherits(&JSCallbackObject::s_info)); - map->map().set(exec->globalData(), key, obj); + ASSERT(obj->inherits(JSCallbackObject::info()) || obj->inherits(JSCallbackObject::info())); + map->map().set(key, obj); } JSObjectRef JSWeakObjectMapGet(JSContextRef ctx, JSWeakObjectMapRef map, void* key) { + if (!ctx) { + ASSERT_NOT_REACHED(); + return 0; + } ExecState* exec = toJS(ctx); APIEntryShim entryShim(exec); return toRef(jsCast(map->map().get(key))); @@ -70,9 +80,13 @@ JSObjectRef JSWeakObjectMapGet(JSContextRef ctx, JSWeakObjectMapRef map, void* k void JSWeakObjectMapRemove(JSContextRef ctx, JSWeakObjectMapRef map, void* key) { + if (!ctx) { + ASSERT_NOT_REACHED(); + return; + } ExecState* exec = toJS(ctx); APIEntryShim entryShim(exec); - map->map().take(key); + map->map().remove(key); } // We need to keep this function in the build to keep the nightlies running. diff --git a/JavaScriptCore/API/JSWrapperMap.h b/JavaScriptCore/API/JSWrapperMap.h new file mode 100644 index 00000000..ce74a9c6 --- /dev/null +++ b/JavaScriptCore/API/JSWrapperMap.h @@ -0,0 +1,47 @@ +/* + * Copyright (C) 2013 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. + */ + +#import +#import +#import + +#if JSC_OBJC_API_ENABLED + +@interface JSWrapperMap : NSObject + +- (id)initWithContext:(JSContext *)context; + +- (JSValue *)jsWrapperForObject:(id)object; + +- (JSValue *)objcWrapperForJSValueRef:(JSValueRef)value; + +@end + +id tryUnwrapObjcObject(JSGlobalContextRef, JSValueRef); + +Protocol *getJSExportProtocol(); +Class getNSBlockClass(); + +#endif diff --git a/JavaScriptCore/API/JSWrapperMap.mm b/JavaScriptCore/API/JSWrapperMap.mm new file mode 100644 index 00000000..c1df234a --- /dev/null +++ b/JavaScriptCore/API/JSWrapperMap.mm @@ -0,0 +1,597 @@ +/* + * Copyright (C) 2013 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" +#import "JavaScriptCore.h" + +#if JSC_OBJC_API_ENABLED + +#import "APICast.h" +#import "APIShims.h" +#import "JSAPIWrapperObject.h" +#import "JSCallbackObject.h" +#import "JSContextInternal.h" +#import "JSWrapperMap.h" +#import "ObjCCallbackFunction.h" +#import "ObjcRuntimeExtras.h" +#import "Operations.h" +#import "WeakGCMap.h" +#import +#import +#import + +#if OS(DARWIN) +#include + +static const int32_t webkitFirstVersionWithInitConstructorSupport = 0x21A0400; // 538.4.0 +#endif + +@class JSObjCClassInfo; + +@interface JSWrapperMap () + +- (JSObjCClassInfo*)classInfoForClass:(Class)cls; + +@end + +// Default conversion of selectors to property names. +// All semicolons are removed, lowercase letters following a semicolon are capitalized. +static NSString *selectorToPropertyName(const char* start) +{ + // Use 'index' to check for colons, if there are none, this is easy! + const char* firstColon = index(start, ':'); + if (!firstColon) + return [NSString stringWithUTF8String:start]; + + // 'header' is the length of string up to the first colon. + size_t header = firstColon - start; + // The new string needs to be long enough to hold 'header', plus the remainder of the string, excluding + // at least one ':', but including a '\0'. (This is conservative if there are more than one ':'). + char* buffer = static_cast(malloc(header + strlen(firstColon + 1) + 1)); + // Copy 'header' characters, set output to point to the end of this & input to point past the first ':'. + memcpy(buffer, start, header); + char* output = buffer + header; + const char* input = start + header + 1; + + // On entry to the loop, we have already skipped over a ':' from the input. + while (true) { + char c; + // Skip over any additional ':'s. We'll leave c holding the next character after the + // last ':', and input pointing past c. + while ((c = *(input++)) == ':'); + // Copy the character, converting to upper case if necessary. + // If the character we copy is '\0', then we're done! + if (!(*(output++) = toupper(c))) + goto done; + // Loop over characters other than ':'. + while ((c = *(input++)) != ':') { + // Copy the character. + // If the character we copy is '\0', then we're done! + if (!(*(output++) = c)) + goto done; + } + // If we get here, we've consumed a ':' - wash, rinse, repeat. + } +done: + NSString *result = [NSString stringWithUTF8String:buffer]; + free(buffer); + return result; +} + +static JSObjectRef makeWrapper(JSContextRef ctx, JSClassRef jsClass, id wrappedObject) +{ + JSC::ExecState* exec = toJS(ctx); + JSC::APIEntryShim entryShim(exec); + + ASSERT(jsClass); + JSC::JSCallbackObject* object = JSC::JSCallbackObject::create(exec, exec->lexicalGlobalObject(), exec->lexicalGlobalObject()->objcWrapperObjectStructure(), jsClass, 0); + object->setWrappedObject(wrappedObject); + if (JSC::JSObject* prototype = jsClass->prototype(exec)) + object->setPrototype(exec->vm(), prototype); + + return toRef(object); +} + +// Make an object that is in all ways a completely vanilla JavaScript object, +// other than that it has a native brand set that will be displayed by the default +// Object.prototype.toString conversion. +static JSValue *objectWithCustomBrand(JSContext *context, NSString *brand, Class cls = 0) +{ + JSClassDefinition definition; + definition = kJSClassDefinitionEmpty; + definition.className = [brand UTF8String]; + JSClassRef classRef = JSClassCreate(&definition); + JSObjectRef result = makeWrapper([context JSGlobalContextRef], classRef, cls); + JSClassRelease(classRef); + return [JSValue valueWithJSValueRef:result inContext:context]; +} + +// Look for @optional properties in the prototype containing a selector to property +// name mapping, separated by a __JS_EXPORT_AS__ delimiter. +static NSMutableDictionary *createRenameMap(Protocol *protocol, BOOL isInstanceMethod) +{ + NSMutableDictionary *renameMap = [[NSMutableDictionary alloc] init]; + + forEachMethodInProtocol(protocol, NO, isInstanceMethod, ^(SEL sel, const char*){ + NSString *rename = @(sel_getName(sel)); + NSRange range = [rename rangeOfString:@"__JS_EXPORT_AS__"]; + if (range.location == NSNotFound) + return; + NSString *selector = [rename substringToIndex:range.location]; + NSUInteger begin = range.location + range.length; + NSUInteger length = [rename length] - begin - 1; + NSString *name = [rename substringWithRange:(NSRange){ begin, length }]; + renameMap[selector] = name; + }); + + return renameMap; +} + +inline void putNonEnumerable(JSValue *base, NSString *propertyName, JSValue *value) +{ + [base defineProperty:propertyName descriptor:@{ + JSPropertyDescriptorValueKey: value, + JSPropertyDescriptorWritableKey: @YES, + JSPropertyDescriptorEnumerableKey: @NO, + JSPropertyDescriptorConfigurableKey: @YES + }]; +} + +// This method will iterate over the set of required methods in the protocol, and: +// * Determine a property name (either via a renameMap or default conversion). +// * If an accessorMap is provided, and contains this name, store the method in the map. +// * Otherwise, if the object doesn't already contain a property with name, create it. +static void copyMethodsToObject(JSContext *context, Class objcClass, Protocol *protocol, BOOL isInstanceMethod, JSValue *object, NSMutableDictionary *accessorMethods = nil) +{ + NSMutableDictionary *renameMap = createRenameMap(protocol, isInstanceMethod); + + forEachMethodInProtocol(protocol, YES, isInstanceMethod, ^(SEL sel, const char* types){ + const char* nameCStr = sel_getName(sel); + NSString *name = @(nameCStr); + // Don't copy over init family methods because we handle those specially + // for the purposes of hooking up the constructor correctly. + if ([name hasPrefix:@"init"]) + return; + + if (accessorMethods && accessorMethods[name]) { + JSObjectRef method = objCCallbackFunctionForMethod(context, objcClass, protocol, isInstanceMethod, sel, types); + if (!method) + return; + accessorMethods[name] = [JSValue valueWithJSValueRef:method inContext:context]; + } else { + name = renameMap[name]; + if (!name) + name = selectorToPropertyName(nameCStr); + if ([object hasProperty:name]) + return; + JSObjectRef method = objCCallbackFunctionForMethod(context, objcClass, protocol, isInstanceMethod, sel, types); + if (method) + putNonEnumerable(object, name, [JSValue valueWithJSValueRef:method inContext:context]); + } + }); + + [renameMap release]; +} + +static bool parsePropertyAttributes(objc_property_t property, char*& getterName, char*& setterName) +{ + bool readonly = false; + unsigned attributeCount; + objc_property_attribute_t* attributes = property_copyAttributeList(property, &attributeCount); + if (attributeCount) { + for (unsigned i = 0; i < attributeCount; ++i) { + switch (*(attributes[i].name)) { + case 'G': + getterName = strdup(attributes[i].value); + break; + case 'S': + setterName = strdup(attributes[i].value); + break; + case 'R': + readonly = true; + break; + default: + break; + } + } + free(attributes); + } + return readonly; +} + +static char* makeSetterName(const char* name) +{ + size_t nameLength = strlen(name); + char* setterName = (char*)malloc(nameLength + 5); // "set" Name ":\0" + setterName[0] = 's'; + setterName[1] = 'e'; + setterName[2] = 't'; + setterName[3] = toupper(*name); + memcpy(setterName + 4, name + 1, nameLength - 1); + setterName[nameLength + 3] = ':'; + setterName[nameLength + 4] = '\0'; + return setterName; +} + +static void copyPrototypeProperties(JSContext *context, Class objcClass, Protocol *protocol, JSValue *prototypeValue) +{ + // First gather propreties into this list, then handle the methods (capturing the accessor methods). + struct Property { + const char* name; + char* getterName; + char* setterName; + }; + __block Vector propertyList; + + // Map recording the methods used as getters/setters. + NSMutableDictionary *accessorMethods = [NSMutableDictionary dictionary]; + + // Useful value. + JSValue *undefined = [JSValue valueWithUndefinedInContext:context]; + + forEachPropertyInProtocol(protocol, ^(objc_property_t property){ + char* getterName = 0; + char* setterName = 0; + bool readonly = parsePropertyAttributes(property, getterName, setterName); + const char* name = property_getName(property); + + // Add the names of the getter & setter methods to + if (!getterName) + getterName = strdup(name); + accessorMethods[@(getterName)] = undefined; + if (!readonly) { + if (!setterName) + setterName = makeSetterName(name); + accessorMethods[@(setterName)] = undefined; + } + + // Add the properties to a list. + propertyList.append((Property){ name, getterName, setterName }); + }); + + // Copy methods to the prototype, capturing accessors in the accessorMethods map. + copyMethodsToObject(context, objcClass, protocol, YES, prototypeValue, accessorMethods); + + // Iterate the propertyList & generate accessor properties. + for (size_t i = 0; i < propertyList.size(); ++i) { + Property& property = propertyList[i]; + + JSValue *getter = accessorMethods[@(property.getterName)]; + free(property.getterName); + ASSERT(![getter isUndefined]); + + JSValue *setter = undefined; + if (property.setterName) { + setter = accessorMethods[@(property.setterName)]; + free(property.setterName); + ASSERT(![setter isUndefined]); + } + + [prototypeValue defineProperty:@(property.name) descriptor:@{ + JSPropertyDescriptorGetKey: getter, + JSPropertyDescriptorSetKey: setter, + JSPropertyDescriptorEnumerableKey: @NO, + JSPropertyDescriptorConfigurableKey: @YES + }]; + } +} + +@interface JSObjCClassInfo : NSObject { + JSContext *m_context; + Class m_class; + bool m_block; + JSClassRef m_classRef; + JSC::Weak m_prototype; + JSC::Weak m_constructor; +} + +- (id)initWithContext:(JSContext *)context forClass:(Class)cls superClassInfo:(JSObjCClassInfo*)superClassInfo; +- (JSValue *)wrapperForObject:(id)object; +- (JSValue *)constructor; + +@end + +@implementation JSObjCClassInfo + +- (id)initWithContext:(JSContext *)context forClass:(Class)cls superClassInfo:(JSObjCClassInfo*)superClassInfo +{ + self = [super init]; + if (!self) + return nil; + + const char* className = class_getName(cls); + m_context = context; + m_class = cls; + m_block = [cls isSubclassOfClass:getNSBlockClass()]; + JSClassDefinition definition; + definition = kJSClassDefinitionEmpty; + definition.className = className; + m_classRef = JSClassCreate(&definition); + + [self allocateConstructorAndPrototypeWithSuperClassInfo:superClassInfo]; + + return self; +} + +- (void)dealloc +{ + JSClassRelease(m_classRef); + [super dealloc]; +} + +static JSValue *allocateConstructorForCustomClass(JSContext *context, const char* className, Class cls) +{ +#if OS(DARWIN) + if (NSVersionOfLinkTimeLibrary("JavaScriptCore") < webkitFirstVersionWithInitConstructorSupport) + return objectWithCustomBrand(context, [NSString stringWithFormat:@"%sConstructor", className], cls); +#endif + // For each protocol that the class implements, gather all of the init family methods into a hash table. + __block HashMap initTable; + Protocol *exportProtocol = getJSExportProtocol(); + for (Class currentClass = cls; currentClass; currentClass = class_getSuperclass(currentClass)) { + forEachProtocolImplementingProtocol(currentClass, exportProtocol, ^(Protocol *protocol) { + forEachMethodInProtocol(protocol, YES, YES, ^(SEL selector, const char*) { + const char* name = sel_getName(selector); + if (![@(name) hasPrefix:@"init"]) + return; + initTable.set(name, protocol); + }); + }); + } + + for (Class currentClass = cls; currentClass; currentClass = class_getSuperclass(currentClass)) { + __block unsigned numberOfInitsFound = 0; + __block SEL initMethod = 0; + __block Protocol *initProtocol = 0; + __block const char* types = 0; + forEachMethodInClass(currentClass, ^(Method method) { + SEL selector = method_getName(method); + const char* name = sel_getName(selector); + auto iter = initTable.find(name); + + if (iter == initTable.end()) + return; + + numberOfInitsFound++; + initMethod = selector; + initProtocol = iter->value; + types = method_getTypeEncoding(method); + }); + + if (!numberOfInitsFound) + continue; + + if (numberOfInitsFound > 1) { + NSLog(@"ERROR: Class %@ exported more than one init family method via JSExport. Class %@ will not have a callable JavaScript constructor function.", cls, cls); + break; + } + + JSObjectRef method = objCCallbackFunctionForInit(context, cls, initProtocol, initMethod, types); + return [JSValue valueWithJSValueRef:method inContext:context]; + } + return objectWithCustomBrand(context, [NSString stringWithFormat:@"%sConstructor", className], cls); +} + +- (void)allocateConstructorAndPrototypeWithSuperClassInfo:(JSObjCClassInfo*)superClassInfo +{ + ASSERT(!m_constructor || !m_prototype); + ASSERT((m_class == [NSObject class]) == !superClassInfo); + if (!superClassInfo) { + JSContextRef cContext = [m_context JSGlobalContextRef]; + JSValue *constructor = m_context[@"Object"]; + if (!m_constructor) + m_constructor = toJS(JSValueToObject(cContext, valueInternalValue(constructor), 0)); + + if (!m_prototype) { + JSValue *prototype = constructor[@"prototype"]; + m_prototype = toJS(JSValueToObject(cContext, valueInternalValue(prototype), 0)); + } + } else { + const char* className = class_getName(m_class); + + // Create or grab the prototype/constructor pair. + JSValue *prototype; + JSValue *constructor; + if (m_prototype) + prototype = [JSValue valueWithJSValueRef:toRef(m_prototype.get()) inContext:m_context]; + else + prototype = objectWithCustomBrand(m_context, [NSString stringWithFormat:@"%sPrototype", className]); + + if (m_constructor) + constructor = [JSValue valueWithJSValueRef:toRef(m_constructor.get()) inContext:m_context]; + else + constructor = allocateConstructorForCustomClass(m_context, className, m_class); + + JSContextRef cContext = [m_context JSGlobalContextRef]; + m_prototype = toJS(JSValueToObject(cContext, valueInternalValue(prototype), 0)); + m_constructor = toJS(JSValueToObject(cContext, valueInternalValue(constructor), 0)); + + putNonEnumerable(prototype, @"constructor", constructor); + putNonEnumerable(constructor, @"prototype", prototype); + + Protocol *exportProtocol = getJSExportProtocol(); + forEachProtocolImplementingProtocol(m_class, exportProtocol, ^(Protocol *protocol){ + copyPrototypeProperties(m_context, m_class, protocol, prototype); + copyMethodsToObject(m_context, m_class, protocol, NO, constructor); + }); + + // Set [Prototype]. + JSObjectSetPrototype([m_context JSGlobalContextRef], toRef(m_prototype.get()), toRef(superClassInfo->m_prototype.get())); + } +} + +- (void)reallocateConstructorAndOrPrototype +{ + [self allocateConstructorAndPrototypeWithSuperClassInfo:[m_context.wrapperMap classInfoForClass:class_getSuperclass(m_class)]]; +} + +- (JSValue *)wrapperForObject:(id)object +{ + ASSERT([object isKindOfClass:m_class]); + ASSERT(m_block == [object isKindOfClass:getNSBlockClass()]); + if (m_block) { + if (JSObjectRef method = objCCallbackFunctionForBlock(m_context, object)) { + JSValue *constructor = [JSValue valueWithJSValueRef:method inContext:m_context]; + JSValue *prototype = [JSValue valueWithNewObjectInContext:m_context]; + putNonEnumerable(constructor, @"prototype", prototype); + putNonEnumerable(prototype, @"constructor", constructor); + return constructor; + } + } + + if (!m_prototype) + [self reallocateConstructorAndOrPrototype]; + ASSERT(!!m_prototype); + + JSObjectRef wrapper = makeWrapper([m_context JSGlobalContextRef], m_classRef, object); + JSObjectSetPrototype([m_context JSGlobalContextRef], wrapper, toRef(m_prototype.get())); + return [JSValue valueWithJSValueRef:wrapper inContext:m_context]; +} + +- (JSValue *)constructor +{ + if (!m_constructor) + [self reallocateConstructorAndOrPrototype]; + ASSERT(!!m_constructor); + return [JSValue valueWithJSValueRef:toRef(m_constructor.get()) inContext:m_context]; +} + +@end + +@implementation JSWrapperMap { + JSContext *m_context; + NSMutableDictionary *m_classMap; + JSC::WeakGCMap m_cachedJSWrappers; + NSMapTable *m_cachedObjCWrappers; +} + +- (id)initWithContext:(JSContext *)context +{ + self = [super init]; + if (!self) + return nil; + + NSPointerFunctionsOptions keyOptions = NSPointerFunctionsOpaqueMemory | NSPointerFunctionsOpaquePersonality; + NSPointerFunctionsOptions valueOptions = NSPointerFunctionsWeakMemory | NSPointerFunctionsObjectPersonality; + m_cachedObjCWrappers = [[NSMapTable alloc] initWithKeyOptions:keyOptions valueOptions:valueOptions capacity:0]; + + m_context = context; + m_classMap = [[NSMutableDictionary alloc] init]; + return self; +} + +- (void)dealloc +{ + [m_cachedObjCWrappers release]; + [m_classMap release]; + [super dealloc]; +} + +- (JSObjCClassInfo*)classInfoForClass:(Class)cls +{ + if (!cls) + return nil; + + // Check if we've already created a JSObjCClassInfo for this Class. + if (JSObjCClassInfo* classInfo = (JSObjCClassInfo*)m_classMap[cls]) + return classInfo; + + // Skip internal classes beginning with '_' - just copy link to the parent class's info. + if ('_' == *class_getName(cls)) + return m_classMap[cls] = [self classInfoForClass:class_getSuperclass(cls)]; + + return m_classMap[cls] = [[[JSObjCClassInfo alloc] initWithContext:m_context forClass:cls superClassInfo:[self classInfoForClass:class_getSuperclass(cls)]] autorelease]; +} + +- (JSValue *)jsWrapperForObject:(id)object +{ + JSC::JSObject* jsWrapper = m_cachedJSWrappers.get(object); + if (jsWrapper) + return [JSValue valueWithJSValueRef:toRef(jsWrapper) inContext:m_context]; + + JSValue *wrapper; + if (class_isMetaClass(object_getClass(object))) + wrapper = [[self classInfoForClass:(Class)object] constructor]; + else { + JSObjCClassInfo* classInfo = [self classInfoForClass:[object class]]; + wrapper = [classInfo wrapperForObject:object]; + } + + // FIXME: https://bugs.webkit.org/show_bug.cgi?id=105891 + // This general approach to wrapper caching is pretty effective, but there are a couple of problems: + // (1) For immortal objects JSValues will effectively leak and this results in error output being logged - we should avoid adding associated objects to immortal objects. + // (2) A long lived object may rack up many JSValues. When the contexts are released these will unprotect the associated JavaScript objects, + // but still, would probably nicer if we made it so that only one associated object was required, broadcasting object dealloc. + JSC::ExecState* exec = toJS([m_context JSGlobalContextRef]); + jsWrapper = toJS(exec, valueInternalValue(wrapper)).toObject(exec); + m_cachedJSWrappers.set(object, jsWrapper); + return wrapper; +} + +- (JSValue *)objcWrapperForJSValueRef:(JSValueRef)value +{ + JSValue *wrapper = static_cast(NSMapGet(m_cachedObjCWrappers, value)); + if (!wrapper) { + wrapper = [[[JSValue alloc] initWithValue:value inContext:m_context] autorelease]; + NSMapInsert(m_cachedObjCWrappers, value, wrapper); + } + return wrapper; +} + +@end + +id tryUnwrapObjcObject(JSGlobalContextRef context, JSValueRef value) +{ + if (!JSValueIsObject(context, value)) + return nil; + JSValueRef exception = 0; + JSObjectRef object = JSValueToObject(context, value, &exception); + ASSERT(!exception); + if (toJS(object)->inherits(JSC::JSCallbackObject::info())) + return (id)JSC::jsCast(toJS(object))->wrappedObject(); + if (id target = tryUnwrapConstructor(object)) + return target; + return nil; +} + +// This class ensures that the JSExport protocol is registered with the runtime. +NS_ROOT_CLASS @interface JSExport +@end +@implementation JSExport +@end + +Protocol *getJSExportProtocol() +{ + static Protocol *protocol = objc_getProtocol("JSExport"); + return protocol; +} + +Class getNSBlockClass() +{ + static Class cls = objc_getClass("NSBlock"); + return cls; +} + +#endif diff --git a/JavaScriptCore/API/JavaScriptCore.h b/JavaScriptCore/API/JavaScriptCore.h index 87d60185..40bea9c3 100644 --- a/JavaScriptCore/API/JavaScriptCore.h +++ b/JavaScriptCore/API/JavaScriptCore.h @@ -29,4 +29,14 @@ #include #include +#if defined(__OBJC__) && JSC_OBJC_API_ENABLED + +#import "JSContext.h" +#import "JSValue.h" +#import "JSManagedValue.h" +#import "JSVirtualMachine.h" +#import "JSExport.h" + +#endif + #endif /* JavaScriptCore_h */ diff --git a/JavaScriptCore/API/ObjCCallbackFunction.h b/JavaScriptCore/API/ObjCCallbackFunction.h new file mode 100644 index 00000000..046bf650 --- /dev/null +++ b/JavaScriptCore/API/ObjCCallbackFunction.h @@ -0,0 +1,83 @@ +/* + * Copyright (C) 2013 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. + */ +#ifndef ObjCCallbackFunction_h +#define ObjCCallbackFunction_h + +#include + +#if JSC_OBJC_API_ENABLED + +#import + +#if defined(__OBJC__) +JSObjectRef objCCallbackFunctionForMethod(JSContext *, Class, Protocol *, BOOL isInstanceMethod, SEL, const char* types); +JSObjectRef objCCallbackFunctionForBlock(JSContext *, id); +JSObjectRef objCCallbackFunctionForInit(JSContext *, Class, Protocol *, SEL, const char* types); + +id tryUnwrapConstructor(JSObjectRef); +#endif + +namespace JSC { + +class ObjCCallbackFunctionImpl; + +class ObjCCallbackFunction : public InternalFunction { + friend struct APICallbackFunction; +public: + typedef InternalFunction Base; + + static ObjCCallbackFunction* create(VM&, JSGlobalObject*, const String& name, PassOwnPtr); + static void destroy(JSCell*); + + static Structure* createStructure(VM& vm, JSGlobalObject* globalObject, JSValue prototype) + { + ASSERT(globalObject); + return Structure::create(vm, globalObject, prototype, TypeInfo(ObjectType, StructureFlags), info()); + } + + DECLARE_EXPORT_INFO; + + ObjCCallbackFunctionImpl* impl() const { return m_impl.get(); } + +protected: + ObjCCallbackFunction(VM&, JSGlobalObject*, JSObjectCallAsFunctionCallback, JSObjectCallAsConstructorCallback, PassOwnPtr); + +private: + static CallType getCallData(JSCell*, CallData&); + static ConstructType getConstructData(JSCell*, ConstructData&); + + JSObjectCallAsFunctionCallback functionCallback() { return m_functionCallback; } + JSObjectCallAsConstructorCallback constructCallback() { return m_constructCallback; } + + JSObjectCallAsFunctionCallback m_functionCallback; + JSObjectCallAsConstructorCallback m_constructCallback; + OwnPtr m_impl; +}; + +} // namespace JSC + +#endif + +#endif // ObjCCallbackFunction_h diff --git a/JavaScriptCore/API/ObjCCallbackFunction.mm b/JavaScriptCore/API/ObjCCallbackFunction.mm new file mode 100644 index 00000000..2203013f --- /dev/null +++ b/JavaScriptCore/API/ObjCCallbackFunction.mm @@ -0,0 +1,709 @@ +/* + * Copyright (C) 2013 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" +#import "JavaScriptCore.h" + +#if JSC_OBJC_API_ENABLED + +#import "APICallbackFunction.h" +#import "APICast.h" +#import "APIShims.h" +#import "Error.h" +#import "JSCJSValueInlines.h" +#import "JSCell.h" +#import "JSCellInlines.h" +#import "JSContextInternal.h" +#import "JSWrapperMap.h" +#import "JSValueInternal.h" +#import "ObjCCallbackFunction.h" +#import "ObjcRuntimeExtras.h" +#import +#import + +class CallbackArgument { +public: + virtual ~CallbackArgument(); + virtual void set(NSInvocation *, NSInteger, JSContext *, JSValueRef, JSValueRef*) = 0; + + OwnPtr m_next; +}; + +CallbackArgument::~CallbackArgument() +{ +} + +class CallbackArgumentBoolean : public CallbackArgument { + virtual void set(NSInvocation *invocation, NSInteger argumentNumber, JSContext *context, JSValueRef argument, JSValueRef*) override + { + bool value = JSValueToBoolean([context JSGlobalContextRef], argument); + [invocation setArgument:&value atIndex:argumentNumber]; + } +}; + +template +class CallbackArgumentInteger : public CallbackArgument { + virtual void set(NSInvocation *invocation, NSInteger argumentNumber, JSContext *context, JSValueRef argument, JSValueRef* exception) override + { + T value = (T)JSC::toInt32(JSValueToNumber([context JSGlobalContextRef], argument, exception)); + [invocation setArgument:&value atIndex:argumentNumber]; + } +}; + +template +class CallbackArgumentDouble : public CallbackArgument { + virtual void set(NSInvocation *invocation, NSInteger argumentNumber, JSContext *context, JSValueRef argument, JSValueRef* exception) override + { + T value = (T)JSValueToNumber([context JSGlobalContextRef], argument, exception); + [invocation setArgument:&value atIndex:argumentNumber]; + } +}; + +class CallbackArgumentJSValue : public CallbackArgument { + virtual void set(NSInvocation *invocation, NSInteger argumentNumber, JSContext *context, JSValueRef argument, JSValueRef*) override + { + JSValue *value = [JSValue valueWithJSValueRef:argument inContext:context]; + [invocation setArgument:&value atIndex:argumentNumber]; + } +}; + +class CallbackArgumentId : public CallbackArgument { + virtual void set(NSInvocation *invocation, NSInteger argumentNumber, JSContext *context, JSValueRef argument, JSValueRef*) override + { + id value = valueToObject(context, argument); + [invocation setArgument:&value atIndex:argumentNumber]; + } +}; + +class CallbackArgumentOfClass : public CallbackArgument { +public: + CallbackArgumentOfClass(Class cls) + : CallbackArgument() + , m_class(cls) + { + [m_class retain]; + } + +private: + virtual ~CallbackArgumentOfClass() + { + [m_class release]; + } + + virtual void set(NSInvocation *invocation, NSInteger argumentNumber, JSContext *context, JSValueRef argument, JSValueRef* exception) override + { + JSGlobalContextRef contextRef = [context JSGlobalContextRef]; + + id object = tryUnwrapObjcObject(contextRef, argument); + if (object && [object isKindOfClass:m_class]) { + [invocation setArgument:&object atIndex:argumentNumber]; + return; + } + + if (JSValueIsNull(contextRef, argument) || JSValueIsUndefined(contextRef, argument)) { + object = nil; + [invocation setArgument:&object atIndex:argumentNumber]; + return; + } + + *exception = toRef(JSC::createTypeError(toJS(contextRef), "Argument does not match Objective-C Class")); + } + + Class m_class; +}; + +class CallbackArgumentNSNumber : public CallbackArgument { + virtual void set(NSInvocation *invocation, NSInteger argumentNumber, JSContext *context, JSValueRef argument, JSValueRef* exception) override + { + id value = valueToNumber([context JSGlobalContextRef], argument, exception); + [invocation setArgument:&value atIndex:argumentNumber]; + } +}; + +class CallbackArgumentNSString : public CallbackArgument { + virtual void set(NSInvocation *invocation, NSInteger argumentNumber, JSContext *context, JSValueRef argument, JSValueRef* exception) override + { + id value = valueToString([context JSGlobalContextRef], argument, exception); + [invocation setArgument:&value atIndex:argumentNumber]; + } +}; + +class CallbackArgumentNSDate : public CallbackArgument { + virtual void set(NSInvocation *invocation, NSInteger argumentNumber, JSContext *context, JSValueRef argument, JSValueRef* exception) override + { + id value = valueToDate([context JSGlobalContextRef], argument, exception); + [invocation setArgument:&value atIndex:argumentNumber]; + } +}; + +class CallbackArgumentNSArray : public CallbackArgument { + virtual void set(NSInvocation *invocation, NSInteger argumentNumber, JSContext *context, JSValueRef argument, JSValueRef* exception) override + { + id value = valueToArray([context JSGlobalContextRef], argument, exception); + [invocation setArgument:&value atIndex:argumentNumber]; + } +}; + +class CallbackArgumentNSDictionary : public CallbackArgument { + virtual void set(NSInvocation *invocation, NSInteger argumentNumber, JSContext *context, JSValueRef argument, JSValueRef* exception) override + { + id value = valueToDictionary([context JSGlobalContextRef], argument, exception); + [invocation setArgument:&value atIndex:argumentNumber]; + } +}; + +class CallbackArgumentStruct : public CallbackArgument { +public: + CallbackArgumentStruct(NSInvocation *conversionInvocation, const char* encodedType) + : m_conversionInvocation(conversionInvocation) + , m_buffer(encodedType) + { + } + +private: + virtual void set(NSInvocation *invocation, NSInteger argumentNumber, JSContext *context, JSValueRef argument, JSValueRef*) override + { + JSValue *value = [JSValue valueWithJSValueRef:argument inContext:context]; + [m_conversionInvocation invokeWithTarget:value]; + [m_conversionInvocation getReturnValue:m_buffer]; + [invocation setArgument:m_buffer atIndex:argumentNumber]; + } + + RetainPtr m_conversionInvocation; + StructBuffer m_buffer; +}; + +class ArgumentTypeDelegate { +public: + typedef CallbackArgument* ResultType; + + template + static ResultType typeInteger() + { + return new CallbackArgumentInteger; + } + + template + static ResultType typeDouble() + { + return new CallbackArgumentDouble; + } + + static ResultType typeBool() + { + return new CallbackArgumentBoolean; + } + + static ResultType typeVoid() + { + RELEASE_ASSERT_NOT_REACHED(); + return 0; + } + + static ResultType typeId() + { + return new CallbackArgumentId; + } + + static ResultType typeOfClass(const char* begin, const char* end) + { + StringRange copy(begin, end); + Class cls = objc_getClass(copy); + if (!cls) + return 0; + + if (cls == [JSValue class]) + return new CallbackArgumentJSValue; + if (cls == [NSString class]) + return new CallbackArgumentNSString; + if (cls == [NSNumber class]) + return new CallbackArgumentNSNumber; + if (cls == [NSDate class]) + return new CallbackArgumentNSDate; + if (cls == [NSArray class]) + return new CallbackArgumentNSArray; + if (cls == [NSDictionary class]) + return new CallbackArgumentNSDictionary; + + return new CallbackArgumentOfClass(cls); + } + + static ResultType typeBlock(const char*, const char*) + { + return nil; + } + + static ResultType typeStruct(const char* begin, const char* end) + { + StringRange copy(begin, end); + if (NSInvocation *invocation = valueToTypeInvocationFor(copy)) + return new CallbackArgumentStruct(invocation, copy); + return 0; + } +}; + +class CallbackResult { +public: + virtual ~CallbackResult() + { + } + + virtual JSValueRef get(NSInvocation *, JSContext *, JSValueRef*) = 0; +}; + +class CallbackResultVoid : public CallbackResult { + virtual JSValueRef get(NSInvocation *, JSContext *context, JSValueRef*) override + { + return JSValueMakeUndefined([context JSGlobalContextRef]); + } +}; + +class CallbackResultId : public CallbackResult { + virtual JSValueRef get(NSInvocation *invocation, JSContext *context, JSValueRef*) override + { + id value; + [invocation getReturnValue:&value]; + return objectToValue(context, value); + } +}; + +template +class CallbackResultNumeric : public CallbackResult { + virtual JSValueRef get(NSInvocation *invocation, JSContext *context, JSValueRef*) override + { + T value; + [invocation getReturnValue:&value]; + return JSValueMakeNumber([context JSGlobalContextRef], value); + } +}; + +class CallbackResultBoolean : public CallbackResult { + virtual JSValueRef get(NSInvocation *invocation, JSContext *context, JSValueRef*) override + { + bool value; + [invocation getReturnValue:&value]; + return JSValueMakeBoolean([context JSGlobalContextRef], value); + } +}; + +class CallbackResultStruct : public CallbackResult { +public: + CallbackResultStruct(NSInvocation *conversionInvocation, const char* encodedType) + : m_conversionInvocation(conversionInvocation) + , m_buffer(encodedType) + { + } + +private: + virtual JSValueRef get(NSInvocation *invocation, JSContext *context, JSValueRef*) override + { + [invocation getReturnValue:m_buffer]; + + [m_conversionInvocation setArgument:m_buffer atIndex:2]; + [m_conversionInvocation setArgument:&context atIndex:3]; + [m_conversionInvocation invokeWithTarget:[JSValue class]]; + + JSValue *value; + [m_conversionInvocation getReturnValue:&value]; + return valueInternalValue(value); + } + + RetainPtr m_conversionInvocation; + StructBuffer m_buffer; +}; + +class ResultTypeDelegate { +public: + typedef CallbackResult* ResultType; + + template + static ResultType typeInteger() + { + return new CallbackResultNumeric; + } + + template + static ResultType typeDouble() + { + return new CallbackResultNumeric; + } + + static ResultType typeBool() + { + return new CallbackResultBoolean; + } + + static ResultType typeVoid() + { + return new CallbackResultVoid; + } + + static ResultType typeId() + { + return new CallbackResultId(); + } + + static ResultType typeOfClass(const char*, const char*) + { + return new CallbackResultId(); + } + + static ResultType typeBlock(const char*, const char*) + { + return new CallbackResultId(); + } + + static ResultType typeStruct(const char* begin, const char* end) + { + StringRange copy(begin, end); + if (NSInvocation *invocation = typeToValueInvocationFor(copy)) + return new CallbackResultStruct(invocation, copy); + return 0; + } +}; + +enum CallbackType { + CallbackInitMethod, + CallbackInstanceMethod, + CallbackClassMethod, + CallbackBlock +}; + +namespace JSC { + +class ObjCCallbackFunctionImpl { +public: + ObjCCallbackFunctionImpl(NSInvocation *invocation, CallbackType type, Class instanceClass, PassOwnPtr arguments, PassOwnPtr result) + : m_type(type) + , m_instanceClass([instanceClass retain]) + , m_invocation(invocation) + , m_arguments(arguments) + , m_result(result) + { + ASSERT((type != CallbackInstanceMethod && type != CallbackInitMethod) || instanceClass); + } + + ~ObjCCallbackFunctionImpl() + { + [m_instanceClass release]; + } + + JSValueRef call(JSContext *context, JSObjectRef thisObject, size_t argumentCount, const JSValueRef arguments[], JSValueRef* exception); + + id wrappedBlock() + { + return m_type == CallbackBlock ? [m_invocation target] : nil; + } + + id wrappedConstructor() + { + switch (m_type) { + case CallbackBlock: + return [m_invocation target]; + case CallbackInitMethod: + return m_instanceClass; + default: + return nil; + } + } + + bool isConstructible() + { + return !!wrappedBlock() || m_type == CallbackInitMethod; + } + + String name(); + +private: + CallbackType m_type; + Class m_instanceClass; + RetainPtr m_invocation; + OwnPtr m_arguments; + OwnPtr m_result; +}; + +static JSValueRef objCCallbackFunctionCallAsFunction(JSContextRef callerContext, JSObjectRef function, JSObjectRef thisObject, size_t argumentCount, const JSValueRef arguments[], JSValueRef* exception) +{ + // Retake the API lock - we need this for a few reasons: + // (1) We don't want to support the C-API's confusing drops-locks-once policy - should only drop locks if we can do so recursively. + // (2) We're calling some JSC internals that require us to be on the 'inside' - e.g. createTypeError. + // (3) We need to be locked (per context would be fine) against conflicting usage of the ObjCCallbackFunction's NSInvocation. + JSC::APIEntryShim entryShim(toJS(callerContext)); + + ObjCCallbackFunction* callback = static_cast(toJS(function)); + ObjCCallbackFunctionImpl* impl = callback->impl(); + JSContext *context = [JSContext contextWithJSGlobalContextRef:toGlobalRef(callback->globalObject()->globalExec())]; + + CallbackData callbackData; + JSValueRef result; + @autoreleasepool { + [context beginCallbackWithData:&callbackData thisValue:thisObject argumentCount:argumentCount arguments:arguments]; + result = impl->call(context, thisObject, argumentCount, arguments, exception); + if (context.exception) + *exception = valueInternalValue(context.exception); + [context endCallbackWithData:&callbackData]; + } + return result; +} + +static JSObjectRef objCCallbackFunctionCallAsConstructor(JSContextRef callerContext, JSObjectRef constructor, size_t argumentCount, const JSValueRef arguments[], JSValueRef* exception) +{ + JSC::APIEntryShim entryShim(toJS(callerContext)); + + ObjCCallbackFunction* callback = static_cast(toJS(constructor)); + ObjCCallbackFunctionImpl* impl = callback->impl(); + JSContext *context = [JSContext contextWithJSGlobalContextRef:toGlobalRef(toJS(callerContext)->lexicalGlobalObject()->globalExec())]; + + CallbackData callbackData; + JSValueRef result; + @autoreleasepool { + [context beginCallbackWithData:&callbackData thisValue:nil argumentCount:argumentCount arguments:arguments]; + result = impl->call(context, NULL, argumentCount, arguments, exception); + if (context.exception) + *exception = valueInternalValue(context.exception); + [context endCallbackWithData:&callbackData]; + } + + JSGlobalContextRef contextRef = [context JSGlobalContextRef]; + if (*exception) + return 0; + + if (!JSValueIsObject(contextRef, result)) { + *exception = toRef(JSC::createTypeError(toJS(contextRef), "Objective-C blocks called as constructors must return an object.")); + return 0; + } + return (JSObjectRef)result; +} + +const JSC::ClassInfo ObjCCallbackFunction::s_info = { "CallbackFunction", &Base::s_info, 0, 0, CREATE_METHOD_TABLE(ObjCCallbackFunction) }; + +ObjCCallbackFunction::ObjCCallbackFunction(JSC::VM& vm, JSC::JSGlobalObject* globalObject, JSObjectCallAsFunctionCallback functionCallback, JSObjectCallAsConstructorCallback constructCallback, PassOwnPtr impl) + : Base(vm, globalObject->objcCallbackFunctionStructure()) + , m_functionCallback(functionCallback) + , m_constructCallback(constructCallback) + , m_impl(impl) +{ +} + +ObjCCallbackFunction* ObjCCallbackFunction::create(JSC::VM& vm, JSC::JSGlobalObject* globalObject, const String& name, PassOwnPtr impl) +{ + ObjCCallbackFunction* function = new (NotNull, allocateCell(vm.heap)) ObjCCallbackFunction(vm, globalObject, objCCallbackFunctionCallAsFunction, objCCallbackFunctionCallAsConstructor, impl); + function->finishCreation(vm, name); + return function; +} + +void ObjCCallbackFunction::destroy(JSCell* cell) +{ + static_cast(cell)->ObjCCallbackFunction::~ObjCCallbackFunction(); +} + + +CallType ObjCCallbackFunction::getCallData(JSCell*, CallData& callData) +{ + callData.native.function = APICallbackFunction::call; + return CallTypeHost; +} + +ConstructType ObjCCallbackFunction::getConstructData(JSCell* cell, ConstructData& constructData) +{ + ObjCCallbackFunction* callback = jsCast(cell); + if (!callback->impl()->isConstructible()) + return Base::getConstructData(cell, constructData); + constructData.native.function = APICallbackFunction::construct; + return ConstructTypeHost; +} + +String ObjCCallbackFunctionImpl::name() +{ + if (m_type == CallbackInitMethod) + return class_getName(m_instanceClass); + return ""; +} + +JSValueRef ObjCCallbackFunctionImpl::call(JSContext *context, JSObjectRef thisObject, size_t argumentCount, const JSValueRef arguments[], JSValueRef* exception) +{ + JSGlobalContextRef contextRef = [context JSGlobalContextRef]; + + id target; + size_t firstArgument; + switch (m_type) { + case CallbackInitMethod: { + RELEASE_ASSERT(!thisObject); + target = [m_instanceClass alloc]; + if (!target || ![target isKindOfClass:m_instanceClass]) { + *exception = toRef(JSC::createTypeError(toJS(contextRef), "self type check failed for Objective-C instance method")); + return JSValueMakeUndefined(contextRef); + } + [m_invocation setTarget:target]; + firstArgument = 2; + break; + } + case CallbackInstanceMethod: { + target = tryUnwrapObjcObject(contextRef, thisObject); + if (!target || ![target isKindOfClass:m_instanceClass]) { + *exception = toRef(JSC::createTypeError(toJS(contextRef), "self type check failed for Objective-C instance method")); + return JSValueMakeUndefined(contextRef); + } + [m_invocation setTarget:target]; + firstArgument = 2; + break; + } + case CallbackClassMethod: + firstArgument = 2; + break; + case CallbackBlock: + firstArgument = 1; + } + + size_t argumentNumber = 0; + for (CallbackArgument* argument = m_arguments.get(); argument; argument = argument->m_next.get()) { + JSValueRef value = argumentNumber < argumentCount ? arguments[argumentNumber] : JSValueMakeUndefined(contextRef); + argument->set(m_invocation.get(), argumentNumber + firstArgument, context, value, exception); + if (*exception) + return JSValueMakeUndefined(contextRef); + ++argumentNumber; + } + + [m_invocation invoke]; + + JSValueRef result = m_result->get(m_invocation.get(), context, exception); + + // Balance our call to -alloc with a call to -autorelease. We have to do this after calling -init + // because init family methods are allowed to release the allocated object and return something + // else in its place. + if (m_type == CallbackInitMethod) { + id objcResult = tryUnwrapObjcObject(contextRef, result); + if (objcResult) + [objcResult autorelease]; + } + + return result; +} + +} // namespace JSC + +static bool blockSignatureContainsClass() +{ + static bool containsClass = ^{ + id block = ^(NSString *string){ return string; }; + return _Block_has_signature(block) && strstr(_Block_signature(block), "NSString"); + }(); + return containsClass; +} + +inline bool skipNumber(const char*& position) +{ + if (!isASCIIDigit(*position)) + return false; + while (isASCIIDigit(*++position)) { } + return true; +} + +static JSObjectRef objCCallbackFunctionForInvocation(JSContext *context, NSInvocation *invocation, CallbackType type, Class instanceClass, const char* signatureWithObjcClasses) +{ + const char* position = signatureWithObjcClasses; + + OwnPtr result = adoptPtr(parseObjCType(position)); + if (!result || !skipNumber(position)) + return nil; + + switch (type) { + case CallbackInitMethod: + case CallbackInstanceMethod: + case CallbackClassMethod: + // Methods are passed two implicit arguments - (id)self, and the selector. + if ('@' != *position++ || !skipNumber(position) || ':' != *position++ || !skipNumber(position)) + return nil; + break; + case CallbackBlock: + // Blocks are passed one implicit argument - the block, of type "@?". + if (('@' != *position++) || ('?' != *position++) || !skipNumber(position)) + return nil; + // Only allow arguments of type 'id' if the block signature contains the NS type information. + if ((!blockSignatureContainsClass() && strchr(position, '@'))) + return nil; + break; + } + + OwnPtr arguments = 0; + OwnPtr* nextArgument = &arguments; + unsigned argumentCount = 0; + while (*position) { + OwnPtr argument = adoptPtr(parseObjCType(position)); + if (!argument || !skipNumber(position)) + return nil; + + *nextArgument = argument.release(); + nextArgument = &(*nextArgument)->m_next; + ++argumentCount; + } + + JSC::ExecState* exec = toJS([context JSGlobalContextRef]); + JSC::APIEntryShim shim(exec); + OwnPtr impl = adoptPtr(new JSC::ObjCCallbackFunctionImpl(invocation, type, instanceClass, arguments.release(), result.release())); + // FIXME: Maybe we could support having the selector as the name of the function to make it a bit more user-friendly from the JS side? + return toRef(JSC::ObjCCallbackFunction::create(exec->vm(), exec->lexicalGlobalObject(), impl->name(), impl.release())); +} + +JSObjectRef objCCallbackFunctionForInit(JSContext *context, Class cls, Protocol *protocol, SEL sel, const char* types) +{ + NSInvocation *invocation = [NSInvocation invocationWithMethodSignature:[NSMethodSignature signatureWithObjCTypes:types]]; + [invocation setSelector:sel]; + return objCCallbackFunctionForInvocation(context, invocation, CallbackInitMethod, cls, _protocol_getMethodTypeEncoding(protocol, sel, YES, YES)); +} + +JSObjectRef objCCallbackFunctionForMethod(JSContext *context, Class cls, Protocol *protocol, BOOL isInstanceMethod, SEL sel, const char* types) +{ + NSInvocation *invocation = [NSInvocation invocationWithMethodSignature:[NSMethodSignature signatureWithObjCTypes:types]]; + [invocation setSelector:sel]; + if (!isInstanceMethod) + [invocation setTarget:cls]; + return objCCallbackFunctionForInvocation(context, invocation, isInstanceMethod ? CallbackInstanceMethod : CallbackClassMethod, isInstanceMethod ? cls : nil, _protocol_getMethodTypeEncoding(protocol, sel, YES, isInstanceMethod)); +} + +JSObjectRef objCCallbackFunctionForBlock(JSContext *context, id target) +{ + if (!_Block_has_signature(target)) + return 0; + const char* signature = _Block_signature(target); + NSInvocation *invocation = [NSInvocation invocationWithMethodSignature:[NSMethodSignature signatureWithObjCTypes:signature]]; + [invocation retainArguments]; + id targetCopy = [target copy]; + [invocation setTarget:targetCopy]; + [targetCopy release]; + return objCCallbackFunctionForInvocation(context, invocation, CallbackBlock, nil, signature); +} + +id tryUnwrapConstructor(JSObjectRef object) +{ + if (!toJS(object)->inherits(JSC::ObjCCallbackFunction::info())) + return nil; + JSC::ObjCCallbackFunctionImpl* impl = static_cast(toJS(object))->impl(); + if (!impl->isConstructible()) + return nil; + return impl->wrappedConstructor(); +} + +#endif diff --git a/JavaScriptCore/API/ObjcRuntimeExtras.h b/JavaScriptCore/API/ObjcRuntimeExtras.h new file mode 100644 index 00000000..48c11209 --- /dev/null +++ b/JavaScriptCore/API/ObjcRuntimeExtras.h @@ -0,0 +1,231 @@ +/* + * Copyright (C) 2013 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. + */ + +#import +#import +#import + +inline bool protocolImplementsProtocol(Protocol *candidate, Protocol *target) +{ + unsigned protocolProtocolsCount; + Protocol ** protocolProtocols = protocol_copyProtocolList(candidate, &protocolProtocolsCount); + for (unsigned i = 0; i < protocolProtocolsCount; ++i) { + if (protocol_isEqual(protocolProtocols[i], target)) { + free(protocolProtocols); + return true; + } + } + free(protocolProtocols); + return false; +} + +inline void forEachProtocolImplementingProtocol(Class cls, Protocol *target, void (^callback)(Protocol *)) +{ + ASSERT(cls); + ASSERT(target); + + Vector worklist; + HashSet visited; + + // Initially fill the worklist with the Class's protocols. + unsigned protocolsCount; + Protocol ** protocols = class_copyProtocolList(cls, &protocolsCount); + worklist.append(protocols, protocolsCount); + free(protocols); + + while (!worklist.isEmpty()) { + Protocol *protocol = worklist.last(); + worklist.removeLast(); + + // Are we encountering this Protocol for the first time? + if (!visited.add(protocol).isNewEntry) + continue; + + // If it implements the protocol, make the callback. + if (protocolImplementsProtocol(protocol, target)) + callback(protocol); + + // Add incorporated protocols to the worklist. + protocols = protocol_copyProtocolList(protocol, &protocolsCount); + worklist.append(protocols, protocolsCount); + free(protocols); + } +} + +inline void forEachMethodInClass(Class cls, void (^callback)(Method)) +{ + unsigned count; + Method* methods = class_copyMethodList(cls, &count); + for (unsigned i = 0; i < count; ++i) + callback(methods[i]); + free(methods); +} + +inline void forEachMethodInProtocol(Protocol *protocol, BOOL isRequiredMethod, BOOL isInstanceMethod, void (^callback)(SEL, const char*)) +{ + unsigned count; + struct objc_method_description* methods = protocol_copyMethodDescriptionList(protocol, isRequiredMethod, isInstanceMethod, &count); + for (unsigned i = 0; i < count; ++i) + callback(methods[i].name, methods[i].types); + free(methods); +} + +inline void forEachPropertyInProtocol(Protocol *protocol, void (^callback)(objc_property_t)) +{ + unsigned count; + objc_property_t* properties = protocol_copyPropertyList(protocol, &count); + for (unsigned i = 0; i < count; ++i) + callback(properties[i]); + free(properties); +} + +template +void skipPair(const char*& position) +{ + size_t count = 1; + do { + char c = *position++; + if (!c) + @throw [NSException exceptionWithName:NSInternalInconsistencyException reason:@"Malformed type encoding" userInfo:nil]; + if (c == open) + ++count; + else if (c == close) + --count; + } while (count); +} + +class StringRange { + WTF_MAKE_NONCOPYABLE(StringRange); +public: + StringRange(const char* begin, const char* end) : m_ptr(strndup(begin, end - begin)) { } + ~StringRange() { free(m_ptr); } + operator const char*() const { return m_ptr; } + const char* get() const { return m_ptr; } + +private: + char* m_ptr; +}; + +class StructBuffer { + WTF_MAKE_NONCOPYABLE(StructBuffer); +public: + StructBuffer(const char* encodedType) + { + NSUInteger size, alignment; + NSGetSizeAndAlignment(encodedType, &size, &alignment); + --alignment; + m_allocation = static_cast(malloc(size + alignment)); + m_buffer = reinterpret_cast((reinterpret_cast(m_allocation) + alignment) & ~alignment); + } + + ~StructBuffer() { free(m_allocation); } + operator void*() const { return m_buffer; } + +private: + void* m_allocation; + void* m_buffer; +}; + +template +typename DelegateType::ResultType parseObjCType(const char*& position) +{ + ASSERT(*position); + + switch (*position++) { + case 'c': + return DelegateType::template typeInteger(); + case 'i': + return DelegateType::template typeInteger(); + case 's': + return DelegateType::template typeInteger(); + case 'l': + return DelegateType::template typeInteger(); + case 'q': + return DelegateType::template typeDouble(); + case 'C': + return DelegateType::template typeInteger(); + case 'I': + return DelegateType::template typeInteger(); + case 'S': + return DelegateType::template typeInteger(); + case 'L': + return DelegateType::template typeInteger(); + case 'Q': + return DelegateType::template typeDouble(); + case 'f': + return DelegateType::template typeDouble(); + case 'd': + return DelegateType::template typeDouble(); + case 'B': + return DelegateType::typeBool(); + case 'v': + return DelegateType::typeVoid(); + + case '@': { // An object (whether statically typed or typed id) + if (position[0] == '?' && position[1] == '<') { + position += 2; + const char* begin = position; + skipPair<'<','>'>(position); + return DelegateType::typeBlock(begin, position - 1); + } + + if (*position == '"') { + const char* begin = ++position; + position = index(position, '"'); + return DelegateType::typeOfClass(begin, position++); + } + + return DelegateType::typeId(); + } + + case '{': { // {name=type...} A structure + const char* begin = position - 1; + skipPair<'{','}'>(position); + return DelegateType::typeStruct(begin, position); + } + + // NOT supporting C strings, arrays, pointers, unions, bitfields, function pointers. + case '*': // A character string (char *) + case '[': // [array type] An array + case '(': // (name=type...) A union + case 'b': // bnum A bit field of num bits + case '^': // ^type A pointer to type + case '?': // An unknown type (among other things, this code is used for function pointers) + // NOT supporting Objective-C Class, SEL + case '#': // A class object (Class) + case ':': // A method selector (SEL) + default: + return nil; + } +} + +extern "C" { + // Forward declare some Objective-C runtime internal methods that are not API. + const char *_protocol_getMethodTypeEncoding(Protocol *, SEL, BOOL isRequiredMethod, BOOL isInstanceMethod); + id objc_initWeak(id *, id); + void objc_destroyWeak(id *); + bool _Block_has_signature(void *); + const char * _Block_signature(void *); +} diff --git a/JavaScriptCore/API/OpaqueJSString.cpp b/JavaScriptCore/API/OpaqueJSString.cpp index 9a116e6b..c9802506 100644 --- a/JavaScriptCore/API/OpaqueJSString.cpp +++ b/JavaScriptCore/API/OpaqueJSString.cpp @@ -26,30 +26,38 @@ #include "config.h" #include "OpaqueJSString.h" -#include -#include -#include +#include "CallFrame.h" +#include "Identifier.h" +#include "JSGlobalObject.h" using namespace JSC; -PassRefPtr OpaqueJSString::create(const UString& ustring) +PassRefPtr OpaqueJSString::create(const String& string) { - if (!ustring.isNull()) - return adoptRef(new OpaqueJSString(ustring.characters(), ustring.length())); + if (!string.isNull()) + return adoptRef(new OpaqueJSString(string)); return 0; } -UString OpaqueJSString::ustring() const +String OpaqueJSString::string() const { - if (this && m_characters) - return UString(m_characters, m_length); - return UString(); + if (!this) + return String(); + + // Return a copy of the wrapped string, because the caller may make it an Identifier. + return m_string.isolatedCopy(); } -Identifier OpaqueJSString::identifier(JSGlobalData* globalData) const +Identifier OpaqueJSString::identifier(VM* vm) const { - if (!this || !m_characters) - return Identifier(globalData, static_cast(0)); + if (!this || m_string.isNull()) + return Identifier(); + + if (m_string.isEmpty()) + return Identifier(Identifier::EmptyIdentifier); + + if (m_string.is8Bit()) + return Identifier(vm, m_string.characters8(), m_string.length()); - return Identifier(globalData, m_characters, m_length); + return Identifier(vm, m_string.characters16(), m_string.length()); } diff --git a/JavaScriptCore/API/OpaqueJSString.h b/JavaScriptCore/API/OpaqueJSString.h index 1c63150c..d617b35a 100644 --- a/JavaScriptCore/API/OpaqueJSString.h +++ b/JavaScriptCore/API/OpaqueJSString.h @@ -27,11 +27,11 @@ #define OpaqueJSString_h #include -#include +#include namespace JSC { class Identifier; - class JSGlobalData; + class VM; } struct OpaqueJSString : public ThreadSafeRefCounted { @@ -41,42 +41,47 @@ struct OpaqueJSString : public ThreadSafeRefCounted { return adoptRef(new OpaqueJSString); } + static PassRefPtr create(const LChar* characters, unsigned length) + { + return adoptRef(new OpaqueJSString(characters, length)); + } + static PassRefPtr create(const UChar* characters, unsigned length) { return adoptRef(new OpaqueJSString(characters, length)); } - JS_EXPORT_PRIVATE static PassRefPtr create(const JSC::UString&); + JS_EXPORT_PRIVATE static PassRefPtr create(const String&); - UChar* characters() { return this ? m_characters : 0; } - unsigned length() { return this ? m_length : 0; } + const UChar* characters() { return !!this ? m_string.characters() : 0; } + unsigned length() { return !!this ? m_string.length() : 0; } - JSC::UString ustring() const; - JSC::Identifier identifier(JSC::JSGlobalData*) const; + JS_EXPORT_PRIVATE String string() const; + JSC::Identifier identifier(JSC::VM*) const; private: friend class WTF::ThreadSafeRefCounted; OpaqueJSString() - : m_characters(0) - , m_length(0) { } - OpaqueJSString(const UChar* characters, unsigned length) - : m_length(length) + OpaqueJSString(const String& string) + : m_string(string.isolatedCopy()) { - m_characters = new UChar[length]; - memcpy(m_characters, characters, length * sizeof(UChar)); } - ~OpaqueJSString() + OpaqueJSString(const LChar* characters, unsigned length) + { + m_string = String(characters, length); + } + + OpaqueJSString(const UChar* characters, unsigned length) { - delete[] m_characters; + m_string = String(characters, length); } - UChar* m_characters; - unsigned m_length; + String m_string; }; #endif diff --git a/JavaScriptCore/API/WebKitAvailability.h b/JavaScriptCore/API/WebKitAvailability.h index 7846058f..ebb33bce 100644 --- a/JavaScriptCore/API/WebKitAvailability.h +++ b/JavaScriptCore/API/WebKitAvailability.h @@ -43,7 +43,9 @@ #ifdef __APPLE__ #include +#include #else +#define CF_AVAILABLE(_mac, _ios) /* * For non-Mac platforms, require the newest version. */ diff --git a/JavaScriptCore/API/tests/CurrentThisInsideBlockGetterTest.h b/JavaScriptCore/API/tests/CurrentThisInsideBlockGetterTest.h new file mode 100644 index 00000000..3fa7aea6 --- /dev/null +++ b/JavaScriptCore/API/tests/CurrentThisInsideBlockGetterTest.h @@ -0,0 +1,38 @@ +/* + * Copyright (C) 2013 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. + */ + +#ifndef CurrentThisInsideBlockGetterTest_h +#define CurrentThisInsideBlockGetterTest_h + +#include + +#if JSC_OBJC_API_ENABLED && __MAC_OS_X_VERSION_MIN_REQUIRED >= 1090 + +void currentThisInsideBlockGetterTest(); + +#endif // JSC_OBJC_API_ENABLED && __MAC_OS_X_VERSION_MIN_REQUIRED >= 1090 + + +#endif // CurrentThisInsideBlockGetterTest_h diff --git a/JavaScriptCore/API/tests/CurrentThisInsideBlockGetterTest.mm b/JavaScriptCore/API/tests/CurrentThisInsideBlockGetterTest.mm new file mode 100644 index 00000000..8b3ef58a --- /dev/null +++ b/JavaScriptCore/API/tests/CurrentThisInsideBlockGetterTest.mm @@ -0,0 +1,125 @@ +/* + * Copyright (C) 2013 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. + */ + +#include "CurrentThisInsideBlockGetterTest.h" + +#if JSC_OBJC_API_ENABLED && __MAC_OS_X_VERSION_MIN_REQUIRED >= 1090 + +#import +#import + +static JSObjectRef CallAsConstructor(JSContextRef ctx, JSObjectRef constructor, size_t, const JSValueRef[], JSValueRef*) +{ + JSObjectRef newObjectRef = NULL; + NSMutableDictionary *constructorPrivateProperties = (__bridge NSMutableDictionary *)(JSObjectGetPrivate(constructor)); + NSDictionary *constructorDescriptor = constructorPrivateProperties[@"constructorDescriptor"]; + newObjectRef = JSObjectMake(ctx, NULL, NULL); + NSDictionary *objectProperties = constructorDescriptor[@"objectProperties"]; + + if (objectProperties) { + JSValue *newObject = [JSValue valueWithJSValueRef:newObjectRef inContext:[JSContext contextWithJSGlobalContextRef:JSContextGetGlobalContext(ctx)]]; + for (NSString *objectProperty in objectProperties) { + [newObject defineProperty:objectProperty descriptor:objectProperties[objectProperty]]; + } + } + + return newObjectRef; +} + +static void ConstructorFinalize(JSObjectRef object) +{ + NSMutableDictionary *privateProperties = (__bridge NSMutableDictionary *)(JSObjectGetPrivate(object)); + CFBridgingRelease((__bridge CFTypeRef)(privateProperties)); + JSObjectSetPrivate(object, NULL); +} + +static JSClassRef ConstructorClass(void) +{ + static JSClassRef constructorClass = NULL; + + if (constructorClass == NULL) { + JSClassDefinition classDefinition = kJSClassDefinitionEmpty; + classDefinition.className = "Constructor"; + classDefinition.callAsConstructor = CallAsConstructor; + classDefinition.finalize = ConstructorFinalize; + constructorClass = JSClassCreate(&classDefinition); + } + + return constructorClass; +} + +@interface JSValue (ConstructorCreation) + ++ (JSValue *)valueWithConstructorDescriptor:(NSDictionary *)constructorDescriptor inContext:(JSContext *)context; + +@end + +@implementation JSValue (ConstructorCreation) + ++ (JSValue *)valueWithConstructorDescriptor:(id)constructorDescriptor inContext:(JSContext *)context +{ + NSMutableDictionary *privateProperties = [@{ @"constructorDescriptor" : constructorDescriptor } mutableCopy]; + JSGlobalContextRef ctx = [context JSGlobalContextRef]; + JSObjectRef constructorRef = JSObjectMake(ctx, ConstructorClass(), (void *)CFBridgingRetain(privateProperties)); + JSValue *constructor = [JSValue valueWithJSValueRef:constructorRef inContext:context]; + return constructor; +} + +@end + +@interface JSContext (ConstructorCreation) + +- (JSValue *)valueWithConstructorDescriptor:(NSDictionary *)constructorDescriptor; + +@end + +@implementation JSContext (ConstructorCreation) + +- (JSValue *)valueWithConstructorDescriptor:(id)constructorDescriptor +{ + return [JSValue valueWithConstructorDescriptor:constructorDescriptor inContext:self]; +} + +@end + +void currentThisInsideBlockGetterTest() +{ + @autoreleasepool { + JSContext *context = [[JSContext alloc] init]; + + JSValue *myConstructor = [context valueWithConstructorDescriptor:@{ + @"objectProperties" : @{ + @"currentThis" : @{ JSPropertyDescriptorGetKey : ^{ return JSContext.currentThis; } }, + }, + }]; + + JSValue *myObj1 = [myConstructor constructWithArguments:nil]; + NSLog(@"myObj1.currentThis: %@", myObj1[@"currentThis"]); + JSValue *myObj2 = [myConstructor constructWithArguments:@[ @"bar" ]]; + NSLog(@"myObj2.currentThis: %@", myObj2[@"currentThis"]); + } +} + +#endif // JSC_OBJC_API_ENABLED && __MAC_OS_X_VERSION_MIN_REQUIRED >= 1090 diff --git a/JavaScriptCore/API/tests/JSNode.c b/JavaScriptCore/API/tests/JSNode.c index 052c88a0..d9a40bea 100644 --- a/JavaScriptCore/API/tests/JSNode.c +++ b/JavaScriptCore/API/tests/JSNode.c @@ -30,7 +30,6 @@ #include "JSValueRef.h" #include "Node.h" #include "NodeList.h" -#include #include static JSValueRef JSNode_appendChild(JSContextRef context, JSObjectRef function, JSObjectRef thisObject, size_t argumentCount, const JSValueRef arguments[], JSValueRef* exception) diff --git a/JavaScriptCore/API/tests/JSNodeList.c b/JavaScriptCore/API/tests/JSNodeList.c index 0d194845..61d7041a 100644 --- a/JavaScriptCore/API/tests/JSNodeList.c +++ b/JavaScriptCore/API/tests/JSNodeList.c @@ -27,7 +27,6 @@ #include "JSNodeList.h" #include "JSObjectRef.h" #include "JSValueRef.h" -#include #include static JSValueRef JSNodeList_item(JSContextRef context, JSObjectRef object, JSObjectRef thisObject, size_t argumentCount, const JSValueRef arguments[], JSValueRef* exception) diff --git a/JavaScriptCore/API/tests/minidom.c b/JavaScriptCore/API/tests/minidom.c index 43ae2c1a..f4ccf91e 100644 --- a/JavaScriptCore/API/tests/minidom.c +++ b/JavaScriptCore/API/tests/minidom.c @@ -31,7 +31,6 @@ #include #include #include -#include static char* createStringWithContentsOfFile(const char* fileName); static JSValueRef print(JSContextRef context, JSObjectRef object, JSObjectRef thisObject, size_t argumentCount, const JSValueRef arguments[], JSValueRef* exception); @@ -106,6 +105,7 @@ static char* createStringWithContentsOfFile(const char* fileName) FILE* f = fopen(fileName, "r"); if (!f) { fprintf(stderr, "Could not open file: %s\n", fileName); + free(buffer); return 0; } diff --git a/JavaScriptCore/API/tests/testapi.c b/JavaScriptCore/API/tests/testapi.c index 91978bbf..77bebd76 100644 --- a/JavaScriptCore/API/tests/testapi.c +++ b/JavaScriptCore/API/tests/testapi.c @@ -27,10 +27,17 @@ #include "JSBasePrivate.h" #include "JSContextRefPrivate.h" #include "JSObjectRefPrivate.h" +#include "JSScriptRefPrivate.h" +#include "JSStringRefPrivate.h" #include #define ASSERT_DISABLED 0 #include -#include + +#if PLATFORM(MAC) || PLATFORM(IOS) +#include +#include +#include +#endif #if OS(WINDOWS) #include @@ -45,10 +52,19 @@ static double nan(const char*) return std::numeric_limits::quiet_NaN(); } +using std::isinf; +using std::isnan; + +#endif + +#if JSC_OBJC_API_ENABLED +void testObjectiveCAPI(void); #endif +extern void JSSynchronousGarbageCollectForDebugging(JSContextRef); + static JSGlobalContextRef context; -static int failed; +int failed; static void assertEqualsAsBoolean(JSValueRef value, bool expectedValue) { if (JSValueToBoolean(context, value) != expectedValue) { @@ -481,6 +497,11 @@ static bool PropertyCatchalls_setProperty(JSContextRef context, JSObjectRef obje return true; } + if (JSStringIsEqualToUTF8CString(propertyName, "make_throw") || JSStringIsEqualToUTF8CString(propertyName, "0")) { + *exception = JSValueMakeNumber(context, 5); + return true; + } + return false; } @@ -1022,6 +1043,44 @@ static bool checkForCycleInPrototypeChain() return result; } +static JSValueRef valueToObjectExceptionCallAsFunction(JSContextRef ctx, JSObjectRef function, JSObjectRef thisObject, size_t argumentCount, const JSValueRef arguments[], JSValueRef* exception) +{ + UNUSED_PARAM(function); + UNUSED_PARAM(thisObject); + UNUSED_PARAM(argumentCount); + UNUSED_PARAM(arguments); + JSValueRef jsUndefined = JSValueMakeUndefined(JSContextGetGlobalContext(ctx)); + JSValueToObject(JSContextGetGlobalContext(ctx), jsUndefined, exception); + + return JSValueMakeUndefined(ctx); +} +static bool valueToObjectExceptionTest() +{ + JSGlobalContextRef testContext; + JSClassDefinition globalObjectClassDefinition = kJSClassDefinitionEmpty; + globalObjectClassDefinition.initialize = globalObject_initialize; + globalObjectClassDefinition.staticValues = globalObject_staticValues; + globalObjectClassDefinition.staticFunctions = globalObject_staticFunctions; + globalObjectClassDefinition.attributes = kJSClassAttributeNoAutomaticPrototype; + JSClassRef globalObjectClass = JSClassCreate(&globalObjectClassDefinition); + testContext = JSGlobalContextCreateInGroup(NULL, globalObjectClass); + JSObjectRef globalObject = JSContextGetGlobalObject(testContext); + + JSStringRef valueToObject = JSStringCreateWithUTF8CString("valueToObject"); + JSObjectRef valueToObjectFunction = JSObjectMakeFunctionWithCallback(testContext, valueToObject, valueToObjectExceptionCallAsFunction); + JSObjectSetProperty(testContext, globalObject, valueToObject, valueToObjectFunction, kJSPropertyAttributeNone, NULL); + JSStringRelease(valueToObject); + + JSStringRef test = JSStringCreateWithUTF8CString("valueToObject();"); + JSEvaluateScript(testContext, test, NULL, NULL, 1, NULL); + + JSStringRelease(test); + JSClassRelease(globalObjectClass); + JSGlobalContextRelease(testContext); + + return true; +} + static void checkConstnessInJSObjectNames() { JSStaticFunction fun; @@ -1030,6 +1089,68 @@ static void checkConstnessInJSObjectNames() val.name = "something"; } +#if PLATFORM(MAC) || PLATFORM(IOS) +static double currentCPUTime() +{ + mach_msg_type_number_t infoCount = THREAD_BASIC_INFO_COUNT; + thread_basic_info_data_t info; + + /* Get thread information */ + mach_port_t threadPort = mach_thread_self(); + thread_info(threadPort, THREAD_BASIC_INFO, (thread_info_t)(&info), &infoCount); + mach_port_deallocate(mach_task_self(), threadPort); + + double time = info.user_time.seconds + info.user_time.microseconds / 1000000.; + time += info.system_time.seconds + info.system_time.microseconds / 1000000.; + + return time; +} + +static JSValueRef currentCPUTime_callAsFunction(JSContextRef ctx, JSObjectRef functionObject, JSObjectRef thisObject, size_t argumentCount, const JSValueRef arguments[], JSValueRef* exception) +{ + UNUSED_PARAM(functionObject); + UNUSED_PARAM(thisObject); + UNUSED_PARAM(argumentCount); + UNUSED_PARAM(arguments); + UNUSED_PARAM(exception); + + ASSERT(JSContextGetGlobalContext(ctx) == context); + return JSValueMakeNumber(ctx, currentCPUTime()); +} + +bool shouldTerminateCallbackWasCalled = false; +static bool shouldTerminateCallback(JSContextRef ctx, void* context) +{ + UNUSED_PARAM(ctx); + UNUSED_PARAM(context); + shouldTerminateCallbackWasCalled = true; + return true; +} + +bool cancelTerminateCallbackWasCalled = false; +static bool cancelTerminateCallback(JSContextRef ctx, void* context) +{ + UNUSED_PARAM(ctx); + UNUSED_PARAM(context); + cancelTerminateCallbackWasCalled = true; + return false; +} + +int extendTerminateCallbackCalled = 0; +static bool extendTerminateCallback(JSContextRef ctx, void* context) +{ + UNUSED_PARAM(context); + extendTerminateCallbackCalled++; + if (extendTerminateCallbackCalled == 1) { + JSContextGroupRef contextGroup = JSContextGetGroup(ctx); + JSContextGroupSetExecutionTimeLimit(contextGroup, .200f, extendTerminateCallback, 0); + return false; + } + return true; +} +#endif /* PLATFORM(MAC) || PLATFORM(IOS) */ + + int main(int argc, char* argv[]) { #if OS(WINDOWS) @@ -1039,6 +1160,10 @@ int main(int argc, char* argv[]) ::SetErrorMode(0); #endif +#if JSC_OBJC_API_ENABLED + testObjectiveCAPI(); +#endif + const char *scriptPath = "testapi.js"; if (argc > 1) { scriptPath = argv[1]; @@ -1061,6 +1186,8 @@ int main(int argc, char* argv[]) JSClassRef globalObjectClass = JSClassCreate(&globalObjectClassDefinition); context = JSGlobalContextCreateInGroup(NULL, globalObjectClass); + JSContextGroupRef contextGroup = JSContextGetGroup(context); + JSGlobalContextRetain(context); JSGlobalContextRelease(context); ASSERT(JSContextGetGlobalContext(context) == context); @@ -1117,6 +1244,12 @@ int main(int argc, char* argv[]) free(buffer); JSValueRef jsCFEmptyStringWithCharacters = JSValueMakeString(context, jsCFEmptyIStringWithCharacters); + JSChar constantString[] = { 'H', 'e', 'l', 'l', 'o', }; + JSStringRef constantStringRef = JSStringCreateWithCharactersNoCopy(constantString, sizeof(constantString) / sizeof(constantString[0])); + ASSERT(JSStringGetCharactersPtr(constantStringRef) == constantString); + JSStringRelease(constantStringRef); + + ASSERT(JSValueGetType(context, NULL) == kJSTypeNull); ASSERT(JSValueGetType(context, jsUndefined) == kJSTypeUndefined); ASSERT(JSValueGetType(context, jsNull) == kJSTypeNull); ASSERT(JSValueGetType(context, jsTrue) == kJSTypeBoolean); @@ -1131,6 +1264,49 @@ int main(int argc, char* argv[]) ASSERT(JSValueGetType(context, jsCFEmptyString) == kJSTypeString); ASSERT(JSValueGetType(context, jsCFEmptyStringWithCharacters) == kJSTypeString); + ASSERT(!JSValueIsBoolean(context, NULL)); + ASSERT(!JSValueIsObject(context, NULL)); + ASSERT(!JSValueIsString(context, NULL)); + ASSERT(!JSValueIsNumber(context, NULL)); + ASSERT(!JSValueIsUndefined(context, NULL)); + ASSERT(JSValueIsNull(context, NULL)); + ASSERT(!JSObjectCallAsFunction(context, NULL, NULL, 0, NULL, NULL)); + ASSERT(!JSObjectCallAsConstructor(context, NULL, 0, NULL, NULL)); + ASSERT(!JSObjectIsConstructor(context, NULL)); + ASSERT(!JSObjectIsFunction(context, NULL)); + + JSStringRef nullString = JSStringCreateWithUTF8CString(0); + const JSChar* characters = JSStringGetCharactersPtr(nullString); + if (characters) { + printf("FAIL: Didn't return null when accessing character pointer of a null String.\n"); + failed = 1; + } else + printf("PASS: returned null when accessing character pointer of a null String.\n"); + + JSStringRef emptyString = JSStringCreateWithCFString(CFSTR("")); + characters = JSStringGetCharactersPtr(emptyString); + if (!characters) { + printf("FAIL: Returned null when accessing character pointer of an empty String.\n"); + failed = 1; + } else + printf("PASS: returned empty when accessing character pointer of an empty String.\n"); + + size_t length = JSStringGetLength(nullString); + if (length) { + printf("FAIL: Didn't return 0 length for null String.\n"); + failed = 1; + } else + printf("PASS: returned 0 length for null String.\n"); + JSStringRelease(nullString); + + length = JSStringGetLength(emptyString); + if (length) { + printf("FAIL: Didn't return 0 length for empty String.\n"); + failed = 1; + } else + printf("PASS: returned 0 length for empty String.\n"); + JSStringRelease(emptyString); + JSObjectRef propertyCatchalls = JSObjectMake(context, PropertyCatchalls_class(context), NULL); JSStringRef propertyCatchallsString = JSStringCreateWithUTF8CString("PropertyCatchalls"); JSObjectSetProperty(context, globalObject, propertyCatchallsString, propertyCatchalls, kJSPropertyAttributeNone, NULL); @@ -1208,6 +1384,15 @@ int main(int argc, char* argv[]) } else printf("PASS: Retrieved private property.\n"); + JSStringRef nullJSON = JSStringCreateWithUTF8CString(0); + JSValueRef nullJSONObject = JSValueMakeFromJSONString(context, nullJSON); + if (nullJSONObject) { + printf("FAIL: Did not parse null String as JSON correctly\n"); + failed = 1; + } else + printf("PASS: Parsed null String as JSON correctly.\n"); + JSStringRelease(nullJSON); + JSStringRef validJSON = JSStringCreateWithUTF8CString("{\"aProperty\":true}"); JSValueRef jsonObject = JSValueMakeFromJSONString(context, validJSON); JSStringRelease(validJSON); @@ -1374,9 +1559,12 @@ int main(int argc, char* argv[]) JSValueUnprotect(context, jsNumberValue); JSStringRef goodSyntax = JSStringCreateWithUTF8CString("x = 1;"); - JSStringRef badSyntax = JSStringCreateWithUTF8CString("x := 1;"); + const char* badSyntaxConstant = "x := 1;"; + JSStringRef badSyntax = JSStringCreateWithUTF8CString(badSyntaxConstant); ASSERT(JSCheckScriptSyntax(context, goodSyntax, NULL, 0, NULL)); ASSERT(!JSCheckScriptSyntax(context, badSyntax, NULL, 0, NULL)); + ASSERT(!JSScriptCreateFromString(contextGroup, 0, 0, badSyntax, 0, 0)); + ASSERT(!JSScriptCreateReferencingImmortalASCIIText(contextGroup, 0, 0, badSyntaxConstant, strlen(badSyntaxConstant), 0, 0)); JSValueRef result; JSValueRef v; @@ -1565,13 +1753,21 @@ int main(int argc, char* argv[]) v = JSObjectCallAsFunction(context, function, o, 0, NULL, NULL); ASSERT(JSValueIsEqual(context, v, o, NULL)); - JSStringRef script = JSStringCreateWithUTF8CString("this;"); + const char* thisScript = "this;"; + JSStringRef script = JSStringCreateWithUTF8CString(thisScript); v = JSEvaluateScript(context, script, NULL, NULL, 1, NULL); ASSERT(JSValueIsEqual(context, v, globalObject, NULL)); v = JSEvaluateScript(context, script, o, NULL, 1, NULL); ASSERT(JSValueIsEqual(context, v, o, NULL)); JSStringRelease(script); + JSScriptRef scriptObject = JSScriptCreateReferencingImmortalASCIIText(contextGroup, 0, 0, thisScript, strlen(thisScript), 0, 0); + v = JSScriptEvaluate(context, scriptObject, NULL, NULL); + ASSERT(JSValueIsEqual(context, v, globalObject, NULL)); + v = JSScriptEvaluate(context, scriptObject, o, NULL); + ASSERT(JSValueIsEqual(context, v, o, NULL)); + JSScriptRelease(scriptObject); + script = JSStringCreateWithUTF8CString("eval(this);"); v = JSEvaluateScript(context, script, NULL, NULL, 1, NULL); ASSERT(JSValueIsEqual(context, v, globalObject, NULL)); @@ -1591,8 +1787,23 @@ int main(int argc, char* argv[]) printf("FAIL: Test script could not be loaded.\n"); failed = 1; } else { - script = JSStringCreateWithUTF8CString(scriptUTF8); - result = JSEvaluateScript(context, script, NULL, NULL, 1, &exception); + JSStringRef url = JSStringCreateWithUTF8CString(scriptPath); + JSStringRef script = JSStringCreateWithUTF8CString(scriptUTF8); + JSStringRef errorMessage = 0; + int errorLine = 0; + JSScriptRef scriptObject = JSScriptCreateFromString(contextGroup, url, 1, script, &errorMessage, &errorLine); + ASSERT((!scriptObject) != (!errorMessage)); + if (!scriptObject) { + printf("FAIL: Test script did not parse\n\t%s:%d\n\t", scriptPath, errorLine); + CFStringRef errorCF = JSStringCopyCFString(kCFAllocatorDefault, errorMessage); + CFShow(errorCF); + CFRelease(errorCF); + JSStringRelease(errorMessage); + failed = 1; + } + + JSStringRelease(script); + result = scriptObject ? JSScriptEvaluate(context, scriptObject, 0, &exception) : 0; if (result && JSValueIsUndefined(context, result)) printf("PASS: Test script executed successfully.\n"); else { @@ -1604,10 +1815,163 @@ int main(int argc, char* argv[]) JSStringRelease(exceptionIString); failed = 1; } - JSStringRelease(script); + JSScriptRelease(scriptObject); free(scriptUTF8); } +#if PLATFORM(MAC) || PLATFORM(IOS) + JSStringRef currentCPUTimeStr = JSStringCreateWithUTF8CString("currentCPUTime"); + JSObjectRef currentCPUTimeFunction = JSObjectMakeFunctionWithCallback(context, currentCPUTimeStr, currentCPUTime_callAsFunction); + JSObjectSetProperty(context, globalObject, currentCPUTimeStr, currentCPUTimeFunction, kJSPropertyAttributeNone, NULL); + JSStringRelease(currentCPUTimeStr); + + /* Test script timeout: */ + JSContextGroupSetExecutionTimeLimit(contextGroup, .10f, shouldTerminateCallback, 0); + { + const char* loopForeverScript = "var startTime = currentCPUTime(); while (true) { if (currentCPUTime() - startTime > .150) break; } "; + JSStringRef script = JSStringCreateWithUTF8CString(loopForeverScript); + double startTime; + double endTime; + exception = NULL; + shouldTerminateCallbackWasCalled = false; + startTime = currentCPUTime(); + v = JSEvaluateScript(context, script, NULL, NULL, 1, &exception); + endTime = currentCPUTime(); + + if (((endTime - startTime) < .150f) && shouldTerminateCallbackWasCalled) + printf("PASS: script timed out as expected.\n"); + else { + if (!((endTime - startTime) < .150f)) + printf("FAIL: script did not timed out as expected.\n"); + if (!shouldTerminateCallbackWasCalled) + printf("FAIL: script timeout callback was not called.\n"); + failed = true; + } + + if (!exception) { + printf("FAIL: TerminatedExecutionException was not thrown.\n"); + failed = true; + } + } + + /* Test the script timeout's TerminatedExecutionException should NOT be catchable: */ + JSContextGroupSetExecutionTimeLimit(contextGroup, 0.10f, shouldTerminateCallback, 0); + { + const char* loopForeverScript = "var startTime = currentCPUTime(); try { while (true) { if (currentCPUTime() - startTime > .150) break; } } catch(e) { }"; + JSStringRef script = JSStringCreateWithUTF8CString(loopForeverScript); + double startTime; + double endTime; + exception = NULL; + shouldTerminateCallbackWasCalled = false; + startTime = currentCPUTime(); + v = JSEvaluateScript(context, script, NULL, NULL, 1, &exception); + endTime = currentCPUTime(); + + if (((endTime - startTime) >= .150f) || !shouldTerminateCallbackWasCalled) { + if (!((endTime - startTime) < .150f)) + printf("FAIL: script did not timed out as expected.\n"); + if (!shouldTerminateCallbackWasCalled) + printf("FAIL: script timeout callback was not called.\n"); + failed = true; + } + + if (exception) + printf("PASS: TerminatedExecutionException was not catchable as expected.\n"); + else { + printf("FAIL: TerminatedExecutionException was caught.\n"); + failed = true; + } + } + + /* Test script timeout with no callback: */ + JSContextGroupSetExecutionTimeLimit(contextGroup, .10f, 0, 0); + { + const char* loopForeverScript = "var startTime = currentCPUTime(); while (true) { if (currentCPUTime() - startTime > .150) break; } "; + JSStringRef script = JSStringCreateWithUTF8CString(loopForeverScript); + double startTime; + double endTime; + exception = NULL; + startTime = currentCPUTime(); + v = JSEvaluateScript(context, script, NULL, NULL, 1, &exception); + endTime = currentCPUTime(); + + if (((endTime - startTime) < .150f) && shouldTerminateCallbackWasCalled) + printf("PASS: script timed out as expected when no callback is specified.\n"); + else { + if (!((endTime - startTime) < .150f)) + printf("FAIL: script did not timed out as expected when no callback is specified.\n"); + failed = true; + } + + if (!exception) { + printf("FAIL: TerminatedExecutionException was not thrown.\n"); + failed = true; + } + } + + /* Test script timeout cancellation: */ + JSContextGroupSetExecutionTimeLimit(contextGroup, 0.10f, cancelTerminateCallback, 0); + { + const char* loopForeverScript = "var startTime = currentCPUTime(); while (true) { if (currentCPUTime() - startTime > .150) break; } "; + JSStringRef script = JSStringCreateWithUTF8CString(loopForeverScript); + double startTime; + double endTime; + exception = NULL; + startTime = currentCPUTime(); + v = JSEvaluateScript(context, script, NULL, NULL, 1, &exception); + endTime = currentCPUTime(); + + if (((endTime - startTime) >= .150f) && cancelTerminateCallbackWasCalled && !exception) + printf("PASS: script timeout was cancelled as expected.\n"); + else { + if (((endTime - startTime) < .150) || exception) + printf("FAIL: script timeout was not cancelled.\n"); + if (!cancelTerminateCallbackWasCalled) + printf("FAIL: script timeout callback was not called.\n"); + failed = true; + } + + if (exception) { + printf("FAIL: Unexpected TerminatedExecutionException thrown.\n"); + failed = true; + } + } + + /* Test script timeout extension: */ + JSContextGroupSetExecutionTimeLimit(contextGroup, 0.100f, extendTerminateCallback, 0); + { + const char* loopForeverScript = "var startTime = currentCPUTime(); while (true) { if (currentCPUTime() - startTime > .500) break; } "; + JSStringRef script = JSStringCreateWithUTF8CString(loopForeverScript); + double startTime; + double endTime; + double deltaTime; + exception = NULL; + startTime = currentCPUTime(); + v = JSEvaluateScript(context, script, NULL, NULL, 1, &exception); + endTime = currentCPUTime(); + deltaTime = endTime - startTime; + + if ((deltaTime >= .300f) && (deltaTime < .500f) && (extendTerminateCallbackCalled == 2) && exception) + printf("PASS: script timeout was extended as expected.\n"); + else { + if (deltaTime < .200f) + printf("FAIL: script timeout was not extended as expected.\n"); + else if (deltaTime >= .500f) + printf("FAIL: script did not timeout.\n"); + + if (extendTerminateCallbackCalled < 1) + printf("FAIL: script timeout callback was not called.\n"); + if (extendTerminateCallbackCalled < 2) + printf("FAIL: script timeout callback was not called after timeout extension.\n"); + + if (!exception) + printf("FAIL: TerminatedExecutionException was not thrown during timeout extension test.\n"); + + failed = true; + } + } +#endif /* PLATFORM(MAC) || PLATFORM(IOS) */ + // Clear out local variables pointing at JSObjectRefs to allow their values to be collected function = NULL; v = NULL; @@ -1649,6 +2013,8 @@ int main(int argc, char* argv[]) printf("FAIL: A cycle in a prototype chain can be created.\n"); failed = true; } + if (valueToObjectExceptionTest()) + printf("PASS: throwException did not crash when handling an error with appendMessageToError set and no codeBlock available.\n"); if (failed) { printf("FAIL: Some tests failed.\n"); @@ -1670,6 +2036,7 @@ static char* createStringWithContentsOfFile(const char* fileName) FILE* f = fopen(fileName, "r"); if (!f) { fprintf(stderr, "Could not open file: %s\n", fileName); + free(buffer); return 0; } diff --git a/JavaScriptCore/API/tests/testapi.js b/JavaScriptCore/API/tests/testapi.js index 28fa5443..47c20a83 100644 --- a/JavaScriptCore/API/tests/testapi.js +++ b/JavaScriptCore/API/tests/testapi.js @@ -262,6 +262,10 @@ shouldBe("PropertyCatchalls.x", 4); for (var i = 0; i < 6; ++i) var x = PropertyCatchalls.x; shouldBe("x", null); +var make_throw = 'make_throw'; +shouldThrow("PropertyCatchalls[make_throw]=1"); +make_throw = 0; +shouldThrow("PropertyCatchalls[make_throw]=1"); for (var i = 0; i < 10; ++i) { for (var p in PropertyCatchalls) { diff --git a/JavaScriptCore/API/tests/testapi.mm b/JavaScriptCore/API/tests/testapi.mm new file mode 100644 index 00000000..3ef3eb33 --- /dev/null +++ b/JavaScriptCore/API/tests/testapi.mm @@ -0,0 +1,1132 @@ +/* + * Copyright (C) 2013 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. + */ + +#import + +#import "CurrentThisInsideBlockGetterTest.h" + +extern "C" void JSSynchronousGarbageCollectForDebugging(JSContextRef); + +extern "C" bool _Block_has_signature(id); +extern "C" const char * _Block_signature(id); + +extern int failed; +extern "C" void testObjectiveCAPI(void); + +#if JSC_OBJC_API_ENABLED && __MAC_OS_X_VERSION_MIN_REQUIRED >= 1090 + +@protocol ParentObject +@end + +@interface ParentObject : NSObject ++ (NSString *)parentTest; +@end + +@implementation ParentObject ++ (NSString *)parentTest +{ + return [self description]; +} +@end + +@protocol TestObject +- (id)init; +@property int variable; +@property (readonly) int six; +@property CGPoint point; ++ (NSString *)classTest; ++ (NSString *)parentTest; +- (NSString *)getString; +JSExportAs(testArgumentTypes, +- (NSString *)testArgumentTypesWithInt:(int)i double:(double)d boolean:(BOOL)b string:(NSString *)s number:(NSNumber *)n array:(NSArray *)a dictionary:(NSDictionary *)o +); +- (void)callback:(JSValue *)function; +- (void)bogusCallback:(void(^)(int))function; +@end + +@interface TestObject : ParentObject +@property int six; ++ (id)testObject; +@end + +@implementation TestObject +@synthesize variable; +@synthesize six; +@synthesize point; ++ (id)testObject +{ + return [[TestObject alloc] init]; +} ++ (NSString *)classTest +{ + return @"classTest - okay"; +} +- (NSString *)getString +{ + return @"42"; +} +- (NSString *)testArgumentTypesWithInt:(int)i double:(double)d boolean:(BOOL)b string:(NSString *)s number:(NSNumber *)n array:(NSArray *)a dictionary:(NSDictionary *)o +{ + return [NSString stringWithFormat:@"%d,%g,%d,%@,%d,%@,%@", i, d, b==YES?true:false,s,[n intValue],a[1],o[@"x"]]; +} +- (void)callback:(JSValue *)function +{ + [function callWithArguments:[NSArray arrayWithObject:[NSNumber numberWithInt:42]]]; +} +- (void)bogusCallback:(void(^)(int))function +{ + function(42); +} +@end + +bool testXYZTested = false; + +@protocol TextXYZ +- (id)initWithString:(NSString*)string; +@property int x; +@property (readonly) int y; +@property (assign) JSValue *onclick; +@property (assign) JSValue *weakOnclick; +- (void)test:(NSString *)message; +@end + +@interface TextXYZ : NSObject +@property int x; +@property int y; +@property int z; +- (void)click; +@end + +@implementation TextXYZ { + JSManagedValue *m_weakOnclickHandler; + JSManagedValue *m_onclickHandler; +} +@synthesize x; +@synthesize y; +@synthesize z; +- (id)initWithString:(NSString*)string +{ + self = [super init]; + if (!self) + return nil; + + NSLog(@"%@", string); + + return self; +} +- (void)test:(NSString *)message +{ + testXYZTested = [message isEqual:@"test"] && x == 13 & y == 4 && z == 5; +} +- (void)setWeakOnclick:(JSValue *)value +{ + m_weakOnclickHandler = [JSManagedValue managedValueWithValue:value]; +} + +- (void)setOnclick:(JSValue *)value +{ + m_onclickHandler = [JSManagedValue managedValueWithValue:value]; + [value.context.virtualMachine addManagedReference:m_onclickHandler withOwner:self]; +} +- (JSValue *)weakOnclick +{ + return [m_weakOnclickHandler value]; +} +- (JSValue *)onclick +{ + return [m_onclickHandler value]; +} +- (void)click +{ + if (!m_onclickHandler) + return; + + JSValue *function = [m_onclickHandler value]; + [function callWithArguments:[NSArray array]]; +} +- (void)dealloc +{ + [[m_onclickHandler value].context.virtualMachine removeManagedReference:m_onclickHandler withOwner:self]; +} +@end + +@class TinyDOMNode; + +@protocol TinyDOMNode +- (void)appendChild:(TinyDOMNode *)child; +- (NSUInteger)numberOfChildren; +- (TinyDOMNode *)childAtIndex:(NSUInteger)index; +- (void)removeChildAtIndex:(NSUInteger)index; +@end + +@interface TinyDOMNode : NSObject ++ (JSVirtualMachine *)sharedVirtualMachine; ++ (void)clearSharedVirtualMachine; +@end + +@implementation TinyDOMNode { + NSMutableArray *m_children; +} + +static JSVirtualMachine *sharedInstance = nil; + ++ (JSVirtualMachine *)sharedVirtualMachine +{ + if (!sharedInstance) + sharedInstance = [[JSVirtualMachine alloc] init]; + return sharedInstance; +} + ++ (void)clearSharedVirtualMachine +{ + sharedInstance = nil; +} + +- (id)init +{ + self = [super init]; + if (!self) + return nil; + + m_children = [[NSMutableArray alloc] initWithCapacity:0]; + + return self; +} + +- (void)dealloc +{ + NSEnumerator *enumerator = [m_children objectEnumerator]; + id nextChild; + while ((nextChild = [enumerator nextObject])) + [[TinyDOMNode sharedVirtualMachine] removeManagedReference:nextChild withOwner:self]; + +#if !__has_feature(objc_arc) + [super dealloc]; +#endif +} + +- (void)appendChild:(TinyDOMNode *)child +{ + [[TinyDOMNode sharedVirtualMachine] addManagedReference:child withOwner:self]; + [m_children addObject:child]; +} + +- (NSUInteger)numberOfChildren +{ + return [m_children count]; +} + +- (TinyDOMNode *)childAtIndex:(NSUInteger)index +{ + if (index >= [m_children count]) + return nil; + return [m_children objectAtIndex:index]; +} + +- (void)removeChildAtIndex:(NSUInteger)index +{ + if (index >= [m_children count]) + return; + [[TinyDOMNode sharedVirtualMachine] removeManagedReference:[m_children objectAtIndex:index] withOwner:self]; + [m_children removeObjectAtIndex:index]; +} + +@end + +@interface JSCollection : NSObject +- (void)setValue:(JSValue *)value forKey:(NSString *)key; +- (JSValue *)valueForKey:(NSString *)key; +@end + +@implementation JSCollection { + NSMutableDictionary *_dict; +} +- (id)init +{ + self = [super init]; + if (!self) + return nil; + + _dict = [[NSMutableDictionary alloc] init]; + + return self; +} + +- (void)setValue:(JSValue *)value forKey:(NSString *)key +{ + JSManagedValue *oldManagedValue = [_dict objectForKey:key]; + if (oldManagedValue) { + JSValue* oldValue = [oldManagedValue value]; + if (oldValue) + [oldValue.context.virtualMachine removeManagedReference:oldManagedValue withOwner:self]; + } + JSManagedValue *managedValue = [JSManagedValue managedValueWithValue:value]; + [value.context.virtualMachine addManagedReference:managedValue withOwner:self]; + [_dict setObject:managedValue forKey:key]; +} + +- (JSValue *)valueForKey:(NSString *)key +{ + JSManagedValue *managedValue = [_dict objectForKey:key]; + if (!managedValue) + return nil; + return [managedValue value]; +} +@end + +@protocol InitA +- (id)initWithA:(int)a; +@end + +@protocol InitB +- (id)initWithA:(int)a b:(int)b; +@end + +@interface ClassA : NSObject +@end + +@interface ClassB : ClassA +@end + +@interface ClassC : ClassB +@end + +@interface ClassD : NSObject +- (id)initWithA:(int)a; +@end + +@interface ClassE : ClassD +- (id)initWithA:(int)a; +@end + +@implementation ClassA { + int _a; +} +- (id)initWithA:(int)a +{ + self = [super init]; + if (!self) + return nil; + + _a = a; + + return self; +} +@end + +@implementation ClassB { + int _b; +} +- (id)initWithA:(int)a b:(int)b +{ + self = [super initWithA:a]; + if (!self) + return nil; + + _b = b; + + return self; +} +@end + +@implementation ClassC { + int _c; +} +- (id)initWithA:(int)a +{ + return [self initWithA:a b:0]; +} +- (id)initWithA:(int)a b:(int)b +{ + self = [super initWithA:a b:b]; + if (!self) + return nil; + + _c = a + b; + + return self; +} +@end + +@implementation ClassD + +- (id)initWithA:(int)a +{ + self = nil; + return [[ClassE alloc] initWithA:a]; +} +@end + +@implementation ClassE { + int _a; +} + +- (id)initWithA:(int)a +{ + self = [super init]; + if (!self) + return nil; + + _a = a; + + return self; +} +@end +static void checkResult(NSString *description, bool passed) +{ + NSLog(@"TEST: \"%@\": %@", description, passed ? @"PASSED" : @"FAILED"); + if (!passed) + failed = 1; +} + +static bool blockSignatureContainsClass() +{ + static bool containsClass = ^{ + id block = ^(NSString *string){ return string; }; + return _Block_has_signature(block) && strstr(_Block_signature(block), "NSString"); + }(); + return containsClass; +} + +void testObjectiveCAPI() +{ + NSLog(@"Testing Objective-C API"); + + @autoreleasepool { + JSContext *context = [[JSContext alloc] init]; + JSValue *result = [context evaluateScript:@"2 + 2"]; + checkResult(@"2 + 2", [result isNumber] && [result toInt32] == 4); + } + + @autoreleasepool { + JSContext *context = [[JSContext alloc] init]; + NSString *result = [NSString stringWithFormat:@"Two plus two is %@", [context evaluateScript:@"2 + 2"]]; + checkResult(@"stringWithFormat", [result isEqual:@"Two plus two is 4"]); + } + + @autoreleasepool { + JSContext *context = [[JSContext alloc] init]; + context[@"message"] = @"Hello"; + JSValue *result = [context evaluateScript:@"message + ', World!'"]; + checkResult(@"Hello, World!", [result isString] && [result isEqualToObject:@"Hello, World!"]); + } + + @autoreleasepool { + JSContext *context = [[JSContext alloc] init]; + JSValue *result = [context evaluateScript:@"({ x:42 })"]; + checkResult(@"({ x:42 })", [result isObject] && [result[@"x"] isEqualToObject:@42]); + id obj = [result toObject]; + checkResult(@"Check dictionary literal", [obj isKindOfClass:[NSDictionary class]]); + id num = (NSDictionary *)obj[@"x"]; + checkResult(@"Check numeric literal", [num isKindOfClass:[NSNumber class]]); + } + + @autoreleasepool { + JSCollection* myPrivateProperties = [[JSCollection alloc] init]; + + @autoreleasepool { + JSContext* context = [[JSContext alloc] init]; + TestObject* rootObject = [TestObject testObject]; + context[@"root"] = rootObject; + [context.virtualMachine addManagedReference:myPrivateProperties withOwner:rootObject]; + [myPrivateProperties setValue:[JSValue valueWithBool:true inContext:context] forKey:@"is_ham"]; + [myPrivateProperties setValue:[JSValue valueWithObject:@"hello!" inContext:context] forKey:@"message"]; + [myPrivateProperties setValue:[JSValue valueWithInt32:42 inContext:context] forKey:@"my_number"]; + [myPrivateProperties setValue:[JSValue valueWithNullInContext:context] forKey:@"definitely_null"]; + [myPrivateProperties setValue:[JSValue valueWithUndefinedInContext:context] forKey:@"not_sure_if_undefined"]; + + JSSynchronousGarbageCollectForDebugging([context JSGlobalContextRef]); + + JSValue *isHam = [myPrivateProperties valueForKey:@"is_ham"]; + JSValue *message = [myPrivateProperties valueForKey:@"message"]; + JSValue *myNumber = [myPrivateProperties valueForKey:@"my_number"]; + JSValue *definitelyNull = [myPrivateProperties valueForKey:@"definitely_null"]; + JSValue *notSureIfUndefined = [myPrivateProperties valueForKey:@"not_sure_if_undefined"]; + checkResult(@"is_ham is true", [isHam isBoolean] && [isHam toBool]); + checkResult(@"message is hello!", [message isString] && [@"hello!" isEqualToString:[message toString]]); + checkResult(@"my_number is 42", [myNumber isNumber] && [myNumber toInt32] == 42); + checkResult(@"definitely_null is null", [definitelyNull isNull]); + checkResult(@"not_sure_if_undefined is undefined", [notSureIfUndefined isUndefined]); + } + + checkResult(@"is_ham is nil", ![myPrivateProperties valueForKey:@"is_ham"]); + checkResult(@"message is nil", ![myPrivateProperties valueForKey:@"message"]); + checkResult(@"my_number is 42", ![myPrivateProperties valueForKey:@"my_number"]); + checkResult(@"definitely_null is null", ![myPrivateProperties valueForKey:@"definitely_null"]); + checkResult(@"not_sure_if_undefined is undefined", ![myPrivateProperties valueForKey:@"not_sure_if_undefined"]); + } + + @autoreleasepool { + JSContext *context = [[JSContext alloc] init]; + __block int result; + context[@"blockCallback"] = ^(int value){ + result = value; + }; + [context evaluateScript:@"blockCallback(42)"]; + checkResult(@"blockCallback", result == 42); + } + + if (blockSignatureContainsClass()) { + @autoreleasepool { + JSContext *context = [[JSContext alloc] init]; + __block bool result = false; + context[@"blockCallback"] = ^(NSString *value){ + result = [@"42" isEqualToString:value] == YES; + }; + [context evaluateScript:@"blockCallback(42)"]; + checkResult(@"blockCallback(NSString *)", result); + } + } else + NSLog(@"Skipping 'blockCallback(NSString *)' test case"); + + @autoreleasepool { + JSContext *context = [[JSContext alloc] init]; + checkResult(@"!context.exception", !context.exception); + [context evaluateScript:@"!@#$%^&*() THIS IS NOT VALID JAVASCRIPT SYNTAX !@#$%^&*()"]; + checkResult(@"context.exception", context.exception); + } + + @autoreleasepool { + JSContext *context = [[JSContext alloc] init]; + __block bool caught = false; + context.exceptionHandler = ^(JSContext *context, JSValue *exception) { + (void)context; + (void)exception; + caught = true; + }; + [context evaluateScript:@"!@#$%^&*() THIS IS NOT VALID JAVASCRIPT SYNTAX !@#$%^&*()"]; + checkResult(@"JSContext.exceptionHandler", caught); + } + + @autoreleasepool { + JSContext *context = [[JSContext alloc] init]; + context[@"callback"] = ^{ + JSContext *context = [JSContext currentContext]; + context.exception = [JSValue valueWithNewErrorFromMessage:@"Something went wrong." inContext:context]; + }; + JSValue *result = [context evaluateScript:@"var result; try { callback(); } catch (e) { result = 'Caught exception'; }"]; + checkResult(@"Explicit throw in callback - was caught by JavaScript", [result isEqualToObject:@"Caught exception"]); + checkResult(@"Explicit throw in callback - not thrown to Objective-C", !context.exception); + } + + @autoreleasepool { + JSContext *context = [[JSContext alloc] init]; + context[@"callback"] = ^{ + JSContext *context = [JSContext currentContext]; + [context evaluateScript:@"!@#$%^&*() THIS IS NOT VALID JAVASCRIPT SYNTAX !@#$%^&*()"]; + }; + JSValue *result = [context evaluateScript:@"var result; try { callback(); } catch (e) { result = 'Caught exception'; }"]; + checkResult(@"Implicit throw in callback - was caught by JavaScript", [result isEqualToObject:@"Caught exception"]); + checkResult(@"Implicit throw in callback - not thrown to Objective-C", !context.exception); + } + + @autoreleasepool { + JSContext *context = [[JSContext alloc] init]; + [context evaluateScript: + @"function sum(array) { \ + var result = 0; \ + for (var i in array) \ + result += array[i]; \ + return result; \ + }"]; + JSValue *array = [JSValue valueWithObject:@[@13, @2, @7] inContext:context]; + JSValue *sumFunction = context[@"sum"]; + JSValue *result = [sumFunction callWithArguments:@[ array ]]; + checkResult(@"sum([13, 2, 7])", [result toInt32] == 22); + } + + @autoreleasepool { + JSContext *context = [[JSContext alloc] init]; + JSValue *mulAddFunction = [context evaluateScript: + @"(function(array, object) { \ + var result = []; \ + for (var i in array) \ + result.push(array[i] * object.x + object.y); \ + return result; \ + })"]; + JSValue *result = [mulAddFunction callWithArguments:@[ @[ @2, @4, @8 ], @{ @"x":@0.5, @"y":@42 } ]]; + checkResult(@"mulAddFunction", [result isObject] && [[result toString] isEqual:@"43,44,46"]); + } + + @autoreleasepool { + JSContext *context = [[JSContext alloc] init]; + JSValue *array = [JSValue valueWithNewArrayInContext:context]; + checkResult(@"arrayLengthEmpty", [[array[@"length"] toNumber] unsignedIntegerValue] == 0); + JSValue *value1 = [JSValue valueWithInt32:42 inContext:context]; + JSValue *value2 = [JSValue valueWithInt32:24 inContext:context]; + NSUInteger lowIndex = 5; + NSUInteger maxLength = UINT_MAX; + + [array setValue:value1 atIndex:lowIndex]; + checkResult(@"array.length after put to low index", [[array[@"length"] toNumber] unsignedIntegerValue] == (lowIndex + 1)); + + [array setValue:value1 atIndex:(maxLength - 1)]; + checkResult(@"array.length after put to maxLength - 1", [[array[@"length"] toNumber] unsignedIntegerValue] == maxLength); + + [array setValue:value2 atIndex:maxLength]; + checkResult(@"array.length after put to maxLength", [[array[@"length"] toNumber] unsignedIntegerValue] == maxLength); + + [array setValue:value2 atIndex:(maxLength + 1)]; + checkResult(@"array.length after put to maxLength + 1", [[array[@"length"] toNumber] unsignedIntegerValue] == maxLength); + + if (sizeof(NSUInteger) == 8) + checkResult(@"valueAtIndex:0 is undefined", [[array valueAtIndex:0] isUndefined]); + else + checkResult(@"valueAtIndex:0", [[array valueAtIndex:0] toInt32] == 24); + checkResult(@"valueAtIndex:lowIndex", [[array valueAtIndex:lowIndex] toInt32] == 42); + checkResult(@"valueAtIndex:maxLength - 1", [[array valueAtIndex:(maxLength - 1)] toInt32] == 42); + checkResult(@"valueAtIndex:maxLength", [[array valueAtIndex:maxLength] toInt32] == 24); + checkResult(@"valueAtIndex:maxLength + 1", [[array valueAtIndex:(maxLength + 1)] toInt32] == 24); + } + + @autoreleasepool { + JSContext *context = [[JSContext alloc] init]; + JSValue *object = [JSValue valueWithNewObjectInContext:context]; + + object[@"point"] = @{ @"x":@1, @"y":@2 }; + object[@"point"][@"x"] = @3; + CGPoint point = [object[@"point"] toPoint]; + checkResult(@"toPoint", point.x == 3 && point.y == 2); + + object[@{ @"toString":^{ return @"foo"; } }] = @"bar"; + checkResult(@"toString in object literal used as subscript", [[object[@"foo"] toString] isEqual:@"bar"]); + + object[[@"foobar" substringToIndex:3]] = @"bar"; + checkResult(@"substring used as subscript", [[object[@"foo"] toString] isEqual:@"bar"]); + } + + @autoreleasepool { + JSContext *context = [[JSContext alloc] init]; + TextXYZ *testXYZ = [[TextXYZ alloc] init]; + context[@"testXYZ"] = testXYZ; + testXYZ.x = 3; + testXYZ.y = 4; + testXYZ.z = 5; + [context evaluateScript:@"testXYZ.x = 13; testXYZ.y = 14;"]; + [context evaluateScript:@"testXYZ.test('test')"]; + checkResult(@"TextXYZ - testXYZTested", testXYZTested); + JSValue *result = [context evaluateScript:@"testXYZ.x + ',' + testXYZ.y + ',' + testXYZ.z"]; + checkResult(@"TextXYZ - result", [result isEqualToObject:@"13,4,undefined"]); + } + + @autoreleasepool { + JSContext *context = [[JSContext alloc] init]; + [context[@"Object"][@"prototype"] defineProperty:@"getterProperty" descriptor:@{ + JSPropertyDescriptorGetKey:^{ + return [JSContext currentThis][@"x"]; + } + }]; + JSValue *object = [JSValue valueWithObject:@{ @"x":@101 } inContext:context]; + int result = [object [@"getterProperty"] toInt32]; + checkResult(@"getterProperty", result == 101); + } + + @autoreleasepool { + JSContext *context = [[JSContext alloc] init]; + context[@"concatenate"] = ^{ + NSArray *arguments = [JSContext currentArguments]; + if (![arguments count]) + return @""; + NSString *message = [arguments[0] description]; + for (NSUInteger index = 1; index < [arguments count]; ++index) + message = [NSString stringWithFormat:@"%@ %@", message, arguments[index]]; + return message; + }; + JSValue *result = [context evaluateScript:@"concatenate('Hello,', 'World!')"]; + checkResult(@"concatenate", [result isEqualToObject:@"Hello, World!"]); + } + + @autoreleasepool { + JSContext *context = [[JSContext alloc] init]; + context[@"foo"] = @YES; + checkResult(@"@YES is boolean", [context[@"foo"] isBoolean]); + JSValue *result = [context evaluateScript:@"typeof foo"]; + checkResult(@"@YES is boolean", [result isEqualToObject:@"boolean"]); + } + + @autoreleasepool { + JSContext *context = [[JSContext alloc] init]; + TestObject* testObject = [TestObject testObject]; + context[@"testObject"] = testObject; + JSValue *result = [context evaluateScript:@"String(testObject)"]; + checkResult(@"String(testObject)", [result isEqualToObject:@"[object TestObject]"]); + } + + @autoreleasepool { + JSContext *context = [[JSContext alloc] init]; + TestObject* testObject = [TestObject testObject]; + context[@"testObject"] = testObject; + JSValue *result = [context evaluateScript:@"String(testObject.__proto__)"]; + checkResult(@"String(testObject.__proto__)", [result isEqualToObject:@"[object TestObjectPrototype]"]); + } + + @autoreleasepool { + JSContext *context = [[JSContext alloc] init]; + context[@"TestObject"] = [TestObject class]; + JSValue *result = [context evaluateScript:@"String(TestObject)"]; + checkResult(@"String(TestObject)", [result isEqualToObject:@"function TestObject() {\n [native code]\n}"]); + } + + @autoreleasepool { + JSContext *context = [[JSContext alloc] init]; + JSValue* value = [JSValue valueWithObject:[TestObject class] inContext:context]; + checkResult(@"[value toObject] == [TestObject class]", [value toObject] == [TestObject class]); + } + + @autoreleasepool { + JSContext *context = [[JSContext alloc] init]; + context[@"TestObject"] = [TestObject class]; + JSValue *result = [context evaluateScript:@"TestObject.parentTest()"]; + checkResult(@"TestObject.parentTest()", [result isEqualToObject:@"TestObject"]); + } + + @autoreleasepool { + JSContext *context = [[JSContext alloc] init]; + TestObject* testObject = [TestObject testObject]; + context[@"testObjectA"] = testObject; + context[@"testObjectB"] = testObject; + JSValue *result = [context evaluateScript:@"testObjectA == testObjectB"]; + checkResult(@"testObjectA == testObjectB", [result isBoolean] && [result toBool]); + } + + @autoreleasepool { + JSContext *context = [[JSContext alloc] init]; + TestObject* testObject = [TestObject testObject]; + context[@"testObject"] = testObject; + testObject.point = (CGPoint){3,4}; + JSValue *result = [context evaluateScript:@"var result = JSON.stringify(testObject.point); testObject.point = {x:12,y:14}; result"]; + checkResult(@"testObject.point - result", [result isEqualToObject:@"{\"x\":3,\"y\":4}"]); + checkResult(@"testObject.point - {x:12,y:14}", testObject.point.x == 12 && testObject.point.y == 14); + } + + @autoreleasepool { + JSContext *context = [[JSContext alloc] init]; + TestObject* testObject = [TestObject testObject]; + testObject.six = 6; + context[@"testObject"] = testObject; + context[@"mul"] = ^(int x, int y){ return x * y; }; + JSValue *result = [context evaluateScript:@"mul(testObject.six, 7)"]; + checkResult(@"mul(testObject.six, 7)", [result isNumber] && [result toInt32] == 42); + } + + @autoreleasepool { + JSContext *context = [[JSContext alloc] init]; + TestObject* testObject = [TestObject testObject]; + context[@"testObject"] = testObject; + context[@"testObject"][@"variable"] = @4; + [context evaluateScript:@"++testObject.variable"]; + checkResult(@"++testObject.variable", testObject.variable == 5); + } + + @autoreleasepool { + JSContext *context = [[JSContext alloc] init]; + context[@"point"] = @{ @"x":@6, @"y":@7 }; + JSValue *result = [context evaluateScript:@"point.x + ',' + point.y"]; + checkResult(@"point.x + ',' + point.y", [result isEqualToObject:@"6,7"]); + } + + @autoreleasepool { + JSContext *context = [[JSContext alloc] init]; + context[@"point"] = @{ @"x":@6, @"y":@7 }; + JSValue *result = [context evaluateScript:@"point.x + ',' + point.y"]; + checkResult(@"point.x + ',' + point.y", [result isEqualToObject:@"6,7"]); + } + + @autoreleasepool { + JSContext *context = [[JSContext alloc] init]; + TestObject* testObject = [TestObject testObject]; + context[@"testObject"] = testObject; + JSValue *result = [context evaluateScript:@"testObject.getString()"]; + checkResult(@"testObject.getString()", [result isString] && [result toInt32] == 42); + } + + @autoreleasepool { + JSContext *context = [[JSContext alloc] init]; + TestObject* testObject = [TestObject testObject]; + context[@"testObject"] = testObject; + JSValue *result = [context evaluateScript:@"testObject.testArgumentTypes(101,0.5,true,'foo',666,[false,'bar',false],{x:'baz'})"]; + checkResult(@"testObject.testArgumentTypes", [result isEqualToObject:@"101,0.5,1,foo,666,bar,baz"]); + } + + @autoreleasepool { + JSContext *context = [[JSContext alloc] init]; + TestObject* testObject = [TestObject testObject]; + context[@"testObject"] = testObject; + JSValue *result = [context evaluateScript:@"testObject.getString.call(testObject)"]; + checkResult(@"testObject.getString.call(testObject)", [result isString] && [result toInt32] == 42); + } + + @autoreleasepool { + JSContext *context = [[JSContext alloc] init]; + TestObject* testObject = [TestObject testObject]; + context[@"testObject"] = testObject; + checkResult(@"testObject.getString.call({}) pre", !context.exception); + [context evaluateScript:@"testObject.getString.call({})"]; + checkResult(@"testObject.getString.call({}) post", context.exception); + } + + @autoreleasepool { + JSContext *context = [[JSContext alloc] init]; + TestObject* testObject = [TestObject testObject]; + context[@"testObject"] = testObject; + JSValue *result = [context evaluateScript:@"var result = 0; testObject.callback(function(x){ result = x; }); result"]; + checkResult(@"testObject.callback", [result isNumber] && [result toInt32] == 42); + result = [context evaluateScript:@"testObject.bogusCallback"]; + checkResult(@"testObject.bogusCallback == undefined", [result isUndefined]); + } + + @autoreleasepool { + JSContext *context = [[JSContext alloc] init]; + TestObject *testObject = [TestObject testObject]; + context[@"testObject"] = testObject; + JSValue *result = [context evaluateScript:@"Function.prototype.toString.call(testObject.callback)"]; + checkResult(@"Function.prototype.toString", !context.exception && ![result isUndefined]); + } + + @autoreleasepool { + JSContext *context1 = [[JSContext alloc] init]; + JSContext *context2 = [[JSContext alloc] initWithVirtualMachine:context1.virtualMachine]; + JSValue *value = [JSValue valueWithDouble:42 inContext:context2]; + context1[@"passValueBetweenContexts"] = value; + JSValue *result = [context1 evaluateScript:@"passValueBetweenContexts"]; + checkResult(@"[value isEqualToObject:result]", [value isEqualToObject:result]); + } + + @autoreleasepool { + JSContext *context = [[JSContext alloc] init]; + context[@"handleTheDictionary"] = ^(NSDictionary *dict) { + NSDictionary *expectedDict = @{ + @"foo" : [NSNumber numberWithInt:1], + @"bar" : @{ + @"baz": [NSNumber numberWithInt:2] + } + }; + checkResult(@"recursively convert nested dictionaries", [dict isEqualToDictionary:expectedDict]); + }; + [context evaluateScript:@"var myDict = { \ + 'foo': 1, \ + 'bar': {'baz': 2} \ + }; \ + handleTheDictionary(myDict);"]; + + context[@"handleTheArray"] = ^(NSArray *array) { + NSArray *expectedArray = @[@"foo", @"bar", @[@"baz"]]; + checkResult(@"recursively convert nested arrays", [array isEqualToArray:expectedArray]); + }; + [context evaluateScript:@"var myArray = ['foo', 'bar', ['baz']]; handleTheArray(myArray);"]; + } + + @autoreleasepool { + JSContext *context = [[JSContext alloc] init]; + TestObject *testObject = [TestObject testObject]; + @autoreleasepool { + context[@"testObject"] = testObject; + [context evaluateScript:@"var constructor = Object.getPrototypeOf(testObject).constructor; constructor.prototype = undefined;"]; + [context evaluateScript:@"testObject = undefined"]; + } + + JSSynchronousGarbageCollectForDebugging([context JSGlobalContextRef]); + + @autoreleasepool { + context[@"testObject"] = testObject; + } + } + + @autoreleasepool { + JSContext *context = [[JSContext alloc] init]; + TextXYZ *testXYZ = [[TextXYZ alloc] init]; + + @autoreleasepool { + context[@"testXYZ"] = testXYZ; + + [context evaluateScript:@" \ + didClick = false; \ + testXYZ.onclick = function() { \ + didClick = true; \ + }; \ + \ + testXYZ.weakOnclick = function() { \ + return 'foo'; \ + }; \ + "]; + } + + @autoreleasepool { + [testXYZ click]; + JSValue *result = [context evaluateScript:@"didClick"]; + checkResult(@"Event handler onclick", [result toBool]); + } + + JSSynchronousGarbageCollectForDebugging([context JSGlobalContextRef]); + + @autoreleasepool { + JSValue *result = [context evaluateScript:@"testXYZ.onclick"]; + checkResult(@"onclick still around after GC", !([result isNull] || [result isUndefined])); + } + + + @autoreleasepool { + JSValue *result = [context evaluateScript:@"testXYZ.weakOnclick"]; + checkResult(@"weakOnclick not around after GC", [result isNull] || [result isUndefined]); + } + + @autoreleasepool { + [context evaluateScript:@" \ + didClick = false; \ + testXYZ = null; \ + "]; + } + + JSSynchronousGarbageCollectForDebugging([context JSGlobalContextRef]); + + @autoreleasepool { + [testXYZ click]; + JSValue *result = [context evaluateScript:@"didClick"]; + checkResult(@"Event handler onclick doesn't fire", ![result toBool]); + } + } + + @autoreleasepool { + JSVirtualMachine *vm = [[JSVirtualMachine alloc] init]; + TestObject *testObject = [TestObject testObject]; + JSManagedValue *weakValue; + @autoreleasepool { + JSContext *context = [[JSContext alloc] initWithVirtualMachine:vm]; + context[@"testObject"] = testObject; + weakValue = [[JSManagedValue alloc] initWithValue:context[@"testObject"]]; + } + + @autoreleasepool { + JSContext *context = [[JSContext alloc] initWithVirtualMachine:vm]; + context[@"testObject"] = testObject; + JSSynchronousGarbageCollectForDebugging([context JSGlobalContextRef]); + checkResult(@"weak value == nil", ![weakValue value]); + checkResult(@"root is still alive", ![context[@"testObject"] isUndefined]); + } + } + + @autoreleasepool { + JSVirtualMachine *vm = [TinyDOMNode sharedVirtualMachine]; + JSContext *context = [[JSContext alloc] initWithVirtualMachine:vm]; + TinyDOMNode *root = [[TinyDOMNode alloc] init]; + TinyDOMNode *lastNode = root; + for (NSUInteger i = 0; i < 3; i++) { + TinyDOMNode *newNode = [[TinyDOMNode alloc] init]; + [lastNode appendChild:newNode]; + lastNode = newNode; + } + + @autoreleasepool { + context[@"root"] = root; + context[@"getLastNodeInChain"] = ^(TinyDOMNode *head){ + TinyDOMNode *lastNode = nil; + while (head) { + lastNode = head; + head = [lastNode childAtIndex:0]; + } + return lastNode; + }; + [context evaluateScript:@"getLastNodeInChain(root).myCustomProperty = 42;"]; + } + + JSSynchronousGarbageCollectForDebugging([context JSGlobalContextRef]); + + JSValue *myCustomProperty = [context evaluateScript:@"getLastNodeInChain(root).myCustomProperty"]; + checkResult(@"My custom property == 42", [myCustomProperty isNumber] && [myCustomProperty toInt32] == 42); + + [TinyDOMNode clearSharedVirtualMachine]; + } + + @autoreleasepool { + JSVirtualMachine *vm = [TinyDOMNode sharedVirtualMachine]; + JSContext *context = [[JSContext alloc] initWithVirtualMachine:vm]; + TinyDOMNode *root = [[TinyDOMNode alloc] init]; + TinyDOMNode *lastNode = root; + for (NSUInteger i = 0; i < 3; i++) { + TinyDOMNode *newNode = [[TinyDOMNode alloc] init]; + [lastNode appendChild:newNode]; + lastNode = newNode; + } + + @autoreleasepool { + context[@"root"] = root; + context[@"getLastNodeInChain"] = ^(TinyDOMNode *head){ + TinyDOMNode *lastNode = nil; + while (head) { + lastNode = head; + head = [lastNode childAtIndex:0]; + } + return lastNode; + }; + [context evaluateScript:@"getLastNodeInChain(root).myCustomProperty = 42;"]; + + [root appendChild:[root childAtIndex:0]]; + [root removeChildAtIndex:0]; + } + + JSSynchronousGarbageCollectForDebugging([context JSGlobalContextRef]); + + JSValue *myCustomProperty = [context evaluateScript:@"getLastNodeInChain(root).myCustomProperty"]; + checkResult(@"duplicate calls to addManagedReference don't cause things to die", [myCustomProperty isNumber] && [myCustomProperty toInt32] == 42); + + [TinyDOMNode clearSharedVirtualMachine]; + } + + @autoreleasepool { + JSContext *context = [[JSContext alloc] init]; + JSValue *o = [JSValue valueWithNewObjectInContext:context]; + o[@"foo"] = @"foo"; + JSSynchronousGarbageCollectForDebugging([context JSGlobalContextRef]); + + checkResult(@"JSValue correctly protected its internal value", [[o[@"foo"] toString] isEqualToString:@"foo"]); + } + + @autoreleasepool { + JSContext *context = [[JSContext alloc] init]; + TestObject *testObject = [TestObject testObject]; + context[@"testObject"] = testObject; + [context evaluateScript:@"testObject.__lookupGetter__('variable').call({})"]; + checkResult(@"Make sure we throw an exception when calling getter on incorrect |this|", context.exception); + } + + @autoreleasepool { + TestObject *testObject = [TestObject testObject]; + JSManagedValue *managedTestObject; + @autoreleasepool { + JSContext *context = [[JSContext alloc] init]; + context[@"testObject"] = testObject; + managedTestObject = [JSManagedValue managedValueWithValue:context[@"testObject"]]; + [context.virtualMachine addManagedReference:managedTestObject withOwner:testObject]; + } + } + + @autoreleasepool { + JSContext *context = [[JSContext alloc] init]; + context[@"MyClass"] = ^{ + JSValue *newThis = [JSValue valueWithNewObjectInContext:[JSContext currentContext]]; + JSGlobalContextRef contextRef = [[JSContext currentContext] JSGlobalContextRef]; + JSObjectRef newThisRef = JSValueToObject(contextRef, [newThis JSValueRef], NULL); + JSObjectSetPrototype(contextRef, newThisRef, [[JSContext currentContext][@"MyClass"][@"prototype"] JSValueRef]); + return newThis; + }; + + context[@"MyOtherClass"] = ^{ + JSValue *newThis = [JSValue valueWithNewObjectInContext:[JSContext currentContext]]; + JSGlobalContextRef contextRef = [[JSContext currentContext] JSGlobalContextRef]; + JSObjectRef newThisRef = JSValueToObject(contextRef, [newThis JSValueRef], NULL); + JSObjectSetPrototype(contextRef, newThisRef, [[JSContext currentContext][@"MyOtherClass"][@"prototype"] JSValueRef]); + return newThis; + }; + + context.exceptionHandler = ^(JSContext *context, JSValue *exception) { + NSLog(@"EXCEPTION: %@", [exception toString]); + context.exception = nil; + }; + + JSValue *constructor1 = context[@"MyClass"]; + JSValue *constructor2 = context[@"MyOtherClass"]; + + JSValue *value1 = [context evaluateScript:@"new MyClass()"]; + checkResult(@"value1 instanceof MyClass", [value1 isInstanceOf:constructor1]); + checkResult(@"!(value1 instanceof MyOtherClass)", ![value1 isInstanceOf:constructor2]); + checkResult(@"MyClass.prototype.constructor === MyClass", [[context evaluateScript:@"MyClass.prototype.constructor === MyClass"] toBool]); + checkResult(@"MyClass instanceof Function", [[context evaluateScript:@"MyClass instanceof Function"] toBool]); + + JSValue *value2 = [context evaluateScript:@"new MyOtherClass()"]; + checkResult(@"value2 instanceof MyOtherClass", [value2 isInstanceOf:constructor2]); + checkResult(@"!(value2 instanceof MyClass)", ![value2 isInstanceOf:constructor1]); + checkResult(@"MyOtherClass.prototype.constructor === MyOtherClass", [[context evaluateScript:@"MyOtherClass.prototype.constructor === MyOtherClass"] toBool]); + checkResult(@"MyOtherClass instanceof Function", [[context evaluateScript:@"MyOtherClass instanceof Function"] toBool]); + } + + @autoreleasepool { + JSContext *context = [[JSContext alloc] init]; + context[@"MyClass"] = ^{ + NSLog(@"I'm intentionally not returning anything."); + }; + JSValue *result = [context evaluateScript:@"new MyClass()"]; + checkResult(@"result === undefined", [result isUndefined]); + checkResult(@"exception.message is correct'", context.exception + && [@"Objective-C blocks called as constructors must return an object." isEqualToString:[context.exception[@"message"] toString]]); + } + + @autoreleasepool { + checkResult(@"[JSContext currentThis] == nil outside of callback", ![JSContext currentThis]); + checkResult(@"[JSContext currentArguments] == nil outside of callback", ![JSContext currentArguments]); + } + + @autoreleasepool { + JSContext *context = [[JSContext alloc] init]; + context[@"TestObject"] = [TestObject class]; + JSValue *testObject = [context evaluateScript:@"(new TestObject())"]; + checkResult(@"testObject instanceof TestObject", [testObject isInstanceOf:context[@"TestObject"]]); + + context[@"TextXYZ"] = [TextXYZ class]; + JSValue *textObject = [context evaluateScript:@"(new TextXYZ(\"Called TextXYZ constructor!\"))"]; + checkResult(@"textObject instanceof TextXYZ", [textObject isInstanceOf:context[@"TextXYZ"]]); + } + + @autoreleasepool { + JSContext *context = [[JSContext alloc] init]; + context[@"ClassA"] = [ClassA class]; + context[@"ClassB"] = [ClassB class]; + context[@"ClassC"] = [ClassC class]; // Should print error message about too many inits found. + + JSValue *a = [context evaluateScript:@"(new ClassA(42))"]; + checkResult(@"a instanceof ClassA", [a isInstanceOf:context[@"ClassA"]]); + + JSValue *b = [context evaluateScript:@"(new ClassB(42, 53))"]; + checkResult(@"b instanceof ClassB", [b isInstanceOf:context[@"ClassB"]]); + + JSValue *canConstructClassC = [context evaluateScript:@"(function() { \ + try { \ + (new ClassC(1, 2)); \ + return true; \ + } catch(e) { \ + return false; \ + } \ + })()"]; + checkResult(@"shouldn't be able to construct ClassC", ![canConstructClassC toBool]); + } + + @autoreleasepool { + JSContext *context = [[JSContext alloc] init]; + context[@"ClassD"] = [ClassD class]; + context[@"ClassE"] = [ClassE class]; + + JSValue *d = [context evaluateScript:@"(new ClassD())"]; + checkResult(@"Returning instance of ClassE from ClassD's init has correct class", [d isInstanceOf:context[@"ClassE"]]); + } + + currentThisInsideBlockGetterTest(); +} + +#else + +void testObjectiveCAPI() +{ +} + +#endif diff --git a/JavaScriptCore/CMakeLists.txt b/JavaScriptCore/CMakeLists.txt index bf48f970..bb8ac983 100644 --- a/JavaScriptCore/CMakeLists.txt +++ b/JavaScriptCore/CMakeLists.txt @@ -1,4 +1,4 @@ -SET(JavaScriptCore_INCLUDE_DIRECTORIES +set(JavaScriptCore_INCLUDE_DIRECTORIES "${CMAKE_BINARY_DIR}" "${JAVASCRIPTCORE_DIR}" "${JAVASCRIPTCORE_DIR}/API" @@ -7,6 +7,8 @@ SET(JavaScriptCore_INCLUDE_DIRECTORIES "${JAVASCRIPTCORE_DIR}/bytecode" "${JAVASCRIPTCORE_DIR}/bytecompiler" "${JAVASCRIPTCORE_DIR}/dfg" + "${JAVASCRIPTCORE_DIR}/disassembler" + "${JAVASCRIPTCORE_DIR}/ftl" "${JAVASCRIPTCORE_DIR}/heap" "${JAVASCRIPTCORE_DIR}/debugger" "${JAVASCRIPTCORE_DIR}/interpreter" @@ -22,8 +24,9 @@ SET(JavaScriptCore_INCLUDE_DIRECTORIES "${CMAKE_SOURCE_DIR}/Source" ) -SET(JavaScriptCore_SOURCES +set(JavaScriptCore_SOURCES API/JSBase.cpp + API/JSCTestRunnerUtils.cpp API/JSCallbackConstructor.cpp API/JSCallbackFunction.cpp API/JSCallbackObject.cpp @@ -31,126 +34,270 @@ SET(JavaScriptCore_SOURCES API/JSContextRef.cpp API/JSObjectRef.cpp API/JSProfilerPrivate.cpp + API/JSScriptRef.cpp API/JSStringRef.cpp API/JSValueRef.cpp API/JSWeakObjectMapRefPrivate.cpp API/OpaqueJSString.cpp + assembler/LinkBuffer.cpp + assembler/MacroAssembler.cpp + assembler/MacroAssemblerX86Common.cpp + + bytecode/ArrayAllocationProfile.cpp + bytecode/ArrayProfile.cpp bytecode/CallLinkInfo.cpp bytecode/CallLinkStatus.cpp bytecode/CodeBlock.cpp + bytecode/CodeBlockHash.cpp + bytecode/CodeBlockJettisoningWatchpoint.cpp + bytecode/CodeOrigin.cpp + bytecode/CodeType.cpp bytecode/DFGExitProfile.cpp + bytecode/DeferredCompilationCallback.cpp bytecode/ExecutionCounter.cpp + bytecode/ExitKind.cpp bytecode/GetByIdStatus.cpp + bytecode/InlineCallFrameSet.cpp bytecode/JumpTable.cpp bytecode/LazyOperandValueProfile.cpp - bytecode/MethodCallLinkInfo.cpp - bytecode/MethodCallLinkStatus.cpp bytecode/MethodOfGettingAValueProfile.cpp bytecode/Opcode.cpp bytecode/PolymorphicPutByIdList.cpp - bytecode/PredictedType.cpp + bytecode/PreciseJumpTargets.cpp + bytecode/ProfiledCodeBlockJettisoningWatchpoint.cpp bytecode/PutByIdStatus.cpp + bytecode/ReduceWhitespace.cpp bytecode/SamplingTool.cpp + bytecode/SpecialPointer.cpp + bytecode/SpeculatedType.cpp + bytecode/StructureStubClearingWatchpoint.cpp bytecode/StructureStubInfo.cpp + bytecode/UnlinkedCodeBlock.cpp + bytecode/ValueRecovery.cpp + bytecode/Watchpoint.cpp bytecompiler/BytecodeGenerator.cpp bytecompiler/NodesCodegen.cpp - dfg/DFGAbstractState.cpp - dfg/DFGAssemblyHelpers.cpp + debugger/Debugger.cpp + debugger/DebuggerActivation.cpp + debugger/DebuggerCallFrame.cpp + + dfg/DFGAbstractHeap.cpp + dfg/DFGAbstractValue.cpp + dfg/DFGArgumentsSimplificationPhase.cpp + dfg/DFGArrayMode.cpp + dfg/DFGAtTailAbstractState.cpp + dfg/DFGBackwardsPropagationPhase.cpp + dfg/DFGBasicBlock.cpp + dfg/DFGBinarySwitch.cpp + dfg/DFGBlockInsertionSet.cpp dfg/DFGByteCodeParser.cpp - dfg/DFGCapabilities.cpp dfg/DFGCFAPhase.cpp - dfg/DFGCorrectableJumpPoint.cpp + dfg/DFGCFGSimplificationPhase.cpp + dfg/DFGCPSRethreadingPhase.cpp dfg/DFGCSEPhase.cpp + dfg/DFGCapabilities.cpp + dfg/DFGClobberSet.cpp + dfg/DFGClobberize.cpp + dfg/DFGCommon.cpp + dfg/DFGCommonData.cpp + dfg/DFGCompilationKey.cpp + dfg/DFGCompilationMode.cpp + dfg/DFGConstantFoldingPhase.cpp + dfg/DFGCriticalEdgeBreakingPhase.cpp + dfg/DFGDCEPhase.cpp + dfg/DFGDesiredIdentifiers.cpp + dfg/DFGDesiredStructureChains.cpp + dfg/DFGDesiredTransitions.cpp + dfg/DFGDesiredWatchpoints.cpp + dfg/DFGDesiredWeakReferences.cpp + dfg/DFGDesiredWriteBarriers.cpp + dfg/DFGDisassembler.cpp + dfg/DFGDominators.cpp dfg/DFGDriver.cpp + dfg/DFGEdge.cpp + dfg/DFGFailedFinalizer.cpp + dfg/DFGFinalizer.cpp dfg/DFGFixupPhase.cpp + dfg/DFGFlushFormat.cpp + dfg/DFGFlushLivenessAnalysisPhase.cpp + dfg/DFGFlushedAt.cpp dfg/DFGGraph.cpp + dfg/DFGInPlaceAbstractState.cpp + dfg/DFGInvalidationPointInjectionPhase.cpp + dfg/DFGJITCode.cpp dfg/DFGJITCompiler.cpp + dfg/DFGJITFinalizer.cpp + dfg/DFGJumpReplacement.cpp + dfg/DFGLICMPhase.cpp + dfg/DFGLazyJSValue.cpp + dfg/DFGLivenessAnalysisPhase.cpp + dfg/DFGLongLivedState.cpp + dfg/DFGLoopPreHeaderCreationPhase.cpp + dfg/DFGMinifiedNode.cpp + dfg/DFGNaturalLoops.cpp + dfg/DFGNode.cpp dfg/DFGNodeFlags.cpp + dfg/DFGOSRAvailabilityAnalysisPhase.cpp dfg/DFGOSREntry.cpp + dfg/DFGOSREntrypointCreationPhase.cpp dfg/DFGOSRExit.cpp + dfg/DFGOSRExitBase.cpp dfg/DFGOSRExitCompiler.cpp dfg/DFGOSRExitCompiler32_64.cpp dfg/DFGOSRExitCompiler64.cpp + dfg/DFGOSRExitCompilerCommon.cpp + dfg/DFGOSRExitJumpPlaceholder.cpp + dfg/DFGOSRExitPreparation.cpp dfg/DFGOperations.cpp dfg/DFGPhase.cpp + dfg/DFGPlan.cpp + dfg/DFGPredictionInjectionPhase.cpp dfg/DFGPredictionPropagationPhase.cpp - dfg/DFGRedundantPhiEliminationPhase.cpp - dfg/DFGRepatch.cpp + dfg/DFGSSAConversionPhase.cpp dfg/DFGSpeculativeJIT.cpp dfg/DFGSpeculativeJIT32_64.cpp dfg/DFGSpeculativeJIT64.cpp + dfg/DFGStackLayoutPhase.cpp dfg/DFGThunks.cpp + dfg/DFGTierUpCheckInjectionPhase.cpp + dfg/DFGTypeCheckHoistingPhase.cpp + dfg/DFGUnificationPhase.cpp + dfg/DFGUseKind.cpp + dfg/DFGValidate.cpp + dfg/DFGValueSource.cpp + dfg/DFGVariableAccessDataDump.cpp + dfg/DFGVariableEvent.cpp + dfg/DFGVariableEventStream.cpp dfg/DFGVirtualRegisterAllocationPhase.cpp + dfg/DFGWatchpointCollectionPhase.cpp + dfg/DFGWorklist.cpp + + disassembler/ARMv7Disassembler.cpp + disassembler/Disassembler.cpp + disassembler/LLVMDisassembler.cpp + disassembler/UDis86Disassembler.cpp + disassembler/X86Disassembler.cpp heap/BlockAllocator.cpp - heap/CopiedSpace.cpp + heap/CodeBlockSet.cpp heap/ConservativeRoots.cpp - heap/DFGCodeBlocks.cpp + heap/CopiedSpace.cpp + heap/CopyVisitor.cpp + heap/DeferGC.cpp + heap/GCThread.cpp + heap/GCThreadSharedData.cpp heap/HandleSet.cpp heap/HandleStack.cpp heap/Heap.cpp + heap/HeapStatistics.cpp + heap/HeapTimer.cpp + heap/IncrementalSweeper.cpp + heap/JITStubRoutineSet.cpp heap/MachineStackMarker.cpp + heap/MarkStack.cpp heap/MarkedAllocator.cpp heap/MarkedBlock.cpp heap/MarkedSpace.cpp - heap/MarkStack.cpp - heap/WeakSet.cpp - heap/WeakHandleOwner.cpp + heap/SlotVisitor.cpp + heap/SuperRegion.cpp + heap/VTableSpectrum.cpp + heap/Weak.cpp heap/WeakBlock.cpp + heap/WeakHandleOwner.cpp + heap/WeakSet.cpp + heap/WriteBarrierSupport.cpp - debugger/Debugger.cpp - debugger/DebuggerActivation.cpp - debugger/DebuggerCallFrame.cpp - interpreter/AbstractPC.cpp interpreter/CallFrame.cpp interpreter/Interpreter.cpp - interpreter/RegisterFile.cpp + interpreter/JSStack.cpp + interpreter/StackVisitor.cpp + interpreter/VMInspector.cpp + jit/AssemblyHelpers.cpp + jit/ClosureCallStubRoutine.cpp jit/ExecutableAllocator.cpp + jit/ExecutableAllocatorFixedVMPool.cpp + jit/GCAwareJITStubRoutine.cpp jit/HostCallReturnValue.cpp - jit/JITArithmetic32_64.cpp + jit/JIT.cpp jit/JITArithmetic.cpp - jit/JITCall32_64.cpp + jit/JITArithmetic32_64.cpp jit/JITCall.cpp - jit/JIT.cpp + jit/JITCall32_64.cpp + jit/JITCode.cpp + jit/JITDisassembler.cpp jit/JITExceptions.cpp - jit/JITOpcodes32_64.cpp + jit/JITInlineCacheGenerator.cpp jit/JITOpcodes.cpp - jit/JITPropertyAccess32_64.cpp + jit/JITOpcodes32_64.cpp + jit/JITOperations.cpp jit/JITPropertyAccess.cpp + jit/JITPropertyAccess32_64.cpp + jit/JITStubRoutine.cpp jit/JITStubs.cpp + jit/JITThunks.cpp + jit/JITToDFGDeferredCompilationCallback.cpp + jit/RegisterSet.cpp + jit/Repatch.cpp + jit/TempRegisterSet.cpp jit/ThunkGenerators.cpp parser/Lexer.cpp parser/Nodes.cpp parser/Parser.cpp parser/ParserArena.cpp + parser/SourceCode.cpp + parser/SourceProvider.cpp parser/SourceProviderCache.cpp + profiler/LegacyProfiler.cpp profiler/Profile.cpp profiler/ProfileGenerator.cpp profiler/ProfileNode.cpp - profiler/Profiler.cpp + profiler/ProfilerBytecode.cpp + profiler/ProfilerBytecodeSequence.cpp + profiler/ProfilerBytecodes.cpp + profiler/ProfilerCompilation.cpp + profiler/ProfilerCompilationKind.cpp + profiler/ProfilerCompiledBytecode.cpp + profiler/ProfilerDatabase.cpp + profiler/ProfilerOSRExit.cpp + profiler/ProfilerOSRExitSite.cpp + profiler/ProfilerOrigin.cpp + profiler/ProfilerOriginStack.cpp + profiler/ProfilerProfiledBytecodes.cpp runtime/ArgList.cpp runtime/Arguments.cpp + runtime/ArrayBuffer.cpp + runtime/ArrayBufferView.cpp runtime/ArrayConstructor.cpp + runtime/ArrayIteratorConstructor.cpp + runtime/ArrayIteratorPrototype.cpp runtime/ArrayPrototype.cpp runtime/BooleanConstructor.cpp runtime/BooleanObject.cpp runtime/BooleanPrototype.cpp runtime/CallData.cpp + runtime/CodeCache.cpp + runtime/CodeSpecializationKind.cpp runtime/CommonIdentifiers.cpp + runtime/CommonSlowPaths.cpp + runtime/CommonSlowPathsExceptions.cpp + runtime/CompilationResult.cpp runtime/Completion.cpp runtime/ConstructData.cpp + runtime/DataView.cpp + runtime/DataView.h runtime/DateConstructor.cpp runtime/DateConversion.cpp runtime/DateInstance.cpp runtime/DatePrototype.cpp + runtime/DumpContext.cpp runtime/Error.cpp runtime/ErrorConstructor.cpp runtime/ErrorInstance.cpp @@ -158,37 +305,72 @@ SET(JavaScriptCore_SOURCES runtime/ExceptionHelpers.cpp runtime/Executable.cpp runtime/FunctionConstructor.cpp + runtime/FunctionExecutableDump.cpp runtime/FunctionPrototype.cpp runtime/GCActivityCallback.cpp runtime/GetterSetter.cpp runtime/Identifier.cpp + runtime/IndexingType.cpp runtime/InitializeThreading.cpp + runtime/IntendedStructureChain.cpp runtime/InternalFunction.cpp - runtime/JSActivation.cpp runtime/JSAPIValueWrapper.cpp + runtime/JSActivation.cpp runtime/JSArray.cpp + runtime/JSArrayBuffer.cpp + runtime/JSArrayBufferConstructor.cpp + runtime/JSArrayBufferPrototype.cpp + runtime/JSArrayBufferView.cpp + runtime/JSArrayIterator.cpp + runtime/JSBoundFunction.cpp + runtime/JSCJSValue.cpp runtime/JSCell.cpp + runtime/JSChunk.cpp + runtime/JSDataView.cpp + runtime/JSDataViewPrototype.cpp runtime/JSDateMath.cpp runtime/JSFunction.cpp - runtime/JSBoundFunction.cpp - runtime/JSGlobalData.cpp runtime/JSGlobalObject.cpp runtime/JSGlobalObjectFunctions.cpp - runtime/JSGlobalThis.cpp runtime/JSLock.cpp + runtime/JSMap.cpp + runtime/JSNameScope.cpp runtime/JSNotAnObject.cpp - runtime/JSObject.cpp runtime/JSONObject.cpp + runtime/JSObject.cpp + runtime/JSPromise.cpp + runtime/JSPromiseCallback.cpp + runtime/JSPromiseConstructor.cpp + runtime/JSPromisePrototype.cpp + runtime/JSPromiseResolver.cpp + runtime/JSPromiseResolverConstructor.cpp + runtime/JSPromiseResolverPrototype.cpp runtime/JSPropertyNameIterator.cpp + runtime/JSProxy.cpp + runtime/JSScope.cpp + runtime/JSSegmentedVariableObject.cpp + runtime/JSSet.cpp runtime/JSStaticScopeObject.cpp runtime/JSString.cpp runtime/JSStringJoiner.cpp - runtime/JSValue.cpp + runtime/JSSymbolTableObject.cpp + runtime/JSTypedArrayConstructors.cpp + runtime/JSTypedArrayPrototypes.cpp + runtime/JSTypedArrays.cpp runtime/JSVariableObject.cpp + runtime/JSWeakMap.cpp + runtime/JSWithScope.cpp runtime/JSWrapperObject.cpp runtime/LiteralParser.cpp runtime/Lookup.cpp + runtime/MapConstructor.cpp + runtime/MapData.cpp + runtime/MapPrototype.cpp runtime/MathObject.cpp + runtime/MemoryStatistics.cpp + runtime/NameConstructor.cpp + runtime/NameInstance.cpp + runtime/NamePrototype.cpp runtime/NativeErrorConstructor.cpp runtime/NativeErrorPrototype.cpp runtime/NumberConstructor.cpp @@ -201,15 +383,21 @@ SET(JavaScriptCore_SOURCES runtime/PropertyDescriptor.cpp runtime/PropertyNameArray.cpp runtime/PropertySlot.cpp + runtime/PropertyTable.cpp + runtime/PrototypeMap.cpp runtime/RegExp.cpp runtime/RegExpCache.cpp - runtime/RegExpConstructor.cpp runtime/RegExpCachedResult.cpp + runtime/RegExpConstructor.cpp runtime/RegExpMatchesArray.cpp runtime/RegExpObject.cpp runtime/RegExpPrototype.cpp - runtime/ScopeChain.cpp + runtime/SamplingCounter.cpp + runtime/SetConstructor.cpp + runtime/SetPrototype.cpp + runtime/SimpleTypedArrayController.cpp runtime/SmallStrings.cpp + runtime/SparseArrayValueMap.cpp runtime/StrictEvalActivation.cpp runtime/StringConstructor.cpp runtime/StringObject.cpp @@ -217,106 +405,293 @@ SET(JavaScriptCore_SOURCES runtime/StringRecursionChecker.cpp runtime/Structure.cpp runtime/StructureChain.cpp - runtime/TimeoutChecker.cpp - runtime/UString.cpp + runtime/StructureRareData.cpp + runtime/SymbolTable.cpp + runtime/TestRunnerUtils.cpp + runtime/TypedArrayController.cpp + runtime/TypedArrayType.cpp + runtime/VM.cpp + runtime/Watchdog.cpp + runtime/WatchdogNone.cpp + runtime/WeakMapConstructor.cpp + runtime/WeakMapData.cpp + runtime/WeakMapPrototype.cpp tools/CodeProfile.cpp tools/CodeProfiling.cpp yarr/YarrCanonicalizeUCS2.cpp - yarr/YarrPattern.cpp yarr/YarrInterpreter.cpp yarr/YarrJIT.cpp + yarr/YarrPattern.cpp yarr/YarrSyntaxChecker.cpp ) -SET(JavaScriptCore_LUT_FILES +set(JavaScriptCore_LUT_FILES runtime/ArrayConstructor.cpp runtime/ArrayPrototype.cpp runtime/BooleanPrototype.cpp runtime/DateConstructor.cpp runtime/DatePrototype.cpp runtime/ErrorPrototype.cpp + runtime/JSDataViewPrototype.cpp runtime/JSGlobalObject.cpp runtime/JSONObject.cpp - runtime/MathObject.cpp + runtime/JSPromiseConstructor.cpp + runtime/JSPromisePrototype.cpp + runtime/JSPromiseResolverPrototype.cpp + runtime/NamePrototype.cpp runtime/NumberConstructor.cpp runtime/NumberPrototype.cpp runtime/ObjectConstructor.cpp - runtime/ObjectPrototype.cpp runtime/RegExpConstructor.cpp runtime/RegExpObject.cpp runtime/RegExpPrototype.cpp runtime/StringConstructor.cpp - runtime/StringPrototype.cpp ) -SET(JavaScriptCore_LIBRARIES - ${WTF_LIBRARY_NAME} +set(JavaScriptCore_LIBRARIES + WTF ) +if (WTF_USE_ICU_UNICODE) + list(APPEND JavaScriptCore_INCLUDE_DIRECTORIES + ${ICU_INCLUDE_DIRS} + ) + list(APPEND JavaScriptCore_LIBRARIES + ${ICU_I18N_LIBRARIES} + ) +endif () + +if (ENABLE_LLINT) + # We cannot check for RUBY_FOUND because it is set only when the full package is installed and + # the only thing we need is the interpreter. Unlike Python, cmake does not provide a macro + # for finding the only Ruby interpreter. + if (NOT RUBY_EXECUTABLE) + message(FATAL_ERROR "The Ruby interpreter is needed to generate LLInt files.") + endif () + + set(LLINT_ASM + llint/LowLevelInterpreter.asm + llint/LowLevelInterpreter32_64.asm + llint/LowLevelInterpreter64.asm + ) + + set(OFFLINE_ASM + offlineasm/arm.rb + offlineasm/ast.rb + offlineasm/backends.rb + offlineasm/cloop.rb + offlineasm/config.rb + offlineasm/instructions.rb + offlineasm/offsets.rb + offlineasm/opt.rb + offlineasm/parser.rb + offlineasm/registers.rb + offlineasm/risc.rb + offlineasm/self_hash.rb + offlineasm/settings.rb + offlineasm/transform.rb + offlineasm/x86.rb + ) + + add_custom_command( + OUTPUT ${DERIVED_SOURCES_JAVASCRIPTCORE_DIR}/LLIntDesiredOffsets.h + MAIN_DEPENDENCY ${JAVASCRIPTCORE_DIR}/offlineasm/generate_offset_extractor.rb + DEPENDS ${LLINT_ASM} ${OFFLINE_ASM} + COMMAND ${RUBY_EXECUTABLE} ${JAVASCRIPTCORE_DIR}/offlineasm/generate_offset_extractor.rb ${JAVASCRIPTCORE_DIR}/llint/LowLevelInterpreter.asm ${DERIVED_SOURCES_JAVASCRIPTCORE_DIR}/LLIntDesiredOffsets.h + VERBATIM) + + # We add the header file directly to the ADD_EXECUTABLE call instead of setting the + # OBJECT_DEPENDS property in LLIntOffsetsExtractor.cpp because generate_offset_extractor.rb may + # not regenerate it in case the hash it calculates does not change. + # In this case, if some of the dependencies specified in the ADD_CUSTOM_COMMAND above have + # changed the command will always be called because the mtime of LLIntDesiredOffsets.h will + # always be older than that of its dependencies. + # Additionally, setting the OBJECT_DEPENDS property will make LLIntDesiredOffsets.h a Makefile + # dependency of both LLIntOffsetsExtractor and LLIntOffsetsExtractor.cpp, so the command will + # actually be run twice! + add_executable(LLIntOffsetsExtractor + ${JAVASCRIPTCORE_DIR}/llint/LLIntOffsetsExtractor.cpp + ${DERIVED_SOURCES_JAVASCRIPTCORE_DIR}/LLIntDesiredOffsets.h + ) + target_link_libraries(LLIntOffsetsExtractor WTF) + + # The build system will execute asm.rb every time LLIntOffsetsExtractor's mtime is newer than + # LLIntAssembly.h's mtime. The problem we have here is: asm.rb has some built-in optimization + # that generates a checksum of the LLIntOffsetsExtractor binary, if the checksum of the new + # LLIntOffsetsExtractor matches, no output is generated. To make this target consistent and avoid + # running this command for every build, we artificially update LLIntAssembly.h's mtime (using touch) + # after every asm.rb run. + add_custom_command( + OUTPUT ${DERIVED_SOURCES_JAVASCRIPTCORE_DIR}/LLIntAssembly.h + MAIN_DEPENDENCY ${JAVASCRIPTCORE_DIR}/offlineasm/asm.rb + DEPENDS LLIntOffsetsExtractor ${LLINT_ASM} ${OFFLINE_ASM} + COMMAND ${RUBY_EXECUTABLE} ${JAVASCRIPTCORE_DIR}/offlineasm/asm.rb ${JAVASCRIPTCORE_DIR}/llint/LowLevelInterpreter.asm $ ${DERIVED_SOURCES_JAVASCRIPTCORE_DIR}/LLIntAssembly.h + COMMAND ${CMAKE_COMMAND} -E touch_nocreate ${DERIVED_SOURCES_JAVASCRIPTCORE_DIR}/LLIntAssembly.h + VERBATIM) + + # The explanation for not making LLIntAssembly.h part of the OBJECT_DEPENDS property of some of + # the .cpp files below is similar to the one in the previous comment. However, since these .cpp + # files are used to build JavaScriptCore itself, we can just add LLIntAssembly.h to JSC_HEADERS + # since it is used in the add_library() call at the end of this file. + list(APPEND JavaScriptCore_HEADERS + ${DERIVED_SOURCES_JAVASCRIPTCORE_DIR}/LLIntAssembly.h + ) + list(APPEND JavaScriptCore_SOURCES + llint/LLIntCLoop.cpp + llint/LLIntData.cpp + llint/LLIntEntrypoint.cpp + llint/LLIntExceptions.cpp + llint/LLIntSlowPaths.cpp + llint/LLIntThunks.cpp + llint/LowLevelInterpreter.cpp + ) +endif () + +set(HASH_LUT_GENERATOR ${CMAKE_CURRENT_SOURCE_DIR}/create_hash_table) +macro(GENERATE_HASH_LUT _input _output) + add_custom_command( + OUTPUT ${_output} + DEPENDS ${HASH_LUT_GENERATOR} ${_input} + COMMAND ${PERL_EXECUTABLE} ${HASH_LUT_GENERATOR} ${_input} -i > ${_output} + VERBATIM) + list(APPEND JavaScriptCore_HEADERS ${_output}) +endmacro() # GENERATOR 1-A: LUT creator -FOREACH (_file ${JavaScriptCore_LUT_FILES}) - GET_FILENAME_COMPONENT(_name ${_file} NAME_WE) - GENERATE_HASH_LUT(${JAVASCRIPTCORE_DIR}/${_file} ${DERIVED_SOURCES_JAVASCRIPTCORE_DIR}/${_name}.lut.h) - LIST(APPEND JavaScriptCore_HEADERS ${DERIVED_SOURCES_JAVASCRIPTCORE_DIR}/${_name}.lut.h) -ENDFOREACH () +foreach (_file ${JavaScriptCore_LUT_FILES}) + get_filename_component(_name ${_file} NAME_WE) + GENERATE_HASH_LUT(${CMAKE_CURRENT_SOURCE_DIR}/${_file} ${DERIVED_SOURCES_JAVASCRIPTCORE_DIR}/${_name}.lut.h) +endforeach () + +set(JavaScriptCore_FORWARDING_HEADERS_DIRECTORIES + assembler + bytecode + collector/handles + debugger + heap + interpreter + jit + llint + parser + profiler + runtime + yarr +) + +set(JavaScriptCore_FORWARDING_HEADERS_FILES + API/APICast.h + API/APIShims.h + API/JSBase.h + API/JSCTestRunnerUtils.h + API/JSContextRef.h + API/JSContextRefPrivate.h + API/JSObjectRef.h + API/JSObjectRefPrivate.h + API/JSRetainPtr.h + API/JSScriptRefPrivate.h + API/JSStringRef.h + API/JSStringRefBSTR.h + API/JSStringRefCF.h + API/JSValueRef.h + API/JSWeakObjectMapRefInternal.h + API/JSWeakObjectMapRefPrivate.h + API/JavaScript.h + API/JavaScriptCore.h + API/OpaqueJSString.h + API/WebKitAvailability.h +) # GENERATOR 1-B: particular LUT creator (for 1 file only) -GENERATE_HASH_LUT(${JAVASCRIPTCORE_DIR}/parser/Keywords.table ${DERIVED_SOURCES_JAVASCRIPTCORE_DIR}/Lexer.lut.h MAIN_DEPENDENCY) -LIST(APPEND JavaScriptCore_HEADERS ${DERIVED_SOURCES_JAVASCRIPTCORE_DIR}/Lexer.lut.h) +GENERATE_HASH_LUT(${CMAKE_CURRENT_SOURCE_DIR}/parser/Keywords.table ${DERIVED_SOURCES_JAVASCRIPTCORE_DIR}/Lexer.lut.h) #GENERATOR: "RegExpJitTables.h": tables used by Yarr -ADD_CUSTOM_COMMAND( +add_custom_command( OUTPUT ${DERIVED_SOURCES_JAVASCRIPTCORE_DIR}/RegExpJitTables.h - MAIN_DEPENDENCY ${JAVASCRIPTCORE_DIR}/create_regex_tables - COMMAND ${PYTHON_EXECUTABLE} ${JAVASCRIPTCORE_DIR}/create_regex_tables > ${DERIVED_SOURCES_JAVASCRIPTCORE_DIR}/RegExpJitTables.h + MAIN_DEPENDENCY ${CMAKE_CURRENT_SOURCE_DIR}/create_regex_tables + COMMAND ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/create_regex_tables > ${DERIVED_SOURCES_JAVASCRIPTCORE_DIR}/RegExpJitTables.h VERBATIM) -ADD_SOURCE_DEPENDENCIES(${JAVASCRIPTCORE_DIR}/yarr/YarrPattern.cpp ${DERIVED_SOURCES_JAVASCRIPTCORE_DIR}/RegExpJitTables.h) +ADD_SOURCE_DEPENDENCIES(${CMAKE_CURRENT_SOURCE_DIR}/yarr/YarrPattern.cpp ${DERIVED_SOURCES_JAVASCRIPTCORE_DIR}/RegExpJitTables.h) #GENERATOR: "KeywordLookup.h": keyword decision tree used by the lexer -ADD_CUSTOM_COMMAND( +add_custom_command( OUTPUT ${DERIVED_SOURCES_JAVASCRIPTCORE_DIR}/KeywordLookup.h - MAIN_DEPENDENCY ${JAVASCRIPTCORE_DIR}/KeywordLookupGenerator.py - COMMAND ${PYTHON_EXECUTABLE} ${JAVASCRIPTCORE_DIR}/KeywordLookupGenerator.py ${JAVASCRIPTCORE_DIR}/parser/Keywords.table > ${DERIVED_SOURCES_JAVASCRIPTCORE_DIR}/KeywordLookup.h + MAIN_DEPENDENCY ${CMAKE_CURRENT_SOURCE_DIR}/KeywordLookupGenerator.py + COMMAND ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/KeywordLookupGenerator.py ${CMAKE_CURRENT_SOURCE_DIR}/parser/Keywords.table > ${DERIVED_SOURCES_JAVASCRIPTCORE_DIR}/KeywordLookup.h VERBATIM) -ADD_SOURCE_DEPENDENCIES(${JAVASCRIPTCORE_DIR}/parser/Lexer.cpp ${DERIVED_SOURCES_JAVASCRIPTCORE_DIR}/KeywordLookup.h) +ADD_SOURCE_DEPENDENCIES(${CMAKE_CURRENT_SOURCE_DIR}/parser/Lexer.cpp ${DERIVED_SOURCES_JAVASCRIPTCORE_DIR}/KeywordLookup.h) -IF (WTF_CPU_ARM) - LIST(APPEND JavaScriptCore_SOURCES +if (WTF_CPU_ARM) + list(APPEND JavaScriptCore_SOURCES assembler/ARMAssembler.cpp assembler/ARMv7Assembler.cpp assembler/MacroAssemblerARM.cpp ) -ELSEIF (WTF_CPU_MIPS) -ELSEIF (WTF_CPU_X86) -ELSEIF (WTF_CPU_X86_64) -ELSE () - MESSAGE(FATAL_ERROR "Unknown CPU") -ENDIF () + if (MSVC AND ENABLE_JIT) + add_custom_command( + OUTPUT ${DERIVED_SOURCES_DIR}/GeneratedJITStubs.asm + MAIN_DEPENDENCY ${JAVASCRIPTCORE_DIR}/create_jit_stubs + DEPENDS ${JAVASCRIPTCORE_DIR}/jit/JITStubsARM.h + DEPENDS ${JAVASCRIPTCORE_DIR}/jit/JITStubs.cpp + COMMAND ${PERL_EXECUTABLE} ${JAVASCRIPTCORE_DIR}/create_jit_stubs --prefix=MSVC --header ${JAVASCRIPTCORE_DIR}/jit/JITStubsARM.h ${JAVASCRIPTCORE_DIR}/jit/JITStubs.cpp > ${DERIVED_SOURCES_DIR}/GeneratedJITStubs.asm + VERBATIM) + + add_custom_command( + OUTPUT ${DERIVED_SOURCES_DIR}/GeneratedJITStubs.obj + MAIN_DEPENDENCY ${DERIVED_SOURCES_DIR}/GeneratedJITStubs.asm + COMMAND armasm -nologo ${DERIVED_SOURCES_DIR}/GeneratedJITStubs.asm ${DERIVED_SOURCES_DIR}/GeneratedJITStubs.obj + VERBATIM) + + list(APPEND JavaScriptCore_SOURCES ${DERIVED_SOURCES_DIR}/GeneratedJITStubs.obj) + endif () +elseif (WTF_CPU_MIPS) +elseif (WTF_CPU_SH4) +elseif (WTF_CPU_X86) + list(APPEND JavaScriptCore_SOURCES + assembler/MacroAssemblerX86Common.cpp + ) +elseif (WTF_CPU_X86_64) + if (MSVC AND ENABLE_JIT) + add_custom_command( + OUTPUT ${DERIVED_SOURCES_DIR}/JITStubsMSVC64.obj + MAIN_DEPENDENCY ${JAVASCRIPTCORE_DIR}/jit/JITStubsMSVC64.asm + COMMAND ml64 -nologo -c -Fo ${DERIVED_SOURCES_DIR}/JITStubsMSVC64.obj ${JAVASCRIPTCORE_DIR}/jit/JITStubsMSVC64.asm + VERBATIM) + + list(APPEND JavaScriptCore_SOURCES ${DERIVED_SOURCES_DIR}/JITStubsMSVC64.obj) + endif () + list(APPEND JavaScriptCore_SOURCES + assembler/MacroAssemblerX86Common.cpp + ) +else () + message(FATAL_ERROR "Unknown CPU") +endif () WEBKIT_INCLUDE_CONFIG_FILES_IF_EXISTS() +WEBKIT_CREATE_FORWARDING_HEADERS(JavaScriptCore DIRECTORIES ${JavaScriptCore_FORWARDING_HEADERS_DIRECTORIES} FILES ${JavaScriptCore_FORWARDING_HEADERS_FILES}) + -ADD_SUBDIRECTORY(shell) +add_subdirectory(shell) WEBKIT_WRAP_SOURCELIST(${JavaScriptCore_SOURCES}) -INCLUDE_DIRECTORIES(${JavaScriptCore_INCLUDE_DIRECTORIES}) -ADD_DEFINITIONS(-DBUILDING_JavaScriptCore) -ADD_LIBRARY(${JavaScriptCore_LIBRARY_NAME} ${JavaScriptCore_LIBRARY_TYPE} ${JavaScriptCore_HEADERS} ${JavaScriptCore_SOURCES}) -TARGET_LINK_LIBRARIES(${JavaScriptCore_LIBRARY_NAME} ${JavaScriptCore_LIBRARIES}) -SET_TARGET_PROPERTIES(${JavaScriptCore_LIBRARY_NAME} PROPERTIES FOLDER "JavaScriptCore") -SET_TARGET_PROPERTIES(${JavaScriptCore_LIBRARY_NAME} PROPERTIES LINK_INTERFACE_LIBRARIES "") - -IF (JavaScriptCore_LINK_FLAGS) - ADD_TARGET_PROPERTIES(${JavaScriptCore_LIBRARY_NAME} LINK_FLAGS "${JavaScriptCore_LINK_FLAGS}") -ENDIF () - -IF (SHARED_CORE) - SET_TARGET_PROPERTIES(${JavaScriptCore_LIBRARY_NAME} PROPERTIES VERSION ${PROJECT_VERSION} SOVERSION ${PROJECT_VERSION_MAJOR}) - INSTALL(TARGETS ${JavaScriptCore_LIBRARY_NAME} DESTINATION "${LIB_INSTALL_DIR}") -ENDIF () +include_directories(${JavaScriptCore_INCLUDE_DIRECTORIES}) +add_definitions(-DSTATICALLY_LINKED_WITH_WTF) +add_library(JavaScriptCore ${JavaScriptCore_LIBRARY_TYPE} ${JavaScriptCore_HEADERS} ${JavaScriptCore_SOURCES}) +target_link_libraries(JavaScriptCore ${JavaScriptCore_LIBRARIES}) +set_target_properties(JavaScriptCore PROPERTIES COMPILE_DEFINITIONS "BUILDING_JavaScriptCore") +set_target_properties(JavaScriptCore PROPERTIES FOLDER "JavaScriptCore") +set_target_properties(JavaScriptCore PROPERTIES LINK_INTERFACE_LIBRARIES "") + +if (JavaScriptCore_OUTPUT_NAME) + set_target_properties(JavaScriptCore PROPERTIES OUTPUT_NAME ${JavaScriptCore_OUTPUT_NAME}) +endif () + +if (SHARED_CORE) + set_target_properties(JavaScriptCore PROPERTIES VERSION ${PROJECT_VERSION} SOVERSION ${PROJECT_VERSION_MAJOR}) + install(TARGETS JavaScriptCore DESTINATION "${LIB_INSTALL_DIR}") +endif () diff --git a/JavaScriptCore/ChangeLog b/JavaScriptCore/ChangeLog index e88692c7..b860d29d 100644 --- a/JavaScriptCore/ChangeLog +++ b/JavaScriptCore/ChangeLog @@ -1,69230 +1,3729 @@ -2012-10-16 Lucas Forschler +2013-10-31 Lucas Forschler - Merge + Merge r158341 - 2012-10-10 Filip Pizlo - - SUSundance: JSArray::sort with an evil compare function allows access into arbitrary memory - - Reviewed by Geoffrey Garen. - - This patch correctly omits the removal of the !header check in unshift(). - - * runtime/ArrayPrototype.cpp: - (JSC::arrayProtoFuncSort): - * runtime/JSArray.cpp: - (JSC::JSArray::sortNumeric): - (JSC::JSArray::sort): - (JSC::JSArray::compactForSorting): - * runtime/JSArray.h: - (JSArray): - (JSC::JSArray::hasSparseMap): + 2013-10-30 Filip Pizlo -2012-10-16 Lucas Forschler + Assertion failure in js/dom/global-constructors-attributes-dedicated-worker.html + https://bugs.webkit.org/show_bug.cgi?id=123551 + - Merge r129577 - - 2012-09-25 Filip Pizlo - - We shouldn't use the optimized versions of shift/unshift if the user is doing crazy things to the array - https://bugs.webkit.org/show_bug.cgi?id=97603 - + Reviewed by Mark Hahnenberg. - Reviewed by Gavin Barraclough. + WatchpointSets have always had this "fire everything on deletion" policy because it + seemed like a good fail-safe at the time I first implemented WatchpointSets. But + it's actually causing bugs rather than providing safety: - You changed the length behind our backs? No optimizations for you then! + - Everyone who registers Watchpoints with WatchpointSets have separate mechanisms + for either keeping the WatchpointSets alive or noticing when they are collected. + So this wasn't actually providing any safety. - * runtime/ArrayPrototype.cpp: - (JSC::shift): - (JSC::unshift): - * runtime/JSArray.cpp: - (JSC::JSArray::shiftCount): + One example of this is Structures, where: -2012-08-14 Lucas Forschler + - CodeBlocks that register Watchpoints on Structure's WatchpointSet will also + register weak references to the Structure, and the GC will jettison a CodeBlock + if the Structure(s) it cares about dies. - Merge r124272. + - StructureStubInfos that register Watchpoints on Structure's WatchpointSet will + also be cleared by GC if the Structures die. - 2012-07-31 Sam Weinig + - The WatchpointSet destructor would get invoked from finalization/destruction. + This would then cause CodeBlock::jettison() to be called on a CodeBlock, but that + method requires doing things that access heap objects. This would usually cause + problems on VM destruction, since then the CodeBlocks would still be alive but the + whole heap would be destroyed. - Fix the Windows build. + This also ensures that CodeBlock::jettison() cannot cause a GC. This is safe since + that method doesn't really allocate objects, and it is likely necessary because + jettison() may be called from deep in the stack. - * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def: + * bytecode/CodeBlock.cpp: + (JSC::CodeBlock::jettison): + * bytecode/Watchpoint.cpp: + (JSC::WatchpointSet::~WatchpointSet): + * bytecode/Watchpoint.h: -2012-08-14 Lucas Forschler +2013-10-30 Mark Lam - Merge r124268. + Unreviewed, fix C Loop LLINT build. - 2012-07-31 Sam Weinig + * bytecode/CodeBlockJettisoningWatchpoint.cpp: + (JSC::CodeBlockJettisoningWatchpoint::fireInternal): + * bytecode/ProfiledCodeBlockJettisoningWatchpoint.cpp: + (JSC::ProfiledCodeBlockJettisoningWatchpoint::fireInternal): - Stop masking 8 bits off of the visited link hash. We need all the bits! - https://bugs.webkit.org/show_bug.cgi?id=92799 +2013-10-30 Filip Pizlo - Reviewed by Anders Carlsson. + Unreviewed, fix FTL build. - * runtime/Identifier.cpp: - (JSC::IdentifierCStringTranslator::hash): - (JSC::IdentifierLCharFromUCharTranslator::hash): - * runtime/Identifier.h: - (JSC::IdentifierCharBufferTranslator::hash): - Update for new function names. + * ftl/FTLAbstractHeapRepository.h: + * ftl/FTLLowerDFGToLLVM.cpp: + (JSC::FTL::LowerDFGToLLVM::compileCallOrConstruct): -2012-08-10 Lucas Forschler - - Windows build fix after merging radar 12050720. - Add missing symbols. - - * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def: +2013-10-30 Alexey Proskuryakov -2012-08-10 Lucas Forschler + Add a way to fulfill promises from DOM code + https://bugs.webkit.org/show_bug.cgi?id=123466 - Windows build fix after merging radar 12050720. - Part 2 - removing symbols. + Reviewed by Sam Weinig. - * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def: + * JavaScriptCore.xcodeproj/project.pbxproj: Make JSPromise.h and JSPromiseResolver.h + private headers for WebCore to use. -2012-08-10 Lucas Forschler + * runtime/JSPromise.h: + * runtime/JSPromiseResolver.h: + Export functions that JSDOMPromise will use. - Windows Build fix after merging radar 12050720. - - * runtime/JSLock.cpp: - (JSC::JSLock::DropAllLocks::DropAllLocks): +2013-10-30 Mark Lam -2012-08-06 Lucas Forschler + Adjust CallFrameHeader's ReturnPC and CallFrame locations to match the native ABI . + https://bugs.webkit.org/show_bug.cgi?id=123444. - Merge patch for - - 2012-07-24 Filip Pizlo + Reviewed by Geoffrey Garen. - DFG method checks should keep the receiver of the property access alive until all checks complete. - - - Reviewed by Gavin Barraclough. + - Introduced an explicit CallerFrameAndPC struct. + - A CallFrame is expected to start with a CallerFrameAndPC struct. + - The Register class no longer supports CallFrame* and Instruction*. - * dfg/DFGByteCodeParser.cpp: - (JSC::DFG::ByteCodeParser::parseBlock): + These hides the differences between JSVALUE32_64 and JSVALUE64 in + terms of managing the callerFrame() and returnPC() values. -2012-08-02 Lucas Forschler + - Convert all uses of JSStack::CallerFrame and JSStack::ReturnPC to + go through CallFrame to access the appropriate values and offsets. + CallFrame, in turn, will access the callerFrame and returnPC via + the CallerFrameAndPC struct. - Merge 121307 + - InlineCallFrame will provide offsets for its callerFrame and + returnPC. It will make use of CallFrame::callerFrameOffset() and + CallerFrame::returnPCOffset() to compute these. - 2012-06-26 Filip Pizlo + * bytecode/CodeOrigin.h: + (JSC::InlineCallFrame::callerFrameOffset): + (JSC::InlineCallFrame::returnPCOffset): + * dfg/DFGJITCompiler.cpp: + (JSC::DFG::JITCompiler::compileEntry): + (JSC::DFG::JITCompiler::compileExceptionHandlers): + * dfg/DFGOSRExitCompilerCommon.cpp: + (JSC::DFG::reifyInlinedCallFrames): + * dfg/DFGSpeculativeJIT.h: + (JSC::DFG::SpeculativeJIT::calleeFrameSlot): + (JSC::DFG::SpeculativeJIT::calleeArgumentSlot): + (JSC::DFG::SpeculativeJIT::calleeFrameTagSlot): + (JSC::DFG::SpeculativeJIT::calleeFramePayloadSlot): + (JSC::DFG::SpeculativeJIT::calleeArgumentTagSlot): + (JSC::DFG::SpeculativeJIT::calleeArgumentPayloadSlot): + - Prefixed all the above with callee since they apply to the callee frame. + (JSC::DFG::SpeculativeJIT::calleeFrameCallerFrame): + - Added to set the callerFrame pointer in the callee frame. - DFG PutByValAlias is too aggressive - https://bugs.webkit.org/show_bug.cgi?id=90026 - + * dfg/DFGSpeculativeJIT32_64.cpp: + (JSC::DFG::SpeculativeJIT::emitCall): + (JSC::DFG::SpeculativeJIT::compile): + * dfg/DFGSpeculativeJIT64.cpp: + (JSC::DFG::SpeculativeJIT::emitCall): + (JSC::DFG::SpeculativeJIT::compile): + * ftl/FTLLink.cpp: + (JSC::FTL::compileEntry): + (JSC::FTL::link): + * interpreter/CallFrame.h: + (JSC::ExecState::callerFrame): + (JSC::ExecState::callerFrameOffset): + (JSC::ExecState::returnPC): + (JSC::ExecState::hasReturnPC): + (JSC::ExecState::clearReturnPC): + (JSC::ExecState::returnPCOffset): + (JSC::ExecState::setCallerFrame): + (JSC::ExecState::setReturnPC): + (JSC::ExecState::callerFrameAndPC): + * interpreter/JSStack.h: + * interpreter/Register.h: + * jit/AssemblyHelpers.h: + (JSC::AssemblyHelpers::emitPutToCallFrameHeader): + - Convert to using storePtr() here and simplify the code. + (JSC::AssemblyHelpers::emitGetCallerFrameFromCallFrameHeaderPtr): + (JSC::AssemblyHelpers::emitPutCallerFrameToCallFrameHeader): + (JSC::AssemblyHelpers::emitGetReturnPCFromCallFrameHeaderPtr): + (JSC::AssemblyHelpers::emitPutReturnPCToCallFrameHeader): + - Helpers to emit gets/puts of the callerFrame and returnPC. + (JSC::AssemblyHelpers::addressForByteOffset): + * jit/JIT.cpp: + (JSC::JIT::JIT): + (JSC::JIT::privateCompile): + (JSC::JIT::privateCompileExceptionHandlers): + * jit/JITCall.cpp: + (JSC::JIT::compileCallEval): + (JSC::JIT::compileOpCall): + * jit/JITCall32_64.cpp: + (JSC::JIT::emit_op_ret): + (JSC::JIT::emit_op_ret_object_or_this): + (JSC::JIT::compileCallEval): + (JSC::JIT::compileOpCall): + * jit/JITInlines.h: + (JSC::JIT::unmap): + * jit/JITOpcodes.cpp: + (JSC::JIT::emit_op_end): + (JSC::JIT::emit_op_ret): + (JSC::JIT::emit_op_ret_object_or_this): + * jit/JITOpcodes32_64.cpp: + (JSC::JIT::privateCompileCTINativeCall): + (JSC::JIT::emit_op_end): + * jit/JITOperations.cpp: + * jit/SpecializedThunkJIT.h: + (JSC::SpecializedThunkJIT::returnJSValue): + (JSC::SpecializedThunkJIT::returnDouble): + (JSC::SpecializedThunkJIT::returnInt32): + (JSC::SpecializedThunkJIT::returnJSCell): + * jit/ThunkGenerators.cpp: + (JSC::throwExceptionFromCallSlowPathGenerator): + (JSC::slowPathFor): + (JSC::nativeForGenerator): - Reviewed by Gavin Barraclough. + * llint/LLIntData.cpp: + (JSC::LLInt::Data::performAssertions): + * llint/LowLevelInterpreter.asm: + - Updated offsets and asserts to match the new CallFrame layout. - For CSE on normal arrays, we now treat PutByVal as impure. This does not appear to affect - performance by much. +2013-10-30 Filip Pizlo - For CSE on typed arrays, we fix PutByValAlias by making GetByVal speculate that the access - is within bounds. This also has the effect of making our out-of-bounds handling consistent - with WebCore. + Unreviewed, fix Mac. - * dfg/DFGCSEPhase.cpp: - (JSC::DFG::CSEPhase::performNodeCSE): - * dfg/DFGGraph.h: - (JSC::DFG::Graph::byValIsPure): - (JSC::DFG::Graph::clobbersWorld): - * dfg/DFGNodeType.h: - (DFG): - * dfg/DFGSpeculativeJIT.cpp: - (JSC::DFG::SpeculativeJIT::compileGetByValOnIntTypedArray): - (JSC::DFG::SpeculativeJIT::compileGetByValOnFloatTypedArray): + * assembler/AbstractMacroAssembler.h: + (JSC::AbstractMacroAssembler::RegisterAllocationOffset::checkOffsets): + (JSC::AbstractMacroAssembler::checkRegisterAllocationAgainstBranchRange): -2012-07-30 Lucas Forschler +2013-10-30 Filip Pizlo - Merge 121391 + Unreviewed, fix Windows. - 2012-06-27 Filip Pizlo + * bytecode/CodeBlock.cpp: + (JSC::CodeBlock::jettison): - Javascript SHA-512 gives wrong hash on second and subsequent runs unless Web Inspector Javascript Debugging is on - https://bugs.webkit.org/show_bug.cgi?id=90053 - +2013-10-30 Filip Pizlo - Reviewed by Mark Hahnenberg. + Unreviewed, fix Windows. - The problem is that the code was assuming that the recovery should be Undefined if the source of - the SetLocal was !shouldGenerate(). But that's wrong, since the DFG optimizer may skip around a - UInt32ToNumber node (hence making it !shouldGenerate()) and keep the source of that node alive. - In that case we should base the recovery on the source of the UInt32ToNumber. The logic for this - was already in place but the fast check for !shouldGenerate() broke it. + * bytecode/CodeBlock.h: + (JSC::CodeBlock::addFrequentExitSite): - * dfg/DFGSpeculativeJIT.cpp: - (JSC::DFG::SpeculativeJIT::computeValueRecoveryFor): +2013-10-29 Filip Pizlo -2012-06-06 Mark Rowe + Add InvalidationPoints to the DFG and use them for all watchpoints + https://bugs.webkit.org/show_bug.cgi?id=123472 - Merge r118995. + Reviewed by Mark Hahnenberg. + + This makes a fundamental change to how watchpoints work in the DFG. + + Previously, a watchpoint was an instruction whose execution semantics were something + like: + + if (watchpoint->invalidated) + exit + + We would implement this without any branch by using jump replacement. + + This is a very good optimization. But it's a bit awkward once you get a lot of + watchpoints: semantically we will have lots of these branches in the code, which the + compiler needs to reason about even though they don't actually result in any emitted + code. + + Separately, we also had a mechanism for jettisoning a CodeBlock. This mechanism would + be invoked if a CodeBlock exited a lot. It would ensure that a CodeBlock wouldn't be + called into again, but it would do nothing for CodeBlocks that were already on the + stack. + + This change flips jettisoning and watchpoint invalidation on their heads. Now, the jump + replacement has nothing to do with watchpoints; instead it's something that happens if + you ever jettison a CodeBlock. Jump replacement is now an all-or-nothing operation over + all of the potential call-return safe-exit-points in a CodeBlock. We call these + "InvalidationPoint"s. A watchpoint instruction is now "lowered" by having the DFG + collect all of the watchpoint sets that the CodeBlock cares about, and then registering + a CodeBlockJettisoningWatchpoint with all of them. That is, if the watchpoint fires, it + jettisons the CodeBlock, which in turn ensures that the CodeBlock can't be called into + (because the entrypoint now points to baseline code) and can't be returned into + (because returning exits to baseline before the next bytecode instruction). + + This will allow for a sensible lowering of watchpoints to LLVM IR. It will also allow + for jettison() to be used effectively for things like breakpointing and single-stepping + in the debugger. + + Well, basically, this mechanism just takes us into the HotSpot-style world where anyone + can, at any time and for any reason, request that an optimized CodeBlock is rendered + immediately invalid. You can use this for many cool things, I'm sure. - 2012-05-30 Oliver Hunt + * CMakeLists.txt: + * GNUmakefile.list.am: + * JavaScriptCore.vcxproj/JavaScriptCore.vcxproj: + * JavaScriptCore.xcodeproj/project.pbxproj: + * assembler/AbstractMacroAssembler.h: + * bytecode/CodeBlock.cpp: + (JSC::CodeBlock::jettison): + * bytecode/CodeBlock.h: + * bytecode/CodeBlockJettisoningWatchpoint.cpp: Added. + (JSC::CodeBlockJettisoningWatchpoint::fireInternal): + * bytecode/CodeBlockJettisoningWatchpoint.h: Added. + (JSC::CodeBlockJettisoningWatchpoint::CodeBlockJettisoningWatchpoint): + * bytecode/ExitKind.cpp: + (JSC::exitKindToString): + * bytecode/ExitKind.h: + * bytecode/ProfiledCodeBlockJettisoningWatchpoint.cpp: Added. + (JSC::ProfiledCodeBlockJettisoningWatchpoint::fireInternal): + * bytecode/ProfiledCodeBlockJettisoningWatchpoint.h: Added. + (JSC::ProfiledCodeBlockJettisoningWatchpoint::ProfiledCodeBlockJettisoningWatchpoint): + * dfg/DFGAbstractHeap.h: + * dfg/DFGAbstractInterpreterInlines.h: + (JSC::DFG::::executeEffects): + * dfg/DFGClobberize.cpp: + (JSC::DFG::writesOverlap): + * dfg/DFGClobberize.h: + (JSC::DFG::clobberize): + (JSC::DFG::AbstractHeapOverlaps::AbstractHeapOverlaps): + (JSC::DFG::AbstractHeapOverlaps::operator()): + (JSC::DFG::AbstractHeapOverlaps::result): + * dfg/DFGCommonData.cpp: + (JSC::DFG::CommonData::invalidate): + * dfg/DFGCommonData.h: + (JSC::DFG::CommonData::CommonData): + * dfg/DFGDesiredWatchpoints.cpp: + (JSC::DFG::DesiredWatchpoints::addLazily): + (JSC::DFG::DesiredWatchpoints::reallyAdd): + * dfg/DFGDesiredWatchpoints.h: + (JSC::DFG::WatchpointForGenericWatchpointSet::WatchpointForGenericWatchpointSet): + (JSC::DFG::GenericDesiredWatchpoints::addLazily): + (JSC::DFG::GenericDesiredWatchpoints::reallyAdd): + (JSC::DFG::GenericDesiredWatchpoints::areStillValid): + * dfg/DFGFixupPhase.cpp: + (JSC::DFG::FixupPhase::fixupNode): + * dfg/DFGInvalidationPointInjectionPhase.cpp: Added. + (JSC::DFG::InvalidationPointInjectionPhase::InvalidationPointInjectionPhase): + (JSC::DFG::InvalidationPointInjectionPhase::run): + (JSC::DFG::InvalidationPointInjectionPhase::handle): + (JSC::DFG::InvalidationPointInjectionPhase::insertInvalidationCheck): + (JSC::DFG::performInvalidationPointInjection): + * dfg/DFGInvalidationPointInjectionPhase.h: Added. + * dfg/DFGJITCode.h: + * dfg/DFGJITCompiler.cpp: + (JSC::DFG::JITCompiler::linkOSRExits): + (JSC::DFG::JITCompiler::link): + * dfg/DFGJITCompiler.h: + * dfg/DFGJumpReplacement.cpp: Added. + (JSC::DFG::JumpReplacement::fire): + * dfg/DFGJumpReplacement.h: Added. + (JSC::DFG::JumpReplacement::JumpReplacement): + * dfg/DFGNodeType.h: + * dfg/DFGOSRExitCompilationInfo.h: + * dfg/DFGOperations.cpp: + * dfg/DFGPlan.cpp: + (JSC::DFG::Plan::compileInThreadImpl): + (JSC::DFG::Plan::reallyAdd): + * dfg/DFGPredictionPropagationPhase.cpp: + (JSC::DFG::PredictionPropagationPhase::propagate): + * dfg/DFGSafeToExecute.h: + (JSC::DFG::safeToExecute): + * dfg/DFGSpeculativeJIT.cpp: + (JSC::DFG::SpeculativeJIT::emitInvalidationPoint): + (JSC::DFG::SpeculativeJIT::compilePeepHoleObjectEquality): + (JSC::DFG::SpeculativeJIT::compileGetByValOnString): + * dfg/DFGSpeculativeJIT.h: + (JSC::DFG::SpeculativeJIT::masqueradesAsUndefinedWatchpointIsStillValid): + (JSC::DFG::SpeculativeJIT::speculateStringObjectForStructure): + * dfg/DFGSpeculativeJIT32_64.cpp: + (JSC::DFG::SpeculativeJIT::nonSpeculativeNonPeepholeCompareNull): + (JSC::DFG::SpeculativeJIT::nonSpeculativePeepholeBranchNull): + (JSC::DFG::SpeculativeJIT::compileObjectEquality): + (JSC::DFG::SpeculativeJIT::compileObjectToObjectOrOtherEquality): + (JSC::DFG::SpeculativeJIT::compilePeepHoleObjectToObjectOrOtherEquality): + (JSC::DFG::SpeculativeJIT::compileObjectOrOtherLogicalNot): + (JSC::DFG::SpeculativeJIT::emitObjectOrOtherBranch): + (JSC::DFG::SpeculativeJIT::compile): + * dfg/DFGSpeculativeJIT64.cpp: + (JSC::DFG::SpeculativeJIT::nonSpeculativeNonPeepholeCompareNull): + (JSC::DFG::SpeculativeJIT::nonSpeculativePeepholeBranchNull): + (JSC::DFG::SpeculativeJIT::compileObjectEquality): + (JSC::DFG::SpeculativeJIT::compileObjectToObjectOrOtherEquality): + (JSC::DFG::SpeculativeJIT::compilePeepHoleObjectToObjectOrOtherEquality): + (JSC::DFG::SpeculativeJIT::compileObjectOrOtherLogicalNot): + (JSC::DFG::SpeculativeJIT::emitObjectOrOtherBranch): + (JSC::DFG::SpeculativeJIT::compile): + * dfg/DFGWatchpointCollectionPhase.cpp: Added. + (JSC::DFG::WatchpointCollectionPhase::WatchpointCollectionPhase): + (JSC::DFG::WatchpointCollectionPhase::run): + (JSC::DFG::WatchpointCollectionPhase::handle): + (JSC::DFG::WatchpointCollectionPhase::handleEdge): + (JSC::DFG::WatchpointCollectionPhase::handleMasqueradesAsUndefined): + (JSC::DFG::WatchpointCollectionPhase::handleStringGetByVal): + (JSC::DFG::WatchpointCollectionPhase::addLazily): + (JSC::DFG::WatchpointCollectionPhase::globalObject): + (JSC::DFG::performWatchpointCollection): + * dfg/DFGWatchpointCollectionPhase.h: Added. + * ftl/FTLCapabilities.cpp: + (JSC::FTL::canCompile): + * ftl/FTLLowerDFGToLLVM.cpp: + (JSC::FTL::LowerDFGToLLVM::compileNode): + (JSC::FTL::LowerDFGToLLVM::compileStructureTransitionWatchpoint): + (JSC::FTL::LowerDFGToLLVM::compileGetByVal): + (JSC::FTL::LowerDFGToLLVM::compileGlobalVarWatchpoint): + (JSC::FTL::LowerDFGToLLVM::compileCompareEqConstant): + (JSC::FTL::LowerDFGToLLVM::compileCompareStrictEq): + (JSC::FTL::LowerDFGToLLVM::compileCompareStrictEqConstant): + (JSC::FTL::LowerDFGToLLVM::compileInvalidationPoint): + (JSC::FTL::LowerDFGToLLVM::equalNullOrUndefined): + (JSC::FTL::LowerDFGToLLVM::speculateNonNullObject): + * jit/JITOperations.cpp: + * jit/JumpReplacementWatchpoint.cpp: Removed. + * jit/JumpReplacementWatchpoint.h: Removed. + +2013-10-25 Mark Hahnenberg + + JSExport doesn't support constructors + https://bugs.webkit.org/show_bug.cgi?id=123380 + + Reviewed by Geoffrey Garen. + + Support for constructor-style callbacks for the Objective-C API to JSC is currently limited to + Objective-C blocks. Any clients who try to call the constructor of a JSExport-ed Objective-C class + are met with a type error stating that it cannot be called as a constructor. + + It would be nice to expand JSExport's functionality to support this idiom. It is a natural + extension to JSExport and would increase the expressiveness and simplicity in both Objective-C and + JavaScript client code. + + The way we'll do this is to expand the capabilities of ObjCCallbackFunction and associated classes. + Instead of constructing a normal C API object for the constructor, we'll instead allocate a full-blown + ObjCCallbackFunction object which can already properly handle being invoked as a constructor. + + * API/JSWrapperMap.mm: + (copyMethodsToObject): + (allocateConstructorForCustomClass): + (-[JSObjCClassInfo allocateConstructorAndPrototypeWithSuperClassInfo:]): + (tryUnwrapObjcObject): + * API/ObjCCallbackFunction.h: + (JSC::ObjCCallbackFunction::impl): + * API/ObjCCallbackFunction.mm: + (JSC::ObjCCallbackFunctionImpl::ObjCCallbackFunctionImpl): + (JSC::ObjCCallbackFunctionImpl::wrappedConstructor): + (JSC::ObjCCallbackFunctionImpl::isConstructible): + (JSC::ObjCCallbackFunction::getConstructData): + (JSC::ObjCCallbackFunctionImpl::name): + (JSC::ObjCCallbackFunctionImpl::call): + (objCCallbackFunctionForInvocation): + (objCCallbackFunctionForInit): + (tryUnwrapConstructor): + * API/tests/testapi.mm: + (-[TextXYZ initWithString:]): + (-[ClassA initWithA:]): + (-[ClassB initWithA:b:]): + (-[ClassC initWithA:]): + (-[ClassC initWithA:b:]): + +2013-10-30 peavo@outlook.com + + [Win] Compile errors when enabling DFG JIT. + https://bugs.webkit.org/show_bug.cgi?id=120998 - Really provide error information with the inspector disabled - https://bugs.webkit.org/show_bug.cgi?id=87910 + Reviewed by Brent Fulgham. - Reviewed by Filip Pizlo. + * JavaScriptCore.vcxproj/JavaScriptCore.vcxproj: Added files. + * JavaScriptCore.vcxproj/JavaScriptCore.vcxproj.filters: Ditto. + * dfg/DFGAllocator.h: Removed scope. + * dfg/DFGWorklist.cpp: Use new ThreadingOnce class instead of pthread_once. + (JSC::DFG::globalWorklist): + * heap/DeferGC.h: Link fix, member needs to be public. + * jit/JITOperationWrappers.h: Added required assembler macros. - Don't bother checking for anything other than pre-existing error info. - In the absence of complete line number information you'll only get the - line a function starts on, but at least it's something. +2013-10-30 Iago Toral Quiroga - * interpreter/Interpreter.cpp: - (JSC::Interpreter::throwException): + Add result caching for Math.cos + https://bugs.webkit.org/show_bug.cgi?id=123255 -2012-06-06 Mark Rowe + Reviewed by Brent Fulgham. - Merge r118992. + * runtime/MathObject.cpp: + (JSC::mathProtoFuncCos): + * runtime/VM.h: - 2012-05-30 Filip Pizlo +2013-10-30 Alex Christensen - LLInt broken on x86-32 with JIT turned off - https://bugs.webkit.org/show_bug.cgi?id=87906 + Disabled JIT on Win64. + https://bugs.webkit.org/show_bug.cgi?id=122472 Reviewed by Geoffrey Garen. - - Fixed the code to not clobber registers that contain important things, like the call frame. - * llint/LowLevelInterpreter32_64.asm: + * JavaScriptCore.vcxproj/JavaScriptCore.vcxproj: + Disabled building JITStubsMSVC64. -2012-05-31 Ojan Vafai +2013-10-29 Michael Saboff - add back the ability to disable flexbox - https://bugs.webkit.org/show_bug.cgi?id=87147 + Change local variable register allocation to start at offset -1 + https://bugs.webkit.org/show_bug.cgi?id=123182 - Reviewed by Tony Chang. + Reviewed by Geoffrey Garen. - * Configurations/FeatureDefines.xcconfig: + Adjusted the virtual register mapping down by one slot. Reduced + the CallFrame header slots offsets by one. They now start at 0. + Changed arity fixup to no longer skip passed register slot 0 as this + is now part of the CallFrame header. -2012-05-31 Tim Horton + * bytecode/VirtualRegister.h: + (JSC::operandIsLocal): + (JSC::operandIsArgument): + (JSC::VirtualRegister::localToOperand): + (JSC::VirtualRegister::operandToLocal): + Adjusted functions for shift in mapping from local to register offset. - Disable CSS3 flexbox - + * dfg/DFGByteCodeParser.cpp: + (JSC::DFG::ByteCodeParser::findArgumentPositionForLocal): + (JSC::DFG::ByteCodeParser::addCall): + (JSC::DFG::ByteCodeParser::handleInlining): + (JSC::DFG::ByteCodeParser::parseBlock): + * dfg/DFGVariableEventStream.cpp: + (JSC::DFG::VariableEventStream::reconstruct): + * dfg/DFGVirtualRegisterAllocationPhase.cpp: + (JSC::DFG::VirtualRegisterAllocationPhase::run): + * interpreter/CallFrame.h: + (JSC::ExecState::frameExtent): + (JSC::ExecState::offsetFor): + * interpreter/Interpreter.cpp: + (JSC::loadVarargs): + (JSC::Interpreter::dumpRegisters): + (JSC::Interpreter::executeCall): + * llint/LLIntData.cpp: + (JSC::LLInt::Data::performAssertions): + * llint/LowLevelInterpreter.asm: + Adjusted math to accomodate for shift in call frame slots. - Reviewed by John Sullivan. + * dfg/DFGJITCompiler.cpp: + (JSC::DFG::JITCompiler::compileFunction): + * dfg/DFGSpeculativeJIT.h: + (JSC::DFG::SpeculativeJIT::calleeFrameOffset): + * interpreter/CallFrame.cpp: + (JSC::CallFrame::frameExtentInternal): + * interpreter/JSStackInlines.h: + (JSC::JSStack::pushFrame): + * jit/JIT.cpp: + (JSC::JIT::privateCompile): + * jit/JITOperations.cpp: + * llint/LLIntSlowPaths.cpp: + (JSC::LLInt::llint_slow_path_stack_check): + * runtime/CommonSlowPaths.h: + (JSC::CommonSlowPaths::arityCheckFor): + Fixed offset calculation to use VirtualRegister and related calculation instead of + doing seperate calculations. - * Configurations/FeatureDefines.xcconfig: + * interpreter/JSStack.h: + Adjusted CallFrame slots down by one. Did some miscellaneous fixing of dumpRegisters() + in the process of testing the fixes. -2012-05-31 Tim Horton + * jit/ThunkGenerators.cpp: + (JSC::arityFixup): + Changed arity fixup to no longer skip passed register slot 0 as this + is now part of the CallFrame header. - Add feature defines for web-facing parts of CSS Regions and Exclusions - https://bugs.webkit.org/show_bug.cgi?id=87442 - + * llint/LowLevelInterpreter32_64.asm: + * llint/LowLevelInterpreter64.asm: + Changed arity fixup to no longer skip passed register slot 0 as this + is now part of the CallFrame header. Updated op_enter processing for + the change in local registers. - Reviewed by Dan Bernstein. + * runtime/JSGlobalObject.h: + Removed the now unneeded extra slot in the global callframe - * Configurations/FeatureDefines.xcconfig: +2013-10-29 Julien Brianceau -2012-05-30 Lucas Forschler + [arm] Fix lots of crashes because of 4th argument register trampling. + https://bugs.webkit.org/show_bug.cgi?id=123421 - Merge 118956 + Reviewed by Michael Saboff. - 2012-05-30 Oliver Hunt + r3 register is the 4th argument register for ARM and also a scratch + register in the baseline JIT for this architecture. We can use r6 + instead, as this used to be the timeoutCheckRegister and it is no + longer used since r148119. + + * assembler/ARMAssembler.h: Temp register is now r6 instead of r3 for ARM. + * assembler/MacroAssemblerARMv7.h: Temp register is now r6 instead of r3 for ARMv7. + * jit/GPRInfo.h: Add r3 properly in GPRInfo for ARM. + (JSC::GPRInfo::toRegister): + (JSC::GPRInfo::toIndex): + * jit/JITStubsARM.h: + (JSC::ctiTrampoline): Remove obsolete timeoutCheckRegister init. + * jit/JITStubsARMv7.h: + (JSC::ctiTrampoline): Remove obsolete timeoutCheckRegister init. + * jit/JSInterfaceJIT.h: Remove useless stuff. + * yarr/YarrJIT.cpp: Use r3 and not the new scratch register r6. + (JSC::Yarr::YarrGenerator::generateEnter): r8 register doesn't need to be saved. + (JSC::Yarr::YarrGenerator::generateReturn): + +2013-10-29 Julien Brianceau + + Fix CPU(ARM_TRADITIONAL) build after r157690. + https://bugs.webkit.org/show_bug.cgi?id=123247 - DFG does not correctly handle exceptions caught in the LLInt - https://bugs.webkit.org/show_bug.cgi?id=87885 + Reviewed by Michael Saboff. - Reviewed by Filip Pizlo. + Since r157690, the executableCopy function has been removed from AssemblerBuffer.h + and the copy of executable code occurs in the linkCode function (in LinkBuffer.cpp). + As the constant pool for jumps is updated in the executableCopy function of ARM_TRADITIONAL, + this part of code still needs to be called and absolute jumps must be corrected to anticipate + the copy of the executable code through memcpy. - Make the DFG use genericThrow, rather than reimplementing a small portion of it. - Also make the LLInt slow paths validate that their PC is correct. + * assembler/ARMAssembler.cpp: + (JSC::ARMAssembler::prepareExecutableCopy): Rename executableCopy to prepareExecutableCopy + and correct absolute jump values using the delta between the source and destination buffers. + * assembler/ARMAssembler.h: + * assembler/LinkBuffer.cpp: + (JSC::LinkBuffer::linkCode): Call prepareExecutableCopy just before the memcpy. - * dfg/DFGOperations.cpp: - * llint/LLIntSlowPaths.cpp: - (LLInt): +2013-10-28 Filip Pizlo -2012-05-30 Lucas Forschler + OSRExit::m_watchpointIndex should be in OSRExitCompilationInfo + https://bugs.webkit.org/show_bug.cgi?id=123423 - Merge 118810 + Reviewed by Mark Hahnenberg. + + Also enable ExitKind to tell you if it's a watchpoint. - 2012-05-29 Mark Hahnenberg + * bytecode/ExitKind.cpp: + (JSC::exitKindToString): + * bytecode/ExitKind.h: + (JSC::isWatchpoint): + * dfg/DFGByteCodeParser.cpp: + (JSC::DFG::ByteCodeParser::setLocal): + (JSC::DFG::ByteCodeParser::setArgument): + (JSC::DFG::ByteCodeParser::handleCall): + (JSC::DFG::ByteCodeParser::handleGetById): + (JSC::DFG::ByteCodeParser::parseBlock): + * dfg/DFGJITCompiler.cpp: + (JSC::DFG::JITCompiler::linkOSRExits): + (JSC::DFG::JITCompiler::link): + * dfg/DFGJITCompiler.h: + (JSC::DFG::JITCompiler::appendExitInfo): + * dfg/DFGOSRExit.cpp: + (JSC::DFG::OSRExit::OSRExit): + * dfg/DFGOSRExit.h: + * dfg/DFGOSRExitCompilationInfo.h: + (JSC::DFG::OSRExitCompilationInfo::OSRExitCompilationInfo): + * dfg/DFGOSRExitCompiler.cpp: + * dfg/DFGSpeculativeJIT.cpp: + (JSC::DFG::SpeculativeJIT::speculationWatchpoint): + * dfg/DFGSpeculativeJIT32_64.cpp: + (JSC::DFG::SpeculativeJIT::compile): + * dfg/DFGSpeculativeJIT64.cpp: + (JSC::DFG::SpeculativeJIT::compile): - CopiedSpace::doneCopying could start another collection - https://bugs.webkit.org/show_bug.cgi?id=86538 +2013-10-28 Myles C. Maxfield - Reviewed by Geoffrey Garen. + Parsing support for -webkit-text-decoration-skip: ink + https://bugs.webkit.org/show_bug.cgi?id=123358 - It's possible that if we don't have anything at the head of to-space - after a collection and the BlockAllocator doesn't have any fresh blocks - to give us right now we could start another collection while still in - the middle of the first collection when we call CopiedSpace::addNewBlock(). + Reviewed by Dean Jackson. - One way to resolve this would be to have Heap::shouldCollect() check that - m_operationInProgress is NoOperation. This would prevent the path in - getFreshBlock() that starts the collection if we're already in the middle of one. + Adding ENABLE(CSS3_TEXT_DECORATION) - I could not come up with a test case to reproduce this crash on ToT. + * Configurations/FeatureDefines.xcconfig: - * heap/Heap.h: - (JSC::Heap::shouldCollect): We shouldn't collect if we're already in the middle - of a collection, i.e. the current operation should be NoOperation. +2013-10-24 Filip Pizlo -2012-05-30 Lucas Forschler + Get rid of InlineStart so that I don't have to implement it in FTL + https://bugs.webkit.org/show_bug.cgi?id=123302 - Merge + Reviewed by Geoffrey Garen. + + InlineStart was a special instruction that we would insert at the top of inlined code, + so that the backend could capture the OSR state of arguments to an inlined call. It used + to be that only the backend had this information, so this instruction was sort of an ugly + callback from the backend for filling in some data structures. + + But in the time since when that code was written (two years ago?), we rationalized how + variables work. It's now the case that variables that the runtime must know about are + treated specially in IR (they are "flushed") and we know how we will represent them even + before we get to the backend. The last place that makes changes to their representation + is the StackLayoutPhase. + + So, this patch gets rid of InlineStart, but keeps around the special meta-data that the + instruction had. Instead of handling the bookkeeping in the backend, we handle it in + StackLayoutPhase. This means that the DFG and FTL can share code for handling this + bookkeeping. This also means that now the FTL can compile code blocks that had inlining. + + Of course, giving the FTL the ability to handle code blocks that had inlining means that + we're going to have new bugs. Sure enough, the FTL's linker didn't handle inline call + frames. This patch also fixes that. -2012-05-23 Lucas Forschler + * dfg/DFGAbstractInterpreterInlines.h: + (JSC::DFG::::executeEffects): + * dfg/DFGByteCodeParser.cpp: + (JSC::DFG::ByteCodeParser::handleInlining): + (JSC::DFG::ByteCodeParser::InlineStackEntry::InlineStackEntry): + * dfg/DFGClobberize.h: + (JSC::DFG::clobberize): + * dfg/DFGFixupPhase.cpp: + (JSC::DFG::FixupPhase::fixupNode): + * dfg/DFGGraph.h: + * dfg/DFGNode.h: + * dfg/DFGNodeType.h: + * dfg/DFGPredictionPropagationPhase.cpp: + (JSC::DFG::PredictionPropagationPhase::propagate): + * dfg/DFGSafeToExecute.h: + (JSC::DFG::safeToExecute): + * dfg/DFGSpeculativeJIT.cpp: + * dfg/DFGSpeculativeJIT.h: + * dfg/DFGSpeculativeJIT32_64.cpp: + (JSC::DFG::SpeculativeJIT::compile): + * dfg/DFGSpeculativeJIT64.cpp: + (JSC::DFG::SpeculativeJIT::compile): + * dfg/DFGStackLayoutPhase.cpp: + (JSC::DFG::StackLayoutPhase::run): + * ftl/FTLLink.cpp: + (JSC::FTL::link): - Merge 117860 +2013-10-24 Filip Pizlo - 2012-05-21 Michael Saboff + The GetById->GetByOffset AI-based optimization should actually do things + https://bugs.webkit.org/show_bug.cgi?id=123299 - Cleanup of Calls to operationStrCat and operationNewArray and Use Constructor after r117729 - https://bugs.webkit.org/show_bug.cgi?id=87027 + Reviewed by Oliver Hunt. + + 20% speed-up on Octane/gbemu. - Reviewed by Oliver Hunt. + * bytecode/GetByIdStatus.cpp: + (JSC::GetByIdStatus::computeFor): Actually finish filling in the Status by setting the state. Previously it would remain set to NoInformation, meaning that this whole method was a no-op. - Change calls to operationStrCat and operationNewArray to provide the - pointer to the EncodedJSValue* data buffer instead of the ScratchBuffer - that contains it. Added a ScratchBuffer::create() function. - This is a clean-up to r117729. +2013-10-28 Carlos Garcia Campos - * dfg/DFGOperations.cpp: - * dfg/DFGSpeculativeJIT32_64.cpp: - (JSC::DFG::SpeculativeJIT::compile): - * dfg/DFGSpeculativeJIT64.cpp: - (JSC::DFG::SpeculativeJIT::compile): - * runtime/JSGlobalData.h: - (JSC::ScratchBuffer::create): - (JSC::ScratchBuffer::dataBuffer): - (JSC::JSGlobalData::scratchBufferForSize): + Unreviewed. Fix make distcheck. -2012-05-23 Lucas Forschler + * GNUmakefile.list.am: Add missing files to compilation. - Merge 117729 +2013-10-25 Oliver Hunt - 2012-05-20 Michael Saboff + Refactor parser rollback logic + https://bugs.webkit.org/show_bug.cgi?id=123372 - JSGlobalData ScratchBuffers Are Not Visited During Garbage Collection - https://bugs.webkit.org/show_bug.cgi?id=86553 + Reviewed by Brady Eidson. - Reviewed by Gavin Barraclough. + Add a sane abstraction for rollbacks in the parser. - Scratch buffers can contain the only reference to live objects. - Therefore visit scratch buffer contents as conservative roots. - Changed the scratch buffers to be a struct with an "active" - length and the actual buffer. The users of the scratch - buffer emit code where needed to set and clear the active - length as appropriate. During marking, the active count is - used for conservative marking. + * parser/Parser.cpp: + (JSC::::parseSourceElements): + (JSC::::parseObjectLiteral): + * parser/Parser.h: + (JSC::Parser::createSavePoint): + (JSC::Parser::restoreSavePoint): - * dfg/DFGAssemblyHelpers.h: - (JSC::DFG::AssemblyHelpers::debugCall): - * dfg/DFGOSRExitCompiler32_64.cpp: - (JSC::DFG::OSRExitCompiler::compileExit): - * dfg/DFGOSRExitCompiler64.cpp: - (JSC::DFG::OSRExitCompiler::compileExit): - * dfg/DFGOperations.cpp: - * dfg/DFGOperations.h: - * dfg/DFGSpeculativeJIT32_64.cpp: - (JSC::DFG::SpeculativeJIT::compile): - * dfg/DFGSpeculativeJIT64.cpp: - (JSC::DFG::SpeculativeJIT::compile): - * dfg/DFGThunks.cpp: - (JSC::DFG::osrExitGenerationThunkGenerator): - * heap/Heap.cpp: - (JSC::Heap::markRoots): - * runtime/JSGlobalData.cpp: - (JSC::JSGlobalData::gatherConservativeRoots): - * runtime/JSGlobalData.h: - (JSC::ScratchBuffer::ScratchBuffer): - (ScratchBuffer): - (JSC::ScratchBuffer::allocationSize): - (JSC::ScratchBuffer::setActiveLength): - (JSC::ScratchBuffer::activeLength): - (JSC::ScratchBuffer::activeLengthPtr): - (JSC::ScratchBuffer::dataBuffer): - (JSGlobalData): - (JSC::JSGlobalData::scratchBufferForSize): +2013-10-25 peavo@outlook.com -2012-05-21 Lucas Forschler + [Win] Javascript crash with DFG JIT enabled. + https://bugs.webkit.org/show_bug.cgi?id=121001 - Merge 117523 + Reviewed by Geoffrey Garen. - 2012-05-17 Filip Pizlo + On windows, using register GPRInfo::regT0 as parameter to e.g. JIT::storeDouble(..., GPRInfo::regT0)), + results in a call to JIT::storeDouble(FPRegisterID src, const void* address), + where the address parameter gets the value of GPRInfo::regT0, which is 0 (eax on Windows). + This causes the register to be written to address 0, hence the crash. + + * assembler/MacroAssemblerX86.h: + (JSC::MacroAssemblerX86::storeDouble): Assert if we try to generate code which writes to a null pointer. + * dfg/DFGOSRExitCompiler32_64.cpp: + (JSC::DFG::OSRExitCompiler::compileExit): Use address in regT0 as parameter. + * dfg/DFGThunks.cpp: + (JSC::DFG::osrExitGenerationThunkGenerator): Ditto. - Setting array index -1 and looping over array causes bad behavior - https://bugs.webkit.org/show_bug.cgi?id=86733 - +2013-10-25 Oliver Hunt - Reviewed by Oliver Hunt. + Fix a number of problems with destructuring of arguments + https://bugs.webkit.org/show_bug.cgi?id=123357 - * dfg/DFGOperations.cpp: + Reviewed by Filip Pizlo. -2012-05-21 Lucas Forschler + This renames the destructuring node's emitBytecode to bindValue + in order to remove the existing confusion over what was happening. - Merge 117193 + We then fix an incorrect fall through in the destructuring arguments + logic, and fix the then exposed bug where we placed the index rather + than value into the bound property. - 2012-05-15 Oliver Hunt + * bytecompiler/BytecodeGenerator.cpp: + (JSC::BytecodeGenerator::BytecodeGenerator): + * bytecompiler/NodesCodegen.cpp: + (JSC::ForInNode::emitBytecode): + (JSC::ForOfNode::emitBytecode): + (JSC::DeconstructingAssignmentNode::emitBytecode): + (JSC::ArrayPatternNode::bindValue): + (JSC::ArrayPatternNode::emitDirectBinding): + (JSC::ObjectPatternNode::bindValue): + (JSC::BindingNode::bindValue): + * parser/Nodes.h: - Make error information available even if all we have is line number information. - https://bugs.webkit.org/show_bug.cgi?id=86547 +2013-10-25 Joseph Pecoraro - Reviewed by Filip Pizlo. + Upstream ENABLE(REMOTE_INSPECTOR) and enable on iOS and Mac + https://bugs.webkit.org/show_bug.cgi?id=123111 - We don't need expression information to generate useful line, file, and stack information, - so only require that we have line number info available. + Reviewed by Timothy Hatcher. - * interpreter/Interpreter.cpp: - (JSC::Interpreter::throwException): - * runtime/Executable.h: - (JSC): + * Configurations/FeatureDefines.xcconfig: -2012-05-21 Lucas Forschler +2013-10-25 Oliver Hunt - Merge 117201 + Fix MSVC again - 2012-05-15 Mark Hahnenberg + * parser/Parser.cpp: - Block freeing thread should not free blocks when we are actively requesting them - https://bugs.webkit.org/show_bug.cgi?id=86519 +2013-10-25 Oliver Hunt - Reviewed by Geoff Garen. + Fix MSVC - * heap/BlockAllocator.h: - (JSC::BlockAllocator::allocate): Reordering the setting of the flag so its done - while we hold the lock to ensure proper locking. + * parser/Parser.cpp: -2012-05-21 Lucas Forschler +2013-10-25 Oliver Hunt - Merge 117183 + Improve JSC Parser error messages + https://bugs.webkit.org/show_bug.cgi?id=123341 - 2012-05-15 Mark Hahnenberg + Reviewed by Andreas Kling. - Block freeing thread should not free blocks when we are actively requesting them - https://bugs.webkit.org/show_bug.cgi?id=86519 + This patch moves away from the current cludgy mechanisms used to produce + error messages and moves to something closer to case by case errors. - Reviewed by Geoffrey Garen. + This results in a large change size as previously we may just have + 'failIfFalse(foo)', but now the logic becomes either + 'failIfFalseWithMessage(foo, "Cannot do blah with ", foo->thing())' + Or alternatively - The block freeing thread shoots us in the foot if it decides to run while we're actively - requesting blocks and returning them. This situation can arise when there is a lot of copying - collection going on in steady state. We allocate a large swath of pages to copy into, then we - return all the newly free old pages to the BlockAllocator. In this state, if the block freeing - thread wakes up in between collections (which is more likely than it waking up during a - collection) and frees half of these pages, they will be needed almost immediately during the - next collection, causing a storm of VM allocations which we know are going to be very slow. + if (!foo) + check for 'interesting' errors, before falling back to generic error - What we'd like is for when things have quieted down the block freeing thread can then return - memory to the OS. Usually this will be when a page has fully loaded and has a low allocation - rate. In this situation, our opportunistic collections will only be running at least every few - seconds, thus the extra time spent doing VM allocations won't matter nearly as much as, say, - while a page is loading. + This means that this patch is large, but produces no semantic changes, and + only hits slow (e.g. error) paths. - * heap/BlockAllocator.cpp: - (JSC::BlockAllocator::BlockAllocator): Initialize our new field. - (JSC::BlockAllocator::blockFreeingThreadMain): We check if we've seen any block requests recently. - If so, reset our flag and go back to sleep. We also don't bother with locking here. If we miss out - on an update, we'll see it when we wake up again. - * heap/BlockAllocator.h: Add new field to track whether or not we've received recent block requests. - (BlockAllocator): - (JSC::BlockAllocator::allocate): If we receive a request for a block, set our field that tracks - that to true. We don't bother locking since we assume that writing to a bool is atomic. + * parser/Parser.cpp: + (JSC::::Parser): + (JSC::::parseSourceElements): + (JSC::::parseVarDeclaration): + (JSC::::parseConstDeclaration): + (JSC::::parseDoWhileStatement): + (JSC::::parseWhileStatement): + (JSC::::parseVarDeclarationList): + (JSC::::createBindingPattern): + (JSC::::parseDeconstructionPattern): + (JSC::::parseConstDeclarationList): + (JSC::::parseForStatement): + (JSC::::parseBreakStatement): + (JSC::::parseContinueStatement): + (JSC::::parseReturnStatement): + (JSC::::parseThrowStatement): + (JSC::::parseWithStatement): + (JSC::::parseSwitchStatement): + (JSC::::parseSwitchClauses): + (JSC::::parseSwitchDefaultClause): + (JSC::::parseTryStatement): + (JSC::::parseDebuggerStatement): + (JSC::::parseBlockStatement): + (JSC::::parseStatement): + (JSC::::parseFormalParameters): + (JSC::::parseFunctionBody): + (JSC::stringForFunctionMode): + (JSC::::parseFunctionInfo): + (JSC::::parseFunctionDeclaration): + (JSC::::parseExpressionOrLabelStatement): + (JSC::::parseExpressionStatement): + (JSC::::parseIfStatement): + (JSC::::parseExpression): + (JSC::::parseAssignmentExpression): + (JSC::::parseConditionalExpression): + (JSC::::parseBinaryExpression): + (JSC::::parseProperty): + (JSC::::parseObjectLiteral): + (JSC::::parseStrictObjectLiteral): + (JSC::::parseArrayLiteral): + (JSC::::parsePrimaryExpression): + (JSC::::parseArguments): + (JSC::::parseMemberExpression): + (JSC::operatorString): + (JSC::::parseUnaryExpression): + (JSC::::printUnexpectedTokenText): + * parser/Parser.h: + (JSC::Scope::hasDeclaredVariable): + (JSC::Scope::hasDeclaredParameter): + (JSC::Parser::hasDeclaredVariable): + (JSC::Parser::hasDeclaredParameter): + (JSC::Parser::setErrorMessage): -2012-05-15 Lucas Forschler +2013-10-24 Mark Rowe - Merge 116785 + Remove references to OS X 10.7 from Xcode configuration settings. - 2012-05-11 Sam Weinig + Now that we're not building for OS X 10.7 they're no longer needed. - Fix crash seen when running with libgmalloc - - https://bugs.webkit.org/show_bug.cgi?id=86232 + Reviewed by Anders Carlsson. - Reviewed by Gavin Barraclough. - - * heap/MarkStack.cpp: - (JSC::MarkStackThreadSharedData::markingThreadMain): - Don't delete the SlotVisitor before the ParallelModeEnabler has had a chance to run its - destructor. + * Configurations/Base.xcconfig: + * Configurations/DebugRelease.xcconfig: + * Configurations/FeatureDefines.xcconfig: + * Configurations/Version.xcconfig: -2012-05-15 Sam Weinig +2013-10-24 Mark Rowe - ENABLE_IFRAME_SEAMLESS should be turned off on the branch + Prepare for the mysterious future. - Reviewed by Andy Estes. + Reviewed by David Kilzer. + * Configurations/Base.xcconfig: + * Configurations/DebugRelease.xcconfig: * Configurations/FeatureDefines.xcconfig: - Disable ENABLE_IFRAME_SEAMLESS. - -2012-05-15 Lucas Forschler + * Configurations/Version.xcconfig: - Merge 116925 +2013-10-24 Mark Lam - 2012-05-13 Filip Pizlo + Better way to fix part of broken C Loop LLINT build. + https://bugs.webkit.org/show_bug.cgi?id=123271. - DFG performs incorrect constant folding on double-to-uint32 conversion in - Uint32Array PutByVal - https://bugs.webkit.org/show_bug.cgi?id=86330 + Reviewed by Geoffrey Garen. - Reviewed by Darin Adler. + Undoing offline asm hackery. - static_cast(d) is wrong, since JS semantics require us to use toInt32(d). - In particular, C++ casts on typical hardware (like x86 and similar) will - return 0x80000000 for double values that are out of range of the int32 domain - (i.e. less than -2^31 or greater than or equal to 2^31). But JS semantics call - for wrap-around; for example the double value 4294967297 ought to become the - int32 value 1, not 0x80000000. + * llint/LowLevelInterpreter.cpp: + * llint/LowLevelInterpreter32_64.asm: + * llint/LowLevelInterpreter64.asm: + * offlineasm/cloop.rb: + * offlineasm/instructions.rb: - * dfg/DFGSpeculativeJIT.cpp: - (JSC::DFG::SpeculativeJIT::compilePutByValForIntTypedArray): +2013-10-24 Mark Lam -2012-05-15 Lucas Forschler + Fix broken C Loop LLINT build. + https://bugs.webkit.org/show_bug.cgi?id=123271. - Merge 116809 + Reviewed by Michael Saboff. - 2012-05-11 Geoffrey Garen + * bytecode/CodeBlock.cpp: + (JSC::CodeBlock::printGetByIdCacheStatus): Added an UNUSED_PARAM(). + (JSC::CodeBlock::dumpBytecode): Added #if ENABLE(JIT) to JIT only code. + * bytecode/GetByIdStatus.cpp: + (JSC::GetByIdStatus::computeFor): Added an UNUSED_PARAM(). + * bytecode/PutByIdStatus.cpp: + (JSC::PutByIdStatus::computeFor): Added an UNUSED_PARAM(). + * bytecode/StructureStubInfo.h: + - Added a stub StubInfoMap for non-JIT builds. StubInfoMap is still used + in function prototypes even when !ENABLE(JIT). Rather that adding #if's + in many places, we just provide a stub/placeholder implementation that + is unused but keeps the compiler happy. + * jit/JITOperations.h: Added #if ENABLE(JIT). + * llint/LowLevelInterpreter32_64.asm: + * llint/LowLevelInterpreter64.asm: + - The putByVal() macro reifies a slow path which is never taken in one case. + This translates into a label that is never used in the C Loop LLINT. The + C++ compiler doesn't like unused labels. So, we fix this by adding a + cloopUnusedLabel offline asm instruction that synthesizes the following: - Clarified JSGlobalData (JavaScript VM) lifetime - https://bugs.webkit.org/show_bug.cgi?id=85142 + if (false) goto unusedLabel; - Reviewed by Alexey Proskuryakov. + This keeps the C++ compiler happy without changing code behavior. + * offlineasm/cloop.rb: Implementing cloopUnusedLabel. + * offlineasm/instructions.rb: Declaring cloopUnusedLabel. + * runtime/Executable.cpp: + (JSC::setupJIT): Added UNUSED_PARAM()s. + (JSC::ScriptExecutable::prepareForExecutionImpl): + - run-javascriptcore-tests have phases that forces the LLINT to be off + which in turn asserts that the JIT is enabled. With the C Loop LLINT, + this combination is illegal. So, we override the setup code here to + always use the LLINT if !ENABLE(JIT) regardless of what options are + passed in. - (Follow-up fix.) +2013-10-24 peavo@outlook.com - * API/JSContextRef.cpp: - (JSGlobalContextCreate): Restored some code I removed because I misread an #ifdef. - (We don't need to test BUILDING_ON_LEOPARD, but we still need the linked-on - test, because apps might have been linked on older OS's.) + Uninitialized member causes crash when DFG JIT is not enabled. + https://bugs.webkit.org/show_bug.cgi?id=123270 -2012-05-15 Lucas Forschler + Reviewed by Brent Fulgham. - Merge 116813 + The data member sizeOfLastScratchBuffer in the VM class is only initialized if DFG JIT is enabled, even though it's defined regardless. + This causes an early crash on Windows, which doesn't have DFG JIT enabled. - 2012-05-11 Filip Pizlo + * runtime/VM.cpp: + (JSC::VM::VM): Initialize sizeOfLastScratchBuffer member regardless of whether DFG JIT is enabled. - JIT memory allocator is not returning memory to the OS on Darwin - https://bugs.webkit.org/show_bug.cgi?id=86047 +2013-10-24 Ryuan Choi - Reviewed by Geoff Garen. + [EFL] Build break with latest EFL 1.8 libraries. + https://bugs.webkit.org/show_bug.cgi?id=123245 - * jit/ExecutableAllocatorFixedVMPool.cpp: - (JSC::FixedVMPoolExecutableAllocator::notifyPageIsFree): + Reviewed by Gyuyoung Kim. -2012-05-15 Lucas Forschler + After fixed build break on EFL 1.8 at r138326, EFL libraries are changed + Eo typedef and splitted header files which contain version macro. - Merge 116593 + * PlatformEfl.cmake: Added EO path to include directories. + * heap/HeapTimer.h: Changed Ecore_Timer typedef when EO exist. - 2012-05-09 Filip Pizlo +2013-10-23 Filip Pizlo - JIT memory allocator is not returning memory to the OS on Darwin - https://bugs.webkit.org/show_bug.cgi?id=86047 - + Put all uses of LLVM intrinsics behind a single Option + https://bugs.webkit.org/show_bug.cgi?id=123219 - Reviewed by Geoff Garen. + Reviewed by Mark Hahnenberg. - Work around the problem by using a different madvise() flag, but only for the JIT memory - allocator. Also put in ASSERTs that the call is actually working. + * ftl/FTLExitThunkGenerator.cpp: + (JSC::FTL::ExitThunkGenerator::emitThunk): + * ftl/FTLLowerDFGToLLVM.cpp: + (JSC::FTL::generateExitThunks): + (JSC::FTL::LowerDFGToLLVM::compileGetById): + (JSC::FTL::LowerDFGToLLVM::emitOSRExitCall): + (JSC::FTL::LowerDFGToLLVM::addExitArgumentForNode): + * ftl/FTLOSRExitCompiler.cpp: + (JSC::FTL::compileFTLOSRExit): + * runtime/Options.h: - * jit/ExecutableAllocatorFixedVMPool.cpp: - (JSC::FixedVMPoolExecutableAllocator::notifyNeedPage): - (JSC::FixedVMPoolExecutableAllocator::notifyPageIsFree): +2013-10-23 Daniel Bates -2012-05-15 Lucas Forschler + Fix JavaScriptCore build targets following + (https://bugs.webkit.org/show_bug.cgi?id=123169) - Merge 116565 + Tell Xcode that the supported platforms for all JavaScriptCore targets are iOS and OS X. - 2012-05-09 Mark Hahnenberg + * Configurations/Base.xcconfig: - CopiedSpace does not add pinned blocks back to the to-space filter - https://bugs.webkit.org/show_bug.cgi?id=86011 +2013-10-23 Michael Saboff - Reviewed by Geoffrey Garen. + LLInt arity check exception processing should start unwinding from caller + https://bugs.webkit.org/show_bug.cgi?id=123209 - After a collection has finished, we go through the blocks in from-space - and move any of them that are pinned into to-space. At the beginning of - collection, we reset the to-space block filter that is used during - conservative scanning and add back the blocks that are filled during the - collection. However, we neglect to add back those blocks that are moved - from from-space to to-space, which can cause the conservative scan to - think that some pinned items are not actually in CopiedSpace. + Reviewed by Oliver Hunt. - * heap/CopiedSpace.cpp: - (JSC::CopiedSpace::doneCopying): Add the pinned blocks back to the - to-space filter. Also added a comment and assert for future readers that - indicates that it's okay that we don't also add the block to the - to-space block set since it was never removed. + Use the caller frame returned from slow_path_call_arityCheck to process exceptions. -2012-05-15 Lucas Forschler + * llint/LowLevelInterpreter32_64.asm: + * llint/LowLevelInterpreter64.asm: - Merge 116484 +2013-10-22 Filip Pizlo - 2012-05-08 Mark Hahnenberg + FTL should be able to do some simple inline caches using LLVM patchpoints + https://bugs.webkit.org/show_bug.cgi?id=123164 - Heap should not continually allocate new pages in steady state - https://bugs.webkit.org/show_bug.cgi?id=85936 + Reviewed by Mark Hahnenberg. + + This implements GetById inline caches in the FTL using llvm.webkit.patchpoint. + + The idea is that we ask LLVM for a nop slide the size of a GetById inline + cache and then fill in the code after LLVM compilation is complete. For now, we + just use the system calling convention for the arguments and return. We also + still make some assumptions about registers that aren't correct. But, most of + the scaffolding is there and this will successfully patch an inline cache. - Reviewed by Geoff Garen. + * JavaScriptCore.xcodeproj/project.pbxproj: + * assembler/AbstractMacroAssembler.h: + * assembler/LinkBuffer.cpp: + (JSC::LinkBuffer::finalizeCodeWithoutDisassembly): + (JSC::LinkBuffer::linkCode): + (JSC::LinkBuffer::allocate): + * assembler/LinkBuffer.h: + (JSC::LinkBuffer::LinkBuffer): + (JSC::LinkBuffer::link): + * ftl/FTLAbbreviations.h: + (JSC::FTL::constNull): + (JSC::FTL::buildCall): + * ftl/FTLCapabilities.cpp: + (JSC::FTL::canCompile): + * ftl/FTLCompile.cpp: + (JSC::FTL::fixFunctionBasedOnStackMaps): + * ftl/FTLInlineCacheDescriptor.h: Added. + (JSC::FTL::InlineCacheDescriptor::InlineCacheDescriptor): + (JSC::FTL::GetByIdDescriptor::GetByIdDescriptor): + (JSC::FTL::GetByIdDescriptor::stackmapID): + (JSC::FTL::GetByIdDescriptor::codeOrigin): + (JSC::FTL::GetByIdDescriptor::uid): + * ftl/FTLInlineCacheSize.cpp: Added. + (JSC::FTL::sizeOfGetById): + (JSC::FTL::sizeOfPutById): + * ftl/FTLInlineCacheSize.h: Added. + * ftl/FTLIntrinsicRepository.h: + * ftl/FTLJITFinalizer.cpp: + (JSC::FTL::JITFinalizer::finalizeFunction): + * ftl/FTLJITFinalizer.h: + * ftl/FTLLocation.cpp: + (JSC::FTL::Location::directGPR): + * ftl/FTLLocation.h: + * ftl/FTLLowerDFGToLLVM.cpp: + (JSC::FTL::LowerDFGToLLVM::compileGetById): + * ftl/FTLOutput.h: + (JSC::FTL::Output::call): + * ftl/FTLSlowPathCall.cpp: Added. + (JSC::FTL::callOperation): + * ftl/FTLSlowPathCall.h: Added. + (JSC::FTL::SlowPathCall::SlowPathCall): + (JSC::FTL::SlowPathCall::call): + (JSC::FTL::SlowPathCall::key): + * ftl/FTLSlowPathCallKey.cpp: Added. + (JSC::FTL::SlowPathCallKey::dump): + * ftl/FTLSlowPathCallKey.h: Added. + (JSC::FTL::SlowPathCallKey::SlowPathCallKey): + (JSC::FTL::SlowPathCallKey::usedRegisters): + (JSC::FTL::SlowPathCallKey::callTarget): + (JSC::FTL::SlowPathCallKey::offset): + (JSC::FTL::SlowPathCallKey::isEmptyValue): + (JSC::FTL::SlowPathCallKey::isDeletedValue): + (JSC::FTL::SlowPathCallKey::operator==): + (JSC::FTL::SlowPathCallKey::hash): + (JSC::FTL::SlowPathCallKeyHash::hash): + (JSC::FTL::SlowPathCallKeyHash::equal): + * ftl/FTLStackMaps.cpp: + (JSC::FTL::StackMaps::Location::directGPR): + * ftl/FTLStackMaps.h: + * ftl/FTLState.h: + * ftl/FTLThunks.cpp: + (JSC::FTL::slowPathCallThunkGenerator): + * ftl/FTLThunks.h: + (JSC::FTL::Thunks::getSlowPathCallThunk): + * jit/CCallHelpers.h: + (JSC::CCallHelpers::setupArguments): + * jit/GPRInfo.h: + * jit/JITInlineCacheGenerator.cpp: + (JSC::garbageStubInfo): + (JSC::JITInlineCacheGenerator::JITInlineCacheGenerator): + (JSC::JITByIdGenerator::finalize): + * jit/JITInlineCacheGenerator.h: + (JSC::JITByIdGenerator::slowPathBegin): + * jit/RegisterSet.cpp: + (JSC::RegisterSet::stackRegisters): + (JSC::RegisterSet::specialRegisters): + (JSC::RegisterSet::calleeSaveRegisters): + (JSC::RegisterSet::allGPRs): + (JSC::RegisterSet::allFPRs): + (JSC::RegisterSet::allRegisters): + (JSC::RegisterSet::dump): + * jit/RegisterSet.h: + (JSC::RegisterSet::exclude): + (JSC::RegisterSet::numberOfSetRegisters): + (JSC::RegisterSet::RegisterSet): + (JSC::RegisterSet::isEmptyValue): + (JSC::RegisterSet::isDeletedValue): + (JSC::RegisterSet::operator==): + (JSC::RegisterSet::hash): + (JSC::RegisterSetHash::hash): + (JSC::RegisterSetHash::equal): + * runtime/Options.h: - Currently, in steady state (i.e. a constant amount of live GC - memory with a constant rate of allocation) assuming we've just - finished a collection with X live blocks in CopiedSpace, we - increase our working set by X blocks in CopiedSpace with each - collection we perform. This is due to the fact that we allocate - until we run out of free blocks to use in the Heap before we - consider whether we should run a collection. +2013-10-22 Filip Pizlo - In the longer term, this issue will be mostly resolved by - implementing quick release for the CopiedSpace. In the shorter - term, we should change our policy to check whether we should - allocate before trying to use a free block from the Heap. We - can change our policy to something more appropriate once we - have implemented quick release. + jitCompileAndSetHeuristics should DeferGCForAWhile + https://bugs.webkit.org/show_bug.cgi?id=123196 - This change should also have the convenient side effect of - reducing the variance in GC-heavy tests (e.g. v8-splay) due - to fact that we are doing less VM allocation during copying - collection. Overall, this patch is performance neutral across - the benchmarks we track. + Reviewed by Mark Hahnenberg. + + This fixes random crashes in V8v7/raytrace. I only see those crashes on exactly one of + my machines. I don't think this is testable; we just need to steadily converge towards + getting our uses of DeferGC to be right and then be careful not to regress. We're not + there yet, obviously. + + * llint/LLIntSlowPaths.cpp: + (JSC::LLInt::jitCompileAndSetHeuristics): - * heap/CopiedSpace.cpp: - (JSC::CopiedSpace::getFreshBlock): Shuffle the request from the BlockAllocator - around so that we only do it if the block request must succeed - i.e. after we've already checked whether we should do a collection. - * heap/MarkedAllocator.cpp: - (JSC::MarkedAllocator::allocateSlowCase): Ditto. - (JSC::MarkedAllocator::allocateBlock): We no longer have a failure mode in this - function because by the time we've called it, we've already checked whether we - should run a collection so there's no point in returning null. - * heap/MarkedAllocator.h: Removing old arguments from function declaration. - (MarkedAllocator): +2013-10-23 Daniel Bates -2012-05-15 Lucas Forschler + [iOS] Upstream more JavaScriptCore build configuration changes + https://bugs.webkit.org/show_bug.cgi?id=123169 - Merge 116372 + Reviewed by David Kilzer. - 2012-05-07 Oliver Hunt + * Configurations/Base.xcconfig: + * Configurations/Version.xcconfig: + * Configurations/iOS.xcconfig: Added. + * JavaScriptCore.xcodeproj/project.pbxproj: - Rolling out r110287 +2013-10-23 Daniel Bates - RS=Filip Pizlo + [iOS] Export DefaultGCActivityCallback member functions + https://bugs.webkit.org/show_bug.cgi?id=123175 - r110287 was meant to be refactoring only, but changed behavior - enough to break some websites, including qq.com. + Reviewed by David Kilzer. -2012-05-15 Lucas Forschler + * runtime/GCActivityCallback.h: - Merge 116363 +2013-10-23 Daniel Bates - 2012-05-07 Oliver Hunt + [iOS] Upstream more ARMv7s bits + https://bugs.webkit.org/show_bug.cgi?id=123052 - Fix release build. + Reviewed by Joseph Pecoraro. - * llint/LLIntSlowPaths.cpp: - (JSC::LLInt::LLINT_SLOW_PATH_DECL): + * Configurations/JavaScriptCore.xcconfig: -2012-05-15 Lucas Forschler +2013-10-22 Andreas Kling - Merge 116361 + Minor VM* -> VM& cleanups in HashTable and Keywords. + - 2012-05-07 Oliver Hunt + Turn some VM* variables that will never be null into VM&. - LLInt doesn't check for Ropes when performing a character switch - https://bugs.webkit.org/show_bug.cgi?id=85837 + Reviewed by Geoffrey Garen. - Reviewed by Filip Pizlo. +2013-10-22 Geoffrey Garen - Make LLint check if the scrutinee of a char switch is a rope, and if - so fall back to a slow case. + REGRESSION: `if (false === (true && undefined)) console.log("wrong!");` logs "wrong!", shouldn't! + https://bugs.webkit.org/show_bug.cgi?id=123179 - * llint/LLIntSlowPaths.cpp: - (JSC::LLInt::LLINT_SLOW_PATH_DECL): - (LLInt): - * llint/LowLevelInterpreter32_64.asm: - * llint/LowLevelInterpreter64.asm: + Reviewed by Mark Hahnenberg. -2012-05-15 Lucas Forschler + * parser/NodeConstructors.h: + (JSC::LogicalOpNode::LogicalOpNode): + * parser/ResultType.h: + (JSC::ResultType::forLogicalOp): Don't assume that && produces a boolean. + This is JavaScript (aka Sparta). - Merge 116367 +2013-10-22 Commit Queue - 2012-05-07 Andy Estes + Unreviewed, rolling out r157819. + http://trac.webkit.org/changeset/157819 + https://bugs.webkit.org/show_bug.cgi?id=123180 - ENABLE_IFRAME_SEAMLESS should be part of FEATURE_DEFINES. + Broke 32-bit builds (Requested by smfr on #webkit). - * Configurations/FeatureDefines.xcconfig: + * Configurations/JavaScriptCore.xcconfig: + * Configurations/ToolExecutable.xcconfig: -2012-05-15 Lucas Forschler +2013-10-22 Daniel Bates - Merge 116356 + [iOS] Upstream more ARMv7s bits + https://bugs.webkit.org/show_bug.cgi?id=123052 - 2012-05-07 Eric Seidel + Reviewed by Joseph Pecoraro. - Add ENABLE_IFRAME_SEAMLESS so Apple can turn off SEAMLESS if needed - https://bugs.webkit.org/show_bug.cgi?id=85822 + * Configurations/JavaScriptCore.xcconfig: + * Configurations/ToolExecutable.xcconfig: Enable CLANG_ENABLE_OBJC_ARC for i386 as I'm + modifying a file in JavaScriptCore/Configurations. - Reviewed by Adam Barth. +2013-10-22 Daniel Bates - * Configurations/FeatureDefines.xcconfig: + [iOS] Upstream JSLock changes + https://bugs.webkit.org/show_bug.cgi?id=123107 -2012-05-04 Filip Pizlo + Reviewed by Geoffrey Garen. - DFG should not Flush GetLocal's - https://bugs.webkit.org/show_bug.cgi?id=85663 - + * runtime/JSLock.cpp: + (JSC::JSLock::unlock): + (JSC::JSLock::dropAllLocks): Modified to take a SpinLock, used only on iOS. + (JSC::JSLock::dropAllLocksUnconditionally): Modified to take a SpinLock, used only on iOS. Also + use pre-increment instead of post-increment when we're not using the return value of the instruction. + (JSC::JSLock::grabAllLocks): Modified to take a SpinLock, used only on iOS. Also change + places where we were using post-increment/post-decrement to use pre-increment/pre-decrement, + since we don't use the return value of such instructions. + (JSC::JSLock::DropAllLocks::DropAllLocks): Modified to support releasing all locks unconditionally. + Take a spin lock before releasing all locks on iOS. Also, use nullptr instead of 0. + (JSC::JSLock::DropAllLocks::~DropAllLocks): Take a spin lock before acquiring all locks on iOS. + * runtime/JSLock.h: Remove extraneous argument name "exec" from DropAllLocks as the data type of + the argument is sufficiently descriptive of its purpose. + +2013-10-22 Julien Brianceau + + [arm] Add missing setupArgumentsWithExecState() prototypes to fix build. + https://bugs.webkit.org/show_bug.cgi?id=123166 - Reviewed by Oliver Hunt. + Reviewed by Michael Saboff. - * dfg/DFGByteCodeParser.cpp: - (JSC::DFG::ByteCodeParser::flushArgument): - (JSC::DFG::ByteCodeParser::handleCall): + * jit/CCallHelpers.h: + (JSC::CCallHelpers::setupArgumentsWithExecState): -2012-05-04 Allan Sandfeld Jensen +2013-10-22 Julien Brianceau - Doesn't build with ENABLE_JIT=0 - https://bugs.webkit.org/show_bug.cgi?id=85042 + [sh4][mips][arm] Fix crashes in JSC (32-bit only). + https://bugs.webkit.org/show_bug.cgi?id=123165 - Reviewed by Gavin Barraclough. + Reviewed by Michael Saboff. - * bytecode/Operands.h: + * jit/JITInlines.h: + (JSC::JIT::callOperationNoExceptionCheck): Add missing EABI_32BIT_DUMMY_ARG. + (JSC::JIT::callOperation): The last TrustedImm32(arg3) is a bit overkill for SH4 :) + (JSC::JIT::callOperation): Add missing EABI_32BIT_DUMMY_ARG. + (JSC::JIT::callOperation): Fix tag and payload order for V_JITOperation_EJJJ prototype. -2012-05-03 Oliver Hunt +2013-10-22 Julien Brianceau - Regression(r114702): Clobbering the caller frame register before we've stored it. - https://bugs.webkit.org/show_bug.cgi?id=85564 + REGRESSION(r157690, r157699) Fix architectures using AssemblerBufferWithConstantPool. + https://bugs.webkit.org/show_bug.cgi?id=123092 - Reviewed by Filip Pizlo. + Reviewed by Michael Saboff. - Don't use t0 as a temporary, when we're about to use the value in t0. + Impacted architectures are SH4 and ARM_TRADITIONAL. - * llint/LowLevelInterpreter32_64.asm: + * assembler/ARMAssembler.h: + (JSC::ARMAssembler::buffer): + * assembler/AssemblerBufferWithConstantPool.h: + (JSC::AssemblerBufferWithConstantPool::flushConstantPool): + * assembler/LinkBuffer.cpp: + (JSC::LinkBuffer::linkCode): + * assembler/SH4Assembler.h: + (JSC::SH4Assembler::buffer): -2012-05-03 Mark Hahnenberg +2013-10-22 Julien Brianceau - Removing remainder of accidental printfs. + Remove unused stuff in JIT stubs. + https://bugs.webkit.org/show_bug.cgi?id=123155 - * heap/Heap.cpp: - (JSC::Heap::collect): + Reviewed by Michael Saboff. -2012-05-03 Andy Estes + * jit/JITStubs.h: + * jit/JITStubsARM.h: + (JSC::ctiTrampoline): + * jit/JITStubsARM64.h: + * jit/JITStubsARMv7.h: + * jit/JITStubsMIPS.h: + * jit/JITStubsSH4.h: + * jit/JITStubsX86.h: + * jit/JITStubsX86_64.h: - If you add printf()s to your garbage collector, the layout tests are gonna have a bad time. +2013-10-22 Daniel Bates - * runtime/GCActivityCallbackCF.cpp: - (JSC::DefaultGCActivityCallbackPlatformData::timerDidFire): + [iOS] Upstream OS-version-specific install paths for JavaScriptCore.framework + https://bugs.webkit.org/show_bug.cgi?id=123115 + -2012-05-03 Mark Hahnenberg + Reviewed by Andy Estes. - Heap::reportAbandonedObjectGraph should not hasten an allocation-triggered collection - https://bugs.webkit.org/show_bug.cgi?id=85543 + Based on a patch by Mark Hahnenberg. - Reviewed by Filip Pizlo. + Add support for running JavaScriptCore-based apps, built against the iOS 7 SDK, on older versions of iOS. - Currently reportAbandonedObjectGraph causes the Heap to think it is closer to its - allocation limit for the current cycle, thus hastening an allocation-triggered collection. - In reality, it should just affect the opportunistic GC timer. We should track the bytes - we think have been abandoned and the bytes that have been allocated separately. - - * heap/Heap.cpp: Added a new field m_abandonedBytes to Heap to keep track of how much - we think we've abandoned. - (JSC::Heap::Heap): - (JSC::Heap::reportAbandonedObjectGraph): - (JSC): - (JSC::Heap::didAbandon): Added this function for reportAbandonedObjectGraph to call - rather than didAllocate. Works the same as didAllocate, but modifies bytes abandoned rather - than bytes allocated. Also notifies the timer, summing the two values together. - (JSC::Heap::collect): - (JSC::Heap::didAllocate): Now adds the bytes allocated and bytes abandoned when reporting - to GCActivityCallback. - * heap/Heap.h: - (Heap): + * API/JSBase.cpp: -2012-05-02 Eric Seidel +2013-10-22 Julien Brianceau - Sort ENABLE_ defines in FeatureDefines.xcconfig files to make them easier to compare with one another (and easier to autogenerate) - https://bugs.webkit.org/show_bug.cgi?id=85433 + [sh4] Add missing lastRegister(), firstFPRegister() and lastFPRegister(). + https://bugs.webkit.org/show_bug.cgi?id=123157 - Reviewed by Adam Barth. + Reviewed by Andreas Kling. - I have a script which can autogenerate these xcconfig files as well as the - vsprops files (and soon the Chromium, cmake, gnumake and qmake) feature lists - from a central feature list file. - In preparation for posting such a tool, I'm re-sorting these xcconfig files to be - alphabetically ordered (currently they're close, but not quite). - There is also at least one inconsistency between these files (CSS_LEGACY_PREFIXES) which - I will fix in a second pass. I will also sort the FEATURE_DEFINES = line in a follow-up patch. + * assembler/SH4Assembler.h: + (JSC::SH4Assembler::lastRegister): + (JSC::SH4Assembler::firstFPRegister): + (JSC::SH4Assembler::lastFPRegister): - * Configurations/FeatureDefines.xcconfig: +2013-10-22 Brian Holt -2012-05-02 Hojong Han + Build break on ARMv7 after r157209 + https://bugs.webkit.org/show_bug.cgi?id=122890 - ARM_TRADITIONAL build fix - https://bugs.webkit.org/show_bug.cgi?id=85358 + Reviewed by Csaba Osztrogonác. - Reviewed by Gavin Barraclough. + Add framePointerRegister and first/last register helpers for ARM_TRADITIONAL. + * assembler/ARMAssembler.h: * assembler/MacroAssemblerARM.h: - (JSC::MacroAssemblerARM::lshift32): - (MacroAssemblerARM): - (JSC::MacroAssemblerARM::or32): - (JSC::MacroAssemblerARM::urshift32): - (JSC::MacroAssemblerARM::xor32): - (JSC::MacroAssemblerARM::branchSub32): - -2012-05-02 Mark Hahnenberg - - Opportunistic GC should give up if the Heap is paged out - https://bugs.webkit.org/show_bug.cgi?id=85411 + (JSC::MacroAssemblerARM::firstRegister): + (JSC::MacroAssemblerARM::lastRegister): + (JSC::MacroAssemblerARM::firstFPRegister): + (JSC::MacroAssemblerARM::lastFPRegister): - Reviewed by Filip Pizlo. +2013-10-21 Daniel Bates - Opportunistic GC is punishing us severely in limited memory situations because its - assumptions about how much time a collection will take are way out of whack when the Heap - has been paged out by the OS. We should add a simple detection function to the Heap that - detects if its is paged out. It will do this by iterating each block of both the MarkedSpace - and CopiedSpace. If that operation takes longer than a fixed amount of time (e.g. 100ms), - the function returns true. This function will only be run prior to an opportunistic - collection (i.e. it will not run during our normal allocation-triggered collections). - - In my tests, steady state was drastically improved in high memory pressure situations (i.e. - the browser was still usable, significant reduction in SPODs). Occasionally, a normal GC - would be triggered due to pages doing things in the background, which would cause a - significant pause. As we close pages we now cause normal collections rather than full - collections, which prevents us from collecting all of the dead memory immediately. One - nice way to deal with this issue might be to do incremental sweeping. - - - * heap/CopiedSpace.cpp: - (JSC::isBlockListPagedOut): Helper function to reduce code duplication when iterating over - to-space, from-space, and the oversize blocks. - (JSC): - (JSC::CopiedSpace::isPagedOut): Tries to determine whether or not CopiedSpace is paged out - by iterating all of the blocks. - * heap/CopiedSpace.h: - (CopiedSpace): - * heap/Heap.cpp: - (JSC::Heap::isPagedOut): Tries to determine whether the Heap is paged out by asking the - MarkedSpace and CopiedSpace if they are paged out. - (JSC): - * heap/Heap.h: - (Heap): - (JSC::Heap::increaseLastGCLength): Added this so that the GC timer can linearly back off - each time it determines that the Heap is paged out. - * heap/MarkedAllocator.cpp: - (JSC::MarkedAllocator::isPagedOut): Tries to determine if this particular MarkedAllocator's - list of blocks are paged out. - (JSC): - * heap/MarkedAllocator.h: - (MarkedAllocator): - * heap/MarkedSpace.cpp: - (JSC::MarkedSpace::isPagedOut): For each MarkedAllocator, check to see if they're paged out. - * heap/MarkedSpace.h: - (MarkedSpace): - * runtime/GCActivityCallback.cpp: - (JSC::DefaultGCActivityCallback::cancel): - (JSC): - * runtime/GCActivityCallback.h: - (JSC::GCActivityCallback::cancel): - (DefaultGCActivityCallback): - * runtime/GCActivityCallbackCF.cpp: Added a constant of 100ms for the timeout in determining - whether the Heap is paged out or not. - (JSC): - (JSC::DefaultGCActivityCallbackPlatformData::timerDidFire): Added the check to see if we - should attempt a collection based on whether or not we can iterate the blocks of the Heap in - 100ms. If we can't, we cancel the timer and tell the Heap we just wasted 100ms more trying to - do a collection. This gives us a nice linear backoff so we're not constantly re-trying in - steady state paged-out-ness. - (JSC::DefaultGCActivityCallback::cancel): Added this function which, while currently doing - exactly the same thing as willCollect, is more obvious as to what it's doing when we call it - in timerDidFire. - -2012-05-02 Yong Li - - Fix GCC X86 build error - https://bugs.webkit.org/show_bug.cgi?id=85379 - - Reviewed by Rob Buis. - - Always explicitly claim ".text" to make sure - functions defined with inline assembly will be - created in the correct section. + [iOS] Upstream JSGlobalObject::shouldInterruptScriptBeforeTimeout() + https://bugs.webkit.org/show_bug.cgi?id=123045 - * dfg/DFGOperations.cpp: - (JSC): + Reviewed by Joseph Pecoraro. -2012-05-02 Oliver Hunt + * jsc.cpp: Add function pointer for shouldInterruptScriptBeforeTimeout + to global method table. + * runtime/JSGlobalObject.cpp: Ditto. + * runtime/JSGlobalObject.h: + (JSC::JSGlobalObject::shouldInterruptScriptBeforeTimeout): Added. - Unreviewed, rolling out r115388. - http://trac.webkit.org/changeset/115388 - https://bugs.webkit.org/show_bug.cgi?id=85011 +2013-10-21 Daniel Bates - This caused many weird performance problems, and needs to be - landed in pieces. + [iOS] Upstream JSC Objective-C API compiler warning fixes + https://bugs.webkit.org/show_bug.cgi?id=123125 - * dfg/DFGOperations.cpp: - * heap/Heap.cpp: - (JSC::Heap::getConservativeRegisterRoots): - (JSC::Heap::markRoots): - * interpreter/CallFrame.cpp: - (JSC::CallFrame::dumpCaller): - (JSC): - * interpreter/CallFrame.h: - (JSC::ExecState::init): - (ExecState): - * interpreter/Interpreter.cpp: - (JSC::Interpreter::execute): - (JSC::Interpreter::executeCall): - (JSC::Interpreter::executeConstruct): - (JSC::Interpreter::prepareForRepeatCall): - (JSC::Interpreter::privateExecute): - * interpreter/Interpreter.h: - (JSC::Interpreter::execute): - * interpreter/RegisterFile.cpp: - (JSC::RegisterFile::growSlowCase): - (JSC::RegisterFile::gatherConservativeRoots): - * interpreter/RegisterFile.h: - (JSC::RegisterFile::end): - (JSC::RegisterFile::size): - (JSC::RegisterFile::addressOfEnd): - (RegisterFile): - (JSC::RegisterFile::RegisterFile): - (JSC::RegisterFile::shrink): - (JSC::RegisterFile::grow): - * jit/JITStubs.cpp: - (JSC::DEFINE_STUB_FUNCTION): - (JSC::jitCompileFor): - (JSC::lazyLinkFor): - * llint/LLIntSlowPaths.cpp: - (JSC::LLInt::LLINT_SLOW_PATH_DECL): - (JSC::LLInt::handleHostCall): - * llint/LowLevelInterpreter.asm: - * runtime/CommonSlowPaths.h: - (JSC::CommonSlowPaths::arityCheckFor): + Reviewed by Mark Hahnenberg. -2012-05-01 Oliver Hunt + Based on a patch by Mark Hahnenberg. - Physijs demo crashes due to DFG not updating topCallFrame correctly. - https://bugs.webkit.org/show_bug.cgi?id=85311 + * API/JSValue.mm: + (-[JSValue toPoint]): Cast to CGFloat to fix some compiler warnings about double narrowing to float. + (-[JSValue toSize]): Ditto. + * API/tests/testapi.mm: Changed a test that was failing due to overflow of 32-bit NSUInteger on armv7. - Reviewed by Filip Pizlo. +2013-10-21 Daniel Bates - A few of the dfg operations failed to correctly set the topCallFrame, - and so everything goes wrong. This patch corrects the effected operations, - and makes debug builds poison topCallFrame before calling a dfg operation. + [iOS] Mark classes JS{Context, ManagedValue, Value, VirtualMachine} as + available since iOS 7.0 + https://bugs.webkit.org/show_bug.cgi?id=123122 - * dfg/DFGOperations.cpp: - (JSC::DFG::putByVal): - * dfg/DFGSpeculativeJIT.h: - (JSC::DFG::SpeculativeJIT::callOperation): - (SpeculativeJIT): - (JSC::DFG::SpeculativeJIT::prepareForExternalCall): - (JSC::DFG::SpeculativeJIT::appendCallWithExceptionCheck): - (JSC::DFG::SpeculativeJIT::appendCallSetResult): + Reviewed by Dan Bernstein. -2012-04-30 Gavin Barraclough + * API/JSContext.h: + * API/JSManagedValue.h: + * API/JSValue.h: + * API/JSVirtualMachine.h: - Should be able to use YARR JIT without the JS language JIT - https://bugs.webkit.org/show_bug.cgi?id=85252 +2013-10-20 Mark Lam - Reviewed by Geoff Garen. + Avoid JSC debugger overhead unless needed. + https://bugs.webkit.org/show_bug.cgi?id=123084. - Need to split canUseRegExpJIT out of canUseJIT. + Reviewed by Geoffrey Garen. - * runtime/JSGlobalData.cpp: - (JSC): - (JSC::useJIT): - (JSC::JSGlobalData::JSGlobalData): - - replace m_canUseJIT with m_canUseAssembler - * runtime/JSGlobalData.h: - (JSGlobalData): - (JSC::JSGlobalData::canUseRegExpJIT): - - Added canUseRegExpJIT, distinct from canUseJIT. - * runtime/RegExp.cpp: - (JSC::RegExp::compile): - (JSC::RegExp::compileMatchOnly): - - Call canUseRegExpJIT instead of canUseJIT. + - If no breakpoints are set, we now avoid calling the debug hook callbacks. + - If no break on exception is set, we also avoid exception event debug callbacks. + - When we return from the ScriptDebugServer to the JSC::Debugger, we may no + longer call the debug hook callbacks if not needed. Hence, the m_currentCallFrame + pointer in the ScriptDebugServer may become stale. To avoid this issue, before + returning, the ScriptDebugServer will clear its m_currentCallFrame if + needsOpDebugCallbacks() is false. -2012-04-30 Gavin Barraclough + * debugger/Debugger.cpp: + (JSC::Debugger::Debugger): + (JSC::Debugger::setNeedsExceptionCallbacks): + (JSC::Debugger::setShouldPause): + (JSC::Debugger::updateNumberOfBreakpoints): + (JSC::Debugger::updateNeedForOpDebugCallbacks): + * debugger/Debugger.h: + * interpreter/Interpreter.cpp: + (JSC::Interpreter::unwind): + (JSC::Interpreter::debug): + * jit/JITOpcodes.cpp: + (JSC::JIT::emit_op_debug): + * jit/JITOpcodes32_64.cpp: + (JSC::JIT::emit_op_debug): + * llint/LLIntOffsetsExtractor.cpp: + * llint/LowLevelInterpreter.asm: - Should be able to build YARR JIT without the JS language JIT - https://bugs.webkit.org/show_bug.cgi?id=85242 +2013-10-21 Brent Fulgham - Reviewed by Michael Saboff. + [WIN] Unreviewed build correction. - Some build macros are wrong. + * JavaScriptCore.vcxproj/JavaScriptCore.vcxproj: Handle new JIT files as C++ implementation + sources, not header files. + * JavaScriptCore.vcxproj/JavaScriptCore.vcxproj.filters: Ditto. - * assembler/RepatchBuffer.h: - * jit/ExecutableAllocator.h: - (JSC): - * jit/JITExceptions.cpp: - * runtime/InitializeThreading.cpp: - (JSC::initializeThreadingOnce): +2013-10-21 Oliver Hunt -2012-04-26 Gavin Barraclough + Support computed property names in object literals + https://bugs.webkit.org/show_bug.cgi?id=123112 - Arguments object resets attributes on redefinition of a parameter - https://bugs.webkit.org/show_bug.cgi?id=84994 + Reviewed by Michael Saboff. - Rubber stamped by Oliver Hunt. + Add support for computed property names to the parser. - There is a bug that we always re-add the original property before - redefinition, doing so in a way that will reset the attributes - without checking configurability. + * bytecompiler/NodesCodegen.cpp: + (JSC::PropertyListNode::emitBytecode): + * parser/ASTBuilder.h: + (JSC::ASTBuilder::createProperty): + (JSC::ASTBuilder::getName): + * parser/NodeConstructors.h: + (JSC::PropertyNode::PropertyNode): + * parser/Nodes.h: + (JSC::PropertyNode::expressionName): + (JSC::PropertyNode::name): + * parser/Parser.cpp: + (JSC::::parseProperty): + (JSC::::parseStrictObjectLiteral): + * parser/SyntaxChecker.h: + (JSC::SyntaxChecker::Property::Property): + (JSC::SyntaxChecker::createProperty): + (JSC::SyntaxChecker::operatorStackPop): - * runtime/Arguments.cpp: - (JSC::Arguments::defineOwnProperty): - - Only instantiate the property once - do not re-add if - it has already been added, or if it has been deleted. +2013-10-21 Michael Saboff -2012-04-30 Ryosuke Niwa + Add option so that JSC will crash if it can't allocate executable memory for the JITs + https://bugs.webkit.org/show_bug.cgi?id=123048 + - Remove an erroneous assertion after r115655. + Reviewed by Geoffrey Garen. - * runtime/NumberPrototype.cpp: - (JSC::toUStringWithRadix): + Added new option, called crashIfCantAllocateJITMemory. If this option is true then we crash + when checking the validity of the executable allocator. The default value for this option is + false, but jsc sets it to true when built for iOS to make it straightforward to identify whether + the app can obtain executable memory. -2012-04-30 Myles Maxfield + * jsc.cpp: Explicitly enable crashIfCantAllocateJITMemory on iOS. + (main): + * runtime/Options.h: Added option crashIfCantAllocateJITMemory. + * runtime/VM.cpp: + (JSC::enableAssembler): Modified to crash if option crashIfCantAllocateJITMemory + is enabled. - End of Interpreter::tryCacheGetByID can trigger the garbage collector - https://bugs.webkit.org/show_bug.cgi?id=84927 +2013-10-21 Nadav Rotem - Reviewed by Oliver Hunt. + Remove AllInOneFile.cpp + https://bugs.webkit.org/show_bug.cgi?id=123055 - * interpreter/Interpreter.cpp: - (JSC::Interpreter::tryCacheGetByID): + Reviewed by Csaba Osztrogonác. -2012-04-30 Benjamin Poulain + * AllInOneFile.cpp: Removed. - jsSingleCharacterString and jsSingleCharacterSubstring are not inlined - https://bugs.webkit.org/show_bug.cgi?id=85147 +2013-10-20 Filip Pizlo - Reviewed by Darin Adler. + Unreviewed, cleanup a FIXME comment. - The functions jsSingleCharacterString() and jsSingleCharacterSubstring() were not inlined - by the compiler. This annihilate the gains of using SmallStrings. + * jit/Repatch.cpp: - On stringProtoFuncCharAt(), this patch improves the performance by 11%. +2013-10-20 Filip Pizlo - * runtime/JSString.h: - (JSC::jsSingleCharacterString): - (JSC::jsSingleCharacterSubstring): + StructureStubInfo's usedRegisters set should be able to track all registers, not just the ones that our JIT's view as temporaries + https://bugs.webkit.org/show_bug.cgi?id=123076 -2012-04-30 Benjamin Poulain + Reviewed by Sam Weinig. + + Start preparing for a world in which we are patching code generated by LLVM, which may have + very different register usage conventions than our JITs. This requires us being more explicit + about the registers we are using. For example, the repatching code shouldn't take for granted + that tagMaskRegister holds the TagMask or that the register is even in use. - Add fast patch for radix == 10 on numberProtoFuncToString - https://bugs.webkit.org/show_bug.cgi?id=85120 + * CMakeLists.txt: + * GNUmakefile.list.am: + * JavaScriptCore.vcxproj/JavaScriptCore.vcxproj: + * JavaScriptCore.xcodeproj/project.pbxproj: + * assembler/MacroAssembler.h: + (JSC::MacroAssembler::numberOfRegisters): + (JSC::MacroAssembler::registerIndex): + (JSC::MacroAssembler::numberOfFPRegisters): + (JSC::MacroAssembler::fpRegisterIndex): + (JSC::MacroAssembler::totalNumberOfRegisters): + * bytecode/StructureStubInfo.h: + * dfg/DFGSpeculativeJIT.cpp: + (JSC::DFG::SpeculativeJIT::usedRegisters): + * dfg/DFGSpeculativeJIT.h: + * ftl/FTLSaveRestore.cpp: + (JSC::FTL::bytesForGPRs): + (JSC::FTL::bytesForFPRs): + (JSC::FTL::offsetOfGPR): + (JSC::FTL::offsetOfFPR): + * jit/JITInlineCacheGenerator.cpp: + (JSC::JITByIdGenerator::JITByIdGenerator): + (JSC::JITPutByIdGenerator::JITPutByIdGenerator): + * jit/JITInlineCacheGenerator.h: + (JSC::JITGetByIdGenerator::JITGetByIdGenerator): + * jit/JITPropertyAccess.cpp: + (JSC::JIT::emit_op_get_by_id): + (JSC::JIT::emit_op_put_by_id): + * jit/JITPropertyAccess32_64.cpp: + (JSC::JIT::emit_op_get_by_id): + (JSC::JIT::emit_op_put_by_id): + * jit/RegisterSet.cpp: Added. + (JSC::RegisterSet::specialRegisters): + * jit/RegisterSet.h: Added. + (JSC::RegisterSet::RegisterSet): + (JSC::RegisterSet::set): + (JSC::RegisterSet::clear): + (JSC::RegisterSet::get): + (JSC::RegisterSet::merge): + * jit/Repatch.cpp: + (JSC::generateProtoChainAccessStub): + (JSC::tryCacheGetByID): + (JSC::tryBuildGetByIDList): + (JSC::emitPutReplaceStub): + (JSC::tryRepatchIn): + (JSC::linkClosureCall): + * jit/TempRegisterSet.cpp: Added. + (JSC::TempRegisterSet::TempRegisterSet): + * jit/TempRegisterSet.h: + +2013-10-20 Julien Brianceau + + [sh4] Fix build (broken since r157690). + https://bugs.webkit.org/show_bug.cgi?id=123081 - Reviewed by Darin Adler. + Reviewed by Andreas Kling. - When radix, we use to turn the doubleValue into a JSValue just to convert - it to a String. The problem is that was using the slow path for conversion and - for the toString() operation. + * assembler/AssemblerBufferWithConstantPool.h: + * assembler/SH4Assembler.h: + (JSC::SH4Assembler::buffer): + (JSC::SH4Assembler::readCallTarget): - This patch shortcuts the creation of a JSValue and uses NumericStrings directly. - The conversion is split between Integer and Double to ensure the fastest conversion - for the common case of integer arguments. +2013-10-19 Filip Pizlo - Converting number with radix 10 becomes 5% faster. + Simplify TempRegisterSet - it no longer needs to be convertible to a POD since it's no longer going to be a member of a union + https://bugs.webkit.org/show_bug.cgi?id=123079 - Due to the simpler conversion of number to string for integer, converting - integers that do not fall in the two previous optimizations get 32% faster. + Reviewed by Geoffrey Garen. - * runtime/NumberPrototype.cpp: - (JSC::extractRadixFromArgs): - (JSC::integerValueToString): - (JSC::numberProtoFuncToString): + * jit/TempRegisterSet.h: -2012-04-30 Carlos Garcia Campos +2013-10-19 Filip Pizlo - Unreviewed. Fix make distcheck. + Rename RegisterSet to TempRegisterSet + https://bugs.webkit.org/show_bug.cgi?id=123077 - * GNUmakefile.list.am: Add missing header. + Reviewed by Dan Bernstein. -2012-04-28 Geoffrey Garen + * JavaScriptCore.vcxproj/JavaScriptCore.vcxproj: + * JavaScriptCore.xcodeproj/project.pbxproj: + * bytecode/StructureStubInfo.h: + * dfg/DFGJITCompiler.h: + * dfg/DFGSpeculativeJIT.h: + (JSC::DFG::SpeculativeJIT::usedRegisters): + * jit/JITInlineCacheGenerator.cpp: + (JSC::JITByIdGenerator::JITByIdGenerator): + (JSC::JITPutByIdGenerator::JITPutByIdGenerator): + * jit/JITInlineCacheGenerator.h: + (JSC::JITGetByIdGenerator::JITGetByIdGenerator): + * jit/JITPropertyAccess.cpp: + (JSC::JIT::emit_op_get_by_id): + (JSC::JIT::emit_op_put_by_id): + * jit/JITPropertyAccess32_64.cpp: + (JSC::JIT::emit_op_get_by_id): + (JSC::JIT::emit_op_put_by_id): + * jit/RegisterSet.h: Removed. + * jit/ScratchRegisterAllocator.h: + (JSC::ScratchRegisterAllocator::ScratchRegisterAllocator): + * jit/TempRegisterSet.h: Copied from Source/JavaScriptCore/jit/RegisterSet.h. + (JSC::TempRegisterSet::TempRegisterSet): + (JSC::TempRegisterSet::asPOD): + (JSC::TempRegisterSet::copyInfo): - Factored threaded block allocation into a separate object - https://bugs.webkit.org/show_bug.cgi?id=85148 +2013-10-19 Filip Pizlo - Reviewed by Sam Weinig. + Restructure LinkBuffer to allow for alternate allocation strategies + https://bugs.webkit.org/show_bug.cgi?id=123071 - 99% of this patch just moves duplicated block allocation and - deallocation code into a new object named BlockAllocator, with these - exceptions: + Reviewed by Oliver Hunt. + + The idea is to eventually allow a LinkBuffer to place the code into an already + allocated region of memory. That region of memory could be the nop-slide left behind + by a llvm.webkit.patchpoint. - * heap/BlockAllocator.h: Added. - (BlockAllocator::BlockAllocator): The order of declarations here now - guards us against an unlikely race condition during startup. + * assembler/ARM64Assembler.h: + (JSC::ARM64Assembler::buffer): + * assembler/AssemblerBuffer.h: + * assembler/LinkBuffer.cpp: + (JSC::LinkBuffer::copyCompactAndLinkCode): + (JSC::LinkBuffer::linkCode): + (JSC::LinkBuffer::allocate): + (JSC::LinkBuffer::shrink): + * assembler/LinkBuffer.h: + (JSC::LinkBuffer::LinkBuffer): + (JSC::LinkBuffer::didFailToAllocate): + * assembler/X86Assembler.h: + (JSC::X86Assembler::buffer): + (JSC::X86Assembler::X86InstructionFormatter::memoryModRM): - * heap/BlockAllocator.cpp: - JSC::BlockAllocator::blockFreeingThreadMain): Added a FIXME to - highlight a lack of clarity we have in our block deallocation routines. +2013-10-19 Alexey Proskuryakov -2012-04-28 Sam Weinig + Some includes in JSC seem to use an incorrect style + https://bugs.webkit.org/show_bug.cgi?id=123057 - Try to fix the Qt build. + Reviewed by Geoffrey Garen. - * heap/Heap.cpp: - (JSC::Heap::lastChanceToFinalize): + Changed pseudo-system includes to user ones. -2012-04-28 Geoffrey Garen + * API/JSContextRef.cpp: + * API/JSStringRefCF.cpp: + * API/JSValueRef.cpp: + * API/OpaqueJSString.cpp: + * jit/JIT.h: + * parser/SyntaxChecker.h: + * runtime/WeakGCMap.h: - Try to fix the Windows build. +2013-10-19 Filip Pizlo - * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def: + Baseline JIT and DFG IC code generation should be unified and rationalized + https://bugs.webkit.org/show_bug.cgi?id=122939 -2012-04-28 Geoffrey Garen + Reviewed by Geoffrey Garen. + + Introduce the JITInlineCacheGenerator, which takes a CodeBlock and a CodeOrigin plus + some register info and creates JIT inline caches for you. Used this to even furhter + unify the baseline and DFG ICs. In the future we can use this for FTL ICs. And my hope + is that we'll be able to use it for cascading ICs: an IC for some instruction may realize + that it needs to do the equivalent of get_by_id, so with this generator it will be able + to create an IC even though it wasn't associated with a get_by_id bytecode instruction. - Clarified JSGlobalData (JavaScript VM) lifetime - https://bugs.webkit.org/show_bug.cgi?id=85142 + * CMakeLists.txt: + * GNUmakefile.list.am: + * JavaScriptCore.vcxproj/JavaScriptCore.vcxproj: + * JavaScriptCore.xcodeproj/project.pbxproj: + * assembler/AbstractMacroAssembler.h: + (JSC::AbstractMacroAssembler::DataLabelCompact::label): + * bytecode/CodeBlock.h: + (JSC::CodeBlock::ecmaMode): + * dfg/DFGInlineCacheWrapper.h: Added. + (JSC::DFG::InlineCacheWrapper::InlineCacheWrapper): + * dfg/DFGInlineCacheWrapperInlines.h: Added. + (JSC::DFG::::finalize): + * dfg/DFGJITCompiler.cpp: + (JSC::DFG::JITCompiler::link): + * dfg/DFGJITCompiler.h: + (JSC::DFG::JITCompiler::addGetById): + (JSC::DFG::JITCompiler::addPutById): + * dfg/DFGSpeculativeJIT32_64.cpp: + (JSC::DFG::SpeculativeJIT::cachedGetById): + (JSC::DFG::SpeculativeJIT::cachedPutById): + * dfg/DFGSpeculativeJIT64.cpp: + (JSC::DFG::SpeculativeJIT::cachedGetById): + (JSC::DFG::SpeculativeJIT::cachedPutById): + (JSC::DFG::SpeculativeJIT::compile): + * jit/AssemblyHelpers.h: + (JSC::AssemblyHelpers::isStrictModeFor): + (JSC::AssemblyHelpers::strictModeFor): + * jit/GPRInfo.h: + (JSC::JSValueRegs::tagGPR): + * jit/JIT.cpp: + (JSC::JIT::JIT): + (JSC::JIT::privateCompileSlowCases): + (JSC::JIT::privateCompile): + * jit/JIT.h: + * jit/JITInlineCacheGenerator.cpp: Added. + (JSC::JITInlineCacheGenerator::JITInlineCacheGenerator): + (JSC::JITByIdGenerator::JITByIdGenerator): + (JSC::JITByIdGenerator::finalize): + (JSC::JITByIdGenerator::generateFastPathChecks): + (JSC::JITGetByIdGenerator::generateFastPath): + (JSC::JITPutByIdGenerator::JITPutByIdGenerator): + (JSC::JITPutByIdGenerator::generateFastPath): + (JSC::JITPutByIdGenerator::slowPathFunction): + * jit/JITInlineCacheGenerator.h: Added. + (JSC::JITInlineCacheGenerator::JITInlineCacheGenerator): + (JSC::JITInlineCacheGenerator::stubInfo): + (JSC::JITByIdGenerator::JITByIdGenerator): + (JSC::JITByIdGenerator::reportSlowPathCall): + (JSC::JITByIdGenerator::slowPathJump): + (JSC::JITGetByIdGenerator::JITGetByIdGenerator): + (JSC::JITPutByIdGenerator::JITPutByIdGenerator): + * jit/JITPropertyAccess.cpp: + (JSC::JIT::emit_op_get_by_id): + (JSC::JIT::emitSlow_op_get_by_id): + (JSC::JIT::emit_op_put_by_id): + (JSC::JIT::emitSlow_op_put_by_id): + * jit/JITPropertyAccess32_64.cpp: + (JSC::JIT::emit_op_get_by_id): + (JSC::JIT::emitSlow_op_get_by_id): + (JSC::JIT::emit_op_put_by_id): + (JSC::JIT::emitSlow_op_put_by_id): + * jit/RegisterSet.h: + (JSC::RegisterSet::set): - Reviewed by Anders Carlsson. +2013-10-19 Alexey Proskuryakov - This was so confusing that I didn't feel like I could reason about - memory lifetime in the heap without fixing it. + APICast.h uses functions from JSCJSValueInlines.h, but doesn't include it + https://bugs.webkit.org/show_bug.cgi?id=123067 - The rules are: + Reviewed by Geoffrey Garen. - (1) JSGlobalData owns the virtual machine and all memory in it. + * API/APICast.h: Include it. - (2) Deleting a JSGlobalData frees the virtual machine and all memory - in it. +2013-10-19 Filip Pizlo - (Caveat emptor: if you delete the virtual machine while you're running - JIT code or accessing GC objects, you're gonna have a bad time.) + FTL::Location should treat the offset as an addend in the case of a Register location + https://bugs.webkit.org/show_bug.cgi?id=123062 - (I opted not to make arbitrary sub-objects keep the virtual machine - alive automatically because: + Reviewed by Sam Weinig. - (a) doing that right would be complex and slow; + * ftl/FTLLocation.cpp: + (JSC::FTL::Location::forStackmaps): + (JSC::FTL::Location::dump): + (JSC::FTL::Location::restoreInto): + * ftl/FTLLocation.h: + (JSC::FTL::Location::forRegister): + (JSC::FTL::Location::hasAddend): + (JSC::FTL::Location::addend): - (b) in the case of an exiting thread or process, there's no - clear way to give the garbage collector a chance to try again - later; +2013-10-19 Nadav Rotem - (c) continuing to run the garbage collector after we've been - asked to shut down the virtual machine seems rude; + DFG dominators: document and rename stuff. + https://bugs.webkit.org/show_bug.cgi?id=123056 - (d) we've never really supported that feature, anyway.) + Reviewed by Filip Pizlo. - (3) Normal ref-counting will do. No need to call a battery of - specialty functions to tear down a JSGlobalData. Its foibles - notwithstanding, C++ does in fact know how to execute destructors in - order. + Documented the code and renamed some variables. - * API/JSContextRef.cpp: - (JSGlobalContextCreate): Removed compatibility shim for older - operating systems because it's no longer used. + * dfg/DFGDominators.cpp: + (JSC::DFG::Dominators::compute): + (JSC::DFG::Dominators::pruneDominators): + * dfg/DFGDominators.h: - (JSGlobalContextRelease): Now that we can rely on JSGlobalData to "do - the right thing", this code is much simpler. We still have one special - case to notify the garbage collector if we're removing the last - reference to the global object, since this can improve memory behavior. +2013-10-19 Julien Brianceau - * heap/CopiedSpace.cpp: - (JSC::CopiedSpace::freeAllBlocks): - * heap/CopiedSpace.h: - (CopiedSpace): Renamed "destroy" => "freeAllBlocks" because true - destruction-time behaviors should be limited to our C++ destructor. + Fix build failure for architectures with 4 argument registers. + https://bugs.webkit.org/show_bug.cgi?id=123060 - * heap/Heap.cpp: - (JSC::Heap::~Heap): - (JSC): - (JSC::Heap::lastChanceToFinalize): - * heap/Heap.h: - (Heap): - (JSC::Heap::heap): Renamed "destroy" => "lastChanceToFinalize" because - true destruction-time behaviors should be limited to our C++ - destructor. + Reviewed by Michael Saboff. - Reorganized the code, putting code that must run before any objects - get torn down into lastChanceToFinalize, and code that just tears down - objects into our destructor. + Add missing setupArgumentsWithExecState() prototypes for architecture with 4 argument registers. + Remove SH4 specific code no longer needed since callOperation prototype change in r157660. - * heap/Local.h: - (JSC::LocalStack::LocalStack): - (JSC::LocalStack::push): - (LocalStack): See rule (2). + * dfg/DFGSpeculativeJIT.h: + (JSC::DFG::SpeculativeJIT::callOperation): + * jit/CCallHelpers.h: + (JSC::CCallHelpers::setupArgumentsWithExecState): + * jit/JITInlines.h: + (JSC::JIT::callOperation): - * jsc.cpp: - (functionQuit): - (main): - (printUsageStatement): - (parseArguments): - (jscmain): - * testRegExp.cpp: - (main): - (printUsageStatement): - (parseArguments): - (realMain): See rule (3). - - I removed the feature of ensuring orderly tear-down when calling quit() - or running in --help mode because it didn't seem very useful and - making it work with Windows structured exception handling and - NO_RETURN didn't seem like a fun way to spend a Saturday. - - * runtime/JSGlobalData.h: - * runtime/JSGlobalData.cpp: - (JSC::JSGlobalData::JSGlobalData): Moved heap to be the first data - member in JSGlobalData to ensure that it's destructed last, so other - objects that reference it destruct without crashing. This allowed me - to remove clearBuiltinStructures() altogether, and helped guarantee - rule (3). - - (JSC::JSGlobalData::~JSGlobalData): Explicitly call - lastChanceToFinalize() at the head of our destructor to ensure that - all pending finalizers run while the virtual machine is still in a - valid state. Trying to resurrect (re-ref) the virtual machine at this - point is not valid, but all other operations are. - - Changed a null to a 0xbbadbeef to clarify just how bad this beef is. - - * runtime/JSGlobalObject.cpp: - (JSC::JSGlobalObject::init): - * runtime/JSGlobalObject.h: - (JSGlobalObject): - (JSC::JSGlobalObject::globalData): See rule (3). +2013-10-18 Filip Pizlo -2012-04-27 Geoffrey Garen + Unreviewed, fix FTL build. - Try to fix the Windows build. + * ftl/FTLIntrinsicRepository.h: + * ftl/FTLLowerDFGToLLVM.cpp: + (JSC::FTL::LowerDFGToLLVM::compileGetById): - * heap/WeakBlock.h: - (WeakBlock): +2013-10-18 Filip Pizlo -2012-04-27 Geoffrey Garen + A CodeBlock's StructureStubInfos shouldn't be in a Vector that we search using code origins and machine code PCs + https://bugs.webkit.org/show_bug.cgi?id=122940 - Made WeakSet::allocate() static and removed its JSGlobalData argument - https://bugs.webkit.org/show_bug.cgi?id=85128 + Reviewed by Oliver Hunt. + + This accomplishes a number of simplifications. StructureStubInfo is now non-moving, + whereas previously it was in a Vector, so it moved. This allows you to use pointers to + StructureStubInfo. This also eliminates the use of return PC as a way of finding the + StructureStubInfo's. It removes some of the need for the compile-time property access + records; for example the DFG no longer has to save information about registers in a + property access record only to later save it to the stub info. + + The main thing is accomplishes is that it makes it easier to add StructureStubInfo's + at any stage of compilation. - Reviewed by Anders Carlsson. - - This is a step toward faster finalization. - - WeakSet::allocate() now deduces which WeakSet to allocate from based on - its JSCell* argument. (Currently, there's only one WeakSet, but soon - there will be many.) - - This was a global replace of "globalData.heap.weakSet()->allocate" with - "WeakSet::allocate", plus by-hand removal of the JSGlobalData argument. - - * heap/WeakSetInlines.h: Copied from Source/JavaScriptCore/heap/WeakSet.h. - - I had to split out WeakSet::allocate() in to a separate header to avoid - a cycle. - - (JSC::WeakSet::allocate): We can mask the pointer we're passed to - figure out where to allocate our WeakImpl. (Soon, we'll use this to - associate the WeakImpl with the GC block it references.) - -2012-04-27 Geoffrey Garen - - Stop using aligned allocation for WeakBlock - https://bugs.webkit.org/show_bug.cgi?id=85124 - - Reviewed by Anders Carlsson. - - We don't actually use the alignment for anything. - - * heap/WeakBlock.cpp: - (JSC::WeakBlock::create): - (JSC::WeakBlock::WeakBlock): Switched from aligned allocation to regular - allocation. - - * heap/WeakBlock.h: - (WeakBlock): Don't use HeapBlock because HeapBlock requires aligned - allocation. This change required me to add some declarations that we used - to inherit from HeapBlock. - - (WeakBlock::blockFor): Removed. This function relied on aligned allocation - but didn't do anything for us. - - (WeakBlock::deallocate): Removed. WeakBlock doesn't own any of the deallocation - logic, so it shouldn't own the function. - - * heap/WeakSet.cpp: - (JSC::WeakSet::~WeakSet): - (JSC::WeakSet::finalizeAll): - (JSC::WeakSet::visitLiveWeakImpls): - (JSC::WeakSet::visitDeadWeakImpls): - (JSC::WeakSet::sweep): - (JSC::WeakSet::shrink): - (JSC::WeakSet::resetAllocator): - (JSC::WeakSet::tryFindAllocator): - * heap/WeakSet.h: - (WeakSet): Updated declarations to reflect WeakBlock not inheriting from - HeapBlock. This allowed me to remove some casts, which was nice. - - (JSC::WeakSet::deallocate): Directly set the deallocated flag instead of - asking WeakBlock to do it for us. We don't need to have a WeakBlock - pointer to set the flag, so stop asking for one. - -2012-04-27 Kentaro Hara - - [JSC] Implement a helper method createNotEnoughArgumentsError() - https://bugs.webkit.org/show_bug.cgi?id=85102 - - Reviewed by Geoffrey Garen. - - In bug 84787, kbr@ requested to avoid hard-coding - createTypeError(exec, "Not enough arguments") here and there. - This patch implements createNotEnoughArgumentsError(exec) - and uses it in JSC bindings. - - c.f. a corresponding bug for V8 bindings is bug 85097. - - * runtime/Error.cpp: - (JSC::createNotEnoughArgumentsError): - (JSC): - * runtime/Error.h: - (JSC): - -2012-04-27 Geoffrey Garen - - Only allow non-null pointers in the WeakSet - https://bugs.webkit.org/show_bug.cgi?id=85119 - - Reviewed by Darin Adler. - - This is a step toward more efficient finalization. - - No clients put non-pointers (JSValues) into Weak and PassWeak. - - Some clients put null pointers into Weak and PassWeak, but this is - more efficient and straight-forward to model with a null in the Weak - or PassWeak instead of allocating a WeakImpl just to hold null. - - * heap/PassWeak.h: - (JSC): Removed the Unknown (JSValue) type of weak pointer because it's - unused now. - - (PassWeak): Don't provide a default initializer for our JSCell* argument. - This feature was only used in one place, and it was a bug. - - (JSC::::get): Don't check for a null stored inside our WeakImpl: that's - not allowed anymore. - - (JSC::PassWeak::PassWeak): Handle null as a null WeakImpl instead of - allocating a WeakImpl and storing null into it. - - * heap/Weak.h: - (Weak): - (JSC::::Weak): Same changes as in PassWeak. - - * heap/WeakBlock.cpp: - (JSC::WeakBlock::visitLiveWeakImpls): - (JSC::WeakBlock::visitDeadWeakImpls): Only non-null cells are valid in - the WeakSet now, so no need to check for non-cells and null cell pointers. - - * heap/WeakImpl.h: - (JSC::WeakImpl::WeakImpl): Only non-null cells are valid in the WeakSet - now, so ASSERT that. - -2012-04-27 Gavin Barraclough - - Math in JavaScript is inaccurate on iOS - - By defalut IEEE754 denormal support is disabled on iOS; - turn it on. - - Reviewed by Filip Pizlo. - - * jsc.cpp: - (main): - - clear the appropriate bit in the fpscr. - -2012-04-27 Michael Saboff - - Memory wasted in JSString for non-rope strings - https://bugs.webkit.org/show_bug.cgi?id=84907 - - Reviewed by Geoffrey Garen. - - Split JSString into two classes, JSString as a base class that does not - include the fibers of a Rope, and a subclass JSRopeString that has the - rope functionality. Both classes "share" the same ClassInfo. Added - a bool to JSString to indicate that the string was allocated as a JSRopeString - to properly handle visiting the fiber children when the rope is resolved and - the JSRopeString appears as a JSString. Didn't change the interface of JSString - to require any JIT changes. - - As part of this change, removed "cellSize" from ClassInfo since both classes - share the same ClassInfo, but have different sizes. The only use I could find - for cellSize was an ASSERT in allocateCell(). - - This appears to be neutral on performance tests. - - * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def: Changed JSString::resolveRope - to JSRopeString::resolveRope - * runtime/ClassInfo.h: - (JSC): - (ClassInfo): - * runtime/JSCell.h: - (JSC::allocateCell): - * runtime/JSString.cpp: - (JSC::JSRopeString::RopeBuilder::expand): - (JSC::JSString::visitChildren): - (JSC): - (JSC::JSRopeString::visitFibers): - (JSC::JSRopeString::resolveRope): - (JSC::JSRopeString::resolveRopeSlowCase8): - (JSC::JSRopeString::resolveRopeSlowCase): - (JSC::JSRopeString::outOfMemory): - (JSC::JSRopeString::getIndexSlowCase): - * runtime/JSString.h: - (JSC): - (JSString): - (JSC::JSString::finishCreation): - (JSC::JSString::create): - (JSC::JSString::isRope): - (JSC::JSString::is8Bit): - (JSRopeString): - (RopeBuilder): - (JSC::JSRopeString::RopeBuilder::RopeBuilder): - (JSC::JSRopeString::RopeBuilder::append): - (JSC::JSRopeString::RopeBuilder::release): - (JSC::JSRopeString::RopeBuilder::length): - (JSC::JSRopeString::JSRopeString): - (JSC::JSRopeString::finishCreation): - (JSC::JSRopeString::createNull): - (JSC::JSRopeString::create): - (JSC::JSString::value): - (JSC::JSString::tryGetValue): - (JSC::JSString::getIndex): - (JSC::jsStringBuilder): - * runtime/Operations.h: - (JSC::jsString): - (JSC::jsStringFromArguments): - -2012-04-27 Oliver Hunt - - Correct assertion. - - * interpreter/Interpreter.cpp: - (JSC::Interpreter::throwException): - -2012-04-27 Oliver Hunt - - Lazy link phase of baseline jit fails to propagate exception - https://bugs.webkit.org/show_bug.cgi?id=85092 - - Reviewed by Filip Pizlo. - - Very simple patch, when linking produces an error we need to actually store - the exception prior to throwing it. I can't find any other examples of this, - but as we're already in the slow path when throwing an exception I've hardened - exception throwing against null exceptions. - - * interpreter/Interpreter.cpp: - (JSC::Interpreter::throwException): - * jit/JITStubs.cpp: - (JSC::lazyLinkFor): - -2012-04-27 Benjamin Poulain - - Generalize the single character optimization of numberProtoFuncToString - https://bugs.webkit.org/show_bug.cgi?id=85027 - - Reviewed by Geoffrey Garen. - - The function numberProtoFuncToString() has an optimization to use SmallStrings::singleCharacterString() - when the radix is 36. - - This patch generalize the optimization for any radix. Any positive number smaller than its radix - can be represented by a single character of radixDigits. - - This makes numberProtoFuncToString() about twice as fast for this case of single digit conversion. - - * runtime/NumberPrototype.cpp: - (JSC::numberProtoFuncToString): - -2012-04-27 Gavin Peters - - Add new ENABLE_LINK_PRERENDER define to control the Prerendering API - https://bugs.webkit.org/show_bug.cgi?id=84871 - - Reviewed by Adam Barth. - - Prerendering is currently covered by the ENABLE_LINK_PREFETCH macro, but the new Prerendering - API separates it from prefetching. Having separate include guards lets ports enable prefetching, - a relatively easy change, without needing to build the infrastructure for prerendering, which - is considerably more complicated. - - * Configurations/FeatureDefines.xcconfig: - -2012-04-26 Oliver Hunt - - Allocating WeakImpl should not trigger GC, as that makes the world very tricksy. - https://bugs.webkit.org/show_bug.cgi?id=85020 - - Reviewed by Gavin Barraclough. - - Now in the event that we are unable to find an allocator for a new handle, just - add a new allocator rather than trying to recover "dead" handles through a GC. - - Find allocator is now much simpler, and addAllocator directly reports the - increased memory usage to the heap without causing any GC to happen immediately. - - * heap/WeakSet.cpp: - (JSC::WeakSet::findAllocator): - (JSC::WeakSet::addAllocator): - -2012-04-26 Oliver Hunt - - Remove RegisterFile::end()/m_end - https://bugs.webkit.org/show_bug.cgi?id=85011 - - Reviewed by Gavin Barraclough. - - Get rid of end() and m_end from RegisterFile. From now on - we only care about the end of the committed region when calling - code. When re-entering the VM we now plant the new CallFrame - immediately after whatever the current topCallFrame is. This - required adding a routine to CallFrame to determine exactly what - we should be doing (in the absence of an existing CallFrame, we - can't reason about the frameExtent() so we check for that). - - This also now means that the GC only marks the portion of the - RegisterFile that is actually in use, and that VM re-entry doesn't - exhaust the RegisterFile as rapidly. - - * dfg/DFGOperations.cpp: - * heap/Heap.cpp: - (JSC::Heap::getConservativeRegisterRoots): - (JSC::Heap::markRoots): - * interpreter/CallFrame.h: - (JSC::ExecState::init): - (JSC::ExecState::startOfReusableRegisterFile): - (ExecState): - * interpreter/Interpreter.cpp: - (JSC::Interpreter::execute): - (JSC::Interpreter::executeCall): - (JSC::Interpreter::executeConstruct): - (JSC::Interpreter::prepareForRepeatCall): - (JSC::Interpreter::privateExecute): - * interpreter/Interpreter.h: - (JSC::Interpreter::execute): - * interpreter/RegisterFile.cpp: - (JSC::RegisterFile::growSlowCase): - (JSC::RegisterFile::gatherConservativeRoots): - * interpreter/RegisterFile.h: - (JSC::RegisterFile::commitEnd): - (JSC::RegisterFile::addressOfEnd): - (RegisterFile): - (JSC::RegisterFile::RegisterFile): - (JSC::RegisterFile::shrink): - (JSC::RegisterFile::grow): - * jit/JITStubs.cpp: - (JSC::DEFINE_STUB_FUNCTION): - (JSC::jitCompileFor): - (JSC::lazyLinkFor): - * llint/LLIntSlowPaths.cpp: - (JSC::LLInt::LLINT_SLOW_PATH_DECL): - (JSC::LLInt::handleHostCall): - * llint/LowLevelInterpreter.asm: - * runtime/CommonSlowPaths.h: - (JSC::CommonSlowPaths::arityCheckFor): - -2012-04-26 Filip Pizlo - - DFG ARMv7 backend should optimize Float32 arrays - https://bugs.webkit.org/show_bug.cgi?id=85000 - - - Reviewed by Gavin Barraclough. - - * assembler/ARMv7Assembler.h: - (ARMv7Assembler): - (JSC::ARMv7Assembler::flds): - (JSC::ARMv7Assembler::fsts): - (JSC::ARMv7Assembler::vcvtds): - (JSC::ARMv7Assembler::vcvtsd): - * assembler/MacroAssemblerARMv7.h: - (JSC::MacroAssemblerARMv7::loadFloat): - (MacroAssemblerARMv7): - (JSC::MacroAssemblerARMv7::storeFloat): - (JSC::MacroAssemblerARMv7::convertFloatToDouble): - (JSC::MacroAssemblerARMv7::convertDoubleToFloat): - * bytecode/PredictedType.h: - (JSC::isActionableFloatMutableArrayPrediction): - * dfg/DFGNode.h: - (JSC::DFG::Node::shouldSpeculateFloat32Array): - -2012-04-25 Benjamin Poulain - - Add a version of StringImpl::find() without offset - https://bugs.webkit.org/show_bug.cgi?id=83968 - - Reviewed by Sam Weinig. - - Add support for the new StringImpl::find() to UString. - - Change stringProtoFuncIndexOf() to specifically take advatage of the feature. - This gives a 12% gains on a distribution of strings between 30 and 100 characters. - - * runtime/StringPrototype.cpp: - (JSC::substituteBackreferences): - (JSC::stringProtoFuncIndexOf): - * runtime/UString.h: - (UString): - (JSC::UString::find): - -2012-04-25 Mark Hahnenberg - - WebCore shouldn't call collectAllGarbage directly - https://bugs.webkit.org/show_bug.cgi?id=84897 - - Reviewed by Geoffrey Garen. - - * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def: Exported symbol - for reportAbanondedObjectGraph so WebCore can use it. - * heap/Heap.h: Ditto. - -2012-04-25 Oliver Hunt - - Biolab disaster crashes on ToT - https://bugs.webkit.org/show_bug.cgi?id=84898 - - Reviewed by Filip Pizlo. - - Whoops, committed without saving reviewer requested change. - - * dfg/DFGVirtualRegisterAllocationPhase.cpp: - (JSC::DFG::VirtualRegisterAllocationPhase::run): - -2012-04-25 Oliver Hunt - - Biolab disaster crashes on ToT - https://bugs.webkit.org/show_bug.cgi?id=84898 - - Reviewed by Filip Pizlo. - - I recently added an assertion to the Interpreter to catch incorrect - updates of topCallFrame. This caused a bunch of sites (including biolab - disaster) to crash as we were not correctly handling callee registers - of inlined functions, leading to a mismatch. - - I could not actually make this trigger directly, although it does trigger - already on some of the GTK and QT bots. - - * dfg/DFGVirtualRegisterAllocationPhase.cpp: - (JSC::DFG::VirtualRegisterAllocationPhase::run): - -2012-04-25 Kenneth Russell - - Delete CanvasPixelArray, ByteArray, JSByteArray and JSC code once unreferenced - https://bugs.webkit.org/show_bug.cgi?id=83655 - - Reviewed by Oliver Hunt. - - * CMakeLists.txt: - * GNUmakefile.list.am: - * JavaScriptCore.gypi: - * JavaScriptCore.order: - * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def: - * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj: - * JavaScriptCore.xcodeproj/project.pbxproj: - * Target.pri: - * bytecode/PredictedType.cpp: - (JSC::predictionToString): - (JSC::predictionToAbbreviatedString): - (JSC::predictionFromClassInfo): - * bytecode/PredictedType.h: - (JSC): - (JSC::isActionableIntMutableArrayPrediction): - * dfg/DFGAbstractState.cpp: - (JSC::DFG::AbstractState::initialize): - (JSC::DFG::AbstractState::execute): - * dfg/DFGCSEPhase.cpp: - (JSC::DFG::CSEPhase::performNodeCSE): - * dfg/DFGFixupPhase.cpp: - (JSC::DFG::FixupPhase::fixupNode): - * dfg/DFGNode.h: - * dfg/DFGNodeType.h: - (DFG): - * dfg/DFGOperations.cpp: - (JSC::DFG::putByVal): - * dfg/DFGPredictionPropagationPhase.cpp: - (JSC::DFG::PredictionPropagationPhase::propagate): - * dfg/DFGSpeculativeJIT.cpp: - (JSC::DFG::SpeculativeJIT::checkArgumentTypes): - (JSC::DFG::SpeculativeJIT::compileGetIndexedPropertyStorage): - * dfg/DFGSpeculativeJIT.h: - (JSC::DFG::ValueSource::forPrediction): - (SpeculativeJIT): - * dfg/DFGSpeculativeJIT32_64.cpp: - (JSC::DFG::SpeculativeJIT::compile): - * dfg/DFGSpeculativeJIT64.cpp: - (JSC::DFG::SpeculativeJIT::compile): - * interpreter/Interpreter.cpp: - (JSC::Interpreter::privateExecute): - * jit/JITStubs.cpp: - (JSC::DEFINE_STUB_FUNCTION): - * jit/JITStubs.h: - * llint/LLIntSlowPaths.cpp: - (JSC::LLInt::getByVal): - (JSC::LLInt::LLINT_SLOW_PATH_DECL): - * runtime/JSByteArray.cpp: Removed. - * runtime/JSByteArray.h: Removed. - * runtime/JSGlobalData.cpp: - -2012-04-25 Filip Pizlo - - http://bellard.org/jslinux/ triggers an assertion failure in the DFG JIT - https://bugs.webkit.org/show_bug.cgi?id=84815 - - - Reviewed by Gavin Barraclough. - - * dfg/DFGSpeculativeJIT.h: - (JSC::DFG::SpeculativeJIT::forwardSpeculationCheck): - -2012-04-25 Michael Saboff - - Closure in try {} with catch captures all locals from the enclosing function - https://bugs.webkit.org/show_bug.cgi?id=84804 - - Reviewed by Oliver Hunt. - - Changed the capturing of local variables from capturing when eval is used, - within a "with" or within a "catch" to be just when an eval is used. - Renamed the function returning that we should capture from - getCapturedVariables() to usesEval(), since that what it noew returns. - Needed to fix the "with" code to only range check when the activation - has actually been torn off. Added m_isTornOff to JSActivation to - track this. - - * parser/Parser.h: - (JSC::Scope::usesEval): - (JSC::Scope::getCapturedVariables): - * runtime/JSActivation.cpp: - (JSC::JSActivation::JSActivation): - (JSC::JSActivation::symbolTableGet): - (JSC::JSActivation::symbolTablePut): - * runtime/JSActivation.h: - (JSActivation): - (JSC::JSActivation::tearOff): - -2012-04-24 Mark Hahnenberg - - GC Activity Callback timer should be based on how much has been allocated since the last collection - https://bugs.webkit.org/show_bug.cgi?id=84763 - - Reviewed by Geoffrey Garen. - - The desired behavior for the GC timer is to collect at some point in the future, - regardless of how little we've allocated. A secondary goal, which is almost if not - as important, is for the timer to collect sooner if there is the potential to - collect a greater amount of memory. Conversely, as we allocate more memory we'd - like to reduce the delay to the next collection. If we're allocating quickly enough, - the timer should be preempted in favor of a normal allocation-triggered collection. - If allocation were to slow or stop, we'd like the timer to be able to opportunistically - run a collection without us having to allocate to the hard limit set by the Heap. - - This type of policy can be described in terms of the amount of CPU we are willing - to dedicate to reclaim a single MB of memory. For example, we might be willing to - dedicate 1% of our CPU to reclaim 1 MB. We base our CPU usage off of the length of - the last collection, e.g. if our last collection took 1ms, we would want to wait about - 100ms before running another collection to reclaim 1 MB. These constants should be - tune-able, e.g. 0.1% CPU = 1 MB vs. 1% CPU = 1 MB vs. 10% CPU = 1 MB. - - * API/JSBase.cpp: Use the new reportAbandonedObjectGraph. - (JSGarbageCollect): - * API/JSContextRef.cpp: Ditto. - * heap/Heap.cpp: - (JSC::Heap::Heap): - (JSC::Heap::reportAbandonedObjectGraph): Similar to reportExtraMemoryCost. Clients call - this function to notify the Heap that some unknown number of JSC objects might have just - been abandoned and are now garbage. The Heap might schedule a new collection timer based - on this notification. - (JSC): - (JSC::Heap::collect): Renamed m_lastFullGCSize to the less confusing m_sizeAfterLastCollect. - * heap/Heap.h: - (Heap): - * heap/MarkedAllocator.h: - (JSC::MarkedAllocator::zapFreeList): Fixed a bug in zapFreeList that failed to nullify the - current allocator's FreeList once zapping was complete. - * runtime/GCActivityCallback.cpp: Removed didAbandonObjectGraph because it was replaced by - Heap::reportAbandonedObjectGraph. - (JSC): - * runtime/GCActivityCallback.h: - (JSC::GCActivityCallback::willCollect): - (DefaultGCActivityCallback): - * runtime/GCActivityCallbackCF.cpp: Refactored the GC timer code so that we now schedule the - timer based on how much we have allocated since the last collection up to a certain amount. - We use the length of the previous GC to try to keep our total cost of opportunistic timer-triggered - collections around 1% of the CPU per MB of garbage we expect to reclaim up to a maximum of 5 MB. - (DefaultGCActivityCallbackPlatformData): - (JSC): - (JSC::DefaultGCActivityCallback::~DefaultGCActivityCallback): - (JSC::DefaultGCActivityCallback::commonConstructor): - (JSC::scheduleTimer): - (JSC::cancelTimer): - (JSC::DefaultGCActivityCallback::didAllocate): - -2012-04-24 Michael Saboff - - objectProtoFuncToString creates new string every invocation - https://bugs.webkit.org/show_bug.cgi?id=84781 - - Reviewed by Geoffrey Garen. - - Cache the results of object toString() in the attached Structure. - - * runtime/ObjectPrototype.cpp: - (JSC::objectProtoFuncToString): - * runtime/Structure.cpp: - (JSC::Structure::visitChildren): visit new m_hasObjectToStringValue. - * runtime/Structure.h: Added new member m_hasObjectToStringValue - (JSC): - (JSC::Structure::objectToStringValue): - (Structure): - (JSC::Structure::setObjectToStringValue): - -2012-04-24 Thouraya ANDOLSI - - Reviewed by Oliver Hunt. - - https://bugs.webkit.org/show_bug.cgi?id=84727. - Fix build when ENABLE_JIT_CONSTANT_BLINDING enabled. - - * assembler/MacroAssemblerSH4.h: - (JSC::MacroAssemblerSH4::or32): - (JSC::MacroAssemblerSH4::and32): - (JSC::MacroAssemblerSH4::lshift32): - (JSC::MacroAssemblerSH4::xor32): - (JSC::MacroAssemblerSH4::branchSub32): - (JSC::MacroAssemblerSH4::urshift32): - -2012-04-24 Gavin Barraclough - - Add explicit patchableBranchPtrWithPatch/patchableJump methods - https://bugs.webkit.org/show_bug.cgi?id=84498 - - Reviewed by Filip Pizlo. - - Don't rely on inUninterruptedSequence to distinguish which jumps we need to be able to repatch. - - * assembler/AbstractMacroAssembler.h: - (JSC::AbstractMacroAssembler::PatchableJump::PatchableJump): - (PatchableJump): - (JSC::AbstractMacroAssembler::PatchableJump::operator Jump&): - (AbstractMacroAssembler): - (JSC::AbstractMacroAssembler::AbstractMacroAssembler): - - Added PatchableJump type, removed inUninterruptedSequence. - * assembler/LinkBuffer.h: - (LinkBuffer): - (JSC::LinkBuffer::locationOf): - - Only allow the location to be taken of patchable branches - * assembler/MacroAssembler.h: - (MacroAssembler): - (JSC::MacroAssembler::patchableBranchPtrWithPatch): - (JSC::MacroAssembler::patchableJump): - (JSC::MacroAssembler::shouldBlind): - - Added default implementation of patchableBranchPtrWithPatch, patchableJump. - * assembler/MacroAssemblerARMv7.h: - (JSC::MacroAssemblerARMv7::MacroAssemblerARMv7): - (MacroAssemblerARMv7): - (JSC::MacroAssemblerARMv7::patchableBranchPtrWithPatch): - (JSC::MacroAssemblerARMv7::patchableJump): - (JSC::MacroAssemblerARMv7::jump): - (JSC::MacroAssemblerARMv7::makeBranch): - - Added ARMv7 implementation of patchableBranchPtrWithPatch, patchableJump. - * dfg/DFGCorrectableJumpPoint.h: - (DFG): - (JSC::DFG::CorrectableJumpPoint::switchToLateJump): - - Late jumps are PatchableJumps. - * dfg/DFGJITCompiler.cpp: - (JSC::DFG::JITCompiler::linkOSRExits): - - replace use of inUninterruptedSequence - * dfg/DFGJITCompiler.h: - (JSC::DFG::PropertyAccessRecord::PropertyAccessRecord): - (PropertyAccessRecord): - - replace use of inUninterruptedSequence - * dfg/DFGSpeculativeJIT32_64.cpp: - (JSC::DFG::SpeculativeJIT::cachedGetById): - (JSC::DFG::SpeculativeJIT::cachedPutById): - - replace use of inUninterruptedSequence - * dfg/DFGSpeculativeJIT64.cpp: - (JSC::DFG::SpeculativeJIT::cachedGetById): - (JSC::DFG::SpeculativeJIT::cachedPutById): - - replace use of inUninterruptedSequence - * jit/JIT.h: - (PropertyStubCompilationInfo): - - replace use of inUninterruptedSequence - * jit/JITInlineMethods.h: - (JSC::JIT::beginUninterruptedSequence): - (JSC::JIT::endUninterruptedSequence): - - replace use of inUninterruptedSequence - * jit/JITPropertyAccess.cpp: - (JSC::JIT::compileGetByIdHotPath): - - replace use of inUninterruptedSequence - * jit/JITPropertyAccess32_64.cpp: - (JSC::JIT::compileGetByIdHotPath): - - replace use of inUninterruptedSequence - -2012-04-24 Benjamin Poulain - - Generalize the single character optimization of r114072 - https://bugs.webkit.org/show_bug.cgi?id=83961 - - Reviewed by Eric Seidel. - - Use the regular String::find(StringImpl*) in all cases now that it has been made faster. - - * runtime/StringPrototype.cpp: - (JSC::replaceUsingStringSearch): - -2012-04-24 Filip Pizlo - - Unreviewed, 32-bit build fix. - - * dfg/DFGSpeculativeJIT32_64.cpp: - (JSC::DFG::SpeculativeJIT::compile): - -2012-04-24 Filip Pizlo - - DFG performs incorrect DCE on (some?) intrinsics - https://bugs.webkit.org/show_bug.cgi?id=84746 - - - Reviewed by Oliver Hunt. - - * dfg/DFGAbstractState.cpp: - (JSC::DFG::AbstractState::execute): - * dfg/DFGByteCodeParser.cpp: - (ByteCodeParser): - (JSC::DFG::ByteCodeParser::setIntrinsicResult): - (JSC::DFG::ByteCodeParser::handleMinMax): - (JSC::DFG::ByteCodeParser::handleIntrinsic): - * dfg/DFGNodeType.h: - (DFG): - * dfg/DFGPredictionPropagationPhase.cpp: - (JSC::DFG::PredictionPropagationPhase::propagate): - * dfg/DFGSpeculativeJIT32_64.cpp: - (JSC::DFG::SpeculativeJIT::compile): - * dfg/DFGSpeculativeJIT64.cpp: - (JSC::DFG::SpeculativeJIT::compile): - -2012-04-24 Mark Hahnenberg - - Failure to allocate ArrayStorage in emit_op_new_array leads to poisonous JSArray - https://bugs.webkit.org/show_bug.cgi?id=84648 - - Reviewed by Geoffrey Garen. - - When emit_op_new_array successfully allocates a new JSArray but fails to allocate - the corresponding ArrayStorage for it, it falls back to the out-of-line stub call - to constructArray, which constructs and entirely new JSArray/ArrayStorage pair. - This leaves us with a JSArray hanging around on the stack or in a register that - did not go through its own constructor, thus giving it uninitialized memory in the - two fields that are checked in JSArray::visitChildren. - - * jit/JITInlineMethods.h: - (JSC::JIT::emitAllocateJSArray): We try to allocate the ArrayStorage first, so that - if we fail we haven't generated the poisonous JSArray that can cause a GC crash. - * jit/JITOpcodes.cpp: - (JSC::JIT::emitSlow_op_new_array): - -2012-04-23 Filip Pizlo - - DFG on ARMv7 should not OSR exit on every integer division - https://bugs.webkit.org/show_bug.cgi?id=84661 - - Reviewed by Oliver Hunt. - - On ARMv7, ArithDiv no longer has to know whether or not to speculate integer (since - that was broken with the introduction of Int32ToDouble) nor does it have to know - whether or not to convert its result to integer. This is now taken care of for free - with the addition of the DoubleAsInt32 node, which represents a double-is-really-int - speculation. - - * dfg/DFGAbstractState.cpp: - (JSC::DFG::AbstractState::execute): - * dfg/DFGCSEPhase.cpp: - (JSC::DFG::CSEPhase::performNodeCSE): - * dfg/DFGFixupPhase.cpp: - (JSC::DFG::FixupPhase::fixupNode): - * dfg/DFGNodeType.h: - (DFG): - * dfg/DFGOSRExit.cpp: - (JSC::DFG::OSRExit::OSRExit): - (JSC::DFG::OSRExit::considerAddingAsFrequentExitSiteSlow): - * dfg/DFGOSRExit.h: - (OSRExit): - * dfg/DFGPredictionPropagationPhase.cpp: - (JSC::DFG::PredictionPropagationPhase::propagate): - * dfg/DFGSpeculativeJIT.cpp: - (JSC::DFG::SpeculativeJIT::computeValueRecoveryFor): - (JSC::DFG::SpeculativeJIT::compileDoubleAsInt32): - (DFG): - * dfg/DFGSpeculativeJIT.h: - (SpeculativeJIT): - (JSC::DFG::SpeculativeJIT::speculationCheck): - (JSC::DFG::SpeculativeJIT::forwardSpeculationCheck): - * dfg/DFGSpeculativeJIT32_64.cpp: - (JSC::DFG::SpeculativeJIT::compile): - * dfg/DFGSpeculativeJIT64.cpp: - (JSC::DFG::SpeculativeJIT::compile): - -2012-04-24 Geoffrey Garen - - "GlobalHandle" HandleHeap (now WeakSet) allocations grow but do not shrink - https://bugs.webkit.org/show_bug.cgi?id=84740 - - - Reviewed by Gavin Barraclough. - - Shrink! - - * heap/Heap.cpp: - (JSC::Heap::destroy): Be more specific about what's shrinking, since we - can also shrink the WeakSet, but we don't do so here. - - (JSC::Heap::collect): If we're going to shrink the heap, shrink the - WeakSet too. Otherwise, its footprint is permanent. - - * heap/Heap.h: - (Heap): Removed shrink() as a public interface, since it's vague about - which parts of the heap it affects, and it's really an internal detail. - - * heap/WeakSet.cpp: - (JSC::WeakSet::shrink): Nix any free blocks. We assume that sweep() has - already taken place, since that's the convention for shrink() in the heap. - - * heap/WeakSet.h: - (WeakSet): New function! - -2012-04-24 Adam Klein - - Fix includes in StrongInlines.h and ScriptValue.h - https://bugs.webkit.org/show_bug.cgi?id=84659 - - Reviewed by Geoffrey Garen. - - * heap/StrongInlines.h: Include JSGlobalData.h, since JSGlobalData's - definiition is required here. - -2012-04-23 Filip Pizlo - - DFG OSR exit should ensure that all variables have been initialized - https://bugs.webkit.org/show_bug.cgi?id=84653 - - - Reviewed by Gavin Barraclough. - - Initialize all uncaptured dead variables to undefined on OSR exit. - - * dfg/DFGSpeculativeJIT.cpp: - (JSC::DFG::ValueSource::dump): - (JSC::DFG::SpeculativeJIT::compile): - (JSC::DFG::SpeculativeJIT::computeValueRecoveryFor): - * dfg/DFGSpeculativeJIT.h: - -2012-04-23 Oliver Hunt - - Call instruction for the baseline JIT stores origin info in wrong callframe - https://bugs.webkit.org/show_bug.cgi?id=84645 - - Reviewed by Gavin Barraclough. - - The baseline JIT was updating the wrong callframe when making a call. If the - call failed during dispatch (unable to perform codegen, calling a non-object) - we would attempt to use this information, but it would be completely wrong. - - * jit/JITCall.cpp: - (JSC::JIT::compileOpCall): - * jit/JITCall32_64.cpp: - (JSC::JIT::compileOpCall): - -2012-04-23 Filip Pizlo - - DFG must keep alive values that it will perform speculations on - https://bugs.webkit.org/show_bug.cgi?id=84638 - - - Reviewed by Oliver Hunt. - - * dfg/DFGNodeType.h: - (DFG): - -2012-04-23 Oliver Hunt - - Fix non-LLInt builds by temporarily removing an over-enthusiastic assertion - - * interpreter/Interpreter.cpp: - (JSC::Interpreter::executeCall): - -2012-04-22 Jon Lee - - Remove notifications support on Mac Lion. - https://bugs.webkit.org/show_bug.cgi?id=84554 - - - Reviewed by Sam Weinig. - - * Configurations/FeatureDefines.xcconfig: - -2012-04-21 Darin Adler - - Change JavaScript lexer to use 0 instead of -1 for sentinel, eliminating the need to put characters into ints - https://bugs.webkit.org/show_bug.cgi?id=84523 - - Reviewed by Oliver Hunt. - - Profiles showed that checks against -1 were costly, and I saw they could be eliminated. - Streamlined this code to use standard character types and 0 rather than -1. One benefit - of this is that there's no widening and narrowing. Another is that there are many cases - where we already have the correct behavior for 0, so can eliminate a branch that was - used to test for -1 before. Also eliminates typecasts in the code. - - * parser/Lexer.cpp: - (JSC::Lexer::invalidCharacterMessage): Updated use of String::format since m_current is now a - character type, not an int. - (JSC::Lexer::setCode): Use 0 rather than -1 when past the end. - (JSC::Lexer::shift): Ditto. Also spruced up the comment a bit. - (JSC::Lexer::atEnd): Added. New function that distinguishes an actual 0 character from the end - of the code. This can be used places we used to cheeck for -1. - (JSC::Lexer::peek): Updated to use -1 instead of 0. Removed meaningless comment. - (JSC::Lexer::parseFourDigitUnicodeHex): Changed to use character types instead of int. - (JSC::Lexer::shiftLineTerminator): Removed now-unneeded type casts. Changed local variable that - had a data-member-style name. - (JSC::Lexer::parseIdentifier): Removed now-unneeded explicit checks for -1, since the isIdentPart - function already returns false for the 0 character. Updated types in a couple other places. Used - the atEnd function where needed. - (JSC::Lexer::parseIdentifierSlowCase): More of the same. - (JSC::characterRequiresParseStringSlowCase): Added overloaded helper function for parseString. - (JSC::Lexer::parseString): Ditto. - (JSC::Lexer::parseStringSlowCase): Ditto. - (JSC::Lexer::parseMultilineComment): Ditto. - (JSC::Lexer::lex): More of the same. Also changed code to set the startOffset directly in - the tokenInfo instead of putting it in a local variable first, saving some memory access. - (JSC::Lexer::scanRegExp): Ditto. - (JSC::Lexer::skipRegExp): Ditto. - - * parser/Lexer.h: Changed return type of the peek function and type of m_current from int to - the character type. Added atEnd function. - (JSC::Lexer::setOffset): Used 0 instead of -1 and removed an overzealous attempt to optimize. - (JSC::Lexer::lexExpectIdentifier): Used 0 instead of -1. - -2012-04-21 Darin Adler - - Change JavaScript lexer to use 0 instead of -1 for sentinel, eliminating the need to put characters into ints - https://bugs.webkit.org/show_bug.cgi?id=84523 - - Reviewed by Oliver Hunt. - - Separate preparation step of copyright dates, renaming, and other small tweaks. - - * parser/Lexer.cpp: - (JSC::Lexer::invalidCharacterMessage): Removed "get" from name to match WebKit naming conventions. - (JSC::Lexer::peek): Removed meaningless comment. - (JSC::Lexer::parseFourDigitUnicodeHex): Renamed from getUnicodeCharacter to be more precise about - what this function does. - (JSC::Lexer::shiftLineTerminator): Renamed local variable that had a data-member-style name. - (JSC::Lexer::parseStringSlowCase): Updated for new name of parseFourDigitUnicodeHex. - (JSC::Lexer::lex): Updated for new name of invalidCharacterMessage. - - * parser/Lexer.h: Removed an unneeded forward declaration of the RegExp class. - Renamed getInvalidCharMessage to invalidCharacterMessage and made it const. Renamed - getUnicodeCharacter to parseFourDigitUnicodeHex. - -2012-04-20 Filip Pizlo - - DFG should optimize int8 and int16 arrays on ARMv7 - https://bugs.webkit.org/show_bug.cgi?id=84503 - - Reviewed by Oliver Hunt. - - * assembler/ARMv7Assembler.h: - (ARMv7Assembler): - (JSC::ARMv7Assembler::ldrsb): - (JSC::ARMv7Assembler::ldrsh): - * assembler/MacroAssemblerARMv7.h: - (JSC::MacroAssemblerARMv7::load16Signed): - (JSC::MacroAssemblerARMv7::load8Signed): - * bytecode/PredictedType.h: - (JSC::isActionableIntMutableArrayPrediction): - * dfg/DFGNode.h: - (JSC::DFG::Node::shouldSpeculateInt8Array): - (JSC::DFG::Node::shouldSpeculateInt16Array): - -2012-04-20 Oliver Hunt - - Add an ability to find the extent of a callframe - https://bugs.webkit.org/show_bug.cgi?id=84513 - - Reviewed by Filip Pizlo. - - Add a function to get the extent of a callframe and - use that function for a new assertion to make sure the - RegisterFile makes sense using that information. - - * interpreter/CallFrame.cpp: - (JSC::CallFrame::frameExtentInternal): - (JSC): - * interpreter/CallFrame.h: - (JSC::ExecState::frameExtent): - (ExecState): - * interpreter/Interpreter.cpp: - (JSC::Interpreter::executeCall): - -2012-04-20 Benjamin Poulain - - Inline the JSArray constructor - https://bugs.webkit.org/show_bug.cgi?id=84416 - - Reviewed by Geoffrey Garen. - - The constructor is trivial, no reason to jump for it. - - This makes the creation of array ~5% faster (on non-trivial cases, no empty arrays). - - * runtime/JSArray.cpp: - (JSC): - * runtime/JSArray.h: - (JSC::JSArray::JSArray): - * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def: - -2012-04-20 Mark Hahnenberg - - Heap should cancel GC timer at the start of the collection - https://bugs.webkit.org/show_bug.cgi?id=84477 - - Reviewed by Geoffrey Garen. - - Currently the Heap cancels the GC timer at the conclusion of a collection. - We should change this to be at the beginning because something (e.g. a finalizer) - could call didAbandonObjectGraph(), which will schedule the timer, but then - we'll immediately unschedule the timer at the conclusion of the collection, - thus potentially preventing large swaths of memory from being reclaimed in a timely manner. - - * API/JSBase.cpp: - (JSGarbageCollect): Remove outdated fix-me and remove check for whether the Heap is - busy or not, since we're just scheduling a timer to run a GC in the future. - * heap/Heap.cpp: - (JSC::Heap::collect): Rename didCollect to willCollect and move the call to the - top of Heap::collect. - * runtime/GCActivityCallback.cpp: Renamed didCollect to willCollect. - (JSC::DefaultGCActivityCallback::willCollect): - * runtime/GCActivityCallback.h: Ditto. - (JSC::GCActivityCallback::willCollect): - (DefaultGCActivityCallback): - * runtime/GCActivityCallbackCF.cpp: Ditto. - (JSC::DefaultGCActivityCallback::willCollect): - -2012-04-20 Mark Hahnenberg - - JSGarbageCollect should not call collectAllGarbage() - https://bugs.webkit.org/show_bug.cgi?id=84476 - - Reviewed by Geoffrey Garen. - - * API/JSBase.cpp: - (JSGarbageCollect): Notify the Heap's GCActivityCallback using didAbandonObjectGraph. - -2012-04-19 Oliver Hunt - - Exception stack traces aren't complete when the exception starts in native code - https://bugs.webkit.org/show_bug.cgi?id=84073 - - Reviewed by Filip Pizlo. - - Refactored building the stack trace to so that we can construct - it earlier, and don't rely on any prior work performed in the - exception handling machinery. Also updated LLInt and the DFG to - completely initialise the callframes of host function calls. - - Also fixed a few LLInt paths that failed to correctly update the - topCallFrame. - - * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def: - * dfg/DFGJITCompiler.h: - * dfg/DFGOperations.cpp: - * dfg/DFGSpeculativeJIT32_64.cpp: - (JSC::DFG::SpeculativeJIT::emitCall): - * dfg/DFGSpeculativeJIT64.cpp: - (JSC::DFG::SpeculativeJIT::emitCall): - * interpreter/Interpreter.cpp: - (JSC::eval): - (JSC::Interpreter::getStackTrace): - (JSC::Interpreter::addStackTraceIfNecessary): - (JSC): - (JSC::Interpreter::throwException): - * interpreter/Interpreter.h: - (Interpreter): - * jit/JITCall.cpp: - (JSC::JIT::compileOpCall): - * jit/JITCall32_64.cpp: - (JSC::JIT::compileOpCall): - * jit/JITOpcodes.cpp: - (JSC::JIT::privateCompileCTINativeCall): - * jit/JITOpcodes32_64.cpp: - (JSC::JIT::privateCompileCTINativeCall): - * jsc.cpp: - (functionJSCStack): - * llint/LLIntExceptions.cpp: - (JSC::LLInt::interpreterThrowInCaller): - (JSC::LLInt::returnToThrow): - (JSC::LLInt::callToThrow): - * llint/LLIntSlowPaths.cpp: - (JSC::LLInt::handleHostCall): - * llint/LowLevelInterpreter32_64.asm: - * llint/LowLevelInterpreter64.asm: - * parser/Parser.h: - (JSC::::parse): - * runtime/Error.cpp: - (JSC::addErrorInfo): - (JSC::throwError): - * runtime/Error.h: - (JSC): - -2012-04-19 Mark Hahnenberg - - We're collecting pathologically due to small allocations - https://bugs.webkit.org/show_bug.cgi?id=84404 - - Reviewed by Geoffrey Garen. - - No change in performance on run-jsc-benchmarks. - - * dfg/DFGSpeculativeJIT.h: Replacing m_firstFreeCell with m_freeList. - (JSC::DFG::SpeculativeJIT::emitAllocateBasicJSObject): - * heap/CopiedSpace.cpp: Getting rid of any water mark related stuff, since it's no - longer useful. - (JSC::CopiedSpace::CopiedSpace): - (JSC::CopiedSpace::tryAllocateSlowCase): We now only call didAllocate here rather than - carrying out a somewhat complicated accounting job for our old water mark throughout CopiedSpace. - (JSC::CopiedSpace::tryAllocateOversize): Call the new didAllocate to notify the Heap of - newly allocated stuff. - (JSC::CopiedSpace::tryReallocateOversize): - (JSC::CopiedSpace::doneFillingBlock): - (JSC::CopiedSpace::doneCopying): - (JSC::CopiedSpace::destroy): - * heap/CopiedSpace.h: - (CopiedSpace): - * heap/CopiedSpaceInlineMethods.h: - (JSC::CopiedSpace::startedCopying): - * heap/Heap.cpp: Removed water mark related stuff, replaced with new bytesAllocated and - bytesAllocatedLimit to track how much memory has been allocated since the last collection. - (JSC::Heap::Heap): - (JSC::Heap::reportExtraMemoryCostSlowCase): - (JSC::Heap::collect): We now set the new limit of bytes that we can allocate before triggering - a collection to be the size of the Heap after the previous collection. Thus, we still have our - 2x allocation amount. - (JSC::Heap::didAllocate): Notifies the GC activity timer of how many bytes have been allocated - thus far and then adds the new number of bytes to the current total. - (JSC): - * heap/Heap.h: Removed water mark related stuff. - (JSC::Heap::notifyIsSafeToCollect): - (Heap): - (JSC::Heap::shouldCollect): - (JSC): - * heap/MarkedAllocator.cpp: - (JSC::MarkedAllocator::tryAllocateHelper): Refactored to use MarkedBlock's new FreeList struct. - (JSC::MarkedAllocator::allocateSlowCase): - (JSC::MarkedAllocator::addBlock): - * heap/MarkedAllocator.h: - (MarkedAllocator): - (JSC::MarkedAllocator::MarkedAllocator): - (JSC::MarkedAllocator::allocate): - (JSC::MarkedAllocator::zapFreeList): Refactored to take in a FreeList instead of a FreeCell. - * heap/MarkedBlock.cpp: - (JSC::MarkedBlock::specializedSweep): - (JSC::MarkedBlock::sweep): - (JSC::MarkedBlock::sweepHelper): - (JSC::MarkedBlock::zapFreeList): - * heap/MarkedBlock.h: - (FreeList): Added a new struct that keeps track of the current MarkedAllocator's - free list including the number of bytes of stuff in the free list so that when the free list is - exhausted, the correct amount can be reported to Heap. - (MarkedBlock): - (JSC::MarkedBlock::FreeList::FreeList): - (JSC): - * heap/MarkedSpace.cpp: Removing all water mark related stuff. - (JSC::MarkedSpace::MarkedSpace): - (JSC::MarkedSpace::resetAllocators): - * heap/MarkedSpace.h: - (MarkedSpace): - (JSC): - * heap/WeakSet.cpp: - (JSC::WeakSet::findAllocator): Refactored to use the didAllocate interface with the Heap. This - function still needs work though now that the Heap knows how many bytes have been allocated - since the last collection. - * jit/JITInlineMethods.h: Refactored to use MarkedBlock's new FreeList struct. - (JSC::JIT::emitAllocateBasicJSObject): Ditto. - * llint/LowLevelInterpreter.asm: Ditto. - * runtime/GCActivityCallback.cpp: - (JSC::DefaultGCActivityCallback::didAllocate): - * runtime/GCActivityCallback.h: - (JSC::GCActivityCallback::didAllocate): Renamed willAllocate to didAllocate to indicate that - the allocation that is being reported has already taken place. - (DefaultGCActivityCallback): - * runtime/GCActivityCallbackCF.cpp: - (JSC): - (JSC::DefaultGCActivityCallback::didAllocate): Refactored to return early if the amount of - allocation since the last collection is not above a threshold (initially arbitrarily chosen to - be 128KB). - -2012-04-19 Filip Pizlo - - MacroAssemblerARMv7::branchTruncateDoubleToUint32 should obey the overflow signal - https://bugs.webkit.org/show_bug.cgi?id=84401 - - Reviewed by Gavin Barraclough. - - * assembler/MacroAssemblerARMv7.h: - (JSC::MacroAssemblerARMv7::branchTruncateDoubleToUint32): - -2012-04-19 Don Olmstead - - KeywordLookupGenerator.py should take an output file as an argument - https://bugs.webkit.org/show_bug.cgi?id=84292 - - Reviewed by Eric Seidel. - - Extended KeywordLookupGenerator to accept an additional argument specifying an output file. If this argument is found stdout is redirected to a file for the duration of the script. - - * KeywordLookupGenerator.py: - -2012-04-19 Filip Pizlo - - It should be possible to perform debugCall on ARMv7 - https://bugs.webkit.org/show_bug.cgi?id=84381 - - Reviewed by Oliver Hunt. - - debugCall() was clobbering the argument to the call it was making, leading to a - corrupt ExecState*. This change fixes that issue by using a scratch register that - does not clobber arguments, and it also introduces more assertions that we have - a valid call frame. - - * dfg/DFGAssemblyHelpers.cpp: - (DFG): - (JSC::DFG::AssemblyHelpers::jitAssertHasValidCallFrame): - * dfg/DFGAssemblyHelpers.h: - (JSC::DFG::AssemblyHelpers::selectScratchGPR): - (AssemblyHelpers): - (JSC::DFG::AssemblyHelpers::debugCall): - (JSC::DFG::AssemblyHelpers::jitAssertHasValidCallFrame): - * dfg/DFGJITCompiler.cpp: - (JSC::DFG::JITCompiler::linkOSRExits): - * dfg/DFGOSRExitCompiler.cpp: - * dfg/DFGSpeculativeJIT.cpp: - (JSC::DFG::SpeculativeJIT::compile): - * dfg/DFGSpeculativeJIT.h: - (JSC::DFG::SpeculativeJIT::selectScratchGPR): - -2012-04-19 Filip Pizlo - - LLInt no-JIT fallback native call trampoline's exception handler incorrectly assumes that - the PB/PC has been preserved - https://bugs.webkit.org/show_bug.cgi?id=84367 - - Reviewed by Oliver Hunt. - - * llint/LowLevelInterpreter32_64.asm: - * llint/LowLevelInterpreter64.asm: - -2012-04-19 Filip Pizlo - - It should be possible to load from Float64 arrays on ARMv7 without crashing - https://bugs.webkit.org/show_bug.cgi?id=84361 - - Reviewed by Oliver Hunt. - - * assembler/MacroAssemblerARMv7.h: - (JSC::MacroAssemblerARMv7::loadDouble): - (JSC::MacroAssemblerARMv7::storeDouble): - -2012-04-19 Dominik Röttsches - - [CMake] Build fix after r114575 - https://bugs.webkit.org/show_bug.cgi?id=84322 - - Reviewed by Simon Hausmann. - - Build fix, adding WTF when linking jsc shell. - - * shell/CMakeLists.txt: - -2012-04-18 Filip Pizlo - - JSC testing should have complete coverage over typed array types - https://bugs.webkit.org/show_bug.cgi?id=84302 - - Reviewed by Geoff Garen. - - Added Uint8ClampedArray to the set of typed arrays that are supported by jsc - command-line. - - * JSCTypedArrayStubs.h: - (JSC): - * jsc.cpp: - (GlobalObject::finishCreation): - -2012-04-18 Filip Pizlo - - jsc command line should support typed arrays by default - https://bugs.webkit.org/show_bug.cgi?id=84298 - - Rubber stamped by Gavin Barraclough. - - * JSCTypedArrayStubs.h: - (JSC): - * jsc.cpp: - (GlobalObject::finishCreation): - -2012-04-18 Filip Pizlo - - JSVALUE32_64 should be able to perform division on ARM without crashing, and variables - forced double should not be scrambled when performing OSR entry - https://bugs.webkit.org/show_bug.cgi?id=84272 - - Reviewed by Geoff Garen. - - * dfg/DFGFixupPhase.cpp: - (JSC::DFG::FixupPhase::fixupNode): - * dfg/DFGOSREntry.cpp: - (JSC::DFG::prepareOSREntry): - -2012-04-18 Don Olmstead - - JavaScriptCore.gypi not current - https://bugs.webkit.org/show_bug.cgi?id=84224 - - Reviewed by Eric Seidel. - - Updated JavaScriptCore.gypi to contain the latest sources. Removed os-win32 as it wasn't used. Also removed references to ICU files in the gypi file as ICU is most likely specified by the port itself. - - Private and public header files were determined by looking at copy-files.cmd within Apple's Visual Studio directory. - - * JavaScriptCore.gypi: - -2012-04-18 Benjamin Poulain - - Remove m_subclassData from JSArray, move the attribute to subclass as needed - https://bugs.webkit.org/show_bug.cgi?id=84249 - - Reviewed by Geoffrey Garen. - - JSArray's m_subclassData is only used by WebCore's RuntimeArray. This patch moves - the attribute to RuntimeArray to avoid allocating memory for the pointer in the common - case. - - This gives ~1% improvement in JSArray creation microbenchmark thanks to fewer allocations - of CopiedSpace. - - * jit/JITInlineMethods.h: - (JSC::JIT::emitAllocateJSArray): - * runtime/JSArray.cpp: - (JSC::JSArray::JSArray): - * runtime/JSArray.h: - -2012-04-18 Benjamin Poulain - - replaceUsingStringSearch: delay the creation of the replace string until needed - https://bugs.webkit.org/show_bug.cgi?id=83841 - - Reviewed by Geoffrey Garen. - - We do not need to obtain the replaceValue until we have a match. By moving the intialization - of replaceValue when needed, we save a few instructions when there is no match. - - * runtime/StringPrototype.cpp: - (JSC::replaceUsingRegExpSearch): - (JSC::replaceUsingStringSearch): - (JSC::stringProtoFuncReplace): - -2012-04-18 Mark Hahnenberg - - GC activity timer should be tied to allocation, not collection - https://bugs.webkit.org/show_bug.cgi?id=83919 - - Reviewed by Geoffrey Garen. - - * API/JSContextRef.cpp: Used the new didAbandonObjectGraph callback to indicate that now that we've - released a global object, we're abandoning a potentially large number of objects that JSC might want - to collect. - * heap/CopiedSpace.cpp: - (JSC::CopiedSpace::tryAllocateSlowCase): Added the call to timer's willAllocate function to indicate - that we've hit a slow path and are allocating now, so schedule the timer. - * heap/Heap.cpp: - (JSC::Heap::Heap): - (JSC::Heap::collectAllGarbage): Removed the call to discardAllCompiledCode because it was causing us to - throw away too much code during our benchmarks (especially vp8, which is very large and thus has large - amounts of compiled code). - (JSC::Heap::collect): Added the new call to didCollect at the conclusion of a collection so that we - can cancel the timer if we no longer need to run a collection. Also added a check at the beginning of a - collection to see if we should throw away our compiled code. Currently this is set to happen about once - every minute. - * heap/Heap.h: Added field to keep track of the last time we threw away our compiled code. - * heap/MarkedAllocator.cpp: - (JSC::MarkedAllocator::allocateSlowCase): Added call to willAllocate on the allocation slow path, just like - in CopiedSpace. - * runtime/GCActivityCallback.cpp: Added default stubs for non-CF platforms. - (JSC::DefaultGCActivityCallback::willAllocate): - (JSC): - (JSC::DefaultGCActivityCallback::didCollect): - (JSC::DefaultGCActivityCallback::didAbandonObjectGraph): - * runtime/GCActivityCallback.h: Added new functions to make JSC's GC timer less arcane. This includes replacing - the operator () with willAllocate() and adding an explicit didCollect() to cancel the timer after a collection - occurs rather than relying on the way the timer is invoked to cancel itself. Also added a callback for - when somebody else (e.g. WebCore or the JSC API) to notify JSC that they have just abandoned an entire graph of - objects and that JSC might want to clean them up. - (JSC::GCActivityCallback::~GCActivityCallback): - (JSC::GCActivityCallback::willAllocate): - (JSC::GCActivityCallback::didCollect): - (JSC::GCActivityCallback::didAbandonObjectGraph): - (JSC::GCActivityCallback::synchronize): - (DefaultGCActivityCallback): - * runtime/GCActivityCallbackCF.cpp: Re-wired all the run loop stuff to implement the aforementioned functions. - We added a flag to check whether the timer was active because the call to CFRunLoopTimerSetNextFireDate actually - turned out to be quite expensive (although Instruments couldn't tell us this). - (DefaultGCActivityCallbackPlatformData): - (JSC): - (JSC::DefaultGCActivityCallbackPlatformData::timerDidFire): - (JSC::DefaultGCActivityCallback::commonConstructor): - (JSC::scheduleTimer): - (JSC::cancelTimer): - (JSC::DefaultGCActivityCallback::willAllocate): - (JSC::DefaultGCActivityCallback::didCollect): - (JSC::DefaultGCActivityCallback::didAbandonObjectGraph): - -2012-04-17 Filip Pizlo - - DFG should not attempt to get rare case counts for op_mod on ARM - https://bugs.webkit.org/show_bug.cgi?id=84218 - - Reviewed by Geoff Garen. - - * dfg/DFGByteCodeParser.cpp: - (JSC::DFG::ByteCodeParser::makeSafe): - * dfg/DFGCommon.h: - (JSC::DFG::isX86): - (DFG): - -2012-04-17 Myles Maxfield - - BumpPointerAllocator assumes page size is less than MINIMUM_BUMP_POOL_SIZE - https://bugs.webkit.org/show_bug.cgi?id=80912 - - Reviewed by Hajime Morita. - - * wtf/BumpPointerAllocator.h: - (WTF::BumpPointerPool::create): - -2012-04-17 Filip Pizlo - - Attempt to fix Windows build. - - * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def: - -2012-04-17 Filip Pizlo - - It should be possible to create an inheritorID for the global this object without crashing - https://bugs.webkit.org/show_bug.cgi?id=84200 - - - Reviewed by Oliver Hunt. - - * runtime/JSGlobalThis.cpp: - (JSC::JSGlobalThis::setUnwrappedObject): - * runtime/JSGlobalThis.h: - (JSC::JSGlobalThis::unwrappedObject): - (JSGlobalThis): - * runtime/JSObject.cpp: - (JSC::JSObject::createInheritorID): - * runtime/JSObject.h: - (JSObject): - (JSC::JSObject::resetInheritorID): - -2012-04-17 Filip Pizlo - - DFG and LLInt should not clobber the frame pointer on ARMv7 - https://bugs.webkit.org/show_bug.cgi?id=84185 - - - Reviewed by Gavin Barraclough. - - Changed LLInt to use a different register. Changed DFG to use one fewer - registers. We should revisit this and switch the DFG to use a different - register instead of r7, but we can do that in a subsequent step since - the performance effect is tiny. - - * dfg/DFGGPRInfo.h: - (GPRInfo): - (JSC::DFG::GPRInfo::toRegister): - (JSC::DFG::GPRInfo::toIndex): - * offlineasm/armv7.rb: - -2012-04-17 Filip Pizlo - - use after free in JSC::DFG::Node::op / JSC::DFG::ByteCodeParser::flushArgument - https://bugs.webkit.org/show_bug.cgi?id=83942 - - - Reviewed by Gavin Barraclough. - - Don't use references to the graph after resizing the graph. - - * dfg/DFGByteCodeParser.cpp: - (JSC::DFG::ByteCodeParser::flushArgument): - -2012-04-16 Gavin Barraclough - - Array.prototype.toString should be generic - https://bugs.webkit.org/show_bug.cgi?id=81588 - - Reviewed by Sam Weinig. - - * runtime/ArrayPrototype.cpp: - (JSC::arrayProtoFuncToString): - - check for join function, use fast case if base object is array & join is present & default. - * runtime/CommonIdentifiers.h: - - added 'join'. - -2012-04-16 Carlos Garcia Campos - - Unreviewed. Fix make distcheck issues. - - * GNUmakefile.list.am: Add missing files. - -2012-04-16 Sheriff Bot - - Unreviewed, rolling out r114309. - http://trac.webkit.org/changeset/114309 - https://bugs.webkit.org/show_bug.cgi?id=84097 - - it broke everything (Requested by olliej on #webkit). - - * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def: - * bytecode/CodeBlock.h: - * dfg/DFGOperations.cpp: - * interpreter/Interpreter.cpp: - (JSC::Interpreter::getStackTrace): - (JSC::Interpreter::throwException): - * interpreter/Interpreter.h: - (Interpreter): - * jit/JITStubs.cpp: - (JSC::DEFINE_STUB_FUNCTION): - * jsc.cpp: - (functionJSCStack): - * llint/LLIntSlowPaths.cpp: - (JSC::LLInt::handleHostCall): - * parser/Parser.h: - (JSC::::parse): - * runtime/Error.cpp: - (JSC::addErrorInfo): - (JSC::throwError): - * runtime/Error.h: - (JSC): - -2012-04-16 Oliver Hunt - - Exception stack traces aren't complete when the exception starts in native code - https://bugs.webkit.org/show_bug.cgi?id=84073 - - Reviewed by Gavin Barraclough. - - Refactored building the stack trace to so that we can construct - it earlier, and don't rely on any prior work performed in the - exception handling machinery. Also updated LLInt and the DFG to - completely initialise the callframes of host function calls. - - * bytecode/CodeBlock.h: - (JSC::CodeBlock::codeOriginIndexForReturn): - (CodeBlock): - * dfg/DFGOperations.cpp: - * interpreter/Interpreter.cpp: - (JSC::Interpreter::getStackTrace): - (JSC::Interpreter::addStackTraceIfNecessary): - (JSC): - (JSC::Interpreter::throwException): - * interpreter/Interpreter.h: - (Interpreter): - * jit/JITStubs.cpp: - (JSC::DEFINE_STUB_FUNCTION): - * jsc.cpp: - (functionJSCStack): - * llint/LLIntSlowPaths.cpp: - (JSC::LLInt::handleHostCall): - * parser/Parser.h: - (JSC::::parse): - * runtime/Error.cpp: - (JSC::addErrorInfo): - (JSC::throwError): - * runtime/Error.h: - (JSC): - -2012-04-16 Oliver Hunt - - Fix COMMANDLINE_TYPEDARRAYS build - https://bugs.webkit.org/show_bug.cgi?id=84051 - - Reviewed by Gavin Barraclough. - - Update for new putByIndex API and wtf changes. - - * JSCTypedArrayStubs.h: - (JSC): - -2012-04-16 Mark Hahnenberg - - GC in the middle of JSObject::allocatePropertyStorage can cause badness - https://bugs.webkit.org/show_bug.cgi?id=83839 - - Reviewed by Geoffrey Garen. - - * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def: - * jit/JITStubs.cpp: Making changes to use the new return value of growPropertyStorage. - (JSC::DEFINE_STUB_FUNCTION): - * runtime/JSObject.cpp: - (JSC::JSObject::growPropertyStorage): Renamed to more accurately reflect that we're - growing our already-existing PropertyStorage. - * runtime/JSObject.h: - (JSObject): - (JSC::JSObject::setPropertyStorage): "Atomically" sets the new property storage - and the new structure so that we can be sure a GC never occurs when our Structure - info is out of sync with our PropertyStorage. - (JSC): - (JSC::JSObject::putDirectInternal): Moved the check to see if we should - allocate more backing store before the actual property insertion into - the structure. - (JSC::JSObject::putDirectWithoutTransition): Ditto. - (JSC::JSObject::transitionTo): Ditto. - * runtime/Structure.cpp: - (JSC::Structure::suggestedNewPropertyStorageSize): Added to keep the resize policy - for property backing stores contained within the Structure class. - (JSC): - * runtime/Structure.h: - (JSC::Structure::shouldGrowPropertyStorage): Lets clients know if another insertion - into the Structure would require resizing the property backing store so that they can - preallocate the required storage. - (Structure): - -2012-04-13 Sheriff Bot - - Unreviewed, rolling out r114185. - http://trac.webkit.org/changeset/114185 - https://bugs.webkit.org/show_bug.cgi?id=83967 - - Broke a bunch of JavaScript related tests (Requested by - andersca on #webkit). - - * runtime/ArrayPrototype.cpp: - (JSC::arrayProtoFuncToString): - (JSC::arrayProtoFuncToLocaleString): - * runtime/CommonIdentifiers.h: - * tests/mozilla/ecma/Array/15.4.4.2.js: - (getTestCases): - -2012-04-13 Gavin Barraclough - - Don't rely on fixed offsets to patch calls - https://bugs.webkit.org/show_bug.cgi?id=83966 - - Rubber stamped by Oliver Hunt. - - These aren't being used anywhere! - - * jit/JIT.h: - * jit/JITCall.cpp: - (JSC::JIT::compileOpCall): - * jit/JITCall32_64.cpp: - (JSC::JIT::compileOpCall): - -2012-04-13 Hojong Han - - Array.prototype.toString and Array.prototype.toLocaleString should be generic - https://bugs.webkit.org/show_bug.cgi?id=81588 - - Reviewed by Gavin Barraclough. - - * runtime/ArrayPrototype.cpp: - (JSC::arrayProtoFuncToString): - (JSC::arrayProtoFuncToLocaleString): - * runtime/CommonIdentifiers.h: - * tests/mozilla/ecma/Array/15.4.4.2.js: - (getTestCases.array.item.new.TestCase): - (getTestCases): - -2012-04-13 Gavin Barraclough - - Don't rely on fixed offsets to patch method checks - https://bugs.webkit.org/show_bug.cgi?id=83958 - - Reviewed by Oliver Hunt. - - * bytecode/StructureStubInfo.h: - - Add fields for the method check info. - * jit/JIT.cpp: - (JSC::PropertyStubCompilationInfo::copyToStubInfo): - - Store the offsets on the stub info, instead of asserting. - * jit/JIT.h: - - Delete all the method check related offsets. - * jit/JITPropertyAccess.cpp: - (JSC::JIT::patchMethodCallProto): - - Use the offset from the stubInfo. - * jit/JITStubs.cpp: - (JSC::DEFINE_STUB_FUNCTION): - - Pass the stubInfo to patchMethodCallProto. - -2012-04-13 Gavin Barraclough - - Don't rely on fixed offsets to patch get_by_id/put_by_id - https://bugs.webkit.org/show_bug.cgi?id=83924 - - Reviewed by Oliver Hunt. - - Store offsets in the structure stub info, as we do for the DFG JIT. - - * assembler/AbstractMacroAssembler.h: - (JSC::AbstractMacroAssembler::differenceBetween): - - this method can be static (now used from PropertyStubCompilationInfo::copyToStubInfo, will be removed soon!) - * bytecode/StructureStubInfo.h: - - added new fields for baseline JIT offsets. - * jit/JIT.cpp: - (JSC::PropertyStubCompilationInfo::copyToStubInfo): - - moved out from JIT::privateCompile. - (JSC::JIT::privateCompile): - - moved out code to PropertyStubCompilationInfo::copyToStubInfo. - * jit/JIT.h: - (PropertyStubCompilationInfo): - - added helper functions to initializae PropertyStubCompilationInfo, state to store more offset info. - - removed many offsets. - * jit/JITPropertyAccess.cpp: - (JSC::JIT::emit_op_method_check): - (JSC::JIT::compileGetByIdHotPath): - (JSC::JIT::compileGetByIdSlowCase): - (JSC::JIT::emit_op_put_by_id): - (JSC::JIT::emitSlow_op_put_by_id): - (JSC::JIT::patchGetByIdSelf): - (JSC::JIT::patchPutByIdReplace): - (JSC::JIT::privateCompilePatchGetArrayLength): - (JSC::JIT::privateCompileGetByIdProto): - (JSC::JIT::privateCompileGetByIdSelfList): - (JSC::JIT::privateCompileGetByIdProtoList): - (JSC::JIT::privateCompileGetByIdChainList): - (JSC::JIT::privateCompileGetByIdChain): - (JSC::JIT::resetPatchGetById): - (JSC::JIT::resetPatchPutById): - - changed code generation to use new interface to store info on PropertyStubCompilationInfo. - - changed repatch functions to read offsets from the structure stub info. - * jit/JITPropertyAccess32_64.cpp: - (JSC::JIT::emit_op_method_check): - (JSC::JIT::compileGetByIdHotPath): - (JSC::JIT::compileGetByIdSlowCase): - (JSC::JIT::emit_op_put_by_id): - (JSC::JIT::emitSlow_op_put_by_id): - (JSC::JIT::patchGetByIdSelf): - (JSC::JIT::patchPutByIdReplace): - (JSC::JIT::privateCompilePatchGetArrayLength): - (JSC::JIT::privateCompileGetByIdProto): - (JSC::JIT::privateCompileGetByIdSelfList): - (JSC::JIT::privateCompileGetByIdProtoList): - (JSC::JIT::privateCompileGetByIdChainList): - (JSC::JIT::privateCompileGetByIdChain): - (JSC::JIT::resetPatchGetById): - (JSC::JIT::resetPatchPutById): - - changed code generation to use new interface to store info on PropertyStubCompilationInfo. - - changed repatch functions to read offsets from the structure stub info. - -2012-04-13 Rob Buis - - Fix some compiler warnings (miscellaneous) - https://bugs.webkit.org/show_bug.cgi?id=80790 - - Reviewed by Antonio Gomes. - - Fix signed/unsigned comparison warning. - - * parser/Lexer.cpp: - (JSC::::record16): - -2012-04-12 Benjamin Poulain - - Improve replaceUsingStringSearch() for case of a single character searchValue - https://bugs.webkit.org/show_bug.cgi?id=83738 - - Reviewed by Geoffrey Garen. - - This patch improves replaceUsingStringSearch() with the following: - -Add a special case for single character search, taking advantage of the faster WTF::find(). - -Inline replaceUsingStringSearch(). - -Use StringImpl::create() instead of UString::substringSharingImpl() since we know we are in the bounds - by definition. - - This gives less than 1% improvement for the multicharacter replace. - The single character search show about 9% improvement. - - * runtime/StringPrototype.cpp: - (JSC::replaceUsingStringSearch): - -2012-04-12 Michael Saboff - - StructureStubInfo::reset() causes leaks of PolymorphicAccessStructureList and ExecutableMemoryHandle objects - https://bugs.webkit.org/show_bug.cgi?id=83823 - - Reviewed by Gavin Barraclough. - - Put the clearing of the accessType to after the call to deref() so that - deref() can use the accessType to delete referenced objects as needed. - - * bytecode/StructureStubInfo.h: - (JSC::StructureStubInfo::reset): - -2012-04-12 Balazs Kelemen - - [Qt] Fix WebKit1 build with V8 - https://bugs.webkit.org/show_bug.cgi?id=83322 - - Reviewed by Adam Barth. - - * yarr/yarr.pri: - -2012-04-12 Gavin Barraclough - - https://bugs.webkit.org/show_bug.cgi?id=83821 - Move dfg repatching properties of structure stub info into a union - - Reviewed by Oliver Hunt. - - We want to be able to have similar properties for the baseline JIT, some restructuring to prepare for this. - - * bytecode/StructureStubInfo.h: - (StructureStubInfo): - * dfg/DFGJITCompiler.cpp: - (JSC::DFG::JITCompiler::link): - * dfg/DFGRepatch.cpp: - (JSC::DFG::dfgRepatchByIdSelfAccess): - (JSC::DFG::linkRestoreScratch): - (JSC::DFG::generateProtoChainAccessStub): - (JSC::DFG::tryCacheGetByID): - (JSC::DFG::tryBuildGetByIDList): - (JSC::DFG::tryBuildGetByIDProtoList): - (JSC::DFG::emitPutReplaceStub): - (JSC::DFG::emitPutTransitionStub): - (JSC::DFG::tryCachePutByID): - (JSC::DFG::tryBuildPutByIdList): - (JSC::DFG::dfgResetGetByID): - (JSC::DFG::dfgResetPutByID): - -2012-04-12 Gavin Barraclough - - Delete a bunch of unused, copy & pasted values in JIT.h - https://bugs.webkit.org/show_bug.cgi?id=83822 - - Reviewed by Oliver Hunt. - - The only architecture we support the JSVALUE64 JIT on is x86-64, all the patch offsets for other architectures are just nonsense. - - * jit/JIT.h: - (JIT): - -2012-04-12 Csaba Osztrogonác - - [Qt][ARM] Buildfix after r113934. - - Reviewed by Zoltan Herczeg. - - * assembler/MacroAssemblerARM.h: - (JSC::MacroAssemblerARM::compare8): - (MacroAssemblerARM): - -2012-04-11 Filip Pizlo - - It is incorrect to short-circuit Branch(LogicalNot(@a)) if boolean speculations on @a may fail - https://bugs.webkit.org/show_bug.cgi?id=83744 - - - Reviewed by Andy Estes. - - This does the conservative thing: it only short-circuits Branch(LogicalNot(@a)) if @a is a node - that is statically known to return boolean results. - - * dfg/DFGFixupPhase.cpp: - (JSC::DFG::FixupPhase::fixupNode): - -2012-04-11 Michael Saboff - - Invalid Union Reference in StructureStubInfo.{cpp.h} - https://bugs.webkit.org/show_bug.cgi?id=83735 - - Reviewed by Filip Pizlo. - - Changed the references to u.getByIdProtoList and u.getByIdSelfList - to be consistent. - - * bytecode/StructureStubInfo.cpp: - (JSC::StructureStubInfo::visitWeakReferences): - * bytecode/StructureStubInfo.h: - (JSC::StructureStubInfo::initGetByIdSelfList): - -2012-04-11 Filip Pizlo - - Unreviewed attempting to make Qt's eccentric hardware work. - - * assembler/MacroAssemblerARM.h: - (JSC::MacroAssemblerARM::compare8): - (MacroAssemblerARM): - * assembler/MacroAssemblerMIPS.h: - (JSC::MacroAssemblerMIPS::compare8): - (MacroAssemblerMIPS): - * assembler/MacroAssemblerSH4.h: - (JSC::MacroAssemblerSH4::compare8): - (MacroAssemblerSH4): - -2012-04-11 Filip Pizlo - - op_is_foo should be optimized - https://bugs.webkit.org/show_bug.cgi?id=83666 - - Reviewed by Gavin Barraclough. - - This implements inlining of op_is_undefined, op_is_string, op_is_number, - and op_is_boolean in LLInt and the baseline JIT. op_is_object and - op_is_function are not inlined because they are quite a bit more complex. - - This also implements all of the op_is_foo opcodes in the DFG, but it does - not do any type profiling based optimizations, yet. - - * assembler/MacroAssemblerARMv7.h: - (JSC::MacroAssemblerARMv7::compare8): - (MacroAssemblerARMv7): - * assembler/MacroAssemblerX86Common.h: - (JSC::MacroAssemblerX86Common::compare8): - (MacroAssemblerX86Common): - * assembler/MacroAssemblerX86_64.h: - (MacroAssemblerX86_64): - (JSC::MacroAssemblerX86_64::testPtr): - * dfg/DFGAbstractState.cpp: - (JSC::DFG::AbstractState::execute): - * dfg/DFGByteCodeParser.cpp: - (JSC::DFG::ByteCodeParser::parseBlock): - * dfg/DFGCCallHelpers.h: - (JSC::DFG::CCallHelpers::setupArguments): - (CCallHelpers): - * dfg/DFGCSEPhase.cpp: - (JSC::DFG::CSEPhase::performNodeCSE): - * dfg/DFGCapabilities.h: - (JSC::DFG::canCompileOpcode): - * dfg/DFGNodeType.h: - (DFG): - * dfg/DFGOperations.cpp: - * dfg/DFGOperations.h: - * dfg/DFGPredictionPropagationPhase.cpp: - (JSC::DFG::PredictionPropagationPhase::propagate): - * dfg/DFGSpeculativeJIT.h: - (JSC::DFG::SpeculativeJIT::callOperation): - (JSC::DFG::SpeculativeJIT::appendCallSetResult): - * dfg/DFGSpeculativeJIT32_64.cpp: - (JSC::DFG::SpeculativeJIT::compile): - * dfg/DFGSpeculativeJIT64.cpp: - (JSC::DFG::SpeculativeJIT::compile): - * jit/JIT.cpp: - (JSC::JIT::privateCompileMainPass): - * jit/JIT.h: - (JIT): - * jit/JITOpcodes.cpp: - (JSC::JIT::emit_op_is_undefined): - (JSC): - (JSC::JIT::emit_op_is_boolean): - (JSC::JIT::emit_op_is_number): - (JSC::JIT::emit_op_is_string): - * jit/JITOpcodes32_64.cpp: - (JSC::JIT::emit_op_is_undefined): - (JSC): - (JSC::JIT::emit_op_is_boolean): - (JSC::JIT::emit_op_is_number): - (JSC::JIT::emit_op_is_string): - * jit/JITStubs.cpp: - (JSC): - * llint/LLIntSlowPaths.cpp: - (LLInt): - * llint/LLIntSlowPaths.h: - (LLInt): - * llint/LowLevelInterpreter.asm: - * llint/LowLevelInterpreter32_64.asm: - * llint/LowLevelInterpreter64.asm: - * offlineasm/armv7.rb: - * offlineasm/instructions.rb: - * offlineasm/x86.rb: - -2012-04-11 Filip Pizlo - - If you use an IntegerOperand and want to return it with integerResult, you need to - zero extend to get rid of the box - https://bugs.webkit.org/show_bug.cgi?id=83734 - - - Reviewed by Oliver Hunt. - - * dfg/DFGSpeculativeJIT64.cpp: - (JSC::DFG::SpeculativeJIT::fillInteger): - (JSC::DFG::SpeculativeJIT::nonSpeculativeValueToInt32): - -2012-04-11 Filip Pizlo - - SpeculativeJIT::fillStorage() should work with all the states that a cell may be in - https://bugs.webkit.org/show_bug.cgi?id=83722 - - Reviewed by Gavin Barraclough. - - It's now possible to do StorageOperand on a cell, in the case that the storage is - inline. But this means that fillStorage() must be able to handle all of the states - that a cell might be in. Previously it didn't. - - With this change, it now does handle all of the states, and moreover, it does so - by preserving the DataFormat of cells and performing all of the cell speculations - that should be performed if you're using a cell as storage. But if you use this on - something that is known to be storage already then it behaves as it did before. - - * dfg/DFGSpeculativeJIT.cpp: - (JSC::DFG::SpeculativeJIT::fillStorage): - -2012-04-11 Filip Pizlo - - Global variable predictions should not be coalesced unnecessarily - https://bugs.webkit.org/show_bug.cgi?id=83678 - - Reviewed by Geoff Garen. - - Removed the PredictionTracker and everyone who used it. Converted GetGlobalVar - to have a heapPrediction like a civilized DFG opcode ought to. - - No performance effect. - - * GNUmakefile.list.am: - * JavaScriptCore.xcodeproj/project.pbxproj: - * bytecode/CodeBlock.h: - * bytecode/PredictionTracker.h: Removed. - * dfg/DFGByteCodeParser.cpp: - (JSC::DFG::ByteCodeParser::parseBlock): - * dfg/DFGGenerationInfo.h: - * dfg/DFGGraph.cpp: - (JSC::DFG::Graph::dump): - * dfg/DFGGraph.h: - (Graph): - * dfg/DFGNode.h: - (JSC::DFG::Node::hasHeapPrediction): - * dfg/DFGPredictionPropagationPhase.cpp: - (JSC::DFG::PredictionPropagationPhase::propagate): - -2012-04-11 Benjamin Poulain - - Optimize String.split() for 1 character separator - https://bugs.webkit.org/show_bug.cgi?id=83546 - - Reviewed by Gavin Barraclough. - - This patch adds a serie of optimizations to make stringProtoFuncSplit() faster in the common case - where the separator is a single character. - - The two main gains are: - -Use of the find() function with a single character instead of doing a full string matching. - -Use of WTF::find() instead of UString::find() to avoid branching on is8Bit() and have a simpler inline - function. - - The code is also changed to avoid making unnecessary allocations by converting the 8bit string to 16bits. - - This makes String.split() faster by about 13% in that particular case. - - * runtime/StringPrototype.cpp: - (JSC): - (JSC::splitStringByOneCharacterImpl): - (JSC::stringProtoFuncSplit): - -2012-04-10 Carlos Garcia Campos - - Unreviewed. Fix make distcheck issues. - - * GNUmakefile.list.am: Ad missing files. - -2012-04-10 Mark Rowe - - Attempt to fix the Windows build. - - * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def: - -2012-04-10 Patrick Gansterer - - Cleanup wtf/Platform.h and config.h files - https://bugs.webkit.org/show_bug.cgi?id=83431 - - Reviewed by Eric Seidel. - - The ENABLE() and USE() macros take care about the case when the flag - isn't defined. So there is no need to define anything with 0. - - Also move duplicated code from the config.h files to Platform.h and - merge a few preprocessor commands to make the file more readable. - - * config.h: - -2012-04-10 Filip Pizlo - - DFG should flush SetLocals to arguments - https://bugs.webkit.org/show_bug.cgi?id=83554 - - Reviewed by Gavin Barraclough. - - This is necessary to match baseline JIT argument capture behavior. - - But to make this work right we need to have a story for arguments into - which we store values of different formats. This patch introduces the - notion of an ArgumentPosition - i.e. an argument in a particular inline - call frame - and forces unification of all data pertinent to selecting - the argument's data format. - - Also fixed an amusing bug in the handling of OSR on SetLocals if there - was any insertion/deletion of nodes in the basic block. This is benign - for now but won't be eventually since the DFG is getting smarter. So - better fix it now. - - Also fixed an amusing bug in the handling of OSR on SetLocals if they - are immediately followed by a Flush. I think this bug might have always - been there but now it'll happen more commonly, and it's covered by the - run-javascriptcore-tests. - - * JavaScriptCore.xcodeproj/project.pbxproj: - * dfg/DFGAbstractState.cpp: - (JSC::DFG::AbstractState::execute): - * dfg/DFGArgumentPosition.h: Added. - (DFG): - (ArgumentPosition): - (JSC::DFG::ArgumentPosition::ArgumentPosition): - (JSC::DFG::ArgumentPosition::addVariable): - (JSC::DFG::ArgumentPosition::mergeArgumentAwareness): - * dfg/DFGByteCodeParser.cpp: - (JSC::DFG::ByteCodeParser::setLocal): - (JSC::DFG::ByteCodeParser::setArgument): - (InlineStackEntry): - (JSC::DFG::ByteCodeParser::InlineStackEntry::InlineStackEntry): - * dfg/DFGDoubleFormatState.h: Added. - (DFG): - (JSC::DFG::mergeDoubleFormatStates): - (JSC::DFG::mergeDoubleFormatState): - (JSC::DFG::doubleFormatStateToString): - * dfg/DFGGraph.h: - (Graph): - * dfg/DFGPredictionPropagationPhase.cpp: - (JSC::DFG::PredictionPropagationPhase::doRoundOfDoubleVoting): - * dfg/DFGSpeculativeJIT32_64.cpp: - (JSC::DFG::SpeculativeJIT::compile): - * dfg/DFGSpeculativeJIT64.cpp: - (JSC::DFG::SpeculativeJIT::compile): - * dfg/DFGVariableAccessData.h: - (JSC::DFG::VariableAccessData::VariableAccessData): - (JSC::DFG::VariableAccessData::predict): - (JSC::DFG::VariableAccessData::argumentAwarePrediction): - (VariableAccessData): - (JSC::DFG::VariableAccessData::mergeArgumentAwarePrediction): - (JSC::DFG::VariableAccessData::doubleFormatState): - (JSC::DFG::VariableAccessData::shouldUseDoubleFormat): - (JSC::DFG::VariableAccessData::tallyVotesForShouldUseDoubleFormat): - (JSC::DFG::VariableAccessData::mergeDoubleFormatState): - (JSC::DFG::VariableAccessData::makePredictionForDoubleFormat): - -2012-04-10 Adam Klein - - Remove unused NonNullPassRefPtr from WTF - https://bugs.webkit.org/show_bug.cgi?id=82389 - - Reviewed by Kentaro Hara. - - * JavaScriptCore.order: Remove nonexistent symbols referencing NonNullPassRefPtr. - -2012-04-10 Darin Adler - - Remove unused data member from Lexer class - https://bugs.webkit.org/show_bug.cgi?id=83429 - - Reviewed by Kentaro Hara. - - I noticed that m_delimited was "write-only", so I deleted it. - - * parser/Lexer.cpp: - (JSC::Lexer::setCode): Removed code to set m_delimited. - (JSC::Lexer::parseIdentifier): Ditto. - (JSC::Lexer::parseIdentifierSlowCase): Ditto. - (JSC::Lexer::lex): Ditto. - * parser/Lexer.h: Deleted m_delimited. - -2012-04-10 Patrick Gansterer - - [CMake] Enable USE_FOLDERS property - https://bugs.webkit.org/show_bug.cgi?id=83571 - - Reviewed by Daniel Bates. - - Setting the FOLDER property on targets gives more structure - to the generated Visual Studio solutions. - This does not affect other CMake generators. - - * CMakeLists.txt: - * shell/CMakeLists.txt: - -2012-04-10 Filip Pizlo - - It should be possible to see why a code block was not compiled by the DFG - https://bugs.webkit.org/show_bug.cgi?id=83553 - - Reviewed by Geoff Garen. - - If DFG_ENABLE(DEBUG_VERBOSE) and a code block is rejected, then print the - opcode that caused the rejection. - - * dfg/DFGCapabilities.cpp: - (JSC::DFG::debugFail): - (DFG): - (JSC::DFG::canHandleOpcodes): - -2012-04-09 Gavin Barraclough - - If a callback constructor returns a C++ null, throw a type error. - https://bugs.webkit.org/show_bug.cgi?id=83537 - - Rubber Stamped by Geoff Garen. - - * API/JSCallbackConstructor.cpp: - (JSC::constructJSCallback): - - If a callback constructor returns a C++ null, throw a type error. - * API/tests/testapi.c: - (Base_returnHardNull): - * API/tests/testapi.js: - - Add a test case for callback constructors that return a C++ null. - -2012-04-09 Gavin Barraclough - - If a callback function returns a C++ null, convert to undefined. - https://bugs.webkit.org/show_bug.cgi?id=83534 - - Reviewed by Geoff Garen. - - * API/JSCallbackFunction.cpp: - - If a callback function returns a C++ null, convert to undefined. - (JSC::JSCallbackFunction::call): - * API/tests/testapi.c: - (Base_returnHardNull): - * API/tests/testapi.js: - - Add a test case for callback functions that return a C++ null. - -2012-04-09 Filip Pizlo - - Classic interpreter's GC hooks shouldn't attempt to scan instructions for code blocks that - are currently being generated - https://bugs.webkit.org/show_bug.cgi?id=83531 - - - Reviewed by Gavin Barraclough. - - * bytecode/CodeBlock.cpp: - (JSC::CodeBlock::stronglyVisitStrongReferences): - -2012-04-09 Filip Pizlo - - Unreviewed, modernize and clean up uses of ARM assembly mnemonics in inline asm blocks. - - * dfg/DFGOperations.cpp: - (JSC): - * offlineasm/armv7.rb: - -2012-04-09 Patrick Gansterer - - Remove HAVE_STDINT_H - https://bugs.webkit.org/show_bug.cgi?id=83434 - - Reviewed by Kentaro Hara. - - HAVE_STDINT_H is defined with 1 all the time and we us stdint.h without HAVE(STDINT_H) already. - - * config.h: - -2012-04-08 Filip Pizlo - - DFG should not load the property storage if it is inline. - https://bugs.webkit.org/show_bug.cgi?id=83455 - - Reviewed by Gavin Barraclough. - - We had previously decided to have all property storage accesses go through - the property storage pointer even if they don't "really" have to, because - we were thinking this would help GC barriers somehow. Well, we never ended - up doing anything with that. Hence, doing these wasted loads of the - property storage pointer when the storage is inline is just a waste of CPU - cycles. - - This change makes the DFG's inline property accesses (GetByOffset and - PutByOffset) go directly to the inline property storage if the structure(s) - tell us that it's OK. - - This looks like an across-the-board 1% win. - - * bytecode/StructureSet.h: - (JSC): - (JSC::StructureSet::allAreUsingInlinePropertyStorage): - (StructureSet): - * dfg/DFGByteCodeParser.cpp: - (JSC::DFG::ByteCodeParser::parseBlock): - * dfg/DFGSpeculativeJIT.cpp: - (JSC::DFG::SpeculativeJIT::fillStorage): - -2012-04-08 Filip Pizlo - - Command-line jsc's exception handling should be rationalized - https://bugs.webkit.org/show_bug.cgi?id=83437 - - Reviewed by Dan Bernstein. - - - If an exception is thrown during run() execution, it is now propagated, - so that it will terminate program execution unless it is caught. - - - If program execution terminates with an exception, the exception is now - always printed. - - - When printing the exception, the backtrace is now also printed if one is - available. It will only not be available if you use something akin to my - favorite line of code, 'throw "error"', since primitives don't have - properties and hence we cannot attach a "stack" property to them. - - * jsc.cpp: - (functionRun): - (runWithScripts): - -2012-04-04 Filip Pizlo - - Forced OSR exits should lead to recompilation based on count, not rate - https://bugs.webkit.org/show_bug.cgi?id=83247 - - - Reviewed by Geoff Garen. - - Track which OSR exits happen because of inadequate coverage. Count them - separately. If the count reaches a threshold, immediately trigger - reoptimization. - - This is in contrast to the recompilation trigger for all other OSR exits. - Normally recomp is triggered when the exit rate exceeds a certain ratio. - - Looks like a slight V8 speedup (sub 1%). - - * bytecode/CodeBlock.cpp: - (JSC::CodeBlock::CodeBlock): - * bytecode/CodeBlock.h: - (JSC::CodeBlock::forcedOSRExitCounter): - (JSC::CodeBlock::addressOfForcedOSRExitCounter): - (JSC::CodeBlock::offsetOfForcedOSRExitCounter): - (JSC::CodeBlock::shouldReoptimizeNow): - (JSC::CodeBlock::shouldReoptimizeFromLoopNow): - (CodeBlock): - * bytecode/DFGExitProfile.h: - (JSC::DFG::exitKindToString): - * dfg/DFGOSRExitCompiler.cpp: - (JSC::DFG::OSRExitCompiler::handleExitCounts): - (DFG): - * dfg/DFGOSRExitCompiler.h: - (OSRExitCompiler): - * dfg/DFGOSRExitCompiler32_64.cpp: - (JSC::DFG::OSRExitCompiler::compileExit): - * dfg/DFGOSRExitCompiler64.cpp: - (JSC::DFG::OSRExitCompiler::compileExit): - * dfg/DFGOperations.cpp: - * dfg/DFGSpeculativeJIT.cpp: - (JSC::DFG::SpeculativeJIT::compileGetIndexedPropertyStorage): - * dfg/DFGSpeculativeJIT32_64.cpp: - (JSC::DFG::SpeculativeJIT::compile): - * dfg/DFGSpeculativeJIT64.cpp: - (JSC::DFG::SpeculativeJIT::compile): - * runtime/Options.cpp: - (Options): - (JSC::Options::initializeOptions): - * runtime/Options.h: - (Options): - -2012-04-06 Benjamin Poulain - - Do not abuse ArrayStorage's m_length for testing array consistency - https://bugs.webkit.org/show_bug.cgi?id=83403 - - Reviewed by Geoffrey Garen. - - Array creation from a list of values is a 3 steps process: - -JSArray::tryCreateUninitialized() - -JSArray::initializeIndex() for each values - -JSArray::completeInitialization() - - Previously, the attribute m_length was not set to the final size - JSArray::tryCreateUninitialized() because it was used to test the array - consistency JSArray::initializeIndex(). - - This caused the initialization loop using JSArray::initializeIndex() maintain - two counters: - -index of the loop - -storage->m_length++ - - This patch fixes this by using the index of the initialization loop for the indinces of - JSArray::initializeIndex(). For testing consistency, the variable m_initializationIndex - is introduced if CHECK_ARRAY_CONSISTENCY is defined. - - The patch also fixes minor unrelated build issue when CHECK_ARRAY_CONSISTENCY is defined. - - This improves the performance of JSArray creation from literals by 8%. - - * runtime/JSArray.cpp: - (JSC::JSArray::tryFinishCreationUninitialized): - (JSC::JSArray::checkConsistency): - * runtime/JSArray.h: - (ArrayStorage): - (JSC::JSArray::initializeIndex): - (JSC::JSArray::completeInitialization): - -2012-04-06 Jon Lee - - Build fix for Windows bots. - - * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def: export missing symbol. - -2012-04-06 Geoffrey Garen - - Renamed - - WeakHeap => WeakSet - HandleHeap => HandleSet - - Reviewed by Sam Weinig. - - These sets do have internal allocators, but it's confusing to call them - heaps because they're sub-objects of an object called "heap". - - * heap/HandleHeap.cpp: Removed. - * heap/HandleHeap.h: Removed. - * heap/HandleSet.cpp: Copied from JavaScriptCore/heap/HandleHeap.cpp. - * heap/WeakHeap.cpp: Removed. - * heap/WeakHeap.h: Removed. - * heap/WeakSet.cpp: Copied from JavaScriptCore/heap/WeakHeap.cpp. - * heap/WeakSet.h: Copied from JavaScriptCore/heap/WeakHeap.h. - - Plus global rename using grep. - -2012-04-06 Dan Bernstein - - HiDPI: Have canvas use a hidpi backing store, but downsample upon access - - Reviewed by Sam Weinig. - - * Configurations/FeatureDefines.xcconfig: Added ENABLE_HIGH_DPI_CANVAS. - -2012-04-06 Rob Buis - - Fix cast-align warnings in JSC - https://bugs.webkit.org/show_bug.cgi?id=80790 - - Reviewed by George Staikos. - - * assembler/ARMv7Assembler.h: - (JSC::ARMv7Assembler::computeJumpType): - (JSC::ARMv7Assembler::link): - * assembler/LinkBuffer.h: - (JSC::LinkBuffer::linkCode): - * heap/MarkStack.cpp: - (JSC::SlotVisitor::copyAndAppend): - * runtime/JSArray.cpp: - (JSC::JSArray::visitChildren): - * wtf/RefCountedArray.h: - (WTF::RefCountedArray::Header::payload): - -2012-04-06 Darin Adler - - Streamline strtod and fix some related problems - https://bugs.webkit.org/show_bug.cgi?id=82857 - - Reviewed by Geoffrey Garen. - - * parser/Lexer.cpp: - (JSC::Lexer<>::lex): Use parseDouble. Since we have already scanned the number - and we know it has only correct characters, leading spaces, trailing junk, and - trailing spaces are not a possibility. No need to add a trailing null character. - - * runtime/JSGlobalObjectFunctions.cpp: - (JSC::parseInt): Changed overflow based 10 case to use parseDouble. No need - to allow trailing junk since the code above already allows only numeric digits - in the string. This code path is used only in unusual cases, so it's not - optimized for 8-bit strings, but easily could be. - (JSC::jsStrDecimalLiteral): Removed the allow trailing junk argument to this - function template because all the callers are OK with trailing junk. Use the - parseDouble function. No need to copy the data into a byte buffer, because - parseDouble handles that. - (JSC::toDouble): Got rid of the DisallowTrailingJunk argument to the - jsStrDecimalLiteral function template. That's OK because this function - already checks for trailing junk and handles it appropriately. The old code - path was doing it twice. - (JSC::parseFloat): Got rid of the AllowTrailingJunk argument to the - jsStrDecimalLiteral function template; the template allows junk unconditionally. - - * runtime/LiteralParser.cpp: - (JSC::::Lexer::lexNumber): Use parseDouble. Since we have already scanned the number - and we know it has only correct characters, leading spaces, trailing junk, and - trailing spaces are not a possibility. No need to add a trailing null character. - No need to copy the data into a byte buffer, because parseDouble handles that. - We could optimize the UChar case even more because we know all the characters - are ASCII, but not doing that at this time. - - * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def: Updated. - -2012-04-06 Patrick Gansterer - - Remove JSC dependency from GregorianDateTime - https://bugs.webkit.org/show_bug.cgi?id=83290 - - Reviewed by Geoffrey Garen. - - This allows us to move it to WTF later. - - * runtime/DateConstructor.cpp: - (JSC::callDate): - * runtime/JSDateMath.h: - -2012-04-05 Michael Saboff - - Call Heap::discardAllCompiledCode() in low memory situations - https://bugs.webkit.org/show_bug.cgi?id=83335 - - Reviewed by Geoffrey Garen. - - Restructured Heap::discardAllCompiledCode() to do the "Is JavaScriptRunning?" - check inline so that it can be called directly without this check. - - * heap/Heap.cpp: - (JSC::Heap::discardAllCompiledCode): - (JSC::Heap::collectAllGarbage): - * heap/Heap.h: Added JS_EXPORT_PRIVATE to discardAllCompiledCode() so it can be - called from WebCore. - (Heap): - * runtime/JSGlobalData.h: Removed unused " void discardAllCompiledCode()" declaration. - (JSGlobalData): - -2012-04-05 Benjamin Poulain - - Speed up the conversion from JSValue to String for bulk operations - https://bugs.webkit.org/show_bug.cgi?id=83243 - - Reviewed by Geoffrey Garen. - - When making operations on primitive types, we loose some time converting - values to JSString in order to extract the string. - - This patch speeds up some basic Array operations by avoiding the creation - of intermediary JSString when possible. - - For the cases where we need to convert a lot of JSValue in a tight loop, - an inline conversion is used. - - * runtime/ArrayPrototype.cpp: - (JSC::arrayProtoFuncToString): - (JSC::arrayProtoFuncToLocaleString): - (JSC::arrayProtoFuncJoin): - (JSC::arrayProtoFuncPush): - (JSC::arrayProtoFuncSort): - * runtime/CommonIdentifiers.h: - * runtime/JSArray.cpp: - (JSC::JSArray::sort): - * runtime/JSString.h: - (JSC::JSValue::toUString): - (JSC): - (JSC::inlineJSValueNotStringtoUString): - (JSC::JSValue::toUStringInline): - * runtime/JSValue.cpp: - (JSC::JSValue::toUStringSlowCase): - (JSC): - * runtime/JSValue.h: - (JSValue): - -2012-04-05 Benjamin Poulain - - Use QuickSort when sorting primitive values by string representation - https://bugs.webkit.org/show_bug.cgi?id=83312 - - Reviewed by Gavin Barraclough. - - When the value we are sorting are all primitive values, we do not need to - ensure a stable sort as two values with equal string representation are - indistinguishable from JavaScript. - - This gives about 16% performance increase when sorting primitive values. - - * runtime/JSArray.cpp: - (JSC::JSArray::sort): - -2012-04-05 Oliver Hunt - - SIGILL in JavaScriptCore on a Geode processor - https://bugs.webkit.org/show_bug.cgi?id=82496 - - Reviewed by Gavin Barraclough. - - Don't attempt to use the DFG when SSE2 is not available. - - * dfg/DFGCapabilities.cpp: - (JSC::DFG::canCompileOpcodes): - -2012-04-05 Oliver Hunt - - Fix 32-bit build. - - * API/APICast.h: - (toJS): - -2012-04-05 Oliver Hunt - - Replace static_cast with jsCast when casting JSCell subclasses in JSC - https://bugs.webkit.org/show_bug.cgi?id=83307 - - Reviewed by Gavin Barraclough. - - Replace all usage of static_cast with jsCast<> in JavaScriptCore. - This results in assertions when unsafe casts are performed, but simply leaves - a static_cast<> in release builds. - - * API/APICast.h: - (toJS): - * API/JSCallbackConstructor.cpp: - (JSC::constructJSCallback): - * API/JSCallbackFunction.cpp: - (JSC::JSCallbackFunction::call): - * API/JSCallbackObjectFunctions.h: - (JSC::::asCallbackObject): - (JSC::::finishCreation): - (JSC::::construct): - (JSC::::call): - * API/JSObjectRef.cpp: - (JSObjectGetPrivate): - (JSObjectSetPrivate): - (JSObjectGetPrivateProperty): - (JSObjectSetPrivateProperty): - (JSObjectDeletePrivateProperty): - * API/JSValueRef.cpp: - (JSValueIsObjectOfClass): - * API/JSWeakObjectMapRefPrivate.cpp: - * bytecompiler/BytecodeGenerator.cpp: - (JSC::BytecodeGenerator::resolve): - (JSC::BytecodeGenerator::resolveConstDecl): - * debugger/DebuggerActivation.cpp: - (JSC::DebuggerActivation::finishCreation): - * dfg/DFGOperations.cpp: - * interpreter/Interpreter.cpp: - (JSC::Interpreter::execute): - (JSC::Interpreter::privateExecute): - * jit/JITStubs.cpp: - (JSC::DEFINE_STUB_FUNCTION): - * runtime/Executable.h: - (JSC::isHostFunction): - * runtime/JSActivation.h: - (JSC::asActivation): - * runtime/JSArray.cpp: - (JSC::JSArray::defineOwnProperty): - * runtime/JSArray.h: - (JSC::asArray): - * runtime/JSBoundFunction.cpp: - (JSC::boundFunctionCall): - (JSC::boundFunctionConstruct): - * runtime/JSByteArray.h: - (JSC::asByteArray): - * runtime/JSCell.cpp: - (JSC::JSCell::toObject): - * runtime/JSCell.h: - (JSC::jsCast): - * runtime/JSGlobalObject.h: - (JSC::asGlobalObject): - * runtime/JSGlobalObjectFunctions.cpp: - (JSC::globalFuncEval): - * runtime/JSObject.cpp: - (JSC::JSObject::setPrototypeWithCycleCheck): - (JSC::JSObject::allowsAccessFrom): - (JSC::JSObject::toThisObject): - (JSC::JSObject::unwrappedObject): - * runtime/JSObject.h: - (JSC::asObject): - * runtime/JSPropertyNameIterator.h: - (JSC::Register::propertyNameIterator): - * runtime/JSString.h: - (JSC::asString): - (JSC::JSValue::toString): - * runtime/StringPrototype.cpp: - (JSC::stringProtoFuncSubstr): - -2012-04-05 Benjamin Poulain - - Make something faster than JSStringBuilder for joining an array of JSValue - https://bugs.webkit.org/show_bug.cgi?id=83180 - - Reviewed by Geoffrey Garen. - - This patch add the class JSStringJoiner optimized for join() operations. - - This class makes stricter constraints than JSStringBuilder in order avoid - memory allocations. - - In the best case, the class allocate memory only twice: - -Allocate an array to keep a list of UString to join. - -Allocate the final string. - - We also avoid the conversion from 8bits strings to 16bits strings since - they are costly and unlikly to help for subsequent calls. - - * CMakeLists.txt: - * GNUmakefile.list.am: - * JavaScriptCore.gypi: - * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj: - * JavaScriptCore.xcodeproj/project.pbxproj: - * Target.pri: - * runtime/ArrayPrototype.cpp: - (JSC::arrayProtoFuncToLocaleString): - (JSC::arrayProtoFuncJoin): - * runtime/JSStringJoiner.cpp: Added. - (JSC): - (JSC::appendStringToData): - (JSC::joinStrings): - (JSC::JSStringJoiner::build): - * runtime/JSStringJoiner.h: Added. - (JSC): - (JSStringJoiner): - (JSC::JSStringJoiner::JSStringJoiner): - (JSC::JSStringJoiner::append): - -2012-04-05 Gavin Barraclough - - https://bugs.webkit.org/show_bug.cgi?id=77293 - [Un]Reserve 'let' - - Rubber stamped by Oliver Hunt. - - Revert r106198. - This does break the web - e.g. https://bvi.bnc.ca/index/bnc/indexen.html - If we're going to reserve let, we're going to have to do so in a more - circumspect fashion. - - * parser/Keywords.table: - -2012-04-05 Michael Saboff - - Rolling out http://trac.webkit.org/changeset/113262. - Original code was fine. - - Rubber-stamped by Oliver Hunt. - - * assembler/MacroAssembler.h: - (JSC::MacroAssembler::additionBlindedConstant): - -2012-04-05 Patrick Gansterer - - [WinCE] Remove unnecessary function decleration - https://bugs.webkit.org/show_bug.cgi?id=83155 - - Reviewed by Kentaro Hara. - - * runtime/JSDateMath.cpp: - -2012-04-04 Patrick Gansterer - - Add WTF::getCurrentLocalTime() - https://bugs.webkit.org/show_bug.cgi?id=83164 - - Reviewed by Alexey Proskuryakov. - - Replace the calls to WTF::getLocalTime() with time(0) with the new function. - This allows us to use Win32 API on windows to get the same result in a next step. - - * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def: - * runtime/DateConstructor.cpp: - (JSC::callDate): - -2012-04-04 Oliver Hunt - - Parser fails to revert some state after parsing expression and object literals. - https://bugs.webkit.org/show_bug.cgi?id=83236 - - Reviewed by Gavin Barraclough. - - Reset left hand side counter after parsing the literals. - - * parser/Parser.cpp: - (JSC::::parseObjectLiteral): - (JSC::::parseStrictObjectLiteral): - (JSC::::parseArrayLiteral): - -2012-04-04 Filip Pizlo - - DFG InstanceOf should not uselessly speculate cell - https://bugs.webkit.org/show_bug.cgi?id=83234 - - Reviewed by Oliver Hunt. - - If InstanceOf is the only user of its child then don't speculate cell, since - the not-cell case is super easy to handle. - - * dfg/DFGSpeculativeJIT.cpp: - (JSC::DFG::SpeculativeJIT::compileInstanceOf): - -2012-04-04 Michael Saboff - - Fixed minor error: "& 3" should be "& 2". - - Rubber-stamped by Oliver Hunt. - - * assembler/MacroAssembler.h: - (JSC::MacroAssembler::additionBlindedConstant): - -2012-04-04 Michael Saboff - - Constant Blinding for add/sub immediate crashes in ArmV7 when dest is SP - https://bugs.webkit.org/show_bug.cgi?id=83191 - - Reviewed by Oliver Hunt. - - Make are that blinded constant pairs are similarly aligned to the - original immediate values so that instructions that expect that - alignment work correctly. One example is ARMv7 add/sub imm to SP. - - * assembler/ARMv7Assembler.h: - (JSC::ARMv7Assembler::add): Added ASSERT that immediate is word aligned. - (JSC::ARMv7Assembler::sub): Added ASSERT that immediate is word aligned. - (JSC::ARMv7Assembler::sub_S): Added ASSERT that immediate is word aligned. - * assembler/MacroAssembler.h: - (JSC::MacroAssembler::additionBlindedConstant): - -2012-04-04 Filip Pizlo - - DFG should short-circuit Branch(LogicalNot(...)) - https://bugs.webkit.org/show_bug.cgi?id=83181 - - Reviewed by Geoff Garen. - - Slight (sub 1%) speed-up on V8. - - * dfg/DFGFixupPhase.cpp: - (JSC::DFG::FixupPhase::fixupNode): - -2012-04-04 Geoffrey Garen - - [Qt] REGRESSION(r113141): All tests assert on 32 bit debug mode - https://bugs.webkit.org/show_bug.cgi?id=83139 - - Reviewed by Sam Weinig. - - * heap/PassWeak.h: - (JSC::::get): 32-bit JSValue treats JSValue(nullptr).asCell() as an error, - so work around that here. (Long-term, we should make 32-bit and 64-bit - agree on the right behavior.) - -2012-04-03 Geoffrey Garen - - Updated JSC expected test results to reflect recent bug fixes . - - Reviewed by Sam Weinig. - - * tests/mozilla/expected.html: - -2012-03-29 Geoffrey Garen - - First step toward incremental Weak finalization - https://bugs.webkit.org/show_bug.cgi?id=82670 - - Reviewed by Filip Pizlo. - - This patch implements a Weak heap that is compatible with incremental - finalization, while making as few behavior changes as possible. The behavior - changes it makes are: - - (*) Weak's raw JSValue no longer reverts to JSValue() automatically -- - instead, a separate flag indicates that the JSValue is no longer valid. - (This is required so that the JSValue can be preserved for later finalization.) - Objects dealing with WeakImpls directly must change to check the flag. - - (*) Weak is no longer a subclass of Handle. - - (*) DOM GC performance is different -- 9% faster in the geometric mean, - but 15% slower in one specific case: - gc-dom1.html: 6% faster - gc-dom2.html: 23% faster - gc-dom3.html: 17% faster - gc-dom4.html: 15% *slower* - - The key features of this new heap are: - - (*) Each block knows its own state, independent of any other blocks. - - (*) Each block caches its own sweep result. - - (*) The heap visits dead Weaks at the end of GC. (It doesn't - mark them yet, since that would be a behavior change.) - - * API/JSCallbackObject.cpp: - (JSC::JSCallbackObjectData::finalize): - * API/JSCallbackObjectFunctions.h: - (JSC::::init): Updated to use the new WeakHeap API. - - * CMakeLists.txt: - * GNUmakefile.list.am: - * JavaScriptCore.gypi: - * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj: - * JavaScriptCore.xcodeproj/project.pbxproj: - * Target.pri: Paid the build system tax since I added some new files. - - * heap/Handle.h: Made WeakBlock a friend and exposed slot() as public, - so we can keep passing a Handle to finalizers, to avoid more surface - area change in this patch. A follow-up patch should change the type we - pass to finalizers. - - * heap/HandleHeap.cpp: - (JSC): - (JSC::HandleHeap::writeBarrier): - (JSC::HandleHeap::isLiveNode): - * heap/HandleHeap.h: - (JSC): - (HandleHeap): - (Node): - (JSC::HandleHeap::Node::Node): Removed all code related to Weak, since - we have a separate WeakHeap now. - - * heap/Heap.cpp: - (JSC::Heap::Heap): Removed m_extraCost because extra cost is accounted - for through our watermark now. Removed m_waterMark because it was unused. - - (JSC::Heap::destroy): Updated for addition of WeakHeap. - - (JSC::Heap::reportExtraMemoryCostSlowCase): Changed from using its own - variable to participating in the watermark strategy. I wanted to standardize - WeakHeap and all other Heap clients on this strategy, to make sure it's - accurate. - - (JSC::Heap::markRoots): Updated for addition of WeakHeap. Added WeakHeap - dead visit pass, as explained above. - - (JSC::Heap::collect): - (JSC::Heap::resetAllocators): Updated for addition of WeakHeap. - - (JSC::Heap::addFinalizer): - (JSC::Heap::FinalizerOwner::finalize): Updated for new Weak API. - - * heap/Heap.h: - (JSC::Heap::weakHeap): - (Heap): - (JSC::Heap::addToWaterMark): Added a way to participate in the watermarking - strategy, since this is the best way for WeakHeap to report its memory - cost. (I plan to update this in a follow-up patch to make it more accurate, - but for now it is not less accurate than it used to be.) - - * heap/MarkedSpace.cpp: - (JSC::MarkedSpace::MarkedSpace): - (JSC::MarkedSpace::resetAllocators): - * heap/MarkedSpace.h: - (MarkedSpace): - (JSC::MarkedSpace::addToWaterMark): - (JSC::MarkedSpace::didConsumeFreeList): Removed m_nurseryWaterMark because - it was unused, and I didn't want to update WeakHeap to keep an usused - variable working. Added API for above. - - * heap/PassWeak.h: - (JSC): - (WeakImplAccessor): - (PassWeak): - (JSC::::operator): - (JSC::::get): - (JSC::::was): - (JSC::::PassWeak): - (JSC::::~PassWeak): - (JSC::UnspecifiedBoolType): - (JSC::::leakImpl): - (JSC::adoptWeak): - * heap/Strong.h: - (JSC::Strong::operator!): - (Strong): - (JSC::Strong::operator UnspecifiedBoolType*): - (JSC::Strong::get): - * heap/Weak.h: - (Weak): - (JSC::::Weak): - (JSC): - (JSC::::isHashTableDeletedValue): - (JSC::::~Weak): - (JSC::::swap): - (JSC::=): - (JSC::::operator): - (JSC::UnspecifiedBoolType): - (JSC::::release): - (JSC::::clear): - (JSC::::hashTableDeletedValue): Lots of code changes here, but they boil - down to two things: - - (*) Allocate WeakImpls from the WeakHeap instead of Handles from the HandleHeap. - - (*) Explicitly check WeakImpl::state() for non-liveness before returning - a value (explained above). - - These files implement the new Weak heap behavior described above: - - * heap/WeakBlock.cpp: Added. - * heap/WeakBlock.h: Added. - * heap/WeakHandleOwner.cpp: Added. - * heap/WeakHandleOwner.h: Added. - * heap/WeakHeap.cpp: Added. - * heap/WeakHeap.h: Added. - * heap/WeakImpl.h: Added. - - One interesting difference from the old heap is that we don't allow - clients to overwrite a WeakImpl after allocating it, and we don't recycle - WeakImpls prior to garbage collection. This is required for lazy finalization, - but it will also help us esablish a useful invariant in the future: allocating - a WeakImpl will be a binding contract to run a finalizer at some point in the - future, even if the WeakImpl is later deallocated. - - * jit/JITStubs.cpp: - (JSC::JITThunks::hostFunctionStub): Check the Weak for ! instead of - its JSValue, since that's our API contract now, and the JSValue might - be stale. - - * runtime/JSCell.h: - (JSC::jsCast): Allow casting NULL pointers because it's useful and harmless. - - * runtime/Structure.cpp: - (JSC::StructureTransitionTable::add): I can't remember why I did this. - - * runtime/StructureTransitionTable.h: - * runtime/WeakGCMap.h: I had to update these classes because they allocate - and deallocate weak pointers manually. They should probably stop doing that. - -2012-04-03 Keishi Hattori - - Disable ENABLE_DATALIST for now - https://bugs.webkit.org/show_bug.cgi?id=82871 - - Reviewed by Kent Tamura. - - * Configurations/FeatureDefines.xcconfig: Disabled ENABLE_DATALIST. - -2012-04-02 Filip Pizlo - - jsr/sret should be removed - https://bugs.webkit.org/show_bug.cgi?id=82986 - - - Reviewed by Sam Weinig and Geoff Garen. - - Replaces jsr/sret with finally block inlining. - - * bytecode/CodeBlock.cpp: - (JSC::CodeBlock::dump): - * bytecode/Opcode.h: - (JSC): - (JSC::padOpcodeName): - * bytecompiler/BytecodeGenerator.cpp: - (JSC::BytecodeGenerator::pushFinallyContext): - (JSC::BytecodeGenerator::emitComplexJumpScopes): - (JSC): - * bytecompiler/BytecodeGenerator.h: - (FinallyContext): - (BytecodeGenerator): - * bytecompiler/NodesCodegen.cpp: - (JSC::TryNode::emitBytecode): - * interpreter/Interpreter.cpp: - (JSC::Interpreter::privateExecute): - * jit/JIT.cpp: - (JSC::JIT::privateCompileMainPass): - (JSC::JIT::privateCompile): - * jit/JIT.h: - (JIT): - * jit/JITOpcodes.cpp: - (JSC): - * jit/JITOpcodes32_64.cpp: - (JSC): - * llint/LowLevelInterpreter32_64.asm: - * llint/LowLevelInterpreter64.asm: - -2012-04-03 Mark Rowe - - Make it possible to install the JavaScriptCore test tools. - - Part of . - - Reviewed by Filip Pizlo. - - * JavaScriptCore.xcodeproj/project.pbxproj: Introduce an aggregate target named - Test Tools that builds testapi, minidom and testRegExp. Switch All from depending on - those targets individually to depending on the new aggregate target. - -2012-04-03 Filip Pizlo - - Offlineasm ARM backend has a very convoluted way of saying it wants to emit a - three-operand multiply instruction - https://bugs.webkit.org/show_bug.cgi?id=83100 - - Reviewed by Darin Adler. - - Changed the "muli"/"mulp" case to call emitArmV7() since that helper method was - already smart enough to do the Right Thing for multiply. - - * offlineasm/armv7.rb: - -2012-04-03 Filip Pizlo - - Offlineasm ARM backend uses the wrong mnemonic for multiply - https://bugs.webkit.org/show_bug.cgi?id=83098 - - - Reviewed by Gavin Barraclough. - - Use "mul" instead of "muls" since we're passing three operands, not two. - - * offlineasm/armv7.rb: - -2012-04-03 Gavin Barraclough - - Linux crashes during boot - https://bugs.webkit.org/show_bug.cgi?id=83096 - - Reviewed by Filip Pizlo. - - The bug here is that we add empty JSValues to the sparse map, and then set them - - but a GC may occur before doing so (due to a call to reportExtraMemory cost). - We may want to consider making it safe to mark empty JSValues, but the simple & - contained fix to this specific bug is to just initialize these values to - something other than JSValue(). - - * runtime/JSArray.cpp: - (JSC::SparseArrayValueMap::add): - - Initialize sparse map entries. - -2012-04-02 Oliver Hunt - - Incorrect liveness information when inlining - https://bugs.webkit.org/show_bug.cgi?id=82985 - - Reviewed by Filip Pizlo. - - Don't remap register numbers that have already been remapped. - - * dfg/DFGByteCodeParser.cpp: - (JSC::DFG::ByteCodeParser::handleInlining): - -2012-04-02 Filip Pizlo - - Activation tear-off neglects to copy the callee and scope chain, leading to crashes if we - try to create an arguments object from the activation - https://bugs.webkit.org/show_bug.cgi?id=82947 - - - Reviewed by Gavin Barraclough. - - We now copy the entire call frame header just to be sure. This is mostly perf-netural, - except for a 3.7% slow-down in V8/earley. - - * runtime/JSActivation.cpp: - (JSC::JSActivation::visitChildren): - * runtime/JSActivation.h: - (JSC::JSActivation::tearOff): - -2012-04-02 Daniel Bates - - Remove Source/JavaScriptCore/wtf and its empty subdirectories - - Rubber-stamped by Eric Seidel. - - Following the move of WTF from Source/JavaScriptCore/wtf to Source/WTF - (https://bugs.webkit.org/show_bug.cgi?id=75673), remove directory - Source/JavaScriptCore/wtf and its empty subdirectories. - - * wtf: Removed. - * wtf/android: Removed. - * wtf/blackberry: Removed. - * wtf/chromium: Removed. - * wtf/dtoa: Removed. - * wtf/efl: Removed. - * wtf/gobject: Removed. - * wtf/gtk: Removed. - * wtf/mac: Removed. - * wtf/qt: Removed. - * wtf/qt/compat: Removed. - * wtf/tests: Removed. - * wtf/text: Removed. - * wtf/threads: Removed. - * wtf/threads/win: Removed. - * wtf/unicode: Removed. - * wtf/unicode/glib: Removed. - * wtf/unicode/icu: Removed. - * wtf/unicode/qt4: Removed. - * wtf/unicode/wince: Removed. - * wtf/url: Removed. - * wtf/url/api: Removed. - * wtf/url/src: Removed. - * wtf/win: Removed. - * wtf/wince: Removed. - * wtf/wx: Removed. - -2012-04-02 Carlos Garcia Campos - - Unreviewed. Fix make distcheck issues. - - * GNUmakefile.list.am: Add missing file. - -2012-04-01 Darin Adler - - Fix incorrect path for libWTF.a in Mac project file. - - * JavaScriptCore.xcodeproj/project.pbxproj: Removed the "../Release" prefix that - would cause other configurations to try to link with the "Release" version of - libWTF.a instead of the correct version. - -2012-03-29 Filip Pizlo - - DFG should optimize a==b for a being an object and b being either an object or - null/undefined, and vice versa - https://bugs.webkit.org/show_bug.cgi?id=82656 - - Reviewed by Oliver Hunt. - - Implements additional object equality optimizations for the case that one - operand is predicted to be an easily speculated object (like FinalObject or - Array) and the other is either an easily speculated object or Other, i.e. - Null or Undefined. - - 2-5% speed-up on V8/raytrace, leading to a sub-1% progression on V8. - - I also took the opportunity to clean up the control flow for the speculation - decisions in the various Compare opcodes. And to fix a build bug in SamplingTool. - And to remove debug cruft I stupidly committed in my last patch. - - * bytecode/SamplingTool.h: - (SamplingRegion): - * dfg/DFGAbstractState.cpp: - (JSC::DFG::AbstractState::execute): - * dfg/DFGOperations.cpp: - * dfg/DFGSpeculativeJIT.cpp: - (JSC::DFG::SpeculativeJIT::compilePeepHoleBranch): - (JSC::DFG::SpeculativeJIT::compare): - * dfg/DFGSpeculativeJIT.h: - (SpeculativeJIT): - * dfg/DFGSpeculativeJIT32_64.cpp: - (JSC::DFG::SpeculativeJIT::nonSpeculativePeepholeBranch): - (JSC::DFG::SpeculativeJIT::compileObjectToObjectOrOtherEquality): - (DFG): - (JSC::DFG::SpeculativeJIT::compilePeepHoleObjectToObjectOrOtherEquality): - * dfg/DFGSpeculativeJIT64.cpp: - (JSC::DFG::SpeculativeJIT::nonSpeculativePeepholeBranch): - (JSC::DFG::SpeculativeJIT::compileObjectToObjectOrOtherEquality): - (DFG): - (JSC::DFG::SpeculativeJIT::compilePeepHoleObjectToObjectOrOtherEquality): - -2012-03-30 David Barr - - Split up top-level .gitignore and .gitattributes - https://bugs.webkit.org/show_bug.cgi?id=82687 - - Reviewed by Tor Arne Vestbø. - - * JavaScriptCore.gyp/.gitignore: Added. - -2012-03-30 Steve Falkenburg - - Windows (make based) build fix. - - * JavaScriptCore.vcproj/JavaScriptCore.make: Copy WTF header files into a place where JavaScriptCore build can see them. - -2012-03-30 Keishi Hattori - - Change ENABLE_INPUT_COLOR to ENABLE_INPUT_TYPE_COLOR and enable it for chromium - https://bugs.webkit.org/show_bug.cgi?id=80972 - - Reviewed by Kent Tamura. - - * Configurations/FeatureDefines.xcconfig: - -2012-03-29 Mark Hahnenberg - - Refactor recompileAllJSFunctions() to be less expensive - https://bugs.webkit.org/show_bug.cgi?id=80330 - - Reviewed by Filip Pizlo. - - This change is performance neutral on the JS benchmarks we track. It's mostly to improve page - load performance, which currently does at least a couple full GCs per navigation. - - * heap/Heap.cpp: - (JSC::Heap::discardAllCompiledCode): Rename recompileAllJSFunctions to discardAllCompiledCode - because the function doesn't actually recompile anything (and never did); it simply throws code - away for it to be recompiled later if we determine we should do so. - (JSC): - (JSC::Heap::collectAllGarbage): - (JSC::Heap::addFunctionExecutable): Adds a newly created FunctionExecutable to the Heap's list. - (JSC::Heap::removeFunctionExecutable): Removes the specified FunctionExecutable from the Heap's list. - * heap/Heap.h: - (JSC): - (Heap): - * runtime/Executable.cpp: Added next and prev fields to FunctionExecutables so that they can - be used in DoublyLinkedLists. - (JSC::FunctionExecutable::FunctionExecutable): - (JSC::FunctionExecutable::finalize): Removes the FunctionExecutable from the Heap's list. - * runtime/Executable.h: - (FunctionExecutable): - (JSC::FunctionExecutable::create): Adds the FunctionExecutable to the Heap's list. - * runtime/JSGlobalData.cpp: Remove recompileAllJSFunctions, as it's the Heap's job to own and manage - the list of FunctionExecutables. - * runtime/JSGlobalData.h: - (JSGlobalData): - * runtime/JSGlobalObject.cpp: - (JSC::DynamicGlobalObjectScope::DynamicGlobalObjectScope): Use the new discardAllCompiledCode. - -2012-03-29 Filip Pizlo - - Unreviewed build fix for non-x86 platforms. - - * dfg/DFGSpeculativeJIT.cpp: - (JSC::DFG::SpeculativeJIT::compileSoftModulo): - * dfg/DFGSpeculativeJIT.h: - (JSC::DFG::SpeculativeJIT::callOperation): - * jit/JITArithmetic32_64.cpp: - (JSC::JIT::emitSlow_op_mod): - -2012-03-29 Gavin Barraclough - - Windows build fix p2. - - * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def: - -2012-03-29 Gavin Barraclough - - Windows build fix p1. - - * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def: - -2012-03-29 Gavin Barraclough - - Template the Yarr::Interpreter on the character type - https://bugs.webkit.org/show_bug.cgi?id=82637 - - Reviewed by Sam Weinig. - - We should be able to call to the interpreter after having already checked the character type, - without having to re-package the character pointer back up into a string! - - * runtime/RegExp.cpp: - (JSC::RegExp::match): - (JSC::RegExp::matchCompareWithInterpreter): - - Don't pass length. - * yarr/Yarr.h: - - moved function declarations to YarrInterpreter.h. - * yarr/YarrInterpreter.cpp: - (Yarr): - (Interpreter): - (JSC::Yarr::Interpreter::InputStream::InputStream): - (InputStream): - (JSC::Yarr::Interpreter::Interpreter): - (JSC::Yarr::interpret): - - templated Interpreter class on CharType. - * yarr/YarrInterpreter.h: - (Yarr): - - added function declarations. - -2012-03-29 David Kilzer - - Don't use a flattened framework path when building on OS X - - Reviewed by Mark Rowe. - - * Configurations/ToolExecutable.xcconfig: Use REAL_PLATFORM_NAME - to select different INSTALL_PATH values. - -2012-03-29 Kevin Ollivier - - [wx] Unreviewed build fix, add Win-specific sources - the wx port needs after WTF move. - - * wscript: - -2012-03-29 Andy Estes - - Remove an unused variable that breaks the build with newer versions of clang. - - Rubber stamped by Gavin Barraclough. - - * yarr/YarrJIT.cpp: - (JSC::Yarr::YarrGenerator::backtrackCharacterClassNonGreedy): - -2012-03-29 Caio Marcelo de Oliveira Filho - - HashMap<>::add should return a more descriptive object - https://bugs.webkit.org/show_bug.cgi?id=71063 - - Reviewed by Ryosuke Niwa. - - Update code to use AddResult instead of a pair. Note that since WeakGCMap wraps - the iterator type, there's a need for its own AddResult type -- instantiated from - HashTableAddResult template class. - - * API/JSCallbackObject.h: - (JSC::JSCallbackObjectData::JSPrivatePropertyMap::setPrivateProperty): - * API/JSClassRef.cpp: - (OpaqueJSClass::contextData): - * bytecompiler/BytecodeGenerator.cpp: - (JSC::BytecodeGenerator::addVar): - (JSC::BytecodeGenerator::addGlobalVar): - (JSC::BytecodeGenerator::addConstant): - (JSC::BytecodeGenerator::addConstantValue): - (JSC::BytecodeGenerator::emitLoad): - (JSC::BytecodeGenerator::addStringConstant): - (JSC::BytecodeGenerator::emitLazyNewFunction): - * bytecompiler/NodesCodegen.cpp: - (JSC::PropertyListNode::emitBytecode): - * debugger/Debugger.cpp: - * dfg/DFGAssemblyHelpers.cpp: - (JSC::DFG::AssemblyHelpers::decodedCodeMapFor): - * dfg/DFGByteCodeParser.cpp: - (JSC::DFG::ByteCodeParser::cellConstant): - (JSC::DFG::ByteCodeParser::InlineStackEntry::InlineStackEntry): - * jit/JITStubs.cpp: - (JSC::JITThunks::ctiStub): - (JSC::JITThunks::hostFunctionStub): - * parser/Parser.cpp: - (JSC::::parseStrictObjectLiteral): - * parser/Parser.h: - (JSC::Scope::declareParameter): - * runtime/Identifier.cpp: - (JSC::Identifier::add): - (JSC::Identifier::add8): - (JSC::Identifier::addSlowCase): - * runtime/Identifier.h: - (JSC::Identifier::add): - (JSC::IdentifierTable::add): - * runtime/JSArray.cpp: - (JSC::SparseArrayValueMap::add): - (JSC::SparseArrayValueMap::put): - (JSC::SparseArrayValueMap::putDirect): - (JSC::JSArray::enterDictionaryMode): - (JSC::JSArray::defineOwnNumericProperty): - * runtime/JSArray.h: - (SparseArrayValueMap): - * runtime/PropertyNameArray.cpp: - (JSC::PropertyNameArray::add): - * runtime/StringRecursionChecker.h: - (JSC::StringRecursionChecker::performCheck): - * runtime/Structure.cpp: - (JSC::StructureTransitionTable::add): - * runtime/WeakGCMap.h: - (WeakGCMap): - (JSC::WeakGCMap::add): - (JSC::WeakGCMap::set): - * tools/ProfileTreeNode.h: - (JSC::ProfileTreeNode::sampleChild): - -2012-03-29 Patrick Gansterer - - Build fix for !ENABLE(YARR_JIT) after r112454. - - * runtime/RegExp.cpp: - (JSC::RegExp::invalidateCode): - -2012-03-28 Filip Pizlo - - DFG object equality speculations should be simplified - https://bugs.webkit.org/show_bug.cgi?id=82557 - - Reviewed by Gavin Barraclough. - - * dfg/DFGNode.h: - (JSC::DFG::Node::shouldSpeculateFinalObject): - (JSC::DFG::Node::shouldSpeculateArray): - -2012-03-28 David Kilzer - - minidom configurations should be based on ToolExecutable.xcconfig - - - Reviewed by Mark Rowe. - - Note that this patch changes minidom from being installed in - /usr/local/bin to JavaScriptCore.framework/Resources. - - * Configurations/ToolExecutable.xcconfig: Add semi-colon. - * JavaScriptCore.xcodeproj/project.pbxproj: Base minidom - configurations on ToolExecutable.xcconfig. Remove redundant - PRODUCT_NAME and SKIP_INSTALL variables. - -2012-03-28 Gavin Barraclough - - Build fix - some compiles generating NORETURN related warnings. - - * yarr/YarrJIT.cpp: - (JSC::Yarr::YarrGenerator::setSubpatternStart): - (JSC::Yarr::YarrGenerator::setSubpatternEnd): - (JSC::Yarr::YarrGenerator::clearSubpatternStart): - -2012-03-28 Kevin Ollivier - - [wx] Unreviewed. Build fix, move WTF back into JSCore target - until issues with JSCore not linking in all WTF symbols are resolved. - - * wscript: - -2012-03-28 Gavin Barraclough - - Yarr: if we're not using the output array, don't populate it! - https://bugs.webkit.org/show_bug.cgi?id=82519 - - Reviewed by Sam Weinig. - - * runtime/RegExp.cpp: - (JSC): - - Missed review comment! - didn't fully remove RegExpRepresentation. - -2012-03-28 Gavin Barraclough - - Yarr: if we're not using the output array, don't populate it! - https://bugs.webkit.org/show_bug.cgi?id=82519 - - Reviewed by Sam Weinig. - - Add a new variant of the match method to RegExp that returns a MatchResult, - and modify YarrJIT to be able to compile code that doesn't use an output vector. - - This is a 3% progression on v8-regexp. - - * JavaScriptCore.xcodeproj/project.pbxproj: - - Moved MatchResult into its own header. - * assembler/AbstractMacroAssembler.h: - - Added missing include. - * runtime/MatchResult.h: Added. - (MatchResult::MatchResult): - (MatchResult): - (MatchResult::failed): - (MatchResult::operator bool): - (MatchResult::empty): - - Moved MatchResult into its own header. - * runtime/RegExp.cpp: - (JSC::RegExp::compile): - (JSC::RegExp::compileIfNecessary): - (JSC::RegExp::match): - - Changed due to execute & representation changes. - (JSC::RegExp::compileMatchOnly): - (JSC::RegExp::compileIfNecessaryMatchOnly): - - Added helper to compile MatchOnly code. - (JSC::RegExp::invalidateCode): - (JSC::RegExp::matchCompareWithInterpreter): - (JSC::RegExp::printTraceData): - - Changed due representation changes. - * runtime/RegExp.h: - (RegExp): - (JSC::RegExp::hasCode): - - Made YarrCodeBlock a member. - * runtime/RegExpConstructor.h: - (RegExpConstructor): - (JSC::RegExpConstructor::performMatch): - - Added no-ovector form. - * runtime/RegExpMatchesArray.cpp: - (JSC::RegExpMatchesArray::reifyAllProperties): - - Match now takes a reference to ovector, not a pointer. - * runtime/RegExpObject.h: - (JSC): - - Moved MatchResult into its own header. - * runtime/StringPrototype.cpp: - (JSC::stringProtoFuncSplit): - - Match now takes a reference to ovector, not a pointer. - * testRegExp.cpp: - (testOneRegExp): - - Match now takes a reference to ovector, not a pointer. - * yarr/YarrJIT.cpp: - (Yarr): - (YarrGenerator): - (JSC::Yarr::YarrGenerator::initCallFrame): - (JSC::Yarr::YarrGenerator::removeCallFrame): - (JSC::Yarr::YarrGenerator::setSubpatternStart): - (JSC::Yarr::YarrGenerator::setSubpatternEnd): - (JSC::Yarr::YarrGenerator::clearSubpatternStart): - (JSC::Yarr::YarrGenerator::setMatchStart): - (JSC::Yarr::YarrGenerator::getMatchStart): - - Added helper functions to intermediate access to output. - (JSC::Yarr::YarrGenerator::generateDotStarEnclosure): - (JSC::Yarr::YarrGenerator::generate): - (JSC::Yarr::YarrGenerator::backtrack): - (JSC::Yarr::YarrGenerator::generateEnter): - (JSC::Yarr::YarrGenerator::compile): - - Changed to use the new helpers, only generate subpatterns if IncludeSubpatterns. - (JSC::Yarr::jitCompile): - - Needs to template of MatchOnly or IncludeSubpatterns. - * yarr/YarrJIT.h: - (YarrCodeBlock): - (JSC::Yarr::YarrCodeBlock::set8BitCode): - (JSC::Yarr::YarrCodeBlock::set16BitCode): - (JSC::Yarr::YarrCodeBlock::has8BitCodeMatchOnly): - (JSC::Yarr::YarrCodeBlock::has16BitCodeMatchOnly): - (JSC::Yarr::YarrCodeBlock::set8BitCodeMatchOnly): - (JSC::Yarr::YarrCodeBlock::set16BitCodeMatchOnly): - (JSC::Yarr::YarrCodeBlock::execute): - (JSC::Yarr::YarrCodeBlock::clear): - - Added a second set of CodeRefs, so that we can compile RexExps with/without subpattern matching. - -2012-03-27 Filip Pizlo - - DFG OSR exit should not generate an exit for variables of inlinees if the - inlinees are not in scope - https://bugs.webkit.org/show_bug.cgi?id=82312 - - Reviewed by Oliver Hunt. - - * bytecode/CodeBlock.h: - (JSC::baselineCodeBlockForInlineCallFrame): - (JSC): - (JSC::baselineCodeBlockForOriginAndBaselineCodeBlock): - * dfg/DFGOSRExit.cpp: - (JSC::DFG::computeNumVariablesForCodeOrigin): - (DFG): - (JSC::DFG::OSRExit::OSRExit): - -2012-03-27 Matt Lilek - - Stop compiling Interpreter.cpp with -fno-var-tracking - https://bugs.webkit.org/show_bug.cgi?id=82299 - - Reviewed by Anders Carlsson. - - * JavaScriptCore.xcodeproj/project.pbxproj: - -2012-03-27 Pratik Solanki - - Compiler warning when JIT is not enabled - https://bugs.webkit.org/show_bug.cgi?id=82352 - - Reviewed by Filip Pizlo. - - * runtime/JSFunction.cpp: - (JSC::JSFunction::create): - -2012-03-26 Thouraya ANDOLSI - - Unaligned userspace access for SH4 platforms - https://bugs.webkit.org/show_bug.cgi?id=79104 - - Reviewed by Gavin Barraclough. - - * assembler/AbstractMacroAssembler.h: - (Jump): - (JSC::AbstractMacroAssembler::Jump::Jump): - (JSC::AbstractMacroAssembler::Jump::link): - * assembler/MacroAssemblerSH4.h: - (JSC::MacroAssemblerSH4::load16Unaligned): - (JSC::MacroAssemblerSH4::load32WithUnalignedHalfWords): - (JSC::MacroAssemblerSH4::branchDouble): - (JSC::MacroAssemblerSH4::branchTrue): - (JSC::MacroAssemblerSH4::branchFalse): - * assembler/SH4Assembler.h: - (JSC::SH4Assembler::extraInstrForBranch): - (SH4Assembler): - (JSC::SH4Assembler::bra): - (JSC::SH4Assembler::linkJump): - * jit/JIT.h: - (JIT): - * yarr/YarrJIT.cpp: - (JSC::Yarr::YarrGenerator::generatePatternCharacterOnce): - -2012-03-26 Ryosuke Niwa - - cssText should use shorthand notations - https://bugs.webkit.org/show_bug.cgi?id=81737 - - Reviewed by Enrica Casucci. - - Export symbols of BitVector on Windows. - - * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def: - -2012-03-26 Filip Pizlo - - DFG should assert that argument value recoveries can only be - AlreadyInRegisterFile or Constant - https://bugs.webkit.org/show_bug.cgi?id=82249 - - Reviewed by Michael Saboff. - - Made the assertions that the DFG makes for argument value recoveries match - what Arguments expects. - - * bytecode/ValueRecovery.h: - (JSC::ValueRecovery::isConstant): - (ValueRecovery): - (JSC::ValueRecovery::isAlreadyInRegisterFile): - * dfg/DFGSpeculativeJIT.cpp: - (JSC::DFG::SpeculativeJIT::compile): - -2012-03-26 Dan Bernstein - - Tried to fix the Windows build. - - * yarr/YarrPattern.cpp: - (JSC::Yarr::CharacterClassConstructor::putRange): - -2012-03-26 Gavin Barraclough - - Unreviewed - speculative Windows build fix. - - * yarr/YarrCanonicalizeUCS2.h: - (JSC::Yarr::getCanonicalPair): - -2012-03-26 Dan Bernstein - - Fixed builds with assertions disabled. - - * yarr/YarrCanonicalizeUCS2.h: - (JSC::Yarr::areCanonicallyEquivalent): - -2012-03-26 Gavin Barraclough - - Unreviewed - errk! - accidentally the whole pbxproj. - - * JavaScriptCore.xcodeproj/project.pbxproj: - -2012-03-25 Gavin Barraclough - - Greek sigma is handled wrong in case independent regexp. - https://bugs.webkit.org/show_bug.cgi?id=82063 - - Reviewed by Oliver Hunt. - - The bug here is that we assume that any given codepoint has at most one additional value it - should match under a case insensitive match, and that the pair of codepoints that match (if - a codepoint does not only match itself) can be determined by calling toUpper/toLower on the - given codepoint). Life is not that simple. - - Instead, pre-calculate a set of tables mapping from a UCS2 codepoint to the set of characters - it may match, under the ES5.1 case-insensitive matching rules. Since unicode is fairly regular - we can pack this table quite nicely, and get it down to 364 entries. This means we can use a - simple binary search to find an entry in typically eight compares. - - * CMakeLists.txt: - * GNUmakefile.list.am: - * JavaScriptCore.gypi: - * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj: - * JavaScriptCore.xcodeproj/project.pbxproj: - * yarr/yarr.pri: - - Added new files to build systems. - * yarr/YarrCanonicalizeUCS2.cpp: Added. - - New - autogenerated, UCS2 canonicalized comparison tables. - * yarr/YarrCanonicalizeUCS2.h: Added. - (JSC::Yarr::rangeInfoFor): - - Look up the canonicalization info for a UCS2 character. - (JSC::Yarr::getCanonicalPair): - - For a UCS2 character with a single equivalent value, look it up. - (JSC::Yarr::isCanonicallyUnique): - - Returns true if no other UCS2 code points are canonically equal. - (JSC::Yarr::areCanonicallyEquivalent): - - Compare two values, under canonicalization rules. - * yarr/YarrCanonicalizeUCS2.js: Added. - - script used to generate YarrCanonicalizeUCS2.cpp. - * yarr/YarrInterpreter.cpp: - (JSC::Yarr::Interpreter::tryConsumeBackReference): - - Use isCanonicallyUnique, rather than Unicode toUpper/toLower. - * yarr/YarrJIT.cpp: - (JSC::Yarr::YarrGenerator::jumpIfCharNotEquals): - (JSC::Yarr::YarrGenerator::generatePatternCharacterOnce): - (JSC::Yarr::YarrGenerator::generatePatternCharacterFixed): - - Use isCanonicallyUnique, rather than Unicode toUpper/toLower. - * yarr/YarrPattern.cpp: - (JSC::Yarr::CharacterClassConstructor::putChar): - - Updated to determine canonical equivalents correctly. - (JSC::Yarr::CharacterClassConstructor::putUnicodeIgnoreCase): - - Added, used to put a non-ascii, non-unique character in a case-insensitive match. - (JSC::Yarr::CharacterClassConstructor::putRange): - - Updated to determine canonical equivalents correctly. - (JSC::Yarr::YarrPatternConstructor::atomPatternCharacter): - - Changed to call putUnicodeIgnoreCase, instead of putChar, avoid a double lookup of rangeInfo. - -2012-03-26 Kevin Ollivier - - [wx] Unreviewed build fix. Add the build outputs dir to the list of build dirs, - so we make sure it finds the API headers on all platforms. - - * wscript: - -2012-03-26 Patrick Gansterer - - Build fix for WinCE after r112039. - - * interpreter/Register.h: - (Register): Removed inline keyword from decleration since - there is an ALWAYS_INLINE at the definition anyway. - -2012-03-26 Carlos Garcia Campos - - Unreviewed. Fix make distcheck. - - * GNUmakefile.list.am: Add missing files. - -2012-03-25 Kevin Ollivier - - [wx] Unreviewed build fix. Move WTF to its own static lib build. - - * wscript: - -2012-03-25 Filip Pizlo - - DFG int-to-double conversion should be revealed to CSE - https://bugs.webkit.org/show_bug.cgi?id=82135 - - Reviewed by Oliver Hunt. - - This introduces the notion of an Int32ToDouble node, which is injected - into the graph anytime we know that we have a double use of a node that - was predicted integer. The Int32ToDouble simplifies double speculation - on integers by skipping the path that would unbox doubles, if we know - that the value is already proven to be an integer. It allows integer to - double conversions to be subjected to common subexpression elimination - (CSE) by allowing the CSE phase to see where these conversions are - occurring. Finally, it allows us to see when a constant is being used - as both a double and an integer. This is a bit odd, since it means that - sometimes a double use of a constant will not refer directly to the - constant. This should not cause problems, for now, but it may require - some canonizalization in the future if we want to support strength - reductions of double operations based on constants. - - To allow injection of nodes into the graph, this change introduces the - DFG::InsertionSet, which is a way of lazily inserting elements into a - list. This allows the FixupPhase to remain O(N) despite performing - multiple injections in a single basic block. Without the InsertionSet, - each injection would require performing an insertion into a vector, - which is O(N), leading to O(N^2) performance overall. With the - InsertionSet, each injection simply records what insertion would have - been performed, and all insertions are performed at once (via - InsertionSet::execute) after processing of a basic block is completed. - - * JavaScriptCore.xcodeproj/project.pbxproj: - * bytecode/PredictedType.h: - (JSC::isActionableIntMutableArrayPrediction): - (JSC): - (JSC::isActionableFloatMutableArrayPrediction): - (JSC::isActionableTypedMutableArrayPrediction): - (JSC::isActionableMutableArrayPrediction): - * dfg/DFGAbstractState.cpp: - (JSC::DFG::AbstractState::execute): - * dfg/DFGCSEPhase.cpp: - (JSC::DFG::CSEPhase::performNodeCSE): - * dfg/DFGCommon.h: - (JSC::DFG::useKindToString): - (DFG): - * dfg/DFGFixupPhase.cpp: - (JSC::DFG::FixupPhase::run): - (JSC::DFG::FixupPhase::fixupBlock): - (FixupPhase): - (JSC::DFG::FixupPhase::fixupNode): - (JSC::DFG::FixupPhase::fixDoubleEdge): - * dfg/DFGGraph.cpp: - (JSC::DFG::Graph::dump): - * dfg/DFGInsertionSet.h: Added. - (DFG): - (Insertion): - (JSC::DFG::Insertion::Insertion): - (JSC::DFG::Insertion::index): - (JSC::DFG::Insertion::element): - (InsertionSet): - (JSC::DFG::InsertionSet::InsertionSet): - (JSC::DFG::InsertionSet::append): - (JSC::DFG::InsertionSet::execute): - * dfg/DFGNodeType.h: - (DFG): - * dfg/DFGPredictionPropagationPhase.cpp: - (JSC::DFG::PredictionPropagationPhase::propagate): - * dfg/DFGSpeculativeJIT.cpp: - (JSC::DFG::SpeculativeJIT::computeValueRecoveryFor): - (JSC::DFG::SpeculativeJIT::compileValueToInt32): - (JSC::DFG::SpeculativeJIT::compileInt32ToDouble): - (DFG): - * dfg/DFGSpeculativeJIT.h: - (SpeculativeJIT): - (JSC::DFG::IntegerOperand::IntegerOperand): - (JSC::DFG::DoubleOperand::DoubleOperand): - (JSC::DFG::JSValueOperand::JSValueOperand): - (JSC::DFG::StorageOperand::StorageOperand): - (JSC::DFG::SpeculateIntegerOperand::SpeculateIntegerOperand): - (JSC::DFG::SpeculateStrictInt32Operand::SpeculateStrictInt32Operand): - (JSC::DFG::SpeculateDoubleOperand::SpeculateDoubleOperand): - (JSC::DFG::SpeculateCellOperand::SpeculateCellOperand): - (JSC::DFG::SpeculateBooleanOperand::SpeculateBooleanOperand): - * dfg/DFGSpeculativeJIT32_64.cpp: - (JSC::DFG::SpeculativeJIT::compile): - * dfg/DFGSpeculativeJIT64.cpp: - (JSC::DFG::SpeculativeJIT::compile): - -2012-03-25 Filip Pizlo - - DFGOperands should be moved out of the DFG and into bytecode - https://bugs.webkit.org/show_bug.cgi?id=82151 - - Reviewed by Dan Bernstein. - - * GNUmakefile.list.am: - * JavaScriptCore.xcodeproj/project.pbxproj: - * bytecode/Operands.h: Copied from Source/JavaScriptCore/dfg/DFGOperands.h. - * dfg/DFGBasicBlock.h: - * dfg/DFGNode.h: - * dfg/DFGOSREntry.h: - * dfg/DFGOSRExit.h: - * dfg/DFGOperands.h: Removed. - * dfg/DFGVariableAccessData.h: - -2012-03-24 Filip Pizlo - - DFG 64-bit Branch implementation should not be creating a JSValueOperand that - it isn't going to use - https://bugs.webkit.org/show_bug.cgi?id=82136 - - Reviewed by Geoff Garen. - - * dfg/DFGSpeculativeJIT64.cpp: - (JSC::DFG::SpeculativeJIT::emitBranch): - -2012-03-24 Kevin Ollivier - - [wx] Unreviewed. Fix the build after WTF move. - - * wscript: - -2012-03-23 Filip Pizlo - - DFG double voting may be overzealous in the case of variables that end up - being used as integers - https://bugs.webkit.org/show_bug.cgi?id=82008 - - Reviewed by Oliver Hunt. - - Cleaned up propagation, making the intent more explicit in most places. - Back-propagate NodeUsedAsInt for cases where a node was used in a context - that is known to strongly prefer integers. - - * dfg/DFGByteCodeParser.cpp: - (JSC::DFG::ByteCodeParser::handleCall): - (JSC::DFG::ByteCodeParser::parseBlock): - * dfg/DFGGraph.cpp: - (JSC::DFG::Graph::dumpCodeOrigin): - (JSC::DFG::Graph::dump): - * dfg/DFGGraph.h: - (Graph): - * dfg/DFGNodeFlags.cpp: - (JSC::DFG::nodeFlagsAsString): - * dfg/DFGNodeFlags.h: - (DFG): - * dfg/DFGPredictionPropagationPhase.cpp: - (JSC::DFG::PredictionPropagationPhase::run): - (JSC::DFG::PredictionPropagationPhase::propagate): - (PredictionPropagationPhase): - (JSC::DFG::PredictionPropagationPhase::mergeDefaultFlags): - (JSC::DFG::PredictionPropagationPhase::vote): - (JSC::DFG::PredictionPropagationPhase::doRoundOfDoubleVoting): - (JSC::DFG::PredictionPropagationPhase::fixupNode): - * dfg/DFGVariableAccessData.h: - (JSC::DFG::VariableAccessData::shouldUseDoubleFormatAccordingToVote): - -2012-03-24 Filip Pizlo - - DFG::Node::shouldNotSpeculateInteger() should be eliminated - https://bugs.webkit.org/show_bug.cgi?id=82123 - - Reviewed by Geoff Garen. - - * dfg/DFGAbstractState.cpp: - (JSC::DFG::AbstractState::execute): - * dfg/DFGNode.h: - (Node): - * dfg/DFGSpeculativeJIT.cpp: - (JSC::DFG::SpeculativeJIT::compilePutByValForByteArray): - (JSC::DFG::SpeculativeJIT::compilePutByValForIntTypedArray): - -2012-03-24 Yong Li - - Increase getByIdSlowCase ConstantSpace/InstructionSpace for CPU(ARM_TRADITIONAL) - https://bugs.webkit.org/show_bug.cgi?id=81521 - - Increase sequenceGetByIdSlowCaseConstantSpace and sequenceGetByIdSlowCaseInstructionSpace - for CPU(ARM_TRADITIONAL) to fit actual need. - - Reviewed by Oliver Hunt. - - * jit/JIT.h: - (JIT): - -2012-03-23 Filip Pizlo - - DFG Fixup should be able to short-circuit trivial ValueToInt32's - https://bugs.webkit.org/show_bug.cgi?id=82030 - - Reviewed by Michael Saboff. - - Takes the fixup() method of the prediction propagation phase and makes it - into its own phase. Adds the ability to short-circuit trivial ValueToInt32 - nodes, and mark pure ValueToInt32's as such. - - * CMakeLists.txt: - * GNUmakefile.list.am: - * JavaScriptCore.xcodeproj/project.pbxproj: - * Target.pri: - * dfg/DFGByteCodeParser.cpp: - (JSC::DFG::ByteCodeParser::makeSafe): - (JSC::DFG::ByteCodeParser::handleCall): - (JSC::DFG::ByteCodeParser::parseBlock): - * dfg/DFGCommon.h: - * dfg/DFGDriver.cpp: - (JSC::DFG::compile): - * dfg/DFGFixupPhase.cpp: Added. - (DFG): - (FixupPhase): - (JSC::DFG::FixupPhase::FixupPhase): - (JSC::DFG::FixupPhase::run): - (JSC::DFG::FixupPhase::fixupNode): - (JSC::DFG::FixupPhase::fixIntEdge): - (JSC::DFG::performFixup): - * dfg/DFGFixupPhase.h: Added. - (DFG): - * dfg/DFGPredictionPropagationPhase.cpp: - (JSC::DFG::PredictionPropagationPhase::run): - (PredictionPropagationPhase): - -2012-03-23 Mark Hahnenberg - - tryReallocate could break the zero-ed memory invariant of CopiedBlocks - https://bugs.webkit.org/show_bug.cgi?id=82087 - - Reviewed by Filip Pizlo. - - Removing this optimization turned out to be ~1% regression on kraken, so I simply - undid the modification to the current block if we fail. - - * heap/CopiedSpace.cpp: - (JSC::CopiedSpace::tryReallocate): Undid the reset in the CopiedAllocator if we fail - to reallocate from the current block. - -2012-03-23 Alexey Proskuryakov - - [Mac] No need for platform-specific ENABLE_BLOB values - https://bugs.webkit.org/show_bug.cgi?id=82102 - - Reviewed by David Kilzer. - - * Configurations/FeatureDefines.xcconfig: - -2012-03-23 Michael Saboff - - DFG::compileValueToInt32 Sometime Generates GPR to FPR reg back to GPR - https://bugs.webkit.org/show_bug.cgi?id=81805 - - Reviewed by Filip Pizlo. - - Added SpeculativeJIT::checkGeneratedType() to determine the current format - of an operand. Used that information in SpeculativeJIT::compileValueToInt32 - to generate code that will use integer and JSValue types in integer - format directly without a conversion to double. - - * JavaScriptCore.xcodeproj/project.pbxproj: - * dfg/DFGSpeculativeJIT.cpp: - (JSC::DFG::SpeculativeJIT::checkGeneratedType): - (DFG): - (JSC::DFG::SpeculativeJIT::compileValueToInt32): - * dfg/DFGSpeculativeJIT.h: - (DFG): - (SpeculativeJIT): - -2012-03-23 Steve Falkenburg - - Update Apple Windows build files for WTF move - https://bugs.webkit.org/show_bug.cgi?id=82069 - - Reviewed by Jessie Berlin. - - * JavaScriptCore.vcproj/JavaScriptCoreSubmit.sln: Removed WTF and WTFGenerated. - -2012-03-23 Dean Jackson - - Disable CSS_SHADERS in Apple builds - https://bugs.webkit.org/show_bug.cgi?id=81996 - - Reviewed by Simon Fraser. - - Remove ENABLE_CSS_SHADERS from FeatureDefines. It's now in Platform.h. - - * Configurations/FeatureDefines.xcconfig: - -2012-03-23 Gavin Barraclough - - RexExp constructor last match properties should not rely on previous ovector - https://bugs.webkit.org/show_bug.cgi?id=82077 - - Reviewed by Oliver Hunt. - - This change simplifies matching, and will enable subpattern results to be fully lazily generated in the future. - - This patch changes the scheme used to lazily generate the last match properties of the RegExp object. - Instead of relying on the results in the ovector, we can instead lazily generate the subpatters using - a RegExpMatchesArray. To do so we just need to store the input, the regexp matched, and the match - location (the MatchResult). When the match is accessed or the input is set, we reify results. We use - a special value of setting the saved result to MatchResult::failed() to indicated that we're in a - reified state. This means that next time a match is performed, the store of the result will - automatically blow away the reified value. - - * JavaScriptCore.xcodeproj/project.pbxproj: - - Added new files. - * runtime/RegExp.cpp: - (JSC::RegExpFunctionalTestCollector::outputOneTest): - - changed 'subPattern' -> 'subpattern' (there was a mix in JSC, 'subpattern' was more common). - * runtime/RegExpCachedResult.cpp: Added. - (JSC::RegExpCachedResult::visitChildren): - (JSC::RegExpCachedResult::lastResult): - (JSC::RegExpCachedResult::setInput): - - New methods, mark GC objects, lazily create the matches array, and record a user provided input (via assignment to RegExp.inupt). - * runtime/RegExpCachedResult.h: Added. - (RegExpCachedResult): - - Added new class. - (JSC::RegExpCachedResult::RegExpCachedResult): - (JSC::RegExpCachedResult::record): - (JSC::RegExpCachedResult::input): - - Initialize the object, record the result of a RegExp match, access the stored input property. - * runtime/RegExpConstructor.cpp: - (JSC::RegExpConstructor::RegExpConstructor): - - Initialize m_result/m_multiline properties. - (JSC::RegExpConstructor::visitChildren): - - Make sure the cached results (or lazy source for them) are marked. - (JSC::RegExpConstructor::getBackref): - (JSC::RegExpConstructor::getLastParen): - (JSC::RegExpConstructor::getLeftContext): - (JSC::RegExpConstructor::getRightContext): - - Moved from RegExpConstructor, moved to RegExpCachedResult, and using new caching scheme. - (JSC::regExpConstructorInput): - (JSC::setRegExpConstructorInput): - - Changed to use RegExpCachedResult. - * runtime/RegExpConstructor.h: - (JSC::RegExpConstructor::create): - (RegExpConstructor): - (JSC::RegExpConstructor::setMultiline): - (JSC::RegExpConstructor::multiline): - - Move multiline property onto the constructor object; it is not affected by the last match. - (JSC::RegExpConstructor::setInput): - (JSC::RegExpConstructor::input): - - These defer to RegExpCachedResult. - (JSC::RegExpConstructor::performMatch): - * runtime/RegExpMatchesArray.cpp: Added. - (JSC::RegExpMatchesArray::visitChildren): - - Eeeep! added missing visitChildren! - (JSC::RegExpMatchesArray::finishCreation): - (JSC::RegExpMatchesArray::reifyAllProperties): - (JSC::RegExpMatchesArray::reifyMatchProperty): - - Moved from RegExpConstructor.cpp. - (JSC::RegExpMatchesArray::leftContext): - (JSC::RegExpMatchesArray::rightContext): - - Since the match start/ - * runtime/RegExpMatchesArray.h: - (RegExpMatchesArray): - - Declare new methods & structure flags. - * runtime/RegExpObject.cpp: - (JSC::RegExpObject::match): - - performMatch now requires the JSString input, to cache. - * runtime/StringPrototype.cpp: - (JSC::removeUsingRegExpSearch): - (JSC::replaceUsingRegExpSearch): - (JSC::stringProtoFuncMatch): - (JSC::stringProtoFuncSearch): - - performMatch now requires the JSString input, to cache. - -2012-03-23 Tony Chang - - [chromium] rename newwtf target back to wtf - https://bugs.webkit.org/show_bug.cgi?id=82064 - - Reviewed by Adam Barth. - - * JavaScriptCore.gyp/JavaScriptCore.gyp: - -2012-03-23 Mark Hahnenberg - - Simplify memory usage tracking in CopiedSpace - https://bugs.webkit.org/show_bug.cgi?id=80705 - - Reviewed by Filip Pizlo. - - * heap/CopiedAllocator.h: - (CopiedAllocator): Rename currentUtilization to currentSize. - (JSC::CopiedAllocator::currentCapacity): - * heap/CopiedBlock.h: - (CopiedBlock): - (JSC::CopiedBlock::payload): Move the implementation of payload() out of the class - declaration. - (JSC): - (JSC::CopiedBlock::size): Add new function to calculate the block's size. - (JSC::CopiedBlock::capacity): Ditto for capacity. - * heap/CopiedSpace.cpp: - (JSC::CopiedSpace::CopiedSpace): Remove old bogus memory stats fields and add a new - field for the water mark. - (JSC::CopiedSpace::init): - (JSC::CopiedSpace::tryAllocateSlowCase): When we fail to allocate from the current - block, we need to update our current water mark with the size of the block. - (JSC::CopiedSpace::tryAllocateOversize): When we allocate a new oversize block, we - need to update our current water mark with the size of the used portion of the block. - (JSC::CopiedSpace::tryReallocate): We don't need to update the water mark when - reallocating because it will either get accounted for when we fill up the block later - in the case of being able to reallocate in the current block or it will get picked up - immediately because we'll have to get a new block. - (JSC::CopiedSpace::tryReallocateOversize): We do, however, need to update in when - realloc-ing an oversize block because we deallocate the old block and allocate a brand - new one. - (JSC::CopiedSpace::doneFillingBlock): Update the water mark as blocks are returned to - the CopiedSpace by the SlotVisitors. - (JSC::CopiedSpace::doneCopying): Add in any pinned blocks to the water mark. - (JSC::CopiedSpace::getFreshBlock): We use the Heap's new function to tell us whether or - not we should collect now instead of doing the calculation ourself. - (JSC::CopiedSpace::destroy): - (JSC): - (JSC::CopiedSpace::size): Manually calculate the size of the CopiedSpace, similar to how - MarkedSpace does. - (JSC::CopiedSpace::capacity): Ditto for capacity. - * heap/CopiedSpace.h: - (JSC::CopiedSpace::waterMark): - (CopiedSpace): - * heap/CopiedSpaceInlineMethods.h: - (JSC::CopiedSpace::startedCopying): Reset water mark to 0 when we start copying during a - collection. - (JSC::CopiedSpace::allocateNewBlock): - (JSC::CopiedSpace::fitsInBlock): - (JSC::CopiedSpace::allocateFromBlock): - * heap/Heap.cpp: - (JSC::Heap::size): Incorporate size of CopiedSpace into the total size of the Heap. - (JSC::Heap::capacity): Ditto for capacity. - (JSC::Heap::collect): - * heap/Heap.h: - (Heap): - (JSC::Heap::shouldCollect): New function for other sub-parts of the Heap to use to - determine whether they should initiate a collection or continue to allocate new blocks. - (JSC): - (JSC::Heap::waterMark): Now is the sum of the water marks of the two sub-parts of the - Heap (MarkedSpace and CopiedSpace). - * heap/MarkedAllocator.cpp: - (JSC::MarkedAllocator::allocateSlowCase): Changed to use the Heap's new shouldCollect() function. - -2012-03-23 Ryosuke Niwa - - BitVector::resizeOutOfLine doesn't memset when converting an inline buffer - https://bugs.webkit.org/show_bug.cgi?id=82012 - - Reviewed by Filip Pizlo. - - Initialize out-of-line buffers while extending an inline buffer. Also export symbols to be used in WebCore. - - * wtf/BitVector.cpp: - (WTF::BitVector::resizeOutOfLine): - * wtf/BitVector.h: - (BitVector): - (OutOfLineBits): - -2012-03-22 Michael Saboff - - ExecutableAllocator::memoryPressureMultiplier() might can return NaN - https://bugs.webkit.org/show_bug.cgi?id=82002 - - Reviewed by Filip Pizlo. - - Guard against divide by zero and then make sure the return - value is >= 1.0. - - * jit/ExecutableAllocator.cpp: - (JSC::ExecutableAllocator::memoryPressureMultiplier): - * jit/ExecutableAllocatorFixedVMPool.cpp: - (JSC::ExecutableAllocator::memoryPressureMultiplier): - -2012-03-22 Jessie Berlin - - Windows build fix after r111778. - - * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj: - Don't include and try to build files owned by WTF. - Also, let VS have its way with the vcproj in terms of file ordering. - -2012-03-22 Raphael Kubo da Costa - - [CMake] Unreviewed build fix after r111778. - - * CMakeLists.txt: Move ${WTF_DIR} after ${JAVASCRIPTCORE_DIR} in - the include paths so that the right config.h is used. - -2012-03-22 Tony Chang - - Unreviewed, fix chromium build after wtf move. - - Remove old wtf_config and wtf targets. - - * JavaScriptCore.gyp/JavaScriptCore.gyp: - -2012-03-22 Martin Robinson - - Fixed the GTK+ WTF/JavaScriptCore build after r111778. - - * GNUmakefile.list.am: Removed an extra trailing backslash. - -2012-03-22 Mark Rowe - - Fix the build. - - * Configurations/JavaScriptCore.xcconfig: Tell the linker to pull in all members from static libraries - rather than only those that contain symbols that JavaScriptCore itself uses. - * JavaScriptCore.xcodeproj/project.pbxproj: Remove some bogus settings that crept in to the Xcode project. - -2012-03-22 Filip Pizlo - - DFG NodeFlags has some duplicate code and naming issues - https://bugs.webkit.org/show_bug.cgi?id=81975 - - Reviewed by Gavin Barraclough. - - Removed most references to "ArithNodeFlags" since those are now just part - of the node flags. Fixed some renaming goofs (EdgedAsNum is once again - NodeUsedAsNum). Got rid of setArithNodeFlags() and mergeArithNodeFlags() - because the former was never called and the latter did the same things as - mergeFlags(). - - * dfg/DFGByteCodeParser.cpp: - (JSC::DFG::ByteCodeParser::makeSafe): - (JSC::DFG::ByteCodeParser::makeDivSafe): - (JSC::DFG::ByteCodeParser::handleIntrinsic): - * dfg/DFGGraph.cpp: - (JSC::DFG::Graph::dump): - * dfg/DFGNode.h: - (JSC::DFG::Node::arithNodeFlags): - (Node): - * dfg/DFGNodeFlags.cpp: - (JSC::DFG::nodeFlagsAsString): - * dfg/DFGNodeFlags.h: - (DFG): - (JSC::DFG::nodeUsedAsNumber): - * dfg/DFGPredictionPropagationPhase.cpp: - (JSC::DFG::PredictionPropagationPhase::propagate): - (JSC::DFG::PredictionPropagationPhase::mergeDefaultArithFlags): - -2012-03-22 Eric Seidel - - Actually move WTF files to their new home - https://bugs.webkit.org/show_bug.cgi?id=81844 - - Unreviewed. The details of the port-specific changes - have been seen by contributors from those ports, but - the whole 5MB change isn't very reviewable as-is. - - * GNUmakefile.am: - * GNUmakefile.list.am: - * JSCTypedArrayStubs.h: - * JavaScriptCore.gypi: - * JavaScriptCore.xcodeproj/project.pbxproj: - * jsc.cpp: - -2012-03-22 Kevin Ollivier - - [wx] Unreviewed. Adding Source/WTF to the build. - - * wscript: - -2012-03-22 Gavin Barraclough - - Add JSValue::isFunction - https://bugs.webkit.org/show_bug.cgi?id=81935 - - Reviewed by Geoff Garen. - - This would be useful in the WebCore bindings code. - Also, remove asFunction, replace with jsCast. - - * API/JSContextRef.cpp: - * debugger/Debugger.cpp: - * debugger/DebuggerCallFrame.cpp: - (JSC::DebuggerCallFrame::functionName): - * dfg/DFGGraph.h: - (JSC::DFG::Graph::valueOfFunctionConstant): - * dfg/DFGOperations.cpp: - * interpreter/CallFrame.cpp: - (JSC::CallFrame::isInlineCallFrameSlow): - * interpreter/Interpreter.cpp: - (JSC::Interpreter::privateExecute): - * jit/JITStubs.cpp: - (JSC::DEFINE_STUB_FUNCTION): - (JSC::jitCompileFor): - (JSC::lazyLinkFor): - * llint/LLIntSlowPaths.cpp: - (JSC::LLInt::traceFunctionPrologue): - (JSC::LLInt::LLINT_SLOW_PATH_DECL): - (JSC::LLInt::setUpCall): - * runtime/Arguments.h: - (JSC::Arguments::finishCreation): - * runtime/ArrayPrototype.cpp: - (JSC::arrayProtoFuncFilter): - (JSC::arrayProtoFuncMap): - (JSC::arrayProtoFuncEvery): - (JSC::arrayProtoFuncForEach): - (JSC::arrayProtoFuncSome): - (JSC::arrayProtoFuncReduce): - (JSC::arrayProtoFuncReduceRight): - * runtime/CommonSlowPaths.h: - (JSC::CommonSlowPaths::arityCheckFor): - * runtime/Executable.h: - (JSC::FunctionExecutable::compileFor): - (JSC::FunctionExecutable::compileOptimizedFor): - * runtime/FunctionPrototype.cpp: - (JSC::functionProtoFuncToString): - * runtime/JSArray.cpp: - (JSC::JSArray::sort): - * runtime/JSFunction.cpp: - (JSC::JSFunction::argumentsGetter): - (JSC::JSFunction::callerGetter): - (JSC::JSFunction::lengthGetter): - * runtime/JSFunction.h: - (JSC): - (JSC::asJSFunction): - (JSC::JSValue::isFunction): - * runtime/JSGlobalData.cpp: - (WTF::Recompiler::operator()): - (JSC::JSGlobalData::releaseExecutableMemory): - * runtime/JSValue.h: - * runtime/StringPrototype.cpp: - (JSC::replaceUsingRegExpSearch): - -2012-03-21 Filip Pizlo - - DFG speculation on booleans should be rationalized - https://bugs.webkit.org/show_bug.cgi?id=81840 - - Reviewed by Gavin Barraclough. - - This removes isKnownBoolean() and replaces it with AbstractState-based - optimization, and cleans up the control flow in code gen methods for - Branch and LogicalNot. Also fixes a goof in Node::shouldSpeculateNumber, - and removes isKnownNotBoolean() since that method appeared to be a - helper used solely by 32_64's speculateBooleanOperation(). - - This is performance-neutral. - - * dfg/DFGAbstractState.cpp: - (JSC::DFG::AbstractState::execute): - * dfg/DFGNode.h: - (JSC::DFG::Node::shouldSpeculateNumber): - * dfg/DFGSpeculativeJIT.cpp: - (DFG): - * dfg/DFGSpeculativeJIT.h: - (SpeculativeJIT): - * dfg/DFGSpeculativeJIT32_64.cpp: - (JSC::DFG::SpeculativeJIT::fillSpeculateBoolean): - (JSC::DFG::SpeculativeJIT::compileLogicalNot): - (JSC::DFG::SpeculativeJIT::emitBranch): - (JSC::DFG::SpeculativeJIT::compile): - * dfg/DFGSpeculativeJIT64.cpp: - (JSC::DFG::SpeculativeJIT::compileLogicalNot): - (JSC::DFG::SpeculativeJIT::emitBranch): - (JSC::DFG::SpeculativeJIT::compile): - -2012-03-21 Mark Rowe - - Fix the build. - - * wtf/MetaAllocator.h: - (MetaAllocator): Export the destructor. - -2012-03-21 Eric Seidel - - Fix remaining WTF includes in JavaScriptCore in preparation for moving WTF headers out of JavaScriptCore - https://bugs.webkit.org/show_bug.cgi?id=81834 - - Reviewed by Adam Barth. - - * jsc.cpp: - * os-win32/WinMain.cpp: - * runtime/JSDateMath.cpp: - * runtime/TimeoutChecker.cpp: - * testRegExp.cpp: - * tools/CodeProfiling.cpp: - -2012-03-21 Eric Seidel - - WTF::MetaAllocator has a weak vtable (discovered when building wtf as a static library) - https://bugs.webkit.org/show_bug.cgi?id=81838 - - Reviewed by Geoffrey Garen. - - My understanding is that weak vtables happen when the compiler/linker cannot - determine which compilation unit should constain the vtable. In this case - because there were only pure virtual functions as well as an "inline" - virtual destructor (thus the virtual destructor was defined in many compilation - units). Since you can't actually "inline" a virtual function (it still has to - bounce through the vtable), the "inline" on this virutal destructor doesn't - actually help performance, and is only serving to confuse the compiler here. - I've moved the destructor implementation to the .cpp file, thus making - it clear to the compiler where the vtable should be stored, and solving the error. - - * wtf/MetaAllocator.cpp: - (WTF::MetaAllocator::~MetaAllocator): - (WTF): - * wtf/MetaAllocator.h: - -2012-03-20 Gavin Barraclough - - RegExpMatchesArray should not copy the ovector - https://bugs.webkit.org/show_bug.cgi?id=81742 - - Reviewed by Michael Saboff. - - Currently, all RegExpMatchesArray object contain Vector, used to hold any sub-pattern results. - This makes allocation/construction/destruction of these objects more expensive. Instead, just store the - main match, and recreate the sub-pattern ranges only if necessary (these are often only used for grouping, - and the results never accessed). - If the main match (index 0) of the RegExpMatchesArray is accessed, reify that value alone. - - * dfg/DFGOperations.cpp: - - RegExpObject match renamed back to test (test returns a bool). - * runtime/RegExpConstructor.cpp: - (JSC): - - Removed RegExpResult, RegExpMatchesArray constructor, destroy method. - (JSC::RegExpMatchesArray::finishCreation): - - Removed RegExpConstructorPrivate parameter. - (JSC::RegExpMatchesArray::reifyAllProperties): - - (Was fillArrayInstance) Reify all properties of the RegExpMatchesArray. - If there are sub-pattern properties, the RegExp is re-run to generate their values. - (JSC::RegExpMatchesArray::reifyMatchProperty): - - Reify just the match (index 0) property of the RegExpMatchesArray. - * runtime/RegExpConstructor.h: - (RegExpConstructor): - (JSC::RegExpConstructor::performMatch): - - performMatch now returns a MatchResult, rather than using out-parameters. - * runtime/RegExpMatchesArray.h: - (JSC::RegExpMatchesArray::RegExpMatchesArray): - - Moved from .cpp, stores the input/regExp/result to use when lazily reifying properties. - (RegExpMatchesArray): - (JSC::RegExpMatchesArray::create): - - Now passed the input string matched against, the RegExp, and the MatchResult. - (JSC::RegExpMatchesArray::reifyAllPropertiesIfNecessary): - (JSC::RegExpMatchesArray::reifyMatchPropertyIfNecessary): - - Helpers to conditionally reify properties. - (JSC::RegExpMatchesArray::getOwnPropertySlot): - (JSC::RegExpMatchesArray::getOwnPropertySlotByIndex): - (JSC::RegExpMatchesArray::getOwnPropertyDescriptor): - (JSC::RegExpMatchesArray::put): - (JSC::RegExpMatchesArray::putByIndex): - (JSC::RegExpMatchesArray::deleteProperty): - (JSC::RegExpMatchesArray::deletePropertyByIndex): - (JSC::RegExpMatchesArray::getOwnPropertyNames): - (JSC::RegExpMatchesArray::defineOwnProperty): - - Changed to use reifyAllPropertiesIfNecessary/reifyMatchPropertyIfNecessary - (getOwnPropertySlotByIndex calls reifyMatchPropertyIfNecessary if index is 0). - * runtime/RegExpObject.cpp: - (JSC::RegExpObject::exec): - (JSC::RegExpObject::match): - - match now returns a MatchResult. - * runtime/RegExpObject.h: - (JSC::MatchResult::MatchResult): - - Added the result of a match is a start & end tuple. - (JSC::MatchResult::failed): - - A failure is indicated by (notFound, 0). - (JSC::MatchResult::operator bool): - - Evaluates to false if the match failed. - (JSC::MatchResult::empty): - - Evaluates to true if the match succeeded with length 0. - (JSC::RegExpObject::test): - - Now returns a bool. - * runtime/RegExpPrototype.cpp: - (JSC::regExpProtoFuncTest): - - RegExpObject match renamed back to test (test returns a bool). - * runtime/StringPrototype.cpp: - (JSC::removeUsingRegExpSearch): - (JSC::replaceUsingRegExpSearch): - (JSC::stringProtoFuncMatch): - (JSC::stringProtoFuncSearch): - - performMatch now returns a MatchResult, rather than using out-parameters. - -2012-03-21 Hojong Han - - Fix out of memory by allowing overcommit - https://bugs.webkit.org/show_bug.cgi?id=81743 - - Reviewed by Geoffrey Garen. - - Garbage collection is not triggered and new blocks are added - because overcommit is allowed by MAP_NORESERVE flag when high water mark is big enough. - - * wtf/OSAllocatorPosix.cpp: - (WTF::OSAllocator::reserveAndCommit): - -2012-03-21 Jessie Berlin - - More Windows build fixing. - - * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCoreCommon.vsprops: - Fix the order of the include directories to look in include/private first before looking - in include/private/JavaScriptCore. - * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCoreReleasePGO.vsprops: - Look in the Production output directory (where the wtf headers will be). This is the same - thing that is done for jsc and testRegExp in ReleasePGO. - -2012-03-21 Jessie Berlin - - WTF headers should be in $(ConfigurationBuildDir)\include\private\wtf, not - $(ConfigurationBuildDir)\include\private\JavaScriptCore\wtf. - https://bugs.webkit.org/show_bug.cgi?id=81739 - - Reviewed by Dan Bernstein. - - * JavaScriptCore.vcproj/jsc/jsc.vcproj: - Look for AtomicString.cpp, StringBuilder.cpp, StringImpl.cpp, and WTFString.cpp in the wtf - subdirectory of the build output, not the JavaScriptCore/wtf subdirectory. - * JavaScriptCore.vcproj/testRegExp/testRegExp.vcproj: - Ditto. - - * JavaScriptCore.vcproj/testRegExp/testRegExpReleasePGO.vsprops: - Get the headers for those 4 files from the wtf subdirectory of the build output, not the - JavaScriptCore/wtf subdirectory. - * JavaScriptCore.vcproj/jsc/jscReleasePGO.vsprops: - Ditto. - -2012-03-20 Eric Seidel - - Move wtf/Platform.h from JavaScriptCore to Source/WTF/wtf - https://bugs.webkit.org/show_bug.cgi?id=80911 - - Reviewed by Adam Barth. - - Update the various build systems to depend on Source/WTF headers - as well as remove references to Platform.h (since it's now moved). - - * CMakeLists.txt: - * JavaScriptCore.pri: - * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCoreCommon.vsprops: - * JavaScriptCore.xcodeproj/project.pbxproj: - * wtf/CMakeLists.txt: - -2012-03-20 Filip Pizlo - - op_mod fails on many interesting corner cases - https://bugs.webkit.org/show_bug.cgi?id=81648 - - Reviewed by Oliver Hunt. - - Removed most strength reduction for op_mod, and fixed the integer handling - to do the right thing for corner cases. Oddly, this revealed bugs in OSR, - which this patch also fixes. - - This patch is performance neutral on all of the major benchmarks we track. - - * dfg/DFGOperations.cpp: - * dfg/DFGOperations.h: - * dfg/DFGSpeculativeJIT.cpp: - (DFG): - (JSC::DFG::SpeculativeJIT::compileSoftModulo): - (JSC::DFG::SpeculativeJIT::compileArithMod): - * jit/JIT.h: - (JIT): - * jit/JITArithmetic.cpp: - (JSC): - (JSC::JIT::emit_op_mod): - (JSC::JIT::emitSlow_op_mod): - * jit/JITArithmetic32_64.cpp: - (JSC::JIT::emit_op_mod): - (JSC::JIT::emitSlow_op_mod): - * jit/JITOpcodes32_64.cpp: - (JSC::JIT::privateCompileCTIMachineTrampolines): - (JSC): - * jit/JITStubs.h: - (TrampolineStructure): - (JSC::JITThunks::ctiNativeConstruct): - * llint/LowLevelInterpreter64.asm: - * wtf/Platform.h: - * wtf/SimpleStats.h: - (WTF::SimpleStats::variance): - -2012-03-20 Steve Falkenburg - - Windows (make based) build fix. - - - * JavaScriptCore.vcproj/JavaScriptCore.make: devenv /rebuild doesn't work with JavaScriptCore.vcproj. Use /clean and /build instead. - -2012-03-20 Steve Falkenburg - - Move WTF-related Windows project files out of JavaScriptCore - https://bugs.webkit.org/show_bug.cgi?id=80680 - - This change only moves the vcproj and related files from JavaScriptCore/JavaScriptCore.vcproj/WTF. - It does not move any source code. This is in preparation for the WTF source move out of - JavaScriptCore. - - Reviewed by Jessie Berlin. - - * JavaScriptCore.vcproj/JavaScriptCore.sln: - * JavaScriptCore.vcproj/JavaScriptCoreSubmit.sln: - * JavaScriptCore.vcproj/WTF: Removed. - * JavaScriptCore.vcproj/WTF/WTF.vcproj: Removed. - * JavaScriptCore.vcproj/WTF/WTFCommon.vsprops: Removed. - * JavaScriptCore.vcproj/WTF/WTFDebug.vsprops: Removed. - * JavaScriptCore.vcproj/WTF/WTFDebugAll.vsprops: Removed. - * JavaScriptCore.vcproj/WTF/WTFDebugCairoCFLite.vsprops: Removed. - * JavaScriptCore.vcproj/WTF/WTFGenerated.make: Removed. - * JavaScriptCore.vcproj/WTF/WTFGenerated.vcproj: Removed. - * JavaScriptCore.vcproj/WTF/WTFGeneratedCommon.vsprops: Removed. - * JavaScriptCore.vcproj/WTF/WTFGeneratedDebug.vsprops: Removed. - * JavaScriptCore.vcproj/WTF/WTFGeneratedDebugAll.vsprops: Removed. - * JavaScriptCore.vcproj/WTF/WTFGeneratedDebugCairoCFLite.vsprops: Removed. - * JavaScriptCore.vcproj/WTF/WTFGeneratedProduction.vsprops: Removed. - * JavaScriptCore.vcproj/WTF/WTFGeneratedRelease.vsprops: Removed. - * JavaScriptCore.vcproj/WTF/WTFGeneratedReleaseCairoCFLite.vsprops: Removed. - * JavaScriptCore.vcproj/WTF/WTFPostBuild.cmd: Removed. - * JavaScriptCore.vcproj/WTF/WTFPreBuild.cmd: Removed. - * JavaScriptCore.vcproj/WTF/WTFProduction.vsprops: Removed. - * JavaScriptCore.vcproj/WTF/WTFRelease.vsprops: Removed. - * JavaScriptCore.vcproj/WTF/WTFReleaseCairoCFLite.vsprops: Removed. - * JavaScriptCore.vcproj/WTF/build-generated-files.sh: Removed. - * JavaScriptCore.vcproj/WTF/copy-files.cmd: Removed. - * JavaScriptCore.vcproj/WTF/work-around-vs-dependency-tracking-bugs.py: Removed. - -2012-03-20 Benjamin Poulain - - Cache the type string of JavaScript object - https://bugs.webkit.org/show_bug.cgi?id=81446 - - Reviewed by Geoffrey Garen. - - Instead of creating the JSString every time, we create - lazily the strings in JSGlobalData. - - This avoid the construction of the StringImpl and of the JSString, - which gives some performance improvements. - - * runtime/CommonIdentifiers.h: - * runtime/JSValue.cpp: - (JSC::JSValue::toStringSlowCase): - * runtime/Operations.cpp: - (JSC::jsTypeStringForValue): - * runtime/SmallStrings.cpp: - (JSC::SmallStrings::SmallStrings): - (JSC::SmallStrings::finalizeSmallStrings): - (JSC::SmallStrings::initialize): - (JSC): - * runtime/SmallStrings.h: - (SmallStrings): - -2012-03-20 Oliver Hunt - - Allow LLINT to work even when executable allocation fails. - https://bugs.webkit.org/show_bug.cgi?id=81693 - - Reviewed by Gavin Barraclough. - - Don't crash if executable allocation fails if we can fall back on LLINT - - * jit/ExecutableAllocatorFixedVMPool.cpp: - (JSC::FixedVMPoolExecutableAllocator::FixedVMPoolExecutableAllocator): - * wtf/OSAllocatorPosix.cpp: - (WTF::OSAllocator::reserveAndCommit): - -2012-03-20 Csaba Osztrogonác - - Division optimizations fail to infer cases of truncated division and mishandle -2147483648/-1 - https://bugs.webkit.org/show_bug.cgi?id=81428 - - 32 bit buildfix after r111355. - - 2147483648 (2^31) isn't valid int literal in ISO C90, because 2147483647 (2^31-1) is the biggest int. - The smallest int is -2147483648 (-2^31) == -2147483647 - 1 == -INT32_MAX-1 == INT32_MIN (stdint.h). - - Reviewed by Zoltan Herczeg. - - * dfg/DFGSpeculativeJIT.cpp: - (JSC::DFG::SpeculativeJIT::compileIntegerArithDivForX86): - -2012-03-19 Jochen Eisinger - - Split WTFReportBacktrace into WTFReportBacktrace and WTFPrintBacktrace - https://bugs.webkit.org/show_bug.cgi?id=80983 - - Reviewed by Darin Adler. - - This allows printing a backtrace acquired by an earlier WTFGetBacktrace - call which is useful for local debugging. - - * wtf/Assertions.cpp: - * wtf/Assertions.h: - -2012-03-19 Benjamin Poulain - - Do not copy the script source in the SourceProvider, just reference the existing string - https://bugs.webkit.org/show_bug.cgi?id=81466 - - Reviewed by Geoffrey Garen. - - * parser/SourceCode.h: Remove the unused, and incorrect, function data(). - * parser/SourceProvider.h: Add OVERRIDE for clarity. - -2012-03-19 Filip Pizlo - - Division optimizations fail to infer cases of truncated division and - mishandle -2147483648/-1 - https://bugs.webkit.org/show_bug.cgi?id=81428 - - - Reviewed by Oliver Hunt. - - If you're a division over integers and you're only used as an integer, then you're - an integer division and remainder checks become unnecessary. If you're dividing - -2147483648 by -1, don't crash. - - * assembler/MacroAssemblerX86Common.h: - (MacroAssemblerX86Common): - (JSC::MacroAssemblerX86Common::add32): - * dfg/DFGSpeculativeJIT.cpp: - (DFG): - (JSC::DFG::SpeculativeJIT::compileIntegerArithDivForX86): - * dfg/DFGSpeculativeJIT.h: - (SpeculativeJIT): - * dfg/DFGSpeculativeJIT32_64.cpp: - (JSC::DFG::SpeculativeJIT::compile): - * dfg/DFGSpeculativeJIT64.cpp: - (JSC::DFG::SpeculativeJIT::compile): - * llint/LowLevelInterpreter64.asm: - -2012-03-19 Benjamin Poulain - - Simplify SmallStrings - https://bugs.webkit.org/show_bug.cgi?id=81445 - - Reviewed by Gavin Barraclough. - - SmallStrings had two methods that should not be public: count() and clear(). - - The method clear() is effectively replaced by finalizeSmallStrings(). The body - of the method was moved to the constructor since the code is obvious. - - The method count() is unused. - - * runtime/SmallStrings.cpp: - (JSC::SmallStrings::SmallStrings): - * runtime/SmallStrings.h: - (SmallStrings): - -2012-03-19 Filip Pizlo - - DFG can no longer compile V8-v4/regexp in debug mode - https://bugs.webkit.org/show_bug.cgi?id=81592 - - Reviewed by Gavin Barraclough. - - * dfg/DFGSpeculativeJIT32_64.cpp: - (JSC::DFG::SpeculativeJIT::compile): - * dfg/DFGSpeculativeJIT64.cpp: - (JSC::DFG::SpeculativeJIT::compile): - -2012-03-19 Filip Pizlo - - Prediction propagation for UInt32ToNumber incorrectly assumes that outs outcome does not - change throughout the fixpoint - https://bugs.webkit.org/show_bug.cgi?id=81583 - - Reviewed by Michael Saboff. - - * dfg/DFGPredictionPropagationPhase.cpp: - (JSC::DFG::PredictionPropagationPhase::propagate): - -2012-03-19 Filip Pizlo - - GC should not attempt to clear LLInt instruction inline caches for code blocks that are in - the process of being generated - https://bugs.webkit.org/show_bug.cgi?id=81565 - - Reviewed by Oliver Hunt. - - * bytecode/CodeBlock.cpp: - (JSC::CodeBlock::finalizeUnconditionally): - -2012-03-19 Eric Seidel - - Fix WTF header include discipline in Chromium WebKit - https://bugs.webkit.org/show_bug.cgi?id=81281 - - Reviewed by James Robinson. - - * JavaScriptCore.gyp/JavaScriptCore.gyp: - * wtf/unicode/icu/CollatorICU.cpp: - -2012-03-19 Filip Pizlo - - DFG NodeUse should be called Edge and NodeReferenceBlob should be called AdjacencyList - https://bugs.webkit.org/show_bug.cgi?id=81556 - - Rubber stamped by Gavin Barraclough. - - * GNUmakefile.list.am: - * JavaScriptCore.xcodeproj/project.pbxproj: - * dfg/DFGAbstractState.h: - (JSC::DFG::AbstractState::forNode): - * dfg/DFGAdjacencyList.h: Copied from Source/JavaScriptCore/dfg/DFGNodeReferenceBlob.h. - (JSC::DFG::AdjacencyList::AdjacencyList): - (JSC::DFG::AdjacencyList::child): - (JSC::DFG::AdjacencyList::setChild): - (JSC::DFG::AdjacencyList::child1): - (JSC::DFG::AdjacencyList::child2): - (JSC::DFG::AdjacencyList::child3): - (JSC::DFG::AdjacencyList::setChild1): - (JSC::DFG::AdjacencyList::setChild2): - (JSC::DFG::AdjacencyList::setChild3): - (JSC::DFG::AdjacencyList::child1Unchecked): - (JSC::DFG::AdjacencyList::initialize): - (AdjacencyList): - * dfg/DFGByteCodeParser.cpp: - (JSC::DFG::ByteCodeParser::addVarArgChild): - (JSC::DFG::ByteCodeParser::processPhiStack): - * dfg/DFGCSEPhase.cpp: - (JSC::DFG::CSEPhase::canonicalize): - (JSC::DFG::CSEPhase::performSubstitution): - * dfg/DFGEdge.h: Copied from Source/JavaScriptCore/dfg/DFGNodeUse.h. - (DFG): - (JSC::DFG::Edge::Edge): - (JSC::DFG::Edge::operator==): - (JSC::DFG::Edge::operator!=): - (Edge): - (JSC::DFG::operator==): - (JSC::DFG::operator!=): - * dfg/DFGGraph.h: - (JSC::DFG::Graph::operator[]): - (JSC::DFG::Graph::at): - (JSC::DFG::Graph::ref): - (JSC::DFG::Graph::deref): - (JSC::DFG::Graph::clearAndDerefChild1): - (JSC::DFG::Graph::clearAndDerefChild2): - (JSC::DFG::Graph::clearAndDerefChild3): - (Graph): - * dfg/DFGJITCompiler.h: - (JSC::DFG::JITCompiler::getPrediction): - * dfg/DFGNode.h: - (JSC::DFG::Node::Node): - (JSC::DFG::Node::child1): - (JSC::DFG::Node::child1Unchecked): - (JSC::DFG::Node::child2): - (JSC::DFG::Node::child3): - (Node): - * dfg/DFGNodeFlags.cpp: - (JSC::DFG::arithNodeFlagsAsString): - * dfg/DFGNodeFlags.h: - (DFG): - (JSC::DFG::nodeUsedAsNumber): - * dfg/DFGNodeReferenceBlob.h: Removed. - * dfg/DFGNodeUse.h: Removed. - * dfg/DFGPredictionPropagationPhase.cpp: - (JSC::DFG::PredictionPropagationPhase::propagate): - (JSC::DFG::PredictionPropagationPhase::mergeDefaultArithFlags): - (JSC::DFG::PredictionPropagationPhase::vote): - (JSC::DFG::PredictionPropagationPhase::fixupNode): - * dfg/DFGScoreBoard.h: - (JSC::DFG::ScoreBoard::use): - * dfg/DFGSpeculativeJIT.cpp: - (JSC::DFG::SpeculativeJIT::useChildren): - (JSC::DFG::SpeculativeJIT::writeBarrier): - (JSC::DFG::SpeculativeJIT::compilePutByValForByteArray): - (JSC::DFG::SpeculativeJIT::compilePutByValForIntTypedArray): - (JSC::DFG::SpeculativeJIT::compilePutByValForFloatTypedArray): - (JSC::DFG::SpeculativeJIT::compileStrictEqForConstant): - * dfg/DFGSpeculativeJIT.h: - (JSC::DFG::SpeculativeJIT::at): - (JSC::DFG::SpeculativeJIT::canReuse): - (JSC::DFG::SpeculativeJIT::use): - (SpeculativeJIT): - (JSC::DFG::SpeculativeJIT::speculationCheck): - (JSC::DFG::SpeculativeJIT::terminateSpeculativeExecution): - (JSC::DFG::IntegerOperand::IntegerOperand): - (JSC::DFG::DoubleOperand::DoubleOperand): - (JSC::DFG::JSValueOperand::JSValueOperand): - (JSC::DFG::StorageOperand::StorageOperand): - (JSC::DFG::SpeculateIntegerOperand::SpeculateIntegerOperand): - (JSC::DFG::SpeculateStrictInt32Operand::SpeculateStrictInt32Operand): - (JSC::DFG::SpeculateDoubleOperand::SpeculateDoubleOperand): - (JSC::DFG::SpeculateCellOperand::SpeculateCellOperand): - (JSC::DFG::SpeculateBooleanOperand::SpeculateBooleanOperand): - * dfg/DFGSpeculativeJIT32_64.cpp: - (JSC::DFG::SpeculativeJIT::cachedPutById): - (JSC::DFG::SpeculativeJIT::nonSpeculativeNonPeepholeCompareNull): - (JSC::DFG::SpeculativeJIT::nonSpeculativePeepholeBranchNull): - (JSC::DFG::SpeculativeJIT::nonSpeculativeCompareNull): - (JSC::DFG::SpeculativeJIT::emitCall): - (JSC::DFG::SpeculativeJIT::compileObjectOrOtherLogicalNot): - (JSC::DFG::SpeculativeJIT::emitObjectOrOtherBranch): - * dfg/DFGSpeculativeJIT64.cpp: - (JSC::DFG::SpeculativeJIT::cachedPutById): - (JSC::DFG::SpeculativeJIT::nonSpeculativeNonPeepholeCompareNull): - (JSC::DFG::SpeculativeJIT::nonSpeculativePeepholeBranchNull): - (JSC::DFG::SpeculativeJIT::nonSpeculativeCompareNull): - (JSC::DFG::SpeculativeJIT::emitCall): - (JSC::DFG::SpeculativeJIT::compileObjectOrOtherLogicalNot): - (JSC::DFG::SpeculativeJIT::emitObjectOrOtherBranch): - -2012-03-19 Gavin Barraclough - - Object.freeze broken on latest Nightly - https://bugs.webkit.org/show_bug.cgi?id=80577 - - Reviewed by Oliver Hunt. - - * runtime/Arguments.cpp: - (JSC::Arguments::defineOwnProperty): - - defineOwnProperty was checking for correct behaviour, provided that length/callee hadn't - been overrridden. instead, just reify length/callee & rely on JSObject::defineOwnProperty. - * runtime/JSFunction.cpp: - (JSC::JSFunction::defineOwnProperty): - - for arguments/caller/length properties, defineOwnProperty was incorrectly asserting that - the object must be extensible; this is incorrect since these properties should already exist - on the object. In addition, it was asserting that the arguments/caller values must match the - corresponding magic data properties, but for strict mode function this is incorrect. Instead, - just reify the arguments/caller accessor & defer to JSObject::defineOwnProperty. - -2012-03-19 Filip Pizlo - - LLInt get_by_pname slow path incorrectly assumes that the operands are not constants - https://bugs.webkit.org/show_bug.cgi?id=81559 - - Reviewed by Michael Saboff. - - * llint/LLIntSlowPaths.cpp: - (JSC::LLInt::LLINT_SLOW_PATH_DECL): - -2012-03-19 Yong Li - - [BlackBerry] Implement OSAllocator::commit/decommit in the correct way - https://bugs.webkit.org/show_bug.cgi?id=77013 - - We should use mmap(PROT_NONE, MAP_LAZY) instead of posix_madvise() to - implement memory decommitting for QNX. - - Reviewed by Rob Buis. - - * wtf/OSAllocatorPosix.cpp: - (WTF::OSAllocator::reserveUncommitted): - (WTF::OSAllocator::commit): - (WTF::OSAllocator::decommit): - -2012-03-19 Gavin Barraclough - - Unreviewed - revent a couple of files accidentally committed. - - * runtime/Arguments.cpp: - (JSC::Arguments::defineOwnProperty): - * runtime/JSFunction.cpp: - (JSC::JSFunction::defineOwnProperty): - -2012-03-19 Jessie Berlin - - Another Windows build fix after r111129. - - * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def: - -2012-03-19 Raphael Kubo da Costa - - Cross-platform processor core counter: fix build on FreeBSD. - https://bugs.webkit.org/show_bug.cgi?id=81482 - - Reviewed by Zoltan Herczeg. - - The documentation of sysctl(3) shows that should be - included before (sys/types.h tends to be the first - included header in general). - - This should fix the build on FreeBSD and other systems where - sysctl.h really depends on types defined in types.h. - - * wtf/NumberOfCores.cpp: - -2012-03-19 Jessie Berlin - - Windows build fix after r111129. - - * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def: - -2012-03-19 Gavin Barraclough - - JSCallbackFunction::toStringCallback/valueOfCallback do not handle 0 return value from convertToType - https://bugs.webkit.org/show_bug.cgi?id=81468 - - Reviewed by Oliver Hunt. - - The API specifies that convertToType may opt not to handle a conversion: - "@result The objects's converted value, or NULL if the object was not converted." - In which case, it would propagate first up the JSClass hierarchy, calling its superclass's - conversion functions, and failing that call the JSObject::defaultValue function. - - Unfortunately this behaviour was removed in bug#69677/bug#69858, and instead we now rely on - the toStringCallback/valueOfCallback function introduced in bug#69156. Even after a fix in - bug#73368, these will return the result from the first convertToType they find, regardless - of whether this result is null, and if no convertToType method is found in the api class - hierarchy (possible if toStringCallback/valueOfCallback was accessed off the prototype - chain), they will also return a null pointer. This is unsafe. - - It would be easy to make the approach based around toStringCallback/valueOfCallback continue - to walk the api class hierarchy, but making the fallback to defaultValue would be problematic - (since defaultValue calls toStringCallback/valueOfCallback, this would infinitely recurse). - Making the fallback work with toString/valueOf methods attached to api objects is probably - not the right thing to do – instead, we should just implement the defaultValue trap for api - objects. - - In addition, this bug highlights that fact that JSCallbackFunction::call will allow a hard - null to be returned from C to JavaScript - this is not okay. Handle with an exception. - - * API/JSCallbackFunction.cpp: - (JSC::JSCallbackFunction::call): - - Should be null checking the return value. - (JSC): - - Remove toStringCallback/valueOfCallback. - * API/JSCallbackFunction.h: - (JSCallbackFunction): - - Remove toStringCallback/valueOfCallback. - * API/JSCallbackObject.h: - (JSCallbackObject): - - Add defaultValue mthods to JSCallbackObject. - * API/JSCallbackObjectFunctions.h: - (JSC::::defaultValue): - - Add defaultValue mthods to JSCallbackObject. - * API/JSClassRef.cpp: - (OpaqueJSClass::prototype): - - Remove toStringCallback/valueOfCallback. - * API/tests/testapi.js: - - Revert this test, now we no longer artificially introduce a toString method onto the api object. - -2012-03-18 Raphael Kubo da Costa - - [EFL] Include ICU_INCLUDE_DIRS when building. - https://bugs.webkit.org/show_bug.cgi?id=81483 - - Reviewed by Daniel Bates. - - So far, only the ICU libraries were being included when building - JavaScriptCore, however the include path is also needed, otherwise the - build will fail when ICU is installed into a non-standard location. - - * PlatformEfl.cmake: Include ${ICU_INCLUDE_DIRS}. - -2012-03-17 Gavin Barraclough - - Strength reduction, RegExp.exec -> RegExp.test - https://bugs.webkit.org/show_bug.cgi?id=81459 - - Reviewed by Sam Weinig. - - RegExp.prototype.exec & RegExp.prototype.test can both be used to test a regular - expression for a match against a string - however exec is more expensive, since - it allocates a matches array object. In cases where the result is consumed in a - boolean context the allocation of the matches array can be trivially elided. - - For example: - function f() - { - for (i =0; i < 10000000; ++i) - if(!/a/.exec("a")) - err = true; - } - - This is a 2.5x speedup on this example microbenchmark loop. - - In a more advanced form of this optimization, we may be able to avoid allocating - the array where access to the array can be observed. - - * create_hash_table: - * dfg/DFGAbstractState.cpp: - (JSC::DFG::AbstractState::execute): - * dfg/DFGByteCodeParser.cpp: - (JSC::DFG::ByteCodeParser::handleIntrinsic): - * dfg/DFGNode.h: - (JSC::DFG::Node::hasHeapPrediction): - * dfg/DFGNodeType.h: - (DFG): - * dfg/DFGOperations.cpp: - * dfg/DFGOperations.h: - * dfg/DFGPredictionPropagationPhase.cpp: - (JSC::DFG::PredictionPropagationPhase::propagate): - * dfg/DFGSpeculativeJIT.cpp: - (JSC::DFG::SpeculativeJIT::compileRegExpExec): - (DFG): - * dfg/DFGSpeculativeJIT.h: - (JSC::DFG::SpeculativeJIT::callOperation): - * dfg/DFGSpeculativeJIT32_64.cpp: - (JSC::DFG::SpeculativeJIT::compile): - * dfg/DFGSpeculativeJIT64.cpp: - (JSC::DFG::SpeculativeJIT::compile): - * jsc.cpp: - (GlobalObject::addConstructableFunction): - * runtime/Intrinsic.h: - * runtime/JSFunction.cpp: - (JSC::JSFunction::create): - (JSC): - * runtime/JSFunction.h: - (JSFunction): - * runtime/Lookup.cpp: - (JSC::setUpStaticFunctionSlot): - * runtime/RegExpObject.cpp: - (JSC::RegExpObject::exec): - (JSC::RegExpObject::match): - * runtime/RegExpObject.h: - (RegExpObject): - * runtime/RegExpPrototype.cpp: - (JSC::regExpProtoFuncTest): - (JSC::regExpProtoFuncExec): - -2012-03-16 Michael Saboff - - Improve diagnostic benefit of JSGlobalData::m_isInitializingObject - https://bugs.webkit.org/show_bug.cgi?id=81244 - - Rubber stamped by Filip Pizlo. - - Changed type and name of JSGlobalData::m_isInitializingObject to - ClassInfo* and m_initializingObjectClass. - Changed JSGlobalData::setInitializingObject to - JSGlobalData::setInitializingObjectClass. This pointer can be used within - the debugger to determine what type of object is being initialized. - - * runtime/JSCell.h: - (JSC::JSCell::finishCreation): - (JSC::allocateCell): - * runtime/JSGlobalData.cpp: - (JSC::JSGlobalData::JSGlobalData): - * runtime/JSGlobalData.h: - (JSGlobalData): - (JSC::JSGlobalData::isInitializingObject): - (JSC::JSGlobalData::setInitializingObjectClass): - * runtime/Structure.h: - (JSC::JSCell::finishCreation): - -2012-03-16 Mark Rowe - - Build fix. Do not preserve owner and group information when installing the WTF headers. - - * JavaScriptCore.xcodeproj/project.pbxproj: - -2012-03-15 David Dorwin - - Make the array pointer parameters in the Typed Array create() methods const. - https://bugs.webkit.org/show_bug.cgi?id=81147 - - Reviewed by Kenneth Russell. - - This allows const arrays to be passed to these methods. - They use PassRefPtr create(), which already has a const parameter. - - * wtf/Int16Array.h: - (Int16Array): - (WTF::Int16Array::create): - * wtf/Int32Array.h: - (Int32Array): - (WTF::Int32Array::create): - * wtf/Int8Array.h: - (Int8Array): - (WTF::Int8Array::create): - * wtf/Uint16Array.h: - (Uint16Array): - (WTF::Uint16Array::create): - * wtf/Uint32Array.h: - (Uint32Array): - (WTF::Uint32Array::create): - * wtf/Uint8Array.h: - (Uint8Array): - (WTF::Uint8Array::create): - * wtf/Uint8ClampedArray.h: - (Uint8ClampedArray): - (WTF::Uint8ClampedArray::create): - -2012-03-15 Myles Maxfield - - CopiedSpace::tryAllocateOversize assumes system page size - https://bugs.webkit.org/show_bug.cgi?id=80615 - - Reviewed by Geoffrey Garen. - - * heap/CopiedSpace.cpp: - (JSC::CopiedSpace::tryAllocateOversize): - * heap/CopiedSpace.h: - (CopiedSpace): - * heap/CopiedSpaceInlineMethods.h: - (JSC::CopiedSpace::oversizeBlockFor): - * wtf/BumpPointerAllocator.h: - (WTF::BumpPointerPool::create): - * wtf/StdLibExtras.h: - (WTF::roundUpToMultipleOf): - -2012-03-15 Mark Hahnenberg - - Fixing Windows build breakage - - * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def: - -2012-03-15 Patrick Gansterer - - [EFL] Make zlib a general build requirement - https://bugs.webkit.org/show_bug.cgi?id=80153 - - Reviewed by Hajime Morita. - - After r109538 WebSocket module needs zlib to support deflate-frame extension. - - * wtf/Platform.h: - -2012-03-15 Benjamin Poulain - - NumericStrings should be inlined - https://bugs.webkit.org/show_bug.cgi?id=81183 - - Reviewed by Gavin Barraclough. - - NumericStrings is not always inlined. When it is not, the class is not faster - than using UString::number() directly. - - * runtime/NumericStrings.h: - (JSC::NumericStrings::add): - (JSC::NumericStrings::lookupSmallString): - -2012-03-15 Andras Becsi - - Fix ARM build after r110792. - - Unreviewed build fix. - - * jit/ExecutableAllocator.h: - (JSC::ExecutableAllocator::cacheFlush): - Remove superfluous curly brackets. - -2012-03-15 Gavin Barraclough - - ARMv7: prefer vmov(gpr,gpr->double) over vmov(gpr->single) - https://bugs.webkit.org/show_bug.cgi?id=81256 - - Reviewed by Oliver Hunt. - - This is a 0.5% sunspider progression. - - * assembler/MacroAssemblerARMv7.h: - (JSC::MacroAssemblerARMv7::convertInt32ToDouble): - - switch which form of vmov we use. - -2012-03-15 YoungTaeck Song - - [EFL] Add OwnPtr specialization for Ecore_Timer. - https://bugs.webkit.org/show_bug.cgi?id=80119 - - Reviewed by Hajime Morita. - - Add an overload for deleteOwnedPtr(Ecore_Timer*) on EFL port. - - * wtf/OwnPtrCommon.h: - (WTF): - * wtf/efl/OwnPtrEfl.cpp: - (WTF::deleteOwnedPtr): - (WTF): - -2012-03-15 Hojong Han - - Linux has madvise enough to support OSAllocator::commit/decommit - https://bugs.webkit.org/show_bug.cgi?id=80505 - - Reviewed by Geoffrey Garen. - - * wtf/OSAllocatorPosix.cpp: - (WTF::OSAllocator::reserveUncommitted): - (WTF::OSAllocator::commit): - (WTF::OSAllocator::decommit): - -2012-03-15 Steve Falkenburg - - Windows build fix. - - * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCoreReleasePGO.vsprops: - * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCoreReleasePGOOptimize.vsprops: - * JavaScriptCore.vcproj/WTF/copy-files.cmd: - * JavaScriptCore.vcproj/jsc/jscReleasePGO.vsprops: - -2012-03-15 Steve Falkenburg - - Windows build fix. - - * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCoreGenerated.vcproj: - -2012-03-15 Kevin Ollivier - - Move wx port to using export macros - https://bugs.webkit.org/show_bug.cgi?id=77279 - - Reviewed by Hajime Morita. - - * wscript: - * wtf/Platform.h: - -2012-03-14 Benjamin Poulain - - Avoid StringImpl::getData16SlowCase() when sorting array - https://bugs.webkit.org/show_bug.cgi?id=81070 - - Reviewed by Geoffrey Garen. - - The function codePointCompare() is used intensively when sorting strings. - This patch improves its performance by: - -Avoiding character conversion. - -Inlining the function. - - This makes Peacekeeper's arrayCombined test 30% faster. - - * wtf/text/StringImpl.cpp: - * wtf/text/StringImpl.h: - (WTF): - (WTF::codePointCompare): - (WTF::codePointCompare8): - (WTF::codePointCompare16): - (WTF::codePointCompare8To16): - -2012-03-14 Hojong Han - - Fix memory allocation failed by fastmalloc - https://bugs.webkit.org/show_bug.cgi?id=79614 - - Reviewed by Geoffrey Garen. - - Memory allocation failed even if the heap grows successfully. - It is wrong to get the span only from the large list after the heap grows, - because new span could be added in the normal list. - - * wtf/FastMalloc.cpp: - (WTF::TCMalloc_PageHeap::New): - -2012-03-14 Hojong Han - - Run cacheFlush page by page to assure of flushing all the requested ranges - https://bugs.webkit.org/show_bug.cgi?id=77712 - - Reviewed by Geoffrey Garen. - - Current MetaAllocator concept, always coalesces adjacent free spaces, - doesn't meet memory management of Linux kernel. - In a certain case Linux kernel doesn't regard contiguous virtual memory areas as one but two. - Therefore cacheFlush page by page guarantees a flush-requested range. - - * jit/ExecutableAllocator.h: - (JSC::ExecutableAllocator::cacheFlush): - -2012-03-14 Oliver Hunt - - Make ARMv7 work again - https://bugs.webkit.org/show_bug.cgi?id=81157 - - Reviewed by Geoffrey Garen. - - We were trying to use the ARMv7 dataRegister as a scratch register in a scenario - where we the ARMv7MacroAssembler would also try to use dataRegister for its own - nefarious purposes. - - * assembler/MacroAssembler.h: - (JSC::MacroAssembler::store32): - * assembler/MacroAssemblerARMv7.h: - (MacroAssemblerARMv7): - -2012-03-14 Mark Hahnenberg - - Heap::destroy leaks CopiedSpace - https://bugs.webkit.org/show_bug.cgi?id=81055 - - Reviewed by Geoffrey Garen. - - Added a destroy() function to CopiedSpace that moves all normal size - CopiedBlocks from the CopiedSpace to the Heap's list of free blocks - as well as deallocates all of the oversize blocks in the CopiedSpace. - This function is now called in Heap::destroy(). - - * heap/CopiedSpace.cpp: - (JSC::CopiedSpace::destroy): - (JSC): - * heap/CopiedSpace.h: - (CopiedSpace): - * heap/Heap.cpp: - (JSC::Heap::destroy): - -2012-03-14 Andrew Lo - - [BlackBerry] Implement REQUEST_ANIMATION_FRAME_DISPLAY_MONITOR using AnimationFrameRateController - https://bugs.webkit.org/show_bug.cgi?id=81000 - - Enable WTF_USE_REQUEST_ANIMATION_FRAME_DISPLAY_MONITOR for BlackBerry. - - Reviewed by Antonio Gomes. - - * wtf/Platform.h: - -2012-03-13 Filip Pizlo - - ValueToInt32 speculation will cause OSR exits even when it does not have to - https://bugs.webkit.org/show_bug.cgi?id=81068 - - - Reviewed by Anders Carlsson. - - Two related changes: - 1) ValueToInt32 will now always just defer to the non-speculative path, instead - of exiting, if it doesn't know what speculations to perform. - 2) ValueToInt32 will speculate boolean if it sees this to be profitable. - - * dfg/DFGAbstractState.cpp: - (JSC::DFG::AbstractState::execute): - * dfg/DFGNode.h: - (JSC::DFG::Node::shouldSpeculateBoolean): - (Node): - * dfg/DFGSpeculativeJIT.cpp: - (JSC::DFG::SpeculativeJIT::compileValueToInt32): - -2012-03-13 Mark Hahnenberg - - More Windows build fixing - - * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def: - -2012-03-13 Mark Hahnenberg - - Windows build fix - - * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def: - -2012-03-13 Mark Hahnenberg - - Type conversion of exponential part failed - https://bugs.webkit.org/show_bug.cgi?id=80673 - - Reviewed by Geoffrey Garen. - - * parser/Lexer.cpp: - (JSC::::lex): - * runtime/JSGlobalObjectFunctions.cpp: - (JSC::parseInt): - (JSC): - (JSC::jsStrDecimalLiteral): Added another template argument that exposes whether or not - we accept trailing junk to clients of jsStrDecimalLiteral. Also added additional template - parameter for strtod to allow trailing spaces. - (JSC::toDouble): - (JSC::parseFloat): Accept trailing junk, as per the ECMA 262 spec (15.1.2.3). - * runtime/LiteralParser.cpp: - (JSC::::Lexer::lexNumber): - * tests/mozilla/expected.html: Update the expected page for run-javascriptcore-tests so that - we will run ecma/TypeConversion/9.3.1-3.js as a regression test now. - * wtf/dtoa.cpp: - (WTF): - (WTF::strtod): We also needed to sometimes accept trailing spaces to pass a few other tests that were - broken by changing the default allowance of trailing junk in jsStrDecimalLiteral. - * wtf/dtoa.h: - * wtf/dtoa/double-conversion.cc: When the AdvanceToNonspace function was lifted out of the - Chromium codebase, the person porting it only thought to check for spaces when skipping whitespace. - A few of our JSC tests check for other types of trailing whitespace, so I've added checks for those - here to cover those cases (horizontal tab, vertical tab, carriage return, form feed, and line feed). - * wtf/text/WTFString.cpp: - (WTF::toDoubleType): Disallow trailing spaces, as this breaks form input verification stuff. - -2012-03-13 Filip Pizlo - - Unreviewed, build fix since is_pod<> includes some header that I didn't know about. - Removing the assert for now. - - * dfg/DFGOperations.h: - * llint/LLIntSlowPaths.h: - -2012-03-13 Filip Pizlo - - Functions with C linkage should return POD types - https://bugs.webkit.org/show_bug.cgi?id=81061 - - Reviewed by Mark Rowe. - - * dfg/DFGOperations.h: - * llint/LLIntSlowPaths.h: - (LLInt): - (SlowPathReturnType): - (JSC::LLInt::encodeResult): - -2012-03-13 Filip Pizlo - - Loads from UInt32Arrays should not result in a double up-convert if it isn't necessary - https://bugs.webkit.org/show_bug.cgi?id=80979 - - - Reviewed by Oliver Hunt. - - Also improved DFG IR dumping to include type information in a somewhat more - intuitive way. - - * bytecode/PredictedType.cpp: - (JSC::predictionToAbbreviatedString): - (JSC): - * bytecode/PredictedType.h: - (JSC): - * dfg/DFGAbstractState.cpp: - (JSC::DFG::AbstractState::execute): - * dfg/DFGGraph.cpp: - (JSC::DFG::Graph::dump): - * dfg/DFGPredictionPropagationPhase.cpp: - (JSC::DFG::PredictionPropagationPhase::propagate): - * dfg/DFGSpeculativeJIT.cpp: - (JSC::DFG::SpeculativeJIT::compileUInt32ToNumber): - (JSC::DFG::SpeculativeJIT::compileGetByValOnIntTypedArray): - * dfg/DFGSpeculativeJIT.h: - (JSC::DFG::SpeculativeJIT::forwardSpeculationCheck): - -2012-03-13 George Staikos - - The callback is only used if SA_RESTART is defined. Compile it out - otherwise to avoid a warning. - https://bugs.webkit.org/show_bug.cgi?id=80926 - - Reviewed by Alexey Proskuryakov. - - * heap/MachineStackMarker.cpp: - (JSC): - -2012-03-13 Hojong Han - - Dump the generated code for ARM_TRADITIONAL - https://bugs.webkit.org/show_bug.cgi?id=80975 - - Reviewed by Gavin Barraclough. - - * assembler/LinkBuffer.h: - (JSC::LinkBuffer::dumpCode): - -2012-03-13 Adam Barth && Benjamin Poulain - - Always enable ENABLE(CLIENT_BASED_GEOLOCATION) - https://bugs.webkit.org/show_bug.cgi?id=78853 - - Reviewed by Adam Barth. - - * Configurations/FeatureDefines.xcconfig: - * wtf/Platform.h: - -2012-03-13 Kwonjin Jeong - - Remove SlotVisitor::copy() method. - https://bugs.webkit.org/show_bug.cgi?id=80973 - - Reviewed by Geoffrey Garen. - - SlotVisitor::copy() method isn't called anywhere. - - * heap/MarkStack.cpp: Remove definition of SlotVisitor::copy() method. - * heap/SlotVisitor.h: Remove declaration of SlotVisitor::copy() method. - -2012-03-12 Hojong Han - - Fix test cases for RegExp multiline - https://bugs.webkit.org/show_bug.cgi?id=80822 - - Reviewed by Gavin Barraclough. - - * tests/mozilla/js1_2/regexp/RegExp_multiline.js: - * tests/mozilla/js1_2/regexp/RegExp_multiline_as_array.js: - * tests/mozilla/js1_2/regexp/beginLine.js: - * tests/mozilla/js1_2/regexp/endLine.js: - -2012-03-12 Filip Pizlo - - Arithmetic use inference should be procedure-global and should run in tandem - with type propagation - https://bugs.webkit.org/show_bug.cgi?id=80819 - - - Reviewed by Gavin Barraclough. - - * CMakeLists.txt: - * GNUmakefile.list.am: - * JavaScriptCore.xcodeproj/project.pbxproj: - * Target.pri: - * dfg/DFGArithNodeFlagsInferencePhase.cpp: Removed. - * dfg/DFGArithNodeFlagsInferencePhase.h: Removed. - * dfg/DFGDriver.cpp: - (JSC::DFG::compile): - * dfg/DFGPredictionPropagationPhase.cpp: - (JSC::DFG::PredictionPropagationPhase::isNotNegZero): - (PredictionPropagationPhase): - (JSC::DFG::PredictionPropagationPhase::isNotZero): - (JSC::DFG::PredictionPropagationPhase::propagate): - (JSC::DFG::PredictionPropagationPhase::mergeDefaultArithFlags): - * dfg/DFGVariableAccessData.h: - (JSC::DFG::VariableAccessData::VariableAccessData): - (JSC::DFG::VariableAccessData::flags): - (VariableAccessData): - (JSC::DFG::VariableAccessData::mergeFlags): - -2012-03-12 Filip Pizlo - - Node::op and Node::flags should be private - https://bugs.webkit.org/show_bug.cgi?id=80824 - - - Reviewed by Gavin Barraclough. - - * CMakeLists.txt: - * GNUmakefile.list.am: - * JavaScriptCore.xcodeproj/project.pbxproj: - * Target.pri: - * dfg/DFGAbstractState.cpp: - (JSC::DFG::AbstractState::initialize): - (JSC::DFG::AbstractState::execute): - (JSC::DFG::AbstractState::mergeStateAtTail): - (JSC::DFG::AbstractState::mergeToSuccessors): - * dfg/DFGArithNodeFlagsInferencePhase.cpp: - (JSC::DFG::ArithNodeFlagsInferencePhase::propagate): - * dfg/DFGByteCodeParser.cpp: - (JSC::DFG::ByteCodeParser::injectLazyOperandPrediction): - (JSC::DFG::ByteCodeParser::getLocal): - (JSC::DFG::ByteCodeParser::getArgument): - (JSC::DFG::ByteCodeParser::flushArgument): - (JSC::DFG::ByteCodeParser::toInt32): - (JSC::DFG::ByteCodeParser::isJSConstant): - (JSC::DFG::ByteCodeParser::makeSafe): - (JSC::DFG::ByteCodeParser::makeDivSafe): - (JSC::DFG::ByteCodeParser::handleInlining): - (JSC::DFG::ByteCodeParser::parseBlock): - (JSC::DFG::ByteCodeParser::processPhiStack): - (JSC::DFG::ByteCodeParser::linkBlock): - * dfg/DFGCFAPhase.cpp: - (JSC::DFG::CFAPhase::performBlockCFA): - * dfg/DFGCSEPhase.cpp: - (JSC::DFG::CSEPhase::canonicalize): - (JSC::DFG::CSEPhase::endIndexForPureCSE): - (JSC::DFG::CSEPhase::pureCSE): - (JSC::DFG::CSEPhase::byValIsPure): - (JSC::DFG::CSEPhase::clobbersWorld): - (JSC::DFG::CSEPhase::impureCSE): - (JSC::DFG::CSEPhase::globalVarLoadElimination): - (JSC::DFG::CSEPhase::getByValLoadElimination): - (JSC::DFG::CSEPhase::checkFunctionElimination): - (JSC::DFG::CSEPhase::checkStructureLoadElimination): - (JSC::DFG::CSEPhase::getByOffsetLoadElimination): - (JSC::DFG::CSEPhase::getPropertyStorageLoadElimination): - (JSC::DFG::CSEPhase::getIndexedPropertyStorageLoadElimination): - (JSC::DFG::CSEPhase::getScopeChainLoadElimination): - (JSC::DFG::CSEPhase::performNodeCSE): - * dfg/DFGGraph.cpp: - (JSC::DFG::Graph::dump): - (DFG): - * dfg/DFGGraph.h: - (JSC::DFG::Graph::addShouldSpeculateInteger): - (JSC::DFG::Graph::negateShouldSpeculateInteger): - (JSC::DFG::Graph::methodOfGettingAValueProfileFor): - * dfg/DFGNode.cpp: Removed. - * dfg/DFGNode.h: - (DFG): - (JSC::DFG::Node::Node): - (Node): - (JSC::DFG::Node::op): - (JSC::DFG::Node::flags): - (JSC::DFG::Node::setOp): - (JSC::DFG::Node::setFlags): - (JSC::DFG::Node::mergeFlags): - (JSC::DFG::Node::filterFlags): - (JSC::DFG::Node::clearFlags): - (JSC::DFG::Node::setOpAndDefaultFlags): - (JSC::DFG::Node::mustGenerate): - (JSC::DFG::Node::isConstant): - (JSC::DFG::Node::isWeakConstant): - (JSC::DFG::Node::valueOfJSConstant): - (JSC::DFG::Node::hasVariableAccessData): - (JSC::DFG::Node::hasIdentifier): - (JSC::DFG::Node::resolveGlobalDataIndex): - (JSC::DFG::Node::hasArithNodeFlags): - (JSC::DFG::Node::arithNodeFlags): - (JSC::DFG::Node::setArithNodeFlag): - (JSC::DFG::Node::mergeArithNodeFlags): - (JSC::DFG::Node::hasConstantBuffer): - (JSC::DFG::Node::hasRegexpIndex): - (JSC::DFG::Node::hasVarNumber): - (JSC::DFG::Node::hasScopeChainDepth): - (JSC::DFG::Node::hasResult): - (JSC::DFG::Node::hasInt32Result): - (JSC::DFG::Node::hasNumberResult): - (JSC::DFG::Node::hasJSResult): - (JSC::DFG::Node::hasBooleanResult): - (JSC::DFG::Node::isJump): - (JSC::DFG::Node::isBranch): - (JSC::DFG::Node::isTerminal): - (JSC::DFG::Node::hasHeapPrediction): - (JSC::DFG::Node::hasFunctionCheckData): - (JSC::DFG::Node::hasStructureTransitionData): - (JSC::DFG::Node::hasStructureSet): - (JSC::DFG::Node::hasStorageAccessData): - (JSC::DFG::Node::hasFunctionDeclIndex): - (JSC::DFG::Node::hasFunctionExprIndex): - (JSC::DFG::Node::child1): - (JSC::DFG::Node::child2): - (JSC::DFG::Node::child3): - (JSC::DFG::Node::firstChild): - (JSC::DFG::Node::numChildren): - * dfg/DFGNodeFlags.cpp: Copied from Source/JavaScriptCore/dfg/DFGNode.cpp. - * dfg/DFGNodeFlags.h: Added. - (DFG): - (JSC::DFG::nodeUsedAsNumber): - (JSC::DFG::nodeCanTruncateInteger): - (JSC::DFG::nodeCanIgnoreNegativeZero): - (JSC::DFG::nodeMayOverflow): - (JSC::DFG::nodeCanSpeculateInteger): - * dfg/DFGNodeType.h: Added. - (DFG): - (JSC::DFG::defaultFlags): - * dfg/DFGPredictionPropagationPhase.cpp: - (JSC::DFG::PredictionPropagationPhase::propagate): - (JSC::DFG::PredictionPropagationPhase::vote): - (JSC::DFG::PredictionPropagationPhase::doRoundOfDoubleVoting): - (JSC::DFG::PredictionPropagationPhase::fixupNode): - * dfg/DFGRedundantPhiEliminationPhase.cpp: - (JSC::DFG::RedundantPhiEliminationPhase::run): - (JSC::DFG::RedundantPhiEliminationPhase::replacePhiChild): - (JSC::DFG::RedundantPhiEliminationPhase::updateBlockVariableInformation): - * dfg/DFGSpeculativeJIT.cpp: - (JSC::DFG::SpeculativeJIT::useChildren): - (JSC::DFG::SpeculativeJIT::compilePeepHoleBranch): - (JSC::DFG::SpeculativeJIT::compileMovHint): - (JSC::DFG::SpeculativeJIT::compile): - (JSC::DFG::SpeculativeJIT::checkArgumentTypes): - (JSC::DFG::SpeculativeJIT::computeValueRecoveryFor): - (JSC::DFG::SpeculativeJIT::compileUInt32ToNumber): - (JSC::DFG::SpeculativeJIT::compileAdd): - (JSC::DFG::SpeculativeJIT::compare): - * dfg/DFGSpeculativeJIT.h: - (JSC::DFG::SpeculativeJIT::detectPeepHoleBranch): - * dfg/DFGSpeculativeJIT32_64.cpp: - (JSC::DFG::SpeculativeJIT::emitCall): - (JSC::DFG::SpeculativeJIT::compile): - * dfg/DFGSpeculativeJIT64.cpp: - (JSC::DFG::SpeculativeJIT::emitCall): - (JSC::DFG::SpeculativeJIT::compile): - * dfg/DFGVirtualRegisterAllocationPhase.cpp: - (JSC::DFG::VirtualRegisterAllocationPhase::run): - -2012-03-12 Laszlo Gombos - - Minor DataLog fixes - https://bugs.webkit.org/show_bug.cgi?id=80826 - - Reviewed by Andreas Kling. - - * bytecode/ExecutionCounter.cpp: - Do not include DataLog.h, it is not used. - - * jit/ExecutableAllocator.cpp: - Ditto. - - * wtf/DataLog.cpp: - (WTF::initializeLogFileOnce): - Add missing semi-colon to the code path where DATA_LOG_FILENAME is defined. - - * wtf/HashTable.cpp: - Include DataLog as it is used. - -2012-03-12 SangGyu Lee - - Integer overflow check code in arithmetic operation in classic interpreter - https://bugs.webkit.org/show_bug.cgi?id=80465 - - Reviewed by Gavin Barraclough. - - * interpreter/Interpreter.cpp: - (JSC::Interpreter::privateExecute): - -2012-03-12 Zeno Albisser - - [Qt][Mac] Build fails after enabling LLINT when JIT is disabled (r109863) - https://bugs.webkit.org/show_bug.cgi?id=80827 - - Qt on Mac uses OS(DARWIN) as well, but we do not want to enable LLINT. - - Reviewed by Simon Hausmann. - - * wtf/Platform.h: - -2012-03-12 Simon Hausmann - - Unreviewed prospective Qt/Mac build fix - - * runtime/JSGlobalData.cpp: use #USE(CF) instead of PLATFORM(MAC) to determine - whether to include CoreFoundation headers, used for JIT configuration in JSGlobalData - constructor. - -2012-03-12 Filip Pizlo - - All DFG nodes should have a mutable set of flags - https://bugs.webkit.org/show_bug.cgi?id=80779 - - - Reviewed by Gavin Barraclough. - - Got rid of NodeId, and placed all of the flags that distinguished NodeId - from NodeType into a separate Node::flags field. Combined what was previously - ArithNodeFlags into Node::flags. - - In the process of debugging, I found that the debug support in the virtual - register allocator was lacking, so I improved it. I also realized that the - virtual register allocator was assuming that the nodes in a basic block were - contiguous, which is no longer the case. So I fixed that. The fix also made - it natural to have more extreme assertions, so I added them. I suspect this - will make it easier to catch virtual register allocation bugs in the future. - - This is mostly performance neutral; if anything it looks like a slight - speed-up. - - This patch does leave some work for future refactorings; for example, Node::op - is unencapsulated. This was already the case, though now it feels even more - like it should be. I avoided doing that because this patch has already grown - way bigger than I wanted. - - Finally, this patch creates a DFGNode.cpp file and makes a slight effort to - move some unnecessarily inline stuff out of DFGNode.h. - - * CMakeLists.txt: - * GNUmakefile.list.am: - * JavaScriptCore.xcodeproj/project.pbxproj: - * Target.pri: - * dfg/DFGArithNodeFlagsInferencePhase.cpp: - (JSC::DFG::ArithNodeFlagsInferencePhase::propagate): - * dfg/DFGByteCodeParser.cpp: - (JSC::DFG::ByteCodeParser::addToGraph): - (JSC::DFG::ByteCodeParser::makeSafe): - (JSC::DFG::ByteCodeParser::makeDivSafe): - (JSC::DFG::ByteCodeParser::handleMinMax): - (JSC::DFG::ByteCodeParser::handleIntrinsic): - (JSC::DFG::ByteCodeParser::parseBlock): - * dfg/DFGCFAPhase.cpp: - (JSC::DFG::CFAPhase::performBlockCFA): - * dfg/DFGCSEPhase.cpp: - (JSC::DFG::CSEPhase::endIndexForPureCSE): - (JSC::DFG::CSEPhase::pureCSE): - (JSC::DFG::CSEPhase::clobbersWorld): - (JSC::DFG::CSEPhase::impureCSE): - (JSC::DFG::CSEPhase::setReplacement): - (JSC::DFG::CSEPhase::eliminate): - (JSC::DFG::CSEPhase::performNodeCSE): - (JSC::DFG::CSEPhase::performBlockCSE): - (CSEPhase): - * dfg/DFGGraph.cpp: - (JSC::DFG::Graph::opName): - (JSC::DFG::Graph::dump): - (DFG): - * dfg/DFGNode.cpp: Added. - (DFG): - (JSC::DFG::arithNodeFlagsAsString): - * dfg/DFGNode.h: - (DFG): - (JSC::DFG::nodeUsedAsNumber): - (JSC::DFG::nodeCanTruncateInteger): - (JSC::DFG::nodeCanIgnoreNegativeZero): - (JSC::DFG::nodeMayOverflow): - (JSC::DFG::nodeCanSpeculateInteger): - (JSC::DFG::defaultFlags): - (JSC::DFG::Node::Node): - (Node): - (JSC::DFG::Node::setOpAndDefaultFlags): - (JSC::DFG::Node::mustGenerate): - (JSC::DFG::Node::arithNodeFlags): - (JSC::DFG::Node::setArithNodeFlag): - (JSC::DFG::Node::mergeArithNodeFlags): - (JSC::DFG::Node::hasResult): - (JSC::DFG::Node::hasInt32Result): - (JSC::DFG::Node::hasNumberResult): - (JSC::DFG::Node::hasJSResult): - (JSC::DFG::Node::hasBooleanResult): - (JSC::DFG::Node::isJump): - (JSC::DFG::Node::isBranch): - (JSC::DFG::Node::isTerminal): - (JSC::DFG::Node::child1): - (JSC::DFG::Node::child2): - (JSC::DFG::Node::child3): - (JSC::DFG::Node::firstChild): - (JSC::DFG::Node::numChildren): - * dfg/DFGPredictionPropagationPhase.cpp: - (JSC::DFG::PredictionPropagationPhase::propagate): - (JSC::DFG::PredictionPropagationPhase::vote): - (JSC::DFG::PredictionPropagationPhase::fixupNode): - * dfg/DFGScoreBoard.h: - (ScoreBoard): - (JSC::DFG::ScoreBoard::~ScoreBoard): - (JSC::DFG::ScoreBoard::assertClear): - (JSC::DFG::ScoreBoard::use): - * dfg/DFGSpeculativeJIT.cpp: - (JSC::DFG::SpeculativeJIT::useChildren): - * dfg/DFGSpeculativeJIT32_64.cpp: - (JSC::DFG::SpeculativeJIT::compile): - * dfg/DFGSpeculativeJIT64.cpp: - (JSC::DFG::SpeculativeJIT::compile): - * dfg/DFGVirtualRegisterAllocationPhase.cpp: - (JSC::DFG::VirtualRegisterAllocationPhase::run): - -2012-03-10 Filip Pizlo - - LLInt should support JSVALUE64 - https://bugs.webkit.org/show_bug.cgi?id=79609 - - - Reviewed by Gavin Barraclough and Oliver Hunt. - - Ported the LLInt, which previously only worked on 32-bit, to 64-bit. This - patch moves a fair bit of code from LowLevelInterpreter32_64.asm to the common - file, LowLevelInterpreter.asm. About 1/3 of the LLInt did not have to be - specialized for value representation. - - Also made some minor changes to offlineasm and the slow-paths. - - * llint/LLIntData.cpp: - (JSC::LLInt::Data::performAssertions): - * llint/LLIntEntrypoints.cpp: - * llint/LLIntSlowPaths.cpp: - (LLInt): - (JSC::LLInt::llint_trace_value): - (JSC::LLInt::LLINT_SLOW_PATH_DECL): - (JSC::LLInt::jitCompileAndSetHeuristics): - * llint/LLIntSlowPaths.h: - (LLInt): - (SlowPathReturnType): - (JSC::LLInt::SlowPathReturnType::SlowPathReturnType): - (JSC::LLInt::encodeResult): - * llint/LLIntThunks.cpp: - * llint/LowLevelInterpreter.asm: - * llint/LowLevelInterpreter32_64.asm: - * llint/LowLevelInterpreter64.asm: - * offlineasm/armv7.rb: - * offlineasm/asm.rb: - * offlineasm/ast.rb: - * offlineasm/backends.rb: - * offlineasm/instructions.rb: - * offlineasm/parser.rb: - * offlineasm/registers.rb: - * offlineasm/transform.rb: - * offlineasm/x86.rb: - * wtf/Platform.h: - -2012-03-10 Yong Li - - Web Worker crashes with WX_EXCLUSIVE - https://bugs.webkit.org/show_bug.cgi?id=80532 - - Let each JS global object own a meta allocator - for WX_EXCLUSIVE to avoid conflicts from Web Worker. - Also fix a mutex leak in MetaAllocator's dtor. - - Reviewed by Filip Pizlo. - - * jit/ExecutableAllocator.cpp: - (JSC::DemandExecutableAllocator::DemandExecutableAllocator): - (JSC::DemandExecutableAllocator::~DemandExecutableAllocator): - (JSC::DemandExecutableAllocator::bytesAllocatedByAllAllocators): - (DemandExecutableAllocator): - (JSC::DemandExecutableAllocator::bytesCommittedByAllocactors): - (JSC::DemandExecutableAllocator::dumpProfileFromAllAllocators): - (JSC::DemandExecutableAllocator::allocateNewSpace): - (JSC::DemandExecutableAllocator::allocators): - (JSC::DemandExecutableAllocator::allocatorsMutex): - (JSC): - (JSC::ExecutableAllocator::initializeAllocator): - (JSC::ExecutableAllocator::ExecutableAllocator): - (JSC::ExecutableAllocator::underMemoryPressure): - (JSC::ExecutableAllocator::memoryPressureMultiplier): - (JSC::ExecutableAllocator::allocate): - (JSC::ExecutableAllocator::committedByteCount): - (JSC::ExecutableAllocator::dumpProfile): - * jit/ExecutableAllocator.h: - (JSC): - (ExecutableAllocator): - (JSC::ExecutableAllocator::allocator): - * wtf/MetaAllocator.h: - (WTF::MetaAllocator::~MetaAllocator): Finalize the spin lock. - * wtf/TCSpinLock.h: - (TCMalloc_SpinLock::Finalize): Add empty Finalize() to some implementations. - -2012-03-09 Gavin Barraclough - - Object.freeze broken on latest Nightly - https://bugs.webkit.org/show_bug.cgi?id=80577 - - Reviewed by Oliver Hunt. - - The problem here is that deleteProperty rejects deletion of prototype. - This is correct in most cases, however defineOwnPropery is presently - implemented internally to ensure the attributes change by deleting the - old property, and creating a new one. - - * runtime/JSFunction.cpp: - (JSC::JSFunction::deleteProperty): - - If deletePropery is called via defineOwnPropery, allow old prototype to be removed. - -2012-03-09 Gavin Barraclough - - Array.prototype.toLocaleString visits elements in wrong order under certain conditions - https://bugs.webkit.org/show_bug.cgi?id=80663 - - Reviewed by Michael Saboff. - - The bug here is actually that we're continuing to process the array after an exception - has been thrown, and that the second value throw is overriding the first. - - * runtime/ArrayPrototype.cpp: - (JSC::arrayProtoFuncToLocaleString): - -2012-03-09 Ryosuke Niwa - - WebKit compiled by gcc (Xcode 3.2.6) hangs while running DOM/Accessors.html - https://bugs.webkit.org/show_bug.cgi?id=80080 - - Reviewed by Filip Pizlo. - - * bytecode/SamplingTool.cpp: - (JSC::SamplingRegion::Locker::Locker): - (JSC::SamplingRegion::Locker::~Locker): - * bytecode/SamplingTool.h: - (JSC::SamplingRegion::exchangeCurrent): - * wtf/Atomics.h: - (WTF): - (WTF::weakCompareAndSwap): - (WTF::weakCompareAndSwapUIntPtr): - -2012-03-09 Gavin Barraclough - - REGRESSION: Date.parse("Tue Nov 23 20:40:05 2010 GMT") returns NaN - https://bugs.webkit.org/show_bug.cgi?id=49989 - - Reviewed by Oliver Hunt. - - Patch originally by chris reiss , - allow the year to appear before the timezone in date strings. - - * wtf/DateMath.cpp: - (WTF::parseDateFromNullTerminatedCharacters): - -2012-03-09 Mark Rowe - - Ensure that the WTF headers are copied at installhdrs time. - - Reviewed by Dan Bernstein and Jessie Berlin. - - * Configurations/JavaScriptCore.xcconfig: Set INSTALLHDRS_SCRIPT_PHASE = YES - so that our script phases are invoked at installhdrs time. The only one that - does any useful work at that time is the one that installs WTF headers. - -2012-03-09 Jon Lee - - Add support for ENABLE(LEGACY_NOTIFICATIONS) - https://bugs.webkit.org/show_bug.cgi?id=80497 - - Reviewed by Adam Barth. - - Prep for b80472: Update API for Web Notifications - * Configurations/FeatureDefines.xcconfig: - -2012-03-09 Ashod Nakashian - - Bash scripts should support LF endings only - https://bugs.webkit.org/show_bug.cgi?id=79509 - - Reviewed by David Kilzer. - - * gyp/generate-derived-sources.sh: Added property svn:eol-style. - * gyp/run-if-exists.sh: Added property svn:eol-style. - * gyp/update-info-plist.sh: Added property svn:eol-style. - -2012-03-09 Jessie Berlin - - Windows debug build fix. - - * assembler/MacroAssembler.h: - (JSC::MacroAssembler::shouldBlind): - Fix unreachable code warnings (which we treat as errors). - -2012-03-09 Thouraya ANDOLSI - - Reviewed by Zoltan Herczeg. - - [Qt] Fix the SH4 build after r109834 - https://bugs.webkit.org/show_bug.cgi?id=80492 - - * assembler/MacroAssemblerSH4.h: - (JSC::MacroAssemblerSH4::branchAdd32): - (JSC::MacroAssemblerSH4::branchSub32): - -2012-03-09 Andy Wingo - - Refactor code feature analysis in the parser - https://bugs.webkit.org/show_bug.cgi?id=79112 - - Reviewed by Geoffrey Garen. - - This commit refactors the parser to more uniformly propagate flag - bits down and up the parse process, as the parser descends and - returns into nested blocks. Some flags get passed town to - subscopes, some apply to specific scopes only, and some get - unioned up after parsing subscopes. - - The goal is to eventually be very precise with scoping - information, once we have block scopes: one block scope might use - `eval', which would require the emission of a symbol table within - that block and containing blocks, whereas another block in the - same function might not, allowing us to not emit a symbol table. - - * parser/Nodes.h: - (JSC::ScopeFlags): Rename from CodeFeatures. - (JSC::ScopeNode::addScopeFlags): - (JSC::ScopeNode::scopeFlags): New accessors for m_scopeFlags. - (JSC::ScopeNode::isStrictMode): - (JSC::ScopeNode::usesEval): - (JSC::ScopeNode::usesArguments): - (JSC::ScopeNode::setUsesArguments): - (JSC::ScopeNode::usesThis): - (JSC::ScopeNode::needsActivationForMoreThanVariables): - (JSC::ScopeNode::needsActivation): Refactor these accessors to - operate on the m_scopeFlags member. - (JSC::ScopeNode::source): - (JSC::ScopeNode::sourceURL): - (JSC::ScopeNode::sourceID): Shuffle these definitions around; no - semantic change. - (JSC::ScopeNode::ScopeNode) - (JSC::ProgramNode::ProgramNode) - (JSC::EvalNode::EvalNode) - (JSC::FunctionBodyNode::FunctionBodyNode): Have these constructors - take a ScopeFlags as an argument, instead of a bool inStrictContext. - - * parser/Nodes.cpp: - (JSC::ScopeNode::ScopeNode): - (JSC::ProgramNode::ProgramNode): - (JSC::ProgramNode::create): - (JSC::EvalNode::EvalNode): - (JSC::EvalNode::create): - (JSC::FunctionBodyNode::FunctionBodyNode): - (JSC::FunctionBodyNode::create): Adapt constructors to change. - - * parser/ASTBuilder.h: - (JSC::ASTBuilder::ASTBuilder): - (JSC::ASTBuilder::thisExpr): - (JSC::ASTBuilder::createResolve): - (JSC::ASTBuilder::createFunctionBody): - (JSC::ASTBuilder::createFuncDeclStatement): - (JSC::ASTBuilder::createTryStatement): - (JSC::ASTBuilder::createWithStatement): - (JSC::ASTBuilder::addVar): - (JSC::ASTBuilder::Scope::Scope): - (Scope): - (ASTBuilder): - (JSC::ASTBuilder::makeFunctionCallNode): Don't track scope - features here. Instead rely on the base Parser mechanism to track - features. - - * parser/NodeInfo.h (NodeInfo, NodeDeclarationInfo): "ScopeFlags". - - * parser/Parser.h: - (JSC::Scope::Scope): Manage scope through flags, not - bit-booleans. This lets us uniformly propagate them up and down. - (JSC::Scope::declareWrite): - (JSC::Scope::declareParameter): - (JSC::Scope::useVariable): - (JSC::Scope::collectFreeVariables): - (JSC::Scope::getCapturedVariables): - (JSC::Scope::saveFunctionInfo): - (JSC::Scope::restoreFunctionInfo): - (JSC::Parser::pushScope): Adapt to use scope flags and their - accessors instead of bit-booleans. - * parser/Parser.cpp: - (JSC::::Parser): - (JSC::::parseInner): - (JSC::::didFinishParsing): - (JSC::::parseSourceElements): - (JSC::::parseVarDeclarationList): - (JSC::::parseConstDeclarationList): - (JSC::::parseWithStatement): - (JSC::::parseTryStatement): - (JSC::::parseFunctionBody): - (JSC::::parseFunctionInfo): - (JSC::::parseFunctionDeclaration): - (JSC::::parsePrimaryExpression): Hoist some of the flag handling - out of the "context" (ASTBuilder or SyntaxChecker) and to here. - Does not seem to have a performance impact. - - * parser/SourceProviderCacheItem.h (SourceProviderCacheItem): - Cache the scopeflags. - * parser/SyntaxChecker.h: Remove evalCount() decl. - - * runtime/Executable.cpp: - (JSC::EvalExecutable::compileInternal): - (JSC::ProgramExecutable::compileInternal): - (JSC::FunctionExecutable::produceCodeBlockFor): - * runtime/Executable.h: - (JSC::ScriptExecutable::ScriptExecutable): - (JSC::ScriptExecutable::usesEval): - (JSC::ScriptExecutable::usesArguments): - (JSC::ScriptExecutable::needsActivation): - (JSC::ScriptExecutable::isStrictMode): - (JSC::ScriptExecutable::recordParse): - (ScriptExecutable): ScopeFlags, not features. - -2012-03-08 Benjamin Poulain - - Build fix for MSVC after r110266 - - Unreviewed. A #ifdef for MSVC was left over in r110266. - - * runtime/RegExpObject.h: - (RegExpObject): - -2012-03-08 Benjamin Poulain - - Allocate the RegExpObject's data with the Cell - https://bugs.webkit.org/show_bug.cgi?id=80654 - - Reviewed by Gavin Barraclough. - - This patch removes the creation of RegExpObject's data to avoid the overhead - create by the allocation and destruction. - - We RegExp are created repeatedly, this provides some performance improvment. - The PeaceKeeper test stringDetectBrowser improves by 10%. - - * runtime/RegExpObject.cpp: - (JSC::RegExpObject::RegExpObject): - (JSC::RegExpObject::visitChildren): - (JSC::RegExpObject::getOwnPropertyDescriptor): - (JSC::RegExpObject::defineOwnProperty): - (JSC::RegExpObject::match): - * runtime/RegExpObject.h: - (JSC::RegExpObject::setRegExp): - (JSC::RegExpObject::regExp): - (JSC::RegExpObject::setLastIndex): - (JSC::RegExpObject::getLastIndex): - (RegExpObject): - -2012-03-08 Steve Falkenburg - - Separate WTF parts of JavaScriptCoreGenerated into WTFGenerated for Windows build - https://bugs.webkit.org/show_bug.cgi?id=80657 - - Preparation for WTF separation from JavaScriptCore. - The "Generated" vcproj files on Windows are necessary so Visual Studio can calculate correct - dependencies for generated files. - - This also removes the PGO build targets from the WTF code, since we can't build instrumentation/optimization - versions of the WTF code independent of the JavaScriptCore code. - - Reviewed by Jessie Berlin. - - * JavaScriptCore.vcproj/JavaScriptCore.sln: Add WTFGenerated, update dependent projects. - * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCoreGenerated.make: Removed WTF specific parts. - * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCoreGenerated.vcproj: Removed WTF specific parts. - * JavaScriptCore.vcproj/JavaScriptCore/build-generated-files.sh: Removed WTF specific parts. - * JavaScriptCore.vcproj/JavaScriptCore/copy-files.cmd: Removed WTF specific parts. - * JavaScriptCore.vcproj/JavaScriptCore/work-around-vs-dependency-tracking-bugs.py: Removed. - * JavaScriptCore.vcproj/JavaScriptCoreSubmit.sln: Add WTFGenerated, update dependent projects. - * JavaScriptCore.vcproj/WTF/WTF.vcproj: Remove PGO targets from WTF. - * JavaScriptCore.vcproj/WTF/WTFGenerated.make: Copied from Source/JavaScriptCore/JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCoreGenerated.make. - * JavaScriptCore.vcproj/WTF/WTFGenerated.vcproj: Copied from Source/JavaScriptCore/JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCoreGenerated.vcproj. - * JavaScriptCore.vcproj/WTF/WTFGeneratedCommon.vsprops: Copied from Source/JavaScriptCore/JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCoreGeneratedCommon.vsprops. - * JavaScriptCore.vcproj/WTF/WTFGeneratedDebug.vsprops: Copied from Source/JavaScriptCore/JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCoreGeneratedDebug.vsprops. - * JavaScriptCore.vcproj/WTF/WTFGeneratedDebugAll.vsprops: Copied from Source/JavaScriptCore/JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCoreGeneratedDebugAll.vsprops. - * JavaScriptCore.vcproj/WTF/WTFGeneratedDebugCairoCFLite.vsprops: Copied from Source/JavaScriptCore/JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCoreGeneratedDebugCairoCFLite.vsprops. - * JavaScriptCore.vcproj/WTF/WTFGeneratedProduction.vsprops: Copied from Source/JavaScriptCore/JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCoreGeneratedProduction.vsprops. - * JavaScriptCore.vcproj/WTF/WTFGeneratedRelease.vsprops: Copied from Source/JavaScriptCore/JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCoreGeneratedRelease.vsprops. - * JavaScriptCore.vcproj/WTF/WTFGeneratedReleaseCairoCFLite.vsprops: Copied from Source/JavaScriptCore/JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCoreGeneratedReleaseCairoCFLite.vsprops. - * JavaScriptCore.vcproj/WTF/WTFReleasePGO.vsprops: Removed. - * JavaScriptCore.vcproj/WTF/build-generated-files.sh: Copied from Source/JavaScriptCore/JavaScriptCore.vcproj/JavaScriptCore/build-generated-files.sh. - * JavaScriptCore.vcproj/WTF/copy-files.cmd: Copied from Source/JavaScriptCore/JavaScriptCore.vcproj/JavaScriptCore/copy-files.cmd. - * JavaScriptCore.vcproj/WTF/work-around-vs-dependency-tracking-bugs.py: Copied from Source/JavaScriptCore/JavaScriptCore.vcproj/JavaScriptCore/work-around-vs-dependency-tracking-bugs.py. - -2012-03-08 Benjamin Poulain - - Fix the build of WebKit with WTFURL following the removal of ForwardingHeaders/wtf - https://bugs.webkit.org/show_bug.cgi?id=80652 - - Reviewed by Eric Seidel. - - Fix the header, URLSegments.h is not part of the API. - - * wtf/url/api/ParsedURL.h: - -2012-03-08 Ryosuke Niwa - - Mac build fix for micro data API. - - * Configurations/FeatureDefines.xcconfig: - -2012-03-08 Gavin Barraclough - - String.prototype.match and replace do not clear global regexp lastIndex per ES5.1 15.5.4.10 - https://bugs.webkit.org/show_bug.cgi?id=26890 - - Reviewed by Oliver Hunt. - - Per 15.10.6.2 step 9.a.1 called via the action of the last iteration of 15.5.4.10 8.f.i. - - * runtime/StringPrototype.cpp: - (JSC::replaceUsingRegExpSearch): - (JSC::stringProtoFuncMatch): - - added calls to setLastIndex. - -2012-03-08 Matt Lilek - - Don't enable VIDEO_TRACK on all OS X platforms - https://bugs.webkit.org/show_bug.cgi?id=80635 - - Reviewed by Eric Carlson. - - * Configurations/FeatureDefines.xcconfig: - -2012-03-08 Oliver Hunt - - Build fix. That day is not today. - - * assembler/MacroAssembler.h: - (JSC::MacroAssembler::shouldBlind): - * assembler/MacroAssemblerX86Common.h: - (MacroAssemblerX86Common): - (JSC::MacroAssemblerX86Common::shouldBlindForSpecificArch): - -2012-03-08 Oliver Hunt - - Build fix. One of these days I'll manage to commit something that works everywhere. - - * assembler/AbstractMacroAssembler.h: - (AbstractMacroAssembler): - * assembler/MacroAssemblerARMv7.h: - (MacroAssemblerARMv7): - * assembler/MacroAssemblerX86Common.h: - (JSC::MacroAssemblerX86Common::shouldBlindForSpecificArch): - (MacroAssemblerX86Common): - -2012-03-08 Chao-ying Fu - - Update MIPS patchOffsetGetByIdSlowCaseCall - https://bugs.webkit.org/show_bug.cgi?id=80302 - - Reviewed by Oliver Hunt. - - * jit/JIT.h: - (JIT): - -2012-03-08 Oliver Hunt - - Missing some places where we should be blinding 64bit values (and blinding something we shouldn't) - https://bugs.webkit.org/show_bug.cgi?id=80633 - - Reviewed by Gavin Barraclough. - - Add 64-bit trap for shouldBlindForSpecificArch, so that we always blind - if there isn't a machine specific implementation (otherwise the 64bit value - got truncated and 32bit checks were used -- leaving 32bits untested). - Also add a bit of logic to ensure that we don't try to blind a few common - constants that go through the ImmPtr paths -- encoded numeric JSValues and - unencoded doubles with common "safe" values. - - * assembler/AbstractMacroAssembler.h: - (JSC::AbstractMacroAssembler::shouldBlindForSpecificArch): - * assembler/MacroAssembler.h: - (JSC::MacroAssembler::shouldBlindDouble): - (MacroAssembler): - (JSC::MacroAssembler::shouldBlind): - * assembler/MacroAssemblerX86Common.h: - (JSC::MacroAssemblerX86Common::shouldBlindForSpecificArch): - -2012-03-08 Mark Rowe - - Ensure that the staged frameworks path is in the search path for JavaScriptCore - - Reviewed by Dan Bernstein. - - * Configurations/Base.xcconfig: - -2012-03-08 Steve Falkenburg - - Fix line endings for copy-files.cmd. - - If a cmd file doesn't have Windows line endings, it doesn't work properly. - In this case, the label :clean wasn't found, breaking the clean build. - - Reviewed by Jessie Berlin. - - * JavaScriptCore.vcproj/JavaScriptCore/copy-files.cmd: - -2012-03-07 Filip Pizlo - - DFG CFA incorrectly handles ValueToInt32 - https://bugs.webkit.org/show_bug.cgi?id=80568 - - Reviewed by Gavin Barraclough. - - Changed it match exactly the decision pattern used in - DFG::SpeculativeJIT::compileValueToInt32 - - * dfg/DFGAbstractState.cpp: - (JSC::DFG::AbstractState::execute): - -2012-03-08 Viatcheslav Ostapenko - - [Qt] [WK2] Webkit fails to link when compiled with force_static_libs_as_shared - https://bugs.webkit.org/show_bug.cgi?id=80524 - - Reviewed by Simon Hausmann. - - Move IdentifierTable methods defintion to WTFThreadData.cpp to fix linking - of WTF library. - - * runtime/Identifier.cpp: - * wtf/WTFThreadData.cpp: - (JSC): - (JSC::IdentifierTable::~IdentifierTable): - (JSC::IdentifierTable::add): - -2012-03-08 Filip Pizlo - - DFG instruction count threshold should be lifted to 10000 - https://bugs.webkit.org/show_bug.cgi?id=80579 - - Reviewed by Gavin Barraclough. - - * runtime/Options.cpp: - (JSC::Options::initializeOptions): - -2012-03-07 Filip Pizlo - - Incorrect tracking of abstract values of variables forced double - https://bugs.webkit.org/show_bug.cgi?id=80566 - - - Reviewed by Gavin Barraclough. - - * dfg/DFGAbstractState.cpp: - (JSC::DFG::AbstractState::mergeStateAtTail): - -2012-03-07 Chao-yng Fu - - [Qt] Fix the MIPS/SH4 build after r109834 - https://bugs.webkit.org/show_bug.cgi?id=80492 - - Reviewed by Oliver Hunt. - - Implement three-argument branch(Add,Sub)32. - - * assembler/MacroAssemblerMIPS.h: - (JSC::MacroAssemblerMIPS::add32): - (MacroAssemblerMIPS): - (JSC::MacroAssemblerMIPS::sub32): - (JSC::MacroAssemblerMIPS::branchAdd32): - (JSC::MacroAssemblerMIPS::branchSub32): - -2012-03-07 Sheriff Bot - - Unreviewed, rolling out r110127. - http://trac.webkit.org/changeset/110127 - https://bugs.webkit.org/show_bug.cgi?id=80562 - - compile failed on AppleWin (Requested by ukai on #webkit). - - * heap/Heap.cpp: - (JSC::Heap::collectAllGarbage): - * heap/Heap.h: - (JSC): - (Heap): - * runtime/Executable.cpp: - (JSC::FunctionExecutable::FunctionExecutable): - (JSC::FunctionExecutable::finalize): - * runtime/Executable.h: - (FunctionExecutable): - (JSC::FunctionExecutable::create): - * runtime/JSGlobalData.cpp: - (WTF): - (Recompiler): - (WTF::Recompiler::operator()): - (JSC::JSGlobalData::recompileAllJSFunctions): - (JSC): - * runtime/JSGlobalData.h: - (JSGlobalData): - * runtime/JSGlobalObject.cpp: - (JSC::DynamicGlobalObjectScope::DynamicGlobalObjectScope): - -2012-03-07 Hojong Han - - The end atom of the marked block considered to filter invalid cells - https://bugs.webkit.org/show_bug.cgi?id=79191 - - Reviewed by Geoffrey Garen. - - Register file could have stale pointers beyond the end atom of marked block. - Those pointers can weasel out of filtering in-middle-of-cell pointer. - - * heap/MarkedBlock.h: - (JSC::MarkedBlock::isLiveCell): - -2012-03-07 Jessie Berlin - - Clean Windows build fails after r110033 - https://bugs.webkit.org/show_bug.cgi?id=80553 - - Rubber-stamped by Jon Honeycutt and Eric Seidel. - - * JavaScriptCore.vcproj/JavaScriptCore/copy-files.cmd: - Place the implementation files next to their header files in the wtf/text subdirectory. - Use echo -F to tell xcopy that these are files (since there is apparently no flag). - * JavaScriptCore.vcproj/jsc/jsc.vcproj: - Update the path to those implementation files. - * JavaScriptCore.vcproj/testRegExp/testRegExp.vcproj: - Ditto. - -2012-03-07 Yuqiang Xian - - Eliminate redundant Phis in DFG - https://bugs.webkit.org/show_bug.cgi?id=80415 - - Reviewed by Filip Pizlo. - - Although this may not have any advantage at current stage, this is towards - minimal SSA to make more high level optimizations (like bug 76770) easier. - We have the choices either to build minimal SSA from scratch or to - keep current simple Phi insertion mechanism and remove the redundancy - in another phase. Currently we choose the latter because the change - could be smaller. - - * CMakeLists.txt: - * GNUmakefile.list.am: - * JavaScriptCore.xcodeproj/project.pbxproj: - * Target.pri: - * dfg/DFGDriver.cpp: - (JSC::DFG::compile): - * dfg/DFGGraph.cpp: - (JSC::DFG::Graph::dump): - * dfg/DFGRedundantPhiEliminationPhase.cpp: Added. - (DFG): - (RedundantPhiEliminationPhase): - (JSC::DFG::RedundantPhiEliminationPhase::RedundantPhiEliminationPhase): - (JSC::DFG::RedundantPhiEliminationPhase::run): - (JSC::DFG::RedundantPhiEliminationPhase::getRedundantReplacement): - (JSC::DFG::RedundantPhiEliminationPhase::replacePhiChild): - (JSC::DFG::RedundantPhiEliminationPhase::fixupPhis): - (JSC::DFG::RedundantPhiEliminationPhase::updateBlockVariableInformation): - (JSC::DFG::performRedundantPhiElimination): - * dfg/DFGRedundantPhiEliminationPhase.h: Added. - (DFG): - -2012-03-07 Mark Hahnenberg - - Refactor recompileAllJSFunctions() to be less expensive - https://bugs.webkit.org/show_bug.cgi?id=80330 - - Reviewed by Geoffrey Garen. - - This change is performance neutral on the JS benchmarks we track. It's mostly to improve page - load performance, which currently does at least a couple full GCs per navigation. - - * heap/Heap.cpp: - (JSC::Heap::discardAllCompiledCode): Rename recompileAllJSFunctions to discardAllCompiledCode - because the function doesn't actually recompile anything (and never did); it simply throws code - away for it to be recompiled later if we determine we should do so. - (JSC): - (JSC::Heap::collectAllGarbage): - (JSC::Heap::addFunctionExecutable): Adds a newly created FunctionExecutable to the Heap's list. - (JSC::Heap::removeFunctionExecutable): Removes the specified FunctionExecutable from the Heap's list. - * heap/Heap.h: - (JSC): - (Heap): - * runtime/Executable.cpp: Added next and prev fields to FunctionExecutables so that they can - be used in DoublyLinkedLists. - (JSC::FunctionExecutable::FunctionExecutable): - (JSC::FunctionExecutable::finalize): Removes the FunctionExecutable from the Heap's list. - * runtime/Executable.h: - (FunctionExecutable): - (JSC::FunctionExecutable::create): Adds the FunctionExecutable to the Heap's list. - * runtime/JSGlobalData.cpp: Remove recompileAllJSFunctions, as it's the Heap's job to own and manage - the list of FunctionExecutables. - * runtime/JSGlobalData.h: - (JSGlobalData): - * runtime/JSGlobalObject.cpp: - (JSC::DynamicGlobalObjectScope::DynamicGlobalObjectScope): Use the new discardAllCompiledCode. - -2012-03-06 Oliver Hunt - - Further harden 64-bit JIT - https://bugs.webkit.org/show_bug.cgi?id=80457 - - Reviewed by Filip Pizlo. - - This patch implements blinding for ImmPtr. Rather than xor based blinding - we perform randomised pointer rotations in order to avoid the significant - cost in executable memory that would otherwise be necessary (and to avoid - the need for an additional scratch register in some cases). - - As with the prior blinding patch there's a moderate amount of noise as we - correct the use of ImmPtr vs. TrustedImmPtr. - - * assembler/AbstractMacroAssembler.h: - (ImmPtr): - (JSC::AbstractMacroAssembler::ImmPtr::asTrustedImmPtr): - * assembler/MacroAssembler.h: - (MacroAssembler): - (JSC::MacroAssembler::storePtr): - (JSC::MacroAssembler::branchPtr): - (JSC::MacroAssembler::shouldBlind): - (JSC::MacroAssembler::RotatedImmPtr::RotatedImmPtr): - (RotatedImmPtr): - (JSC::MacroAssembler::rotationBlindConstant): - (JSC::MacroAssembler::loadRotationBlindedConstant): - (JSC::MacroAssembler::convertInt32ToDouble): - (JSC::MacroAssembler::move): - (JSC::MacroAssembler::poke): - * assembler/MacroAssemblerARMv7.h: - (JSC::MacroAssemblerARMv7::storeDouble): - (JSC::MacroAssemblerARMv7::branchAdd32): - * assembler/MacroAssemblerX86_64.h: - (MacroAssemblerX86_64): - (JSC::MacroAssemblerX86_64::rotateRightPtr): - (JSC::MacroAssemblerX86_64::xorPtr): - * assembler/X86Assembler.h: - (X86Assembler): - (JSC::X86Assembler::xorq_rm): - (JSC::X86Assembler::rorq_i8r): - * dfg/DFGCCallHelpers.h: - (CCallHelpers): - (JSC::DFG::CCallHelpers::setupArgumentsWithExecState): - * dfg/DFGOSRExitCompiler32_64.cpp: - (JSC::DFG::OSRExitCompiler::compileExit): - * dfg/DFGOSRExitCompiler64.cpp: - (JSC::DFG::OSRExitCompiler::compileExit): - * dfg/DFGSpeculativeJIT.cpp: - (JSC::DFG::SpeculativeJIT::createOSREntries): - * dfg/DFGSpeculativeJIT.h: - (JSC::DFG::SpeculativeJIT::silentFillGPR): - (JSC::DFG::SpeculativeJIT::callOperation): - (JSC::DFG::SpeculativeJIT::emitEdgeCode): - * dfg/DFGSpeculativeJIT32_64.cpp: - (JSC::DFG::SpeculativeJIT::compile): - * dfg/DFGSpeculativeJIT64.cpp: - (JSC::DFG::SpeculativeJIT::fillInteger): - (JSC::DFG::SpeculativeJIT::fillDouble): - (JSC::DFG::SpeculativeJIT::fillJSValue): - (JSC::DFG::SpeculativeJIT::emitCall): - (JSC::DFG::SpeculativeJIT::compileObjectEquality): - (JSC::DFG::SpeculativeJIT::compileLogicalNot): - (JSC::DFG::SpeculativeJIT::emitBranch): - * jit/JIT.cpp: - (JSC::JIT::emitOptimizationCheck): - * jit/JITArithmetic32_64.cpp: - (JSC::JIT::emitSlow_op_post_inc): - * jit/JITInlineMethods.h: - (JSC::JIT::emitValueProfilingSite): - (JSC::JIT::emitGetVirtualRegister): - * jit/JITOpcodes.cpp: - (JSC::JIT::emit_op_mov): - (JSC::JIT::emit_op_new_object): - (JSC::JIT::emit_op_strcat): - (JSC::JIT::emit_op_ensure_property_exists): - (JSC::JIT::emit_op_resolve_skip): - (JSC::JIT::emitSlow_op_resolve_global): - (JSC::JIT::emit_op_resolve_with_base): - (JSC::JIT::emit_op_resolve_with_this): - (JSC::JIT::emit_op_jmp_scopes): - (JSC::JIT::emit_op_switch_imm): - (JSC::JIT::emit_op_switch_char): - (JSC::JIT::emit_op_switch_string): - (JSC::JIT::emit_op_throw_reference_error): - (JSC::JIT::emit_op_debug): - (JSC::JIT::emitSlow_op_resolve_global_dynamic): - (JSC::JIT::emit_op_new_array): - (JSC::JIT::emitSlow_op_new_array): - (JSC::JIT::emit_op_new_array_buffer): - * jit/JITOpcodes32_64.cpp: - (JSC::JIT::emit_op_new_object): - (JSC::JIT::emit_op_strcat): - (JSC::JIT::emit_op_ensure_property_exists): - (JSC::JIT::emit_op_resolve_skip): - (JSC::JIT::emitSlow_op_resolve_global): - (JSC::JIT::emit_op_resolve_with_base): - (JSC::JIT::emit_op_resolve_with_this): - (JSC::JIT::emit_op_jmp_scopes): - (JSC::JIT::emit_op_switch_imm): - (JSC::JIT::emit_op_switch_char): - (JSC::JIT::emit_op_switch_string): - * jit/JITPropertyAccess32_64.cpp: - (JSC::JIT::emit_op_put_by_index): - * jit/JITStubCall.h: - (JITStubCall): - (JSC::JITStubCall::addArgument): - -2012-03-07 Simon Hausmann - - ARM build fix. - - Reviewed by Zoltan Herczeg. - - Implement three-argument branch(Add,Sub)32. - - * assembler/MacroAssemblerARM.h: - (JSC::MacroAssemblerARM::add32): - (MacroAssemblerARM): - (JSC::MacroAssemblerARM::sub32): - (JSC::MacroAssemblerARM::branchAdd32): - (JSC::MacroAssemblerARM::branchSub32): - -2012-03-07 Andy Wingo - - Parser: Inline ScopeNodeData into ScopeNode - https://bugs.webkit.org/show_bug.cgi?id=79776 - - Reviewed by Geoffrey Garen. - - It used to be that some ScopeNode members were kept in a separate - structure because sometimes they wouldn't be needed, and - allocating a ParserArena was expensive. This patch makes - ParserArena lazily allocate its IdentifierArena, allowing the - members to be included directly, which is simpler and easier to - reason about. - - * parser/ParserArena.cpp: - (JSC::ParserArena::ParserArena): - (JSC::ParserArena::reset): - (JSC::ParserArena::isEmpty): - * parser/ParserArena.h: - (JSC::ParserArena::identifierArena): Lazily allocate the - IdentifierArena. - - * parser/Nodes.cpp: - (JSC::ScopeNode::ScopeNode): - (JSC::ScopeNode::singleStatement): - (JSC::ProgramNode::create): - (JSC::EvalNode::create): - (JSC::FunctionBodyNode::create): - * parser/Nodes.h: - (JSC::ScopeNode::destroyData): - (JSC::ScopeNode::needsActivationForMoreThanVariables): - (JSC::ScopeNode::needsActivation): - (JSC::ScopeNode::hasCapturedVariables): - (JSC::ScopeNode::capturedVariableCount): - (JSC::ScopeNode::captures): - (JSC::ScopeNode::varStack): - (JSC::ScopeNode::functionStack): - (JSC::ScopeNode::neededConstants): - (ScopeNode): - * bytecompiler/NodesCodegen.cpp: - (JSC::ScopeNode::emitStatementsBytecode): Inline ScopeNodeData - into ScopeNode. Adapt accessors. - -2012-03-06 Eric Seidel - - Make WTF public headers use fully-qualified include paths and remove ForwardingHeaders/wtf - https://bugs.webkit.org/show_bug.cgi?id=80363 - - Reviewed by Mark Rowe. - - Historically WTF has been part of JavaScriptCore, and on Mac and Windows - its headers have appeared as part of the "private" headers exported by - JavaScriptCore. All of the WTF headers there are "flattened" into a single - private headers directory, and WebCore, WebKit and WebKit2 have used "ForwardingHeaders" - to re-map fully-qualified includes to simple includes. - - However, very soon, we are moving the WTF source code out of JavaScriptCore into its - own directory and project. As part of such, the WTF headers will no longer be part of - the JavaScriptCore private interfaces. - In preparation for that, this change makes both the Mac and Win builds export - WTF headers in a non-flattened manner. On Mac, that means into usr/local/include/wtf - (and subdirectories), on Windows for now that means JavaScriptCore/wtf (and subdirectories). - - There are 5 parts to this change. - 1. Updates the JavaScriptCore XCode and VCProj files to actually install these headers - (and header directories) into the appropriate places in the build directory. - 2. Updates JavaScriptCore.xcodeproj to look for these WTF headers in this install location - (WebCore, WebKit, etc. had already been taught to look in previous patches). - 3. Fixes all JavaScriptCore source files, and WTF headers to include WTF headers - using fully qualified paths. - 4. Stops the Mac and Win builds from installing these WTF headers in their old "flattened" location. - 5. Removes WebCore and WebKit ForwardingHeaders/wtf directories now that the flattened headers no longer exist. - - Unfortunately we see no way to do this change in smaller parts, since all of these steps are interdependant. - It is possible there are internal Apple projects which depend on JavaScriptCore/Foo.h working for WTF - headers, those will have to be updated to use after this change. - I've discussed this proposed change at length with Mark Rowe, and my understanding is they - are ready for (and interested in) this change happening. - - * API/tests/JSNode.c: - * API/tests/JSNodeList.c: - * Configurations/Base.xcconfig: - * JavaScriptCore.vcproj/JavaScriptCore/copy-files.cmd: - * JavaScriptCore.xcodeproj/project.pbxproj: - * assembler/MacroAssemblerCodeRef.h: - * bytecompiler/BytecodeGenerator.h: - * dfg/DFGOperations.cpp: - * heap/GCAssertions.h: - * heap/HandleHeap.h: - * heap/HandleStack.h: - * heap/MarkedSpace.h: - * heap/PassWeak.h: - * heap/Strong.h: - * heap/Weak.h: - * jit/HostCallReturnValue.cpp: - * jit/JIT.cpp: - * jit/JITStubs.cpp: - * jit/ThunkGenerators.cpp: - * parser/Lexer.cpp: - * runtime/Completion.cpp: - * runtime/Executable.cpp: - * runtime/Identifier.h: - * runtime/InitializeThreading.cpp: - * runtime/JSDateMath.cpp: - * runtime/JSGlobalObjectFunctions.cpp: - * runtime/JSStringBuilder.h: - * runtime/JSVariableObject.h: - * runtime/NumberPrototype.cpp: - * runtime/WriteBarrier.h: - * tools/CodeProfile.cpp: - * tools/TieredMMapArray.h: - * wtf/AVLTree.h: - * wtf/Alignment.h: - * wtf/AlwaysInline.h: - * wtf/ArrayBufferView.h: - * wtf/Assertions.h: - * wtf/Atomics.h: - * wtf/Bitmap.h: - * wtf/BoundsCheckedPointer.h: - * wtf/CheckedArithmetic.h: - * wtf/Deque.h: - * wtf/ExportMacros.h: - * wtf/FastAllocBase.h: - * wtf/FastMalloc.h: - * wtf/Float32Array.h: - * wtf/Float64Array.h: - * wtf/Functional.h: - * wtf/HashCountedSet.h: - * wtf/HashFunctions.h: - * wtf/HashMap.h: - * wtf/HashSet.h: - * wtf/HashTable.h: - * wtf/HashTraits.h: - * wtf/Int16Array.h: - * wtf/Int32Array.h: - * wtf/Int8Array.h: - * wtf/IntegralTypedArrayBase.h: - * wtf/ListHashSet.h: - * wtf/MainThread.h: - * wtf/MetaAllocator.h: - * wtf/Noncopyable.h: - * wtf/OwnArrayPtr.h: - * wtf/OwnPtr.h: - * wtf/PackedIntVector.h: - * wtf/ParallelJobs.h: - * wtf/PassOwnArrayPtr.h: - * wtf/PassOwnPtr.h: - * wtf/PassRefPtr.h: - * wtf/PassTraits.h: - * wtf/Platform.h: - * wtf/PossiblyNull.h: - * wtf/RefCounted.h: - * wtf/RefCountedLeakCounter.h: - * wtf/RefPtr.h: - * wtf/RetainPtr.h: - * wtf/SimpleStats.h: - * wtf/Spectrum.h: - * wtf/StdLibExtras.h: - * wtf/TCPageMap.h: - * wtf/TemporaryChange.h: - * wtf/ThreadSafeRefCounted.h: - * wtf/Threading.h: - * wtf/ThreadingPrimitives.h: - * wtf/TypeTraits.h: - * wtf/TypedArrayBase.h: - * wtf/Uint16Array.h: - * wtf/Uint32Array.h: - * wtf/Uint8Array.h: - * wtf/Uint8ClampedArray.h: - * wtf/UnusedParam.h: - * wtf/Vector.h: - * wtf/VectorTraits.h: - * wtf/dtoa/double-conversion.h: - * wtf/dtoa/utils.h: - * wtf/gobject/GRefPtr.h: - * wtf/gobject/GlibUtilities.h: - * wtf/text/AtomicString.h: - * wtf/text/AtomicStringImpl.h: - * wtf/text/CString.h: - * wtf/text/StringConcatenate.h: - * wtf/text/StringHash.h: - * wtf/text/WTFString.h: - * wtf/unicode/CharacterNames.h: - * wtf/unicode/UTF8.h: - * wtf/unicode/glib/UnicodeGLib.h: - * wtf/unicode/qt4/UnicodeQt4.h: - * wtf/unicode/wince/UnicodeWinCE.h: - * wtf/url/api/ParsedURL.h: - * wtf/url/api/URLString.h: - * wtf/wince/FastMallocWinCE.h: - * yarr/YarrJIT.cpp: - -2012-03-06 Gavin Barraclough - - Array.prototype functions should throw if delete fails - https://bugs.webkit.org/show_bug.cgi?id=80467 - - Reviewed by Oliver Hunt. - - All calls to [[Delete]] from Array.prototype are specified to pass 'true' as the value of Throw. - In the case of shift/unshift, these are also missing a throw from the 'put' in the implementations - in JSArray.cpp. There are effectively three copies of each of the generic shift/unshift routines, - one in splice, one in ArrayPrototype's shift/unshift methods, and one in JSArray's shift/unshift - routines, for handling arrays with holes. These three copies should be unified. - - * runtime/ArrayPrototype.cpp: - (JSC::shift): - (JSC::unshift): - - Added - shared copies of the shift/unshift functionality. - (JSC::arrayProtoFuncPop): - - should throw if the delete fails. - (JSC::arrayProtoFuncReverse): - - should throw if the delete fails. - (JSC::arrayProtoFuncShift): - (JSC::arrayProtoFuncSplice): - (JSC::arrayProtoFuncUnShift): - - use shift/unshift. - * runtime/JSArray.cpp: - (JSC::JSArray::shiftCount): - (JSC::JSArray::unshiftCount): - - Don't try to handle arrays with holes; return a value indicating - the generic routine should be used instead. - * runtime/JSArray.h: - - declaration for shiftCount/unshiftCount changed. - * tests/mozilla/js1_6/Array/regress-304828.js: - - this was asserting incorrect behaviour. - -2012-03-06 Raphael Kubo da Costa - - [CMake] Make the removal of transitive library dependencies work with CMake < 2.8.7. - https://bugs.webkit.org/show_bug.cgi?id=80469 - - Reviewed by Antonio Gomes. - - * CMakeLists.txt: Manually set the LINK_INTERFACE_LIBRARIES target - property on the library being created. - -2012-03-06 Yuqiang Xian - - DFG BasicBlock should group the Phi nodes together and separate them - from the other nodes - https://bugs.webkit.org/show_bug.cgi?id=80361 - - Reviewed by Filip Pizlo. - - This would make it more efficient to remove the redundant Phi nodes or - insert new Phi nodes for SSA, besides providing a cleaner BasicBlock structure. - This is performance neutral on SunSpider, V8 and Kraken. - - * dfg/DFGAbstractState.cpp: - (JSC::DFG::AbstractState::clobberStructures): - (JSC::DFG::AbstractState::dump): - * dfg/DFGBasicBlock.h: - (JSC::DFG::BasicBlock::BasicBlock): - (BasicBlock): - * dfg/DFGByteCodeParser.cpp: - (JSC::DFG::ByteCodeParser::addToGraph): - (JSC::DFG::ByteCodeParser::insertPhiNode): - * dfg/DFGCFAPhase.cpp: - (JSC::DFG::CFAPhase::performBlockCFA): - * dfg/DFGCSEPhase.cpp: - (JSC::DFG::CSEPhase::pureCSE): - (JSC::DFG::CSEPhase::impureCSE): - (JSC::DFG::CSEPhase::globalVarLoadElimination): - (JSC::DFG::CSEPhase::getByValLoadElimination): - (JSC::DFG::CSEPhase::checkFunctionElimination): - (JSC::DFG::CSEPhase::checkStructureLoadElimination): - (JSC::DFG::CSEPhase::getByOffsetLoadElimination): - (JSC::DFG::CSEPhase::getPropertyStorageLoadElimination): - (JSC::DFG::CSEPhase::getIndexedPropertyStorageLoadElimination): - (JSC::DFG::CSEPhase::getScopeChainLoadElimination): - (JSC::DFG::CSEPhase::performBlockCSE): - * dfg/DFGGraph.cpp: - (JSC::DFG::Graph::dump): - * dfg/DFGSpeculativeJIT.cpp: - (JSC::DFG::SpeculativeJIT::compile): - -2012-03-06 Mark Hahnenberg - - GCActivityCallback timer should vary with the length of the previous GC - https://bugs.webkit.org/show_bug.cgi?id=80344 - - Reviewed by Geoffrey Garen. - - * heap/Heap.cpp: Gave Heap the ability to keep track of the length of its last - GC length so that the GC Activity Callback can use it. - (JSC::Heap::Heap): - (JSC::Heap::collect): - * heap/Heap.h: - (JSC::Heap::lastGCLength): - (Heap): - * runtime/GCActivityCallbackCF.cpp: - (JSC): - (JSC::DefaultGCActivityCallback::operator()): Use the length of the Heap's last - GC to determine the length of our timer trigger (currently set at 100x the duration - of the last GC). - -2012-03-06 Rob Buis - - BlackBerry] Fix cast-align gcc warnings when compiling JSC - https://bugs.webkit.org/show_bug.cgi?id=80420 - - Reviewed by Gavin Barraclough. - - Fix warnings given in Blackberry build. - - * heap/CopiedBlock.h: - (JSC::CopiedBlock::CopiedBlock): - * wtf/RefCountedArray.h: - (WTF::RefCountedArray::Header::fromPayload): - -2012-03-06 Gavin Barraclough - - writable/configurable not respected for some properties of Function/String/Arguments - https://bugs.webkit.org/show_bug.cgi?id=80436 - - Reviewed by Oliver Hunt. - - Special properties should behave like regular properties. - - * runtime/Arguments.cpp: - (JSC::Arguments::defineOwnProperty): - - Mis-nested logic for making read-only properties non-live. - * runtime/JSFunction.cpp: - (JSC::JSFunction::put): - - arguments/length/caller are non-writable, non-configurable - reject appropriately. - (JSC::JSFunction::deleteProperty): - - Attempting to delete prototype/caller should fail. - (JSC::JSFunction::defineOwnProperty): - - Ensure prototype is reified on attempt to reify it. - - arguments/length/caller are non-writable, non-configurable - reject appropriately. - * runtime/JSFunction.h: - - added declaration for defineOwnProperty. - (JSFunction): - * runtime/StringObject.cpp: - (JSC::StringObject::put): - - length is non-writable, non-configurable - reject appropriately. - -2012-03-06 Ulan Degenbaev - - TypedArray subarray call for subarray does not clamp the end index parameter properly - https://bugs.webkit.org/show_bug.cgi?id=80285 - - Reviewed by Kenneth Russell. - - * wtf/ArrayBufferView.h: - (WTF::ArrayBufferView::calculateOffsetAndLength): - -2012-03-06 Sheriff Bot - - Unreviewed, rolling out r109837. - http://trac.webkit.org/changeset/109837 - https://bugs.webkit.org/show_bug.cgi?id=80399 - - breaks Mac Productions builds, too late to try and fix it - tonight (Requested by eseidel on #webkit). - - * API/tests/JSNode.c: - * API/tests/JSNodeList.c: - * Configurations/Base.xcconfig: - * JavaScriptCore.vcproj/JavaScriptCore/copy-files.cmd: - * JavaScriptCore.xcodeproj/project.pbxproj: - * assembler/MacroAssemblerCodeRef.h: - * bytecompiler/BytecodeGenerator.h: - * dfg/DFGOperations.cpp: - * heap/GCAssertions.h: - * heap/HandleHeap.h: - * heap/HandleStack.h: - * heap/MarkedSpace.h: - * heap/PassWeak.h: - * heap/Strong.h: - * heap/Weak.h: - * jit/HostCallReturnValue.cpp: - * jit/JIT.cpp: - * jit/JITStubs.cpp: - * jit/ThunkGenerators.cpp: - * parser/Lexer.cpp: - * runtime/Completion.cpp: - * runtime/Executable.cpp: - * runtime/Identifier.h: - * runtime/InitializeThreading.cpp: - * runtime/JSDateMath.cpp: - * runtime/JSGlobalObjectFunctions.cpp: - * runtime/JSStringBuilder.h: - * runtime/JSVariableObject.h: - * runtime/NumberPrototype.cpp: - * runtime/WriteBarrier.h: - * tools/CodeProfile.cpp: - * tools/TieredMMapArray.h: - * yarr/YarrJIT.cpp: - -2012-03-06 Zoltan Herczeg - - [Qt][ARM] Speculative buildfix after r109834. - - Reviewed by Csaba Osztrogonác. - - * assembler/MacroAssemblerARM.h: - (JSC::MacroAssemblerARM::and32): - (MacroAssemblerARM): - -2012-03-05 Gavin Barraclough - - Unreviewed windows build fix pt 2. - - * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def: - -2012-03-05 Gavin Barraclough - - Unreviewed windows build fix pt 1. - - * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def: - -2012-03-05 Gavin Barraclough - - putByIndex should throw in strict mode - https://bugs.webkit.org/show_bug.cgi?id=80335 - - Reviewed by Filip Pizlo. - - Make the MethodTable PutByIndex trap take a boolean 'shouldThrow' parameter. - - This is a largely mechanical change, simply adding an extra parameter to a number - of functions. Some call sites need perform additional exception checks, and - operationPutByValBeyondArrayBounds needs to know whether it is strict or not. - - This patch doesn't fix a missing throw from some cases of shift/unshift (this is - an existing bug), I'll follow up with a third patch to handle that. - - * API/JSObjectRef.cpp: - (JSObjectSetPropertyAtIndex): - * JSCTypedArrayStubs.h: - (JSC): - * dfg/DFGOperations.cpp: - (JSC::DFG::putByVal): - * dfg/DFGOperations.h: - * dfg/DFGSpeculativeJIT32_64.cpp: - (JSC::DFG::SpeculativeJIT::compile): - * dfg/DFGSpeculativeJIT64.cpp: - (JSC::DFG::SpeculativeJIT::compile): - * interpreter/Interpreter.cpp: - (JSC::Interpreter::privateExecute): - * jit/JITStubs.cpp: - (JSC::DEFINE_STUB_FUNCTION): - * jsc.cpp: - (GlobalObject::finishCreation): - * llint/LLIntSlowPaths.cpp: - (JSC::LLInt::LLINT_SLOW_PATH_DECL): - * runtime/Arguments.cpp: - (JSC::Arguments::putByIndex): - * runtime/Arguments.h: - (Arguments): - * runtime/ArrayPrototype.cpp: - (JSC::arrayProtoFuncPush): - (JSC::arrayProtoFuncReverse): - (JSC::arrayProtoFuncShift): - (JSC::arrayProtoFuncSort): - (JSC::arrayProtoFuncSplice): - (JSC::arrayProtoFuncUnShift): - * runtime/ClassInfo.h: - (MethodTable): - * runtime/JSArray.cpp: - (JSC::SparseArrayValueMap::put): - (JSC::JSArray::put): - (JSC::JSArray::putByIndex): - (JSC::JSArray::putByIndexBeyondVectorLength): - (JSC::JSArray::push): - (JSC::JSArray::shiftCount): - (JSC::JSArray::unshiftCount): - * runtime/JSArray.h: - (SparseArrayValueMap): - (JSArray): - * runtime/JSByteArray.cpp: - (JSC::JSByteArray::putByIndex): - * runtime/JSByteArray.h: - (JSByteArray): - * runtime/JSCell.cpp: - (JSC::JSCell::putByIndex): - * runtime/JSCell.h: - (JSCell): - * runtime/JSNotAnObject.cpp: - (JSC::JSNotAnObject::putByIndex): - * runtime/JSNotAnObject.h: - (JSNotAnObject): - * runtime/JSONObject.cpp: - (JSC::Walker::walk): - * runtime/JSObject.cpp: - (JSC::JSObject::putByIndex): - * runtime/JSObject.h: - (JSC::JSValue::putByIndex): - * runtime/RegExpConstructor.cpp: - (JSC::RegExpMatchesArray::fillArrayInstance): - * runtime/RegExpMatchesArray.h: - (JSC::RegExpMatchesArray::putByIndex): - * runtime/StringPrototype.cpp: - (JSC::stringProtoFuncSplit): - -2012-03-05 Yuqiang Xian - - PredictNone is incorrectly treated as isDoublePrediction - https://bugs.webkit.org/show_bug.cgi?id=80365 - - Reviewed by Filip Pizlo. - - Also it is incorrectly treated as isFixedIndexedStorageObjectPrediction. - - * bytecode/PredictedType.h: - (JSC::isFixedIndexedStorageObjectPrediction): - (JSC::isDoublePrediction): - -2012-03-05 Filip Pizlo - - The LLInt should work even when the JIT is disabled - https://bugs.webkit.org/show_bug.cgi?id=80340 - - - Reviewed by Gavin Barraclough. - - * assembler/MacroAssemblerCodeRef.h: - (JSC::MacroAssemblerCodePtr::createLLIntCodePtr): - (MacroAssemblerCodeRef): - (JSC::MacroAssemblerCodeRef::createLLIntCodeRef): - * interpreter/Interpreter.cpp: - (JSC::Interpreter::initialize): - (JSC::Interpreter::execute): - (JSC::Interpreter::executeCall): - (JSC::Interpreter::executeConstruct): - * jit/JIT.h: - (JSC::JIT::compileCTINativeCall): - * jit/JITStubs.h: - (JSC::JITThunks::ctiNativeCall): - (JSC::JITThunks::ctiNativeConstruct): - * llint/LLIntEntrypoints.cpp: - (JSC::LLInt::getFunctionEntrypoint): - (JSC::LLInt::getEvalEntrypoint): - (JSC::LLInt::getProgramEntrypoint): - * llint/LLIntSlowPaths.cpp: - (JSC::LLInt::LLINT_SLOW_PATH_DECL): - (LLInt): - * llint/LLIntSlowPaths.h: - (LLInt): - * llint/LowLevelInterpreter.h: - * llint/LowLevelInterpreter32_64.asm: - * runtime/Executable.h: - (NativeExecutable): - (JSC::NativeExecutable::create): - (JSC::NativeExecutable::finishCreation): - * runtime/JSGlobalData.cpp: - (JSC::JSGlobalData::JSGlobalData): - * runtime/JSGlobalData.h: - (JSGlobalData): - * runtime/Options.cpp: - (Options): - (JSC::Options::parse): - (JSC::Options::initializeOptions): - * runtime/Options.h: - (Options): - * wtf/Platform.h: - -2012-03-05 Yuqiang Xian - - Checks for dead variables are not sufficient when fixing the expected - values in DFG OSR entry - https://bugs.webkit.org/show_bug.cgi?id=80371 - - Reviewed by Filip Pizlo. - - A dead variable should be identified when there's no node referencing it. - But we currently failed to catch the case where there are some nodes - referencing a variable but those nodes are actually not referenced by - others so will be ignored in code generation. In such case we should - also consider that variable to be a dead variable in the block and fix - the expected values. - This is performance neutral on SunSpider, V8 and Kraken. - - * dfg/DFGJITCompiler.h: - (JSC::DFG::JITCompiler::noticeOSREntry): - -2012-03-05 Oliver Hunt - - Fix Qt build. - - * assembler/AbstractMacroAssembler.h: - * assembler/MacroAssembler.h: - (MacroAssembler): - * dfg/DFGSpeculativeJIT.cpp: - (JSC::DFG::SpeculativeJIT::compileArithSub): - * jit/JITArithmetic32_64.cpp: - (JSC::JIT::emitSub32Constant): - -2012-03-05 Eric Seidel - - Update JavaScriptCore files to use fully-qualified WTF include paths - https://bugs.webkit.org/show_bug.cgi?id=79960 - - Reviewed by Adam Barth. - - This change does 5 small/related things: - 1. Updates JavaScriptCore.xcodeproj to install WTF headers into $BUILD/usr/local/include - (WebCore, WebKit were already setup to look there, but JavaScriptCore.xcodeproj - was not installing headers there.) - 2. Makes JavaScriptCore targets include $BUILD/usr/local/include in their - header search path, as that's where the WTF headers will be installed. - 3. Similarly updates JavaScriptCore.vcproj/copy-files.cmd to copy WTF headers to PrivateHeaders/wtf/* - in addition to the current behavior of flattening all headers to PrivateHeaders/*.h. - 4. Updates a bunch of JSC files to use #include instead of #include "Foo.h" - since soon the WTF headers will not be part of the JavaScriptCore Xcode project. - 5. Makes build-webkit build the WTF XCode project by default. - - * API/tests/JSNode.c: - * API/tests/JSNodeList.c: - * Configurations/Base.xcconfig: - * assembler/MacroAssemblerCodeRef.h: - * bytecompiler/BytecodeGenerator.h: - * dfg/DFGOperations.cpp: - * heap/GCAssertions.h: - * heap/HandleHeap.h: - * heap/HandleStack.h: - * heap/MarkedSpace.h: - * heap/PassWeak.h: - * heap/Strong.h: - * heap/Weak.h: - * jit/HostCallReturnValue.cpp: - * jit/JIT.cpp: - * jit/JITStubs.cpp: - * jit/ThunkGenerators.cpp: - * parser/Lexer.cpp: - * runtime/Completion.cpp: - * runtime/Executable.cpp: - * runtime/Identifier.h: - * runtime/InitializeThreading.cpp: - * runtime/JSDateMath.cpp: - * runtime/JSGlobalObjectFunctions.cpp: - * runtime/JSStringBuilder.h: - * runtime/JSVariableObject.h: - * runtime/NumberPrototype.cpp: - * runtime/WriteBarrier.h: - * tools/CodeProfile.cpp: - * tools/TieredMMapArray.h: - * yarr/YarrJIT.cpp: - -2012-03-05 Oliver Hunt - - Add basic support for constant blinding to the JIT - https://bugs.webkit.org/show_bug.cgi?id=80354 - - Reviewed by Filip Pizlo. - - This patch adds basic constant blinding support to the JIT, at the - MacroAssembler level. This means all JITs in JSC (Yarr, baseline, and DFG) - get constant blinding. Woo! - - This patch only introduces blinding for Imm32, a later patch will do similar - for ImmPtr. In order to make misuse of Imm32 as a trusted type essentially - impossible, we make TrustedImm32 a private parent of Imm32 and add an explicit - accessor that's needed to access the actual value. This also means you cannot - accidentally pass an untrusted value to a function that does not perform - blinding. - - To make everything work sensibly, this patch also corrects some code that was using - Imm32 when TrustedImm32 could be used, and refactors a few callers that use - untrusted immediates, so that they call slightly different varaints of the functions - that they used previously. This is largely necessary to deal with x86-32 not having - sufficient registers to handle the additional work required when we choose to blind - a constant. - - * assembler/AbstractMacroAssembler.h: - (JSC::AbstractMacroAssembler::Imm32::asTrustedImm32): - (Imm32): - (JSC::AbstractMacroAssembler::beginUninterruptedSequence): - (JSC::AbstractMacroAssembler::endUninterruptedSequence): - (JSC::AbstractMacroAssembler::AbstractMacroAssembler): - (AbstractMacroAssembler): - (JSC::AbstractMacroAssembler::inUninterruptedSequence): - (JSC::AbstractMacroAssembler::random): - (JSC::AbstractMacroAssembler::scratchRegisterForBlinding): - (JSC::AbstractMacroAssembler::shouldBlindForSpecificArch): - * assembler/MacroAssembler.h: - (JSC::MacroAssembler::addressForPoke): - (MacroAssembler): - (JSC::MacroAssembler::poke): - (JSC::MacroAssembler::branchPtr): - (JSC::MacroAssembler::branch32): - (JSC::MacroAssembler::convertInt32ToDouble): - (JSC::MacroAssembler::shouldBlind): - (JSC::MacroAssembler::BlindedImm32::BlindedImm32): - (BlindedImm32): - (JSC::MacroAssembler::keyForConstant): - (JSC::MacroAssembler::xorBlindConstant): - (JSC::MacroAssembler::additionBlindedConstant): - (JSC::MacroAssembler::andBlindedConstant): - (JSC::MacroAssembler::orBlindedConstant): - (JSC::MacroAssembler::loadXorBlindedConstant): - (JSC::MacroAssembler::add32): - (JSC::MacroAssembler::addPtr): - (JSC::MacroAssembler::and32): - (JSC::MacroAssembler::andPtr): - (JSC::MacroAssembler::move): - (JSC::MacroAssembler::or32): - (JSC::MacroAssembler::store32): - (JSC::MacroAssembler::sub32): - (JSC::MacroAssembler::subPtr): - (JSC::MacroAssembler::xor32): - (JSC::MacroAssembler::branchAdd32): - (JSC::MacroAssembler::branchMul32): - (JSC::MacroAssembler::branchSub32): - (JSC::MacroAssembler::trustedImm32ForShift): - (JSC::MacroAssembler::lshift32): - (JSC::MacroAssembler::rshift32): - (JSC::MacroAssembler::urshift32): - * assembler/MacroAssemblerARMv7.h: - (MacroAssemblerARMv7): - (JSC::MacroAssemblerARMv7::scratchRegisterForBlinding): - (JSC::MacroAssemblerARMv7::shouldBlindForSpecificArch): - * assembler/MacroAssemblerX86_64.h: - (JSC::MacroAssemblerX86_64::branchSubPtr): - (MacroAssemblerX86_64): - (JSC::MacroAssemblerX86_64::scratchRegisterForBlinding): - * dfg/DFGJITCompiler.cpp: - (JSC::DFG::JITCompiler::linkOSRExits): - (JSC::DFG::JITCompiler::compileBody): - (JSC::DFG::JITCompiler::compileFunction): - * dfg/DFGOSRExitCompiler32_64.cpp: - (JSC::DFG::OSRExitCompiler::compileExit): - * dfg/DFGOSRExitCompiler64.cpp: - (JSC::DFG::OSRExitCompiler::compileExit): - * dfg/DFGSpeculativeJIT.cpp: - (JSC::DFG::SpeculativeJIT::compile): - (JSC::DFG::SpeculativeJIT::compileArithSub): - (JSC::DFG::SpeculativeJIT::compileStrictEqForConstant): - * dfg/DFGSpeculativeJIT.h: - (JSC::DFG::SpeculativeJIT::callOperation): - * dfg/DFGSpeculativeJIT32_64.cpp: - (JSC::DFG::SpeculativeJIT::emitCall): - (JSC::DFG::SpeculativeJIT::compileObjectEquality): - (JSC::DFG::SpeculativeJIT::compileDoubleCompare): - (JSC::DFG::SpeculativeJIT::compile): - * dfg/DFGSpeculativeJIT64.cpp: - (JSC::DFG::SpeculativeJIT::emitCall): - (JSC::DFG::SpeculativeJIT::compileDoubleCompare): - (JSC::DFG::SpeculativeJIT::compile): - * jit/JIT.cpp: - (JSC::JIT::privateCompileSlowCases): - (JSC::JIT::privateCompile): - * jit/JITArithmetic.cpp: - (JSC::JIT::compileBinaryArithOp): - (JSC::JIT::emit_op_add): - (JSC::JIT::emit_op_mul): - (JSC::JIT::emit_op_div): - * jit/JITArithmetic32_64.cpp: - (JSC::JIT::emitAdd32Constant): - (JSC::JIT::emitSub32Constant): - (JSC::JIT::emitBinaryDoubleOp): - (JSC::JIT::emitSlow_op_mul): - (JSC::JIT::emit_op_div): - * jit/JITCall.cpp: - (JSC::JIT::compileLoadVarargs): - * jit/JITCall32_64.cpp: - (JSC::JIT::compileLoadVarargs): - * jit/JITInlineMethods.h: - (JSC::JIT::updateTopCallFrame): - (JSC::JIT::emitValueProfilingSite): - * jit/JITOpcodes32_64.cpp: - (JSC::JIT::emitSlow_op_jfalse): - (JSC::JIT::emitSlow_op_jtrue): - * jit/JITStubCall.h: - (JITStubCall): - (JSC::JITStubCall::addArgument): - * yarr/YarrJIT.cpp: - (JSC::Yarr::YarrGenerator::backtrack): - -2012-03-05 Gavin Barraclough - - putByIndex should throw in strict mode - https://bugs.webkit.org/show_bug.cgi?id=80335 - - Reviewed by Filip Pizlo. - - We'll need to pass an additional parameter. - - Part 1 - rename JSValue::put() for integer indices to JSValue::putByIndex() - to match the method in the MethodTable, make this take a parameter indicating - whether the put should throw. This fixes the cases where the base of the put - is a primitive. - - * dfg/DFGOperations.cpp: - (DFG): - (JSC::DFG::putByVal): - (JSC::DFG::operationPutByValInternal): - * interpreter/Interpreter.cpp: - (JSC::Interpreter::execute): - (JSC::Interpreter::privateExecute): - * jit/JITStubs.cpp: - (JSC::DEFINE_STUB_FUNCTION): - * llint/LLIntSlowPaths.cpp: - (JSC::LLInt::LLINT_SLOW_PATH_DECL): - * runtime/JSObject.h: - (JSC::JSValue::putByIndex): - * runtime/JSValue.cpp: - (JSC): - * runtime/JSValue.h: - (JSValue): - -2012-03-05 Sam Weinig - - Add support for hosting layers in the window server in WebKit2 - - https://bugs.webkit.org/show_bug.cgi?id=80310 - - Reviewed by Anders Carlsson. - - * wtf/Platform.h: - Add HAVE_LAYER_HOSTING_IN_WINDOW_SERVER. - -2012-03-05 Filip Pizlo - - Unreviewed, attempted build fix for !ENABLE(JIT) after r109705. - - * bytecode/ExecutionCounter.cpp: - (JSC::ExecutionCounter::applyMemoryUsageHeuristics): - * bytecode/ExecutionCounter.h: - -2012-03-05 Patrick Gansterer - - Unreviewed. Build fix for !ENABLE(JIT) after r109705. - - * bytecode/ExecutionCounter.cpp: - * bytecode/ExecutionCounter.h: - -2012-03-05 Andy Wingo - - Lexer: Specialize character predicates for LChar, UChar - https://bugs.webkit.org/show_bug.cgi?id=79677 - - Reviewed by Oliver Hunt. - - This patch specializes isIdentStart, isIdentPart, isWhiteSpace, - and isLineTerminator to perform a more limited number of checks if - the lexer is being instantiated to work on LChar sequences. This - is about a 1.5% win on the --parse-only suite, here. - - * parser/Lexer.cpp: - (JSC::isLatin1): New static helper, specialized for LChar and - UChar. - (JSC::typesOfLatin1Characters): Rename from - typesOfASCIICharacters, and expand to the range of the LChar - type. All uses of isASCII are changed to use isLatin1. Generated - using libunistring. - (JSC::isNonLatin1IdentStart): - (JSC::isIdentStart): - (JSC::isNonLatin1IdentPart): - (JSC::isIdentPart): - (JSC::Lexer::shiftLineTerminator): - (JSC::Lexer::parseIdentifier): - (JSC::Lexer::parseIdentifierSlowCase): - (JSC::Lexer::parseStringSlowCase): - (JSC::Lexer::parseMultilineComment): - (JSC::Lexer::lex): - (JSC::Lexer::scanRegExp): - (JSC::Lexer::skipRegExp): Sprinkle static_cast(_) around. - * parser/Lexer.h: - (JSC::Lexer::isWhiteSpace): - (JSC::Lexer::isLineTerminator): - * KeywordLookupGenerator.py: - (Trie.printAsC): Declare specialized isIdentPart static functions. - -2012-03-05 Carlos Garcia Campos - - Unreviewed. Fix make distcheck. - - * GNUmakefile.list.am: Add missing header file. - -2012-03-05 Andy Wingo - - WTF: Micro-optimize cleanup of empty vectors and hash tables - https://bugs.webkit.org/show_bug.cgi?id=79903 - - Reviewed by Michael Saboff and Geoffrey Garen. - - This patch speeds up cleanup of vectors and hash tables whose - backing store was never allocated. This is the case by default - for most vectors / hash tables that never had any entries added. - - The result for me is that calling checkSyntax 1000 times on - concat-jquery-mootools-prototype.js goes from 6.234s to 6.068s, a - 2.4% speedup. - - * wtf/HashTable.h: - (WTF::HashTable::~HashTable): - (WTF::::clear): Don't deallocate the storage or frob member - variables if there is no backing storage. - * wtf/Vector.h: - (WTF::VectorBufferBase::deallocateBuffer): Likewise. - -2012-03-04 Filip Pizlo - - JIT heuristics should be hyperbolic - https://bugs.webkit.org/show_bug.cgi?id=80055 - - - Reviewed by Oliver Hunt. - - Added tracking of the amount of executable memory typically used for a bytecode - instruction. Modified the execution counter scheme to use this, and the amount - of free memory, to determine how long to wait before invoking the JIT. - - The result is that even if we bomb the VM with more code than can fit in our - executable memory pool, we still keep running and almost never run out of - executable memory - which ensures that if we have to JIT something critical, then - we'll likely have enough memory to do so. This also does not regress performance - on the three main benchmarks. - - * CMakeLists.txt: - * GNUmakefile.list.am: - * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj: - * JavaScriptCore.xcodeproj/project.pbxproj: - * Target.pri: - * bytecode/CodeBlock.cpp: - (JSC::CodeBlock::predictedMachineCodeSize): - (JSC): - (JSC::CodeBlock::usesOpcode): - * bytecode/CodeBlock.h: - (CodeBlock): - (JSC::CodeBlock::checkIfJITThresholdReached): - (JSC::CodeBlock::dontJITAnytimeSoon): - (JSC::CodeBlock::jitAfterWarmUp): - (JSC::CodeBlock::jitSoon): - (JSC::CodeBlock::llintExecuteCounter): - (JSC::CodeBlock::counterValueForOptimizeAfterWarmUp): - (JSC::CodeBlock::counterValueForOptimizeAfterLongWarmUp): - (JSC::CodeBlock::addressOfJITExecuteCounter): - (JSC::CodeBlock::offsetOfJITExecuteCounter): - (JSC::CodeBlock::offsetOfJITExecutionActiveThreshold): - (JSC::CodeBlock::offsetOfJITExecutionTotalCount): - (JSC::CodeBlock::jitExecuteCounter): - (JSC::CodeBlock::checkIfOptimizationThresholdReached): - (JSC::CodeBlock::optimizeNextInvocation): - (JSC::CodeBlock::dontOptimizeAnytimeSoon): - (JSC::CodeBlock::optimizeAfterWarmUp): - (JSC::CodeBlock::optimizeAfterLongWarmUp): - (JSC::CodeBlock::optimizeSoon): - * bytecode/ExecutionCounter.cpp: Added. - (JSC): - (JSC::ExecutionCounter::ExecutionCounter): - (JSC::ExecutionCounter::checkIfThresholdCrossedAndSet): - (JSC::ExecutionCounter::setNewThreshold): - (JSC::ExecutionCounter::deferIndefinitely): - (JSC::ExecutionCounter::applyMemoryUsageHeuristics): - (JSC::ExecutionCounter::applyMemoryUsageHeuristicsAndConvertToInt): - (JSC::ExecutionCounter::hasCrossedThreshold): - (JSC::ExecutionCounter::setThreshold): - (JSC::ExecutionCounter::reset): - * bytecode/ExecutionCounter.h: Added. - (JSC): - (ExecutionCounter): - (JSC::ExecutionCounter::formattedTotalCount): - * dfg/DFGOSRExitCompiler32_64.cpp: - (JSC::DFG::OSRExitCompiler::compileExit): - * dfg/DFGOSRExitCompiler64.cpp: - (JSC::DFG::OSRExitCompiler::compileExit): - * jit/ExecutableAllocator.cpp: - (JSC::DemandExecutableAllocator::allocateNewSpace): - (JSC::ExecutableAllocator::underMemoryPressure): - (JSC): - (JSC::ExecutableAllocator::memoryPressureMultiplier): - * jit/ExecutableAllocator.h: - * jit/ExecutableAllocatorFixedVMPool.cpp: - (JSC::ExecutableAllocator::memoryPressureMultiplier): - (JSC): - * jit/JIT.cpp: - (JSC::JIT::privateCompile): - * jit/JITStubs.cpp: - (JSC::DEFINE_STUB_FUNCTION): - * llint/LLIntSlowPaths.cpp: - (JSC::LLInt::jitCompileAndSetHeuristics): - * llint/LowLevelInterpreter32_64.asm: - * runtime/JSGlobalData.h: - (JSGlobalData): - * runtime/Options.cpp: - (Options): - (JSC::Options::initializeOptions): - * runtime/Options.h: - (Options): - * wtf/SimpleStats.h: Added. - (WTF): - (SimpleStats): - (WTF::SimpleStats::SimpleStats): - (WTF::SimpleStats::add): - (WTF::SimpleStats::operator!): - (WTF::SimpleStats::count): - (WTF::SimpleStats::sum): - (WTF::SimpleStats::sumOfSquares): - (WTF::SimpleStats::mean): - (WTF::SimpleStats::variance): - (WTF::SimpleStats::standardDeviation): - -2012-03-04 Raphael Kubo da Costa - - [CMake] Libraries are installed to /usr/lib and not /usr/lib64 on x86_64 - https://bugs.webkit.org/show_bug.cgi?id=71507 - - Reviewed by Antonio Gomes. - - * CMakeLists.txt: Use ${LIB_INSTALL_DIR} instead of hardcoding "lib". - -2012-03-04 David Kilzer - - Fix build when the classic interpreter is enabled - - Reviewed by Gavin Barraclough. - - Fixes the following build error when running the "Generate - Derived Sources" build phase script: - - offlineasm: Parsing JavaScriptCore/llint/LowLevelInterpreter.asm and ../../JSCLLIntOffsetsExtractor and creating assembly file LLIntAssembly.h. - ./JavaScriptCore/offlineasm/offsets.rb:145:in `offsetsAndConfigurationIndex': unhandled exception - from JavaScriptCore/offlineasm/asm.rb:131 - Command /bin/sh failed with exit code 1 - - Gavin's fix in r109674 avoided the #error statement in - JITStubs.h when compiling LLIntOffsetsExtractor.cpp, but it - caused the "Generate Derived Sources" build phase script to fail - when JavaScriptCore/offlineasm/asm.rb was run. The solution is - to detect when the classic interpreter is being built and simply - exit early from asm.rb in that case. - - * llint/LLIntOffsetsExtractor.cpp: - (JSC::LLIntOffsetsExtractor::dummy): Return NULL pointer if the - JIT is disabled. Note that offsets.rb doesn't care about the - return value here, but instead it cares about finding the magic - values in the binary. The magic values are no longer present - when the JIT is disabled. - * offlineasm/asm.rb: Catch MissingMagicValuesException and exit - early with a status message. - * offlineasm/offsets.rb: - (MissingMagicValuesException): Add new exception class. - (offsetsAndConfigurationIndex): Throw - MissingMagicValuesException when no magic values are found. - -2012-03-04 Jurij Smakov - - SPARC also needs aligned accesses. - - Rubber-stamped by Gustavo Noronha Silva. - - * wtf/Platform.h: - -2012-03-04 Gavin Barraclough - - Unreviewed build fix. - - * jit/JITStubs.h: - - Move ENABLE(JIT) to head of file. - -2012-03-03 Gavin Barraclough - - Split JSArray's [[Put]] & [[DefineOwnProperty]] traps. - https://bugs.webkit.org/show_bug.cgi?id=80217 - - Reviewed by Filip Pizlo. - - putByIndex() provides similar behavior to put(), but for indexed property names. - Many places in ArrayPrototype call putByIndex() where they really mean to call - [[DefineOwnProperty]]. This is only okay due to a bug – putByIndex should be - calling numeric accessors (& respecting numeric read only properties) on the - prototype chain, but isn't. Add a new putDirectIndex (matching JSObject's - putDirect* methods), to correctly provide a fast [[DefineOwnProperty]] interface. - - * runtime/ArrayPrototype.cpp: - (JSC::arrayProtoFuncConcat): - (JSC::arrayProtoFuncSlice): - (JSC::arrayProtoFuncFilter): - (JSC::arrayProtoFuncMap): - * runtime/JSArray.cpp: - (JSC): - (JSC::reject): - (JSC::SparseArrayValueMap::putDirect): - (JSC::JSArray::defineOwnNumericProperty): - (JSC::JSArray::putByIndexBeyondVectorLength): - (JSC::JSArray::putDirectIndexBeyondVectorLength): - * runtime/JSArray.h: - (SparseArrayValueMap): - (JSArray): - (JSC::JSArray::putDirectIndex): - -2012-03-03 Benjamin Poulain - - Implement the basis of KURLWTFURL - https://bugs.webkit.org/show_bug.cgi?id=79600 - - Reviewed by Adam Barth. - - Add an API to know if a ParsedURL is valid. - - * wtf/url/api/ParsedURL.cpp: - (WTF::ParsedURL::ParsedURL): - (WTF): - (WTF::ParsedURL::isolatedCopy): This is needed by APIs moving URL objects between thread - and by KURL's detach() on write. - (WTF::ParsedURL::baseAsString): - (WTF::ParsedURL::segment): - Add a stronger constraint on accessors: the client of this API should never ask for the segments - on an invalid URL. - * wtf/url/api/ParsedURL.h: - (WTF): - (WTF::ParsedURL::ParsedURL): - (ParsedURL): - (WTF::ParsedURL::isValid): - -2012-03-03 Hans Wennborg - - Implement Speech JavaScript API - https://bugs.webkit.org/show_bug.cgi?id=80019 - - Reviewed by Adam Barth. - - Add ENABLE_SCRIPTED_SPEECH. - - * Configurations/FeatureDefines.xcconfig: - -2012-03-02 Filip Pizlo - - When getting the line number of a call into a call frame with no code block, it's - incorrect to rely on the returnPC - https://bugs.webkit.org/show_bug.cgi?id=80195 - - Reviewed by Oliver Hunt. - - * interpreter/Interpreter.cpp: - (JSC::getCallerInfo): - * jit/JITCall.cpp: - (JSC::JIT::compileLoadVarargs): - -2012-03-02 Han Hojong - - Expected results updated for checking type conversion - https://bugs.webkit.org/show_bug.cgi?id=80138 - - Reviewed by Gavin Barraclough. - - * tests/mozilla/ecma/TypeConversion/9.3.1-3.js: - -2012-03-02 Kenichi Ishibashi - - Adding WebSocket per-frame DEFLATE extension - https://bugs.webkit.org/show_bug.cgi?id=77522 - - Added USE(ZLIB) flag. - - Reviewed by Kent Tamura. - - * wtf/Platform.h: - -2012-03-02 Filip Pizlo - - Unreviewed build fix for platforms that have DFG_JIT disabled but PARALLEL_GC enabled. - - * bytecode/CodeBlock.cpp: - (JSC::CodeBlock::visitAggregate): - -2012-03-01 Filip Pizlo - - DFGCodeBlocks should not trace CodeBlocks that are also going to be traced by - virtue of being in the transitive closure - https://bugs.webkit.org/show_bug.cgi?id=80098 - - Reviewed by Anders Carlsson. - - If DFGCodeBlocks traces a CodeBlock that might also be traced via its owner Executable, - then you might have the visitAggregate() method called concurrently by multiple threads. - This is benign on 64-bit -- visitAggregate() and everything it calls turns out to be - racy and slightly imprecise but not unsound. But on 32-bit, visitAggregate() may crash - due to word tearing in ValueProfile bucket updates inside of computeUpdatedPrediction(). - - It would seem that the fix is just to have DFGCodeBlocks not trace CodeBlocks that are - not jettisoned. But CodeBlocks may be jettisoned later during the GC, so it must trace - any CodeBlock that it knows to be live by virtue of it being reachable from the stack. - Hence the real fix is to make sure that concurrent calls into CodeBlock::visitAggregate() - don't lead to two threads racing over each other as they clobber state. This patch - achieves this with a simple CAS loop: whichever thread wins the CAS race (which is - trivially linearizable) will get to trace the CodeBlock; all other threads give up and - go home. - - Unfortunately there will be no new tests. It's possible to reproduce this maybe 1/10 - times by running V8-v6's raytrace repeatedly, using the V8 harness hacked to rerun it - even when it's gotten sufficient counts. But that takes a while - sometimes up to a - minute to get a crash. I have no other reliable repro case. - - * bytecode/CodeBlock.cpp: - (JSC::CodeBlock::visitAggregate): - * bytecode/CodeBlock.h: - (DFGData): - * heap/DFGCodeBlocks.cpp: - (JSC::DFGCodeBlocks::clearMarks): - -2012-03-01 Filip Pizlo - - The JIT should not crash the entire process just because there is not enough executable - memory, if the LLInt is enabled - https://bugs.webkit.org/show_bug.cgi?id=79962 - - Reviewed by Csaba Osztrogonác. - - Fix for ARM, SH4. - - * assembler/AssemblerBufferWithConstantPool.h: - (JSC::AssemblerBufferWithConstantPool::executableCopy): - -2012-03-01 Ryosuke Niwa - - Revert my change. Broke builds. - Source/JavaScriptCore/wtf/Atomics.h:188: error: redefinition of 'bool WTF::weakCompareAndSwap(volatile uintptr_t*, uintptr_t, uintptr_t)' - Source/JavaScriptCore/wtf/Atomics.h:122: error: 'bool WTF::weakCompareAndSwap(volatile unsigned int*, unsigned int, unsigned i - - * wtf/Atomics.h: - (WTF): - (WTF::weakCompareAndSwap): - -2012-03-01 Ryosuke Niwa - - Gcc build fix. - - Rubber-stamped by Filip Pizlo. - - * wtf/Atomics.h: - (WTF): - (WTF::weakCompareAndSwap): - -2012-03-01 Gavin Barraclough - - ES5.1-15.3.5.4. prohibits Function.caller from [[Get]]ting a strict caller - https://bugs.webkit.org/show_bug.cgi?id=80011 - - Reviewed by Oliver Hunt. - - Also, fix getting the caller from within a bound function, for within a getter, - or setter (make our implementation match other browsers). - - * interpreter/Interpreter.cpp: - (JSC::getCallerInfo): - - Allow this to get the caller of host functions. - (JSC::Interpreter::retrieveCallerFromVMCode): - - This should use getCallerInfo, and should skip over function bindings. - * runtime/JSFunction.cpp: - (JSC::JSFunction::callerGetter): - - This should never return a strict-mode function. - -2012-03-01 Yuqiang Xian - - DFG local CSE for a node can be terminated earlier - https://bugs.webkit.org/show_bug.cgi?id=80014 - - Reviewed by Filip Pizlo. - - When one of the node's childredn is met in the process of back traversing - the nodes, we don't need to traverse the remaining nodes. - This is performance neutral on SunSpider, V8 and Kraken. - - * dfg/DFGCSEPhase.cpp: - (JSC::DFG::CSEPhase::pureCSE): - (JSC::DFG::CSEPhase::impureCSE): - (JSC::DFG::CSEPhase::getByValLoadElimination): - (JSC::DFG::CSEPhase::checkFunctionElimination): - (JSC::DFG::CSEPhase::checkStructureLoadElimination): - (JSC::DFG::CSEPhase::getByOffsetLoadElimination): - (JSC::DFG::CSEPhase::getPropertyStorageLoadElimination): - (JSC::DFG::CSEPhase::getIndexedPropertyStorageLoadElimination): - -2012-02-29 Yuqiang Xian - - DFG BasicBlocks should not require that their nodes have continuous indices in the graph - https://bugs.webkit.org/show_bug.cgi?id=79899 - - Reviewed by Filip Pizlo. - - This will make it more convenient to insert nodes into the DFG. - With this capability we now place the Phi nodes in the corresponding - blocks. - Local CSE is modified to not to rely on the assumption of continuous - node indices in a block. - This is performance neutral on SunSpider, V8 and Kraken. - - * dfg/DFGAbstractState.cpp: - (JSC::DFG::AbstractState::AbstractState): - (JSC::DFG::AbstractState::beginBasicBlock): - (JSC::DFG::AbstractState::execute): - (JSC::DFG::AbstractState::clobberStructures): - (JSC::DFG::AbstractState::mergeToSuccessors): - (JSC::DFG::AbstractState::dump): - * dfg/DFGAbstractState.h: - (JSC::DFG::AbstractState::forNode): - (AbstractState): - * dfg/DFGArithNodeFlagsInferencePhase.cpp: - (ArithNodeFlagsInferencePhase): - * dfg/DFGBasicBlock.h: - (JSC::DFG::BasicBlock::BasicBlock): - (BasicBlock): - * dfg/DFGByteCodeParser.cpp: - (JSC::DFG::ByteCodeParser::addToGraph): - (ByteCodeParser): - (JSC::DFG::ByteCodeParser::insertPhiNode): - (JSC::DFG::ByteCodeParser::handleInlining): - (JSC::DFG::ByteCodeParser::parseBlock): - (JSC::DFG::ByteCodeParser::processPhiStack): - (JSC::DFG::ByteCodeParser::linkBlock): - (JSC::DFG::ByteCodeParser::determineReachability): - (JSC::DFG::ByteCodeParser::parseCodeBlock): - * dfg/DFGCFAPhase.cpp: - (JSC::DFG::CFAPhase::performBlockCFA): - (CFAPhase): - * dfg/DFGCSEPhase.cpp: - (JSC::DFG::CSEPhase::CSEPhase): - (JSC::DFG::CSEPhase::endIndexForPureCSE): - (JSC::DFG::CSEPhase::pureCSE): - (JSC::DFG::CSEPhase::impureCSE): - (JSC::DFG::CSEPhase::globalVarLoadElimination): - (JSC::DFG::CSEPhase::getByValLoadElimination): - (JSC::DFG::CSEPhase::checkFunctionElimination): - (JSC::DFG::CSEPhase::checkStructureLoadElimination): - (JSC::DFG::CSEPhase::getByOffsetLoadElimination): - (JSC::DFG::CSEPhase::getPropertyStorageLoadElimination): - (JSC::DFG::CSEPhase::getIndexedPropertyStorageLoadElimination): - (JSC::DFG::CSEPhase::getScopeChainLoadElimination): - (JSC::DFG::CSEPhase::performNodeCSE): - (JSC::DFG::CSEPhase::performBlockCSE): - (CSEPhase): - * dfg/DFGGraph.cpp: - (JSC::DFG::Graph::dump): - * dfg/DFGPhase.cpp: - (JSC::DFG::Phase::beginPhase): - * dfg/DFGSpeculativeJIT.cpp: - (JSC::DFG::SpeculativeJIT::nonSpeculativeCompare): - (JSC::DFG::SpeculativeJIT::nonSpeculativeStrictEq): - (JSC::DFG::SpeculativeJIT::compilePeepHoleBranch): - (JSC::DFG::SpeculativeJIT::compile): - (JSC::DFG::SpeculativeJIT::compileStrictEqForConstant): - (JSC::DFG::SpeculativeJIT::compileStrictEq): - * dfg/DFGSpeculativeJIT.h: - (SpeculativeJIT): - (JSC::DFG::SpeculativeJIT::detectPeepHoleBranch): - (JSC::DFG::SpeculativeJIT::SpeculativeJIT): - * dfg/DFGSpeculativeJIT32_64.cpp: - (JSC::DFG::SpeculativeJIT::nonSpeculativeCompareNull): - * dfg/DFGSpeculativeJIT64.cpp: - (JSC::DFG::SpeculativeJIT::nonSpeculativeCompareNull): - * dfg/DFGVirtualRegisterAllocationPhase.cpp: - (JSC::DFG::VirtualRegisterAllocationPhase::run): - -2012-02-29 Filip Pizlo - - The JIT should not crash the entire process just because there is not - enough executable memory, if the LLInt is enabled - https://bugs.webkit.org/show_bug.cgi?id=79962 - - - Unreviewed, adding forgotten file. - - * jit/JITCompilationEffort.h: Added. - (JSC): - -2012-02-29 Filip Pizlo - - The JIT should not crash the entire process just because there is not - enough executable memory, if the LLInt is enabled - https://bugs.webkit.org/show_bug.cgi?id=79962 - - - Reviewed by Gavin Barraclough. - - Added the notion of JITCompilationEffort. If we're JIT'ing as a result of - a tier-up, then we set it to JITCompilationCanFail. Otherwise it's - JITCompilationMustSucceed. This preserves the old behavior of LLInt is - disabled or if we're compiling something that can't be interpreted (like - an OSR exit stub). - - * JavaScriptCore.xcodeproj/project.pbxproj: - * assembler/ARMAssembler.cpp: - (JSC::ARMAssembler::executableCopy): - * assembler/ARMAssembler.h: - (ARMAssembler): - * assembler/AssemblerBuffer.h: - (JSC::AssemblerBuffer::executableCopy): - * assembler/LinkBuffer.h: - (JSC::LinkBuffer::LinkBuffer): - (JSC::LinkBuffer::~LinkBuffer): - (LinkBuffer): - (JSC::LinkBuffer::didFailToAllocate): - (JSC::LinkBuffer::isValid): - (JSC::LinkBuffer::linkCode): - (JSC::LinkBuffer::performFinalization): - * assembler/MIPSAssembler.h: - (JSC::MIPSAssembler::executableCopy): - * assembler/SH4Assembler.h: - (JSC::SH4Assembler::executableCopy): - * assembler/X86Assembler.h: - (JSC::X86Assembler::executableCopy): - (JSC::X86Assembler::X86InstructionFormatter::executableCopy): - * bytecode/CodeBlock.cpp: - (JSC::ProgramCodeBlock::jitCompileImpl): - (JSC::EvalCodeBlock::jitCompileImpl): - (JSC::FunctionCodeBlock::jitCompileImpl): - * bytecode/CodeBlock.h: - (JSC::CodeBlock::jitCompile): - (CodeBlock): - (ProgramCodeBlock): - (EvalCodeBlock): - (FunctionCodeBlock): - * dfg/DFGDriver.cpp: - (JSC::DFG::compile): - * dfg/DFGJITCompiler.cpp: - (JSC::DFG::JITCompiler::compile): - (JSC::DFG::JITCompiler::compileFunction): - * dfg/DFGJITCompiler.h: - (JITCompiler): - * jit/ExecutableAllocator.cpp: - (JSC::DemandExecutableAllocator::allocateNewSpace): - (JSC::ExecutableAllocator::allocate): - * jit/ExecutableAllocator.h: - (ExecutableAllocator): - * jit/ExecutableAllocatorFixedVMPool.cpp: - (JSC::ExecutableAllocator::allocate): - * jit/JIT.cpp: - (JSC::JIT::privateCompile): - * jit/JIT.h: - (JSC::JIT::compile): - (JIT): - * jit/JITCompilationEffort.h: Added. - (JSC): - * jit/JITDriver.h: - (JSC::jitCompileIfAppropriate): - (JSC::jitCompileFunctionIfAppropriate): - * llint/LLIntSlowPaths.cpp: - (LLInt): - (JSC::LLInt::jitCompileAndSetHeuristics): - (JSC::LLInt::entryOSR): - (JSC::LLInt::LLINT_SLOW_PATH_DECL): - * runtime/Executable.cpp: - (JSC::EvalExecutable::jitCompile): - (JSC::ProgramExecutable::jitCompile): - (JSC::FunctionExecutable::jitCompileForCall): - (JSC::FunctionExecutable::jitCompileForConstruct): - * runtime/Executable.h: - (EvalExecutable): - (ProgramExecutable): - (FunctionExecutable): - (JSC::FunctionExecutable::jitCompileFor): - * runtime/ExecutionHarness.h: - (JSC::prepareForExecution): - (JSC::prepareFunctionForExecution): - -2012-02-29 No'am Rosenthal - - [Qt][WK2] Get rid of the #ifdef mess in LayerTreeHost[Proxy] - https://bugs.webkit.org/show_bug.cgi?id=79501 - - Enable WTF_USE_UI_SIDE_COMPOSITING for Qt. - - Reviewed by Kenneth Rohde Christiansen. - - * wtf/Platform.h: - -2012-02-29 Gavin Barraclough - - Rubber stamped by Oliver Hunt. - - * tests/mozilla/ecma_2/RegExp/constructor-001.js: - * tests/mozilla/ecma_2/RegExp/function-001.js: - * tests/mozilla/ecma_2/RegExp/properties-001.js: - - Check in new test cases results. - -2012-02-29 Mark Rowe - - Stop installing JSCLLIntOffsetsExtractor. - - Replace the separate TestRegExp and TestAPI xcconfig files with a single ToolExecutable xcconfig file - that derives the product name from the target name. We can then use that xcconfig file for JSCLLIntOffsetsExtractor. - This has the results of setting SKIP_INSTALL = YES for JSCLLIntOffsetsExtractor. - - While I was doing this fiddling I noticed that the JSCLLIntOffsetsExtractor target had a custom value - for USER_HEADER_SEARCH_PATHS to allow it to find LLIntDesiredOffsets.h. A better way of doing that is - to add LLIntDesiredOffsets.h to the Xcode project so that it'll be included in the header map. That - allows us to remove the override of USER_HEADER_SEARCH_PATHS entirely. So I did that too! - - Reviewed by Filip Pizlo. - - * Configurations/TestRegExp.xcconfig: Removed. - * Configurations/ToolExecutable.xcconfig: Renamed from Source/JavaScriptCore/Configurations/TestAPI.xcconfig. - * JavaScriptCore.xcodeproj/project.pbxproj: - -2012-02-28 Filip Pizlo - - RefCounted::deprecatedTurnOffVerifier() should not be deprecated - https://bugs.webkit.org/show_bug.cgi?id=79864 - - Reviewed by Oliver Hunt. - - Removed the word "deprecated" from the name of this method, since this method - should not be deprecated. It works just fine as it is, and there is simply no - alternative to calling this method for many interesting JSC classes. - - * parser/SourceProvider.h: - (JSC::SourceProvider::SourceProvider): - * runtime/SymbolTable.h: - (JSC::SharedSymbolTable::SharedSymbolTable): - * wtf/MetaAllocator.cpp: - (WTF::MetaAllocatorHandle::MetaAllocatorHandle): - (WTF::MetaAllocator::allocate): - * wtf/RefCounted.h: - (RefCountedBase): - (WTF::RefCountedBase::turnOffVerifier): - -2012-02-29 Gavin Barraclough - - 'source' property of RegExp instance cannot be "" - https://bugs.webkit.org/show_bug.cgi?id=79938 - - Reviewed by Oliver Hunt. - - 15.10.6.4 specifies that RegExp.prototype.toString must return '/' + source + '/', - and also states that the result must be a valid RegularExpressionLiteral. '//' is - not a valid RegularExpressionLiteral (since it is a single line comment), and hence - source cannot ever validly be "". If the source is empty, return a different Pattern - that would match the same thing. - - * runtime/RegExpObject.cpp: - (JSC::regExpObjectSource): - - Do not return "" if the source is empty, this would lead to invalid behaviour in toString. - * runtime/RegExpPrototype.cpp: - (JSC::regExpProtoFuncToString): - - No need to special case the empty string - this should be being done by 'source'. - -2012-02-29 Gavin Barraclough - - Writable attribute not set correctly when redefining an accessor to a data descriptor - https://bugs.webkit.org/show_bug.cgi?id=79931 - - Reviewed by Oliver Hunt. - - * runtime/JSObject.cpp: - (JSC::JSObject::defineOwnProperty): - - use attributesOverridingCurrent instead of attributesWithOverride. - * runtime/PropertyDescriptor.cpp: - * runtime/PropertyDescriptor.h: - - remove attributesWithOverride - attributesOverridingCurrent does the same thing. - -2012-02-29 Kevin Ollivier - - Add JSCore symbol exports needed by wx port - https://bugs.webkit.org/show_bug.cgi?id=77280 - - Reviewed by Hajime Morita. - - * wtf/ArrayBufferView.h: - * wtf/ExportMacros.h: - -2012-02-28 Raphael Kubo da Costa - - [CMake] Always build wtf as a static library. - https://bugs.webkit.org/show_bug.cgi?id=79857 - - Reviewed by Eric Seidel. - - To help the efforts in bug 75673 to move WTF out of - JavaScriptCore, act more like the other ports and remove the - possibility of building WTF as a shared library. - - It does not make much sense to, for example, ship WTF as a - separate .so with webkit-efl packages, and it should be small - enough not to cause problems during linking. - - * wtf/CMakeLists.txt: - -2012-02-28 Dmitry Lomov - - [JSC] Implement ArrayBuffer transfer - https://bugs.webkit.org/show_bug.cgi?id=73493. - Implement ArrayBuffer transfer, per Khronos spec: http://www.khronos.org/registry/typedarray/specs/latest/#9. - This brings parity with V8 implementation of transferable typed arrays. - - Reviewed by Oliver Hunt. - - * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def: Extra export. - * wtf/ArrayBuffer.h: - (ArrayBuffer): Added extra export. - -2012-02-28 Kevin Ollivier - - [wx] Unreviewed. Build fix after recent LLInt additions. - - * wscript: - -2012-02-28 Mark Hahnenberg - - Refactor SpeculativeJIT::emitAllocateJSFinalObject - https://bugs.webkit.org/show_bug.cgi?id=79801 - - Reviewed by Filip Pizlo. - - * dfg/DFGSpeculativeJIT.h: - (JSC::DFG::SpeculativeJIT::emitAllocateBasicJSObject): Split emitAllocateJSFinalObject out to form this - function, which is more generic in that it can allocate a variety of classes. - (SpeculativeJIT): - (JSC::DFG::SpeculativeJIT::emitAllocateJSFinalObject): Changed to use the new helper function. - -2012-02-28 Gavin Barraclough - - [[Get]]/[[Put]] for primitives should not wrap on strict accessor call - https://bugs.webkit.org/show_bug.cgi?id=79588 - - Reviewed by Oliver Hunt. - - In the case of [[Get]], this is a pretty trivial bug - just don't wrap - primitives at the point you call a getter. - - For setters, this is a little more involved, since we have already wrapped - the value up in a synthesized object. Stop doing so. There is also a further - subtely, that in strict mode all attempts to create a new data property on - the object should throw. - - * runtime/JSCell.cpp: - (JSC::JSCell::put): - - [[Put]] to a string primitive should use JSValue::putToPrimitive. - * runtime/JSObject.cpp: - (JSC::JSObject::put): - - Remove static function called in one place. - * runtime/JSObject.h: - (JSC::JSValue::put): - - [[Put]] to a non-cell JSValue should use JSValue::putToPrimitive. - * runtime/JSValue.cpp: - (JSC::JSValue::synthesizePrototype): - - Add support for synthesizing the prototype of strings. - (JSC::JSValue::putToPrimitive): - - Added, implements [[Put]] for primitive bases, per 8.7.2. - * runtime/JSValue.h: - (JSValue): - - Add declaration for JSValue::putToPrimitive. - * runtime/PropertySlot.cpp: - (JSC::PropertySlot::functionGetter): - - Don't call ToObject on primitive this values. - -2012-02-28 Mark Hahnenberg - - Re-enable parallel GC on Mac - https://bugs.webkit.org/show_bug.cgi?id=79837 - - Rubber stamped by Filip Pizlo. - - * runtime/Options.cpp: - (JSC::Options::initializeOptions): We accidentally disabled parallel GC with this line, - so we removed it and things should go back to normal. - -2012-02-28 Filip Pizlo - - Some run-javascriptcore-tests broken for 32-bit debug - https://bugs.webkit.org/show_bug.cgi?id=79844 - - Rubber stamped by Oliver Hunt. - - These assertions are just plain wrong for 32-bit. We could either have a massive - assertion that depends on value representation, that has to be changed every - time we change the JITs, resulting in a bug tail of debug-mode crashes, or we - could get rid of the assertions. I pick the latter. - - * dfg/DFGOperations.cpp: - * jit/JITStubs.cpp: - (JSC::DEFINE_STUB_FUNCTION): - -2012-02-28 Mark Hahnenberg - - Get rid of padding cruft in CopiedBlock - https://bugs.webkit.org/show_bug.cgi?id=79686 - - Reviewed by Filip Pizlo. - - * heap/CopiedBlock.h: - (CopiedBlock): Removed the extra padding that was used for alignment purposes until - the calculation of the payload offset into CopiedBlocks was redone recently. - -2012-02-28 Anders Carlsson - - Fix build with newer versions of clang. - - Clang now warns since we're not passing a CFString literal to CFStringCreateWithFormatAndArguments, - but it's OK to ignore this warning since clang is also checking that the caller (vprintf_stderr_common) - takes a string literal. - - * wtf/Assertions.cpp: - -2012-02-28 Mario Sanchez Prada - - [GTK] Add GMainLoop and GMainContext to be handled by GRefPtr - https://bugs.webkit.org/show_bug.cgi?id=79496 - - Reviewed by Martin Robinson. - - Handle GMainLoop and GMainContext in GRefPtr, by calling - g_main_loop_(un)ref and g_main_context_(un)ref in the - implementation of the refGPtr and derefGPtr template functions. - - * wtf/gobject/GRefPtr.cpp: - (WTF::refGPtr): - (WTF): - (WTF::derefGPtr): - * wtf/gobject/GRefPtr.h: - (WTF): - * wtf/gobject/GTypedefs.h: - -2012-02-28 Yong Li - - JSString::resolveRope() should report extra memory cost to the heap. - https://bugs.webkit.org/show_bug.cgi?id=79555 - - Reviewed by Michael Saboff. - - At the time a JSString is constructed with fibers, it doesn't report - extra memory cost, which is reasonable because it hasn't allocate - new memory. However when the rope is resolved, it should report meory - cost for the new buffer. - - * runtime/JSString.cpp: - (JSC::JSString::resolveRope): - -2012-02-27 Oliver Hunt - - sputnik/Unicode/Unicode_500/S7.2_A1.6_T1.html crashes in the interpreter - https://bugs.webkit.org/show_bug.cgi?id=79728 - - Reviewed by Gavin Barraclough. - - When initialising a chained get instruction we may end up in a state where - the instruction stream says we have a scopechain, but it has not yet been set - (eg. if allocating the StructureChain itself is what leads to the GC). We could - re-order the allocation, but it occurs in a couple of places, so it seems less - fragile simply to null check the scopechain slot before we actually visit the slot. - - * bytecode/CodeBlock.cpp: - (JSC::CodeBlock::visitStructures): - -2012-02-27 Filip Pizlo - - Old JIT's style of JSVALUE64 strict equality is subtly wrong - https://bugs.webkit.org/show_bug.cgi?id=79700 - - Reviewed by Oliver Hunt. - - * assembler/MacroAssemblerX86_64.h: - (JSC::MacroAssemblerX86_64::comparePtr): - (MacroAssemblerX86_64): - * dfg/DFGOperations.cpp: - * dfg/DFGSpeculativeJIT.cpp: - (JSC::DFG::SpeculativeJIT::nonSpeculativeStrictEq): - * dfg/DFGSpeculativeJIT64.cpp: - (JSC::DFG::SpeculativeJIT::nonSpeculativePeepholeStrictEq): - (JSC::DFG::SpeculativeJIT::nonSpeculativeNonPeepholeStrictEq): - * jit/JITOpcodes.cpp: - (JSC::JIT::compileOpStrictEq): - (JSC::JIT::emitSlow_op_stricteq): - (JSC::JIT::emitSlow_op_nstricteq): - * jit/JITStubs.cpp: - (JSC::DEFINE_STUB_FUNCTION): - -2012-02-27 Gavin Barraclough - - Implement support for op_negate and op_bitnot in the DFG JIT - https://bugs.webkit.org/show_bug.cgi?id=79617 - - Reviewed by Filip Pizlo. - - Add an ArithNegate op to the DFG JIT, to implement op_negate. - - This patch also adds support for op_negate to the JSVALUE64 baseline JIT - (JSVALUE32_64 already had this), so that we can profile the slowpath usage. - - This is a 2.5%-3% Sunspider progression and a 1% win on Kraken. - - * assembler/ARMv7Assembler.h: - (JSC::ARMv7Assembler::sub_S): - - Added sub_S from immediate. - (ARMv7Assembler): - (JSC::ARMv7Assembler::vneg): - - Added double negate. - * assembler/MacroAssemblerARMv7.h: - (JSC::MacroAssemblerARMv7::negateDouble): - - Added double negate. - (MacroAssemblerARMv7): - (JSC::MacroAssemblerARMv7::branchNeg32): - - Added. - * assembler/MacroAssemblerX86.h: - (MacroAssemblerX86): - - moved loadDouble, absDouble to common. - * assembler/MacroAssemblerX86Common.h: - (MacroAssemblerX86Common): - (JSC::MacroAssemblerX86Common::absDouble): - - implementation can be shared. - (JSC::MacroAssemblerX86Common::negateDouble): - - Added. - (JSC::MacroAssemblerX86Common::loadDouble): - - allow absDouble to have a common implementation. - * assembler/MacroAssemblerX86_64.h: - (MacroAssemblerX86_64): - - moved loadDouble, absDouble to common. - * dfg/DFGAbstractState.cpp: - (JSC::DFG::AbstractState::execute): - - support ArithNegate. - * dfg/DFGArithNodeFlagsInferencePhase.cpp: - (JSC::DFG::ArithNodeFlagsInferencePhase::propagate): - - support ArithNegate. - * dfg/DFGByteCodeParser.cpp: - (JSC::DFG::ByteCodeParser::makeSafe): - - support ArithNegate. - (JSC::DFG::ByteCodeParser::parseBlock): - - support op_negate. - * dfg/DFGCSEPhase.cpp: - (JSC::DFG::CSEPhase::performNodeCSE): - - support ArithNegate. - * dfg/DFGCapabilities.h: - (JSC::DFG::canCompileOpcode): - - support op_negate. - * dfg/DFGGraph.h: - (JSC::DFG::Graph::negateShouldSpeculateInteger): - - support ArithNegate. - * dfg/DFGNode.h: - (JSC::DFG::Node::hasArithNodeFlags): - - support ArithNegate. - * dfg/DFGPredictionPropagationPhase.cpp: - (JSC::DFG::PredictionPropagationPhase::propagate): - - support ArithNegate. - * dfg/DFGSpeculativeJIT.cpp: - (JSC::DFG::SpeculativeJIT::compileArithNegate): - - support ArithNegate. - * dfg/DFGSpeculativeJIT.h: - (SpeculativeJIT): - - support ArithNegate. - * dfg/DFGSpeculativeJIT32_64.cpp: - (JSC::DFG::SpeculativeJIT::compile): - - support ArithNegate. - * dfg/DFGSpeculativeJIT64.cpp: - (JSC::DFG::SpeculativeJIT::compile): - - support ArithNegate. - * jit/JIT.cpp: - (JSC::JIT::privateCompileMainPass): - (JSC::JIT::privateCompileSlowCases): - - Add support for op_negate in JSVALUE64. - * jit/JITArithmetic.cpp: - (JSC::JIT::emit_op_negate): - (JSC::JIT::emitSlow_op_negate): - - Add support for op_negate in JSVALUE64. - -2012-02-27 Mahesh Kulkarni - - Unreviewed. Build fix for linux-bot (qt) after r109021. - - * runtime/Error.cpp: - -2012-02-27 Oliver Hunt - - REGRESSION (r108112): AWS Management Console at amazon.com fails to initialize - https://bugs.webkit.org/show_bug.cgi?id=79693 - - Reviewed by Filip Pizlo. - - Alas we can't provide the stack trace as an array, as despite everyone wanting - an array, everyone arbitrarily creates the array by calling split on the stack - trace. To create the array we would have provided them in the first place. - - This changes the exception's stack property to a \n separated string. To get the - old array just do .stack.split("\n"). - - * runtime/Error.cpp: - (JSC::addErrorInfo): - -2012-02-27 Gavin Barraclough - - RegExp lastIndex should behave as a regular property - https://bugs.webkit.org/show_bug.cgi?id=79446 - - Reviewed by Sam Weinig. - - lastIndex should be a regular data descriptor, with the attributes configurable:false, - enumerable:false, writable:true. As such, it should be possible to reconfigure writable - as false. If the lastIndex property is reconfigured to be read-only, we should respect - this correctly. - - * runtime/CommonIdentifiers.h: - - Removed some unused identifiers, added lastIndex. - * runtime/RegExpObject.cpp: - (JSC::RegExpObject::getOwnPropertySlot): - - lastIndex is no longer a static value, provided specific handling. - (JSC::RegExpObject::getOwnPropertyDescriptor): - - lastIndex is no longer a static value, provided specific handling. - (JSC::RegExpObject::deleteProperty): - - lastIndex is no longer a static value, provided specific handling. - (JSC::RegExpObject::getOwnPropertyNames): - - lastIndex is no longer a static value, provided specific handling. - (JSC::RegExpObject::getPropertyNames): - - lastIndex is no longer a static value, provided specific handling. - (JSC::reject): - - helper function for defineOwnProperty. - (JSC::RegExpObject::defineOwnProperty): - - lastIndex is no longer a static value, provided specific handling. - (JSC::RegExpObject::put): - - lastIndex is no longer a static value, provided specific handling. - (JSC::RegExpObject::match): - - Pass setLastIndex an ExecState, so it can throw if read-only. - * runtime/RegExpObject.h: - (JSC::RegExpObject::setLastIndex): - - Pass setLastIndex an ExecState, so it can throw if read-only. - (RegExpObjectData): - - Added lastIndexIsWritable. - * runtime/RegExpPrototype.cpp: - (JSC::regExpProtoFuncCompile): - - Pass setLastIndex an ExecState, so it can throw if read-only. - -2012-02-27 Gavin Barraclough - - Implement support for op_negate and op_bitnot in the DFG JIT - https://bugs.webkit.org/show_bug.cgi?id=79617 - - Reviewed by Sam Weinig. - - Remove op_bitnop - this is redundant, ~x === x^-1. - This is a fractional (<1%) progression. - - Remove not32(X) from the MacroAssemblers - make this an optimization to add32(-1, X). - Remove CanReuse from the result type - this was unused. - Remove op_bitnot. - - * assembler/MacroAssemblerARM.h: - (MacroAssemblerARM): - (JSC::MacroAssemblerARM::xor32): - * assembler/MacroAssemblerARMv7.h: - (MacroAssemblerARMv7): - (JSC::MacroAssemblerARMv7::xor32): - * assembler/MacroAssemblerMIPS.h: - (MacroAssemblerMIPS): - (JSC::MacroAssemblerMIPS::xor32): - * assembler/MacroAssemblerSH4.h: - (MacroAssemblerSH4): - (JSC::MacroAssemblerSH4::xor32): - * assembler/MacroAssemblerX86Common.h: - (MacroAssemblerX86Common): - (JSC::MacroAssemblerX86Common::xor32): - * bytecode/CodeBlock.cpp: - (JSC::CodeBlock::dump): - * bytecode/Opcode.h: - (JSC): - (JSC::padOpcodeName): - * bytecompiler/NodesCodegen.cpp: - (JSC): - (JSC::BitwiseNotNode::emitBytecode): - * interpreter/Interpreter.cpp: - (JSC::Interpreter::privateExecute): - * jit/JIT.cpp: - (JSC::JIT::privateCompileMainPass): - (JSC::JIT::privateCompileSlowCases): - * jit/JIT.h: - (JIT): - * jit/JITArithmetic32_64.cpp: - (JSC): - * jit/JITOpcodes.cpp: - (JSC): - * jit/JITStubs.cpp: - (JSC): - * jit/JITStubs.h: - * llint/LLIntSlowPaths.cpp: - (LLInt): - * llint/LLIntSlowPaths.h: - (LLInt): - * llint/LowLevelInterpreter32_64.asm: - * parser/NodeConstructors.h: - (JSC::NegateNode::NegateNode): - (JSC::BitwiseNotNode::BitwiseNotNode): - (JSC::MultNode::MultNode): - (JSC::DivNode::DivNode): - (JSC::ModNode::ModNode): - (JSC::SubNode::SubNode): - (JSC::UnsignedRightShiftNode::UnsignedRightShiftNode): - * parser/Nodes.h: - (BitwiseNotNode): - (JSC::BitwiseNotNode::expr): - (JSC): - * parser/ResultType.h: - (ResultType): - (JSC::ResultType::numberTypeIsInt32): - (JSC::ResultType::stringOrNumberType): - (JSC::ResultType::forAdd): - (JSC::ResultType::forBitOp): - -2012-02-27 Michael Saboff - - Error check regexp min quantifier - https://bugs.webkit.org/show_bug.cgi?id=70648 - - Reviewed by Gavin Barraclough. - - Added checking for min or only quantifier being UINT_MAX. - When encountered this becomes a SyntaxError during parsing. - - * yarr/YarrParser.h: - (JSC::Yarr::Parser::parseQuantifier): - (JSC::Yarr::Parser::parse): - (Parser): - -2012-02-27 Carlos Garcia Campos - - Unreviewed. Fix make distcheck. - - * GNUmakefile.list.am: Add missing files. - -2012-02-26 Hajime Morrita - - Move ChromeClient::showContextMenu() to ContextMenuClient - https://bugs.webkit.org/show_bug.cgi?id=79427 - - Reviewed by Adam Barth. - - Added ACCESSIBILITY_CONTEXT_MENUS. - - * wtf/Platform.h: - -2012-02-26 Filip Pizlo - - LayoutTests/fast/xpath/xpath-functional-test.html is crashing in the DFG - https://bugs.webkit.org/show_bug.cgi?id=79616 - - Reviewed by Oliver Hunt. - - Guard against the fact that in JSVALUE64, JSValue().isCell() == true. - - * dfg/DFGAbstractValue.h: - (JSC::DFG::AbstractValue::validate): - -2012-02-26 Filip Pizlo - - DFG should support activations and nested functions - https://bugs.webkit.org/show_bug.cgi?id=79554 - - Reviewed by Sam Weinig. - - Fix 32-bit. The 32-bit function+activation code had some really weird - register reuse bugs. - - * dfg/DFGSpeculativeJIT32_64.cpp: - (JSC::DFG::SpeculativeJIT::compile): - -2012-02-26 Filip Pizlo - - Getting the instruction stream for a code block should not require two loads - https://bugs.webkit.org/show_bug.cgi?id=79608 - - Reviewed by Sam Weinig. - - Introduced the RefCountedArray class, which contains a single inline pointer - to a ref-counted non-resizeable vector backing store. This satisfies the - requirements of CodeBlock, which desires the ability to share instruction - streams with other CodeBlocks. It also reduces the number of loads required - for getting the instruction stream by one. - - This patch also gets rid of the bytecode discarding logic, since we don't - use it anymore and it's unlikely to ever work right with DFG or LLInt. And - I didn't feel like porting dead code to use RefCountedArray. - - * GNUmakefile.list.am: - * JavaScriptCore.xcodeproj/project.pbxproj: - * bytecode/CodeBlock.cpp: - (JSC::instructionOffsetForNth): - (JSC::CodeBlock::dump): - (JSC::CodeBlock::CodeBlock): - (JSC::CodeBlock::finalizeUnconditionally): - (JSC::CodeBlock::handlerForBytecodeOffset): - (JSC::CodeBlock::lineNumberForBytecodeOffset): - (JSC::CodeBlock::expressionRangeForBytecodeOffset): - (JSC::CodeBlock::shrinkToFit): - * bytecode/CodeBlock.h: - (CodeBlock): - (JSC::CodeBlock::numberOfInstructions): - (JSC::CodeBlock::instructions): - (JSC::CodeBlock::instructionCount): - (JSC::CodeBlock::valueProfileForBytecodeOffset): - (JSC): - * bytecompiler/BytecodeGenerator.cpp: - (JSC::Label::setLocation): - (JSC): - (JSC::BytecodeGenerator::generate): - (JSC::BytecodeGenerator::newLabel): - * bytecompiler/BytecodeGenerator.h: - (JSC): - (BytecodeGenerator): - (JSC::BytecodeGenerator::instructions): - * bytecompiler/Label.h: - (JSC::Label::Label): - (Label): - * dfg/DFGByteCodeCache.h: - (JSC::DFG::ByteCodeCache::~ByteCodeCache): - (JSC::DFG::ByteCodeCache::get): - * jit/JITExceptions.cpp: - (JSC::genericThrow): - * llint/LowLevelInterpreter32_64.asm: - * runtime/Executable.cpp: - (JSC::EvalExecutable::compileInternal): - (JSC::ProgramExecutable::compileInternal): - (JSC::FunctionExecutable::codeBlockWithBytecodeFor): - (JSC::FunctionExecutable::produceCodeBlockFor): - * wtf/RefCountedArray.h: Added. - (WTF): - (RefCountedArray): - (WTF::RefCountedArray::RefCountedArray): - (WTF::RefCountedArray::operator=): - (WTF::RefCountedArray::~RefCountedArray): - (WTF::RefCountedArray::size): - (WTF::RefCountedArray::data): - (WTF::RefCountedArray::begin): - (WTF::RefCountedArray::end): - (WTF::RefCountedArray::at): - (WTF::RefCountedArray::operator[]): - (Header): - (WTF::RefCountedArray::Header::size): - (WTF::RefCountedArray::Header::payload): - (WTF::RefCountedArray::Header::fromPayload): - * wtf/Platform.h: - -2012-02-26 Yusuke Suzuki - - StringLiteral and NumericLiteral are allowed as ObjectLiteral getter / setter name - https://bugs.webkit.org/show_bug.cgi?id=79571 - - Reviewed by Gavin Barraclough. - - * parser/ASTBuilder.h: - (JSC::ASTBuilder::createGetterOrSetterProperty): - * parser/Parser.cpp: - (JSC::::parseProperty): - * parser/SyntaxChecker.h: - (JSC::SyntaxChecker::createGetterOrSetterProperty): - -2012-02-26 Mark Hahnenberg - - Implement fast path for op_new_array in the baseline JIT - https://bugs.webkit.org/show_bug.cgi?id=78612 - - Reviewed by Filip Pizlo. - - heap/CopiedAllocator.h: - (CopiedAllocator): Friended the JIT to allow access to m_currentOffset. - * heap/CopiedSpace.h: - (CopiedSpace): Friended the JIT to allow access to isOversize. - (JSC::CopiedSpace::allocator): - * heap/Heap.h: - (JSC::Heap::storageAllocator): Added a getter for the CopiedAllocator class so the JIT - can use it for simple allocation i.e. when we can just bump the offset without having to - do anything else. - * jit/JIT.cpp: - (JSC::JIT::privateCompileSlowCases): Added new slow case for op_new_array for when - we have to bail out because the fast allocation path fails for whatever reason. - * jit/JIT.h: - (JIT): - * jit/JITInlineMethods.h: - (JSC::JIT::emitAllocateBasicStorage): Added utility function that allows objects to - allocate generic backing stores. This function is used by emitAllocateJSArray. - (JSC): - (JSC::JIT::emitAllocateJSArray): Added utility function that allows the client to - more easily allocate JSArrays. This function is used by emit_op_new_array and I expect - it will also be used for emit_op_new_array_buffer. - * jit/JITOpcodes.cpp: - (JSC::JIT::emit_op_new_array): Changed to do inline allocation of JSArrays. Still does - a stub call for oversize arrays. - (JSC): - (JSC::JIT::emitSlow_op_new_array): New slow path that just bails out to a stub call if we - fail in any way on the fast path. - * runtime/JSArray.cpp: - (JSC): - * runtime/JSArray.h: Added lots of offset functions for all the fields that we need to - initialize in the JIT. - (ArrayStorage): - (JSC::ArrayStorage::lengthOffset): - (JSC::ArrayStorage::numValuesInVectorOffset): - (JSC::ArrayStorage::allocBaseOffset): - (JSC::ArrayStorage::vectorOffset): - (JSArray): - (JSC::JSArray::sparseValueMapOffset): - (JSC::JSArray::subclassDataOffset): - (JSC::JSArray::indexBiasOffset): - (JSC): - (JSC::JSArray::storageSize): Moved this function from being a static function in the cpp file - to being a static function in the JSArray class. This move allows the JIT to call it to - see what size it should allocate. - -2012-02-26 Patrick Gansterer - - Unreviewed. Build fix for ENABLE(CLASSIC_INTERPRETER) after r108681. - - * interpreter/Interpreter.cpp: - (JSC::getLineNumberForCallFrame): - (JSC::Interpreter::getStackTrace): - -2012-02-26 Patrick Gansterer - - Unreviewed. Build fix for !ENABLE(JIT) after r108681. - - * interpreter/Interpreter.cpp: - (JSC::getLineNumberForCallFrame): - -2012-02-25 Filip Pizlo - - LLInt assembly file should be split into 32-bit and 64-bit parts - https://bugs.webkit.org/show_bug.cgi?id=79584 - - Reviewed by Sam Weinig. - - Moved LowLevelInterpreter.asm to LowLevelInterpreter32_64.asm. Gave offlineasm - the ability to include files, and correctly track dependencies: it restricts - the include mechanism to using the same directory as the source file, and uses - the SHA1 hash of all .asm files in that directory as an input hash. - - * llint/LLIntOfflineAsmConfig.h: - * llint/LowLevelInterpreter.asm: - * llint/LowLevelInterpreter32_64.asm: Added. - - This is just the entire contents of what was previously LowLevelInterpreter.asm - * llint/LowLevelInterpreter64.asm: Added. - * offlineasm/asm.rb: - * offlineasm/ast.rb: - * offlineasm/generate_offset_extractor.rb: - * offlineasm/parser.rb: - * offlineasm/self_hash.rb: - -2012-02-25 Filip Pizlo - - Offlineasm should support X86_64 - https://bugs.webkit.org/show_bug.cgi?id=79581 - - Reviewed by Oliver Hunt. - - * llint/LLIntOfflineAsmConfig.h: - * offlineasm/backends.rb: - * offlineasm/instructions.rb: - * offlineasm/settings.rb: - * offlineasm/x86.rb: - -2012-02-25 Filip Pizlo - - DFG should support activations and nested functions - https://bugs.webkit.org/show_bug.cgi?id=79554 - - Reviewed by Oliver Hunt. - - Wrote the simplest possible implementation of activations. Big speed-up on - code that uses activations, no speed-up on major benchmarks (SunSpider, V8, - Kraken) because they do not appear to have sufficient coverage over code - that uses activations. - - * bytecode/PredictedType.cpp: - (JSC::predictionToString): - (JSC::predictionFromValue): - * bytecode/PredictedType.h: - (JSC): - (JSC::isEmptyPrediction): - * dfg/DFGAbstractState.cpp: - (JSC::DFG::AbstractState::execute): - * dfg/DFGByteCodeParser.cpp: - (JSC::DFG::ByteCodeParser::ByteCodeParser): - (ByteCodeParser): - (JSC::DFG::ByteCodeParser::parseBlock): - (JSC::DFG::ByteCodeParser::buildOperandMapsIfNecessary): - (JSC::DFG::ByteCodeParser::InlineStackEntry::InlineStackEntry): - (JSC::DFG::ByteCodeParser::parse): - * dfg/DFGCapabilities.h: - (JSC::DFG::canCompileOpcode): - (JSC::DFG::canInlineOpcode): - * dfg/DFGGraph.h: - (JSC::DFG::Graph::needsActivation): - * dfg/DFGNode.h: - (DFG): - (JSC::DFG::Node::storageAccessDataIndex): - (Node): - (JSC::DFG::Node::hasFunctionDeclIndex): - (JSC::DFG::Node::functionDeclIndex): - (JSC::DFG::Node::hasFunctionExprIndex): - (JSC::DFG::Node::functionExprIndex): - * dfg/DFGOperations.cpp: - * dfg/DFGOperations.h: - * dfg/DFGPredictionPropagationPhase.cpp: - (JSC::DFG::PredictionPropagationPhase::propagate): - * dfg/DFGSpeculativeJIT.cpp: - (JSC::DFG::SpeculativeJIT::compileNewFunctionNoCheck): - (DFG): - (JSC::DFG::SpeculativeJIT::compileNewFunctionExpression): - * dfg/DFGSpeculativeJIT.h: - (JSC::DFG::SpeculativeJIT::callOperation): - * dfg/DFGSpeculativeJIT32_64.cpp: - (JSC::DFG::SpeculativeJIT::compile): - * dfg/DFGSpeculativeJIT64.cpp: - (JSC::DFG::SpeculativeJIT::compile): - -2012-02-25 Benjamin Poulain - - Add an empty skeleton of KURL for WTFURL - https://bugs.webkit.org/show_bug.cgi?id=78990 - - Reviewed by Adam Barth. - - * JavaScriptCore.xcodeproj/project.pbxproj: Export the relevant classes from WTFURL - so that can use them in WebCore. - -2012-02-25 Filip Pizlo - - Unreviewed, fix build for DFG disabled and LLInt enabled. - - * jit/JIT.cpp: - (JSC::JIT::privateCompile): - * llint/LLIntSlowPaths.cpp: - (LLInt): - (JSC::LLInt::LLINT_SLOW_PATH_DECL): - -2012-02-25 Mark Hahnenberg - - Fix the CopiedBlock offset alignment in a cross platform fashion - https://bugs.webkit.org/show_bug.cgi?id=79556 - - Reviewed by Filip Pizlo. - - Replaced m_payload with a payload() method that calculates the offset - of the payload with the proper alignment. This change allows us to - avoid alignment-related issues in a cross-platform manner. - - * heap/CopiedAllocator.h: - (JSC::CopiedAllocator::currentUtilization): - * heap/CopiedBlock.h: - (JSC::CopiedBlock::CopiedBlock): - (JSC::CopiedBlock::payload): - (CopiedBlock): - * heap/CopiedSpace.cpp: - (JSC::CopiedSpace::doneFillingBlock): - * heap/CopiedSpaceInlineMethods.h: - (JSC::CopiedSpace::borrowBlock): - (JSC::CopiedSpace::allocateFromBlock): - -2012-02-24 Michael Saboff - - Unreviewed, Windows build fix. Changed signature in export to match - change made in r108858. - - * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def: - -2012-02-24 Filip Pizlo - - DFG support for op_new_regexp should be enabled - https://bugs.webkit.org/show_bug.cgi?id=79538 - - Reviewed by Oliver Hunt. - - No performance change. - - * dfg/DFGCapabilities.h: - (JSC::DFG::canCompileOpcode): - * dfg/DFGCommon.h: - -2012-02-24 Michael Saboff - - ASSERT(position < 0) in JSC::Yarr::Interpreter::InputStream::readChecked - https://bugs.webkit.org/show_bug.cgi?id=73728 - - Reviewed by Gavin Barraclough. - - Fixed the mixing of signed and unsigned character indeces in YARR - interpreter. - - * runtime/RegExp.cpp: - (JSC::RegExp::match): Added code to check for match longer than 2^31 and - return no match after resetting the offsets. - * yarr/YarrInterpreter.cpp: Changed to use unsigned for all character index - handling except when matching back references. - (JSC::Yarr::Interpreter::InputStream::readChecked): - (JSC::Yarr::Interpreter::InputStream::checkInput): - (JSC::Yarr::Interpreter::InputStream::uncheckInput): - (JSC::Yarr::Interpreter::InputStream::atStart): - (JSC::Yarr::Interpreter::InputStream::atEnd): - (JSC::Yarr::Interpreter::InputStream::isAvailableInput): - (JSC::Yarr::Interpreter::checkCharacter): - (JSC::Yarr::Interpreter::checkCasedCharacter): - (JSC::Yarr::Interpreter::checkCharacterClass): - (JSC::Yarr::Interpreter::tryConsumeBackReference): - (JSC::Yarr::Interpreter::matchAssertionBOL): - (JSC::Yarr::Interpreter::matchAssertionWordBoundary): - (JSC::Yarr::Interpreter::backtrackPatternCharacter): - (JSC::Yarr::Interpreter::backtrackPatternCasedCharacter): - (JSC::Yarr::Interpreter::matchCharacterClass): - (JSC::Yarr::Interpreter::backtrackCharacterClass): - (JSC::Yarr::Interpreter::matchParenthesesOnceBegin): - (JSC::Yarr::Interpreter::matchDisjunction): - (JSC::Yarr::Interpreter::interpret): - (JSC::Yarr::ByteCompiler::assertionBOL): - (JSC::Yarr::ByteCompiler::assertionEOL): - (JSC::Yarr::ByteCompiler::assertionWordBoundary): - (JSC::Yarr::ByteCompiler::atomPatternCharacter): - (JSC::Yarr::ByteCompiler::atomCharacterClass): - (JSC::Yarr::ByteCompiler::atomBackReference): - (JSC::Yarr::ByteCompiler::atomParenthesesOnceBegin): - (JSC::Yarr::ByteCompiler::atomParenthesesTerminalBegin): - (JSC::Yarr::ByteCompiler::atomParenthesesSubpatternBegin): - (JSC::Yarr::ByteCompiler::atomParentheticalAssertionEnd): - (JSC::Yarr::ByteCompiler::emitDisjunction): - * yarr/YarrInterpreter.h: - -2012-02-24 Filip Pizlo - - Unreviewed, build fix for builds where the DFG is disabled but the LLInt is - enabled. - - * llint/LLIntOfflineAsmConfig.h: - * llint/LowLevelInterpreter.asm: - -2012-02-24 Filip Pizlo - - DFG should be able to handle variables getting captured - https://bugs.webkit.org/show_bug.cgi?id=79469 - - Reviewed by Oliver Hunt. - - Made captured variables work by placing a Flush on the SetLocal and - forcing the emission of the GetLocal even if copy propagation tells us - who has the value. - - Changed the CFA and various prediction codes to understand that we can't - really prove anything about captured variables. Well, we could in the - future by just looking at what side effects are happening, but in this - first cut we just assume that we can't reason about captured variables. - - Also added a mode where the DFG pretends that all variables and arguments - got captured. Used this mode to harden the code. - - This is performance neutral. Capturing all variables is a slow down, but - not too big of one. This seems to predict that when we add activation - support, the amount of speed benefit we'll get from increased coverage - will far outweigh the pessimism that we'll have to endure for captured - variables. - - * bytecode/CodeType.h: - (JSC::codeTypeToString): - * dfg/DFGAbstractState.cpp: - (JSC::DFG::AbstractState::initialize): - (JSC::DFG::AbstractState::endBasicBlock): - (JSC::DFG::AbstractState::execute): - (JSC::DFG::AbstractState::merge): - * dfg/DFGAbstractState.h: - (AbstractState): - * dfg/DFGByteCodeParser.cpp: - (JSC::DFG::ByteCodeParser::getLocal): - (JSC::DFG::ByteCodeParser::setLocal): - (JSC::DFG::ByteCodeParser::getArgument): - (JSC::DFG::ByteCodeParser::setArgument): - (JSC::DFG::ByteCodeParser::flushArgument): - (JSC::DFG::ByteCodeParser::handleInlining): - (JSC::DFG::ByteCodeParser::processPhiStack): - (JSC::DFG::ByteCodeParser::parseCodeBlock): - (JSC::DFG::ByteCodeParser::parse): - * dfg/DFGCapabilities.h: - (JSC::DFG::mightInlineFunctionForCall): - (JSC::DFG::mightInlineFunctionForConstruct): - * dfg/DFGCommon.h: - * dfg/DFGGraph.h: - (JSC::DFG::Graph::needsActivation): - (Graph): - (JSC::DFG::Graph::argumentIsCaptured): - (JSC::DFG::Graph::localIsCaptured): - (JSC::DFG::Graph::isCaptured): - * dfg/DFGNode.h: - (JSC::DFG::Node::shouldGenerate): - * dfg/DFGPredictionPropagationPhase.cpp: - (JSC::DFG::PredictionPropagationPhase::propagate): - (JSC::DFG::PredictionPropagationPhase::doRoundOfDoubleVoting): - * dfg/DFGSpeculativeJIT.cpp: - (DFG): - (JSC::DFG::ValueSource::dump): - (JSC::DFG::SpeculativeJIT::compile): - * dfg/DFGSpeculativeJIT.h: - (ValueSource): - * dfg/DFGSpeculativeJIT32_64.cpp: - (JSC::DFG::SpeculativeJIT::compile): - * dfg/DFGSpeculativeJIT64.cpp: - (JSC::DFG::SpeculativeJIT::compile): - * dfg/DFGVirtualRegisterAllocationPhase.cpp: - (JSC::DFG::VirtualRegisterAllocationPhase::run): - -2012-02-24 Gavin Barraclough - - Should not allow malformed \x escapes - https://bugs.webkit.org/show_bug.cgi?id=79462 - - Reviewed by Oliver Hunt. - - * parser/Lexer.cpp: - (JSC::::parseString): - (JSC::::parseStringSlowCase): - - Prohibit malformed '\x' escapes - * tests/mozilla/ecma/Array/15.4.5.1-1.js: - * tests/mozilla/ecma/LexicalConventions/7.7.4.js: - * tests/mozilla/ecma_2/RegExp/hex-001.js: - * tests/mozilla/js1_2/regexp/hexadecimal.js: - - Remove erroneous test cases (correct behaviour is tested by LayoutTests/sputnik). - -2012-02-24 Daniel Bates - - Fix change log entry for changeset r108819; add bug URL - https://bugs.webkit.org/show_bug.cgi?id=79504 - - Changeset r108819 is associated with bug #79504. - - * ChangeLog - -2012-02-24 Daniel Bates - - Substitute ENABLE(CLASSIC_INTERPRETER) for ENABLE(INTERPRETER) in Interpreter.cpp - https://bugs.webkit.org/show_bug.cgi?id=79504 - - Reviewed by Oliver Hunt. - - There are a few places in Interpreter.cpp that need to be updated to use - ENABLE(CLASSIC_INTERPRETER) following the renaming of ENABLE_INTERPRETER to - ENABLE_CLASSIC_INTERPRETER in changeset - (https://bugs.webkit.org/show_bug.cgi?id=78791). - - * interpreter/Interpreter.cpp: - (JSC::getLineNumberForCallFrame): - (JSC::getCallerInfo): - (JSC::getSourceURLFromCallFrame): - -2012-02-24 Adam Roben - - Undo the BUILDING_WTF part of r108808 - - This broke the build, which is obviously worse than the linker warning it was trying to - solve. - - * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCoreCommon.vsprops: - -2012-02-24 Adam Roben - - Fix linker warnings on Windows - - * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def: Removed symbols that are already - exported via JS_EXPORTDATA. - - * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCoreCommon.vsprops: Define BUILDING_WTF. We - aren't actually building WTF, but we are statically linking it, so we need to define this - symbol so that we export WTF's exports. - -2012-02-24 Philippe Normand - - Fix GTK WebAudio build for WebKitGTK 1.7.90. - - Patch by Priit Laes on 2012-02-24 - Rubber-stamped by Philippe Normand. - - * GNUmakefile.list.am: Add Complex.h to the list of files so it - gets disted in the tarballs. - -2012-02-24 Zoltan Herczeg - - [Qt] Buildfix for "Zero out CopiedBlocks on initialization". - https://bugs.webkit.org/show_bug.cgi?id=79199 - - Ruber stamped by Csaba Osztrogonác. - - Temporary fix since the new member wastes a little space on - 64 bit systems. Although it is harmless, it is only needed - for 32 bit systems. - - * heap/CopiedBlock.h: - (CopiedBlock): - -2012-02-24 Han Hojong - - Remove useless jump instructions for short circuit - https://bugs.webkit.org/show_bug.cgi?id=75602 - - Reviewed by Michael Saboff. - - Jump instruction is inserted to make short circuit, - however it does nothing but moving to the next instruction. - Therefore useless jump instructions are removed, - and jump list is moved into the case not for a short circuit, - so that only necessary instructions are added to JIT code - unless it has a 16 bit pattern character and an 8 bit string. - - * yarr/YarrJIT.cpp: - (JSC::Yarr::YarrGenerator::generatePatternCharacterGreedy): - (JSC::Yarr::YarrGenerator::backtrackPatternCharacterNonGreedy): - -2012-02-24 Sheriff Bot - - Unreviewed, rolling out r108731. - http://trac.webkit.org/changeset/108731 - https://bugs.webkit.org/show_bug.cgi?id=79464 - - Broke Chromium Win tests (Requested by bashi on #webkit). - - * wtf/Platform.h: - -2012-02-24 Andrew Lo - - [BlackBerry] Enable requestAnimationFrame - https://bugs.webkit.org/show_bug.cgi?id=79408 - - Use timer implementation of requestAnimationFrame on BlackBerry. - - Reviewed by Rob Buis. - - * wtf/Platform.h: - -2012-02-24 Mathias Bynens - - `\u200c` and `\u200d` should be allowed in IdentifierPart, as per ES5 - https://bugs.webkit.org/show_bug.cgi?id=78908 - - Add additional checks for zero-width non-joiner (0x200C) and - zero-width joiner (0x200D) characters. - - Reviewed by Michael Saboff. - - * parser/Lexer.cpp: - (JSC::isNonASCIIIdentPart) - * runtime/LiteralParser.cpp: - (JSC::::Lexer::lexIdentifier) - -2012-02-23 Kenichi Ishibashi - - Adding WebSocket per-frame DEFLATE extension - https://bugs.webkit.org/show_bug.cgi?id=77522 - - Added USE(ZLIB) flag. - - Reviewed by Kent Tamura. - - * wtf/Platform.h: - -2012-02-23 Mark Hahnenberg - - Zero out CopiedBlocks on initialization - https://bugs.webkit.org/show_bug.cgi?id=79199 - - Reviewed by Filip Pizlo. - - Made CopyBlocks zero their payloads during construction. This allows - JSArray to avoid having to manually clear its backing store upon allocation - and also alleviates any future pain with regard to the garbage collector trying - to mark what it thinks are values in what is actually uninitialized memory. - - * heap/CopiedBlock.h: - (JSC::CopiedBlock::CopiedBlock): - * runtime/JSArray.cpp: - (JSC::JSArray::finishCreation): - (JSC::JSArray::tryFinishCreationUninitialized): - (JSC::JSArray::increaseVectorLength): - (JSC::JSArray::unshiftCountSlowCase): - -2012-02-23 Oliver Hunt - - Make Interpreter::getStackTrace be able to generate the line number for the top callframe if none is provided - https://bugs.webkit.org/show_bug.cgi?id=79407 - - Reviewed by Gavin Barraclough. - - Outside of exception handling, we don't know what our source line number is. This - change allows us to pass -1 is as the initial line number, and get the correct line - number in the resultant stack trace. We can't completely elide the initial line - number (yet) due to some idiosyncrasies of the exception handling machinery. - - * interpreter/Interpreter.cpp: - (JSC::getLineNumberForCallFrame): - (JSC): - (JSC::Interpreter::getStackTrace): - -2012-02-22 Filip Pizlo - - DFG OSR exit value profiling should have graceful handling of local variables and arguments - https://bugs.webkit.org/show_bug.cgi?id=79310 - - Reviewed by Gavin Barraclough. - - Previously, if we OSR exited because a prediction in a local was wrong, we'd - only realize what the true type of the local was if the regular value profiling - kicked in and told us. Unless the local was block-locally copy propagated, in - which case we'd know from an OSR exit profile. - - This patch adds OSR exit profiling to all locals and arguments. Now, if we OSR - exit because of a mispredicted local or argument type, we'll know what the type of - the local or argument should be immediately upon exiting. - - The way that local variable OSR exit profiling works is that we now have a lazily - added set of OSR-exit-only value profiles for exit sites that are BadType and that - cited a GetLocal as their value source. The value profiles are only added if the - OSR exit is taken, and are keyed by CodeBlock, bytecode index of the GetLocal, and - operand. The look-up is performed by querying the - CompressedLazyOperandValueProfileHolder in the CodeBlock, using a key that contains - the bytecode index and the operand. Because the value profiles are added at random - times, they are not sorted; instead they are just stored in an arbitrarily-ordered - SegmentedVector. Look-ups are made fast by "decompressing": the DFG::ByteCodeParser - creates a LazyOperandValueProfileParser, which turns the - CompressedLazyOperandValueProfileHolder's contents into a HashMap for the duration - of DFG parsing. - - Previously, OSR exits had a pointer to the ValueProfile that had the specFailBucket - into which values observed during OSR exit would be placed. Now it uses a lazy - thunk for a ValueProfile. I call this the MethodOfGettingAValueProfile. It may - either contain a ValueProfile inside it (which works for previous uses of OSR exit - profiling) or it may just have knowledge of how to go about creating the - LazyOperandValueProfile in the case that the OSR exit is actually taken. This - ensures that we never have to create NumOperands*NumBytecodeIndices*NumCodeBlocks - value profiling buckets unless we actually did OSR exit on every single operand, - in every single instruction, in each code block (that's probably unlikely). - - This appears to be neutral on the major benchmarks, but is a double-digit speed-up - on code deliberately written to have data flow that spans basic blocks and where - the code exhibits post-optimization polymorphism in a local variable. - - * CMakeLists.txt: - * GNUmakefile.list.am: - * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj: - * JavaScriptCore.xcodeproj/project.pbxproj: - * Target.pri: - * bytecode/CodeBlock.cpp: - (JSC::CodeBlock::stronglyVisitStrongReferences): - * bytecode/CodeBlock.h: - (CodeBlock): - (JSC::CodeBlock::lazyOperandValueProfiles): - * bytecode/LazyOperandValueProfile.cpp: Added. - (JSC): - (JSC::CompressedLazyOperandValueProfileHolder::CompressedLazyOperandValueProfileHolder): - (JSC::CompressedLazyOperandValueProfileHolder::~CompressedLazyOperandValueProfileHolder): - (JSC::CompressedLazyOperandValueProfileHolder::computeUpdatedPredictions): - (JSC::CompressedLazyOperandValueProfileHolder::add): - (JSC::LazyOperandValueProfileParser::LazyOperandValueProfileParser): - (JSC::LazyOperandValueProfileParser::~LazyOperandValueProfileParser): - (JSC::LazyOperandValueProfileParser::getIfPresent): - (JSC::LazyOperandValueProfileParser::prediction): - * bytecode/LazyOperandValueProfile.h: Added. - (JSC): - (LazyOperandValueProfileKey): - (JSC::LazyOperandValueProfileKey::LazyOperandValueProfileKey): - (JSC::LazyOperandValueProfileKey::operator!): - (JSC::LazyOperandValueProfileKey::operator==): - (JSC::LazyOperandValueProfileKey::hash): - (JSC::LazyOperandValueProfileKey::bytecodeOffset): - (JSC::LazyOperandValueProfileKey::operand): - (JSC::LazyOperandValueProfileKey::isHashTableDeletedValue): - (JSC::LazyOperandValueProfileKeyHash::hash): - (JSC::LazyOperandValueProfileKeyHash::equal): - (LazyOperandValueProfileKeyHash): - (WTF): - (JSC::LazyOperandValueProfile::LazyOperandValueProfile): - (LazyOperandValueProfile): - (JSC::LazyOperandValueProfile::key): - (CompressedLazyOperandValueProfileHolder): - (LazyOperandValueProfileParser): - * bytecode/MethodOfGettingAValueProfile.cpp: Added. - (JSC): - (JSC::MethodOfGettingAValueProfile::fromLazyOperand): - (JSC::MethodOfGettingAValueProfile::getSpecFailBucket): - * bytecode/MethodOfGettingAValueProfile.h: Added. - (JSC): - (MethodOfGettingAValueProfile): - (JSC::MethodOfGettingAValueProfile::MethodOfGettingAValueProfile): - (JSC::MethodOfGettingAValueProfile::operator!): - * bytecode/ValueProfile.cpp: Removed. - * bytecode/ValueProfile.h: - (JSC): - (ValueProfileBase): - (JSC::ValueProfileBase::ValueProfileBase): - (JSC::ValueProfileBase::dump): - (JSC::ValueProfileBase::computeUpdatedPrediction): - (JSC::MinimalValueProfile::MinimalValueProfile): - (ValueProfileWithLogNumberOfBuckets): - (JSC::ValueProfileWithLogNumberOfBuckets::ValueProfileWithLogNumberOfBuckets): - (JSC::ValueProfile::ValueProfile): - (JSC::getValueProfileBytecodeOffset): - (JSC::getRareCaseProfileBytecodeOffset): - * dfg/DFGByteCodeParser.cpp: - (ByteCodeParser): - (JSC::DFG::ByteCodeParser::injectLazyOperandPrediction): - (JSC::DFG::ByteCodeParser::getLocal): - (JSC::DFG::ByteCodeParser::getArgument): - (InlineStackEntry): - (JSC::DFG::ByteCodeParser::fixVariableAccessPredictions): - (DFG): - (JSC::DFG::ByteCodeParser::InlineStackEntry::InlineStackEntry): - (JSC::DFG::ByteCodeParser::parse): - * dfg/DFGDriver.cpp: - (JSC::DFG::compile): - * dfg/DFGGraph.h: - (JSC::DFG::Graph::valueProfileFor): - (JSC::DFG::Graph::methodOfGettingAValueProfileFor): - (Graph): - * dfg/DFGNode.h: - (Node): - * dfg/DFGOSRExit.cpp: - (JSC::DFG::OSRExit::OSRExit): - * dfg/DFGOSRExit.h: - (OSRExit): - * dfg/DFGOSRExitCompiler32_64.cpp: - (JSC::DFG::OSRExitCompiler::compileExit): - * dfg/DFGOSRExitCompiler64.cpp: - (JSC::DFG::OSRExitCompiler::compileExit): - * dfg/DFGPhase.cpp: - (JSC::DFG::Phase::beginPhase): - (JSC::DFG::Phase::endPhase): - * dfg/DFGSpeculativeJIT.cpp: - (JSC::DFG::SpeculativeJIT::checkArgumentTypes): - * dfg/DFGSpeculativeJIT.h: - (JSC::DFG::SpeculativeJIT::speculationCheck): - * dfg/DFGVariableAccessData.h: - (JSC::DFG::VariableAccessData::nonUnifiedPrediction): - (VariableAccessData): - -2012-02-23 Filip Pizlo - - Build fix. - - * llint/LLIntOffsetsExtractor.cpp: - -2012-02-23 Kevin Ollivier - - [wx] Build fix, disable LLINT for now and fix ENABLE defines for it. - - * llint/LLIntOffsetsExtractor.cpp: - * wtf/Platform.h: - -2012-02-23 Kevin Ollivier - - [wx] Build fix for non-Mac wx builds. - - * runtime/DatePrototype.cpp: - -2012-02-22 Filip Pizlo - - DFG's logic for emitting a Flush is too convoluted and contains an inaccurate comment - https://bugs.webkit.org/show_bug.cgi?id=79334 - - Reviewed by Oliver Hunt. - - * dfg/DFGByteCodeParser.cpp: - (JSC::DFG::ByteCodeParser::getLocal): - (JSC::DFG::ByteCodeParser::getArgument): - (JSC::DFG::ByteCodeParser::flush): - -2012-02-23 Gavin Barraclough - - Object.isSealed / Object.isFrozen don't work for native objects - https://bugs.webkit.org/show_bug.cgi?id=79331 - - Reviewed by Sam Weinig. - - Need to inspect all properties, including static ones. - This exposes a couple of bugs in Array & Arguments: - - getOwnPropertyDescriptor doesn't correctly report the writable attribute of array length. - - Arguments object's defineOwnProperty does not handle callee/caller/length correctly. - - * runtime/Arguments.cpp: - (JSC::Arguments::defineOwnProperty): - - Add handling for callee/caller/length. - * runtime/JSArray.cpp: - (JSC::JSArray::getOwnPropertyDescriptor): - - report length's writability correctly. - * runtime/ObjectConstructor.cpp: - (JSC::objectConstructorSeal): - (JSC::objectConstructorFreeze): - (JSC::objectConstructorIsSealed): - (JSC::objectConstructorIsFrozen): - - Add spec-based implementation for non-final objects. - -2012-02-23 Gavin Barraclough - - pop of array hole should get from the prototype chain - https://bugs.webkit.org/show_bug.cgi?id=79338 - - Reviewed by Sam Weinig. - - * runtime/JSArray.cpp: - (JSC::JSArray::pop): - - If the fast fast vector case fails, more closely follow the spec. - -2012-02-23 Yong Li - - JSString::outOfMemory() should ASSERT(isRope()) rather than !isRope() - https://bugs.webkit.org/show_bug.cgi?id=79268 - - Reviewed by Michael Saboff. - - resolveRope() is the only caller of outOfMemory(), and it calls outOfMemory() - after it fails to allocate a buffer for m_value. So outOfMemory() should assert - isRope() rather than !isRope(). - - * runtime/JSString.cpp: - (JSC::JSString::outOfMemory): - -2012-02-23 Patrick Gansterer - - [CMake] Add WEBKIT_INCLUDE_CONFIG_FILES_IF_EXISTS macro - https://bugs.webkit.org/show_bug.cgi?id=79371 - - Reviewed by Daniel Bates. - - * CMakeLists.txt: - * shell/CMakeLists.txt: - * wtf/CMakeLists.txt: - -2012-02-23 Aron Rosenberg - - Fix the PRI macros used in WTF::String formatters to be compatible with Qt and Visual Studio 2005 and newer. - https://bugs.webkit.org/show_bug.cgi?id=76210 - - Add compile time check for Visual Studio 2005 or newer. - - Reviewed by Simon Hausmann. - - * os-win32/inttypes.h: - -2012-02-22 Gavin Barraclough - - Implement [[DefineOwnProperty]] for the arguments object - https://bugs.webkit.org/show_bug.cgi?id=79309 - - Reviewed by Sam Weinig. - - * runtime/Arguments.cpp: - (JSC::Arguments::deletePropertyByIndex): - (JSC::Arguments::deleteProperty): - - Deleting an argument should also delete the copy on the object, if any. - (JSC::Arguments::defineOwnProperty): - - Defining a property may override the live mapping. - * runtime/Arguments.h: - (Arguments): - -2012-02-22 Gavin Barraclough - - Fix Object.freeze for non-final objects. - https://bugs.webkit.org/show_bug.cgi?id=79286 - - Reviewed by Oliver Hunt. - - For vanilla objects we implement this with a single transition, for objects - with special properties we should just follow the spec defined algorithm. - - * runtime/JSArray.cpp: - (JSC::SparseArrayValueMap::put): - - this does need to handle inextensible objects. - * runtime/ObjectConstructor.cpp: - (JSC::objectConstructorSeal): - (JSC::objectConstructorFreeze): - - Implement spec defined algorithm for non-final objects. - * runtime/Structure.cpp: - (JSC::Structure::Structure): - (JSC::Structure::freezeTransition): - - freeze should set m_hasReadOnlyOrGetterSetterPropertiesExcludingProto. - * runtime/Structure.h: - (JSC::Structure::hasReadOnlyOrGetterSetterPropertiesExcludingProto): - (JSC::Structure::setHasGetterSetterProperties): - (JSC::Structure::setContainsReadOnlyProperties): - (Structure): - - renamed m_hasReadOnlyOrGetterSetterPropertiesExcludingProto. - -2012-02-22 Mark Hahnenberg - - Allocations from CopiedBlocks should always be 8-byte aligned - https://bugs.webkit.org/show_bug.cgi?id=79271 - - Reviewed by Geoffrey Garen. - - * heap/CopiedAllocator.h: - (JSC::CopiedAllocator::allocate): - * heap/CopiedBlock.h: Changed to add padding so that the start of the payload is always - guaranteed to be 8 byte aligned on both 64- and 32-bit platforms. - (CopiedBlock): - * heap/CopiedSpace.cpp: Changed all assertions of isPointerAligned to is8ByteAligned. - (JSC::CopiedSpace::tryAllocateOversize): - (JSC::CopiedSpace::getFreshBlock): - * heap/CopiedSpaceInlineMethods.h: - (JSC::CopiedSpace::allocateFromBlock): - * runtime/JSArray.h: - (ArrayStorage): Added padding for ArrayStorage to make sure that it is always 8 byte - aligned on both 64- and 32-bit platforms. - * wtf/StdLibExtras.h: - (WTF::is8ByteAligned): Added new utility function that functions similarly to the - way isPointerAligned does, but it just always checks for 8 byte alignment. - (WTF): - -2012-02-22 Sheriff Bot - - Unreviewed, rolling out r108456. - http://trac.webkit.org/changeset/108456 - https://bugs.webkit.org/show_bug.cgi?id=79223 - - Broke fast/regex/pcre-test-4.html and cannot find anyone on - IRC (Requested by zherczeg on #webkit). - - * yarr/YarrJIT.cpp: - (JSC::Yarr::YarrGenerator::backtrackPatternCharacterGreedy): - -2012-02-22 Sheriff Bot - - Unreviewed, rolling out r108468. - http://trac.webkit.org/changeset/108468 - https://bugs.webkit.org/show_bug.cgi?id=79219 - - Broke Chromium Win release build (Requested by bashi on - #webkit). - - * wtf/Platform.h: - -2012-02-22 Kenichi Ishibashi - - Adding WebSocket per-frame DEFLATE extension - https://bugs.webkit.org/show_bug.cgi?id=77522 - - Added USE(ZLIB) flag. - - Reviewed by Kent Tamura. - - * wtf/Platform.h: - -2012-02-22 Hojong Han - - Short circuit fixed for a 16 bt pattern character and an 8 bit string. - https://bugs.webkit.org/show_bug.cgi?id=75602 - - Reviewed by Gavin Barraclough. - - * yarr/YarrJIT.cpp: - (JSC::Yarr::YarrGenerator::backtrackPatternCharacterGreedy): - -2012-02-21 Filip Pizlo - - Build fix for systems with case sensitive disks. - - * llint/LLIntOfflineAsmConfig.h: - -2012-02-21 Filip Pizlo - - JSC should be a triple-tier VM - https://bugs.webkit.org/show_bug.cgi?id=75812 - - - Reviewed by Gavin Barraclough. - - Implemented an interpreter that uses the JIT's calling convention. This - interpreter is called LLInt, or the Low Level Interpreter. JSC will now - will start by executing code in LLInt and will only tier up to the old - JIT after the code is proven hot. - - LLInt is written in a modified form of our macro assembly. This new macro - assembly is compiled by an offline assembler (see offlineasm), which - implements many modern conveniences such as a Turing-complete CPS-based - macro language and direct access to relevant C++ type information - (basically offsets of fields and sizes of structs/classes). - - Code executing in LLInt appears to the rest of the JSC world "as if" it - were executing in the old JIT. Hence, things like exception handling and - cross-execution-engine calls just work and require pretty much no - additional overhead. - - This interpreter is 2-2.5x faster than our old interpreter on SunSpider, - V8, and Kraken. With triple-tiering turned on, we're neutral on SunSpider, - V8, and Kraken, but appear to get a double-digit improvement on real-world - websites due to a huge reduction in the amount of JIT'ing. - - * CMakeLists.txt: - * GNUmakefile.am: - * GNUmakefile.list.am: - * JavaScriptCore.pri: - * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj: - * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCoreCommon.vsprops: - * JavaScriptCore.vcproj/JavaScriptCore/copy-files.cmd: - * JavaScriptCore.xcodeproj/project.pbxproj: - * Target.pri: - * assembler/LinkBuffer.h: - * assembler/MacroAssemblerCodeRef.h: - (MacroAssemblerCodePtr): - (JSC::MacroAssemblerCodePtr::createFromExecutableAddress): - * bytecode/BytecodeConventions.h: Added. - * bytecode/CallLinkStatus.cpp: - (JSC::CallLinkStatus::computeFromLLInt): - (JSC): - (JSC::CallLinkStatus::computeFor): - * bytecode/CallLinkStatus.h: - (JSC::CallLinkStatus::isSet): - (JSC::CallLinkStatus::operator!): - (CallLinkStatus): - * bytecode/CodeBlock.cpp: - (JSC::CodeBlock::dump): - (JSC::CodeBlock::CodeBlock): - (JSC::CodeBlock::~CodeBlock): - (JSC::CodeBlock::finalizeUnconditionally): - (JSC::CodeBlock::stronglyVisitStrongReferences): - (JSC): - (JSC::CodeBlock::unlinkCalls): - (JSC::CodeBlock::unlinkIncomingCalls): - (JSC::CodeBlock::bytecodeOffset): - (JSC::ProgramCodeBlock::jettison): - (JSC::EvalCodeBlock::jettison): - (JSC::FunctionCodeBlock::jettison): - (JSC::ProgramCodeBlock::jitCompileImpl): - (JSC::EvalCodeBlock::jitCompileImpl): - (JSC::FunctionCodeBlock::jitCompileImpl): - * bytecode/CodeBlock.h: - (JSC): - (CodeBlock): - (JSC::CodeBlock::baselineVersion): - (JSC::CodeBlock::linkIncomingCall): - (JSC::CodeBlock::bytecodeOffset): - (JSC::CodeBlock::jitCompile): - (JSC::CodeBlock::hasOptimizedReplacement): - (JSC::CodeBlock::addPropertyAccessInstruction): - (JSC::CodeBlock::addGlobalResolveInstruction): - (JSC::CodeBlock::addLLIntCallLinkInfo): - (JSC::CodeBlock::addGlobalResolveInfo): - (JSC::CodeBlock::numberOfMethodCallLinkInfos): - (JSC::CodeBlock::valueProfilePredictionForBytecodeOffset): - (JSC::CodeBlock::likelyToTakeSlowCase): - (JSC::CodeBlock::couldTakeSlowCase): - (JSC::CodeBlock::likelyToTakeSpecialFastCase): - (JSC::CodeBlock::likelyToTakeDeepestSlowCase): - (JSC::CodeBlock::likelyToTakeAnySlowCase): - (JSC::CodeBlock::addFrequentExitSite): - (JSC::CodeBlock::dontJITAnytimeSoon): - (JSC::CodeBlock::jitAfterWarmUp): - (JSC::CodeBlock::jitSoon): - (JSC::CodeBlock::llintExecuteCounter): - (ProgramCodeBlock): - (EvalCodeBlock): - (FunctionCodeBlock): - * bytecode/GetByIdStatus.cpp: - (JSC::GetByIdStatus::computeFromLLInt): - (JSC): - (JSC::GetByIdStatus::computeFor): - * bytecode/GetByIdStatus.h: - (JSC::GetByIdStatus::GetByIdStatus): - (JSC::GetByIdStatus::wasSeenInJIT): - (GetByIdStatus): - * bytecode/Instruction.h: - (JSC): - (JSC::Instruction::Instruction): - (Instruction): - * bytecode/LLIntCallLinkInfo.h: Added. - (JSC): - (JSC::LLIntCallLinkInfo::LLIntCallLinkInfo): - (LLIntCallLinkInfo): - (JSC::LLIntCallLinkInfo::~LLIntCallLinkInfo): - (JSC::LLIntCallLinkInfo::isLinked): - (JSC::LLIntCallLinkInfo::unlink): - * bytecode/MethodCallLinkStatus.cpp: - (JSC::MethodCallLinkStatus::computeFor): - * bytecode/Opcode.cpp: - (JSC): - * bytecode/Opcode.h: - (JSC): - (JSC::padOpcodeName): - * bytecode/PutByIdStatus.cpp: - (JSC::PutByIdStatus::computeFromLLInt): - (JSC): - (JSC::PutByIdStatus::computeFor): - * bytecode/PutByIdStatus.h: - (PutByIdStatus): - * bytecompiler/BytecodeGenerator.cpp: - (JSC::BytecodeGenerator::emitResolve): - (JSC::BytecodeGenerator::emitResolveWithBase): - (JSC::BytecodeGenerator::emitGetById): - (JSC::BytecodeGenerator::emitPutById): - (JSC::BytecodeGenerator::emitDirectPutById): - (JSC::BytecodeGenerator::emitCall): - (JSC::BytecodeGenerator::emitConstruct): - (JSC::BytecodeGenerator::emitCatch): - * dfg/DFGByteCodeParser.cpp: - (JSC::DFG::ByteCodeParser::getPredictionWithoutOSRExit): - (JSC::DFG::ByteCodeParser::handleInlining): - (JSC::DFG::ByteCodeParser::parseBlock): - * dfg/DFGCapabilities.h: - (JSC::DFG::canCompileOpcode): - * dfg/DFGOSRExitCompiler.cpp: - * dfg/DFGOperations.cpp: - * heap/Heap.h: - (JSC): - (JSC::Heap::firstAllocatorWithoutDestructors): - (Heap): - * heap/MarkStack.cpp: - (JSC::visitChildren): - * heap/MarkedAllocator.h: - (JSC): - (MarkedAllocator): - * heap/MarkedSpace.h: - (JSC): - (MarkedSpace): - (JSC::MarkedSpace::firstAllocator): - * interpreter/CallFrame.cpp: - (JSC): - (JSC::CallFrame::bytecodeOffsetForNonDFGCode): - (JSC::CallFrame::setBytecodeOffsetForNonDFGCode): - (JSC::CallFrame::currentVPC): - (JSC::CallFrame::setCurrentVPC): - (JSC::CallFrame::trueCallerFrame): - * interpreter/CallFrame.h: - (JSC::ExecState::hasReturnPC): - (JSC::ExecState::clearReturnPC): - (ExecState): - (JSC::ExecState::bytecodeOffsetForNonDFGCode): - (JSC::ExecState::currentVPC): - (JSC::ExecState::setCurrentVPC): - * interpreter/Interpreter.cpp: - (JSC::Interpreter::Interpreter): - (JSC::Interpreter::~Interpreter): - (JSC): - (JSC::Interpreter::initialize): - (JSC::Interpreter::isOpcode): - (JSC::Interpreter::unwindCallFrame): - (JSC::getCallerInfo): - (JSC::Interpreter::privateExecute): - (JSC::Interpreter::retrieveLastCaller): - * interpreter/Interpreter.h: - (JSC): - (Interpreter): - (JSC::Interpreter::getOpcode): - (JSC::Interpreter::getOpcodeID): - (JSC::Interpreter::classicEnabled): - * interpreter/RegisterFile.h: - (JSC): - (RegisterFile): - * jit/ExecutableAllocator.h: - (JSC): - * jit/HostCallReturnValue.cpp: Added. - (JSC): - (JSC::getHostCallReturnValueWithExecState): - * jit/HostCallReturnValue.h: Added. - (JSC): - (JSC::initializeHostCallReturnValue): - * jit/JIT.cpp: - (JSC::JIT::privateCompileMainPass): - (JSC::JIT::privateCompileSlowCases): - (JSC::JIT::privateCompile): - * jit/JITCode.h: - (JSC::JITCode::isOptimizingJIT): - (JITCode): - (JSC::JITCode::isBaselineCode): - (JSC::JITCode::JITCode): - * jit/JITDriver.h: - (JSC::jitCompileIfAppropriate): - (JSC::jitCompileFunctionIfAppropriate): - * jit/JITExceptions.cpp: - (JSC::jitThrow): - * jit/JITInlineMethods.h: - (JSC::JIT::updateTopCallFrame): - * jit/JITStubs.cpp: - (JSC::DEFINE_STUB_FUNCTION): - (JSC): - * jit/JITStubs.h: - (JSC): - * jit/JSInterfaceJIT.h: - * llint: Added. - * llint/LLIntCommon.h: Added. - * llint/LLIntData.cpp: Added. - (LLInt): - (JSC::LLInt::Data::Data): - (JSC::LLInt::Data::performAssertions): - (JSC::LLInt::Data::~Data): - * llint/LLIntData.h: Added. - (JSC): - (LLInt): - (Data): - (JSC::LLInt::Data::exceptionInstructions): - (JSC::LLInt::Data::opcodeMap): - (JSC::LLInt::Data::performAssertions): - * llint/LLIntEntrypoints.cpp: Added. - (LLInt): - (JSC::LLInt::getFunctionEntrypoint): - (JSC::LLInt::getEvalEntrypoint): - (JSC::LLInt::getProgramEntrypoint): - * llint/LLIntEntrypoints.h: Added. - (JSC): - (LLInt): - (JSC::LLInt::getEntrypoint): - * llint/LLIntExceptions.cpp: Added. - (LLInt): - (JSC::LLInt::interpreterThrowInCaller): - (JSC::LLInt::returnToThrowForThrownException): - (JSC::LLInt::returnToThrow): - (JSC::LLInt::callToThrow): - * llint/LLIntExceptions.h: Added. - (JSC): - (LLInt): - * llint/LLIntOfflineAsmConfig.h: Added. - * llint/LLIntOffsetsExtractor.cpp: Added. - (JSC): - (LLIntOffsetsExtractor): - (JSC::LLIntOffsetsExtractor::dummy): - (main): - * llint/LLIntSlowPaths.cpp: Added. - (LLInt): - (JSC::LLInt::llint_trace_operand): - (JSC::LLInt::llint_trace_value): - (JSC::LLInt::LLINT_SLOW_PATH_DECL): - (JSC::LLInt::traceFunctionPrologue): - (JSC::LLInt::shouldJIT): - (JSC::LLInt::entryOSR): - (JSC::LLInt::resolveGlobal): - (JSC::LLInt::getByVal): - (JSC::LLInt::handleHostCall): - (JSC::LLInt::setUpCall): - (JSC::LLInt::genericCall): - * llint/LLIntSlowPaths.h: Added. - (JSC): - (LLInt): - * llint/LLIntThunks.cpp: Added. - (LLInt): - (JSC::LLInt::generateThunkWithJumpTo): - (JSC::LLInt::functionForCallEntryThunkGenerator): - (JSC::LLInt::functionForConstructEntryThunkGenerator): - (JSC::LLInt::functionForCallArityCheckThunkGenerator): - (JSC::LLInt::functionForConstructArityCheckThunkGenerator): - (JSC::LLInt::evalEntryThunkGenerator): - (JSC::LLInt::programEntryThunkGenerator): - * llint/LLIntThunks.h: Added. - (JSC): - (LLInt): - * llint/LowLevelInterpreter.asm: Added. - * llint/LowLevelInterpreter.cpp: Added. - * llint/LowLevelInterpreter.h: Added. - * offlineasm: Added. - * offlineasm/armv7.rb: Added. - * offlineasm/asm.rb: Added. - * offlineasm/ast.rb: Added. - * offlineasm/backends.rb: Added. - * offlineasm/generate_offset_extractor.rb: Added. - * offlineasm/instructions.rb: Added. - * offlineasm/offset_extractor_constants.rb: Added. - * offlineasm/offsets.rb: Added. - * offlineasm/opt.rb: Added. - * offlineasm/parser.rb: Added. - * offlineasm/registers.rb: Added. - * offlineasm/self_hash.rb: Added. - * offlineasm/settings.rb: Added. - * offlineasm/transform.rb: Added. - * offlineasm/x86.rb: Added. - * runtime/CodeSpecializationKind.h: Added. - (JSC): - * runtime/CommonSlowPaths.h: - (JSC::CommonSlowPaths::arityCheckFor): - (CommonSlowPaths): - * runtime/Executable.cpp: - (JSC::jettisonCodeBlock): - (JSC): - (JSC::EvalExecutable::jitCompile): - (JSC::samplingDescription): - (JSC::EvalExecutable::compileInternal): - (JSC::ProgramExecutable::jitCompile): - (JSC::ProgramExecutable::compileInternal): - (JSC::FunctionExecutable::baselineCodeBlockFor): - (JSC::FunctionExecutable::jitCompileForCall): - (JSC::FunctionExecutable::jitCompileForConstruct): - (JSC::FunctionExecutable::compileForCallInternal): - (JSC::FunctionExecutable::compileForConstructInternal): - * runtime/Executable.h: - (JSC): - (EvalExecutable): - (ProgramExecutable): - (FunctionExecutable): - (JSC::FunctionExecutable::jitCompileFor): - * runtime/ExecutionHarness.h: Added. - (JSC): - (JSC::prepareForExecution): - (JSC::prepareFunctionForExecution): - * runtime/JSArray.h: - (JSC): - (JSArray): - * runtime/JSCell.h: - (JSC): - (JSCell): - * runtime/JSFunction.h: - (JSC): - (JSFunction): - * runtime/JSGlobalData.cpp: - (JSC::JSGlobalData::JSGlobalData): - * runtime/JSGlobalData.h: - (JSC): - (JSGlobalData): - * runtime/JSGlobalObject.h: - (JSC): - (JSGlobalObject): - * runtime/JSObject.h: - (JSC): - (JSObject): - (JSFinalObject): - * runtime/JSPropertyNameIterator.h: - (JSC): - (JSPropertyNameIterator): - * runtime/JSString.h: - (JSC): - (JSString): - * runtime/JSTypeInfo.h: - (JSC): - (TypeInfo): - * runtime/JSValue.cpp: - (JSC::JSValue::description): - * runtime/JSValue.h: - (LLInt): - (JSValue): - * runtime/JSVariableObject.h: - (JSC): - (JSVariableObject): - * runtime/Options.cpp: - (Options): - (JSC::Options::initializeOptions): - * runtime/Options.h: - (Options): - * runtime/ScopeChain.h: - (JSC): - (ScopeChainNode): - * runtime/Structure.cpp: - (JSC::Structure::addPropertyTransition): - * runtime/Structure.h: - (JSC): - (Structure): - * runtime/StructureChain.h: - (JSC): - (StructureChain): - * wtf/InlineASM.h: - * wtf/Platform.h: - * wtf/SentinelLinkedList.h: - (SentinelLinkedList): - (WTF::SentinelLinkedList::isEmpty): - * wtf/text/StringImpl.h: - (JSC): - (StringImpl): - -2012-02-21 Oliver Hunt - - Unbreak double-typed arrays on ARMv7 - https://bugs.webkit.org/show_bug.cgi?id=79177 - - Reviewed by Gavin Barraclough. - - The existing code had completely broken address arithmetic. - - * JSCTypedArrayStubs.h: - (JSC): - * assembler/MacroAssemblerARMv7.h: - (JSC::MacroAssemblerARMv7::storeDouble): - (JSC::MacroAssemblerARMv7::storeFloat): - -2012-02-21 Gavin Barraclough - - Should be able to reconfigure a non-configurable property as read-only - https://bugs.webkit.org/show_bug.cgi?id=79170 - - Reviewed by Sam Weinig. - - See ES5.1 8.12.9 10.a.i - the spec prohibits making a read-only property writable, - but does not inhibit making a writable property read-only. - - * runtime/JSGlobalData.cpp: - (JSC::JSGlobalData::JSGlobalData): - * runtime/JSGlobalData.h: - (JSC::JSGlobalData::setInDefineOwnProperty): - (JSGlobalData): - (JSC::JSGlobalData::isInDefineOwnProperty): - - Added flag, tracking whether we are in JSObject::defineOwnProperty. - * runtime/JSObject.cpp: - (JSC::JSObject::deleteProperty): - (DefineOwnPropertyScope): - - Always allow properties to be deleted by DefineOwnProperty - assume it knows what it is doing! - (JSC::DefineOwnPropertyScope::DefineOwnPropertyScope): - (JSC::DefineOwnPropertyScope::~DefineOwnPropertyScope): - - Added RAII helper. - (JSC::JSObject::defineOwnProperty): - - Track on the globalData when we are in this method. - -2012-02-21 Oliver Hunt - - Make TypedArrays be available in commandline jsc - https://bugs.webkit.org/show_bug.cgi?id=79163 - - Reviewed by Gavin Barraclough. - - Adds a compile time option to have jsc support a basic implementation - of the TypedArrays available in WebCore. This lets us test the typed - array logic in the JIT witout having to build webcore. - - * JSCTypedArrayStubs.h: Added. - (JSC): - * JavaScriptCore.xcodeproj/project.pbxproj: - * jsc.cpp: - (GlobalObject::finishCreation): - (GlobalObject): - (GlobalObject::addConstructableFunction): - * runtime/JSGlobalData.h: - (JSGlobalData): - -2012-02-21 Tom Sepez - - equalIgnoringNullity() only comparing half the bytes for equality - https://bugs.webkit.org/show_bug.cgi?id=79135 - - Reviewed by Adam Barth. - - * wtf/text/StringImpl.h: - (WTF::equalIgnoringNullity): - -2012-02-21 Roland Takacs - - Unnecessary preprocessor macros in MainThread.h/cpp - https://bugs.webkit.org/show_bug.cgi?id=79083 - - Removed invalid/wrong PLATFORM(WINDOWS) preprocessor macro. - - * wtf/MainThread.cpp: - (WTF): - * wtf/MainThread.h: - (WTF): - -2012-02-21 Sam Weinig - - Attempt to fix the Snow Leopard build. - - * Configurations/Base.xcconfig: - -2012-02-21 Sam Weinig - - Use libc++ when building with Clang on Mac - https://bugs.webkit.org/show_bug.cgi?id=78981 - - Reviewed by Dan Bernstein. - - * Configurations/Base.xcconfig: - -2012-02-21 Adam Roben - - Roll out r108309, r108323, and r108326 - - They broke the 32-bit Lion build. - - Original bugs is . - - * CMakeLists.txt: - * GNUmakefile.am: - * GNUmakefile.list.am: - * JavaScriptCore.pri: - * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj: - * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCoreCommon.vsprops: - * JavaScriptCore.vcproj/JavaScriptCore/copy-files.cmd: - * JavaScriptCore.xcodeproj/project.pbxproj: - * Target.pri: - * assembler/LinkBuffer.h: - * assembler/MacroAssemblerCodeRef.h: - * bytecode/BytecodeConventions.h: Removed. - * bytecode/CallLinkStatus.cpp: - * bytecode/CallLinkStatus.h: - * bytecode/CodeBlock.cpp: - * bytecode/CodeBlock.h: - * bytecode/GetByIdStatus.cpp: - * bytecode/GetByIdStatus.h: - * bytecode/Instruction.h: - * bytecode/LLIntCallLinkInfo.h: Removed. - * bytecode/MethodCallLinkStatus.cpp: - * bytecode/Opcode.cpp: - * bytecode/Opcode.h: - * bytecode/PutByIdStatus.cpp: - * bytecode/PutByIdStatus.h: - * bytecompiler/BytecodeGenerator.cpp: - * dfg/DFGByteCodeParser.cpp: - * dfg/DFGCapabilities.h: - * dfg/DFGOSRExitCompiler.cpp: - * dfg/DFGOperations.cpp: - * heap/Heap.h: - * heap/MarkStack.cpp: - * heap/MarkedAllocator.h: - * heap/MarkedSpace.h: - * interpreter/CallFrame.cpp: - * interpreter/CallFrame.h: - * interpreter/Interpreter.cpp: - * interpreter/Interpreter.h: - * interpreter/RegisterFile.h: - * jit/ExecutableAllocator.h: - * jit/HostCallReturnValue.cpp: Removed. - * jit/HostCallReturnValue.h: Removed. - * jit/JIT.cpp: - * jit/JITCode.h: - * jit/JITDriver.h: - * jit/JITExceptions.cpp: - * jit/JITInlineMethods.h: - * jit/JITStubs.cpp: - * jit/JITStubs.h: - * jit/JSInterfaceJIT.h: - * llint/LLIntCommon.h: Removed. - * llint/LLIntData.cpp: Removed. - * llint/LLIntData.h: Removed. - * llint/LLIntEntrypoints.cpp: Removed. - * llint/LLIntEntrypoints.h: Removed. - * llint/LLIntExceptions.cpp: Removed. - * llint/LLIntExceptions.h: Removed. - * llint/LLIntOfflineAsmConfig.h: Removed. - * llint/LLIntOffsetsExtractor.cpp: Removed. - * llint/LLIntSlowPaths.cpp: Removed. - * llint/LLIntSlowPaths.h: Removed. - * llint/LLIntThunks.cpp: Removed. - * llint/LLIntThunks.h: Removed. - * llint/LowLevelInterpreter.asm: Removed. - * llint/LowLevelInterpreter.cpp: Removed. - * llint/LowLevelInterpreter.h: Removed. - * offlineasm/armv7.rb: Removed. - * offlineasm/asm.rb: Removed. - * offlineasm/ast.rb: Removed. - * offlineasm/backends.rb: Removed. - * offlineasm/generate_offset_extractor.rb: Removed. - * offlineasm/instructions.rb: Removed. - * offlineasm/offset_extractor_constants.rb: Removed. - * offlineasm/offsets.rb: Removed. - * offlineasm/opt.rb: Removed. - * offlineasm/parser.rb: Removed. - * offlineasm/registers.rb: Removed. - * offlineasm/self_hash.rb: Removed. - * offlineasm/settings.rb: Removed. - * offlineasm/transform.rb: Removed. - * offlineasm/x86.rb: Removed. - * runtime/CodeSpecializationKind.h: Removed. - * runtime/CommonSlowPaths.h: - * runtime/Executable.cpp: - * runtime/Executable.h: - * runtime/ExecutionHarness.h: Removed. - * runtime/JSArray.h: - * runtime/JSCell.h: - * runtime/JSFunction.h: - * runtime/JSGlobalData.cpp: - * runtime/JSGlobalData.h: - * runtime/JSGlobalObject.h: - * runtime/JSObject.h: - * runtime/JSPropertyNameIterator.h: - * runtime/JSString.h: - * runtime/JSTypeInfo.h: - * runtime/JSValue.cpp: - * runtime/JSValue.h: - * runtime/JSVariableObject.h: - * runtime/Options.cpp: - * runtime/Options.h: - * runtime/ScopeChain.h: - * runtime/Structure.cpp: - * runtime/Structure.h: - * runtime/StructureChain.h: - * wtf/InlineASM.h: - * wtf/Platform.h: - * wtf/SentinelLinkedList.h: - * wtf/text/StringImpl.h: - -2012-02-21 Gustavo Noronha Silva and Bob Tracy - - Does not build on IA64, SPARC and Alpha - https://bugs.webkit.org/show_bug.cgi?id=79047 - - Rubber-stamped by Kent Tamura. - - * wtf/dtoa/utils.h: these architectures also have correct double - operations, so add them to the appropriate side of the check. - -2012-02-21 Filip Pizlo - - Fix massive crashes in all tests introduced by previous build fix, and fix non-DFG build. - https://bugs.webkit.org/show_bug.cgi?id=75812 - - Reviewed by Csaba Osztrogonác. - - * dfg/DFGOperations.cpp: - (JSC): - * jit/HostCallReturnValue.h: - (JSC::initializeHostCallReturnValue): - -2012-02-21 Filip Pizlo - - Attempted build fix for ELF platforms. - - * dfg/DFGOperations.cpp: - (JSC): - (JSC::getHostCallReturnValueWithExecState): - * jit/HostCallReturnValue.cpp: - (JSC): - * jit/HostCallReturnValue.h: - (JSC::initializeHostCallReturnValue): - -2012-02-20 Filip Pizlo - - JSC should be a triple-tier VM - https://bugs.webkit.org/show_bug.cgi?id=75812 - - - Reviewed by Gavin Barraclough. - - Implemented an interpreter that uses the JIT's calling convention. This - interpreter is called LLInt, or the Low Level Interpreter. JSC will now - will start by executing code in LLInt and will only tier up to the old - JIT after the code is proven hot. - - LLInt is written in a modified form of our macro assembly. This new macro - assembly is compiled by an offline assembler (see offlineasm), which - implements many modern conveniences such as a Turing-complete CPS-based - macro language and direct access to relevant C++ type information - (basically offsets of fields and sizes of structs/classes). - - Code executing in LLInt appears to the rest of the JSC world "as if" it - were executing in the old JIT. Hence, things like exception handling and - cross-execution-engine calls just work and require pretty much no - additional overhead. - - This interpreter is 2-2.5x faster than our old interpreter on SunSpider, - V8, and Kraken. With triple-tiering turned on, we're neutral on SunSpider, - V8, and Kraken, but appear to get a double-digit improvement on real-world - websites due to a huge reduction in the amount of JIT'ing. - - * CMakeLists.txt: - * GNUmakefile.am: - * GNUmakefile.list.am: - * JavaScriptCore.pri: - * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj: - * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCoreCommon.vsprops: - * JavaScriptCore.vcproj/JavaScriptCore/copy-files.cmd: - * JavaScriptCore.xcodeproj/project.pbxproj: - * Target.pri: - * assembler/LinkBuffer.h: - * assembler/MacroAssemblerCodeRef.h: - (MacroAssemblerCodePtr): - (JSC::MacroAssemblerCodePtr::createFromExecutableAddress): - * bytecode/BytecodeConventions.h: Added. - * bytecode/CallLinkStatus.cpp: - (JSC::CallLinkStatus::computeFromLLInt): - (JSC): - (JSC::CallLinkStatus::computeFor): - * bytecode/CallLinkStatus.h: - (JSC::CallLinkStatus::isSet): - (JSC::CallLinkStatus::operator!): - (CallLinkStatus): - * bytecode/CodeBlock.cpp: - (JSC::CodeBlock::dump): - (JSC::CodeBlock::CodeBlock): - (JSC::CodeBlock::~CodeBlock): - (JSC::CodeBlock::finalizeUnconditionally): - (JSC::CodeBlock::stronglyVisitStrongReferences): - (JSC): - (JSC::CodeBlock::unlinkCalls): - (JSC::CodeBlock::unlinkIncomingCalls): - (JSC::CodeBlock::bytecodeOffset): - (JSC::ProgramCodeBlock::jettison): - (JSC::EvalCodeBlock::jettison): - (JSC::FunctionCodeBlock::jettison): - (JSC::ProgramCodeBlock::jitCompileImpl): - (JSC::EvalCodeBlock::jitCompileImpl): - (JSC::FunctionCodeBlock::jitCompileImpl): - * bytecode/CodeBlock.h: - (JSC): - (CodeBlock): - (JSC::CodeBlock::baselineVersion): - (JSC::CodeBlock::linkIncomingCall): - (JSC::CodeBlock::bytecodeOffset): - (JSC::CodeBlock::jitCompile): - (JSC::CodeBlock::hasOptimizedReplacement): - (JSC::CodeBlock::addPropertyAccessInstruction): - (JSC::CodeBlock::addGlobalResolveInstruction): - (JSC::CodeBlock::addLLIntCallLinkInfo): - (JSC::CodeBlock::addGlobalResolveInfo): - (JSC::CodeBlock::numberOfMethodCallLinkInfos): - (JSC::CodeBlock::valueProfilePredictionForBytecodeOffset): - (JSC::CodeBlock::likelyToTakeSlowCase): - (JSC::CodeBlock::couldTakeSlowCase): - (JSC::CodeBlock::likelyToTakeSpecialFastCase): - (JSC::CodeBlock::likelyToTakeDeepestSlowCase): - (JSC::CodeBlock::likelyToTakeAnySlowCase): - (JSC::CodeBlock::addFrequentExitSite): - (JSC::CodeBlock::dontJITAnytimeSoon): - (JSC::CodeBlock::jitAfterWarmUp): - (JSC::CodeBlock::jitSoon): - (JSC::CodeBlock::llintExecuteCounter): - (ProgramCodeBlock): - (EvalCodeBlock): - (FunctionCodeBlock): - * bytecode/GetByIdStatus.cpp: - (JSC::GetByIdStatus::computeFromLLInt): - (JSC): - (JSC::GetByIdStatus::computeFor): - * bytecode/GetByIdStatus.h: - (JSC::GetByIdStatus::GetByIdStatus): - (JSC::GetByIdStatus::wasSeenInJIT): - (GetByIdStatus): - * bytecode/Instruction.h: - (JSC): - (JSC::Instruction::Instruction): - (Instruction): - * bytecode/LLIntCallLinkInfo.h: Added. - (JSC): - (JSC::LLIntCallLinkInfo::LLIntCallLinkInfo): - (LLIntCallLinkInfo): - (JSC::LLIntCallLinkInfo::~LLIntCallLinkInfo): - (JSC::LLIntCallLinkInfo::isLinked): - (JSC::LLIntCallLinkInfo::unlink): - * bytecode/MethodCallLinkStatus.cpp: - (JSC::MethodCallLinkStatus::computeFor): - * bytecode/Opcode.cpp: - (JSC): - * bytecode/Opcode.h: - (JSC): - (JSC::padOpcodeName): - * bytecode/PutByIdStatus.cpp: - (JSC::PutByIdStatus::computeFromLLInt): - (JSC): - (JSC::PutByIdStatus::computeFor): - * bytecode/PutByIdStatus.h: - (PutByIdStatus): - * bytecompiler/BytecodeGenerator.cpp: - (JSC::BytecodeGenerator::emitResolve): - (JSC::BytecodeGenerator::emitResolveWithBase): - (JSC::BytecodeGenerator::emitGetById): - (JSC::BytecodeGenerator::emitPutById): - (JSC::BytecodeGenerator::emitDirectPutById): - (JSC::BytecodeGenerator::emitCall): - (JSC::BytecodeGenerator::emitConstruct): - (JSC::BytecodeGenerator::emitCatch): - * dfg/DFGByteCodeParser.cpp: - (JSC::DFG::ByteCodeParser::getPredictionWithoutOSRExit): - (JSC::DFG::ByteCodeParser::handleInlining): - (JSC::DFG::ByteCodeParser::parseBlock): - * dfg/DFGCapabilities.h: - (JSC::DFG::canCompileOpcode): - * dfg/DFGOSRExitCompiler.cpp: - * dfg/DFGOperations.cpp: - * heap/Heap.h: - (JSC): - (JSC::Heap::firstAllocatorWithoutDestructors): - (Heap): - * heap/MarkStack.cpp: - (JSC::visitChildren): - * heap/MarkedAllocator.h: - (JSC): - (MarkedAllocator): - * heap/MarkedSpace.h: - (JSC): - (MarkedSpace): - (JSC::MarkedSpace::firstAllocator): - * interpreter/CallFrame.cpp: - (JSC): - (JSC::CallFrame::bytecodeOffsetForNonDFGCode): - (JSC::CallFrame::setBytecodeOffsetForNonDFGCode): - (JSC::CallFrame::currentVPC): - (JSC::CallFrame::setCurrentVPC): - (JSC::CallFrame::trueCallerFrame): - * interpreter/CallFrame.h: - (JSC::ExecState::hasReturnPC): - (JSC::ExecState::clearReturnPC): - (ExecState): - (JSC::ExecState::bytecodeOffsetForNonDFGCode): - (JSC::ExecState::currentVPC): - (JSC::ExecState::setCurrentVPC): - * interpreter/Interpreter.cpp: - (JSC::Interpreter::Interpreter): - (JSC::Interpreter::~Interpreter): - (JSC): - (JSC::Interpreter::initialize): - (JSC::Interpreter::isOpcode): - (JSC::Interpreter::unwindCallFrame): - (JSC::getCallerInfo): - (JSC::Interpreter::privateExecute): - (JSC::Interpreter::retrieveLastCaller): - * interpreter/Interpreter.h: - (JSC): - (Interpreter): - (JSC::Interpreter::getOpcode): - (JSC::Interpreter::getOpcodeID): - (JSC::Interpreter::classicEnabled): - * interpreter/RegisterFile.h: - (JSC): - (RegisterFile): - * jit/ExecutableAllocator.h: - (JSC): - * jit/HostCallReturnValue.cpp: Added. - (JSC): - (JSC::getHostCallReturnValueWithExecState): - * jit/HostCallReturnValue.h: Added. - (JSC): - (JSC::initializeHostCallReturnValue): - * jit/JIT.cpp: - (JSC::JIT::privateCompileMainPass): - (JSC::JIT::privateCompileSlowCases): - (JSC::JIT::privateCompile): - * jit/JITCode.h: - (JSC::JITCode::isOptimizingJIT): - (JITCode): - (JSC::JITCode::isBaselineCode): - (JSC::JITCode::JITCode): - * jit/JITDriver.h: - (JSC::jitCompileIfAppropriate): - (JSC::jitCompileFunctionIfAppropriate): - * jit/JITExceptions.cpp: - (JSC::jitThrow): - * jit/JITInlineMethods.h: - (JSC::JIT::updateTopCallFrame): - * jit/JITStubs.cpp: - (JSC::DEFINE_STUB_FUNCTION): - (JSC): - * jit/JITStubs.h: - (JSC): - * jit/JSInterfaceJIT.h: - * llint: Added. - * llint/LLIntCommon.h: Added. - * llint/LLIntData.cpp: Added. - (LLInt): - (JSC::LLInt::Data::Data): - (JSC::LLInt::Data::performAssertions): - (JSC::LLInt::Data::~Data): - * llint/LLIntData.h: Added. - (JSC): - (LLInt): - (Data): - (JSC::LLInt::Data::exceptionInstructions): - (JSC::LLInt::Data::opcodeMap): - (JSC::LLInt::Data::performAssertions): - * llint/LLIntEntrypoints.cpp: Added. - (LLInt): - (JSC::LLInt::getFunctionEntrypoint): - (JSC::LLInt::getEvalEntrypoint): - (JSC::LLInt::getProgramEntrypoint): - * llint/LLIntEntrypoints.h: Added. - (JSC): - (LLInt): - (JSC::LLInt::getEntrypoint): - * llint/LLIntExceptions.cpp: Added. - (LLInt): - (JSC::LLInt::interpreterThrowInCaller): - (JSC::LLInt::returnToThrowForThrownException): - (JSC::LLInt::returnToThrow): - (JSC::LLInt::callToThrow): - * llint/LLIntExceptions.h: Added. - (JSC): - (LLInt): - * llint/LLIntOfflineAsmConfig.h: Added. - * llint/LLIntOffsetsExtractor.cpp: Added. - (JSC): - (LLIntOffsetsExtractor): - (JSC::LLIntOffsetsExtractor::dummy): - (main): - * llint/LLIntSlowPaths.cpp: Added. - (LLInt): - (JSC::LLInt::llint_trace_operand): - (JSC::LLInt::llint_trace_value): - (JSC::LLInt::LLINT_SLOW_PATH_DECL): - (JSC::LLInt::traceFunctionPrologue): - (JSC::LLInt::shouldJIT): - (JSC::LLInt::entryOSR): - (JSC::LLInt::resolveGlobal): - (JSC::LLInt::getByVal): - (JSC::LLInt::handleHostCall): - (JSC::LLInt::setUpCall): - (JSC::LLInt::genericCall): - * llint/LLIntSlowPaths.h: Added. - (JSC): - (LLInt): - * llint/LLIntThunks.cpp: Added. - (LLInt): - (JSC::LLInt::generateThunkWithJumpTo): - (JSC::LLInt::functionForCallEntryThunkGenerator): - (JSC::LLInt::functionForConstructEntryThunkGenerator): - (JSC::LLInt::functionForCallArityCheckThunkGenerator): - (JSC::LLInt::functionForConstructArityCheckThunkGenerator): - (JSC::LLInt::evalEntryThunkGenerator): - (JSC::LLInt::programEntryThunkGenerator): - * llint/LLIntThunks.h: Added. - (JSC): - (LLInt): - * llint/LowLevelInterpreter.asm: Added. - * llint/LowLevelInterpreter.cpp: Added. - * llint/LowLevelInterpreter.h: Added. - * offlineasm: Added. - * offlineasm/armv7.rb: Added. - * offlineasm/asm.rb: Added. - * offlineasm/ast.rb: Added. - * offlineasm/backends.rb: Added. - * offlineasm/generate_offset_extractor.rb: Added. - * offlineasm/instructions.rb: Added. - * offlineasm/offset_extractor_constants.rb: Added. - * offlineasm/offsets.rb: Added. - * offlineasm/opt.rb: Added. - * offlineasm/parser.rb: Added. - * offlineasm/registers.rb: Added. - * offlineasm/self_hash.rb: Added. - * offlineasm/settings.rb: Added. - * offlineasm/transform.rb: Added. - * offlineasm/x86.rb: Added. - * runtime/CodeSpecializationKind.h: Added. - (JSC): - * runtime/CommonSlowPaths.h: - (JSC::CommonSlowPaths::arityCheckFor): - (CommonSlowPaths): - * runtime/Executable.cpp: - (JSC::jettisonCodeBlock): - (JSC): - (JSC::EvalExecutable::jitCompile): - (JSC::samplingDescription): - (JSC::EvalExecutable::compileInternal): - (JSC::ProgramExecutable::jitCompile): - (JSC::ProgramExecutable::compileInternal): - (JSC::FunctionExecutable::baselineCodeBlockFor): - (JSC::FunctionExecutable::jitCompileForCall): - (JSC::FunctionExecutable::jitCompileForConstruct): - (JSC::FunctionExecutable::compileForCallInternal): - (JSC::FunctionExecutable::compileForConstructInternal): - * runtime/Executable.h: - (JSC): - (EvalExecutable): - (ProgramExecutable): - (FunctionExecutable): - (JSC::FunctionExecutable::jitCompileFor): - * runtime/ExecutionHarness.h: Added. - (JSC): - (JSC::prepareForExecution): - (JSC::prepareFunctionForExecution): - * runtime/JSArray.h: - (JSC): - (JSArray): - * runtime/JSCell.h: - (JSC): - (JSCell): - * runtime/JSFunction.h: - (JSC): - (JSFunction): - * runtime/JSGlobalData.cpp: - (JSC::JSGlobalData::JSGlobalData): - * runtime/JSGlobalData.h: - (JSC): - (JSGlobalData): - * runtime/JSGlobalObject.h: - (JSC): - (JSGlobalObject): - * runtime/JSObject.h: - (JSC): - (JSObject): - (JSFinalObject): - * runtime/JSPropertyNameIterator.h: - (JSC): - (JSPropertyNameIterator): - * runtime/JSString.h: - (JSC): - (JSString): - * runtime/JSTypeInfo.h: - (JSC): - (TypeInfo): - * runtime/JSValue.cpp: - (JSC::JSValue::description): - * runtime/JSValue.h: - (LLInt): - (JSValue): - * runtime/JSVariableObject.h: - (JSC): - (JSVariableObject): - * runtime/Options.cpp: - (Options): - (JSC::Options::initializeOptions): - * runtime/Options.h: - (Options): - * runtime/ScopeChain.h: - (JSC): - (ScopeChainNode): - * runtime/Structure.cpp: - (JSC::Structure::addPropertyTransition): - * runtime/Structure.h: - (JSC): - (Structure): - * runtime/StructureChain.h: - (JSC): - (StructureChain): - * wtf/InlineASM.h: - * wtf/Platform.h: - * wtf/SentinelLinkedList.h: - (SentinelLinkedList): - (WTF::SentinelLinkedList::isEmpty): - * wtf/text/StringImpl.h: - (JSC): - (StringImpl): - -2012-02-20 Filip Pizlo - - Unreviewed, rolling out http://trac.webkit.org/changeset/108291 - It completely broke the 32-bit JIT. - - * heap/CopiedAllocator.h: - * heap/CopiedSpace.h: - (CopiedSpace): - * heap/Heap.h: - (JSC::Heap::allocatorForObjectWithDestructor): - * jit/JIT.cpp: - (JSC::JIT::privateCompileSlowCases): - * jit/JIT.h: - (JIT): - * jit/JITInlineMethods.h: - (JSC): - * jit/JITOpcodes.cpp: - (JSC::JIT::emit_op_new_array): - * runtime/JSArray.cpp: - (JSC::storageSize): - (JSC): - * runtime/JSArray.h: - (ArrayStorage): - (JSArray): - -2012-02-20 Gavin Barraclough - - [[Put]] should throw if prototype chain contains a readonly property. - https://bugs.webkit.org/show_bug.cgi?id=79069 - - Reviewed by Oliver Hunt. - - Currently we only check the base of the put, not the prototype chain. - Fold this check in with the test for accessors. - - * runtime/JSObject.cpp: - (JSC::JSObject::put): - - Updated to test all objects in the propotype chain for readonly properties. - (JSC::JSObject::putDirectAccessor): - (JSC::putDescriptor): - - Record the presence of readonly properties on the structure. - * runtime/Structure.cpp: - (JSC::Structure::Structure): - - hasGetterSetterPropertiesExcludingProto expanded to hasReadOnlyOrGetterSetterPropertiesExcludingProto. - * runtime/Structure.h: - (JSC::Structure::hasReadOnlyOrGetterSetterPropertiesExcludingProto): - (JSC::Structure::setHasGetterSetterProperties): - - hasGetterSetterPropertiesExcludingProto expanded to hasReadOnlyOrGetterSetterPropertiesExcludingProto. - (JSC::Structure::setContainsReadOnlyProperties): - - Added. - -2012-02-20 Mark Hahnenberg - - Implement fast path for op_new_array in the baseline JIT - https://bugs.webkit.org/show_bug.cgi?id=78612 - - Reviewed by Filip Pizlo. - - * heap/CopiedAllocator.h: - (CopiedAllocator): Friended the JIT to allow access to m_currentOffset. - * heap/CopiedSpace.h: - (CopiedSpace): Friended the JIT to allow access to - (JSC::CopiedSpace::allocator): - * heap/Heap.h: - (JSC::Heap::storageAllocator): Added a getter for the CopiedAllocator class so the JIT - can use it for simple allocation i.e. when we can just bump the offset without having to - do anything else. - * jit/JIT.cpp: - (JSC::JIT::privateCompileSlowCases): Added new slow case for op_new_array for when - we have to bail out because the fast allocation path fails for whatever reason. - * jit/JIT.h: - (JIT): - * jit/JITInlineMethods.h: - (JSC::JIT::emitAllocateBasicStorage): Added utility function that allows objects to - allocate generic backing stores. This function is used by emitAllocateJSArray. - (JSC): - (JSC::JIT::emitAllocateJSArray): Added utility function that allows the client to - more easily allocate JSArrays. This function is used by emit_op_new_array and I expect - it will also be used for emit_op_new_array_buffer. - * jit/JITOpcodes.cpp: - (JSC::JIT::emit_op_new_array): Changed to do inline allocation of JSArrays. Still does - a stub call for oversize arrays. - (JSC): - (JSC::JIT::emitSlow_op_new_array): Just bails out to a stub call if we fail in any way on - the fast path. - * runtime/JSArray.cpp: - (JSC): - * runtime/JSArray.h: Added lots of offset functions for all the fields that we need to - initialize in the JIT. - (ArrayStorage): - (JSC::ArrayStorage::lengthOffset): - (JSC::ArrayStorage::numValuesInVectorOffset): - (JSC::ArrayStorage::allocBaseOffset): - (JSC::ArrayStorage::vectorOffset): - (JSArray): - (JSC::JSArray::sparseValueMapOffset): - (JSC::JSArray::subclassDataOffset): - (JSC::JSArray::indexBiasOffset): - (JSC): - (JSC::JSArray::storageSize): Moved this function from being a static function in the cpp file - to being a static function in the JSArray class. This move allows the JIT to call it to - see what size it should allocate. - -2012-02-20 Gavin Barraclough - - DefineOwnProperty fails with numeric properties & Object.prototype - https://bugs.webkit.org/show_bug.cgi?id=79059 - - Reviewed by Oliver Hunt. - - ObjectPrototype caches whether it contains any numeric properties (m_hasNoPropertiesWithUInt32Names), - calls to defineOwnProperty need to update this cache. - - * runtime/ObjectPrototype.cpp: - (JSC::ObjectPrototype::put): - (JSC::ObjectPrototype::defineOwnProperty): - (JSC): - (JSC::ObjectPrototype::getOwnPropertySlotByIndex): - * runtime/ObjectPrototype.h: - (ObjectPrototype): - -2012-02-20 Pino Toscano - - Does not build on GNU Hurd - https://bugs.webkit.org/show_bug.cgi?id=79045 - - Reviewed by Gustavo Noronha Silva. - - * wtf/Platform.h: define WTF_OS_HURD. - * wtf/ThreadIdentifierDataPthreads.cpp: adds a band-aid fix - for the lack of PTHREAD_KEYS_MAX definition, with a value which - should not cause issues. - -2012-02-20 Gavin Barraclough - - Unreviewed windows build fix. - - * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def: - -2012-02-20 Mark Hahnenberg - - Undoing accidental changes - - * heap/Heap.cpp: - (JSC::Heap::collectAllGarbage): - -2012-02-20 Mark Hahnenberg - - Factor out allocation in CopySpace into a separate CopyAllocator - https://bugs.webkit.org/show_bug.cgi?id=78610 - - Reviewed by Oliver Hunt. - - Added a new CopyAllocator class, which allows us to do allocations without - having to load the current offset and store the current offset in the current - block. This change will allow us to easily do inline assembly in the JIT for - array allocations. - - * GNUmakefile.list.am: - * JavaScriptCore.gypi: - * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj: - * JavaScriptCore.xcodeproj/project.pbxproj: - * heap/CopiedAllocator.h: Added. - (JSC): - (CopiedAllocator): - (JSC::CopiedAllocator::currentBlock): - (JSC::CopiedAllocator::CopiedAllocator): - (JSC::CopiedAllocator::allocate): - (JSC::CopiedAllocator::fitsInCurrentBlock): - (JSC::CopiedAllocator::wasLastAllocation): - (JSC::CopiedAllocator::startedCopying): - (JSC::CopiedAllocator::resetCurrentBlock): - (JSC::CopiedAllocator::currentUtilization): - (JSC::CopiedAllocator::resetLastAllocation): - * heap/CopiedBlock.h: - (CopiedBlock): - * heap/CopiedSpace.cpp: Moved some stuff from CopiedSpaceInlineMethods to here because we - weren't really getting any benefits from having such big functions in a header file. - (JSC::CopiedSpace::CopiedSpace): - (JSC): - (JSC::CopiedSpace::init): - (JSC::CopiedSpace::tryAllocateSlowCase): - (JSC::CopiedSpace::tryAllocateOversize): - (JSC::CopiedSpace::tryReallocate): - (JSC::CopiedSpace::tryReallocateOversize): - (JSC::CopiedSpace::doneFillingBlock): - (JSC::CopiedSpace::doneCopying): - (JSC::CopiedSpace::getFreshBlock): - * heap/CopiedSpace.h: - (CopiedSpace): - * heap/CopiedSpaceInlineMethods.h: - (JSC): - (JSC::CopiedSpace::startedCopying): - (JSC::CopiedSpace::addNewBlock): - (JSC::CopiedSpace::allocateNewBlock): - (JSC::CopiedSpace::fitsInBlock): - (JSC::CopiedSpace::tryAllocate): - (JSC::CopiedSpace::allocateFromBlock): - * heap/Heap.cpp: - (JSC::Heap::collectAllGarbage): - * heap/HeapBlock.h: - (HeapBlock): - -2012-02-20 Patrick Gansterer - - Fix Visual Studio 2010 build. - - * bytecompiler/NodesCodegen.cpp: - (JSC::PropertyListNode::emitBytecode): - -2012-02-16 Gavin Barraclough - - Move special __proto__ property to Object.prototype - https://bugs.webkit.org/show_bug.cgi?id=78409 - - Reviewed by Oliver Hunt. - - Re-implement this as a regular accessor property. This has three key benefits: - 1) It makes it possible for objects to be given properties named __proto__. - 2) Object.prototype.__proto__ can be deleted, preventing object prototypes from being changed. - 3) This largely removes the magic used the implement __proto__, it can just be made a regular accessor property. - - * parser/Parser.cpp: - (JSC::::parseFunctionInfo): - - No need to prohibit functions named __proto__. - * runtime/JSGlobalObject.cpp: - (JSC::JSGlobalObject::reset): - - Add __proto__ accessor to Object.prototype. - * runtime/JSGlobalObjectFunctions.cpp: - (JSC::globalFuncProtoGetter): - (JSC::globalFuncProtoSetter): - - Definition of the __proto__ accessor functions. - * runtime/JSGlobalObjectFunctions.h: - - Declaration of the __proto__ accessor functions. - * runtime/JSObject.cpp: - (JSC::JSObject::put): - - Remove the special handling for __proto__, there is still a check to allow for a fast guard for accessors excluding __proto__. - (JSC::JSObject::putDirectAccessor): - - Track on the structure whether an object contains accessors other than one for __proto__. - (JSC::JSObject::defineOwnProperty): - - No need to prohibit definition of own properties named __proto__. - * runtime/JSObject.h: - (JSC::JSObject::inlineGetOwnPropertySlot): - - Remove the special handling for __proto__. - (JSC::JSValue::get): - - Remove the special handling for __proto__. - * runtime/JSString.cpp: - (JSC::JSString::getOwnPropertySlot): - - Remove the special handling for __proto__. - * runtime/JSValue.h: - (JSValue): - - Made synthesizePrototype public (this may be needed by the __proto__ getter). - * runtime/ObjectConstructor.cpp: - (JSC::objectConstructorGetPrototypeOf): - - Perform the security check & call prototype() directly. - * runtime/Structure.cpp: - (JSC::Structure::Structure): - - Added 'ExcludingProto' variant of the 'hasGetterSetterProperties' state. - * runtime/Structure.h: - (JSC::Structure::hasGetterSetterPropertiesExcludingProto): - (JSC::Structure::setHasGetterSetterProperties): - (Structure): - - Added 'ExcludingProto' variant of the 'hasGetterSetterProperties' state. - -2012-02-20 Michael Saboff - - Update toLower and toUpper tests for Unicode 6.1 changes - https://bugs.webkit.org/show_bug.cgi?id=78923 - - Reviewed by Oliver Hunt. - - * tests/mozilla/ecma/String/15.5.4.11-2.js: Updated the test - to handle a third set of results for updated Unicode 6.1 - changes. - (getTestCases): - (TestCaseMultiExpected): - (writeTestCaseResultMultiExpected): - (getTestCaseResultMultiExpected): - (test): - (GetUnicodeValues): - (DecimalToHexString): - -2012-02-20 Andy Wingo - - Remove unused features from CodeFeatures - https://bugs.webkit.org/show_bug.cgi?id=78804 - - Reviewed by Gavin Barraclough. - - * parser/Nodes.h: - * parser/ASTBuilder.h: - (JSC::ClosureFeature): - (JSC::ASTBuilder::createFunctionBody): - (JSC::ASTBuilder::usesClosures): - Remove "ClosureFeature". Since we track captured variables more - precisely, this bit doesn't do us any good. - - (JSC::AssignFeature): - (JSC::ASTBuilder::makeAssignNode): - (JSC::ASTBuilder::makePrefixNode): - (JSC::ASTBuilder::makePostfixNode): - (JSC::ASTBuilder::usesAssignment): - Similarly, remove AssignFeature. It is unused. - -2012-02-19 Carlos Garcia Campos - - Unreviewed. Fix make distcheck issues. - - * GNUmakefile.list.am: Add missing files. - -2012-02-18 Sam Weinig - - Fix style issues in DFG Phase classes - https://bugs.webkit.org/show_bug.cgi?id=78983 - - Reviewed by Ryosuke Niwa. - - * dfg/DFGArithNodeFlagsInferencePhase.cpp: - * dfg/DFGCFAPhase.cpp: - * dfg/DFGCSEPhase.cpp: - * dfg/DFGPredictionPropagationPhase.cpp: - * dfg/DFGVirtualRegisterAllocationPhase.cpp: - Add a space before the colon in class declarations. - -2012-02-18 Filip Pizlo - - Attempt to fix Windows build. - - * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def: - -2012-02-18 Sam Weinig - - Fix the libc++ build. - - Reviewed by Anders Carlsson. - - * heap/Weak.h: - Libc++'s nullptr emulation does not allow default construction - of the nullptr_t type. Work around this with the arguably clearer - just returning nullptr. - -2012-02-18 Filip Pizlo - - DFGPropagator.cpp has too many things - https://bugs.webkit.org/show_bug.cgi?id=78956 - - Reviewed by Oliver Hunt. - - Added the notion of a DFG::Phase. Removed DFG::Propagator, and took its - various things and put them into separate files. These new phases follow - the naming convention "DFGPhase" where is a noun. They are - called via functions of the form "perform". - - * CMakeLists.txt: - * GNUmakefile.list.am: - * JavaScriptCore.xcodeproj/project.pbxproj: - * Target.pri: - * dfg/DFGArithNodeFlagsInferencePhase.cpp: Added. - (DFG): - (JSC::DFG::performArithNodeFlagsInference): - * dfg/DFGArithNodeFlagsInferencePhase.h: Added. - (DFG): - * dfg/DFGCFAPhase.cpp: Added. - (DFG): - (JSC::DFG::performCFA): - * dfg/DFGCFAPhase.h: Added. - (DFG): - * dfg/DFGCSEPhase.cpp: Added. - (DFG): - (JSC::DFG::performCSE): - * dfg/DFGCSEPhase.h: Added. - (DFG): - * dfg/DFGDriver.cpp: - (JSC::DFG::compile): - * dfg/DFGPhase.cpp: Added. - (DFG): - (JSC::DFG::Phase::beginPhase): - (JSC::DFG::Phase::endPhase): - * dfg/DFGPhase.h: Added. - (DFG): - (Phase): - (JSC::DFG::Phase::Phase): - (JSC::DFG::Phase::~Phase): - (JSC::DFG::Phase::globalData): - (JSC::DFG::Phase::codeBlock): - (JSC::DFG::Phase::profiledBlock): - (JSC::DFG::Phase::beginPhase): - (JSC::DFG::Phase::endPhase): - (JSC::DFG::runPhase): - * dfg/DFGPredictionPropagationPhase.cpp: Added. - (DFG): - (JSC::DFG::performPredictionPropagation): - * dfg/DFGPredictionPropagationPhase.h: Added. - (DFG): - * dfg/DFGPropagator.cpp: Removed. - * dfg/DFGPropagator.h: Removed. - * dfg/DFGVirtualRegisterAllocationPhase.cpp: Added. - (DFG): - (JSC::DFG::performVirtualRegisterAllocation): - * dfg/DFGVirtualRegisterAllocationPhase.h: Added. - (DFG): - -2012-02-17 Filip Pizlo - - DFG::Graph should have references to JSGlobalData, the CodeBlock being compiled, and - the CodeBlock that was used for profiling - https://bugs.webkit.org/show_bug.cgi?id=78954 - - Reviewed by Gavin Barraclough. - - * bytecode/CodeBlock.h: - (JSC::baselineCodeBlockForOriginAndBaselineCodeBlock): - (JSC): - * dfg/DFGAbstractState.cpp: - (JSC::DFG::AbstractState::AbstractState): - (JSC::DFG::AbstractState::execute): - * dfg/DFGAbstractState.h: - * dfg/DFGAssemblyHelpers.h: - (AssemblyHelpers): - * dfg/DFGByteCodeParser.cpp: - (JSC::DFG::ByteCodeParser::ByteCodeParser): - (JSC::DFG::ByteCodeParser::handleCall): - (JSC::DFG::parse): - * dfg/DFGByteCodeParser.h: - (DFG): - * dfg/DFGDriver.cpp: - (JSC::DFG::compile): - * dfg/DFGGraph.cpp: - (JSC::DFG::Graph::dump): - (JSC::DFG::Graph::predictArgumentTypes): - * dfg/DFGGraph.h: - (JSC::DFG::Graph::Graph): - (Graph): - (JSC::DFG::Graph::getJSConstantPrediction): - (JSC::DFG::Graph::addShouldSpeculateInteger): - (JSC::DFG::Graph::isInt32Constant): - (JSC::DFG::Graph::isDoubleConstant): - (JSC::DFG::Graph::isNumberConstant): - (JSC::DFG::Graph::isBooleanConstant): - (JSC::DFG::Graph::isFunctionConstant): - (JSC::DFG::Graph::valueOfJSConstant): - (JSC::DFG::Graph::valueOfInt32Constant): - (JSC::DFG::Graph::valueOfNumberConstant): - (JSC::DFG::Graph::valueOfBooleanConstant): - (JSC::DFG::Graph::valueOfFunctionConstant): - (JSC::DFG::Graph::baselineCodeBlockFor): - (JSC::DFG::Graph::valueProfileFor): - (JSC::DFG::Graph::addImmediateShouldSpeculateInteger): - * dfg/DFGJITCompiler.h: - (JSC::DFG::JITCompiler::JITCompiler): - (JITCompiler): - * dfg/DFGOSRExit.cpp: - (JSC::DFG::OSRExit::considerAddingAsFrequentExitSiteSlow): - * dfg/DFGPropagator.cpp: - (JSC::DFG::Propagator::Propagator): - (JSC::DFG::Propagator::isNotNegZero): - (JSC::DFG::Propagator::isNotZero): - (JSC::DFG::Propagator::propagateNodePredictions): - (JSC::DFG::Propagator::doRoundOfDoubleVoting): - (JSC::DFG::Propagator::globalCFA): - (JSC::DFG::propagate): - * dfg/DFGPropagator.h: - (DFG): - * dfg/DFGSpeculativeJIT.cpp: - (JSC::DFG::SpeculativeJIT::computeValueRecoveryFor): - (JSC::DFG::SpeculativeJIT::compileAdd): - (JSC::DFG::SpeculativeJIT::compileArithSub): - * dfg/DFGSpeculativeJIT.h: - (JSC::DFG::SpeculativeJIT::isConstant): - (JSC::DFG::SpeculativeJIT::isJSConstant): - (JSC::DFG::SpeculativeJIT::isInt32Constant): - (JSC::DFG::SpeculativeJIT::isDoubleConstant): - (JSC::DFG::SpeculativeJIT::isNumberConstant): - (JSC::DFG::SpeculativeJIT::isBooleanConstant): - (JSC::DFG::SpeculativeJIT::isFunctionConstant): - (JSC::DFG::SpeculativeJIT::valueOfInt32Constant): - (JSC::DFG::SpeculativeJIT::valueOfNumberConstant): - (JSC::DFG::SpeculativeJIT::valueOfJSConstant): - (JSC::DFG::SpeculativeJIT::valueOfBooleanConstant): - (JSC::DFG::SpeculativeJIT::valueOfFunctionConstant): - (JSC::DFG::SpeculativeJIT::speculationCheck): - (JSC::DFG::SpeculativeJIT::SpeculativeJIT): - -2012-02-17 Ahmad Sharif - - There is a warning in memset in glibc that gets triggered through a - warndecl when the fill-value of memset is a non-zero constant and the - size is zero. This warning is enabled when building with - -D_FORTIFY_SOURCE=2. This patch fixes the warning. - - https://bugs.webkit.org/show_bug.cgi?id=78513 - - Reviewed by Alexey Proskuryakov - - * wtf/Vector.h: - -2012-02-17 Kalev Lember - - Remove unused parameters from WTF threading API - https://bugs.webkit.org/show_bug.cgi?id=78389 - - Reviewed by Adam Roben. - - waitForThreadCompletion() had an out param 'void **result' to get the - 'void *' returned by ThreadFunction. However, the implementation in - ThreadingWin.cpp ignored the out param, not filling it in. This had - led to a situation where none of the client code made use of the param - and just ignored it. - - To clean this up, the patch changes the signature of ThreadFunction to - return void instead of void* and drops the the unused 'void **result' - parameter from waitForThreadCompletion. Also, all client code is - updated for the API change. - - As mentioned in https://bugs.webkit.org/show_bug.cgi?id=78389 , even - though the change only affects internal API, Safari is using it - directly and we'll need to keep the old versions around for ABI - compatibility. For this, the patch adds compatibility wrappers with - the old ABI. - - * JavaScriptCore.order: - * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def: - * bytecode/SamplingTool.cpp: - (JSC::SamplingThread::threadStartFunc): - (JSC::SamplingThread::stop): - * bytecode/SamplingTool.h: - (SamplingThread): - * heap/Heap.cpp: - (JSC::Heap::~Heap): - (JSC::Heap::blockFreeingThreadStartFunc): - * heap/Heap.h: - * heap/MarkStack.cpp: - (JSC::MarkStackThreadSharedData::markingThreadStartFunc): - (JSC::MarkStackThreadSharedData::~MarkStackThreadSharedData): - * heap/MarkStack.h: - (MarkStackThreadSharedData): - * wtf/ParallelJobsGeneric.cpp: - (WTF::ParallelEnvironment::ThreadPrivate::workerThread): - * wtf/ParallelJobsGeneric.h: - (ThreadPrivate): - * wtf/ThreadFunctionInvocation.h: Update the signature of - ThreadFunction. - (WTF): - * wtf/Threading.cpp: - (WTF::threadEntryPoint): Update for ThreadFunction signature change. - (WTF): - (WTF::ThreadFunctionWithReturnValueInvocation::ThreadFunctionWithReturnValueInvocation): - ABI compatibility function for Safari. - (ThreadFunctionWithReturnValueInvocation): Ditto. - (WTF::compatEntryPoint): Ditto. - (WTF::createThread): Ditto. - (WTF::waitForThreadCompletion): Ditto. - * wtf/Threading.h: Update the signature of ThreadFunction and - waitForThreadCompletion. - (WTF): - * wtf/ThreadingPthreads.cpp: Implement the new API. - (WTF::wtfThreadEntryPoint): - (WTF): - (WTF::createThreadInternal): - (WTF::waitForThreadCompletion): - * wtf/ThreadingWin.cpp: Implement the new API. - (WTF::wtfThreadEntryPoint): - (WTF::waitForThreadCompletion): - -2012-02-16 Oliver Hunt - - Implement Error.stack - https://bugs.webkit.org/show_bug.cgi?id=66994 - - Reviewed by Gavin Barraclough. - - Implement support for stack traces on exception objects. This is a rewrite - of the core portion of the last stack walking logic, but the mechanical work - of adding the information to an exception comes from the original work by - Juan Carlos Montemayor Elosua. - - * interpreter/Interpreter.cpp: - (JSC::getCallerInfo): - (JSC): - (JSC::getSourceURLFromCallFrame): - (JSC::getStackFrameCodeType): - (JSC::Interpreter::getStackTrace): - (JSC::Interpreter::throwException): - (JSC::Interpreter::privateExecute): - * interpreter/Interpreter.h: - (JSC): - (StackFrame): - (JSC::StackFrame::toString): - (Interpreter): - * jsc.cpp: - (GlobalObject::finishCreation): - (functionJSCStack): - * parser/Nodes.h: - (JSC::FunctionBodyNode::setInferredName): - * parser/Parser.h: - (JSC::::parse): - * runtime/CommonIdentifiers.h: - * runtime/Error.cpp: - (JSC::addErrorInfo): - * runtime/Error.h: - (JSC): - -2012-02-17 Mark Hahnenberg - - Rename Bump* to Copy* - https://bugs.webkit.org/show_bug.cgi?id=78573 - - Reviewed by Geoffrey Garen. - - Renamed anything with "Bump" in the name to have "Copied" instead. - - * CMakeLists.txt: - * GNUmakefile.list.am: - * JavaScriptCore.gypi: - * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj: - * JavaScriptCore.xcodeproj/project.pbxproj: - * Target.pri: - * heap/BumpBlock.h: Removed. - * heap/BumpSpace.cpp: Removed. - * heap/BumpSpace.h: Removed. - * heap/BumpSpaceInlineMethods.h: Removed. - * heap/ConservativeRoots.cpp: - (JSC::ConservativeRoots::ConservativeRoots): - (JSC::ConservativeRoots::genericAddPointer): - * heap/ConservativeRoots.h: - (ConservativeRoots): - * heap/CopiedBlock.h: Added. - (JSC): - (CopiedBlock): - (JSC::CopiedBlock::CopiedBlock): - * heap/CopiedSpace.cpp: Added. - (JSC): - (JSC::CopiedSpace::tryAllocateSlowCase): - * heap/CopiedSpace.h: Added. - (JSC): - (CopiedSpace): - (JSC::CopiedSpace::isInCopyPhase): - (JSC::CopiedSpace::totalMemoryAllocated): - (JSC::CopiedSpace::totalMemoryUtilized): - * heap/CopiedSpaceInlineMethods.h: Added. - (JSC): - (JSC::CopiedSpace::CopiedSpace): - (JSC::CopiedSpace::init): - (JSC::CopiedSpace::contains): - (JSC::CopiedSpace::pin): - (JSC::CopiedSpace::startedCopying): - (JSC::CopiedSpace::doneCopying): - (JSC::CopiedSpace::doneFillingBlock): - (JSC::CopiedSpace::recycleBlock): - (JSC::CopiedSpace::getFreshBlock): - (JSC::CopiedSpace::borrowBlock): - (JSC::CopiedSpace::addNewBlock): - (JSC::CopiedSpace::allocateNewBlock): - (JSC::CopiedSpace::fitsInBlock): - (JSC::CopiedSpace::fitsInCurrentBlock): - (JSC::CopiedSpace::tryAllocate): - (JSC::CopiedSpace::tryAllocateOversize): - (JSC::CopiedSpace::allocateFromBlock): - (JSC::CopiedSpace::tryReallocate): - (JSC::CopiedSpace::tryReallocateOversize): - (JSC::CopiedSpace::isOversize): - (JSC::CopiedSpace::isPinned): - (JSC::CopiedSpace::oversizeBlockFor): - (JSC::CopiedSpace::blockFor): - * heap/Heap.cpp: - * heap/Heap.h: - (JSC): - (Heap): - * heap/MarkStack.cpp: - (JSC::MarkStackThreadSharedData::MarkStackThreadSharedData): - (JSC::SlotVisitor::drainFromShared): - (JSC::SlotVisitor::startCopying): - (JSC::SlotVisitor::allocateNewSpace): - (JSC::SlotVisitor::doneCopying): - * heap/MarkStack.h: - (MarkStackThreadSharedData): - * heap/SlotVisitor.h: - (SlotVisitor): - * runtime/JSArray.cpp: - * runtime/JSObject.cpp: - -2012-02-16 Yuqiang Xian - - Add JSC code profiling support on Linux x86 - https://bugs.webkit.org/show_bug.cgi?id=78871 - - Reviewed by Gavin Barraclough. - - We don't unwind the stack for now as we cannot guarantee all the - libraries are compiled without -fomit-frame-pointer. - - * tools/CodeProfile.cpp: - (JSC::CodeProfile::sample): - * tools/CodeProfiling.cpp: - (JSC): - (JSC::profilingTimer): - (JSC::CodeProfiling::begin): - (JSC::CodeProfiling::end): - -2012-02-16 Csaba Osztrogonác - - Unreviewed. Rolling out r107980, because it broke 32 bit platforms. - - * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def: - * interpreter/Interpreter.cpp: - (JSC::Interpreter::throwException): - (JSC::Interpreter::privateExecute): - * interpreter/Interpreter.h: - (JSC): - (Interpreter): - * jsc.cpp: - (GlobalObject::finishCreation): - * parser/Nodes.h: - (JSC::FunctionBodyNode::setInferredName): - * parser/Parser.h: - (JSC::::parse): - * runtime/CommonIdentifiers.h: - * runtime/Error.cpp: - (JSC::addErrorInfo): - * runtime/Error.h: - (JSC): - -2012-02-16 Filip Pizlo - - ENABLE_INTERPRETER should be ENABLE_CLASSIC_INTERPRETER - https://bugs.webkit.org/show_bug.cgi?id=78791 - - Rubber stamped by Oliver Hunt. - - Just a renaming, nothing more. Also renamed COMPUTED_GOTO_INTERPRETER to - COMPUTED_GOTO_CLASSIC_INTERPRETER. - - * bytecode/CodeBlock.cpp: - (JSC::CodeBlock::dump): - (JSC::CodeBlock::stronglyVisitStrongReferences): - (JSC): - (JSC::CodeBlock::shrinkToFit): - * bytecode/CodeBlock.h: - (CodeBlock): - * bytecode/Instruction.h: - (JSC::Instruction::Instruction): - * bytecode/Opcode.h: - (JSC::padOpcodeName): - * bytecompiler/BytecodeGenerator.cpp: - (JSC::BytecodeGenerator::emitResolve): - (JSC::BytecodeGenerator::emitResolveWithBase): - (JSC::BytecodeGenerator::emitGetById): - (JSC::BytecodeGenerator::emitPutById): - (JSC::BytecodeGenerator::emitDirectPutById): - * interpreter/AbstractPC.cpp: - (JSC::AbstractPC::AbstractPC): - * interpreter/AbstractPC.h: - (AbstractPC): - * interpreter/CallFrame.h: - (ExecState): - * interpreter/Interpreter.cpp: - (JSC): - (JSC::Interpreter::initialize): - (JSC::Interpreter::isOpcode): - (JSC::Interpreter::unwindCallFrame): - (JSC::Interpreter::execute): - (JSC::Interpreter::privateExecute): - (JSC::Interpreter::retrieveLastCaller): - * interpreter/Interpreter.h: - (JSC::Interpreter::getOpcode): - (JSC::Interpreter::getOpcodeID): - (Interpreter): - * jit/ExecutableAllocatorFixedVMPool.cpp: - (JSC::FixedVMPoolExecutableAllocator::FixedVMPoolExecutableAllocator): - * runtime/Executable.cpp: - (JSC::EvalExecutable::compileInternal): - (JSC::ProgramExecutable::compileInternal): - (JSC::FunctionExecutable::compileForCallInternal): - (JSC::FunctionExecutable::compileForConstructInternal): - * runtime/Executable.h: - (NativeExecutable): - * runtime/JSGlobalData.cpp: - (JSC::JSGlobalData::JSGlobalData): - (JSC::JSGlobalData::getHostFunction): - * runtime/JSGlobalData.h: - (JSGlobalData): - * wtf/OSAllocatorPosix.cpp: - (WTF::OSAllocator::reserveAndCommit): - * wtf/Platform.h: - -2012-02-15 Geoffrey Garen - - Made Weak single-owner, adding PassWeak - https://bugs.webkit.org/show_bug.cgi?id=78740 - - Reviewed by Sam Weinig. - - This works basically the same way as OwnPtr and PassOwnPtr. - - This clarifies the semantics of finalizers: It's ambiguous and probably - a bug to copy a finalizer (i.e., it's a bug to run a C++ destructor - twice), so I've made Weak non-copyable. Anywhere we used to copy a - Weak, we now use PassWeak. - - This also makes Weak HashMaps more efficient. - - * API/JSClassRef.cpp: - (OpaqueJSClass::prototype): Use PassWeak instead of set(), since - set() is gone now. - - * JavaScriptCore.xcodeproj/project.pbxproj: Export! - - * heap/PassWeak.h: Added. - (JSC): - (PassWeak): - (JSC::PassWeak::PassWeak): - (JSC::PassWeak::~PassWeak): - (JSC::PassWeak::get): - (JSC::::leakHandle): - (JSC::adoptWeak): - (JSC::operator==): - (JSC::operator!=): This is the Weak version of PassOwnPtr. - - * heap/Weak.h: - (Weak): - (JSC::Weak::Weak): - (JSC::Weak::release): - (JSC::Weak::hashTableDeletedValue): - (JSC::=): - (JSC): Changed to be non-copyable, removing a lot of copying-related - APIs. Added hash traits so hash maps still work. - - * jit/JITStubs.cpp: - (JSC::JITThunks::hostFunctionStub): - * runtime/RegExpCache.cpp: - (JSC::RegExpCache::lookupOrCreate): Use PassWeak, as required by - our new hash map API. - -2012-02-16 Mark Hahnenberg - - Fix the broken viewport tests - https://bugs.webkit.org/show_bug.cgi?id=78774 - - Reviewed by Kenneth Rohde Christiansen. - - * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def: - * wtf/text/WTFString.cpp: - (WTF): - (WTF::toDoubleType): Template-ized to allow other functions to specify whether they - want to allow trailing junk or not when calling strtod. - (WTF::charactersToDouble): - (WTF::charactersToFloat): - (WTF::charactersToFloatIgnoringJunk): Created new version of charactersToFloat that allows - trailing junk. - * wtf/text/WTFString.h: - (WTF): - -2012-02-16 Oliver Hunt - - Implement Error.stack - https://bugs.webkit.org/show_bug.cgi?id=66994 - - Reviewed by Gavin Barraclough. - - Implement support for stack traces on exception objects. This is a rewrite - of the core portion of the last stack walking logic, but the mechanical work - of adding the information to an exception comes from the original work by - Juan Carlos Montemayor Elosua. - - * interpreter/Interpreter.cpp: - (JSC::getCallerInfo): - (JSC): - (JSC::getSourceURLFromCallFrame): - (JSC::getStackFrameCodeType): - (JSC::Interpreter::getStackTrace): - (JSC::Interpreter::throwException): - (JSC::Interpreter::privateExecute): - * interpreter/Interpreter.h: - (JSC): - (StackFrame): - (JSC::StackFrame::toString): - (Interpreter): - * jsc.cpp: - (GlobalObject::finishCreation): - (functionJSCStack): - * parser/Nodes.h: - (JSC::FunctionBodyNode::setInferredName): - * parser/Parser.h: - (JSC::::parse): - * runtime/CommonIdentifiers.h: - * runtime/Error.cpp: - (JSC::addErrorInfo): - * runtime/Error.h: - (JSC): - -2012-02-15 Gavin Barraclough - - Numerous trivial bugs in Object.defineProperty - https://bugs.webkit.org/show_bug.cgi?id=78777 - - Reviewed by Sam Weinig. - - There are a handful of really trivial bugs, related to Object.defineProperty: - * Redefining an accessor with different attributes changes the attributes, but not the get/set functions! - * Calling an undefined setter should only throw in strict mode. - * When redefining an accessor to a data decriptor, if writable is not specified we should default to false. - * Any attempt to redefine a non-configurable property of an array as configurable should be rejected. - * Object.defineProperties should call toObject on 'Properties' argument, rather than throwing if it is not an object. - * If preventExtensions has been called on an array, subsequent assignment beyond array bounds should fail. - * 'isFrozen' shouldn't be checking the ReadOnly bit for accessor descriptors (we presently always keep this bit as 'false'). - * Should be able to redefine an non-writable, non-configurable property, with the same value and attributes. - * Should be able to define an non-configurable accessor. - These are mostly all one-line changes, e.g. inverted boolean checks, masking against wrong attribute. - - * runtime/JSArray.cpp: - (JSC::SparseArrayValueMap::put): - - Added ASSERT. - - Calling an undefined setter should only throw in strict mode. - (JSC::JSArray::putDescriptor): - - Should be able to define an non-configurable accessor. - (JSC::JSArray::defineOwnNumericProperty): - - Any attempt to redefine a non-configurable property of an array as configurable should be rejected. - (JSC::JSArray::putByIndexBeyondVectorLength): - - If preventExtensions has been called on an array, subsequent assignment beyond array bounds should fail. - * runtime/JSArray.h: - (JSArray): - - made enterDictionaryMode public, called from JSObject. - * runtime/JSObject.cpp: - (JSC::JSObject::put): - - Calling an undefined setter should only throw in strict mode. - (JSC::JSObject::preventExtensions): - - Put array objects into dictionary mode to handle this! - (JSC::JSObject::defineOwnProperty): - - Should be able to redefine an non-writable, non-configurable property, with the same value and attributes. - - Redefining an accessor with different attributes changes the attributes, but not the get/set functions! - * runtime/ObjectConstructor.cpp: - (JSC::objectConstructorDefineProperties): - - Object.defineProperties should call toObject on 'Properties' argument, rather than throwing if it is not an object. - * runtime/PropertyDescriptor.cpp: - (JSC::PropertyDescriptor::attributesWithOverride): - - When redefining an accessor to a data decriptor, if writable is not specified we should default to false. - (JSC::PropertyDescriptor::attributesOverridingCurrent): - - When redefining an accessor to a data decriptor, if writable is not specified we should default to false. - * runtime/Structure.cpp: - (JSC::Structure::freezeTransition): - - 'freezeTransition' shouldn't be setting the ReadOnly bit for accessor descriptors (we presently always keep this bit as 'false'). - (JSC::Structure::isFrozen): - - 'isFrozen' shouldn't be checking the ReadOnly bit for accessor descriptors (we presently always keep this bit as 'false'). - -2012-02-13 Filip Pizlo - - DFG should not check the types of arguments that are dead - https://bugs.webkit.org/show_bug.cgi?id=78518 - - Reviewed by Geoff Garen. - - The argument checks are now elided if the corresponding SetArgument is dead, - and the abstract value of the argument is set to bottom (None, []). This is - performance neutral on the benchmarks we currently track. - - * dfg/DFGAbstractState.cpp: - (JSC::DFG::AbstractState::initialize): - * dfg/DFGSpeculativeJIT.cpp: - (JSC::DFG::SpeculativeJIT::checkArgumentTypes): - -2012-02-15 Oliver Hunt - - Ensure that the DFG JIT always plants a CodeOrigin when making calls - https://bugs.webkit.org/show_bug.cgi?id=78763 - - Reviewed by Gavin Barraclough. - - Make all calls plant a CodeOrigin prior to the actual - call. Also clobbers the Interpreter with logic to ensure - that the interpreter always plants a bytecode offset. - - * dfg/DFGJITCompiler.cpp: - (JSC::DFG::JITCompiler::link): - (JSC::DFG::JITCompiler::compileFunction): - * dfg/DFGJITCompiler.h: - (CallBeginToken): - (JSC::DFG::JITCompiler::beginJSCall): - (JSC::DFG::JITCompiler::beginCall): - * dfg/DFGRepatch.cpp: - (JSC::DFG::tryBuildGetByIDList): - * dfg/DFGSpeculativeJIT.h: - (JSC::DFG::SpeculativeJIT::appendCallWithExceptionCheck): - * dfg/DFGSpeculativeJIT32_64.cpp: - (JSC::DFG::SpeculativeJIT::emitCall): - * dfg/DFGSpeculativeJIT64.cpp: - (JSC::DFG::SpeculativeJIT::emitCall): - * interpreter/AbstractPC.cpp: - (JSC::AbstractPC::AbstractPC): - * interpreter/CallFrame.cpp: - (JSC::CallFrame::trueCallFrame): - * interpreter/CallFrame.h: - (JSC::ExecState::bytecodeOffsetForNonDFGCode): - (ExecState): - (JSC::ExecState::setBytecodeOffsetForNonDFGCode): - (JSC::ExecState::codeOriginIndexForDFG): - -2012-02-14 Oliver Hunt - - Fix Interpreter. - - * runtime/Executable.cpp: - (JSC): - * runtime/Executable.h: - (ExecutableBase): - -2012-02-14 Matt Lilek - - Don't ENABLE_DASHBOARD_SUPPORT unconditionally on all Mac platforms - https://bugs.webkit.org/show_bug.cgi?id=78629 - - Reviewed by David Kilzer. - - * Configurations/FeatureDefines.xcconfig: - -2012-02-14 Filip Pizlo - - Unreviewed, build fix for non-DFG platforms. - - * assembler/MacroAssembler.h: - (MacroAssembler): - -2012-02-14 Filip Pizlo - - Unreviewed, fix build and configuration goof. - - * assembler/MacroAssembler.h: - (JSC::MacroAssembler::invert): - * dfg/DFGCommon.h: - -2012-02-13 Filip Pizlo - - DFG should be able to emit code on control flow edges - https://bugs.webkit.org/show_bug.cgi?id=78515 - - Reviewed by Gavin Barraclough. - - This gets us a few steps closer to being able to perform global register allocation, - by allowing us to have landing pads on control flow edges. This will let us reshuffle - registers if it happens to be necessary due to different reg alloc decisions in - differen blocks. - - This also introduces the notion of a landing pad for OSR entry, which will allow us - to emit code that places data into registers when we're entering into the DFG from - the old JIT. - - Finally, this patch introduces a verification mode that checks that the landing pads - are actually emitted and do actually work as advertised. When verification is disabled, - this has no effect on behavior. - - * assembler/MacroAssembler.h: - (MacroAssembler): - (JSC::MacroAssembler::invert): - (JSC::MacroAssembler::isInvertible): - * dfg/DFGCommon.h: - * dfg/DFGJITCompiler.cpp: - (JSC::DFG::JITCompiler::compile): - (JSC::DFG::JITCompiler::compileFunction): - * dfg/DFGSpeculativeJIT.cpp: - (JSC::DFG::SpeculativeJIT::compilePeepHoleDoubleBranch): - (JSC::DFG::SpeculativeJIT::compilePeepHoleObjectEquality): - (JSC::DFG::SpeculativeJIT::compilePeepHoleIntegerBranch): - (JSC::DFG::SpeculativeJIT::compile): - (JSC::DFG::SpeculativeJIT::createOSREntries): - (DFG): - (JSC::DFG::SpeculativeJIT::linkOSREntries): - (JSC::DFG::SpeculativeJIT::compileStrictEqForConstant): - * dfg/DFGSpeculativeJIT.h: - (SpeculativeJIT): - (JSC::DFG::SpeculativeJIT::branchDouble): - (JSC::DFG::SpeculativeJIT::branchDoubleNonZero): - (JSC::DFG::SpeculativeJIT::branch32): - (JSC::DFG::SpeculativeJIT::branchTest32): - (JSC::DFG::SpeculativeJIT::branchPtr): - (JSC::DFG::SpeculativeJIT::branchTestPtr): - (JSC::DFG::SpeculativeJIT::branchTest8): - (JSC::DFG::SpeculativeJIT::jump): - (JSC::DFG::SpeculativeJIT::haveEdgeCodeToEmit): - (JSC::DFG::SpeculativeJIT::emitEdgeCode): - * dfg/DFGSpeculativeJIT32_64.cpp: - (JSC::DFG::SpeculativeJIT::nonSpeculativePeepholeBranchNull): - (JSC::DFG::SpeculativeJIT::nonSpeculativePeepholeBranch): - (JSC::DFG::SpeculativeJIT::nonSpeculativePeepholeStrictEq): - (JSC::DFG::SpeculativeJIT::emitObjectOrOtherBranch): - (JSC::DFG::SpeculativeJIT::emitBranch): - (JSC::DFG::SpeculativeJIT::compile): - * dfg/DFGSpeculativeJIT64.cpp: - (JSC::DFG::SpeculativeJIT::nonSpeculativePeepholeBranchNull): - (JSC::DFG::SpeculativeJIT::nonSpeculativePeepholeBranch): - (JSC::DFG::SpeculativeJIT::nonSpeculativePeepholeStrictEq): - (JSC::DFG::SpeculativeJIT::emitObjectOrOtherBranch): - (JSC::DFG::SpeculativeJIT::emitBranch): - (JSC::DFG::SpeculativeJIT::compile): - -2012-02-14 Filip Pizlo - - Assertion failure under JSC::DFG::AbstractState::execute loading economist.com - https://bugs.webkit.org/show_bug.cgi?id=78153 - - - Reviewed by Oliver Hunt. - - * dfg/DFGAbstractState.cpp: - (JSC::DFG::AbstractState::execute): - * dfg/DFGSpeculativeJIT.cpp: - (JSC::DFG::SpeculativeJIT::compileAdd): - -2012-02-14 Eric Seidel - - Upstream Android's additions to Platform.h - https://bugs.webkit.org/show_bug.cgi?id=78536 - - Reviewed by Adam Barth. - - * wtf/Platform.h: - -2012-02-12 Mark Hahnenberg - - Replace old strtod with new strtod - https://bugs.webkit.org/show_bug.cgi?id=68044 - - Reviewed by Geoffrey Garen. - - * parser/Lexer.cpp: Added template argument. This version allows junk after numbers. - (JSC::::lex): - * runtime/JSGlobalObjectFunctions.cpp: Ditto. - (JSC::parseInt): - (JSC::jsStrDecimalLiteral): - * runtime/LiteralParser.cpp: Ditto. - (JSC::::Lexer::lexNumber): - * wtf/dtoa.cpp: Replaced old strtod with a new version that uses the new StringToDoubleConverter. - It takes a template argument to allow clients to determine statically whether it should allow - junk after the numbers or not. - (WTF): - (WTF::strtod): - * wtf/dtoa.h: - (WTF): - * wtf/text/WTFString.cpp: Added template argument. This version does not allow junk after numbers. - (WTF::toDoubleType): - -2012-02-13 Mark Hahnenberg - - More windows build fixing - - * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def: - -2012-02-13 Oliver Hunt - - Executing out of bounds in JSC::Yarr::YarrCodeBlock::execute / JSC::RegExp::match - https://bugs.webkit.org/show_bug.cgi?id=76315 - - Reviewed by Gavin Barraclough. - - Perform a 3 byte compare using two comparisons, rather than trying to perform the - operation with a four byte load. - - * yarr/YarrJIT.cpp: - (JSC::Yarr::YarrGenerator::generatePatternCharacterOnce): - -2012-02-13 Mark Hahnenberg - - Windows build fix - - * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def: - -2012-02-12 Mark Hahnenberg - - Replace old strtod with new strtod - https://bugs.webkit.org/show_bug.cgi?id=68044 - - Reviewed by Geoffrey Garen. - - * parser/Lexer.cpp: Added template argument. This version allows junk after numbers. - (JSC::::lex): - * runtime/JSGlobalObjectFunctions.cpp: Ditto. - (JSC::parseInt): - (JSC::jsStrDecimalLiteral): - * runtime/LiteralParser.cpp: Ditto. - (JSC::::Lexer::lexNumber): - * wtf/dtoa.cpp: Replaced old strtod with a new version that uses the new StringToDoubleConverter. - It takes a template argument to allow clients to determine statically whether it should allow - junk after the numbers or not. - (WTF): - (WTF::strtod): - * wtf/dtoa.h: - (WTF): - * wtf/text/WTFString.cpp: Added template argument. This version does not allow junk after numbers. - (WTF::toDoubleType): - -2012-02-13 Sam Weinig - - Move JSC related assertions out of Assertions.h and into their own header - https://bugs.webkit.org/show_bug.cgi?id=78508 - - Reviewed by Gavin Barraclough. - - * GNUmakefile.list.am: - * JavaScriptCore.gypi: - * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj: - * JavaScriptCore.xcodeproj/project.pbxproj: - Add GCAssertions.h - - * heap/GCAssertions.h: Added. - Move assertions here. - - * runtime/WriteBarrier.h: - Add #include of GCAssertions.h - - * wtf/Assertions.h: - Remove JSC related assertions. - - * wtf/Compiler.h: - Add compiler check for __has_trivial_destructor. - -2012-02-13 Chao-ying Fu - - Update MIPS patchOffsetGetByIdSlowCaseCall - https://bugs.webkit.org/show_bug.cgi?id=78392 - - Reviewed by Gavin Barraclough. - - * jit/JIT.h: - (JIT): - -2012-02-13 Patrick Gansterer - - Remove obsolete #if from ThreadSpecific.h - https://bugs.webkit.org/show_bug.cgi?id=78485 - - Reviewed by Adam Roben. - - Since alle platform use either pthread or Win32 for threading, - we can remove all PLATFORM() preprocessor statements. - - * wtf/ThreadSpecific.h: - (ThreadSpecific): - -2012-02-13 Jessie Berlin - - Fix the Windows build. - - * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def: - -2012-02-13 Sam Weinig - - Use C11's _Static_assert for COMPILE_ASSERT if it is available - https://bugs.webkit.org/show_bug.cgi?id=78506 - - Rubber-stamped by Antti Koivisto. - - Use C11's _Static_assert for COMPILE_ASSERT if it is available to give slightly - better error messages. - - * wtf/Assertions.h: - Use _Static_assert if it is available. - - * wtf/Compiler.h: - Add COMPILER_SUPPORTS support for _Static_assert when using the LLVM Compiler. - -2012-02-13 Mario Sanchez Prada - - [GTK] Add GSList to the list of GObject types in GOwnPtr - https://bugs.webkit.org/show_bug.cgi?id=78487 - - Reviewed by Philippe Normand. - - Handle the GSList type in GOwnPtr, by calling g_slist_free in the - implementation of the freeOwnedGPtr template function. - - * wtf/gobject/GOwnPtr.cpp: - (WTF::GSList): - (WTF): - * wtf/gobject/GOwnPtr.h: - (WTF): - * wtf/gobject/GTypedefs.h: - -2012-02-06 Raphael Kubo da Costa - - [EFL] Drop support for the Curl network backend. - https://bugs.webkit.org/show_bug.cgi?id=77874 - - Reviewed by Eric Seidel. - - Nobody seems to be maintaining the Curl backend in WebCore, the - EFL port developers all seem to be using the Soup backend and the - port itself has many features which are only implemented for the - latter. - - * wtf/PlatformEfl.cmake: Always build the gobject-dependent source - files. - -2012-02-13 Patrick Gansterer - - Unreviewed. Build fix for !ENABLE(JIT) after r107485. - - * bytecode/PolymorphicPutByIdList.cpp: - -2012-02-13 Gavin Barraclough - - https://bugs.webkit.org/show_bug.cgi?id=78434 - Unreviewed - temporarily reverting r107498 will I fix a couple of testcases. - - * parser/Parser.cpp: - (JSC::::parseFunctionInfo): - * runtime/ClassInfo.h: - (MethodTable): - (JSC): - * runtime/JSCell.cpp: - (JSC): - * runtime/JSCell.h: - (JSCell): - * runtime/JSGlobalObject.cpp: - (JSC::JSGlobalObject::reset): - * runtime/JSGlobalObjectFunctions.cpp: - (JSC): - * runtime/JSGlobalObjectFunctions.h: - (JSC): - * runtime/JSObject.cpp: - (JSC::JSObject::put): - (JSC): - (JSC::JSObject::putDirectAccessor): - (JSC::JSObject::defineOwnProperty): - * runtime/JSObject.h: - (JSC::JSObject::inlineGetOwnPropertySlot): - (JSC::JSValue::get): - * runtime/JSString.cpp: - (JSC::JSString::getOwnPropertySlot): - * runtime/JSValue.h: - (JSValue): - * runtime/ObjectConstructor.cpp: - (JSC::objectConstructorGetPrototypeOf): - * runtime/Structure.cpp: - (JSC::Structure::Structure): - * runtime/Structure.h: - (JSC::Structure::setHasGetterSetterProperties): - (Structure): - -2012-02-12 Ashod Nakashian - - KeywordLookupGenerator.py script fails in some cases - https://bugs.webkit.org/show_bug.cgi?id=77886 - - Reviewed by Benjamin Poulain. - - * parser/Keywords.table: Converted to LF-only. - -2012-02-12 Shinya Kawanaka - - Introduce ShadowRootList. - https://bugs.webkit.org/show_bug.cgi?id=78069 - - Reviewed by Hajime Morita. - - DoublyLinkedList should have tail() method to take the last element. - - * wtf/DoublyLinkedList.h: - (DoublyLinkedList): - (WTF::::tail): - (WTF): - -2012-02-12 Raphael Kubo da Costa - - [CMake] Move source files in WTF_HEADERS to WTF_SOURCES. - https://bugs.webkit.org/show_bug.cgi?id=78436 - - Reviewed by Daniel Bates. - - * wtf/CMakeLists.txt: Move .cpp files from WTF_HEADERS to WTF_SOURCES, - and correctly sort the files which start with 'M'. - -2012-02-12 Sam Weinig - - Move the NumberOfCores.h/cpp files into the WTF group of JavaScriptCore.xcodeproj. - - Rubber-stamped by Anders Carlsson. - - * JavaScriptCore.xcodeproj/project.pbxproj: - -2012-02-12 Raphael Kubo da Costa - - [CMake] Remove unused or empty variable definitions. - https://bugs.webkit.org/show_bug.cgi?id=78437 - - Reviewed by Daniel Bates. - - * CMakeLists.txt: Remove unused JavaScriptCore_HEADERS definition. - * shell/CMakeLists.txt: Remove unused JSC_HEADERS definition. - * wtf/CMakeLists.txt: Remove empty WTF_LIBRARIES definition, it will - be defined later by Platform*.cmake via LIST(APPEND WTF_LIBRARIES). - -2012-02-12 Filip Pizlo - - DFG::SpeculativeJIT calls fprintf() instead of dataLog in terminateSpeculativeExecution() - https://bugs.webkit.org/show_bug.cgi?id=78431 - - Reviewed by Gavin Barraclough. - - * dfg/DFGSpeculativeJIT.h: - (JSC::DFG::SpeculativeJIT::terminateSpeculativeExecution): - -2012-02-11 Benjamin Poulain - - Add back WTFURL to WebKit - https://bugs.webkit.org/show_bug.cgi?id=77291 - - Reviewed by Adam Barth. - - WTFURL was removed from WebKit in r86787. - - This patch adds the code back to WTF with the following changes: - -Guard the feature with USE(WTFURL). - -Change the typename CHAR to CharacterType to follow recent WebKit conventions. - -Fix some coding style to make check-webkit-style happy. - - * JavaScriptCore.xcodeproj/project.pbxproj: - * wtf/Platform.h: - * wtf/url/api/ParsedURL.cpp: Added. - (WTF): - (WTF::ParsedURL::ParsedURL): - (WTF::ParsedURL::scheme): - (WTF::ParsedURL::username): - (WTF::ParsedURL::password): - (WTF::ParsedURL::host): - (WTF::ParsedURL::port): - (WTF::ParsedURL::path): - (WTF::ParsedURL::query): - (WTF::ParsedURL::fragment): - (WTF::ParsedURL::segment): - * wtf/url/api/ParsedURL.h: Added. - (WTF): - (ParsedURL): - (WTF::ParsedURL::spec): - * wtf/url/api/URLString.h: Added. - (WTF): - (URLString): - (WTF::URLString::URLString): - (WTF::URLString::string): - * wtf/url/src/RawURLBuffer.h: Added. - (WTF): - (RawURLBuffer): - (WTF::RawURLBuffer::RawURLBuffer): - (WTF::RawURLBuffer::~RawURLBuffer): - (WTF::RawURLBuffer::resize): - * wtf/url/src/URLBuffer.h: Added. - (WTF): - (URLBuffer): - (WTF::URLBuffer::URLBuffer): - (WTF::URLBuffer::~URLBuffer): - (WTF::URLBuffer::at): - (WTF::URLBuffer::set): - (WTF::URLBuffer::capacity): - (WTF::URLBuffer::length): - (WTF::URLBuffer::data): - (WTF::URLBuffer::setLength): - (WTF::URLBuffer::append): - (WTF::URLBuffer::grow): - * wtf/url/src/URLCharacterTypes.cpp: Added. - (WTF): - (): - * wtf/url/src/URLCharacterTypes.h: Added. - (WTF): - (URLCharacterTypes): - (WTF::URLCharacterTypes::isQueryChar): - (WTF::URLCharacterTypes::isIPv4Char): - (WTF::URLCharacterTypes::isHexChar): - (): - (WTF::URLCharacterTypes::isCharOfType): - * wtf/url/src/URLComponent.h: Added. - (WTF): - (URLComponent): - (WTF::URLComponent::URLComponent): - (WTF::URLComponent::fromRange): - (WTF::URLComponent::isValid): - (WTF::URLComponent::isNonEmpty): - (WTF::URLComponent::isEmptyOrInvalid): - (WTF::URLComponent::reset): - (WTF::URLComponent::operator==): - (WTF::URLComponent::begin): - (WTF::URLComponent::setBegin): - (WTF::URLComponent::length): - (WTF::URLComponent::setLength): - (WTF::URLComponent::end): - * wtf/url/src/URLEscape.cpp: Added. - (WTF): - (): - * wtf/url/src/URLEscape.h: Added. - (WTF): - (WTF::appendURLEscapedCharacter): - * wtf/url/src/URLParser.h: Added. - (WTF): - (URLParser): - (): - (WTF::URLParser::isPossibleAuthorityTerminator): - (WTF::URLParser::parseAuthority): - (WTF::URLParser::extractScheme): - (WTF::URLParser::parseAfterScheme): - (WTF::URLParser::parseStandardURL): - (WTF::URLParser::parsePath): - (WTF::URLParser::parsePathURL): - (WTF::URLParser::parseMailtoURL): - (WTF::URLParser::parsePort): - (WTF::URLParser::extractFileName): - (WTF::URLParser::extractQueryKeyValue): - (WTF::URLParser::isURLSlash): - (WTF::URLParser::shouldTrimFromURL): - (WTF::URLParser::trimURL): - (WTF::URLParser::consecutiveSlashes): - (WTF::URLParser::isPortDigit): - (WTF::URLParser::nextAuthorityTerminator): - (WTF::URLParser::parseUserInfo): - (WTF::URLParser::parseServerInfo): - * wtf/url/src/URLQueryCanonicalizer.h: Added. - (WTF): - (URLQueryCanonicalizer): - (WTF::URLQueryCanonicalizer::canonicalize): - (WTF::URLQueryCanonicalizer::isAllASCII): - (WTF::URLQueryCanonicalizer::isRaw8Bit): - (WTF::URLQueryCanonicalizer::appendRaw8BitQueryString): - (WTF::URLQueryCanonicalizer::convertToQueryEncoding): - * wtf/url/src/URLSegments.cpp: Added. - (WTF): - (WTF::URLSegments::length): - (WTF::URLSegments::charactersBefore): - * wtf/url/src/URLSegments.h: Added. - (WTF): - (URLSegments): - (): - (WTF::URLSegments::URLSegments): - -2012-02-11 Filip Pizlo - - Old JIT put_by_id profiling counts every put_by_id_transition as taking slow path - https://bugs.webkit.org/show_bug.cgi?id=78430 - - - Reviewed by Gavin Barraclough. - - The old JIT's put_by_id transition caching involves repatching the slow call to - a generated stub. That means that the call is counted as "slow case". So, this - patch inserts code to decrement the slow case count if the stub succeeds. - - Looks like a ~1% speed-up on V8. - - * jit/JITPropertyAccess.cpp: - (JSC::JIT::privateCompilePutByIdTransition): - * jit/JITPropertyAccess32_64.cpp: - (JSC::JIT::privateCompilePutByIdTransition): - -2012-02-11 Filip Pizlo - - Build fix for Qt. - - * wtf/DataLog.h: - -2012-02-11 Filip Pizlo - - It should be possible to send all JSC debug logging to a file - https://bugs.webkit.org/show_bug.cgi?id=78418 - - Reviewed by Sam Weinig. - - Introduced wtf/DataLog, which defines WTF::dataFile, WTF::dataLog, - and WTF::dataLogV. Changed all debugging- and profiling-related printfs - to use WTF::dataLog() or one of its friends. By default, debug logging - goes to stderr, unless you change the setting in wtf/DataLog.cpp. - - * GNUmakefile.list.am: - * JavaScriptCore.gypi: - * JavaScriptCore.vcproj/WTF/WTF.vcproj: - * JavaScriptCore.xcodeproj/project.pbxproj: - * assembler/LinkBuffer.h: - (JSC::LinkBuffer::dumpLinkStatistics): - (JSC::LinkBuffer::dumpCode): - * assembler/SH4Assembler.h: - (JSC::SH4Assembler::vprintfStdoutInstr): - * bytecode/CodeBlock.cpp: - (JSC::CodeBlock::printUnaryOp): - (JSC::CodeBlock::printBinaryOp): - (JSC::CodeBlock::printConditionalJump): - (JSC::CodeBlock::printGetByIdOp): - (JSC::CodeBlock::printCallOp): - (JSC::CodeBlock::printPutByIdOp): - (JSC::printGlobalResolveInfo): - (JSC::printStructureStubInfo): - (JSC::CodeBlock::printStructure): - (JSC::CodeBlock::printStructures): - (JSC::CodeBlock::dump): - (JSC::CodeBlock::dumpStatistics): - (JSC::CodeBlock::finalizeUnconditionally): - (JSC::CodeBlock::shouldOptimizeNow): - (JSC::CodeBlock::tallyFrequentExitSites): - (JSC::CodeBlock::dumpValueProfiles): - * bytecode/Opcode.cpp: - (JSC::OpcodeStats::~OpcodeStats): - * bytecode/SamplingTool.cpp: - (JSC::SamplingFlags::stop): - (JSC::SamplingRegion::dumpInternal): - (JSC::SamplingTool::dump): - * dfg/DFGAbstractState.cpp: - (JSC::DFG::AbstractState::endBasicBlock): - (JSC::DFG::AbstractState::mergeStateAtTail): - * dfg/DFGByteCodeParser.cpp: - (JSC::DFG::ByteCodeParser::getPredictionWithoutOSRExit): - (JSC::DFG::ByteCodeParser::makeSafe): - (JSC::DFG::ByteCodeParser::makeDivSafe): - (JSC::DFG::ByteCodeParser::handleCall): - (JSC::DFG::ByteCodeParser::handleInlining): - (JSC::DFG::ByteCodeParser::parseBlock): - (JSC::DFG::ByteCodeParser::processPhiStack): - (JSC::DFG::ByteCodeParser::linkBlock): - (JSC::DFG::ByteCodeParser::parseCodeBlock): - (JSC::DFG::ByteCodeParser::parse): - * dfg/DFGCommon.h: - * dfg/DFGDriver.cpp: - (JSC::DFG::compile): - * dfg/DFGGraph.cpp: - (JSC::DFG::printWhiteSpace): - (JSC::DFG::Graph::dumpCodeOrigin): - (JSC::DFG::Graph::dump): - (JSC::DFG::Graph::predictArgumentTypes): - * dfg/DFGJITCompiler.cpp: - (JSC::DFG::JITCompiler::link): - * dfg/DFGOSREntry.cpp: - (JSC::DFG::prepareOSREntry): - * dfg/DFGOSRExitCompiler.cpp: - * dfg/DFGOSRExitCompiler32_64.cpp: - (JSC::DFG::OSRExitCompiler::compileExit): - * dfg/DFGOSRExitCompiler64.cpp: - (JSC::DFG::OSRExitCompiler::compileExit): - * dfg/DFGOperations.cpp: - * dfg/DFGPropagator.cpp: - (JSC::DFG::Propagator::fixpoint): - (JSC::DFG::Propagator::propagateArithNodeFlags): - (JSC::DFG::Propagator::propagateArithNodeFlagsForward): - (JSC::DFG::Propagator::propagateArithNodeFlagsBackward): - (JSC::DFG::Propagator::propagateNodePredictions): - (JSC::DFG::Propagator::propagatePredictionsForward): - (JSC::DFG::Propagator::propagatePredictionsBackward): - (JSC::DFG::Propagator::doRoundOfDoubleVoting): - (JSC::DFG::Propagator::fixupNode): - (JSC::DFG::Propagator::fixup): - (JSC::DFG::Propagator::startIndexForChildren): - (JSC::DFG::Propagator::endIndexForPureCSE): - (JSC::DFG::Propagator::setReplacement): - (JSC::DFG::Propagator::eliminate): - (JSC::DFG::Propagator::performNodeCSE): - (JSC::DFG::Propagator::localCSE): - (JSC::DFG::Propagator::allocateVirtualRegisters): - (JSC::DFG::Propagator::performBlockCFA): - (JSC::DFG::Propagator::performForwardCFA): - * dfg/DFGRegisterBank.h: - (JSC::DFG::RegisterBank::dump): - * dfg/DFGScoreBoard.h: - (JSC::DFG::ScoreBoard::dump): - * dfg/DFGSpeculativeJIT.cpp: - (JSC::DFG::SpeculativeJIT::dump): - (JSC::DFG::SpeculativeJIT::checkConsistency): - (JSC::DFG::SpeculativeJIT::compile): - * dfg/DFGSpeculativeJIT32_64.cpp: - (JSC::DFG::SpeculativeJIT::fillSpeculateIntInternal): - (JSC::DFG::SpeculativeJIT::fillSpeculateDouble): - (JSC::DFG::SpeculativeJIT::fillSpeculateCell): - (JSC::DFG::SpeculativeJIT::fillSpeculateBoolean): - * dfg/DFGSpeculativeJIT64.cpp: - (JSC::DFG::SpeculativeJIT::fillSpeculateIntInternal): - (JSC::DFG::SpeculativeJIT::fillSpeculateDouble): - (JSC::DFG::SpeculativeJIT::fillSpeculateCell): - (JSC::DFG::SpeculativeJIT::fillSpeculateBoolean): - * heap/Heap.cpp: - (JSC::Heap::destroy): - * heap/MarkedBlock.h: - * interpreter/CallFrame.cpp: - (JSC::CallFrame::dumpCaller): - * interpreter/Interpreter.cpp: - (JSC::Interpreter::dumpRegisters): - * jit/JIT.cpp: - (JSC::JIT::privateCompileMainPass): - (JSC::JIT::privateCompileSlowCases): - (JSC::JIT::privateCompile): - * jit/JITStubs.cpp: - (JSC::DEFINE_STUB_FUNCTION): - * profiler/Profile.cpp: - (JSC::Profile::debugPrintData): - (JSC::Profile::debugPrintDataSampleStyle): - * profiler/ProfileNode.cpp: - (JSC::ProfileNode::debugPrintData): - (JSC::ProfileNode::debugPrintDataSampleStyle): - * runtime/JSGlobalData.cpp: - (JSC::JSGlobalData::dumpRegExpTrace): - * runtime/RegExp.cpp: - (JSC::RegExp::matchCompareWithInterpreter): - * runtime/SamplingCounter.cpp: - (JSC::AbstractSamplingCounter::dump): - * runtime/SamplingCounter.h: - (JSC::DeletableSamplingCounter::~DeletableSamplingCounter): - * runtime/ScopeChain.cpp: - (JSC::ScopeChainNode::print): - * runtime/Structure.cpp: - (JSC::Structure::dumpStatistics): - (JSC::PropertyMapStatisticsExitLogger::~PropertyMapStatisticsExitLogger): - * tools/CodeProfile.cpp: - (JSC::CodeProfile::report): - * tools/ProfileTreeNode.h: - (JSC::ProfileTreeNode::dumpInternal): - * wtf/CMakeLists.txt: - * wtf/DataLog.cpp: Added. - (WTF): - (WTF::initializeLogFileOnce): - (WTF::initializeLogFile): - (WTF::dataFile): - (WTF::dataLogV): - (WTF::dataLog): - * wtf/DataLog.h: Added. - (WTF): - * wtf/HashTable.cpp: - (WTF::HashTableStats::~HashTableStats): - * wtf/MetaAllocator.cpp: - (WTF::MetaAllocator::dumpProfile): - * wtf/text/WTFString.cpp: - (String::show): - * yarr/YarrInterpreter.cpp: - (JSC::Yarr::ByteCompiler::dumpDisjunction): - -2012-02-11 Gavin Barraclough - - Move special __proto__ property to Object.prototype - https://bugs.webkit.org/show_bug.cgi?id=78409 - - Reviewed by Oliver Hunt. - - Re-implement this as a regular accessor property. This has three key benefits: - 1) It makes it possible for objects to be given properties named __proto__. - 2) Object.prototype.__proto__ can be deleted, preventing object prototypes from being changed. - 3) This largely removes the magic used the implement __proto__, it can just be made a regular accessor property. - - * parser/Parser.cpp: - (JSC::::parseFunctionInfo): - - No need to prohibit functions named __proto__. - * runtime/JSGlobalObject.cpp: - (JSC::JSGlobalObject::reset): - - Add __proto__ accessor to Object.prototype. - * runtime/JSGlobalObjectFunctions.cpp: - (JSC::globalFuncProtoGetter): - (JSC::globalFuncProtoSetter): - - Definition of the __proto__ accessor functions. - * runtime/JSGlobalObjectFunctions.h: - - Declaration of the __proto__ accessor functions. - * runtime/JSObject.cpp: - (JSC::JSObject::put): - - Remove the special handling for __proto__, there is still a check to allow for a fast guard for accessors excluding __proto__. - (JSC::JSObject::putDirectAccessor): - - Track on the structure whether an object contains accessors other than one for __proto__. - (JSC::JSObject::defineOwnProperty): - - No need to prohibit definition of own properties named __proto__. - * runtime/JSObject.h: - (JSC::JSObject::inlineGetOwnPropertySlot): - - Remove the special handling for __proto__. - (JSC::JSValue::get): - - Remove the special handling for __proto__. - * runtime/JSString.cpp: - (JSC::JSString::getOwnPropertySlot): - - Remove the special handling for __proto__. - * runtime/JSValue.h: - (JSValue): - - Made synthesizePrototype public (this may be needed by the __proto__ getter). - * runtime/ObjectConstructor.cpp: - (JSC::objectConstructorGetPrototypeOf): - - Perform the security check & call prototype() directly. - * runtime/Structure.cpp: - (JSC::Structure::Structure): - - Added 'ExcludingProto' variant of the 'hasGetterSetterProperties' state. - * runtime/Structure.h: - (JSC::Structure::hasGetterSetterPropertiesExcludingProto): - (JSC::Structure::setHasGetterSetterProperties): - (Structure): - - Added 'ExcludingProto' variant of the 'hasGetterSetterProperties' state. - -2012-02-11 Filip Pizlo - - DFG CFA assumes that a WeakJSConstant's structure is known - https://bugs.webkit.org/show_bug.cgi?id=78428 - - - Reviewed by Gavin Barraclough. - - * dfg/DFGAbstractState.cpp: - (JSC::DFG::AbstractState::execute): - -2012-02-11 Mark Hahnenberg - - Qt debug build fix - - * heap/MarkedBlock.cpp: - (JSC::MarkedBlock::callDestructor): Platforms that don't use clang will allocate - JSFinalObjects in the destuctor subspace, so we should remove this assert so it - doesn't cause crashes. - -2012-02-11 Filip Pizlo - - Old 32_64 JIT should assert that its use of map() is consistent with the DFG - OSR exit's expectations - https://bugs.webkit.org/show_bug.cgi?id=78419 - - - Reviewed by Oliver Hunt. - - * jit/JITInlineMethods.h: - (JSC::JIT::map): - -2012-02-11 Mark Hahnenberg - - Reduce the reentrancy limit of the interpreter for the iOS simulator - https://bugs.webkit.org/show_bug.cgi?id=78400 - - Reviewed by Gavin Barraclough. - - * interpreter/Interpreter.h: Lowered the maximum reentrancy limit for large thread stacks. - (JSC): - -2012-02-11 Filip Pizlo - - [DFG] Misuse of WeakJSConstants in silentFillGPR code. - https://bugs.webkit.org/show_bug.cgi?id=78423 - - - Reviewed by Sam Weinig. - - The code was using Node::isConstant(), when it was supposed to use Node::hasConstant(). - This patch is a surgical fix; the bigger problem is: why do we have isConstant() and - hasConstant() when hasConstant() is correct and isConstant() is almost always wrong? - - * dfg/DFGSpeculativeJIT.h: - (JSC::DFG::SpeculativeJIT::silentFillGPR): - -2012-02-11 Sam Weinig - - Prepare JavaScriptCore to build with libc++ - - https://bugs.webkit.org/show_bug.cgi?id=78424 - - Reviewed by Anders Carlsson. - - * wtf/NullPtr.cpp: - * wtf/NullPtr.h: - libc++ provides std::nullptr emulation, so we don't have to. - -2012-02-07 Filip Pizlo - - DFG should have polymorphic put_by_id caching - https://bugs.webkit.org/show_bug.cgi?id=78062 - - - Reviewed by Oliver Hunt. - - Implemented polymorphic put_by_id caching in the DFG, and added much of the - machinery that would be needed to implement it in the old JIT as well. - - I decided against using the old PolymorphicAccessStructureList mechanism as - this didn't quite fit with put_by_id. In particular, I wanted the ability to - have one list that captured all relevant cases (including proto put_by_id - if we ever decided to do it). And I wanted the code to have better - encapsulation. And I didn't want to get confused by the fact that the - original (non-list) put_by_id cache may itself consist of a stub routine. - - This code is still sub-optimal (for example adding a replace to a list whose - previous elements are all transitions should just repatch the original code, - but here it will generate a stub) but it already generates a >20% speed-up - on V8-splay, leading to a 2% win overall in splay. Neutral elsewhere. - - * CMakeLists.txt: - * GNUmakefile.list.am: - * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj: - * JavaScriptCore.xcodeproj/project.pbxproj: - * Target.pri: - * bytecode/PolymorphicPutByIdList.cpp: Added. - (JSC): - (JSC::PutByIdAccess::fromStructureStubInfo): - (JSC::PutByIdAccess::visitWeak): - (JSC::PolymorphicPutByIdList::PolymorphicPutByIdList): - (JSC::PolymorphicPutByIdList::from): - (JSC::PolymorphicPutByIdList::~PolymorphicPutByIdList): - (JSC::PolymorphicPutByIdList::isFull): - (JSC::PolymorphicPutByIdList::isAlmostFull): - (JSC::PolymorphicPutByIdList::addAccess): - (JSC::PolymorphicPutByIdList::visitWeak): - * bytecode/PolymorphicPutByIdList.h: Added. - (JSC): - (PutByIdAccess): - (JSC::PutByIdAccess::PutByIdAccess): - (JSC::PutByIdAccess::transition): - (JSC::PutByIdAccess::replace): - (JSC::PutByIdAccess::isSet): - (JSC::PutByIdAccess::operator!): - (JSC::PutByIdAccess::type): - (JSC::PutByIdAccess::isTransition): - (JSC::PutByIdAccess::isReplace): - (JSC::PutByIdAccess::oldStructure): - (JSC::PutByIdAccess::structure): - (JSC::PutByIdAccess::newStructure): - (JSC::PutByIdAccess::chain): - (JSC::PutByIdAccess::stubRoutine): - (PolymorphicPutByIdList): - (JSC::PolymorphicPutByIdList::currentSlowPathTarget): - (JSC::PolymorphicPutByIdList::isEmpty): - (JSC::PolymorphicPutByIdList::size): - (JSC::PolymorphicPutByIdList::at): - (JSC::PolymorphicPutByIdList::operator[]): - (JSC::PolymorphicPutByIdList::kind): - * bytecode/PutKind.h: Added. - (JSC): - * bytecode/StructureStubInfo.cpp: - (JSC::StructureStubInfo::deref): - (JSC::StructureStubInfo::visitWeakReferences): - * bytecode/StructureStubInfo.h: - (JSC): - (JSC::isPutByIdAccess): - (JSC::StructureStubInfo::initPutByIdList): - (StructureStubInfo): - (JSC::StructureStubInfo::reset): - * dfg/DFGOperations.cpp: - * dfg/DFGOperations.h: - (DFG): - * dfg/DFGRepatch.cpp: - (JSC::DFG::appropriateGenericPutByIdFunction): - (JSC::DFG::appropriateListBuildingPutByIdFunction): - (DFG): - (JSC::DFG::emitPutReplaceStub): - (JSC::DFG::emitPutTransitionStub): - (JSC::DFG::tryCachePutByID): - (JSC::DFG::dfgRepatchPutByID): - (JSC::DFG::tryBuildPutByIdList): - (JSC::DFG::dfgBuildPutByIdList): - (JSC::DFG::dfgResetPutByID): - * dfg/DFGRepatch.h: - (DFG): - * runtime/WriteBarrier.h: - (WriteBarrierBase): - (JSC::WriteBarrierBase::copyFrom): - -2012-02-10 Vineet Chaudhary - - https://bugs.webkit.org/show_bug.cgi?id=72756 - DOMHTMLElement’s accessKey property is declared as available in WebKit version that didn’t have it - - Reviewed by Timothy Hatcher. - - * API/WebKitAvailability.h: Added AVAILABLE_AFTER_WEBKIT_VERSION_5_1 and - AVAILABLE_WEBKIT_VERSION_1_3_AND_LATER_BUT_DEPRECATED_AFTER_WEBKIT_VERSION_5_1 for the new versions. - -2012-02-10 Mark Hahnenberg - - Fixing windows build - - Unreviewed build fix - - * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def: - -2012-02-10 Adam Klein - - Enable MUTATION_OBSERVERS by default on all platforms - https://bugs.webkit.org/show_bug.cgi?id=78196 - - Reviewed by Ojan Vafai. - - * Configurations/FeatureDefines.xcconfig: - -2012-02-10 Yong Li - - ENABLE(ASSEMBLER_WX_EXCLUSIVE): LinkBuffer can leave pages not marked as executable. - https://bugs.webkit.org/show_bug.cgi?id=76724 - - Reviewed by Rob Buis. - - This issue only exists when both ENABLE(ASSEMBLER_WX_EXCLUSIVE) and ENABLE(BRANCH_COMPACTION) are on. - The size used to call makeExecutable can be smaller than the one that was used for makeWritable. - So it can leave pages behind that are not set back to default flags. When an assembly on one of those - pages is executed or JIT returns to those pages in the case it was already executing from there, the - software will crash. - - * assembler/LinkBuffer.h: Add m_initialSize and use it in performFinalization(). - (JSC::LinkBuffer::LinkBuffer): - (JSC::LinkBuffer::linkCode): - (JSC::LinkBuffer::performFinalization): - (LinkBuffer): - -2012-02-10 Mark Hahnenberg - - Split MarkedSpace into destructor and destructor-free subspaces - https://bugs.webkit.org/show_bug.cgi?id=77761 - - Reviewed by Geoffrey Garen. - - * dfg/DFGSpeculativeJIT.h: - (JSC::DFG::SpeculativeJIT::emitAllocateJSFinalObject): Switched over to use destructor-free space. - * heap/Heap.h: - (JSC::Heap::allocatorForObjectWithoutDestructor): Added to give clients (e.g. the JIT) the ability to - pick which subspace they want to allocate out of. - (JSC::Heap::allocatorForObjectWithDestructor): Ditto. - (Heap): - (JSC::Heap::allocateWithDestructor): Added private function for CellAllocator to use. - (JSC): - (JSC::Heap::allocateWithoutDestructor): Ditto. - * heap/MarkedAllocator.cpp: Added the cellsNeedDestruction flag to allocators so that they can allocate - their MarkedBlocks correctly. - (JSC::MarkedAllocator::allocateBlock): - * heap/MarkedAllocator.h: - (JSC::MarkedAllocator::cellsNeedDestruction): - (MarkedAllocator): - (JSC::MarkedAllocator::MarkedAllocator): - (JSC): - (JSC::MarkedAllocator::init): Replaced custom set functions, which were only used upon initialization, with - an init function that does all of that stuff in fewer lines. - * heap/MarkedBlock.cpp: - (JSC::MarkedBlock::create): - (JSC::MarkedBlock::recycle): - (JSC::MarkedBlock::MarkedBlock): - (JSC::MarkedBlock::callDestructor): Templatized, along with specializedSweep and sweepHelper, to make - checking the m_cellsNeedDestructor flag faster and cleaner looking. - (JSC): - (JSC::MarkedBlock::specializedSweep): - (JSC::MarkedBlock::sweep): - (JSC::MarkedBlock::sweepHelper): - * heap/MarkedBlock.h: - (MarkedBlock): - (JSC::MarkedBlock::cellsNeedDestruction): - (JSC): - * heap/MarkedSpace.cpp: - (JSC::MarkedSpace::MarkedSpace): - (JSC::MarkedSpace::resetAllocators): - (JSC::MarkedSpace::canonicalizeCellLivenessData): - (JSC::TakeIfUnmarked::operator()): - * heap/MarkedSpace.h: - (MarkedSpace): - (Subspace): - (JSC::MarkedSpace::allocatorFor): Needed function to differentiate between the two broad subspaces of - allocators. - (JSC): - (JSC::MarkedSpace::destructorAllocatorFor): Ditto. - (JSC::MarkedSpace::allocateWithoutDestructor): Ditto. - (JSC::MarkedSpace::allocateWithDestructor): Ditto. - (JSC::MarkedSpace::forEachBlock): - * jit/JIT.h: - * jit/JITInlineMethods.h: Modified to use the proper allocator for JSFinalObjects and others. - (JSC::JIT::emitAllocateBasicJSObject): - (JSC::JIT::emitAllocateJSFinalObject): - (JSC::JIT::emitAllocateJSFunction): - * runtime/JSArray.cpp: - (JSC): - * runtime/JSArray.h: - (JSArray): - (JSC::JSArray::create): - (JSC): - (JSC::JSArray::tryCreateUninitialized): - * runtime/JSCell.h: - (JSCell): - (JSC): - (NeedsDestructor): Template struct that calculates at compile time whether the class in question requires - destruction or not using the compiler type trait __has_trivial_destructor. allocateCell then checks this - constant to decide whether to allocate in the destructor or destructor-free parts of the heap. - (JSC::allocateCell): - * runtime/JSFunction.cpp: - (JSC): - * runtime/JSFunction.h: - (JSFunction): - * runtime/JSObject.cpp: - (JSC): - * runtime/JSObject.h: - (JSNonFinalObject): - (JSC): - (JSFinalObject): - (JSC::JSFinalObject::create): - -2012-02-10 Adrienne Walker - - Remove implicit copy constructor usage in HashMaps with OwnPtr - https://bugs.webkit.org/show_bug.cgi?id=78071 - - Reviewed by Darin Adler. - - Change the return type of emptyValue() in PairHashTraits to be the - actual type returned rather than the trait type to avoid an implicit - generation of the OwnPtr copy constructor. This happens for hash - traits involving OwnPtr where the empty value is not zero and each - hash bucket needs to be initialized with emptyValue(). - - Also, update StructureTransitionTable to use default hash traits - rather than rolling its own, in order to update it to handle - EmptyValueType. - - Test: patch from bug 74154 compiles on Clang with this patch - - * runtime/StructureTransitionTable.h: - (StructureTransitionTable): - * wtf/HashTraits.h: - (GenericHashTraits): - (PairHashTraits): - (WTF::PairHashTraits::emptyValue): - -2012-02-10 Aron Rosenberg - - [Qt] Fix compiler warning in Visual Studio 2010 about TR1 - https://bugs.webkit.org/show_bug.cgi?id=63642 - - Reviewed by Simon Hausmann. - - * JavaScriptCore.pri: - -2012-02-10 Michael Saboff - - Yarr assert with regexp where alternative in *-quantified group matches empty - https://bugs.webkit.org/show_bug.cgi?id=67752 - - Reviewed by Gavin Barraclough. - - Added backtracking for the prior alternative if it matched - but didn't consume any input characters. - - * yarr/YarrJIT.cpp: - (YarrOp): New jump. - (JSC::Yarr::YarrGenerator::generate): Emit conditional jump - when an alternative matches and no input was consumed. Moved the - zero length match check for a set of alternatives to the alternative - code from the parentheses cases to the alternative end cases. - Converted the existing zero length checks in the parentheses cases - to runtime assertion checks. - (JSC::Yarr::YarrGenerator::backtrack): Link new jump to backtrack - to prior term. - -2012-02-10 Roland Takacs - - [Qt] GC should be parallel on Qt platform - https://bugs.webkit.org/show_bug.cgi?id=73309 - - Reviewed by Zoltan Herczeg. - - These changes made the parallel gc feature available for Qt port. - The implementation of "registerGCThread" and "isMainThreadOrGCThread", - and a local static function [initializeGCThreads] is moved from - MainThreadMac.mm to the common MainThread.cpp to make them available - for other platforms. - - Measurement results: - V8 speed-up: 1.025x as fast [From: 663.4ms To: 647.0ms ] - V8 Splay speed-up: 1.185x as fast [From: 138.4ms To: 116.8ms ] - - Tested on Intel(R) Core(TM) i5-2320 CPU @ 3.00GHz with 4-core. - - * JavaScriptCore.order: - * wtf/MainThread.cpp: - (WTF::initializeMainThread): - (WTF): - (WTF::initializeGCThreads): - (WTF::registerGCThread): - (WTF::isMainThreadOrGCThread): - * wtf/MainThread.h: - (WTF): - * wtf/Platform.h: - * wtf/mac/MainThreadMac.mm: - (WTF): - -2012-02-09 Andy Wingo - - Eliminate dead code in BytecodeGenerator::resolve() - https://bugs.webkit.org/show_bug.cgi?id=78242 - - Reviewed by Gavin Barraclough. - - * bytecompiler/BytecodeGenerator.cpp: - (JSC::BytecodeGenerator::resolve): - BytecodeGenerator::shouldOptimizeLocals() is only true for - FunctionCode, and thus cannot be true for GlobalCode. - -2012-02-09 Andy Wingo - - Remove BytecodeGenerator::isLocal - https://bugs.webkit.org/show_bug.cgi?id=78241 - - Minor refactor to BytecodeGenerator. - - Reviewed by Gavin Barraclough. - - * bytecompiler/BytecodeGenerator.h: - * bytecompiler/BytecodeGenerator.cpp: - (JSC::BytecodeGenerator::isLocal): - (JSC::BytecodeGenerator::isLocalConstant): Remove now-unused - methods. - * bytecompiler/NodesCodegen.cpp: - (JSC::ResolveNode::isPure): Use the ResolveResult mechanism - instead of isLocal. This will recognize more resolve nodes as - being pure. - (JSC::PrefixResolveNode::emitBytecode): Use isReadOnly on the - location instead of isLocalConstant. - -2012-02-09 Oliver Hunt - - The JS Parser scope object needs a VectorTrait specialization - https://bugs.webkit.org/show_bug.cgi?id=78308 - - Reviewed by Gavin Barraclough. - - This showed up as a periodic crash in various bits of generated code - originally, but I've added an assertion in the bytecode generator - that makes the effected code much more crash-happy should it go - wrong again. - - * bytecompiler/BytecodeGenerator.cpp: - (JSC::BytecodeGenerator::BytecodeGenerator): - (JSC::BytecodeGenerator::resolve): - * parser/Parser.cpp: - * parser/Parser.h: - (JSC): - * runtime/JSActivation.h: - (JSC::JSActivation::isValidScopedLookup): - (JSActivation): - -2012-02-08 Oliver Hunt - - Whoops, fix the build. - - * runtime/Executable.cpp: - (JSC::FunctionExecutable::FunctionExecutable): - -2012-02-08 Oliver Hunt - - Fix issue encountered while debugging stacktraces - https://bugs.webkit.org/show_bug.cgi?id=78147 - - Reviewed by Gavin Barraclough. - - Debugging is easier if we always ensure that we have a non-null - inferred name. - - * runtime/Executable.cpp: - (JSC::FunctionExecutable::FunctionExecutable): - -2012-02-08 Oliver Hunt - - updateTopCallframe in the baseline JIT doesn't provide enough information to the stubs - https://bugs.webkit.org/show_bug.cgi?id=78145 - - Reviewed by Gavin Barraclough. - - Fix the updateTopCallFrame helper to store additional information - that becomes necessary when we are trying to provide more stack - frame information. - - * interpreter/CallFrame.h: - (JSC::ExecState::bytecodeOffsetForBaselineJIT): - (ExecState): - * jit/JIT.cpp: - (JSC::JIT::privateCompile): - * jit/JIT.h: - (JSC::JIT::compileGetByIdProto): - (JSC::JIT::compileGetByIdSelfList): - (JSC::JIT::compileGetByIdProtoList): - (JSC::JIT::compileGetByIdChainList): - (JSC::JIT::compileGetByIdChain): - (JSC::JIT::compilePutByIdTransition): - (JIT): - * jit/JITInlineMethods.h: - (JSC::JIT::updateTopCallFrame): - -2012-02-07 Robert Kroeger - - [chromium] Remove the enable marcro for the no longer necessary Chromium - gesture recognizer. - https://bugs.webkit.org/show_bug.cgi?id=77492 - - Reviewed by Adam Barth. - - * wtf/Platform.h: - -2012-02-07 Tony Chang - - merge DashboardSupportCSSPropertyNames.in into CSSPropertyNames.in - https://bugs.webkit.org/show_bug.cgi?id=78036 - - Reviewed by Darin Adler. - - * Configurations/FeatureDefines.xcconfig: Add ENABLE_DASHBOARD_SUPPORT to FEATURE_DEFINES. - -2012-02-07 Gyuyoung Kim - - [CMAKE] Use *bin* and *lib* directories for executable and libraries. - https://bugs.webkit.org/show_bug.cgi?id=77928 - - Reviewed by Daniel Bates. - - CMake has used *Programs* directory for executable. In addition, shared libraries are being - built in source directory. It is better to set common places in order to maintain executable - and libraries. *bin* is for executable and *lib* is for library. - - * shell/CMakeLists.txt: Change *Programs* with *bin*. - -2012-02-07 Gavin Barraclough - - Crash on http://www.rickshawbags.com/ - https://bugs.webkit.org/show_bug.cgi?id=78045 - - Reviewed by Darin Adler. - - Problem URL is: http://www.rickshawbags.com/customize/custom-bag#!thl=rickshaw/bag() - - This is a bug introduced by https://bugs.webkit.org/show_bug.cgi?id=71933, - isVariableObject() checks were excluding StaticScopeObjects, this patch - inadvertently changed them to be included. - - * runtime/JSType.h: - - sort JSType enum such that StaticScopeObjectType comes before VariableObjectType, - and thus is excluded from isVariableObject() checks. - -2012-02-06 Jer Noble - - Use CMClock as a timing source for PlatformClock where available. - https://bugs.webkit.org/show_bug.cgi?id=77885 - - Reviewed by Eric Carlson. - - * wtf/Platform.h: Added WTF_USE_COREMEDIA. - -2012-02-06 Filip Pizlo - - ValueToNumber and ValueToDouble nodes don't do anything and should be removed - https://bugs.webkit.org/show_bug.cgi?id=77855 - - - Reviewed by Gavin Barraclough. - - Removed ValueToNumber and ValueToDouble, because the only thing they were doing - was wasting registers. - - This looks like a 1% win on V8 (with a 5% win on crypto) and a 2-3% win on Kraken, - mostly due to a >10% win on gaussian-blur. No win anywhere else. - - * dfg/DFGAbstractState.cpp: - (JSC::DFG::AbstractState::execute): - * dfg/DFGByteCodeParser.cpp: - (JSC::DFG::ByteCodeParser::getToInt32): - (ByteCodeParser): - (JSC::DFG::ByteCodeParser::handleMinMax): - (JSC::DFG::ByteCodeParser::handleIntrinsic): - (JSC::DFG::ByteCodeParser::parseBlock): - * dfg/DFGNode.h: - (DFG): - (JSC::DFG::Node::hasArithNodeFlags): - * dfg/DFGPropagator.cpp: - (JSC::DFG::Propagator::propagateArithNodeFlags): - (JSC::DFG::Propagator::propagateNodePredictions): - (JSC::DFG::Propagator::vote): - (JSC::DFG::Propagator::doRoundOfDoubleVoting): - (Propagator): - (JSC::DFG::Propagator::fixupNode): - (JSC::DFG::Propagator::canonicalize): - * dfg/DFGSpeculativeJIT.cpp: - (JSC::DFG::SpeculativeJIT::computeValueRecoveryFor): - * dfg/DFGSpeculativeJIT32_64.cpp: - (JSC::DFG::SpeculativeJIT::compile): - * dfg/DFGSpeculativeJIT64.cpp: - (JSC::DFG::SpeculativeJIT::compile): - -2012-02-06 Patrick Gansterer - - Unreviewed WinCE build fix after r106197. - - * tools/CodeProfiling.cpp: - (JSC::CodeProfiling::notifyAllocator): getenv() isn't supported by WinCE. Don't call it. - -2012-02-05 Gavin Barraclough - - Remove JSObject defineGetter/defineSetter lookupGetter/lookupSetter - https://bugs.webkit.org/show_bug.cgi?id=77451 - - Reviewed by Sam Weinig. - - These can now all be implemented in terms of defineOwnProperty & getPropertyDescriptor. - Also remove initializeGetterSetterProperty, since this is equivalent to putDirectAccessor. - - * JavaScriptCore.exp: - * debugger/DebuggerActivation.cpp: - (JSC::DebuggerActivation::defineOwnProperty): - * debugger/DebuggerActivation.h: - (DebuggerActivation): - * runtime/ClassInfo.h: - (MethodTable): - (JSC): - * runtime/JSBoundFunction.cpp: - (JSC::JSBoundFunction::finishCreation): - * runtime/JSCell.cpp: - (JSC): - * runtime/JSCell.h: - (JSCell): - * runtime/JSFunction.cpp: - (JSC::JSFunction::getOwnPropertySlot): - (JSC::JSFunction::getOwnPropertyDescriptor): - * runtime/JSGlobalObject.cpp: - (JSC::JSGlobalObject::defineOwnProperty): - (JSC): - * runtime/JSGlobalObject.h: - (JSGlobalObject): - * runtime/JSObject.cpp: - (JSC): - * runtime/JSObject.h: - (JSObject): - * runtime/ObjectPrototype.cpp: - (JSC::objectProtoFuncDefineGetter): - (JSC::objectProtoFuncDefineSetter): - (JSC::objectProtoFuncLookupGetter): - (JSC::objectProtoFuncLookupSetter): - -2012-02-06 Carlos Garcia Campos - - Unreviewed. Fix make distcheck. - - * GNUmakefile.list.am: Add missing files. - -2012-02-05 Filip Pizlo - - DFG's child references from one node to another should have room for type information - https://bugs.webkit.org/show_bug.cgi?id=77797 - - Reviewed by Oliver Hunt. - - The DFG::Node::child fields now contain both a DFG::NodeIndex (which is just an unsigned) - and a DFG::UseKind (which is currently an effectively empty enum). They are encapsulated - together as a DFG::NodeUse, which can in most cases still be used as an index (for - example DFG::Graph, AbstractState, and SpeculativeJIT all accept NodeUse in most places - where they really want a NodeIndex). - - The NodeUse stores both the index and the UseKind without bloating the memory usage of - DFG::Node, since we really don't need full 32 bits for the NodeIndex (a DFG::Node is - roughly 11 words, so if we assume that we never want to use more than 1GB to DFG compile - something - likely a sensible assumption! - then we will only be able to have room for - about 24 million nodes, which means we only need about 24.5 bits for the node index). - Currently the DFG::NodeUse allocates 4 bits for the UseKind and 28 bits for the index, - but stores the index as a signed number to make NoNode work naturally. Hence we really - just have 27 bits for the index. - - This is performance-neutral on all benchmarks we track. - - * JavaScriptCore.xcodeproj/project.pbxproj: - * dfg/DFGAbstractState.h: - (JSC::DFG::AbstractState::forNode): - (AbstractState): - * dfg/DFGByteCodeParser.cpp: - (JSC::DFG::ByteCodeParser::getLocal): - (JSC::DFG::ByteCodeParser::getArgument): - (JSC::DFG::ByteCodeParser::toInt32): - (JSC::DFG::ByteCodeParser::addVarArgChild): - (JSC::DFG::ByteCodeParser::processPhiStack): - * dfg/DFGCommon.h: - * dfg/DFGGraph.cpp: - (JSC::DFG::Graph::dump): - (DFG): - * dfg/DFGGraph.h: - (Graph): - (JSC::DFG::Graph::operator[]): - (JSC::DFG::Graph::at): - (JSC::DFG::Graph::ref): - (JSC::DFG::Graph::deref): - (JSC::DFG::Graph::clearAndDerefChild1): - (JSC::DFG::Graph::clearAndDerefChild2): - (JSC::DFG::Graph::clearAndDerefChild3): - * dfg/DFGJITCompiler.h: - (JSC::DFG::JITCompiler::getPrediction): - * dfg/DFGNode.h: - (JSC::DFG::Node::Node): - (JSC::DFG::Node::child1): - (JSC::DFG::Node::child1Unchecked): - (JSC::DFG::Node::child2): - (JSC::DFG::Node::child3): - (JSC::DFG::Node::firstChild): - (JSC::DFG::Node::numChildren): - (JSC::DFG::Node::dumpChildren): - (Node): - * dfg/DFGNodeReferenceBlob.h: Added. - (DFG): - (NodeReferenceBlob): - (JSC::DFG::NodeReferenceBlob::NodeReferenceBlob): - (JSC::DFG::NodeReferenceBlob::child): - (JSC::DFG::NodeReferenceBlob::child1): - (JSC::DFG::NodeReferenceBlob::child2): - (JSC::DFG::NodeReferenceBlob::child3): - (JSC::DFG::NodeReferenceBlob::child1Unchecked): - (JSC::DFG::NodeReferenceBlob::initialize): - (JSC::DFG::NodeReferenceBlob::firstChild): - (JSC::DFG::NodeReferenceBlob::setFirstChild): - (JSC::DFG::NodeReferenceBlob::numChildren): - (JSC::DFG::NodeReferenceBlob::setNumChildren): - * dfg/DFGNodeUse.h: Added. - (DFG): - (NodeUse): - (JSC::DFG::NodeUse::NodeUse): - (JSC::DFG::NodeUse::indexUnchecked): - (JSC::DFG::NodeUse::index): - (JSC::DFG::NodeUse::setIndex): - (JSC::DFG::NodeUse::useKind): - (JSC::DFG::NodeUse::setUseKind): - (JSC::DFG::NodeUse::isSet): - (JSC::DFG::NodeUse::operator!): - (JSC::DFG::NodeUse::operator==): - (JSC::DFG::NodeUse::operator!=): - (JSC::DFG::NodeUse::shift): - (JSC::DFG::NodeUse::makeWord): - (JSC::DFG::operator==): - (JSC::DFG::operator!=): - * dfg/DFGPropagator.cpp: - (JSC::DFG::Propagator::propagateArithNodeFlags): - (JSC::DFG::Propagator::vote): - (JSC::DFG::Propagator::toDouble): - (JSC::DFG::Propagator::fixupNode): - (JSC::DFG::Propagator::canonicalize): - (JSC::DFG::Propagator::startIndex): - (JSC::DFG::Propagator::globalVarLoadElimination): - (JSC::DFG::Propagator::getByValLoadElimination): - (JSC::DFG::Propagator::getByOffsetLoadElimination): - (JSC::DFG::Propagator::performSubstitution): - (JSC::DFG::Propagator::performNodeCSE): - * dfg/DFGScoreBoard.h: - (JSC::DFG::ScoreBoard::use): - * dfg/DFGSpeculativeJIT.cpp: - (JSC::DFG::SpeculativeJIT::useChildren): - (JSC::DFG::SpeculativeJIT::writeBarrier): - (JSC::DFG::SpeculativeJIT::nonSpeculativeStrictEq): - (JSC::DFG::SpeculativeJIT::compilePeepHoleObjectEquality): - (JSC::DFG::SpeculativeJIT::compilePeepHoleIntegerBranch): - (JSC::DFG::SpeculativeJIT::compileMovHint): - (JSC::DFG::SpeculativeJIT::computeValueRecoveryFor): - (JSC::DFG::SpeculativeJIT::compilePutByValForByteArray): - (JSC::DFG::SpeculativeJIT::compilePutByValForIntTypedArray): - (JSC::DFG::SpeculativeJIT::compilePutByValForFloatTypedArray): - (JSC::DFG::SpeculativeJIT::compileSoftModulo): - (JSC::DFG::SpeculativeJIT::compileAdd): - (JSC::DFG::SpeculativeJIT::compileArithSub): - (JSC::DFG::SpeculativeJIT::compileStrictEqForConstant): - (JSC::DFG::SpeculativeJIT::compileStrictEq): - * dfg/DFGSpeculativeJIT.h: - (JSC::DFG::SpeculativeJIT::at): - (JSC::DFG::SpeculativeJIT::canReuse): - (JSC::DFG::SpeculativeJIT::use): - (SpeculativeJIT): - (JSC::DFG::SpeculativeJIT::detectPeepHoleBranch): - (JSC::DFG::SpeculativeJIT::speculationCheck): - (JSC::DFG::SpeculativeJIT::terminateSpeculativeExecution): - (JSC::DFG::IntegerOperand::IntegerOperand): - (JSC::DFG::DoubleOperand::DoubleOperand): - (JSC::DFG::JSValueOperand::JSValueOperand): - (JSC::DFG::StorageOperand::StorageOperand): - (JSC::DFG::SpeculateIntegerOperand::SpeculateIntegerOperand): - (JSC::DFG::SpeculateStrictInt32Operand::SpeculateStrictInt32Operand): - (JSC::DFG::SpeculateDoubleOperand::SpeculateDoubleOperand): - (JSC::DFG::SpeculateCellOperand::SpeculateCellOperand): - (JSC::DFG::SpeculateBooleanOperand::SpeculateBooleanOperand): - * dfg/DFGSpeculativeJIT32_64.cpp: - (JSC::DFG::SpeculativeJIT::nonSpeculativeValueToNumber): - (JSC::DFG::SpeculativeJIT::nonSpeculativeValueToInt32): - (JSC::DFG::SpeculativeJIT::cachedPutById): - (JSC::DFG::SpeculativeJIT::nonSpeculativeNonPeepholeCompareNull): - (JSC::DFG::SpeculativeJIT::nonSpeculativePeepholeBranchNull): - (JSC::DFG::SpeculativeJIT::nonSpeculativeCompareNull): - (JSC::DFG::SpeculativeJIT::nonSpeculativePeepholeBranch): - (JSC::DFG::SpeculativeJIT::nonSpeculativeNonPeepholeCompare): - (JSC::DFG::SpeculativeJIT::nonSpeculativePeepholeStrictEq): - (JSC::DFG::SpeculativeJIT::nonSpeculativeNonPeepholeStrictEq): - (JSC::DFG::SpeculativeJIT::emitCall): - (JSC::DFG::SpeculativeJIT::compileValueAdd): - (JSC::DFG::SpeculativeJIT::compileObjectOrOtherLogicalNot): - (JSC::DFG::SpeculativeJIT::compileLogicalNot): - (JSC::DFG::SpeculativeJIT::emitObjectOrOtherBranch): - (JSC::DFG::SpeculativeJIT::emitBranch): - (JSC::DFG::SpeculativeJIT::compile): - * dfg/DFGSpeculativeJIT64.cpp: - (JSC::DFG::SpeculativeJIT::nonSpeculativeValueToNumber): - (JSC::DFG::SpeculativeJIT::nonSpeculativeValueToInt32): - (JSC::DFG::SpeculativeJIT::cachedPutById): - (JSC::DFG::SpeculativeJIT::nonSpeculativeNonPeepholeCompareNull): - (JSC::DFG::SpeculativeJIT::nonSpeculativePeepholeBranchNull): - (JSC::DFG::SpeculativeJIT::nonSpeculativeCompareNull): - (JSC::DFG::SpeculativeJIT::nonSpeculativePeepholeBranch): - (JSC::DFG::SpeculativeJIT::nonSpeculativeNonPeepholeCompare): - (JSC::DFG::SpeculativeJIT::nonSpeculativePeepholeStrictEq): - (JSC::DFG::SpeculativeJIT::nonSpeculativeNonPeepholeStrictEq): - (JSC::DFG::SpeculativeJIT::emitCall): - (JSC::DFG::SpeculativeJIT::compileObjectEquality): - (JSC::DFG::SpeculativeJIT::compileValueAdd): - (JSC::DFG::SpeculativeJIT::compileObjectOrOtherLogicalNot): - (JSC::DFG::SpeculativeJIT::compileLogicalNot): - (JSC::DFG::SpeculativeJIT::emitObjectOrOtherBranch): - (JSC::DFG::SpeculativeJIT::emitBranch): - (JSC::DFG::SpeculativeJIT::compile): - -2012-02-05 Gyuyoung Kim - - [CMAKE] Support javascriptcore test for EFL port. - https://bugs.webkit.org/show_bug.cgi?id=77425 - - Reviewed by Daniel Bates. - - Efl and WinCE as well as Blackberry port are now using Cmake as its build system - and they are share the make file to create jsc excutable. In order to run - "run-javascriptcore-tests", EFL port needs to change jsc installation configuration - with executable output directory(e.g. Programs). So, this patch change jsc installation - configuration only for EFL port. - - * shell/CMakeLists.txt: - -2012-02-04 Gavin Barraclough - - Rubber stamped by Sam Weinig. - - * yarr/YarrPattern.cpp: - (JSC::Yarr::YarrPatternConstructor::quantifyAtom): - - Fix comment. - -2012-02-04 Kalev Lember - - [GTK] CurrentTime: Reorder headers for win32 - https://bugs.webkit.org/show_bug.cgi?id=77808 - - Reviewed by Martin Robinson. - - In GTK+ win32 port, monotonicallyIncreasingTime() implementation is - based on g_get_monotonic_time(). Reorder headers to make sure glib.h - gets included even when the platform is win32. - - CurrentTime.cpp: In function 'double WTF::monotonicallyIncreasingTime()': - CurrentTime.cpp:321:53: error: 'g_get_monotonic_time' was not declared in this scope - CurrentTime.cpp:322:1: warning: control reaches end of non-void function [-Wreturn-type] - - * wtf/CurrentTime.cpp: - -2012-02-03 Anders Carlsson - - Prefix the typedef in WTF_MAKE_FAST_ALLOCATED with underscores - https://bugs.webkit.org/show_bug.cgi?id=77788 - - Reviewed by Andreas Kling. - - The current typedef name, 'ThisIsHereToForceASemicolonAfterThisMacro', shows up when trying to - code-complete 'this' in Xcode. Prefix the typedef with two underscores to stop this from happening. - - * wtf/FastAllocBase.h: - -2012-02-03 Rob Buis - - Fix alignment warnings in ARMv7 - https://bugs.webkit.org/show_bug.cgi?id=55368 - - Reviewed by Filip Pizlo. - - Use reinterpret_cast_ptr and static_cast to get rid of alignment issues in ARMv7 code. - - * heap/HandleTypes.h: - (JSC::HandleTypes::getFromSlot): - * heap/MarkedBlock.cpp: - (JSC::MarkedBlock::specializedSweep): - * heap/MarkedBlock.h: - (JSC::MarkedBlock::forEachCell): - * runtime/WriteBarrier.h: - (JSC::WriteBarrierBase::get): - (JSC::WriteBarrierBase::unvalidatedGet): - -2012-02-03 Mark Hahnenberg - - Build fix - - Unreviewed build fix - - Forgot to add a couple files. - - * heap/MarkedAllocator.cpp: Added. - (JSC): - (JSC::MarkedAllocator::tryAllocateHelper): - (JSC::MarkedAllocator::tryAllocate): - (JSC::MarkedAllocator::allocateSlowCase): - (JSC::MarkedAllocator::allocateBlock): - (JSC::MarkedAllocator::addBlock): - (JSC::MarkedAllocator::removeBlock): - * heap/MarkedAllocator.h: Added. - (JSC): - (DFG): - (MarkedAllocator): - (JSC::MarkedAllocator::cellSize): - (JSC::MarkedAllocator::heap): - (JSC::MarkedAllocator::setHeap): - (JSC::MarkedAllocator::setCellSize): - (JSC::MarkedAllocator::setMarkedSpace): - (JSC::MarkedAllocator::MarkedAllocator): - (JSC::MarkedAllocator::allocate): - (JSC::MarkedAllocator::reset): - (JSC::MarkedAllocator::zapFreeList): - (JSC::MarkedAllocator::forEachBlock): - -2012-02-03 Mark Hahnenberg - - Refactor MarkedBlock::SizeClass into a separate class - https://bugs.webkit.org/show_bug.cgi?id=77600 - - Reviewed by Geoffrey Garen. - - We pulled SizeClass out into its own class, named MarkedAllocator, and gave it - the responsibility of allocating objects from the collection of MarkedBlocks - that it manages. Also limited the amount of coupling to internal data fields - from other places, although it's mostly unavoidable in the JIT code. - - Eventually MarkedAllocator will implement various policies to do with object - management, e.g. whether or not to run destructors on objects that it manages. - MarkedSpace will manage a collection of MarkedAllocators with varying policies, - as it does now but to a larger extent. - - * CMakeLists.txt: - * GNUmakefile.list.am: - * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def: - * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj: - * JavaScriptCore.xcodeproj/project.pbxproj: - * Target.pri: - * dfg/DFGSpeculativeJIT.h: - (JSC::DFG::SpeculativeJIT::emitAllocateJSFinalObject): - * heap/Heap.cpp: - (JSC::Heap::collect): - (JSC::Heap::resetAllocators): - * heap/Heap.h: - (JSC::Heap::allocatorForObject): - (Heap): - * heap/MarkedAllocator.cpp: Added. - (JSC): - (JSC::MarkedAllocator::tryAllocateHelper): - (JSC::MarkedAllocator::tryAllocate): - (JSC::MarkedAllocator::allocateSlowCase): - (JSC::MarkedAllocator::allocateBlock): - (JSC::MarkedAllocator::addBlock): - (JSC::MarkedAllocator::removeBlock): - * heap/MarkedAllocator.h: Added. - (JSC): - (DFG): - (MarkedAllocator): - (JSC::MarkedAllocator::cellSize): - (JSC::MarkedAllocator::heap): - (JSC::MarkedAllocator::setHeap): - (JSC::MarkedAllocator::setCellSize): - (JSC::MarkedAllocator::setMarkedSpace): - (JSC::MarkedAllocator::MarkedAllocator): - (JSC::MarkedAllocator::allocate): - (JSC::MarkedAllocator::reset): - (JSC::MarkedAllocator::zapFreeList): - (JSC::MarkedAllocator::forEachBlock): - * heap/MarkedSpace.cpp: - (JSC::MarkedSpace::MarkedSpace): - (JSC::MarkedSpace::resetAllocators): - (JSC::MarkedSpace::canonicalizeCellLivenessData): - (JSC::TakeIfUnmarked::operator()): - * heap/MarkedSpace.h: - (MarkedSpace): - (JSC::MarkedSpace::allocatorFor): - (JSC::MarkedSpace::allocate): - (JSC::MarkedSpace::forEachBlock): - (JSC::MarkedSpace::didAddBlock): - (JSC::MarkedSpace::didConsumeFreeList): - * jit/JITInlineMethods.h: - (JSC::JIT::emitAllocateBasicJSObject): - -2012-02-03 Simon Hausmann - - [Qt] Replace GNU linker script for exports with export macros in WTF/JSC - https://bugs.webkit.org/show_bug.cgi?id=77723 - - Reviewed by Tor Arne Vestbø. - - * wtf/Platform.h: Enable use of export macros. - -2012-02-02 Hajime Morrita - - Unreviewed, removing an unnecessarily JS_PRIVATE_EXPORT annotation. - - * interpreter/Interpreter.h: - (Interpreter): - -2012-01-31 Hajime Morrita - - [Mac] eliminate JavaScriptCore.exp - https://bugs.webkit.org/show_bug.cgi?id=72854 - - Reviewed by Darin Adler. - - - Removed exp files and corresponding makefile entries. - - Changed the build configuration no to use exp file. - - * Configurations/JavaScriptCore.xcconfig: - * DerivedSources.make: - * JavaScriptCore.JSVALUE32_64only.exp: Removed. - * JavaScriptCore.JSVALUE64only.exp: Removed. - * JavaScriptCore.exp: Removed. - * JavaScriptCore.xcodeproj/project.pbxproj: - * wtf/Platform.h: - -2012-02-02 Benjamin Poulain - - Running a Web Worker on about:blank crashes the interpreter - https://bugs.webkit.org/show_bug.cgi?id=77593 - - Reviewed by Michael Saboff. - - The method Interpreter::execute() was crashing on empty programs because - the assumption is made the source is not null. - - This patch shortcut the execution when the String is null to avoid invalid - memory access. - - * interpreter/Interpreter.cpp: - (JSC::Interpreter::execute): - -2012-02-02 Kalev Lember - - [GTK] Use win32 native threading - https://bugs.webkit.org/show_bug.cgi?id=77676 - - Reviewed by Martin Robinson. - - r97269 switched from glib threading to pthreads, breaking win32 GTK+. - This is a follow up, removing some leftovers in ThreadSpecific.h and - switching win32 to use the native threading in ThreadingWin.cpp. - - * GNUmakefile.list.am: Compile in win32 native threading support - * wtf/ThreadSpecific.h: Remove GTK+-specific definitions - (ThreadSpecific): - (WTF::::destroy): - -2012-02-02 Filip Pizlo - - retrieveCallerFromVMCode should call trueCallerFrame - https://bugs.webkit.org/show_bug.cgi?id=77684 - - Reviewed by Oliver Hunt. - - * interpreter/Interpreter.cpp: - (JSC::Interpreter::retrieveCallerFromVMCode): - -2012-02-02 Kalev Lember - - [GTK] Implement current executable path finding for win32 - https://bugs.webkit.org/show_bug.cgi?id=77677 - - Reviewed by Martin Robinson. - - The WTF helper for getting the binary path that was added in r101710 - left out the win32 implementation. Fix this. - - * wtf/gobject/GlibUtilities.cpp: - (getCurrentExecutablePath): - -2012-02-02 Filip Pizlo - - Throwing away bytecode and then reparsing during DFG optimization is just - plain wrong and makes things crash - https://bugs.webkit.org/show_bug.cgi?id=77680 - - - Reviewed by Oliver Hunt. - - This is the minimal surgical fix: it removes the code that triggered bytecode - throw-away. Once we're confident that this is a good idea, we can kill all of - the code that implements the feature. - - * bytecode/CodeBlock.h: - (JSC::CodeBlock::discardBytecodeLater): - (JSC::CodeBlock::addValueProfile): - * jit/JITDriver.h: - (JSC::jitCompileIfAppropriate): - (JSC::jitCompileFunctionIfAppropriate): - -2012-02-02 Filip Pizlo - - Release build debugging should be easier - https://bugs.webkit.org/show_bug.cgi?id=77669 - - Reviewed by Gavin Barraclough. - - * assembler/ARMAssembler.h: - (ARMAssembler): - (JSC::ARMAssembler::debugOffset): - * assembler/ARMv7Assembler.h: - (ARMv7Assembler): - (JSC::ARMv7Assembler::debugOffset): - (ARMInstructionFormatter): - (JSC::ARMv7Assembler::ARMInstructionFormatter::debugOffset): - * assembler/AbstractMacroAssembler.h: - (AbstractMacroAssembler): - (JSC::AbstractMacroAssembler::debugOffset): - * assembler/AssemblerBuffer.h: - (AssemblerBuffer): - (JSC::AssemblerBuffer::debugOffset): - * assembler/LinkBuffer.h: - (LinkBuffer): - (JSC::LinkBuffer::debugSize): - * assembler/MIPSAssembler.h: - (MIPSAssembler): - (JSC::MIPSAssembler::debugOffset): - * assembler/X86Assembler.h: - (X86Assembler): - (JSC::X86Assembler::debugOffset): - (X86InstructionFormatter): - (JSC::X86Assembler::X86InstructionFormatter::debugOffset): - * bytecode/CodeBlock.cpp: - (JSC): - * bytecode/CodeBlock.h: - (CodeBlock): - * bytecode/CodeOrigin.h: - (CodeOrigin): - (JSC): - (JSC::CodeOrigin::inlineStack): - * bytecode/DFGExitProfile.h: - (JSC::DFG::exitKindToString): - * bytecode/DataFormat.h: - (JSC::dataFormatToString): - * bytecode/PredictedType.cpp: - (JSC): - (JSC::predictionToString): - * bytecode/PredictedType.h: - (JSC): - * bytecode/ValueRecovery.h: - (ValueRecovery): - (JSC::ValueRecovery::dump): - * bytecompiler/BytecodeGenerator.cpp: - (JSC): - (JSC::BytecodeGenerator::setDumpsGeneratedCode): - (JSC::BytecodeGenerator::dumpsGeneratedCode): - (JSC::BytecodeGenerator::generate): - * dfg/DFGAbstractValue.h: - (StructureAbstractValue): - (JSC::DFG::StructureAbstractValue::dump): - (AbstractValue): - (JSC::DFG::AbstractValue::dump): - * dfg/DFGAssemblyHelpers.h: - (DFG): - (AssemblyHelpers): - (JSC::DFG::AssemblyHelpers::debugCall): - * dfg/DFGFPRInfo.h: - (FPRInfo): - (JSC::DFG::FPRInfo::debugName): - * dfg/DFGGPRInfo.h: - (GPRInfo): - (JSC::DFG::GPRInfo::debugName): - * dfg/DFGGraph.cpp: - (DFG): - * dfg/DFGGraph.h: - (Graph): - * dfg/DFGNode.h: - (DFG): - (JSC::DFG::arithNodeFlagsAsString): - (Node): - (JSC::DFG::Node::hasIdentifier): - (JSC::DFG::Node::dumpChildren): - * dfg/DFGOSRExit.cpp: - (DFG): - (JSC::DFG::OSRExit::dump): - * dfg/DFGOSRExit.h: - (OSRExit): - * runtime/JSValue.cpp: - (JSC): - (JSC::JSValue::description): - * runtime/JSValue.h: - (JSValue): - * wtf/BitVector.cpp: - (WTF): - (WTF::BitVector::dump): - * wtf/BitVector.h: - (BitVector): - -2012-02-02 Oliver Hunt - - Getters and setters cause line numbers in errors/console.log to be offset for the whole file - https://bugs.webkit.org/show_bug.cgi?id=77675 - - Reviewed by Timothy Hatcher. - - Our default literal parsing logic doesn't handle the extra work required for - getters and setters. When it encounters one, it rolls back the lexer and - then switches to a more complete parsing function. Unfortunately it was only - winding back the character position, and was ignoring the line number and - other lexer data. This led to every getter and setter causing the line number - to be incorrectly incremented leading to increasingly incorrect numbers for - the rest of the file. - - * parser/Parser.cpp: - (JSC::::parseObjectLiteral): - -2012-02-02 Andy Wingo - - Fix type punning warning in HashTable.h debug builds - https://bugs.webkit.org/show_bug.cgi?id=77422 - - Reviewed by Gavin Barraclough. - - * wtf/HashTable.h (WTF::HashTable::checkKey): Fix type punning - warning appearing in debug builds with gcc-4.6.2 on GNU/Linux. - -2012-02-01 Michael Saboff - - Yarr crash with regexp replace - https://bugs.webkit.org/show_bug.cgi?id=67454 - - Reviewed by Gavin Barraclough. - - Properly handle the case of a back reference to an unmatched - subpattern by always matching without consuming any characters. - - * yarr/YarrInterpreter.cpp: - (JSC::Yarr::Interpreter::matchBackReference): - (JSC::Yarr::Interpreter::backtrackBackReference): - -2012-02-01 Gavin Barraclough - - calling function on catch block scope containing an eval result in wrong this value being passed - https://bugs.webkit.org/show_bug.cgi?id=77581 - - Reviewed by Oliver Hunt. - - javascript:function F(){ return 'F' in this; }; try { throw F; } catch (e) { eval(""); alert(e()); } - - * bytecompiler/NodesCodegen.cpp: - (JSC::TryNode::emitBytecode): - * interpreter/Interpreter.cpp: - (JSC::Interpreter::execute): - * parser/ASTBuilder.h: - (JSC::ASTBuilder::createTryStatement): - * parser/NodeConstructors.h: - (JSC::TryNode::TryNode): - * parser/Nodes.h: - (TryNode): - * parser/Parser.cpp: - (JSC::::parseTryStatement): - * parser/SyntaxChecker.h: - (JSC::SyntaxChecker::createTryStatement): - * runtime/JSObject.h: - (JSObject): - (JSC::JSObject::isStaticScopeObject): - (JSC): - -2012-02-01 Oliver Hunt - - Add support for inferred function names - https://bugs.webkit.org/show_bug.cgi?id=77579 - - Reviewed by Gavin Barraclough. - - Add new "inferred" names to function expressions, getters, and setters. - This property is not exposed to JS, so is only visible in the debugger - and profiler. - - * JavaScriptCore.exp: - * bytecompiler/BytecodeGenerator.h: - (JSC::BytecodeGenerator::makeFunction): - * debugger/DebuggerCallFrame.cpp: - (JSC::DebuggerCallFrame::calculatedFunctionName): - * parser/ASTBuilder.h: - (JSC::ASTBuilder::createAssignResolve): - (JSC::ASTBuilder::createGetterOrSetterProperty): - (JSC::ASTBuilder::createProperty): - (JSC::ASTBuilder::makeAssignNode): - * parser/Nodes.h: - (JSC::FunctionBodyNode::setInferredName): - (JSC::FunctionBodyNode::inferredName): - (FunctionBodyNode): - * profiler/Profiler.cpp: - (JSC): - (JSC::Profiler::createCallIdentifier): - (JSC::createCallIdentifierFromFunctionImp): - * runtime/Executable.cpp: - (JSC::FunctionExecutable::FunctionExecutable): - (JSC::FunctionExecutable::fromGlobalCode): - * runtime/Executable.h: - (JSC::FunctionExecutable::create): - (JSC::FunctionExecutable::inferredName): - (FunctionExecutable): - * runtime/JSFunction.cpp: - (JSC::JSFunction::calculatedDisplayName): - (JSC): - (JSC::getCalculatedDisplayName): - * runtime/JSFunction.h: - (JSC): - -2012-02-01 Filip Pizlo - - DFG should fold double-to-int conversions - https://bugs.webkit.org/show_bug.cgi?id=77532 - - Reviewed by Oliver Hunt. - - Performance neutral on major benchmarks. But it makes calling V8's - Math.random() 4x faster. - - * bytecode/CodeBlock.cpp: - (JSC): - (JSC::CodeBlock::addOrFindConstant): - * bytecode/CodeBlock.h: - (JSC::CodeBlock::addConstant): - (CodeBlock): - * dfg/DFGAbstractState.cpp: - (JSC::DFG::AbstractState::execute): - * dfg/DFGByteCodeParser.cpp: - (JSC::DFG::ByteCodeParser::toInt32): - (ByteCodeParser): - (JSC::DFG::ByteCodeParser::getJSConstantForValue): - (JSC::DFG::ByteCodeParser::isInt32Constant): - * dfg/DFGGraph.h: - (JSC::DFG::Graph::addShouldSpeculateInteger): - (Graph): - (JSC::DFG::Graph::addImmediateShouldSpeculateInteger): - * dfg/DFGPropagator.cpp: - (JSC::DFG::Propagator::propagateNodePredictions): - (JSC::DFG::Propagator::doRoundOfDoubleVoting): - (JSC::DFG::Propagator::fixupNode): - * dfg/DFGSpeculativeJIT.cpp: - (JSC::DFG::SpeculativeJIT::compileAdd): - (DFG): - (JSC::DFG::SpeculativeJIT::compileArithSub): - * dfg/DFGSpeculativeJIT.h: - (JSC::DFG::SpeculativeJIT::valueOfNumberConstantAsInt32): - (SpeculativeJIT): - * dfg/DFGSpeculativeJIT32_64.cpp: - (JSC::DFG::SpeculativeJIT::compile): - * dfg/DFGSpeculativeJIT64.cpp: - (JSC::DFG::SpeculativeJIT::compile): - * runtime/JSValueInlineMethods.h: - (JSC::JSValue::asDouble): - -2012-02-01 Filip Pizlo - - DFG graph dump for GetScopedVar should show the correct prediction - https://bugs.webkit.org/show_bug.cgi?id=77530 - - Reviewed by Geoff Garen. - - GetScopedVar has a heap prediction, not a variable prediction. But it does - have a variable. Hence we need to check for heap predictions before checking - for variable predictions. - - * dfg/DFGGraph.cpp: - (JSC::DFG::Graph::dump): - -2012-02-01 Mark Hahnenberg - - Replace JSArray destructor with finalizer - https://bugs.webkit.org/show_bug.cgi?id=77488 - - Reviewed by Geoffrey Garen. - - * JavaScriptCore.exp: - * runtime/JSArray.cpp: - (JSC::JSArray::finalize): Added finalizer. - (JSC::JSArray::allocateSparseMap): Factored out code for allocating new sparse maps. - (JSC): - (JSC::JSArray::deallocateSparseMap): Factored out code for deallocating sparse maps. - (JSC::JSArray::enterDictionaryMode): Renamed enterSparseMode to enterDictionaryMode - because the old name was confusing because we could have a sparse array that never - called enterSparseMode. - (JSC::JSArray::defineOwnNumericProperty): - (JSC::JSArray::setLengthWritable): - (JSC::JSArray::putByIndexBeyondVectorLength): - (JSC::JSArray::setLength): - (JSC::JSArray::pop): - (JSC::JSArray::sort): - (JSC::JSArray::compactForSorting): - * runtime/JSArray.h: - (JSArray): - -2012-02-01 Andy Wingo - - Refactor identifier resolution in BytecodeGenerator - https://bugs.webkit.org/show_bug.cgi?id=76285 - - Reviewed by Geoffrey Garen. - - * bytecompiler/BytecodeGenerator.h: - (JSC::ResolveResult): New class, to describe the storage - location corresponding to an identifier in a program. - * bytecompiler/BytecodeGenerator.cpp: - (JSC::BytecodeGenerator::resolve): New function, replacing - findScopedProperty. - (JSC::BytecodeGenerator::resolveConstDecl): New function, - encapsulating what ConstDeclNode::emitBytecode used to do. - (JSC::BytecodeGenerator::emitGetStaticVar): - (JSC::BytecodeGenerator::emitPutStaticVar): New functions, - corresponding to the old emitGetScopedVar and emitPutScopedVar. - (JSC::BytecodeGenerator::registerFor): Remove version that took an - Identifier&; replaced by ResolveResult::local(). - (JSC::BytecodeGenerator::emitResolve): - (JSC::BytecodeGenerator::emitResolveBase): - (JSC::BytecodeGenerator::emitResolveBaseForPut): - (JSC::BytecodeGenerator::emitResolveWithBase): - (JSC::BytecodeGenerator::emitResolveWithThis): Change to accept a - "resolveResult" argument. This is more clear, and reduces the - amount of double analysis happening at compile-time. - * bytecompiler/NodesCodegen.cpp: - (JSC::ResolveNode::emitBytecode): - (JSC::EvalFunctionCallNode::emitBytecode): - (JSC::FunctionCallResolveNode::emitBytecode): - (JSC::PostfixResolveNode::emitBytecode): - (JSC::DeleteResolveNode::emitBytecode): - (JSC::TypeOfResolveNode::emitBytecode): - (JSC::PrefixResolveNode::emitBytecode): - (JSC::ReadModifyResolveNode::emitBytecode): - (JSC::AssignResolveNode::emitBytecode): - (JSC::ConstDeclNode::emitCodeSingle): - (JSC::ForInNode::emitBytecode): Refactor to use the new - ResolveResult structure. - -2012-02-01 Csaba Osztrogonác - - Implement Error.stack - https://bugs.webkit.org/show_bug.cgi?id=66994 - - Unreviewed, rolling out r106407. - - * JavaScriptCore.exp: - * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def: - * interpreter/AbstractPC.cpp: - (JSC::AbstractPC::AbstractPC): - * interpreter/Interpreter.cpp: - (JSC::Interpreter::throwException): - * interpreter/Interpreter.h: - (JSC): - (Interpreter): - * jsc.cpp: - (GlobalObject::finishCreation): - * parser/Parser.h: - (JSC::::parse): - * runtime/CommonIdentifiers.h: - * runtime/Error.cpp: - (JSC::addErrorInfo): - * runtime/Error.h: - (JSC): - -2012-01-31 Hajime Morrita - - Add missing JS_PRIVATE_EXPORTs - https://bugs.webkit.org/show_bug.cgi?id=77507 - - Reviewed by Kevin Ollivier. - - * heap/MarkedSpace.h: - (MarkedSpace): - * interpreter/Interpreter.h: - (Interpreter): - * runtime/JSValue.h: - (JSValue): - * wtf/text/AtomicString.h: - (WTF::AtomicString::add): - * wtf/text/WTFString.h: - (WTF): - -2012-01-31 Geoffrey Garen - - Stop using -fomit-frame-pointer - https://bugs.webkit.org/show_bug.cgi?id=77403 - - Reviewed by Filip Pizlo. - - JavaScriptCore is too fast. I'm just the man to fix it. - - * Configurations/JavaScriptCore.xcconfig: - -2012-01-31 Michael Saboff - - StringProtoFuncToUpperCase should call StringImpl::upper similar to StringProtoToLowerCase - https://bugs.webkit.org/show_bug.cgi?id=76647 - - Reviewed by Darin Adler. - - Changed stringProtoFuncToUpperCase to call StringImpl::upper() in a manor similar - to stringProtoFuncToLowerCase(). Fixed StringImpl::upper() to handle to special - cases. One case is s-sharp (0xdf) which converts to "SS". The other case is - for characters which become 16 bit values when converted to upper case. For - those, we up convert the the source string and use the 16 bit path. - - * runtime/StringPrototype.cpp: - (JSC::stringProtoFuncToUpperCase): - * wtf/text/StringImpl.cpp: - (WTF::StringImpl::upper): - * wtf/unicode/CharacterNames.h: - (smallLetterSharpS): New constant - -2012-01-31 Oliver Hunt - - Remove unneeded sourceId property - https://bugs.webkit.org/show_bug.cgi?id=77495 - - Reviewed by Filip Pizlo. - - sourceId isn't used anymore, so we'll just remove it. - - * runtime/Error.cpp: - (JSC): - (JSC::addErrorInfo): - (JSC::hasErrorInfo): - -2012-01-31 Oliver Hunt - - Implement Error.stack - https://bugs.webkit.org/show_bug.cgi?id=66994 - - Reviewed by Gavin Barraclough. - - Original patch by Juan Carlos Montemayor Elosua: - This patch utilizes topCallFrame to create a stack trace when - an error is thrown. Users will also be able to use the stack() - command in jsc to get arrays with stack trace information. - - Modified to be correct on ToT, with a variety of correctness, - performance, and security improvements. - - * JavaScriptCore.exp: - * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def: - * interpreter/Interpreter.cpp: - (JSC::getCallerLine): - (JSC::getSourceURLFromCallFrame): - (JSC::getStackFrameCodeType): - (JSC::Interpreter::getStackTrace): - (JSC::Interpreter::throwException): - * interpreter/Interpreter.h: - (JSC::StackFrame::toString): - * jsc.cpp: - (GlobalObject::finishCreation): - (functionJSCStack): - * parser/Parser.h: - (JSC::Parser::parse): - * runtime/CommonIdentifiers.h: - * runtime/Error.cpp: - (JSC::addErrorInfo): - * runtime/Error.h: - -2012-01-31 Scott Graham - - [Chromium] Remove references to gyp cygwin build target - https://bugs.webkit.org/show_bug.cgi?id=77253 - - Reviewed by Julien Chaffraix. - - Target dependency is no longer required, it's done earlier in the - build process. - - * JavaScriptCore.gyp/JavaScriptCore.gyp: - -2012-01-31 Michael Saboff - - ASSERT(m_jumpsToLink.isEmpty()) failing in ARMv7Assembler dtor - https://bugs.webkit.org/show_bug.cgi?id=77443 - - Reviewed by Gavin Barraclough. - - Removed failing ASSERT() and thus destructor. The ASSERT isn't needed. - We are hitting it in the YARR JIT case where we bail out and go to the - interpreter with a partially JIT'ed function. Since we haven't linked - the JIT'ed code, there is likely to be some unresolved jumps in the vector - when the ARMv7Assembler destructor is called. For the case where we - complete the JIT process, we clear the vector at the end of - LinkBuffer::linkCode (LinkBuffer.h:292). - - * assembler/ARMv7Assembler.h: - (ARMv7Assembler): - -2012-01-31 Anders Carlsson - - Vector::operator== shouldn't require T to have operator!= - https://bugs.webkit.org/show_bug.cgi?id=77448 - - Reviewed by Andreas Kling. - - Change VectorComparer::compare to use !(a == b) instead of a != b since - it makes more sense for Vector::operator== to use the element's operator==. - - * wtf/Vector.h: - -2012-01-30 Oliver Hunt - - get_by_val_arguments is broken in the interpreter - https://bugs.webkit.org/show_bug.cgi?id=77389 - - Reviewed by Gavin Barraclough. - - When get_by_val had wad a value profile added, the same slot was not added to - get_by_val_arguments. This broke the interpreter as the interpreter falls - back on its regular get_by_val implementation. - - No tests are added as the interpreter is fairly broken in its - current state (multiple tests fail due to this bug). - - * bytecode/CodeBlock.cpp: - (JSC::CodeBlock::dump): - * bytecode/Opcode.h: - (JSC): - (): - * bytecompiler/BytecodeGenerator.cpp: - (JSC::BytecodeGenerator::emitGetArgumentByVal): - -2012-01-30 Oliver Hunt - - Unexpected syntax error - https://bugs.webkit.org/show_bug.cgi?id=77340 - - Reviewed by Gavin Barraclough. - - Function calls and new expressions have the same semantics for - assignment, so should simply share their lhs handling. - - * parser/Parser.cpp: - (JSC::::parseMemberExpression): - -2012-01-30 Gavin Barraclough - - Unreviewed ARMv7 build fix. - - * tools/CodeProfiling.cpp: - (JSC): - (JSC::setProfileTimer): - (JSC::CodeProfiling::begin): - (JSC::CodeProfiling::end): - -2012-01-30 David Levin - - Using OS(WIN) or OS(MAC) should cause a build error. - https://bugs.webkit.org/show_bug.cgi?id=77162 - - Reviewed by Darin Adler. - - * wtf/Platform.h: Expand them into something that will - cause a compile error. - -2012-01-30 Yong Li - - [BlackBerry] OS(QNX) also has TM_GMTOFF, TM_ZONE, and TIMEGM - https://bugs.webkit.org/show_bug.cgi?id=77360 - - Reviewed by Rob Buis. - - Turn on HAVE(TM_GMTOFF), HAVE(TM_ZONE), and HAVE(TIMEGM) - for OS(QNX). - - * wtf/Platform.h: - -2012-01-30 Gavin Barraclough - - Speculative Windows build fix. - - * assembler/MacroAssemblerCodeRef.h: - (FunctionPtr): - -2012-01-30 Gavin Barraclough - - https://bugs.webkit.org/show_bug.cgi?id=77163 - MacroAssemblerCodeRef.h uses OS(WIN) instead of OS(WINDOWS) - - Rubber stamped by Geoff Garen - - * assembler/MacroAssemblerCodeRef.h: - -2012-01-30 Gavin Barraclough - - Unreviewed build fix for interpreter builds. - - * bytecode/CodeBlock.cpp: - (JSC::CodeBlock::CodeBlock): - * bytecode/CodeBlock.h: - (CodeBlock): - * interpreter/Interpreter.cpp: - (JSC::Interpreter::privateExecute): - * tools/CodeProfile.cpp: - (JSC::CodeProfile::sample): - -2012-01-30 Gavin Barraclough - - Unreviewed build fix following bug#76855 - - * JavaScriptCore.exp: - -2012-01-30 Michael Saboff - - CaseFoldingHash::hash() doesn't handle 8 bit strings directly - https://bugs.webkit.org/show_bug.cgi?id=76652 - - Reviewed by Andreas Kling. - - * wtf/text/StringHash.h: - (WTF::CaseFoldingHash::hash): Added 8 bit string code path. - -2012-01-30 Michael Saboff - - stringProtoFuncReplace converts 8 bit strings to 16 bit during replacement - https://bugs.webkit.org/show_bug.cgi?id=76651 - - Reviewed by Geoffrey Garen. - - Made local function substituteBackreferencesSlow a template function - based on character width. Cleaned up getCharacters() in both UString - and StringImpl. Changed getCharacters to up convert an 8 bit - string to 16 bits if necessary. - - * runtime/StringPrototype.cpp: - (JSC::substituteBackreferencesSlow): - (JSC::substituteBackreferences): - * runtime/UString.h: - (JSC::LChar): - (JSC::UChar): - * wtf/text/StringImpl.h: - (WTF::UChar): - -2012-01-30 Gavin Barraclough - - Clean up putDirect - https://bugs.webkit.org/show_bug.cgi?id=76232 - - Reviewed by Sam Weinig. - - Part 3 - merge op_put_getter & op_put_setter. - - Putting these separately is inefficient (and makes future optimiation, - e.g. making GetterSetter immutable) harder. Change to emit a single - op_put_getter_setter bytecode op. Ultimately we should probably be - able to merge this with put direct, to create a common op to initialize - object literal properties. - - * bytecode/CodeBlock.cpp: - (JSC::CodeBlock::dump): - * bytecode/Opcode.h: - (JSC): - (): - * bytecompiler/BytecodeGenerator.cpp: - (JSC::BytecodeGenerator::emitPutGetterSetter): - * bytecompiler/BytecodeGenerator.h: - (BytecodeGenerator): - * bytecompiler/NodesCodegen.cpp: - (JSC::PropertyListNode::emitBytecode): - * interpreter/Interpreter.cpp: - (JSC::Interpreter::privateExecute): - * jit/JIT.cpp: - (JSC::JIT::privateCompileMainPass): - * jit/JIT.h: - (JIT): - * jit/JITPropertyAccess.cpp: - (JSC::JIT::emit_op_put_getter_setter): - * jit/JITPropertyAccess32_64.cpp: - (JSC::JIT::emit_op_put_getter_setter): - * jit/JITStubs.cpp: - (JSC::DEFINE_STUB_FUNCTION): - * jit/JITStubs.h: - (): - * runtime/JSObject.cpp: - (JSC::JSObject::putDirectVirtual): - (JSC::JSObject::putDirectAccessor): - (JSC): - (JSC::putDescriptor): - (JSC::JSObject::defineOwnProperty): - * runtime/JSObject.h: - (): - (JSC::JSObject::putDirectInternal): - (JSC::JSObject::putDirect): - (JSC::JSObject::putDirectWithoutTransition): - -2012-01-30 Michael Saboff - - Dromaeo tests call parseSimpleLengthValue() on 8 bit strings - https://bugs.webkit.org/show_bug.cgi?id=76649 - - Reviewed by Geoffrey Garen. - - * JavaScriptCore.exp: Added export for charactersToDouble. - -2012-01-30 Michael Saboff - - WebCore decodeEscapeSequences unnecessarily converts 8 bit strings to 16 bit when decoding. - https://bugs.webkit.org/show_bug.cgi?id=76648 - - Reviewed by Geoffrey Garen. - - Added a new overloaded append member that takes a String& argument, an offest - and a length to do direct sub string appending to a StringBuilder. - - * wtf/text/StringBuilder.h: - (WTF::StringBuilder::append): - -2012-01-29 Zoltan Herczeg - - Custom written CSS lexer - https://bugs.webkit.org/show_bug.cgi?id=70107 - - Reviewed by Antti Koivisto and Oliver Hunt. - - Add new helper functions for the custom written CSS lexer. - - * wtf/ASCIICType.h: - (WTF::toASCIILowerUnchecked): - (WTF): - (WTF::isASCIIAlphaCaselessEqual): - -2012-01-29 Filip Pizlo - - REGRESSION (r105576-r105582): Web Inspector Crash in JSC::JSValue::toString(JSC::ExecState*) const - https://bugs.webkit.org/show_bug.cgi?id=77146 - - - Reviewed by Oliver Hunt. - - The old JIT expects that the result of the last operation is in the lastResultRegister. The DFG JIT is - designed to correctly track the lastResultRegister by looking at SetLocal nodes. However, when the DFG - JIT inlines a code block, it forgets that the inlined code block's result would have been placed in the - lastResultRegister. Hence if we OSR exit on the first node following the end of an inlined code block - that had a return value, and that first node uses the return value, the old JIT will get massively - confused. This patch takes a surgical approach: instead of making the DFG smarter, it makes the old - JIT slightly dumber. - - * jit/JITCall.cpp: - (JSC::JIT::emit_op_call_put_result): - -2012-01-29 Filip Pizlo - - Build fix for Mac non-x64 platforms. - - * tools/CodeProfiling.cpp: - (JSC): - -2012-01-28 Gavin Barraclough - - Reserve 'let' - https://bugs.webkit.org/show_bug.cgi?id=77293 - - Rubber stamped by Oliver Hunt. - - 'let' may become a keyword in ES6. We're going to try experimentally reserving it, - to see if this breaks the web. - - * parser/Keywords.table: - -2012-01-27 Gavin Barraclough - - Implement a JIT-code aware sampling profiler for JSC - https://bugs.webkit.org/show_bug.cgi?id=76855 - - Reviewed by Oliver Hunt. - - To enable the profiler, set the JSC_CODE_PROFILING environment variable to - 1 (no tracing the C stack), 2 (trace one level of C code) or 3 (recursively - trace all samples). - - The profiler requires -fomit-frame-pointer to be removed from the build flags. - - * JavaScriptCore.exp: - - Removed an export. - * JavaScriptCore.xcodeproj/project.pbxproj: - - Added new files - * bytecode/CodeBlock.cpp: - - For baseline codeblocks, cache the result of canCompileWithDFG. - * bytecode/CodeBlock.h: - - For baseline codeblocks, cache the result of canCompileWithDFG. - * jit/ExecutableAllocator.cpp: - (JSC::ExecutableAllocator::initializeAllocator): - - Notify the profiler when the allocator is created. - (JSC::ExecutableAllocator::allocate): - - Inform the allocated of the ownerUID. - * jit/ExecutableAllocatorFixedVMPool.cpp: - (JSC::ExecutableAllocator::initializeAllocator): - - Notify the profiler when the allocator is created. - (JSC::ExecutableAllocator::allocate): - - Inform the allocated of the ownerUID. - * jit/JITStubs.cpp: - - If profiling, don't mask the return address in JIT code. - (We do so to provide nicer backtraces in debug builds). - * runtime/Completion.cpp: - (JSC::evaluate): - - Notify the profiler of script evaluations. - * tools: Added. - * tools/CodeProfile.cpp: Added. - (JSC::symbolName): - - Helper function to get the name of a symbol in the framework. - (JSC::truncateTrace): - - Helper to truncate traces into methods know to have uninformatively deep stacks. - (JSC::CodeProfile::sample): - - Record a stack trace classifying samples. - (JSC::CodeProfile::report): - - {Print profiler output. - * tools/CodeProfile.h: Added. - - new class, captures a set of samples associated with an evaluated script, - and nested to record samples from subscripts. - * tools/CodeProfiling.cpp: Added. - (JSC::CodeProfiling::profilingTimer): - - callback fired then a timer event occurs. - (JSC::CodeProfiling::notifyAllocator): - - called when the executable allocator is constructed. - (JSC::CodeProfiling::getOwnerUIDForPC): - - helper to lookup the codeblock from an address in JIT code - (JSC::CodeProfiling::begin): - - enter a profiling scope. - (JSC::CodeProfiling::end): - - exit a profiling scope. - * tools/CodeProfiling.h: Added. - - new class, instantialed from Completion to define a profiling scope. - * tools/ProfileTreeNode.h: Added. - - new class, used to construct a tree of samples. - * tools/TieredMMapArray.h: Added. - - new class, a malloc-free vector (can be used while the main thread is suspended, - possibly holding the malloc heap lock). - * wtf/MetaAllocator.cpp: - (WTF::MetaAllocatorHandle::MetaAllocatorHandle): - (WTF::MetaAllocator::allocate): - - Allow allocation handles to track information about their owner. - * wtf/MetaAllocator.h: - (MetaAllocator): - - Allow allocation handles to track information about their owner. - * wtf/MetaAllocatorHandle.h: - (MetaAllocatorHandle): - (WTF::MetaAllocatorHandle::ownerUID): - - Allow allocation handles to track information about their owner. - * wtf/OSAllocator.h: - (WTF::OSAllocator::reallocateCommitted): - - reallocate an existing, committed memory allocation. - -2012-01-28 Sheriff Bot - - Unreviewed, rolling out r106187. - http://trac.webkit.org/changeset/106187 - https://bugs.webkit.org/show_bug.cgi?id=77276 - - The last rollout was a false charge. (Requested by morrita on - #webkit). - - * runtime/ExceptionHelpers.h: - (InterruptedExecutionError): - * runtime/JSBoundFunction.h: - (JSBoundFunction): - * runtime/RegExp.h: - (RegExp): - * runtime/RegExpMatchesArray.h: - (RegExpMatchesArray): - -2012-01-28 Sheriff Bot - - Unreviewed, rolling out r106151. - http://trac.webkit.org/changeset/106151 - https://bugs.webkit.org/show_bug.cgi?id=77275 - - may break windows build (Requested by morrita on #webkit). - - * runtime/ExceptionHelpers.h: - (InterruptedExecutionError): - * runtime/JSBoundFunction.h: - (JSBoundFunction): - * runtime/RegExp.h: - (RegExp): - * runtime/RegExpMatchesArray.h: - (RegExpMatchesArray): - -2012-01-28 Filip Pizlo - - GC invoked while doing an old JIT property storage reallocation may lead - to an object that refers to a dead structure - https://bugs.webkit.org/show_bug.cgi?id=77273 - - - Reviewed by Gavin Barraclough. - - The put_by_id transition was already saving the old structure by virtue of - having the object on the stack, so that wasn't going to get deleted. But the - new structure was unprotected in the transition. I've now changed the - transition code to save the new structure, ensuring that the GC will know it - to be marked if invoked from within put_by_id_transition_realloc. - - * jit/JITPropertyAccess.cpp: - (JSC::JIT::privateCompilePutByIdTransition): - * jit/JITPropertyAccess32_64.cpp: - (JSC::JIT::privateCompilePutByIdTransition): - * jit/JITStubs.cpp: - (JSC::DEFINE_STUB_FUNCTION): - * jit/JITStubs.h: - (JSC): - (): - -2012-01-27 Sheriff Bot - - Unreviewed, rolling out r106167. - http://trac.webkit.org/changeset/106167 - https://bugs.webkit.org/show_bug.cgi?id=77264 - - broke LayoutTests/fast/js/string-capitalization.html - (Requested by msaboff on #webkit). - - * runtime/StringPrototype.cpp: - (JSC::stringProtoFuncToLowerCase): - (JSC::stringProtoFuncToUpperCase): - * wtf/text/StringImpl.cpp: - (WTF::StringImpl::upper): - -2012-01-27 Filip Pizlo - - Build fix for interpreter platforms. - - * interpreter/AbstractPC.cpp: - (JSC::AbstractPC::AbstractPC): - -2012-01-27 Michael Saboff - - StringProtoFuncToUpperCase should call StringImpl::upper similar to StringProtoToLowerCase - https://bugs.webkit.org/show_bug.cgi?id=76647 - - Reviewed by Geoffrey Garen. - - Changed stringProtoFuncToUpperCase to call StringImpl::upper() is a manor similar - to stringProtoFuncToLowerCase(). Fixed StringImpl::upper() to handle the two - 8 bit characters that when converted to upper case become 16 bit characters. - - * runtime/StringPrototype.cpp: - (JSC::stringProtoFuncToLowerCase): Removed extra trailing whitespace. - (JSC::stringProtoFuncToUpperCase): - * wtf/text/StringImpl.cpp: - (WTF::StringImpl::upper): - -2012-01-27 Hajime Morita - - [JSC] ThunkGenerators.cpp should hide its asm-defined symbols - https://bugs.webkit.org/show_bug.cgi?id=77244 - - Reviewed by Filip Pizlo. - - * jit/ThunkGenerators.cpp: Added HIDE_SYMBOLS() - * wtf/InlineASM.h: Moved some duplicated macros from ThunkGenerators.cpp - -2012-01-27 Simon Hausmann - - [JSC] Asm-originated symbols should be marked as hidden - https://bugs.webkit.org/show_bug.cgi?id=77150 - - Reviewed by Filip Pizlo. - - * dfg/DFGOperations.cpp: The HIDE_SYMBOLS macros were present in the CPU(ARM) preprocessor branches, - but they were missing in the CPU(X86) and the CPU(X86_64) cases. - -2012-01-27 MORITA Hajime - - [JSC] Some JS_EXPORTDATA may not be necessary. - https://bugs.webkit.org/show_bug.cgi?id=77145 - - Reviewed by Darin Adler. - - Removed JS_EXPORTDATA attributes whose attributing symbols are - not exported on Mac port. - - * runtime/ExceptionHelpers.h: - (InterruptedExecutionError): - * runtime/JSBoundFunction.h: - (JSBoundFunction): - * runtime/RegExp.h: - (RegExp): - * runtime/RegExpMatchesArray.h: - (RegExpMatchesArray): - -2012-01-27 MORITA Hajime - - [WTF] WTFString.h has some extra JS_EXPORT_PRIVATEs - https://bugs.webkit.org/show_bug.cgi?id=77113 - - Reviewed by Darin Adler. - - * wtf/text/WTFString.h: Removed some WTF_EXPORT_PRIVATE attributes which we don't need to export. - -2012-01-27 Zeno Albisser - - [Qt][Mac] Build fails after adding ICU support (r105997). - https://bugs.webkit.org/show_bug.cgi?id=77118 - - Use Apple code path for unicode date formats on mac. - - Reviewed by Tor Arne Vestbø. - - * runtime/DatePrototype.cpp: - (): - -2012-01-27 Carlos Garcia Campos - - [GTK] Add a GKeyFile especialization to GOwnPtr - https://bugs.webkit.org/show_bug.cgi?id=77191 - - Reviewed by Martin Robinson. - - * wtf/gobject/GOwnPtr.cpp: - (WTF::GKeyFile): Implement freeOwnedGPtr for GKeyFile. - * wtf/gobject/GOwnPtr.h: Add GKeyFile template. - * wtf/gobject/GTypedefs.h: Add forward declaration for GKeyFile. - -2012-01-25 Yury Semikhatsky - - Web Inspector: should be possible to open function declaration from script popover - https://bugs.webkit.org/show_bug.cgi?id=76913 - - Added display function name and source location to the popover in scripts panel. - Now when a function is hovered user can navigate to its definition. - - Reviewed by Pavel Feldman. - - * JavaScriptCore/JavaScriptCore.exp - * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def: - * runtime/JSFunction.h: - (JSFunction): - -2012-01-26 Kevin Ollivier - - [wx] Unreviewed. Build fix, wx uses the Mac ICU headers so we must match Mac behavior. - - * runtime/DatePrototype.cpp: - (): - -2012-01-26 Mark Hahnenberg - - Merge AllocationSpace into MarkedSpace - https://bugs.webkit.org/show_bug.cgi?id=77116 - - Reviewed by Geoffrey Garen. - - Merging AllocationSpace and MarkedSpace in preparation for future refactoring/enhancement to - MarkedSpace allocation. - - * CMakeLists.txt: - * GNUmakefile.list.am: - * JavaScriptCore.exp: - * JavaScriptCore.gypi: - * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def: - * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj: - * JavaScriptCore.xcodeproj/project.pbxproj: - * Target.pri: - * heap/AllocationSpace.cpp: Removed. - * heap/AllocationSpace.h: Removed. - * heap/BumpSpace.h: - (BumpSpace): - * heap/Heap.h: - (JSC::Heap::objectSpace): - (Heap): - (): - * heap/HeapBlock.h: - (): - * heap/MarkedSpace.cpp: - (JSC::MarkedSpace::tryAllocateHelper): - (JSC): - (JSC::MarkedSpace::tryAllocate): - (JSC::MarkedSpace::allocateSlowCase): - (JSC::MarkedSpace::allocateBlock): - (JSC::MarkedSpace::freeBlocks): - (TakeIfUnmarked): - (JSC::TakeIfUnmarked::TakeIfUnmarked): - (JSC::TakeIfUnmarked::operator()): - (JSC::TakeIfUnmarked::returnValue): - (JSC::MarkedSpace::shrink): - (GatherDirtyCells): - (JSC::GatherDirtyCells::returnValue): - (JSC::GatherDirtyCells::GatherDirtyCells): - (JSC::GatherDirtyCells::operator()): - (JSC::MarkedSpace::gatherDirtyCells): - * heap/MarkedSpace.h: - (MarkedSpace): - (JSC::MarkedSpace::blocks): - (JSC::MarkedSpace::forEachCell): - (JSC): - (JSC::MarkedSpace::allocate): - -2012-01-26 Oliver Hunt - - MSVC bug fix. - MSVC generates bad code for enum compare. - - RS=Geoff - - Make bitfield large enough to work around MSVC's desire to make enums - signed types. - - * bytecode/CallLinkInfo.h: - (CallLinkInfo): - -2012-01-26 Filip Pizlo - - All DFG helpers that may call out to arbitrary JS code must know where they - were called from due to inlining and call stack walking - https://bugs.webkit.org/show_bug.cgi?id=77070 - - - Reviewed by Geoff Garen. - - Changed the DFG to always record a code origin index in the tag of the argument - count (which we previously left blank for the benefit of LLInt, but is still - otherwise unused by the DFG), so that if we ever need to walk the stack accurately - we know where to start. In particular, if the current ExecState* points several - semantic call frames away from the true semantic call frame because we had - performed inlining, having the code origin index recorded means that we can reify - those call frames as necessary to give runtime/library code an accurate view of - the current JS state. - - This required several large but mechanical changes: - - - Calling a function from the DFG now plants a store32 instruction to store the - code origin index. But the indices of code origins were previously picked by - the DFG::JITCompiler after code generation completed. I changed this somewhat; - even though the code origins are put into the CodeBlock after code gen, the - code gen now knows a priori what their indices will be. Extensive assertions - are in place to ensure that the two don't get out of sync, in the form of the - DFG::CallBeginToken. Note that this mechanism has almost no effect on JS calls; - those don't need the code origin index set in the call frame because we can get - it by doing a binary search on the return PC. - - - Stack walking now always calls trueCallFrame() first before beginning the walk, - since even the top call frame may be wrong. It still calls trueCallerFrame() as - before to get to the next frame, though trueCallerFrame() is now mostly a - wrapper around callerFrame()->trueCallFrame(). - - - Because the mechanism for getting the code origin of a call frame is bimodal - (either the call frame knows its code origin because the code origin index was - set, or it's necessary to use the callee frame's return PC), I put in extra - mechanisms to determine whether your caller, or your callee, corresponds to - a call out of C++ code. Previously we just had the host call flag, but this is - insufficient as it does not cover the case of someone calling JSC::call(). But - luckily we can determine this just by looking at the return PC: if the return - PC is in range of the ctiTrampiline, then two things are true: this call - frame's PC will tell you nothing about where you came from in your caller, and - the caller already knows where it's at because it must have set the code origin - index (unless it's not DFG code, in which case we don't care because there is - no inlining to worry about). - - - During testing this revealed a simple off-by-one goof in DFG::ByteCodeParser's - inlining code, so I fixed it. - - - Finally because I was tired of doing random #if's for checking if I should be - passing around an Instruction* or a ReturnAddressPtr, I created a class called - AbstractPC that holds whatever notion of a PC is appropriate for the current - execution environment. It's designed to work gracefully even if both the - interpreter and the JIT are compiled in, and should integrate nicely with the - LLInt. - - This is neutral on all benchmarks and fixes some nasty corner-case regressions of - evil code that uses combinations of getters/setters and function.arguments. - - * CMakeLists.txt: - * GNUmakefile.list.am: - * JavaScriptCore.exp: - * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def: - * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj: - * JavaScriptCore.xcodeproj/project.pbxproj: - * Target.pri: - * bytecode/CodeBlock.h: - (JSC::CodeBlock::codeOrigin): - (CodeBlock): - * dfg/DFGByteCodeParser.cpp: - (JSC::DFG::ByteCodeParser::handleInlining): - * dfg/DFGJITCompiler.cpp: - (JSC::DFG::JITCompiler::link): - * dfg/DFGJITCompiler.h: - (CallBeginToken): - (JSC::DFG::CallBeginToken::CallBeginToken): - (JSC::DFG::CallBeginToken::assertCodeOriginIndex): - (JSC::DFG::CallBeginToken::assertNoCodeOriginIndex): - (DFG): - (JSC::DFG::CallExceptionRecord::CallExceptionRecord): - (CallExceptionRecord): - (JSC::DFG::JITCompiler::JITCompiler): - (JITCompiler): - (JSC::DFG::JITCompiler::nextCallBeginToken): - (JSC::DFG::JITCompiler::beginCall): - (JSC::DFG::JITCompiler::notifyCall): - (JSC::DFG::JITCompiler::addExceptionCheck): - (JSC::DFG::JITCompiler::addFastExceptionCheck): - * dfg/DFGOperations.cpp: - (): - * dfg/DFGRepatch.cpp: - (JSC::DFG::tryBuildGetByIDList): - * dfg/DFGSpeculativeJIT.h: - (JSC::DFG::SpeculativeJIT::appendCallWithExceptionCheck): - * dfg/DFGSpeculativeJIT32_64.cpp: - (JSC::DFG::SpeculativeJIT::emitCall): - * dfg/DFGSpeculativeJIT64.cpp: - (JSC::DFG::SpeculativeJIT::emitCall): - * interpreter/AbstractPC.cpp: Added. - (JSC): - (JSC::AbstractPC::AbstractPC): - * interpreter/AbstractPC.h: Added. - (JSC): - (AbstractPC): - (JSC::AbstractPC::AbstractPC): - (JSC::AbstractPC::hasJITReturnAddress): - (JSC::AbstractPC::jitReturnAddress): - (JSC::AbstractPC::hasInterpreterReturnAddress): - (JSC::AbstractPC::interpreterReturnAddress): - (JSC::AbstractPC::isSet): - (JSC::AbstractPC::operator!): - (): - * interpreter/CallFrame.cpp: - (JSC): - (JSC::CallFrame::trueCallFrame): - (JSC::CallFrame::trueCallerFrame): - * interpreter/CallFrame.h: - (JSC::ExecState::abstractReturnPC): - (JSC::ExecState::codeOriginIndexForDFGWithInlining): - (ExecState): - (JSC::ExecState::trueCallFrame): - (JSC::ExecState::trueCallFrameFromVMCode): - * interpreter/Interpreter.cpp: - (JSC::Interpreter::retrieveArgumentsFromVMCode): - (JSC::Interpreter::retrieveCallerFromVMCode): - (JSC::Interpreter::findFunctionCallFrameFromVMCode): - * interpreter/Interpreter.h: - (Interpreter): - (): - * jit/JITStubs.cpp: - (JSC): - (): - * jit/JITStubs.h: - (JSC): - (JSC::returnAddressIsInCtiTrampoline): - * runtime/JSFunction.cpp: - (JSC::JSFunction::argumentsGetter): - (JSC::JSFunction::callerGetter): - (JSC::JSFunction::getOwnPropertyDescriptor): - -2012-01-26 Peter Varga - - Fix build when VERBOSE_SPECULATION_FAILURE is enabled in DFG - https://bugs.webkit.org/show_bug.cgi?id=77104 - - Reviewed by Filip Pizlo. - - * dfg/DFGOperations.cpp: - (): - -2012-01-26 Michael Saboff - - String::latin1() should take advantage of 8 bit strings - https://bugs.webkit.org/show_bug.cgi?id=76646 - - Reviewed by Geoffrey Garen. - - * wtf/text/WTFString.cpp: - (WTF::String::latin1): For 8 bit strings, use existing buffer - without conversion. - -2012-01-26 Michael Saboff - - Dromaeo tests usage of StringImpl find routines cause 8->16 bit conversions - https://bugs.webkit.org/show_bug.cgi?id=76645 - - Reviewed by Geoffrey Garen. - - * wtf/text/StringImpl.cpp: - (WTF::equalIgnoringCase): New LChar version. - (WTF::findInner): New helper function. - (WTF::StringImpl::find): Added 8 bit path. - (WTF::reverseFindInner): New helper funciton. - (WTF::StringImpl::reverseFind): Added 8 bit path. - (WTF::StringImpl::reverseFindIgnoringCase): Added 8 bit path. - * wtf/text/StringImpl.h: - (WTF): - -2012-01-26 Csaba Osztrogonác - - [Qt][Win] One more speculative buildfix after r105970. - - * JavaScriptCore.pri: - -2012-01-26 Csaba Osztrogonác - - [Qt][Win] Speculative buildfix after r105970. - - * JavaScriptCore.pri: Link lgdi for DeleteObject() and DeleteDC(). - -2012-01-26 Sheriff Bot - - Unreviewed, rolling out r105982. - http://trac.webkit.org/changeset/105982 - https://bugs.webkit.org/show_bug.cgi?id=77090 - - breaks the world (Requested by WildFox on #webkit). - - * wtf/MainThread.cpp: - (WTF): - * wtf/Platform.h: - * wtf/mac/MainThreadMac.mm: - (WTF): - (WTF::registerGCThread): - (WTF::isMainThreadOrGCThread): - -2012-01-26 Roland Takacs - - [Qt] GC should be parallel on Qt platform - https://bugs.webkit.org/show_bug.cgi?id=73309 - - Reviewed by Zoltan Herczeg. - - These changes made the parallel gc feature available for Qt port. - The implementation of "registerGCThread" and "isMainThreadOrGCThread" - is moved from MainThreadMac.mm to the common MainThread.cpp to make - them available for other platforms. - - Measurement results: - V8 speed-up: 1.071x as fast [From: 746.1ms To: 696.4ms ] - WindScorpion speed-up: 1.082x as fast [From: 3490.4ms To: 3226.7ms] - V8 Splay speed-up: 1.158x as fast [From: 145.8ms To: 125.9ms ] - - Tested on Intel(R) Core(TM) i5-2320 CPU @ 3.00GHz with 4-core. - - * wtf/MainThread.cpp: - (WTF): - (WTF::registerGCThread): - (WTF::isMainThreadOrGCThread): - * wtf/Platform.h: - * wtf/mac/MainThreadMac.mm: - -2012-01-26 Andy Estes - - REGRESSION (r105555): Incorrect use of OS() macro breaks OwnPtr when used with Win32 data types - https://bugs.webkit.org/show_bug.cgi?id=77073 - - Reviewed by Ryosuke Niwa. - - r105555 changed PLATFORM(WIN) to OS(WIN), but WTF_OS_WIN isn't defined. - This should have been changed to OS(WINDOWS). This causes the - preprocessor to strip out Win32 data type overrides for deleteOwnedPtr, - causing allocations made by Win32 to be deleted by fastmalloc. - - * wtf/OwnPtrCommon.h: - (WTF): Use OS(WINDOWS) instead of OS(WIN). - -2012-01-25 Mark Rowe - - Attempted Mac build fix after r105939. - - * runtime/DatePrototype.cpp: Don't #include unicode/udat.h on Mac or iOS. - It isn't used on these platforms and isn't available in the ICU headers - for Mac. - -2012-01-25 Mark Rowe - - Build in to an alternate location when USE_STAGING_INSTALL_PATH is set. - - Adopt USE_STAGING_INSTALL_PATH - - Reviewed by David Kilzer. - - * Configurations/Base.xcconfig: Define NORMAL_JAVASCRIPTCORE_FRAMEWORKS_DIR, which contains - the path where JavaScriptCore is normally installed. Update JAVASCRIPTCORE_FRAMEWORKS_DIR - to point to the staged frameworks directory when USE_STAGING_INSTALL_PATH is set. - * Configurations/JavaScriptCore.xcconfig: Always set the framework's install name based on - the normal framework location. This prevents an incorrect install name from being used when - installing in to the staged frameworks directory. - -2012-01-25 Eli Fidler - - Implement Date.toLocaleString() using ICU - https://bugs.webkit.org/show_bug.cgi?id=76714 - - Reviewed by Darin Adler. - - * runtime/DatePrototype.cpp: - (JSC::formatLocaleDate): - -2012-01-25 Hajime Morita - - ENABLE_SHADOW_DOM should be available via build-webkit --shadow-dom - https://bugs.webkit.org/show_bug.cgi?id=76863 - - Reviewed by Dimitri Glazkov. - - Added a feature flag. - - * Configurations/FeatureDefines.xcconfig: - -2012-01-25 Yong Li - - [BlackBerry] Implement OSAllocator::commit/decommit. - BlackBerry port should support virtual memory decommiting. - https://bugs.webkit.org/show_bug.cgi?id=77013 - - Reviewed by Rob Buis. - - * wtf/OSAllocatorPosix.cpp: - (WTF::OSAllocator::reserveUncommitted): - (WTF::OSAllocator::commit): - (WTF::OSAllocator::decommit): - * wtf/Platform.h: - -2012-01-24 Oliver Hunt - - Make DFG update topCallFrame - https://bugs.webkit.org/show_bug.cgi?id=76969 - - Reviewed by Filip Pizlo. - - Add NativeCallFrameTracer to manage topCallFrame assignment - in the DFG operations, and make use of it. - - * dfg/DFGOperations.cpp: - (JSC::DFG::operationPutByValInternal): - (): - * interpreter/Interpreter.h: - (JSC): - (NativeCallFrameTracer): - (JSC::NativeCallFrameTracer::NativeCallFrameTracer): - -2012-01-24 Filip Pizlo - - Inlining breaks call frame walking when the walking is done from outside the inlinee, - but inside a code block that had inlining - https://bugs.webkit.org/show_bug.cgi?id=76978 - - - Reviewed by Oliver Hunt. - - * bytecode/CodeBlock.h: - (JSC::CodeBlock::codeOriginForReturn): - * interpreter/CallFrame.cpp: - (JSC::CallFrame::trueCallerFrame): - -2012-01-24 Gavin Barraclough - - https://bugs.webkit.org/show_bug.cgi?id=76855 - Implement a JIT-code aware sampling profiler for JSC - - Reviewed by Oliver Hunt. - - Add support to MetaAllocator.cpp to track all live handles in a map, - allowing lookup based on any address within the allocation. - - * wtf/MetaAllocator.cpp: - (WTF::MetaAllocatorTracker::notify): - (WTF::MetaAllocatorTracker::release): - - Track live handle objects in a map. - (WTF::MetaAllocator::release): - - Removed support for handles with null m_allocator (no longer used). - - Notify the tracker of handles being released. - (WTF::MetaAllocatorHandle::~MetaAllocatorHandle): - - Moved functionality out into MetaAllocator::release. - (WTF::MetaAllocatorHandle::shrink): - - Removed support for handles with null m_allocator (no longer used). - (WTF::MetaAllocator::MetaAllocator): - - Initialize m_tracker. - (WTF::MetaAllocator::allocate): - - Notify the tracker of new allocations. - * wtf/MetaAllocator.h: - (WTF::MetaAllocatorTracker::find): - - Lookup a MetaAllocatorHandle based on an address inside the allocation. - (WTF::MetaAllocator::trackAllocations): - - Register a callback object to track allocation state. - * wtf/MetaAllocatorHandle.h: - - Remove unused createSelfManagedHandle/constructor. - (WTF::MetaAllocatorHandle::key): - - Added, for use in RedBlackTree. - -2012-01-24 Mark Hahnenberg - - Use copying collector for out-of-line JSObject property storage - https://bugs.webkit.org/show_bug.cgi?id=76665 - - Reviewed by Geoffrey Garen. - - * runtime/JSObject.cpp: - (JSC::JSObject::visitChildren): Changed to use copyAndAppend whenever the property storage is out-of-line. - Also added a temporary variable to avoid warnings from GCC. - (JSC::JSObject::allocatePropertyStorage): Changed to use tryAllocateStorage/tryReallocateStorage as opposed to - operator new. Also added a temporary variable to avoid warnings from GCC. - * runtime/JSObject.h: - -2012-01-24 Geoffrey Garen - - JSValue::toString() should return a JSString* instead of a UString - https://bugs.webkit.org/show_bug.cgi?id=76861 - - Fixed two failing layout tests after my last patch. - - Reviewed by Gavin Barraclough. - - * runtime/ArrayPrototype.cpp: - (JSC::arrayProtoFuncSort): Call value() after calling toString(), as - in all other cases. - - I missed this case because the JSString* type has a valid operator<, - so the compiler didn't complain. - -2012-01-24 Kenichi Ishibashi - - [V8] Add Uint8ClampedArray support - https://bugs.webkit.org/show_bug.cgi?id=76803 - - Reviewed by Kenneth Russell. - - * wtf/ArrayBufferView.h: - (WTF::ArrayBufferView::isUnsignedByteClampedArray): Added. - * wtf/Uint8ClampedArray.h: - (WTF::Uint8ClampedArray::isUnsignedByteClampedArray): Overridden to return true. - -2012-01-23 Carlos Garcia Campos - - [GTK] Add WebKitDownload to WebKit2 GTK+ API - https://bugs.webkit.org/show_bug.cgi?id=72949 - - Reviewed by Martin Robinson. - - * wtf/gobject/GOwnPtr.cpp: - (WTF::GTimer): Use g_timer_destroy() to free a GTimer. - * wtf/gobject/GOwnPtr.h: Add GTimer template. - * wtf/gobject/GTypedefs.h: Add GTimer forward declaration. - -2012-01-24 Ilya Tikhonovsky - - Unreviewed build fix for Qt LinuxSH4 build after r105698. - - * interpreter/Interpreter.cpp: - (JSC::Interpreter::privateExecute): - -2012-01-23 Geoffrey Garen - - JSValue::toString() should return a JSString* instead of a UString - https://bugs.webkit.org/show_bug.cgi?id=76861 - - Reviewed by Gavin Barraclough. - - This makes the common case -- toString() on a string -- faster and - inline-able. (Not a measureable speedup, but we can now remove a bunch - of duplicate hand-rolled code for this optimization.) - - This also clarifies the boundary between "C++ strings" and "JS strings". - - In all cases other than true, false, null, undefined, and multi-digit - numbers, the JS runtime was just retrieving a UString from a JSString, - so returning a JSString* is strictly better. In the other cases, we can - optimize to avoid creating a new JSString if we care to, but it doesn't - seem to be a big deal. - - * JavaScriptCore.exp: Export! - - * jsc.cpp: - (functionPrint): - (functionDebug): - (functionRun): - (functionLoad): - (functionCheckSyntax): - (runWithScripts): - (runInteractive): - * API/JSValueRef.cpp: - (JSValueToStringCopy): - * bytecode/CodeBlock.cpp: - (JSC::valueToSourceString): Call value() after calling toString(), to - convert from "JS string" (JSString*) to "C++ string" (UString), since - toString() no longer returns a "C++ string". - - * dfg/DFGOperations.cpp: - (JSC::DFG::operationValueAddNotNumber): - * jit/JITStubs.cpp: - (op_add): Updated for removal of toPrimitiveString(): - all '+' operands can use toString(), except for object operands, which - need to take a slow path to call toPrimitive(). - - * runtime/ArrayPrototype.cpp: - (JSC::arrayProtoFuncToString): - (JSC::arrayProtoFuncToLocaleString): - (JSC::arrayProtoFuncJoin): - (JSC::arrayProtoFuncPush): - * runtime/CommonSlowPaths.h: - (JSC::CommonSlowPaths::opIn): - * runtime/DateConstructor.cpp: - (JSC::dateParse): - * runtime/DatePrototype.cpp: - (JSC::formatLocaleDate): Call value() after calling toString(), as above. - - * runtime/ErrorInstance.h: - (JSC::ErrorInstance::create): Simplified down to one canonical create() - function, to make string handling easier. - - * runtime/ErrorPrototype.cpp: - (JSC::errorProtoFuncToString): - * runtime/ExceptionHelpers.cpp: - (JSC::createInvalidParamError): - (JSC::createNotAConstructorError): - (JSC::createNotAFunctionError): - (JSC::createNotAnObjectError): - * runtime/FunctionConstructor.cpp: - (JSC::constructFunctionSkippingEvalEnabledCheck): - * runtime/FunctionPrototype.cpp: - (JSC::functionProtoFuncBind): - * runtime/JSArray.cpp: - (JSC::JSArray::sort): Call value() after calling toString(), as above. - - * runtime/JSCell.cpp: - * runtime/JSCell.h: Removed JSCell::toString() because JSValue does this - job now. Doing it in JSCell is slower (requires extra type checking), and - creates the misimpression that language-defined toString() behavior is - an implementation detail of JSCell. - - * runtime/JSGlobalObjectFunctions.cpp: - (JSC::encode): - (JSC::decode): - (JSC::globalFuncEval): - (JSC::globalFuncParseInt): - (JSC::globalFuncParseFloat): - (JSC::globalFuncEscape): - (JSC::globalFuncUnescape): Call value() after calling toString(), as above. - - * runtime/JSONObject.cpp: - (JSC::unwrapBoxedPrimitive): - (JSC::Stringifier::Stringifier): - (JSC::JSONProtoFuncParse): Removed some manual optimization that toString() - takes care of. - - * runtime/JSObject.cpp: - (JSC::JSObject::toString): - * runtime/JSObject.h: Updated to return JSString*. - - * runtime/JSString.cpp: - * runtime/JSString.h: - (JSC::JSValue::toString): Removed, since I removed JSCell::toString(). - - * runtime/JSValue.cpp: - (JSC::JSValue::toStringSlowCase): Removed toPrimitiveString(), and re- - spawned toStringSlowCase() from its zombie corpse, since toPrimitiveString() - basically did what we want all the time. (Note that the toPrimitive() - preference changes from NoPreference to PreferString, because that's - how ToString is defined in the language. op_add does not want this behavior.) - - * runtime/NumberPrototype.cpp: - (JSC::numberProtoFuncToString): - (JSC::numberProtoFuncToLocaleString): A little simpler, now that toString() - returns a JSString*. - - * runtime/ObjectConstructor.cpp: - (JSC::objectConstructorGetOwnPropertyDescriptor): - (JSC::objectConstructorDefineProperty): - * runtime/ObjectPrototype.cpp: - (JSC::objectProtoFuncHasOwnProperty): - (JSC::objectProtoFuncDefineGetter): - (JSC::objectProtoFuncDefineSetter): - (JSC::objectProtoFuncLookupGetter): - (JSC::objectProtoFuncLookupSetter): - (JSC::objectProtoFuncPropertyIsEnumerable): More calls to value(), as above. - - * runtime/Operations.cpp: - (JSC::jsAddSlowCase): Need to check for object before taking the toString() - fast path becuase adding an object to a string requires calling toPrimitive() - on the object, not toString(). (They differ in their preferred conversion - type.) - - * runtime/Operations.h: - (JSC::jsString): - (JSC::jsStringFromArguments): This code gets simpler, now that toString() - does the right thing. - - (JSC::jsAdd): Now checks for object, just like jsAddSlowCase(). - - * runtime/RegExpConstructor.cpp: - (JSC::setRegExpConstructorInput): - (JSC::constructRegExp): - * runtime/RegExpObject.cpp: - (JSC::RegExpObject::match): - * runtime/RegExpPrototype.cpp: - (JSC::regExpProtoFuncCompile): - (JSC::regExpProtoFuncToString): More calls to value(), as above. - - * runtime/StringConstructor.cpp: - (JSC::constructWithStringConstructor): - (JSC::callStringConstructor): This code gets simpler, now that toString() - does the right thing. - - * runtime/StringPrototype.cpp: - (JSC::replaceUsingRegExpSearch): - (JSC::replaceUsingStringSearch): - (JSC::stringProtoFuncReplace): - (JSC::stringProtoFuncCharAt): - (JSC::stringProtoFuncCharCodeAt): - (JSC::stringProtoFuncConcat): - (JSC::stringProtoFuncIndexOf): - (JSC::stringProtoFuncLastIndexOf): - (JSC::stringProtoFuncMatch): - (JSC::stringProtoFuncSearch): - (JSC::stringProtoFuncSlice): - (JSC::stringProtoFuncSplit): - (JSC::stringProtoFuncSubstr): - (JSC::stringProtoFuncSubstring): - (JSC::stringProtoFuncToLowerCase): - (JSC::stringProtoFuncToUpperCase): - (JSC::stringProtoFuncLocaleCompare): - (JSC::stringProtoFuncBig): - (JSC::stringProtoFuncSmall): - (JSC::stringProtoFuncBlink): - (JSC::stringProtoFuncBold): - (JSC::stringProtoFuncFixed): - (JSC::stringProtoFuncItalics): - (JSC::stringProtoFuncStrike): - (JSC::stringProtoFuncSub): - (JSC::stringProtoFuncSup): - (JSC::stringProtoFuncFontcolor): - (JSC::stringProtoFuncFontsize): - (JSC::stringProtoFuncAnchor): - (JSC::stringProtoFuncLink): - (JSC::trimString): Some of this code gets simpler, now that toString() - does the right thing. More calls to value(), as above. - -2012-01-23 Luke Macpherson - - Unreviewed, rolling out r105676. - http://trac.webkit.org/changeset/105676 - https://bugs.webkit.org/show_bug.cgi?id=76665 - - Breaks build on max due to compile warnings. - - * runtime/JSObject.cpp: - (JSC::JSObject::finalize): - (JSC::JSObject::visitChildren): - (JSC::JSObject::allocatePropertyStorage): - * runtime/JSObject.h: - -2012-01-23 Mark Hahnenberg - - Use copying collector for out-of-line JSObject property storage - https://bugs.webkit.org/show_bug.cgi?id=76665 - - Reviewed by Geoffrey Garen. - - * runtime/JSObject.cpp: - (JSC::JSObject::visitChildren): Changed to use copyAndAppend whenever the property storage is out-of-line. - (JSC::JSObject::allocatePropertyStorage): Changed to use tryAllocateStorage/tryReallocateStorage as opposed to - operator new. - * runtime/JSObject.h: - -2012-01-23 Brian Weinstein - - More build fixing after r105646. - - * JavaScriptCore.exp: - -2012-01-23 Gavin Barraclough - - https://bugs.webkit.org/show_bug.cgi?id=76855 - Implement a JIT-code aware sampling profiler for JSC - - Reviewed by Geoff Garen. - - Step 2: generalize RedBlackTree. The profiler is going to want tio use - a RedBlackTree, allow this class to work with subclasses of - RedBlackTree::Node, Node should not need to know the names of the m_key - and m_value fields (the subclass can provide a key() accessor), and - RedBlackTree does not need to know anything about ValueType. - - * JavaScriptCore.exp: - * wtf/MetaAllocator.cpp: - (WTF::MetaAllocator::findAndRemoveFreeSpace): - (WTF::MetaAllocator::debugFreeSpaceSize): - (WTF::MetaAllocator::addFreeSpace): - * wtf/MetaAllocator.h: - (WTF::MetaAllocator::FreeSpaceNode::FreeSpaceNode): - (WTF::MetaAllocator::FreeSpaceNode::key): - * wtf/MetaAllocatorHandle.h: - (WTF::MetaAllocatorHandle::key): - * wtf/RedBlackTree.h: - (WTF::RedBlackTree::Node::successor): - (WTF::RedBlackTree::Node::predecessor): - (WTF::RedBlackTree::Node::parent): - (WTF::RedBlackTree::Node::setParent): - (WTF::RedBlackTree::Node::left): - (WTF::RedBlackTree::Node::setLeft): - (WTF::RedBlackTree::Node::right): - (WTF::RedBlackTree::Node::setRight): - (WTF::RedBlackTree::insert): - (WTF::RedBlackTree::remove): - (WTF::RedBlackTree::findExact): - (WTF::RedBlackTree::findLeastGreaterThanOrEqual): - (WTF::RedBlackTree::findGreatestLessThanOrEqual): - (WTF::RedBlackTree::first): - (WTF::RedBlackTree::last): - (WTF::RedBlackTree::size): - (WTF::RedBlackTree::treeMinimum): - (WTF::RedBlackTree::treeMaximum): - (WTF::RedBlackTree::treeInsert): - (WTF::RedBlackTree::leftRotate): - (WTF::RedBlackTree::rightRotate): - (WTF::RedBlackTree::removeFixup): - -2012-01-23 Andy Estes - - Fix the build after r105635. - - * JavaScriptCore.exp: - -2012-01-23 Mark Hahnenberg - - Remove StackBounds from JSGlobalData - https://bugs.webkit.org/show_bug.cgi?id=76310 - - Reviewed by Sam Weinig. - - Removed StackBounds and the stack() function from JSGlobalData since it no - longer accessed any members of JSGlobalData. - - * bytecompiler/BytecodeGenerator.cpp: - (JSC::BytecodeGenerator::BytecodeGenerator): - * heap/MachineStackMarker.cpp: - (JSC::MachineThreads::addCurrentThread): - (JSC::MachineThreads::gatherFromCurrentThread): - * parser/Parser.cpp: - (JSC::::Parser): - * runtime/JSGlobalData.cpp: - (JSC::JSGlobalData::JSGlobalData): - * runtime/JSGlobalData.h: - -2012-01-23 Gavin Barraclough - - Implement a JIT-code aware sampling profiler for JSC - https://bugs.webkit.org/show_bug.cgi?id=76855 - - Rubber stanmped by Geoff Garen. - - Mechanical change - pass CodeBlock through to the executable allocator, - such that we will be able to map ranges of JIT code back to their owner. - - * assembler/ARMAssembler.cpp: - (JSC::ARMAssembler::executableCopy): - * assembler/ARMAssembler.h: - * assembler/AssemblerBuffer.h: - (JSC::AssemblerBuffer::executableCopy): - * assembler/AssemblerBufferWithConstantPool.h: - (JSC::AssemblerBufferWithConstantPool::executableCopy): - * assembler/LinkBuffer.h: - (JSC::LinkBuffer::LinkBuffer): - (JSC::LinkBuffer::linkCode): - * assembler/MIPSAssembler.h: - (JSC::MIPSAssembler::executableCopy): - * assembler/SH4Assembler.h: - (JSC::SH4Assembler::executableCopy): - * assembler/X86Assembler.h: - (JSC::X86Assembler::executableCopy): - (JSC::X86Assembler::X86InstructionFormatter::executableCopy): - * dfg/DFGJITCompiler.cpp: - (JSC::DFG::JITCompiler::compile): - (JSC::DFG::JITCompiler::compileFunction): - * dfg/DFGOSRExitCompiler.cpp: - * dfg/DFGRepatch.cpp: - (JSC::DFG::generateProtoChainAccessStub): - (JSC::DFG::tryCacheGetByID): - (JSC::DFG::tryBuildGetByIDList): - (JSC::DFG::tryCachePutByID): - * dfg/DFGThunks.cpp: - (JSC::DFG::osrExitGenerationThunkGenerator): - * jit/ExecutableAllocator.cpp: - (JSC::ExecutableAllocator::allocate): - * jit/ExecutableAllocator.h: - * jit/ExecutableAllocatorFixedVMPool.cpp: - (JSC::ExecutableAllocator::allocate): - * jit/JIT.cpp: - (JSC::JIT::privateCompile): - * jit/JITOpcodes.cpp: - (JSC::JIT::privateCompileCTIMachineTrampolines): - * jit/JITOpcodes32_64.cpp: - (JSC::JIT::privateCompileCTIMachineTrampolines): - (JSC::JIT::privateCompileCTINativeCall): - * jit/JITPropertyAccess.cpp: - (JSC::JIT::stringGetByValStubGenerator): - (JSC::JIT::privateCompilePutByIdTransition): - (JSC::JIT::privateCompilePatchGetArrayLength): - (JSC::JIT::privateCompileGetByIdProto): - (JSC::JIT::privateCompileGetByIdSelfList): - (JSC::JIT::privateCompileGetByIdProtoList): - (JSC::JIT::privateCompileGetByIdChainList): - (JSC::JIT::privateCompileGetByIdChain): - * jit/JITPropertyAccess32_64.cpp: - (JSC::JIT::stringGetByValStubGenerator): - (JSC::JIT::privateCompilePutByIdTransition): - (JSC::JIT::privateCompilePatchGetArrayLength): - (JSC::JIT::privateCompileGetByIdProto): - (JSC::JIT::privateCompileGetByIdSelfList): - (JSC::JIT::privateCompileGetByIdProtoList): - (JSC::JIT::privateCompileGetByIdChainList): - (JSC::JIT::privateCompileGetByIdChain): - * jit/JITStubs.cpp: - * jit/SpecializedThunkJIT.h: - (JSC::SpecializedThunkJIT::finalize): - * yarr/YarrJIT.cpp: - (JSC::Yarr::YarrGenerator::compile): - -2012-01-23 Xianzhu Wang - - Basic enhancements to StringBuilder - https://bugs.webkit.org/show_bug.cgi?id=67081 - - This change contains the following enhancements to StringBuilder, - for convenience, performance, testability, etc.: - - Change toStringPreserveCapacity() to const - - new public methods: capacity(), swap(), toAtomicString(), canShrink() - and append(const StringBuilder&) - - == and != opearators to compare StringBuilders and a StringBuilder/String - - Unit tests: Tools/TestWebKitAPI/Tests/WTF/StringBuilder.cpp - - Reviewed by Darin Adler. - - * JavaScriptCore.exp: - * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def: - * wtf/text/AtomicString.cpp: - (WTF::SubstringTranslator::hash): - (WTF::SubstringTranslator::equal): - (WTF::SubstringTranslator::translate): - (WTF::AtomicString::add): - (WTF::AtomicString::addSlowCase): - * wtf/text/AtomicString.h: - (WTF::AtomicString::AtomicString): - (WTF::AtomicString::add): - * wtf/text/StringBuilder.cpp: - (WTF::StringBuilder::reifyString): - (WTF::StringBuilder::resize): - (WTF::StringBuilder::canShrink): - (WTF::StringBuilder::shrinkToFit): - * wtf/text/StringBuilder.h: - (WTF::StringBuilder::append): - (WTF::StringBuilder::toString): - (WTF::StringBuilder::toStringPreserveCapacity): - (WTF::StringBuilder::toAtomicString): - (WTF::StringBuilder::isEmpty): - (WTF::StringBuilder::capacity): - (WTF::StringBuilder::is8Bit): - (WTF::StringBuilder::swap): - (WTF::equal): - (WTF::operator==): - (WTF::operator!=): - * wtf/text/StringImpl.h: - -2012-01-23 Carlos Garcia Campos - - Unreviewed. Fix make distcheck. - - * GNUmakefile.list.am: Add missing files, remove deleted files and - fix indentation. - -2012-01-22 Filip Pizlo - - Build fix for non-DFG platforms that error out on warn-unused-parameter. - - * bytecode/CallLinkStatus.cpp: - (JSC::CallLinkStatus::computeFor): - * bytecode/GetByIdStatus.cpp: - (JSC::GetByIdStatus::computeFor): - * bytecode/MethodCallLinkStatus.cpp: - (JSC::MethodCallLinkStatus::computeFor): - * bytecode/PutByIdStatus.cpp: - (JSC::PutByIdStatus::computeFor): - -2012-01-22 Filip Pizlo - - Build fix for non-DFG platforms. - - * bytecode/CallLinkStatus.cpp: - (JSC::CallLinkStatus::computeFor): - * bytecode/GetByIdStatus.cpp: - (JSC::GetByIdStatus::computeFor): - * bytecode/MethodCallLinkStatus.cpp: - (JSC::MethodCallLinkStatus::computeFor): - * bytecode/PutByIdStatus.cpp: - (JSC::PutByIdStatus::computeFor): - -2012-01-20 Filip Pizlo - - DFG should not have code that directly decodes the states of old JIT inline - cache data structures - https://bugs.webkit.org/show_bug.cgi?id=76768 - - Reviewed by Sam Weinig. - - Introduced new classes (like GetByIdStatus) that encapsulate the set of things - that the DFG would like to know about property accesses and calls. Whereas it - previously got this information by directly decoding the data structures used - by the old JIT for inline caching, it now uses these classes, which do the work - for it. This should make it somewhat more straight forward to introduce new - ways of profiling the same information. - - Also hoisted StructureSet into bytecode/ from dfg/, because it's now used by - code in bytecode/. - - Making this work right involved carefully ensuring that the heuristics for - choosing how to handle property accesses was at least as good as what we had - before, since I completely restructured that code. Currently the performance - looks neutral. Since I rewrote the code I did change some things that I never - liked before, like previously if a put_bu_id had executed exactly once then - we'd compile it as if it had taken slow-path. Executing once is special because - then the inline cache is not baked in, so there is no information about how the - DFG should optimize the code. Now this is rationalized: if the put_by_id does - not offer enough information to be optimized (i.e. had executed 0 or 1 times) - then we turn it into a forced OSR exit (i.e. a patch point). However, get_by_id - still has the old behavior; I left it that way because I didn't want to make - too many changes at once. - - * CMakeLists.txt: - * GNUmakefile.list.am: - * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj: - * JavaScriptCore.xcodeproj/project.pbxproj: - * Target.pri: - * bytecode/CallLinkStatus.cpp: Added. - (JSC::CallLinkStatus::computeFor): - * bytecode/CallLinkStatus.h: Added. - (JSC::CallLinkStatus::CallLinkStatus): - (JSC::CallLinkStatus::isSet): - (JSC::CallLinkStatus::operator!): - (JSC::CallLinkStatus::couldTakeSlowPath): - (JSC::CallLinkStatus::callTarget): - * bytecode/GetByIdStatus.cpp: Added. - (JSC::GetByIdStatus::computeFor): - * bytecode/GetByIdStatus.h: Added. - (JSC::GetByIdStatus::GetByIdStatus): - (JSC::GetByIdStatus::state): - (JSC::GetByIdStatus::isSet): - (JSC::GetByIdStatus::operator!): - (JSC::GetByIdStatus::isSimpleDirect): - (JSC::GetByIdStatus::takesSlowPath): - (JSC::GetByIdStatus::makesCalls): - (JSC::GetByIdStatus::structureSet): - (JSC::GetByIdStatus::offset): - * bytecode/MethodCallLinkStatus.cpp: Added. - (JSC::MethodCallLinkStatus::computeFor): - * bytecode/MethodCallLinkStatus.h: Added. - (JSC::MethodCallLinkStatus::MethodCallLinkStatus): - (JSC::MethodCallLinkStatus::isSet): - (JSC::MethodCallLinkStatus::operator!): - (JSC::MethodCallLinkStatus::needsPrototypeCheck): - (JSC::MethodCallLinkStatus::structure): - (JSC::MethodCallLinkStatus::prototypeStructure): - (JSC::MethodCallLinkStatus::function): - (JSC::MethodCallLinkStatus::prototype): - * bytecode/PutByIdStatus.cpp: Added. - (JSC::PutByIdStatus::computeFor): - * bytecode/PutByIdStatus.h: Added. - (JSC::PutByIdStatus::PutByIdStatus): - (JSC::PutByIdStatus::state): - (JSC::PutByIdStatus::isSet): - (JSC::PutByIdStatus::operator!): - (JSC::PutByIdStatus::isSimpleReplace): - (JSC::PutByIdStatus::isSimpleTransition): - (JSC::PutByIdStatus::takesSlowPath): - (JSC::PutByIdStatus::oldStructure): - (JSC::PutByIdStatus::newStructure): - (JSC::PutByIdStatus::structureChain): - (JSC::PutByIdStatus::offset): - * bytecode/StructureSet.h: Added. - (JSC::StructureSet::StructureSet): - (JSC::StructureSet::clear): - (JSC::StructureSet::add): - (JSC::StructureSet::addAll): - (JSC::StructureSet::remove): - (JSC::StructureSet::contains): - (JSC::StructureSet::isSubsetOf): - (JSC::StructureSet::isSupersetOf): - (JSC::StructureSet::size): - (JSC::StructureSet::at): - (JSC::StructureSet::operator[]): - (JSC::StructureSet::last): - (JSC::StructureSet::predictionFromStructures): - (JSC::StructureSet::operator==): - (JSC::StructureSet::dump): - * dfg/DFGAbstractValue.h: - * dfg/DFGByteCodeParser.cpp: - (JSC::DFG::ByteCodeParser::handleCall): - (JSC::DFG::ByteCodeParser::parseBlock): - * dfg/DFGStructureSet.h: Removed. - -2012-01-20 Filip Pizlo - - JIT compilation should not require ExecState - https://bugs.webkit.org/show_bug.cgi?id=76729 - - - Reviewed by Gavin Barraclough. - - Changed the relevant JIT driver functions to take JSGlobalData& instead of - ExecState*, since really they just needed the global data. - - * dfg/DFGDriver.cpp: - (JSC::DFG::compile): - (JSC::DFG::tryCompile): - (JSC::DFG::tryCompileFunction): - * dfg/DFGDriver.h: - (JSC::DFG::tryCompile): - (JSC::DFG::tryCompileFunction): - * jit/JITDriver.h: - (JSC::jitCompileIfAppropriate): - (JSC::jitCompileFunctionIfAppropriate): - * runtime/Executable.cpp: - (JSC::EvalExecutable::compileInternal): - (JSC::ProgramExecutable::compileInternal): - (JSC::FunctionExecutable::compileForCallInternal): - (JSC::FunctionExecutable::compileForConstructInternal): - -2012-01-20 David Levin - - Make OwnPtr work for the Chromium Windows port. - https://bugs.webkit.org/show_bug.cgi?id=76738 - - Reviewed by Jian Li. - - * JavaScriptCore.gyp/JavaScriptCore.gyp: Added OwnPtrWin.cpp to the - Chromium Windows build. - * wtf/OwnPtrCommon.h: Changed from platform WIN to OS WIN for - OwnPtr and similar constructs. - -2012-01-19 Geoffrey Garen - - Removed some regexp entry boilerplate code - https://bugs.webkit.org/show_bug.cgi?id=76687 - - Reviewed by Darin Adler. - - 1% - 2% speedup on regexp tests, no change overall. - - * runtime/RegExp.cpp: - (JSC::RegExp::match): - - ASSERT that our startIndex is non-negative, because anything less - would be uncivilized. - - - ASSERT that our input is not the null string for the same reason. - - - No need to test for startOffset being past the end of the string, - since the regular expression engine will do this test for us. - - - No need to initialize the output vector, since the regular expression - engine will fill it in for us. - - * yarr/YarrInterpreter.cpp: - (JSC::Yarr::Interpreter::interpret): - * yarr/YarrJIT.cpp: - (JSC::Yarr::YarrGenerator::compile): - - RegExp used to do these jobs for us, but now we do them for ourselves - because it's a better separation of concerns, and the JIT can do them - more efficiently than C++ code: - - - Test for "past the end" before doing any matching -- otherwise - a* will match with zero length past the end of the string, which is wrong. - - - Initialize the output vector before doing any matching. - -2012-01-20 Filip Pizlo - - Build fix for no-DFG configuration. - Needed for . - - * bytecompiler/BytecodeGenerator.cpp: - (JSC::BytecodeGenerator::emitProfiledOpcode): - * jit/JIT.h: - (JSC::JIT::emitValueProfilingSite): - -2012-01-19 Filip Pizlo - - Bytecode instructions that may have value profiling should have a direct inline - link to the ValueProfile instance - https://bugs.webkit.org/show_bug.cgi?id=76682 - - - Reviewed by Sam Weinig. - - Each opcode that gets value profiled now has a link to its ValueProfile. This - required rationalizing the emission of value profiles for opcode combos, like - op_method_check/op_get_by_id and op_call/op_call_put_result. It only makes - sense for one of them to have a value profile link, and it makes most sense - for it to be the one that actually sets the result. The previous behavior was - to have op_method_check profile for op_get_by_id when they were used together, - but otherwise for op_get_by_id to have its own profiles. op_call already did - the right thing; all profiling was done by op_call_put_result. - - But rationalizing this code required breaking some of the natural boundaries - that the code had; for instance the code in DFG that emits a GetById in place - of both op_method_check and op_get_by_id must now know that it's the latter of - those that has the value profile, while the first of those constitutes the OSR - target. Hence each CodeOrigin must now have two bytecode indices - one for - OSR exit and one for profiling. - - Finally this change required some refiddling of our optimization heuristics, - because now all code blocks have "more instructions" due to the value profile - slots. - - * bytecode/CodeBlock.cpp: - (JSC::CodeBlock::printGetByIdOp): - (JSC::CodeBlock::dump): - * bytecode/CodeBlock.h: - (JSC::CodeBlock::valueProfileForBytecodeOffset): - * bytecode/CodeOrigin.h: - (JSC::CodeOrigin::CodeOrigin): - (JSC::CodeOrigin::bytecodeIndexForValueProfile): - * bytecode/Instruction.h: - (JSC::Instruction::Instruction): - * bytecode/Opcode.h: - * bytecompiler/BytecodeGenerator.cpp: - (JSC::BytecodeGenerator::emitProfiledOpcode): - (JSC::BytecodeGenerator::emitResolve): - (JSC::BytecodeGenerator::emitGetScopedVar): - (JSC::BytecodeGenerator::emitResolveBase): - (JSC::BytecodeGenerator::emitResolveBaseForPut): - (JSC::BytecodeGenerator::emitResolveWithBase): - (JSC::BytecodeGenerator::emitResolveWithThis): - (JSC::BytecodeGenerator::emitGetById): - (JSC::BytecodeGenerator::emitGetByVal): - (JSC::BytecodeGenerator::emitCall): - (JSC::BytecodeGenerator::emitCallVarargs): - (JSC::BytecodeGenerator::emitConstruct): - * bytecompiler/BytecodeGenerator.h: - * dfg/DFGByteCodeParser.cpp: - (JSC::DFG::ByteCodeParser::ByteCodeParser): - (JSC::DFG::ByteCodeParser::currentCodeOrigin): - (JSC::DFG::ByteCodeParser::addCall): - (JSC::DFG::ByteCodeParser::getPredictionWithoutOSRExit): - (JSC::DFG::ByteCodeParser::getPrediction): - (JSC::DFG::ByteCodeParser::handleCall): - (JSC::DFG::ByteCodeParser::handleInlining): - (JSC::DFG::ByteCodeParser::parseBlock): - (JSC::DFG::ByteCodeParser::parse): - * dfg/DFGGraph.h: - (JSC::DFG::Graph::valueProfileFor): - * jit/JIT.h: - (JSC::JIT::emitValueProfilingSite): - * jit/JITCall.cpp: - (JSC::JIT::emit_op_call_put_result): - * jit/JITCall32_64.cpp: - (JSC::JIT::emit_op_call_put_result): - * jit/JITInlineMethods.h: - (JSC::JIT::emitValueProfilingSite): - * jit/JITOpcodes.cpp: - (JSC::JIT::emit_op_resolve): - (JSC::JIT::emit_op_resolve_base): - (JSC::JIT::emit_op_resolve_skip): - (JSC::JIT::emit_op_resolve_global): - (JSC::JIT::emitSlow_op_resolve_global): - (JSC::JIT::emit_op_resolve_with_base): - (JSC::JIT::emit_op_resolve_with_this): - (JSC::JIT::emitSlow_op_resolve_global_dynamic): - * jit/JITOpcodes32_64.cpp: - (JSC::JIT::emit_op_resolve): - (JSC::JIT::emit_op_resolve_base): - (JSC::JIT::emit_op_resolve_skip): - (JSC::JIT::emit_op_resolve_global): - (JSC::JIT::emitSlow_op_resolve_global): - (JSC::JIT::emit_op_resolve_with_base): - (JSC::JIT::emit_op_resolve_with_this): - * jit/JITPropertyAccess.cpp: - (JSC::JIT::emit_op_get_by_val): - (JSC::JIT::emitSlow_op_get_by_val): - (JSC::JIT::emit_op_method_check): - (JSC::JIT::emitSlow_op_method_check): - (JSC::JIT::emit_op_get_by_id): - (JSC::JIT::emitSlow_op_get_by_id): - (JSC::JIT::emit_op_get_scoped_var): - (JSC::JIT::emit_op_get_global_var): - * jit/JITPropertyAccess32_64.cpp: - (JSC::JIT::emit_op_method_check): - (JSC::JIT::emitSlow_op_method_check): - (JSC::JIT::emit_op_get_by_val): - (JSC::JIT::emitSlow_op_get_by_val): - (JSC::JIT::emit_op_get_by_id): - (JSC::JIT::emitSlow_op_get_by_id): - (JSC::JIT::emit_op_get_scoped_var): - (JSC::JIT::emit_op_get_global_var): - * jit/JITStubCall.h: - (JSC::JITStubCall::callWithValueProfiling): - * runtime/Options.cpp: - (JSC::Options::initializeOptions): - -2012-01-20 ChangSeok Oh - - undefined reference to symbol eina_module_free - https://bugs.webkit.org/show_bug.cgi?id=76681 - - Reviewed by Martin Robinson. - - eina_module_free has been used without including eina libraries after r104936. - - * wtf/PlatformEfl.cmake: Add EINA_LIBRARIES. - -2012-01-19 Tony Chang - - [chromium] Remove an obsolete comment about features.gypi - https://bugs.webkit.org/show_bug.cgi?id=76643 - - There can be only one features.gypi. - - Reviewed by James Robinson. - - * JavaScriptCore.gyp/JavaScriptCore.gyp: - -2012-01-19 Geoffrey Garen - - Implicit creation of a regular expression should eagerly check for syntax errors - https://bugs.webkit.org/show_bug.cgi?id=76642 - - Reviewed by Oliver Hunt. - - This is a correctness fix and a slight optimization. - - * runtime/StringPrototype.cpp: - (JSC::stringProtoFuncMatch): - (JSC::stringProtoFuncSearch): Check for syntax errors because that's the - correct behavior. - - * runtime/RegExp.cpp: - (JSC::RegExp::match): ASSERT that we aren't a syntax error. (One line - of code change, many lines of indentation change.) - - Since we have no clients that try to match a RegExp that is a syntax error, - let's optimize out the check. - -2012-01-19 Mark Hahnenberg - - Implement a new allocator for backing stores - https://bugs.webkit.org/show_bug.cgi?id=75181 - - Reviewed by Filip Pizlo. - - We want to move away from using fastMalloc for the backing stores for - some of our objects (e.g. JSArray, JSObject, JSString, etc). These backing - stores have a nice property in that they only have a single owner (i.e. a - single pointer to them at any one time). One way that we can take advantage - of this property is to implement a simple bump allocator/copying collector, - which will run alongside our normal mark/sweep collector, that only needs to - update the single owner pointer rather than having to redirect an arbitrary - number of pointers in from-space to to-space. - - This plan can give us a number of benefits. We can beat fastMalloc in terms - of both performance and memory usage, we can track how much memory we're using - far more accurately than our rough estimation now through the use of - reportExtraMemoryCost, and we can allocate arbitrary size objects (as opposed - to being limited to size classes like we have been historically). This is also - another step toward moving away from lazy destruction, which will improve our memory footprint. - - We start by creating said allocator and moving the ArrayStorage for JSArray - to use it rather than fastMalloc. - - The design of the collector is as follows: - Allocation: - -The collector allocates 64KB chunks from the OS to use for object allocation. - -Each chunk contains an offset, a flag indicating if the block has been pinned, - and a payload, along with next and prev pointers so that they can be put in DoublyLinkedLists. - -Any allocation greater than 64KB gets its own separate oversize block, which - is managed separately from the rest. - -If the allocator receives a request for more than the remaining amount in the - current block, it grabs a fresh block. - -Grabbing a fresh block means grabbing one off of the global free list (which is now - shared between the mark/sweep allocator and the bump allocator) if there is one. - If there isn't a new one we do one of two things: allocate a new block from the OS - if we're not ready for a GC yet, or run a GC and then try again. If we still don't - have enough space after the GC, we allocate a new block from the OS. - - Garbage collection: - -At the start of garbage collection during conservative stack scanning, if we encounter - what appears to be a pointer to a bump-allocated block of memory, we pin that block so - that it will not be copied for this round of collection. - -We also pin any oversize blocks that we encounter, which effectively doubles as a - "mark bit" for that block. Any oversize blocks that aren't pinned at the end of copying - are given back to the OS. - -Marking threads are now also responsible for copying bump-allocated objects to newSpace - -Each marking thread has a private 64KB block into which it copies bump-allocated objects that it encounters. - -When that block fills up, the marking thread gives it back to the allocator and requests a new one. - -When all marking has concluded, each thread gives back its copy block, even if it isn't full. - -At the conclusion of copying (which is done by the end of the marking phase), we un-pin - any pinned blocks and give any blocks left in from-space to the global free list. - - * CMakeLists.txt: - * GNUmakefile.list.am: - * JavaScriptCore.gypi: - * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj: - * JavaScriptCore.vcproj/WTF/WTF.vcproj: - * JavaScriptCore.xcodeproj/project.pbxproj: - * Target.pri: - * heap/AllocationSpace.cpp: - (JSC::AllocationSpace::allocateSlowCase): - (JSC::AllocationSpace::allocateBlock): - (JSC::AllocationSpace::freeBlocks): - * heap/AllocationSpace.h: - (JSC::AllocationSpace::waterMark): - * heap/BumpBlock.h: Added. - (JSC::BumpBlock::BumpBlock): - * heap/BumpSpace.cpp: Added. - (JSC::BumpSpace::tryAllocateSlowCase): - * heap/BumpSpace.h: Added. - (JSC::BumpSpace::isInCopyPhase): - (JSC::BumpSpace::totalMemoryAllocated): - (JSC::BumpSpace::totalMemoryUtilized): - * heap/BumpSpaceInlineMethods.h: Added. - (JSC::BumpSpace::BumpSpace): - (JSC::BumpSpace::init): - (JSC::BumpSpace::contains): - (JSC::BumpSpace::pin): - (JSC::BumpSpace::startedCopying): - (JSC::BumpSpace::doneCopying): - (JSC::BumpSpace::doneFillingBlock): - (JSC::BumpSpace::recycleBlock): - (JSC::BumpSpace::getFreshBlock): - (JSC::BumpSpace::borrowBlock): - (JSC::BumpSpace::addNewBlock): - (JSC::BumpSpace::allocateNewBlock): - (JSC::BumpSpace::fitsInBlock): - (JSC::BumpSpace::fitsInCurrentBlock): - (JSC::BumpSpace::tryAllocate): - (JSC::BumpSpace::tryAllocateOversize): - (JSC::BumpSpace::allocateFromBlock): - (JSC::BumpSpace::tryReallocate): - (JSC::BumpSpace::tryReallocateOversize): - (JSC::BumpSpace::isOversize): - (JSC::BumpSpace::isPinned): - (JSC::BumpSpace::oversizeBlockFor): - (JSC::BumpSpace::blockFor): - * heap/ConservativeRoots.cpp: - (JSC::ConservativeRoots::ConservativeRoots): - (JSC::ConservativeRoots::genericAddPointer): - (JSC::ConservativeRoots::add): - * heap/ConservativeRoots.h: - * heap/Heap.cpp: - (JSC::Heap::Heap): - (JSC::Heap::blockFreeingThreadMain): - (JSC::Heap::reportExtraMemoryCostSlowCase): - (JSC::Heap::getConservativeRegisterRoots): - (JSC::Heap::markRoots): - (JSC::Heap::collect): - (JSC::Heap::releaseFreeBlocks): - * heap/Heap.h: - (JSC::Heap::waterMark): - (JSC::Heap::highWaterMark): - (JSC::Heap::setHighWaterMark): - (JSC::Heap::tryAllocateStorage): - (JSC::Heap::tryReallocateStorage): - * heap/HeapBlock.h: Added. - (JSC::HeapBlock::HeapBlock): - * heap/MarkStack.cpp: - (JSC::MarkStackThreadSharedData::MarkStackThreadSharedData): - (JSC::SlotVisitor::drain): - (JSC::SlotVisitor::drainFromShared): - (JSC::SlotVisitor::startCopying): - (JSC::SlotVisitor::allocateNewSpace): - (JSC::SlotVisitor::copy): - (JSC::SlotVisitor::copyAndAppend): - (JSC::SlotVisitor::doneCopying): - * heap/MarkStack.h: - * heap/MarkedBlock.cpp: - (JSC::MarkedBlock::recycle): - (JSC::MarkedBlock::MarkedBlock): - * heap/MarkedBlock.h: - * heap/MarkedSpace.cpp: - (JSC::MarkedSpace::MarkedSpace): - * heap/MarkedSpace.h: - (JSC::MarkedSpace::allocate): - (JSC::MarkedSpace::forEachBlock): - (JSC::MarkedSpace::SizeClass::resetAllocator): - * heap/SlotVisitor.h: - (JSC::SlotVisitor::SlotVisitor): - * heap/TinyBloomFilter.h: - (JSC::TinyBloomFilter::reset): - * runtime/JSArray.cpp: - (JSC::JSArray::JSArray): - (JSC::JSArray::finishCreation): - (JSC::JSArray::tryFinishCreationUninitialized): - (JSC::JSArray::~JSArray): - (JSC::JSArray::enterSparseMode): - (JSC::JSArray::defineOwnNumericProperty): - (JSC::JSArray::setLengthWritable): - (JSC::JSArray::getOwnPropertySlotByIndex): - (JSC::JSArray::getOwnPropertyDescriptor): - (JSC::JSArray::putByIndexBeyondVectorLength): - (JSC::JSArray::deletePropertyByIndex): - (JSC::JSArray::getOwnPropertyNames): - (JSC::JSArray::increaseVectorLength): - (JSC::JSArray::unshiftCountSlowCase): - (JSC::JSArray::setLength): - (JSC::JSArray::pop): - (JSC::JSArray::unshiftCount): - (JSC::JSArray::visitChildren): - (JSC::JSArray::sortNumeric): - (JSC::JSArray::sort): - (JSC::JSArray::compactForSorting): - (JSC::JSArray::subclassData): - (JSC::JSArray::setSubclassData): - (JSC::JSArray::checkConsistency): - * runtime/JSArray.h: - (JSC::JSArray::inSparseMode): - (JSC::JSArray::isLengthWritable): - * wtf/CheckedBoolean.h: Added. - (CheckedBoolean::CheckedBoolean): - (CheckedBoolean::~CheckedBoolean): - (CheckedBoolean::operator bool): - * wtf/DoublyLinkedList.h: - (WTF::::push): - * wtf/StdLibExtras.h: - (WTF::isPointerAligned): - -2012-01-19 Joi Sigurdsson - - Enable use of precompiled headers in Chromium port on Windows. - - Bug 76381 - Use precompiled headers in Chromium port on Windows - https://bugs.webkit.org/show_bug.cgi?id=76381 - - Reviewed by Tony Chang. - - * JavaScriptCore.gyp/JavaScriptCore.gyp: Include WinPrecompile.gypi. - -2012-01-18 Roland Takacs - - Cross-platform processor core counter fix - https://bugs.webkit.org/show_bug.cgi?id=76540 - - Reviewed by Zoltan Herczeg. - - I attached "OS(FREEBSD)" to "#if OS(DARWIN) || OS(OPENBSD) || OS(NETBSD)" - and I removed the OS checking macros from ParallelJobsGeneric.cpp because - the NumberOfCores.cpp contains them for counting CPU cores. - The processor core counter patch located at - https://bugs.webkit.org/show_bug.cgi?id=76530 - - * wtf/NumberOfCores.cpp: - * wtf/ParallelJobsGeneric.cpp: - -2012-01-18 Csaba Osztrogonác - - Cross-platform processor core counter - https://bugs.webkit.org/show_bug.cgi?id=76530 - - Unreviewed cross-MinGW buildfix after r105270. - - * wtf/NumberOfCores.cpp: Use windows.h instead of Windows.h. - -2012-01-18 Roland Takacs - - Cross-platform processor core counter - https://bugs.webkit.org/show_bug.cgi?id=76530 - - Reviewed by Zoltan Herczeg. - - Two files have been created that include the processor core counter function. - It used to be in ParallelJobsGeneric.h/cpp before. - - * GNUmakefile.list.am: - * JavaScriptCore.gypi: - * JavaScriptCore.vcproj/WTF/WTF.vcproj: - * JavaScriptCore.xcodeproj/project.pbxproj: - * runtime/Options.cpp: - (JSC::Options::initializeOptions): - * wtf/CMakeLists.txt: - * wtf/NumberOfCores.cpp: Added. - (WTF::numberOfProcessorCores): - * wtf/NumberOfCores.h: Added. - * wtf/ParallelJobsGeneric.cpp: - (WTF::ParallelEnvironment::ParallelEnvironment): - * wtf/ParallelJobsGeneric.h: - -2012-01-18 Balazs Kelemen - - [Qt] Consolidate layout test crash logging - https://bugs.webkit.org/show_bug.cgi?id=75088 - - Reviewed by Simon Hausmann. - - Move backtrace generating logic into WTFReportBacktrace - and add a way to deinstall signal handlers if we know - that we have already printed the backtrace. - - * JavaScriptCore.exp: - * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def: - * wtf/Assertions.cpp: - (WTFLogLocker::WTFReportBacktrace): - (WTFLogLocker::WTFSetCrashHook): - (WTFLogLocker::WTFInvokeCrashHook): - * wtf/Assertions.h: - -2012-01-17 Geoffrey Garen - - Factored out some code into a helper function. - - I think this might help getting rid of omit-frame-pointer. - - Reviewed by Sam Weinig. - - No benchmark change. - - * runtime/StringPrototype.cpp: - (JSC::removeUsingRegExpSearch): Moved to here... - (JSC::replaceUsingRegExpSearch): ...from here. - -2012-01-17 Caio Marcelo de Oliveira Filho - - Uint8ClampedArray support - https://bugs.webkit.org/show_bug.cgi?id=74455 - - Reviewed by Filip Pizlo. - - * GNUmakefile.list.am: - * JavaScriptCore.xcodeproj/project.pbxproj: - * bytecode/PredictedType.cpp: - (JSC::predictionToString): - (JSC::predictionFromClassInfo): - * bytecode/PredictedType.h: - (JSC::isUint8ClampedArrayPrediction): - (JSC::isActionableMutableArrayPrediction): - * dfg/DFGAbstractState.cpp: - (JSC::DFG::AbstractState::initialize): - (JSC::DFG::AbstractState::execute): - * dfg/DFGNode.h: - (JSC::DFG::Node::shouldSpeculateUint8ClampedArray): - * dfg/DFGPropagator.cpp: - (JSC::DFG::Propagator::propagateNodePredictions): - (JSC::DFG::Propagator::fixupNode): - (JSC::DFG::Propagator::performNodeCSE): - * dfg/DFGSpeculativeJIT.cpp: - (JSC::DFG::SpeculativeJIT::checkArgumentTypes): - (JSC::DFG::clampDoubleToByte): - (JSC::DFG::compileClampIntegerToByte): - (JSC::DFG::SpeculativeJIT::compilePutByValForByteArray): - (JSC::DFG::SpeculativeJIT::compilePutByValForIntTypedArray): - (JSC::DFG::SpeculativeJIT::compileGetIndexedPropertyStorage): - * dfg/DFGSpeculativeJIT.h: - * dfg/DFGSpeculativeJIT32_64.cpp: - (JSC::DFG::SpeculativeJIT::compile): - * dfg/DFGSpeculativeJIT64.cpp: - (JSC::DFG::SpeculativeJIT::compile): - * runtime/JSCell.h: - * runtime/JSGlobalData.h: - * wtf/Forward.h: - * wtf/Uint8Array.h: - * wtf/Uint8ClampedArray.h: Added. - (WTF::Uint8ClampedArray::set): - (WTF::Uint8ClampedArray::create): - (WTF::Uint8ClampedArray::Uint8ClampedArray): - (WTF::Uint8ClampedArray::subarray): - -2012-01-17 Sam Weinig - - Add helper macro for forward declaring objective-c classes - https://bugs.webkit.org/show_bug.cgi?id=76485 - - Reviewed by Anders Carlsson. - - * wtf/Compiler.h: - Add OBJC_CLASS macro which helps reduce code when forward declaring an - objective-c class in a header which can be included from both Objective-C - and non-Objective-C files. - -2012-01-17 Filip Pizlo - - DFG should be able to do JS and custom getter caching - https://bugs.webkit.org/show_bug.cgi?id=76361 - - Reviewed by Csaba Osztrogonác. - - Fix for 32-bit. - - * dfg/DFGRepatch.cpp: - (JSC::DFG::tryBuildGetByIDList): - * dfg/DFGSpeculativeJIT32_64.cpp: - (JSC::DFG::SpeculativeJIT::compile): - -2012-01-15 Filip Pizlo - - DFG should be able to do JS and custom getter caching - https://bugs.webkit.org/show_bug.cgi?id=76361 - - - Reviewed by Geoff Garen. - - Added the ability to cache JS getter calls and custom getter calls in the DFG. - Most of this is pretty mundane, since the old JIT supported this functionality - as well. But a couple interesting things had to happen: - - - There are now two variants of GetById: GetById, which works as before, and - GetByIdFlush, which flushes registers prior to doing the GetById. Only - GetByIdFlush can be used for caching getters. We detect which GetById style - to use by looking at the inline caches of the old JIT. - - - Exception handling for getter calls planted in stubs uses a separate lookup - handler routine, which uses the CodeOrigin stored in the StructureStubInfo. - - This is a 40% speed-up in the Dromaeo DOM Traversal average. It removes all of - the DFG regressions we saw in Dromaeo. This is neutral on SunSpider, V8, and - Kraken. - - * bytecode/StructureStubInfo.h: - * dfg/DFGAbstractState.cpp: - (JSC::DFG::AbstractState::execute): - * dfg/DFGAssemblyHelpers.h: - (JSC::DFG::AssemblyHelpers::emitExceptionCheck): - * dfg/DFGByteCodeParser.cpp: - (JSC::DFG::ByteCodeParser::willNeedFlush): - (JSC::DFG::ByteCodeParser::parseBlock): - * dfg/DFGCCallHelpers.h: - (JSC::DFG::CCallHelpers::setupResults): - * dfg/DFGJITCompiler.cpp: - (JSC::DFG::JITCompiler::link): - * dfg/DFGJITCompiler.h: - (JSC::DFG::PropertyAccessRecord::PropertyAccessRecord): - (JSC::DFG::JITCompiler::addExceptionCheck): - * dfg/DFGNode.h: - (JSC::DFG::Node::hasIdentifier): - (JSC::DFG::Node::hasHeapPrediction): - * dfg/DFGOperations.cpp: - * dfg/DFGOperations.h: - * dfg/DFGPropagator.cpp: - (JSC::DFG::Propagator::propagateNodePredictions): - * dfg/DFGRepatch.cpp: - (JSC::DFG::tryCacheGetByID): - (JSC::DFG::tryBuildGetByIDList): - * dfg/DFGSpeculativeJIT.h: - (JSC::DFG::SpeculativeJIT::appendCallWithExceptionCheckSetResult): - * dfg/DFGSpeculativeJIT32_64.cpp: - (JSC::DFG::SpeculativeJIT::cachedGetById): - (JSC::DFG::SpeculativeJIT::compile): - * dfg/DFGSpeculativeJIT64.cpp: - (JSC::DFG::SpeculativeJIT::cachedGetById): - (JSC::DFG::SpeculativeJIT::compile): - -2012-01-16 Jon Lee - - Build fix for r105086. - - * Configurations/FeatureDefines.xcconfig: - * wtf/Platform.h: - -2012-01-16 Jon Lee - - Remove HTML notifications support on Mac - https://bugs.webkit.org/show_bug.cgi?id=76401 - - - Reviewed by Sam Weinig. - - * wtf/Platform.h: Define ENABLE_HTML_NOTIFICATIONS macro. - -2012-01-16 Zeno Albisser - - [Qt] Fix QT_VERSION related warnings when building on Mac OS X - https://bugs.webkit.org/show_bug.cgi?id=76340 - - This bug was caused by r104826. - As already mentioned for https://bugs.webkit.org/show_bug.cgi?id=57239 - we should not use "using namespace WebCore" in header files, - because it might cause ambiguous references. - This patch reverts the changes from r104826 and r104981 - and removes the "using namespace WebCore" statement from - two header files. - - Reviewed by Tor Arne Vestbø. - - * wtf/Platform.h: - -2012-01-16 Carlos Garcia Campos - - Unreviewed. Fix make distcheck. - - * GNUmakefile.list.am: Fix typo. - -2012-01-16 Pavel Heimlich - - Solaris Studio supports alignment macros too - https://bugs.webkit.org/show_bug.cgi?id=75453 - - Reviewed by Hajime Morita. - - * wtf/Alignment.h: - -2012-01-16 Yuqiang Xian - - Build fix on 32bit if verbose debug is enabled in DFG - https://bugs.webkit.org/show_bug.cgi?id=76351 - - Reviewed by Hajime Morita. - - Mostly change "%lu" to "%zu" to print a "size_t" variable. - - * dfg/DFGAbstractState.cpp: - (JSC::DFG::AbstractState::endBasicBlock): - * dfg/DFGByteCodeParser.cpp: - (JSC::DFG::ByteCodeParser::handleCall): - (JSC::DFG::ByteCodeParser::handleInlining): - (JSC::DFG::ByteCodeParser::parseBlock): - (JSC::DFG::ByteCodeParser::parseCodeBlock): - * dfg/DFGGraph.cpp: - (JSC::DFG::Graph::predictArgumentTypes): - * dfg/DFGJITCompiler.cpp: - (JSC::DFG::JITCompiler::link): - * dfg/DFGOSREntry.cpp: - (JSC::DFG::prepareOSREntry): - -2012-01-15 Filip Pizlo - - The C calling convention logic in DFG::SpeculativeJIT should be available even - when not generating code for the DFG speculative path - https://bugs.webkit.org/show_bug.cgi?id=76355 - - Reviewed by Dan Bernstein. - - Moved all of the logic for placing C call arguments into the right place (stack - or registers) into a new class, DFG::CCallHelpers. This class inherits from - AssemblyHelpers, another DFG grab-bag of helper functions. I could have moved - this code into AssemblyHelpers, but decided against it, because I wanted to - limit the number of methods each class in the JIT has. Hence now we have a - slightly odd organization of JIT classes in DFG: MacroAssembler (basic instruction - emission) <= AssemblyHelpers (some additional JS smarts) <= CCallHelpers - (understands calls to C functions) <= JITCompiler (can compile a graph to machine - code). Each of these except for JITCompiler can be reused for stub compilation. - - * GNUmakefile.list.am: - * JavaScriptCore.xcodeproj/project.pbxproj: - * dfg/DFGCCallHelpers.h: Added. - (JSC::DFG::CCallHelpers::CCallHelpers): - (JSC::DFG::CCallHelpers::resetCallArguments): - (JSC::DFG::CCallHelpers::addCallArgument): - (JSC::DFG::CCallHelpers::setupArguments): - (JSC::DFG::CCallHelpers::setupArgumentsExecState): - (JSC::DFG::CCallHelpers::setupArgumentsWithExecState): - (JSC::DFG::CCallHelpers::setupTwoStubArgs): - (JSC::DFG::CCallHelpers::setupStubArguments): - * dfg/DFGJITCompiler.h: - (JSC::DFG::JITCompiler::JITCompiler): - * dfg/DFGSpeculativeJIT.h: - (JSC::DFG::SpeculativeJIT::callOperation): - -2012-01-15 Pablo Flouret - - Fix compilation errors on build-webkit --debug --no-video on mac. - https://bugs.webkit.org/show_bug.cgi?id=75867 - - Reviewed by Philippe Normand. - - Make ENABLE_VIDEO_TRACK conditional on ENABLE_VIDEO, video track feature - doesn't build without video. - - * wtf/Platform.h: - -2012-01-14 David Levin - - HWndDC should be in platform/win instead of wtf. - https://bugs.webkit.org/show_bug.cgi?id=76314 - - Reviewed by Sam Weinig. - - * JavaScriptCore.gyp/JavaScriptCore.gyp: - * JavaScriptCore.gypi: - -2012-01-13 David Levin - - check-webkit-style: should encourage the use of Own* classes for Windows DC. - https://bugs.webkit.org/show_bug.cgi?id=76227 - - Reviewed by Dirk Pranke. - - * wtf/win/HWndDCWin.h: - (WTF::HwndDC::HwndDC): Add a way to do GetDCEx. - There are no users, but I want to catch this in check-webkit-style - and tell any users to use HwndDC to avoid leaks. - -2012-01-13 David Levin - - Header file is missing header guard. - - Reviewed by Dirk Pranke. - - * wtf/win/HWndDCWin.h: Added the guards. - -2012-01-13 Andy Wingo - - Eval in strict mode does not need dynamic checks - https://bugs.webkit.org/show_bug.cgi?id=76286 - - Reviewed by Oliver Hunt. - - * runtime/JSActivation.cpp (JSC::JSActivation::JSActivation): - Eval in strict mode cannot introduce variables, so it not impose - the need for dynamic checks. - -2012-01-13 David Levin - - HWndDC is a better name than HwndDC. - https://bugs.webkit.org/show_bug.cgi?id=76281 - - Reviewed by Darin Adler. - - * JavaScriptCore.gyp/JavaScriptCore.gyp: - * JavaScriptCore.gypi: - * wtf/win/HWndDCWin.h: Renamed from Source/JavaScriptCore/wtf/win/HwndDCWin.h. - (WTF::HWndDC::HWndDC): - (WTF::HWndDC::~HWndDC): - (WTF::HWndDC::operator HDC): - -2012-01-13 YoungTaeck Song - - [EFL] Add OwnPtr specialization for Eina_Module. - https://bugs.webkit.org/show_bug.cgi?id=76255 - - Reviewed by Andreas Kling. - - Add an overload for deleteOwnedPtr(Eina_Module*) on EFL port. - - * wtf/OwnPtrCommon.h: - * wtf/efl/OwnPtrEfl.cpp: - (WTF::deleteOwnedPtr): - -2012-01-13 Yuqiang Xian - - Unreviewed build fix after r104787 if JIT_VERBOSE_OSR is defined - - * jit/JITStubs.cpp: - (JSC::DEFINE_STUB_FUNCTION): - -2012-01-12 Hajime Morrita - - JavaScriptCore: Mark all exported symbols in the header file automatically. - https://bugs.webkit.org/show_bug.cgi?id=72855 - - Reviewed by Darin Adler. - - Added WTF_EXPORT_PRIVATE and JS_EXPORT_PRIVATE based on JavaScriptCore.exp files. - The change is generated by a tool calledListExportables (https://github.com/omo/ListExportables) - - * API/OpaqueJSString.h: - * bytecode/CodeBlock.h: - * bytecode/SamplingTool.h: - * debugger/Debugger.h: - * debugger/DebuggerActivation.h: - * debugger/DebuggerCallFrame.h: - * heap/AllocationSpace.h: - * heap/HandleHeap.h: - * heap/Heap.h: - * heap/MachineStackMarker.h: - * heap/MarkStack.h: - * heap/VTableSpectrum.h: - * heap/WriteBarrierSupport.h: - * parser/Nodes.h: - * parser/ParserArena.h: - * profiler/Profile.h: - * runtime/ArgList.h: - * runtime/CallData.h: - * runtime/Completion.h: - * runtime/ConstructData.h: - * runtime/DateInstance.h: - * runtime/Error.h: - * runtime/ExceptionHelpers.h: - * runtime/FunctionConstructor.h: - * runtime/Identifier.h: - * runtime/InitializeThreading.h: - * runtime/InternalFunction.h: - * runtime/JSArray.h: - * runtime/JSByteArray.h: - * runtime/JSCell.h: - * runtime/JSFunction.h: - * runtime/JSGlobalData.cpp: - * runtime/JSGlobalData.h: - * runtime/JSGlobalObject.h: - * runtime/JSGlobalThis.h: - * runtime/JSLock.h: - * runtime/JSObject.h: - * runtime/JSString.h: - * runtime/JSValue.h: - * runtime/JSVariableObject.h: - * runtime/Lookup.h: - * runtime/MemoryStatistics.h: - * runtime/ObjectPrototype.h: - * runtime/Options.h: - * runtime/PropertyDescriptor.h: - * runtime/PropertyNameArray.h: - * runtime/PropertySlot.h: - * runtime/RegExp.h: - * runtime/RegExpObject.h: - * runtime/SamplingCounter.h: - * runtime/SmallStrings.h: - * runtime/StringObject.h: - * runtime/Structure.h: - * runtime/TimeoutChecker.h: - * runtime/UString.h: - * runtime/WriteBarrier.h: - * wtf/ArrayBufferView.h: - * wtf/ByteArray.h: - * wtf/CryptographicallyRandomNumber.h: - * wtf/CurrentTime.h: - * wtf/DateMath.h: - * wtf/DecimalNumber.h: - * wtf/FastMalloc.cpp: - * wtf/FastMalloc.h: - * wtf/MD5.h: - * wtf/MainThread.h: - * wtf/MetaAllocator.h: - * wtf/MetaAllocatorHandle.h: - * wtf/OSAllocator.h: - * wtf/PageBlock.h: - * wtf/RandomNumber.h: - * wtf/RefCountedLeakCounter.h: - * wtf/SHA1.h: - * wtf/Threading.cpp: - * wtf/Threading.h: - * wtf/ThreadingPrimitives.h: - * wtf/WTFThreadData.h: - * wtf/dtoa.h: - * wtf/text/AtomicString.h: - * wtf/text/CString.h: - * wtf/text/StringBuilder.h: - * wtf/text/StringImpl.h: - * wtf/text/WTFString.h: - * wtf/unicode/Collator.h: - * wtf/unicode/UTF8.h: - * yarr/Yarr.h: - * yarr/YarrPattern.h: - -2012-01-12 MORITA Hajime - - [Chromium] JSExportMacros.h should be visible. - https://bugs.webkit.org/show_bug.cgi?id=76147 - - Reviewed by Tony Chang. - - * config.h: - -2012-01-12 David Levin - - HwndDC is a better name than OwnGetDC. - https://bugs.webkit.org/show_bug.cgi?id=76235 - - Reviewed by Dmitry Titov. - - This is a better name for two reasons: - 1. "Own" implies "delete". In this case, the final call is a release (ReleaseDC). - 2. "Ref" would be a better name due to the release but the RefPtr (and OwnPtr) - classes always take something to hold on to. In this case, the object (the DC) - is created by the class once it is given a Window to ensure that the HDC - was actually created using GetDC. - - * JavaScriptCore.gyp/JavaScriptCore.gyp: - * JavaScriptCore.gypi: - * wtf/win/HwndDCWin.h: Renamed from Source/JavaScriptCore/wtf/win/OwnGetDCWin.h. - (WTF::HwndDC::HwndDC): - (WTF::HwndDC::~HwndDC): - (WTF::HwndDC::operator HDC): - -2012-01-12 Gavin Barraclough - - Clean up putDirect (part 2) - https://bugs.webkit.org/show_bug.cgi?id=76232 - - Reviewed by Sam Weinig. - - Rename putWithAttributes to putDirectVirtual, to identify that this - has the same unchecked-DefineOwnProperty behaviour, change putDirectInternal - to be templated on an enum indicating which behaviour it is supposed to be - implementing, and change clients that are defining properties to call - putDirectInternal correctly. - - * API/JSObjectRef.cpp: - (JSObjectSetProperty): - * JavaScriptCore.exp: - * debugger/DebuggerActivation.cpp: - (JSC::DebuggerActivation::putDirectVirtual): - * debugger/DebuggerActivation.h: - * interpreter/Interpreter.cpp: - (JSC::Interpreter::execute): - * runtime/ClassInfo.h: - * runtime/Error.cpp: - (JSC::addErrorInfo): - * runtime/JSActivation.cpp: - (JSC::JSActivation::putDirectVirtual): - * runtime/JSActivation.h: - * runtime/JSCell.cpp: - (JSC::JSCell::putDirectVirtual): - * runtime/JSCell.h: - * runtime/JSGlobalObject.cpp: - (JSC::JSGlobalObject::putDirectVirtual): - * runtime/JSGlobalObject.h: - * runtime/JSObject.cpp: - (JSC::JSObject::put): - (JSC::JSObject::putDirectVirtual): - (JSC::JSObject::defineGetter): - (JSC::JSObject::initializeGetterSetterProperty): - (JSC::JSObject::defineSetter): - (JSC::putDescriptor): - * runtime/JSObject.h: - (JSC::JSObject::putDirectInternal): - (JSC::JSObject::putOwnDataProperty): - (JSC::JSObject::putDirect): - * runtime/JSStaticScopeObject.cpp: - (JSC::JSStaticScopeObject::putDirectVirtual): - * runtime/JSStaticScopeObject.h: - * runtime/JSVariableObject.cpp: - (JSC::JSVariableObject::putDirectVirtual): - * runtime/JSVariableObject.h: - -2012-01-12 Gavin Barraclough - - Clean up putDirect (part 1) - https://bugs.webkit.org/show_bug.cgi?id=76232 - - Reviewed by Sam Weinig. - - putDirect has ambiguous semantics, clean these up a bit. - - putDirect generally behaves a bit like a fast defineOwnProperty, but one that - always creates the property, with no checking to validate the put it permitted. - - It also encompasses two slightly different behaviors. - (1) a fast form of put for JSActivation, which doesn't have to handle searching - the prototype chain, getter/setter properties, or the magic __proto__ value. - Break this out as a new method, 'putOwnDataProperty'. - (2) the version of putDirect on JSValue will also check for overwriting ReadOnly - values, in strict mode. This is, however, not so smart on a few level, since - it is only called from op_put_by_id with direct set, which is only used with - an object as the base, and is only used to put new properties onto objects. - - * dfg/DFGOperations.cpp: - * interpreter/Interpreter.cpp: - (JSC::Interpreter::privateExecute): - * jit/JITStubs.cpp: - (JSC::DEFINE_STUB_FUNCTION): - * runtime/JSActivation.cpp: - (JSC::JSActivation::put): - * runtime/JSFunction.cpp: - (JSC::JSFunction::getOwnPropertySlot): - * runtime/JSObject.h: - (JSC::JSObject::putOwnDataProperty): - * runtime/JSValue.h: - -2012-01-12 Gavin Barraclough - - https://bugs.webkit.org/show_bug.cgi?id=76141 - defineSetter/defineGetter may fail to update Accessor attribute - - Reviewed by Oliver Hunt. - - * runtime/JSObject.cpp: - (JSC::JSObject::defineGetter): - (JSC::JSObject::initializeGetterSetterProperty): - (JSC::JSObject::defineSetter): - * runtime/Structure.cpp: - (JSC::Structure::attributeChangeTransition): - * runtime/Structure.h: - -2012-01-12 David Levin - - [chromium] Fix DC leak in WebScreenInfoFactory. - https://bugs.webkit.org/show_bug.cgi?id=76203 - - Reviewed by Dmitry Titov. - - * JavaScriptCore.gyp/JavaScriptCore.gyp: Added OwnGetDCWin.h - * JavaScriptCore.gypi: Added OwnGetDCWin.h - * JavaScriptCore/wtf/win/OwnGetDCWin.h: Made an owner class for GetDC which needs ReleaseDC as opposed to DeleteDC. - -2012-01-11 Gavin Barraclough - - Allow accessor get/set property to be set to undefined - https://bugs.webkit.org/show_bug.cgi?id=76148 - - Reviewed by Oliver Hunt. - - AccessorDescriptor properties may have their get & set properties defined to reference a function - (Callable object) or be set to undefined. Valid PropertyDescriptors created by toPropertyDescriptor - (defined from JS code via Object.defineProperty, etc) have get and set properties that are in one of - three states (1) nonexistent, (2) set to undefined, or (3) a function (any Callable object). - - On the PropertyDescriptor object these three states are represneted by JSValue(), jsUndefined(), and - any JSObject* (with a constraint that this must be callable). - - Logically the get/set property of an accessor descriptor on an object might be in any of the three - states above, but in practice there is no way to distinguish between the first two states. As such - we stor the get/set values in property storage in a JSObject* field, with 0 indicating absent or - undefined. When unboxing to a PropertyDescriptor, map this back to a JS undefined value. - - * runtime/GetterSetter.h: - (JSC::GetterSetter::setGetter): - (JSC::GetterSetter::setSetter): - - Allow the getter/setter to be cleared. - * runtime/JSArray.cpp: - (JSC::JSArray::putDescriptor): - - Changed to call getterObject/setterObject. - (JSC::JSArray::defineOwnNumericProperty): - - Added ASSERT. - * runtime/JSObject.cpp: - (JSC::putDescriptor): - (JSC::JSObject::defineOwnProperty): - - Changed to call getterObject/setterObject. - * runtime/ObjectConstructor.cpp: - (JSC::objectConstructorGetOwnPropertyDescriptor): - - getter/setter values read from properties on object are never missing, they will now be set as undefined by 'setDescriptor'. - (JSC::toPropertyDescriptor): - - Do not translate undefined->empty, this loses an important distinction between a get/set property being absent, or being explicitly set to undefined. - * runtime/PropertyDescriptor.cpp: - (JSC::PropertyDescriptor::getterObject): - (JSC::PropertyDescriptor::setterObject): - - Accessors to convert the get/set property to an object pointer, converting undefined to 0. - (JSC::PropertyDescriptor::setDescriptor): - (JSC::PropertyDescriptor::setAccessorDescriptor): - - Translate a getter/setter internally represented at 0 to undefined, indicating that it is present. - * runtime/PropertyDescriptor.h: - - Declare getterObject/setterObject. - -2012-01-12 Zeno Albisser - - [Qt][WK2][Mac] Conflict of MacTypes.h defining a Fixed type after r104560. - https://bugs.webkit.org/show_bug.cgi?id=76175 - - Defining ENABLE_CSS_FILTERS leads to ambiguous references - due to MacTypes.h being included. - Defining CF_OPEN_SOURCE works around this problem. - - Reviewed by Simon Hausmann. - - * wtf/Platform.h: - -2012-01-12 Simon Hausmann - - Make the new WTF module build on Qt - https://bugs.webkit.org/show_bug.cgi?id=76163 - - Reviewed by Tor Arne Vestbø. - - * JavaScriptCore.pro: Removed wtf from the subdirs to build. - -2012-01-11 Filip Pizlo - - CodeBlock::m_executeCounter should be renamed to CodeBlock::m_jitExecuteCounter - https://bugs.webkit.org/show_bug.cgi?id=76144 - - - Rubber stamped by Gavin Barraclough. - - * bytecode/CodeBlock.h: - (JSC::CodeBlock::addressOfJITExecuteCounter): - (JSC::CodeBlock::offsetOfJITExecuteCounter): - (JSC::CodeBlock::jitExecuteCounter): - (JSC::CodeBlock::optimizeNextInvocation): - (JSC::CodeBlock::dontOptimizeAnytimeSoon): - (JSC::CodeBlock::optimizeAfterWarmUp): - (JSC::CodeBlock::optimizeAfterLongWarmUp): - (JSC::CodeBlock::optimizeSoon): - * dfg/DFGOSRExitCompiler32_64.cpp: - (JSC::DFG::OSRExitCompiler::compileExit): - * dfg/DFGOSRExitCompiler64.cpp: - (JSC::DFG::OSRExitCompiler::compileExit): - * jit/JIT.cpp: - (JSC::JIT::emitOptimizationCheck): - -2012-01-11 Gavin Barraclough - - Merge 'Getter'/'Setter' attributes into 'Accessor' - https://bugs.webkit.org/show_bug.cgi?id=76141 - - Reviewed by Filip Pizlo. - - These are currently ambiguous (and used inconsistently). It would logically appear - that either being bit set implies that the corresponding type of accessor is present - but (a) we don't correctly enforce this, and (b) this means the attributes would not - be able to distinguish between a data descriptor and an accessor descriptor with - neither a getter nor setter defined (which is a descriptor permissible under the spec). - This ambiguity would lead to unsafe property caching behavior (though this does not - represent an actual current bug, since we are currently unable to create descriptors - that have neither a getter nor setter, it just prevents us from doing so). - - * runtime/Arguments.cpp: - (JSC::Arguments::createStrictModeCallerIfNecessary): - (JSC::Arguments::createStrictModeCalleeIfNecessary): - * runtime/JSArray.cpp: - (JSC::SparseArrayValueMap::put): - (JSC::JSArray::putDescriptor): - * runtime/JSBoundFunction.cpp: - (JSC::JSBoundFunction::finishCreation): - * runtime/JSFunction.cpp: - (JSC::JSFunction::getOwnPropertySlot): - (JSC::JSFunction::getOwnPropertyDescriptor): - * runtime/JSObject.cpp: - (JSC::JSObject::defineGetter): - (JSC::JSObject::initializeGetterSetterProperty): - (JSC::JSObject::defineSetter): - (JSC::putDescriptor): - (JSC::JSObject::defineOwnProperty): - * runtime/JSObject.h: - * runtime/ObjectConstructor.cpp: - (JSC::objectConstructorDefineProperty): - * runtime/PropertyDescriptor.cpp: - (JSC::PropertyDescriptor::setDescriptor): - (JSC::PropertyDescriptor::setAccessorDescriptor): - (JSC::PropertyDescriptor::setSetter): - (JSC::PropertyDescriptor::setGetter): - (JSC::PropertyDescriptor::attributesOverridingCurrent): - -2012-01-11 Gavin Barraclough - - Object.defineProperty([], 'length', {}) should not make length read-only - https://bugs.webkit.org/show_bug.cgi?id=76097 - - Reviewed by Oliver Hunt. - - * runtime/JSArray.cpp: - (JSC::JSArray::defineOwnProperty): - - We should be checking writablePresent(). - -2012-01-11 Filip Pizlo - - Code duplication for invoking the JIT and DFG should be reduced - https://bugs.webkit.org/show_bug.cgi?id=76117 - - - Rubber stamped by Geoff Garen. - - * GNUmakefile.list.am: - * JavaScriptCore.xcodeproj/project.pbxproj: - * jit/JITDriver.h: Added. - (JSC::jitCompileIfAppropriate): - (JSC::jitCompileFunctionIfAppropriate): - * runtime/Executable.cpp: - (JSC::EvalExecutable::compileInternal): - (JSC::ProgramExecutable::compileInternal): - (JSC::FunctionExecutable::compileForCallInternal): - (JSC::FunctionExecutable::compileForConstructInternal): - -2012-01-11 Geoffrey Garen - - Bytecode dumping is broken for call opcodes (due to two new operands) - https://bugs.webkit.org/show_bug.cgi?id=75886 - - Reviewed by Oliver Hunt. - - * bytecode/CodeBlock.cpp: - (JSC::CodeBlock::printCallOp): Made a helper function, so I wouldn't have - to fix this more than once. The helper function skips the extra two operands - at the end of the opcode, used for optimization. - - (JSC::CodeBlock::dump): Used the helper function. - - * bytecode/CodeBlock.h: Declared the helper function. - -2012-01-09 Geoffrey Garen - - REGRESSION: d3 Bullet Charts demo doesn't work (call with argument assignment is broken) - https://bugs.webkit.org/show_bug.cgi?id=75911 - - * bytecompiler/BytecodeGenerator.h: - (JSC::BytecodeGenerator::emitNodeForLeftHandSide): Cleanup: No need to - explicitly cast to our return type in C++. - - * bytecompiler/NodesCodegen.cpp: - (JSC::FunctionCallResolveNode::emitBytecode): - (JSC::ApplyFunctionCallDotNode::emitBytecode): Make sure to copy our function - into a temporary register before evaluating our arguments, since argument - evaluation might include function calls or assignments that overwrite our callee by name. - -2012-01-11 Michael Saboff - - v8-regexp spends 35% of its time allocating and copying internal regexp results data - https://bugs.webkit.org/show_bug.cgi?id=76079 - - Reviewed by Geoffrey Garen. - - Added a new RegExpResults struct that has the input string, the number of - subexpressions and the output vector. Changed RegExpConstructor to - include a RegExpConstructorPrivate instead of having a reference to one. - Changed RegExpMatchesArray to include a RegExpResults instead of a - reference to a RegExpConstructorPrivate. Created an overloaded assignment - operator to assign a RegExpConstructorPrivate to a RegExpResults. - Collectively this change is worth 24% performance improvement to v8-regexp. - - * runtime/RegExpConstructor.cpp: - (JSC::RegExpResult::operator=): - (JSC::RegExpConstructor::RegExpConstructor): - (JSC::RegExpMatchesArray::RegExpMatchesArray): - (JSC::RegExpMatchesArray::finishCreation): - (JSC::RegExpMatchesArray::~RegExpMatchesArray): - (JSC::RegExpMatchesArray::fillArrayInstance): - (JSC::RegExpConstructor::arrayOfMatches): - (JSC::RegExpConstructor::getBackref): - (JSC::RegExpConstructor::getLastParen): - (JSC::RegExpConstructor::getLeftContext): - (JSC::RegExpConstructor::getRightContext): - (JSC::RegExpConstructor::setInput): - (JSC::RegExpConstructor::input): - (JSC::RegExpConstructor::setMultiline): - (JSC::RegExpConstructor::multiline): - * runtime/RegExpConstructor.h: - (JSC::RegExpResult::RegExpResult): - (JSC::RegExpConstructor::performMatch): - * runtime/RegExpMatchesArray.h: - (JSC::RegExpMatchesArray::create): - (JSC::RegExpMatchesArray::getOwnPropertySlot): - (JSC::RegExpMatchesArray::getOwnPropertySlotByIndex): - (JSC::RegExpMatchesArray::getOwnPropertyDescriptor): - (JSC::RegExpMatchesArray::put): - (JSC::RegExpMatchesArray::putByIndex): - (JSC::RegExpMatchesArray::deleteProperty): - (JSC::RegExpMatchesArray::deletePropertyByIndex): - (JSC::RegExpMatchesArray::getOwnPropertyNames): - -2012-01-11 Eugene Girard - - Typo in error message: Unexpected token 'defualt' - https://bugs.webkit.org/show_bug.cgi?id=75105 - - Reviewed by Simon Fraser. - - * parser/Parser.h: - (JSC::Parser::getTokenName): - -2012-01-11 Anders Carlsson - - Assertion failure in JSC::allocateCell trying to allocate a JSString - https://bugs.webkit.org/show_bug.cgi?id=76101 - - Reviewed by Adam Roben. - - Remove the ExecutableBase::s_info and JSString::s_info static member variables from the .def file and - export them explicitly using the JS_EXPORTDATA macro. - - member variables explicitly using - * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def: - * runtime/Executable.h: - * runtime/JSString.h: - -2012-01-10 Mark Rowe - - jsc should install directly in to versioned Resources subfolder - - This ensures that jsc ends up in a consistent location whether built in to the same DSTROOT - as JavaScriptCore.framework or in to a different one. - - Rubber-stamped by Dan Bernstein. - - * Configurations/JSC.xcconfig: Update INSTALL_PATH. - -2012-01-10 Filip Pizlo - - DFG inlining block linking compares BlockIndex against bytecode index - https://bugs.webkit.org/show_bug.cgi?id=76018 - - - Reviewed by Gavin Barraclough. - - * dfg/DFGByteCodeParser.cpp: - (JSC::DFG::ByteCodeParser::parseCodeBlock): - -2012-01-10 Filip Pizlo - - CodeBlock.h declares too many things - https://bugs.webkit.org/show_bug.cgi?id=76001 - - Rubber stamped by Gavin Barraclough. - - Removed all non-CodeBlock type declarations from CodeBlock.h, and put them - into separate header files. Also removed all non-CodeBlock method implementations - from CodeBlock.cpp and put them into corresponding cpp files. - - * CMakeLists.txt: - * GNUmakefile.list.am: - * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj: - * JavaScriptCore.xcodeproj/project.pbxproj: - * Target.pri: - * assembler/RepatchBuffer.h: - * bytecode/CallLinkInfo.cpp: Added. - (JSC::CallLinkInfo::unlink): - * bytecode/CallLinkInfo.h: Added. - (JSC::CallLinkInfo::callTypeFor): - (JSC::CallLinkInfo::CallLinkInfo): - (JSC::CallLinkInfo::~CallLinkInfo): - (JSC::CallLinkInfo::isLinked): - (JSC::CallLinkInfo::seenOnce): - (JSC::CallLinkInfo::setSeen): - (JSC::getCallLinkInfoReturnLocation): - (JSC::getCallLinkInfoBytecodeIndex): - * bytecode/CallReturnOffsetToBytecodeOffset.h: Added. - (JSC::CallReturnOffsetToBytecodeOffset::CallReturnOffsetToBytecodeOffset): - (JSC::getCallReturnOffset): - * bytecode/CodeBlock.cpp: - * bytecode/CodeBlock.h: - * bytecode/CodeType.h: Added. - * bytecode/ExpressionRangeInfo.h: Added. - * bytecode/GlobalResolveInfo.h: Added. - (JSC::GlobalResolveInfo::GlobalResolveInfo): - * bytecode/HandlerInfo.h: Added. - * bytecode/LineInfo.h: Added. - * bytecode/MethodCallLinkInfo.cpp: Added. - (JSC::MethodCallLinkInfo::reset): - * bytecode/MethodCallLinkInfo.h: Added. - (JSC::MethodCallLinkInfo::MethodCallLinkInfo): - (JSC::MethodCallLinkInfo::seenOnce): - (JSC::MethodCallLinkInfo::setSeen): - (JSC::getMethodCallLinkInfoReturnLocation): - (JSC::getMethodCallLinkInfoBytecodeIndex): - * bytecode/StructureStubInfo.h: - (JSC::getStructureStubInfoReturnLocation): - (JSC::getStructureStubInfoBytecodeIndex): - -2012-01-10 Anders Carlsson - - Hang opening movie that requires authentication - https://bugs.webkit.org/show_bug.cgi?id=75989 - - - Reviewed by Sam Weinig. - - * wtf/Functional.h: - Add function wrapper for a function that takes three parameters. - -2012-01-10 Filip Pizlo - - CodeBlock::m_numParameters should be encapsulated - https://bugs.webkit.org/show_bug.cgi?id=75985 - - - Reviewed by Oliver Hunt. - - Encapsulated CodeBlock::m_numParameters and hooked argument profile creation - into it. This appears to be performance neutral. - - * bytecode/CodeBlock.cpp: - (JSC::CodeBlock::CodeBlock): - (JSC::CodeBlock::setNumParameters): - (JSC::CodeBlock::addParameter): - * bytecode/CodeBlock.h: - (JSC::CodeBlock::numParameters): - (JSC::CodeBlock::addressOfNumParameters): - (JSC::CodeBlock::offsetOfNumParameters): - (JSC::CodeBlock::numberOfArgumentValueProfiles): - * bytecompiler/BytecodeGenerator.cpp: - (JSC::BytecodeGenerator::BytecodeGenerator): - (JSC::BytecodeGenerator::addParameter): - (JSC::BytecodeGenerator::emitReturn): - * dfg/DFGAbstractState.cpp: - (JSC::DFG::AbstractState::AbstractState): - * dfg/DFGByteCodeParser.cpp: - (JSC::DFG::ByteCodeParser::ByteCodeParser): - (JSC::DFG::ByteCodeParser::InlineStackEntry::InlineStackEntry): - * dfg/DFGGraph.cpp: - (JSC::DFG::Graph::predictArgumentTypes): - * dfg/DFGJITCompiler.cpp: - (JSC::DFG::JITCompiler::compileFunction): - * dfg/DFGOperations.cpp: - * dfg/DFGSpeculativeJIT.cpp: - (JSC::DFG::SpeculativeJIT::checkArgumentTypes): - * dfg/DFGSpeculativeJIT.h: - (JSC::DFG::SpeculativeJIT::SpeculativeJIT): - * interpreter/Interpreter.cpp: - (JSC::Interpreter::slideRegisterWindowForCall): - (JSC::Interpreter::dumpRegisters): - (JSC::Interpreter::execute): - (JSC::Interpreter::prepareForRepeatCall): - * jit/JIT.cpp: - (JSC::JIT::privateCompile): - * jit/JITStubs.cpp: - (JSC::arityCheckFor): - (JSC::lazyLinkFor): - * runtime/Executable.cpp: - (JSC::FunctionExecutable::compileForCallInternal): - (JSC::FunctionExecutable::compileForConstructInternal): - -2012-01-10 Gavin Barraclough - - Build fix following https://bugs.webkit.org/show_bug.cgi?id=75935 - - Fix 32-bit builds. - - * runtime/JSArray.cpp: - (JSC::JSArray::getOwnPropertyNames): - (JSC::JSArray::setLength): - -2012-01-10 Gavin Barraclough - - Windows build fix. - - * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def: - -2012-01-10 Gavin Barraclough - - Do not allow Array length to be set if it is non-configurable - https://bugs.webkit.org/show_bug.cgi?id=75935 - - Reviewed by Sam Weinig. - - Do not allow Array length to be set if it is non-configurable, and if the new - length is less than the old length then intervening properties should removed - in reverse order. Removal of properties should cease if an intervening indexed - property being removed is non-configurable. - - * JavaScriptCore.exp: - - Removed export for setLength. - * runtime/ArrayPrototype.cpp: - (JSC::arrayProtoFuncConcat): - - JSArray::setLength now takes an ExecState* - (JSC::arrayProtoFuncSlice): - - JSArray::setLength now takes an ExecState* - * runtime/JSArray.cpp: - (JSC::JSArray::defineOwnProperty): - - JSArray::setLength now takes an ExecState* - (JSC::JSArray::put): - - JSArray::setLength now takes an ExecState* - (JSC::compareKeysForQSort): - - Keys extracted from the map can be stored as unsigneds. - (JSC::JSArray::getOwnPropertyNames): - - Keys extracted from the map can be stored as unsigneds. - (JSC::JSArray::setLength): - - Check lengthIsReadOnly(), rather than copying the entire map to iterate - over to determine which keys to remove, instead just copy the keys from - the map to a Vector. When inSparseMode sort the keys in the Vector so - that we can remove properties in reverse order. - * runtime/JSArray.h: - - JSArray::setLength now takes an ExecState* - -2012-01-10 Gavin Barraclough - - Use SameValue to compare property descriptor values - https://bugs.webkit.org/show_bug.cgi?id=75975 - - Reviewed by Sam Weinig. - - Rather than strictEqual. - - * runtime/JSArray.cpp: - (JSC::JSArray::defineOwnNumericProperty): - - Missing configurablePresent() check. - * runtime/JSObject.cpp: - (JSC::JSObject::defineOwnProperty): - - call sameValue. - * runtime/PropertyDescriptor.cpp: - (JSC::sameValue): - - Moved from JSArray.cpp, fix NaN comparison. - (JSC::PropertyDescriptor::equalTo): - - call sameValue. - * runtime/PropertyDescriptor.h: - - Added declaration for sameValue. -2012-01-09 Gavin Barraclough - - Error handling : in ISO8601 timezone - https://bugs.webkit.org/show_bug.cgi?id=75919 - - Reviewed by Sam Weinig. - - * wtf/DateMath.cpp: - (WTF::parseDateFromNullTerminatedCharacters): - - need to increment the string position. - -2012-01-09 Mark Rowe - - JavaScriptCore executable targets shouldn't explicitly depend on the JavaScriptCore framework target - / - - We'd like for it to be possible to build jsc without building JavaScriptCore.framework and the explicit - dependencies prevent this. - - Reviewed by Dan Bernstein. - - * JavaScriptCore.xcodeproj/project.pbxproj: - -2012-01-09 Adam Treat - - Log is a little to verbose for blackberry port - https://bugs.webkit.org/show_bug.cgi?id=75728 - - The BlackBerry::Platform::Log* functions take care of the call to vfprintf - which is resulting in unintentional noise in our logs. Add a conditional - directive to fix. - - Change to using BlackBerry::Platform::logStreamV which does not insert - threading info and newlines unlike BlackBerry::Platform::log. - - Finally, add log locking and unlocking which the BlackBerry platform - uses to ensure that N threads do not trample on each other's logs. - - Reviewed by Rob Buis. - - * wtf/Assertions.cpp: - (WTFLogLocker::WTFReportAssertionFailure): - (WTFLogLocker::WTFReportAssertionFailureWithMessage): - (WTFLogLocker::WTFReportArgumentAssertionFailure): - (WTFLogLocker::WTFReportFatalError): - (WTFLogLocker::WTFReportError): - (WTFLogLocker::WTFLog): - (WTFLogLocker::WTFLogVerbose): - -2012-01-09 Gavin Barraclough - - https://bugs.webkit.org/show_bug.cgi?id=75789 - defineOwnProperty not implemented for Array objects - - Reviewed by Sam Weinig. - - Implements support for getter/setter & non-default attribute properties on arrays, - by forcing them into a dictionary-like 'SparseMode'. This fixes ~300 test-262 - test failures. - - * JavaScriptCore.exp: - - Updated exports. - * dfg/DFGOperations.cpp: - - JSArray::pop now requires an exec state. - * runtime/ArrayPrototype.cpp: - (JSC::arrayProtoFuncPop): - - JSArray::pop now requires an exec state. - * runtime/JSArray.cpp: - (JSC::SparseArrayValueMap::add): - - Add a potentially empty entry into the map. - (JSC::SparseArrayValueMap::put): - - Changed to call setter. - (JSC::SparseArrayEntry::get): - - calls getters. - (JSC::SparseArrayEntry::getNonSparseMode): - - does not call getters. - (JSC::JSArray::enterSparseMode): - - Convert into 'SparseMode' - removes the vectors, don't allow it to be recreated. - (JSC::JSArray::putDescriptor): - - Create a numeric property based on a descriptor. - (JSC::sameValue): - - See ES5.1 9.12. - (JSC::reject): - - Helper for the [[DefineOwnProperty]] algorithm. - (JSC::JSArray::defineOwnNumericProperty): - - Define an indexed property on an array object. - (JSC::JSArray::setLengthWritable): - - Marks the length read-only, enters SparseMode as necessary. - (JSC::JSArray::defineOwnProperty): - - Defines either an indexed property or 'length' on an array object. - (JSC::JSArray::getOwnPropertySlotByIndex): - - Updated to correctly handle accessor descriptors & attributes. - (JSC::JSArray::getOwnPropertyDescriptor): - - Updated to correctly handle accessor descriptors & attributes. - (JSC::JSArray::put): - - Pass strict mode flag to setLength. - (JSC::JSArray::putByIndex): - - putByIndexBeyondVectorLength requires an ExecState* rather than a JSGloablData&. - (JSC::JSArray::putByIndexBeyondVectorLength): - - Pass exec to SparseArrayValueMap::put. - (JSC::JSArray::deletePropertyByIndex): - - Do not allow deletion of non-configurable properties. - (JSC::compareKeysForQSort): - - used in implementation of getOwnPropertyNames. - (JSC::JSArray::getOwnPropertyNames): - - Properties in the sparse map should be iterated in order. - (JSC::JSArray::setLength): - - Updated to take a 'shouldThrow' flag, return a result indicating error. - (JSC::JSArray::pop): - - pop should throw an error if length is not writable, even if the array is empty. - (JSC::JSArray::push): - - putByIndexBeyondVectorLength requires an ExecState* rather than a JSGloablData&. - (JSC::JSArray::sort): - - Changed 'get' to 'getNonSparseMode' (can't be getters to call). - (JSC::JSArray::compactForSorting): - - Changed 'get' to 'getNonSparseMode' (can't be getters to call). - * runtime/JSArray.h: - (JSC::SparseArrayValueMap::lengthIsReadOnly): - - Check if the length is read only. - (JSC::SparseArrayValueMap::setLengthIsReadOnly): - - Mark the length as read only. - (JSC::SparseArrayValueMap::find): - - Moved into header. - (JSC::JSArray::isLengthWritable): - - Wraps SparseArrayValueMap::lengthIsReadOnly. - * runtime/JSObject.cpp: - (JSC::JSObject::defineOwnProperty): - - Should be returning the result of putDescriptor. - * runtime/PropertyDescriptor.cpp: - (JSC::PropertyDescriptor::attributesOverridingCurrent): - - Added attributesOverridingCurrent - this should probably be merged with attributesWithOverride. - * runtime/PropertyDescriptor.h: - - Added attributesOverridingCurrent. - -2012-01-09 Pavel Heimlich - - There is no support for fastcall in Solaris Studio. - Fixes build on Solaris. - https://bugs.webkit.org/show_bug.cgi?id=75736 - - Reviewed by Gavin Barraclough. - - * jit/JITStubs.h: - -2012-01-09 Pavel Heimlich - - Fix build failure on Solaris - https://bugs.webkit.org/show_bug.cgi?id=75733 - - Reviewed by Gavin Barraclough. - - * wtf/ByteArray.h: - -2012-01-01 Raphael Kubo da Costa - - [CMake] Clean up some cruft from WTF's CMakeLists.txt - https://bugs.webkit.org/show_bug.cgi?id=75420 - - Reviewed by Daniel Bates. - - * wtf/CMakeLists.txt: Remove the unused WTF_PORT_FLAGS variable; add - all needed paths to WTF_INCLUDE_DIRECTORIES in a single place. - -2012-01-08 Xianzhu Wang - - Fix compilation error about ListHashSetReverseIterator - https://bugs.webkit.org/show_bug.cgi?id=75372 - - Reviewed by Darin Adler. - - There is a typo in class ListHashSetReverseIterator: - typedef ListHashSetConstIterator const_reverse_iterator; - Should be - typedef ListHashSetConstReverseIterator const_reverse_iterator; - - * wtf/ListHashSet.h: - -2012-01-08 Ryosuke Niwa - - WinCE build fix after r104415. - - * jit/JITExceptions.cpp: - * jit/JITExceptions.h: - -2012-01-08 Filip Pizlo - - The JIT's protocol for exception handling should be available to other parts of the system - https://bugs.webkit.org/show_bug.cgi?id=75808 - - - Reviewed by Oliver Hunt. - - * CMakeLists.txt: - * GNUmakefile.list.am: - * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj: - * JavaScriptCore.xcodeproj/project.pbxproj: - * Target.pri: - * jit/JITExceptions.cpp: Added. - (JSC::genericThrow): - (JSC::jitThrow): - * jit/JITExceptions.h: Added. - * jit/JITStubs.cpp: - * runtime/JSGlobalData.h: - -2012-01-06 Hajime Morrita - - https://bugs.webkit.org/show_bug.cgi?id=75296 - JSString should not have JS_EXPORTCLASS annotation - - Reviewed by Kevin Ollivier. - - * runtime/JSString.h: Removed JS_EXPORTCLASS annotation. - * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def: - Added missing symbols which were hidden by JS_EXPORTCLASS. - -2012-01-06 Michael Saboff - - JSArray::pop() should compare SparseArrayValueMap::find() to SparseArrayValueMap::notFound() - https://bugs.webkit.org/show_bug.cgi?id=75757 - - Reviewed by Gavin Barraclough. - - * runtime/JSArray.cpp: - (JSC::JSArray::pop): Changed map->end() to map->notFound(). - -2012-01-06 Filip Pizlo - - JIT stub slow paths that would be identical to that of an interpreter should be factored out - https://bugs.webkit.org/show_bug.cgi?id=75743 - - - Reviewed by Geoff Garen. - - * GNUmakefile.list.am: - * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj: - * JavaScriptCore.xcodeproj/project.pbxproj: - * jit/JITStubs.cpp: - (JSC::DEFINE_STUB_FUNCTION): - * runtime/CommonSlowPaths.h: Added. - (JSC::CommonSlowPaths::opInstanceOfSlow): - (JSC::CommonSlowPaths::opIn): - (JSC::CommonSlowPaths::opResolve): - (JSC::CommonSlowPaths::opResolveSkip): - (JSC::CommonSlowPaths::opResolveWithBase): - (JSC::CommonSlowPaths::opResolveWithThis): - -2012-01-06 Sam Weinig - - Fix windows build. - - * wtf/TypeTraits.cpp: - -2012-01-05 Michael Saboff - - Default HashTraits for Opcode don't work for Opcode = 0 - https://bugs.webkit.org/show_bug.cgi?id=75595 - - Reviewed by Oliver Hunt. - - Removed the populating of the m_opcodeIDTable table in the - case where the OpcodeID and Opcode are the same (m_enabled is false). - Instead we just cast the one type to the other. - - * interpreter/Interpreter.cpp: - (JSC::Interpreter::initialize): - (JSC::Interpreter::isOpcode): - * interpreter/Interpreter.h: - (JSC::Interpreter::getOpcodeID): - -2012-01-06 Sam Weinig - - Add a DecayArray type trait as a first step towards merging OwnPtr and OwnArrayPtr - https://bugs.webkit.org/show_bug.cgi?id=75737 - - Reviewed by Anders Carlsson. - - * wtf/TypeTraits.cpp: - * wtf/TypeTraits.h: - Added a DecayArray trait, that can convert T[] and T[3] -> T*. DecayArray - is composed of some helpers which are also exposed, Conditional<>, which - can provide one type or another based on a boolean predicate, IsArray<> - which can deduce array types, and RemoveExtent<>, which removes the extent - from an array type. - -2012-01-06 Oliver Hunt - - GetByteArrayLength is incorrect - https://bugs.webkit.org/show_bug.cgi?id=75735 - - Reviewed by Filip Pizlo. - - Load the byte array length from the correct location. - This stops an existing test from hanging. - - * dfg/DFGSpeculativeJIT32_64.cpp: - (JSC::DFG::SpeculativeJIT::compile): - * dfg/DFGSpeculativeJIT64.cpp: - (JSC::DFG::SpeculativeJIT::compile): - -2012-01-06 Filip Pizlo - - Fix build. - - * JavaScriptCore.xcodeproj/project.pbxproj: - -2012-01-06 Oliver Hunt - - DFG no longer optimises CanvasPixelArray - https://bugs.webkit.org/show_bug.cgi?id=75729 - - Reviewed by Gavin Barraclough. - - Rename ByteArray (in its ClassInfo) to Uint8ClampedArray to match - the future name when we switch over to the new typed-array based - ImageData specification. - - * runtime/JSByteArray.cpp: - -2012-01-06 Caio Marcelo de Oliveira Filho - - Use HashMap for SourceProviderCache items - https://bugs.webkit.org/show_bug.cgi?id=75346 - - Reviewed by Daniel Bates. - - * parser/Parser.cpp: - * parser/SourceProviderCache.cpp: - (JSC::SourceProviderCache::clear): - (JSC::SourceProviderCache::add): - * parser/SourceProviderCache.h: - -2012-01-06 Sam Weinig - - Remove unused OwnFastMallocPtr class. - https://bugs.webkit.org/show_bug.cgi?id=75722 - - Reviewed by Geoffrey Garen. - - * GNUmakefile.list.am: - * JavaScriptCore.gypi: - * JavaScriptCore.vcproj/WTF/WTF.vcproj: - * JavaScriptCore.xcodeproj/project.pbxproj: - * wtf/CMakeLists.txt: - * wtf/OwnFastMallocPtr.h: Removed. - * wtf/text/StringImpl.h: - * wtf/wtf.pro: - -2012-01-06 Benjamin Poulain - - [Mac] Sort the resources of JavaScriptCore.xcodeproj and remove duplicates - https://bugs.webkit.org/show_bug.cgi?id=75631 - - Reviewed by Andreas Kling. - - * JavaScriptCore.xcodeproj/project.pbxproj: - -2012-01-06 Eric Seidel and Gustavo Noronha Silva - - Make the new WTF module build on Gtk - https://bugs.webkit.org/show_bug.cgi?id=75669 - - * GNUmakefile.am: - -2012-01-06 Tor Arne Vestbø - - [Qt] Remove un-needed VPATHs from project includes - - Reviewed by Simon Hausmann. - - * JavaScriptCore.pri: - * wtf/wtf.pri: - -2012-01-06 Tor Arne Vestbø - - [Qt] Move listing of include paths and libs to pri files in sources - - Includepaths are sometimes modified by non-Qt contributors so keeping - them in files inside Sources makes it more likely that they are updated - along with project files for the other ports. - - Using pri files instead of prf files for this also has the benefit that - the include() from the main target file can be parsed and followed by - Qt Creator -- something that does not work with load(). - - Dependency from a target to a library through the WEBKIT variable are - handled through forwarding-files in Tools/qmake/mkspecs/modules, which - set the source root of the module and include the right pri file. - - Ideally we'd use the variant of include() that takes an optional - namespace to read the variables into, or the fromfile() function, - but both of these add an overhead of about 40% on the total qmake - runtime, due to making a deep copy of all the variables in the - project or re-reading all the prf files from scratch. - - Reviewed by Simon Hausmann. - Reviewed by Ossy. - - * JavaScriptCore.pri: Renamed from Tools/qmake/mkspecs/features/javascriptcore.prf. - * Target.pri: - * wtf/wtf.pri: Renamed from Tools/qmake/mkspecs/features/wtf.prf. - * wtf/wtf.pro: - -2012-01-06 Hajime Morrita - - WTF::String: Inline method shouldn't have WTF_EXPORT_PRIVATE - https://bugs.webkit.org/show_bug.cgi?id=75612 - - Reviewed by Kevin Ollivier. - - * wtf/text/WTFString.h: - (WTF::String::findIgnoringCase): - (WTF::String::append): - (WTF::String::fromUTF8): - (WTF::String::fromUTF8WithLatin1Fallback): - (WTF::String::isHashTableDeletedValue): - -2012-01-05 Dan Bernstein - - Update copyright strings - - Reviewed by Mark Rowe. - - * Info.plist: - -2012-01-05 Gavin Barraclough - - Date constructor handles infinite values incorrectly. - https://bugs.webkit.org/show_bug.cgi?id=70998 - - Reviewed by Filip Pizlo. - - * runtime/DateConstructor.cpp: - (JSC::constructDate): - - should be checking !finite rather then isnan. - -2012-01-05 Gavin Barraclough - - date.toISOString produces incorrect results for dates with ms prior to 1970 - https://bugs.webkit.org/show_bug.cgi?id=75684 - - Reviewed by Sam Weinig. - - * runtime/DatePrototype.cpp: - (JSC::dateProtoFuncToISOString): - -2012-01-05 Gavin Barraclough - - Array.prototype.lastIndexOf ignores undefined fromIndex. - https://bugs.webkit.org/show_bug.cgi?id=75678 - - Reviewed by Sam Weinig. - - array.lastIndexOf(x, undefined) is equivalent to array.lastIndexOf(x, 0), not array.lastIndexOf(x) - - * runtime/ArrayPrototype.cpp: - (JSC::arrayProtoFuncLastIndexOf): - - should check argumnet count, rather than checking agument value for undefined. - -2012-01-05 Gavin Barraclough - - Date parsing is too restrictive. - https://bugs.webkit.org/show_bug.cgi?id=75671 - - Reviewed by Oliver Hunt. - - ES5 date parsing currently requires all fields to be present, which does not match the spec (ES5.1 15.9.1.15). - The spec allow a date to be date only, or date + time. - - The date portion on the should match: (pseudocode!:) - [(+|-)YY]YYYY[-MM[-DD]] - though we are slightly more liberal (permitted by the spec), allowing: - [+|-]Y+[-MM[-DD]] - The time portion should match: - THH:mm[:ss[.sss]][Z|(+|-)HH:mm] - again we're slightly more liberal, allowing: - THH:mm[:ss[.s+]][Z|(+|-)HH:mm] - - * wtf/DateMath.cpp: - (WTF::parseES5DatePortion): - - Month/day fields are optional, default to 01. - (WTF::parseES5TimePortion): - - Hours/Minutes are requires, seconds/timezone are optional. - (WTF::parseES5DateFromNullTerminatedCharacters): - - Dates may be date only, or date + time. - -2012-01-05 Bruno Dilly - - [EFL] Undefined references to ICU_I18N symbols on WTF - https://bugs.webkit.org/show_bug.cgi?id=75642 - - Unreviewed build fix. - - Add ${ICU_I18N_LIBRARIES} to WTF_LIBRARIES on wtf efl platform cmake. - Some undefined references were ucol_setAttribute_44, ucol_close_44, - ucol_getAttribute_44... - - * wtf/PlatformEfl.cmake: - -2012-01-05 Geoffrey Garen - - Refined the fast path for StringImpl::hash() - https://bugs.webkit.org/show_bug.cgi?id=75178 - - Reviewed by Darin Adler. - - Moved the hash calculation code into an out-of-line function to clean up - the hot path. - - No measurable benchmark change, but this knocks some samples off in - Instruments, and I think this is a step toward removing -fomit-frame-pointer. - - * wtf/text/StringImpl.cpp: - (WTF::StringImpl::hashSlowCase): - * wtf/text/StringImpl.h: - (WTF::StringImpl::hash): The patch. - - * wtf/text/StringStatics.cpp: - (WTF::StringImpl::hashSlowCase): Abide by the cockamamie Windows build - scheme, which requires all out-of-line StringImpl functions used by - WebCore be defined in this file instead of StringImpl.cpp. (See http://trac.webkit.org/changeset/59187.) - -2012-01-05 Gavin Barraclough - - Literal tab in JSONString fails - https://bugs.webkit.org/show_bug.cgi?id=71772 - - Reviewed by Oliver Hunt. - - rfc4627 does not allow literal tab characters in JSON source. - - * runtime/LiteralParser.cpp: - (JSC::isSafeStringCharacter): - - do not allow literal tab in StrictJSON mode. - -2012-01-05 Gavin Barraclough - - push/shift fifo may consume excessive memory - https://bugs.webkit.org/show_bug.cgi?id=75610 - - Reviewed by Sam Weinig. - - Array object commonly store data in a vector, consisting of a portion that is - in use, a pre-capacity (m_indexBias) and a post-capacity (the delta between - m_length and m_vectorLength). Calls to shift with grow the pre-capacity, and - the current algorithm for increaseVectorLength (used by push, or [[Put]]) will - never shrink the pre-capacity, so a push/shift fifo may consume an inordinate - amount of memory, whilst having a relatively small active length. - - * runtime/JSArray.cpp: - (JSC::JSArray::increaseVectorLength): - - If m_indexBias is non-zero, decay it over time. - -2012-01-05 Csaba Osztrogonác - - unshift/pop fifo may consume excessive memory - https://bugs.webkit.org/show_bug.cgi?id=75588 - - Reviewed by Zoltan Herczeg. - - Buildfix after r104120. - - * runtime/JSArray.cpp: Remove useless asserts, baecause unsigned expression >= 0 is always true - (JSC::JSArray::unshiftCount): - -2012-01-05 Zoltan Herczeg - - Unreviewed gardening after r104134. - - * wtf/Assertions.cpp: - -2012-01-05 Zoltan Herczeg - - Unreviewed gardening after r75605. - - Rubber stamped by NOBODY Csaba Osztrogonác. - - * wtf/Assertions.cpp: - -2012-01-05 Benjamin Poulain - - Improve charactersAreAllASCII() to compare multiple characters at a time - https://bugs.webkit.org/show_bug.cgi?id=74063 - - Reviewed by Darin Adler. - - A new header ASCIIFastPath.h contains the functions related to - the detection of ASCII by using machine words. Part of it comes from - WebCore's TextCodecASCIIFastPath.h. - - The function charactersAreAllASCII() is moved to TextCodecASCIIFastPath.h - and is implemented with computer word comparison. - The gain over the previous implementation of charactersAreAllASCII() is of - the order of how many comparison are avoided (4x, 8x, 16x depending on the - format and the CPU type). - - * GNUmakefile.list.am: - * JavaScriptCore.gypi: - * JavaScriptCore.vcproj/WTF/WTF.vcproj: - * JavaScriptCore.xcodeproj/project.pbxproj: - * wtf/text/ASCIIFastPath.h: Added. - (WTF::isAlignedToMachineWord): - (WTF::alignToMachineWord): - (WTF::isAllASCII): - (WTF::charactersAreAllASCII): - * wtf/text/WTFString.h: - * wtf/wtf.pro: - -2012-01-05 Mark Rowe - - [Mac] WTF logging functions should output to both stderr and ASL - - We should always log to both ASL and stderr on platforms where this won't result in launchd - duplicating the messages. - - Reviewed by Dan Bernstein. - - * wtf/Assertions.cpp: - (vprintf_stderr_common): - -2012-01-05 Mark Rowe - - WTF logging functions should call vprintf_stderr_common only once per line - - Several of the WTF logging functions make multiple calls to vprintf_stderr_common to output a - single line of text. This results in strangely formatted output if vprintf_stderr_common is - retargeted to an output device that is message-oriented (such as ASL) rather than stream-oriented - like stderr. - - Reviewed by Dan Bernstein. - - * wtf/Assertions.cpp: - (vprintf_stderr_with_prefix): Helper function to prepend a given prefix on to the given format - string before handing it off to vprintf_stderr_common. This requires disabling warnings about - calling a printf-like function with a non-literal format string for this piece of code. It's - safe in this particular case as vprintf_stderr_with_prefix is only ever given a literal prefix. - (vprintf_stderr_with_trailing_newline): Helper function to append a trailling newline on to the - given format string if one does not already exist. It requires the same treatment with regards - to the non-literal format string warning. - (WTFReportAssertionFailureWithMessage): Switch to using vprintf_stderr_with_prefix. - (WTFReportBacktrace): Switch from calling fprintf directly to using fprintf_stderr_common. - (WTFReportFatalError): Switch to using vprintf_stderr_with_prefix. - (WTFReportError): Ditto. - (WTFLog): Switch to using vprintf_stderr_with_trailing_newline. - (WTFLogVerbose): Ditto. - -2012-01-04 Gavin Barraclough - - unshift/pop fifo may consume excessive memory - https://bugs.webkit.org/show_bug.cgi?id=75588 - - Reviewed by Sam Weinig. - - The Array object commonly store data in a vector, consisting of a portion that - is in use, a pre-capacity (m_indexBias) and a post-capacity (the delta between - m_length and m_vectorLength). Calls to pop with grow the post-capacity, and the - current algorithm for increasePrefixVectorLength (used by unshift) will never - stink the post-capacity, so a unshift/pop fifo may consume an inordinate amount - of memory, whilst having a relatively small active length. - - * runtime/JSArray.cpp: - (JSC::storageSize): - - sizeof(JSValue) should be sizeof(WriteBarrier) - (JSC::SparseArrayValueMap::put): - - sizeof(JSValue) should be sizeof(WriteBarrier) - (JSC::JSArray::increaseVectorLength): - - sizeof(JSValue) should be sizeof(WriteBarrier) - (JSC::JSArray::unshiftCountSlowCase): - - renamed from increaseVectorPrefixLength (this was a bad name, since it - also moved the ArrayStorage header), rewritten. - (JSC::JSArray::shiftCount): - - sizeof(JSValue) should be sizeof(WriteBarrier), count should be unsigned - (JSC::JSArray::unshiftCount): - - sizeof(JSValue) should be sizeof(WriteBarrier), count should be unsigned, - increaseVectorPrefixLength renamed to unshiftCountSlowCase - (JSC::JSArray::sortNumeric): - * runtime/JSArray.h: - - Updated function declarations, m_indexBias should be unsigned. - -2012-01-04 Mark Rowe - - All instances of JSC::ArgumentsData appear to be leaked by JSC::Arguments - - Since JSC::Arguments has an OwnPtr for a member it needs to override destroy - to ensure that the correct destructor is invoked. This is necessary because - JSCell subclasses all intentionally have non-virtual destructors. - - Reviewed by Filip Pizlo. - - * runtime/Arguments.cpp: - (JSC::Arguments::destroy): - * runtime/Arguments.h: - -2012-01-04 Filip Pizlo - - Unreviewed, accidentally turned off the JIT in previous commit. Turning - it back on. - - * wtf/Platform.h: - -2012-01-04 Filip Pizlo - - Changed "return" to "break" in some macrology I introduced in - http://trac.webkit.org/changeset/104086. This is a benign change, as - "return" was technically correct for all uses of the macro. - - Reviewed by Oliver Hunt. - - * dfg/DFGGraph.cpp: - * wtf/Platform.h: - -2012-01-04 Michael Saboff - - StructureStubInfo not reset when corresponding MethodCallLinkInfo is reset - https://bugs.webkit.org/show_bug.cgi?id=75583 - - Reviewed by Filip Pizlo. - - * bytecode/CodeBlock.cpp: - (JSC::CodeBlock::finalizeUnconditionally): Find the corresponding - StructureStubInfo and reset the appropriate JIT and - the StructureStubInfo itself when reseting a MethodCallLinkInfo. - -2012-01-04 Michael Saboff - - Invalid ASSERT() in DFGRepatch.cpp near line 385 - https://bugs.webkit.org/show_bug.cgi?id=75584 - - Reviewed by Filip Pizlo. - - * dfg/DFGRepatch.cpp: - (JSC::DFG::tryBuildGetByIDProtoList): Fixed ASSERT to use ==. - -2012-01-04 Filip Pizlo - - Incorrect use of DFG node reference counts when mutating the graph - https://bugs.webkit.org/show_bug.cgi?id=75580 - - - Reviewed by Oliver Hunt. - - Made deref(node) follow the pattern of ref(node), which it should have - to begin with. - - * dfg/DFGGraph.cpp: - (JSC::DFG::Graph::refChildren): - (JSC::DFG::Graph::derefChildren): - * dfg/DFGGraph.h: - (JSC::DFG::Graph::deref): - (JSC::DFG::Graph::clearAndDerefChild1): - (JSC::DFG::Graph::clearAndDerefChild2): - (JSC::DFG::Graph::clearAndDerefChild3): - * dfg/DFGNode.h: - (JSC::DFG::Node::deref): - * dfg/DFGPropagator.cpp: - (JSC::DFG::Propagator::fixupNode): - -2012-01-04 Tor Arne Vestbø - - [Qt] Introduce new qmake variable 'WEBKIT' for signaling dependencies - - The custom qmake variable 'WEBKIT' is used for signaling that a - target depends in some way on other subproject of the WebKit - project. For now this is limited to the set of intermediate - libraries: wtf, javascriptcore, webcore, and webkit2. - - This replaces the previous convension of using load(foo) for - just include paths, and CONFIG += foo to also link against foo. - - Adding a dependency results in additional include paths being - available, and potentially linking to the library. This is - decided by the build system based on conditions such as what - kind of target is being built and the general build config. - - An advantage to his approach is that it simplifies the individual - foo.prf files, for example by allowing us to use INCLUDEPATH += - and LIBS += as normal instead of prepending. - - Reviewed by Simon Hausmann. - - * Target.pri: - * jsc.pro: - * wtf/wtf.pro: - -2012-01-03 Filip Pizlo - - DFG: The assertion that a double-voted variable cannot become double-unvoted is wrong - https://bugs.webkit.org/show_bug.cgi?id=75516 - - - Reviewed by Gavin Barraclough. - - Removed the offending assertion, since it was wrong. Also hardened the code to make - this case less likely by first having the propagator fixpoint converge, and then doing - double voting combined with a second fixpoint. This is neutral on benchmarks and - fixes the assertion in a fairly low-risk way (i.e. we won't vote a variable double - until we've converged to the conclusion that it really is double). - - * dfg/DFGPropagator.cpp: - (JSC::DFG::Propagator::propagatePredictions): - * dfg/DFGVariableAccessData.h: - (JSC::DFG::VariableAccessData::tallyVotesForShouldUseDoubleFormat): - -2012-01-03 Filip Pizlo - - REGRESSION (r98196-98236): Incorrect layout of iGoogle with RSS feeds - https://bugs.webkit.org/show_bug.cgi?id=75303 - - - Reviewed by Gavin Barraclough. - - The this argument was not being kept alive in some cases during inlining and intrinsic - optimizations. - - * dfg/DFGByteCodeParser.cpp: - (JSC::DFG::ByteCodeParser::handleCall): - (JSC::DFG::ByteCodeParser::emitFunctionCheck): - (JSC::DFG::ByteCodeParser::handleInlining): - -2012-01-03 Gavin Barraclough - - Windows build fix. - - * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def: - -2012-01-03 Gavin Barraclough - - Windows build fix. - - * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def: - -2012-01-03 Gavin Barraclough - - https://bugs.webkit.org/show_bug.cgi?id=75140 - - Reviewed by Sam Weinig. - - Rewrite JSArray::putSlowCase to be much cleaner & simpler. - - This rewrite only significantly changes behaviour for sparse array, specifically - in how sparse arrays are reified back to vector form. This does not affect arrays - with less than 10000 entries (since these always use a vector). The more common - cases of sparse array behavior (though large sparse arrays are rare) - arrays that - always remain sparse, and arrays that are filled in reverse sequential order - - should be just as fast or faster (since reification is simpler & no longer - requires map lookups) after these changes. - - Simplifying this code allows all cases of putByIndex that need to grow the vector - to do so via increaseVectorLength, which means that this method can encapsulate - the policy of determining how the vector should be grown. - - No performance impact. - - * runtime/JSArray.cpp: - (JSC::isDenseEnoughForVector): - - any array of length <= MIN_SPARSE_ARRAY_INDEX is dense enough for a vector. - (JSC::JSArray::putByIndex): - - simplify & comment. - (JSC::JSArray::putByIndexBeyondVectorLength): - - Re-written to be much clearer & simpler. - (JSC::JSArray::increaseVectorLength): - (JSC::JSArray::increaseVectorPrefixLength): - - add explicit checks against MAX_STORAGE_VECTOR_LENGTH, so clients do not need do so. - (JSC::JSArray::push): - - simplify & comment. - * runtime/JSArray.h: - - removed SparseArrayValueMap::take. - -2012-01-03 Gavin Barraclough - - Windows build fix. - - * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def: - -2012-01-03 Gavin Barraclough - - https://bugs.webkit.org/show_bug.cgi?id=75140 - - Reviewed by Sam Weinig. - - Simplify JSArray creation - remove ArgsList/JSValue* create methods - (this functionality can be implemented in terms of tryCreateUninitialized). - - * JavaScriptCore.exp: - * runtime/ArrayConstructor.cpp: - - use constructArray/constructEmptyArray instead of calling JSArray::create directly - (JSC::constructArrayWithSizeQuirk): - * runtime/JSArray.cpp: - * runtime/JSArray.h: - - removed ArgsList/JSValue* create methods - * runtime/JSGlobalObject.h: - (JSC::constructEmptyArray): - (JSC::constructArray): - - changed to be implemented in terms of JSArray::tryCreateUninitialized - -2012-01-03 Gavin Barraclough - - https://bugs.webkit.org/show_bug.cgi?id=75429 - ThrowTypeError should be a singleton object - - Reviewed by Sam Weinig. - - Per section 13.2.3 of the spec. - We could change setAccessorDescriptor to be able to share the global - GetterSetter object, rather than storing the accessor functions and - creating a new GetterSetter in defineProperty - but this won't be a - small change to PropertyDescriptors (and would probably mean making - GetterSetter objects immutable?) - so I'll leave that for another - patch. - - * JavaScriptCore.exp: - - don't export setAccessorDescriptor - * runtime/Arguments.cpp: - (JSC::Arguments::createStrictModeCallerIfNecessary): - (JSC::Arguments::createStrictModeCalleeIfNecessary): - - call throwTypeErrorGetterSetter instead of createTypeErrorFunction - * runtime/Error.cpp: - * runtime/Error.h: - - remove createTypeErrorFunction - * runtime/JSFunction.cpp: - * runtime/JSFunction.h: - - remove unused createDescriptorForThrowingProperty - * runtime/JSGlobalObject.cpp: - (JSC::JSGlobalObject::reset): - (JSC::JSGlobalObject::visitChildren): - - removed m_strictModeTypeErrorFunctionStructure. - * runtime/JSGlobalObject.h: - (JSC::JSGlobalObject::internalFunctionStructure): - - removed m_strictModeTypeErrorFunctionStructure. - * runtime/PropertyDescriptor.cpp: - (JSC::PropertyDescriptor::setAccessorDescriptor): - - changed to take a GetterSetter - * runtime/PropertyDescriptor.h: - - changed to take a GetterSetter - -2012-01-02 Gavin Barraclough - - Check in fixes for jsc tests following bug #75455. - - * tests/mozilla/ecma/GlobalObject/15.1.2.2-1.js: - * tests/mozilla/ecma/GlobalObject/15.1.2.2-2.js: - -2012-01-02 Gavin Barraclough - - https://bugs.webkit.org/show_bug.cgi?id=75452 - If argument to Error is undefined, message is not set - - Reviewed by Sam Weinig. - - Per section 15.11.1.1 of the spec. - - * runtime/ErrorInstance.h: - (JSC::ErrorInstance::create): - (JSC::ErrorInstance::finishCreation): - -2012-01-02 Gavin Barraclough - - ES5 prohibits parseInt from supporting octal - https://bugs.webkit.org/show_bug.cgi?id=75455 - - Reviewed by Sam Weinig. - - See sections 15.1.2.2 and annex E. - - * runtime/JSGlobalObjectFunctions.cpp: - (JSC::parseInt): - -2012-01-02 Gavin Barraclough - - https://bugs.webkit.org/show_bug.cgi?id=55343 - Global JSON should be configurable but isn't - - Reviewed by Sam Weinig. - - * runtime/JSGlobalObject.cpp: - (JSC::JSGlobalObject::reset): - - make JSON configurable - -2012-01-01 Filip Pizlo - - Call instructions should leave room for linking information - https://bugs.webkit.org/show_bug.cgi?id=75422 - - - Reviewed by Oliver Hunt. - - * bytecode/Opcode.h: - * bytecompiler/BytecodeGenerator.cpp: - (JSC::BytecodeGenerator::emitCall): - (JSC::BytecodeGenerator::emitConstruct): - -2011-12-31 Dan Bernstein - - Continue trying to fix the Windows build after r103823. - - * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def: - -2011-12-31 Dan Bernstein - - Start trying to fix the Windows build after r103823. - - * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def: - -2011-12-30 Anders Carlsson - - Add a ParamStorageTraits specialization for RetainPtr - https://bugs.webkit.org/show_bug.cgi?id=75392 - - Reviewed by Daniel Bates. - - * wtf/Functional.h: - Add a partial specialization of ParamStorageTraits for RetainPtr. - - * wtf/RetainPtr.h: - Bring in the retainPtr function template from WTF. - -2011-12-29 Sam Weinig - - It should be easier to iterate a Vector backwards - https://bugs.webkit.org/show_bug.cgi?id=75359 - - Reviewed by Anders Carlsson. - - Adds Vector::rbegin(), Vector::rend(), and Vector::reversed(), - a new proxy driven way to access a vector backwards. One can use - reversed() in a range-based for loop like so: - - for (auto val: myVector.reversed()) - doSomething(val) - - * wtf/Vector.h: - (WTF::Vector::~Vector): - Fix style. - - (WTF::Vector::rbegin): - (WTF::Vector::rend): - Added using standard adaptor std::reverse_iterator. - - (WTF::Vector::reversed): - (WTF::Vector::VectorReverseProxy::begin): - (WTF::Vector::VectorReverseProxy::end): - Add proxy similar to one used in HashMap for keys() and values() - which allows access to a Vector backwards for use in range-based - for loops. - -2011-12-29 Gavin Barraclough - - https://bugs.webkit.org/show_bug.cgi?id=75140 - - Reviewed by Oliver Hunt. - - Start cleaning up JSArray construction. JSArray has a set of create methods, - one of which (currently) takes a 'creation mode' enum parameter. Based on that - parameter, the constructor does one of two completely different things. If the - parameter is 'CreateInitialized' it creates an array, setting the length, but - does not eagerly allocate a storage vector of the specified length. A small - (BASE_VECTOR_LEN sized) initial vector will be allocated, and cleared, property - access to the vector will read the hole value (return undefined). The alternate - usage of this method ('CreateCompact') does something very different. It tries - to create an array of the requested length, and also allocates a storage vector - large enough to hold all properties. It does not clear the storage vector, - leaving the memory uninitialized and requiring the user to call a method - 'uncheckedSetIndex' to initialize values in the vector. - - This patch factors out these two behaviours, moving the 'CreateCompact' mode - into its own method, 'tryCreateUninitialized' (matching the naming for this - functionality in the string classes). 'tryCreateUninitialized' may return 0 if - memory allocation fails during construction of the object. The construction - pattern changes such that values added during initialization will be marked if - a GC is triggered during array allocation. 'CreateInitialized' no longer need - be passed to create a normal, fully constructed array with a length, and this - method is merged with the version of 'create' that does not take an initial - length (length parameter defaults to 0). - - * JavaScriptCore.exp: - * runtime/ArrayConstructor.cpp: - (JSC::constructArrayWithSizeQuirk): - - removed 'CreateInitialized' argument - * runtime/ArrayPrototype.cpp: - (JSC::arrayProtoFuncSplice): - - changed to call 'tryCreateUninitialized' - * runtime/FunctionPrototype.cpp: - (JSC::functionProtoFuncBind): - - changed to call 'tryCreateUninitialized' - * runtime/JSArray.cpp: - (JSC::JSArray::JSArray): - - initialize m_storage to null; if construction fails, make destruction safe - (JSC::JSArray::finishCreation): - - merge versions of this method, takes an initialLength parameter defaulting to zero - (JSC::JSArray::tryFinishCreationUninitialized): - - version of 'finishCreation' that tries to eagerly allocate storage; may fail & return 0 - (JSC::JSArray::~JSArray): - - check for null m_storage, in case array construction failed. - (JSC::JSArray::increaseVectorPrefixLength): - * runtime/JSArray.h: - (JSC::JSArray::create): - - merge versions of this method, takes an initialLength parameter defaulting to zero - (JSC::JSArray::tryCreateUninitialized): - - version of 'create' that tries to eagerly allocate storage; may fail & return 0 - (JSC::JSArray::initializeIndex): - (JSC::JSArray::completeInitialization): - - used in conjunction with 'tryCreateUninitialized' to initialize the array - * runtime/JSGlobalObject.h: - (JSC::constructEmptyArray): - - removed 'CreateInitialized' argument - * runtime/RegExpConstructor.cpp: - (JSC::RegExpMatchesArray::finishCreation): - - removed 'CreateInitialized' argument - -2011-12-29 Anders Carlsson - - Add a retainPtr function template - https://bugs.webkit.org/show_bug.cgi?id=75365 - - Reviewed by Dan Bernstein. - - This makes it easier to make a RetainPtr using template argument deduction, which - is useful when passing RetainPtr objects as function arguments. - - * wtf/RetainPtr.h: - (WTF::retainPtr): - -2011-12-28 Yuqiang Xian - - spill unboxed values in DFG 32_64 - https://bugs.webkit.org/show_bug.cgi?id=75291 - - Reviewed by Filip Pizlo. - - Currently all the values are spilled as boxed in DFG 32_64, which is - not necessary and introduces additional stores/loads. Instead we - can spill them as unboxed if feasible. It can be applied to the - Integers, Cells and Booleans in DFG 32_64. Doubles are left as is - because they don't need to be boxed at all. The modifications to the - spill/fill and the OSR exit are required, as well as a bug fix to the - "isUnknownJS" logic. - - * bytecode/ValueRecovery.h: - (JSC::ValueRecovery::displacedInRegisterFile): - (JSC::ValueRecovery::virtualRegister): - (JSC::ValueRecovery::dump): - * dfg/DFGGenerationInfo.h: - (JSC::DFG::GenerationInfo::isUnknownJS): - (JSC::DFG::GenerationInfo::spill): - * dfg/DFGOSRExitCompiler32_64.cpp: - (JSC::DFG::OSRExitCompiler::compileExit): - * dfg/DFGSpeculativeJIT.cpp: - (JSC::DFG::SpeculativeJIT::isKnownNotBoolean): - * dfg/DFGSpeculativeJIT.h: - (JSC::DFG::SpeculativeJIT::silentFillGPR): - (JSC::DFG::SpeculativeJIT::spill): - * dfg/DFGSpeculativeJIT32_64.cpp: - (JSC::DFG::SpeculativeJIT::fillInteger): - (JSC::DFG::SpeculativeJIT::fillDouble): - (JSC::DFG::SpeculativeJIT::fillJSValue): - (JSC::DFG::SpeculativeJIT::fillSpeculateIntInternal): - (JSC::DFG::SpeculativeJIT::fillSpeculateDouble): - (JSC::DFG::SpeculativeJIT::fillSpeculateCell): - (JSC::DFG::SpeculativeJIT::fillSpeculateBoolean): - (JSC::DFG::SpeculativeJIT::compileObjectEquality): - (JSC::DFG::SpeculativeJIT::compile): - -2011-12-28 Anders Carlsson - - Add an implicit block conversion operator to WTF::Function - https://bugs.webkit.org/show_bug.cgi?id=75325 - - Reviewed by Dan Bernstein. - - * wtf/Compiler.h: - Add a define for COMPILER_SUPPORTS(BLOCKS). It's only defined for clang, since the gcc blocks implementation - is buggy, especially when it comes to C++. - - * wtf/Functional.h: - Add a block conversion operator that creates and returns an autoreleased block that will call the function when executed. - -2011-12-27 Anders Carlsson - - Add a new WTF::bind overload that takes 6 parameters - https://bugs.webkit.org/show_bug.cgi?id=75287 - - Reviewed by Sam Weinig. - - * wtf/Functional.h: - -2011-12-27 Sam Weinig - - Continue moving compiler feature checks to use the COMPILER_SUPPORTS() macro - https://bugs.webkit.org/show_bug.cgi?id=75268 - - Reviewed by Anders Carlsson. - - * wtf/Compiler.h: - Add support for COMPILER_SUPPORTS(CXX_NULLPTR) and COMPILER_SUPPORTS(CXX_DELETED_FUNCTIONS). - - * wtf/Noncopyable.h: - Use COMPILER_SUPPORTS(CXX_DELETED_FUNCTIONS). - - * wtf/NullPtr.cpp: - * wtf/NullPtr.h: - Use COMPILER_SUPPORTS(CXX_NULLPTR). Remove support for HAVE(NULLPTR). - - * wtf/RefPtr.h: - * wtf/RetainPtr.h: - Switch from HAVE(NULLPTR) to COMPILER_SUPPORTS(CXX_NULLPTR). - -2011-12-27 Anders Carlsson - - Misc fixes and cleanups in Functional.h - https://bugs.webkit.org/show_bug.cgi?id=75281 - - Reviewed by Andreas Kling. - - - Reformat template declarations so that the class begins on a new line. - - Change the parameter template parameters to start at P1 instead of P0. - - Add function wrappers and bind overloads for 4 and 5 parameter functions. - - Change the Function call operator to be const so const functions can be called. - - * wtf/Functional.h: - -2011-12-27 Tony Chang - - [chromium] Minor cleanup of gyp files. - https://bugs.webkit.org/show_bug.cgi?id=75269 - - Reviewed by Adam Barth. - - * JavaScriptCore.gyp/JavaScriptCore.gyp: msvs_guid is no longer needed - and vim/emacs specific hooks should be added by the user. - -2011-12-27 Gavin Barraclough - - https://bugs.webkit.org/show_bug.cgi?id=75260 - Null name for host function can result in dereference of uninitialize memory - - Reviewed by Filip Pizlo. - - This is a recent regression in ToT, if the name passed to finishCreation of a host function is null, - we are currently skipping the putDirect, which leaves memory uninitialized. This patch reverts the - aspect of the change that introduced the issue. It might be better if functions that don't have a - name don't have this property at all, but that's change should be separate from fixing the bug. - - * runtime/JSFunction.cpp: - (JSC::JSFunction::finishCreation): - - Always initialize the name property. - -2011-12-27 Anders Carlsson - - Function should handle wrapping/unwrapping RefPtr and PassRefPtr - https://bugs.webkit.org/show_bug.cgi?id=75266 - - Reviewed by Sam Weinig. - - Add ParamStorageTraits that can be used for deciding how bound parameters should be stored - and peeked at. For RefPtr we want to use the raw pointer when "peeking" to avoid ref-churn. - For PassRefPtr, we want to use RefPtr for storage but still use the raw pointer when peeking. - - * wtf/Functional.h: - (WTF::ParamStorageTraits::wrap): - (WTF::ParamStorageTraits::unwrap): - -2011-12-27 Tony Chang - - [chromium] really enable wpo for WebCore libs and for WTF - https://bugs.webkit.org/show_bug.cgi?id=75264 - - Reviewed by Adam Barth. - - * JavaScriptCore.gyp/JavaScriptCore.gyp: Enable WPO for wtf and yarr. - -2011-12-26 Gavin Barraclough - - Errk! OS X build fix. - - * JavaScriptCore.exp: - -2011-12-26 Gavin Barraclough - - Windows build fix. - - * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def: - * runtime/JSObject.h: - -2011-12-26 Gavin Barraclough - - https://bugs.webkit.org/show_bug.cgi?id=75231 - Fail to throw in strict mode on assign to read only static properties - - Reviewed by Filip Pizlo. - - There are three bugs here: - * symbolTablePut should throw for strict mode accesses. - * lookupPut should throw for strict mode accesses. - * NumberConstructor should override put to call lookupPut, to trap assignment to readonly properties. - - * runtime/JSActivation.cpp: - (JSC::JSActivation::symbolTablePut): - (JSC::JSActivation::put): - * runtime/JSActivation.h: - * runtime/JSGlobalObject.cpp: - (JSC::JSGlobalObject::put): - * runtime/JSStaticScopeObject.cpp: - (JSC::JSStaticScopeObject::put): - * runtime/JSVariableObject.h: - (JSC::JSVariableObject::symbolTablePut): - * runtime/Lookup.h: - (JSC::lookupPut): - * runtime/NumberConstructor.cpp: - (JSC::NumberConstructor::put): - * runtime/NumberConstructor.h: - -2011-12-26 Gavin Barraclough - - Fix miss-commit of utf8 change. - - Reviewed by Filip Pizlo - - Eeep, patch as landed a while ago had no effect! - acidentally landed - modified version of patch used for performance testing. - - (This isn't covered by layout tests because layour tests don't use jsc, - and the tests/mozilla tests use latin1, which was already supported!) - - Landing changes as intended (and as originally reviewed). - - * jsc.cpp: - (jscSource): - -2011-12-26 Filip Pizlo - - Unreviewed build fix for ARMv7. - - * assembler/MacroAssemblerARMv7.h: - (JSC::MacroAssemblerARMv7::load16Signed): - (JSC::MacroAssemblerARMv7::load8Signed): - -2011-12-26 Hajime Morrita - - Rename WTF_INLINE, JS_INLINE to HIDDEN_INLINE - https://bugs.webkit.org/show_bug.cgi?id=74990 - - Reviewed by Kevin Ollivier. - - * runtime/JSExportMacros.h: Removed JS_INLINE - * wtf/ExportMacros.h: Renamed WTF_INLINE to HIDDEN_INLINE - -2011-12-24 Filip Pizlo - - The ArgumentCount field in the CallFrame should have its tag left blank for other uses - https://bugs.webkit.org/show_bug.cgi?id=75199 - - - - Reviewed by Oliver Hunt. - - * dfg/DFGOSRExitCompiler32_64.cpp: - (JSC::DFG::OSRExitCompiler::compileExit): - * dfg/DFGOSRExitCompiler64.cpp: - (JSC::DFG::OSRExitCompiler::compileExit): - * dfg/DFGSpeculativeJIT.h: - (JSC::DFG::SpeculativeJIT::argumentPayloadSlot): - * dfg/DFGSpeculativeJIT32_64.cpp: - (JSC::DFG::SpeculativeJIT::emitCall): - * dfg/DFGSpeculativeJIT64.cpp: - (JSC::DFG::SpeculativeJIT::emitCall): - * interpreter/CallFrame.h: - (JSC::ExecState::argumentCountIncludingThis): - (JSC::ExecState::setArgumentCountIncludingThis): - * interpreter/Register.h: - (JSC::Register::unboxedInt32): - (JSC::Register::unboxedBoolean): - (JSC::Register::unboxedCell): - (JSC::Register::payload): - (JSC::Register::tag): - * jit/JITCall.cpp: - (JSC::JIT::compileOpCall): - * jit/JITCall32_64.cpp: - (JSC::JIT::compileLoadVarargs): - (JSC::JIT::compileOpCall): - -2011-12-25 Andreas Kling - - Yarr: Avoid copying vectors in CharacterClassConstructor. - - - Reviewed by Darin Adler. - - Yarr::CharacterClassConstructor::charClass() was hot when loading twitter - feeds (1.2%), replace the usage of Vector::append() by swap() since we're - always clearing the source vector afterwards anyway. - - * yarr/YarrPattern.cpp: - (JSC::Yarr::CharacterClassConstructor::charClass): - -2011-12-24 Darin Adler - - Specialize HashTraits for RefPtr to use PassRefPtr as "pass type" to reduce reference count churn - https://bugs.webkit.org/show_bug.cgi?id=72476 - - Reviewed by Sam Weinig. - - * wtf/HashTraits.h: Defined PassInType and store function in HashTraits. - -2011-12-23 Geoffrey Garen - - Inlined Yarr::execute - https://bugs.webkit.org/show_bug.cgi?id=75180 - - Reviewed reluctantly by Beth Dakin. - - Tiny speedup on SunSpider string tests. Removes some samples from - Instruments. A step toward removing -fomit-frame-pointer. - - * yarr/YarrJIT.cpp: - * yarr/YarrJIT.h: - (JSC::Yarr::execute): ONE LINE FUNCTION, Y U NOT INLINED?! - -2011-12-23 Filip Pizlo - - DFG loads from signed 8-bit and 16-bit typed arrays are broken - https://bugs.webkit.org/show_bug.cgi?id=75163 - - Reviewed by Geoffrey Garen. - - Added 8-bit and 16-bit signed loads. Because doing so on ARM is less trivial, I'm - currently disabling Int8Array and Int16Array optimizations on ARM. - - * assembler/MacroAssemblerX86Common.h: - (JSC::MacroAssemblerX86Common::load8Signed): - (JSC::MacroAssemblerX86Common::load16Signed): - * assembler/X86Assembler.h: - (JSC::X86Assembler::movswl_mr): - (JSC::X86Assembler::movsbl_mr): - * bytecode/PredictedType.h: - (JSC::isActionableMutableArrayPrediction): - * dfg/DFGNode.h: - (JSC::DFG::Node::shouldSpeculateInt8Array): - (JSC::DFG::Node::shouldSpeculateInt16Array): - * dfg/DFGSpeculativeJIT.cpp: - (JSC::DFG::SpeculativeJIT::compileGetByValOnIntTypedArray): - -2011-12-23 Filip Pizlo - - DFG does double-to-int conversion incorrectly when storing into int typed arrays - https://bugs.webkit.org/show_bug.cgi?id=75164 - - - Reviewed by Geoffrey Garen. - - * assembler/MacroAssemblerARMv7.h: - (JSC::MacroAssemblerARMv7::branchTruncateDoubleToUint32): - * assembler/MacroAssemblerX86Common.h: - (JSC::MacroAssemblerX86Common::branchTruncateDoubleToUint32): - (JSC::MacroAssemblerX86Common::truncateDoubleToUint32): - * dfg/DFGSpeculativeJIT.cpp: - (JSC::DFG::SpeculativeJIT::compilePutByValForIntTypedArray): - -2011-12-23 Geoffrey Garen - - Refactored String.prototype.replace - https://bugs.webkit.org/show_bug.cgi?id=75114 - - Reviewed by Darin Adler. - - No performance difference. - - I think this is a step toward removing -fomit-frame-pointer. - - * runtime/JSString.cpp: - * runtime/JSString.h: Removed the test and special case for a single-character - search string because the standard path does this test and special case - for us. (As an aside, if we do come up with a unique single-character - replace optimization in future, it probably belongs in the replace function, - and not in JSString.) - - * runtime/StringPrototype.cpp: - (JSC::stringProtoFuncReplace): Split this mega-sized function into: - (JSC::replaceUsingStringSearch): - This reasonably sized function, and - (JSC::replaceUsingRegExpSearch): - This still mega-sized function. - -2011-12-23 Pierre Rossi - - [Qt] REGRESSION(r103467): It broke fast/images/animated-gif-restored-from-bfcache.html - https://bugs.webkit.org/show_bug.cgi?id=75087 - - monotonicallyIncreasingTime needs to hava a higher resolution than milliseconds. - - Reviewed by Darin Adler. - - * wtf/CurrentTime.cpp: - (WTF::monotonicallyIncreasingTime): - -2011-12-22 Filip Pizlo - - DFG should not speculate array even when predictions say that the base is not an array - https://bugs.webkit.org/show_bug.cgi?id=75160 - - - - Reviewed by Oliver Hunt. - - Added the ability to call slow path when the base is known to not be an array. - Also rationalized the logic for deciding when the index is not an int, and - cleaned up the logic for deciding when to speculate typed array. - - Neutral for the most part, with odd speed-ups and slow-downs. The slow-downs can - likely be mitigated by having the notion of a polymorphic array access, where we - try, but don't speculate, to access the array one way before either trying some - other ways or calling slow path. - - * bytecode/PredictedType.h: - (JSC::isActionableMutableArrayPrediction): - (JSC::isActionableArrayPrediction): - * dfg/DFGAbstractState.cpp: - (JSC::DFG::AbstractState::execute): - * dfg/DFGNode.h: - (JSC::DFG::Node::shouldSpeculateInt8Array): - (JSC::DFG::Node::shouldSpeculateInt16Array): - (JSC::DFG::Node::shouldSpeculateInt32Array): - (JSC::DFG::Node::shouldSpeculateUint8Array): - (JSC::DFG::Node::shouldSpeculateUint16Array): - (JSC::DFG::Node::shouldSpeculateUint32Array): - (JSC::DFG::Node::shouldSpeculateFloat32Array): - (JSC::DFG::Node::shouldSpeculateFloat64Array): - * dfg/DFGPropagator.cpp: - (JSC::DFG::Propagator::byValIsPure): - * dfg/DFGSpeculativeJIT.cpp: - (JSC::DFG::SpeculativeJIT::compileGetIndexedPropertyStorage): - * dfg/DFGSpeculativeJIT32_64.cpp: - (JSC::DFG::SpeculativeJIT::compile): - * dfg/DFGSpeculativeJIT64.cpp: - (JSC::DFG::SpeculativeJIT::compile): - -2011-12-22 Gavin Barraclough - - Unreviewed - fix stylebot issues from last patch. - - * runtime/JSArray.cpp: - (JSC::JSArray::putSlowCase): - -2011-12-22 Gavin Barraclough - - https://bugs.webkit.org/show_bug.cgi?id=75151 - Add attributes field to JSArray's SparseMap - - Reviewed by Sam Weinig. - - This will be necessary to be able to support non- writable/configurable/enumerable - properties, and helpful for getters/setters. - - Added a concept of being 'inSparseMode' - this indicates the array has a non-standard - - * runtime/ArrayPrototype.cpp: - (JSC::arrayProtoFuncSort): - - JSArray::sort methods not allowed on arrays that are 'inSparseMode'. - (must fall back to generic sort alogrithm). - * runtime/JSArray.cpp: - (JSC::JSArray::finishCreation): - - moved reportedMapCapacity into the SparseArrayValueMap object. - (JSC::SparseArrayValueMap::find): - (JSC::SparseArrayValueMap::put): - (JSC::SparseArrayValueMap::visitChildren): - - Added. - (JSC::JSArray::getOwnPropertySlotByIndex): - (JSC::JSArray::getOwnPropertyDescriptor): - (JSC::JSArray::putSlowCase): - (JSC::JSArray::deletePropertyByIndex): - (JSC::JSArray::getOwnPropertyNames): - (JSC::JSArray::setLength): - (JSC::JSArray::pop): - (JSC::JSArray::visitChildren): - - Updated for changes in SparseArrayValueMap. - (JSC::JSArray::sortNumeric): - (JSC::JSArray::sort): - (JSC::JSArray::compactForSorting): - - Disallow on 'SparseMode' arrays. - * runtime/JSArray.h: - (JSC::SparseArrayEntry::SparseArrayEntry): - - An entry in the sparse array - value (WriteBarrier) + attributes. - (JSC::SparseArrayValueMap::SparseArrayValueMap): - (JSC::SparseArrayValueMap::sparseMode): - (JSC::SparseArrayValueMap::setSparseMode): - - Flags to track whether an Array is forced into SparseMode. - (JSC::SparseArrayValueMap::remove): - (JSC::SparseArrayValueMap::notFound): - (JSC::SparseArrayValueMap::isEmpty): - (JSC::SparseArrayValueMap::contains): - (JSC::SparseArrayValueMap::size): - (JSC::SparseArrayValueMap::begin): - (JSC::SparseArrayValueMap::end): - - accessors to the map - (JSC::SparseArrayValueMap::take): - - only for use on non-SpareMode arrays. - (JSC::JSArray::inSparseMode): - - Added. - -2011-12-22 Filip Pizlo - - DFG CFA sometimes generates an incorrect proof that a node is known to be a typed array - https://bugs.webkit.org/show_bug.cgi?id=75150 - - - Reviewed by Gavin Barraclough. - - * dfg/DFGAbstractState.cpp: - (JSC::DFG::AbstractState::execute): - -2011-12-22 Filip Pizlo - - DFG JIT does exactly the wrong thing when doing strict equality on two known cells - https://bugs.webkit.org/show_bug.cgi?id=75138 - - - Reviewed by Oliver Hunt. - - * dfg/DFGSpeculativeJIT32_64.cpp: - (JSC::DFG::SpeculativeJIT::nonSpeculativePeepholeStrictEq): - * dfg/DFGSpeculativeJIT64.cpp: - (JSC::DFG::SpeculativeJIT::nonSpeculativePeepholeStrictEq): - -2011-12-22 Balazs Kelemen - - Fix debug build with assertions disabled - https://bugs.webkit.org/show_bug.cgi?id=75075 - - Reviewed by Darin Adler. - - Check whether assertions are disabled instead of NDEBUG - where appropriate to avoid "defined but not used" warnings. - - * wtf/DateMath.cpp: - (WTF::initializeDates): - -2011-12-22 Mariusz Grzegorczyk - - [EFL] Missing plugins support for efl port - https://bugs.webkit.org/show_bug.cgi?id=44505 - - Reviewed by Anders Carlsson. - - Add define of ENABLE_PLUGIN_PACKAGE_SIMPLE_HASH for efl port. - - * wtf/Platform.h: - -2011-12-22 Wei Charles - - Remove un-used data member of LiteralParser::Lex::m_string - https://bugs.webkit.org/show_bug.cgi?id=68216 - - Reviewed by George Staikos. - - * runtime/LiteralParser.h: - -2011-12-21 Dan Bernstein - - OS X build fix after r103488. - - * JavaScriptCore.exp: - -2011-12-21 Konrad Piascik - - Implement the JavaScriptCore bindings for eventListenerHandlerLocation - https://bugs.webkit.org/show_bug.cgi?id=74313 - - Reviewed by Eric Seidel. - - Updated project files to get Windows and Mac builds working. - - * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def: - * JavaScriptCore.xcodeproj/project.pbxproj: - -2011-12-21 Filip Pizlo - - DFG ConvertThis optimizations do not honor the distinction between the global object and the global this object - https://bugs.webkit.org/show_bug.cgi?id=75058 - - - - Reviewed by Oliver Hunt. - - Added a call to toThisObject() in the DFG when planting a direct reference to the global this object. - Instead of adding a separate toThisObject() method on JSCell which does not take ExecState*, I reascribed - a new contract: if you're calling toThisObject() on JSObject or one of its subtypes, then the ExecState* - is optional. - - * dfg/DFGAssemblyHelpers.h: - (JSC::DFG::AssemblyHelpers::globalThisObjectFor): - * dfg/DFGSpeculativeJIT32_64.cpp: - (JSC::DFG::SpeculativeJIT::compile): - * dfg/DFGSpeculativeJIT64.cpp: - (JSC::DFG::SpeculativeJIT::compile): - * runtime/JSObject.h: - -2011-12-21 Pierre Rossi - - Implement montonicallyIncreasingClock() on Qt - https://bugs.webkit.org/show_bug.cgi?id=62159 - - Reviewed by Darin Adler. - - * wtf/CurrentTime.cpp: - (WTF::monotonicallyIncreasingTime): - -2011-12-20 Filip Pizlo - - 32_64 baseline JIT should attempt to convert division results to integers, and record when that fails - https://bugs.webkit.org/show_bug.cgi?id=74997 - - - Reviewed by Gavin Barraclough. - - * jit/JITArithmetic32_64.cpp: - (JSC::JIT::emit_op_div): - -2011-12-20 Filip Pizlo - - JavaScriptCore should be consistent about how it reads and writes ArgumentCount - https://bugs.webkit.org/show_bug.cgi?id=74989 - - - Reviewed by Gavin Barraclough. - - * dfg/DFGJITCompiler.cpp: - (JSC::DFG::JITCompiler::compileFunction): - * jit/JIT.cpp: - (JSC::JIT::privateCompile): - * jit/JITCall32_64.cpp: - (JSC::JIT::compileLoadVarargs): - * jit/JITOpcodes32_64.cpp: - (JSC::JIT::emit_op_get_arguments_length): - (JSC::JIT::emit_op_get_argument_by_val): - * jit/SpecializedThunkJIT.h: - (JSC::SpecializedThunkJIT::SpecializedThunkJIT): - -2011-12-20 Filip Pizlo - - Value Profiles for arguments should be more easily accessible to the interpreter - https://bugs.webkit.org/show_bug.cgi?id=74984 - - - Reviewed by Gavin Barraclough. - - * bytecode/CodeBlock.cpp: - (JSC::CodeBlock::stronglyVisitStrongReferences): - (JSC::CodeBlock::shouldOptimizeNow): - (JSC::CodeBlock::dumpValueProfiles): - * bytecode/CodeBlock.h: - (JSC::CodeBlock::setArgumentValueProfileSize): - (JSC::CodeBlock::numberOfArgumentValueProfiles): - (JSC::CodeBlock::valueProfileForArgument): - (JSC::CodeBlock::addValueProfile): - (JSC::CodeBlock::valueProfile): - (JSC::CodeBlock::valueProfileForBytecodeOffset): - (JSC::CodeBlock::totalNumberOfValueProfiles): - (JSC::CodeBlock::getFromAllValueProfiles): - * bytecode/ValueProfile.h: - (JSC::ValueProfile::ValueProfile): - * jit/JIT.cpp: - (JSC::JIT::privateCompile): - * jit/JIT.h: - * jit/JITInlineMethods.h: - (JSC::JIT::emitValueProfilingSite): - -2011-12-20 Gavin Barraclough - - JSC shell should accept utf8 input. - - Reviewed by Filip Pizlo. - - * jsc.cpp: - (jscSource): - (functionRun): - (functionLoad): - (functionCheckSyntax): - (runWithScripts): - (runInteractive): - -2011-12-20 Gavin Barraclough - - Rubber Stamped by Sam Weinig - - * runtime/JSGlobalData.cpp: - - removed some dead code. - -2011-12-19 Geoffrey Garen - - Tightened up Vector::append - https://bugs.webkit.org/show_bug.cgi?id=74906 - - Reviewed by Sam Weinig. - - Not a measurable speedup, but code inspection shows better code generated, - and I believe this is a step toward turning off -fomit-frame-pointer. - - * wtf/Vector.h: - (WTF::::append): - (WTF::::appendSlowCase): Split out the slow case into a separate function - to keep unnecessary instructions off the hot path. This means the hot - path can now be inlined more often. - - Removed some old MSVC7 cruft. Hopefully, we don't need to hang on to a - compiler work-around from 2007. - -2011-12-19 Yuqiang Xian - - Temporary GPR should not be lazily allocated in DFG JIT on X86 - https://bugs.webkit.org/show_bug.cgi?id=74908 - - Reviewed by Filip Pizlo. - - On X86, we used to allocate a temporary GPR lazily when it's really - used rather than defined. This may cause potential issues of - allocating registers inside control flow and result in problems in - subsequent code generation, for example the DFG JIT may think an - operand already being spilled (to satisfy the allocation request) and - generate code to read the data from memory, but the allocation and - spilling are in a branch which is not taken at runtime, so the - generated code is incorrect. - - Although current DFG JIT code doesn't have this problematic pattern, - it's better to cut-off the root to avoid any potential issues in the - future. - - * dfg/DFGSpeculativeJIT.cpp: - (JSC::DFG::GPRTemporary::GPRTemporary): - * dfg/DFGSpeculativeJIT.h: - (JSC::DFG::GPRTemporary::gpr): - * dfg/DFGSpeculativeJIT32_64.cpp: - (JSC::DFG::SpeculativeJIT::compile): - -2011-12-19 Yuqiang Xian - - Remove unused code for non-speculative Arith operations from DFG JIT - https://bugs.webkit.org/show_bug.cgi?id=74905 - - Reviewed by Filip Pizlo. - - * dfg/DFGSpeculativeJIT.h: - * dfg/DFGSpeculativeJIT32_64.cpp: - * dfg/DFGSpeculativeJIT64.cpp: - -2011-12-19 Gavin Barraclough - - https://bugs.webkit.org/show_bug.cgi?id=74903 - Exceptions not thrown correctly from DFG JIT on 32bit - - Reviewed by Oliver Hunt. - - Arguments for lookupExceptionHandler are not setup correctly. - In the case of ARMv7 we rely on lr being preserved over a call, - this in invalid. On x86 we don't should be poking the arguments onto the stack! - - * bytecode/CodeBlock.h: - (JSC::CodeBlock::bytecodeOffsetForCallAtIndex): - * dfg/DFGAssemblyHelpers.h: - (JSC::DFG::AssemblyHelpers::restoreReturnAddressBeforeReturn): - * dfg/DFGGPRInfo.h: - * dfg/DFGJITCompiler.cpp: - (JSC::DFG::JITCompiler::compileBody): - * dfg/DFGJITCompiler.h: - (JSC::DFG::JITCompiler::addExceptionCheck): - (JSC::DFG::JITCompiler::addFastExceptionCheck): - * dfg/DFGOperations.cpp: - * dfg/DFGOperations.h: - -2011-12-19 Filip Pizlo - - If we detect that we can use the JIT, don't use computed opcode lookups - https://bugs.webkit.org/show_bug.cgi?id=74899 - - - Reviewed by Gavin Barraclough. - - * interpreter/Interpreter.cpp: - (JSC::Interpreter::Interpreter): - (JSC::Interpreter::initialize): - (JSC::Interpreter::privateExecute): - * interpreter/Interpreter.h: - (JSC::Interpreter::getOpcode): - (JSC::Interpreter::getOpcodeID): - * runtime/JSGlobalData.cpp: - (JSC::JSGlobalData::JSGlobalData): - -2011-12-19 Geoffrey Garen - - Try to fix the Qt build. - - Unreviewed. - - * wtf/ThreadSpecific.h: #include! - -2011-12-18 Filip Pizlo - - It should be possible to change the value of an Options variable without recompiling the world - https://bugs.webkit.org/show_bug.cgi?id=74807 - - Reviewed by Gavin Barraclough. - - * runtime/Options.cpp: - (JSC::Options::initializeOptions): - * runtime/Options.h: - -2011-12-19 Sheriff Bot - - Unreviewed, rolling out r103250. - http://trac.webkit.org/changeset/103250 - https://bugs.webkit.org/show_bug.cgi?id=74877 - - it still breaks codegen (Requested by olliej on #webkit). - - * dfg/DFGAbstractState.cpp: - (JSC::DFG::AbstractState::execute): - * dfg/DFGByteCodeParser.cpp: - (JSC::DFG::ByteCodeParser::parseBlock): - * dfg/DFGNode.h: - * dfg/DFGPropagator.cpp: - (JSC::DFG::Propagator::propagateArithNodeFlags): - (JSC::DFG::Propagator::fixupNode): - (JSC::DFG::Propagator::byValIsPure): - (JSC::DFG::Propagator::clobbersWorld): - (JSC::DFG::Propagator::getByValLoadElimination): - (JSC::DFG::Propagator::checkStructureLoadElimination): - (JSC::DFG::Propagator::getByOffsetLoadElimination): - (JSC::DFG::Propagator::getPropertyStorageLoadElimination): - (JSC::DFG::Propagator::getIndexedPropertyStorageLoadElimination): - (JSC::DFG::Propagator::performNodeCSE): - * dfg/DFGSpeculativeJIT.cpp: - (JSC::DFG::SpeculativeJIT::compilePutByValForByteArray): - (JSC::DFG::SpeculativeJIT::compilePutByValForIntTypedArray): - (JSC::DFG::SpeculativeJIT::compilePutByValForFloatTypedArray): - * dfg/DFGSpeculativeJIT.h: - * dfg/DFGSpeculativeJIT32_64.cpp: - (JSC::DFG::SpeculativeJIT::compile): - * dfg/DFGSpeculativeJIT64.cpp: - (JSC::DFG::SpeculativeJIT::compile): - -2011-12-16 Oliver Hunt - - Rolling r103120 back in with merge errors corrected. - - PutByVal[Alias] unnecessarily reloads the storage buffer - https://bugs.webkit.org/show_bug.cgi?id=74747 - - Reviewed by Gavin Barraclough. - - Make PutByVal use GetIndexedStorage to load the storage buffer. - This required switching PutByVal to a vararg node (which is - responsible for most of the noise in this patch). This fixes the - remaining portion of the kraken regression caused by the GetByVal - storage load elimination, and a 1-5% win on some of the sub tests of - the typed array benchmark at: - http://stepheneb.github.com/webgl-matrix-benchmarks/matrix_benchmark.html - - * dfg/DFGAbstractState.cpp: - (JSC::DFG::AbstractState::execute): - * dfg/DFGByteCodeParser.cpp: - (JSC::DFG::ByteCodeParser::parseBlock): - * dfg/DFGNode.h: - * dfg/DFGPropagator.cpp: - (JSC::DFG::Propagator::propagateArithNodeFlags): - (JSC::DFG::Propagator::fixupNode): - (JSC::DFG::Propagator::byValIndexIsPure): - (JSC::DFG::Propagator::clobbersWorld): - (JSC::DFG::Propagator::getByValLoadElimination): - (JSC::DFG::Propagator::checkStructureLoadElimination): - (JSC::DFG::Propagator::getByOffsetLoadElimination): - (JSC::DFG::Propagator::getPropertyStorageLoadElimination): - (JSC::DFG::Propagator::getIndexedPropertyStorageLoadElimination): - (JSC::DFG::Propagator::performNodeCSE): - * dfg/DFGSpeculativeJIT.cpp: - (JSC::DFG::SpeculativeJIT::compilePutByValForByteArray): - (JSC::DFG::SpeculativeJIT::compilePutByValForIntTypedArray): - (JSC::DFG::SpeculativeJIT::compilePutByValForFloatTypedArray): - * dfg/DFGSpeculativeJIT.h: - * dfg/DFGSpeculativeJIT32_64.cpp: - (JSC::DFG::SpeculativeJIT::compile): - * dfg/DFGSpeculativeJIT64.cpp: - (JSC::DFG::SpeculativeJIT::compile): - -2011-12-15 Geoffrey Garen - - Placement new does an unnecessary NULL check - https://bugs.webkit.org/show_bug.cgi?id=74676 - - Reviewed by Sam Weinig. - - We can define our own version, which skips the NULL check. - - Not a measurable speedup, but code inspection shows better code generated, - and I believe this is a step toward turning off -fomit-frame-pointer. - - * API/JSCallbackConstructor.h: - (JSC::JSCallbackConstructor::create): - * API/JSCallbackFunction.h: - (JSC::JSCallbackFunction::create): Use the NotNull version of placement - new to skip the NULL check. - - * API/JSCallbackObject.h: Removed a conflicting, unnecessaray placement new. - - (JSC::JSCallbackObject::create): - * debugger/DebuggerActivation.h: - (JSC::DebuggerActivation::create): - * heap/HandleHeap.cpp: - (JSC::HandleHeap::grow): - * heap/HandleHeap.h: - (JSC::HandleHeap::allocate): - * heap/MarkedBlock.cpp: - (JSC::MarkedBlock::create): - (JSC::MarkedBlock::recycle): - * jit/JITCode.h: - (JSC::JITCode::clear): - * jsc.cpp: - (GlobalObject::create): - * profiler/CallIdentifier.h: - * runtime/Arguments.h: - (JSC::Arguments::create): - * runtime/ArrayConstructor.h: - (JSC::ArrayConstructor::create): - * runtime/ArrayPrototype.h: - (JSC::ArrayPrototype::create): - * runtime/BooleanConstructor.h: - (JSC::BooleanConstructor::create): - * runtime/BooleanObject.h: - (JSC::BooleanObject::create): - * runtime/BooleanPrototype.h: - (JSC::BooleanPrototype::create): - * runtime/DateConstructor.h: - (JSC::DateConstructor::create): - * runtime/DateInstance.h: - (JSC::DateInstance::create): - * runtime/DatePrototype.h: - (JSC::DatePrototype::create): - * runtime/Error.h: - (JSC::StrictModeTypeErrorFunction::create): - * runtime/ErrorConstructor.h: - (JSC::ErrorConstructor::create): - * runtime/ErrorInstance.h: - (JSC::ErrorInstance::create): - * runtime/ErrorPrototype.h: - (JSC::ErrorPrototype::create): - * runtime/ExceptionHelpers.h: - (JSC::InterruptedExecutionError::create): - (JSC::TerminatedExecutionError::create): - * runtime/Executable.h: - (JSC::NativeExecutable::create): - (JSC::EvalExecutable::create): - (JSC::ProgramExecutable::create): - (JSC::FunctionExecutable::create): - * runtime/FunctionConstructor.h: - (JSC::FunctionConstructor::create): - * runtime/FunctionPrototype.h: - (JSC::FunctionPrototype::create): - * runtime/GetterSetter.h: - (JSC::GetterSetter::create): - * runtime/JSAPIValueWrapper.h: - (JSC::JSAPIValueWrapper::create): - * runtime/JSActivation.h: - (JSC::JSActivation::create): - * runtime/JSArray.h: - (JSC::JSArray::create): - * runtime/JSBoundFunction.cpp: - (JSC::JSBoundFunction::create): - * runtime/JSByteArray.h: - (JSC::JSByteArray::create): Use the NotNull version of placement - new to skip the NULL check. - - * runtime/JSCell.h: Removed a conflicting, unnecessaray placement new. - - * runtime/JSFunction.cpp: - (JSC::JSFunction::create): - * runtime/JSFunction.h: - (JSC::JSFunction::create): - * runtime/JSGlobalObject.h: - (JSC::JSGlobalObject::create): - * runtime/JSGlobalThis.h: - (JSC::JSGlobalThis::create): - * runtime/JSNotAnObject.h: - (JSC::JSNotAnObject::create): - * runtime/JSONObject.h: - (JSC::JSONObject::create): - * runtime/JSObject.h: - (JSC::JSFinalObject::create): - * runtime/JSPropertyNameIterator.cpp: - (JSC::JSPropertyNameIterator::create): - * runtime/JSPropertyNameIterator.h: - (JSC::JSPropertyNameIterator::create): - * runtime/JSStaticScopeObject.h: - (JSC::JSStaticScopeObject::create): - * runtime/JSString.cpp: - (JSC::StringObject::create): - * runtime/JSString.h: - (JSC::RopeBuilder::createNull): - (JSC::RopeBuilder::create): - (JSC::RopeBuilder::createHasOtherOwner): - * runtime/MathObject.h: - (JSC::MathObject::create): - * runtime/NativeErrorConstructor.h: - (JSC::NativeErrorConstructor::create): - * runtime/NativeErrorPrototype.h: - (JSC::NativeErrorPrototype::create): - * runtime/NumberConstructor.h: - (JSC::NumberConstructor::create): - * runtime/NumberObject.h: - (JSC::NumberObject::create): - * runtime/NumberPrototype.h: - (JSC::NumberPrototype::create): - * runtime/ObjectConstructor.h: - (JSC::ObjectConstructor::create): - * runtime/ObjectPrototype.h: - (JSC::ObjectPrototype::create): - * runtime/RegExp.cpp: - (JSC::RegExp::createWithoutCaching): - * runtime/RegExpConstructor.h: - (JSC::RegExpConstructor::create): - * runtime/RegExpMatchesArray.h: - (JSC::RegExpMatchesArray::create): - * runtime/RegExpObject.h: - (JSC::RegExpObject::create): - * runtime/RegExpPrototype.h: - (JSC::RegExpPrototype::create): - * runtime/ScopeChain.h: - (JSC::ScopeChainNode::create): - * runtime/StrictEvalActivation.h: - (JSC::StrictEvalActivation::create): - * runtime/StringConstructor.h: - (JSC::StringConstructor::create): - * runtime/StringObject.h: - (JSC::StringObject::create): - * runtime/StringPrototype.h: - (JSC::StringPrototype::create): - * runtime/Structure.h: - (JSC::Structure::create): - (JSC::Structure::createStructure): - * runtime/StructureChain.h: - (JSC::StructureChain::create): - * testRegExp.cpp: - (GlobalObject::create): - * wtf/BitVector.cpp: - (WTF::BitVector::OutOfLineBits::create): Use the NotNull version of placement - new to skip the NULL check. - - * wtf/BumpPointerAllocator.h: - (WTF::BumpPointerPool::create): Standardized spacing to make grep easier. - - * wtf/ByteArray.cpp: - (WTF::ByteArray::create): - * wtf/Deque.h: - (WTF::::append): - (WTF::::prepend): Use NotNull, as above. - - * wtf/FastAllocBase.h: Added a placement new, since this class would otherwise - hide the name of the global placement new. - - (WTF::fastNew): Standardized spacing. Most of these functions don't need - NotNull, since they check for NULL, and the optimizer can see that. - - * wtf/HashTable.h: - * wtf/HashTraits.h: - (WTF::SimpleClassHashTraits::constructDeletedValue): - * wtf/MetaAllocator.cpp: - (WTF::MetaAllocator::allocFreeSpaceNode): NotNull, as above. - - * wtf/StdLibExtras.h: - (throw): This is our NotNull placement new. Declaring that we throw is - the C++ way to say that operator new will not return NULL. - - * wtf/ThreadSpecific.h: - (WTF::T): - * wtf/Vector.h: - (WTF::::append): - (WTF::::tryAppend): - (WTF::::uncheckedAppend): - (WTF::::insert): - * wtf/text/AtomicStringHash.h: - * wtf/text/StringImpl.cpp: - (WTF::StringImpl::createUninitialized): - (WTF::StringImpl::reallocate): - * wtf/text/StringImpl.h: - (WTF::StringImpl::tryCreateUninitialized): - * wtf/text/StringStatics.cpp: - (WTF::AtomicString::init): Use NotNull, as above. - - * yarr/YarrInterpreter.cpp: - (JSC::Yarr::Interpreter::allocDisjunctionContext): - (JSC::Yarr::Interpreter::ParenthesesDisjunctionContext::ParenthesesDisjunctionContext): - (JSC::Yarr::Interpreter::allocParenthesesDisjunctionContext): Standardized - spacing for easy grep. - -2011-12-19 Eric Carlson - - Enable for Mac build - https://bugs.webkit.org/show_bug.cgi?id=74838 - - Reviewed by Darin Adler. - - * wtf/Platform.h: - -2011-12-18 Filip Pizlo - - DFG is too sloppy with register allocation - https://bugs.webkit.org/show_bug.cgi?id=74835 - - Reviewed by Gavin Barraclough. - - Added assertions that at the end of a successfully generated basic block, - all use counts should be zero. This revealed a number of bugs: - - - Array length optimizations were turning a must-generate node into one - that is not must-generate, but failing to change the ref count - accordingly. - - - Indexed property storage optimizations were failing to deref their - children, or to deref the indexed property storage node itself. Also, - they used the Phantom node as a replacement. But the Phantom node is - must-generate, which was causing bizarre issues. So this introduces a - Nop node, which should be used in cases where you want a node that is - skipped and has no children. - - This does not have any significant performance effect, but it should - relieve some register pressure. The main thing this patch adds, though, - are the assertions, which should make it easier to do register allocation - related changes in the future. - - * dfg/DFGAbstractState.cpp: - (JSC::DFG::AbstractState::execute): - * dfg/DFGGenerationInfo.h: - (JSC::DFG::GenerationInfo::initConstant): - (JSC::DFG::GenerationInfo::initInteger): - (JSC::DFG::GenerationInfo::initJSValue): - (JSC::DFG::GenerationInfo::initCell): - (JSC::DFG::GenerationInfo::initBoolean): - (JSC::DFG::GenerationInfo::initDouble): - (JSC::DFG::GenerationInfo::initStorage): - (JSC::DFG::GenerationInfo::use): - * dfg/DFGGraph.h: - (JSC::DFG::Graph::clearAndDerefChild1): - (JSC::DFG::Graph::clearAndDerefChild2): - (JSC::DFG::Graph::clearAndDerefChild3): - * dfg/DFGNode.h: - (JSC::DFG::Node::deref): - * dfg/DFGPropagator.cpp: - (JSC::DFG::Propagator::propagateNodePredictions): - (JSC::DFG::Propagator::fixupNode): - * dfg/DFGSpeculativeJIT.cpp: - (JSC::DFG::SpeculativeJIT::compile): - * dfg/DFGSpeculativeJIT32_64.cpp: - (JSC::DFG::SpeculativeJIT::compile): - * dfg/DFGSpeculativeJIT64.cpp: - (JSC::DFG::SpeculativeJIT::compile): - -2011-12-18 Benjamin Poulain - - Remove the duplicated code from ASCIICType.h - https://bugs.webkit.org/show_bug.cgi?id=74771 - - Reviewed by Andreas Kling. - - Use isASCIIDigit() and isASCIIAlpha() instead of copying the code. - - * wtf/ASCIICType.h: - (WTF::isASCIIDigit): - (WTF::isASCIIAlphanumeric): - (WTF::isASCIIHexDigit): - -2011-12-18 Anders Carlsson - - Set the main frame view scroll position asynchronously - https://bugs.webkit.org/show_bug.cgi?id=74823 - - Reviewed by Sam Weinig. - - * JavaScriptCore.exp: - -2011-12-10 Andreas Kling - - OpaqueJSClass: Remove RVCT2 workarounds. - - - Reviewed by Benjamin Poulain. - - We no longer need workarounds for the RVCT2 compiler since it was - only used for the Symbian port of WebKit which is now defunct. - - * API/JSClassRef.cpp: - (OpaqueJSClass::OpaqueJSClass): - (OpaqueJSClassContextData::OpaqueJSClassContextData): - -2011-12-16 Benjamin Poulain - - Remove the duplicated code from ASCIICType.h - https://bugs.webkit.org/show_bug.cgi?id=74771 - - Reviewed by Andreas Kling. - - The functions were sharing similar code and were defined for the various input types. - Use templates instead to avoid code duplication. - - * wtf/ASCIICType.h: - (WTF::isASCII): - (WTF::isASCIIAlpha): - (WTF::isASCIIAlphanumeric): - (WTF::isASCIIDigit): - (WTF::isASCIIHexDigit): - (WTF::isASCIILower): - (WTF::isASCIIOctalDigit): - (WTF::isASCIIPrintable): - (WTF::isASCIISpace): - (WTF::isASCIIUpper): - (WTF::toASCIILower): - (WTF::toASCIIUpper): - (WTF::toASCIIHexValue): - (WTF::lowerNibbleToASCIIHexDigit): - (WTF::upperNibbleToASCIIHexDigit): - -2011-12-16 Filip Pizlo - - DFG OSR exit may get confused about where in the scratch buffer it stored a value - https://bugs.webkit.org/show_bug.cgi?id=74695 - - Reviewed by Oliver Hunt. - - The code that reads from the scratch buffer now explicitly knows which locations to - read from. No new tests, since this patch covers a case so uncommon that I don't know - how to make a test for it. - - * dfg/DFGOSRExitCompiler.h: - (JSC::DFG::OSRExitCompiler::badIndex): - (JSC::DFG::OSRExitCompiler::initializePoisoned): - (JSC::DFG::OSRExitCompiler::poisonIndex): - * dfg/DFGOSRExitCompiler32_64.cpp: - (JSC::DFG::OSRExitCompiler::compileExit): - * dfg/DFGOSRExitCompiler64.cpp: - (JSC::DFG::OSRExitCompiler::compileExit): - -2011-12-16 Oliver Hunt - - PutByVal[Alias] unnecessarily reloads the storage buffer - https://bugs.webkit.org/show_bug.cgi?id=74747 - - Reviewed by Gavin Barraclough. - - Make PutByVal use GetIndexedStorage to load the storage buffer. - This required switching PutByVal to a vararg node (which is - responsible for most of the noise in this patch). This fixes the - remaining portion of the kraken regression caused by the GetByVal - storage load elimination, and a 1-5% win on some of the sub tests of - the typed array benchmark at: - http://stepheneb.github.com/webgl-matrix-benchmarks/matrix_benchmark.html - - * dfg/DFGAbstractState.cpp: - (JSC::DFG::AbstractState::execute): - * dfg/DFGByteCodeParser.cpp: - (JSC::DFG::ByteCodeParser::parseBlock): - * dfg/DFGNode.h: - * dfg/DFGPropagator.cpp: - (JSC::DFG::Propagator::propagateArithNodeFlags): - (JSC::DFG::Propagator::fixupNode): - (JSC::DFG::Propagator::byValIndexIsPure): - (JSC::DFG::Propagator::clobbersWorld): - (JSC::DFG::Propagator::getByValLoadElimination): - (JSC::DFG::Propagator::checkStructureLoadElimination): - (JSC::DFG::Propagator::getByOffsetLoadElimination): - (JSC::DFG::Propagator::getPropertyStorageLoadElimination): - (JSC::DFG::Propagator::getIndexedPropertyStorageLoadElimination): - (JSC::DFG::Propagator::performNodeCSE): - * dfg/DFGSpeculativeJIT.cpp: - (JSC::DFG::SpeculativeJIT::compilePutByValForByteArray): - (JSC::DFG::SpeculativeJIT::compilePutByValForIntTypedArray): - (JSC::DFG::SpeculativeJIT::compilePutByValForFloatTypedArray): - * dfg/DFGSpeculativeJIT.h: - * dfg/DFGSpeculativeJIT32_64.cpp: - (JSC::DFG::SpeculativeJIT::compile): - * dfg/DFGSpeculativeJIT64.cpp: - (JSC::DFG::SpeculativeJIT::compile): - -2011-12-16 Daniel Bates - - Include BlackBerryPlatformLog.h instead of BlackBerryPlatformMisc.h - - Rubber-stamped by Antonio Gomes. - - BlackBerry::Platform::logV() is declared in BlackBerryPlatformLog.h. That is, it isn't - declared in BlackBerryPlatformMisc.h. Hence, we should include BlackBerryPlatformLog.h - instead of BlackBerryPlatformMisc.h. - - * wtf/Assertions.cpp: - -2011-12-16 Mark Hahnenberg - - De-virtualize destructors - https://bugs.webkit.org/show_bug.cgi?id=74331 - - Reviewed by Geoffrey Garen. - - This is a megapatch which frees us from the chains of virtual destructors. - - In order to remove the virtual destructors, which are the last of the virtual - functions, from the JSCell hierarchy, we need to add the ClassInfo pointer to - the cell rather than to the structure because in order to be able to lazily call - the static destroy() functions that will replace the virtual destructors, we - need to be able to access the ClassInfo without the danger of the object's - Structure being collected before the object itself. - - After adding the ClassInfo to the cell, we can then begin to remove our use - of vptrs for optimizations within the JIT and the GC. When we have removed - all of the stored vptrs from JSGlobalData, we can then also remove all of - the related VPtrStealingHack code. - - The replacement for virtual destructors will be to add a static destroy function - pointer to the MethodTable stored in ClassInfo. Any subclass of JSCell that has - a non-trivial destructor will require its own static destroy function to static - call its corresponding destructor, which will now be non-virtual. In future - patches we will slowly move away from destructors altogether as we make more and - more objects backed by GC memory rather than malloc-ed memory. The GC will now - call the static destroy method rather than the virtual destructor. - - As we go through the hierarchy and add static destroy functions to classes, - we will also add a new assert, ASSERT_HAS_TRIVIAL_DESTRUCTOR, to those classes - to which it applies. The future goal is to eventually have every class have that assert. - - * API/JSCallbackConstructor.cpp: - (JSC::JSCallbackConstructor::destroy): Add a destroy function to statically call - ~JSCallbackConstructor because it has some extra destruction logic. - * API/JSCallbackConstructor.h: - * API/JSCallbackFunction.cpp: Add trivial destructor assert for JSCallbackFunction. - * API/JSCallbackObject.cpp: Add a destroy function to statically call ~JSCallbackObject - because it has a member OwnPtr that needs destruction. - (JSC::::destroy): - * API/JSCallbackObject.h: - * JavaScriptCore.exp: Add/remove necessary symbols for JSC. - * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def: Same for Windows symbols. - * debugger/DebuggerActivation.cpp: DebuggerActivation, for some strange reason, didn't - have its own ClassInfo despite the fact that it overrides a number of MethodTable - methods. Added the ClassInfo, along with an assertion that its destructor is trivial. - * debugger/DebuggerActivation.h: - * dfg/DFGOperations.cpp: Remove global data first argument to isJSArray, isJSByteArray, - isJSString, as it is no longer necessary. - (JSC::DFG::putByVal): - * dfg/DFGRepatch.cpp: Ditto. Also remove uses of jsArrayVPtr in favor of using the - JSArray ClassInfo pointer. - (JSC::DFG::tryCacheGetByID): - * dfg/DFGSpeculativeJIT.cpp: Replace uses of the old vptrs with new ClassInfo - comparisons since we don't have vptrs anymore. - (JSC::DFG::SpeculativeJIT::compilePeepHoleObjectEquality): - (JSC::DFG::SpeculativeJIT::compilePeepHoleBranch): - (JSC::DFG::SpeculativeJIT::checkArgumentTypes): - (JSC::DFG::SpeculativeJIT::compilePutByValForByteArray): - (JSC::DFG::SpeculativeJIT::compileGetTypedArrayLength): - (JSC::DFG::SpeculativeJIT::compilePutByValForIntTypedArray): - (JSC::DFG::SpeculativeJIT::compilePutByValForFloatTypedArray): - (JSC::DFG::SpeculativeJIT::compare): - (JSC::DFG::SpeculativeJIT::compileStrictEq): - (JSC::DFG::SpeculativeJIT::compileGetIndexedPropertyStorage): - * dfg/DFGSpeculativeJIT.h: Ditto. - (JSC::DFG::SpeculativeJIT::emitAllocateJSFinalObject): - * dfg/DFGSpeculativeJIT32_64.cpp: Ditto. - (JSC::DFG::SpeculativeJIT::compileObjectEquality): - (JSC::DFG::SpeculativeJIT::compileObjectOrOtherLogicalNot): - (JSC::DFG::SpeculativeJIT::compileLogicalNot): - (JSC::DFG::SpeculativeJIT::emitObjectOrOtherBranch): - (JSC::DFG::SpeculativeJIT::emitBranch): - (JSC::DFG::SpeculativeJIT::compile): - * dfg/DFGSpeculativeJIT64.cpp: Ditto. - (JSC::DFG::SpeculativeJIT::compileObjectEquality): - (JSC::DFG::SpeculativeJIT::compileObjectOrOtherLogicalNot): - (JSC::DFG::SpeculativeJIT::compileLogicalNot): - (JSC::DFG::SpeculativeJIT::emitObjectOrOtherBranch): - (JSC::DFG::SpeculativeJIT::emitBranch): - (JSC::DFG::SpeculativeJIT::compile): - * heap/Heap.cpp: Remove all uses of vptrs in GC optimizations and replace them with - ClassInfo comparisons. - (JSC::Heap::Heap): - * heap/MarkStack.cpp: Ditto. - (JSC::MarkStackThreadSharedData::markingThreadMain): - (JSC::visitChildren): - (JSC::SlotVisitor::drain): - * heap/MarkStack.h: Ditto. - (JSC::MarkStack::MarkStack): - * heap/MarkedBlock.cpp: Ditto. - (JSC::MarkedBlock::callDestructor): - (JSC::MarkedBlock::specializedSweep): - * heap/MarkedBlock.h: Ditto. - * heap/SlotVisitor.h: Ditto. - (JSC::SlotVisitor::SlotVisitor): - * heap/VTableSpectrum.cpp: Now that we don't have vptrs, we can't count them. - We'll have to rename this class and make it use ClassInfo ptrs in a future patch. - (JSC::VTableSpectrum::count): - * interpreter/Interpreter.cpp: Remove all global data arguments from isJSArray, - etc. functions. - (JSC::loadVarargs): - (JSC::Interpreter::tryCacheGetByID): - (JSC::Interpreter::privateExecute): - * jit/JIT.h: Remove vptr argument from emitAllocateBasicJSObject - * jit/JITInlineMethods.h: Remove vptr planting, and add ClassInfo planting, - remove all vtable related code. - (JSC::JIT::emitLoadCharacterString): - (JSC::JIT::emitAllocateBasicJSObject): - (JSC::JIT::emitAllocateJSFinalObject): - (JSC::JIT::emitAllocateJSFunction): - * jit/JITOpcodes.cpp: Replace vptr related branch code with corresponding ClassInfo. - (JSC::JIT::privateCompileCTIMachineTrampolines): - (JSC::JIT::emit_op_to_primitive): - (JSC::JIT::emit_op_convert_this): - * jit/JITOpcodes32_64.cpp: Ditto. - (JSC::JIT::privateCompileCTIMachineTrampolines): - (JSC::JIT::emit_op_to_primitive): - (JSC::JIT::emitSlow_op_eq): - (JSC::JIT::emitSlow_op_neq): - (JSC::JIT::compileOpStrictEq): - (JSC::JIT::emit_op_convert_this): - * jit/JITPropertyAccess.cpp: Ditto. - (JSC::JIT::stringGetByValStubGenerator): - (JSC::JIT::emit_op_get_by_val): - (JSC::JIT::emitSlow_op_get_by_val): - (JSC::JIT::emit_op_put_by_val): - (JSC::JIT::privateCompilePutByIdTransition): - (JSC::JIT::privateCompilePatchGetArrayLength): - * jit/JITPropertyAccess32_64.cpp: Ditto. - (JSC::JIT::stringGetByValStubGenerator): - (JSC::JIT::emit_op_get_by_val): - (JSC::JIT::emitSlow_op_get_by_val): - (JSC::JIT::emit_op_put_by_val): - (JSC::JIT::privateCompilePatchGetArrayLength): - * jit/JITStubs.cpp: Remove global data argument from isJSString, etc. - (JSC::JITThunks::tryCacheGetByID): - (JSC::DEFINE_STUB_FUNCTION): - * jit/SpecializedThunkJIT.h: Replace vptr related stuff with ClassInfo stuff. - (JSC::SpecializedThunkJIT::loadJSStringArgument): - * runtime/ArrayConstructor.cpp: Add trivial destructor assert. - * runtime/ArrayPrototype.cpp: Remove global data argument from isJSArray. - (JSC::arrayProtoFuncToString): - (JSC::arrayProtoFuncJoin): - (JSC::arrayProtoFuncPop): - (JSC::arrayProtoFuncPush): - (JSC::arrayProtoFuncShift): - (JSC::arrayProtoFuncSplice): - (JSC::arrayProtoFuncUnShift): - (JSC::arrayProtoFuncFilter): - (JSC::arrayProtoFuncMap): - (JSC::arrayProtoFuncEvery): - (JSC::arrayProtoFuncForEach): - (JSC::arrayProtoFuncSome): - (JSC::arrayProtoFuncReduce): - (JSC::arrayProtoFuncReduceRight): - * runtime/BooleanConstructor.cpp: Add trivial destructor assert. - * runtime/BooleanObject.cpp: Ditto. - * runtime/BooleanPrototype.cpp: Ditto. - * runtime/ClassInfo.h: Add destroy function pointer to MethodTable. - * runtime/DateConstructor.cpp: Add trivial destructor assert. - * runtime/DateInstance.cpp: Add destroy function for DateInstance because it has a RefPtr - that needs destruction. - (JSC::DateInstance::destroy): - * runtime/DateInstance.h: - * runtime/Error.cpp: Ditto (because of UString member). - (JSC::StrictModeTypeErrorFunction::destroy): - * runtime/Error.h: - * runtime/ErrorConstructor.cpp: Add trivial destructor assert. - * runtime/ErrorInstance.cpp: Ditto. - * runtime/ExceptionHelpers.cpp: Ditto. - * runtime/Executable.cpp: Add destroy functions for ExecutableBase and subclasses. - (JSC::ExecutableBase::destroy): - (JSC::NativeExecutable::destroy): - (JSC::ScriptExecutable::destroy): - (JSC::EvalExecutable::destroy): - (JSC::ProgramExecutable::destroy): - (JSC::FunctionExecutable::destroy): - * runtime/Executable.h: - * runtime/FunctionConstructor.cpp: Add trivial destructor assert. - * runtime/FunctionPrototype.cpp: Ditto. Also remove global data first arg from isJSArray. - (JSC::functionProtoFuncApply): - * runtime/GetterSetter.cpp: Ditto. - * runtime/InitializeThreading.cpp: Remove call to JSGlobalData::storeVPtrs since it no - longer exists. - (JSC::initializeThreadingOnce): - * runtime/InternalFunction.cpp: Remove vtableAnchor function, add trivial destructor assert, - remove first arg from isJSString. - (JSC::InternalFunction::displayName): - * runtime/InternalFunction.h: Remove VPtrStealingHack. - * runtime/JSAPIValueWrapper.cpp: Add trivial destructor assert. - * runtime/JSArray.cpp: Add static destroy to call ~JSArray. Replace vptr checks in - destructor with ClassInfo checks. - (JSC::JSArray::~JSArray): - (JSC::JSArray::destroy): - * runtime/JSArray.h: Remove VPtrStealingHack. Remove globalData argument from isJSArray - and change them to check the ClassInfo rather than the vptrs. - (JSC::isJSArray): - * runtime/JSBoundFunction.cpp: Add trival destructor assert. Remove first arg from isJSArray. - (JSC::boundFunctionCall): - (JSC::boundFunctionConstruct): - * runtime/JSByteArray.cpp: Add static destroy function, replace vptr checks with ClassInfo checks. - (JSC::JSByteArray::~JSByteArray): - (JSC::JSByteArray::destroy): - * runtime/JSByteArray.h: Remove VPtrStealingHack code. - (JSC::isJSByteArray): - * runtime/JSCell.cpp: Add trivial destructor assert. Add static destroy function. - (JSC::JSCell::destroy): - * runtime/JSCell.h: Remove VPtrStealingHack code. Add function for returning the offset - of the ClassInfo pointer in the object for use by the JIT. Add the ClassInfo pointer to - the JSCell itself, and grab it from the Structure. Remove the vptr and setVPtr functions, - as they are no longer used. Add a validatedClassInfo function to JSCell for any clients - that want to verify, while in Debug mode, that the ClassInfo contained in the cell is the - same one as that contained in the Structure. This isn't used too often, because most of - the places where we compare the ClassInfo to things can be called during destruction. - Since the Structure is unreliable during the phase when destructors are being called, - we can't call validatedClassInfo. - (JSC::JSCell::classInfoOffset): - (JSC::JSCell::structure): - (JSC::JSCell::classInfo): - * runtime/JSFunction.cpp: Remove VPtrStealingHack code. Add static destroy, remove vtableAnchor, - remove first arg from call to isJSString. - (JSC::JSFunction::destroy): - (JSC::JSFunction::displayName): - * runtime/JSFunction.h: - * runtime/JSGlobalData.cpp: Remove all VPtr stealing code and storage, including storeVPtrs, - as these vptrs are no longer needed in the codebase. - * runtime/JSGlobalData.h: - (JSC::TypedArrayDescriptor::TypedArrayDescriptor): Changed the TypedArrayDescriptor to use - ClassInfo rather than the vptr. - * runtime/JSGlobalObject.cpp: Add static destroy function. - (JSC::JSGlobalObject::destroy): - * runtime/JSGlobalObject.h: - * runtime/JSGlobalThis.cpp: Add trivial destructor assert. - * runtime/JSNotAnObject.cpp: Ditto. - * runtime/JSONObject.cpp: Ditto. Remove first arg from isJSArray calls. - (JSC::Stringifier::Holder::appendNextProperty): - (JSC::Walker::walk): - * runtime/JSObject.cpp: - (JSC::JSFinalObject::destroy): - (JSC::JSNonFinalObject::destroy): - (JSC::JSObject::destroy): - * runtime/JSObject.h: Add trivial destructor assert for JSObject, remove vtableAnchor - from JSNonFinalObject and JSFinalObject, add static destroy for JSFinalObject and - JSNonFinalObject, add isJSFinalObject utility function similar to isJSArray, remove all VPtrStealingHack code. - (JSC::JSObject::finishCreation): - (JSC::JSNonFinalObject::finishCreation): - (JSC::JSFinalObject::finishCreation): - (JSC::isJSFinalObject): - * runtime/JSPropertyNameIterator.cpp: Add static destroy. - (JSC::JSPropertyNameIterator::destroy): - * runtime/JSPropertyNameIterator.h: - * runtime/JSStaticScopeObject.cpp: Ditto. - (JSC::JSStaticScopeObject::destroy): - * runtime/JSStaticScopeObject.h: Ditto. - * runtime/JSString.cpp: - (JSC::JSString::destroy): - * runtime/JSString.h: Ditto. Remove VPtrStealingHack code. Also remove fixupVPtr code, - since we no longer need to fixup vptrs. - (JSC::jsSingleCharacterString): - (JSC::jsSingleCharacterSubstring): - (JSC::jsNontrivialString): - (JSC::jsString): - (JSC::jsSubstring8): - (JSC::jsSubstring): - (JSC::jsOwnedString): - (JSC::jsStringBuilder): - (JSC::isJSString): - * runtime/JSVariableObject.cpp: - (JSC::JSVariableObject::destroy): - * runtime/JSVariableObject.h: Ditto. - * runtime/JSWrapperObject.cpp: - * runtime/JSWrapperObject.h: Add trivial destructor assert. - * runtime/MathObject.cpp: Ditto. - * runtime/NativeErrorConstructor.cpp: Ditto. - * runtime/NumberConstructor.cpp: Ditto. - * runtime/NumberObject.cpp: Ditto. - * runtime/NumberPrototype.cpp: Ditto. - * runtime/ObjectConstructor.cpp: Ditto. - * runtime/ObjectPrototype.cpp: Ditto. - * runtime/Operations.h: Remove calls to fixupVPtr, remove first arg to isJSString. - (JSC::jsString): - (JSC::jsLess): - (JSC::jsLessEq): - * runtime/RegExp.cpp: Add static destroy. - (JSC::RegExp::destroy): - * runtime/RegExp.h: - * runtime/RegExpConstructor.cpp: Add static destroy for RegExpConstructor and RegExpMatchesArray. - (JSC::RegExpConstructor::destroy): - (JSC::RegExpMatchesArray::destroy): - * runtime/RegExpConstructor.h: - * runtime/RegExpMatchesArray.h: - * runtime/RegExpObject.cpp: Add static destroy. - (JSC::RegExpObject::destroy): - * runtime/RegExpObject.h: - * runtime/ScopeChain.cpp: Add trivial destructor assert. - * runtime/ScopeChain.h: - * runtime/StrictEvalActivation.cpp: Ditto. - * runtime/StringConstructor.cpp: - * runtime/StringObject.cpp: Ditto. Remove vtableAnchor. - * runtime/StringObject.h: - * runtime/StringPrototype.cpp: Ditto. - * runtime/Structure.cpp: Add static destroy. - (JSC::Structure::destroy): - * runtime/Structure.h: Move JSCell::finishCreation and JSCell constructor into Structure.h - because they need to have the full Structure type to access the ClassInfo to store in the JSCell. - (JSC::JSCell::setStructure): - (JSC::JSCell::validatedClassInfo): - (JSC::JSCell::JSCell): - (JSC::JSCell::finishCreation): - * runtime/StructureChain.cpp: Add static destroy. - (JSC::StructureChain::destroy): - * runtime/StructureChain.h: - * wtf/Assertions.h: Add new assertion ASSERT_HAS_TRIVIAL_DESTRUCTOR, which uses clangs - ability to tell us when a class has a trivial destructor. We will use this assert - more in future patches as we move toward having all JSC objects backed by GC memory, - which means moving away from using destructors/finalizers. - -2011-12-15 Martin Robinson - - Fix 'make dist' in preparation for the GTK+ release. - - * GNUmakefile.list.am: Add missing header. - -2011-12-15 Sam Weinig - - JavaScriptCore uses obsolete 'cpy' mnemonic in ARM assembly - - Reviewed by Gavin Barraclough. - - Original patch by Jim Grosbach. - - * jit/JITStubs.cpp: - (JSC::ctiTrampoline): - (JSC::ctiVMThrowTrampoline): - Replace uses of the 'cpy' mnemonic with 'mov'. - -2011-12-15 Filip Pizlo - - Value profiling should distinguished between NaN and non-NaN doubles - https://bugs.webkit.org/show_bug.cgi?id=74682 - - Reviewed by Gavin Barraclough. - - Added PredictDoubleReal and PredictDoubleNaN. PredictDouble is now the union - of the two. - - * bytecode/PredictedType.cpp: - (JSC::predictionToString): - (JSC::predictionFromValue): - * bytecode/PredictedType.h: - (JSC::isDoubleRealPrediction): - (JSC::isDoublePrediction): - -2011-12-15 Anders Carlsson - - Regression (r102866): Navigating away from or closing a page with a plugin crashes - https://bugs.webkit.org/show_bug.cgi?id=74655 - - - Reviewed by Sam Weinig. - - Rewrite HasRefAndDeref to work if ref and deref are implemented in base classes, - using a modified version of the technique described here: - http://groups.google.com/group/comp.lang.c++.moderated/msg/e5fbc9305539f699 - - * wtf/Functional.h: - -2011-12-15 Andy Wingo - - Warnings fixes in Interpreter.cpp and PrivateExecute.cpp - https://bugs.webkit.org/show_bug.cgi?id=74624 - - Reviewed by Darin Adler. - - * interpreter/Interpreter.cpp: - (JSC::Interpreter::privateExecute): Fix variables unused in - release mode. - * wtf/ParallelJobsGeneric.cpp: - (WTF::ParallelEnvironment::ParallelEnvironment): Fix - signed/unsigned comparison warning, with a cast. - -2011-12-15 Andy Wingo - - Use more macrology in JSC::Options - https://bugs.webkit.org/show_bug.cgi?id=72938 - - Reviewed by Filip Pizlo. - - * runtime/Options.cpp: - (JSC::Options::initializeOptions): - * runtime/Options.h: Use macros to ensure that all heuristics are - declared and have initializers. - -2011-12-15 Anders Carlsson - - Add ScrollingCoordinator class and ENABLE_THREADED_SCROLLING define - https://bugs.webkit.org/show_bug.cgi?id=74639 - - Reviewed by Andreas Kling. - - Add ENABLE_THREADED_SCROLLING #define. - - * wtf/Platform.h: - -2011-12-15 Anders Carlsson - - EventDispatcher should handle wheel events on the connection queue - https://bugs.webkit.org/show_bug.cgi?id=74627 - - Reviewed by Andreas Kling. - - Add a BoundFunctionImpl specialization that takes three parameters. - - * wtf/Functional.h: - (WTF::C::): - (WTF::R): - (WTF::bind): - -2011-12-14 Anders Carlsson - - Add WTF::Function to wtf/Forward.h - https://bugs.webkit.org/show_bug.cgi?id=74576 - - Reviewed by Adam Roben. - - * jsc.cpp: - Work around a name conflict in the readline library. - - * wtf/Forward.h: - Add Function. - -2011-12-15 Igor Oliveira - - [Qt] Support requestAnimationFrame API - https://bugs.webkit.org/show_bug.cgi?id=74528 - - Let Qt port use REQUEST_ANIMATION_FRAME_TIMER. - - Reviewed by Kenneth Rohde Christiansen. - - * wtf/Platform.h: - -2011-12-15 Andy Wingo - - Minor refactor to Parser::parseTryStatement - https://bugs.webkit.org/show_bug.cgi?id=74507 - - Reviewed by Geoffrey Garen. - - * parser/Parser.cpp (JSC::Parser::parseTryStatement): Use the - Parser's declareVariable instead of going directly to the scope. - This will facilitate future checks related to harmony block - scoping. - -2011-12-15 Andy Wingo - - Rename JSC::Heuristics to JSC::Options - https://bugs.webkit.org/show_bug.cgi?id=72889 - - Reviewed by Filip Pizlo. - - * runtime/Options.cpp: Renamed from Source/JavaScriptCore/runtime/Heuristics.cpp. - * runtime/Options.h: Renamed from Source/JavaScriptCore/runtime/Heuristics.h. - - * CMakeLists.txt: - * GNUmakefile.list.am: - * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj: - * JavaScriptCore.xcodeproj/project.pbxproj: - * Target.pri: - * bytecode/CodeBlock.cpp: - (JSC::CodeBlock::shouldOptimizeNow): - * bytecode/CodeBlock.h: - (JSC::CodeBlock::likelyToTakeSlowCase): - (JSC::CodeBlock::couldTakeSlowCase): - (JSC::CodeBlock::likelyToTakeSpecialFastCase): - (JSC::CodeBlock::likelyToTakeDeepestSlowCase): - (JSC::CodeBlock::likelyToTakeAnySlowCase): - (JSC::CodeBlock::reoptimizationRetryCounter): - (JSC::CodeBlock::countReoptimization): - (JSC::CodeBlock::counterValueForOptimizeAfterWarmUp): - (JSC::CodeBlock::counterValueForOptimizeAfterLongWarmUp): - (JSC::CodeBlock::optimizeNextInvocation): - (JSC::CodeBlock::dontOptimizeAnytimeSoon): - (JSC::CodeBlock::optimizeSoon): - (JSC::CodeBlock::largeFailCountThreshold): - (JSC::CodeBlock::largeFailCountThresholdForLoop): - (JSC::CodeBlock::shouldReoptimizeNow): - (JSC::CodeBlock::shouldReoptimizeFromLoopNow): - * dfg/DFGByteCodeParser.cpp: - (JSC::DFG::ByteCodeParser::handleInlining): - * dfg/DFGCapabilities.h: - (JSC::DFG::mightCompileEval): - (JSC::DFG::mightCompileProgram): - (JSC::DFG::mightCompileFunctionForCall): - (JSC::DFG::mightCompileFunctionForConstruct): - (JSC::DFG::mightInlineFunctionForCall): - (JSC::DFG::mightInlineFunctionForConstruct): - * dfg/DFGOSRExit.cpp: - (JSC::DFG::OSRExit::considerAddingAsFrequentExitSiteSlow): - * dfg/DFGOSRExitCompiler32_64.cpp: - (JSC::DFG::OSRExitCompiler::compileExit): - * dfg/DFGOSRExitCompiler64.cpp: - (JSC::DFG::OSRExitCompiler::compileExit): - * dfg/DFGVariableAccessData.h: - (JSC::DFG::VariableAccessData::shouldUseDoubleFormatAccordingToVote): - * heap/MarkStack.cpp: - (JSC::MarkStackSegmentAllocator::allocate): - (JSC::MarkStackSegmentAllocator::shrinkReserve): - (JSC::MarkStackArray::MarkStackArray): - (JSC::MarkStackArray::donateSomeCellsTo): - (JSC::MarkStackArray::stealSomeCellsFrom): - (JSC::MarkStackThreadSharedData::MarkStackThreadSharedData): - (JSC::SlotVisitor::donateSlow): - (JSC::SlotVisitor::drain): - (JSC::SlotVisitor::drainFromShared): - * heap/MarkStack.h: - (JSC::MarkStack::mergeOpaqueRootsIfProfitable): - (JSC::MarkStack::addOpaqueRoot): - (JSC::MarkStackArray::canDonateSomeCells): - * heap/SlotVisitor.h: - (JSC::SlotVisitor::donate): - * jit/JIT.cpp: - (JSC::JIT::emitOptimizationCheck): - * runtime/InitializeThreading.cpp: - (JSC::initializeThreadingOnce): Adapt callers and build systems. - - * testRegExp.cpp: - (CommandLine::CommandLine): - * jsc.cpp: - (CommandLine::CommandLine): - Rename from Options, to avoid name conflict. - -2011-12-14 Sam Weinig - - Revert unintentional change to JavaScriptCore.def - - * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def: - -2011-12-14 Sam Weinig - - Remove whitespace from InheritedPropertySheets attributes in - vsprops files to appease the Visual Studio project migrator. - - Reviewed by Adam Roben. - - * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def: - * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCoreDebug.vsprops: - * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCoreDebugAll.vsprops: - * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCoreDebugCairoCFLite.vsprops: - * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCoreGeneratedDebug.vsprops: - * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCoreGeneratedDebugAll.vsprops: - * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCoreGeneratedDebugCairoCFLite.vsprops: - * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCoreGeneratedProduction.vsprops: - * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCoreGeneratedRelease.vsprops: - * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCoreGeneratedReleaseCairoCFLite.vsprops: - * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCoreGeneratedReleasePGO.vsprops: - * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCoreProduction.vsprops: - * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCoreRelease.vsprops: - * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCoreReleaseCairoCFLite.vsprops: - * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCoreReleasePGO.vsprops: - * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCoreReleasePGOOptimize.vsprops: - * JavaScriptCore.vcproj/WTF/WTFDebug.vsprops: - * JavaScriptCore.vcproj/WTF/WTFDebugAll.vsprops: - * JavaScriptCore.vcproj/WTF/WTFDebugCairoCFLite.vsprops: - * JavaScriptCore.vcproj/WTF/WTFProduction.vsprops: - * JavaScriptCore.vcproj/WTF/WTFRelease.vsprops: - * JavaScriptCore.vcproj/WTF/WTFReleaseCairoCFLite.vsprops: - * JavaScriptCore.vcproj/WTF/WTFReleasePGO.vsprops: - * JavaScriptCore.vcproj/jsc/jscDebug.vsprops: - * JavaScriptCore.vcproj/jsc/jscDebugAll.vsprops: - * JavaScriptCore.vcproj/jsc/jscDebugCairoCFLite.vsprops: - * JavaScriptCore.vcproj/jsc/jscProduction.vsprops: - * JavaScriptCore.vcproj/jsc/jscRelease.vsprops: - * JavaScriptCore.vcproj/jsc/jscReleaseCairoCFLite.vsprops: - * JavaScriptCore.vcproj/jsc/jscReleasePGO.vsprops: - * JavaScriptCore.vcproj/testRegExp/testRegExpDebug.vsprops: - * JavaScriptCore.vcproj/testRegExp/testRegExpDebugAll.vsprops: - * JavaScriptCore.vcproj/testRegExp/testRegExpDebugCairoCFLite.vsprops: - * JavaScriptCore.vcproj/testRegExp/testRegExpProduction.vsprops: - * JavaScriptCore.vcproj/testRegExp/testRegExpRelease.vsprops: - * JavaScriptCore.vcproj/testRegExp/testRegExpReleaseCairoCFLite.vsprops: - * JavaScriptCore.vcproj/testRegExp/testRegExpReleasePGO.vsprops: - * JavaScriptCore.vcproj/testapi/testapiDebug.vsprops: - * JavaScriptCore.vcproj/testapi/testapiDebugAll.vsprops: - * JavaScriptCore.vcproj/testapi/testapiDebugCairoCFLite.vsprops: - * JavaScriptCore.vcproj/testapi/testapiProduction.vsprops: - * JavaScriptCore.vcproj/testapi/testapiRelease.vsprops: - * JavaScriptCore.vcproj/testapi/testapiReleaseCairoCFLite.vsprops: - -2011-12-14 Anders Carlsson - - binding a member function should ref/deref the object pointer if needed - https://bugs.webkit.org/show_bug.cgi?id=74552 - - Reviewed by Sam Weinig. - - Add a HasRefAndDeref helper class template which checks if a given class type has ref and deref - member functions which the right type. Use this to determine if we should ref/deref the first parameter. - - * wtf/Functional.h: - (WTF::R): - (WTF::C::): - (WTF::RefAndDeref::ref): - (WTF::RefAndDeref::deref): - -2011-12-14 Hajime Morrita - - JS_INLINE and WTF_INLINE should be visible from WebCore - https://bugs.webkit.org/show_bug.cgi?id=73191 - - - Moved Export related macro definitions from config.h to ExportMacros.h and JSExportMacros.h. - - Moved WTF_USE_JSC and WTF_USE_V8 from various config.h family to Platform.h. - - Replaced JS_EXPORTDATA in wtf moudule with newly introduced WTF_EXPORTDATA. - - Reviewed by Kevin Ollivier. - - * JavaScriptCore.xcodeproj/project.pbxproj: - * config.h: - * runtime/JSExportMacros.h: Added. - * wtf/ExportMacros.h: - * wtf/Platform.h: - * wtf/WTFThreadData.h: - * wtf/text/AtomicString.h: - * wtf/text/StringStatics.cpp: - -2011-12-14 Anders Carlsson - - Work around a bug in the MSVC2005 compiler - https://bugs.webkit.org/show_bug.cgi?id=74550 - - Reviewed by Sam Weinig. - - Add template parameters for the return types of the partial specializations of BoundFunctionImpl. - - * wtf/Functional.h: - (WTF::R): - -2011-12-13 Jon Lee - - Enable notifications on Mac. - - Reviewed by Sam Weinig. - - * Configurations/FeatureDefines.xcconfig: - -2011-12-14 David Kilzer - - Remove definition of old ENABLE(YARR) macro - - - Reviewed by Darin Adler. - - * wtf/Platform.h: Removed ENABLE_YARR macros. - -2011-12-14 Anders Carlsson - - bind should handle member functions - https://bugs.webkit.org/show_bug.cgi?id=74529 - - Reviewed by Sam Weinig. - - Add FunctionWrapper partial specializations for member function pointers. - - * wtf/Functional.h: - (WTF::C::): - -2011-12-14 Gavin Barraclough - - DFG relies on returning a struct in registers - https://bugs.webkit.org/show_bug.cgi?id=74527 - - Reviewed by Geoff Garen. - - This will not work on all platforms. Returning a uint64_t will more reliably achieve - what we want, on 32-bit platforms (on 64-bit, stick with the struct return). - - * dfg/DFGOperations.cpp: - * dfg/DFGOperations.h: - (JSC::DFG::DFGHandler::dfgHandlerEncoded): - -2011-12-14 Anders Carlsson - - Add unary and binary bind overloads - https://bugs.webkit.org/show_bug.cgi?id=74524 - - Reviewed by Sam Weinig. - - * wtf/Functional.h: - (WTF::R): - (WTF::FunctionWrapper::ResultType): - (WTF::bind): - -2011-12-14 Anders Carlsson - - Add back the callOnMainThread overload that takes a WTF::Function - https://bugs.webkit.org/show_bug.cgi?id=74512 - - Reviewed by Darin Adler. - - Add back the overload; the changes to WebCore should hopefully keep Windows building. - - * wtf/MainThread.cpp: - (WTF::callFunctionObject): - (WTF::callOnMainThread): - * wtf/MainThread.h: - -2011-12-13 Filip Pizlo - - DFG should infer when local variables are doubles - https://bugs.webkit.org/show_bug.cgi?id=74480 - - Reviewed by Oliver Hunt. - - Introduced the notion that a local variable (though not an argument, yet!) can - be stored as a double, and will be guaranteed to always contain a double. This - requires more magic in the OSR (conversion in both entry and exit). The inference - is quite unorthodox: all uses of a variable vote on whether they think it should - be a double or a JSValue, based on how they use it. If they use it in an integer - or boxed value context, they vote JSValue. If they use it in a double context, - they vote double. This voting is interleaved in the propagator's fixpoint, so - that variables voted double then have a double prediction propagated from them. - This interleaving is needed because a variable that actually always contains an - integer that always gets used in arithmetic that involves doubles may end up - being voted double, which then means that all uses of the variable will see a - double rather than an integer. - - This is worth 18% to SunSpider/3d-cube, 7% to Kraken/audio-beat-detection, 7% - to Kraken/audio-fft, 6% to Kraken/imaging-darkroom, 20% to - Kraken/imaging-gaussian-blur, and just over 1% to Kraken/json-parse-financial. - It results in a 1% speed-up on SunSpider and a 4% speed-up in Kraken. Similar - results on JSVALUE32_64, though with a bigger win on Kraken (5%) and no overall - win on SunSpider. - - * bytecode/ValueRecovery.h: - (JSC::ValueRecovery::alreadyInRegisterFileAsUnboxedDouble): - (JSC::ValueRecovery::dump): - * dfg/DFGAbstractState.cpp: - (JSC::DFG::AbstractState::execute): - * dfg/DFGAssemblyHelpers.h: - (JSC::DFG::AssemblyHelpers::boxDouble): - * dfg/DFGGraph.cpp: - (JSC::DFG::Graph::dump): - * dfg/DFGJITCompiler.h: - (JSC::DFG::JITCompiler::noticeOSREntry): - * dfg/DFGOSREntry.cpp: - (JSC::DFG::prepareOSREntry): - * dfg/DFGOSREntry.h: - * dfg/DFGOSRExitCompiler64.cpp: - (JSC::DFG::OSRExitCompiler::compileExit): - * dfg/DFGPropagator.cpp: - (JSC::DFG::Propagator::vote): - (JSC::DFG::Propagator::doRoundOfDoubleVoting): - (JSC::DFG::Propagator::propagatePredictions): - (JSC::DFG::Propagator::fixupNode): - * dfg/DFGSpeculativeJIT.cpp: - (JSC::DFG::ValueSource::dump): - (JSC::DFG::SpeculativeJIT::compile): - (JSC::DFG::SpeculativeJIT::computeValueRecoveryFor): - * dfg/DFGSpeculativeJIT.h: - * dfg/DFGSpeculativeJIT32_64.cpp: - (JSC::DFG::SpeculativeJIT::compile): - * dfg/DFGSpeculativeJIT64.cpp: - (JSC::DFG::SpeculativeJIT::compile): - * dfg/DFGVariableAccessData.h: - (JSC::DFG::VariableAccessData::VariableAccessData): - (JSC::DFG::VariableAccessData::clearVotes): - (JSC::DFG::VariableAccessData::vote): - (JSC::DFG::VariableAccessData::doubleVoteRatio): - (JSC::DFG::VariableAccessData::shouldUseDoubleFormatAccordingToVote): - (JSC::DFG::VariableAccessData::shouldUseDoubleFormat): - (JSC::DFG::VariableAccessData::tallyVotesForShouldUseDoubleFormat): - * runtime/Arguments.cpp: - (JSC::Arguments::tearOff): - * runtime/Heuristics.cpp: - (JSC::Heuristics::initializeHeuristics): - * runtime/Heuristics.h: - -2011-12-13 Anders Carlsson - - Try to fix the Windows build. - - Remove the callOnMainThread overload that takes a WTF::Function since it's not being used. - - * wtf/MainThread.cpp: - * wtf/MainThread.h: - -2011-12-13 Anders Carlsson - - Add a very bare-bones implementation of bind and Function to WTF - https://bugs.webkit.org/show_bug.cgi?id=74462 - - Reviewed by Sam Weinig. - - In order to make it easier to package up function calls and send them across - threads, add a (currently very simple) implementation of WTF::bind and WTF::Function to a new - wtf/Functional.h header. - - Currently, all bind can do is bind a nullary function and return a Function object that can be called and copied, - but I'll add more as the need arises. - - * GNUmakefile.list.am: - * JavaScriptCore.gypi: - * JavaScriptCore.vcproj/WTF/WTF.vcproj: - * JavaScriptCore.xcodeproj/project.pbxproj: - * wtf/Functional.h: Added. - (WTF::R): - (WTF::FunctionImplBase::~FunctionImplBase): - (WTF::FunctionWrapper::ResultType): - (WTF::FunctionBase::isNull): - (WTF::FunctionBase::FunctionBase): - (WTF::FunctionBase::impl): - (WTF::bind): - * wtf/MainThread.cpp: - (WTF::callFunctionObject): - (WTF::callOnMainThread): - * wtf/MainThread.h: - * wtf/wtf.pro: - -2011-12-13 Geoffrey Garen - - GC Crash introduced in r102545 - - Reviewed by Gavin Barraclough. - - MarkedArgumentBuffer was still marking items in forwards order, even though - the argument order has been reversed. - - I fixed this bug, and replaced address calculation code with some helper - functions -- mallocBase() and slotFor() -- so it stays fixed everywhere. - - * runtime/ArgList.cpp: - (JSC::MarkedArgumentBuffer::markLists): - (JSC::MarkedArgumentBuffer::slowAppend): - * runtime/ArgList.h: - (JSC::MarkedArgumentBuffer::~MarkedArgumentBuffer): - (JSC::MarkedArgumentBuffer::at): - (JSC::MarkedArgumentBuffer::append): - (JSC::MarkedArgumentBuffer::last): - (JSC::MarkedArgumentBuffer::slotFor): - (JSC::MarkedArgumentBuffer::mallocBase): - -2011-12-13 Filip Pizlo - - DFG OSR exit for UInt32ToNumber should roll forward, not roll backward - https://bugs.webkit.org/show_bug.cgi?id=74463 - - Reviewed by Gavin Barraclough. - - Implements roll-forward OSR exit for UInt32ToNumber, which requires ValueRecoveries knowing - how to execute the slow path of UInt32ToNumber. - - * bytecode/CodeBlock.h: - (JSC::CodeBlock::lastOSRExit): - * bytecode/CodeOrigin.h: - (JSC::CodeOrigin::operator!=): - * bytecode/ValueRecovery.h: - (JSC::ValueRecovery::uint32InGPR): - (JSC::ValueRecovery::gpr): - (JSC::ValueRecovery::dump): - * dfg/DFGAssemblyHelpers.cpp: - * dfg/DFGAssemblyHelpers.h: - * dfg/DFGOSRExit.h: - (JSC::DFG::OSRExit::valueRecoveryForOperand): - * dfg/DFGOSRExitCompiler32_64.cpp: - (JSC::DFG::OSRExitCompiler::compileExit): - * dfg/DFGOSRExitCompiler64.cpp: - (JSC::DFG::OSRExitCompiler::compileExit): - * dfg/DFGSpeculativeJIT.cpp: - (JSC::DFG::SpeculativeJIT::compileUInt32ToNumber): - (JSC::DFG::SpeculativeJIT::compileGetByValOnIntTypedArray): - * dfg/DFGSpeculativeJIT.h: - * dfg/DFGSpeculativeJIT32_64.cpp: - (JSC::DFG::SpeculativeJIT::nonSpeculativeUInt32ToNumber): - (JSC::DFG::SpeculativeJIT::compile): - * dfg/DFGSpeculativeJIT64.cpp: - (JSC::DFG::SpeculativeJIT::nonSpeculativeUInt32ToNumber): - (JSC::DFG::SpeculativeJIT::compile): - -2011-12-13 Oliver Hunt - - Arguments object doesn't handle mutation of length property correctly - https://bugs.webkit.org/show_bug.cgi?id=74454 - - Reviewed by Gavin Barraclough. - - Correct handling of arguments objects with overridden length property - - * interpreter/Interpreter.cpp: - (JSC::loadVarargs): - * runtime/Arguments.cpp: - (JSC::Arguments::copyToArguments): - (JSC::Arguments::fillArgList): - -2011-12-13 Filip Pizlo - - DFG GetByVal CSE rule should match PutByValAlias - https://bugs.webkit.org/show_bug.cgi?id=74390 - - Reviewed by Geoff Garen. - - Tiny win on some benchmarks. Maybe a 0.2% win on SunSpider. - - * dfg/DFGPropagator.cpp: - (JSC::DFG::Propagator::getByValLoadElimination): - -2011-12-13 Andy Wingo - - Fix interpreter debug build. - https://bugs.webkit.org/show_bug.cgi?id=74439 - - Reviewed by Geoffrey Garen. - - * bytecode/ValueRecovery.h: Include stdio.h on debug builds. - -2011-12-13 Filip Pizlo - - DFG should know exactly why recompilation was triggered - https://bugs.webkit.org/show_bug.cgi?id=74362 - - Reviewed by Oliver Hunt. - - Each OSR exit is now individually counted, as well as counting the total number - of OSR exits that occurred in a code block. If recompilation is triggered, we - check to see if there are OSR exit sites that make up a sufficiently large - portion of the total OSR exits that occurred. For any such OSR exit sites, we - add a description of the site (bytecode index, kind) to a data structure in the - corresponding baseline CodeBlock. Then, when we recompile the code, we immediately - know which speculations would be unwise based on the fact that previous such - speculations proved to be fruitless. - - This means 2% win on two of the SunSpider string tests, a 4% win on V8's deltablue, - and 5% on Kraken's imaging-darkroom. It is only a minor win in the averages, less - than 0.5%. - - * CMakeLists.txt: - * GNUmakefile.list.am: - * JavaScriptCore.xcodeproj/project.pbxproj: - * Target.pri: - * bytecode/CodeBlock.cpp: - (JSC::CodeBlock::tallyFrequentExitSites): - * bytecode/CodeBlock.h: - (JSC::CodeBlock::addFrequentExitSite): - (JSC::CodeBlock::exitProfile): - (JSC::CodeBlock::reoptimize): - (JSC::CodeBlock::tallyFrequentExitSites): - * bytecode/DFGExitProfile.cpp: Added. - (JSC::DFG::ExitProfile::ExitProfile): - (JSC::DFG::ExitProfile::~ExitProfile): - (JSC::DFG::ExitProfile::add): - (JSC::DFG::QueryableExitProfile::QueryableExitProfile): - (JSC::DFG::QueryableExitProfile::~QueryableExitProfile): - * bytecode/DFGExitProfile.h: Added. - (JSC::DFG::exitKindToString): - (JSC::DFG::exitKindIsCountable): - (JSC::DFG::FrequentExitSite::FrequentExitSite): - (JSC::DFG::FrequentExitSite::operator!): - (JSC::DFG::FrequentExitSite::operator==): - (JSC::DFG::FrequentExitSite::hash): - (JSC::DFG::FrequentExitSite::bytecodeOffset): - (JSC::DFG::FrequentExitSite::kind): - (JSC::DFG::FrequentExitSite::isHashTableDeletedValue): - (JSC::DFG::FrequentExitSiteHash::hash): - (JSC::DFG::FrequentExitSiteHash::equal): - (JSC::DFG::QueryableExitProfile::hasExitSite): - * dfg/DFGAssemblyHelpers.h: - (JSC::DFG::AssemblyHelpers::baselineCodeBlockForOriginAndBaselineCodeBlock): - (JSC::DFG::AssemblyHelpers::baselineCodeBlockFor): - * dfg/DFGByteCodeParser.cpp: - (JSC::DFG::ByteCodeParser::makeSafe): - (JSC::DFG::ByteCodeParser::makeDivSafe): - (JSC::DFG::ByteCodeParser::handleCall): - (JSC::DFG::ByteCodeParser::handleIntrinsic): - (JSC::DFG::ByteCodeParser::parseBlock): - (JSC::DFG::ByteCodeParser::InlineStackEntry::InlineStackEntry): - * dfg/DFGOSRExit.cpp: - (JSC::DFG::OSRExit::OSRExit): - (JSC::DFG::OSRExit::considerAddingAsFrequentExitSiteSlow): - * dfg/DFGOSRExit.h: - (JSC::DFG::OSRExit::considerAddingAsFrequentExitSite): - * dfg/DFGOSRExitCompiler.cpp: - * dfg/DFGOSRExitCompiler32_64.cpp: - (JSC::DFG::OSRExitCompiler::compileExit): - * dfg/DFGOSRExitCompiler64.cpp: - (JSC::DFG::OSRExitCompiler::compileExit): - * dfg/DFGSpeculativeJIT.cpp: - (JSC::DFG::SpeculativeJIT::compilePeepHoleObjectEquality): - (JSC::DFG::SpeculativeJIT::checkArgumentTypes): - (JSC::DFG::SpeculativeJIT::compileGetCharCodeAt): - (JSC::DFG::SpeculativeJIT::compileGetByValOnString): - (JSC::DFG::SpeculativeJIT::compilePutByValForByteArray): - (JSC::DFG::SpeculativeJIT::compileGetByValOnByteArray): - (JSC::DFG::SpeculativeJIT::compileGetTypedArrayLength): - (JSC::DFG::SpeculativeJIT::compileGetByValOnIntTypedArray): - (JSC::DFG::SpeculativeJIT::compilePutByValForIntTypedArray): - (JSC::DFG::SpeculativeJIT::compileGetByValOnFloatTypedArray): - (JSC::DFG::SpeculativeJIT::compilePutByValForFloatTypedArray): - (JSC::DFG::SpeculativeJIT::compileInstanceOfForObject): - (JSC::DFG::SpeculativeJIT::compileSoftModulo): - (JSC::DFG::SpeculativeJIT::compileArithMul): - (JSC::DFG::SpeculativeJIT::compileGetIndexedPropertyStorage): - * dfg/DFGSpeculativeJIT.h: - (JSC::DFG::SpeculativeJIT::speculationCheck): - (JSC::DFG::SpeculativeJIT::terminateSpeculativeExecution): - * dfg/DFGSpeculativeJIT32_64.cpp: - (JSC::DFG::SpeculativeJIT::fillSpeculateIntInternal): - (JSC::DFG::SpeculativeJIT::fillSpeculateDouble): - (JSC::DFG::SpeculativeJIT::fillSpeculateCell): - (JSC::DFG::SpeculativeJIT::fillSpeculateBoolean): - (JSC::DFG::SpeculativeJIT::compileObjectEquality): - (JSC::DFG::SpeculativeJIT::compileObjectOrOtherLogicalNot): - (JSC::DFG::SpeculativeJIT::emitObjectOrOtherBranch): - (JSC::DFG::SpeculativeJIT::compile): - * dfg/DFGSpeculativeJIT64.cpp: - (JSC::DFG::SpeculativeJIT::fillSpeculateIntInternal): - (JSC::DFG::SpeculativeJIT::fillSpeculateDouble): - (JSC::DFG::SpeculativeJIT::fillSpeculateCell): - (JSC::DFG::SpeculativeJIT::fillSpeculateBoolean): - (JSC::DFG::SpeculativeJIT::compileObjectEquality): - (JSC::DFG::SpeculativeJIT::compileObjectOrOtherLogicalNot): - (JSC::DFG::SpeculativeJIT::compileLogicalNot): - (JSC::DFG::SpeculativeJIT::emitObjectOrOtherBranch): - (JSC::DFG::SpeculativeJIT::emitBranch): - (JSC::DFG::SpeculativeJIT::compile): - * runtime/Heuristics.cpp: - (JSC::Heuristics::initializeHeuristics): - * runtime/Heuristics.h: - -2011-12-13 Michael Saboff - - Cleanup of StringImpl::equal in r102631 post commit - https://bugs.webkit.org/show_bug.cgi?id=74421 - - Reviewed by Darin Adler. - - * wtf/text/AtomicString.h: - (WTF::operator==): Removed cast no longer needed. - * wtf/text/StringImpl.h: - (WTF::equal): Changed template to several overloaded methods. - -2011-12-12 Michael Saboff - - Eliminate Duplicate word at a time equal code in StringImpl.cpp and StringHash.h - https://bugs.webkit.org/show_bug.cgi?id=73622 - - Reviewed by Oliver Hunt. - - Moved equal(charType1 *, charType2, unsigned) template methods - from static StringImpl.cpp to StringImpl.h and then replaced the - processor specific character comparison code in StringHash::equal - with calls to these methods. - - This change is worth 3% on SunSpider string-unpack-code as reported - by the SunSpider command line harness. No other tests appear to - have measurable performance changes. - - * wtf/text/AtomicString.h: - (WTF::operator==): - * wtf/text/StringHash.h: - (WTF::StringHash::equal): - * wtf/text/StringImpl.cpp: - * wtf/text/StringImpl.h: - (WTF::LChar): - (WTF::UChar): - (WTF::equal): - -2011-12-12 Filip Pizlo - - ARMv7 version of DFG soft modulo does register allocation inside of control flow - https://bugs.webkit.org/show_bug.cgi?id=74354 - - Reviewed by Gavin Barraclough. - - * dfg/DFGSpeculativeJIT.cpp: - (JSC::DFG::SpeculativeJIT::compileSoftModulo): - -2011-12-12 Andy Wingo - - Simplify autotools configure.ac - https://bugs.webkit.org/show_bug.cgi?id=74312 - - Reviewed by Martin Robinson. - - * GNUmakefile.am: Add JSC_CPPFLAGS to javascriptcore_cppflags. - -2011-12-12 Filip Pizlo - - DFG GetByVal CSE incorrectly assumes that a non-matching PutByVal cannot clobber - https://bugs.webkit.org/show_bug.cgi?id=74329 - - Reviewed by Gavin Barraclough. - - * dfg/DFGPropagator.cpp: - (JSC::DFG::Propagator::getByValLoadElimination): - -2011-12-09 Alexander Pavlov - - WebKit does not enumerate over CSS properties in HTMLElement.style - https://bugs.webkit.org/show_bug.cgi?id=23946 - - Reviewed by Darin Adler. - - Add a few exports to follow the JSCSSStyleDeclaration.cpp changes, - introduce an std::sort() comparator function. - - * JavaScriptCore.exp: - * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def: - * wtf/text/WTFString.h: - (WTF::codePointCompareLessThan): Used by std::sort() to sort properties. - -2011-12-12 Alexander Pavlov - - Unreviewed, build fix. - - Revert r102570 which broke SnowLeopard builders. - - * JavaScriptCore.exp: - * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def: - * wtf/text/WTFString.h: - -2011-12-09 Alexander Pavlov - - WebKit does not enumerate over CSS properties in HTMLElement.style - https://bugs.webkit.org/show_bug.cgi?id=23946 - - Reviewed by Darin Adler. - - Add a few exports to follow the JSCSSStyleDeclaration.cpp changes, - introduce an std::sort() comparator function. - - * JavaScriptCore.exp: - * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def: - * wtf/text/WTFString.h: - (WTF::codePointCompareLessThan): Used by std::sort() to sort properties. - -2011-12-12 Carlos Garcia Campos - - Unreviewed. Fix make distcheck issues. - - * GNUmakefile.list.am: - -2011-12-11 Sam Weinig - - Fix another signed vs. unsigned warning - - * runtime/ArgList.h: - (JSC::MarkedArgumentBuffer::~MarkedArgumentBuffer): - -2011-12-11 Sam Weinig - - Fix a signed vs. unsigned warning. - - * runtime/ArgList.cpp: - (JSC::MarkedArgumentBuffer::slowAppend): - Cast inlineCapacity to an int to appease the warning. This is known OK - since inlineCapacity is defined to be 8. - -2011-12-11 Geoffrey Garen - - Rolled out *another* debugging change I committed accidentally. - - Unreviewed. - - * Configurations/Base.xcconfig: - -2011-12-11 Geoffrey Garen - - Rolled out a debug counter I committed accidentally. - - Unreviewed. - - * jit/JITStubs.cpp: - (JSC::arityCheckFor): - -2011-12-10 Geoffrey Garen - - v8 benchmark takes 12-13 million function call slow paths due to extra arguments - https://bugs.webkit.org/show_bug.cgi?id=74244 - - Reviewed by Filip Pizlo. - - .arguments function of order the Reversed - - 10% speedup on v8-raytrace, 1.7% speedup on v8 overall, neutral on Kraken - and SunSpider. - - * bytecode/CodeBlock.h: - (JSC::CodeBlock::valueProfileForArgument): Clarified that the interface - to this function is an argument number. - - * bytecompiler/BytecodeGenerator.cpp: - (JSC::BytecodeGenerator::BytecodeGenerator): - (JSC::BytecodeGenerator::emitCall): - (JSC::BytecodeGenerator::emitConstruct): - (JSC::BytecodeGenerator::isArgumentNumber): Switched to using CallFrame - helper functions for computing offsets for arguments, rather than doing - the math by hand. - - Switched to iterating argument offsets backwards (--) instead of forwards (++). - - * bytecompiler/BytecodeGenerator.h: - (JSC::CallArguments::thisRegister): - (JSC::CallArguments::argumentRegister): - (JSC::CallArguments::registerOffset): Updated for arguments being reversed. - - * bytecompiler/NodesCodegen.cpp: Allocate arguments in reverse order. - - * dfg/DFGByteCodeParser.cpp: - (JSC::DFG::ByteCodeParser::getArgument): - (JSC::DFG::ByteCodeParser::setArgument): - (JSC::DFG::ByteCodeParser::flush): - (JSC::DFG::ByteCodeParser::addCall): - (JSC::DFG::ByteCodeParser::handleCall): - (JSC::DFG::ByteCodeParser::handleInlining): - (JSC::DFG::ByteCodeParser::handleMinMax): - (JSC::DFG::ByteCodeParser::handleIntrinsic): - (JSC::DFG::ByteCodeParser::parseBlock): - (JSC::DFG::ByteCodeParser::processPhiStack): Use abstract argument indices - that just-in-time convert to bytecode operands (i.e., indexes in the register - file) through helper functions. This means only one piece of code needs - to know how arguments are laid out in the register file. - - * dfg/DFGGraph.cpp: - (JSC::DFG::Graph::dump): Ditto. - - * dfg/DFGGraph.h: - (JSC::DFG::Graph::valueProfileFor): Ditto. - - * dfg/DFGJITCompiler.cpp: - (JSC::DFG::JITCompiler::compileFunction): The whole point of this patch: - Treat too many arguments as an arity match. - - * dfg/DFGOSRExit.h: - (JSC::DFG::OSRExit::variableForIndex): - (JSC::DFG::OSRExit::operandForIndex): Use helper functions, as above. - - * dfg/DFGOperands.h: - (JSC::DFG::operandToArgument): - (JSC::DFG::argumentToOperand): These are now the only two lines of code in - the DFG compiler that know how arguments are laid out in memory. - - (JSC::DFG::Operands::operand): - (JSC::DFG::Operands::setOperand): Use helper functions, as above. - - * dfg/DFGOperations.cpp: The whole point of this patch: - Treat too many arguments as an arity match. - - * dfg/DFGSpeculativeJIT32_64.cpp: - (JSC::DFG::SpeculativeJIT::emitCall): Use helper functions, as above. - - Also, don't tag the caller frame slot as a cell, because it's not a cell. - - * dfg/DFGSpeculativeJIT64.cpp: - (JSC::DFG::SpeculativeJIT::emitCall): Use helper functions, as above. - - * dfg/DFGSpeculativeJIT.cpp: - (JSC::DFG::SpeculativeJIT::compile): Use helper functions, as above. - - (JSC::DFG::SpeculativeJIT::checkArgumentTypes): Use already-computed - argument virtual register instead of recomputing by hand. - - * dfg/DFGSpeculativeJIT.h: - (JSC::DFG::SpeculativeJIT::callFrameSlot): - (JSC::DFG::SpeculativeJIT::argumentSlot): - (JSC::DFG::SpeculativeJIT::callFrameTagSlot): - (JSC::DFG::SpeculativeJIT::callFramePayloadSlot): - (JSC::DFG::SpeculativeJIT::argumentTagSlot): - (JSC::DFG::SpeculativeJIT::argumentPayloadSlot): Added a few helper - functions for dealing with callee arguments specifically. These still - build on top of our other helper functions, and have no direct knowledge - of how arguments are laid out in the register file. - - (JSC::DFG::SpeculativeJIT::resetCallArguments): - (JSC::DFG::SpeculativeJIT::addCallArgument): Renamed argumentIndex to - argumentOffset to match CallFrame naming. - - (JSC::DFG::SpeculativeJIT::valueSourceReferenceForOperand): Use helper - functions, as above. - - * interpreter/CallFrame.h: - (JSC::ExecState::argumentOffset): - (JSC::ExecState::argumentOffsetIncludingThis): - (JSC::ExecState::argument): - (JSC::ExecState::setArgument): - (JSC::ExecState::thisArgumentOffset): - (JSC::ExecState::thisValue): - (JSC::ExecState::setThisValue): - (JSC::ExecState::offsetFor): - (JSC::ExecState::hostThisRegister): - (JSC::ExecState::hostThisValue): Added a bunch of helper functions for - computing where an argument is in the register file. Anything in the - runtime that needs to access arguments should use these helpers. - - * interpreter/CallFrameClosure.h: - (JSC::CallFrameClosure::setThis): - (JSC::CallFrameClosure::setArgument): - (JSC::CallFrameClosure::resetCallFrame): This stuff is a lot simpler, now - that too many arguments counts as an arity match and doesn't require - preserving two copies of our arguments. - - * interpreter/Interpreter.cpp: - (JSC::Interpreter::slideRegisterWindowForCall): Only need to do something - special if the caller provided too few arguments. - - Key simplification: We never need to maintain two copies of our arguments - anymore. - - (JSC::eval): - (JSC::loadVarargs): Use helper functions. - - (JSC::Interpreter::unwindCallFrame): Updated for new interface. - - (JSC::Interpreter::execute): - (JSC::Interpreter::executeCall): - (JSC::Interpreter::executeConstruct): - (JSC::Interpreter::prepareForRepeatCall): Seriously, though: use helper - functions. - - (JSC::Interpreter::privateExecute): No need to check for stack overflow - when calling host functions because they have zero callee registers. - - (JSC::Interpreter::retrieveArguments): Explicitly tear off the arguments - object, since there's no special constructor for this anymore. - - * interpreter/Interpreter.h: Reduced the C++ re-entry depth because some - workers tests were hitting stack overflow in some of my testing. We should - make this test more exact in future. - - * interpreter/RegisterFile.h: Death to all runtime knowledge of argument - location that does not belong to the CallFrame class! - - * jit/JIT.cpp: - (JSC::JIT::privateCompile): I am a broken record and I use helper functions. - - Also, the whole point of this patch: Treat too many arguments as an arity match. - - * jit/JITCall32_64.cpp: - (JSC::JIT::compileLoadVarargs): - * jit/JITCall.cpp: - (JSC::JIT::compileLoadVarargs): Updated the argument copying math to use - helper functions, for backwards-correctness. Removed the condition - pertaining to declared argument count because, now that arguments are - always in just one place, this optimization is valid for all functions. - Standardized the if predicate for each line of the optimization. This might - fix a bug, but I couldn't get the bug to crash in practice. - - * jit/JITOpcodes32_64.cpp: - (JSC::JIT::emit_op_create_arguments): - (JSC::JIT::emit_op_get_argument_by_val): - (JSC::JIT::emitSlow_op_get_argument_by_val): - * jit/JITOpcodes.cpp: - (JSC::JIT::emit_op_create_arguments): - (JSC::JIT::emit_op_get_argument_by_val): - (JSC::JIT::emitSlow_op_get_argument_by_val): Removed cti_op_create_arguments_no_params - optimization because it's no longer an optimization, now that arguments - are always contiguous in a known location. - - Updated argument access opcode math for backwards-correctness. - - * jit/JITStubs.cpp: - (JSC::arityCheckFor): Updated just like slideRegisterWindowForCall. This - function is slightly different because it copies the call frame in - addition to the arguments. (In the Interpreter, the call frame is not - set up by this point.) - - (JSC::lazyLinkFor): The whole point of this patch: Treat too many - arguments as an arity match. - - (JSC::DEFINE_STUB_FUNCTION): Updated for new iterface to tearOff(). - - * jit/JITStubs.h: - * jit/SpecializedThunkJIT.h: - (JSC::SpecializedThunkJIT::loadDoubleArgument): - (JSC::SpecializedThunkJIT::loadCellArgument): - (JSC::SpecializedThunkJIT::loadInt32Argument): Use helper functions! They - build strong bones and teeth! - - * runtime/ArgList.cpp: - (JSC::ArgList::getSlice): - (JSC::MarkedArgumentBuffer::slowAppend): - * runtime/ArgList.h: - (JSC::MarkedArgumentBuffer::MarkedArgumentBuffer): - (JSC::MarkedArgumentBuffer::~MarkedArgumentBuffer): - (JSC::MarkedArgumentBuffer::at): - (JSC::MarkedArgumentBuffer::clear): - (JSC::MarkedArgumentBuffer::append): - (JSC::MarkedArgumentBuffer::removeLast): - (JSC::MarkedArgumentBuffer::last): - (JSC::ArgList::ArgList): - (JSC::ArgList::at): Updated for backwards-correctness. WTF::Vector doesn't - play nice with backwards-ness, so I changed to using manual allocation. - - Fixed a FIXME about not all values being marked in the case of out-of-line - arguments. I had to rewrite the loop anyway, and I didn't feel like - maintaining fidelity to its old bugs. - - * runtime/Arguments.cpp: - (JSC::Arguments::visitChildren): - (JSC::Arguments::copyToArguments): - (JSC::Arguments::fillArgList): - (JSC::Arguments::getOwnPropertySlotByIndex): - (JSC::Arguments::getOwnPropertySlot): - (JSC::Arguments::getOwnPropertyDescriptor): - (JSC::Arguments::putByIndex): - (JSC::Arguments::put): - (JSC::Arguments::tearOff): - * runtime/Arguments.h: - (JSC::Arguments::create): - (JSC::Arguments::Arguments): - (JSC::Arguments::argument): - (JSC::Arguments::finishCreation): Secondary benefit of this patch: deleted - lots of tricky code designed to maintain two different copies of function - arguments. Now that arguments are always contiguous in one place in memory, - this complexity can go away. - - Reduced down to one create function for the Arguments class, from three. - - Moved tearOff() into an out-of-line function because it's huge. - - Moved logic about whether to tear off eagerly into the Arguments class, - so we didn't have to duplicate it elsewhere. - - * runtime/JSActivation.cpp: - (JSC::JSActivation::JSActivation): - (JSC::JSActivation::visitChildren): Renamed m_numParametersMinusThis to - m_numCapturedArgs because if the value really were m_numParametersMinusThis - we would be marking too much. (We shouldn't mark 'this' because it can't - be captured.) Also, use helper functions. - - * runtime/JSActivation.h: - (JSC::JSActivation::tearOff): Use helper functions. - - * runtime/JSArray.cpp: - (JSC::JSArray::copyToArguments): - * runtime/JSArray.h: Use helper functions, as above. - -2011-12-10 Mark Hahnenberg - - JSC testapi is crashing on Windows - https://bugs.webkit.org/show_bug.cgi?id=74233 - - Reviewed by Sam Weinig. - - Same error we've encountered before where we are calling the wrong version of - visitChildren and objects that are still reachable aren't getting marked. - This problem will go away soon with the removal of vptrs for these sorts of - optimizations in favor of using the ClassInfo, but for now we can simply give - JSFinalObject a bogus virtual method that Visual Studio can't optimize away to - ensure that JSFinalObject will always have a unique vptr. We don't have to worry - about JSString or JSArray right now, which are the other two special cases for - visitChildren, since they already have their own virtual functions. - - * JavaScriptCore.exp: - * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def: - * runtime/JSObject.cpp: - (JSC::JSFinalObject::vtableAnchor): - * runtime/JSObject.h: - -2011-12-10 Alexis Menard - - Unused variable in YarrJIT.cpp. - https://bugs.webkit.org/show_bug.cgi?id=74237 - - Reviewed by Andreas Kling. - - Variable is set but not used so we can remove it. - - * yarr/YarrJIT.cpp: - (JSC::Yarr::YarrGenerator::generatePatternCharacterOnce): - -2011-12-09 Filip Pizlo - - DFG ArithMul power-of-two case does not check for overflow - https://bugs.webkit.org/show_bug.cgi?id=74230 - - Reviewed by Gavin Barraclough. - - Disabled power-of-2 peephole optimization for multiplication, because it was wrong, - and any attempt to fix it would likely introduce code bloat and register pressure. - - * dfg/DFGSpeculativeJIT.cpp: - (JSC::DFG::SpeculativeJIT::compileArithMul): - -2011-12-09 David Levin - - REGRESSION(r101863-r102042): Assertion hit: m_verifier.isSafeToUse() in RefCountedBase::ref in FunctionCodeBlock - https://bugs.webkit.org/show_bug.cgi?id=73886 - - Reviewed by Darin Adler. - - * runtime/SymbolTable.h: - (JSC::SharedSymbolTable::SharedSymbolTable): Added deprecatedTurnOffVerifier for - another JavaScriptObject, since JavaScriptCore objects allow use on multiple threads. - Bug 58091 is about changing these deprecated calls to something else but that something - else will still need to be in all of these places. - -2011-12-09 Konrad Piascik - - Remove unnecessary file DissasemblerARM.cpp from build system - https://bugs.webkit.org/show_bug.cgi?id=74184 - - Reviewed by Daniel Bates. - - * PlatformBlackBerry.cmake: - -2011-12-09 Filip Pizlo - - DFG's interpretation of rare case profiles should be frequency-based not count-based - https://bugs.webkit.org/show_bug.cgi?id=74170 - - Reviewed by Geoff Garen. - - DFG optimizes for rare cases only when the rare case counter is above some threshold - and it also constitutes a large enough fraction of total function executions. Also - added some minor debug logic. - - * bytecode/CodeBlock.cpp: - (JSC::CodeBlock::CodeBlock): - * bytecode/CodeBlock.h: - (JSC::CodeBlock::likelyToTakeSlowCase): - (JSC::CodeBlock::couldTakeSlowCase): - (JSC::CodeBlock::likelyToTakeSpecialFastCase): - (JSC::CodeBlock::likelyToTakeDeepestSlowCase): - (JSC::CodeBlock::likelyToTakeAnySlowCase): - (JSC::CodeBlock::executionEntryCount): - * dfg/DFGByteCodeParser.cpp: - (JSC::DFG::ByteCodeParser::makeSafe): - (JSC::DFG::ByteCodeParser::makeDivSafe): - (JSC::DFG::ByteCodeParser::handleCall): - (JSC::DFG::ByteCodeParser::parseBlock): - * dfg/DFGDriver.cpp: - (JSC::DFG::compile): - * jit/JIT.cpp: - (JSC::JIT::privateCompile): - * runtime/Heuristics.cpp: - (JSC::Heuristics::initializeHeuristics): - * runtime/Heuristics.h: - -2011-12-09 Oliver Hunt - - PutByValAlias unnecessarily clobbers GetIndexedPropertyStorage - https://bugs.webkit.org/show_bug.cgi?id=74223 - - Reviewed by Geoffrey Garen. - - Don't clobber GetIndexedPropertyStorage when we see PutByValAlias - - * dfg/DFGPropagator.cpp: - (JSC::DFG::Propagator::getIndexedPropertyStorageLoadElimination): - -2011-12-09 David Levin - - Hash* iterators should allow comparison between const and const versions. - https://bugs.webkit.org/show_bug.cgi?id=73370 - - Reviewed by Darin Adler. - - * wtf/HashTable.h: Add the operators needed to do this. - (WTF::HashTableConstIterator::operator==): - (WTF::HashTableConstIterator::operator!=): - (WTF::HashTableIterator::operator==): - (WTF::HashTableIterator::operator!=): - (WTF::operator==): - (WTF::operator!=): - -2011-12-09 Michael Saboff - - YARR: Multi-character read optimization for 8bit strings - https://bugs.webkit.org/show_bug.cgi?id=74191 - - Reviewed by Oliver Hunt. - - Changed generatePatternCharacterOnce to generate - code for 1 to 4 characters in the 8 bit case. - This is worth 29% improvement on SunSpider regexp-dna test. - It provides no benefit to v8-regexp. - - * yarr/YarrJIT.cpp: - (JSC::Yarr::YarrGenerator::generatePatternCharacterOnce): - (JSC::Yarr::YarrGenerator::generate): Spelling fix in comment. - -2011-12-09 David Levin - - Regression(r53595): Sync xhr requests in workers aren't terminated on worker close. - https://bugs.webkit.org/show_bug.cgi?id=71695 - - Reviewed by Zoltan Herczeg. - - * wtf/MessageQueue.h: - (WTF::MessageQueue::tryGetMessageIgnoringKilled): Added a way to get messages - even after the queue has been killed. This is useful when one wants to - kill a queue but then go through it to run clean up tasks from it. - -2011-12-09 Adrienne Walker - - Fix HashMap<..., OwnPtr<...> >::add compilation errors - https://bugs.webkit.org/show_bug.cgi?id=74159 - - Reviewed by Darin Adler. - - Add a constructor to OwnPtr that takes the empty value (nullptr_t) - from HashTraits so that this function can compile. - - * wtf/OwnPtr.h: - (WTF::OwnPtr::OwnPtr): - -2011-12-09 Oliver Hunt - - Avoid reloading storage pointer for indexed properties unnecessarily - https://bugs.webkit.org/show_bug.cgi?id=74136 - - Reviewed by Filip Pizlo. - - Add a node to represent loading property storage for indexed properties. - This allows us to reduce code generated for sequential access of arrays, - strings, etc. This results in up to 5% improvement in code that is - very heavy on indexed reads, such as matrix operations in typed arrays - and 20% faster on microbenchmarks. - - Currently this is only supported by GetByVal and other similar indexed reads. - - * bytecode/PredictedType.h: - (JSC::isFixedIndexedStorageObjectPrediction): - * dfg/DFGAbstractState.cpp: - (JSC::DFG::AbstractState::execute): - * dfg/DFGByteCodeParser.cpp: - (JSC::DFG::ByteCodeParser::handleIntrinsic): - (JSC::DFG::ByteCodeParser::parseBlock): - * dfg/DFGNode.h: - * dfg/DFGPropagator.cpp: - (JSC::DFG::Propagator::propagateNodePredictions): - (JSC::DFG::Propagator::fixupNode): - (JSC::DFG::Propagator::getIndexedPropertyStorageLoadElimination): - (JSC::DFG::Propagator::performNodeCSE): - * dfg/DFGSpeculativeJIT.cpp: - (JSC::DFG::SpeculativeJIT::compileGetCharCodeAt): - (JSC::DFG::SpeculativeJIT::compileGetByValOnString): - (JSC::DFG::SpeculativeJIT::compileGetByValOnByteArray): - (JSC::DFG::SpeculativeJIT::compileGetByValOnIntTypedArray): - (JSC::DFG::SpeculativeJIT::compileGetByValOnFloatTypedArray): - (JSC::DFG::SpeculativeJIT::compileGetIndexedPropertyStorage): - * dfg/DFGSpeculativeJIT.h: - * dfg/DFGSpeculativeJIT32_64.cpp: - (JSC::DFG::SpeculativeJIT::compile): - * dfg/DFGSpeculativeJIT64.cpp: - (JSC::DFG::SpeculativeJIT::compile): - -2011-12-08 Fady Samuel - - [Chromium] Enable viewport metatag - https://bugs.webkit.org/show_bug.cgi?id=73495 - - Reviewed by Darin Fisher. - - * wtf/Platform.h: Added ENABLE(VIEWPORT) tag. - -2011-12-08 Adam Klein - - Use HashMap> in ChildListMutationScope - https://bugs.webkit.org/show_bug.cgi?id=73964 - - Reviewed by Darin Adler. - - * wtf/HashTraits.h: Add passOut(std::nullptr_t) to allow callers to use HashMap::take on a HashMap of OwnPtrs. - -2011-12-08 Thouraya ANDOLSI - - https://bugs.webkit.org/show_bug.cgi?id=74005 - fix unaligned access memory in generatePatternCharacterOnce function - for SH4 platforms. - - Reviewed by Gavin Barraclough. - - * assembler/MacroAssemblerARM.h: - (JSC::MacroAssemblerARM::load16Unaligned): - * assembler/MacroAssemblerARMv7.h: - (JSC::MacroAssemblerARMv7::load16Unaligned): - * assembler/MacroAssemblerMIPS.h: - (JSC::MacroAssemblerMIPS::load16Unaligned): - * assembler/MacroAssemblerSH4.h: - (JSC::MacroAssemblerSH4::lshift32): - (JSC::MacroAssemblerSH4::load8): - (JSC::MacroAssemblerSH4::load16): - (JSC::MacroAssemblerSH4::load16Unaligned): - (JSC::MacroAssemblerSH4::branch8): - * assembler/MacroAssemblerX86Common.h: - (JSC::MacroAssemblerX86Common::load16Unaligned): - * jit/JIT.h: - * yarr/YarrJIT.cpp: - (JSC::Yarr::YarrGenerator::generatePatternCharacterOnce): - -2011-12-08 Michael Saboff - - Add 8 bit paths for StringTypeAdapter classes - https://bugs.webkit.org/show_bug.cgi?id=73882 - - Reviewed by Darin Adler. - - Added is8Bit() method and writeTo(LChar*) methods - to StringTypeAdapter<> classes. The writeTo(LChar*) - method can be used if is8Bit() returns true. The - non-native 8 bit classes contain ASSERT(is8Bit()) - in their writeTo(LChar*). - - Updated all of the various versions of tryMakeString() to - use 8 bit processing in the updated StringTypeAdapter<> - classes. - - This has slight if any performance improvement on kraken. - - * runtime/UStringConcatenate.h: - * wtf/text/StringConcatenate.h: - (WTF::tryMakeString): - * wtf/text/StringOperators.h: - (WTF::StringAppend::is8Bit): - (WTF::StringAppend::writeTo): - -2011-12-07 Filip Pizlo - - DFG CSE should know that CheckFunction is pure - https://bugs.webkit.org/show_bug.cgi?id=74044 - - Reviewed by Oliver Hunt. - - Possible slight win on V8, no regressions. - - * dfg/DFGPropagator.cpp: - (JSC::DFG::Propagator::checkFunctionElimination): - -2011-12-07 Michael Saboff - - StringBuilderTest.Append and StringBuilderTest.ToStringPreserveCapacity are failing. - https://bugs.webkit.org/show_bug.cgi?id=73995 - - Reviewed by Geoffrey Garen. - - Problem was that a call to characters on an StringImpl associated - with a StringBuilder that is being appended to gets stale. - Added a new m_valid16BitShadowlen that keeps the length of - the 16 bit shadow that has been upconverted or will be up converted - with the first getCharacters(). When StringBuilder::characters or - ::reifyString is called, further characters are upconverted if - we have a shadow16bit copy and the m_valid16BitShadowlen is updated. - - * JavaScriptCore.exp: - * wtf/text/StringBuilder.cpp: - (WTF::StringBuilder::reifyString): - * wtf/text/StringBuilder.h: - (WTF::StringBuilder::StringBuilder): - (WTF::StringBuilder::characters): - (WTF::StringBuilder::clear): Cleaned up as part of the change. - * wtf/text/StringImpl.cpp: - (WTF::StringImpl::getData16SlowCase): - (WTF::StringImpl::upconvertCharacters): - * wtf/text/StringImpl.h: - -2011-12-07 Filip Pizlo - - Compare and Swap should be enabled on ARMv7 - https://bugs.webkit.org/show_bug.cgi?id=74023 - - Reviewed by Geoff Garen. - - Implemented weakCompareAndSwap in terms of LDREX/STREX and enabled PARALLEL_GC. - It gives the expected speed-up on multi-core ARMv7 devices. - - * wtf/Atomics.h: - (WTF::weakCompareAndSwap): - * wtf/Platform.h: - -2011-12-07 Filip Pizlo - - DFG CSE is overzealous with GetByVal - https://bugs.webkit.org/show_bug.cgi?id=74042 - - Reviewed by Oliver Hunt. - - Made sure that the purity of GetByVal and the limited-clobber-itude of PutByVal - is tested in all places that matter. - - * dfg/DFGPropagator.cpp: - (JSC::DFG::Propagator::byValIsPure): - (JSC::DFG::Propagator::clobbersWorld): - (JSC::DFG::Propagator::getByValLoadElimination): - (JSC::DFG::Propagator::checkStructureLoadElimination): - (JSC::DFG::Propagator::getByOffsetLoadElimination): - (JSC::DFG::Propagator::getPropertyStorageLoadElimination): - (JSC::DFG::Propagator::performNodeCSE): - -2011-12-07 Sheriff Bot - - Unreviewed, rolling out r102267. - http://trac.webkit.org/changeset/102267 - https://bugs.webkit.org/show_bug.cgi?id=74032 - - Breaks build on Chromium Mac Debug (Requested by aklein on - #webkit). - - * wtf/HashTraits.h: - -2011-12-07 Adam Klein - - Use HashMap> in ChildListMutationScope - https://bugs.webkit.org/show_bug.cgi?id=73964 - - Reviewed by Ryosuke Niwa. - - * wtf/HashTraits.h: Add passOut(std::nullptr_t) to allow callers to use HashMap::take on an entry whose value is null. - -2011-12-07 Filip Pizlo - - Non-Mac devices should benefit from a larger heap - https://bugs.webkit.org/show_bug.cgi?id=74015 - - Reviewed by Geoff Garen. - - Removed the ENABLE(LARGE_HEAP) option from Platform.h, since it was only used in - Heap.cpp, and got in the way of having more granular, per-platform control over - what the heap size should be. Bumped the heap size to 8MB on iOS (was 512KB). - - * heap/Heap.cpp: - (JSC::GCTimer::heapSizeForHint): - * wtf/Platform.h: - -2011-11-30 Simon Hausmann - - [Qt] V8 build fixes. - - Reviewed by Tor Arne Vestbø. - - * yarr/yarr.pri: Don't rely on Source/JavaScriptCore being in - VPATH. Prefix SOURCES correctly and make sure that runtime/ is - in the include search path when building with v8. - -2011-12-06 Filip Pizlo - - Zapping a block that is Marked leads to dead objects being mistaken for live ones - https://bugs.webkit.org/show_bug.cgi?id=73982 - - Reviewed by Geoff Garen. - - Changed the zapping code to ignore blocks that are Marked or Zapped. Additionally, - the code asserts that: - - - If we zap a Marked or Zapped block then the free list is empty, because this - can only happen if the block was never free-listed. - - - Zapping can only happen for Marked, Zapped, or FreeListed blocks, since Allocated - blocks are those that cannot be referred to by SizeClass::currentBlock (since - SizeClass::currentBlock only refers to blocks that are candidates for allocation, - and Allocated blocks are those who have been exhausted by allocation and will not - be allocated from again), and New blocks cannot be referred to by anything except - during a brief window inside the allocation slow-path. - - * heap/MarkedBlock.cpp: - (JSC::MarkedBlock::zapFreeList): - -2011-12-06 Filip Pizlo - - DFG 32_64 call linking does not handle non-cell callees correctly - https://bugs.webkit.org/show_bug.cgi?id=73965 - - Reviewed by Sam Weinig. - - * dfg/DFGSpeculativeJIT32_64.cpp: - (JSC::DFG::SpeculativeJIT::emitCall): - -2011-12-06 Sam Weinig - - Remove unintentional type name shadowing in the Interpreter - https://bugs.webkit.org/show_bug.cgi?id=73963 - - Reviewed by Oliver Hunt. - - * interpreter/Interpreter.cpp: - (JSC::Interpreter::prepareForRepeatCall): Replace the parameter name FunctionExecutable, - which shadows the FunctionExecutable type name, with functionExecutable. - -2011-12-06 Michael Saboff - - r102146 from 73875 broke fast/js/encode-URI-test.html - https://bugs.webkit.org/show_bug.cgi?id=73950 - - Reviewed by Gavin Barraclough. - - * runtime/JSGlobalObjectFunctions.cpp: - (JSC::globalFuncUnescape): Restructured to handle - the %uHHHH case to output the resulting character - and continue so that a failure in finding 4 hex - digits will fall through and output the '%'. - Due to style check, changed the temporary - character variable to a more descriptive name. - -2011-12-06 Filip Pizlo - - GC zapping logic could benefit from some more assertions - https://bugs.webkit.org/show_bug.cgi?id=73947 - - Reviewed by Gavin Barraclough. - - - If you're in a zapped block and you're zapped, then your mark bit should - never be set. - - - If you're being marked, then you should never be zapped. - - * heap/MarkedBlock.h: - (JSC::MarkedBlock::isLive): - * runtime/Structure.h: - (JSC::MarkStack::internalAppend): - -2011-12-06 Oliver Hunt - - Don't allocate register in typedarray control flow - https://bugs.webkit.org/show_bug.cgi?id=73944 - - Reviewed by Gavin Barraclough. - - Move a temporary allocation outside of control flow. - - * dfg/DFGSpeculativeJIT.cpp: - (JSC::DFG::SpeculativeJIT::compileGetByValOnFloatTypedArray): - -2011-12-06 Gavin Barraclough - - https://bugs.webkit.org/show_bug.cgi?id=68328 - The generator and intrinsic fields in HashTableValue/HashEntry and associated structures and methods are redundant - - Reviewed by Geoff Garen. - - Move the instrinsic enum out of the DFG, into runtime. Add entires for all host functions - that have an intrinsic in the form of a generated thunk. Remove the thunk pointer from the - hashtable, and make Intrinsic field no longer ifdef on JIT/DFG. In getHostFunction select - a thunk genertaor to use based on the Intrinsic. - - * JavaScriptCore.xcodeproj/project.pbxproj: - * create_hash_table: - * dfg/DFGByteCodeParser.cpp: - (JSC::DFG::ByteCodeParser::handleCall): - (JSC::DFG::ByteCodeParser::handleIntrinsic): - * dfg/DFGCapabilities.h: - * dfg/DFGIntrinsic.h: Removed. - * jit/JITStubs.cpp: - (JSC::JITThunks::hostFunctionStub): - * jit/JITStubs.h: - * runtime/Executable.cpp: - (JSC::ExecutableBase::intrinsic): - (JSC::NativeExecutable::intrinsic): - * runtime/Executable.h: - (JSC::ExecutableBase::intrinsicFor): - (JSC::NativeExecutable::create): - (JSC::NativeExecutable::finishCreation): - * runtime/Intrinsic.h: Copied from Source/JavaScriptCore/dfg/DFGIntrinsic.h. - * runtime/JSGlobalData.cpp: - (JSC::thunkGeneratorForIntrinsic): - (JSC::JSGlobalData::getHostFunction): - * runtime/JSGlobalData.h: - * runtime/Lookup.cpp: - (JSC::HashTable::createTable): - (JSC::setUpStaticFunctionSlot): - * runtime/Lookup.h: - (JSC::HashEntry::initialize): - (JSC::HashEntry::intrinsic): - -2011-12-06 Michael Saboff - - Add 8 bit paths to global object functions - https://bugs.webkit.org/show_bug.cgi?id=73875 - - Added 8 bit paths for converions methods. - - This is worth 1.5% on kraken audio-oscillator, - 1.6% on stanford-crypto-ccm and 2.5% on - stanford-crypto-sha256-iterative. See bug for - a full report. - - Reviewed by Oliver Hunt. - - * runtime/JSGlobalObjectFunctions.cpp: - (JSC::decode): Split into a templated helper. - (JSC::parseInt): Split into a templated helper. - (JSC::parseFloat): Added an 8 bit path - (JSC::globalFuncEscape): Added 8 bit path - (JSC::globalFuncUnescape): Added 8 bit path - * runtime/JSStringBuilder.h: - (JSC::JSStringBuilder::append): New append for LChar - * wtf/text/StringBuilder.h: - (WTF::StringBuilder::append): New append for LChar - -2011-11-21 Balazs Kelemen - - Enable ParallelJobs by default - https://bugs.webkit.org/show_bug.cgi?id=70032 - - Reviewed by Zoltan Herczeg. - - According to measurements on Mac and Linux it is a - considerable speedup for SVG on multicore. - - Remove the ENABLE(PARALLEL_JOBS) guard. - Fix build on Windows and Chromium. - - * JavaScriptCore.gypi: Add the files to the build. It was - missing for the gyp build system. - * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def: - Export symbols. - * wtf/ParallelJobs.h: - * wtf/ParallelJobsGeneric.cpp: - (WTF::ParallelEnvironment::ParallelEnvironment): - (WTF::ParallelEnvironment::execute): - Deinline these to avoid exporting a lot of symbols. - These are non-trivial and called only once on a given object - so it doesn't seems to be worthwile to inline them. - Additionally fix a signed-unsigned comparison in the constructor. - * wtf/ParallelJobsGeneric.h: - * wtf/Platform.h: - -2011-12-06 Simon Hausmann - - [Qt] build-jsc script doesn't work - https://bugs.webkit.org/show_bug.cgi?id=73910 - - Reviewed by Tor Arne Vestbø. - - * JavaScriptCore.pro: Build WTF before JavaScriptCore and JSC - (moved from top-level WebKit.pro). Also add v8 scopes to only build - WTF during v8 builds. - -2011-12-05 Anders Carlsson - - Add HashMap::keys() and HashMap::values() for easy iteration of hash map keys and values in C++11. - - Reviewed by Darin Adler. - - * wtf/HashMap.h: - -2011-12-05 Michael Saboff - - Create StringImpl::empty() as an 8 bit string - https://bugs.webkit.org/show_bug.cgi?id=73871 - - Reviewed by Oliver Hunt. - - * wtf/text/StringStatics.cpp: - (WTF::StringImpl::empty): Changed to be an 8 bit string. - -2011-12-05 Darin Adler - - Convert JSClassRef to use HashMap - https://bugs.webkit.org/show_bug.cgi?id=73780 - - Reviewed by Andreas Kling. - - * API/JSCallbackObjectFunctions.h: - (JSC::JSCallbackObject::getOwnPropertyNames): Use get() on the hash map - entries because the hash map now has an OwnPtr instead of a raw pointer. - - * API/JSClassRef.cpp: - (OpaqueJSClass::OpaqueJSClass): No need to initialize m_staticValues and - m_staticFunctions since they are now OwnPtr. Use adoptPtr when allocating. - Removed the code that gets and deletes existing entries, and just use set, - which now handles deletion automatically due to it being OwnPtr. - (OpaqueJSClass::~OpaqueJSClass): Replaced code to do all the deletion - with assertion-only NDEBUG-only code. - (OpaqueJSClassContextData::OpaqueJSClassContextData): Use adoptPtr when - allocating. Use OwnPtr when adding. Removed unneeded code to set - staticValues and staticFunctions to 0. Removed unneeded destructor. - (OpaqueJSClass::staticValues): Added get call. Also removed unneeded local. - (OpaqueJSClass::staticFunctions): Ditto. - (OpaqueJSClass::prototype): Added use of adoptPtr. - - * API/JSClassRef.h: Made the static values and static functions tables - use OwnPtr for the entries. Also used OwnPtr for the pointers to the - tables themselves. Also removed ~OpaqueJSClassContextData(), letting - the compiler generate it. - -2011-12-05 Oliver Hunt - - Land uncommitted bit of float array support - https://bugs.webkit.org/show_bug.cgi?id=73873 - - Reviewed by Filip Pizlo. - - * dfg/DFGSpeculativeJIT.cpp: - (JSC::DFG::SpeculativeJIT::compileGetByValOnFloatTypedArray): - -2011-12-05 Benjamin Poulain - - Update String::containsOnlyASCII() to handle 8 bits strings - https://bugs.webkit.org/show_bug.cgi?id=73799 - - Reviewed by Darin Adler. - - Implement String::containsOnlyASCII() so that it does not - call String::characters(). - - * wtf/text/WTFString.h: - (WTF::String::containsOnlyASCII): - -2011-12-05 Filip Pizlo - - Unreviewed build fix for non-DFG platforms. - - * dfg/DFGRepatch.h: - -2011-12-05 Filip Pizlo - - Old JIT emits 32-bit offsets for put_by_id but sometimes patches them as if they - were compact offsets - https://bugs.webkit.org/show_bug.cgi?id=73861 - - Reviewed by Gavin Barraclough. - - * jit/JITPropertyAccess32_64.cpp: - (JSC::JIT::resetPatchPutById): - -2011-12-05 Filip Pizlo - - Unreviewed, build fixes for ARM. - - * assembler/AbstractMacroAssembler.h: - (JSC::AbstractMacroAssembler::unreachableForPlatform): - * assembler/MacroAssemblerARMv7.h: - (JSC::MacroAssemblerARMv7::loadDouble): - (JSC::MacroAssemblerARMv7::loadFloat): - (JSC::MacroAssemblerARMv7::storeFloat): - (JSC::MacroAssemblerARMv7::convertFloatToDouble): - (JSC::MacroAssemblerARMv7::convertDoubleToFloat): - -2011-12-05 Benjamin Poulain - - Update String::containsOnlyLatin1() to avoid converting to 16 bits - https://bugs.webkit.org/show_bug.cgi?id=73797 - - Reviewed by Andreas Kling. - - When the String use 8bits StringImpl, there is no need to iterate - over the string. - - The function charactersAreAllLatin1() is removed because it is not - used anywhere. - - * wtf/text/WTFString.h: - (WTF::String::containsOnlyLatin1): - -2011-12-05 Michael Saboff - - 8 bit string work slows down Kraken json-stringify-tinderbox - https://bugs.webkit.org/show_bug.cgi?id=73457 - - Added 8 bit path to StringBuilder. StringBuilder starts - assuming 8 bit contents and gets converted to 16 bit upon - seeing the first 16 bit character or string. Split - appendUninitialiezed into an inlined fast and function call - slow case. - - Factored out the processing of the UString argument from - Stringifier::appendQuotedString() to a static templated function - based on character size. - - This change eliminates 5% of the 7% slowdown to json-stringify-tinderbox. - This change introduces a 4.8% slowdown to json-parse-financial. - This slowdown will be addressed in a subsequent patch to StringImpl::equal. - - Reviewed by Oliver Hunt. - - * runtime/JSONObject.cpp: - (JSC::appendStringToUStringBuilder): - (JSC::Stringifier::appendQuotedString): - * wtf/text/StringBuilder.cpp: - (WTF::StringBuilder::resize): - (WTF::StringBuilder::allocateBuffer): - (WTF::StringBuilder::allocateBufferUpConvert): - (WTF::LChar): - (WTF::UChar): - (WTF::StringBuilder::reserveCapacity): - (WTF::StringBuilder::appendUninitialized): - (WTF::StringBuilder::appendUninitializedSlow): - (WTF::StringBuilder::append): - (WTF::StringBuilder::shrinkToFit): - * wtf/text/StringBuilder.h: - (WTF::StringBuilder::StringBuilder): - (WTF::StringBuilder::append): - (WTF::StringBuilder::operator[]): - (WTF::StringBuilder::characters8): - (WTF::StringBuilder::characters16): - (WTF::StringBuilder::charactersBlah): - (WTF::LChar): - (WTF::UChar): - -2011-12-01 Gavin Barraclough - - https://bugs.webkit.org/show_bug.cgi?id=73624 - JIT + INTERPRETER builds are broken - - Reviewed by Geoff Garen, Sam Weinig. - - These don't fallback to the interpreter correctly. - Thunk creation assumes that is the JIT is compiled in, then it is enabled. - - * jit/JITStubs.cpp: - (JSC::JITThunks::JITThunks): - * runtime/Executable.h: - (JSC::NativeExecutable::create): - (JSC::NativeExecutable::finishCreation): - * runtime/JSGlobalData.cpp: - (JSC::JSGlobalData::getHostFunction): - -2011-12-05 Zoltan Herczeg - - MacroAssemblerSH4 does not implement readCallTarget - https://bugs.webkit.org/show_bug.cgi?id=73434 - - Reviewed by Csaba Osztrogonác. - - * assembler/MacroAssemblerSH4.h: Support for SH4. - (JSC::MacroAssemblerSH4::readCallTarget): - * assembler/SH4Assembler.h: - (JSC::SH4Assembler::readCallTarget): - -2011-12-04 Filip Pizlo - - DFG should optimize strict equality - https://bugs.webkit.org/show_bug.cgi?id=73764 - - Reviewed by Oliver Hunt. - - 1% speed-up on V8. - - * dfg/DFGSpeculativeJIT.cpp: - (JSC::DFG::SpeculativeJIT::compare): - (JSC::DFG::SpeculativeJIT::compileStrictEqForConstant): - (JSC::DFG::SpeculativeJIT::compileStrictEq): - * dfg/DFGSpeculativeJIT.h: - * dfg/DFGSpeculativeJIT32_64.cpp: - (JSC::DFG::SpeculativeJIT::compileIntegerCompare): - (JSC::DFG::SpeculativeJIT::compileDoubleCompare): - (JSC::DFG::SpeculativeJIT::compile): - * dfg/DFGSpeculativeJIT64.cpp: - (JSC::DFG::SpeculativeJIT::compileIntegerCompare): - (JSC::DFG::SpeculativeJIT::compileDoubleCompare): - (JSC::DFG::SpeculativeJIT::compile): - -2011-12-03 Darin Adler - - Use HashMap for ScriptSampleRecordMap - https://bugs.webkit.org/show_bug.cgi?id=73758 - - Reviewed by Andreas Kling. - - * bytecode/SamplingTool.cpp: - (JSC::SamplingTool::notifyOfScope): Added adoptPtr. - (JSC::SamplingTool::dump): Added get. - * bytecode/SamplingTool.h: Changed the value type of ScriptSampleRecordMap to be OwnPtr. - -2011-12-03 Darin Adler - - Use HashMap for the opaqueJSClassData map - https://bugs.webkit.org/show_bug.cgi?id=73759 - - Reviewed by Andreas Kling. - - * API/JSClassRef.cpp: - (OpaqueJSClass::contextData): Update types. - * runtime/JSGlobalData.cpp: - (JSC::JSGlobalData::~JSGlobalData): Add an explicit clear of opaqueJSClassData to keep the - timing the same. If we didn't care about the order of operations, we could remove this, too. - * runtime/JSGlobalData.h: Use OwnPtr instead of raw pointer for the mapped type in the - opaqueJSClassData map. - -2011-12-03 Darin Adler - - Change HashMap implementation to use the pass type and peek type from traits for the mapped value - https://bugs.webkit.org/show_bug.cgi?id=72474 - - Reviewed by Anders Carlsson. - - * wtf/HashMap.h: Added ReferenceTypeMaker struct template. Get PassInType, PassOutType, - and PeekType from the traits of the mapped value instead of hard-coding them here. - Changed inlineAdd to take a reference to the PassInType instead of the PassInType itself, - to accomodate a PassInType that can't be copied. Use the store, peek, and passOut - functions from the traits as well. - - * wtf/HashTraits.h: Updated GenericHashTraits and HashTraits for OwnPtr to include - PassInType, PassOutType, PeekType, store, passOut, and peek. Before this, the file had - an earlier version that was just PassType, PeekType, pass, and peek. Also commented - the HashTraits for RefPtr to foreshadow some work we can do there. - - * wtf/RefPtrHashMap.h: Same changes as HashMap.h. - -2011-12-02 David Levin - - Rename WTF class from TemporarilyChange to TemporaryChange. - https://bugs.webkit.org/show_bug.cgi?id=73479 - - Reviewed by Eric Seidel. - - * JavaScriptCore.gypi: - * JavaScriptCore.vcproj/WTF/WTF.vcproj: - * JavaScriptCore.xcodeproj/project.pbxproj: - * wtf/TemporaryChange.h: Renamed from Source/JavaScriptCore/wtf/TemporarilyChange.h. - (WTF::TemporaryChange::TemporaryChange): - (WTF::TemporaryChange::~TemporaryChange): - -2011-12-02 Mark Hahnenberg - - REGRESSION (r99754): All layout tests crash on Windows - https://bugs.webkit.org/show_bug.cgi?id=72305 - - Reviewed by Geoffrey Garen. - - Fixes a crash in release builds on Windows. Windows was optimizing the out-of-line virtual destructor in - JSFunction away, which left it with no virtual functions. Its vtable ptr was then identical to that of - a different class, therefore the optimization in the visitChildren helper function in MarkedStack.cpp was calling an - incorrect version of visitChildren on the object, which left its children unmarked, causing them to be - collected when they were still reachable. - - * runtime/JSFunction.cpp: - (JSC::JSFunction::vtableAnchor): Add a virtual function to JSFunction that Visual Studio can't optimize away. - * runtime/JSFunction.h: - * runtime/JSGlobalData.cpp: - (JSC::JSGlobalData::storeVPtrs): Add checks to make sure that all virtual pointers that we rely on for optimization - purposes are distinct from one another. - -2011-12-02 Oliver Hunt - - Improve float array support in the DFG JIT - https://bugs.webkit.org/show_bug.cgi?id=73722 - - Reviewed by Gavin Barraclough. - - Add basic support for float typed arrays in JSC. This is currently - less optimal than it could be in the following ways: - * float32Array1[0] = float32Array2[0] (eg. an element by element copy) - promotes float to double and then back to float. - * float64Array[0] will always perform NaN tests in order to prevent - signalling NaNs from entering the engine. - - We also don't support Float32Array on ARMv7 - - * assembler/MacroAssemblerARMv7.h: - (JSC::MacroAssemblerARMv7::loadDouble): - (JSC::MacroAssemblerARMv7::loadFloat): - (JSC::MacroAssemblerARMv7::storeDouble): - (JSC::MacroAssemblerARMv7::storeFloat): - (JSC::MacroAssemblerARMv7::convertFloatToDouble): - (JSC::MacroAssemblerARMv7::convertDoubleToFloat): - * assembler/MacroAssemblerX86Common.h: - (JSC::MacroAssemblerX86Common::loadDouble): - (JSC::MacroAssemblerX86Common::loadFloat): - (JSC::MacroAssemblerX86Common::storeDouble): - (JSC::MacroAssemblerX86Common::storeFloat): - (JSC::MacroAssemblerX86Common::convertDoubleToFloat): - (JSC::MacroAssemblerX86Common::convertFloatToDouble): - * assembler/X86Assembler.h: - (JSC::X86Assembler::cvtsd2ss_rr): - (JSC::X86Assembler::cvtss2sd_rr): - (JSC::X86Assembler::movsd_rm): - (JSC::X86Assembler::movss_rm): - (JSC::X86Assembler::movsd_mr): - (JSC::X86Assembler::movss_mr): - * dfg/DFGAbstractState.cpp: - (JSC::DFG::AbstractState::execute): - * dfg/DFGNode.h: - (JSC::DFG::Node::shouldSpeculateFloat32Array): - * dfg/DFGPropagator.cpp: - (JSC::DFG::Propagator::propagateNodePredictions): - * dfg/DFGSpeculativeJIT.cpp: - (JSC::DFG::SpeculativeJIT::compilePutByValForIntTypedArray): - (JSC::DFG::SpeculativeJIT::compileGetByValOnFloatTypedArray): - (JSC::DFG::SpeculativeJIT::compilePutByValForFloatTypedArray): - * dfg/DFGSpeculativeJIT.h: - * dfg/DFGSpeculativeJIT32_64.cpp: - (JSC::DFG::SpeculativeJIT::compile): - * dfg/DFGSpeculativeJIT64.cpp: - (JSC::DFG::SpeculativeJIT::fillSpeculateIntInternal): - (JSC::DFG::SpeculativeJIT::compile): - -2011-12-02 Sheriff Bot - - Unreviewed, rolling out r101801. - http://trac.webkit.org/changeset/101801 - https://bugs.webkit.org/show_bug.cgi?id=73667 - - Build is still broken (Requested by Ossy on #webkit). - - * assembler/SH4Assembler.h: - -2011-12-01 Darin Adler - - Prepare to deploy pass and peek types in the HashMap class - https://bugs.webkit.org/show_bug.cgi?id=73477 - - Reviewed by Adam Roben. - - This patch adds private typedefs inside the HashMap class, - and uses them as appropriate. A future patch will actually - tie those typedefs to hash traits, which will allow us to - make HashMap work with OwnPtr mapped values and to optimize - how HashMap works with RefPtr mapped values. - - Also changed the hash translator and adapter struct templates - to use template functions to simplify them and make them more - flexible. - - Also removed some unused template arguments. - - This goes out of its way to not change behavior. Future patches - will change the peek type to be a reference type, which will - reduce reference count churn a bit for hash tables with RefPtr - mapped values, and then do further optimizations for RefPtr - and OwnPtr by getting types from the hash traits. - - * wtf/HashMap.h: Added MappedPassInType, MappedPassOutType, - and MappedPeekType typedefs, and used them for the arguments - and return types of the get, set, add, take, and inlineAdd - functions. - (WTF::HashMapTranslator): Changed this struct template to take - fewer arguments, and changed its member functions to be - function templates instead. This allows the compiler to - determine types more flexibly and also simplifies use of it. - (WTF::HashMapTranslatorAdapter): Ditto. - (WTF::HashMap::find): Updated to use new HashMapTranslatorAdapter. - Also reduced the arguments passed to the HashTable function template. - (WTF::HashMap::contains): Ditto. - (WTF::HashMap::inlineAdd): Ditto. Also take MappedPassInType. - (WTF::HashMap::set): Ditto. - (WTF::HashMap::add): Ditto. - (WTF::HashMap::inlineGet): Ditto, but return MappedPeekType. - (WTF::HashMap::get): Ditto. - (WTF::HashMap::take): Ditto, but return MappedPassOutType and use - that type in the implementation. - (WTF::deleteAllValues): Removed unneeded template arguments from - call to deleteAllPairSeconds. - (WTF::deleteAllKeys): Removed unneeded template arguments from - call to deleteAllPairFirsts. - - * wtf/HashSet.h: - (WTF::IdentityExtractor): Changed this to be a struct rather than - a struct template, and replaced the extract function with a function - template. This allows the compiler to deduce the type. - (WTF::HashSetTranslatorAdapter): Changed this struct template to take - fewer arguments, and changed its member functions to be - function templates instead. This allows the compiler to - determine types more flexibly and also simplifies use of it. - (WTF::HashSet::find): Updated to use new HashSetTranslatorAdapter. - Also reduced the arguments passed to the HashTable function template. - (WTF::HashSet::contains): Ditto. - (WTF::HashSet::add): Ditto. - - * wtf/HashTable.h: - (WTF::IdentityHashTranslator): Changed this struct template to take - fewer arguments, and changed its member functions to be - function templates instead. This allows the compiler to - determine types more flexibly and also simplifies use of it. - (WTF::HashTable::add): Reduced arguments passed to the function template. - (WTF::HashTable::find): Ditto, also reversed the template arguments so the - translator comes first so the compiler can deduce the other type. - (WTF::HashTable::contains): Ditto. - (WTF::HashTable::lookup): Ditto. - (WTF::HashTable::lookupForWriting): Ditto. - (WTF::HashTable::checkKey): Ditto. - (WTF::HashTable::fullLookupForWriting): Ditto. - (WTF::HashTable::add): Ditto. - (WTF::HashTable::addPassingHashCode): Ditto. - (WTF::HashTable::find): Ditto. - (WTF::HashTable::contains): Ditto. - - * wtf/ListHashSet.h: - (WTF::ListHashSetNodeHashFunctions): Changed this struct template to take - fewer arguments, and changed its member functions to be function templates - instead. This allows the compiler to determine types more flexibly and - also simplifies use of it. - (WTF::ListHashSet::find): Reduced the arguments passed to the HashTable - functon template. - (WTF::ListHashSetTranslatorAdapter): Changed this struct template in the - same way we changed ListHashSetNodeHashFunctions above. - (WTF::ListHashSetTranslatorAdapter::equal): - (WTF::::contains): - (WTF::::add): - (WTF::::insertBefore): - - * wtf/RefPtrHashMap.h: Updated comments. Removed the - RefPtrHashMapRawKeyTranslator struct template; we can use the - HashMapTranslator struct template from HashMap.h instead now that - it is more flexible. Added MappedPassInType, MappedPassOutType, - and MappedPeekType typedefs, and used them for the arguments - and return types of the get, inlineGet, set, add, take, and inlineAdd - functions. Changed the name of the RawKeyTranslator type to - Translator since it's now a class that can handle both raw keys - and conventional keys. - (WTF::HashMap::find): Changed to use Translator instead of RawKeyTranslator. - Reduced the arguments passed to the HashTable function template. - (WTF::HashMap::contains): Ditto. - (WTF::HashMap::inlineAdd): Ditto. Also take MappedPassInType. - (WTF::HashMap::set): Ditto. - (WTF::HashMap::add): Ditto. - (WTF::HashMap::inlineGet): Ditto, but return MappedPeekType. - (WTF::HashMap::get): Ditto. - (WTF::HashMap::take): Ditto, but return MappedPassOutType and use - that type in the implementation. - (WTF::deleteAllValues): Removed unneeded template arguments from - call to deleteAllPairSeconds. - (WTF::deleteAllKeys): Removed unneeded template arguments from - call to deleteAllPairFirsts. - -2011-12-02 Zoltan Herczeg - - MacroAssemblerSH4 does not implement readCallTarget - https://bugs.webkit.org/show_bug.cgi?id=73434 - - Reviewed by Csaba Osztrogonác. - - * assembler/SH4Assembler.h: - (JSC::SH4Assembler::readCallTarget): Support for SH4. - -2011-12-02 Hajime Morrita - - Unreviewed, rolling out r101751 and r101775. - http://trac.webkit.org/changeset/101751 - http://trac.webkit.org/changeset/101775 - https://bugs.webkit.org/show_bug.cgi?id=73191 - - breaks Windows build - - * JavaScriptCore.xcodeproj/project.pbxproj: - * config.h: - * runtime/JSExportMacros.h: Removed. - * wtf/ExportMacros.h: - * wtf/Platform.h: - * wtf/WTFThreadData.h: - * wtf/text/AtomicString.h: - * wtf/text/StringStatics.cpp: - -2011-12-01 Hajime Morrita - - JS_INLINE and WTF_INLINE should be visible from WebCore - https://bugs.webkit.org/show_bug.cgi?id=73191 - - - Moved Export related macro definitions from config.h to ExportMacros.h and JSExportMacros.h. - - Moved WTF_USE_JSC and WTF_USE_V8 from various config.h family to Platform.h. - - Replaced JS_EXPORTDATA in wtf moudule with newly introduced WTF_EXPORTDATA. - - Reviewed by Kevin Ollivier. - - * JavaScriptCore.xcodeproj/project.pbxproj: - * config.h: - * runtime/JSExportMacros.h: Added. - * wtf/ExportMacros.h: - * wtf/Platform.h: - * wtf/WTFThreadData.h: - * wtf/text/AtomicString.h: - * wtf/text/StringStatics.cpp: - -2011-12-01 Michael Saboff - - Changes proposed for 73457 slow down Kraken json-parse-financial - https://bugs.webkit.org/show_bug.cgi?id=73584 - - Restructured StringImpl::equal to take advantage of 8 or 4 bytes - at a time when possible. - - This is worth ~3% on Kraken json-parse-financial. It provides - ~2% on SunSpider string-unpack-code. - - Reviewed by Sam Weinig. - - * wtf/text/StringImpl.cpp: - (WTF::equal): - -2011-12-01 Oliver Hunt - - Support integer typed arrays in the DFG JIT - https://bugs.webkit.org/show_bug.cgi?id=73608 - - Reviewed by Filip Pizlo. - - Add support for all the integral typed arrays in the DFG JIT. - Currently this loads the contents of Uint32 arrays as doubles, - which is clearly not as efficient as it could be, but this is - still in the order of 10-20x faster than the existing behaviour. - - This needed us to add support for writing 16bit values to the - macroassembler, and also to support double<->unsigned conversion. - - * assembler/ARMv7Assembler.h: - (JSC::ARMv7Assembler::strh): - (JSC::ARMv7Assembler::vcvt_floatingPointToUnsigned): - * assembler/MacroAssemblerARMv7.h: - (JSC::MacroAssemblerARMv7::store16): - (JSC::MacroAssemblerARMv7::truncateDoubleToUint32): - * assembler/MacroAssemblerX86Common.h: - (JSC::MacroAssemblerX86Common::store16): - (JSC::MacroAssemblerX86Common::truncateDoubleToUint32): - * assembler/X86Assembler.h: - (JSC::X86Assembler::movw_rm): - (JSC::X86Assembler::cvttsd2siq_rr): - * bytecode/PredictedType.cpp: - (JSC::predictionToString): - (JSC::predictionFromClassInfo): - * bytecode/PredictedType.h: - (JSC::isInt8ArrayPrediction): - (JSC::isInt16ArrayPrediction): - (JSC::isInt32ArrayPrediction): - (JSC::isUint8ArrayPrediction): - (JSC::isUint16ArrayPrediction): - (JSC::isUint32ArrayPrediction): - (JSC::isFloat32ArrayPrediction): - (JSC::isFloat64ArrayPrediction): - * dfg/DFGAbstractState.cpp: - (JSC::DFG::AbstractState::initialize): - (JSC::DFG::AbstractState::execute): - * dfg/DFGNode.h: - (JSC::DFG::Node::shouldSpeculateInt8Array): - (JSC::DFG::Node::shouldSpeculateInt16Array): - (JSC::DFG::Node::shouldSpeculateInt32Array): - (JSC::DFG::Node::shouldSpeculateUint8Array): - (JSC::DFG::Node::shouldSpeculateUint16Array): - (JSC::DFG::Node::shouldSpeculateUint32Array): - (JSC::DFG::Node::shouldSpeculateFloat32Array): - (JSC::DFG::Node::shouldSpeculateFloat64Array): - * dfg/DFGPropagator.cpp: - (JSC::DFG::Propagator::propagateNodePredictions): - (JSC::DFG::Propagator::fixupNode): - (JSC::DFG::Propagator::performNodeCSE): - * dfg/DFGSpeculativeJIT.cpp: - (JSC::DFG::SpeculativeJIT::checkArgumentTypes): - (JSC::DFG::SpeculativeJIT::compileGetTypedArrayLength): - (JSC::DFG::SpeculativeJIT::compileGetByValOnIntTypedArray): - (JSC::DFG::SpeculativeJIT::compilePutByValForIntTypedArray): - * dfg/DFGSpeculativeJIT.h: - * dfg/DFGSpeculativeJIT32_64.cpp: - (JSC::DFG::SpeculativeJIT::compile): - * dfg/DFGSpeculativeJIT64.cpp: - (JSC::DFG::SpeculativeJIT::compile): - * runtime/JSGlobalData.h: - -2011-12-01 Benjamin Poulain - - URLs are encoded in UTF-8, then decoded as if they are Latin1 - https://bugs.webkit.org/show_bug.cgi?id=71758 - - Reviewed by Darin Adler. - - Add the operator == between a String and a Vector of char. The implementation - is the same as the comparison of String and char* but adds the length as a - parameter for comparing the strings. - - * JavaScriptCore.exp: - * wtf/text/StringImpl.h: - (WTF::equal): - * wtf/text/WTFString.h: - (WTF::operator==): - (WTF::operator!=): - -2011-12-01 Martin Robinson - - [GTK] Read fonts from the jhbuild root - https://bugs.webkit.org/show_bug.cgi?id=73487 - - Reviewed by Gustavo Noronha Silva. - - Read fonts from the jhbuild root instead of from the system. This will ensure - that all testers use the same fonts instead of leaving this up to luck. - - * wtf/gobject/GlibUtilities.h: Add Assertions.h which was required for the WebKit2TestRunner. - -2011-12-01 Martin Robinson - - [GTK] Add a helper function to find the current executable's path - https://bugs.webkit.org/show_bug.cgi?id=73473 - - Reviewed by Gustavo Noronha Silva. - - Add a WTF helper which gets the binary path. This is currently only used - in WebKit2. - - * GNUmakefile.list.am: Add the new file to the source list. - * wtf/gobject/GlibUtilities.cpp: Added. - (getCurrentExecutablePath): - * wtf/gobject/GlibUtilities.h: Added. - -2011-12-01 Sheriff Bot - - Unreviewed, rolling out r101691. - http://trac.webkit.org/changeset/101691 - https://bugs.webkit.org/show_bug.cgi?id=73588 - - Tests fail on Chromium bots, early warning system warned - committer, please adjust test_expectations in patch (Requested - by scheib on #webkit). - - * JavaScriptCore.exp: - * wtf/text/StringImpl.h: - * wtf/text/WTFString.h: - -2011-12-01 Filip Pizlo - - ARMv7 only allows for one-shot patching of compact offsets, while the - JIT expects to be able to repatch - https://bugs.webkit.org/show_bug.cgi?id=73548 - - Reviewed by Oliver Hunt. - - * assembler/ARMv7Assembler.h: - (JSC::ARMv7Assembler::setUInt7ForLoad): - -2011-11-30 Benjamin Poulain - - URLs are encoded in UTF-8, then decoded as if they are Latin1 - https://bugs.webkit.org/show_bug.cgi?id=71758 - - Reviewed by Darin Adler. - - Add the operator == between a String and a Vector of char. The implementation - is the same as the comparison of String and char* but adds the length as a - parameter for comparing the strings. - - * JavaScriptCore.exp: - * wtf/text/StringImpl.h: - (WTF::equal): - * wtf/text/WTFString.h: - (WTF::operator==): - (WTF::operator!=): - -2011-11-30 Dmitry Lomov - - https://bugs.webkit.org/show_bug.cgi?id=73503 - [Chromium][V8] Implement ArrayBuffer transfer in chromium. - Portions of this patch come from Luke Zarko. - - Reviewed by David Levin. - - * wtf/ArrayBuffer.cpp: - (WTF::ArrayBuffer::transfer): Changed prototype from pointers to RefPtr. - * wtf/ArrayBuffer.h: - (WTF::ArrayBufferContents::transfer): Changed prototype from pointers to RefPtr. - (WTF::ArrayBuffer::isNeutered): - * wtf/TypedArrayBase.h: - (WTF::TypedArrayBase::neuter): - -2011-12-01 Chao-ying Fu - - MacroAssemblerMIPS does not implement readCallTarget - https://bugs.webkit.org/show_bug.cgi?id=73432 - - Reviewed by Zoltan Herczeg. - - * assembler/MIPSAssembler.h: - (JSC::MIPSAssembler::readCallTarget): - * assembler/MacroAssemblerMIPS.h: - (JSC::MacroAssemblerMIPS::readCallTarget): - -2011-12-01 Noel Gordon - - [chromium] Remove wtf/qt/ThreadingQt.cpp from the gyp projects - https://bugs.webkit.org/show_bug.cgi?id=73527 - - Reviewed by Simon Hausmann. - - wtf/qt/ThreadingQt.cpp was removed in r101477 - - * JavaScriptCore.gypi: remove wtf/qt/ThreadingQt.cpp - -2011-12-01 Filip Pizlo - - BitVector isInline check could fail - https://bugs.webkit.org/show_bug.cgi?id=70691 - - Reviewed by Gavin Barraclough. - - Switch back to using the high bit as the inline marker, to make - all of the bit indexing operations simpler. Computing the size in - words and in bytes of a bitvector, using the number of bits as - input is error-prone enough; and with the current approach to - solving the X86 bug we end up getting it wrong. Making it right - seems hard. - - So instead, to solve the original problem (the high bit may be - meaningful on 32-bit systems), the out-of-line storage pointer is - right-shifted by 1. Compared to the original BitVector code, this - is a much smaller change (just three lines). - - This solves a bug where the DFG was corrupting its call frame - because BitVector lost track of some bits. - - * wtf/BitVector.cpp: - (WTF::BitVector::setSlow): - (WTF::BitVector::resizeOutOfLine): - * wtf/BitVector.h: - (WTF::BitVector::quickGet): - (WTF::BitVector::quickSet): - (WTF::BitVector::quickClear): - (WTF::BitVector::makeInlineBits): - (WTF::BitVector::isInline): - (WTF::BitVector::outOfLineBits): - -2011-11-30 Filip Pizlo - - DFG should make it easier to notice node boundaries in disassembly - https://bugs.webkit.org/show_bug.cgi?id=73509 - - Rubber-stamped by Gavin Barraclough - - If you set XOR_DEBUG_AID to 1 in DFGCommon.h, a pair of xor's will - be emitted at node boundaries, where the immediate being xor'd is the - node index. - - * dfg/DFGCommon.h: - * dfg/DFGSpeculativeJIT.cpp: - (JSC::DFG::SpeculativeJIT::compile): - -2011-11-30 Geoffrey Garen - - Removed ArgList iterators. - - Reviewed by Gavin Barraclough. - - Another step toward reversing the argument order. - - * interpreter/Interpreter.cpp: - (JSC::Interpreter::executeCall): - (JSC::Interpreter::executeConstruct): Switched from iterator to int. - - * runtime/ArgList.h: - (JSC::ArgList::ArgList): - (JSC::ArgList::isEmpty): Removed iterators. - - * runtime/JSArray.cpp: - (JSC::JSArray::finishCreation): Switched from iterator to int. - -2011-11-30 Yuqiang Xian - - 32 bit DFG should handle logicalNot slow case instead of simply bailing out - https://bugs.webkit.org/show_bug.cgi?id=73515 - - Reviewed by Filip Pizlo. - - This improves Kraken performance by 14%, mainly due to ~3X improvement - on imaging-desaturate. - - * dfg/DFGSpeculativeJIT32_64.cpp: - (JSC::DFG::SpeculativeJIT::compileLogicalNot): - -2011-11-30 Max Vujovic - - Some date values not handled consistently with IE/Firefox - https://bugs.webkit.org/show_bug.cgi?id=14176 - - Reviewed by Gavin Barraclough. - - Changed time zone offset parsing behavior to match IE/Firefox/Opera's in - implementation dependent cases like "GMT-4". - - * wtf/DateMath.cpp: - (WTF::parseDateFromNullTerminatedCharacters): - -2011-11-30 Mark Hahnenberg - - toStringCallback and valueOfCallback do not check the entire prototype chain for convertToType callback - https://bugs.webkit.org/show_bug.cgi?id=73368 - - Reviewed by Darin Adler. - - We need to search the entire prototype chain for the convertToType callback, rather than just calling whatever - happens to be in the first class of the chain, which potentially could be null. - - - - * API/JSCallbackFunction.cpp: - (JSC::JSCallbackFunction::toStringCallback): - (JSC::JSCallbackFunction::valueOfCallback): - -2011-11-29 Sam Weinig - - Add adoptCF and adoptNS convenience functions to RetainPtr.h - https://bugs.webkit.org/show_bug.cgi?id=73399 - - Reviewed by Anders Carlsson. - - * wtf/RetainPtr.h: - (WTF::adoptCF): - (WTF::adoptNS): - These adoption functions match the pattern we use in other - smart pointer classes. - -2011-11-30 Adam Roben - - Fix RetainPtr's move assignment operators - - Fixes RetainPtr's move assignment operators don't modify the - pointer being assigned to - - I didn't write a test for this because we don't have a way of unit testing C++11 code (see - ). - - Reviewed by Anders Carlsson. - - * wtf/RetainPtr.h: - (WTF::RetainPtr::operator=): Adopt the passed-in RetainPtr's underlying pointer, not our own - pointer. - -2011-11-30 Csaba Osztrogonác - - Unreviewed rolling out incorrect r101481. - - * assembler/MIPSAssembler.h: - * assembler/MacroAssemblerMIPS.h: - -2011-11-30 Simon Hausmann - - Fix compilation with MingW. - - Reviewed by Csaba Osztrogonác. - - * wtf/ThreadingWin.cpp: - (WTF::initializeCurrentThreadInternal): MingW doesn't support MSVC exception handling, so for - the time being make the thread name setting unimplemented for MingW. - -2011-11-30 Simon Hausmann - - Unreviewed propective build fix for Qt/Windows part 2 after r101477. - - * wtf/ThreadSpecific.h: Fix the OS(WINDOWS) defines for the friend declaration for ThreadSpecific::Data - -2011-11-30 Simon Hausmann - - Unreviewed propective build fix for Qt/Windows after r101477. - - * wtf/ThreadSpecific.h: Use OS(WINDOWS) for declaring "destructor", as it's - only referenced from within another OS(WINDOWS) section. - -2011-11-30 Csaba Osztrogonác - - Unreviewed speculative buildfix after r101457. - - * assembler/MIPSAssembler.h: - (JSC::MIPSAssembler::readCallTarget): - * assembler/MacroAssemblerMIPS.h: - (JSC::MacroAssemblerMIPS::readCallTarget): - -2011-11-30 Andrew Wason - - Replace Qt QThread threading back-end with pthread/Win32 threading back-ends - https://bugs.webkit.org/show_bug.cgi?id=72155 - - Reviewed by Simon Hausmann. - - Use ThreadingPthreads and ThreadingWin instead of ThreadingQt. - - * heap/MachineStackMarker.cpp: - * wtf/MainThread.cpp: - (WTF::initializeMainThread): - * wtf/Platform.h: - * wtf/ThreadSpecific.h: Drop QThreadStorage related code. - (WTF::::destroy): - * wtf/ThreadingPrimitives.h: - * wtf/qt/MainThreadQt.cpp: Drop Qt specific isMainThread(). - (WTF::initializeMainThreadPlatform): Initialize MainThreadInvoker on main thread to avoid infecting secondary thread with QAdoptedThread. - (WTF::scheduleDispatchFunctionsOnMainThread): - * wtf/qt/ThreadingQt.cpp: Removed. - * wtf/wtf.pro: - -2011-11-30 Csaba Osztrogonác - - MacroAssemblerARM does not implement readCallTarget - https://bugs.webkit.org/show_bug.cgi?id=73413 - - Based on Filip Pizlo's patch. - - Buildfix. Rubber-stamped by Gabor Loki. - - * assembler/ARMAssembler.h: - (JSC::ARMAssembler::readCallTarget): - * assembler/MacroAssemblerARM.h: - (JSC::MacroAssemblerARM::readCallTarget): - -2011-11-29 Filip Pizlo - - Resetting a put_by_id inline cache should preserve the "isDirect" bit - https://bugs.webkit.org/show_bug.cgi?id=73375 - - Reviewed by Gavin Barraclough. - - For the replace case, we can find out if it was direct by looking at the - slow call. For the transition case, we explicitly remember if it was - direct. - - * bytecode/CodeBlock.cpp: - (JSC::printStructureStubInfo): - * bytecode/StructureStubInfo.cpp: - (JSC::StructureStubInfo::deref): - (JSC::StructureStubInfo::visitWeakReferences): - * bytecode/StructureStubInfo.h: - (JSC::isPutByIdAccess): - (JSC::StructureStubInfo::initPutByIdTransition): - * dfg/DFGByteCodeParser.cpp: - (JSC::DFG::ByteCodeParser::parseBlock): - * dfg/DFGRepatch.cpp: - (JSC::DFG::tryCachePutByID): - * jit/JIT.h: - * jit/JITPropertyAccess.cpp: - (JSC::JIT::resetPatchPutById): - (JSC::JIT::isDirectPutById): - * jit/JITPropertyAccess32_64.cpp: - (JSC::JIT::resetPatchPutById): - * jit/JITStubs.cpp: - (JSC::JITThunks::tryCachePutByID): - -2011-11-29 Sam Weinig - - Remove RetainPtr::releaseRef - https://bugs.webkit.org/show_bug.cgi?id=73396 - - Reviewed by Dan Bernstein. - - * wtf/RetainPtr.h: - Be gone releaseRef! Long live leakRef! - -2011-11-29 Sam Weinig - - Add move semantics to RetainPtr - https://bugs.webkit.org/show_bug.cgi?id=73393 - - Reviewed by Anders Carlsson. - - * wtf/RetainPtr.h: - (WTF::RetainPtr::RetainPtr): - Add a move constructor and move enabled assignment operators - to RetainPtr if the compiler being used supports rvalue - references. If the compiler does not support it, we fallback - to the copy semantics we have always had. - -2011-11-29 Yuqiang Xian - - DFG local CSE may cause incorrect reference counting for a node - https://bugs.webkit.org/show_bug.cgi?id=73390 - - Reviewed by Filip Pizlo. - - When performing a node substitution, the ref count of the replaced - child will be increased, no matter whether the user node is skipped in - code generation or not. This will cause the reference count of the - replaced child never get the chance to become zero and so the - registers occupied by it cannot be reused simply without spilling, if - it's used by a "skipped" node. - This is a 1% gain on V8 benchmark, tested on IA32 Linux. - - * dfg/DFGPropagator.cpp: - (JSC::DFG::Propagator::performSubstitution): - (JSC::DFG::Propagator::performNodeCSE): - -2011-11-29 David Levin - - Add a way to revert a variable to its previous value after leaving a scope. - https://bugs.webkit.org/show_bug.cgi?id=73371 - - Reviewed by Adam Barth. - - In case anyone from Chromium sees this, it is nearly identical to AutoReset - but if the same name were used, it causes unnecessary ambiguity. - - * JavaScriptCore.xcodeproj/project.pbxproj: - * wtf/TemporarilyChange.h: Added. - (WTF::TemporarilyChange::TemporarilyChange): - (WTF::TemporarilyChange::~TemporarilyChange): - -2011-11-29 Sam Weinig - - Add COMPILER_SUPPORTS macro to allow for compiler feature testing - https://bugs.webkit.org/show_bug.cgi?id=73386 - - Reviewed by Anders Carlsson. - - * wtf/Compiler.h: - Add COMPILER_SUPPORTS and #defines for C++11 variadic templates and - rvalue references for Clang. - -2011-11-29 Oliver Hunt - - Allow WebCore to describe typed arrays to JSC - https://bugs.webkit.org/show_bug.cgi?id=73355 - - Reviewed by Gavin Barraclough. - - Allow globaldata to track the structure of typed arrays. - - * runtime/JSGlobalData.h: - (JSC::TypedArrayDescriptor::TypedArrayDescriptor): - -2011-11-28 Filip Pizlo - - DFG debugCall() mechanism only works on X86 and X86-64 - https://bugs.webkit.org/show_bug.cgi?id=73282 - - Reviewed by Oliver Hunt. - - * dfg/DFGAssemblyHelpers.h: - (JSC::DFG::AssemblyHelpers::debugCall): - -2011-11-28 Filip Pizlo - - DFG non-X86 ArithDiv does speculation failure after mutating state, - without a value recovery - https://bugs.webkit.org/show_bug.cgi?id=73286 - - Reviewed by Gavin Barraclough. - - * dfg/DFGSpeculativeJIT32_64.cpp: - (JSC::DFG::SpeculativeJIT::compile): - -2011-11-28 Filip Pizlo - - Unreviewed build fixes for ARM. - - * assembler/MacroAssemblerARMv7.h: - (JSC::MacroAssemblerARMv7::readCallTarget): - * dfg/DFGSpeculativeJIT.h: - (JSC::DFG::SpeculativeJIT::setupArgumentsWithExecState): - -2011-11-20 Roland Steiner - - \n"; - -while () { - if (/^ *DEFINE_OPCODE/) { - chomp; - s/^ *DEFINE_OPCODE\(op_//; - s/\).*$//; - my $opcode = $_; - $_ = ; - chomp; - if (m|/\* |) { - my $format = $_; - $format =~ s|.* /\* ||; - my $doc = ""; - while () { - if (m|\*/|) { - last; - } - $doc .= $_ . " "; - } - - print OUTPUT "

${opcode}

\n

Format: \n${format}\n

\n

\n${doc}\n

\n"; - } else { - push @undocumented, $opcode; - } - } -} - -close OUTPUT; - -for my $undoc (@undocumented) { - print "UNDOCUMENTED: ${undoc}\n"; -} diff --git a/JavaScriptCore/ftl/FTLAbbreviatedTypes.h b/JavaScriptCore/ftl/FTLAbbreviatedTypes.h index e978fc3e..06a68cd6 100644 --- a/JavaScriptCore/ftl/FTLAbbreviatedTypes.h +++ b/JavaScriptCore/ftl/FTLAbbreviatedTypes.h @@ -34,6 +34,7 @@ namespace JSC { namespace FTL { +typedef LLVMAtomicOrdering LAtomicOrdering; typedef LLVMBasicBlockRef LBasicBlock; typedef LLVMBuilderRef LBuilder; typedef LLVMCallConv LCallConv; diff --git a/JavaScriptCore/ftl/FTLAbbreviations.h b/JavaScriptCore/ftl/FTLAbbreviations.h index 19a843ea..02e0c04c 100644 --- a/JavaScriptCore/ftl/FTLAbbreviations.h +++ b/JavaScriptCore/ftl/FTLAbbreviations.h @@ -58,6 +58,7 @@ static inline LType floatType(LContext context) { return llvm->FloatTypeInContex static inline LType doubleType(LContext context) { return llvm->DoubleTypeInContext(context); } static inline LType pointerType(LType type) { return llvm->PointerType(type, 0); } +static inline LType vectorType(LType type, unsigned count) { return llvm->VectorType(type, count); } enum PackingMode { NotPacked, Packed }; static inline LType structType(LContext context, LType* elementTypes, unsigned elementCount, PackingMode packing = NotPacked) @@ -140,6 +141,7 @@ static inline LValue addExternFunction(LModule module, const char* name, LType t } static inline LValue getParam(LValue function, unsigned index) { return llvm->GetParam(function, index); } +static inline LValue getUndef(LType type) { return llvm->GetUndef(type); } enum BitExtension { ZeroExtend, SignExtend }; static inline LValue constInt(LType type, unsigned long long value, BitExtension extension = ZeroExtend) { return llvm->ConstInt(type, value, extension == SignExtend); } @@ -217,6 +219,14 @@ static inline LValue buildPtrToInt(LBuilder builder, LValue value, LType type) { static inline LValue buildBitCast(LBuilder builder, LValue value, LType type) { return llvm->BuildBitCast(builder, value, type, ""); } static inline LValue buildICmp(LBuilder builder, LIntPredicate cond, LValue left, LValue right) { return llvm->BuildICmp(builder, cond, left, right, ""); } static inline LValue buildFCmp(LBuilder builder, LRealPredicate cond, LValue left, LValue right) { return llvm->BuildFCmp(builder, cond, left, right, ""); } +static inline LValue buildInsertElement(LBuilder builder, LValue vector, LValue element, LValue index) { return llvm->BuildInsertElement(builder, vector, element, index, ""); } + +enum SynchronizationScope { SingleThread, CrossThread }; +static inline LValue buildFence(LBuilder builder, LAtomicOrdering ordering, SynchronizationScope scope = CrossThread) +{ + return llvm->BuildFence(builder, ordering, scope == SingleThread, ""); +} + static inline LValue buildCall(LBuilder builder, LValue function, const LValue* args, unsigned numArgs) { return llvm->BuildCall(builder, function, const_cast(args), numArgs, ""); @@ -259,8 +269,17 @@ static inline LValue buildCall(LBuilder builder, LValue function, LValue arg1, L LValue args[] = { arg1, arg2, arg3, arg4, arg5, arg6 }; return buildCall(builder, function, args, 6); } -enum TailCallMode { IsNotTailCall, IsTailCall }; -static inline void setTailCall(LValue call, TailCallMode mode) { llvm->SetTailCall(call, mode == IsTailCall); } +static inline LValue buildCall(LBuilder builder, LValue function, LValue arg1, LValue arg2, LValue arg3, LValue arg4, LValue arg5, LValue arg6, LValue arg7) +{ + LValue args[] = { arg1, arg2, arg3, arg4, arg5, arg6, arg7 }; + return buildCall(builder, function, args, 7); +} +static inline LValue buildCall(LBuilder builder, LValue function, LValue arg1, LValue arg2, LValue arg3, LValue arg4, LValue arg5, LValue arg6, LValue arg7, LValue arg8) +{ + LValue args[] = { arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8 }; + return buildCall(builder, function, args, 8); +} +static inline void setInstructionCallingConvention(LValue instruction, LCallConv callingConvention) { llvm->SetInstructionCallConv(instruction, callingConvention); } static inline LValue buildExtractValue(LBuilder builder, LValue aggVal, unsigned index) { return llvm->BuildExtractValue(builder, aggVal, index, ""); } static inline LValue buildSelect(LBuilder builder, LValue condition, LValue taken, LValue notTaken) { return llvm->BuildSelect(builder, condition, taken, notTaken, ""); } static inline LValue buildBr(LBuilder builder, LBasicBlock destination) { return llvm->BuildBr(builder, destination); } diff --git a/JavaScriptCore/ftl/FTLAbstractHeap.h b/JavaScriptCore/ftl/FTLAbstractHeap.h index 7dea9e57..e92a2fc2 100644 --- a/JavaScriptCore/ftl/FTLAbstractHeap.h +++ b/JavaScriptCore/ftl/FTLAbstractHeap.h @@ -32,8 +32,8 @@ #include "FTLAbbreviations.h" #include "JSCJSValue.h" +#include #include -#include #include #include #include @@ -171,7 +171,7 @@ class IndexedAbstractHeap { size_t m_elementSize; LValue m_scaleTerm; bool m_canShift; - FixedArray m_smallIndices; + std::array m_smallIndices; struct WithoutZeroOrOneHashTraits : WTF::GenericHashTraits { static void constructDeletedValue(ptrdiff_t& slot) { slot = 1; } diff --git a/JavaScriptCore/ftl/FTLAbstractHeapRepository.cpp b/JavaScriptCore/ftl/FTLAbstractHeapRepository.cpp index 2a3fb5ec..d7f83c96 100644 --- a/JavaScriptCore/ftl/FTLAbstractHeapRepository.cpp +++ b/JavaScriptCore/ftl/FTLAbstractHeapRepository.cpp @@ -45,6 +45,8 @@ AbstractHeapRepository::AbstractHeapRepository(LContext context) FOR_EACH_ABSTRACT_FIELD(ABSTRACT_FIELD_INITIALIZATION) #undef ABSTRACT_FIELD_INITIALIZATION + , JSCell_freeListNext(JSCell_structure) + #define INDEXED_ABSTRACT_HEAP_INITIALIZATION(name, size) , name(context, &root, #name, size) FOR_EACH_INDEXED_ABSTRACT_HEAP(INDEXED_ABSTRACT_HEAP_INITIALIZATION) #undef INDEXED_ABSTRACT_HEAP_INITIALIZATION @@ -61,6 +63,8 @@ AbstractHeapRepository::AbstractHeapRepository(LContext context) RELEASE_ASSERT(m_tbaaKind); RELEASE_ASSERT(root.m_tbaaMetadata); + + RELEASE_ASSERT(!JSCell_freeListNext.offset()); } AbstractHeapRepository::~AbstractHeapRepository() diff --git a/JavaScriptCore/ftl/FTLAbstractHeapRepository.h b/JavaScriptCore/ftl/FTLAbstractHeapRepository.h index 691aff7e..f811c8be 100644 --- a/JavaScriptCore/ftl/FTLAbstractHeapRepository.h +++ b/JavaScriptCore/ftl/FTLAbstractHeapRepository.h @@ -31,12 +31,14 @@ #if ENABLE(FTL_JIT) #include "FTLAbstractHeap.h" +#include "IndexingType.h" namespace JSC { namespace FTL { #define FOR_EACH_ABSTRACT_HEAP(macro) \ macro(length) \ - macro(typedArrayProperties) + macro(typedArrayProperties) \ + macro(WriteBarrierBuffer_bufferContents) #define FOR_EACH_ABSTRACT_FIELD(macro) \ macro(Butterfly_publicLength, Butterfly::offsetOfPublicLength()) \ @@ -51,12 +53,15 @@ namespace JSC { namespace FTL { macro(JSString_length, JSString::offsetOfLength()) \ macro(JSString_value, JSString::offsetOfValue()) \ macro(JSVariableObject_registers, JSVariableObject::offsetOfRegisters()) \ + macro(MarkedAllocator_freeListHead, MarkedAllocator::offsetOfFreeListHead()) \ + macro(MarkedBlock_markBits, MarkedBlock::offsetOfMarks()) \ macro(StringImpl_data, StringImpl::dataOffset()) \ macro(StringImpl_hashAndFlags, StringImpl::flagsOffset()) \ macro(Structure_classInfo, Structure::classInfoOffset()) \ macro(Structure_globalObject, Structure::globalObjectOffset()) \ macro(Structure_indexingType, Structure::indexingTypeOffset()) \ - macro(Structure_typeInfoFlags, Structure::typeInfoFlagsOffset()) + macro(Structure_typeInfoFlags, Structure::typeInfoFlagsOffset()) \ + macro(Structure_typeInfoType, Structure::typeInfoTypeOffset()) #define FOR_EACH_INDEXED_ABSTRACT_HEAP(macro) \ macro(characters8, sizeof(LChar)) \ @@ -65,6 +70,7 @@ namespace JSC { namespace FTL { macro(indexedDoubleProperties, sizeof(double)) \ macro(indexedContiguousProperties, sizeof(EncodedJSValue)) \ macro(indexedArrayStorageProperties, sizeof(EncodedJSValue)) \ + macro(singleCharacterStrings, sizeof(JSString*)) \ macro(variables, sizeof(Register)) #define FOR_EACH_NUMBERED_ABSTRACT_HEAP(macro) \ @@ -89,6 +95,8 @@ class AbstractHeapRepository { FOR_EACH_ABSTRACT_FIELD(ABSTRACT_FIELD_DECLARATION) #undef ABSTRACT_FIELD_DECLARATION + AbstractField& JSCell_freeListNext; + #define INDEXED_ABSTRACT_HEAP_DECLARATION(name, size) IndexedAbstractHeap name; FOR_EACH_INDEXED_ABSTRACT_HEAP(INDEXED_ABSTRACT_HEAP_DECLARATION) #undef INDEXED_ABSTRACT_HEAP_DECLARATION @@ -98,6 +106,31 @@ class AbstractHeapRepository { #undef NUMBERED_ABSTRACT_HEAP_DECLARATION AbsoluteAbstractHeap absolute; + + IndexedAbstractHeap* forIndexingType(IndexingType indexingType) + { + switch (indexingType) { + case ALL_BLANK_INDEXING_TYPES: + case ALL_UNDECIDED_INDEXING_TYPES: + return 0; + + case ALL_INT32_INDEXING_TYPES: + return &indexedInt32Properties; + + case ALL_DOUBLE_INDEXING_TYPES: + return &indexedDoubleProperties; + + case ALL_CONTIGUOUS_INDEXING_TYPES: + return &indexedContiguousProperties; + + case ALL_ARRAY_STORAGE_INDEXING_TYPES: + return &indexedArrayStorageProperties; + + default: + RELEASE_ASSERT_NOT_REACHED(); + return 0; + } + } private: friend class AbstractHeap; diff --git a/JavaScriptCore/ftl/FTLCArgumentGetter.cpp b/JavaScriptCore/ftl/FTLCArgumentGetter.cpp deleted file mode 100644 index 7e14147a..00000000 --- a/JavaScriptCore/ftl/FTLCArgumentGetter.cpp +++ /dev/null @@ -1,85 +0,0 @@ -/* - * Copyright (C) 2013 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 "FTLCArgumentGetter.h" - -#if ENABLE(FTL_JIT) - -namespace JSC { namespace FTL { - -using namespace DFG; - -void CArgumentGetter::loadNextAndBox( - ValueFormat format, GPRReg destination, GPRReg scratch1, GPRReg scratch2) -{ - if (scratch1 == InvalidGPRReg) { - ASSERT(scratch2 == InvalidGPRReg); - if (destination == GPRInfo::nonArgGPR0) - scratch1 = GPRInfo::nonArgGPR1; - else - scratch1 = GPRInfo::nonArgGPR0; - } - if (scratch2 == InvalidGPRReg) { - if (destination != GPRInfo::nonArgGPR0 && scratch1 != GPRInfo::nonArgGPR0) - scratch2 = GPRInfo::nonArgGPR0; - else if (destination != GPRInfo::nonArgGPR1 && scratch1 != GPRInfo::nonArgGPR1) - scratch2 = GPRInfo::nonArgGPR1; - else - scratch2 = GPRInfo::nonArgGPR2; - } - - switch (format) { - case ValueFormatInt32: - case ValueFormatUInt32: - loadNext32(destination); - break; - - case ValueFormatInt52: - case ValueFormatStrictInt52: - case ValueFormatJSValue: - loadNext64(destination); - break; - - case ValueFormatBoolean: - loadNext8(destination); - break; - - case ValueFormatDouble: - loadNextDoubleIntoGPR(destination); - break; - - default: - RELEASE_ASSERT_NOT_REACHED(); - break; - } - - reboxAccordingToFormat(format, m_jit, destination, scratch1, scratch2); -} - -} } // namespace JSC::FTL - -#endif // ENABLE(FTL_JIT) - diff --git a/JavaScriptCore/ftl/FTLCArgumentGetter.h b/JavaScriptCore/ftl/FTLCArgumentGetter.h deleted file mode 100644 index 0944fa53..00000000 --- a/JavaScriptCore/ftl/FTLCArgumentGetter.h +++ /dev/null @@ -1,151 +0,0 @@ -/* - * Copyright (C) 2013 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. - */ - -#ifndef FTLCArgumentGetter_h -#define FTLCArgumentGetter_h - -#include - -#if ENABLE(FTL_JIT) - -#include "AssemblyHelpers.h" -#include "FTLValueFormat.h" - -namespace JSC { namespace FTL { - -// This currently only understands how to get arguments on X86-64 cdecl. This is also -// not particularly efficient. It will generate some redundant moves. - -template -bool isArgumentRegister(typename RegisterKind::RegisterType reg) -{ - for (unsigned i = 0; i < RegisterKind::numberOfArgumentRegisters; ++i) { - if (RegisterKind::toArgumentRegister(i) == reg) - return true; - } - return false; -} - -class CArgumentGetter { -public: - // Peek offset is the number of things on the stack below the first argument. - // It will be 1 if you haven't pushed or popped after the call; i.e. the only - // thing is the return address. - CArgumentGetter(AssemblyHelpers& jit, int peekOffset = 1) - : m_jit(jit) - , m_peekOffset(peekOffset) - , m_gprArgumentIndex(0) - , m_fprArgumentIndex(0) - , m_stackArgumentIndex(0) - { - } - - void loadNext8(GPRReg destination) - { - ASSERT(!isArgumentRegister(destination)); - if (m_gprArgumentIndex < GPRInfo::numberOfArgumentRegisters) { - m_jit.move(GPRInfo::toArgumentRegister(m_gprArgumentIndex++), destination); - return; - } - - m_jit.load8(nextAddress(), destination); - } - - void loadNext32(GPRReg destination) - { - ASSERT(!isArgumentRegister(destination)); - if (m_gprArgumentIndex < GPRInfo::numberOfArgumentRegisters) { - m_jit.move(GPRInfo::toArgumentRegister(m_gprArgumentIndex++), destination); - return; - } - - m_jit.load32(nextAddress(), destination); - } - - void loadNext64(GPRReg destination) - { - ASSERT(!isArgumentRegister(destination)); - if (m_gprArgumentIndex < GPRInfo::numberOfArgumentRegisters) { - m_jit.move(GPRInfo::toArgumentRegister(m_gprArgumentIndex++), destination); - return; - } - - m_jit.load64(nextAddress(), destination); - } - - void loadNextPtr(GPRReg destination) - { - loadNext64(destination); - } - - void loadNextDoubleIntoGPR(GPRReg destination) - { - if (m_fprArgumentIndex < FPRInfo::numberOfArgumentRegisters) { - m_jit.moveDoubleTo64(FPRInfo::toArgumentRegister(m_fprArgumentIndex++), destination); - return; - } - - m_jit.load64(nextAddress(), destination); - } - - void loadNextDouble(FPRReg destination) - { - ASSERT( - !isArgumentRegister(destination) - || destination == FPRInfo::argumentFPR0); - - if (m_fprArgumentIndex < FPRInfo::numberOfArgumentRegisters) { - m_jit.moveDouble(FPRInfo::toArgumentRegister(m_fprArgumentIndex++), destination); - return; - } - - m_jit.loadDouble(nextAddress(), destination); - } - - void loadNextAndBox( - ValueFormat, GPRReg destination, - GPRReg scratch1 = InvalidGPRReg, GPRReg scratch2 = InvalidGPRReg); - -private: - MacroAssembler::Address nextAddress() - { - return MacroAssembler::Address( - MacroAssembler::stackPointerRegister, - (m_peekOffset + m_stackArgumentIndex++) * sizeof(void*)); - } - - AssemblyHelpers& m_jit; - unsigned m_peekOffset; - unsigned m_gprArgumentIndex; - unsigned m_fprArgumentIndex; - unsigned m_stackArgumentIndex; -}; - -} } // namespace JSC::FTL - -#endif // ENABLE(FTL_JIT) - -#endif // FTLCArgumentGetter_h - diff --git a/JavaScriptCore/ftl/FTLCapabilities.cpp b/JavaScriptCore/ftl/FTLCapabilities.cpp index be56492b..86a28cf8 100644 --- a/JavaScriptCore/ftl/FTLCapabilities.cpp +++ b/JavaScriptCore/ftl/FTLCapabilities.cpp @@ -42,7 +42,6 @@ inline CapabilityLevel canCompile(Node* node) case WeakJSConstant: case GetLocal: case SetLocal: - case MovHintAndCheck: case MovHint: case ZombieHint: case Phantom: @@ -62,6 +61,9 @@ inline CapabilityLevel canCompile(Node* node) case PutStructure: case PhantomPutStructure: case GetButterfly: + case NewObject: + case NewArray: + case NewArrayBuffer: case GetByOffset: case PutByOffset: case GetGlobalVar: @@ -88,7 +90,6 @@ inline CapabilityLevel canCompile(Node* node) case LoopHint: case Call: case Construct: - case GlobalVarWatchpoint: case GetMyScope: case SkipScope: case GetClosureRegisters: @@ -96,13 +97,33 @@ inline CapabilityLevel canCompile(Node* node) case PutClosureVar: case Int52ToValue: case InvalidationPoint: + case StringCharAt: + case CheckFunction: + case StringCharCodeAt: + case AllocatePropertyStorage: + case FunctionReentryWatchpoint: + case TypedArrayWatchpoint: + case VariableWatchpoint: + case NotifyWrite: + case StoreBarrier: + case ConditionalStoreBarrier: + case StoreBarrierWithNullCheck: + case ValueToInt32: + case Branch: + case LogicalNot: + case CheckInBounds: + case ConstantStoragePointer: + case Check: // These are OK. break; case GetById: + case PutById: if (node->child1().useKind() == CellUse) break; return CannotCompile; case GetIndexedPropertyStorage: + if (node->arrayMode().type() == Array::String) + break; if (isTypedView(node->arrayMode().typedArrayType())) break; return CannotCompile; @@ -123,6 +144,7 @@ inline CapabilityLevel canCompile(Node* node) case Array::Int32: case Array::Double: case Array::Contiguous: + case Array::String: break; default: if (isTypedView(node->arrayMode().typedArrayType())) @@ -133,7 +155,8 @@ inline CapabilityLevel canCompile(Node* node) case GetByVal: switch (node->arrayMode().type()) { case Array::ForceExit: - return CanCompileAndOSREnter; + case Array::Generic: + case Array::String: case Array::Int32: case Array::Double: case Array::Contiguous: @@ -143,19 +166,13 @@ inline CapabilityLevel canCompile(Node* node) return CanCompileAndOSREnter; return CannotCompile; } - switch (node->arrayMode().speculation()) { - case Array::SaneChain: - case Array::InBounds: - break; - default: - return CannotCompile; - } break; case PutByVal: case PutByValAlias: + case PutByValDirect: switch (node->arrayMode().type()) { case Array::ForceExit: - return CanCompileAndOSREnter; + case Array::Generic: case Array::Int32: case Array::Double: case Array::Contiguous: @@ -167,6 +184,17 @@ inline CapabilityLevel canCompile(Node* node) } break; case CompareEq: + if (node->isBinaryUseKind(Int32Use)) + break; + if (node->isBinaryUseKind(MachineIntUse)) + break; + if (node->isBinaryUseKind(NumberUse)) + break; + if (node->isBinaryUseKind(ObjectUse)) + break; + if (node->isBinaryUseKind(UntypedUse)) + break; + return CannotCompile; case CompareStrictEq: if (node->isBinaryUseKind(Int32Use)) break; @@ -187,20 +215,9 @@ inline CapabilityLevel canCompile(Node* node) break; if (node->isBinaryUseKind(NumberUse)) break; - return CannotCompile; - case Branch: - case LogicalNot: - switch (node->child1().useKind()) { - case BooleanUse: - case Int32Use: - case NumberUse: - case StringUse: - case ObjectOrOtherUse: + if (node->isBinaryUseKind(UntypedUse)) break; - default: - return CannotCompile; - } - break; + return CannotCompile; case Switch: switch (node->switchData()->kind) { case SwitchImm: @@ -210,10 +227,6 @@ inline CapabilityLevel canCompile(Node* node) return CannotCompile; } break; - case ValueToInt32: - if (node->child1().useKind() != BooleanUse) - return CannotCompile; - break; default: // Don't know how to handle anything else. return CannotCompile; @@ -261,6 +274,7 @@ CapabilityLevel canCompile(Graph& graph) case ObjectUse: case ObjectOrOtherUse: case StringUse: + case FinalObjectUse: // These are OK. break; default: diff --git a/JavaScriptCore/ftl/FTLCompile.cpp b/JavaScriptCore/ftl/FTLCompile.cpp index 44873cfc..6c01f4fa 100644 --- a/JavaScriptCore/ftl/FTLCompile.cpp +++ b/JavaScriptCore/ftl/FTLCompile.cpp @@ -78,7 +78,7 @@ static uint8_t* mmAllocateDataSection( RefCountedArray section( (size + sizeof(LSectionWord) - 1) / sizeof(LSectionWord)); - if (!strcmp(sectionName, "__js_stackmaps")) + if (!strcmp(sectionName, "__llvm_stackmaps")) state.stackmapsSection = section; else { state.jitCode->addDataSection(section); @@ -106,6 +106,45 @@ static void dumpDataSection(RefCountedArray section, const char* p } } +template +void generateICFastPath( + State& state, CodeBlock* codeBlock, GeneratedFunction generatedFunction, + StackMaps::RecordMap& recordMap, DescriptorType& ic, size_t sizeOfIC) +{ + VM& vm = state.graph.m_vm; + + StackMaps::RecordMap::iterator iter = recordMap.find(ic.stackmapID()); + if (iter == recordMap.end()) { + // It was optimized out. + return; + } + + StackMaps::Record& record = iter->value; + + CCallHelpers fastPathJIT(&vm, codeBlock); + ic.m_generator.generateFastPath(fastPathJIT); + + char* startOfIC = + bitwise_cast(generatedFunction) + record.instructionOffset; + + LinkBuffer linkBuffer(vm, &fastPathJIT, startOfIC, sizeOfIC); + // Note: we could handle the !isValid() case. We just don't appear to have a + // reason to do so, yet. + RELEASE_ASSERT(linkBuffer.isValid()); + + MacroAssembler::AssemblerType_T::fillNops( + startOfIC + linkBuffer.size(), sizeOfIC - linkBuffer.size()); + + state.finalizer->sideCodeLinkBuffer->link( + ic.m_slowPathDone, CodeLocationLabel(startOfIC + sizeOfIC)); + + linkBuffer.link( + ic.m_generator.slowPathJump(), + state.finalizer->sideCodeLinkBuffer->locationOf(ic.m_generator.slowPathBegin())); + + ic.m_generator.finalize(linkBuffer, *state.finalizer->sideCodeLinkBuffer); +} + static void fixFunctionBasedOnStackMaps( State& state, CodeBlock* codeBlock, JITCode* jitCode, GeneratedFunction generatedFunction, StackMaps::RecordMap& recordMap) @@ -124,6 +163,10 @@ static void fixFunctionBasedOnStackMaps( for (unsigned i = 0; i < state.jitCode->osrExit.size(); ++i) { OSRExitCompilationInfo& info = state.finalizer->osrExit[i]; OSRExit& exit = jitCode->osrExit[i]; + + if (Options::verboseCompilation()) + dataLog("Handling OSR stackmap #", exit.m_stackmapID, " for ", exit.m_codeOrigin, "\n"); + StackMaps::RecordMap::iterator iter = recordMap.find(exit.m_stackmapID); if (iter == recordMap.end()) { // It was optimized out. @@ -138,12 +181,15 @@ static void fixFunctionBasedOnStackMaps( state.finalizer->exitThunksLinkBuffer = linkBuffer.release(); } - if (!state.getByIds.isEmpty()) { + if (!state.getByIds.isEmpty() || !state.putByIds.isEmpty()) { CCallHelpers slowPathJIT(&vm, codeBlock); for (unsigned i = state.getByIds.size(); i--;) { GetByIdDescriptor& getById = state.getByIds[i]; + if (Options::verboseCompilation()) + dataLog("Handling GetById stackmap #", getById.stackmapID(), "\n"); + StackMaps::RecordMap::iterator iter = recordMap.find(getById.stackmapID()); if (iter == recordMap.end()) { // It was optimized out. @@ -152,18 +198,16 @@ static void fixFunctionBasedOnStackMaps( StackMaps::Record& record = iter->value; - UNUSED_PARAM(record); // FIXME: use AnyRegs. - // FIXME: LLVM should tell us which registers are live. RegisterSet usedRegisters = RegisterSet::allRegisters(); - GPRReg callFrameRegister = GPRInfo::argumentGPR0; - GPRReg base = GPRInfo::argumentGPR1; - GPRReg result = GPRInfo::returnValueGPR; + GPRReg result = record.locations[0].directGPR(); + GPRReg callFrameRegister = record.locations[1].directGPR(); + GPRReg base = record.locations[2].directGPR(); JITGetByIdGenerator gen( - codeBlock, getById.codeOrigin(), usedRegisters, JSValueRegs(base), - JSValueRegs(result), false); + codeBlock, getById.codeOrigin(), usedRegisters, callFrameRegister, + JSValueRegs(base), JSValueRegs(result), false); MacroAssembler::Label begin = slowPathJIT.label(); @@ -177,40 +221,56 @@ static void fixFunctionBasedOnStackMaps( getById.m_generator = gen; } - state.finalizer->sideCodeLinkBuffer = adoptPtr( - new LinkBuffer(vm, &slowPathJIT, codeBlock, JITCompilationMustSucceed)); - - for (unsigned i = state.getByIds.size(); i--;) { - GetByIdDescriptor& getById = state.getByIds[i]; + for (unsigned i = state.putByIds.size(); i--;) { + PutByIdDescriptor& putById = state.putByIds[i]; - StackMaps::RecordMap::iterator iter = recordMap.find(getById.stackmapID()); + if (Options::verboseCompilation()) + dataLog("Handling PutById stackmap #", putById.stackmapID(), "\n"); + + StackMaps::RecordMap::iterator iter = recordMap.find(putById.stackmapID()); if (iter == recordMap.end()) { // It was optimized out. continue; } StackMaps::Record& record = iter->value; - - CCallHelpers fastPathJIT(&vm, codeBlock); - getById.m_generator.generateFastPath(fastPathJIT); - - char* startOfIC = - bitwise_cast(generatedFunction) + record.instructionOffset; - size_t sizeOfIC = sizeOfGetById(); - LinkBuffer linkBuffer(vm, &fastPathJIT, startOfIC, sizeOfIC); - // Note: we could handle the !isValid() case. We just don't appear to have a - // reason to do so, yet. - RELEASE_ASSERT(linkBuffer.isValid()); + // FIXME: LLVM should tell us which registers are live. + RegisterSet usedRegisters = RegisterSet::allRegisters(); + + GPRReg callFrameRegister = record.locations[0].directGPR(); + GPRReg base = record.locations[1].directGPR(); + GPRReg value = record.locations[2].directGPR(); + + JITPutByIdGenerator gen( + codeBlock, putById.codeOrigin(), usedRegisters, callFrameRegister, + JSValueRegs(base), JSValueRegs(value), MacroAssembler::scratchRegister, + false, putById.ecmaMode(), putById.putKind()); + + MacroAssembler::Label begin = slowPathJIT.label(); - state.finalizer->sideCodeLinkBuffer->link( - getById.m_slowPathDone, CodeLocationLabel(startOfIC + sizeOfIC)); + MacroAssembler::Call call = callOperation( + state, usedRegisters, slowPathJIT, gen.slowPathFunction(), callFrameRegister, + gen.stubInfo(), value, base, putById.uid()); - linkBuffer.link( - getById.m_generator.slowPathJump(), - state.finalizer->sideCodeLinkBuffer->locationOf(getById.m_generator.slowPathBegin())); + gen.reportSlowPathCall(begin, call); - getById.m_generator.finalize(linkBuffer, *state.finalizer->sideCodeLinkBuffer); + putById.m_slowPathDone = slowPathJIT.jump(); + putById.m_generator = gen; + } + + state.finalizer->sideCodeLinkBuffer = adoptPtr( + new LinkBuffer(vm, &slowPathJIT, codeBlock, JITCompilationMustSucceed)); + + for (unsigned i = state.getByIds.size(); i--;) { + generateICFastPath( + state, codeBlock, generatedFunction, recordMap, state.getByIds[i], + sizeOfGetById()); + } + for (unsigned i = state.putByIds.size(); i--;) { + generateICFastPath( + state, codeBlock, generatedFunction, recordMap, state.putByIds[i], + sizeOfPutById()); } } @@ -227,10 +287,15 @@ static void fixFunctionBasedOnStackMaps( StackMaps::Record& record = iter->value; - repatchBuffer.replaceWithJump( - CodeLocationLabel( - bitwise_cast(generatedFunction) + record.instructionOffset), - info.m_thunkAddress); + CodeLocationLabel source = CodeLocationLabel( + bitwise_cast(generatedFunction) + record.instructionOffset); + + if (info.m_isInvalidationPoint) { + jitCode->common.jumpReplacements.append(JumpReplacement(source, info.m_thunkAddress)); + continue; + } + + repatchBuffer.replaceWithJump(source, info.m_thunkAddress); } } @@ -255,26 +320,42 @@ void compile(State& state) CRASH(); } - LLVMPassManagerBuilderRef passBuilder = llvm->PassManagerBuilderCreate(); - llvm->PassManagerBuilderSetOptLevel(passBuilder, Options::llvmOptimizationLevel()); - llvm->PassManagerBuilderSetSizeLevel(passBuilder, Options::llvmSizeLevel()); - - LLVMPassManagerRef functionPasses = llvm->CreateFunctionPassManagerForModule(state.module); - LLVMPassManagerRef modulePasses = llvm->CreatePassManager(); - - llvm->AddTargetData(llvm->GetExecutionEngineTargetData(engine), modulePasses); - - llvm->PassManagerBuilderPopulateFunctionPassManager(passBuilder, functionPasses); - llvm->PassManagerBuilderPopulateModulePassManager(passBuilder, modulePasses); - - llvm->PassManagerBuilderDispose(passBuilder); - - llvm->InitializeFunctionPassManager(functionPasses); - for (LValue function = llvm->GetFirstFunction(state.module); function; function = llvm->GetNextFunction(function)) - llvm->RunFunctionPassManager(functionPasses, function); - llvm->FinalizeFunctionPassManager(functionPasses); + LLVMPassManagerRef functionPasses = 0; + LLVMPassManagerRef modulePasses; - llvm->RunPassManager(modulePasses, state.module); + if (Options::llvmSimpleOpt()) { + modulePasses = llvm->CreatePassManager(); + llvm->AddTargetData(llvm->GetExecutionEngineTargetData(engine), modulePasses); + llvm->AddPromoteMemoryToRegisterPass(modulePasses); + llvm->AddConstantPropagationPass(modulePasses); + llvm->AddInstructionCombiningPass(modulePasses); + llvm->AddBasicAliasAnalysisPass(modulePasses); + llvm->AddTypeBasedAliasAnalysisPass(modulePasses); + llvm->AddGVNPass(modulePasses); + llvm->AddCFGSimplificationPass(modulePasses); + llvm->RunPassManager(modulePasses, state.module); + } else { + LLVMPassManagerBuilderRef passBuilder = llvm->PassManagerBuilderCreate(); + llvm->PassManagerBuilderSetOptLevel(passBuilder, Options::llvmOptimizationLevel()); + llvm->PassManagerBuilderSetSizeLevel(passBuilder, Options::llvmSizeLevel()); + + functionPasses = llvm->CreateFunctionPassManagerForModule(state.module); + modulePasses = llvm->CreatePassManager(); + + llvm->AddTargetData(llvm->GetExecutionEngineTargetData(engine), modulePasses); + + llvm->PassManagerBuilderPopulateFunctionPassManager(passBuilder, functionPasses); + llvm->PassManagerBuilderPopulateModulePassManager(passBuilder, modulePasses); + + llvm->PassManagerBuilderDispose(passBuilder); + + llvm->InitializeFunctionPassManager(functionPasses); + for (LValue function = llvm->GetFirstFunction(state.module); function; function = llvm->GetNextFunction(function)) + llvm->RunFunctionPassManager(functionPasses, function); + llvm->FinalizeFunctionPassManager(functionPasses); + + llvm->RunPassManager(modulePasses, state.module); + } if (DFG::shouldShowDisassembly() || DFG::verboseCompilationEnabled()) state.dumpState("after optimization"); @@ -282,7 +363,8 @@ void compile(State& state) // FIXME: Need to add support for the case where JIT memory allocation failed. // https://bugs.webkit.org/show_bug.cgi?id=113620 state.generatedFunction = reinterpret_cast(llvm->GetPointerToGlobal(engine, state.function)); - llvm->DisposePassManager(functionPasses); + if (functionPasses) + llvm->DisposePassManager(functionPasses); llvm->DisposePassManager(modulePasses); llvm->DisposeExecutionEngine(engine); diff --git a/JavaScriptCore/ftl/FTLExitThunkGenerator.cpp b/JavaScriptCore/ftl/FTLExitThunkGenerator.cpp index 6037c302..86c87230 100644 --- a/JavaScriptCore/ftl/FTLExitThunkGenerator.cpp +++ b/JavaScriptCore/ftl/FTLExitThunkGenerator.cpp @@ -51,10 +51,7 @@ void ExitThunkGenerator::emitThunk(unsigned index) OSRExitCompilationInfo& info = m_state.finalizer->osrExit[index]; info.m_thunkLabel = label(); - if (Options::ftlUsesStackmaps()) - push(TrustedImm32(index)); - else - move(TrustedImm32(index), GPRInfo::nonArgGPR0); + push(TrustedImm32(index)); info.m_thunkJump = patchableJump(); m_didThings = true; diff --git a/JavaScriptCore/ftl/FTLExitValue.cpp b/JavaScriptCore/ftl/FTLExitValue.cpp index 95dc82cb..a987c60c 100644 --- a/JavaScriptCore/ftl/FTLExitValue.cpp +++ b/JavaScriptCore/ftl/FTLExitValue.cpp @@ -48,16 +48,16 @@ void ExitValue::dumpInContext(PrintStream& out, DumpContext* context) const out.print("Constant(", inContext(constant(), context), ")"); return; case ExitValueInJSStack: - out.print("InJSStack"); + out.print("InJSStack:r", virtualRegister()); return; case ExitValueInJSStackAsInt32: - out.print("InJSStackAsInt32"); + out.print("InJSStackAsInt32:r", virtualRegister()); return; case ExitValueInJSStackAsInt52: - out.print("InJSStackAsInt52"); + out.print("InJSStackAsInt52:r", virtualRegister()); return; case ExitValueInJSStackAsDouble: - out.print("InJSStackAsDouble"); + out.print("InJSStackAsDouble:r", virtualRegister()); return; } diff --git a/JavaScriptCore/ftl/FTLFormattedValue.h b/JavaScriptCore/ftl/FTLFormattedValue.h index 81743efe..b7ab3616 100644 --- a/JavaScriptCore/ftl/FTLFormattedValue.h +++ b/JavaScriptCore/ftl/FTLFormattedValue.h @@ -72,7 +72,6 @@ class FormattedValue { static inline FormattedValue noValue() { return FormattedValue(); } static inline FormattedValue int32Value(LValue value) { return FormattedValue(ValueFormatInt32, value); } -static inline FormattedValue uInt32Value(LValue value) { return FormattedValue(ValueFormatUInt32, value); } static inline FormattedValue booleanValue(LValue value) { return FormattedValue(ValueFormatBoolean, value); } static inline FormattedValue jsValueValue(LValue value) { return FormattedValue(ValueFormatJSValue, value); } static inline FormattedValue doubleValue(LValue value) { return FormattedValue(ValueFormatDouble, value); } diff --git a/JavaScriptCore/ftl/FTLInlineCacheDescriptor.h b/JavaScriptCore/ftl/FTLInlineCacheDescriptor.h index 06e796a9..34fb3d5d 100644 --- a/JavaScriptCore/ftl/FTLInlineCacheDescriptor.h +++ b/JavaScriptCore/ftl/FTLInlineCacheDescriptor.h @@ -39,14 +39,7 @@ class InlineCacheDescriptor { public: InlineCacheDescriptor() { } - MacroAssembler::Jump m_slowPathDone; -}; - -class GetByIdDescriptor : public InlineCacheDescriptor { -public: - GetByIdDescriptor() { } - - GetByIdDescriptor(unsigned stackmapID, CodeOrigin codeOrigin, StringImpl* uid) + InlineCacheDescriptor(unsigned stackmapID, CodeOrigin codeOrigin, StringImpl* uid) : m_stackmapID(stackmapID) , m_codeOrigin(codeOrigin) , m_uid(uid) @@ -61,11 +54,46 @@ class GetByIdDescriptor : public InlineCacheDescriptor { unsigned m_stackmapID; CodeOrigin m_codeOrigin; StringImpl* m_uid; + +public: + MacroAssembler::Jump m_slowPathDone; +}; +class GetByIdDescriptor : public InlineCacheDescriptor { public: + GetByIdDescriptor() { } + + GetByIdDescriptor(unsigned stackmapID, CodeOrigin codeOrigin, StringImpl* uid) + : InlineCacheDescriptor(stackmapID, codeOrigin, uid) + { + } + JITGetByIdGenerator m_generator; }; +class PutByIdDescriptor : public InlineCacheDescriptor { +public: + PutByIdDescriptor() { } + + PutByIdDescriptor( + unsigned stackmapID, CodeOrigin codeOrigin, StringImpl* uid, + ECMAMode ecmaMode, PutKind putKind) + : InlineCacheDescriptor(stackmapID, codeOrigin, uid) + , m_ecmaMode(ecmaMode) + , m_putKind(putKind) + { + } + + JITPutByIdGenerator m_generator; + + ECMAMode ecmaMode() const { return m_ecmaMode; } + PutKind putKind() const { return m_putKind; } + +private: + ECMAMode m_ecmaMode; + PutKind m_putKind; +}; + } } // namespace JSC::FTL #endif // ENABLE(FTL_JIT) diff --git a/JavaScriptCore/ftl/FTLInlineCacheSize.cpp b/JavaScriptCore/ftl/FTLInlineCacheSize.cpp index b5681358..82d4be56 100644 --- a/JavaScriptCore/ftl/FTLInlineCacheSize.cpp +++ b/JavaScriptCore/ftl/FTLInlineCacheSize.cpp @@ -33,37 +33,18 @@ namespace JSC { namespace FTL { -static size_t s_sizeOfGetById; -static size_t s_sizeOfPutById; +// These sizes are x86-64-specific, and were found empirically. They have to cover the worst +// possible combination of registers leading to the largest possible encoding of each +// instruction in the IC. size_t sizeOfGetById() { - if (s_sizeOfGetById) - return s_sizeOfGetById; - - MacroAssembler jit; - - JITGetByIdGenerator generator( - 0, CodeOrigin(), RegisterSet(), JSValueRegs(GPRInfo::regT6), JSValueRegs(GPRInfo::regT7), - false); - generator.generateFastPath(jit); - - return s_sizeOfGetById = jit.m_assembler.codeSize(); + return 30; } size_t sizeOfPutById() { - if (s_sizeOfPutById) - return s_sizeOfPutById; - - MacroAssembler jit; - - JITPutByIdGenerator generator( - 0, CodeOrigin(), RegisterSet(), JSValueRegs(GPRInfo::regT6), JSValueRegs(GPRInfo::regT7), - GPRInfo::regT8, false, NotStrictMode, NotDirect); - generator.generateFastPath(jit); - - return s_sizeOfPutById = jit.m_assembler.codeSize(); + return 32; } } } // namespace JSC::FTL diff --git a/JavaScriptCore/ftl/FTLIntrinsicRepository.h b/JavaScriptCore/ftl/FTLIntrinsicRepository.h index 4ddbb0ec..7f560dd9 100644 --- a/JavaScriptCore/ftl/FTLIntrinsicRepository.h +++ b/JavaScriptCore/ftl/FTLIntrinsicRepository.h @@ -42,20 +42,37 @@ namespace JSC { namespace FTL { macro(doubleAbs, "llvm.fabs.f64", functionType(doubleType, doubleType)) \ macro(mulWithOverflow32, "llvm.smul.with.overflow.i32", functionType(structType(m_context, int32, boolean), int32, int32)) \ macro(mulWithOverflow64, "llvm.smul.with.overflow.i64", functionType(structType(m_context, int64, boolean), int64, int64)) \ + macro(patchpointInt64, "llvm.experimental.patchpoint.i64", functionType(int64, int32, int32, ref8, int32, Variadic)) \ + macro(patchpointVoid, "llvm.experimental.patchpoint.void", functionType(voidType, int32, int32, ref8, int32, Variadic)) \ + macro(stackmap, "llvm.experimental.stackmap", functionType(voidType, int32, int32, Variadic)) \ macro(subWithOverflow32, "llvm.ssub.with.overflow.i32", functionType(structType(m_context, int32, boolean), int32, int32)) \ macro(subWithOverflow64, "llvm.ssub.with.overflow.i64", functionType(structType(m_context, int64, boolean), int64, int64)) \ - macro(webkitPatchpointInt64, "llvm.webkit.patchpoint.i64", functionType(int64, int32, int32, ref8, int32, Variadic)) \ - macro(webkitStackmap, "llvm.webkit.stackmap", functionType(voidType, int32, int32, Variadic)) \ macro(trap, "llvm.trap", functionType(voidType)) \ - macro(osrExit, "webkit_osr_exit", functionType(voidType, boolean, int32, Variadic)) + macro(x86SSE2CvtTSD2SI, "llvm.x86.sse2.cvttsd2si", functionType(int32, vectorType(doubleType, 2))) #define FOR_EACH_FUNCTION_TYPE(macro) \ + macro(C_JITOperation_ESt, functionType(intPtr, intPtr, intPtr)) \ macro(I_JITOperation_EJss, functionType(intPtr, intPtr, intPtr)) \ macro(J_JITOperation_E, functionType(int64, intPtr)) \ + macro(J_JITOperation_EAZ, functionType(int64, intPtr, intPtr, int32)) \ + macro(J_JITOperation_EJJ, functionType(int64, intPtr, int64, int64)) \ + macro(J_JITOperation_EJssZ, functionType(int64, intPtr, intPtr, int32)) \ macro(J_JITOperation_ESsiJI, functionType(int64, intPtr, intPtr, int64, intPtr)) \ + macro(Jss_JITOperation_EZ, functionType(intPtr, intPtr, int32)) \ + macro(P_JITOperation_E, functionType(intPtr, intPtr)) \ macro(P_JITOperation_EC, functionType(intPtr, intPtr, intPtr)) \ + macro(P_JITOperation_EO, functionType(intPtr, intPtr, intPtr)) \ + macro(P_JITOperation_ESt, functionType(intPtr, intPtr, intPtr)) \ + macro(P_JITOperation_EStPS, functionType(intPtr, intPtr, intPtr, intPtr, intPtr)) \ + macro(P_JITOperation_EStSS, functionType(intPtr, intPtr, intPtr, intPtr, intPtr)) \ + macro(P_JITOperation_EStZ, functionType(intPtr, intPtr, intPtr, int32)) \ + macro(S_JITOperation_EJ, functionType(intPtr, intPtr, int64)) \ + macro(S_JITOperation_EJJ, functionType(intPtr, intPtr, int64, int64)) \ + macro(V_JITOperation_EJJJ, functionType(voidType, intPtr, int64, int64, int64)) \ macro(V_JITOperation_EOZD, functionType(voidType, intPtr, intPtr, int32, doubleType)) \ macro(V_JITOperation_EOZJ, functionType(voidType, intPtr, intPtr, int32, int64)) \ + macro(V_JITOperation_EC, functionType(voidType, intPtr, intPtr)) \ + macro(V_JITOperation_EVws, functionType(voidType, intPtr, intPtr)) \ macro(Z_JITOperation_D, functionType(int32, doubleType)) class IntrinsicRepository : public CommonValues { diff --git a/JavaScriptCore/ftl/FTLJITFinalizer.cpp b/JavaScriptCore/ftl/FTLJITFinalizer.cpp index 178fd276..a8a99b63 100644 --- a/JavaScriptCore/ftl/FTLJITFinalizer.cpp +++ b/JavaScriptCore/ftl/FTLJITFinalizer.cpp @@ -75,7 +75,7 @@ bool JITFinalizer::finalizeFunction() CodeLocationLabel( m_plan.vm.ftlThunks->getOSRExitGenerationThunk( m_plan.vm, Location::forStackmaps( - jitCode->stackmaps, iter->value.locations[0])).code())); + &jitCode->stackmaps, iter->value.locations[0])).code())); } jitCode->initializeExitThunks( diff --git a/JavaScriptCore/ftl/FTLLink.cpp b/JavaScriptCore/ftl/FTLLink.cpp index 3c095bdc..85050d15 100644 --- a/JavaScriptCore/ftl/FTLLink.cpp +++ b/JavaScriptCore/ftl/FTLLink.cpp @@ -57,6 +57,9 @@ void link(State& state) // LLVM will create its own jump tables as needed. codeBlock->clearSwitchJumpTables(); + state.jitCode->common.frameRegisterCount = state.graph.frameRegisterCount(); + state.jitCode->common.requiredRegisterCountForExit = state.graph.requiredRegisterCountForExit(); + if (!state.graph.m_inlineCallFrames->isEmpty()) state.jitCode->common.inlineCallFrames = std::move(state.graph.m_inlineCallFrames); @@ -80,11 +83,11 @@ void link(State& state) // Plant a check that sufficient space is available in the JSStack. // FIXME: https://bugs.webkit.org/show_bug.cgi?id=56291 jit.addPtr( - CCallHelpers::TrustedImm32(virtualRegisterForLocal(codeBlock->m_numCalleeRegisters).offset() * sizeof(Register)), + CCallHelpers::TrustedImm32(virtualRegisterForLocal(state.jitCode->common.requiredRegisterCountForExit).offset() * sizeof(Register)), GPRInfo::callFrameRegister, GPRInfo::regT1); CCallHelpers::Jump stackCheck = jit.branchPtr( CCallHelpers::Above, - CCallHelpers::AbsoluteAddress(state.graph.m_vm.interpreter->stack().addressOfEnd()), + CCallHelpers::AbsoluteAddress(state.graph.m_vm.addressOfJSStackLimit()), GPRInfo::regT1); CCallHelpers::Label fromStackCheck = jit.label(); diff --git a/JavaScriptCore/ftl/FTLLocation.cpp b/JavaScriptCore/ftl/FTLLocation.cpp index 5805ad12..a8ed642e 100644 --- a/JavaScriptCore/ftl/FTLLocation.cpp +++ b/JavaScriptCore/ftl/FTLLocation.cpp @@ -35,13 +35,15 @@ namespace JSC { namespace FTL { -Location Location::forStackmaps(const StackMaps& stackmaps, const StackMaps::Location& location) +Location Location::forStackmaps(const StackMaps* stackmaps, const StackMaps::Location& location) { switch (location.kind) { case StackMaps::Location::Unprocessed: - return Location(); + RELEASE_ASSERT_NOT_REACHED(); + break; case StackMaps::Location::Register: + case StackMaps::Location::Direct: return forRegister(location.dwarfRegNum, location.offset); case StackMaps::Location::Indirect: @@ -51,7 +53,8 @@ Location Location::forStackmaps(const StackMaps& stackmaps, const StackMaps::Loc return forConstant(location.offset); case StackMaps::Location::ConstantIndex: - return forConstant(stackmaps.constants[location.offset].integer); + ASSERT(stackmaps); + return forConstant(stackmaps->constants[location.offset].integer); } RELEASE_ASSERT_NOT_REACHED(); @@ -89,7 +92,7 @@ GPRReg Location::gpr() const // for example, the architecture encodes CX as 1 and DX as 2 while Dwarf does the // opposite. Hence we need the switch. - ASSERT(involvesGPR()); + RELEASE_ASSERT(involvesGPR()); switch (dwarfRegNum()) { case 0: @@ -122,16 +125,31 @@ bool Location::isFPR() const FPRReg Location::fpr() const { - ASSERT(isFPR()); + RELEASE_ASSERT(isFPR()); return static_cast(dwarfRegNum() - 17); } -void Location::restoreInto(MacroAssembler& jit, char* savedRegisters, GPRReg result) const +void Location::restoreInto(MacroAssembler& jit, char* savedRegisters, GPRReg result, unsigned numFramesToPop) const { + if (involvesGPR() && MacroAssembler::isStackRelated(gpr())) { + // Make the result GPR contain the appropriate stack register. + if (numFramesToPop) { + jit.move(MacroAssembler::framePointerRegister, result); + + for (unsigned i = numFramesToPop - 1; i--;) + jit.loadPtr(result, result); + + if (gpr() == MacroAssembler::framePointerRegister) + jit.loadPtr(result, result); + else + jit.addPtr(MacroAssembler::TrustedImmPtr(sizeof(void*) * 2), result); + } else + jit.move(gpr(), result); + } + if (isGPR()) { if (MacroAssembler::isStackRelated(gpr())) { - // These don't get saved. - jit.move(gpr(), result); + // Already restored into result. } else jit.load64(savedRegisters + offsetOfGPR(gpr()), result); @@ -154,8 +172,8 @@ void Location::restoreInto(MacroAssembler& jit, char* savedRegisters, GPRReg res case Indirect: if (MacroAssembler::isStackRelated(gpr())) { - // These don't get saved. - jit.load64(MacroAssembler::Address(gpr(), offset()), result); + // The stack register is already recovered into result. + jit.load64(MacroAssembler::Address(result, offset()), result); return; } @@ -182,7 +200,7 @@ void Location::restoreInto(MacroAssembler& jit, char* savedRegisters, GPRReg res GPRReg Location::directGPR() const { - ASSERT(!addend()); + RELEASE_ASSERT(!addend()); return gpr(); } diff --git a/JavaScriptCore/ftl/FTLLocation.h b/JavaScriptCore/ftl/FTLLocation.h index de5a44de..90f5dded 100644 --- a/JavaScriptCore/ftl/FTLLocation.h +++ b/JavaScriptCore/ftl/FTLLocation.h @@ -84,7 +84,9 @@ class Location { return result; } - static Location forStackmaps(const StackMaps&, const StackMaps::Location&); + // You can pass a null StackMaps if you are confident that the location doesn't + // involve a wide constant. + static Location forStackmaps(const StackMaps*, const StackMaps::Location&); Kind kind() const { return m_kind; } @@ -166,10 +168,10 @@ class Location { // to FTLSaveRestore convention, this loads the value into the given register. // The code that this generates isn't exactly super fast. This assumes that FP // and SP contain the same values that they would have contained in the original - // frame. If we did push things onto the stack then probably we'll have to change - // the signature of this method to take a stack offset for stack-relative - // indirects. - void restoreInto(MacroAssembler&, char* savedRegisters, GPRReg result) const; + // frame, or that you've done one or more canonically formed calls (i.e. can + // restore the FP by following the call frame linked list numFramesToPop times, + // and SP can be recovered by popping FP numFramesToPop-1 times and adding 16). + void restoreInto(MacroAssembler&, char* savedRegisters, GPRReg result, unsigned numFramesToPop = 0) const; private: Kind m_kind; diff --git a/JavaScriptCore/ftl/FTLLowerDFGToLLVM.cpp b/JavaScriptCore/ftl/FTLLowerDFGToLLVM.cpp index 362b069b..09c7e64b 100644 --- a/JavaScriptCore/ftl/FTLLowerDFGToLLVM.cpp +++ b/JavaScriptCore/ftl/FTLLowerDFGToLLVM.cpp @@ -32,14 +32,12 @@ #include "DFGAbstractInterpreterInlines.h" #include "DFGInPlaceAbstractState.h" #include "FTLAbstractHeapRepository.h" -#include "FTLExitThunkGenerator.h" #include "FTLForOSREntryJITCode.h" #include "FTLFormattedValue.h" #include "FTLInlineCacheSize.h" #include "FTLLoweredNodeValue.h" #include "FTLOutput.h" #include "FTLThunks.h" -#include "FTLValueSource.h" #include "LinkBuffer.h" #include "OperandsInlines.h" #include "Operations.h" @@ -53,11 +51,6 @@ using namespace DFG; static int compileCounter; -static bool generateExitThunks() -{ - return !Options::useLLVMOSRExitIntrinsic() && !Options::ftlUsesStackmaps(); -} - // Using this instead of typeCheck() helps to reduce the load on LLVM, by creating // significantly less dead code. #define FTL_TYPE_CHECK(lowValue, highValue, typesPassedThrough, failCondition) do { \ @@ -76,9 +69,7 @@ class LowerDFGToLLVM { , m_ftlState(state) , m_heaps(state.context) , m_out(state.context) - , m_valueSources(OperandsLike, state.graph.block(0)->variablesAtHead) - , m_lastSetOperand(VirtualRegister()) - , m_exitThunkGenerator(state) + , m_availability(OperandsLike, state.graph.block(0)->variablesAtHead) , m_state(state.graph) , m_interpreter(state.graph, m_state) , m_stackmapIDs(0) @@ -110,8 +101,6 @@ class LowerDFGToLLVM { m_out.appendTo(m_prologue); createPhiVariables(); - m_initialization = appendBasicBlock(m_ftlState.context, m_ftlState.function); - m_callFrame = m_out.param(0); m_tagTypeNumber = m_out.constInt64(TagTypeNumber); m_tagMask = m_out.constInt64(TagMask); @@ -123,14 +112,14 @@ class LowerDFGToLLVM { m_blocks.add(m_highBlock, FTL_NEW_BLOCK(m_out, ("Block ", *m_highBlock))); } + m_out.appendTo(m_prologue); + m_out.jump(lowBlock(m_graph.block(0))); + Vector depthFirst; m_graph.getBlocksInDepthFirstOrder(depthFirst); for (unsigned i = 0; i < depthFirst.size(); ++i) compileBlock(depthFirst[i]); - // And now complete the initialization block. - linkOSRExitsAndCompleteInitializationBlocks(); - if (Options::dumpLLVMIR()) dumpModule(m_ftlState.module); @@ -214,8 +203,6 @@ class LowerDFGToLLVM { initializeOSRExitStateForBlock(); - m_live = block->ssa->liveAtHead; - m_state.reset(); m_state.beginBasicBlock(m_highBlock); @@ -241,8 +228,6 @@ class LowerDFGToLLVM { bool shouldExecuteEffects = m_interpreter.startExecuting(m_node); - m_direction = (m_node->flags() & NodeExitsForward) ? ForwardSpeculation : BackwardSpeculation; - switch (m_node->op()) { case Upsilon: compileUpsilon(); @@ -273,19 +258,13 @@ class LowerDFGToLLVM { case ZombieHint: compileZombieHint(); break; - case MovHintAndCheck: - compileMovHintAndCheck(); - break; case Phantom: compilePhantom(); break; - case Flush: - case PhantomLocal: - case SetArgument: - case LoopHint: + case ValueAdd: + compileValueAdd(); break; case ArithAdd: - case ValueAdd: compileAddSub(); break; case ArithSub: @@ -340,6 +319,9 @@ class LowerDFGToLLVM { case StructureTransitionWatchpoint: compileStructureTransitionWatchpoint(); break; + case CheckFunction: + compileCheckFunction(); + break; case ArrayifyToStructure: compileArrayifyToStructure(); break; @@ -352,9 +334,15 @@ class LowerDFGToLLVM { case GetById: compileGetById(); break; + case PutById: + compilePutById(); + break; case GetButterfly: compileGetButterfly(); break; + case ConstantStoragePointer: + compileConstantStoragePointer(); + break; case GetIndexedPropertyStorage: compileGetIndexedPropertyStorage(); break; @@ -364,13 +352,35 @@ class LowerDFGToLLVM { case GetArrayLength: compileGetArrayLength(); break; + case CheckInBounds: + compileCheckInBounds(); + break; case GetByVal: compileGetByVal(); break; case PutByVal: case PutByValAlias: + case PutByValDirect: compilePutByVal(); break; + case NewObject: + compileNewObject(); + break; + case NewArray: + compileNewArray(); + break; + case NewArrayBuffer: + compileNewArrayBuffer(); + break; + case AllocatePropertyStorage: + compileAllocatePropertyStorage(); + break; + case StringCharAt: + compileStringCharAt(); + break; + case StringCharCodeAt: + compileStringCharCodeAt(); + break; case GetByOffset: compileGetByOffset(); break; @@ -383,8 +393,8 @@ class LowerDFGToLLVM { case PutGlobalVar: compilePutGlobalVar(); break; - case GlobalVarWatchpoint: - compileGlobalVarWatchpoint(); + case NotifyWrite: + compileNotifyWrite(); break; case GetMyScope: compileGetMyScope(); @@ -456,17 +466,28 @@ class LowerDFGToLLVM { case Int52ToValue: compileInt52ToValue(); break; + case StoreBarrier: + compileStoreBarrier(); + break; + case ConditionalStoreBarrier: + compileConditionalStoreBarrier(); + break; + case StoreBarrierWithNullCheck: + compileStoreBarrierWithNullCheck(); + break; + case Flush: + case PhantomLocal: + case SetArgument: + case LoopHint: + case VariableWatchpoint: + case FunctionReentryWatchpoint: + case TypedArrayWatchpoint: + break; default: RELEASE_ASSERT_NOT_REACHED(); break; } - if (m_node->shouldGenerate()) - DFG_NODE_DO_TO_CHILDREN(m_graph, m_node, use); - - if (m_node->adjustedRefCount()) - m_live.add(m_node); - if (shouldExecuteEffects) m_interpreter.executeEffects(nodeIndex); @@ -475,8 +496,96 @@ class LowerDFGToLLVM { void compileValueToInt32() { - ASSERT(m_node->child1().useKind() == BooleanUse); - setInt32(m_out.zeroExt(lowBoolean(m_node->child1()), m_out.int32)); + switch (m_node->child1().useKind()) { + case Int32Use: + setInt32(lowInt32(m_node->child1())); + break; + + case MachineIntUse: + setInt32(m_out.castToInt32(lowStrictInt52(m_node->child1()))); + break; + + case NumberUse: + case NotCellUse: { + LoweredNodeValue value = m_int32Values.get(m_node->child1().node()); + if (isValid(value)) { + setInt32(value.value()); + break; + } + + value = m_jsValueValues.get(m_node->child1().node()); + if (isValid(value)) { + LBasicBlock intCase = FTL_NEW_BLOCK(m_out, ("ValueToInt32 int case")); + LBasicBlock notIntCase = FTL_NEW_BLOCK(m_out, ("ValueToInt32 not int case")); + LBasicBlock doubleCase = 0; + LBasicBlock notNumberCase = 0; + if (m_node->child1().useKind() == NotCellUse) { + doubleCase = FTL_NEW_BLOCK(m_out, ("ValueToInt32 double case")); + notNumberCase = FTL_NEW_BLOCK(m_out, ("ValueToInt32 not number case")); + } + LBasicBlock continuation = FTL_NEW_BLOCK(m_out, ("ValueToInt32 continuation")); + + Vector results; + + m_out.branch(isNotInt32(value.value()), notIntCase, intCase); + + LBasicBlock lastNext = m_out.appendTo(intCase, notIntCase); + results.append(m_out.anchor(unboxInt32(value.value()))); + m_out.jump(continuation); + + if (m_node->child1().useKind() == NumberUse) { + m_out.appendTo(notIntCase, continuation); + FTL_TYPE_CHECK( + jsValueValue(value.value()), m_node->child1(), SpecFullNumber, + isCellOrMisc(value.value())); + results.append(m_out.anchor(doubleToInt32(unboxDouble(value.value())))); + m_out.jump(continuation); + } else { + m_out.appendTo(notIntCase, doubleCase); + m_out.branch(isCellOrMisc(value.value()), notNumberCase, doubleCase); + + m_out.appendTo(doubleCase, notNumberCase); + results.append(m_out.anchor(doubleToInt32(unboxDouble(value.value())))); + m_out.jump(continuation); + + m_out.appendTo(notNumberCase, continuation); + + FTL_TYPE_CHECK( + jsValueValue(value.value()), m_node->child1(), ~SpecCell, + isCell(value.value())); + + LValue specialResult = m_out.select( + m_out.equal( + value.value(), + m_out.constInt64(JSValue::encode(jsBoolean(true)))), + m_out.int32One, m_out.int32Zero); + results.append(m_out.anchor(specialResult)); + m_out.jump(continuation); + } + + m_out.appendTo(continuation, lastNext); + setInt32(m_out.phi(m_out.int32, results)); + break; + } + + value = m_doubleValues.get(m_node->child1().node()); + if (isValid(value)) { + setInt32(doubleToInt32(value.value())); + break; + } + + terminate(Uncountable); + break; + } + + case BooleanUse: + setInt32(m_out.zeroExt(lowBoolean(m_node->child1()), m_out.int32)); + break; + + default: + RELEASE_ASSERT_NOT_REACHED(); + break; + } } void compileInt52ToValue() @@ -484,6 +593,34 @@ class LowerDFGToLLVM { setJSValue(lowJSValue(m_node->child1())); } + void compileStoreBarrier() + { + emitStoreBarrier(lowCell(m_node->child1())); + } + + void compileConditionalStoreBarrier() + { + LValue base = lowCell(m_node->child1()); + LValue value = lowJSValue(m_node->child2()); + emitStoreBarrier(base, value, m_node->child2()); + } + + void compileStoreBarrierWithNullCheck() + { +#if ENABLE(GGC) + LBasicBlock isNotNull = FTL_NEW_BLOCK(m_out, ("Store barrier with null check value not null")); + LBasicBlock continuation = FTL_NEW_BLOCK(m_out, ("Store barrier continuation")); + + LValue base = lowJSValue(m_node->child1()); + m_out.branch(m_out.isZero64(base), continuation, isNotNull); + LBasicBlock lastNext = m_out.appendTo(isNotNull, continuation); + emitStoreBarrier(base); + m_out.appendTo(continuation, lastNext); +#else + speculate(m_node->child1()); +#endif + } + void compileUpsilon() { LValue destination = m_phis.get(m_node->phi()); @@ -539,15 +676,6 @@ class LowerDFGToLLVM { } } - void compileJSConstant() - { - JSValue value = m_graph.valueOfJSConstant(m_node); - if (value.isDouble()) - setDouble(m_out.constDouble(value.asDouble())); - else - setJSValue(m_out.constInt64(JSValue::encode(value))); - } - void compileWeakJSConstant() { setJSValue(weakPointer(m_node->weakConstant())); @@ -563,15 +691,15 @@ class LowerDFGToLLVM { switch (useKindFor(variable->flushFormat())) { case Int32Use: - speculateBackward(BadType, jsValueValue(jsValue), m_node, isNotInt32(jsValue)); + speculate(BadType, jsValueValue(jsValue), m_node, isNotInt32(jsValue)); setInt32(unboxInt32(jsValue)); break; case CellUse: - speculateBackward(BadType, jsValueValue(jsValue), m_node, isNotCell(jsValue)); + speculate(BadType, jsValueValue(jsValue), m_node, isNotCell(jsValue)); setJSValue(jsValue); break; case BooleanUse: - speculateBackward(BadType, jsValueValue(jsValue), m_node, isNotBoolean(jsValue)); + speculate(BadType, jsValueValue(jsValue), m_node, isNotBoolean(jsValue)); setBoolean(unboxBoolean(jsValue)); break; case UntypedUse: @@ -607,43 +735,36 @@ class LowerDFGToLLVM { void compileSetLocal() { - observeMovHint(m_node); - VariableAccessData* variable = m_node->variableAccessData(); switch (variable->flushFormat()) { case FlushedJSValue: { LValue value = lowJSValue(m_node->child1()); m_out.store64(value, addressFor(variable->machineLocal())); - m_valueSources.operand(variable->local()) = ValueSource(ValueInJSStack, variable->machineLocal()); - return; + break; } case FlushedDouble: { LValue value = lowDouble(m_node->child1()); m_out.storeDouble(value, addressFor(variable->machineLocal())); - m_valueSources.operand(variable->local()) = ValueSource(DoubleInJSStack, variable->machineLocal()); - return; + break; } case FlushedInt32: { LValue value = lowInt32(m_node->child1()); m_out.store32(value, payloadFor(variable->machineLocal())); - m_valueSources.operand(variable->local()) = ValueSource(Int32InJSStack, variable->machineLocal()); - return; + break; } case FlushedInt52: { LValue value = lowInt52(m_node->child1()); m_out.store64(value, addressFor(variable->machineLocal())); - m_valueSources.operand(variable->local()) = ValueSource(Int52InJSStack, variable->machineLocal()); - return; + break; } case FlushedCell: { LValue value = lowCell(m_node->child1()); m_out.store64(value, addressFor(variable->machineLocal())); - m_valueSources.operand(variable->local()) = ValueSource(ValueInJSStack, variable->machineLocal()); - return; + break; } case FlushedBoolean: { @@ -651,38 +772,47 @@ class LowerDFGToLLVM { m_out.store64( lowJSValue(m_node->child1(), ManualOperandSpeculation), addressFor(variable->machineLocal())); - m_valueSources.operand(variable->local()) = ValueSource(ValueInJSStack, variable->machineLocal()); - return; + break; } - case DeadFlush: + default: RELEASE_ASSERT_NOT_REACHED(); + break; } - RELEASE_ASSERT_NOT_REACHED(); + m_availability.operand(variable->local()) = Availability(variable->flushedAt()); } void compileMovHint() { - observeMovHint(m_node); + ASSERT(m_node->containsMovHint()); + ASSERT(m_node->op() != ZombieHint); + + VirtualRegister operand = m_node->unlinkedLocal(); + m_availability.operand(operand) = Availability(m_node->child1().node()); } void compileZombieHint() { - VariableAccessData* data = m_node->variableAccessData(); - m_lastSetOperand = data->local(); - m_valueSources.operand(data->local()) = ValueSource(SourceIsDead); + m_availability.operand(m_node->unlinkedLocal()) = Availability::unavailable(); } - void compileMovHintAndCheck() + void compilePhantom() { - observeMovHint(m_node); - speculate(m_node->child1()); + DFG_NODE_DO_TO_CHILDREN(m_graph, m_node, speculate); } - void compilePhantom() + void compileValueAdd() { - DFG_NODE_DO_TO_CHILDREN(m_graph, m_node, speculate); + J_JITOperation_EJJ operation; + if (!(m_state.forNode(m_node->child1()).m_type & SpecFullNumber) + && !(m_state.forNode(m_node->child2()).m_type & SpecFullNumber)) + operation = operationValueAddNotNumber; + else + operation = operationValueAdd; + setJSValue(vmCall( + m_out.operation(operation), m_callFrame, + lowJSValue(m_node->child1()), lowJSValue(m_node->child2()))); } void compileAddSub() @@ -694,7 +824,7 @@ class LowerDFGToLLVM { LValue right = lowInt32(m_node->child2()); LValue result = isSub ? m_out.sub(left, right) : m_out.add(left, right); - if (bytecodeCanTruncateInteger(m_node->arithNodeFlags())) { + if (!shouldCheckOverflow(m_node->arithMode())) { setInt32(result); break; } @@ -748,12 +878,12 @@ class LowerDFGToLLVM { LValue right = lowInt32(m_node->child2()); LValue result = m_out.mul(left, right); - if (!bytecodeCanTruncateInteger(m_node->arithNodeFlags())) { + if (shouldCheckOverflow(m_node->arithMode())) { LValue overflowResult = m_out.mulWithOverflow32(left, right); speculate(Overflow, noValue(), 0, m_out.extractValue(overflowResult, 1)); } - if (!bytecodeCanIgnoreNegativeZero(m_node->arithNodeFlags())) { + if (shouldCheckNegativeZero(m_node->arithMode())) { LBasicBlock slowCase = FTL_NEW_BLOCK(m_out, ("ArithMul slow case")); LBasicBlock continuation = FTL_NEW_BLOCK(m_out, ("ArithMul continuation")); @@ -780,7 +910,7 @@ class LowerDFGToLLVM { LValue overflowResult = m_out.mulWithOverflow64(left, right); speculate(Int52Overflow, noValue(), 0, m_out.extractValue(overflowResult, 1)); - if (!bytecodeCanIgnoreNegativeZero(m_node->arithNodeFlags())) { + if (shouldCheckNegativeZero(m_node->arithMode())) { LBasicBlock slowCase = FTL_NEW_BLOCK(m_out, ("ArithMul slow case")); LBasicBlock continuation = FTL_NEW_BLOCK(m_out, ("ArithMul continuation")); @@ -830,7 +960,7 @@ class LowerDFGToLLVM { LValue neg2ToThe31 = m_out.constInt32(-2147483647-1); - if (bytecodeUsesAsNumber(m_node->arithNodeFlags())) { + if (shouldCheckOverflow(m_node->arithMode())) { LValue cond = m_out.bitOr(m_out.isZero32(denominator), m_out.equal(numerator, neg2ToThe31)); speculate(Overflow, noValue(), 0, cond); m_out.jump(continuation); @@ -860,7 +990,7 @@ class LowerDFGToLLVM { m_out.appendTo(continuation, done); - if (!bytecodeCanIgnoreNegativeZero(m_node->arithNodeFlags())) { + if (shouldCheckNegativeZero(m_node->arithMode())) { LBasicBlock zeroNumerator = FTL_NEW_BLOCK(m_out, ("ArithDivMod zero numerator")); LBasicBlock numeratorContinuation = FTL_NEW_BLOCK(m_out, ("ArithDivMod numerator continuation")); @@ -880,7 +1010,7 @@ class LowerDFGToLLVM { ? m_out.div(numerator, denominator) : m_out.rem(numerator, denominator); - if (bytecodeUsesAsNumber(m_node->arithNodeFlags())) { + if (shouldCheckOverflow(m_node->arithMode())) { speculate( Overflow, noValue(), 0, m_out.notEqual(m_out.mul(divModResult, denominator), numerator)); @@ -992,8 +1122,8 @@ class LowerDFGToLLVM { LValue value = lowInt32(m_node->child1()); LValue result = m_out.neg(value); - if (!bytecodeCanTruncateInteger(m_node->arithNodeFlags())) { - if (bytecodeCanIgnoreNegativeZero(m_node->arithNodeFlags())) { + if (shouldCheckOverflow(m_node->arithMode())) { + if (!shouldCheckNegativeZero(m_node->arithMode())) { // We don't have a negate-with-overflow intrinsic. Hopefully this // does the trick, though. LValue overflowResult = m_out.subWithOverflow32(m_out.int32Zero, value); @@ -1012,7 +1142,7 @@ class LowerDFGToLLVM { Int52Kind kind; LValue value = lowWhicheverInt52(m_node->child1(), kind); LValue result = m_out.neg(value); - if (!bytecodeCanIgnoreNegativeZero(m_node->arithNodeFlags())) + if (shouldCheckNegativeZero(m_node->arithMode())) speculate(NegativeZero, noValue(), 0, m_out.isZero64(result)); setInt52(result, kind); break; @@ -1078,26 +1208,17 @@ class LowerDFGToLLVM { { LValue value = lowInt32(m_node->child1()); - if (!nodeCanSpeculateInt32(m_node->arithNodeFlags())) { + if (doesOverflow(m_node->arithMode())) { setDouble(m_out.unsignedToDouble(value)); return; } - speculateForward( - Overflow, noValue(), 0, m_out.lessThan(value, m_out.int32Zero), - FormattedValue(ValueFormatUInt32, value)); + speculate(Overflow, noValue(), 0, m_out.lessThan(value, m_out.int32Zero)); setInt32(value); } void compileInt32ToDouble() { - // This node is tricky to compile in the DFG backend because it tries to - // avoid converting child1 to a double in-place, as that would make subsequent - // int uses of of child1 fail. But the FTL needs no such special magic, since - // unlike the DFG backend, the FTL allows each node to have multiple - // contemporaneous low-level representations. So, this gives child1 a double - // representation and then forwards that representation to m_node. - setDouble(lowDouble(m_node->child1())); } @@ -1145,6 +1266,15 @@ class LowerDFGToLLVM { speculateCell(m_node->child1()); } + void compileCheckFunction() + { + LValue cell = lowCell(m_node->child1()); + + speculate( + BadFunction, jsValueValue(cell), m_node->child1().node(), + m_out.notEqual(cell, weakPointer(m_node->function()))); + } + void compileArrayifyToStructure() { LValue cell = lowCell(m_node->child1()); @@ -1232,29 +1362,86 @@ class LowerDFGToLLVM { LValue base = lowCell(m_node->child1()); StringImpl* uid = m_graph.identifiers()[m_node->identifierNumber()]; - if (!Options::ftlUsesStackmaps()) { - setJSValue(vmCall(m_out.operation(operationGetById), m_callFrame, m_out.intPtrZero, base, m_out.constIntPtr(uid))); - return; - } - // Arguments: id, bytes, target, numArgs, args... unsigned stackmapID = m_stackmapIDs++; - setJSValue(m_out.call( - m_out.webkitPatchpointInt64Intrinsic(), + + if (Options::verboseCompilation()) + dataLog(" Emitting GetById patchpoint with stackmap #", stackmapID, "\n"); + + LValue call = m_out.call( + m_out.patchpointInt64Intrinsic(), m_out.constInt32(stackmapID), m_out.constInt32(sizeOfGetById()), - constNull(m_out.ref8), m_out.constInt32(2), m_callFrame, base)); + constNull(m_out.ref8), m_out.constInt32(2), m_callFrame, base); + setInstructionCallingConvention(call, LLVMAnyRegCallConv); + setJSValue(call); m_ftlState.getByIds.append(GetByIdDescriptor(stackmapID, m_node->codeOrigin, uid)); } + void compilePutById() + { + // See above; CellUse is easier so we do only that for now. + ASSERT(m_node->child1().useKind() == CellUse); + + LValue base = lowCell(m_node->child1()); + LValue value = lowJSValue(m_node->child2()); + StringImpl* uid = m_graph.identifiers()[m_node->identifierNumber()]; + + // Arguments: id, bytes, target, numArgs, args... + unsigned stackmapID = m_stackmapIDs++; + + if (Options::verboseCompilation()) + dataLog(" Emitting PutById patchpoint with stackmap #", stackmapID, "\n"); + + LValue call = m_out.call( + m_out.patchpointVoidIntrinsic(), + m_out.constInt32(stackmapID), m_out.constInt32(sizeOfPutById()), + constNull(m_out.ref8), m_out.constInt32(3), m_callFrame, base, value); + setInstructionCallingConvention(call, LLVMAnyRegCallConv); + + m_ftlState.putByIds.append(PutByIdDescriptor( + stackmapID, m_node->codeOrigin, uid, + m_graph.executableFor(m_node->codeOrigin)->ecmaMode(), + m_node->op() == PutByIdDirect ? Direct : NotDirect)); + } + void compileGetButterfly() { setStorage(m_out.loadPtr(lowCell(m_node->child1()), m_heaps.JSObject_butterfly)); } + void compileConstantStoragePointer() + { + setStorage(m_out.constIntPtr(m_node->storagePointer())); + } + void compileGetIndexedPropertyStorage() { - setStorage(m_out.loadPtr(lowCell(m_node->child1()), m_heaps.JSArrayBufferView_vector)); + LValue cell = lowCell(m_node->child1()); + + if (m_node->arrayMode().type() == Array::String) { + LBasicBlock slowPath = FTL_NEW_BLOCK(m_out, ("GetIndexedPropertyStorage String slow case")); + LBasicBlock continuation = FTL_NEW_BLOCK(m_out, ("GetIndexedPropertyStorage String continuation")); + + ValueFromBlock fastResult = m_out.anchor( + m_out.loadPtr(cell, m_heaps.JSString_value)); + + m_out.branch(m_out.notNull(fastResult.value()), continuation, slowPath); + + LBasicBlock lastNext = m_out.appendTo(slowPath, continuation); + + ValueFromBlock slowResult = m_out.anchor( + vmCall(m_out.operation(operationResolveRope), m_callFrame, cell)); + + m_out.jump(continuation); + + m_out.appendTo(continuation, lastNext); + + setStorage(m_out.loadPtr(m_out.phi(m_out.intPtr, fastResult, slowResult), m_heaps.StringImpl_data)); + return; + } + + setStorage(m_out.loadPtr(cell, m_heaps.JSArrayBufferView_vector)); } void compileCheckArray() @@ -1280,6 +1467,12 @@ class LowerDFGToLLVM { return; } + case Array::String: { + LValue string = lowCell(m_node->child1()); + setInt32(m_out.load32(string, m_heaps.JSString_length)); + return; + } + default: if (isTypedView(m_node->arrayMode().typedArrayType())) { setInt32( @@ -1292,47 +1485,67 @@ class LowerDFGToLLVM { } } + void compileCheckInBounds() + { + speculate( + OutOfBounds, noValue(), 0, + m_out.aboveOrEqual(lowInt32(m_node->child1()), lowInt32(m_node->child2()))); + } + void compileGetByVal() { - LValue index = lowInt32(m_node->child2()); - LValue storage = lowStorage(m_node->child3()); - switch (m_node->arrayMode().type()) { case Array::Int32: case Array::Contiguous: { + LValue index = lowInt32(m_node->child2()); + LValue storage = lowStorage(m_node->child3()); + + IndexedAbstractHeap& heap = m_node->arrayMode().type() == Array::Int32 ? + m_heaps.indexedInt32Properties : m_heaps.indexedContiguousProperties; + if (m_node->arrayMode().isInBounds()) { - speculate( - OutOfBounds, noValue(), 0, - m_out.aboveOrEqual( - index, m_out.load32(storage, m_heaps.Butterfly_publicLength))); - - LValue result = m_out.load64(m_out.baseIndex( - m_node->arrayMode().type() == Array::Int32 ? - m_heaps.indexedInt32Properties : m_heaps.indexedContiguousProperties, - storage, m_out.zeroExt(index, m_out.intPtr), - m_state.forNode(m_node->child2()).m_value)); + LValue result = m_out.load64(baseIndex(heap, storage, index, m_node->child2())); speculate(LoadFromHole, noValue(), 0, m_out.isZero64(result)); setJSValue(result); return; } - // FIXME: Implement hole/OOB loads in the FTL. - // https://bugs.webkit.org/show_bug.cgi?id=118077 - RELEASE_ASSERT_NOT_REACHED(); + LValue base = lowCell(m_node->child1()); + + LBasicBlock fastCase = FTL_NEW_BLOCK(m_out, ("GetByVal int/contiguous fast case")); + LBasicBlock slowCase = FTL_NEW_BLOCK(m_out, ("GetByVal int/contiguous slow case")); + LBasicBlock continuation = FTL_NEW_BLOCK(m_out, ("GetByVal int/contiguous continuation")); + + m_out.branch( + m_out.aboveOrEqual( + index, m_out.load32(storage, m_heaps.Butterfly_publicLength)), + slowCase, fastCase); + + LBasicBlock lastNext = m_out.appendTo(fastCase, slowCase); + + ValueFromBlock fastResult = m_out.anchor( + m_out.load64(baseIndex(heap, storage, index, m_node->child2()))); + m_out.branch(m_out.isZero64(fastResult.value()), slowCase, continuation); + + m_out.appendTo(slowCase, continuation); + ValueFromBlock slowResult = m_out.anchor( + vmCall(m_out.operation(operationGetByValArrayInt), m_callFrame, base, index)); + m_out.jump(continuation); + + m_out.appendTo(continuation, lastNext); + setJSValue(m_out.phi(m_out.int64, fastResult, slowResult)); return; } case Array::Double: { + LValue index = lowInt32(m_node->child2()); + LValue storage = lowStorage(m_node->child3()); + + IndexedAbstractHeap& heap = m_heaps.indexedDoubleProperties; + if (m_node->arrayMode().isInBounds()) { - speculate( - OutOfBounds, noValue(), 0, - m_out.aboveOrEqual( - index, m_out.load32(storage, m_heaps.Butterfly_publicLength))); - - LValue result = m_out.loadDouble(m_out.baseIndex( - m_heaps.indexedDoubleProperties, - storage, m_out.zeroExt(index, m_out.intPtr), - m_state.forNode(m_node->child2()).m_value)); + LValue result = m_out.loadDouble( + baseIndex(heap, storage, index, m_node->child2())); if (!m_node->arrayMode().isSaneChain()) { speculate( @@ -1343,23 +1556,57 @@ class LowerDFGToLLVM { break; } - // FIXME: Implement hole/OOB loads in the FTL. - // https://bugs.webkit.org/show_bug.cgi?id=118077 - RELEASE_ASSERT_NOT_REACHED(); + LValue base = lowCell(m_node->child1()); + + LBasicBlock inBounds = FTL_NEW_BLOCK(m_out, ("GetByVal double in bounds")); + LBasicBlock boxPath = FTL_NEW_BLOCK(m_out, ("GetByVal double boxing")); + LBasicBlock slowCase = FTL_NEW_BLOCK(m_out, ("GetByVal double slow case")); + LBasicBlock continuation = FTL_NEW_BLOCK(m_out, ("GetByVal double continuation")); + + m_out.branch( + m_out.aboveOrEqual( + index, m_out.load32(storage, m_heaps.Butterfly_publicLength)), + slowCase, inBounds); + + LBasicBlock lastNext = m_out.appendTo(inBounds, boxPath); + LValue doubleValue = m_out.loadDouble( + baseIndex(heap, storage, index, m_node->child2())); + m_out.branch( + m_out.doubleNotEqualOrUnordered(doubleValue, doubleValue), slowCase, boxPath); + + m_out.appendTo(boxPath, slowCase); + ValueFromBlock fastResult = m_out.anchor(boxDouble(doubleValue)); + m_out.jump(continuation); + + m_out.appendTo(slowCase, continuation); + ValueFromBlock slowResult = m_out.anchor( + vmCall(m_out.operation(operationGetByValArrayInt), m_callFrame, base, index)); + m_out.jump(continuation); + + m_out.appendTo(continuation, lastNext); + setJSValue(m_out.phi(m_out.int64, fastResult, slowResult)); + return; + } + + case Array::Generic: { + setJSValue(vmCall( + m_out.operation(operationGetByVal), m_callFrame, + lowJSValue(m_node->child1()), lowJSValue(m_node->child2()))); + return; + } + + case Array::String: { + compileStringCharAt(); return; } default: { + LValue index = lowInt32(m_node->child2()); + LValue storage = lowStorage(m_node->child3()); + TypedArrayType type = m_node->arrayMode().typedArrayType(); if (isTypedView(type)) { - LValue array = lowCell(m_node->child1()); - - speculate( - OutOfBounds, noValue(), 0, - m_out.aboveOrEqual( - index, m_out.load32(array, m_heaps.JSArrayBufferView_length))); - TypedPointer pointer = TypedPointer( m_heaps.typedArrayProperties, m_out.add( @@ -1399,9 +1646,8 @@ class LowerDFGToLLVM { } if (m_node->shouldSpeculateInt32()) { - speculateForward( - Overflow, noValue(), 0, m_out.lessThan(result, m_out.int32Zero), - uInt32Value(result)); + speculate( + Overflow, noValue(), 0, m_out.lessThan(result, m_out.int32Zero)); setInt32(result); return; } @@ -1441,6 +1687,31 @@ class LowerDFGToLLVM { Edge child2 = m_graph.varArgChild(m_node, 1); Edge child3 = m_graph.varArgChild(m_node, 2); Edge child4 = m_graph.varArgChild(m_node, 3); + + switch (m_node->arrayMode().type()) { + case Array::Generic: { + V_JITOperation_EJJJ operation; + if (m_node->op() == PutByValDirect) { + if (m_graph.isStrictModeFor(m_node->codeOrigin)) + operation = operationPutByValDirectStrict; + else + operation = operationPutByValDirectNonStrict; + } else { + if (m_graph.isStrictModeFor(m_node->codeOrigin)) + operation = operationPutByValStrict; + else + operation = operationPutByValNonStrict; + } + + vmCall( + m_out.operation(operation), m_callFrame, + lowJSValue(child1), lowJSValue(child2), lowJSValue(child3)); + return; + } + + default: + break; + } LValue base = lowCell(child1); LValue index = lowInt32(child2); @@ -1522,13 +1793,6 @@ class LowerDFGToLLVM { TypedArrayType type = m_node->arrayMode().typedArrayType(); if (isTypedView(type)) { - if (m_node->op() == PutByVal) { - speculate( - OutOfBounds, noValue(), 0, - m_out.aboveOrEqual( - index, m_out.load32(base, m_heaps.JSArrayBufferView_length))); - } - TypedPointer pointer = TypedPointer( m_heaps.typedArrayProperties, m_out.add( @@ -1545,7 +1809,7 @@ class LowerDFGToLLVM { if (child3.useKind() == Int32Use) intValue = lowInt32(child3); else - intValue = m_out.castToInt32(lowInt52(child3)); + intValue = m_out.castToInt32(lowStrictInt52(child3)); if (isClamped(type)) { ASSERT(elementSize(type) == 1); @@ -1601,10 +1865,8 @@ class LowerDFGToLLVM { m_out.appendTo(continuation, lastNext); intValue = m_out.phi(m_out.int32, intValues); - } else if (isSigned(type)) + } else intValue = doubleToInt32(doubleValue); - else - intValue = doubleToUInt32(doubleValue); break; } @@ -1650,30 +1912,363 @@ class LowerDFGToLLVM { } } - void compileGetByOffset() + void compileNewObject() { - StorageAccessData& data = - m_graph.m_storageAccessData[m_node->storageAccessDataIndex()]; + Structure* structure = m_node->structure(); + size_t allocationSize = JSFinalObject::allocationSize(structure->inlineCapacity()); + MarkedAllocator* allocator = &vm().heap.allocatorForObjectWithoutDestructor(allocationSize); - setJSValue( - m_out.load64( - m_out.address( - m_heaps.properties[data.identifierNumber], - lowStorage(m_node->child1()), - offsetRelativeToBase(data.offset)))); + LBasicBlock slowPath = FTL_NEW_BLOCK(m_out, ("NewObject slow path")); + LBasicBlock continuation = FTL_NEW_BLOCK(m_out, ("NewObject continuation")); + + LBasicBlock lastNext = m_out.insertNewBlocksBefore(slowPath); + + ValueFromBlock fastResult = m_out.anchor(allocateObject( + m_out.constIntPtr(allocator), m_out.constIntPtr(structure), m_out.intPtrZero, slowPath)); + + m_out.jump(continuation); + + m_out.appendTo(slowPath, continuation); + + ValueFromBlock slowResult = m_out.anchor(vmCall( + m_out.operation(operationNewObject), m_callFrame, m_out.constIntPtr(structure))); + m_out.jump(continuation); + + m_out.appendTo(continuation, lastNext); + setJSValue(m_out.phi(m_out.intPtr, fastResult, slowResult)); } - void compilePutByOffset() + void compileNewArray() { - StorageAccessData& data = - m_graph.m_storageAccessData[m_node->storageAccessDataIndex()]; + // First speculate appropriately on all of the children. Do this unconditionally up here + // because some of the slow paths may otherwise forget to do it. It's sort of arguable + // that doing the speculations up here might be unprofitable for RA - so we can consider + // sinking this to below the allocation fast path if we find that this has a lot of + // register pressure. + for (unsigned operandIndex = 0; operandIndex < m_node->numChildren(); ++operandIndex) + speculate(m_graph.varArgChild(m_node, operandIndex)); - m_out.store64( - lowJSValue(m_node->child3()), - m_out.address( - m_heaps.properties[data.identifierNumber], - lowStorage(m_node->child1()), - offsetRelativeToBase(data.offset))); + JSGlobalObject* globalObject = m_graph.globalObjectFor(m_node->codeOrigin); + Structure* structure = globalObject->arrayStructureForIndexingTypeDuringAllocation( + m_node->indexingType()); + + RELEASE_ASSERT(structure->indexingType() == m_node->indexingType()); + + if (!globalObject->isHavingABadTime() && !hasArrayStorage(m_node->indexingType())) { + unsigned numElements = m_node->numChildren(); + + ArrayValues arrayValues = allocateJSArray(structure, numElements); + + for (unsigned operandIndex = 0; operandIndex < m_node->numChildren(); ++operandIndex) { + Edge edge = m_graph.varArgChild(m_node, operandIndex); + + switch (m_node->indexingType()) { + case ALL_BLANK_INDEXING_TYPES: + case ALL_UNDECIDED_INDEXING_TYPES: + CRASH(); + break; + + case ALL_DOUBLE_INDEXING_TYPES: + m_out.storeDouble( + lowDouble(edge), + arrayValues.butterfly, m_heaps.indexedDoubleProperties[operandIndex]); + break; + + case ALL_INT32_INDEXING_TYPES: + case ALL_CONTIGUOUS_INDEXING_TYPES: + m_out.store64( + lowJSValue(edge, ManualOperandSpeculation), + arrayValues.butterfly, + m_heaps.forIndexingType(m_node->indexingType())->at(operandIndex)); + break; + + default: + CRASH(); + } + } + + setJSValue(arrayValues.array); + return; + } + + if (!m_node->numChildren()) { + setJSValue(vmCall( + m_out.operation(operationNewEmptyArray), m_callFrame, + m_out.constIntPtr(structure))); + return; + } + + size_t scratchSize = sizeof(EncodedJSValue) * m_node->numChildren(); + ASSERT(scratchSize); + ScratchBuffer* scratchBuffer = vm().scratchBufferForSize(scratchSize); + EncodedJSValue* buffer = static_cast(scratchBuffer->dataBuffer()); + + for (unsigned operandIndex = 0; operandIndex < m_node->numChildren(); ++operandIndex) { + Edge edge = m_graph.varArgChild(m_node, operandIndex); + m_out.store64( + lowJSValue(edge, ManualOperandSpeculation), + m_out.absolute(buffer + operandIndex)); + } + + m_out.storePtr( + m_out.constIntPtr(scratchSize), m_out.absolute(scratchBuffer->activeLengthPtr())); + + LValue result = vmCall( + m_out.operation(operationNewArray), m_callFrame, + m_out.constIntPtr(structure), m_out.constIntPtr(buffer), + m_out.constIntPtr(m_node->numChildren())); + + m_out.storePtr(m_out.intPtrZero, m_out.absolute(scratchBuffer->activeLengthPtr())); + + setJSValue(result); + } + + void compileNewArrayBuffer() + { + JSGlobalObject* globalObject = m_graph.globalObjectFor(m_node->codeOrigin); + Structure* structure = globalObject->arrayStructureForIndexingTypeDuringAllocation( + m_node->indexingType()); + + RELEASE_ASSERT(structure->indexingType() == m_node->indexingType()); + + if (!globalObject->isHavingABadTime() && !hasArrayStorage(m_node->indexingType())) { + unsigned numElements = m_node->numConstants(); + + ArrayValues arrayValues = allocateJSArray(structure, numElements); + + JSValue* data = codeBlock()->constantBuffer(m_node->startConstant()); + for (unsigned index = 0; index < m_node->numConstants(); ++index) { + int64_t value; + if (hasDouble(m_node->indexingType())) + value = bitwise_cast(data[index].asNumber()); + else + value = JSValue::encode(data[index]); + + m_out.store64( + m_out.constInt64(value), + arrayValues.butterfly, + m_heaps.forIndexingType(m_node->indexingType())->at(index)); + } + + setJSValue(arrayValues.array); + return; + } + + setJSValue(vmCall( + m_out.operation(operationNewArrayBuffer), m_callFrame, + m_out.constIntPtr(structure), m_out.constIntPtr(m_node->startConstant()), + m_out.constIntPtr(m_node->numConstants()))); + } + + void compileAllocatePropertyStorage() + { + StructureTransitionData& data = m_node->structureTransitionData(); + + LValue object = lowCell(m_node->child1()); + + if (data.previousStructure->couldHaveIndexingHeader()) { + setStorage(vmCall( + m_out.operation( + operationReallocateButterflyToHavePropertyStorageWithInitialCapacity), + m_callFrame, object)); + return; + } + + LBasicBlock slowPath = FTL_NEW_BLOCK(m_out, ("AllocatePropertyStorage slow path")); + LBasicBlock continuation = FTL_NEW_BLOCK(m_out, ("AllocatePropertyStorage continuation")); + + LBasicBlock lastNext = m_out.insertNewBlocksBefore(slowPath); + + LValue endOfStorage = allocateBasicStorageAndGetEnd( + m_out.constIntPtr(initialOutOfLineCapacity * sizeof(JSValue)), slowPath); + + ValueFromBlock fastButterfly = m_out.anchor( + m_out.add(m_out.constIntPtr(sizeof(IndexingHeader)), endOfStorage)); + + m_out.jump(continuation); + + m_out.appendTo(slowPath, continuation); + + ValueFromBlock slowButterfly = m_out.anchor(vmCall( + m_out.operation(operationAllocatePropertyStorageWithInitialCapacity), m_callFrame)); + + m_out.jump(continuation); + + m_out.appendTo(continuation, lastNext); + + LValue result = m_out.phi(m_out.intPtr, fastButterfly, slowButterfly); + m_out.storePtr(result, object, m_heaps.JSObject_butterfly); + + setStorage(result); + } + + void compileStringCharAt() + { + LValue base = lowCell(m_node->child1()); + LValue index = lowInt32(m_node->child2()); + LValue storage = lowStorage(m_node->child3()); + + LBasicBlock fastPath = FTL_NEW_BLOCK(m_out, ("GetByVal String fast path")); + LBasicBlock slowPath = FTL_NEW_BLOCK(m_out, ("GetByVal String slow path")); + LBasicBlock continuation = FTL_NEW_BLOCK(m_out, ("GetByVal String continuation")); + + m_out.branch( + m_out.aboveOrEqual( + index, m_out.load32(base, m_heaps.JSString_length)), + slowPath, fastPath); + + LBasicBlock lastNext = m_out.appendTo(fastPath, slowPath); + + LValue stringImpl = m_out.loadPtr(base, m_heaps.JSString_value); + + LBasicBlock is8Bit = FTL_NEW_BLOCK(m_out, ("GetByVal String 8-bit case")); + LBasicBlock is16Bit = FTL_NEW_BLOCK(m_out, ("GetByVal String 16-bit case")); + LBasicBlock bitsContinuation = FTL_NEW_BLOCK(m_out, ("GetByVal String bitness continuation")); + LBasicBlock bigCharacter = FTL_NEW_BLOCK(m_out, ("GetByVal String big character")); + + m_out.branch( + m_out.testIsZero32( + m_out.load32(stringImpl, m_heaps.StringImpl_hashAndFlags), + m_out.constInt32(StringImpl::flagIs8Bit())), + is16Bit, is8Bit); + + m_out.appendTo(is8Bit, is16Bit); + + ValueFromBlock char8Bit = m_out.anchor(m_out.zeroExt( + m_out.load8(m_out.baseIndex( + m_heaps.characters8, + storage, m_out.zeroExt(index, m_out.intPtr), + m_state.forNode(m_node->child2()).m_value)), + m_out.int32)); + m_out.jump(bitsContinuation); + + m_out.appendTo(is16Bit, bigCharacter); + + ValueFromBlock char16Bit = m_out.anchor(m_out.zeroExt( + m_out.load16(m_out.baseIndex( + m_heaps.characters16, + storage, m_out.zeroExt(index, m_out.intPtr), + m_state.forNode(m_node->child2()).m_value)), + m_out.int32)); + m_out.branch(m_out.aboveOrEqual(char16Bit.value(), m_out.constInt32(0x100)), bigCharacter, bitsContinuation); + + m_out.appendTo(bigCharacter, bitsContinuation); + + Vector results; + results.append(m_out.anchor(vmCall( + m_out.operation(operationSingleCharacterString), + m_callFrame, char16Bit.value()))); + m_out.jump(continuation); + + m_out.appendTo(bitsContinuation, slowPath); + + LValue character = m_out.phi(m_out.int32, char8Bit, char16Bit); + + LValue smallStrings = m_out.constIntPtr(vm().smallStrings.singleCharacterStrings()); + + results.append(m_out.anchor(m_out.loadPtr(m_out.baseIndex( + m_heaps.singleCharacterStrings, smallStrings, + m_out.zeroExt(character, m_out.intPtr))))); + m_out.jump(continuation); + + m_out.appendTo(slowPath, continuation); + + if (m_node->arrayMode().isInBounds()) { + speculate(OutOfBounds, noValue(), 0, m_out.booleanTrue); + results.append(m_out.anchor(m_out.intPtrZero)); + } else { + JSGlobalObject* globalObject = m_graph.globalObjectFor(m_node->codeOrigin); + + if (globalObject->stringPrototypeChainIsSane()) { + LBasicBlock negativeIndex = FTL_NEW_BLOCK(m_out, ("GetByVal String negative index")); + + results.append(m_out.anchor(m_out.constInt64(JSValue::encode(jsUndefined())))); + m_out.branch(m_out.lessThan(index, m_out.int32Zero), negativeIndex, continuation); + + m_out.appendTo(negativeIndex, continuation); + } + + results.append(m_out.anchor(vmCall( + m_out.operation(operationGetByValStringInt), m_callFrame, base, index))); + } + + m_out.jump(continuation); + + m_out.appendTo(continuation, lastNext); + setJSValue(m_out.phi(m_out.int64, results)); + } + + void compileStringCharCodeAt() + { + LBasicBlock is8Bit = FTL_NEW_BLOCK(m_out, ("StringCharCodeAt 8-bit case")); + LBasicBlock is16Bit = FTL_NEW_BLOCK(m_out, ("StringCharCodeAt 16-bit case")); + LBasicBlock continuation = FTL_NEW_BLOCK(m_out, ("StringCharCodeAt continuation")); + + LValue base = lowCell(m_node->child1()); + LValue index = lowInt32(m_node->child2()); + LValue storage = lowStorage(m_node->child3()); + + speculate( + Uncountable, noValue(), 0, + m_out.aboveOrEqual(index, m_out.load32(base, m_heaps.JSString_length))); + + LValue stringImpl = m_out.loadPtr(base, m_heaps.JSString_value); + + m_out.branch( + m_out.testIsZero32( + m_out.load32(stringImpl, m_heaps.StringImpl_hashAndFlags), + m_out.constInt32(StringImpl::flagIs8Bit())), + is16Bit, is8Bit); + + LBasicBlock lastNext = m_out.appendTo(is8Bit, is16Bit); + + ValueFromBlock char8Bit = m_out.anchor(m_out.zeroExt( + m_out.load8(m_out.baseIndex( + m_heaps.characters8, + storage, m_out.zeroExt(index, m_out.intPtr), + m_state.forNode(m_node->child2()).m_value)), + m_out.int32)); + m_out.jump(continuation); + + m_out.appendTo(is16Bit, continuation); + + ValueFromBlock char16Bit = m_out.anchor(m_out.zeroExt( + m_out.load16(m_out.baseIndex( + m_heaps.characters16, + storage, m_out.zeroExt(index, m_out.intPtr), + m_state.forNode(m_node->child2()).m_value)), + m_out.int32)); + m_out.jump(continuation); + + m_out.appendTo(continuation, lastNext); + + setInt32(m_out.phi(m_out.int32, char8Bit, char16Bit)); + } + + void compileGetByOffset() + { + StorageAccessData& data = + m_graph.m_storageAccessData[m_node->storageAccessDataIndex()]; + + setJSValue( + m_out.load64( + m_out.address( + m_heaps.properties[data.identifierNumber], + lowStorage(m_node->child1()), + offsetRelativeToBase(data.offset)))); + } + + void compilePutByOffset() + { + StorageAccessData& data = + m_graph.m_storageAccessData[m_node->storageAccessDataIndex()]; + + m_out.store64( + lowJSValue(m_node->child3()), + m_out.address( + m_heaps.properties[data.identifierNumber], + lowStorage(m_node->child1()), + offsetRelativeToBase(data.offset))); } void compileGetGlobalVar() @@ -1687,10 +2282,67 @@ class LowerDFGToLLVM { lowJSValue(m_node->child1()), m_out.absolute(m_node->registerPointer())); } - void compileGlobalVarWatchpoint() + void compileNotifyWrite() { - // FIXME: In debug mode we could emit some assertion code here. - // https://bugs.webkit.org/show_bug.cgi?id=123471 + VariableWatchpointSet* set = m_node->variableWatchpointSet(); + + LValue value = lowJSValue(m_node->child1()); + + LBasicBlock isNotInvalidated = FTL_NEW_BLOCK(m_out, ("NotifyWrite not invalidated case")); + LBasicBlock isClear = FTL_NEW_BLOCK(m_out, ("NotifyWrite clear case")); + LBasicBlock isWatched = FTL_NEW_BLOCK(m_out, ("NotifyWrite watched case")); + LBasicBlock invalidate = FTL_NEW_BLOCK(m_out, ("NotifyWrite invalidate case")); + LBasicBlock invalidateFast = FTL_NEW_BLOCK(m_out, ("NotifyWrite invalidate fast case")); + LBasicBlock invalidateSlow = FTL_NEW_BLOCK(m_out, ("NotifyWrite invalidate slow case")); + LBasicBlock continuation = FTL_NEW_BLOCK(m_out, ("NotifyWrite continuation")); + + LValue state = m_out.load8(m_out.absolute(set->addressOfState())); + + m_out.branch( + m_out.equal(state, m_out.constInt8(IsInvalidated)), + continuation, isNotInvalidated); + + LBasicBlock lastNext = m_out.appendTo(isNotInvalidated, isClear); + + LValue isClearValue; + if (set->state() == ClearWatchpoint) + isClearValue = m_out.equal(state, m_out.constInt8(ClearWatchpoint)); + else + isClearValue = m_out.booleanFalse; + m_out.branch(isClearValue, isClear, isWatched); + + m_out.appendTo(isClear, isWatched); + + m_out.store64(value, m_out.absolute(set->addressOfInferredValue())); + m_out.store8(m_out.constInt8(IsWatched), m_out.absolute(set->addressOfState())); + m_out.jump(continuation); + + m_out.appendTo(isWatched, invalidate); + + m_out.branch( + m_out.equal(value, m_out.load64(m_out.absolute(set->addressOfInferredValue()))), + continuation, invalidate); + + m_out.appendTo(invalidate, invalidateFast); + + m_out.branch( + m_out.notZero8(m_out.load8(m_out.absolute(set->addressOfSetIsNotEmpty()))), + invalidateSlow, invalidateFast); + + m_out.appendTo(invalidateFast, invalidateSlow); + + m_out.store64( + m_out.constInt64(JSValue::encode(JSValue())), + m_out.absolute(set->addressOfInferredValue())); + m_out.store8(m_out.constInt8(IsInvalidated), m_out.absolute(set->addressOfState())); + m_out.jump(continuation); + + m_out.appendTo(invalidateSlow, continuation); + + vmCall(m_out.operation(operationInvalidate), m_callFrame, m_out.constIntPtr(set)); + m_out.jump(continuation); + + m_out.appendTo(continuation, lastNext); } void compileGetMyScope() @@ -1706,6 +2358,11 @@ class LowerDFGToLLVM { void compileGetClosureRegisters() { + if (WriteBarrierBase* registers = m_graph.tryGetRegisters(m_node->child1().node())) { + setStorage(m_out.constIntPtr(registers)); + return; + } + setStorage(m_out.loadPtr( lowCell(m_node->child1()), m_heaps.JSVariableObject_registers)); } @@ -1733,6 +2390,11 @@ class LowerDFGToLLVM { return; } + if (m_node->isBinaryUseKind(UntypedUse)) { + nonSpeculativeCompare(LLVMIntEQ, operationCompareEq); + return; + } + RELEASE_ASSERT_NOT_REACHED(); } @@ -1801,106 +2463,22 @@ class LowerDFGToLLVM { void compileCompareLess() { - if (m_node->isBinaryUseKind(Int32Use)) { - setBoolean( - m_out.lessThan(lowInt32(m_node->child1()), lowInt32(m_node->child2()))); - return; - } - - if (m_node->isBinaryUseKind(MachineIntUse)) { - Int52Kind kind; - LValue left = lowWhicheverInt52(m_node->child1(), kind); - LValue right = lowInt52(m_node->child2(), kind); - setBoolean(m_out.lessThan(left, right)); - return; - } - - if (m_node->isBinaryUseKind(NumberUse)) { - setBoolean( - m_out.doubleLessThan(lowDouble(m_node->child1()), lowDouble(m_node->child2()))); - return; - } - - RELEASE_ASSERT_NOT_REACHED(); + compare(LLVMIntSLT, LLVMRealOLT, operationCompareLess); } void compileCompareLessEq() { - if (m_node->isBinaryUseKind(Int32Use)) { - setBoolean( - m_out.lessThanOrEqual(lowInt32(m_node->child1()), lowInt32(m_node->child2()))); - return; - } - - if (m_node->isBinaryUseKind(MachineIntUse)) { - Int52Kind kind; - LValue left = lowWhicheverInt52(m_node->child1(), kind); - LValue right = lowInt52(m_node->child2(), kind); - setBoolean(m_out.lessThanOrEqual(left, right)); - return; - } - - if (m_node->isBinaryUseKind(NumberUse)) { - setBoolean( - m_out.doubleLessThanOrEqual( - lowDouble(m_node->child1()), lowDouble(m_node->child2()))); - return; - } - - RELEASE_ASSERT_NOT_REACHED(); + compare(LLVMIntSLE, LLVMRealOLE, operationCompareLessEq); } void compileCompareGreater() { - if (m_node->isBinaryUseKind(Int32Use)) { - setBoolean( - m_out.greaterThan(lowInt32(m_node->child1()), lowInt32(m_node->child2()))); - return; - } - - if (m_node->isBinaryUseKind(MachineIntUse)) { - Int52Kind kind; - LValue left = lowWhicheverInt52(m_node->child1(), kind); - LValue right = lowInt52(m_node->child2(), kind); - setBoolean(m_out.greaterThan(left, right)); - return; - } - - if (m_node->isBinaryUseKind(NumberUse)) { - setBoolean( - m_out.doubleGreaterThan( - lowDouble(m_node->child1()), lowDouble(m_node->child2()))); - return; - } - - RELEASE_ASSERT_NOT_REACHED(); + compare(LLVMIntSGT, LLVMRealOGT, operationCompareGreater); } void compileCompareGreaterEq() { - if (m_node->isBinaryUseKind(Int32Use)) { - setBoolean( - m_out.greaterThanOrEqual( - lowInt32(m_node->child1()), lowInt32(m_node->child2()))); - return; - } - - if (m_node->isBinaryUseKind(MachineIntUse)) { - Int52Kind kind; - LValue left = lowWhicheverInt52(m_node->child1(), kind); - LValue right = lowInt52(m_node->child2(), kind); - setBoolean(m_out.greaterThanOrEqual(left, right)); - return; - } - - if (m_node->isBinaryUseKind(NumberUse)) { - setBoolean( - m_out.doubleGreaterThanOrEqual( - lowDouble(m_node->child1()), lowDouble(m_node->child2()))); - return; - } - - RELEASE_ASSERT_NOT_REACHED(); + compare(LLVMIntSGE, LLVMRealOGE, operationCompareGreaterEq); } void compileLogicalNot() @@ -1922,7 +2500,7 @@ class LowerDFGToLLVM { LValue calleeFrame = m_out.add( m_callFrame, - m_out.constIntPtr(sizeof(Register) * virtualRegisterForLocal(codeBlock()->m_numCalleeRegisters).offset())); + m_out.constIntPtr(sizeof(Register) * virtualRegisterForLocal(m_graph.frameRegisterCount()).offset())); m_out.store32( m_out.constInt32(numPassedArgs + dummyThisArgument), @@ -2088,30 +2666,270 @@ class LowerDFGToLLVM { return; } - case SwitchString: - RELEASE_ASSERT_NOT_REACHED(); - break; + case SwitchString: + RELEASE_ASSERT_NOT_REACHED(); + break; + } + + RELEASE_ASSERT_NOT_REACHED(); + } + + void compileReturn() + { + // FIXME: have a real epilogue when we switch to using our calling convention. + // https://bugs.webkit.org/show_bug.cgi?id=113621 + m_out.ret(lowJSValue(m_node->child1())); + } + + void compileForceOSRExit() + { + terminate(InadequateCoverage); + } + + void compileInvalidationPoint() + { + if (verboseCompilationEnabled()) + dataLog(" Invalidation point with availability: ", m_availability, "\n"); + + m_ftlState.jitCode->osrExit.append(OSRExit( + UncountableInvalidation, InvalidValueFormat, MethodOfGettingAValueProfile(), + m_codeOriginForExitTarget, m_codeOriginForExitProfile, + m_availability.numberOfArguments(), m_availability.numberOfLocals())); + m_ftlState.finalizer->osrExit.append(OSRExitCompilationInfo()); + + OSRExit& exit = m_ftlState.jitCode->osrExit.last(); + OSRExitCompilationInfo& info = m_ftlState.finalizer->osrExit.last(); + + ExitArgumentList arguments; + + buildExitArguments(exit, arguments, FormattedValue(), exit.m_codeOrigin); + callStackmap(exit, arguments); + + info.m_isInvalidationPoint = true; + } + + TypedPointer baseIndex(IndexedAbstractHeap& heap, LValue storage, LValue index, Edge edge) + { + return m_out.baseIndex( + heap, storage, m_out.zeroExt(index, m_out.intPtr), + m_state.forNode(edge).m_value); + } + + void compare( + LIntPredicate intCondition, LRealPredicate realCondition, + S_JITOperation_EJJ helperFunction) + { + if (m_node->isBinaryUseKind(Int32Use)) { + LValue left = lowInt32(m_node->child1()); + LValue right = lowInt32(m_node->child2()); + setBoolean(m_out.icmp(intCondition, left, right)); + return; + } + + if (m_node->isBinaryUseKind(MachineIntUse)) { + Int52Kind kind; + LValue left = lowWhicheverInt52(m_node->child1(), kind); + LValue right = lowInt52(m_node->child2(), kind); + setBoolean(m_out.icmp(intCondition, left, right)); + return; + } + + if (m_node->isBinaryUseKind(NumberUse)) { + LValue left = lowDouble(m_node->child1()); + LValue right = lowDouble(m_node->child2()); + setBoolean(m_out.fcmp(realCondition, left, right)); + return; + } + + if (m_node->isBinaryUseKind(UntypedUse)) { + nonSpeculativeCompare(intCondition, helperFunction); + return; + } + + RELEASE_ASSERT_NOT_REACHED(); + } + + void nonSpeculativeCompare(LIntPredicate intCondition, S_JITOperation_EJJ helperFunction) + { + LValue left = lowJSValue(m_node->child1()); + LValue right = lowJSValue(m_node->child2()); + + LBasicBlock leftIsInt = FTL_NEW_BLOCK(m_out, ("CompareEq untyped left is int")); + LBasicBlock fastPath = FTL_NEW_BLOCK(m_out, ("CompareEq untyped fast path")); + LBasicBlock slowPath = FTL_NEW_BLOCK(m_out, ("CompareEq untyped slow path")); + LBasicBlock continuation = FTL_NEW_BLOCK(m_out, ("CompareEq untyped continuation")); + + m_out.branch(isNotInt32(left), slowPath, leftIsInt); + + LBasicBlock lastNext = m_out.appendTo(leftIsInt, fastPath); + m_out.branch(isNotInt32(right), slowPath, fastPath); + + m_out.appendTo(fastPath, slowPath); + ValueFromBlock fastResult = m_out.anchor( + m_out.icmp(intCondition, unboxInt32(left), unboxInt32(right))); + m_out.jump(continuation); + + m_out.appendTo(slowPath, continuation); + ValueFromBlock slowResult = m_out.anchor(m_out.notNull(vmCall( + m_out.operation(helperFunction), m_callFrame, left, right))); + m_out.jump(continuation); + + m_out.appendTo(continuation, lastNext); + setBoolean(m_out.phi(m_out.boolean, fastResult, slowResult)); + } + + LValue allocateCell(LValue allocator, LValue structure, LBasicBlock slowPath) + { + LBasicBlock success = FTL_NEW_BLOCK(m_out, ("object allocation success")); + + LValue result = m_out.loadPtr( + allocator, m_heaps.MarkedAllocator_freeListHead); + + m_out.branch(m_out.notNull(result), success, slowPath); + + m_out.appendTo(success); + + m_out.storePtr( + m_out.loadPtr(result, m_heaps.JSCell_freeListNext), + allocator, m_heaps.MarkedAllocator_freeListHead); + + m_out.storePtr(structure, result, m_heaps.JSCell_structure); + + return result; + } + + LValue allocateObject( + LValue allocator, LValue structure, LValue butterfly, LBasicBlock slowPath) + { + LValue result = allocateCell(allocator, structure, slowPath); + m_out.storePtr(butterfly, result, m_heaps.JSObject_butterfly); + return result; + } + + template + LValue allocateObject(LValue structure, LValue butterfly, LBasicBlock slowPath) + { + MarkedAllocator* allocator; + size_t size = ClassType::allocationSize(0); + if (ClassType::needsDestruction && ClassType::hasImmortalStructure) + allocator = &vm().heap.allocatorForObjectWithImmortalStructureDestructor(size); + else if (ClassType::needsDestruction) + allocator = &vm().heap.allocatorForObjectWithNormalDestructor(size); + else + allocator = &vm().heap.allocatorForObjectWithoutDestructor(size); + return allocateObject(m_out.constIntPtr(allocator), structure, butterfly, slowPath); + } + + // Returns a pointer to the end of the allocation. + LValue allocateBasicStorageAndGetEnd(LValue size, LBasicBlock slowPath) + { + CopiedAllocator& allocator = vm().heap.storageAllocator(); + + LBasicBlock success = FTL_NEW_BLOCK(m_out, ("storage allocation success")); + + LValue remaining = m_out.loadPtr(m_out.absolute(&allocator.m_currentRemaining)); + LValue newRemaining = m_out.sub(remaining, size); + + m_out.branch(m_out.lessThan(newRemaining, m_out.intPtrZero), slowPath, success); + + m_out.appendTo(success); + + m_out.storePtr(newRemaining, m_out.absolute(&allocator.m_currentRemaining)); + return m_out.sub( + m_out.loadPtr(m_out.absolute(&allocator.m_currentPayloadEnd)), newRemaining); + } + + struct ArrayValues { + ArrayValues() + : array(0) + , butterfly(0) + { + } + + ArrayValues(LValue array, LValue butterfly) + : array(array) + , butterfly(butterfly) + { } - RELEASE_ASSERT_NOT_REACHED(); + LValue array; + LValue butterfly; + }; + ArrayValues allocateJSArray( + Structure* structure, unsigned numElements, LBasicBlock slowPath) + { + ASSERT( + hasUndecided(structure->indexingType()) + || hasInt32(structure->indexingType()) + || hasDouble(structure->indexingType()) + || hasContiguous(structure->indexingType())); + + unsigned vectorLength = std::max(BASE_VECTOR_LEN, numElements); + + LValue endOfStorage = allocateBasicStorageAndGetEnd( + m_out.constIntPtr(sizeof(JSValue) * vectorLength + sizeof(IndexingHeader)), + slowPath); + + LValue butterfly = m_out.sub( + endOfStorage, m_out.constIntPtr(sizeof(JSValue) * vectorLength)); + + LValue object = allocateObject( + m_out.constIntPtr(structure), butterfly, slowPath); + + m_out.store32(m_out.constInt32(numElements), butterfly, m_heaps.Butterfly_publicLength); + m_out.store32(m_out.constInt32(vectorLength), butterfly, m_heaps.Butterfly_vectorLength); + + if (hasDouble(structure->indexingType())) { + for (unsigned i = numElements; i < vectorLength; ++i) { + m_out.store64( + m_out.constInt64(bitwise_cast(QNaN)), + butterfly, m_heaps.indexedDoubleProperties[i]); + } + } + + return ArrayValues(object, butterfly); } - void compileReturn() + ArrayValues allocateJSArray(Structure* structure, unsigned numElements) { - // FIXME: have a real epilogue when we switch to using our calling convention. - // https://bugs.webkit.org/show_bug.cgi?id=113621 - m_out.ret(lowJSValue(m_node->child1())); + LBasicBlock slowPath = FTL_NEW_BLOCK(m_out, ("JSArray allocation slow path")); + LBasicBlock continuation = FTL_NEW_BLOCK(m_out, ("JSArray allocation continuation")); + + LBasicBlock lastNext = m_out.insertNewBlocksBefore(slowPath); + + ArrayValues fastValues = allocateJSArray(structure, numElements, slowPath); + ValueFromBlock fastArray = m_out.anchor(fastValues.array); + ValueFromBlock fastButterfly = m_out.anchor(fastValues.butterfly); + + m_out.jump(continuation); + + m_out.appendTo(slowPath, continuation); + + ValueFromBlock slowArray = m_out.anchor(vmCall( + m_out.operation(operationNewArrayWithSize), m_callFrame, + m_out.constIntPtr(structure), m_out.constInt32(numElements))); + ValueFromBlock slowButterfly = m_out.anchor( + m_out.loadPtr(slowArray.value(), m_heaps.JSObject_butterfly)); + + m_out.jump(continuation); + + m_out.appendTo(continuation, lastNext); + + return ArrayValues( + m_out.phi(m_out.intPtr, fastArray, slowArray), + m_out.phi(m_out.intPtr, fastButterfly, slowButterfly)); } - void compileForceOSRExit() + LValue typedArrayLength(Edge baseEdge, ArrayMode arrayMode, LValue base) { - terminate(InadequateCoverage); + if (JSArrayBufferView* view = m_graph.tryGetFoldableView(baseEdge.node(), arrayMode)) + return m_out.constInt32(view->length()); + return m_out.load32(base, m_heaps.JSArrayBufferView_length); } - void compileInvalidationPoint() + LValue typedArrayLength(Edge baseEdge, ArrayMode arrayMode) { - // FIXME: Implement invalidation points in terms of llvm.stackmap. - // https://bugs.webkit.org/show_bug.cgi?id=113647 + return typedArrayLength(baseEdge, arrayMode, lowCell(baseEdge)); } LValue boolify(Edge edge) @@ -2133,6 +2951,27 @@ class LowerDFGToLLVM { LValue length = m_out.load32(stringValue, m_heaps.JSString_length); return m_out.notEqual(length, m_out.int32Zero); } + case UntypedUse: { + LValue value = lowJSValue(m_node->child1()); + + LBasicBlock slowCase = FTL_NEW_BLOCK(m_out, ("Boolify untyped slow case")); + LBasicBlock fastCase = FTL_NEW_BLOCK(m_out, ("Boolify untyped fast case")); + LBasicBlock continuation = FTL_NEW_BLOCK(m_out, ("Boolify untyped continuation")); + + m_out.branch(isNotBoolean(value), slowCase, fastCase); + + LBasicBlock lastNext = m_out.appendTo(fastCase, slowCase); + ValueFromBlock fastResult = m_out.anchor(unboxBoolean(value)); + m_out.jump(continuation); + + m_out.appendTo(slowCase, continuation); + ValueFromBlock slowResult = m_out.anchor(m_out.notNull(vmCall( + m_out.operation(operationConvertJSValueToBoolean), m_callFrame, value))); + m_out.jump(continuation); + + m_out.appendTo(continuation, lastNext); + return m_out.phi(m_out.boolean, fastResult, slowResult); + } default: RELEASE_ASSERT_NOT_REACHED(); return 0; @@ -2239,15 +3078,12 @@ class LowerDFGToLLVM { template void contiguousPutByValOutOfBounds( - FunctionType slowPathFunction, - LValue base, LValue storage, LValue index, LValue value, + FunctionType slowPathFunction, LValue base, LValue storage, LValue index, LValue value, LBasicBlock continuation) { LValue isNotInBounds = m_out.aboveOrEqual( index, m_out.load32(storage, m_heaps.Butterfly_publicLength)); - if (m_node->arrayMode().isInBounds()) - speculate(StoreToHoleOrOutOfBounds, noValue(), 0, isNotInBounds); - else { + if (!m_node->arrayMode().isInBounds()) { LBasicBlock notInBoundsCase = FTL_NEW_BLOCK(m_out, ("PutByVal not in bounds")); LBasicBlock performStore = @@ -2315,12 +3151,12 @@ class LowerDFGToLLVM { Vector results; m_out.branch( - m_out.greaterThanOrEqual(doubleValue, m_out.constDouble(low)), + m_out.doubleGreaterThanOrEqual(doubleValue, m_out.constDouble(low)), greatEnough, slowPath); LBasicBlock lastNext = m_out.appendTo(greatEnough, withinRange); m_out.branch( - m_out.lessThanOrEqual(doubleValue, m_out.constDouble(high)), + m_out.doubleLessThanOrEqual(doubleValue, m_out.constDouble(high)), withinRange, slowPath); m_out.appendTo(withinRange, slowPath); @@ -2342,35 +3178,37 @@ class LowerDFGToLLVM { LValue doubleToInt32(LValue doubleValue) { + if (Output::hasSensibleDoubleToInt()) + return sensibleDoubleToInt32(doubleValue); + double limit = pow(2, 31) - 1; return doubleToInt32(doubleValue, -limit, limit); } - LValue doubleToUInt32(LValue doubleValue) + LValue sensibleDoubleToInt32(LValue doubleValue) { - return doubleToInt32(doubleValue, 0, pow(2, 32) - 1, false); - } - - void speculateBackward( - ExitKind kind, FormattedValue lowValue, Node* highValue, LValue failCondition) - { - appendOSRExit( - kind, lowValue, highValue, failCondition, BackwardSpeculation, FormattedValue()); - } - - void speculateForward( - ExitKind kind, FormattedValue lowValue, Node* highValue, LValue failCondition, - const FormattedValue& recovery) - { - appendOSRExit( - kind, lowValue, highValue, failCondition, ForwardSpeculation, recovery); + LBasicBlock slowPath = FTL_NEW_BLOCK(m_out, ("sensible doubleToInt32 slow path")); + LBasicBlock continuation = FTL_NEW_BLOCK(m_out, ("sensible doubleToInt32 continuation")); + + ValueFromBlock fastResult = m_out.anchor( + m_out.sensibleDoubleToInt(doubleValue)); + m_out.branch( + m_out.equal(fastResult.value(), m_out.constInt32(0x80000000)), + slowPath, continuation); + + LBasicBlock lastNext = m_out.appendTo(slowPath, continuation); + ValueFromBlock slowResult = m_out.anchor( + m_out.call(m_out.operation(toInt32), doubleValue)); + m_out.jump(continuation); + + m_out.appendTo(continuation, lastNext); + return m_out.phi(m_out.int32, fastResult, slowResult); } void speculate( ExitKind kind, FormattedValue lowValue, Node* highValue, LValue failCondition) { - appendOSRExit( - kind, lowValue, highValue, failCondition, m_direction, FormattedValue()); + appendOSRExit(kind, lowValue, highValue, failCondition); } void terminate(ExitKind kind) @@ -2378,41 +3216,21 @@ class LowerDFGToLLVM { speculate(kind, noValue(), 0, m_out.booleanTrue); } - void backwardTypeCheck( - FormattedValue lowValue, Edge highValue, SpeculatedType typesPassedThrough, - LValue failCondition) - { - appendTypeCheck( - lowValue, highValue, typesPassedThrough, failCondition, BackwardSpeculation, - FormattedValue()); - } - - void forwardTypeCheck( - FormattedValue lowValue, Edge highValue, SpeculatedType typesPassedThrough, - LValue failCondition) - { - appendTypeCheck( - lowValue, highValue, typesPassedThrough, failCondition, ForwardSpeculation, - FormattedValue()); - } - void typeCheck( FormattedValue lowValue, Edge highValue, SpeculatedType typesPassedThrough, LValue failCondition) { - appendTypeCheck( - lowValue, highValue, typesPassedThrough, failCondition, m_direction, - FormattedValue()); + appendTypeCheck(lowValue, highValue, typesPassedThrough, failCondition); } void appendTypeCheck( FormattedValue lowValue, Edge highValue, SpeculatedType typesPassedThrough, - LValue failCondition, SpeculationDirection direction, FormattedValue recovery) + LValue failCondition) { if (!m_interpreter.needsTypeCheck(highValue, typesPassedThrough)) return; ASSERT(mayHaveTypeCheck(highValue.useKind())); - appendOSRExit(BadType, lowValue, highValue.node(), failCondition, direction, recovery); + appendOSRExit(BadType, lowValue, highValue.node(), failCondition); m_interpreter.filter(highValue, typesPassedThrough); } @@ -2561,7 +3379,7 @@ class LowerDFGToLLVM { LValue lowCell(Edge edge, OperandSpeculationMode mode = AutomaticOperandSpeculation) { - ASSERT_UNUSED(mode, mode == ManualOperandSpeculation || isCell(edge.useKind())); + ASSERT_UNUSED(mode, mode == ManualOperandSpeculation || DFG::isCell(edge.useKind())); if (edge->op() == JSConstant) { JSValue value = m_graph.valueOfJSConstant(edge.node()); @@ -2870,6 +3688,11 @@ class LowerDFGToLLVM { return m_out.testNonZero64(jsValue, m_tagMask); } + LValue isCell(LValue jsValue) + { + return m_out.testIsZero64(jsValue, m_tagMask); + } + LValue isNotBoolean(LValue jsValue) { return m_out.testNonZero64( @@ -2912,6 +3735,9 @@ class LowerDFGToLLVM { case ObjectOrOtherUse: speculateObjectOrOther(edge); break; + case FinalObjectUse: + speculateFinalObject(edge); + break; case StringUse: speculateString(edge); break; @@ -2992,11 +3818,19 @@ class LowerDFGToLLVM { m_out.bitAnd(indexingType, m_out.constInt8(IsArray | IndexingShapeMask)), m_out.constInt8(IsArray | arrayMode.shapeMask())); - default: + case Array::NonArray: + case Array::OriginalNonArray: + return m_out.equal( + m_out.bitAnd(indexingType, m_out.constInt8(IsArray | IndexingShapeMask)), + m_out.constInt8(arrayMode.shapeMask())); + + case Array::PossiblyArray: return m_out.equal( m_out.bitAnd(indexingType, m_out.constInt8(IndexingShapeMask)), m_out.constInt8(arrayMode.shapeMask())); } + + RELEASE_ASSERT_NOT_REACHED(); } default: @@ -3013,6 +3847,20 @@ class LowerDFGToLLVM { m_out.constIntPtr(classInfo)); } + LValue isType(LValue cell, JSType type) + { + return m_out.equal( + m_out.load8( + m_out.loadPtr(cell, m_heaps.JSCell_structure), + m_heaps.Structure_typeInfoType), + m_out.constInt8(type)); + } + + LValue isNotType(LValue cell, JSType type) + { + return m_out.bitNot(isType(cell, type)); + } + void speculateObject(Edge edge, LValue cell) { FTL_TYPE_CHECK(jsValueValue(cell), edge, SpecObject, isNotObject(cell)); @@ -3059,6 +3907,17 @@ class LowerDFGToLLVM { m_out.appendTo(continuation, lastNext); } + void speculateFinalObject(Edge edge, LValue cell) + { + FTL_TYPE_CHECK( + jsValueValue(cell), edge, SpecFinalObject, isNotType(cell, FinalObjectType)); + } + + void speculateFinalObject(Edge edge) + { + speculateFinalObject(edge, lowCell(edge)); + } + void speculateString(Edge edge, LValue cell) { FTL_TYPE_CHECK(jsValueValue(cell), edge, SpecString, isNotString(cell)); @@ -3125,6 +3984,72 @@ class LowerDFGToLLVM { return m_graph.masqueradesAsUndefinedWatchpointIsStillValid(m_node->codeOrigin); } + LValue loadMarkByte(LValue base) + { + LValue markedBlock = m_out.bitAnd(base, m_out.constInt64(MarkedBlock::blockMask)); + LValue baseOffset = m_out.bitAnd(base, m_out.constInt64(~MarkedBlock::blockMask)); + LValue markByteIndex = m_out.lShr(baseOffset, m_out.constInt64(MarkedBlock::atomShiftAmount + MarkedBlock::markByteShiftAmount)); + return m_out.load8(m_out.baseIndex(m_heaps.MarkedBlock_markBits, markedBlock, markByteIndex, ScaleOne, MarkedBlock::offsetOfMarks())); + } + + void emitStoreBarrier(LValue base, LValue value, Edge& valueEdge) + { +#if ENABLE(GGC) + LBasicBlock continuation = FTL_NEW_BLOCK(m_out, ("Store barrier continuation")); + LBasicBlock isCell = FTL_NEW_BLOCK(m_out, ("Store barrier is cell block")); + + if (m_state.forNode(valueEdge.node()).couldBeType(SpecCell)) + m_out.branch(isNotCell(value), continuation, isCell); + else + m_out.jump(isCell); + + LBasicBlock lastNext = m_out.appendTo(isCell, continuation); + emitStoreBarrier(base); + m_out.jump(continuation); + + m_out.appendTo(continuation, lastNext); +#else + UNUSED_PARAM(base); + UNUSED_PARAM(value); + UNUSED_PARAM(valueEdge); +#endif + } + + void emitStoreBarrier(LValue base) + { +#if ENABLE(GGC) + LBasicBlock continuation = FTL_NEW_BLOCK(m_out, ("Store barrier continuation")); + LBasicBlock isMarked = FTL_NEW_BLOCK(m_out, ("Store barrier is marked block")); + LBasicBlock bufferHasSpace = FTL_NEW_BLOCK(m_out, ("Store barrier buffer is full")); + LBasicBlock bufferIsFull = FTL_NEW_BLOCK(m_out, ("Store barrier buffer is full")); + + // Check the mark byte. + m_out.branch(m_out.isZero8(loadMarkByte(base)), continuation, isMarked); + + // Append to the write barrier buffer. + LBasicBlock lastNext = m_out.appendTo(isMarked, bufferHasSpace); + LValue currentBufferIndex = m_out.load32(m_out.absolute(&vm().heap.writeBarrierBuffer().m_currentIndex)); + LValue bufferCapacity = m_out.load32(m_out.absolute(&vm().heap.writeBarrierBuffer().m_capacity)); + m_out.branch(m_out.lessThan(currentBufferIndex, bufferCapacity), bufferHasSpace, bufferIsFull); + + // Buffer has space, store to it. + m_out.appendTo(bufferHasSpace, bufferIsFull); + LValue writeBarrierBufferBase = m_out.loadPtr(m_out.absolute(&vm().heap.writeBarrierBuffer().m_buffer)); + m_out.storePtr(base, m_out.baseIndex(m_heaps.WriteBarrierBuffer_bufferContents, writeBarrierBufferBase, m_out.zeroExt(currentBufferIndex, m_out.intPtr), ScalePtr)); + m_out.store32(m_out.add(currentBufferIndex, m_out.constInt32(1)), m_out.absolute(&vm().heap.writeBarrierBuffer().m_currentIndex)); + m_out.jump(continuation); + + // Buffer is out of space, flush it. + m_out.appendTo(bufferIsFull, continuation); + vmCall(m_out.operation(operationFlushWriteBarrierBuffer), m_callFrame, base); + m_out.jump(continuation); + + m_out.appendTo(continuation, lastNext); +#else + UNUSED_PARAM(base); +#endif + } + enum ExceptionCheckMode { NoExceptions, CheckExceptions }; LValue vmCall(LValue function, ExceptionCheckMode mode = CheckExceptions) @@ -3195,25 +4120,6 @@ class LowerDFGToLLVM { m_out.appendTo(continuation, lastNext); } - bool isLive(Node* node) - { - return m_live.contains(node); - } - - void use(Edge edge) - { - ASSERT(edge->hasResult()); - if (!edge.doesKill()) - return; - m_live.remove(edge.node()); - } - - // Wrapper used only for DFG_NODE_DO_TO_CHILDREN - void use(Node*, Edge edge) - { - use(edge); - } - LBasicBlock lowBlock(BasicBlock* block) { return m_blocks.get(block); @@ -3221,148 +4127,112 @@ class LowerDFGToLLVM { void initializeOSRExitStateForBlock() { - for (unsigned i = m_valueSources.size(); i--;) { - FlushedAt flush = m_highBlock->ssa->flushAtHead[i]; - switch (flush.format()) { - case DeadFlush: { - // Must consider available nodes instead. - Node* node = m_highBlock->ssa->availabilityAtHead[i]; - if (!node) { - m_valueSources[i] = ValueSource(SourceIsDead); - break; - } - - m_valueSources[i] = ValueSource(node); - break; - } - - case FlushedInt32: - m_valueSources[i] = ValueSource(Int32InJSStack, flush.virtualRegister()); - break; - - case FlushedInt52: - m_valueSources[i] = ValueSource(Int52InJSStack, flush.virtualRegister()); - break; - - case FlushedDouble: - m_valueSources[i] = ValueSource(DoubleInJSStack, flush.virtualRegister()); - break; - - case FlushedCell: - case FlushedBoolean: - case FlushedJSValue: - m_valueSources[i] = ValueSource(ValueInJSStack, flush.virtualRegister()); - break; - } - } + m_availability = m_highBlock->ssa->availabilityAtHead; } void appendOSRExit( - ExitKind kind, FormattedValue lowValue, Node* highValue, LValue failCondition, - SpeculationDirection direction, FormattedValue recovery) + ExitKind kind, FormattedValue lowValue, Node* highValue, LValue failCondition) { - if (Options::ftlTrapsOnOSRExit()) { - LBasicBlock failCase = FTL_NEW_BLOCK(m_out, ("OSR exit failCase for ", m_node)); - LBasicBlock continuation = FTL_NEW_BLOCK(m_out, ("OSR exit continuation for ", m_node)); - - m_out.branch(failCondition, failCase, continuation); - - LBasicBlock lastNext = m_out.appendTo(failCase, continuation); - m_out.trap(); - m_out.unreachable(); - - m_out.appendTo(continuation, lastNext); - return; - } - if (verboseCompilationEnabled()) - dataLog(" OSR exit with value sources: ", m_valueSources, "\n"); - + dataLog(" OSR exit #", m_ftlState.jitCode->osrExit.size(), " with availability: ", m_availability, "\n"); + ASSERT(m_ftlState.jitCode->osrExit.size() == m_ftlState.finalizer->osrExit.size()); - unsigned index = m_ftlState.finalizer->osrExit.size(); m_ftlState.jitCode->osrExit.append(OSRExit( kind, lowValue.format(), m_graph.methodOfGettingAValueProfileFor(highValue), - m_codeOriginForExitTarget, m_codeOriginForExitProfile, m_lastSetOperand.offset(), - m_valueSources.numberOfArguments(), m_valueSources.numberOfLocals())); + m_codeOriginForExitTarget, m_codeOriginForExitProfile, + m_availability.numberOfArguments(), m_availability.numberOfLocals())); m_ftlState.finalizer->osrExit.append(OSRExitCompilationInfo()); OSRExit& exit = m_ftlState.jitCode->osrExit.last(); - OSRExitCompilationInfo& info = m_ftlState.finalizer->osrExit.last(); LBasicBlock lastNext = 0; LBasicBlock continuation = 0; - if (!Options::useLLVMOSRExitIntrinsic()) { - LBasicBlock failCase = FTL_NEW_BLOCK(m_out, ("OSR exit failCase for ", m_node)); - continuation = FTL_NEW_BLOCK(m_out, ("OSR exit continuation for ", m_node)); - - m_out.branch(failCondition, failCase, continuation); - - if (generateExitThunks()) { - m_out.appendTo(m_prologue); - info.m_thunkAddressValue = buildAlloca(m_out.m_builder, m_out.intPtr); - } + LBasicBlock failCase = FTL_NEW_BLOCK(m_out, ("OSR exit failCase for ", m_node)); + continuation = FTL_NEW_BLOCK(m_out, ("OSR exit continuation for ", m_node)); - lastNext = m_out.appendTo(failCase, continuation); - } + m_out.branch(failCondition, failCase, continuation); - if (Options::ftlOSRExitOmitsMarshalling()) { - m_out.call( - m_out.intToPtr( - m_out.get(info.m_thunkAddressValue), - pointerType(functionType(m_out.voidType)))); - } else - emitOSRExitCall(failCondition, index, exit, info, lowValue, direction, recovery); + lastNext = m_out.appendTo(failCase, continuation); - if (!Options::useLLVMOSRExitIntrinsic()) { - m_out.unreachable(); - - m_out.appendTo(continuation, lastNext); + emitOSRExitCall(exit, lowValue); - if (generateExitThunks()) - m_exitThunkGenerator.emitThunk(index); - } + m_out.unreachable(); + + m_out.appendTo(continuation, lastNext); } - void emitOSRExitCall( - LValue failCondition, unsigned index, OSRExit& exit, OSRExitCompilationInfo& info, - FormattedValue lowValue, SpeculationDirection direction, FormattedValue recovery) + void emitOSRExitCall(OSRExit& exit, FormattedValue lowValue) { ExitArgumentList arguments; - if (Options::useLLVMOSRExitIntrinsic()) { - arguments.append(failCondition); - arguments.append(m_out.constInt32(index)); - } + CodeOrigin codeOrigin = exit.m_codeOrigin; + + buildExitArguments(exit, arguments, lowValue, codeOrigin); + callStackmap(exit, arguments); + } + + void buildExitArguments( + OSRExit& exit, ExitArgumentList& arguments, FormattedValue lowValue, + CodeOrigin codeOrigin) + { arguments.append(m_callFrame); if (!!lowValue) arguments.append(lowValue.value()); for (unsigned i = 0; i < exit.m_values.size(); ++i) { - ValueSource source = m_valueSources[i]; + int operand = exit.m_values.operandForIndex(i); + bool isLive = m_graph.isLiveInBytecode(VirtualRegister(operand), codeOrigin); + if (!isLive) { + exit.m_values[i] = ExitValue::dead(); + continue; + } - switch (source.kind()) { - case ValueInJSStack: - exit.m_values[i] = ExitValue::inJSStack(source.virtualRegister()); - break; - case Int32InJSStack: - exit.m_values[i] = ExitValue::inJSStackAsInt32(source.virtualRegister()); + Availability availability = m_availability[i]; + FlushedAt flush = availability.flushedAt(); + switch (flush.format()) { + case DeadFlush: + case ConflictingFlush: + if (availability.hasNode()) { + addExitArgumentForNode(exit, arguments, i, availability.node()); + break; + } + + if (Options::validateFTLOSRExitLiveness()) { + dataLog("Expected r", operand, " to be available but it wasn't.\n"); + RELEASE_ASSERT_NOT_REACHED(); + } + + // This means that the DFG's DCE proved that the value is dead in bytecode + // even though the bytecode liveness analysis thinks it's live. This is + // acceptable since the DFG's DCE is by design more aggressive while still + // being sound. + exit.m_values[i] = ExitValue::dead(); break; - case Int52InJSStack: - exit.m_values[i] = ExitValue::inJSStackAsInt52(source.virtualRegister()); + + case FlushedJSValue: + case FlushedCell: + case FlushedBoolean: + exit.m_values[i] = ExitValue::inJSStack(flush.virtualRegister()); break; - case DoubleInJSStack: - exit.m_values[i] = ExitValue::inJSStackAsDouble(source.virtualRegister()); + + case FlushedInt32: + exit.m_values[i] = ExitValue::inJSStackAsInt32(flush.virtualRegister()); break; - case SourceIsDead: - exit.m_values[i] = ExitValue::dead(); + + case FlushedInt52: + exit.m_values[i] = ExitValue::inJSStackAsInt52(flush.virtualRegister()); break; - case HaveNode: - addExitArgumentForNode(exit, arguments, i, source.node()); + + case FlushedDouble: + exit.m_values[i] = ExitValue::inJSStackAsDouble(flush.virtualRegister()); break; - default: + + case FlushedArguments: + // FIXME: implement PhantomArguments. + // https://bugs.webkit.org/show_bug.cgi?id=113986 RELEASE_ASSERT_NOT_REACHED(); break; } @@ -3370,37 +4240,15 @@ class LowerDFGToLLVM { if (verboseCompilationEnabled()) dataLog(" Exit values: ", exit.m_values, "\n"); + } + + void callStackmap(OSRExit& exit, ExitArgumentList& arguments) + { + exit.m_stackmapID = m_stackmapIDs++; + arguments.insert(0, m_out.constInt32(MacroAssembler::maxJumpReplacementSize())); + arguments.insert(0, m_out.constInt32(exit.m_stackmapID)); - if (direction == ForwardSpeculation) { - ASSERT(m_node); - exit.convertToForward(m_highBlock, m_node, m_nodeIndex, recovery, arguments); - } - - // So, the really lame thing here is that we have to build an LLVM function type. - // Booo. - Vector argumentTypes; - for (unsigned i = 0; i < arguments.size(); ++i) - argumentTypes.append(typeOf(arguments[i])); - - if (Options::useLLVMOSRExitIntrinsic()) { - m_out.call(m_out.osrExitIntrinsic(), arguments); - return; - } - - if (Options::ftlUsesStackmaps()) { - exit.m_stackmapID = m_stackmapIDs++; - arguments.insert(0, m_out.constInt32(MacroAssembler::maxJumpReplacementSize())); - arguments.insert(0, m_out.constInt32(exit.m_stackmapID)); - - m_out.call(m_out.webkitStackmapIntrinsic(), arguments); - return; - } - - m_out.call( - m_out.intToPtr( - m_out.get(info.m_thunkAddressValue), - pointerType(functionType(m_out.voidType, argumentTypes))), - arguments); + m_out.call(m_out.stackmapIntrinsic(), arguments); } void addExitArgumentForNode( @@ -3412,53 +4260,6 @@ class LowerDFGToLLVM { if (tryToSetConstantExitArgument(exit, index, node)) return; - if (!isLive(node)) { - bool found = false; - - if (permitsOSRBackwardRewiring(node->op())) { - node = node->child1().node(); - if (tryToSetConstantExitArgument(exit, index, node)) - return; - if (isLive(node)) - found = true; - } - - if (!found) { - Node* bestNode = 0; - unsigned bestScore = 0; - - HashSet::iterator iter = m_live.begin(); - HashSet::iterator end = m_live.end(); - for (; iter != end; ++iter) { - Node* candidate = *iter; - if (candidate->flags() & NodeHasVarArgs) - continue; - if (!candidate->child1()) - continue; - if (candidate->child1() != node) - continue; - unsigned myScore = forwardRewiringSelectionScore(candidate->op()); - if (myScore <= bestScore) - continue; - bestNode = candidate; - bestScore = myScore; - } - - if (bestNode) { - ASSERT(isLive(bestNode)); - node = bestNode; - found = true; - } - } - - if (!found) { - exit.m_values[index] = ExitValue::dead(); - return; - } - } - - ASSERT(isLive(node)); - LoweredNodeValue value = m_int32Values.get(node); if (isValid(value)) { addExitArgument(exit, arguments, index, ValueFormatInt32, value.value()); @@ -3479,11 +4280,7 @@ class LowerDFGToLLVM { value = m_booleanValues.get(node); if (isValid(value)) { - LValue valueToPass; - if (Options::ftlUsesStackmaps()) - valueToPass = m_out.zeroExt(value.value(), m_out.int32); - else - valueToPass = value.value(); + LValue valueToPass = m_out.zeroExt(value.value(), m_out.int32); addExitArgument(exit, arguments, index, ValueFormatBoolean, valueToPass); return; } @@ -3532,55 +4329,6 @@ class LowerDFGToLLVM { arguments.append(value); } - void linkOSRExitsAndCompleteInitializationBlocks() - { - MacroAssemblerCodeRef osrExitThunk = - vm().getCTIStub(osrExitGenerationWithoutStackMapThunkGenerator); - CodeLocationLabel target = CodeLocationLabel(osrExitThunk.code()); - - m_out.appendTo(m_prologue); - m_out.jump(m_initialization); - - m_out.appendTo(m_initialization); - - if (m_exitThunkGenerator.didThings()) { - OwnPtr linkBuffer = adoptPtr(new LinkBuffer( - vm(), &m_exitThunkGenerator, m_ftlState.graph.m_codeBlock, - JITCompilationMustSucceed)); - - ASSERT(m_ftlState.finalizer->osrExit.size() == m_ftlState.jitCode->osrExit.size()); - - for (unsigned i = 0; i < m_ftlState.finalizer->osrExit.size(); ++i) { - OSRExitCompilationInfo& info = m_ftlState.finalizer->osrExit[i]; - OSRExit& exit = m_ftlState.jitCode->osrExit[i]; - - linkBuffer->link(info.m_thunkJump, target); - - m_out.set( - m_out.constIntPtr( - linkBuffer->locationOf(info.m_thunkLabel).executableAddress()), - info.m_thunkAddressValue); - - exit.m_patchableCodeOffset = linkBuffer->offsetOf(info.m_thunkJump); - } - - m_ftlState.finalizer->exitThunksLinkBuffer = linkBuffer.release(); - } - - m_out.jump(lowBlock(m_graph.block(0))); - } - - void observeMovHint(Node* node) - { - ASSERT(node->containsMovHint()); - ASSERT(node->op() != ZombieHint); - - VirtualRegister operand = node->local(); - - m_lastSetOperand = operand; - m_valueSources.operand(operand) = ValueSource(node->child1().node()); - } - void setInt32(Node* node, LValue value) { m_int32Values.set(node, LoweredNodeValue(value, m_highBlock)); @@ -3723,7 +4471,6 @@ class LowerDFGToLLVM { Output m_out; LBasicBlock m_prologue; - LBasicBlock m_initialization; HashMap m_blocks; LValue m_callFrame; @@ -3737,13 +4484,10 @@ class LowerDFGToLLVM { HashMap m_booleanValues; HashMap m_storageValues; HashMap m_doubleValues; - HashSet m_live; HashMap m_phis; - Operands m_valueSources; - VirtualRegister m_lastSetOperand; - ExitThunkGenerator m_exitThunkGenerator; + Operands m_availability; InPlaceAbstractState m_state; AbstractInterpreter m_interpreter; @@ -3755,7 +4499,6 @@ class LowerDFGToLLVM { CodeOrigin m_codeOriginForExitProfile; unsigned m_nodeIndex; Node* m_node; - SpeculationDirection m_direction; uint32_t m_stackmapIDs; }; diff --git a/JavaScriptCore/ftl/FTLOSREntry.cpp b/JavaScriptCore/ftl/FTLOSREntry.cpp index 09106246..18504605 100644 --- a/JavaScriptCore/ftl/FTLOSREntry.cpp +++ b/JavaScriptCore/ftl/FTLOSREntry.cpp @@ -30,6 +30,8 @@ #include "CodeBlock.h" #include "DFGJITCode.h" #include "FTLForOSREntryJITCode.h" +#include "JSStackInlines.h" +#include "OperandsInlines.h" #if ENABLE(FTL_JIT) @@ -77,10 +79,10 @@ void* prepareOSREntry( for (int local = values.numberOfLocals(); local--;) scratch[local] = JSValue::encode(values.local(local)); - int stackFrameSize = entryCodeBlock->m_numCalleeRegisters; + int stackFrameSize = entryCode->common.requiredRegisterCountForExecutionAndExit(); if (!vm.interpreter->stack().grow(&exec->registers()[virtualRegisterForLocal(stackFrameSize).offset()])) { if (Options::verboseOSR()) - dataLog(" OSR failed bcause stack growth failed.\n"); + dataLog(" OSR failed because stack growth failed.\n"); return 0; } diff --git a/JavaScriptCore/ftl/FTLOSRExit.cpp b/JavaScriptCore/ftl/FTLOSRExit.cpp index 65f53a68..00ea014c 100644 --- a/JavaScriptCore/ftl/FTLOSRExit.cpp +++ b/JavaScriptCore/ftl/FTLOSRExit.cpp @@ -43,13 +43,12 @@ using namespace DFG; OSRExit::OSRExit( ExitKind exitKind, ValueFormat profileValueFormat, MethodOfGettingAValueProfile valueProfile, CodeOrigin codeOrigin, - CodeOrigin originForProfile, int lastSetOperand, unsigned numberOfArguments, + CodeOrigin originForProfile, unsigned numberOfArguments, unsigned numberOfLocals) : OSRExitBase(exitKind, codeOrigin, originForProfile) , m_profileValueFormat(profileValueFormat) , m_valueProfile(valueProfile) , m_patchableCodeOffset(0) - , m_lastSetOperand(lastSetOperand) , m_values(numberOfArguments, numberOfLocals) { } @@ -62,42 +61,6 @@ CodeLocationJump OSRExit::codeLocationForRepatch(CodeBlock* ftlCodeBlock) const m_patchableCodeOffset); } -void OSRExit::convertToForward( - BasicBlock* block, Node* currentNode, unsigned nodeIndex, - const FormattedValue &value, ExitArgumentList& arguments) -{ - Node* node; - Node* lastMovHint; - if (!doSearchForForwardConversion(block, currentNode, nodeIndex, !!value, node, lastMovHint)) - return; - - ASSERT(node->codeOrigin != currentNode->codeOrigin); - - m_codeOrigin = node->codeOrigin; - - if (!value) - return; - - VirtualRegister overriddenOperand = lastMovHint->local(); - m_lastSetOperand = overriddenOperand; - - // Is the value for this operand being passed as an argument to the exit, or is - // it something else? If it's an argument already, then replace that argument; - // otherwise add another argument. - if (m_values.operand(overriddenOperand).isArgument()) { - ExitArgument exitArgument = m_values.operand(overriddenOperand).exitArgument(); - arguments[exitArgument.argument()] = value.value(); - m_values.operand(overriddenOperand) = ExitValue::exitArgument( - exitArgument.withFormat(value.format())); - return; - } - - unsigned argument = arguments.size(); - arguments.append(value.value()); - m_values.operand(m_lastSetOperand) = ExitValue::exitArgument( - ExitArgument(value.format(), argument)); -} - } } // namespace JSC::FTL #endif // ENABLE(FTL_JIT) diff --git a/JavaScriptCore/ftl/FTLOSRExit.h b/JavaScriptCore/ftl/FTLOSRExit.h index 45d2fefb..4e479ebd 100644 --- a/JavaScriptCore/ftl/FTLOSRExit.h +++ b/JavaScriptCore/ftl/FTLOSRExit.h @@ -145,7 +145,7 @@ namespace JSC { namespace FTL { struct OSRExit : public DFG::OSRExitBase { OSRExit( ExitKind, ValueFormat profileValueFormat, MethodOfGettingAValueProfile, - CodeOrigin, CodeOrigin originForProfile, int lastSetOperand, + CodeOrigin, CodeOrigin originForProfile, unsigned numberOfArguments, unsigned numberOfLocals); MacroAssemblerCodeRef m_code; @@ -161,17 +161,11 @@ struct OSRExit : public DFG::OSRExitBase { // Offset within the exit stubs of the stub for this exit. unsigned m_patchableCodeOffset; - VirtualRegister m_lastSetOperand; - Operands m_values; uint32_t m_stackmapID; CodeLocationJump codeLocationForRepatch(CodeBlock* ftlCodeBlock) const; - - void convertToForward( - DFG::BasicBlock*, DFG::Node* currentNode, unsigned nodeIndex, - const FormattedValue&, ExitArgumentList& arguments); }; } } // namespace JSC::FTL diff --git a/JavaScriptCore/ftl/FTLOSRExitCompilationInfo.h b/JavaScriptCore/ftl/FTLOSRExitCompilationInfo.h index 1e7266f4..796c9d69 100644 --- a/JavaScriptCore/ftl/FTLOSRExitCompilationInfo.h +++ b/JavaScriptCore/ftl/FTLOSRExitCompilationInfo.h @@ -37,14 +37,14 @@ namespace JSC { namespace FTL { struct OSRExitCompilationInfo { OSRExitCompilationInfo() - : m_thunkAddressValue(0) + : m_isInvalidationPoint(false) { } MacroAssembler::Label m_thunkLabel; MacroAssembler::PatchableJump m_thunkJump; CodeLocationLabel m_thunkAddress; - LValue m_thunkAddressValue; + bool m_isInvalidationPoint; }; } } // namespace JSC::FTL diff --git a/JavaScriptCore/ftl/FTLOSRExitCompiler.cpp b/JavaScriptCore/ftl/FTLOSRExitCompiler.cpp index 36fba88c..076a495e 100644 --- a/JavaScriptCore/ftl/FTLOSRExitCompiler.cpp +++ b/JavaScriptCore/ftl/FTLOSRExitCompiler.cpp @@ -30,11 +30,11 @@ #include "DFGOSRExitCompilerCommon.h" #include "DFGOSRExitPreparation.h" -#include "FTLCArgumentGetter.h" #include "FTLExitArgumentForOperand.h" #include "FTLJITCode.h" #include "FTLOSRExit.h" #include "FTLSaveRestore.h" +#include "OperandsInlines.h" #include "Operations.h" #include "RepatchBuffer.h" @@ -42,11 +42,7 @@ namespace JSC { namespace FTL { using namespace DFG; -// This implements two flavors of OSR exit: one that involves having LLVM intrinsics to help -// OSR exit, and one that doesn't. The one that doesn't will get killed off, so we don't attempt -// to share code between the two. - -static void compileStubWithOSRExitStackmap( +static void compileStub( unsigned exitID, JITCode* jitCode, OSRExit& exit, VM* vm, CodeBlock* codeBlock) { StackMaps::Record* record; @@ -59,6 +55,9 @@ static void compileStubWithOSRExitStackmap( RELEASE_ASSERT(record->patchpointID == exit.m_stackmapID); + // This code requires framePointerRegister is the same as callFrameRegister + static_assert(MacroAssembler::framePointerRegister == GPRInfo::callFrameRegister, "MacroAssembler::framePointerRegister and GPRInfo::callFrameRegister must be the same"); + CCallHelpers jit(vm, codeBlock); // We need scratch space to save all registers and to build up the JSStack. @@ -80,7 +79,8 @@ static void compileStubWithOSRExitStackmap( // call frame. // Get the call frame and tag thingies. - record->locations[0].restoreInto(jit, jitCode->stackmaps, registerScratch, GPRInfo::callFrameRegister); + // Restore the exiting function's callFrame value into a regT4 + record->locations[0].restoreInto(jit, jitCode->stackmaps, registerScratch, GPRInfo::regT4); jit.move(MacroAssembler::TrustedImm64(TagTypeNumber), GPRInfo::tagTypeNumberRegister); jit.move(MacroAssembler::TrustedImm64(TagMask), GPRInfo::tagMaskRegister); @@ -130,7 +130,7 @@ static void compileStubWithOSRExitStackmap( case ExitValueInJSStackAsInt32: case ExitValueInJSStackAsInt52: case ExitValueInJSStackAsDouble: - jit.load64(AssemblyHelpers::addressFor(value.virtualRegister()), GPRInfo::regT0); + jit.load64(AssemblyHelpers::addressFor(value.virtualRegister(), GPRInfo::regT4), GPRInfo::regT0); break; default: @@ -150,195 +150,32 @@ static void compileStubWithOSRExitStackmap( jit.load64(scratch + index, GPRInfo::regT0); reboxAccordingToFormat( value.valueFormat(), jit, GPRInfo::regT0, GPRInfo::regT1, GPRInfo::regT2); - jit.store64(GPRInfo::regT0, AssemblyHelpers::addressFor(operand)); + jit.store64(GPRInfo::regT0, AssemblyHelpers::addressFor(static_cast(operand), GPRInfo::regT4)); } - handleExitCounts(jit, exit); - reifyInlinedCallFrames(jit, exit); - + // Restore the old stack pointer and then put regT4 into callFrameRegister. The idea is + // that the FTL call frame is pushed onto the JS call frame and we can recover the old + // value of the stack pointer by popping the FTL call frame. We already know what the + // frame pointer in the JS call frame was because it would have been passed as an argument + // to the FTL call frame. jit.move(MacroAssembler::framePointerRegister, MacroAssembler::stackPointerRegister); - jit.pop(MacroAssembler::framePointerRegister); - jit.pop(GPRInfo::nonArgGPR0); // ignore the result. - - if (exit.m_lastSetOperand.isValid()) { - jit.load64( - AssemblyHelpers::addressFor(exit.m_lastSetOperand), GPRInfo::cachedResultRegister); - } - - adjustAndJumpToTarget(jit, exit); - - LinkBuffer patchBuffer(*vm, &jit, codeBlock); - exit.m_code = FINALIZE_CODE_IF( - shouldShowDisassembly(), - patchBuffer, - ("FTL OSR exit #%u (bc#%u, %s) from %s, with operands = %s, and record = %s", - exitID, exit.m_codeOrigin.bytecodeIndex, - exitKindToString(exit.m_kind), toCString(*codeBlock).data(), - toCString(ignoringContext(exit.m_values)).data(), - toCString(*record).data())); -} - -static void compileStubWithoutOSRExitStackmap( - unsigned exitID, OSRExit& exit, VM* vm, CodeBlock* codeBlock) -{ - CCallHelpers jit(vm, codeBlock); - - // Make ourselves look like a real C function. - jit.push(MacroAssembler::framePointerRegister); - jit.move(MacroAssembler::stackPointerRegister, MacroAssembler::framePointerRegister); - - // This is actually fairly easy, even though it is horribly gross. We know that - // LLVM would have passes us all of the state via arguments. We know how to get - // the arguments. And, we know how to pop stack back to the JIT stack frame, sort - // of: we know that it's two frames beneath us. This is terrible and I feel - // ashamed of it, but it will work for now. - - CArgumentGetter arguments(jit, 2); - - // First recover our call frame and tag thingies. - arguments.loadNextPtr(GPRInfo::callFrameRegister); - jit.move(MacroAssembler::TrustedImm64(TagTypeNumber), GPRInfo::tagTypeNumberRegister); - jit.move(MacroAssembler::TrustedImm64(TagMask), GPRInfo::tagMaskRegister); - - // Do some value profiling. - if (exit.m_profileValueFormat != InvalidValueFormat) { - arguments.loadNextAndBox(exit.m_profileValueFormat, GPRInfo::nonArgGPR0); - - if (exit.m_kind == BadCache || exit.m_kind == BadIndexingType) { - CodeOrigin codeOrigin = exit.m_codeOriginForExitProfile; - if (ArrayProfile* arrayProfile = jit.baselineCodeBlockFor(codeOrigin)->getArrayProfile(codeOrigin.bytecodeIndex)) { - jit.loadPtr(MacroAssembler::Address(GPRInfo::nonArgGPR0, JSCell::structureOffset()), GPRInfo::nonArgGPR1); - jit.storePtr(GPRInfo::nonArgGPR1, arrayProfile->addressOfLastSeenStructure()); - jit.load8(MacroAssembler::Address(GPRInfo::nonArgGPR1, Structure::indexingTypeOffset()), GPRInfo::nonArgGPR1); - jit.move(MacroAssembler::TrustedImm32(1), GPRInfo::nonArgGPR2); - jit.lshift32(GPRInfo::nonArgGPR1, GPRInfo::nonArgGPR2); - jit.or32(GPRInfo::nonArgGPR2, MacroAssembler::AbsoluteAddress(arrayProfile->addressOfArrayModes())); - } - } - - if (!!exit.m_valueProfile) - jit.store64(GPRInfo::nonArgGPR0, exit.m_valueProfile.getSpecFailBucket(0)); - } - - // Use a scratch buffer to transfer all values. - ScratchBuffer* scratchBuffer = vm->scratchBufferForSize(sizeof(EncodedJSValue) * exit.m_values.size()); - EncodedJSValue* scratch = scratchBuffer ? static_cast(scratchBuffer->dataBuffer()) : 0; - - // Start by dumping all argument exit values to the stack. - - Vector sortedArguments; - for (unsigned i = exit.m_values.size(); i--;) { - ExitValue value = exit.m_values[i]; - int operand = exit.m_values.operandForIndex(i); - - if (!value.isArgument()) - continue; - - sortedArguments.append(ExitArgumentForOperand(value.exitArgument(), VirtualRegister(operand))); - } - std::sort(sortedArguments.begin(), sortedArguments.end(), lesserArgumentIndex); - - for (unsigned i = 0; i < sortedArguments.size(); ++i) { - ExitArgumentForOperand argument = sortedArguments[i]; - - arguments.loadNextAndBox(argument.exitArgument().format(), GPRInfo::nonArgGPR0); - jit.store64( - GPRInfo::nonArgGPR0, scratch + exit.m_values.indexForOperand(argument.operand())); - } - - // All temp registers are free at this point. - - // Move anything on the stack into the appropriate place in the scratch buffer. - - for (unsigned i = exit.m_values.size(); i--;) { - ExitValue value = exit.m_values[i]; - - switch (value.kind()) { - case ExitValueInJSStack: - jit.load64(AssemblyHelpers::addressFor(value.virtualRegister()), GPRInfo::regT0); - break; - case ExitValueInJSStackAsInt32: - jit.load32( - AssemblyHelpers::addressFor(value.virtualRegister()).withOffset( - OBJECT_OFFSETOF(EncodedValueDescriptor, asBits.payload)), - GPRInfo::regT0); - jit.or64(GPRInfo::tagTypeNumberRegister, GPRInfo::regT0); - break; - case ExitValueInJSStackAsInt52: - jit.load64(AssemblyHelpers::addressFor(value.virtualRegister()), GPRInfo::regT0); - jit.rshift64( - AssemblyHelpers::TrustedImm32(JSValue::int52ShiftAmount), GPRInfo::regT0); - jit.boxInt52(GPRInfo::regT0, GPRInfo::regT0, GPRInfo::regT1, FPRInfo::fpRegT0); - break; - case ExitValueInJSStackAsDouble: - jit.loadDouble(AssemblyHelpers::addressFor(value.virtualRegister()), FPRInfo::fpRegT0); - jit.boxDouble(FPRInfo::fpRegT0, GPRInfo::regT0); - break; - case ExitValueDead: - case ExitValueConstant: - case ExitValueArgument: - // Don't do anything for these. - continue; - default: - RELEASE_ASSERT_NOT_REACHED(); - break; - } - - jit.store64(GPRInfo::regT0, scratch + i); - } - - // Move everything from the scratch buffer to the stack; this also reifies constants. - - for (unsigned i = exit.m_values.size(); i--;) { - ExitValue value = exit.m_values[i]; - int operand = exit.m_values.operandForIndex(i); - - MacroAssembler::Address address = AssemblyHelpers::addressFor(operand); - - switch (value.kind()) { - case ExitValueDead: - jit.store64(MacroAssembler::TrustedImm64(JSValue::encode(jsUndefined())), address); - break; - case ExitValueConstant: - jit.store64(MacroAssembler::TrustedImm64(JSValue::encode(value.constant())), address); - break; - case ExitValueInJSStack: - case ExitValueInJSStackAsInt32: - case ExitValueInJSStackAsInt52: - case ExitValueInJSStackAsDouble: - case ExitValueArgument: - jit.load64(scratch + i, GPRInfo::regT0); - jit.store64(GPRInfo::regT0, address); - break; - default: - RELEASE_ASSERT_NOT_REACHED(); - break; - } - } + jit.pop(GPRInfo::nonArgGPR0); + jit.pop(GPRInfo::nonArgGPR0); + jit.move(GPRInfo::regT4, GPRInfo::callFrameRegister); handleExitCounts(jit, exit); reifyInlinedCallFrames(jit, exit); - - jit.pop(MacroAssembler::framePointerRegister); - jit.move(MacroAssembler::framePointerRegister, MacroAssembler::stackPointerRegister); - jit.pop(MacroAssembler::framePointerRegister); - jit.pop(GPRInfo::nonArgGPR0); // ignore the result. - - if (exit.m_lastSetOperand.isValid()) { - jit.load64( - AssemblyHelpers::addressFor(exit.m_lastSetOperand), GPRInfo::cachedResultRegister); - } - adjustAndJumpToTarget(jit, exit); LinkBuffer patchBuffer(*vm, &jit, codeBlock); exit.m_code = FINALIZE_CODE_IF( shouldShowDisassembly(), patchBuffer, - ("FTL OSR exit #%u (bc#%u, %s) from %s, with operands = %s", - exitID, exit.m_codeOrigin.bytecodeIndex, + ("FTL OSR exit #%u (%s, %s) from %s, with operands = %s, and record = %s", + exitID, toCString(exit.m_codeOrigin).data(), exitKindToString(exit.m_kind), toCString(*codeBlock).data(), - toCString(ignoringContext(exit.m_values)).data())); + toCString(ignoringContext(exit.m_values)).data(), + toCString(*record).data())); } extern "C" void* compileFTLOSRExit(ExecState* exec, unsigned exitID) @@ -361,10 +198,7 @@ extern "C" void* compileFTLOSRExit(ExecState* exec, unsigned exitID) prepareCodeOriginForOSRExit(exec, exit.m_codeOrigin); - if (Options::ftlUsesStackmaps()) - compileStubWithOSRExitStackmap(exitID, jitCode, exit, vm, codeBlock); - else - compileStubWithoutOSRExitStackmap(exitID, exit, vm, codeBlock); + compileStub(exitID, jitCode, exit, vm, codeBlock); RepatchBuffer repatchBuffer(codeBlock); repatchBuffer.relink( diff --git a/JavaScriptCore/ftl/FTLOutput.h b/JavaScriptCore/ftl/FTLOutput.h index c3df088d..2ec87350 100644 --- a/JavaScriptCore/ftl/FTLOutput.h +++ b/JavaScriptCore/ftl/FTLOutput.h @@ -154,6 +154,8 @@ class Output : public IntrinsicRepository { LValue lShr(LValue left, LValue right) { return buildLShr(m_builder, left, right); } LValue bitNot(LValue value) { return buildNot(m_builder, value); } + LValue insertElement(LValue vector, LValue element, LValue index) { return buildInsertElement(m_builder, vector, element, index); } + LValue addWithOverflow32(LValue left, LValue right) { return call(addWithOverflow32Intrinsic(), left, right); @@ -183,6 +185,17 @@ class Output : public IntrinsicRepository { return call(doubleAbsIntrinsic(), value); } + static bool hasSensibleDoubleToInt() { return isX86(); } + LValue sensibleDoubleToInt(LValue value) + { + RELEASE_ASSERT(isX86()); + return call( + x86SSE2CvtTSD2SIIntrinsic(), + insertElement( + insertElement(getUndef(vectorType(doubleType, 2)), value, int32Zero), + doubleZero, int32One)); + } + LValue signExt(LValue value, LType type) { return buildSExt(m_builder, value, type); } LValue zeroExt(LValue value, LType type) { return buildZExt(m_builder, value, type); } LValue fpToInt(LValue value, LType type) { return buildFPToSI(m_builder, value, type); } @@ -199,6 +212,7 @@ class Output : public IntrinsicRepository { LValue intToPtr(LValue value, LType type) { return buildIntToPtr(m_builder, value, type); } LValue bitCast(LValue value, LType type) { return buildBitCast(m_builder, value, type); } + LValue alloca(LType type) { return buildAlloca(m_builder, type); } LValue get(LValue reference) { return buildLoad(m_builder, reference); } LValue set(LValue value, LValue reference) { return buildStore(m_builder, value, reference); } @@ -294,33 +308,37 @@ class Output : public IntrinsicRepository { LValue load32(LValue base, const AbstractField& field) { return load32(address(base, field)); } LValue load64(LValue base, const AbstractField& field) { return load64(address(base, field)); } LValue loadPtr(LValue base, const AbstractField& field) { return loadPtr(address(base, field)); } + LValue loadDouble(LValue base, const AbstractField& field) { return loadDouble(address(base, field)); } void store32(LValue value, LValue base, const AbstractField& field) { store32(value, address(base, field)); } void store64(LValue value, LValue base, const AbstractField& field) { store64(value, address(base, field)); } void storePtr(LValue value, LValue base, const AbstractField& field) { storePtr(value, address(base, field)); } + void storeDouble(LValue value, LValue base, const AbstractField& field) { storeDouble(value, address(base, field)); } + + LValue icmp(LIntPredicate cond, LValue left, LValue right) { return buildICmp(m_builder, cond, left, right); } + LValue equal(LValue left, LValue right) { return icmp(LLVMIntEQ, left, right); } + LValue notEqual(LValue left, LValue right) { return icmp(LLVMIntNE, left, right); } + LValue above(LValue left, LValue right) { return icmp(LLVMIntUGT, left, right); } + LValue aboveOrEqual(LValue left, LValue right) { return icmp(LLVMIntUGE, left, right); } + LValue below(LValue left, LValue right) { return icmp(LLVMIntULT, left, right); } + LValue belowOrEqual(LValue left, LValue right) { return icmp(LLVMIntULE, left, right); } + LValue greaterThan(LValue left, LValue right) { return icmp(LLVMIntSGT, left, right); } + LValue greaterThanOrEqual(LValue left, LValue right) { return icmp(LLVMIntSGE, left, right); } + LValue lessThan(LValue left, LValue right) { return icmp(LLVMIntSLT, left, right); } + LValue lessThanOrEqual(LValue left, LValue right) { return icmp(LLVMIntSLE, left, right); } - LValue equal(LValue left, LValue right) { return buildICmp(m_builder, LLVMIntEQ, left, right); } - LValue notEqual(LValue left, LValue right) { return buildICmp(m_builder, LLVMIntNE, left, right); } - LValue above(LValue left, LValue right) { return buildICmp(m_builder, LLVMIntUGT, left, right); } - LValue aboveOrEqual(LValue left, LValue right) { return buildICmp(m_builder, LLVMIntUGE, left, right); } - LValue below(LValue left, LValue right) { return buildICmp(m_builder, LLVMIntULT, left, right); } - LValue belowOrEqual(LValue left, LValue right) { return buildICmp(m_builder, LLVMIntULE, left, right); } - LValue greaterThan(LValue left, LValue right) { return buildICmp(m_builder, LLVMIntSGT, left, right); } - LValue greaterThanOrEqual(LValue left, LValue right) { return buildICmp(m_builder, LLVMIntSGE, left, right); } - LValue lessThan(LValue left, LValue right) { return buildICmp(m_builder, LLVMIntSLT, left, right); } - LValue lessThanOrEqual(LValue left, LValue right) { return buildICmp(m_builder, LLVMIntSLE, left, right); } - - LValue doubleEqual(LValue left, LValue right) { return buildFCmp(m_builder, LLVMRealOEQ, left, right); } - LValue doubleNotEqualOrUnordered(LValue left, LValue right) { return buildFCmp(m_builder, LLVMRealUNE, left, right); } - LValue doubleLessThan(LValue left, LValue right) { return buildFCmp(m_builder, LLVMRealOLT, left, right); } - LValue doubleLessThanOrEqual(LValue left, LValue right) { return buildFCmp(m_builder, LLVMRealOLE, left, right); } - LValue doubleGreaterThan(LValue left, LValue right) { return buildFCmp(m_builder, LLVMRealOGT, left, right); } - LValue doubleGreaterThanOrEqual(LValue left, LValue right) { return buildFCmp(m_builder, LLVMRealOGE, left, right); } - LValue doubleEqualOrUnordered(LValue left, LValue right) { return buildFCmp(m_builder, LLVMRealUEQ, left, right); } - LValue doubleNotEqual(LValue left, LValue right) { return buildFCmp(m_builder, LLVMRealONE, left, right); } - LValue doubleLessThanOrUnordered(LValue left, LValue right) { return buildFCmp(m_builder, LLVMRealULT, left, right); } - LValue doubleLessThanOrEqualOrUnordered(LValue left, LValue right) { return buildFCmp(m_builder, LLVMRealULE, left, right); } - LValue doubleGreaterThanOrUnordered(LValue left, LValue right) { return buildFCmp(m_builder, LLVMRealUGT, left, right); } - LValue doubleGreaterThanOrEqualOrUnordered(LValue left, LValue right) { return buildFCmp(m_builder, LLVMRealUGE, left, right); } + LValue fcmp(LRealPredicate cond, LValue left, LValue right) { return buildFCmp(m_builder, cond, left, right); } + LValue doubleEqual(LValue left, LValue right) { return fcmp(LLVMRealOEQ, left, right); } + LValue doubleNotEqualOrUnordered(LValue left, LValue right) { return fcmp(LLVMRealUNE, left, right); } + LValue doubleLessThan(LValue left, LValue right) { return fcmp(LLVMRealOLT, left, right); } + LValue doubleLessThanOrEqual(LValue left, LValue right) { return fcmp(LLVMRealOLE, left, right); } + LValue doubleGreaterThan(LValue left, LValue right) { return fcmp(LLVMRealOGT, left, right); } + LValue doubleGreaterThanOrEqual(LValue left, LValue right) { return fcmp(LLVMRealOGE, left, right); } + LValue doubleEqualOrUnordered(LValue left, LValue right) { return fcmp(LLVMRealUEQ, left, right); } + LValue doubleNotEqual(LValue left, LValue right) { return fcmp(LLVMRealONE, left, right); } + LValue doubleLessThanOrUnordered(LValue left, LValue right) { return fcmp(LLVMRealULT, left, right); } + LValue doubleLessThanOrEqualOrUnordered(LValue left, LValue right) { return fcmp(LLVMRealULE, left, right); } + LValue doubleGreaterThanOrUnordered(LValue left, LValue right) { return fcmp(LLVMRealUGT, left, right); } + LValue doubleGreaterThanOrEqualOrUnordered(LValue left, LValue right) { return fcmp(LLVMRealUGE, left, right); } LValue isZero8(LValue value) { return equal(value, int8Zero); } LValue notZero8(LValue value) { return notEqual(value, int8Zero); } @@ -341,6 +359,9 @@ class Output : public IntrinsicRepository { LValue select(LValue value, LValue taken, LValue notTaken) { return buildSelect(m_builder, value, taken, notTaken); } LValue extractValue(LValue aggVal, unsigned index) { return buildExtractValue(m_builder, aggVal, index); } + LValue fence(LAtomicOrdering ordering = LLVMAtomicOrderingSequentiallyConsistent, SynchronizationScope scope = CrossThread) { return buildFence(m_builder, ordering, scope); } + LValue fenceAcqRel() { return fence(LLVMAtomicOrderingAcquireRelease); } + template LValue call(LValue function, const VectorType& vector) { return buildCall(m_builder, function, vector); } LValue call(LValue function) { return buildCall(m_builder, function); } @@ -350,6 +371,8 @@ class Output : public IntrinsicRepository { LValue call(LValue function, LValue arg1, LValue arg2, LValue arg3, LValue arg4) { return buildCall(m_builder, function, arg1, arg2, arg3, arg4); } LValue call(LValue function, LValue arg1, LValue arg2, LValue arg3, LValue arg4, LValue arg5) { return buildCall(m_builder, function, arg1, arg2, arg3, arg4, arg5); } LValue call(LValue function, LValue arg1, LValue arg2, LValue arg3, LValue arg4, LValue arg5, LValue arg6) { return buildCall(m_builder, function, arg1, arg2, arg3, arg4, arg5, arg6); } + LValue call(LValue function, LValue arg1, LValue arg2, LValue arg3, LValue arg4, LValue arg5, LValue arg6, LValue arg7) { return buildCall(m_builder, function, arg1, arg2, arg3, arg4, arg5, arg6, arg7); } + LValue call(LValue function, LValue arg1, LValue arg2, LValue arg3, LValue arg4, LValue arg5, LValue arg6, LValue arg7, LValue arg8) { return buildCall(m_builder, function, arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8); } template LValue operation(FunctionType function) @@ -357,12 +380,6 @@ class Output : public IntrinsicRepository { return intToPtr(constIntPtr(function), pointerType(operationType(function))); } - LValue convertToTailCall(LValue call) - { - setTailCall(call, IsTailCall); - return call; - } - void jump(LBasicBlock destination) { buildBr(m_builder, destination); } void branch(LValue condition, LBasicBlock taken, LBasicBlock notTaken) { buildCondBr(m_builder, condition, taken, notTaken); } template diff --git a/JavaScriptCore/ftl/FTLSlowPathCall.cpp b/JavaScriptCore/ftl/FTLSlowPathCall.cpp index da7d56c8..3cf6ae0e 100644 --- a/JavaScriptCore/ftl/FTLSlowPathCall.cpp +++ b/JavaScriptCore/ftl/FTLSlowPathCall.cpp @@ -64,20 +64,23 @@ class CallContext { m_offsetToSavingArea = (std::max(m_numArgs, NUMBER_OF_ARGUMENT_REGISTERS) - NUMBER_OF_ARGUMENT_REGISTERS) * wordSize; - unsigned numArgumentRegistersThatNeedSaving = 0; - for (unsigned i = std::min(NUMBER_OF_ARGUMENT_REGISTERS, numArgs); i--;) { - if (m_usedRegisters.get(GPRInfo::toArgumentRegister(i))) - numArgumentRegistersThatNeedSaving++; - } + for (unsigned i = std::min(NUMBER_OF_ARGUMENT_REGISTERS, numArgs); i--;) + m_callingConventionRegisters.set(GPRInfo::toArgumentRegister(i)); + if (returnRegister != InvalidGPRReg) + m_callingConventionRegisters.set(GPRInfo::returnValueGPR); + m_callingConventionRegisters.filter(m_usedRegisters); + + unsigned numberOfCallingConventionRegisters = + m_callingConventionRegisters.numberOfSetRegisters(); size_t offsetToThunkSavingArea = m_offsetToSavingArea + - numArgumentRegistersThatNeedSaving * wordSize; + numberOfCallingConventionRegisters * wordSize; m_stackBytesNeeded = offsetToThunkSavingArea + stackBytesNeededForReturnAddress + - (m_usedRegisters.numberOfSetRegisters() - numArgumentRegistersThatNeedSaving) * wordSize; + (m_usedRegisters.numberOfSetRegisters() - numberOfCallingConventionRegisters) * wordSize; size_t stackAlignment = 16; @@ -87,11 +90,13 @@ class CallContext { m_thunkSaveSet = m_usedRegisters; - for (unsigned i = std::min(NUMBER_OF_ARGUMENT_REGISTERS, numArgs); i--;) { - if (!m_usedRegisters.get(GPRInfo::toArgumentRegister(i))) + // This relies on all calling convention registers also being temp registers. + unsigned stackIndex = 0; + for (unsigned i = GPRInfo::numberOfRegisters; i--;) { + GPRReg reg = GPRInfo::toRegister(i); + if (!m_callingConventionRegisters.get(reg)) continue; - GPRReg reg = GPRInfo::toArgumentRegister(i); - m_jit.storePtr(reg, CCallHelpers::Address(CCallHelpers::stackPointerRegister, m_offsetToSavingArea + i * wordSize)); + m_jit.storePtr(reg, CCallHelpers::Address(CCallHelpers::stackPointerRegister, m_offsetToSavingArea + (stackIndex++) * wordSize)); m_thunkSaveSet.clear(reg); } @@ -100,13 +105,15 @@ class CallContext { ~CallContext() { - m_jit.move(GPRInfo::returnValueGPR, m_returnRegister); + if (m_returnRegister != InvalidGPRReg) + m_jit.move(GPRInfo::returnValueGPR, m_returnRegister); - for (unsigned i = std::min(NUMBER_OF_ARGUMENT_REGISTERS, m_numArgs); i--;) { - if (!m_usedRegisters.get(GPRInfo::toArgumentRegister(i))) + unsigned stackIndex = 0; + for (unsigned i = GPRInfo::numberOfRegisters; i--;) { + GPRReg reg = GPRInfo::toRegister(i); + if (!m_callingConventionRegisters.get(reg)) continue; - GPRReg reg = GPRInfo::toArgumentRegister(i); - m_jit.loadPtr(CCallHelpers::Address(CCallHelpers::stackPointerRegister, m_offsetToSavingArea + i * wordSize), reg); + m_jit.loadPtr(CCallHelpers::Address(CCallHelpers::stackPointerRegister, m_offsetToSavingArea + (stackIndex++) * wordSize), reg); } m_jit.addPtr(CCallHelpers::TrustedImm32(m_stackBytesNeeded), CCallHelpers::stackPointerRegister); @@ -138,6 +145,7 @@ class CallContext { private: State& m_state; RegisterSet m_usedRegisters; + RegisterSet m_callingConventionRegisters; CCallHelpers& m_jit; unsigned m_numArgs; GPRReg m_returnRegister; @@ -163,6 +171,20 @@ MacroAssembler::Call callOperation( // https://bugs.webkit.org/show_bug.cgi?id=113622 } +MacroAssembler::Call callOperation( + State& state, const RegisterSet& usedRegisters, CCallHelpers& jit, + V_JITOperation_ESsiJJI operation, GPRReg callFrameRegister, + StructureStubInfo* stubInfo, GPRReg value, GPRReg object, StringImpl* uid) +{ + CallContext context(state, usedRegisters, jit, 5, InvalidGPRReg); + jit.setupArguments( + callFrameRegister, CCallHelpers::TrustedImmPtr(stubInfo), value, object, + CCallHelpers::TrustedImmPtr(uid)); + return context.makeCall(bitwise_cast(operation)); + // FIXME: FTL should support exceptions. + // https://bugs.webkit.org/show_bug.cgi?id=113622 +} + } } // namespace JSC::FTL #endif // ENABLE(FTL_JIT) diff --git a/JavaScriptCore/ftl/FTLSlowPathCall.h b/JavaScriptCore/ftl/FTLSlowPathCall.h index b1a840b6..435efdc8 100644 --- a/JavaScriptCore/ftl/FTLSlowPathCall.h +++ b/JavaScriptCore/ftl/FTLSlowPathCall.h @@ -59,6 +59,10 @@ MacroAssembler::Call callOperation( State&, const RegisterSet&, CCallHelpers&, J_JITOperation_ESsiJI, GPRReg result, GPRReg callFrameRegister, StructureStubInfo*, GPRReg object, StringImpl* uid); +MacroAssembler::Call callOperation( + State&, const RegisterSet&, CCallHelpers&, V_JITOperation_ESsiJJI, + GPRReg callFrameRegister, StructureStubInfo*, GPRReg value, GPRReg object, + StringImpl* uid); } } // namespace JSC::FTL diff --git a/JavaScriptCore/ftl/FTLSlowPathCallKey.h b/JavaScriptCore/ftl/FTLSlowPathCallKey.h index 4a3569ec..0c7c3298 100644 --- a/JavaScriptCore/ftl/FTLSlowPathCallKey.h +++ b/JavaScriptCore/ftl/FTLSlowPathCallKey.h @@ -61,6 +61,11 @@ class SlowPathCallKey { void* callTarget() const { return m_callTarget; } ptrdiff_t offset() const { return m_offset; } + SlowPathCallKey withCallTarget(void* callTarget) + { + return SlowPathCallKey(usedRegisters(), callTarget, offset()); + } + void dump(PrintStream&) const; enum EmptyValueTag { EmptyValue }; diff --git a/JavaScriptCore/ftl/FTLStackMaps.cpp b/JavaScriptCore/ftl/FTLStackMaps.cpp index 58620912..5af2082c 100644 --- a/JavaScriptCore/ftl/FTLStackMaps.cpp +++ b/JavaScriptCore/ftl/FTLStackMaps.cpp @@ -55,33 +55,26 @@ void StackMaps::Constant::dump(PrintStream& out) const void StackMaps::Location::parse(DataView* view, unsigned& offset) { - uint16_t taggedReg = view->read(offset, true); - if (static_cast(taggedReg) < 0) { - dataLog( - "Detected a negative tagged register ", static_cast(taggedReg), - " at offset ", offset, "\n"); - RELEASE_ASSERT_NOT_REACHED(); - } - dwarfRegNum = taggedReg & ((1 << 12) - 1); - kind = static_cast(taggedReg >> 12); - - this->offset = view->read(offset, true); + kind = static_cast(view->read(offset, true)); + size = view->read(offset, true); + dwarfRegNum = view->read(offset, true); + this->offset = view->read(offset, true); } void StackMaps::Location::dump(PrintStream& out) const { - out.print("(", kind, ", reg", dwarfRegNum, ", ", offset, ")"); + out.print("(", kind, ", reg", dwarfRegNum, ", off:", offset, ", size:", size, ")"); } -GPRReg StackMaps::Location::directGPR(StackMaps& stackmaps) const +GPRReg StackMaps::Location::directGPR() const { - return FTL::Location::forStackmaps(stackmaps, *this).directGPR(); + return FTL::Location::forStackmaps(nullptr, *this).directGPR(); } void StackMaps::Location::restoreInto( MacroAssembler& jit, StackMaps& stackmaps, char* savedRegisters, GPRReg result) const { - FTL::Location::forStackmaps(stackmaps, *this).restoreInto(jit, savedRegisters, result); + FTL::Location::forStackmaps(&stackmaps, *this).restoreInto(jit, savedRegisters, result); } bool StackMaps::Record::parse(DataView* view, unsigned& offset) @@ -111,6 +104,8 @@ bool StackMaps::parse(DataView* view) { unsigned offset = 0; + view->read(offset, true); // Reserved (header) + uint32_t numConstants = view->read(offset, true); while (numConstants--) constants.append(readObject(view, offset)); @@ -164,6 +159,9 @@ void printInternal(PrintStream& out, StackMaps::Location::Kind kind) case StackMaps::Location::Register: out.print("Register"); return; + case StackMaps::Location::Direct: + out.print("Direct"); + return; case StackMaps::Location::Indirect: out.print("Indirect"); return; diff --git a/JavaScriptCore/ftl/FTLStackMaps.h b/JavaScriptCore/ftl/FTLStackMaps.h index fac5afcb..f175925d 100644 --- a/JavaScriptCore/ftl/FTLStackMaps.h +++ b/JavaScriptCore/ftl/FTLStackMaps.h @@ -49,22 +49,24 @@ struct StackMaps { }; struct Location { - enum Kind { + enum Kind : int8_t { Unprocessed, Register, + Direct, Indirect, Constant, ConstantIndex }; uint16_t dwarfRegNum; // Represented as a 12-bit int in the section. + int8_t size; Kind kind; int16_t offset; void parse(DataView*, unsigned& offset); void dump(PrintStream& out) const; - GPRReg directGPR(StackMaps&) const; + GPRReg directGPR() const; void restoreInto(MacroAssembler&, StackMaps&, char* savedRegisters, GPRReg result) const; }; diff --git a/JavaScriptCore/ftl/FTLState.h b/JavaScriptCore/ftl/FTLState.h index 10a773c5..c82db672 100644 --- a/JavaScriptCore/ftl/FTLState.h +++ b/JavaScriptCore/ftl/FTLState.h @@ -58,6 +58,7 @@ class State { GeneratedFunction generatedFunction; JITFinalizer* finalizer; SegmentedVector getByIds; + SegmentedVector putByIds; Vector codeSectionNames; Vector dataSectionNames; RefCountedArray stackmapsSection; diff --git a/JavaScriptCore/ftl/FTLThunks.cpp b/JavaScriptCore/ftl/FTLThunks.cpp index df02d160..bf04af02 100644 --- a/JavaScriptCore/ftl/FTLThunks.cpp +++ b/JavaScriptCore/ftl/FTLThunks.cpp @@ -39,60 +39,7 @@ namespace JSC { namespace FTL { using namespace DFG; -MacroAssemblerCodeRef osrExitGenerationWithoutStackMapThunkGenerator(VM* vm) -{ - AssemblyHelpers jit(vm, 0); - - // Pretend that we're a C call frame. - jit.push(MacroAssembler::framePointerRegister); - jit.move(MacroAssembler::stackPointerRegister, MacroAssembler::framePointerRegister); - jit.push(GPRInfo::regT0); - jit.push(GPRInfo::regT0); - - jit.poke(GPRInfo::nonArgGPR0, 1); - - ScratchBuffer* scratchBuffer = vm->scratchBufferForSize(requiredScratchMemorySizeInBytes()); - char* buffer = static_cast(scratchBuffer->dataBuffer()); - - saveAllRegisters(jit, buffer); - - // Tell GC mark phase how much of the scratch buffer is active during call. - jit.move(MacroAssembler::TrustedImmPtr(scratchBuffer->activeLengthPtr()), GPRInfo::nonArgGPR1); - jit.storePtr(MacroAssembler::TrustedImmPtr(requiredScratchMemorySizeInBytes()), GPRInfo::nonArgGPR1); - - // argument 0 is already the call frame. - jit.peek(GPRInfo::argumentGPR1, 1); - MacroAssembler::Call functionCall = jit.call(); - - // At this point we want to make a tail call to what was returned to us in the - // returnValueGPR. But at the same time as we do this, we must restore all registers. - // The way we will accomplish this is by arranging to have the tail call target in the - // return address "slot" (be it a register or the stack). - - jit.move(GPRInfo::returnValueGPR, GPRInfo::regT0); - - // Prepare for tail call. - jit.pop(GPRInfo::regT1); - jit.pop(GPRInfo::regT1); - jit.pop(MacroAssembler::framePointerRegister); - - // At this point we're sitting on the return address - so if we did a jump right now, the - // tail-callee would be happy. Instead we'll stash the callee in the return address and then - // restore all registers. - - jit.restoreReturnAddressBeforeReturn(GPRInfo::regT0); - - restoreAllRegisters(jit, buffer); - - jit.ret(); - - LinkBuffer patchBuffer(*vm, &jit, GLOBAL_THUNK_ID); - patchBuffer.link(functionCall, compileFTLOSRExit); - return FINALIZE_CODE(patchBuffer, ("FTL OSR exit generation thunk")); -} - -MacroAssemblerCodeRef osrExitGenerationWithStackMapThunkGenerator( - VM& vm, const Location& location) +MacroAssemblerCodeRef osrExitGenerationThunkGenerator(VM& vm, const Location& location) { AssemblyHelpers jit(&vm, 0); @@ -113,7 +60,7 @@ MacroAssemblerCodeRef osrExitGenerationWithStackMapThunkGenerator( jit.move(MacroAssembler::TrustedImmPtr(scratchBuffer->activeLengthPtr()), GPRInfo::nonArgGPR1); jit.storePtr(MacroAssembler::TrustedImmPtr(requiredScratchMemorySizeInBytes()), GPRInfo::nonArgGPR1); - location.restoreInto(jit, buffer, GPRInfo::argumentGPR0); + location.restoreInto(jit, buffer, GPRInfo::argumentGPR0, 1); jit.peek(GPRInfo::argumentGPR1, 3); MacroAssembler::Call functionCall = jit.call(); diff --git a/JavaScriptCore/ftl/FTLThunks.h b/JavaScriptCore/ftl/FTLThunks.h index da1cf109..bbcdbddc 100644 --- a/JavaScriptCore/ftl/FTLThunks.h +++ b/JavaScriptCore/ftl/FTLThunks.h @@ -41,30 +41,47 @@ class VM; namespace FTL { -MacroAssemblerCodeRef osrExitGenerationWithoutStackMapThunkGenerator(VM*); - -MacroAssemblerCodeRef osrExitGenerationWithStackMapThunkGenerator(VM&, const Location&); +MacroAssemblerCodeRef osrExitGenerationThunkGenerator(VM&, const Location&); MacroAssemblerCodeRef slowPathCallThunkGenerator(VM&, const SlowPathCallKey&); -template +template +struct ThunkMap { + typedef KeyTypeArgument KeyType; + typedef HashMap ToThunkMap; + typedef HashMap FromThunkMap; + + ToThunkMap m_toThunk; + FromThunkMap m_fromThunk; +}; + +template MacroAssemblerCodeRef generateIfNecessary( - VM& vm, MapType& map, const KeyType& key, GeneratorType generator) + VM& vm, MapType& map, const typename MapType::KeyType& key, GeneratorType generator) { - typename MapType::iterator iter = map.find(key); - if (iter != map.end()) + typename MapType::ToThunkMap::iterator iter = map.m_toThunk.find(key); + if (iter != map.m_toThunk.end()) return iter->value; MacroAssemblerCodeRef result = generator(vm, key); - map.add(key, result); + map.m_toThunk.add(key, result); + map.m_fromThunk.add(result.code(), key); return result; } +template +typename MapType::KeyType keyForThunk(MapType& map, MacroAssemblerCodePtr ptr) +{ + typename MapType::FromThunkMap::iterator iter = map.m_fromThunk.find(ptr); + RELEASE_ASSERT(iter != map.m_fromThunk.end()); + return iter->value; +} + class Thunks { public: MacroAssemblerCodeRef getOSRExitGenerationThunk(VM& vm, const Location& location) { return generateIfNecessary( - vm, m_osrExitThunks, location, osrExitGenerationWithStackMapThunkGenerator); + vm, m_osrExitThunks, location, osrExitGenerationThunkGenerator); } MacroAssemblerCodeRef getSlowPathCallThunk(VM& vm, const SlowPathCallKey& key) @@ -73,9 +90,14 @@ class Thunks { vm, m_slowPathCallThunks, key, slowPathCallThunkGenerator); } + SlowPathCallKey keyForSlowPathCallThunk(MacroAssemblerCodePtr ptr) + { + return keyForThunk(m_slowPathCallThunks, ptr); + } + private: - HashMap m_osrExitThunks; - HashMap m_slowPathCallThunks; + ThunkMap m_osrExitThunks; + ThunkMap m_slowPathCallThunks; }; } } // namespace JSC::FTL diff --git a/JavaScriptCore/ftl/FTLValueFormat.cpp b/JavaScriptCore/ftl/FTLValueFormat.cpp index e9a4a636..5a89d6a4 100644 --- a/JavaScriptCore/ftl/FTLValueFormat.cpp +++ b/JavaScriptCore/ftl/FTLValueFormat.cpp @@ -42,14 +42,6 @@ void reboxAccordingToFormat( break; } - case ValueFormatUInt32: { - jit.zeroExtend32ToPtr(value, value); - jit.moveDoubleTo64(FPRInfo::fpRegT0, scratch2); - jit.boxInt52(value, value, scratch1, FPRInfo::fpRegT0); - jit.move64ToDouble(scratch2, FPRInfo::fpRegT0); - break; - } - case ValueFormatInt52: { jit.rshift64(AssemblyHelpers::TrustedImm32(JSValue::int52ShiftAmount), value); jit.moveDoubleTo64(FPRInfo::fpRegT0, scratch2); @@ -105,9 +97,6 @@ void printInternal(PrintStream& out, ValueFormat format) case ValueFormatInt32: out.print("Int32"); return; - case ValueFormatUInt32: - out.print("UInt32"); - return; case ValueFormatInt52: out.print("Int52"); return; diff --git a/JavaScriptCore/ftl/FTLValueFormat.h b/JavaScriptCore/ftl/FTLValueFormat.h index 40ac775c..b031f0de 100644 --- a/JavaScriptCore/ftl/FTLValueFormat.h +++ b/JavaScriptCore/ftl/FTLValueFormat.h @@ -45,7 +45,6 @@ namespace FTL { enum ValueFormat { InvalidValueFormat, ValueFormatInt32, - ValueFormatUInt32, ValueFormatInt52, ValueFormatStrictInt52, ValueFormatBoolean, diff --git a/JavaScriptCore/ftl/FTLValueSource.h b/JavaScriptCore/ftl/FTLValueSource.h deleted file mode 100644 index 3a4a55bd..00000000 --- a/JavaScriptCore/ftl/FTLValueSource.h +++ /dev/null @@ -1,110 +0,0 @@ -/* - * Copyright (C) 2013 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. - */ - -#ifndef FTLValueSource_h -#define FTLValueSource_h - -#include - -#if ENABLE(FTL_JIT) - -#include "DFGNode.h" -#include -#include - -namespace JSC { namespace FTL { - -enum ValueSourceKind { - SourceNotSet, - ValueInJSStack, - Int32InJSStack, - Int52InJSStack, - DoubleInJSStack, - SourceIsDead, - HaveNode -}; - -class ValueSource { -public: - ValueSource() - : m_kind(SourceNotSet) - { - } - - explicit ValueSource(ValueSourceKind kind) - : m_kind(kind) - { - ASSERT(m_kind == SourceIsDead); - } - - explicit ValueSource(DFG::Node* node) - : m_kind(HaveNode) - { - m_value.node = node; - } - - ValueSource(ValueSourceKind kind, VirtualRegister reg) - : m_kind(kind) - { - ASSERT(m_kind == ValueInJSStack || m_kind == Int32InJSStack || m_kind == Int52InJSStack || m_kind == DoubleInJSStack); - m_value.virtualRegister = reg.offset(); - } - - ValueSourceKind kind() const - { - return m_kind; - } - - bool operator!() const { return kind() == SourceNotSet; } - - DFG::Node* node() const - { - ASSERT(kind() == HaveNode); - return m_value.node; - } - - VirtualRegister virtualRegister() const - { - ASSERT(kind() == ValueInJSStack || kind() == Int32InJSStack || kind() == Int52InJSStack || kind() == DoubleInJSStack); - return VirtualRegister(m_value.virtualRegister); - } - - void dump(PrintStream&) const; - void dumpInContext(PrintStream&, DumpContext*) const; - -private: - ValueSourceKind m_kind; - union { - DFG::Node* node; - int virtualRegister; - } m_value; -}; - -} } // namespace JSC::FTL - -#endif // ENABLE(FTL_JIT) - -#endif // FTLValueSource_h - diff --git a/JavaScriptCore/heap/CodeBlockSet.cpp b/JavaScriptCore/heap/CodeBlockSet.cpp index ae274808..2fc999bc 100644 --- a/JavaScriptCore/heap/CodeBlockSet.cpp +++ b/JavaScriptCore/heap/CodeBlockSet.cpp @@ -45,7 +45,8 @@ CodeBlockSet::~CodeBlockSet() void CodeBlockSet::add(PassRefPtr codeBlock) { - bool isNewEntry = m_set.add(codeBlock.leakRef()).isNewEntry; + CodeBlock* block = codeBlock.leakRef(); + bool isNewEntry = m_set.add(block).isNewEntry; ASSERT_UNUSED(isNewEntry, isNewEntry); } @@ -101,9 +102,20 @@ void CodeBlockSet::traceMarked(SlotVisitor& visitor) CodeBlock* codeBlock = *iter; if (!codeBlock->m_mayBeExecuting) continue; - codeBlock->visitAggregate(visitor); + codeBlock->ownerExecutable()->methodTable()->visitChildren(codeBlock->ownerExecutable(), visitor); } } +void CodeBlockSet::rememberCurrentlyExecutingCodeBlocks(Heap* heap) +{ +#if ENABLE(GGC) + for (size_t i = 0; i < m_currentlyExecuting.size(); ++i) + heap->addToRememberedSet(m_currentlyExecuting[i]->ownerExecutable()); + m_currentlyExecuting.clear(); +#else + UNUSED_PARAM(heap); +#endif // ENABLE(GGC) +} + } // namespace JSC diff --git a/JavaScriptCore/heap/CodeBlockSet.h b/JavaScriptCore/heap/CodeBlockSet.h index 2e4e606f..bb786f06 100644 --- a/JavaScriptCore/heap/CodeBlockSet.h +++ b/JavaScriptCore/heap/CodeBlockSet.h @@ -30,10 +30,12 @@ #include #include #include +#include namespace JSC { class CodeBlock; +class Heap; class SlotVisitor; // CodeBlockSet tracks all CodeBlocks. Every CodeBlock starts out with one @@ -65,11 +67,16 @@ class CodeBlockSet { // mayBeExecuting. void traceMarked(SlotVisitor&); + // Add all currently executing CodeBlocks to the remembered set to be + // re-scanned during the next collection. + void rememberCurrentlyExecutingCodeBlocks(Heap*); + private: // This is not a set of RefPtr because we need to be able to find // arbitrary bogus pointers. I could have written a thingy that had peek types // and all, but that seemed like overkill. HashSet m_set; + Vector m_currentlyExecuting; }; } // namespace JSC diff --git a/JavaScriptCore/heap/CopiedAllocator.h b/JavaScriptCore/heap/CopiedAllocator.h index 32b84f00..3dfc9a7f 100644 --- a/JavaScriptCore/heap/CopiedAllocator.h +++ b/JavaScriptCore/heap/CopiedAllocator.h @@ -38,6 +38,7 @@ class CopiedAllocator { bool fastPathShouldSucceed(size_t bytes) const; CheckedBoolean tryAllocate(size_t bytes, void** outPtr); + CheckedBoolean tryAllocateDuringCopying(size_t bytes, void** outPtr); CheckedBoolean tryReallocate(void *oldPtr, size_t oldBytes, size_t newBytes); void* forceAllocate(size_t bytes); CopiedBlock* resetCurrentBlock(); @@ -93,6 +94,14 @@ inline CheckedBoolean CopiedAllocator::tryAllocate(size_t bytes, void** outPtr) return true; } +inline CheckedBoolean CopiedAllocator::tryAllocateDuringCopying(size_t bytes, void** outPtr) +{ + if (!tryAllocate(bytes, outPtr)) + return false; + m_currentBlock->reportLiveBytesDuringCopying(bytes); + return true; +} + inline CheckedBoolean CopiedAllocator::tryReallocate( void* oldPtr, size_t oldBytes, size_t newBytes) { diff --git a/JavaScriptCore/heap/CopiedBlock.h b/JavaScriptCore/heap/CopiedBlock.h index 04cb31e5..6d59aa6b 100644 --- a/JavaScriptCore/heap/CopiedBlock.h +++ b/JavaScriptCore/heap/CopiedBlock.h @@ -49,10 +49,14 @@ class CopiedBlock : public HeapBlock { void pin(); bool isPinned(); + bool isOld(); bool isOversize(); + void didPromote(); unsigned liveBytes(); - void reportLiveBytes(JSCell*, CopyToken, unsigned); + bool shouldReportLiveBytes(SpinLockHolder&, JSCell* owner); + void reportLiveBytes(SpinLockHolder&, JSCell*, CopyToken, unsigned); + void reportLiveBytesDuringCopying(unsigned); void didSurviveGC(); void didEvacuateBytes(unsigned); bool shouldEvacuate(); @@ -81,6 +85,7 @@ class CopiedBlock : public HeapBlock { bool hasWorkList(); CopyWorkList& workList(); + SpinLock& workListLock() { return m_workListLock; } private: CopiedBlock(Region*); @@ -88,13 +93,12 @@ class CopiedBlock : public HeapBlock { void checkConsistency(); -#if ENABLE(PARALLEL_GC) SpinLock m_workListLock; -#endif OwnPtr m_workList; size_t m_remaining; - uintptr_t m_isPinned; + bool m_isPinned : 1; + bool m_isOld : 1; unsigned m_liveBytes; #ifndef NDEBUG unsigned m_liveObjects; @@ -130,14 +134,13 @@ inline CopiedBlock::CopiedBlock(Region* region) : HeapBlock(region) , m_remaining(payloadCapacity()) , m_isPinned(false) + , m_isOld(false) , m_liveBytes(0) #ifndef NDEBUG , m_liveObjects(0) #endif { -#if ENABLE(PARALLEL_GC) m_workListLock.Init(); -#endif ASSERT(is8ByteAligned(reinterpret_cast(m_remaining))); } @@ -156,6 +159,7 @@ inline void CopiedBlock::didSurviveGC() inline void CopiedBlock::didEvacuateBytes(unsigned bytes) { ASSERT(m_liveBytes >= bytes); + ASSERT(m_liveObjects); checkConsistency(); m_liveBytes -= bytes; #ifndef NDEBUG @@ -188,6 +192,16 @@ inline bool CopiedBlock::isPinned() return m_isPinned; } +inline bool CopiedBlock::isOld() +{ + return m_isOld; +} + +inline void CopiedBlock::didPromote() +{ + m_isOld = true; +} + inline bool CopiedBlock::isOversize() { return region()->isCustomSize(); diff --git a/JavaScriptCore/heap/CopiedBlockInlines.h b/JavaScriptCore/heap/CopiedBlockInlines.h index 61996ce3..8bf831cf 100644 --- a/JavaScriptCore/heap/CopiedBlockInlines.h +++ b/JavaScriptCore/heap/CopiedBlockInlines.h @@ -26,21 +26,36 @@ #ifndef CopiedBlockInlines_h #define CopiedBlockInlines_h +#include "ClassInfo.h" #include "CopiedBlock.h" #include "Heap.h" +#include "MarkedBlock.h" namespace JSC { -inline void CopiedBlock::reportLiveBytes(JSCell* owner, CopyToken token, unsigned bytes) +inline bool CopiedBlock::shouldReportLiveBytes(SpinLockHolder&, JSCell* owner) +{ + // We want to add to live bytes if the owner isn't part of the remembered set or + // if this block was allocated during the last cycle. + // If we always added live bytes we would double count for elements in the remembered + // set across collections. + // If we didn't always add live bytes to new blocks, we'd get too few. + bool ownerIsRemembered = MarkedBlock::blockFor(owner)->isRemembered(owner); + return !ownerIsRemembered || !m_isOld; +} + +inline void CopiedBlock::reportLiveBytes(SpinLockHolder&, JSCell* owner, CopyToken token, unsigned bytes) { -#if ENABLE(PARALLEL_GC) - SpinLockHolder locker(&m_workListLock); -#endif -#ifndef NDEBUG checkConsistency(); +#ifndef NDEBUG m_liveObjects++; #endif m_liveBytes += bytes; + checkConsistency(); + ASSERT(m_liveBytes <= CopiedBlock::blockSize); + + if (isPinned()) + return; if (!shouldEvacuate()) { pin(); @@ -53,6 +68,19 @@ inline void CopiedBlock::reportLiveBytes(JSCell* owner, CopyToken token, unsigne m_workList->append(CopyWorklistItem(owner, token)); } +inline void CopiedBlock::reportLiveBytesDuringCopying(unsigned bytes) +{ + checkConsistency(); + // This doesn't need to be locked because the thread that calls this function owns the current block. + m_isOld = true; +#ifndef NDEBUG + m_liveObjects++; +#endif + m_liveBytes += bytes; + checkConsistency(); + ASSERT(m_liveBytes <= CopiedBlock::blockSize); +} + } // namespace JSC #endif // CopiedBlockInlines_h diff --git a/JavaScriptCore/heap/CopiedSpace.cpp b/JavaScriptCore/heap/CopiedSpace.cpp index f0e7722a..eb294214 100644 --- a/JavaScriptCore/heap/CopiedSpace.cpp +++ b/JavaScriptCore/heap/CopiedSpace.cpp @@ -35,8 +35,6 @@ namespace JSC { CopiedSpace::CopiedSpace(Heap* heap) : m_heap(heap) - , m_toSpace(0) - , m_fromSpace(0) , m_inCopyingPhase(false) , m_shouldDoCopyPhase(false) , m_numberOfLoanedBlocks(0) @@ -46,21 +44,40 @@ CopiedSpace::CopiedSpace(Heap* heap) CopiedSpace::~CopiedSpace() { - while (!m_toSpace->isEmpty()) - m_heap->blockAllocator().deallocate(CopiedBlock::destroy(m_toSpace->removeHead())); + while (!m_oldGen.toSpace->isEmpty()) + m_heap->blockAllocator().deallocate(CopiedBlock::destroy(m_oldGen.toSpace->removeHead())); - while (!m_fromSpace->isEmpty()) - m_heap->blockAllocator().deallocate(CopiedBlock::destroy(m_fromSpace->removeHead())); + while (!m_oldGen.fromSpace->isEmpty()) + m_heap->blockAllocator().deallocate(CopiedBlock::destroy(m_oldGen.fromSpace->removeHead())); - while (!m_oversizeBlocks.isEmpty()) - m_heap->blockAllocator().deallocateCustomSize(CopiedBlock::destroy(m_oversizeBlocks.removeHead())); + while (!m_oldGen.oversizeBlocks.isEmpty()) + m_heap->blockAllocator().deallocateCustomSize(CopiedBlock::destroy(m_oldGen.oversizeBlocks.removeHead())); + + while (!m_newGen.toSpace->isEmpty()) + m_heap->blockAllocator().deallocate(CopiedBlock::destroy(m_newGen.toSpace->removeHead())); + + while (!m_newGen.fromSpace->isEmpty()) + m_heap->blockAllocator().deallocate(CopiedBlock::destroy(m_newGen.fromSpace->removeHead())); + + while (!m_newGen.oversizeBlocks.isEmpty()) + m_heap->blockAllocator().deallocateCustomSize(CopiedBlock::destroy(m_newGen.oversizeBlocks.removeHead())); + + ASSERT(m_oldGen.toSpace->isEmpty()); + ASSERT(m_oldGen.fromSpace->isEmpty()); + ASSERT(m_oldGen.oversizeBlocks.isEmpty()); + ASSERT(m_newGen.toSpace->isEmpty()); + ASSERT(m_newGen.fromSpace->isEmpty()); + ASSERT(m_newGen.oversizeBlocks.isEmpty()); } void CopiedSpace::init() { - m_toSpace = &m_blocks1; - m_fromSpace = &m_blocks2; + m_oldGen.toSpace = &m_oldGen.blocks1; + m_oldGen.fromSpace = &m_oldGen.blocks2; + m_newGen.toSpace = &m_newGen.blocks1; + m_newGen.fromSpace = &m_newGen.blocks2; + allocateBlock(); } @@ -83,9 +100,10 @@ CheckedBoolean CopiedSpace::tryAllocateOversize(size_t bytes, void** outPtr) ASSERT(isOversize(bytes)); CopiedBlock* block = CopiedBlock::create(m_heap->blockAllocator().allocateCustomSize(sizeof(CopiedBlock) + bytes, CopiedBlock::blockSize)); - m_oversizeBlocks.push(block); - m_blockFilter.add(reinterpret_cast(block)); + m_newGen.oversizeBlocks.push(block); + m_newGen.blockFilter.add(reinterpret_cast(block)); m_blockSet.add(block); + ASSERT(!block->isOld()); CopiedAllocator allocator; allocator.setCurrentBlock(block); @@ -138,7 +156,10 @@ CheckedBoolean CopiedSpace::tryReallocateOversize(void** ptr, size_t oldSize, si CopiedBlock* oldBlock = CopiedSpace::blockFor(oldPtr); if (oldBlock->isOversize()) { - m_oversizeBlocks.remove(oldBlock); + if (oldBlock->isOld()) + m_oldGen.oversizeBlocks.remove(oldBlock); + else + m_newGen.oversizeBlocks.remove(oldBlock); m_blockSet.remove(oldBlock); m_heap->blockAllocator().deallocateCustomSize(CopiedBlock::destroy(oldBlock)); } @@ -165,10 +186,11 @@ void CopiedSpace::doneFillingBlock(CopiedBlock* block, CopiedBlock** exchange) block->zeroFillWilderness(); { + // Always put the block into the old gen because it's being promoted! SpinLockHolder locker(&m_toSpaceLock); - m_toSpace->push(block); + m_oldGen.toSpace->push(block); m_blockSet.add(block); - m_blockFilter.add(reinterpret_cast(block)); + m_oldGen.blockFilter.add(reinterpret_cast(block)); } { @@ -181,52 +203,25 @@ void CopiedSpace::doneFillingBlock(CopiedBlock* block, CopiedBlock** exchange) } } -void CopiedSpace::startedCopying() +void CopiedSpace::didStartFullCollection() { - std::swap(m_fromSpace, m_toSpace); - - m_blockFilter.reset(); - m_allocator.resetCurrentBlock(); - - CopiedBlock* next = 0; - size_t totalLiveBytes = 0; - size_t totalUsableBytes = 0; - for (CopiedBlock* block = m_fromSpace->head(); block; block = next) { - next = block->next(); - if (!block->isPinned() && block->canBeRecycled()) { - recycleEvacuatedBlock(block); - continue; - } - totalLiveBytes += block->liveBytes(); - totalUsableBytes += block->payloadCapacity(); - } + ASSERT(heap()->operationInProgress() == FullCollection); + ASSERT(m_oldGen.fromSpace->isEmpty()); + ASSERT(m_newGen.fromSpace->isEmpty()); - CopiedBlock* block = m_oversizeBlocks.head(); - while (block) { - CopiedBlock* next = block->next(); - if (block->isPinned()) { - m_blockFilter.add(reinterpret_cast(block)); - totalLiveBytes += block->payloadCapacity(); - totalUsableBytes += block->payloadCapacity(); - block->didSurviveGC(); - } else { - m_oversizeBlocks.remove(block); - m_blockSet.remove(block); - m_heap->blockAllocator().deallocateCustomSize(CopiedBlock::destroy(block)); - } - block = next; - } +#ifndef NDEBUG + for (CopiedBlock* block = m_newGen.toSpace->head(); block; block = block->next()) + ASSERT(!block->liveBytes()); - double markedSpaceBytes = m_heap->objectSpace().capacity(); - double totalFragmentation = ((double)totalLiveBytes + markedSpaceBytes) / ((double)totalUsableBytes + markedSpaceBytes); - m_shouldDoCopyPhase = totalFragmentation <= Options::minHeapUtilization(); - if (!m_shouldDoCopyPhase) - return; + for (CopiedBlock* block = m_newGen.oversizeBlocks.head(); block; block = block->next()) + ASSERT(!block->liveBytes()); +#endif + + for (CopiedBlock* block = m_oldGen.toSpace->head(); block; block = block->next()) + block->didSurviveGC(); - ASSERT(m_shouldDoCopyPhase); - ASSERT(!m_inCopyingPhase); - ASSERT(!m_numberOfLoanedBlocks); - m_inCopyingPhase = true; + for (CopiedBlock* block = m_oldGen.oversizeBlocks.head(); block; block = block->next()) + block->didSurviveGC(); } void CopiedSpace::doneCopying() @@ -240,21 +235,39 @@ void CopiedSpace::doneCopying() ASSERT(m_inCopyingPhase == m_shouldDoCopyPhase); m_inCopyingPhase = false; - while (!m_fromSpace->isEmpty()) { - CopiedBlock* block = m_fromSpace->removeHead(); - // All non-pinned blocks in from-space should have been reclaimed as they were evacuated. - ASSERT(block->isPinned() || !m_shouldDoCopyPhase); - block->didSurviveGC(); + DoublyLinkedList* toSpace; + DoublyLinkedList* fromSpace; + TinyBloomFilter* blockFilter; + if (heap()->operationInProgress() == FullCollection) { + toSpace = m_oldGen.toSpace; + fromSpace = m_oldGen.fromSpace; + blockFilter = &m_oldGen.blockFilter; + } else { + toSpace = m_newGen.toSpace; + fromSpace = m_newGen.fromSpace; + blockFilter = &m_newGen.blockFilter; + } + + while (!fromSpace->isEmpty()) { + CopiedBlock* block = fromSpace->removeHead(); // We don't add the block to the blockSet because it was never removed. ASSERT(m_blockSet.contains(block)); - m_blockFilter.add(reinterpret_cast(block)); - m_toSpace->push(block); + blockFilter->add(reinterpret_cast(block)); + toSpace->push(block); } - if (!m_toSpace->head()) - allocateBlock(); - else - m_allocator.setCurrentBlock(m_toSpace->head()); + if (heap()->operationInProgress() == EdenCollection) { + m_oldGen.toSpace->append(*m_newGen.toSpace); + m_oldGen.oversizeBlocks.append(m_newGen.oversizeBlocks); + m_oldGen.blockFilter.add(m_newGen.blockFilter); + m_newGen.blockFilter.reset(); + } + + ASSERT(m_newGen.toSpace->isEmpty()); + ASSERT(m_newGen.fromSpace->isEmpty()); + ASSERT(m_newGen.oversizeBlocks.isEmpty()); + + allocateBlock(); m_shouldDoCopyPhase = false; } @@ -263,13 +276,22 @@ size_t CopiedSpace::size() { size_t calculatedSize = 0; - for (CopiedBlock* block = m_toSpace->head(); block; block = block->next()) + for (CopiedBlock* block = m_oldGen.toSpace->head(); block; block = block->next()) + calculatedSize += block->size(); + + for (CopiedBlock* block = m_oldGen.fromSpace->head(); block; block = block->next()) + calculatedSize += block->size(); + + for (CopiedBlock* block = m_oldGen.oversizeBlocks.head(); block; block = block->next()) calculatedSize += block->size(); - for (CopiedBlock* block = m_fromSpace->head(); block; block = block->next()) + for (CopiedBlock* block = m_newGen.toSpace->head(); block; block = block->next()) calculatedSize += block->size(); - for (CopiedBlock* block = m_oversizeBlocks.head(); block; block = block->next()) + for (CopiedBlock* block = m_newGen.fromSpace->head(); block; block = block->next()) + calculatedSize += block->size(); + + for (CopiedBlock* block = m_newGen.oversizeBlocks.head(); block; block = block->next()) calculatedSize += block->size(); return calculatedSize; @@ -279,13 +301,22 @@ size_t CopiedSpace::capacity() { size_t calculatedCapacity = 0; - for (CopiedBlock* block = m_toSpace->head(); block; block = block->next()) + for (CopiedBlock* block = m_oldGen.toSpace->head(); block; block = block->next()) + calculatedCapacity += block->capacity(); + + for (CopiedBlock* block = m_oldGen.fromSpace->head(); block; block = block->next()) + calculatedCapacity += block->capacity(); + + for (CopiedBlock* block = m_oldGen.oversizeBlocks.head(); block; block = block->next()) + calculatedCapacity += block->capacity(); + + for (CopiedBlock* block = m_newGen.toSpace->head(); block; block = block->next()) calculatedCapacity += block->capacity(); - for (CopiedBlock* block = m_fromSpace->head(); block; block = block->next()) + for (CopiedBlock* block = m_newGen.fromSpace->head(); block; block = block->next()) calculatedCapacity += block->capacity(); - for (CopiedBlock* block = m_oversizeBlocks.head(); block; block = block->next()) + for (CopiedBlock* block = m_newGen.oversizeBlocks.head(); block; block = block->next()) calculatedCapacity += block->capacity(); return calculatedCapacity; @@ -311,9 +342,12 @@ static bool isBlockListPagedOut(double deadline, DoublyLinkedList* bool CopiedSpace::isPagedOut(double deadline) { - return isBlockListPagedOut(deadline, m_toSpace) - || isBlockListPagedOut(deadline, m_fromSpace) - || isBlockListPagedOut(deadline, &m_oversizeBlocks); + return isBlockListPagedOut(deadline, m_oldGen.toSpace) + || isBlockListPagedOut(deadline, m_oldGen.fromSpace) + || isBlockListPagedOut(deadline, &m_oldGen.oversizeBlocks) + || isBlockListPagedOut(deadline, m_newGen.toSpace) + || isBlockListPagedOut(deadline, m_newGen.fromSpace) + || isBlockListPagedOut(deadline, &m_newGen.oversizeBlocks); } } // namespace JSC diff --git a/JavaScriptCore/heap/CopiedSpace.h b/JavaScriptCore/heap/CopiedSpace.h index 65ca04ef..c0a59a27 100644 --- a/JavaScriptCore/heap/CopiedSpace.h +++ b/JavaScriptCore/heap/CopiedSpace.h @@ -28,6 +28,7 @@ #include "CopiedAllocator.h" #include "HeapBlock.h" +#include "HeapOperation.h" #include "TinyBloomFilter.h" #include #include @@ -60,7 +61,12 @@ class CopiedSpace { CopiedAllocator& allocator() { return m_allocator; } + void didStartFullCollection(); + + template void startedCopying(); + void startedEdenCopy(); + void startedFullCopy(); void doneCopying(); bool isInCopyPhase() { return m_inCopyingPhase; } @@ -80,6 +86,8 @@ class CopiedSpace { static CopiedBlock* blockFor(void*); + Heap* heap() const { return m_heap; } + private: static bool isOversize(size_t); @@ -91,24 +99,36 @@ class CopiedSpace { CopiedBlock* allocateBlockForCopyingPhase(); void doneFillingBlock(CopiedBlock*, CopiedBlock**); - void recycleEvacuatedBlock(CopiedBlock*); + void recycleEvacuatedBlock(CopiedBlock*, HeapOperation collectionType); void recycleBorrowedBlock(CopiedBlock*); Heap* m_heap; CopiedAllocator m_allocator; - TinyBloomFilter m_blockFilter; HashSet m_blockSet; SpinLock m_toSpaceLock; - DoublyLinkedList* m_toSpace; - DoublyLinkedList* m_fromSpace; - - DoublyLinkedList m_blocks1; - DoublyLinkedList m_blocks2; - DoublyLinkedList m_oversizeBlocks; + struct CopiedGeneration { + CopiedGeneration() + : toSpace(0) + , fromSpace(0) + { + } + + DoublyLinkedList* toSpace; + DoublyLinkedList* fromSpace; + + DoublyLinkedList blocks1; + DoublyLinkedList blocks2; + DoublyLinkedList oversizeBlocks; + + TinyBloomFilter blockFilter; + }; + + CopiedGeneration m_oldGen; + CopiedGeneration m_newGen; bool m_inCopyingPhase; bool m_shouldDoCopyPhase; diff --git a/JavaScriptCore/heap/CopiedSpaceInlines.h b/JavaScriptCore/heap/CopiedSpaceInlines.h index 44092617..ec33f582 100644 --- a/JavaScriptCore/heap/CopiedSpaceInlines.h +++ b/JavaScriptCore/heap/CopiedSpaceInlines.h @@ -37,7 +37,8 @@ namespace JSC { inline bool CopiedSpace::contains(CopiedBlock* block) { - return !m_blockFilter.ruleOut(reinterpret_cast(block)) && m_blockSet.contains(block); + return (!m_newGen.blockFilter.ruleOut(reinterpret_cast(block)) || !m_oldGen.blockFilter.ruleOut(reinterpret_cast(block))) + && m_blockSet.contains(block); } inline bool CopiedSpace::contains(void* ptr, CopiedBlock*& result) @@ -92,7 +93,7 @@ inline void CopiedSpace::pinIfNecessary(void* opaquePointer) pin(block); } -inline void CopiedSpace::recycleEvacuatedBlock(CopiedBlock* block) +inline void CopiedSpace::recycleEvacuatedBlock(CopiedBlock* block, HeapOperation collectionType) { ASSERT(block); ASSERT(block->canBeRecycled()); @@ -100,7 +101,10 @@ inline void CopiedSpace::recycleEvacuatedBlock(CopiedBlock* block) { SpinLockHolder locker(&m_toSpaceLock); m_blockSet.remove(block); - m_fromSpace->remove(block); + if (collectionType == EdenCollection) + m_newGen.fromSpace->remove(block); + else + m_oldGen.fromSpace->remove(block); } m_heap->blockAllocator().deallocate(CopiedBlock::destroy(block)); } @@ -141,8 +145,8 @@ inline void CopiedSpace::allocateBlock() CopiedBlock* block = CopiedBlock::create(m_heap->blockAllocator().allocate()); - m_toSpace->push(block); - m_blockFilter.add(reinterpret_cast(block)); + m_newGen.toSpace->push(block); + m_newGen.blockFilter.add(reinterpret_cast(block)); m_blockSet.add(block); m_allocator.setCurrentBlock(block); } @@ -150,6 +154,7 @@ inline void CopiedSpace::allocateBlock() inline CheckedBoolean CopiedSpace::tryAllocate(size_t bytes, void** outPtr) { ASSERT(!m_heap->vm()->isInitializingObject()); + ASSERT(bytes); if (!m_allocator.tryAllocate(bytes, outPtr)) return tryAllocateSlowCase(bytes, outPtr); @@ -173,6 +178,85 @@ inline CopiedBlock* CopiedSpace::blockFor(void* ptr) return reinterpret_cast(reinterpret_cast(ptr) & s_blockMask); } +template +inline void CopiedSpace::startedCopying() +{ + DoublyLinkedList* fromSpace; + DoublyLinkedList* oversizeBlocks; + TinyBloomFilter* blockFilter; + if (collectionType == FullCollection) { + ASSERT(m_oldGen.fromSpace->isEmpty()); + ASSERT(m_newGen.fromSpace->isEmpty()); + + m_oldGen.toSpace->append(*m_newGen.toSpace); + m_oldGen.oversizeBlocks.append(m_newGen.oversizeBlocks); + + ASSERT(m_newGen.toSpace->isEmpty()); + ASSERT(m_newGen.fromSpace->isEmpty()); + ASSERT(m_newGen.oversizeBlocks.isEmpty()); + + std::swap(m_oldGen.fromSpace, m_oldGen.toSpace); + fromSpace = m_oldGen.fromSpace; + oversizeBlocks = &m_oldGen.oversizeBlocks; + blockFilter = &m_oldGen.blockFilter; + } else { + std::swap(m_newGen.fromSpace, m_newGen.toSpace); + fromSpace = m_newGen.fromSpace; + oversizeBlocks = &m_newGen.oversizeBlocks; + blockFilter = &m_newGen.blockFilter; + } + + blockFilter->reset(); + m_allocator.resetCurrentBlock(); + + CopiedBlock* next = 0; + size_t totalLiveBytes = 0; + size_t totalUsableBytes = 0; + for (CopiedBlock* block = fromSpace->head(); block; block = next) { + next = block->next(); + if (!block->isPinned() && block->canBeRecycled()) { + recycleEvacuatedBlock(block, collectionType); + continue; + } + ASSERT(block->liveBytes() <= CopiedBlock::blockSize); + totalLiveBytes += block->liveBytes(); + totalUsableBytes += block->payloadCapacity(); + block->didPromote(); + } + + CopiedBlock* block = oversizeBlocks->head(); + while (block) { + CopiedBlock* next = block->next(); + if (block->isPinned()) { + blockFilter->add(reinterpret_cast(block)); + totalLiveBytes += block->payloadCapacity(); + totalUsableBytes += block->payloadCapacity(); + block->didPromote(); + } else { + oversizeBlocks->remove(block); + m_blockSet.remove(block); + m_heap->blockAllocator().deallocateCustomSize(CopiedBlock::destroy(block)); + } + block = next; + } + + double markedSpaceBytes = m_heap->objectSpace().capacity(); + double totalFragmentation = static_cast(totalLiveBytes + markedSpaceBytes) / static_cast(totalUsableBytes + markedSpaceBytes); + m_shouldDoCopyPhase = m_heap->operationInProgress() == EdenCollection || totalFragmentation <= Options::minHeapUtilization(); + if (!m_shouldDoCopyPhase) { + if (Options::logGC()) + dataLog("Skipped copying, "); + return; + } + + if (Options::logGC()) + dataLogF("Did copy, "); + ASSERT(m_shouldDoCopyPhase); + ASSERT(!m_numberOfLoanedBlocks); + ASSERT(!m_inCopyingPhase); + m_inCopyingPhase = true; +} + } // namespace JSC #endif // CopiedSpaceInlines_h diff --git a/JavaScriptCore/heap/CopyVisitor.cpp b/JavaScriptCore/heap/CopyVisitor.cpp index 3be31c10..3d18936e 100644 --- a/JavaScriptCore/heap/CopyVisitor.cpp +++ b/JavaScriptCore/heap/CopyVisitor.cpp @@ -57,7 +57,7 @@ void CopyVisitor::copyFromShared() visitItem(*it); ASSERT(!block->liveBytes()); - m_shared.m_copiedSpace->recycleEvacuatedBlock(block); + m_shared.m_copiedSpace->recycleEvacuatedBlock(block, m_shared.m_vm->heap.operationInProgress()); } m_shared.getNextBlocksToCopy(next, end); } diff --git a/JavaScriptCore/heap/CopyVisitorInlines.h b/JavaScriptCore/heap/CopyVisitorInlines.h index 94a38cf8..6e197fca 100644 --- a/JavaScriptCore/heap/CopyVisitorInlines.h +++ b/JavaScriptCore/heap/CopyVisitorInlines.h @@ -55,7 +55,7 @@ inline bool CopyVisitor::checkIfShouldCopy(void* oldPtr) inline void* CopyVisitor::allocateNewSpace(size_t bytes) { void* result = 0; // Compilers don't realize that this will be assigned. - if (LIKELY(m_copiedAllocator.tryAllocate(bytes, &result))) + if (LIKELY(m_copiedAllocator.tryAllocateDuringCopying(bytes, &result))) return result; result = allocateNewSpaceSlow(bytes); @@ -70,7 +70,7 @@ inline void* CopyVisitor::allocateNewSpaceSlow(size_t bytes) m_copiedAllocator.setCurrentBlock(newBlock); void* result = 0; - CheckedBoolean didSucceed = m_copiedAllocator.tryAllocate(bytes, &result); + CheckedBoolean didSucceed = m_copiedAllocator.tryAllocateDuringCopying(bytes, &result); ASSERT(didSucceed); return result; } diff --git a/JavaScriptCore/heap/CopyWriteBarrier.h b/JavaScriptCore/heap/CopyWriteBarrier.h new file mode 100644 index 00000000..84771266 --- /dev/null +++ b/JavaScriptCore/heap/CopyWriteBarrier.h @@ -0,0 +1,90 @@ +/* + * Copyright (C) 2014 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. + */ + +#ifndef CopyWriteBarrier_h +#define CopyWriteBarrier_h + +#include "Heap.h" + +namespace JSC { + +template +class CopyWriteBarrier { +public: + CopyWriteBarrier() + : m_value(0) + { + } + + CopyWriteBarrier(VM& vm, const JSCell* owner, T& value) + { + this->set(vm, owner, &value); + } + + CopyWriteBarrier(VM& vm, const JSCell* owner, T* value) + { + this->set(vm, owner, value); + } + + bool operator!() const { return !m_value; } + + typedef T* (CopyWriteBarrier::*UnspecifiedBoolType); + operator UnspecifiedBoolType*() const { return m_value ? reinterpret_cast(1) : 0; } + + T* get() const + { + return m_value; + } + + T* operator*() const + { + return get(); + } + + T* operator->() const + { + return get(); + } + + void set(VM&, const JSCell* owner, T* value) + { + this->m_value = value; + Heap::writeBarrier(owner); + } + + void setWithoutWriteBarrier(T* value) + { + this->m_value = value; + } + + void clear() { m_value = 0; } + +private: + T* m_value; +}; + +} // namespace JSC + +#endif // CopyWriteBarrier_h diff --git a/JavaScriptCore/heap/DelayedReleaseScope.h b/JavaScriptCore/heap/DelayedReleaseScope.h new file mode 100644 index 00000000..52e062d2 --- /dev/null +++ b/JavaScriptCore/heap/DelayedReleaseScope.h @@ -0,0 +1,95 @@ +/* + * Copyright (C) 2013 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. + */ + +#ifndef DelayedReleaseScope_h +#define DelayedReleaseScope_h + +#include "APIShims.h" +#include "MarkedSpace.h" + +namespace JSC { + +#if USE(CF) + +class DelayedReleaseScope { +public: + DelayedReleaseScope(MarkedSpace& markedSpace) + : m_markedSpace(markedSpace) + { + ASSERT(!m_markedSpace.m_currentDelayedReleaseScope); + m_markedSpace.m_currentDelayedReleaseScope = this; + } + + ~DelayedReleaseScope() + { + ASSERT(m_markedSpace.m_currentDelayedReleaseScope == this); + m_markedSpace.m_currentDelayedReleaseScope = nullptr; + + APICallbackShim callbackShim(*m_markedSpace.m_heap->vm()); + m_delayedReleaseObjects.clear(); + } + + template + void releaseSoon(RetainPtr&& object) + { + m_delayedReleaseObjects.append(std::move(object)); + } + + static bool isInEffectFor(MarkedSpace& markedSpace) + { + return markedSpace.m_currentDelayedReleaseScope; + } + +private: + MarkedSpace& m_markedSpace; + Vector> m_delayedReleaseObjects; +}; + +template +inline void MarkedSpace::releaseSoon(RetainPtr&& object) +{ + ASSERT(m_currentDelayedReleaseScope); + m_currentDelayedReleaseScope->releaseSoon(std::move(object)); +} + +#else // USE(CF) + +class DelayedReleaseScope { +public: + DelayedReleaseScope(MarkedSpace&) + { + } + + static bool isInEffectFor(MarkedSpace&) + { + return true; + } +}; + +#endif // USE(CF) + +} // namespace JSC + +#endif // DelayedReleaseScope_h diff --git a/JavaScriptCore/heap/GCThreadSharedData.cpp b/JavaScriptCore/heap/GCThreadSharedData.cpp index b342b961..7d1d7b4c 100644 --- a/JavaScriptCore/heap/GCThreadSharedData.cpp +++ b/JavaScriptCore/heap/GCThreadSharedData.cpp @@ -181,7 +181,15 @@ void GCThreadSharedData::didStartCopying() { { SpinLockHolder locker(&m_copyLock); - WTF::copyToVector(m_copiedSpace->m_blockSet, m_blocksToCopy); + if (m_vm->heap.operationInProgress() == EdenCollection) { + // Reset the vector to be empty, but don't throw away the backing store. + m_blocksToCopy.shrink(0); + for (CopiedBlock* block = m_copiedSpace->m_newGen.fromSpace->head(); block; block = block->next()) + m_blocksToCopy.append(block); + } else { + ASSERT(m_vm->heap.operationInProgress() == FullCollection); + WTF::copyToVector(m_copiedSpace->m_blockSet, m_blocksToCopy); + } m_copyIndex = 0; } diff --git a/JavaScriptCore/heap/Heap.cpp b/JavaScriptCore/heap/Heap.cpp index 07572ee3..2aba3aa9 100644 --- a/JavaScriptCore/heap/Heap.cpp +++ b/JavaScriptCore/heap/Heap.cpp @@ -27,6 +27,7 @@ #include "CopiedSpaceInlines.h" #include "CopyVisitorInlines.h" #include "DFGWorklist.h" +#include "DelayedReleaseScope.h" #include "GCActivityCallback.h" #include "GCIncomingRefCountedSetInlines.h" #include "HeapIterationScope.h" @@ -34,13 +35,14 @@ #include "HeapStatistics.h" #include "IncrementalSweeper.h" #include "Interpreter.h" -#include "VM.h" #include "JSGlobalObject.h" #include "JSLock.h" #include "JSONObject.h" #include "Operations.h" +#include "RecursiveAllocationScope.h" #include "Tracing.h" #include "UnlinkedCodeBlock.h" +#include "VM.h" #include "WeakSetInlines.h" #include #include @@ -251,9 +253,11 @@ Heap::Heap(VM* vm, HeapType heapType) , m_ramSize(ramSize()) , m_minBytesPerCycle(minHeapSize(m_heapType, m_ramSize)) , m_sizeAfterLastCollect(0) - , m_bytesAllocatedLimit(m_minBytesPerCycle) - , m_bytesAllocated(0) - , m_bytesAbandoned(0) + , m_bytesAllocatedThisCycle(0) + , m_bytesAbandonedThisCycle(0) + , m_maxEdenSize(m_minBytesPerCycle) + , m_maxHeapSize(m_minBytesPerCycle) + , m_shouldDoFullCollection(false) , m_totalBytesVisited(0) , m_totalBytesCopied(0) , m_operationInProgress(NoOperation) @@ -267,6 +271,7 @@ Heap::Heap(VM* vm, HeapType heapType) , m_copyVisitor(m_sharedData) , m_handleSet(vm) , m_isSafeToCollect(false) + , m_writeBarrierBuffer(256) , m_vm(vm) , m_lastGCLength(0) , m_lastCodeDiscardTime(WTF::monotonicallyIncreasingTime()) @@ -290,15 +295,10 @@ bool Heap::isPagedOut(double deadline) // Run all pending finalizers now because we won't get another chance. void Heap::lastChanceToFinalize() { - RELEASE_ASSERT(!m_vm->dynamicGlobalObject); + RELEASE_ASSERT(!m_vm->entryScope); RELEASE_ASSERT(m_operationInProgress == NoOperation); m_objectSpace.lastChanceToFinalize(); - -#if ENABLE(SIMPLE_HEAP_PROFILING) - m_slotVisitor.m_visitedTypeCounts.dump(WTF::dataFile(), "Visited Type Counts"); - m_destroyedTypeCounts.dump(WTF::dataFile(), "Destroyed Type Counts"); -#endif } void Heap::reportExtraMemoryCostSlowCase(size_t cost) @@ -334,8 +334,8 @@ void Heap::reportAbandonedObjectGraph() void Heap::didAbandon(size_t bytes) { if (m_activityCallback) - m_activityCallback->didAllocate(m_bytesAllocated + m_bytesAbandoned); - m_bytesAbandoned += bytes; + m_activityCallback->didAllocate(m_bytesAllocatedThisCycle + m_bytesAbandonedThisCycle); + m_bytesAbandonedThisCycle += bytes; } void Heap::protect(JSValue k) @@ -467,6 +467,7 @@ void Heap::markRoots() { GCPHASE(GatherStackRoots); stack().gatherConservativeRoots(stackRoots, m_jitStubRoutines, m_codeBlocks); + stack().sanitizeStack(); } #if ENABLE(DFG_JIT) @@ -488,6 +489,11 @@ void Heap::markRoots() visitor.setup(); HeapRootVisitor heapRootVisitor(visitor); +#if ENABLE(GGC) + Vector rememberedSet(m_slotVisitor.markStack().size()); + m_slotVisitor.markStack().fillVector(rememberedSet); +#endif + { ParallelModeEnabler enabler(visitor); @@ -591,6 +597,16 @@ void Heap::markRoots() } } +#if ENABLE(GGC) + { + GCPHASE(ClearRememberedSet); + for (unsigned i = 0; i < rememberedSet.size(); ++i) { + const JSCell* cell = rememberedSet[i]; + MarkedBlock::blockFor(cell)->clearRemembered(cell); + } + } +#endif + GCCOUNTER(VisitedValueCount, visitor.visitCount()); m_sharedData.didFinishMarking(); @@ -602,8 +618,14 @@ void Heap::markRoots() MARK_LOG_MESSAGE2("\nNumber of live Objects after full GC %lu, took %.6f secs\n", visitCount, WTF::monotonicallyIncreasingTime() - gcStartTime); #endif - m_totalBytesVisited = visitor.bytesVisited(); - m_totalBytesCopied = visitor.bytesCopied(); + if (m_operationInProgress == EdenCollection) { + m_totalBytesVisited += visitor.bytesVisited(); + m_totalBytesCopied += visitor.bytesCopied(); + } else { + ASSERT(m_operationInProgress == FullCollection); + m_totalBytesVisited = visitor.bytesVisited(); + m_totalBytesCopied = visitor.bytesCopied(); + } #if ENABLE(PARALLEL_GC) m_totalBytesVisited += m_sharedData.childBytesVisited(); m_totalBytesCopied += m_sharedData.childBytesCopied(); @@ -616,9 +638,10 @@ void Heap::markRoots() m_sharedData.reset(); } +template void Heap::copyBackingStores() { - m_storageSpace.startedCopying(); + m_storageSpace.startedCopying(); if (m_storageSpace.shouldDoCopyPhase()) { m_sharedData.didStartCopying(); m_copyVisitor.startCopying(); @@ -628,7 +651,7 @@ void Heap::copyBackingStores() // before signaling that the phase is complete. m_storageSpace.doneCopying(); m_sharedData.didFinishCopying(); - } else + } else m_storageSpace.doneCopying(); } @@ -693,7 +716,7 @@ void Heap::deleteAllCompiledCode() { // If JavaScript is running, it's not safe to delete code, since we'll end // up deleting code that is live on the stack. - if (m_vm->dynamicGlobalObject) + if (m_vm->entryScope) return; for (ExecutableBase* current = m_compiledCode.head(); current; current = current->next()) { @@ -724,17 +747,33 @@ void Heap::deleteUnmarkedCompiledCode() m_jitStubRoutines.deleteUnmarkedJettisonedStubRoutines(); } +void Heap::addToRememberedSet(const JSCell* cell) +{ + ASSERT(cell); + ASSERT(!Options::enableConcurrentJIT() || !isCompilationThread()); + if (isInRememberedSet(cell)) + return; + MarkedBlock::blockFor(cell)->setRemembered(cell); + m_slotVisitor.unconditionallyAppend(const_cast(cell)); +} + void Heap::collectAllGarbage() { if (!m_isSafeToCollect) return; - - collect(DoSweep); + + m_shouldDoFullCollection = true; + collect(); + + SamplingRegion samplingRegion("Garbage Collection: Sweeping"); + DelayedReleaseScope delayedReleaseScope(m_objectSpace); + m_objectSpace.sweep(); + m_objectSpace.shrink(); } static double minute = 60.0; -void Heap::collect(SweepToggle sweepToggle) +void Heap::collect() { #if ENABLE(ALLOCATION_LOGGING) dataLogF("JSC GC starting collection.\n"); @@ -742,7 +781,7 @@ void Heap::collect(SweepToggle sweepToggle) double before = 0; if (Options::logGC()) { - dataLog("[GC", sweepToggle == DoSweep ? " (eager sweep)" : "", ": "); + dataLog("[GC: "); before = currentTimeMS(); } @@ -756,12 +795,32 @@ void Heap::collect(SweepToggle sweepToggle) JAVASCRIPTCORE_GC_BEGIN(); RELEASE_ASSERT(m_operationInProgress == NoOperation); - m_deferralDepth++; // Make sure that we don't GC in this call. - m_vm->prepareToDiscardCode(); - m_deferralDepth--; // Decrement deferal manually, so we don't GC when we do so, since we are already GCing!. - - m_operationInProgress = Collection; - m_extraMemoryUsage = 0; + { + RecursiveAllocationScope scope(*this); + m_vm->prepareToDiscardCode(); + } + + bool isFullCollection = m_shouldDoFullCollection; + if (isFullCollection) { + m_operationInProgress = FullCollection; + m_slotVisitor.clearMarkStack(); + m_shouldDoFullCollection = false; + if (Options::logGC()) + dataLog("FullCollection, "); + } else { +#if ENABLE(GGC) + m_operationInProgress = EdenCollection; + if (Options::logGC()) + dataLog("EdenCollection, "); +#else + m_operationInProgress = FullCollection; + m_slotVisitor.clearMarkStack(); + if (Options::logGC()) + dataLog("FullCollection, "); +#endif + } + if (m_operationInProgress == FullCollection) + m_extraMemoryUsage = 0; if (m_activityCallback) m_activityCallback->willCollect(); @@ -775,6 +834,16 @@ void Heap::collect(SweepToggle sweepToggle) { GCPHASE(StopAllocation); m_objectSpace.stopAllocating(); + if (m_operationInProgress == FullCollection) + m_storageSpace.didStartFullCollection(); + } + + { + GCPHASE(FlushWriteBarrierBuffer); + if (m_operationInProgress == EdenCollection) + m_writeBarrierBuffer.flush(*this); + else + m_writeBarrierBuffer.reset(); } markRoots(); @@ -791,13 +860,16 @@ void Heap::collect(SweepToggle sweepToggle) m_arrayBuffers.sweep(); } - { + if (m_operationInProgress == FullCollection) { m_blockSnapshot.resize(m_objectSpace.blocks().set().size()); MarkedBlockSnapshotFunctor functor(m_blockSnapshot); m_objectSpace.forEachBlock(functor); } - copyBackingStores(); + if (m_operationInProgress == FullCollection) + copyBackingStores(); + else + copyBackingStores(); { GCPHASE(FinalizeUnconditionalFinalizers); @@ -814,15 +886,15 @@ void Heap::collect(SweepToggle sweepToggle) m_vm->clearSourceProviderCaches(); } - if (sweepToggle == DoSweep) { - SamplingRegion samplingRegion("Garbage Collection: Sweeping"); - GCPHASE(Sweeping); - m_objectSpace.sweep(); - m_objectSpace.shrink(); + if (m_operationInProgress == FullCollection) + m_sweeper->startSweeping(m_blockSnapshot); + + { + GCPHASE(AddCurrentlyExecutingCodeBlocksToRememberedSet); + m_codeBlocks.rememberCurrentlyExecutingCodeBlocks(this); } - m_sweeper->startSweeping(m_blockSnapshot); - m_bytesAbandoned = 0; + m_bytesAbandonedThisCycle = 0; { GCPHASE(ResetAllocators); @@ -833,21 +905,32 @@ void Heap::collect(SweepToggle sweepToggle) if (Options::gcMaxHeapSize() && currentHeapSize > Options::gcMaxHeapSize()) HeapStatistics::exitWithFailure(); - m_sizeAfterLastCollect = currentHeapSize; + if (m_operationInProgress == FullCollection) { + // To avoid pathological GC churn in very small and very large heaps, we set + // the new allocation limit based on the current size of the heap, with a + // fixed minimum. + m_maxHeapSize = max(minHeapSize(m_heapType, m_ramSize), proportionalHeapSize(currentHeapSize, m_ramSize)); + m_maxEdenSize = m_maxHeapSize - currentHeapSize; + } else { + ASSERT(currentHeapSize >= m_sizeAfterLastCollect); + m_maxEdenSize = m_maxHeapSize - currentHeapSize; + double edenToOldGenerationRatio = (double)m_maxEdenSize / (double)m_maxHeapSize; + double minEdenToOldGenerationRatio = 1.0 / 3.0; + if (edenToOldGenerationRatio < minEdenToOldGenerationRatio) + m_shouldDoFullCollection = true; + m_maxHeapSize += currentHeapSize - m_sizeAfterLastCollect; + m_maxEdenSize = m_maxHeapSize - currentHeapSize; + } - // To avoid pathological GC churn in very small and very large heaps, we set - // the new allocation limit based on the current size of the heap, with a - // fixed minimum. - size_t maxHeapSize = max(minHeapSize(m_heapType, m_ramSize), proportionalHeapSize(currentHeapSize, m_ramSize)); - m_bytesAllocatedLimit = maxHeapSize - currentHeapSize; + m_sizeAfterLastCollect = currentHeapSize; - m_bytesAllocated = 0; + m_bytesAllocatedThisCycle = 0; double lastGCEndTime = WTF::monotonicallyIncreasingTime(); m_lastGCLength = lastGCEndTime - lastGCStartTime; if (Options::recordGCPauseTimes()) HeapStatistics::recordGCPauseTime(lastGCStartTime, lastGCEndTime); - RELEASE_ASSERT(m_operationInProgress == Collection); + RELEASE_ASSERT(m_operationInProgress == EdenCollection || m_operationInProgress == FullCollection); m_operationInProgress = NoOperation; JAVASCRIPTCORE_GC_END(); @@ -865,10 +948,6 @@ void Heap::collect(SweepToggle sweepToggle) double after = currentTimeMS(); dataLog(after - before, " ms, ", currentHeapSize / 1024, " kb]\n"); } - -#if ENABLE(ALLOCATION_LOGGING) - dataLogF("JSC GC finishing collection.\n"); -#endif } bool Heap::collectIfNecessaryOrDefer() @@ -879,7 +958,7 @@ bool Heap::collectIfNecessaryOrDefer() if (!shouldCollect()) return false; - collect(DoNotSweep); + collect(); return true; } @@ -918,8 +997,8 @@ void Heap::setGarbageCollectionTimerEnabled(bool enable) void Heap::didAllocate(size_t bytes) { if (m_activityCallback) - m_activityCallback->didAllocate(m_bytesAllocated + m_bytesAbandoned); - m_bytesAllocated += bytes; + m_activityCallback->didAllocate(m_bytesAllocatedThisCycle + m_bytesAbandonedThisCycle); + m_bytesAllocatedThisCycle += bytes; } bool Heap::isValidAllocation(size_t) @@ -996,4 +1075,27 @@ void Heap::decrementDeferralDepthAndGCIfNeeded() collectIfNecessaryOrDefer(); } +void Heap::writeBarrier(const JSCell* from) +{ +#if ENABLE(GGC) + ASSERT_GC_OBJECT_LOOKS_VALID(const_cast(from)); + if (!from || !isMarked(from)) + return; + Heap* heap = Heap::heap(from); + heap->addToRememberedSet(from); +#else + UNUSED_PARAM(from); +#endif +} + +void Heap::flushWriteBarrierBuffer(JSCell* cell) +{ +#if ENABLE(GGC) + m_writeBarrierBuffer.flush(*this); + m_writeBarrierBuffer.add(cell); +#else + UNUSED_PARAM(cell); +#endif +} + } // namespace JSC diff --git a/JavaScriptCore/heap/Heap.h b/JavaScriptCore/heap/Heap.h index 27c22297..ab580aa1 100644 --- a/JavaScriptCore/heap/Heap.h +++ b/JavaScriptCore/heap/Heap.h @@ -39,6 +39,7 @@ #include "Options.h" #include "SlotVisitor.h" #include "WeakHandleOwner.h" +#include "WriteBarrierBuffer.h" #include "WriteBarrierSupport.h" #include #include @@ -77,6 +78,7 @@ namespace JSC { WTF_MAKE_NONCOPYABLE(Heap); public: friend class JIT; + friend class DFG::SpeculativeJIT; friend class GCThreadSharedData; static Heap* heap(const JSValue); // 0 for immediate values static Heap* heap(const JSCell*); @@ -92,10 +94,20 @@ namespace JSC { static bool testAndSetMarked(const void*); static void setMarked(const void*); + JS_EXPORT_PRIVATE void addToRememberedSet(const JSCell*); + bool isInRememberedSet(const JSCell* cell) const + { + ASSERT(cell); + ASSERT(!Options::enableConcurrentJIT() || !isCompilationThread()); + return MarkedBlock::blockFor(cell)->isRemembered(cell); + } static bool isWriteBarrierEnabled(); + JS_EXPORT_PRIVATE static void writeBarrier(const JSCell*); static void writeBarrier(const JSCell*, JSValue); static void writeBarrier(const JSCell*, JSCell*); - static uint8_t* addressOfCardFor(JSCell*); + + WriteBarrierBuffer& writeBarrierBuffer() { return m_writeBarrierBuffer; } + void flushWriteBarrierBuffer(JSCell*); Heap(VM*, HeapType); ~Heap(); @@ -114,6 +126,7 @@ namespace JSC { // true if collection is in progress inline bool isCollecting(); + inline HeapOperation operationInProgress() { return m_operationInProgress; } // true if an allocation or collection is in progress inline bool isBusy(); @@ -133,9 +146,8 @@ namespace JSC { bool isSafeToCollect() const { return m_isSafeToCollect; } JS_EXPORT_PRIVATE void collectAllGarbage(); - enum SweepToggle { DoNotSweep, DoSweep }; bool shouldCollect(); - void collect(SweepToggle); + void collect(); bool collectIfNecessaryOrDefer(); // Returns true if it did collect. void reportExtraMemoryCost(size_t cost); @@ -186,6 +198,10 @@ namespace JSC { bool isDeferred() const { return !!m_deferralDepth; } +#if USE(CF) + template void releaseSoon(RetainPtr&&); +#endif + private: friend class CodeBlock; friend class CopiedBlock; @@ -200,6 +216,7 @@ namespace JSC { friend class MarkedBlock; friend class CopiedSpace; friend class CopyVisitor; + friend class RecursiveAllocationScope; friend class SlotVisitor; friend class SuperRegion; friend class IncrementalSweeper; @@ -226,6 +243,7 @@ namespace JSC { void markRoots(); void markProtectedObjects(HeapRootVisitor&); void markTempSortVectors(HeapRootVisitor&); + template void copyBackingStores(); void harvestWeakReferences(); void finalizeUnconditionalFinalizers(); @@ -247,10 +265,11 @@ namespace JSC { const size_t m_minBytesPerCycle; size_t m_sizeAfterLastCollect; - size_t m_bytesAllocatedLimit; - size_t m_bytesAllocated; - size_t m_bytesAbandoned; - + size_t m_bytesAllocatedThisCycle; + size_t m_bytesAbandonedThisCycle; + size_t m_maxEdenSize; + size_t m_maxHeapSize; + bool m_shouldDoFullCollection; size_t m_totalBytesVisited; size_t m_totalBytesCopied; @@ -261,9 +280,7 @@ namespace JSC { GCIncomingRefCountedSet m_arrayBuffers; size_t m_extraMemoryUsage; -#if ENABLE(SIMPLE_HEAP_PROFILING) - VTableSpectrum m_destroyedTypeCounts; -#endif + HashSet m_copyingRememberedSet; ProtectCountSet m_protectedValues; Vector* > m_tempSortingVectors; @@ -283,6 +300,8 @@ namespace JSC { bool m_isSafeToCollect; + WriteBarrierBuffer m_writeBarrierBuffer; + VM* m_vm; double m_lastGCLength; double m_lastCodeDiscardTime; @@ -314,8 +333,8 @@ namespace JSC { if (isDeferred()) return false; if (Options::gcMaxHeapSize()) - return m_bytesAllocated > Options::gcMaxHeapSize() && m_isSafeToCollect && m_operationInProgress == NoOperation; - return m_bytesAllocated > m_bytesAllocatedLimit && m_isSafeToCollect && m_operationInProgress == NoOperation; + return m_bytesAllocatedThisCycle > Options::gcMaxHeapSize() && m_isSafeToCollect && m_operationInProgress == NoOperation; + return m_bytesAllocatedThisCycle > m_maxEdenSize && m_isSafeToCollect && m_operationInProgress == NoOperation; } bool Heap::isBusy() @@ -325,7 +344,7 @@ namespace JSC { bool Heap::isCollecting() { - return m_operationInProgress == Collection; + return m_operationInProgress == FullCollection || m_operationInProgress == EdenCollection; } inline Heap* Heap::heap(const JSCell* cell) @@ -362,21 +381,33 @@ namespace JSC { inline bool Heap::isWriteBarrierEnabled() { -#if ENABLE(WRITE_BARRIER_PROFILING) +#if ENABLE(WRITE_BARRIER_PROFILING) || ENABLE(GGC) return true; #else return false; #endif } - inline void Heap::writeBarrier(const JSCell*, JSCell*) + inline void Heap::writeBarrier(const JSCell* from, JSCell* to) { +#if ENABLE(WRITE_BARRIER_PROFILING) WriteBarrierCounters::countWriteBarrier(); +#endif + if (!from || !isMarked(from)) + return; + if (!to || isMarked(to)) + return; + Heap::heap(from)->addToRememberedSet(from); } - inline void Heap::writeBarrier(const JSCell*, JSValue) + inline void Heap::writeBarrier(const JSCell* from, JSValue to) { +#if ENABLE(WRITE_BARRIER_PROFILING) WriteBarrierCounters::countWriteBarrier(); +#endif + if (!to.isCell()) + return; + writeBarrier(from, to.asCell()); } inline void Heap::reportExtraMemoryCost(size_t cost) @@ -468,6 +499,14 @@ namespace JSC { return m_blockAllocator; } +#if USE(CF) + template + inline void Heap::releaseSoon(RetainPtr&& object) + { + m_objectSpace.releaseSoon(std::move(object)); + } +#endif + } // namespace JSC #endif // Heap_h diff --git a/JavaScriptCore/heap/HeapOperation.h b/JavaScriptCore/heap/HeapOperation.h index 8f0a0232..769127e8 100644 --- a/JavaScriptCore/heap/HeapOperation.h +++ b/JavaScriptCore/heap/HeapOperation.h @@ -28,7 +28,7 @@ namespace JSC { -enum HeapOperation { NoOperation, Allocation, Collection }; +enum HeapOperation { NoOperation, Allocation, FullCollection, EdenCollection }; } // namespace JSC diff --git a/JavaScriptCore/heap/HeapTimer.cpp b/JavaScriptCore/heap/HeapTimer.cpp index 14915716..1331b0ac 100644 --- a/JavaScriptCore/heap/HeapTimer.cpp +++ b/JavaScriptCore/heap/HeapTimer.cpp @@ -100,30 +100,6 @@ void HeapTimer::timerDidFire(CFRunLoopTimerRef timer, void* context) apiLock->unlock(); } -#elif PLATFORM(BLACKBERRY) - -HeapTimer::HeapTimer(VM* vm) - : m_vm(vm) - , m_timer(this, &HeapTimer::timerDidFire) -{ - // FIXME: Implement HeapTimer for other threads. - if (WTF::isMainThread() && !m_timer.tryCreateClient()) - CRASH(); -} - -HeapTimer::~HeapTimer() -{ -} - -void HeapTimer::timerDidFire() -{ - doWork(); -} - -void HeapTimer::invalidate() -{ -} - #elif PLATFORM(EFL) HeapTimer::HeapTimer(VM* vm) diff --git a/JavaScriptCore/heap/HeapTimer.h b/JavaScriptCore/heap/HeapTimer.h index 4d1ee667..760405c7 100644 --- a/JavaScriptCore/heap/HeapTimer.h +++ b/JavaScriptCore/heap/HeapTimer.h @@ -31,8 +31,6 @@ #if USE(CF) #include -#elif PLATFORM(BLACKBERRY) -#include #elif PLATFORM(EFL) #if USE(EO) typedef struct _Eo_Opaque Ecore_Timer; @@ -68,10 +66,6 @@ class HeapTimer { CFRunLoopTimerContext m_context; Mutex m_shutdownMutex; -#elif PLATFORM(BLACKBERRY) - void timerDidFire(); - - BlackBerry::Platform::Timer m_timer; #elif PLATFORM(EFL) static bool timerEvent(void*); Ecore_Timer* add(double delay, void* agent); diff --git a/JavaScriptCore/heap/IncrementalSweeper.cpp b/JavaScriptCore/heap/IncrementalSweeper.cpp index ac050b6e..2852266a 100644 --- a/JavaScriptCore/heap/IncrementalSweeper.cpp +++ b/JavaScriptCore/heap/IncrementalSweeper.cpp @@ -27,6 +27,7 @@ #include "IncrementalSweeper.h" #include "APIShims.h" +#include "DelayedReleaseScope.h" #include "Heap.h" #include "JSObject.h" #include "JSString.h" @@ -37,14 +38,12 @@ namespace JSC { -#if USE(CF) || PLATFORM(BLACKBERRY) +#if USE(CF) static const double sweepTimeSlice = .01; // seconds static const double sweepTimeTotal = .10; static const double sweepTimeMultiplier = 1.0 / sweepTimeTotal; -#if USE(CF) - IncrementalSweeper::IncrementalSweeper(Heap* heap, CFRunLoopRef runLoop) : HeapTimer(heap->vm(), runLoop) , m_currentBlockToSweepIndex(0) @@ -67,32 +66,6 @@ void IncrementalSweeper::cancelTimer() CFRunLoopTimerSetNextFireDate(m_timer.get(), CFAbsoluteTimeGetCurrent() + s_decade); } -#elif PLATFORM(BLACKBERRY) - -IncrementalSweeper::IncrementalSweeper(Heap* heap) - : HeapTimer(heap->vm()) - , m_currentBlockToSweepIndex(0) - , m_blocksToSweep(heap->m_blockSnapshot) -{ -} - -PassOwnPtr IncrementalSweeper::create(Heap* heap) -{ - return adoptPtr(new IncrementalSweeper(heap)); -} - -void IncrementalSweeper::scheduleTimer() -{ - m_timer.start(sweepTimeSlice * sweepTimeMultiplier); -} - -void IncrementalSweeper::cancelTimer() -{ - m_timer.stop(); -} - -#endif - void IncrementalSweeper::doWork() { doSweep(WTF::monotonicallyIncreasingTime()); @@ -100,6 +73,7 @@ void IncrementalSweeper::doWork() void IncrementalSweeper::doSweep(double sweepBeginTime) { + DelayedReleaseScope scope(m_vm->heap.m_objectSpace); while (m_currentBlockToSweepIndex < m_blocksToSweep.size()) { sweepNextBlock(); diff --git a/JavaScriptCore/heap/IncrementalSweeper.h b/JavaScriptCore/heap/IncrementalSweeper.h index 25954239..f5998254 100644 --- a/JavaScriptCore/heap/IncrementalSweeper.h +++ b/JavaScriptCore/heap/IncrementalSweeper.h @@ -46,13 +46,11 @@ class IncrementalSweeper : public HeapTimer { protected: #if USE(CF) JS_EXPORT_PRIVATE IncrementalSweeper(Heap*, CFRunLoopRef); -#elif PLATFORM(BLACKBERRY) - IncrementalSweeper(Heap*); #else IncrementalSweeper(VM*); #endif -#if USE(CF) || PLATFORM(BLACKBERRY) +#if USE(CF) private: void doSweep(double startTime); void scheduleTimer(); diff --git a/JavaScriptCore/heap/MachineStackMarker.cpp b/JavaScriptCore/heap/MachineStackMarker.cpp index 63854482..f546cb38 100644 --- a/JavaScriptCore/heap/MachineStackMarker.cpp +++ b/JavaScriptCore/heap/MachineStackMarker.cpp @@ -58,13 +58,6 @@ #include #endif -#if OS(QNX) -#include -#include -#include -#include -#endif - #if USE(PTHREADS) && !OS(WINDOWS) && !OS(DARWIN) #include #endif @@ -311,8 +304,6 @@ typedef arm_thread_state64_t PlatformThreadRegisters; #elif OS(WINDOWS) typedef CONTEXT PlatformThreadRegisters; -#elif OS(QNX) -typedef struct _debug_thread_info PlatformThreadRegisters; #elif USE(PTHREADS) typedef pthread_attr_t PlatformThreadRegisters; #else @@ -358,22 +349,6 @@ static size_t getPlatformThreadRegisters(const PlatformThread& platformThread, P regs.ContextFlags = CONTEXT_INTEGER | CONTEXT_CONTROL; GetThreadContext(platformThread, ®s); return sizeof(CONTEXT); -#elif OS(QNX) - memset(®s, 0, sizeof(regs)); - regs.tid = platformThread; - // FIXME: If we find this hurts performance, we can consider caching the fd and keeping it open. - int fd = open("/proc/self/as", O_RDONLY); - if (fd == -1) { - LOG_ERROR("Unable to open /proc/self/as (errno: %d)", errno); - CRASH(); - } - int rc = devctl(fd, DCMD_PROC_TIDSTATUS, ®s, sizeof(regs), 0); - if (rc != EOK) { - LOG_ERROR("devctl(DCMD_PROC_TIDSTATUS) failed (error: %d)", rc); - CRASH(); - } - close(fd); - return sizeof(struct _debug_thread_info); #elif USE(PTHREADS) pthread_attr_init(®s); #if HAVE(PTHREAD_NP_H) || OS(NETBSD) @@ -438,9 +413,6 @@ static inline void* otherThreadStackPointer(const PlatformThreadRegisters& regs) #error Unknown Architecture #endif -#elif OS(QNX) - return reinterpret_cast((uintptr_t) regs.sp); - #elif USE(PTHREADS) void* stackBase = 0; size_t stackSize = 0; @@ -455,7 +427,7 @@ static inline void* otherThreadStackPointer(const PlatformThreadRegisters& regs) static void freePlatformThreadRegisters(PlatformThreadRegisters& regs) { -#if USE(PTHREADS) && !OS(WINDOWS) && !OS(DARWIN) && !OS(QNX) +#if USE(PTHREADS) && !OS(WINDOWS) && !OS(DARWIN) pthread_attr_destroy(®s); #else UNUSED_PARAM(regs); diff --git a/JavaScriptCore/heap/MarkStack.cpp b/JavaScriptCore/heap/MarkStack.cpp index 39907c71..688de42e 100644 --- a/JavaScriptCore/heap/MarkStack.cpp +++ b/JavaScriptCore/heap/MarkStack.cpp @@ -57,8 +57,29 @@ MarkStackArray::MarkStackArray(BlockAllocator& blockAllocator) MarkStackArray::~MarkStackArray() { - ASSERT(m_numberOfSegments == 1 && m_segments.size() == 1); + ASSERT(m_numberOfSegments == 1); + ASSERT(m_segments.size() == 1); m_blockAllocator.deallocate(MarkStackSegment::destroy(m_segments.removeHead())); + m_numberOfSegments--; + ASSERT(!m_numberOfSegments); + ASSERT(!m_segments.size()); +} + +void MarkStackArray::clear() +{ + if (!m_segments.head()) + return; + MarkStackSegment* next; + for (MarkStackSegment* current = m_segments.head(); current->next(); current = next) { + next = current->next(); + m_segments.remove(current); + m_blockAllocator.deallocate(MarkStackSegment::destroy(current)); + } + m_top = 0; + m_numberOfSegments = 1; +#if !ASSERT_DISABLED + m_segments.head()->m_top = 0; +#endif } void MarkStackArray::expand() @@ -167,4 +188,28 @@ void MarkStackArray::stealSomeCellsFrom(MarkStackArray& other, size_t idleThread append(other.removeLast()); } +void MarkStackArray::fillVector(Vector& vector) +{ + ASSERT(vector.size() == size()); + + MarkStackSegment* currentSegment = m_segments.head(); + if (!currentSegment) + return; + + unsigned count = 0; + for (unsigned i = 0; i < m_top; ++i) { + ASSERT(currentSegment->data()[i]); + vector[count++] = currentSegment->data()[i]; + } + + currentSegment = currentSegment->next(); + while (currentSegment) { + for (unsigned i = 0; i < s_segmentCapacity; ++i) { + ASSERT(currentSegment->data()[i]); + vector[count++] = currentSegment->data()[i]; + } + currentSegment = currentSegment->next(); + } +} + } // namespace JSC diff --git a/JavaScriptCore/heap/MarkStack.h b/JavaScriptCore/heap/MarkStack.h index c97b6a73..6729bad2 100644 --- a/JavaScriptCore/heap/MarkStack.h +++ b/JavaScriptCore/heap/MarkStack.h @@ -52,6 +52,7 @@ #include "HeapBlock.h" #include +#include namespace JSC { @@ -100,6 +101,9 @@ class MarkStackArray { size_t size(); bool isEmpty(); + void fillVector(Vector&); + void clear(); + private: template struct CapacityFromSize { static const size_t value = (size - sizeof(MarkStackSegment)) / sizeof(const JSCell*); diff --git a/JavaScriptCore/heap/MarkedAllocator.cpp b/JavaScriptCore/heap/MarkedAllocator.cpp index 14c17ec8..c2b0f72d 100644 --- a/JavaScriptCore/heap/MarkedAllocator.cpp +++ b/JavaScriptCore/heap/MarkedAllocator.cpp @@ -1,6 +1,7 @@ #include "config.h" #include "MarkedAllocator.h" +#include "DelayedReleaseScope.h" #include "GCActivityCallback.h" #include "Heap.h" #include "IncrementalSweeper.h" @@ -9,10 +10,10 @@ namespace JSC { -bool MarkedAllocator::isPagedOut(double deadline) +static bool isListPagedOut(double deadline, DoublyLinkedList& list) { unsigned itersSinceLastTimeCheck = 0; - MarkedBlock* block = m_blockList.head(); + MarkedBlock* block = list.head(); while (block) { block = block->next(); ++itersSinceLastTimeCheck; @@ -23,23 +24,41 @@ bool MarkedAllocator::isPagedOut(double deadline) itersSinceLastTimeCheck = 0; } } + return false; +} +bool MarkedAllocator::isPagedOut(double deadline) +{ + if (isListPagedOut(deadline, m_blockList)) + return true; return false; } inline void* MarkedAllocator::tryAllocateHelper(size_t bytes) { - if (!m_freeList.head) { + // We need a while loop to check the free list because the DelayedReleaseScope + // could cause arbitrary code to execute and exhaust the free list that we + // thought had elements in it. + while (!m_freeList.head) { + DelayedReleaseScope delayedReleaseScope(*m_markedSpace); if (m_currentBlock) { - ASSERT(m_currentBlock == m_blocksToSweep); + ASSERT(m_currentBlock == m_nextBlockToSweep); m_currentBlock->didConsumeFreeList(); - m_blocksToSweep = m_currentBlock->next(); + m_nextBlockToSweep = m_currentBlock->next(); } - for (MarkedBlock*& block = m_blocksToSweep; block; block = block->next()) { + MarkedBlock* next; + for (MarkedBlock*& block = m_nextBlockToSweep; block; block = next) { + next = block->next(); + MarkedBlock::FreeList freeList = block->sweep(MarkedBlock::SweepToFreeList); + if (!freeList.head) { block->didConsumeEmptyFreeList(); + m_blockList.remove(block); + m_blockList.push(block); + if (!m_lastFullBlock) + m_lastFullBlock = block; continue; } @@ -58,10 +77,12 @@ inline void* MarkedAllocator::tryAllocateHelper(size_t bytes) return 0; } } - + + ASSERT(m_freeList.head); MarkedBlock::FreeCell* head = m_freeList.head; m_freeList.head = head->next; ASSERT(head); + m_markedSpace->didAllocateInBlock(m_currentBlock); return head; } @@ -124,11 +145,13 @@ MarkedBlock* MarkedAllocator::allocateBlock(size_t bytes) void MarkedAllocator::addBlock(MarkedBlock* block) { + // Satisfy the ASSERT in MarkedBlock::sweep. + DelayedReleaseScope delayedReleaseScope(*m_markedSpace); ASSERT(!m_currentBlock); ASSERT(!m_freeList.head); m_blockList.append(block); - m_blocksToSweep = m_currentBlock = block; + m_nextBlockToSweep = m_currentBlock = block; m_freeList = block->sweep(MarkedBlock::SweepToFreeList); m_markedSpace->didAddBlock(block); } @@ -139,9 +162,27 @@ void MarkedAllocator::removeBlock(MarkedBlock* block) m_currentBlock = m_currentBlock->next(); m_freeList = MarkedBlock::FreeList(); } - if (m_blocksToSweep == block) - m_blocksToSweep = m_blocksToSweep->next(); + if (m_nextBlockToSweep == block) + m_nextBlockToSweep = m_nextBlockToSweep->next(); + + if (block == m_lastFullBlock) + m_lastFullBlock = m_lastFullBlock->prev(); + m_blockList.remove(block); } +void MarkedAllocator::reset() +{ + m_lastActiveBlock = 0; + m_currentBlock = 0; + m_freeList = MarkedBlock::FreeList(); + if (m_heap->operationInProgress() == FullCollection) + m_lastFullBlock = 0; + + if (m_lastFullBlock) + m_nextBlockToSweep = m_lastFullBlock->next() ? m_lastFullBlock->next() : m_lastFullBlock; + else + m_nextBlockToSweep = m_blockList.head(); +} + } // namespace JSC diff --git a/JavaScriptCore/heap/MarkedAllocator.h b/JavaScriptCore/heap/MarkedAllocator.h index 3a629c3e..e0d3e890 100644 --- a/JavaScriptCore/heap/MarkedAllocator.h +++ b/JavaScriptCore/heap/MarkedAllocator.h @@ -52,7 +52,8 @@ class MarkedAllocator { MarkedBlock::FreeList m_freeList; MarkedBlock* m_currentBlock; MarkedBlock* m_lastActiveBlock; - MarkedBlock* m_blocksToSweep; + MarkedBlock* m_nextBlockToSweep; + MarkedBlock* m_lastFullBlock; DoublyLinkedList m_blockList; size_t m_cellSize; MarkedBlock::DestructorType m_destructorType; @@ -68,7 +69,8 @@ inline ptrdiff_t MarkedAllocator::offsetOfFreeListHead() inline MarkedAllocator::MarkedAllocator() : m_currentBlock(0) , m_lastActiveBlock(0) - , m_blocksToSweep(0) + , m_nextBlockToSweep(0) + , m_lastFullBlock(0) , m_cellSize(0) , m_destructorType(MarkedBlock::None) , m_heap(0) @@ -102,14 +104,6 @@ inline void* MarkedAllocator::allocate(size_t bytes) return head; } -inline void MarkedAllocator::reset() -{ - m_lastActiveBlock = 0; - m_currentBlock = 0; - m_freeList = MarkedBlock::FreeList(); - m_blocksToSweep = m_blockList.head(); -} - inline void MarkedAllocator::stopAllocating() { ASSERT(!m_lastActiveBlock); diff --git a/JavaScriptCore/heap/MarkedBlock.cpp b/JavaScriptCore/heap/MarkedBlock.cpp index 1e563a4c..674f4563 100644 --- a/JavaScriptCore/heap/MarkedBlock.cpp +++ b/JavaScriptCore/heap/MarkedBlock.cpp @@ -26,6 +26,7 @@ #include "config.h" #include "MarkedBlock.h" +#include "DelayedReleaseScope.h" #include "IncrementalSweeper.h" #include "JSCell.h" #include "JSDestructibleObject.h" @@ -59,10 +60,6 @@ inline void MarkedBlock::callDestructor(JSCell* cell) if (cell->isZapped()) return; -#if ENABLE(SIMPLE_HEAP_PROFILING) - m_heap->m_destroyedTypeCounts.countVPtr(vptr); -#endif - cell->methodTableForDestruction()->destroy(cell); cell->zap(); } @@ -106,6 +103,7 @@ MarkedBlock::FreeList MarkedBlock::specializedSweep() MarkedBlock::FreeList MarkedBlock::sweep(SweepMode sweepMode) { + ASSERT(DelayedReleaseScope::isInEffectFor(heap()->m_objectSpace)); HEAP_LOG_BLOCK_STATE_TRANSITION(this); m_weakSet.sweep(); @@ -199,6 +197,51 @@ void MarkedBlock::stopAllocating(const FreeList& freeList) m_state = Marked; } +void MarkedBlock::clearMarks() +{ +#if ENABLE(GGC) + if (heap()->operationInProgress() == JSC::EdenCollection) + this->clearMarksWithCollectionType(); + else + this->clearMarksWithCollectionType(); +#else + this->clearMarksWithCollectionType(); +#endif +} + +void MarkedBlock::clearRememberedSet() +{ + m_rememberedSet.clearAll(); +} + +template +void MarkedBlock::clearMarksWithCollectionType() +{ + ASSERT(collectionType == FullCollection || collectionType == EdenCollection); + HEAP_LOG_BLOCK_STATE_TRANSITION(this); + + ASSERT(m_state != New && m_state != FreeListed); + if (collectionType == FullCollection) { + m_marks.clearAll(); +#if ENABLE(GGC) + m_rememberedSet.clearAll(); +#endif + } + + // This will become true at the end of the mark phase. We set it now to + // avoid an extra pass to do so later. + m_state = Marked; +} + +void MarkedBlock::lastChanceToFinalize() +{ + m_weakSet.lastChanceToFinalize(); + + clearNewlyAllocated(); + clearMarksWithCollectionType(); + sweep(); +} + MarkedBlock::FreeList MarkedBlock::resumeAllocating() { HEAP_LOG_BLOCK_STATE_TRANSITION(this); diff --git a/JavaScriptCore/heap/MarkedBlock.h b/JavaScriptCore/heap/MarkedBlock.h index 61e41b3a..73f56cd7 100644 --- a/JavaScriptCore/heap/MarkedBlock.h +++ b/JavaScriptCore/heap/MarkedBlock.h @@ -25,6 +25,7 @@ #include "BlockAllocator.h" #include "HeapBlock.h" +#include "HeapOperation.h" #include "WeakSet.h" #include #include @@ -72,13 +73,16 @@ namespace JSC { friend class LLIntOffsetsExtractor; public: - static const size_t atomSize = 8; // bytes + static const size_t atomSize = 16; // bytes + static const size_t atomShiftAmount = 4; // log_2(atomSize) FIXME: Change atomSize to 16. static const size_t blockSize = 64 * KB; static const size_t blockMask = ~(blockSize - 1); // blockSize must be a power of two. static const size_t atomsPerBlock = blockSize / atomSize; static const size_t atomMask = atomsPerBlock - 1; + static const size_t markByteShiftAmount = 3; // log_2(word size for m_marks) FIXME: Change word size for m_marks to uint8_t. + struct FreeCell { FreeCell* next; }; @@ -137,11 +141,16 @@ namespace JSC { void stopAllocating(const FreeList&); FreeList resumeAllocating(); // Call this if you canonicalized a block for some non-collection related purpose. void didConsumeEmptyFreeList(); // Call this if you sweep a block, but the returned FreeList is empty. + void didSweepToNoAvail(); // Call this if you sweep a block and get an empty free list back. // Returns true if the "newly allocated" bitmap was non-null // and was successfully cleared and false otherwise. bool clearNewlyAllocated(); void clearMarks(); + void clearRememberedSet(); + template + void clearMarksWithCollectionType(); + size_t markCount(); bool isEmpty(); @@ -158,6 +167,11 @@ namespace JSC { void setMarked(const void*); void clearMarked(const void*); + void setRemembered(const void*); + void clearRemembered(const void*); + void atomicClearRemembered(const void*); + bool isRemembered(const void*); + bool isNewlyAllocated(const void*); void setNewlyAllocated(const void*); void clearNewlyAllocated(const void*); @@ -168,6 +182,8 @@ namespace JSC { template void forEachLiveCell(Functor&); template void forEachDeadCell(Functor&); + static ptrdiff_t offsetOfMarks() { return OBJECT_OFFSETOF(MarkedBlock, m_marks); } + private: static const size_t atomAlignmentMask = atomSize - 1; // atomSize must be a power of two. @@ -185,9 +201,11 @@ namespace JSC { size_t m_atomsPerCell; size_t m_endAtom; // This is a fuzzy end. Always test for < m_endAtom. #if ENABLE(PARALLEL_GC) - WTF::Bitmap m_marks; + WTF::Bitmap m_marks; + WTF::Bitmap m_rememberedSet; #else - WTF::Bitmap m_marks; + WTF::Bitmap m_marks; + WTF::Bitmap m_rememberedSet; #endif OwnPtr> m_newlyAllocated; @@ -229,15 +247,6 @@ namespace JSC { return reinterpret_cast(reinterpret_cast(p) & blockMask); } - inline void MarkedBlock::lastChanceToFinalize() - { - m_weakSet.lastChanceToFinalize(); - - clearNewlyAllocated(); - clearMarks(); - sweep(); - } - inline MarkedAllocator* MarkedBlock::allocator() const { return m_allocator; @@ -286,26 +295,10 @@ namespace JSC { HEAP_LOG_BLOCK_STATE_TRANSITION(this); ASSERT(!m_newlyAllocated); -#ifndef NDEBUG - for (size_t i = firstAtom(); i < m_endAtom; i += m_atomsPerCell) - ASSERT(m_marks.get(i)); -#endif ASSERT(m_state == FreeListed); m_state = Marked; } - inline void MarkedBlock::clearMarks() - { - HEAP_LOG_BLOCK_STATE_TRANSITION(this); - - ASSERT(m_state != New && m_state != FreeListed); - m_marks.clearAll(); - - // This will become true at the end of the mark phase. We set it now to - // avoid an extra pass to do so later. - m_state = Marked; - } - inline size_t MarkedBlock::markCount() { return m_marks.count(); @@ -341,6 +334,26 @@ namespace JSC { return (reinterpret_cast(p) - reinterpret_cast(this)) / atomSize; } + inline void MarkedBlock::setRemembered(const void* p) + { + m_rememberedSet.set(atomNumber(p)); + } + + inline void MarkedBlock::clearRemembered(const void* p) + { + m_rememberedSet.clear(atomNumber(p)); + } + + inline void MarkedBlock::atomicClearRemembered(const void* p) + { + m_rememberedSet.concurrentTestAndClear(atomNumber(p)); + } + + inline bool MarkedBlock::isRemembered(const void* p) + { + return m_rememberedSet.get(atomNumber(p)); + } + inline bool MarkedBlock::isMarked(const void* p) { return m_marks.get(atomNumber(p)); diff --git a/JavaScriptCore/heap/MarkedSpace.cpp b/JavaScriptCore/heap/MarkedSpace.cpp index 8bfff495..e005337a 100644 --- a/JavaScriptCore/heap/MarkedSpace.cpp +++ b/JavaScriptCore/heap/MarkedSpace.cpp @@ -21,6 +21,7 @@ #include "config.h" #include "MarkedSpace.h" +#include "DelayedReleaseScope.h" #include "IncrementalSweeper.h" #include "JSGlobalObject.h" #include "JSLock.h" @@ -81,6 +82,7 @@ MarkedSpace::MarkedSpace(Heap* heap) : m_heap(heap) , m_capacity(0) , m_isIterating(false) + , m_currentDelayedReleaseScope(nullptr) { for (size_t cellSize = preciseStep; cellSize <= preciseCutoff; cellSize += preciseStep) { allocatorFor(cellSize).init(heap, this, cellSize, MarkedBlock::None); @@ -103,6 +105,7 @@ MarkedSpace::~MarkedSpace() { Free free(Free::FreeAll, this); forEachBlock(free); + ASSERT(!m_blocks.set().size()); } struct LastChanceToFinalize : MarkedBlock::VoidFunctor { @@ -111,12 +114,15 @@ struct LastChanceToFinalize : MarkedBlock::VoidFunctor { void MarkedSpace::lastChanceToFinalize() { + DelayedReleaseScope delayedReleaseScope(*this); stopAllocating(); forEachBlock(); } void MarkedSpace::sweep() { + if (Options::logGC()) + dataLog("Eagerly sweeping..."); m_heap->sweeper()->willFinishSweeping(); forEachBlock(); } @@ -138,17 +144,29 @@ void MarkedSpace::resetAllocators() m_normalSpace.largeAllocator.reset(); m_normalDestructorSpace.largeAllocator.reset(); m_immortalStructureDestructorSpace.largeAllocator.reset(); + +#if ENABLE(GGC) + m_blocksWithNewObjects.clear(); +#endif } void MarkedSpace::visitWeakSets(HeapRootVisitor& heapRootVisitor) { VisitWeakSet visitWeakSet(heapRootVisitor); - forEachBlock(visitWeakSet); + if (m_heap->operationInProgress() == EdenCollection) { + for (unsigned i = 0; i < m_blocksWithNewObjects.size(); ++i) + visitWeakSet(m_blocksWithNewObjects[i]); + } else + forEachBlock(visitWeakSet); } void MarkedSpace::reapWeakSets() { - forEachBlock(); + if (m_heap->operationInProgress() == EdenCollection) { + for (unsigned i = 0; i < m_blocksWithNewObjects.size(); ++i) + m_blocksWithNewObjects[i]->reapWeakSet(); + } else + forEachBlock(); } template @@ -195,6 +213,7 @@ struct ResumeAllocatingFunctor { void MarkedSpace::resumeAllocating() { ASSERT(isIterating()); + DelayedReleaseScope scope(*this); forEachAllocator(); } @@ -299,6 +318,24 @@ void MarkedSpace::clearNewlyAllocated() #endif } +#ifndef NDEBUG +struct VerifyMarked : MarkedBlock::VoidFunctor { + void operator()(MarkedBlock* block) { ASSERT(block->needsSweeping()); } +}; +#endif + +void MarkedSpace::clearMarks() +{ + if (m_heap->operationInProgress() == EdenCollection) { + for (unsigned i = 0; i < m_blocksWithNewObjects.size(); ++i) + m_blocksWithNewObjects[i]->clearMarks(); + } else + forEachBlock(); +#ifndef NDEBUG + forEachBlock(); +#endif +} + void MarkedSpace::willStartIterating() { ASSERT(!isIterating()); diff --git a/JavaScriptCore/heap/MarkedSpace.h b/JavaScriptCore/heap/MarkedSpace.h index fbd6d6c0..e853d667 100644 --- a/JavaScriptCore/heap/MarkedSpace.h +++ b/JavaScriptCore/heap/MarkedSpace.h @@ -26,16 +26,17 @@ #include "MarkedAllocator.h" #include "MarkedBlock.h" #include "MarkedBlockSet.h" +#include #include #include #include -#include #include #include #include namespace JSC { +class DelayedReleaseScope; class Heap; class HeapIterationScope; class JSCell; @@ -45,7 +46,17 @@ class WeakGCHandle; class SlotVisitor; struct ClearMarks : MarkedBlock::VoidFunctor { - void operator()(MarkedBlock* block) { block->clearMarks(); } + void operator()(MarkedBlock* block) + { + block->clearMarks(); + } +}; + +struct ClearRememberedSet : MarkedBlock::VoidFunctor { + void operator()(MarkedBlock* block) + { + block->clearRememberedSet(); + } }; struct Sweep : MarkedBlock::VoidFunctor { @@ -104,8 +115,10 @@ class MarkedSpace { void didAddBlock(MarkedBlock*); void didConsumeFreeList(MarkedBlock*); + void didAllocateInBlock(MarkedBlock*); void clearMarks(); + void clearRememberedSet(); void clearNewlyAllocated(); void sweep(); size_t objectCount(); @@ -114,7 +127,12 @@ class MarkedSpace { bool isPagedOut(double deadline); +#if USE(CF) + template void releaseSoon(RetainPtr&&); +#endif + private: + friend class DelayedReleaseScope; friend class LLIntOffsetsExtractor; template void forEachAllocator(Functor&); @@ -131,8 +149,8 @@ class MarkedSpace { static const size_t impreciseCount = impreciseCutoff / impreciseStep; struct Subspace { - FixedArray preciseAllocators; - FixedArray impreciseAllocators; + std::array preciseAllocators; + std::array impreciseAllocators; MarkedAllocator largeAllocator; }; @@ -144,6 +162,9 @@ class MarkedSpace { size_t m_capacity; bool m_isIterating; MarkedBlockSet m_blocks; + Vector m_blocksWithNewObjects; + + DelayedReleaseScope* m_currentDelayedReleaseScope; }; template inline typename Functor::ReturnType MarkedSpace::forEachLiveCell(HeapIterationScope&, Functor& functor) @@ -254,9 +275,18 @@ inline void MarkedSpace::didAddBlock(MarkedBlock* block) m_blocks.add(block); } -inline void MarkedSpace::clearMarks() +inline void MarkedSpace::didAllocateInBlock(MarkedBlock* block) +{ +#if ENABLE(GGC) + m_blocksWithNewObjects.append(block); +#else + UNUSED_PARAM(block); +#endif +} + +inline void MarkedSpace::clearRememberedSet() { - forEachBlock(); + forEachBlock(); } inline size_t MarkedSpace::objectCount() diff --git a/JavaScriptCore/heap/RecursiveAllocationScope.h b/JavaScriptCore/heap/RecursiveAllocationScope.h new file mode 100644 index 00000000..e05f60d9 --- /dev/null +++ b/JavaScriptCore/heap/RecursiveAllocationScope.h @@ -0,0 +1,65 @@ +/* + * Copyright (C) 2013 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. + */ + +#ifndef RecursiveAllocationScope_h +#define RecursiveAllocationScope_h + +#include "Heap.h" +#include "VM.h" + +namespace JSC { + +class RecursiveAllocationScope { +public: + RecursiveAllocationScope(Heap& heap) + : m_heap(heap) +#ifndef NDEBUG + , m_savedObjectClass(heap.vm()->m_initializingObjectClass) +#endif + { +#ifndef NDEBUG + m_heap.vm()->m_initializingObjectClass = nullptr; +#endif + m_heap.m_deferralDepth++; // Make sure that we don't GC. + } + + ~RecursiveAllocationScope() + { + m_heap.m_deferralDepth--; // Decrement deferal manually so we don't GC when we do so since we are already GCing!. +#ifndef NDEBUG + m_heap.vm()->m_initializingObjectClass = m_savedObjectClass; +#endif + } + +private: + Heap& m_heap; +#ifndef NDEBUG + const ClassInfo* m_savedObjectClass; +#endif +}; + +} + +#endif // RecursiveAllocationScope_h diff --git a/JavaScriptCore/heap/SlotVisitor.cpp b/JavaScriptCore/heap/SlotVisitor.cpp index 68d894e1..05fb001a 100644 --- a/JavaScriptCore/heap/SlotVisitor.cpp +++ b/JavaScriptCore/heap/SlotVisitor.cpp @@ -33,7 +33,7 @@ SlotVisitor::SlotVisitor(GCThreadSharedData& shared) SlotVisitor::~SlotVisitor() { - ASSERT(m_stack.isEmpty()); + clearMarkStack(); } void SlotVisitor::setup() @@ -63,6 +63,11 @@ void SlotVisitor::reset() } } +void SlotVisitor::clearMarkStack() +{ + m_stack.clear(); +} + void SlotVisitor::append(ConservativeRoots& conservativeRoots) { StackStats::probe(); @@ -75,9 +80,6 @@ void SlotVisitor::append(ConservativeRoots& conservativeRoots) ALWAYS_INLINE static void visitChildren(SlotVisitor& visitor, const JSCell* cell) { StackStats::probe(); -#if ENABLE(SIMPLE_HEAP_PROFILING) - m_visitedTypeCounts.count(cell); -#endif ASSERT(Heap::isMarked(cell)); diff --git a/JavaScriptCore/heap/SlotVisitor.h b/JavaScriptCore/heap/SlotVisitor.h index a8aa66b3..4a8dc3e9 100644 --- a/JavaScriptCore/heap/SlotVisitor.h +++ b/JavaScriptCore/heap/SlotVisitor.h @@ -49,10 +49,15 @@ class SlotVisitor { SlotVisitor(GCThreadSharedData&); ~SlotVisitor(); + MarkStackArray& markStack() { return m_stack; } + + Heap* heap() const; + void append(ConservativeRoots&); template void append(JITWriteBarrier*); template void append(WriteBarrierBase*); + template void append(Iterator begin , Iterator end); void appendValues(WriteBarrierBase*, size_t count); template @@ -60,17 +65,19 @@ class SlotVisitor { void appendUnbarrieredValue(JSValue*); template void appendUnbarrieredWeak(Weak*); + void unconditionallyAppend(JSCell*); void addOpaqueRoot(void*); bool containsOpaqueRoot(void*); TriState containsOpaqueRootTriState(void*); int opaqueRootCount(); - GCThreadSharedData& sharedData() { return m_shared; } + GCThreadSharedData& sharedData() const { return m_shared; } bool isEmpty() { return m_stack.isEmpty(); } void setup(); void reset(); + void clearMarkStack(); size_t bytesVisited() const { return m_bytesVisited; } size_t bytesCopied() const { return m_bytesCopied; } @@ -88,12 +95,8 @@ class SlotVisitor { void copyLater(JSCell*, CopyToken, void*, size_t); - void reportExtraMemoryUsage(size_t size); + void reportExtraMemoryUsage(JSCell* owner, size_t); -#if ENABLE(SIMPLE_HEAP_PROFILING) - VTableSpectrum m_visitedTypeCounts; -#endif - void addWeakReferenceHarvester(WeakReferenceHarvester*); void addUnconditionalFinalizer(UnconditionalFinalizer*); diff --git a/JavaScriptCore/heap/SlotVisitorInlines.h b/JavaScriptCore/heap/SlotVisitorInlines.h index 90f18efe..ccd2e4ae 100644 --- a/JavaScriptCore/heap/SlotVisitorInlines.h +++ b/JavaScriptCore/heap/SlotVisitorInlines.h @@ -101,10 +101,17 @@ ALWAYS_INLINE void SlotVisitor::internalAppend(void* from, JSCell* cell) return; m_bytesVisited += MarkedBlock::blockFor(cell)->cellSize(); - m_visitCount++; MARK_LOG_CHILD(*this, cell); + unconditionallyAppend(cell); +} + +ALWAYS_INLINE void SlotVisitor::unconditionallyAppend(JSCell* cell) +{ + ASSERT(Heap::isMarked(cell)); + m_visitCount++; + // Should never attempt to mark something that is zapped. ASSERT(!cell->isZapped()); @@ -116,6 +123,12 @@ template inline void SlotVisitor::append(WriteBarrierBase* slot) internalAppend(slot, *slot->slot()); } +template inline void SlotVisitor::append(Iterator begin, Iterator end) +{ + for (auto it = begin; it != end; ++it) + append(&*it); +} + ALWAYS_INLINE void SlotVisitor::appendValues(WriteBarrierBase* barriers, size_t count) { append(barriers->slot(), count); @@ -212,22 +225,29 @@ inline void SlotVisitor::donateAndDrain() inline void SlotVisitor::copyLater(JSCell* owner, CopyToken token, void* ptr, size_t bytes) { ASSERT(bytes); - m_bytesCopied += bytes; - CopiedBlock* block = CopiedSpace::blockFor(ptr); if (block->isOversize()) { m_shared.m_copiedSpace->pin(block); return; } - if (block->isPinned()) - return; - - block->reportLiveBytes(owner, token, bytes); + SpinLockHolder locker(&block->workListLock()); + if (heap()->operationInProgress() == FullCollection || block->shouldReportLiveBytes(locker, owner)) { + m_bytesCopied += bytes; + block->reportLiveBytes(locker, owner, token, bytes); + } } -inline void SlotVisitor::reportExtraMemoryUsage(size_t size) +inline void SlotVisitor::reportExtraMemoryUsage(JSCell* owner, size_t size) { +#if ENABLE(GGC) + // We don't want to double-count the extra memory that was reported in previous collections. + if (heap()->operationInProgress() == EdenCollection && MarkedBlock::blockFor(owner)->isRemembered(owner)) + return; +#else + UNUSED_PARAM(owner); +#endif + size_t* counter = &m_shared.m_vm->heap.m_extraMemoryUsage; #if ENABLE(COMPARE_AND_SWAP) @@ -241,6 +261,11 @@ inline void SlotVisitor::reportExtraMemoryUsage(size_t size) #endif } +inline Heap* SlotVisitor::heap() const +{ + return &sharedData().m_vm->heap; +} + } // namespace JSC #endif // SlotVisitorInlines_h diff --git a/JavaScriptCore/heap/TinyBloomFilter.h b/JavaScriptCore/heap/TinyBloomFilter.h index a75ce8ce..15a419de 100644 --- a/JavaScriptCore/heap/TinyBloomFilter.h +++ b/JavaScriptCore/heap/TinyBloomFilter.h @@ -35,6 +35,7 @@ class TinyBloomFilter { TinyBloomFilter(); void add(Bits); + void add(TinyBloomFilter&); bool ruleOut(Bits) const; // True for 0. void reset(); @@ -52,6 +53,11 @@ inline void TinyBloomFilter::add(Bits bits) m_bits |= bits; } +inline void TinyBloomFilter::add(TinyBloomFilter& other) +{ + m_bits |= other.m_bits; +} + inline bool TinyBloomFilter::ruleOut(Bits bits) const { if (!bits) diff --git a/JavaScriptCore/heap/VTableSpectrum.cpp b/JavaScriptCore/heap/VTableSpectrum.cpp deleted file mode 100644 index 0581ca47..00000000 --- a/JavaScriptCore/heap/VTableSpectrum.cpp +++ /dev/null @@ -1,89 +0,0 @@ -/* - * 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. ``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 "VTableSpectrum.h" - -#include "JSObject.h" -#include "Structure.h" -#include -#include -#include - -#if PLATFORM(MAC) -#include -#endif - -namespace JSC { - -VTableSpectrum::VTableSpectrum() -{ -} - -VTableSpectrum::~VTableSpectrum() -{ -} - -void VTableSpectrum::countVPtr(void* vTablePointer) -{ - add(vTablePointer); -} - -void VTableSpectrum::count(JSCell* cell) -{ - // FIXME: we need to change this class to count ClassInfos rather than vptrs - UNUSED_PARAM(cell); -} - -void VTableSpectrum::dump(FILE* output, const char* comment) -{ - fprintf(output, "%s:\n", comment); - - Vector list = buildList(); - - for (size_t index = list.size(); index-- > 0;) { - KeyAndCount item = list.at(index); -#if PLATFORM(MAC) - Dl_info info; - if (dladdr(item.key, &info)) { - const char* findResult = strrchr(info.dli_fname, '/'); - const char* strippedFileName; - - if (findResult) - strippedFileName = findResult + 1; - else - strippedFileName = info.dli_fname; - - fprintf(output, " %s:%s(%p): %lu\n", strippedFileName, info.dli_sname, item.key, item.count); - continue; - } -#endif - fprintf(output, " %p: %lu\n", item.key, item.count); - } - - fflush(output); -} - -} // namespace JSC diff --git a/JavaScriptCore/heap/WriteBarrierBuffer.cpp b/JavaScriptCore/heap/WriteBarrierBuffer.cpp new file mode 100644 index 00000000..5314b511 --- /dev/null +++ b/JavaScriptCore/heap/WriteBarrierBuffer.cpp @@ -0,0 +1,69 @@ +/* + * Copyright (C) 2013 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. + */ + +#include "config.h" +#include "WriteBarrierBuffer.h" + +#include "GCAssertions.h" +#include "Heap.h" +#include "JSCell.h" +#include "Structure.h" + +namespace JSC { + +WriteBarrierBuffer::WriteBarrierBuffer(unsigned capacity) + : m_currentIndex(0) + , m_capacity(capacity) + , m_buffer(static_cast(fastMalloc(sizeof(JSCell*) * capacity))) +{ +} + +WriteBarrierBuffer::~WriteBarrierBuffer() +{ + fastFree(m_buffer); + m_buffer = 0; +} + +void WriteBarrierBuffer::flush(Heap& heap) +{ + ASSERT(m_currentIndex <= m_capacity); + for (size_t i = 0; i < m_currentIndex; ++i) + heap.writeBarrier(m_buffer[i]); + m_currentIndex = 0; +} + +void WriteBarrierBuffer::reset() +{ + m_currentIndex = 0; +} + +void WriteBarrierBuffer::add(JSCell* cell) +{ + ASSERT_GC_OBJECT_LOOKS_VALID(cell); + ASSERT(m_currentIndex < m_capacity); + m_buffer[m_currentIndex++] = cell; +} + +} // namespace JSC diff --git a/JavaScriptCore/runtime/JSPromiseResolverConstructor.h b/JavaScriptCore/heap/WriteBarrierBuffer.h similarity index 63% rename from JavaScriptCore/runtime/JSPromiseResolverConstructor.h rename to JavaScriptCore/heap/WriteBarrierBuffer.h index c415ed8c..9126bdbe 100644 --- a/JavaScriptCore/runtime/JSPromiseResolverConstructor.h +++ b/JavaScriptCore/heap/WriteBarrierBuffer.h @@ -23,38 +23,49 @@ * THE POSSIBILITY OF SUCH DAMAGE. */ -#ifndef JSPromiseResolverConstructor_h -#define JSPromiseResolverConstructor_h +#ifndef WriteBarrierBuffer_h +#define WriteBarrierBuffer_h -#if ENABLE(PROMISES) - -#include "InternalFunction.h" +#include namespace JSC { -class JSPromiseResolverPrototype; +class Heap; +class JSCell; + +namespace FTL { class LowerDFGToLLVM; } -class JSPromiseResolverConstructor : public InternalFunction { +class WriteBarrierBuffer { + friend class FTL::LowerDFGToLLVM; public: - typedef InternalFunction Base; + WriteBarrierBuffer(unsigned capacity); + ~WriteBarrierBuffer(); - static JSPromiseResolverConstructor* create(VM&, Structure*, JSPromiseResolverPrototype*); - static Structure* createStructure(VM&, JSGlobalObject*, JSValue); + void add(JSCell*); + void flush(Heap&); + void reset(); - DECLARE_INFO; + static ptrdiff_t currentIndexOffset() + { + return OBJECT_OFFSETOF(WriteBarrierBuffer, m_currentIndex); + } -protected: - void finishCreation(VM&, JSPromiseResolverPrototype*); - static const unsigned StructureFlags = InternalFunction::StructureFlags; + static ptrdiff_t capacityOffset() + { + return OBJECT_OFFSETOF(WriteBarrierBuffer, m_capacity); + } + + static ptrdiff_t bufferOffset() + { + return OBJECT_OFFSETOF(WriteBarrierBuffer, m_buffer); + } private: - JSPromiseResolverConstructor(VM&, Structure*); - static ConstructType getConstructData(JSCell*, ConstructData&); - static CallType getCallData(JSCell*, CallData&); + unsigned m_currentIndex; + unsigned m_capacity; + JSCell** m_buffer; }; } // namespace JSC -#endif // ENABLE(PROMISES) - -#endif // JSPromiseResolverConstructor_h +#endif // WriteBarrierBuffer_h diff --git a/JavaScriptCore/inspector/InjectedScript.cpp b/JavaScriptCore/inspector/InjectedScript.cpp new file mode 100644 index 00000000..38fac562 --- /dev/null +++ b/JavaScriptCore/inspector/InjectedScript.cpp @@ -0,0 +1,243 @@ +/* + * Copyright (C) 2013 Apple Inc. All rights reserved. + * Copyright (C) 2012 Google 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: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * 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. + * * Neither the name of Google Inc. nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND 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 THE COPYRIGHT + * OWNER 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 "InjectedScript.h" + +#if ENABLE(INSPECTOR) + +#include "InspectorValues.h" +#include "ScriptFunctionCall.h" +#include "ScriptObject.h" +#include + +using Inspector::TypeBuilder::Array; + +namespace Inspector { + +InjectedScript::InjectedScript() + : InjectedScriptBase(ASCIILiteral("InjectedScript")) +{ +} + +InjectedScript::InjectedScript(Deprecated::ScriptObject injectedScriptObject, InspectorEnvironment* environment) + : InjectedScriptBase(ASCIILiteral("InjectedScript"), injectedScriptObject, environment) +{ +} + +InjectedScript::~InjectedScript() +{ +} + +void InjectedScript::evaluate(ErrorString* errorString, const String& expression, const String& objectGroup, bool includeCommandLineAPI, bool returnByValue, bool generatePreview, RefPtr* result, Inspector::TypeBuilder::OptOutput* wasThrown) +{ + Deprecated::ScriptFunctionCall function(injectedScriptObject(), ASCIILiteral("evaluate"), inspectorEnvironment()->functionCallHandler()); + function.appendArgument(expression); + function.appendArgument(objectGroup); + function.appendArgument(includeCommandLineAPI); + function.appendArgument(returnByValue); + function.appendArgument(generatePreview); + makeEvalCall(errorString, function, result, wasThrown); +} + +void InjectedScript::callFunctionOn(ErrorString* errorString, const String& objectId, const String& expression, const String& arguments, bool returnByValue, bool generatePreview, RefPtr* result, Inspector::TypeBuilder::OptOutput* wasThrown) +{ + Deprecated::ScriptFunctionCall function(injectedScriptObject(), ASCIILiteral("callFunctionOn"), inspectorEnvironment()->functionCallHandler()); + function.appendArgument(objectId); + function.appendArgument(expression); + function.appendArgument(arguments); + function.appendArgument(returnByValue); + function.appendArgument(generatePreview); + makeEvalCall(errorString, function, result, wasThrown); +} + +void InjectedScript::evaluateOnCallFrame(ErrorString* errorString, const Deprecated::ScriptValue& callFrames, const String& callFrameId, const String& expression, const String& objectGroup, bool includeCommandLineAPI, bool returnByValue, bool generatePreview, RefPtr* result, Inspector::TypeBuilder::OptOutput* wasThrown) +{ + Deprecated::ScriptFunctionCall function(injectedScriptObject(), ASCIILiteral("evaluateOnCallFrame"), inspectorEnvironment()->functionCallHandler()); + function.appendArgument(callFrames); + function.appendArgument(callFrameId); + function.appendArgument(expression); + function.appendArgument(objectGroup); + function.appendArgument(includeCommandLineAPI); + function.appendArgument(returnByValue); + function.appendArgument(generatePreview); + makeEvalCall(errorString, function, result, wasThrown); +} + +void InjectedScript::getFunctionDetails(ErrorString* errorString, const String& functionId, RefPtr* result) +{ + Deprecated::ScriptFunctionCall function(injectedScriptObject(), ASCIILiteral("getFunctionDetails"), inspectorEnvironment()->functionCallHandler()); + function.appendArgument(functionId); + + RefPtr resultValue; + makeCall(function, &resultValue); + if (!resultValue || resultValue->type() != InspectorValue::TypeObject) { + if (!resultValue->asString(errorString)) + *errorString = ASCIILiteral("Internal error"); + return; + } + + *result = Inspector::TypeBuilder::Debugger::FunctionDetails::runtimeCast(resultValue); +} + +void InjectedScript::getProperties(ErrorString* errorString, const String& objectId, bool ownProperties, RefPtr>* properties) +{ + Deprecated::ScriptFunctionCall function(injectedScriptObject(), ASCIILiteral("getProperties"), inspectorEnvironment()->functionCallHandler()); + function.appendArgument(objectId); + function.appendArgument(ownProperties); + + RefPtr result; + makeCall(function, &result); + if (!result || result->type() != InspectorValue::TypeArray) { + *errorString = ASCIILiteral("Internal error"); + return; + } + + *properties = Array::runtimeCast(result); +} + +void InjectedScript::getInternalProperties(ErrorString* errorString, const String& objectId, RefPtr>* properties) +{ + Deprecated::ScriptFunctionCall function(injectedScriptObject(), ASCIILiteral("getInternalProperties"), inspectorEnvironment()->functionCallHandler()); + function.appendArgument(objectId); + + RefPtr result; + makeCall(function, &result); + if (!result || result->type() != InspectorValue::TypeArray) { + *errorString = ASCIILiteral("Internal error"); + return; + } + + RefPtr> array = Array::runtimeCast(result); + if (array->length() > 0) + *properties = array; +} + +#if ENABLE(JAVASCRIPT_DEBUGGER) +PassRefPtr> InjectedScript::wrapCallFrames(const Deprecated::ScriptValue& callFrames) +{ + ASSERT(!hasNoValue()); + Deprecated::ScriptFunctionCall function(injectedScriptObject(), ASCIILiteral("wrapCallFrames"), inspectorEnvironment()->functionCallHandler()); + function.appendArgument(callFrames); + + bool hadException = false; + Deprecated::ScriptValue callFramesValue = callFunctionWithEvalEnabled(function, hadException); + ASSERT(!hadException); + RefPtr result = callFramesValue.toInspectorValue(scriptState()); + if (result->type() == InspectorValue::TypeArray) + return Array::runtimeCast(result); + + return Array::create(); +} +#endif + +PassRefPtr InjectedScript::wrapObject(const Deprecated::ScriptValue& value, const String& groupName, bool generatePreview) const +{ + ASSERT(!hasNoValue()); + Deprecated::ScriptFunctionCall wrapFunction(injectedScriptObject(), ASCIILiteral("wrapObject"), inspectorEnvironment()->functionCallHandler()); + wrapFunction.appendArgument(value); + wrapFunction.appendArgument(groupName); + wrapFunction.appendArgument(hasAccessToInspectedScriptState()); + wrapFunction.appendArgument(generatePreview); + + bool hadException = false; + Deprecated::ScriptValue r = callFunctionWithEvalEnabled(wrapFunction, hadException); + if (hadException) + return nullptr; + + RefPtr rawResult = r.toInspectorValue(scriptState())->asObject(); + return Inspector::TypeBuilder::Runtime::RemoteObject::runtimeCast(rawResult); +} + +PassRefPtr InjectedScript::wrapTable(const Deprecated::ScriptValue& table, const Deprecated::ScriptValue& columns) const +{ + ASSERT(!hasNoValue()); + Deprecated::ScriptFunctionCall wrapFunction(injectedScriptObject(), ASCIILiteral("wrapTable"), inspectorEnvironment()->functionCallHandler()); + wrapFunction.appendArgument(hasAccessToInspectedScriptState()); + wrapFunction.appendArgument(table); + if (columns.hasNoValue()) + wrapFunction.appendArgument(false); + else + wrapFunction.appendArgument(columns); + + bool hadException = false; + Deprecated::ScriptValue r = callFunctionWithEvalEnabled(wrapFunction, hadException); + if (hadException) + return nullptr; + + RefPtr rawResult = r.toInspectorValue(scriptState())->asObject(); + return Inspector::TypeBuilder::Runtime::RemoteObject::runtimeCast(rawResult); +} + +Deprecated::ScriptValue InjectedScript::findObjectById(const String& objectId) const +{ + ASSERT(!hasNoValue()); + Deprecated::ScriptFunctionCall function(injectedScriptObject(), ASCIILiteral("findObjectById"), inspectorEnvironment()->functionCallHandler()); + function.appendArgument(objectId); + + bool hadException = false; + Deprecated::ScriptValue resultValue = callFunctionWithEvalEnabled(function, hadException); + ASSERT(!hadException); + + return resultValue; +} + +void InjectedScript::inspectObject(Deprecated::ScriptValue value) +{ + ASSERT(!hasNoValue()); + Deprecated::ScriptFunctionCall function(injectedScriptObject(), ASCIILiteral("inspectObject"), inspectorEnvironment()->functionCallHandler()); + function.appendArgument(value); + RefPtr result; + makeCall(function, &result); +} + +void InjectedScript::releaseObject(const String& objectId) +{ + Deprecated::ScriptFunctionCall function(injectedScriptObject(), ASCIILiteral("releaseObject"), inspectorEnvironment()->functionCallHandler()); + function.appendArgument(objectId); + RefPtr result; + makeCall(function, &result); +} + +void InjectedScript::releaseObjectGroup(const String& objectGroup) +{ + ASSERT(!hasNoValue()); + Deprecated::ScriptFunctionCall releaseFunction(injectedScriptObject(), ASCIILiteral("releaseObjectGroup"), inspectorEnvironment()->functionCallHandler()); + releaseFunction.appendArgument(objectGroup); + + bool hadException = false; + callFunctionWithEvalEnabled(releaseFunction, hadException); + ASSERT(!hadException); +} + +} // namespace Inspector + +#endif // ENABLE(INSPECTOR) diff --git a/JavaScriptCore/inspector/InjectedScript.h b/JavaScriptCore/inspector/InjectedScript.h new file mode 100644 index 00000000..ae671265 --- /dev/null +++ b/JavaScriptCore/inspector/InjectedScript.h @@ -0,0 +1,85 @@ +/* + * Copyright (C) 2013 Apple Inc. All rights reserved. + * Copyright (C) 2012 Google 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: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * 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. + * * Neither the name of Google Inc. nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND 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 THE COPYRIGHT + * OWNER 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. + */ + +#ifndef InjectedScript_h +#define InjectedScript_h + +#if ENABLE(INSPECTOR) + +#include "InjectedScriptBase.h" +#include "InspectorJSTypeBuilders.h" +#include +#include +#include +#include + +namespace Deprecated { +class ScriptObject; +} + +namespace Inspector { + +class InjectedScriptModule; +class InspectorEnvironment; + +class JS_EXPORT_PRIVATE InjectedScript : public InjectedScriptBase { +public: + InjectedScript(); + InjectedScript(Deprecated::ScriptObject, InspectorEnvironment*); + virtual ~InjectedScript(); + + void evaluate(ErrorString*, const String& expression, const String& objectGroup, bool includeCommandLineAPI, bool returnByValue, bool generatePreview, RefPtr* result, TypeBuilder::OptOutput* wasThrown); + void callFunctionOn(ErrorString*, const String& objectId, const String& expression, const String& arguments, bool returnByValue, bool generatePreview, RefPtr* result, TypeBuilder::OptOutput* wasThrown); + void evaluateOnCallFrame(ErrorString*, const Deprecated::ScriptValue& callFrames, const String& callFrameId, const String& expression, const String& objectGroup, bool includeCommandLineAPI, bool returnByValue, bool generatePreview, RefPtr* result, TypeBuilder::OptOutput* wasThrown); + void getFunctionDetails(ErrorString*, const String& functionId, RefPtr* result); + void getProperties(ErrorString*, const String& objectId, bool ownProperties, RefPtr>* result); + void getInternalProperties(ErrorString*, const String& objectId, RefPtr>* result); + +#if ENABLE(JAVASCRIPT_DEBUGGER) + PassRefPtr> wrapCallFrames(const Deprecated::ScriptValue&); +#endif + PassRefPtr wrapObject(const Deprecated::ScriptValue&, const String& groupName, bool generatePreview = false) const; + PassRefPtr wrapTable(const Deprecated::ScriptValue& table, const Deprecated::ScriptValue& columns) const; + + Deprecated::ScriptValue findObjectById(const String& objectId) const; + void inspectObject(Deprecated::ScriptValue); + void releaseObject(const String& objectId); + void releaseObjectGroup(const String& objectGroup); + +private: + friend class InjectedScriptModule; +}; + +} // namespace Inspector + +#endif // ENABLE(INSPECTOR) + +#endif // InjectedScript_h diff --git a/JavaScriptCore/inspector/InjectedScriptBase.cpp b/JavaScriptCore/inspector/InjectedScriptBase.cpp new file mode 100644 index 00000000..c2a49472 --- /dev/null +++ b/JavaScriptCore/inspector/InjectedScriptBase.cpp @@ -0,0 +1,155 @@ +/* + * Copyright (C) 2013 Apple Inc. All rights reserved. + * Copyright (C) 2012 Google 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: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * 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. + * * Neither the name of Google Inc. nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND 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 THE COPYRIGHT + * OWNER 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 "InjectedScriptBase.h" + +#if ENABLE(INSPECTOR) + +#include "InspectorValues.h" +#include "JSGlobalObject.h" +#include "ScriptFunctionCall.h" +#include + +namespace Inspector { + +InjectedScriptBase::InjectedScriptBase(const String& name) + : m_name(name) + , m_environment(nullptr) +{ +} + +InjectedScriptBase::InjectedScriptBase(const String& name, Deprecated::ScriptObject injectedScriptObject, InspectorEnvironment* environment) + : m_name(name) + , m_injectedScriptObject(injectedScriptObject) + , m_environment(environment) +{ +} + +InjectedScriptBase::~InjectedScriptBase() +{ +} + +void InjectedScriptBase::initialize(Deprecated::ScriptObject injectedScriptObject, InspectorEnvironment* environment) +{ + m_injectedScriptObject = injectedScriptObject; + m_environment = environment; +} + +bool InjectedScriptBase::hasAccessToInspectedScriptState() const +{ + return m_environment && m_environment->canAccessInspectedScriptState(m_injectedScriptObject.scriptState()); +} + +const Deprecated::ScriptObject& InjectedScriptBase::injectedScriptObject() const +{ + return m_injectedScriptObject; +} + +Deprecated::ScriptValue InjectedScriptBase::callFunctionWithEvalEnabled(Deprecated::ScriptFunctionCall& function, bool& hadException) const +{ + if (m_environment) + m_environment->willCallInjectedScriptFunction(m_injectedScriptObject.scriptState(), name(), 1); + + JSC::ExecState* scriptState = m_injectedScriptObject.scriptState(); + bool evalIsDisabled = false; + if (scriptState) { + evalIsDisabled = !scriptState->lexicalGlobalObject()->evalEnabled(); + // Temporarily enable allow evals for inspector. + if (evalIsDisabled) + scriptState->lexicalGlobalObject()->setEvalEnabled(true); + } + + Deprecated::ScriptValue resultValue = function.call(hadException); + + if (evalIsDisabled) + scriptState->lexicalGlobalObject()->setEvalEnabled(false); + + if (m_environment) + m_environment->didCallInjectedScriptFunction(); + + return resultValue; +} + +void InjectedScriptBase::makeCall(Deprecated::ScriptFunctionCall& function, RefPtr* result) +{ + if (hasNoValue() || !hasAccessToInspectedScriptState()) { + *result = InspectorValue::null(); + return; + } + + bool hadException = false; + Deprecated::ScriptValue resultValue = callFunctionWithEvalEnabled(function, hadException); + + ASSERT(!hadException); + if (!hadException) { + *result = resultValue.toInspectorValue(m_injectedScriptObject.scriptState()); + if (!*result) + *result = InspectorString::create(String::format("Object has too long reference chain (must not be longer than %d)", InspectorValue::maxDepth)); + } else + *result = InspectorString::create("Exception while making a call."); +} + +void InjectedScriptBase::makeEvalCall(ErrorString* errorString, Deprecated::ScriptFunctionCall& function, RefPtr* objectResult, TypeBuilder::OptOutput* wasThrown) +{ + RefPtr result; + makeCall(function, &result); + if (!result) { + *errorString = ASCIILiteral("Internal error: result value is empty"); + return; + } + + if (result->type() == InspectorValue::TypeString) { + result->asString(errorString); + ASSERT(errorString->length()); + return; + } + + RefPtr resultPair = result->asObject(); + if (!resultPair) { + *errorString = ASCIILiteral("Internal error: result is not an Object"); + return; + } + + RefPtr resultObj = resultPair->getObject(ASCIILiteral("result")); + bool wasThrownVal = false; + if (!resultObj || !resultPair->getBoolean(ASCIILiteral("wasThrown"), &wasThrownVal)) { + *errorString = ASCIILiteral("Internal error: result is not a pair of value and wasThrown flag"); + return; + } + + *objectResult = TypeBuilder::Runtime::RemoteObject::runtimeCast(resultObj); + *wasThrown = wasThrownVal; +} + +} // namespace Inspector + +#endif // ENABLE(INSPECTOR) diff --git a/JavaScriptCore/inspector/InjectedScriptBase.h b/JavaScriptCore/inspector/InjectedScriptBase.h new file mode 100644 index 00000000..034e0c20 --- /dev/null +++ b/JavaScriptCore/inspector/InjectedScriptBase.h @@ -0,0 +1,83 @@ +/* + * Copyright (C) 2013 Apple Inc. All rights reserved. + * Copyright (C) 2012 Google 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: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * 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. + * * Neither the name of Google Inc. nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND 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 THE COPYRIGHT + * OWNER 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. + */ + +#ifndef InjectedScriptBase_h +#define InjectedScriptBase_h + +#if ENABLE(INSPECTOR) + +#include "InspectorEnvironment.h" +#include "InspectorJSTypeBuilders.h" +#include "bindings/ScriptObject.h" +#include +#include + +namespace Deprecated { +class ScriptFunctionCall; +} + +namespace Inspector { + +typedef String ErrorString; + +class JS_EXPORT_PRIVATE InjectedScriptBase { +public: + virtual ~InjectedScriptBase(); + + const String& name() const { return m_name; } + bool hasNoValue() const { return m_injectedScriptObject.hasNoValue(); } + JSC::ExecState* scriptState() const { return m_injectedScriptObject.scriptState(); } + +protected: + InjectedScriptBase(const String& name); + InjectedScriptBase(const String& name, Deprecated::ScriptObject, InspectorEnvironment*); + + InspectorEnvironment* inspectorEnvironment() const { return m_environment; } + + void initialize(Deprecated::ScriptObject, InspectorEnvironment*); + bool hasAccessToInspectedScriptState() const; + + const Deprecated::ScriptObject& injectedScriptObject() const; + Deprecated::ScriptValue callFunctionWithEvalEnabled(Deprecated::ScriptFunctionCall&, bool& hadException) const; + void makeCall(Deprecated::ScriptFunctionCall&, RefPtr* result); + void makeEvalCall(ErrorString*, Deprecated::ScriptFunctionCall&, RefPtr* result, TypeBuilder::OptOutput* wasThrown); + +private: + String m_name; + Deprecated::ScriptObject m_injectedScriptObject; + InspectorEnvironment* m_environment; +}; + +} // namespace Inspector + +#endif // ENABLE(INSPECTOR) + +#endif // InjectedScriptBase_h diff --git a/JavaScriptCore/inspector/InjectedScriptHost.cpp b/JavaScriptCore/inspector/InjectedScriptHost.cpp new file mode 100644 index 00000000..46b3c4e3 --- /dev/null +++ b/JavaScriptCore/inspector/InjectedScriptHost.cpp @@ -0,0 +1,83 @@ +/* + * Copyright (C) 2013 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 "InjectedScriptHost.h" + +#if ENABLE(INSPECTOR) + +#include "JSInjectedScriptHost.h" + +using namespace JSC; + +namespace Inspector { + +InjectedScriptHost::~InjectedScriptHost() +{ +} + +JSValue InjectedScriptHost::jsWrapper(ExecState* exec, JSGlobalObject* globalObject) +{ + auto key = std::make_pair(exec, globalObject); + auto it = m_wrappers.find(key); + if (it != m_wrappers.end()) + return it->value.get(); + + JSValue jsValue = toJS(exec, globalObject, this); + if (!jsValue.isObject()) + return jsValue; + + JSObject* jsObject = jsValue.toObject(exec, globalObject); + Strong wrapper(exec->vm(), jsObject); + m_wrappers.add(key, wrapper); + + return jsValue; +} + +static void clearWrapperFromValue(JSValue value) +{ + JSInjectedScriptHost* jsInjectedScriptHost = toJSInjectedScriptHost(value); + ASSERT(jsInjectedScriptHost); + if (jsInjectedScriptHost) + jsInjectedScriptHost->releaseImpl(); +} + +void InjectedScriptHost::clearWrapper(ExecState* exec, JSGlobalObject* globalObject) +{ + auto key = std::make_pair(exec, globalObject); + clearWrapperFromValue(m_wrappers.take(key).get()); +} + +void InjectedScriptHost::clearAllWrappers() +{ + for (auto wrapper : m_wrappers) + clearWrapperFromValue(wrapper.value.get()); + + m_wrappers.clear(); +} + +} // namespace Inspector + +#endif // ENABLE(INSPECTOR) diff --git a/JavaScriptCore/inspector/InjectedScriptHost.h b/JavaScriptCore/inspector/InjectedScriptHost.h new file mode 100644 index 00000000..db93f863 --- /dev/null +++ b/JavaScriptCore/inspector/InjectedScriptHost.h @@ -0,0 +1,59 @@ +/* + * Copyright (C) 2013 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. + */ + +#ifndef InjectedScriptHost_h +#define InjectedScriptHost_h + +#if ENABLE(INSPECTOR) + +#include "JSCJSValueInlines.h" +#include "Strong.h" +#include "StrongInlines.h" +#include +#include + +namespace Inspector { + +class JS_EXPORT_PRIVATE InjectedScriptHost : public RefCounted { +public: + static PassRefPtr create() { return adoptRef(new InjectedScriptHost); } + virtual ~InjectedScriptHost(); + + virtual JSC::JSValue type(JSC::ExecState*, JSC::JSValue) { return JSC::jsUndefined(); } + virtual bool isHTMLAllCollection(JSC::JSValue) { return false; } + + JSC::JSValue jsWrapper(JSC::ExecState*, JSC::JSGlobalObject*); + void clearWrapper(JSC::ExecState*, JSC::JSGlobalObject*); + void clearAllWrappers(); + +private: + HashMap, JSC::Strong> m_wrappers; +}; + +} // namespace Inspector + +#endif // ENABLE(INSPECTOR) + +#endif // !defined(InjectedScriptHost_h) diff --git a/JavaScriptCore/inspector/InjectedScriptManager.cpp b/JavaScriptCore/inspector/InjectedScriptManager.cpp new file mode 100644 index 00000000..72d20df3 --- /dev/null +++ b/JavaScriptCore/inspector/InjectedScriptManager.cpp @@ -0,0 +1,185 @@ +/* + * Copyright (C) 2007, 2008, 2013 Apple Inc. All rights reserved. + * Copyright (C) 2008 Matt Lilek + * Copyright (C) 2012 Google 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. + * 3. Neither the name of Apple Computer, Inc. ("Apple") nor the names of + * its contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY APPLE 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 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. + */ + +#include "config.h" +#include "InjectedScriptManager.h" + +#if ENABLE(INSPECTOR) + +#include "Completion.h" +#include "InjectedScriptHost.h" +#include "InjectedScriptSource.h" +#include "InspectorValues.h" +#include "JSInjectedScriptHost.h" +#include "JSLock.h" +#include "ScriptObject.h" +#include "SourceCode.h" + +using namespace JSC; + +namespace Inspector { + +InjectedScriptManager::InjectedScriptManager(InspectorEnvironment& environment, PassRefPtr injectedScriptHost) + : m_environment(environment) + , m_injectedScriptHost(injectedScriptHost) + , m_nextInjectedScriptId(1) +{ +} + +InjectedScriptManager::~InjectedScriptManager() +{ +} + +void InjectedScriptManager::disconnect() +{ + discardInjectedScripts(); + m_injectedScriptHost = nullptr; +} + +InjectedScriptHost* InjectedScriptManager::injectedScriptHost() +{ + return m_injectedScriptHost.get(); +} + +InjectedScript InjectedScriptManager::injectedScriptForId(int id) +{ + auto it = m_idToInjectedScript.find(id); + if (it != m_idToInjectedScript.end()) + return it->value; + + for (auto it = m_scriptStateToId.begin(); it != m_scriptStateToId.end(); ++it) { + if (it->value == id) + return injectedScriptFor(it->key); + } + + return InjectedScript(); +} + +int InjectedScriptManager::injectedScriptIdFor(ExecState* scriptState) +{ + auto it = m_scriptStateToId.find(scriptState); + if (it != m_scriptStateToId.end()) + return it->value; + + int id = m_nextInjectedScriptId++; + m_scriptStateToId.set(scriptState, id); + return id; +} + +InjectedScript InjectedScriptManager::injectedScriptForObjectId(const String& objectId) +{ + RefPtr parsedObjectId = InspectorValue::parseJSON(objectId); + if (parsedObjectId && parsedObjectId->type() == InspectorValue::TypeObject) { + long injectedScriptId = 0; + bool success = parsedObjectId->asObject()->getNumber(ASCIILiteral("injectedScriptId"), &injectedScriptId); + if (success) + return m_idToInjectedScript.get(injectedScriptId); + } + + return InjectedScript(); +} + +void InjectedScriptManager::discardInjectedScripts() +{ + m_injectedScriptHost->clearAllWrappers(); + m_idToInjectedScript.clear(); + m_scriptStateToId.clear(); +} + +void InjectedScriptManager::releaseObjectGroup(const String& objectGroup) +{ + for (auto it = m_idToInjectedScript.begin(); it != m_idToInjectedScript.end(); ++it) + it->value.releaseObjectGroup(objectGroup); +} + +String InjectedScriptManager::injectedScriptSource() +{ + return String(reinterpret_cast(InjectedScriptSource_js), sizeof(InjectedScriptSource_js)); +} + +Deprecated::ScriptObject InjectedScriptManager::createInjectedScript(const String& source, ExecState* scriptState, int id) +{ + JSLockHolder lock(scriptState); + + SourceCode sourceCode = makeSource(source); + JSGlobalObject* globalObject = scriptState->lexicalGlobalObject(); + JSValue globalThisValue = scriptState->globalThisValue(); + + JSValue evaluationException; + InspectorEvaluateHandler evaluateHandler = m_environment.evaluateHandler(); + JSValue functionValue = evaluateHandler(scriptState, sourceCode, globalThisValue, &evaluationException); + if (evaluationException) + return Deprecated::ScriptObject(); + + CallData callData; + CallType callType = getCallData(functionValue, callData); + if (callType == CallTypeNone) + return Deprecated::ScriptObject(); + + MarkedArgumentBuffer args; + args.append(m_injectedScriptHost->jsWrapper(scriptState, globalObject)); + args.append(globalThisValue); + args.append(jsNumber(id)); + + JSValue result = JSC::call(scriptState, functionValue, callType, callData, globalThisValue, args); + if (result.isObject()) + return Deprecated::ScriptObject(scriptState, result.getObject()); + + return Deprecated::ScriptObject(); +} + +InjectedScript InjectedScriptManager::injectedScriptFor(ExecState* inspectedExecState) +{ + auto it = m_scriptStateToId.find(inspectedExecState); + if (it != m_scriptStateToId.end()) { + auto it1 = m_idToInjectedScript.find(it->value); + if (it1 != m_idToInjectedScript.end()) + return it1->value; + } + + if (!m_environment.canAccessInspectedScriptState(inspectedExecState)) + return InjectedScript(); + + int id = injectedScriptIdFor(inspectedExecState); + Deprecated::ScriptObject injectedScriptObject = createInjectedScript(injectedScriptSource(), inspectedExecState, id); + InjectedScript result(injectedScriptObject, &m_environment); + m_idToInjectedScript.set(id, result); + didCreateInjectedScript(result); + return result; +} + +void InjectedScriptManager::didCreateInjectedScript(InjectedScript) +{ + // Intentionally empty. This allows for subclasses to inject additional scripts. +} + +} // namespace Inspector + +#endif // ENABLE(INSPECTOR) diff --git a/JavaScriptCore/inspector/InjectedScriptManager.h b/JavaScriptCore/inspector/InjectedScriptManager.h new file mode 100644 index 00000000..bcc64e2a --- /dev/null +++ b/JavaScriptCore/inspector/InjectedScriptManager.h @@ -0,0 +1,85 @@ +/* + * Copyright (C) 2007, 2013 Apple Inc. All rights reserved. + * Copyright (C) 2012 Google 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. + * 3. Neither the name of Apple Computer, Inc. ("Apple") nor the names of + * its contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY APPLE 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 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. + */ + +#ifndef InjectedScriptManager_h +#define InjectedScriptManager_h + +#include "InjectedScript.h" +#include "InjectedScriptHost.h" +#include "InspectorEnvironment.h" +#include +#include +#include + +namespace Deprecated { +class ScriptObject; +} + +namespace JSC { +class ExecState; +} + +namespace Inspector { + +class JS_EXPORT_PRIVATE InjectedScriptManager { + WTF_MAKE_NONCOPYABLE(InjectedScriptManager); WTF_MAKE_FAST_ALLOCATED; +public: + InjectedScriptManager(InspectorEnvironment&, PassRefPtr); + virtual ~InjectedScriptManager(); + + virtual void disconnect(); + + InjectedScriptHost* injectedScriptHost(); + InspectorEnvironment& inspectorEnvironment() const { return m_environment; } + + InjectedScript injectedScriptFor(JSC::ExecState*); + InjectedScript injectedScriptForId(int); + int injectedScriptIdFor(JSC::ExecState*); + InjectedScript injectedScriptForObjectId(const String& objectId); + void discardInjectedScripts(); + void releaseObjectGroup(const String& objectGroup); + +protected: + virtual void didCreateInjectedScript(InjectedScript); + + HashMap m_idToInjectedScript; + HashMap m_scriptStateToId; + +private: + String injectedScriptSource(); + Deprecated::ScriptObject createInjectedScript(const String& source, JSC::ExecState*, int id); + + InspectorEnvironment& m_environment; + RefPtr m_injectedScriptHost; + int m_nextInjectedScriptId; +}; + +} // namespace Inspector + +#endif // !defined(InjectedScriptManager_h) diff --git a/JavaScriptCore/inspector/InjectedScriptModule.cpp b/JavaScriptCore/inspector/InjectedScriptModule.cpp new file mode 100644 index 00000000..f2b29d25 --- /dev/null +++ b/JavaScriptCore/inspector/InjectedScriptModule.cpp @@ -0,0 +1,91 @@ +/* + * Copyright (C) 2013 Apple Inc. All rights reserved. + * Copyright (C) 2012 Google 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: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * 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. + * * Neither the name of Google Inc. nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND 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 THE COPYRIGHT + * OWNER 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 "InjectedScriptModule.h" + +#if ENABLE(INSPECTOR) + +#include "InjectedScript.h" +#include "InjectedScriptManager.h" +#include "ScriptFunctionCall.h" +#include "ScriptObject.h" + +namespace Inspector { + +InjectedScriptModule::InjectedScriptModule(const String& name) + : InjectedScriptBase(name) +{ +} + +InjectedScriptModule::~InjectedScriptModule() +{ +} + +void InjectedScriptModule::ensureInjected(InjectedScriptManager* injectedScriptManager, JSC::ExecState* scriptState) +{ + InjectedScript injectedScript = injectedScriptManager->injectedScriptFor(scriptState); + ensureInjected(injectedScriptManager, injectedScript); +} + +void InjectedScriptModule::ensureInjected(InjectedScriptManager* injectedScriptManager, InjectedScript injectedScript) +{ + ASSERT(!injectedScript.hasNoValue()); + if (injectedScript.hasNoValue()) + return; + + // FIXME: Make the InjectedScript a module itself. + Deprecated::ScriptFunctionCall function(injectedScript.injectedScriptObject(), ASCIILiteral("module"), injectedScriptManager->inspectorEnvironment().functionCallHandler()); + function.appendArgument(name()); + bool hadException = false; + Deprecated::ScriptValue resultValue = injectedScript.callFunctionWithEvalEnabled(function, hadException); + ASSERT(!hadException); + if (hadException || resultValue.hasNoValue() || !resultValue.isObject()) { + Deprecated::ScriptFunctionCall function(injectedScript.injectedScriptObject(), ASCIILiteral("injectModule"), injectedScriptManager->inspectorEnvironment().functionCallHandler()); + function.appendArgument(name()); + function.appendArgument(source()); + function.appendArgument(host(injectedScriptManager, injectedScript.scriptState())); + resultValue = injectedScript.callFunctionWithEvalEnabled(function, hadException); + if (hadException || (returnsObject() && (resultValue.hasNoValue() || !resultValue.isObject()))) { + ASSERT_NOT_REACHED(); + return; + } + } + + if (returnsObject()) { + Deprecated::ScriptObject moduleObject(injectedScript.scriptState(), resultValue); + initialize(moduleObject, &injectedScriptManager->inspectorEnvironment()); + } +} + +} // namespace Inspector + +#endif // ENABLE(INSPECTOR) diff --git a/JavaScriptCore/inspector/InjectedScriptModule.h b/JavaScriptCore/inspector/InjectedScriptModule.h new file mode 100644 index 00000000..a170e798 --- /dev/null +++ b/JavaScriptCore/inspector/InjectedScriptModule.h @@ -0,0 +1,69 @@ +/* + * Copyright (C) 2013 Apple Inc. All rights reserved. + * Copyright (C) 2012 Google 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: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * 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. + * * Neither the name of Google Inc. nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND 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 THE COPYRIGHT + * OWNER 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. + */ + +#ifndef InjectedScriptModule_h +#define InjectedScriptModule_h + +#include "InjectedScriptBase.h" +#include + +#if ENABLE(INSPECTOR) + +namespace JSC { +class JSValue; +} + +namespace Inspector { + +class InjectedScript; +class InjectedScriptManager; + +class JS_EXPORT_PRIVATE InjectedScriptModule : public InjectedScriptBase { +public: + virtual ~InjectedScriptModule(); + virtual String source() const = 0; + virtual JSC::JSValue host(InjectedScriptManager*, JSC::ExecState*) const = 0; + virtual bool returnsObject() const = 0; + +protected: + // Do not expose constructor in the child classes as well. Instead provide + // a static factory method that would create a new instance of the class + // and call its ensureInjected() method immediately. + InjectedScriptModule(const String& name); + void ensureInjected(InjectedScriptManager*, JSC::ExecState*); + void ensureInjected(InjectedScriptManager*, InjectedScript); +}; + +} // namespace Inspector + +#endif // ENABLE(INSPECTOR) + +#endif // InjectedScriptModule_h diff --git a/JavaScriptCore/inspector/InjectedScriptSource.js b/JavaScriptCore/inspector/InjectedScriptSource.js new file mode 100644 index 00000000..7bff7f6d --- /dev/null +++ b/JavaScriptCore/inspector/InjectedScriptSource.js @@ -0,0 +1,1033 @@ +/* + * Copyright (C) 2007 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. + * 3. Neither the name of Apple Computer, Inc. ("Apple") nor the names of + * its contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY APPLE 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 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. + */ + +//# sourceURL=__WebInspectorInjectedScript__ + +/** + * @param {InjectedScriptHost} InjectedScriptHost + * @param {GlobalObject} inspectedGlobalObject + * @param {number} injectedScriptId + */ +(function (InjectedScriptHost, inspectedGlobalObject, injectedScriptId) { + +// Protect against Object overwritten by the user code. +var Object = {}.constructor; + +/** + * @constructor + */ +var InjectedScript = function() +{ + this._lastBoundObjectId = 1; + this._idToWrappedObject = {}; + this._idToObjectGroupName = {}; + this._objectGroups = {}; + this._modules = {}; +} + +/** + * @type {Object.} + * @const + */ +InjectedScript.primitiveTypes = { + undefined: true, + boolean: true, + number: true, + string: true +} + +InjectedScript.prototype = { + /** + * @param {*} object + * @return {boolean} + */ + isPrimitiveValue: function(object) + { + // FIXME(33716): typeof document.all is always 'undefined'. + return InjectedScript.primitiveTypes[typeof object] && !this._isHTMLAllCollection(object); + }, + + /** + * @param {*} object + * @param {string} groupName + * @param {boolean} canAccessInspectedGlobalObject + * @param {boolean} generatePreview + * @return {!RuntimeAgent.RemoteObject} + */ + wrapObject: function(object, groupName, canAccessInspectedGlobalObject, generatePreview) + { + if (canAccessInspectedGlobalObject) + return this._wrapObject(object, groupName, false, generatePreview); + return this._fallbackWrapper(object); + }, + + /** + * @param {*} object + * @return {!RuntimeAgent.RemoteObject} + */ + _fallbackWrapper: function(object) + { + var result = {}; + result.type = typeof object; + if (this.isPrimitiveValue(object)) + result.value = object; + else + result.description = this._toString(object); + return /** @type {!RuntimeAgent.RemoteObject} */ (result); + }, + + /** + * @param {boolean} canAccessInspectedGlobalObject + * @param {Object} table + * @param {Array.|string|boolean} columns + * @return {!RuntimeAgent.RemoteObject} + */ + wrapTable: function(canAccessInspectedGlobalObject, table, columns) + { + if (!canAccessInspectedGlobalObject) + return this._fallbackWrapper(table); + var columnNames = null; + if (typeof columns === "string") + columns = [columns]; + if (InjectedScriptHost.type(columns) == "array") { + columnNames = []; + for (var i = 0; i < columns.length; ++i) + columnNames.push(String(columns[i])); + } + return this._wrapObject(table, "console", false, true, columnNames); + }, + + /** + * @param {*} object + */ + inspectObject: function(object) + { + if (this._commandLineAPIImpl) + this._commandLineAPIImpl.inspect(object); + }, + + /** + * This method cannot throw. + * @param {*} object + * @param {string=} objectGroupName + * @param {boolean=} forceValueType + * @param {boolean=} generatePreview + * @param {?Array.=} columnNames + * @return {!RuntimeAgent.RemoteObject} + * @suppress {checkTypes} + */ + _wrapObject: function(object, objectGroupName, forceValueType, generatePreview, columnNames) + { + try { + return new InjectedScript.RemoteObject(object, objectGroupName, forceValueType, generatePreview, columnNames); + } catch (e) { + try { + var description = injectedScript._describe(e); + } catch (ex) { + var description = ""; + } + return new InjectedScript.RemoteObject(description); + } + }, + + /** + * @param {*} object + * @param {string=} objectGroupName + * @return {string} + */ + _bind: function(object, objectGroupName) + { + var id = this._lastBoundObjectId++; + this._idToWrappedObject[id] = object; + var objectId = "{\"injectedScriptId\":" + injectedScriptId + ",\"id\":" + id + "}"; + if (objectGroupName) { + var group = this._objectGroups[objectGroupName]; + if (!group) { + group = []; + this._objectGroups[objectGroupName] = group; + } + group.push(id); + this._idToObjectGroupName[id] = objectGroupName; + } + return objectId; + }, + + /** + * @param {string} objectId + * @return {Object} + */ + _parseObjectId: function(objectId) + { + return InjectedScriptHost.evaluate("(" + objectId + ")"); + }, + + /** + * @param {string} objectGroupName + */ + releaseObjectGroup: function(objectGroupName) + { + var group = this._objectGroups[objectGroupName]; + if (!group) + return; + for (var i = 0; i < group.length; i++) + this._releaseObject(group[i]); + delete this._objectGroups[objectGroupName]; + }, + + /** + * @param {string} methodName + * @param {string} args + * @return {*} + */ + dispatch: function(methodName, args) + { + var argsArray = InjectedScriptHost.evaluate("(" + args + ")"); + var result = this[methodName].apply(this, argsArray); + if (typeof result === "undefined") { + // FIXME: JS Context inspection currently does not have a global.console object. + if (inspectedGlobalObject.console) + inspectedGlobalObject.console.error("Web Inspector error: InjectedScript.%s returns undefined", methodName); + result = null; + } + return result; + }, + + /** + * @param {string} objectId + * @param {boolean} ownProperties + * @return {Array.|boolean} + */ + getProperties: function(objectId, ownProperties) + { + var parsedObjectId = this._parseObjectId(objectId); + var object = this._objectForId(parsedObjectId); + var objectGroupName = this._idToObjectGroupName[parsedObjectId.id]; + + if (!this._isDefined(object)) + return false; + var descriptors = this._propertyDescriptors(object, ownProperties); + + // Go over properties, wrap object values. + for (var i = 0; i < descriptors.length; ++i) { + var descriptor = descriptors[i]; + if ("get" in descriptor) + descriptor.get = this._wrapObject(descriptor.get, objectGroupName); + if ("set" in descriptor) + descriptor.set = this._wrapObject(descriptor.set, objectGroupName); + if ("value" in descriptor) + descriptor.value = this._wrapObject(descriptor.value, objectGroupName); + if (!("configurable" in descriptor)) + descriptor.configurable = false; + if (!("enumerable" in descriptor)) + descriptor.enumerable = false; + } + return descriptors; + }, + + /** + * @param {string} objectId + * @return {Array.|boolean} + */ + getInternalProperties: function(objectId, ownProperties) + { + var parsedObjectId = this._parseObjectId(objectId); + var object = this._objectForId(parsedObjectId); + var objectGroupName = this._idToObjectGroupName[parsedObjectId.id]; + if (!this._isDefined(object)) + return false; + var descriptors = []; + var internalProperties = InjectedScriptHost.getInternalProperties(object); + if (internalProperties) { + for (var i = 0; i < internalProperties.length; i++) { + var property = internalProperties[i]; + var descriptor = { + name: property.name, + value: this._wrapObject(property.value, objectGroupName) + }; + descriptors.push(descriptor); + } + } + return descriptors; + }, + + /** + * @param {string} functionId + * @return {!DebuggerAgent.FunctionDetails|string} + */ + getFunctionDetails: function(functionId) + { + var parsedFunctionId = this._parseObjectId(functionId); + var func = this._objectForId(parsedFunctionId); + if (typeof func !== "function") + return "Cannot resolve function by id."; + var details = InjectedScriptHost.functionDetails(func); + if (!details) + return "Cannot resolve function details."; + if ("rawScopes" in details) { + var objectGroupName = this._idToObjectGroupName[parsedFunctionId.id]; + var rawScopes = details.rawScopes; + var scopes = []; + delete details.rawScopes; + for (var i = 0; i < rawScopes.length; i++) + scopes.push(InjectedScript.CallFrameProxy._createScopeJson(rawScopes[i].type, rawScopes[i].object, objectGroupName)); + details.scopeChain = scopes; + } + return details; + }, + + /** + * @param {string} objectId + */ + releaseObject: function(objectId) + { + var parsedObjectId = this._parseObjectId(objectId); + this._releaseObject(parsedObjectId.id); + }, + + /** + * @param {string} id + */ + _releaseObject: function(id) + { + delete this._idToWrappedObject[id]; + delete this._idToObjectGroupName[id]; + }, + + /** + * @param {Object} object + * @param {boolean} ownProperties + * @return {Array.} + */ + _propertyDescriptors: function(object, ownProperties) + { + var descriptors = []; + var nameProcessed = {}; + nameProcessed["__proto__"] = null; + for (var o = object; this._isDefined(o); o = o.__proto__) { + var names = Object.getOwnPropertyNames(/** @type {!Object} */ (o)); + for (var i = 0; i < names.length; ++i) { + var name = names[i]; + if (nameProcessed[name]) + continue; + + try { + nameProcessed[name] = true; + var descriptor = Object.getOwnPropertyDescriptor(/** @type {!Object} */ (object), name); + if (!descriptor) { + // Not all bindings provide proper descriptors. Fall back to the writable, configurable property. + try { + descriptor = { name: name, value: object[name], writable: false, configurable: false, enumerable: false}; + if (o === object) + descriptor.isOwn = true; + descriptors.push(descriptor); + } catch (e) { + // Silent catch. + } + continue; + } + } catch (e) { + var descriptor = {}; + descriptor.value = e; + descriptor.wasThrown = true; + } + + descriptor.name = name; + if (o === object) + descriptor.isOwn = true; + descriptors.push(descriptor); + } + if (ownProperties) { + if (object.__proto__) + descriptors.push({ name: "__proto__", value: object.__proto__, writable: true, configurable: true, enumerable: false, isOwn: true}); + break; + } + } + return descriptors; + }, + + /** + * @param {string} expression + * @param {string} objectGroup + * @param {boolean} injectCommandLineAPI + * @param {boolean} returnByValue + * @param {boolean} generatePreview + * @return {*} + */ + evaluate: function(expression, objectGroup, injectCommandLineAPI, returnByValue, generatePreview) + { + return this._evaluateAndWrap(InjectedScriptHost.evaluate, InjectedScriptHost, expression, objectGroup, false, injectCommandLineAPI, returnByValue, generatePreview); + }, + + /** + * @param {string} objectId + * @param {string} expression + * @param {boolean} returnByValue + * @return {Object|string} + */ + callFunctionOn: function(objectId, expression, args, returnByValue) + { + var parsedObjectId = this._parseObjectId(objectId); + var object = this._objectForId(parsedObjectId); + if (!this._isDefined(object)) + return "Could not find object with given id"; + + if (args) { + var resolvedArgs = []; + args = InjectedScriptHost.evaluate(args); + for (var i = 0; i < args.length; ++i) { + var resolvedCallArgument; + try { + resolvedCallArgument = this._resolveCallArgument(args[i]); + } catch (e) { + return String(e); + } + resolvedArgs.push(resolvedCallArgument) + } + } + + try { + var objectGroup = this._idToObjectGroupName[parsedObjectId.id]; + var func = InjectedScriptHost.evaluate("(" + expression + ")"); + if (typeof func !== "function") + return "Given expression does not evaluate to a function"; + + return { wasThrown: false, + result: this._wrapObject(func.apply(object, resolvedArgs), objectGroup, returnByValue) }; + } catch (e) { + return this._createThrownValue(e, objectGroup); + } + }, + + /** + * Resolves a value from CallArgument description. + * @param {RuntimeAgent.CallArgument} callArgumentJson + * @return {*} resolved value + * @throws {string} error message + */ + _resolveCallArgument: function(callArgumentJson) { + var objectId = callArgumentJson.objectId; + if (objectId) { + var parsedArgId = this._parseObjectId(objectId); + if (!parsedArgId || parsedArgId["injectedScriptId"] !== injectedScriptId) + throw "Arguments should belong to the same JavaScript world as the target object."; + + var resolvedArg = this._objectForId(parsedArgId); + if (!this._isDefined(resolvedArg)) + throw "Could not find object with given id"; + + return resolvedArg; + } else if ("value" in callArgumentJson) + return callArgumentJson.value; + else + return undefined; + }, + + /** + * @param {Function} evalFunction + * @param {Object} object + * @param {string} objectGroup + * @param {boolean} isEvalOnCallFrame + * @param {boolean} injectCommandLineAPI + * @param {boolean} returnByValue + * @param {boolean} generatePreview + * @return {*} + */ + _evaluateAndWrap: function(evalFunction, object, expression, objectGroup, isEvalOnCallFrame, injectCommandLineAPI, returnByValue, generatePreview) + { + try { + return { wasThrown: false, + result: this._wrapObject(this._evaluateOn(evalFunction, object, objectGroup, expression, isEvalOnCallFrame, injectCommandLineAPI), objectGroup, returnByValue, generatePreview) }; + } catch (e) { + return this._createThrownValue(e, objectGroup); + } + }, + + /** + * @param {*} value + * @param {string} objectGroup + * @return {Object} + */ + _createThrownValue: function(value, objectGroup) + { + var remoteObject = this._wrapObject(value, objectGroup); + try { + remoteObject.description = this._toString(value); + } catch (e) {} + return { wasThrown: true, + result: remoteObject }; + }, + + /** + * @param {Function} evalFunction + * @param {Object} object + * @param {string} objectGroup + * @param {string} expression + * @param {boolean} isEvalOnCallFrame + * @param {boolean} injectCommandLineAPI + * @return {*} + */ + _evaluateOn: function(evalFunction, object, objectGroup, expression, isEvalOnCallFrame, injectCommandLineAPI) + { + var commandLineAPI = null; + if (injectCommandLineAPI) { + if (this.CommandLineAPI) + commandLineAPI = new this.CommandLineAPI(this._commandLineAPIImpl, isEvalOnCallFrame ? object : null); + else + commandLineAPI = new BasicCommandLineAPI; + } + + if (isEvalOnCallFrame) { + // We can only use this approach if the evaluate function is the true 'eval'. That allows us to use it with + // the 'eval' identifier when calling it. Using 'eval' grants access to the local scope of the closure we + // create that provides the command line APIs. + + var parameters = [InjectedScriptHost.evaluate, expression]; + var expressionFunctionBody = "" + + "var global = Function('return this')() || (1, eval)('this');" + + "var __originalEval = global.eval; global.eval = __eval;" + + "try { return eval(__currentExpression); }" + + "finally { global.eval = __originalEval; }"; + + if (commandLineAPI) { + // To avoid using a 'with' statement (which fails in strict mode and requires injecting the API object) + // we instead create a closure where we evaluate the expression. The command line APIs are passed as + // parameters to the closure so they are in scope but not injected. This allows the code evaluated in + // the console to stay in strict mode (if is was already set), or to get strict mode by prefixing + // expressions with 'use strict';. + + var parameterNames = Object.getOwnPropertyNames(commandLineAPI); + for (var i = 0; i < parameterNames.length; ++i) + parameters.push(commandLineAPI[parameterNames[i]]); + + var expressionFunctionString = "(function(__eval, __currentExpression, " + parameterNames.join(", ") + ") { " + expressionFunctionBody + " })"; + } else { + // Use a closure in this case too to keep the same behavior of 'var' being captured by the closure instead + // of leaking out into the calling scope. + var expressionFunctionString = "(function(__eval, __currentExpression) { " + expressionFunctionBody + " })"; + } + + // Bind 'this' to the function expression using another closure instead of Function.prototype.bind. This ensures things will work if the page replaces bind. + var boundExpressionFunctionString = "(function(__function, __thisObject) { return function() { return __function.apply(__thisObject, arguments) }; })(" + expressionFunctionString + ", this)"; + var expressionFunction = evalFunction.call(object, boundExpressionFunctionString); + var result = expressionFunction.apply(null, parameters); + + if (objectGroup === "console") + this._lastResult = result; + + return result; + } + + // When not evaluating on a call frame we use a 'with' statement to allow var and function statements to leak + // into the global scope. This allow them to stick around between evaluations. + + // FIXME: JS Context inspection currently does not have a global.console object. + try { + if (commandLineAPI) { + if (inspectedGlobalObject.console) + inspectedGlobalObject.console.__commandLineAPI = commandLineAPI; + else + inspectedGlobalObject.__commandLineAPI = commandLineAPI; + expression = "with ((this && (this.console ? this.console.__commandLineAPI : this.__commandLineAPI)) || {}) { " + expression + "\n}"; + } + + var result = evalFunction.call(inspectedGlobalObject, expression); + + if (objectGroup === "console") + this._lastResult = result; + + return result; + } finally { + if (commandLineAPI) { + if (inspectedGlobalObject.console) + delete inspectedGlobalObject.console.__commandLineAPI; + else + delete inspectedGlobalObject.__commandLineAPI; + } + } + }, + + /** + * @param {Object} callFrame + * @return {Array.|boolean} + */ + wrapCallFrames: function(callFrame) + { + if (!callFrame) + return false; + + var result = []; + var depth = 0; + do { + result.push(new InjectedScript.CallFrameProxy(depth++, callFrame)); + callFrame = callFrame.caller; + } while (callFrame); + return result; + }, + + /** + * @param {Object} topCallFrame + * @param {string} callFrameId + * @param {string} expression + * @param {string} objectGroup + * @param {boolean} injectCommandLineAPI + * @param {boolean} returnByValue + * @param {boolean} generatePreview + * @return {*} + */ + evaluateOnCallFrame: function(topCallFrame, callFrameId, expression, objectGroup, injectCommandLineAPI, returnByValue, generatePreview) + { + var callFrame = this._callFrameForId(topCallFrame, callFrameId); + if (!callFrame) + return "Could not find call frame with given id"; + return this._evaluateAndWrap(callFrame.evaluate, callFrame, expression, objectGroup, true, injectCommandLineAPI, returnByValue, generatePreview); + }, + + /** + * @param {Object} topCallFrame + * @param {string} callFrameId + * @return {Object} + */ + _callFrameForId: function(topCallFrame, callFrameId) + { + var parsedCallFrameId = InjectedScriptHost.evaluate("(" + callFrameId + ")"); + var ordinal = parsedCallFrameId["ordinal"]; + var callFrame = topCallFrame; + while (--ordinal >= 0 && callFrame) + callFrame = callFrame.caller; + return callFrame; + }, + + /** + * @param {Object} objectId + * @return {Object} + */ + _objectForId: function(objectId) + { + return this._idToWrappedObject[objectId.id]; + }, + + /** + * @param {string} objectId + * @return {Object} + */ + findObjectById: function(objectId) + { + var parsedObjectId = this._parseObjectId(objectId); + return this._objectForId(parsedObjectId); + }, + + /** + * @param {string} name + * @return {Object} + */ + module: function(name) + { + return this._modules[name]; + }, + + /** + * @param {string} name + * @param {string} source + * @return {Object} + */ + injectModule: function(name, source, host) + { + delete this._modules[name]; + var moduleFunction = InjectedScriptHost.evaluate("(" + source + ")"); + if (typeof moduleFunction !== "function") { + // FIXME: JS Context inspection currently does not have a global.console object. + if (inspectedGlobalObject.console) + inspectedGlobalObject.console.error("Web Inspector error: A function was expected for module %s evaluation", name); + return null; + } + var module = moduleFunction.call(inspectedGlobalObject, InjectedScriptHost, inspectedGlobalObject, injectedScriptId, this, host); + this._modules[name] = module; + return module; + }, + + /** + * @param {*} object + * @return {boolean} + */ + _isDefined: function(object) + { + return !!object || this._isHTMLAllCollection(object); + }, + + /** + * @param {*} object + * @return {boolean} + */ + _isHTMLAllCollection: function(object) + { + // document.all is reported as undefined, but we still want to process it. + return (typeof object === "undefined") && InjectedScriptHost.isHTMLAllCollection(object); + }, + + /** + * @param {Object=} obj + * @return {string?} + */ + _subtype: function(obj) + { + if (obj === null) + return "null"; + + if (this.isPrimitiveValue(obj)) + return null; + + if (this._isHTMLAllCollection(obj)) + return "array"; + + var preciseType = InjectedScriptHost.type(obj); + if (preciseType) + return preciseType; + + // FireBug's array detection. + try { + if (typeof obj.splice === "function" && isFinite(obj.length)) + return "array"; + if (Object.prototype.toString.call(obj) === "[object Arguments]" && isFinite(obj.length)) // arguments. + return "array"; + } catch (e) { + } + + // If owning frame has navigated to somewhere else window properties will be undefined. + return null; + }, + + /** + * @param {*} obj + * @return {string?} + */ + _describe: function(obj) + { + if (this.isPrimitiveValue(obj)) + return null; + + obj = /** @type {Object} */ (obj); + + // Type is object, get subtype. + var subtype = this._subtype(obj); + + if (subtype === "regexp") + return this._toString(obj); + + if (subtype === "date") + return this._toString(obj); + + if (subtype === "node") { + var description = obj.nodeName.toLowerCase(); + switch (obj.nodeType) { + case 1 /* Node.ELEMENT_NODE */: + description += obj.id ? "#" + obj.id : ""; + var className = obj.className; + description += className ? "." + className : ""; + break; + case 10 /*Node.DOCUMENT_TYPE_NODE */: + description = ""; + break; + } + return description; + } + + var className = InjectedScriptHost.internalConstructorName(obj); + if (subtype === "array") { + if (typeof obj.length === "number") + className += "[" + obj.length + "]"; + return className; + } + + // NodeList in JSC is a function, check for array prior to this. + if (typeof obj === "function") + return this._toString(obj); + + if (className === "Object") { + // In Chromium DOM wrapper prototypes will have Object as their constructor name, + // get the real DOM wrapper name from the constructor property. + var constructorName = obj.constructor && obj.constructor.name; + if (constructorName) + return constructorName; + } + return className; + }, + + /** + * @param {*} obj + * @return {string} + */ + _toString: function(obj) + { + // We don't use String(obj) because inspectedGlobalObject.String is undefined if owning frame navigated to another page. + return "" + obj; + } +} + +/** + * @type {InjectedScript} + * @const + */ +var injectedScript = new InjectedScript(); + +/** + * @constructor + * @param {*} object + * @param {string=} objectGroupName + * @param {boolean=} forceValueType + * @param {boolean=} generatePreview + * @param {?Array.=} columnNames + */ +InjectedScript.RemoteObject = function(object, objectGroupName, forceValueType, generatePreview, columnNames) +{ + this.type = typeof object; + if (injectedScript.isPrimitiveValue(object) || object === null || forceValueType) { + // We don't send undefined values over JSON. + if (typeof object !== "undefined") + this.value = object; + + // Null object is object with 'null' subtype' + if (object === null) + this.subtype = "null"; + + // Provide user-friendly number values. + if (typeof object === "number") + this.description = object + ""; + return; + } + + object = /** @type {Object} */ (object); + + this.objectId = injectedScript._bind(object, objectGroupName); + var subtype = injectedScript._subtype(object); + if (subtype) + this.subtype = subtype; + this.className = InjectedScriptHost.internalConstructorName(object); + this.description = injectedScript._describe(object); + + if (generatePreview && (this.type === "object" || injectedScript._isHTMLAllCollection(object))) + this.preview = this._generatePreview(object, undefined, columnNames); +} + +InjectedScript.RemoteObject.prototype = { + /** + * @param {Object} object + * @param {Array.=} firstLevelKeys + * @param {?Array.=} secondLevelKeys + * @return {Object} preview + */ + _generatePreview: function(object, firstLevelKeys, secondLevelKeys) + { + var preview = {}; + preview.lossless = true; + preview.overflow = false; + preview.properties = []; + + var isTableRowsRequest = secondLevelKeys === null || secondLevelKeys; + var firstLevelKeysCount = firstLevelKeys ? firstLevelKeys.length : 0; + + var propertiesThreshold = { + properties: isTableRowsRequest ? 1000 : Math.max(5, firstLevelKeysCount), + indexes: isTableRowsRequest ? 1000 : Math.max(100, firstLevelKeysCount) + }; + for (var o = object; injectedScript._isDefined(o); o = o.__proto__) + this._generateProtoPreview(o, preview, propertiesThreshold, firstLevelKeys, secondLevelKeys); + return preview; + }, + + /** + * @param {Object} object + * @param {Object} preview + * @param {Object} propertiesThreshold + * @param {Array.=} firstLevelKeys + * @param {Array.=} secondLevelKeys + */ + _generateProtoPreview: function(object, preview, propertiesThreshold, firstLevelKeys, secondLevelKeys) + { + var propertyNames = firstLevelKeys ? firstLevelKeys : Object.keys(/** @type {!Object} */(object)); + try { + for (var i = 0; i < propertyNames.length; ++i) { + if (!propertiesThreshold.properties || !propertiesThreshold.indexes) { + preview.overflow = true; + preview.lossless = false; + break; + } + var name = propertyNames[i]; + if (this.subtype === "array" && name === "length") + continue; + + var descriptor = Object.getOwnPropertyDescriptor(/** @type {!Object} */(object), name); + if (!("value" in descriptor) || !descriptor.enumerable) { + preview.lossless = false; + continue; + } + + var value = descriptor.value; + if (value === null) { + this._appendPropertyPreview(preview, { name: name, type: "object", value: "null" }, propertiesThreshold); + continue; + } + + const maxLength = 100; + var type = typeof value; + + if (InjectedScript.primitiveTypes[type]) { + if (type === "string") { + if (value.length > maxLength) { + value = this._abbreviateString(value, maxLength, true); + preview.lossless = false; + } + value = value.replace(/\n/g, "\u21B5"); + } + this._appendPropertyPreview(preview, { name: name, type: type, value: value + "" }, propertiesThreshold); + continue; + } + + if (secondLevelKeys === null || secondLevelKeys) { + var subPreview = this._generatePreview(value, secondLevelKeys || undefined); + var property = { name: name, type: type, valuePreview: subPreview }; + this._appendPropertyPreview(preview, property, propertiesThreshold); + if (!subPreview.lossless) + preview.lossless = false; + if (subPreview.overflow) + preview.overflow = true; + continue; + } + + preview.lossless = false; + + var subtype = injectedScript._subtype(value); + var description = ""; + if (type !== "function") + description = this._abbreviateString(/** @type {string} */ (injectedScript._describe(value)), maxLength, subtype === "regexp"); + + var property = { name: name, type: type, value: description }; + if (subtype) + property.subtype = subtype; + this._appendPropertyPreview(preview, property, propertiesThreshold); + } + } catch (e) { + } + }, + + /** + * @param {Object} preview + * @param {Object} property + * @param {Object} propertiesThreshold + */ + _appendPropertyPreview: function(preview, property, propertiesThreshold) + { + if (isNaN(property.name)) + propertiesThreshold.properties--; + else + propertiesThreshold.indexes--; + preview.properties.push(property); + }, + + /** + * @param {string} string + * @param {number} maxLength + * @param {boolean=} middle + * @returns + */ + _abbreviateString: function(string, maxLength, middle) + { + if (string.length <= maxLength) + return string; + if (middle) { + var leftHalf = maxLength >> 1; + var rightHalf = maxLength - leftHalf - 1; + return string.substr(0, leftHalf) + "\u2026" + string.substr(string.length - rightHalf, rightHalf); + } + return string.substr(0, maxLength) + "\u2026"; + } +} +/** + * @constructor + * @param {number} ordinal + * @param {Object} callFrame + */ +InjectedScript.CallFrameProxy = function(ordinal, callFrame) +{ + this.callFrameId = "{\"ordinal\":" + ordinal + ",\"injectedScriptId\":" + injectedScriptId + "}"; + this.functionName = (callFrame.type === "function" ? callFrame.functionName : ""); + this.location = { scriptId: String(callFrame.sourceID), lineNumber: callFrame.line, columnNumber: callFrame.column }; + this.scopeChain = this._wrapScopeChain(callFrame); + this.this = injectedScript._wrapObject(callFrame.thisObject, "backtrace"); +} + +InjectedScript.CallFrameProxy.prototype = { + /** + * @param {Object} callFrame + * @return {!Array.} + */ + _wrapScopeChain: function(callFrame) + { + var scopeChain = callFrame.scopeChain; + var scopeChainProxy = []; + for (var i = 0; i < scopeChain.length; i++) { + var scope = InjectedScript.CallFrameProxy._createScopeJson(callFrame.scopeType(i), scopeChain[i], "backtrace"); + scopeChainProxy.push(scope); + } + return scopeChainProxy; + } +} + +/** + * @param {number} scopeTypeCode + * @param {*} scopeObject + * @param {string} groupId + * @return {!DebuggerAgent.Scope} + */ +InjectedScript.CallFrameProxy._createScopeJson = function(scopeTypeCode, scopeObject, groupId) { + const GLOBAL_SCOPE = 0; + const LOCAL_SCOPE = 1; + const WITH_SCOPE = 2; + const CLOSURE_SCOPE = 3; + const CATCH_SCOPE = 4; + + /** @type {!Object.} */ + var scopeTypeNames = {}; + scopeTypeNames[GLOBAL_SCOPE] = "global"; + scopeTypeNames[LOCAL_SCOPE] = "local"; + scopeTypeNames[WITH_SCOPE] = "with"; + scopeTypeNames[CLOSURE_SCOPE] = "closure"; + scopeTypeNames[CATCH_SCOPE] = "catch"; + + return { + object: injectedScript._wrapObject(scopeObject, groupId), + type: /** @type {DebuggerAgent.ScopeType} */ (scopeTypeNames[scopeTypeCode]) + }; +} + +function BasicCommandLineAPI() +{ + this.$_ = injectedScript._lastResult; +} + +return injectedScript; +}) diff --git a/JavaScriptCore/inspector/InspectorAgentBase.h b/JavaScriptCore/inspector/InspectorAgentBase.h new file mode 100644 index 00000000..20ad71fb --- /dev/null +++ b/JavaScriptCore/inspector/InspectorAgentBase.h @@ -0,0 +1,56 @@ +/* + * Copyright (C) 2013 Apple Inc. All Rights Reserved. + * Copyright (C) 2011 Google 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. + */ + +#ifndef InspectorAgentBase_h +#define InspectorAgentBase_h + +#include + +namespace Inspector { + +class InspectorBackendDispatcher; +class InspectorFrontendChannel; + +class InspectorAgentBase { +public: + virtual ~InspectorAgentBase() { } + + virtual void didCreateFrontendAndBackend(InspectorFrontendChannel*, InspectorBackendDispatcher*) = 0; + virtual void willDestroyFrontendAndBackend() = 0; + virtual void discardAgent() { } + +protected: + InspectorAgentBase(const String& name) + : m_name(name) + { + } + + String m_name; +}; + +} // namespace Inspector + +#endif // !defined(InspectorAgentBase_h) diff --git a/JavaScriptCore/inspector/InspectorAgentRegistry.cpp b/JavaScriptCore/inspector/InspectorAgentRegistry.cpp new file mode 100644 index 00000000..203c8f6e --- /dev/null +++ b/JavaScriptCore/inspector/InspectorAgentRegistry.cpp @@ -0,0 +1,65 @@ +/* + * Copyright (C) 2013 Apple Inc. All rights reserved. + * Copyright (C) 2011 Google 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 "InspectorAgentRegistry.h" + +#if ENABLE(INSPECTOR) + +#include "InspectorAgentBase.h" + +namespace Inspector { + +InspectorAgentRegistry::InspectorAgentRegistry() +{ +} + +void InspectorAgentRegistry::append(std::unique_ptr agent) +{ + m_agents.append(std::move(agent)); +} + +void InspectorAgentRegistry::didCreateFrontendAndBackend(InspectorFrontendChannel* frontendChannel, InspectorBackendDispatcher* backendDispatcher) +{ + for (size_t i = 0; i < m_agents.size(); i++) + m_agents[i]->didCreateFrontendAndBackend(frontendChannel, backendDispatcher); +} + +void InspectorAgentRegistry::willDestroyFrontendAndBackend() +{ + for (size_t i = 0; i < m_agents.size(); i++) + m_agents[i]->willDestroyFrontendAndBackend(); +} + +void InspectorAgentRegistry::discardAgents() +{ + for (size_t i = 0; i < m_agents.size(); i++) + m_agents[i]->discardAgent(); +} + +} // namespace Inspector + +#endif // ENABLE(INSPECTOR) diff --git a/JavaScriptCore/inspector/InspectorAgentRegistry.h b/JavaScriptCore/inspector/InspectorAgentRegistry.h new file mode 100644 index 00000000..7c1095a4 --- /dev/null +++ b/JavaScriptCore/inspector/InspectorAgentRegistry.h @@ -0,0 +1,59 @@ +/* + * Copyright (C) 2013 Apple Inc. All rights reserved. + * Copyright (C) 2011 Google 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. + */ + +#ifndef InspectorAgentRegistry_h +#define InspectorAgentRegistry_h + +#include + +namespace Inspector { + +class InspectorAgentBase; +class InspectorBackendDispatcher; +class InspectorFrontendChannel; + +class JS_EXPORT_PRIVATE InspectorAgentRegistry { +public: + InspectorAgentRegistry(); + + void append(std::unique_ptr); + + void didCreateFrontendAndBackend(InspectorFrontendChannel*, InspectorBackendDispatcher*); + void willDestroyFrontendAndBackend(); + void discardAgents(); + +private: + // These are declared here to avoid MSVC from trying to create default iplementations which would + // involve generating a copy constructor and copy assignment operator for the Vector of std::unique_ptrs. + InspectorAgentRegistry(const InspectorAgentRegistry&) WTF_DELETED_FUNCTION; + InspectorAgentRegistry& operator=(const InspectorAgentRegistry&) WTF_DELETED_FUNCTION; + + Vector> m_agents; +}; + +} // namespace Inspector + +#endif // !defined(InspectorAgentRegistry_h) diff --git a/JavaScriptCore/inspector/InspectorBackendDispatcher.cpp b/JavaScriptCore/inspector/InspectorBackendDispatcher.cpp new file mode 100644 index 00000000..30a66f7b --- /dev/null +++ b/JavaScriptCore/inspector/InspectorBackendDispatcher.cpp @@ -0,0 +1,264 @@ +/* + * Copyright (C) 2013 Apple Inc. All Rights Reserved. + * Copyright (C) 2011 The Chromium Authors. 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 "InspectorBackendDispatcher.h" + +#if ENABLE(INSPECTOR) + +#include "InspectorFrontendChannel.h" +#include "InspectorValues.h" +#include +#include + +namespace Inspector { + +InspectorBackendDispatcher::CallbackBase::CallbackBase(PassRefPtr backendDispatcher, int id) + : m_backendDispatcher(backendDispatcher) + , m_id(id) + , m_alreadySent(false) +{ +} + +bool InspectorBackendDispatcher::CallbackBase::isActive() const +{ + return !m_alreadySent && m_backendDispatcher->isActive(); +} + +void InspectorBackendDispatcher::CallbackBase::sendFailure(const ErrorString& error) +{ + ASSERT(error.length()); + sendIfActive(nullptr, error); +} + +void InspectorBackendDispatcher::CallbackBase::sendIfActive(PassRefPtr partialMessage, const ErrorString& invocationError) +{ + if (m_alreadySent) + return; + + m_backendDispatcher->sendResponse(m_id, partialMessage, invocationError); + m_alreadySent = true; +} + +PassRefPtr InspectorBackendDispatcher::create(InspectorFrontendChannel* inspectorFrontendChannel) +{ + return adoptRef(new InspectorBackendDispatcher(inspectorFrontendChannel)); +} + +void InspectorBackendDispatcher::registerDispatcherForDomain(const String& domain, InspectorSupplementalBackendDispatcher* dispatcher) +{ + auto result = m_dispatchers.add(domain, dispatcher); + ASSERT_UNUSED(result, result.isNewEntry); +} + +void InspectorBackendDispatcher::dispatch(const String& message) +{ + Ref protect(*this); + + RefPtr parsedMessage = InspectorValue::parseJSON(message); + if (!parsedMessage) { + reportProtocolError(nullptr, ParseError, ASCIILiteral("Message must be in JSON format")); + return; + } + + RefPtr messageObject = parsedMessage->asObject(); + if (!messageObject) { + reportProtocolError(nullptr, InvalidRequest, ASCIILiteral("Message must be a JSONified object")); + return; + } + + RefPtr callIdValue = messageObject->get("id"); + if (!callIdValue) { + reportProtocolError(nullptr, InvalidRequest, ASCIILiteral("'id' property was not found")); + return; + } + + long callId = 0; + if (!callIdValue->asNumber(&callId)) { + reportProtocolError(nullptr, InvalidRequest, ASCIILiteral("The type of 'id' property must be number")); + return; + } + + RefPtr methodValue = messageObject->get("method"); + if (!methodValue) { + reportProtocolError(&callId, InvalidRequest, ASCIILiteral("'method' property wasn't found")); + return; + } + + String method; + if (!methodValue->asString(&method)) { + reportProtocolError(&callId, InvalidRequest, ASCIILiteral("The type of 'method' property must be string")); + return; + } + + size_t position = method.find('.'); + if (position == WTF::notFound) { + reportProtocolError(&callId, InvalidRequest, ASCIILiteral("The 'method' property was formatted incorrectly. It should be 'Domain.method'")); + return; + } + + String domain = method.substring(0, position); + InspectorSupplementalBackendDispatcher* domainDispatcher = m_dispatchers.get(domain); + if (!domainDispatcher) { + reportProtocolError(&callId, MethodNotFound, "'" + domain + "' domain was not found"); + return; + } + + String domainMethod = method.substring(position + 1); + domainDispatcher->dispatch(callId, domainMethod, messageObject.release()); +} + +void InspectorBackendDispatcher::sendResponse(long callId, PassRefPtr result, const ErrorString& invocationError) +{ + if (!m_inspectorFrontendChannel) + return; + + if (invocationError.length()) { + reportProtocolError(&callId, ServerError, invocationError); + return; + } + + RefPtr responseMessage = InspectorObject::create(); + responseMessage->setObject(ASCIILiteral("result"), result); + responseMessage->setNumber(ASCIILiteral("id"), callId); + m_inspectorFrontendChannel->sendMessageToFrontend(responseMessage->toJSONString()); +} + +void InspectorBackendDispatcher::reportProtocolError(const long* const callId, CommonErrorCode errorCode, const String& errorMessage) const +{ + reportProtocolError(callId, errorCode, errorMessage, nullptr); +} + +void InspectorBackendDispatcher::reportProtocolError(const long* const callId, CommonErrorCode errorCode, const String& errorMessage, PassRefPtr data) const +{ + static const int errorCodes[] = { + -32700, // ParseError + -32600, // InvalidRequest + -32601, // MethodNotFound + -32602, // InvalidParams + -32603, // InternalError + -32000, // ServerError + }; + + ASSERT(errorCode >= 0); + ASSERT((unsigned)errorCode < WTF_ARRAY_LENGTH(errorCodes)); + ASSERT(errorCodes[errorCode]); + + if (!m_inspectorFrontendChannel) + return; + + RefPtr error = InspectorObject::create(); + error->setNumber(ASCIILiteral("code"), errorCodes[errorCode]); + error->setString(ASCIILiteral("message"), errorMessage); + if (data) + error->setArray(ASCIILiteral("data"), data); + + RefPtr message = InspectorObject::create(); + message->setObject(ASCIILiteral("error"), error.release()); + if (callId) + message->setNumber(ASCIILiteral("id"), *callId); + else + message->setValue(ASCIILiteral("id"), InspectorValue::null()); + + m_inspectorFrontendChannel->sendMessageToFrontend(message->toJSONString()); +} + +template +static ReturnValueType getPropertyValue(InspectorObject* object, const String& name, bool* valueFound, InspectorArray* protocolErrors, DefaultValueType defaultValue, bool (*asMethod)(InspectorValue*, ValueType*), const char* typeName) +{ + ASSERT(protocolErrors); + + ValueType value = defaultValue; + if (valueFound) + *valueFound = false; + + if (!object) { + if (!valueFound) + protocolErrors->pushString(String::format("'params' object must contain required parameter '%s' with type '%s'.", name.utf8().data(), typeName)); + return value; + } + + InspectorObject::const_iterator end = object->end(); + InspectorObject::const_iterator valueIterator = object->find(name); + if (valueIterator == end) { + if (!valueFound) + protocolErrors->pushString(String::format("Parameter '%s' with type '%s' was not found.", name.utf8().data(), typeName)); + return value; + } + + if (!asMethod(valueIterator->value.get(), &value)) { + protocolErrors->pushString(String::format("Parameter '%s' has wrong type. It must be '%s'.", name.utf8().data(), typeName)); + return value; + } + + if (valueFound) + *valueFound = true; + + return value; +} + +struct AsMethodBridges { + static bool asInt(InspectorValue* value, int* output) { return value->asNumber(output); } + static bool asDouble(InspectorValue* value, double* output) { return value->asNumber(output); } + static bool asString(InspectorValue* value, String* output) { return value->asString(output); } + static bool asBoolean(InspectorValue* value, bool* output) { return value->asBoolean(output); } + static bool asObject(InspectorValue* value, RefPtr* output) { return value->asObject(output); } + static bool asArray(InspectorValue* value, RefPtr* output) { return value->asArray(output); } +}; + +int InspectorBackendDispatcher::getInt(InspectorObject* object, const String& name, bool* valueFound, InspectorArray* protocolErrors) +{ + return getPropertyValue(object, name, valueFound, protocolErrors, 0, AsMethodBridges::asInt, "Number"); +} + +double InspectorBackendDispatcher::getDouble(InspectorObject* object, const String& name, bool* valueFound, InspectorArray* protocolErrors) +{ + return getPropertyValue(object, name, valueFound, protocolErrors, 0, AsMethodBridges::asDouble, "Number"); +} + +String InspectorBackendDispatcher::getString(InspectorObject* object, const String& name, bool* valueFound, InspectorArray* protocolErrors) +{ + return getPropertyValue(object, name, valueFound, protocolErrors, "", AsMethodBridges::asString, "String"); +} + +bool InspectorBackendDispatcher::getBoolean(InspectorObject* object, const String& name, bool* valueFound, InspectorArray* protocolErrors) +{ + return getPropertyValue(object, name, valueFound, protocolErrors, false, AsMethodBridges::asBoolean, "Boolean"); +} + +PassRefPtr InspectorBackendDispatcher::getObject(InspectorObject* object, const String& name, bool* valueFound, InspectorArray* protocolErrors) +{ + return getPropertyValue, RefPtr, InspectorObject*>(object, name, valueFound, protocolErrors, nullptr, AsMethodBridges::asObject, "Object"); +} + +PassRefPtr InspectorBackendDispatcher::getArray(InspectorObject* object, const String& name, bool* valueFound, InspectorArray* protocolErrors) +{ + return getPropertyValue, RefPtr, InspectorArray*>(object, name, valueFound, protocolErrors, nullptr, AsMethodBridges::asArray, "Array"); +} + +} // namespace Inspector + +#endif // ENABLE(INSPECTOR) diff --git a/JavaScriptCore/inspector/InspectorBackendDispatcher.h b/JavaScriptCore/inspector/InspectorBackendDispatcher.h new file mode 100644 index 00000000..0a55a1c9 --- /dev/null +++ b/JavaScriptCore/inspector/InspectorBackendDispatcher.h @@ -0,0 +1,105 @@ +/* + * Copyright (C) 2013 Apple Inc. All Rights Reserved. + * Copyright (C) 2011 The Chromium Authors. 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. + */ + +#ifndef InspectorBackendDispatcher_h +#define InspectorBackendDispatcher_h + +#include "InspectorValues.h" +#include +#include +#include + +namespace Inspector { + +class InspectorBackendDispatcher; +class InspectorFrontendChannel; +typedef String ErrorString; + +class InspectorSupplementalBackendDispatcher : public RefCounted { +public: + InspectorSupplementalBackendDispatcher(InspectorBackendDispatcher* backendDispatcher) : m_backendDispatcher(backendDispatcher) { } + virtual ~InspectorSupplementalBackendDispatcher() { } + virtual void dispatch(long callId, const String& method, PassRefPtr message) = 0; +protected: + RefPtr m_backendDispatcher; +}; + +class JS_EXPORT_PRIVATE InspectorBackendDispatcher : public RefCounted { +public: + static PassRefPtr create(InspectorFrontendChannel*); + + class JS_EXPORT_PRIVATE CallbackBase : public RefCounted { + public: + CallbackBase(PassRefPtr, int id); + + bool isActive() const; + void sendFailure(const ErrorString&); + void disable() { m_alreadySent = true; } + + protected: + void sendIfActive(PassRefPtr partialMessage, const ErrorString& invocationError); + + private: + RefPtr m_backendDispatcher; + int m_id; + bool m_alreadySent; + }; + + void clearFrontend() { m_inspectorFrontendChannel = nullptr; } + bool isActive() const { return !!m_inspectorFrontendChannel; } + + enum CommonErrorCode { + ParseError = 0, + InvalidRequest, + MethodNotFound, + InvalidParams, + InternalError, + ServerError + }; + + void registerDispatcherForDomain(const String& domain, InspectorSupplementalBackendDispatcher*); + void dispatch(const String& message); + void sendResponse(long callId, PassRefPtr result, const ErrorString& invocationError); + void reportProtocolError(const long* const callId, CommonErrorCode, const String& errorMessage) const; + void reportProtocolError(const long* const callId, CommonErrorCode, const String& errorMessage, PassRefPtr data) const; + + static int getInt(InspectorObject*, const String& name, bool* valueFound, InspectorArray* protocolErrors); + static double getDouble(InspectorObject*, const String& name, bool* valueFound, InspectorArray* protocolErrors); + static String getString(InspectorObject*, const String& name, bool* valueFound, InspectorArray* protocolErrors); + static bool getBoolean(InspectorObject*, const String& name, bool* valueFound, InspectorArray* protocolErrors); + static PassRefPtr getObject(InspectorObject*, const String& name, bool* valueFound, InspectorArray* protocolErrors); + static PassRefPtr getArray(InspectorObject*, const String& name, bool* valueFound, InspectorArray* protocolErrors); + +private: + InspectorBackendDispatcher(InspectorFrontendChannel* inspectorFrontendChannel) : m_inspectorFrontendChannel(inspectorFrontendChannel) { } + + InspectorFrontendChannel* m_inspectorFrontendChannel; + HashMap m_dispatchers; +}; + +} // namespace Inspector + +#endif // !defined(InspectorBackendDispatcher_h) diff --git a/JavaScriptCore/inspector/InspectorEnvironment.h b/JavaScriptCore/inspector/InspectorEnvironment.h new file mode 100644 index 00000000..327a9f89 --- /dev/null +++ b/JavaScriptCore/inspector/InspectorEnvironment.h @@ -0,0 +1,53 @@ +/* + * Copyright (C) 2013 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. + */ + +#ifndef InspectorEnvironment_h +#define InspectorEnvironment_h + +#include "CallData.h" + +namespace JSC { +class SourceCode; +} + +namespace Inspector { + +typedef JSC::JSValue (*InspectorFunctionCallHandler)(JSC::ExecState* exec, JSC::JSValue functionObject, JSC::CallType callType, const JSC::CallData& callData, JSC::JSValue thisValue, const JSC::ArgList& args); +typedef JSC::JSValue (*InspectorEvaluateHandler)(JSC::ExecState*, const JSC::SourceCode&, JSC::JSValue thisValue, JSC::JSValue* exception); + +class InspectorEnvironment { +public: + virtual ~InspectorEnvironment() { } + virtual bool developerExtrasEnabled() const = 0; + virtual bool canAccessInspectedScriptState(JSC::ExecState*) const = 0; + virtual InspectorFunctionCallHandler functionCallHandler() const = 0; + virtual InspectorEvaluateHandler evaluateHandler() const = 0; + virtual void willCallInjectedScriptFunction(JSC::ExecState*, const String& scriptName, int scriptLine) = 0; + virtual void didCallInjectedScriptFunction() = 0; +}; + +} // namespace Inspector + +#endif // !defined(InspectorEnvironment_h) diff --git a/JavaScriptCore/inspector/InspectorFrontendChannel.h b/JavaScriptCore/inspector/InspectorFrontendChannel.h new file mode 100644 index 00000000..fa0a8eae --- /dev/null +++ b/JavaScriptCore/inspector/InspectorFrontendChannel.h @@ -0,0 +1,41 @@ +/* + * Copyright (C) 2013 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. + */ + +#ifndef InspectorFrontendChannel_h +#define InspectorFrontendChannel_h + +#include + +namespace Inspector { + +class InspectorFrontendChannel { +public: + virtual ~InspectorFrontendChannel() { } + virtual bool sendMessageToFrontend(const String& message) = 0; +}; + +} // namespace Inspector + +#endif // !defined(InspectorFrontendChannel_h) diff --git a/JavaScriptCore/inspector/InspectorTypeBuilder.h b/JavaScriptCore/inspector/InspectorTypeBuilder.h new file mode 100644 index 00000000..8ea76ec9 --- /dev/null +++ b/JavaScriptCore/inspector/InspectorTypeBuilder.h @@ -0,0 +1,337 @@ +/* + * Copyright (C) 2013 Apple Inc. All Rights Reserved. + * Copyright (C) 2011 The Chromium Authors. 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. + */ + +#ifndef InspectorTypeBuilder_h +#define InspectorTypeBuilder_h + +#if ENABLE(INSPECTOR) + +#include "InspectorValues.h" +#include +#include + +namespace Inspector { + +namespace TypeBuilder { + +template +class OptOutput { +public: + OptOutput() : m_assigned(false) { } + + void operator=(T value) + { + m_value = value; + m_assigned = true; + } + + bool isAssigned() const { return m_assigned; } + + T getValue() + { + ASSERT(isAssigned()); + return m_value; + } + +private: + T m_value; + bool m_assigned; + + WTF_MAKE_NONCOPYABLE(OptOutput); +}; + + +// A small transient wrapper around int type, that can be used as a funciton parameter type +// cleverly disallowing C++ implicit casts from float or double. +class ExactlyInt { +public: + template + ExactlyInt(T t) : m_value(cast_to_int(t)) { } + ExactlyInt() { } + + operator int() { return m_value; } + +private: + int m_value; + + template + static int cast_to_int(T) { return T::default_case_cast_is_not_supported(); } +}; + +template<> +inline int ExactlyInt::cast_to_int(int i) { return i; } + +template<> +inline int ExactlyInt::cast_to_int(unsigned int i) { return i; } + +#if !ASSERT_DISABLED +class RuntimeCastHelper { +public: + template + static void assertType(InspectorValue* value) + { + ASSERT(value->type() == TYPE); + } + + static void assertAny(InspectorValue*) + { + } + + static void assertInt(InspectorValue* value) + { + double v; + bool castRes = value->asNumber(&v); + ASSERT_UNUSED(castRes, castRes); + ASSERT(static_cast(static_cast(v)) == v); + } +}; +#endif + + +// This class provides "Traits" type for the input type T. It is programmed using C++ template specialization +// technique. By default it simply takes "ItemTraits" type from T, but it doesn't work with the base types. +template +struct ArrayItemHelper { + typedef typename T::ItemTraits Traits; +}; + +template +class Array : public InspectorArrayBase { +private: + Array() { } + + InspectorArray* openAccessors() + { + COMPILE_ASSERT(sizeof(InspectorArray) == sizeof(Array), cannot_cast); + return static_cast(static_cast(this)); + } + +public: + void addItem(PassRefPtr value) + { + ArrayItemHelper::Traits::pushRefPtr(this->openAccessors(), value); + } + + void addItem(T value) + { + ArrayItemHelper::Traits::pushRaw(this->openAccessors(), value); + } + + static PassRefPtr> create() + { + return adoptRef(new Array()); + } + + static PassRefPtr> runtimeCast(PassRefPtr value) + { + RefPtr array; + bool castRes = value->asArray(&array); + ASSERT_UNUSED(castRes, castRes); +#if !ASSERT_DISABLED + assertCorrectValue(array.get()); +#endif // !ASSERT_DISABLED + COMPILE_ASSERT(sizeof(Array) == sizeof(InspectorArray), type_cast_problem); + return static_cast*>(static_cast(array.get())); + } + +#if !ASSERT_DISABLED + static void assertCorrectValue(InspectorValue* value) + { + RefPtr array; + bool castRes = value->asArray(&array); + ASSERT_UNUSED(castRes, castRes); + for (unsigned i = 0; i < array->length(); i++) + ArrayItemHelper::Traits::template assertCorrectValue(array->get(i).get()); + } +#endif // !ASSERT_DISABLED +}; + +struct StructItemTraits { + static void pushRefPtr(InspectorArray* array, PassRefPtr value) + { + array->pushValue(value); + } + +#if !ASSERT_DISABLED + template + static void assertCorrectValue(InspectorValue* value) + { + T::assertCorrectValue(value); + } +#endif // !ASSERT_DISABLED +}; + +template<> +struct ArrayItemHelper { + struct Traits { + static void pushRaw(InspectorArray* array, const String& value) + { + array->pushString(value); + } + +#if !ASSERT_DISABLED + template + static void assertCorrectValue(InspectorValue* value) + { + RuntimeCastHelper::assertType(value); + } +#endif // !ASSERT_DISABLED + }; +}; + +template<> +struct ArrayItemHelper { + struct Traits { + static void pushRaw(InspectorArray* array, int value) + { + array->pushInt(value); + } + +#if !ASSERT_DISABLED + template + static void assertCorrectValue(InspectorValue* value) + { + RuntimeCastHelper::assertInt(value); + } +#endif // !ASSERT_DISABLED + }; +}; + +template<> +struct ArrayItemHelper { + struct Traits { + static void pushRaw(InspectorArray* array, double value) + { + array->pushNumber(value); + } + +#if !ASSERT_DISABLED + template + static void assertCorrectValue(InspectorValue* value) + { + RuntimeCastHelper::assertType(value); + } +#endif // !ASSERT_DISABLED + }; +}; + +template<> +struct ArrayItemHelper { + struct Traits { + static void pushRaw(InspectorArray* array, bool value) + { + array->pushBoolean(value); + } + +#if !ASSERT_DISABLED + template + static void assertCorrectValue(InspectorValue* value) + { + RuntimeCastHelper::assertType(value); + } +#endif // !ASSERT_DISABLED + }; +}; + +template<> +struct ArrayItemHelper { + struct Traits { + static void pushRefPtr(InspectorArray* array, PassRefPtr value) + { + array->pushValue(value); + } + +#if !ASSERT_DISABLED + template + static void assertCorrectValue(InspectorValue* value) + { + RuntimeCastHelper::assertAny(value); + } +#endif // !ASSERT_DISABLED + }; +}; + +template<> +struct ArrayItemHelper { + struct Traits { + static void pushRefPtr(InspectorArray* array, PassRefPtr value) + { + array->pushValue(value); + } + +#if !ASSERT_DISABLED + template + static void assertCorrectValue(InspectorValue* value) + { + RuntimeCastHelper::assertType(value); + } +#endif // !ASSERT_DISABLED + }; +}; + +template<> +struct ArrayItemHelper { + struct Traits { + static void pushRefPtr(InspectorArray* array, PassRefPtr value) + { + array->pushArray(value); + } + +#if !ASSERT_DISABLED + template + static void assertCorrectValue(InspectorValue* value) + { + RuntimeCastHelper::assertType(value); + } +#endif // !ASSERT_DISABLED + }; +}; + +template +struct ArrayItemHelper> { + struct Traits { + static void pushRefPtr(InspectorArray* array, PassRefPtr> value) + { + array->pushValue(value); + } + +#if !ASSERT_DISABLED + template + static void assertCorrectValue(InspectorValue* value) + { + S::assertCorrectValue(value); + } +#endif // !ASSERT_DISABLED + }; +}; + +} // namespace TypeBuilder + +} // namespace Inspector + +#endif // ENABLE(INSPECTOR) + +#endif // !defined(InspectorTypeBuilder_h) diff --git a/JavaScriptCore/inspector/InspectorValues.cpp b/JavaScriptCore/inspector/InspectorValues.cpp new file mode 100644 index 00000000..211dacd9 --- /dev/null +++ b/JavaScriptCore/inspector/InspectorValues.cpp @@ -0,0 +1,836 @@ +/* + * Copyright (C) 2010 Google 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: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * 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. + * * Neither the name of Google Inc. nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND 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 THE COPYRIGHT + * OWNER 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 "InspectorValues.h" + +#include +#include +#include + +namespace Inspector { + +namespace { + +static const int stackLimit = 1000; + +enum Token { + OBJECT_BEGIN, + OBJECT_END, + ARRAY_BEGIN, + ARRAY_END, + STRING, + NUMBER, + BOOL_TRUE, + BOOL_FALSE, + NULL_TOKEN, + LIST_SEPARATOR, + OBJECT_PAIR_SEPARATOR, + INVALID_TOKEN, +}; + +const char* const nullString = "null"; +const char* const trueString = "true"; +const char* const falseString = "false"; + +bool parseConstToken(const UChar* start, const UChar* end, const UChar** tokenEnd, const char* token) +{ + while (start < end && *token != '\0' && *start++ == *token++) { } + if (*token != '\0') + return false; + *tokenEnd = start; + return true; +} + +bool readInt(const UChar* start, const UChar* end, const UChar** tokenEnd, bool canHaveLeadingZeros) +{ + if (start == end) + return false; + bool haveLeadingZero = '0' == *start; + int length = 0; + while (start < end && '0' <= *start && *start <= '9') { + ++start; + ++length; + } + if (!length) + return false; + if (!canHaveLeadingZeros && length > 1 && haveLeadingZero) + return false; + *tokenEnd = start; + return true; +} + +bool parseNumberToken(const UChar* start, const UChar* end, const UChar** tokenEnd) +{ + // We just grab the number here. We validate the size in DecodeNumber. + // According to RFC4627, a valid number is: [minus] int [frac] [exp] + if (start == end) + return false; + UChar c = *start; + if ('-' == c) + ++start; + + if (!readInt(start, end, &start, false)) + return false; + if (start == end) { + *tokenEnd = start; + return true; + } + + // Optional fraction part + c = *start; + if ('.' == c) { + ++start; + if (!readInt(start, end, &start, true)) + return false; + if (start == end) { + *tokenEnd = start; + return true; + } + c = *start; + } + + // Optional exponent part + if ('e' == c || 'E' == c) { + ++start; + if (start == end) + return false; + c = *start; + if ('-' == c || '+' == c) { + ++start; + if (start == end) + return false; + } + if (!readInt(start, end, &start, true)) + return false; + } + + *tokenEnd = start; + return true; +} + +bool readHexDigits(const UChar* start, const UChar* end, const UChar** tokenEnd, int digits) +{ + if (end - start < digits) + return false; + for (int i = 0; i < digits; ++i) { + UChar c = *start++; + if (!(('0' <= c && c <= '9') || ('a' <= c && c <= 'f') || ('A' <= c && c <= 'F'))) + return false; + } + *tokenEnd = start; + return true; +} + +bool parseStringToken(const UChar* start, const UChar* end, const UChar** tokenEnd) +{ + while (start < end) { + UChar c = *start++; + if ('\\' == c) { + c = *start++; + // Make sure the escaped char is valid. + switch (c) { + case 'x': + if (!readHexDigits(start, end, &start, 2)) + return false; + break; + case 'u': + if (!readHexDigits(start, end, &start, 4)) + return false; + break; + case '\\': + case '/': + case 'b': + case 'f': + case 'n': + case 'r': + case 't': + case 'v': + case '"': + break; + default: + return false; + } + } else if ('"' == c) { + *tokenEnd = start; + return true; + } + } + return false; +} + +Token parseToken(const UChar* start, const UChar* end, const UChar** tokenStart, const UChar** tokenEnd) +{ + while (start < end && isSpaceOrNewline(*start)) + ++start; + + if (start == end) + return INVALID_TOKEN; + + *tokenStart = start; + + switch (*start) { + case 'n': + if (parseConstToken(start, end, tokenEnd, nullString)) + return NULL_TOKEN; + break; + case 't': + if (parseConstToken(start, end, tokenEnd, trueString)) + return BOOL_TRUE; + break; + case 'f': + if (parseConstToken(start, end, tokenEnd, falseString)) + return BOOL_FALSE; + break; + case '[': + *tokenEnd = start + 1; + return ARRAY_BEGIN; + case ']': + *tokenEnd = start + 1; + return ARRAY_END; + case ',': + *tokenEnd = start + 1; + return LIST_SEPARATOR; + case '{': + *tokenEnd = start + 1; + return OBJECT_BEGIN; + case '}': + *tokenEnd = start + 1; + return OBJECT_END; + case ':': + *tokenEnd = start + 1; + return OBJECT_PAIR_SEPARATOR; + case '0': + case '1': + case '2': + case '3': + case '4': + case '5': + case '6': + case '7': + case '8': + case '9': + case '-': + if (parseNumberToken(start, end, tokenEnd)) + return NUMBER; + break; + case '"': + if (parseStringToken(start + 1, end, tokenEnd)) + return STRING; + break; + } + return INVALID_TOKEN; +} + +inline int hexToInt(UChar c) +{ + if ('0' <= c && c <= '9') + return c - '0'; + if ('A' <= c && c <= 'F') + return c - 'A' + 10; + if ('a' <= c && c <= 'f') + return c - 'a' + 10; + ASSERT_NOT_REACHED(); + return 0; +} + +bool decodeString(const UChar* start, const UChar* end, StringBuilder* output) +{ + while (start < end) { + UChar c = *start++; + if ('\\' != c) { + output->append(c); + continue; + } + c = *start++; + switch (c) { + case '"': + case '/': + case '\\': + break; + case 'b': + c = '\b'; + break; + case 'f': + c = '\f'; + break; + case 'n': + c = '\n'; + break; + case 'r': + c = '\r'; + break; + case 't': + c = '\t'; + break; + case 'v': + c = '\v'; + break; + case 'x': + c = (hexToInt(*start) << 4) + + hexToInt(*(start + 1)); + start += 2; + break; + case 'u': + c = (hexToInt(*start) << 12) + + (hexToInt(*(start + 1)) << 8) + + (hexToInt(*(start + 2)) << 4) + + hexToInt(*(start + 3)); + start += 4; + break; + default: + return false; + } + output->append(c); + } + return true; +} + +bool decodeString(const UChar* start, const UChar* end, String* output) +{ + if (start == end) { + *output = ""; + return true; + } + if (start > end) + return false; + StringBuilder buffer; + buffer.reserveCapacity(end - start); + if (!decodeString(start, end, &buffer)) + return false; + *output = buffer.toString(); + return true; +} + +PassRefPtr buildValue(const UChar* start, const UChar* end, const UChar** valueTokenEnd, int depth) +{ + if (depth > stackLimit) + return 0; + + RefPtr result; + const UChar* tokenStart; + const UChar* tokenEnd; + Token token = parseToken(start, end, &tokenStart, &tokenEnd); + switch (token) { + case INVALID_TOKEN: + return 0; + case NULL_TOKEN: + result = InspectorValue::null(); + break; + case BOOL_TRUE: + result = InspectorBasicValue::create(true); + break; + case BOOL_FALSE: + result = InspectorBasicValue::create(false); + break; + case NUMBER: { + bool ok; + double value = charactersToDouble(tokenStart, tokenEnd - tokenStart, &ok); + if (!ok) + return 0; + result = InspectorBasicValue::create(value); + break; + } + case STRING: { + String value; + bool ok = decodeString(tokenStart + 1, tokenEnd - 1, &value); + if (!ok) + return 0; + result = InspectorString::create(value); + break; + } + case ARRAY_BEGIN: { + RefPtr array = InspectorArray::create(); + start = tokenEnd; + token = parseToken(start, end, &tokenStart, &tokenEnd); + while (token != ARRAY_END) { + RefPtr arrayNode = buildValue(start, end, &tokenEnd, depth + 1); + if (!arrayNode) + return 0; + array->pushValue(arrayNode); + + // After a list value, we expect a comma or the end of the list. + start = tokenEnd; + token = parseToken(start, end, &tokenStart, &tokenEnd); + if (token == LIST_SEPARATOR) { + start = tokenEnd; + token = parseToken(start, end, &tokenStart, &tokenEnd); + if (token == ARRAY_END) + return 0; + } else if (token != ARRAY_END) { + // Unexpected value after list value. Bail out. + return 0; + } + } + if (token != ARRAY_END) + return 0; + result = array.release(); + break; + } + case OBJECT_BEGIN: { + RefPtr object = InspectorObject::create(); + start = tokenEnd; + token = parseToken(start, end, &tokenStart, &tokenEnd); + while (token != OBJECT_END) { + if (token != STRING) + return 0; + String key; + if (!decodeString(tokenStart + 1, tokenEnd - 1, &key)) + return 0; + start = tokenEnd; + + token = parseToken(start, end, &tokenStart, &tokenEnd); + if (token != OBJECT_PAIR_SEPARATOR) + return 0; + start = tokenEnd; + + RefPtr value = buildValue(start, end, &tokenEnd, depth + 1); + if (!value) + return 0; + object->setValue(key, value); + start = tokenEnd; + + // After a key/value pair, we expect a comma or the end of the + // object. + token = parseToken(start, end, &tokenStart, &tokenEnd); + if (token == LIST_SEPARATOR) { + start = tokenEnd; + token = parseToken(start, end, &tokenStart, &tokenEnd); + if (token == OBJECT_END) + return 0; + } else if (token != OBJECT_END) { + // Unexpected value after last object value. Bail out. + return 0; + } + } + if (token != OBJECT_END) + return 0; + result = object.release(); + break; + } + + default: + // We got a token that's not a value. + return 0; + } + *valueTokenEnd = tokenEnd; + return result.release(); +} + +inline bool escapeChar(UChar c, StringBuilder* dst) +{ + switch (c) { + case '\b': dst->append("\\b", 2); break; + case '\f': dst->append("\\f", 2); break; + case '\n': dst->append("\\n", 2); break; + case '\r': dst->append("\\r", 2); break; + case '\t': dst->append("\\t", 2); break; + case '\\': dst->append("\\\\", 2); break; + case '"': dst->append("\\\"", 2); break; + default: + return false; + } + return true; +} + +inline void doubleQuoteString(const String& str, StringBuilder* dst) +{ + dst->append('"'); + for (unsigned i = 0; i < str.length(); ++i) { + UChar c = str[i]; + if (!escapeChar(c, dst)) { + if (c < 32 || c > 126 || c == '<' || c == '>') { + // 1. Escaping <, > to prevent script execution. + // 2. Technically, we could also pass through c > 126 as UTF8, but this + // is also optional. It would also be a pain to implement here. + unsigned int symbol = static_cast(c); + String symbolCode = String::format("\\u%04X", symbol); + dst->append(symbolCode.characters(), symbolCode.length()); + } else + dst->append(c); + } + } + dst->append('"'); +} + +} // anonymous namespace + +bool InspectorValue::asBoolean(bool*) const +{ + return false; +} + +bool InspectorValue::asNumber(double*) const +{ + return false; +} + +bool InspectorValue::asNumber(long*) const +{ + return false; +} + +bool InspectorValue::asNumber(int*) const +{ + return false; +} + +bool InspectorValue::asNumber(unsigned long*) const +{ + return false; +} + +bool InspectorValue::asNumber(unsigned int*) const +{ + return false; +} + +bool InspectorValue::asString(String*) const +{ + return false; +} + +bool InspectorValue::asValue(RefPtr* output) +{ + *output = this; + return true; +} + +bool InspectorValue::asObject(RefPtr*) +{ + return false; +} + +bool InspectorValue::asArray(RefPtr*) +{ + return false; +} + +PassRefPtr InspectorValue::asObject() +{ + return 0; +} + +PassRefPtr InspectorValue::asArray() +{ + return 0; +} + +PassRefPtr InspectorValue::parseJSON(const String& json) +{ + const UChar* start = json.deprecatedCharacters(); + const UChar* end = json.deprecatedCharacters() + json.length(); + const UChar *tokenEnd; + RefPtr value = buildValue(start, end, &tokenEnd, 0); + if (!value || tokenEnd != end) + return 0; + return value.release(); +} + +String InspectorValue::toJSONString() const +{ + StringBuilder result; + result.reserveCapacity(512); + writeJSON(&result); + return result.toString(); +} + +void InspectorValue::writeJSON(StringBuilder* output) const +{ + ASSERT(m_type == TypeNull); + output->append(nullString, 4); +} + +bool InspectorBasicValue::asBoolean(bool* output) const +{ + if (type() != TypeBoolean) + return false; + *output = m_boolValue; + return true; +} + +bool InspectorBasicValue::asNumber(double* output) const +{ + if (type() != TypeNumber) + return false; + *output = m_doubleValue; + return true; +} + +bool InspectorBasicValue::asNumber(long* output) const +{ + if (type() != TypeNumber) + return false; + *output = static_cast(m_doubleValue); + return true; +} + +bool InspectorBasicValue::asNumber(int* output) const +{ + if (type() != TypeNumber) + return false; + *output = static_cast(m_doubleValue); + return true; +} + +bool InspectorBasicValue::asNumber(unsigned long* output) const +{ + if (type() != TypeNumber) + return false; + *output = static_cast(m_doubleValue); + return true; +} + +bool InspectorBasicValue::asNumber(unsigned int* output) const +{ + if (type() != TypeNumber) + return false; + *output = static_cast(m_doubleValue); + return true; +} + +void InspectorBasicValue::writeJSON(StringBuilder* output) const +{ + ASSERT(type() == TypeBoolean || type() == TypeNumber); + if (type() == TypeBoolean) { + if (m_boolValue) + output->append(trueString, 4); + else + output->append(falseString, 5); + } else if (type() == TypeNumber) { + NumberToLStringBuffer buffer; + if (!std::isfinite(m_doubleValue)) { + output->append(nullString, 4); + return; + } + DecimalNumber decimal = m_doubleValue; + unsigned length = 0; + if (decimal.bufferLengthForStringDecimal() > WTF::NumberToStringBufferLength) { + // Not enough room for decimal. Use exponential format. + if (decimal.bufferLengthForStringExponential() > WTF::NumberToStringBufferLength) { + // Fallback for an abnormal case if it's too little even for exponential. + output->append("NaN", 3); + return; + } + length = decimal.toStringExponential(buffer, WTF::NumberToStringBufferLength); + } else + length = decimal.toStringDecimal(buffer, WTF::NumberToStringBufferLength); + output->append(buffer, length); + } +} + +bool InspectorString::asString(String* output) const +{ + *output = m_stringValue; + return true; +} + +void InspectorString::writeJSON(StringBuilder* output) const +{ + ASSERT(type() == TypeString); + doubleQuoteString(m_stringValue, output); +} + +InspectorObjectBase::~InspectorObjectBase() +{ +} + +bool InspectorObjectBase::asObject(RefPtr* output) +{ + COMPILE_ASSERT(sizeof(InspectorObject) == sizeof(InspectorObjectBase), cannot_cast); + *output = static_cast(this); + return true; +} + +PassRefPtr InspectorObjectBase::asObject() +{ + return openAccessors(); +} + +InspectorObject* InspectorObjectBase::openAccessors() +{ + COMPILE_ASSERT(sizeof(InspectorObject) == sizeof(InspectorObjectBase), cannot_cast); + return static_cast(this); +} + +bool InspectorObjectBase::getBoolean(const String& name, bool* output) const +{ + RefPtr value = get(name); + if (!value) + return false; + return value->asBoolean(output); +} + +bool InspectorObjectBase::getString(const String& name, String* output) const +{ + RefPtr value = get(name); + if (!value) + return false; + return value->asString(output); +} + +PassRefPtr InspectorObjectBase::getObject(const String& name) const +{ + PassRefPtr value = get(name); + if (!value) + return 0; + return value->asObject(); +} + +PassRefPtr InspectorObjectBase::getArray(const String& name) const +{ + PassRefPtr value = get(name); + if (!value) + return 0; + return value->asArray(); +} + +PassRefPtr InspectorObjectBase::get(const String& name) const +{ + Dictionary::const_iterator it = m_data.find(name); + if (it == m_data.end()) + return 0; + return it->value; +} + +void InspectorObjectBase::remove(const String& name) +{ + m_data.remove(name); + for (size_t i = 0; i < m_order.size(); ++i) { + if (m_order[i] == name) { + m_order.remove(i); + break; + } + } +} + +void InspectorObjectBase::writeJSON(StringBuilder* output) const +{ + output->append('{'); + for (size_t i = 0; i < m_order.size(); ++i) { + Dictionary::const_iterator it = m_data.find(m_order[i]); + ASSERT(it != m_data.end()); + if (i) + output->append(','); + doubleQuoteString(it->key, output); + output->append(':'); + it->value->writeJSON(output); + } + output->append('}'); +} + +InspectorObjectBase::InspectorObjectBase() + : InspectorValue(TypeObject) + , m_data() + , m_order() +{ +} + +InspectorArrayBase::~InspectorArrayBase() +{ +} + +bool InspectorArrayBase::asArray(RefPtr* output) +{ + COMPILE_ASSERT(sizeof(InspectorArrayBase) == sizeof(InspectorArray), cannot_cast); + *output = static_cast(this); + return true; +} + +PassRefPtr InspectorArrayBase::asArray() +{ + COMPILE_ASSERT(sizeof(InspectorArrayBase) == sizeof(InspectorArray), cannot_cast); + return static_cast(this); +} + +void InspectorArrayBase::writeJSON(StringBuilder* output) const +{ + output->append('['); + for (Vector>::const_iterator it = m_data.begin(); it != m_data.end(); ++it) { + if (it != m_data.begin()) + output->append(','); + (*it)->writeJSON(output); + } + output->append(']'); +} + +InspectorArrayBase::InspectorArrayBase() + : InspectorValue(TypeArray) + , m_data() +{ +} + +PassRefPtr InspectorArrayBase::get(size_t index) +{ + ASSERT_WITH_SECURITY_IMPLICATION(index < m_data.size()); + return m_data[index]; +} + +PassRefPtr InspectorObject::create() +{ + return adoptRef(new InspectorObject); +} + +PassRefPtr InspectorArray::create() +{ + return adoptRef(new InspectorArray); +} + +PassRefPtr InspectorValue::null() +{ + return adoptRef(new InspectorValue); +} + +PassRefPtr InspectorString::create(const String& value) +{ + return adoptRef(new InspectorString(value)); +} + +PassRefPtr InspectorString::create(const char* value) +{ + return adoptRef(new InspectorString(value)); +} + +PassRefPtr InspectorBasicValue::create(bool value) +{ + return adoptRef(new InspectorBasicValue(value)); +} + +PassRefPtr InspectorBasicValue::create(int value) +{ + return adoptRef(new InspectorBasicValue(value)); +} + +PassRefPtr InspectorBasicValue::create(double value) +{ + return adoptRef(new InspectorBasicValue(value)); +} + +} // namespace Inspector diff --git a/JavaScriptCore/inspector/InspectorValues.h b/JavaScriptCore/inspector/InspectorValues.h new file mode 100644 index 00000000..012a1a65 --- /dev/null +++ b/JavaScriptCore/inspector/InspectorValues.h @@ -0,0 +1,368 @@ +/* + * Copyright (C) 2009 Google 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: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * 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. + * * Neither the name of Google Inc. nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND 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 THE COPYRIGHT + * OWNER 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. + */ + +#ifndef InspectorValues_h +#define InspectorValues_h + +#include +#include +#include +#include +#include +#include + +namespace Inspector { + +class InspectorArray; +class InspectorObject; + +class JS_EXPORT_PRIVATE InspectorValue : public RefCounted { +public: + static const int maxDepth = 1000; + + InspectorValue() : m_type(TypeNull) { } + virtual ~InspectorValue() { } + + static PassRefPtr null(); + + typedef enum { + TypeNull = 0, + TypeBoolean, + TypeNumber, + TypeString, + TypeObject, + TypeArray + } Type; + + Type type() const { return m_type; } + + bool isNull() const { return m_type == TypeNull; } + + virtual bool asBoolean(bool* output) const; + virtual bool asNumber(double* output) const; + virtual bool asNumber(long* output) const; + virtual bool asNumber(int* output) const; + virtual bool asNumber(unsigned long* output) const; + virtual bool asNumber(unsigned int* output) const; + virtual bool asString(String* output) const; + virtual bool asValue(RefPtr* output); + virtual bool asObject(RefPtr* output); + virtual bool asArray(RefPtr* output); + virtual PassRefPtr asObject(); + virtual PassRefPtr asArray(); + + static PassRefPtr parseJSON(const String& json); + + String toJSONString() const; + virtual void writeJSON(StringBuilder* output) const; + +protected: + explicit InspectorValue(Type type) : m_type(type) { } + +private: + Type m_type; +}; + +class JS_EXPORT_PRIVATE InspectorBasicValue : public InspectorValue { +public: + + static PassRefPtr create(bool); + static PassRefPtr create(int); + static PassRefPtr create(double); + + virtual bool asBoolean(bool* output) const OVERRIDE; + virtual bool asNumber(double* output) const OVERRIDE; + virtual bool asNumber(long* output) const OVERRIDE; + virtual bool asNumber(int* output) const OVERRIDE; + virtual bool asNumber(unsigned long* output) const OVERRIDE; + virtual bool asNumber(unsigned* output) const OVERRIDE; + + virtual void writeJSON(StringBuilder* output) const OVERRIDE; + +private: + explicit InspectorBasicValue(bool value) : InspectorValue(TypeBoolean), m_boolValue(value) { } + explicit InspectorBasicValue(int value) : InspectorValue(TypeNumber), m_doubleValue((double)value) { } + explicit InspectorBasicValue(double value) : InspectorValue(TypeNumber), m_doubleValue(value) { } + + union { + bool m_boolValue; + double m_doubleValue; + }; +}; + +class JS_EXPORT_PRIVATE InspectorString : public InspectorValue { +public: + static PassRefPtr create(const String&); + static PassRefPtr create(const char*); + + virtual bool asString(String* output) const OVERRIDE; + + virtual void writeJSON(StringBuilder* output) const OVERRIDE; + +private: + explicit InspectorString(const String& value) : InspectorValue(TypeString), m_stringValue(value) { } + explicit InspectorString(const char* value) : InspectorValue(TypeString), m_stringValue(value) { } + + String m_stringValue; +}; + +class JS_EXPORT_PRIVATE InspectorObjectBase : public InspectorValue { +private: + typedef HashMap> Dictionary; + +public: + typedef Dictionary::iterator iterator; + typedef Dictionary::const_iterator const_iterator; + + virtual PassRefPtr asObject() OVERRIDE; + InspectorObject* openAccessors(); + +protected: + virtual ~InspectorObjectBase(); + + virtual bool asObject(RefPtr* output) OVERRIDE; + + void setBoolean(const String& name, bool); + void setNumber(const String& name, double); + void setString(const String& name, const String&); + void setValue(const String& name, PassRefPtr); + void setObject(const String& name, PassRefPtr); + void setArray(const String& name, PassRefPtr); + + iterator find(const String& name); + const_iterator find(const String& name) const; + bool getBoolean(const String& name, bool* output) const; + template bool getNumber(const String& name, T* output) const + { + RefPtr value = get(name); + if (!value) + return false; + return value->asNumber(output); + } + bool getString(const String& name, String* output) const; + PassRefPtr getObject(const String& name) const; + PassRefPtr getArray(const String& name) const; + PassRefPtr get(const String& name) const; + + void remove(const String& name); + + virtual void writeJSON(StringBuilder* output) const OVERRIDE; + + iterator begin() { return m_data.begin(); } + iterator end() { return m_data.end(); } + const_iterator begin() const { return m_data.begin(); } + const_iterator end() const { return m_data.end(); } + + int size() const { return m_data.size(); } + +protected: + InspectorObjectBase(); + +private: + Dictionary m_data; + Vector m_order; +}; + +class InspectorObject : public InspectorObjectBase { +public: + static JS_EXPORT_PRIVATE PassRefPtr create(); + + using InspectorObjectBase::asObject; + + using InspectorObjectBase::setBoolean; + using InspectorObjectBase::setNumber; + using InspectorObjectBase::setString; + using InspectorObjectBase::setValue; + using InspectorObjectBase::setObject; + using InspectorObjectBase::setArray; + + using InspectorObjectBase::find; + using InspectorObjectBase::getBoolean; + using InspectorObjectBase::getNumber; + using InspectorObjectBase::getString; + using InspectorObjectBase::getObject; + using InspectorObjectBase::getArray; + using InspectorObjectBase::get; + + using InspectorObjectBase::remove; + + using InspectorObjectBase::begin; + using InspectorObjectBase::end; + + using InspectorObjectBase::size; +}; + + +class JS_EXPORT_PRIVATE InspectorArrayBase : public InspectorValue { +public: + typedef Vector>::iterator iterator; + typedef Vector>::const_iterator const_iterator; + + virtual PassRefPtr asArray() OVERRIDE; + + unsigned length() const { return m_data.size(); } + +protected: + virtual ~InspectorArrayBase(); + + virtual bool asArray(RefPtr* output) OVERRIDE; + + void pushBoolean(bool); + void pushInt(int); + void pushNumber(double); + void pushString(const String&); + void pushValue(PassRefPtr); + void pushObject(PassRefPtr); + void pushArray(PassRefPtr); + + PassRefPtr get(size_t index); + + virtual void writeJSON(StringBuilder* output) const OVERRIDE; + + iterator begin() { return m_data.begin(); } + iterator end() { return m_data.end(); } + const_iterator begin() const { return m_data.begin(); } + const_iterator end() const { return m_data.end(); } + +protected: + InspectorArrayBase(); + +private: + Vector> m_data; +}; + +class InspectorArray : public InspectorArrayBase { +public: + static JS_EXPORT_PRIVATE PassRefPtr create(); + + using InspectorArrayBase::asArray; + + using InspectorArrayBase::pushBoolean; + using InspectorArrayBase::pushInt; + using InspectorArrayBase::pushNumber; + using InspectorArrayBase::pushString; + using InspectorArrayBase::pushValue; + using InspectorArrayBase::pushObject; + using InspectorArrayBase::pushArray; + + using InspectorArrayBase::get; + + using InspectorArrayBase::begin; + using InspectorArrayBase::end; +}; + + +inline InspectorObjectBase::iterator InspectorObjectBase::find(const String& name) +{ + return m_data.find(name); +} + +inline InspectorObjectBase::const_iterator InspectorObjectBase::find(const String& name) const +{ + return m_data.find(name); +} + +inline void InspectorObjectBase::setBoolean(const String& name, bool value) +{ + setValue(name, InspectorBasicValue::create(value)); +} + +inline void InspectorObjectBase::setNumber(const String& name, double value) +{ + setValue(name, InspectorBasicValue::create(value)); +} + +inline void InspectorObjectBase::setString(const String& name, const String& value) +{ + setValue(name, InspectorString::create(value)); +} + +inline void InspectorObjectBase::setValue(const String& name, PassRefPtr value) +{ + ASSERT(value); + if (m_data.set(name, value).isNewEntry) + m_order.append(name); +} + +inline void InspectorObjectBase::setObject(const String& name, PassRefPtr value) +{ + ASSERT(value); + if (m_data.set(name, value).isNewEntry) + m_order.append(name); +} + +inline void InspectorObjectBase::setArray(const String& name, PassRefPtr value) +{ + ASSERT(value); + if (m_data.set(name, value).isNewEntry) + m_order.append(name); +} + +inline void InspectorArrayBase::pushBoolean(bool value) +{ + m_data.append(InspectorBasicValue::create(value)); +} + +inline void InspectorArrayBase::pushInt(int value) +{ + m_data.append(InspectorBasicValue::create(value)); +} + +inline void InspectorArrayBase::pushNumber(double value) +{ + m_data.append(InspectorBasicValue::create(value)); +} + +inline void InspectorArrayBase::pushString(const String& value) +{ + m_data.append(InspectorString::create(value)); +} + +inline void InspectorArrayBase::pushValue(PassRefPtr value) +{ + ASSERT(value); + m_data.append(value); +} + +inline void InspectorArrayBase::pushObject(PassRefPtr value) +{ + ASSERT(value); + m_data.append(value); +} + +inline void InspectorArrayBase::pushArray(PassRefPtr value) +{ + ASSERT(value); + m_data.append(value); +} + +} // namespace Inspector + +#endif // !defined(InspectorValues_h) diff --git a/JavaScriptCore/inspector/JSGlobalObjectInspectorController.cpp b/JavaScriptCore/inspector/JSGlobalObjectInspectorController.cpp new file mode 100644 index 00000000..7462aad2 --- /dev/null +++ b/JavaScriptCore/inspector/JSGlobalObjectInspectorController.cpp @@ -0,0 +1,103 @@ +/* + * Copyright (C) 2014 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 "JSGlobalObjectInspectorController.h" + +#if ENABLE(INSPECTOR) + +#include "Completion.h" +#include "InjectedScriptHost.h" +#include "InjectedScriptManager.h" +#include "InspectorAgent.h" +#include "InspectorBackendDispatcher.h" +#include "InspectorFrontendChannel.h" +#include "JSGlobalObject.h" + +using namespace JSC; + +namespace Inspector { + +JSGlobalObjectInspectorController::JSGlobalObjectInspectorController(JSGlobalObject& globalObject) + : m_globalObject(globalObject) + , m_injectedScriptManager(std::make_unique(*this, InjectedScriptHost::create())) + , m_inspectorFrontendChannel(nullptr) +{ + m_agents.append(std::make_unique()); + + // FIXME: Create RuntimeAgent. + // FIXME: Create DebuggerAgent. + (void)m_globalObject; // Will be used by RuntimeAgent. +} + +JSGlobalObjectInspectorController::~JSGlobalObjectInspectorController() +{ + m_agents.discardAgents(); +} + +void JSGlobalObjectInspectorController::connectFrontend(InspectorFrontendChannel* frontendChannel) +{ + ASSERT(!m_inspectorFrontendChannel); + ASSERT(!m_inspectorBackendDispatcher); + + m_inspectorFrontendChannel = frontendChannel; + m_inspectorBackendDispatcher = InspectorBackendDispatcher::create(frontendChannel); + + m_agents.didCreateFrontendAndBackend(frontendChannel, m_inspectorBackendDispatcher.get()); +} + +void JSGlobalObjectInspectorController::disconnectFrontend() +{ + if (!m_inspectorFrontendChannel) + return; + + m_agents.willDestroyFrontendAndBackend(); + + m_inspectorBackendDispatcher->clearFrontend(); + m_inspectorBackendDispatcher.clear(); + m_inspectorFrontendChannel = nullptr; + + m_injectedScriptManager->disconnect(); +} + +void JSGlobalObjectInspectorController::dispatchMessageFromFrontend(const String& message) +{ + if (m_inspectorBackendDispatcher) + m_inspectorBackendDispatcher->dispatch(message); +} + +InspectorFunctionCallHandler JSGlobalObjectInspectorController::functionCallHandler() const +{ + return JSC::call; +} + +InspectorEvaluateHandler JSGlobalObjectInspectorController::evaluateHandler() const +{ + return JSC::evaluate; +} + +} // namespace Inspector + +#endif // ENABLE(INSPECTOR) diff --git a/JavaScriptCore/inspector/JSGlobalObjectInspectorController.h b/JavaScriptCore/inspector/JSGlobalObjectInspectorController.h new file mode 100644 index 00000000..23349431 --- /dev/null +++ b/JavaScriptCore/inspector/JSGlobalObjectInspectorController.h @@ -0,0 +1,78 @@ +/* + * Copyright (C) 2014 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. + */ + +#ifndef JSGlobalObjectInspectorController_h +#define JSGlobalObjectInspectorController_h + +#if ENABLE(INSPECTOR) + +#include "InspectorAgentRegistry.h" +#include "InspectorEnvironment.h" +#include +#include +#include + +namespace JSC { +class ExecState; +class JSGlobalObject; +} + +namespace Inspector { + +class InjectedScriptManager; +class InspectorBackendDispatcher; +class InspectorFrontendChannel; + +class JSGlobalObjectInspectorController FINAL : public InspectorEnvironment { + WTF_MAKE_NONCOPYABLE(JSGlobalObjectInspectorController); + WTF_MAKE_FAST_ALLOCATED; +public: + JSGlobalObjectInspectorController(JSC::JSGlobalObject&); + ~JSGlobalObjectInspectorController(); + + void connectFrontend(InspectorFrontendChannel*); + void disconnectFrontend(); + void dispatchMessageFromFrontend(const String&); + + virtual bool developerExtrasEnabled() const OVERRIDE { return true; } + virtual bool canAccessInspectedScriptState(JSC::ExecState*) const OVERRIDE { return true; } + virtual InspectorFunctionCallHandler functionCallHandler() const OVERRIDE; + virtual InspectorEvaluateHandler evaluateHandler() const OVERRIDE; + virtual void willCallInjectedScriptFunction(JSC::ExecState*, const String&, int) OVERRIDE { } + virtual void didCallInjectedScriptFunction() OVERRIDE { } + +private: + JSC::JSGlobalObject& m_globalObject; + std::unique_ptr m_injectedScriptManager; + InspectorAgentRegistry m_agents; + InspectorFrontendChannel* m_inspectorFrontendChannel; + RefPtr m_inspectorBackendDispatcher; +}; + +} // namespace Inspector + +#endif // ENABLE(INSPECTOR) + +#endif // !defined(JSGlobalObjectInspectorController_h) diff --git a/JavaScriptCore/inspector/JSInjectedScriptHost.cpp b/JavaScriptCore/inspector/JSInjectedScriptHost.cpp new file mode 100644 index 00000000..3f2f1ed4 --- /dev/null +++ b/JavaScriptCore/inspector/JSInjectedScriptHost.cpp @@ -0,0 +1,205 @@ +/* + * Copyright (C) 2013 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 "JSInjectedScriptHost.h" + +#if ENABLE(INSPECTOR) + +#include "DateInstance.h" +#include "Error.h" +#include "InjectedScriptHost.h" +#include "JSArray.h" +#include "JSFunction.h" +#include "JSInjectedScriptHostPrototype.h" +#include "JSTypedArrays.h" +#include "ObjectConstructor.h" +#include "Operations.h" +#include "RegExpObject.h" +#include "SourceCode.h" +#include "TypedArrayInlines.h" + +using namespace JSC; + +namespace Inspector { + +const ClassInfo JSInjectedScriptHost::s_info = { "InjectedScriptHost", &Base::s_info, 0, 0, CREATE_METHOD_TABLE(JSInjectedScriptHost) }; + +JSInjectedScriptHost::JSInjectedScriptHost(VM& vm, Structure* structure, PassRefPtr impl) + : JSDestructibleObject(vm, structure) + , m_impl(impl.leakRef()) +{ +} + +void JSInjectedScriptHost::finishCreation(VM& vm) +{ + Base::finishCreation(vm); + ASSERT(inherits(info())); +} + +JSObject* JSInjectedScriptHost::createPrototype(VM& vm, JSGlobalObject* globalObject) +{ + return JSInjectedScriptHostPrototype::create(vm, globalObject, JSInjectedScriptHostPrototype::createStructure(vm, globalObject, globalObject->objectPrototype())); +} + +void JSInjectedScriptHost::destroy(JSC::JSCell* cell) +{ + JSInjectedScriptHost* thisObject = static_cast(cell); + thisObject->JSInjectedScriptHost::~JSInjectedScriptHost(); +} + +void JSInjectedScriptHost::releaseImpl() +{ + if (m_impl) { + m_impl->deref(); + m_impl = nullptr; + } +} + +JSInjectedScriptHost::~JSInjectedScriptHost() +{ + releaseImpl(); +} + +JSValue JSInjectedScriptHost::evaluate(ExecState* exec) const +{ + JSGlobalObject* globalObject = exec->lexicalGlobalObject(); + return globalObject->evalFunction(); +} + +JSValue JSInjectedScriptHost::internalConstructorName(ExecState* exec) +{ + if (exec->argumentCount() < 1) + return jsUndefined(); + + JSObject* thisObject = jsCast(exec->uncheckedArgument(0).toThis(exec, NotStrictMode)); + String result = thisObject->methodTable()->className(thisObject); + return jsString(exec, result); +} + +JSValue JSInjectedScriptHost::isHTMLAllCollection(ExecState* exec) +{ + if (exec->argumentCount() < 1) + return jsUndefined(); + + JSValue value = exec->uncheckedArgument(0); + return jsBoolean(impl().isHTMLAllCollection(value)); +} + +JSValue JSInjectedScriptHost::type(ExecState* exec) +{ + if (exec->argumentCount() < 1) + return jsUndefined(); + + JSValue value = exec->uncheckedArgument(0); + if (value.isString()) + return exec->vm().smallStrings.stringString(); + if (value.isBoolean()) + return exec->vm().smallStrings.booleanString(); + if (value.isNumber()) + return exec->vm().smallStrings.numberString(); + + if (value.inherits(JSArray::info())) + return jsNontrivialString(exec, ASCIILiteral("array")); + if (value.inherits(DateInstance::info())) + return jsNontrivialString(exec, ASCIILiteral("date")); + if (value.inherits(RegExpObject::info())) + return jsNontrivialString(exec, ASCIILiteral("regexp")); + if (value.inherits(JSInt8Array::info()) || value.inherits(JSInt16Array::info()) || value.inherits(JSInt32Array::info())) + return jsNontrivialString(exec, ASCIILiteral("array")); + if (value.inherits(JSUint8Array::info()) || value.inherits(JSUint16Array::info()) || value.inherits(JSUint32Array::info())) + return jsNontrivialString(exec, ASCIILiteral("array")); + if (value.inherits(JSFloat32Array::info()) || value.inherits(JSFloat64Array::info())) + return jsNontrivialString(exec, ASCIILiteral("array")); + + return impl().type(exec, value); +} + +JSValue JSInjectedScriptHost::functionDetails(ExecState* exec) +{ + if (exec->argumentCount() < 1) + return jsUndefined(); + + JSValue value = exec->uncheckedArgument(0); + if (!value.asCell()->inherits(JSFunction::info())) + return jsUndefined(); + + JSFunction* function = jsCast(value); + const SourceCode* sourceCode = function->sourceCode(); + if (!sourceCode) + return jsUndefined(); + + int lineNumber = sourceCode->firstLine(); + if (lineNumber) + lineNumber -= 1; // In the inspector protocol all positions are 0-based while in SourceCode they are 1-based + + String scriptID = String::number(sourceCode->provider()->asID()); + JSObject* location = constructEmptyObject(exec); + location->putDirect(exec->vm(), Identifier(exec, "lineNumber"), jsNumber(lineNumber)); + location->putDirect(exec->vm(), Identifier(exec, "scriptId"), jsString(exec, scriptID)); + + JSObject* result = constructEmptyObject(exec); + result->putDirect(exec->vm(), Identifier(exec, "location"), location); + + String name = function->name(exec); + if (!name.isEmpty()) + result->putDirect(exec->vm(), Identifier(exec, "name"), jsString(exec, name)); + + String displayName = function->displayName(exec); + if (!displayName.isEmpty()) + result->putDirect(exec->vm(), Identifier(exec, "displayName"), jsString(exec, displayName)); + + // FIXME: provide function scope data in "scopesRaw" property when JSC supports it. + // [JSC] expose function (closure) inner context to debugger + + return result; +} + +JSValue JSInjectedScriptHost::getInternalProperties(ExecState*) +{ + // FIXME: [JSC] expose object inner properties to debugger + return jsUndefined(); +} + +JSValue toJS(ExecState* exec, JSGlobalObject* globalObject, InjectedScriptHost* impl) +{ + if (!impl) + return jsNull(); + + JSObject* prototype = JSInjectedScriptHost::createPrototype(exec->vm(), globalObject); + Structure* structure = JSInjectedScriptHost::createStructure(exec->vm(), globalObject, prototype); + JSInjectedScriptHost* injectedScriptHost = JSInjectedScriptHost::create(exec->vm(), structure, impl); + + return injectedScriptHost; +} + +JSInjectedScriptHost* toJSInjectedScriptHost(JSValue value) +{ + return value.inherits(JSInjectedScriptHost::info()) ? jsCast(value) : nullptr; +} + +} // namespace Inspector + +#endif // ENABLE(INSPECTOR) diff --git a/JavaScriptCore/inspector/JSInjectedScriptHost.h b/JavaScriptCore/inspector/JSInjectedScriptHost.h new file mode 100644 index 00000000..199dfca4 --- /dev/null +++ b/JavaScriptCore/inspector/JSInjectedScriptHost.h @@ -0,0 +1,90 @@ +/* + * Copyright (C) 2013 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. + */ + +#ifndef JSInjectedScriptHost_h +#define JSInjectedScriptHost_h + +#if ENABLE(INSPECTOR) + +#include "JSDestructibleObject.h" + +namespace Inspector { + +class InjectedScriptHost; + +class JSInjectedScriptHost : public JSC::JSDestructibleObject { +public: + typedef JSC::JSDestructibleObject Base; + + DECLARE_INFO; + + static JSC::Structure* createStructure(JSC::VM& vm, JSC::JSGlobalObject* globalObject, JSC::JSValue prototype) + { + return JSC::Structure::create(vm, globalObject, prototype, JSC::TypeInfo(JSC::ObjectType, StructureFlags), info()); + } + + static JSInjectedScriptHost* create(JSC::VM& vm, JSC::Structure* structure, PassRefPtr impl) + { + JSInjectedScriptHost* instance = new (NotNull, JSC::allocateCell(vm.heap)) JSInjectedScriptHost(vm, structure, impl); + instance->finishCreation(vm); + return instance; + } + + static JSC::JSObject* createPrototype(JSC::VM&, JSC::JSGlobalObject*); + static void destroy(JSC::JSCell*); + + InjectedScriptHost& impl() const { return *m_impl; } + void releaseImpl(); + + // Attributes. + JSC::JSValue evaluate(JSC::ExecState*) const; + + // Functions. + JSC::JSValue internalConstructorName(JSC::ExecState*); + JSC::JSValue isHTMLAllCollection(JSC::ExecState*); + JSC::JSValue type(JSC::ExecState*); + JSC::JSValue functionDetails(JSC::ExecState*); + JSC::JSValue getInternalProperties(JSC::ExecState*); + +protected: + static const unsigned StructureFlags = JSC::OverridesGetOwnPropertySlot | JSC::InterceptsGetOwnPropertySlotByIndexEvenWhenLengthIsNotZero | Base::StructureFlags; + + void finishCreation(JSC::VM&); + +private: + JSInjectedScriptHost(JSC::VM&, JSC::Structure*, PassRefPtr); + ~JSInjectedScriptHost(); + + InjectedScriptHost* m_impl; +}; + +JSC::JSValue toJS(JSC::ExecState*, JSC::JSGlobalObject*, InjectedScriptHost*); +JSInjectedScriptHost* toJSInjectedScriptHost(JSC::JSValue); + +} // namespace Inspector + +#endif // ENABLE(INSPECTOR) + +#endif // !defined(JSInjectedScriptHost_h) diff --git a/JavaScriptCore/inspector/JSInjectedScriptHostPrototype.cpp b/JavaScriptCore/inspector/JSInjectedScriptHostPrototype.cpp new file mode 100644 index 00000000..12c7a502 --- /dev/null +++ b/JavaScriptCore/inspector/JSInjectedScriptHostPrototype.cpp @@ -0,0 +1,140 @@ +/* + * Copyright (C) 2013 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 "JSInjectedScriptHostPrototype.h" + +#if ENABLE(INSPECTOR) + +#include "Error.h" +#include "GetterSetter.h" +#include "Identifier.h" +#include "InjectedScriptHost.h" +#include "JSCJSValueInlines.h" +#include "JSFunction.h" +#include "JSInjectedScriptHost.h" + +using namespace JSC; + +namespace Inspector { + +static EncodedJSValue JSC_HOST_CALL jsInjectedScriptHostPrototypeFunctionType(ExecState*); +static EncodedJSValue JSC_HOST_CALL jsInjectedScriptHostPrototypeFunctionFunctionDetails(ExecState*); +static EncodedJSValue JSC_HOST_CALL jsInjectedScriptHostPrototypeFunctionGetInternalProperties(ExecState*); +static EncodedJSValue JSC_HOST_CALL jsInjectedScriptHostPrototypeFunctionInternalConstructorName(ExecState*); +static EncodedJSValue JSC_HOST_CALL jsInjectedScriptHostPrototypeFunctionIsHTMLAllCollection(ExecState*); + +static EncodedJSValue JSC_HOST_CALL jsInjectedScriptHostPrototypeAttributeEvaluate(ExecState*); + +const ClassInfo JSInjectedScriptHostPrototype::s_info = { "InjectedScriptHost", &Base::s_info, 0, 0, CREATE_METHOD_TABLE(JSInjectedScriptHostPrototype) }; + +void JSInjectedScriptHostPrototype::finishCreation(VM& vm, JSGlobalObject* globalObject) +{ + Base::finishCreation(vm); + ASSERT(inherits(info())); + vm.prototypeMap.addPrototype(this); + + JSC_NATIVE_FUNCTION("type", jsInjectedScriptHostPrototypeFunctionType, DontEnum, 1); + JSC_NATIVE_FUNCTION("functionDetails", jsInjectedScriptHostPrototypeFunctionFunctionDetails, DontEnum, 1); + JSC_NATIVE_FUNCTION("getInternalProperties", jsInjectedScriptHostPrototypeFunctionGetInternalProperties, DontEnum, 1); + JSC_NATIVE_FUNCTION("internalConstructorName", jsInjectedScriptHostPrototypeFunctionInternalConstructorName, DontEnum, 1); + JSC_NATIVE_FUNCTION("isHTMLAllCollection", jsInjectedScriptHostPrototypeFunctionIsHTMLAllCollection, DontEnum, 1); + + Identifier evaluateIdentifier(&vm, "evaluate"); + GetterSetter* accessor = GetterSetter::create(vm); + JSFunction* function = JSFunction::create(vm, globalObject, 0, evaluateIdentifier.string(), jsInjectedScriptHostPrototypeAttributeEvaluate); + accessor->setGetter(vm, function); + putDirectNonIndexAccessor(vm, evaluateIdentifier, accessor, DontEnum | Accessor); +} + +EncodedJSValue JSC_HOST_CALL jsInjectedScriptHostPrototypeAttributeEvaluate(ExecState* exec) +{ + JSValue thisValue = exec->hostThisValue(); + JSInjectedScriptHost* castedThis = jsDynamicCast(thisValue); + if (!castedThis) + return throwVMTypeError(exec); + + ASSERT_GC_OBJECT_INHERITS(castedThis, JSInjectedScriptHost::info()); + return JSValue::encode(castedThis->evaluate(exec)); +} + +EncodedJSValue JSC_HOST_CALL jsInjectedScriptHostPrototypeFunctionInternalConstructorName(ExecState* exec) +{ + JSValue thisValue = exec->hostThisValue(); + JSInjectedScriptHost* castedThis = jsDynamicCast(thisValue); + if (!castedThis) + return throwVMTypeError(exec); + + ASSERT_GC_OBJECT_INHERITS(castedThis, JSInjectedScriptHost::info()); + return JSValue::encode(castedThis->internalConstructorName(exec)); +} + +EncodedJSValue JSC_HOST_CALL jsInjectedScriptHostPrototypeFunctionIsHTMLAllCollection(ExecState* exec) +{ + JSValue thisValue = exec->hostThisValue(); + JSInjectedScriptHost* castedThis = jsDynamicCast(thisValue); + if (!castedThis) + return throwVMTypeError(exec); + + ASSERT_GC_OBJECT_INHERITS(castedThis, JSInjectedScriptHost::info()); + return JSValue::encode(castedThis->isHTMLAllCollection(exec)); +} + +EncodedJSValue JSC_HOST_CALL jsInjectedScriptHostPrototypeFunctionType(ExecState* exec) +{ + JSValue thisValue = exec->hostThisValue(); + JSInjectedScriptHost* castedThis = jsDynamicCast(thisValue); + if (!castedThis) + return throwVMTypeError(exec); + + ASSERT_GC_OBJECT_INHERITS(castedThis, JSInjectedScriptHost::info()); + return JSValue::encode(castedThis->type(exec)); +} + +EncodedJSValue JSC_HOST_CALL jsInjectedScriptHostPrototypeFunctionFunctionDetails(ExecState* exec) +{ + JSValue thisValue = exec->hostThisValue(); + JSInjectedScriptHost* castedThis = jsDynamicCast(thisValue); + if (!castedThis) + return throwVMTypeError(exec); + + ASSERT_GC_OBJECT_INHERITS(castedThis, JSInjectedScriptHost::info()); + return JSValue::encode(castedThis->functionDetails(exec)); +} + +EncodedJSValue JSC_HOST_CALL jsInjectedScriptHostPrototypeFunctionGetInternalProperties(ExecState* exec) +{ + JSValue thisValue = exec->hostThisValue(); + JSInjectedScriptHost* castedThis = jsDynamicCast(thisValue); + if (!castedThis) + return throwVMTypeError(exec); + + ASSERT_GC_OBJECT_INHERITS(castedThis, JSInjectedScriptHost::info()); + return JSValue::encode(castedThis->getInternalProperties(exec)); +} + +} // namespace Inspector + +#endif // ENABLE(INSPECTOR) diff --git a/JavaScriptCore/inspector/JSInjectedScriptHostPrototype.h b/JavaScriptCore/inspector/JSInjectedScriptHostPrototype.h new file mode 100644 index 00000000..9d0b7b66 --- /dev/null +++ b/JavaScriptCore/inspector/JSInjectedScriptHostPrototype.h @@ -0,0 +1,68 @@ +/* + * Copyright (C) 2013 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. + */ + +#ifndef JSInjectedScriptHostPrototype_h +#define JSInjectedScriptHostPrototype_h + +#if ENABLE(INSPECTOR) + +#include "JSObject.h" + +namespace Inspector { + +class JSInjectedScriptHostPrototype : public JSC::JSNonFinalObject { +public: + typedef JSC::JSNonFinalObject Base; + + DECLARE_INFO; + + static JSInjectedScriptHostPrototype* create(JSC::VM& vm, JSC::JSGlobalObject* globalObject, JSC::Structure* structure) + { + JSInjectedScriptHostPrototype* ptr = new (NotNull, JSC::allocateCell(vm.heap)) JSInjectedScriptHostPrototype(vm, globalObject, structure); + ptr->finishCreation(vm, globalObject); + return ptr; + } + + static JSC::Structure* createStructure(JSC::VM& vm, JSC::JSGlobalObject* globalObject, JSC::JSValue prototype) + { + return JSC::Structure::create(vm, globalObject, prototype, JSC::TypeInfo(JSC::ObjectType, StructureFlags), info()); + } + +protected: + static const unsigned StructureFlags = JSC::OverridesGetOwnPropertySlot | Base::StructureFlags; + +private: + JSInjectedScriptHostPrototype(JSC::VM& vm, JSC::JSGlobalObject*, JSC::Structure* structure) + : JSC::JSNonFinalObject(vm, structure) + { + } + void finishCreation(JSC::VM&, JSC::JSGlobalObject*); +}; + +} // namespace Inspector + +#endif // ENABLE(INSPECTOR) + +#endif // !defined(JSInjectedScriptHostPrototype_h) diff --git a/JavaScriptCore/inspector/agents/InspectorAgent.cpp b/JavaScriptCore/inspector/agents/InspectorAgent.cpp new file mode 100644 index 00000000..69ba5eb3 --- /dev/null +++ b/JavaScriptCore/inspector/agents/InspectorAgent.cpp @@ -0,0 +1,110 @@ +/* + * Copyright (C) 2007, 2008, 2009, 2010 Apple Inc. All rights reserved. + * Copyright (C) 2008 Matt Lilek + * Copyright (C) 2011 Google 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. + * 3. Neither the name of Apple Computer, Inc. ("Apple") nor the names of + * its contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY APPLE 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 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. + */ + +#include "config.h" +#include "InspectorAgent.h" + +#if ENABLE(INSPECTOR) + +#include "InspectorValues.h" +#include "ScriptValue.h" +#include +#include + +namespace Inspector { + +InspectorAgent::InspectorAgent() + : InspectorAgentBase(ASCIILiteral("Inspector")) + , m_enabled(false) +{ +} + +InspectorAgent::~InspectorAgent() +{ +} + +void InspectorAgent::didCreateFrontendAndBackend(InspectorFrontendChannel* frontendChannel, InspectorBackendDispatcher* backendDispatcher) +{ + m_frontendDispatcher = std::make_unique(frontendChannel); + m_backendDispatcher = InspectorInspectorBackendDispatcher::create(backendDispatcher, this); +} + +void InspectorAgent::willDestroyFrontendAndBackend() +{ + m_frontendDispatcher = nullptr; + m_backendDispatcher.clear(); + + m_pendingEvaluateTestCommands.clear(); + + ErrorString error; + disable(&error); +} + +void InspectorAgent::enable(ErrorString*) +{ + m_enabled = true; + + if (m_pendingInspectData.first) + inspect(m_pendingInspectData.first, m_pendingInspectData.second); + + for (Vector>::iterator it = m_pendingEvaluateTestCommands.begin(); m_frontendDispatcher && it != m_pendingEvaluateTestCommands.end(); ++it) + m_frontendDispatcher->evaluateForTestInFrontend(static_cast((*it).first), (*it).second); + m_pendingEvaluateTestCommands.clear(); +} + +void InspectorAgent::disable(ErrorString*) +{ + m_enabled = false; +} + +void InspectorAgent::inspect(PassRefPtr objectToInspect, PassRefPtr hints) +{ + if (m_enabled && m_frontendDispatcher) { + m_frontendDispatcher->inspect(objectToInspect, hints); + m_pendingInspectData.first = nullptr; + m_pendingInspectData.second = nullptr; + return; + } + + m_pendingInspectData.first = objectToInspect; + m_pendingInspectData.second = hints; +} + +void InspectorAgent::evaluateForTestInFrontend(long callId, const String& script) +{ + if (m_enabled && m_frontendDispatcher) + m_frontendDispatcher->evaluateForTestInFrontend(static_cast(callId), script); + else + m_pendingEvaluateTestCommands.append(std::pair(callId, script)); +} + +} // namespace Inspector + +#endif // ENABLE(INSPECTOR) diff --git a/JavaScriptCore/inspector/agents/InspectorAgent.h b/JavaScriptCore/inspector/agents/InspectorAgent.h new file mode 100644 index 00000000..fa859cfc --- /dev/null +++ b/JavaScriptCore/inspector/agents/InspectorAgent.h @@ -0,0 +1,72 @@ +/* + * Copyright (C) 2007, 2008, 2009, 2010 Apple Inc. All rights reserved. + * Copyright (C) 2011 Google 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. + * 3. Neither the name of Apple Computer, Inc. ("Apple") nor the names of + * its contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY APPLE 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 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. + */ + +#ifndef InspectorAgent_h +#define InspectorAgent_h + +#include "InspectorJSBackendDispatchers.h" +#include "InspectorJSFrontendDispatchers.h" +#include "inspector/InspectorAgentBase.h" +#include +#include +#include + +namespace Inspector { + +class InspectorObject; +class InstrumentingAgents; + +typedef String ErrorString; + +class JS_EXPORT_PRIVATE InspectorAgent FINAL : public InspectorAgentBase, public InspectorInspectorBackendDispatcherHandler { + WTF_MAKE_NONCOPYABLE(InspectorAgent); +public: + InspectorAgent(); + virtual ~InspectorAgent(); + + virtual void didCreateFrontendAndBackend(InspectorFrontendChannel*, InspectorBackendDispatcher*) OVERRIDE; + virtual void willDestroyFrontendAndBackend() OVERRIDE; + + virtual void enable(ErrorString*) OVERRIDE; + virtual void disable(ErrorString*) OVERRIDE; + + void inspect(PassRefPtr objectToInspect, PassRefPtr hints); + void evaluateForTestInFrontend(long testCallId, const String& script); + +private: + std::unique_ptr m_frontendDispatcher; + RefPtr m_backendDispatcher; + Vector> m_pendingEvaluateTestCommands; + std::pair, RefPtr> m_pendingInspectData; + bool m_enabled; +}; + +} // namespace Inspector + +#endif // !defined(InspectorAgent_h) diff --git a/JavaScriptCore/inspector/protocol/Debugger.json b/JavaScriptCore/inspector/protocol/Debugger.json new file mode 100644 index 00000000..f1d957b7 --- /dev/null +++ b/JavaScriptCore/inspector/protocol/Debugger.json @@ -0,0 +1,278 @@ +{ + "domain": "Debugger", + "description": "Debugger domain exposes JavaScript debugging capabilities. It allows setting and removing breakpoints, stepping through execution, exploring stack traces, etc.", + "types": [ + { + "id": "BreakpointId", + "type": "string", + "description": "Breakpoint identifier." + }, + { + "id": "ScriptId", + "type": "string", + "description": "Unique script identifier." + }, + { + "id": "CallFrameId", + "type": "string", + "description": "Call frame identifier." + }, + { + "id": "Location", + "type": "object", + "properties": [ + { "name": "scriptId", "$ref": "ScriptId", "description": "Script identifier as reported in the Debugger.scriptParsed." }, + { "name": "lineNumber", "type": "integer", "description": "Line number in the script." }, + { "name": "columnNumber", "type": "integer", "optional": true, "description": "Column number in the script." } + ], + "description": "Location in the source code." + }, + { + "id": "BreakpointAction", + "type": "object", + "properties": [ + { "name": "type", "type": "string", "enum": ["log", "evaluate", "sound"], "description": "Different kinds of breakpoint actions." }, + { "name": "data", "type": "string", "optional": true, "description": "Data associated with this breakpoint type (e.g. for type \"eval\" this is the JavaScript string to evalulate)." } + ], + "description": "Action to perform when a breakpoint is triggered." + }, + { + "id": "BreakpointOptions", + "type": "object", + "properties": [ + { "name": "condition", "type": "string", "optional": true, "description": "Expression to use as a breakpoint condition. When specified, debugger will only stop on the breakpoint if this expression evaluates to true." }, + { "name": "actions", "type": "array", "optional": true, "items": { "$ref": "BreakpointAction" }, "description": "Actions to perform automatically when the breakpoint is triggered." }, + { "name": "autoContinue", "type": "boolean", "optional": true, "description": "Automatically continue after hitting this breakpoint and running actions." } + ], + "description": "Extra options that modify breakpoint behavior." + }, + { + "id": "FunctionDetails", + "type": "object", + "properties": [ + { "name": "location", "$ref": "Location", "description": "Location of the function." }, + { "name": "name", "type": "string", "optional": true, "description": "Name of the function. Not present for anonymous functions." }, + { "name": "displayName", "type": "string", "optional": true, "description": "Display name of the function(specified in 'displayName' property on the function object)." }, + { "name": "inferredName", "type": "string", "optional": true, "description": "Name of the function inferred from its initial assignment." }, + { "name": "scopeChain", "type": "array", "optional": true, "items": { "$ref": "Scope" }, "description": "Scope chain for this closure." } + ], + "description": "Information about the function." + }, + { + "id": "CallFrame", + "type": "object", + "properties": [ + { "name": "callFrameId", "$ref": "CallFrameId", "description": "Call frame identifier. This identifier is only valid while the virtual machine is paused." }, + { "name": "functionName", "type": "string", "description": "Name of the JavaScript function called on this call frame." }, + { "name": "location", "$ref": "Location", "description": "Location in the source code." }, + { "name": "scopeChain", "type": "array", "items": { "$ref": "Scope" }, "description": "Scope chain for this call frame." }, + { "name": "this", "$ref": "Runtime.RemoteObject", "description": "this object for this call frame." } + ], + "description": "JavaScript call frame. Array of call frames form the call stack." + }, + { + "id": "Scope", + "type": "object", + "properties": [ + { "name": "type", "type": "string", "enum": ["global", "local", "with", "closure", "catch"], "description": "Scope type." }, + { "name": "object", "$ref": "Runtime.RemoteObject", "description": "Object representing the scope. For global and with scopes it represents the actual object; for the rest of the scopes, it is artificial transient object enumerating scope variables as its properties." } + ], + "description": "Scope description." + } + ], + "commands": [ + { + "name": "enable", + "description": "Enables debugger for the given page. Clients should not assume that the debugging has been enabled until the result for this command is received." + }, + { + "name": "disable", + "description": "Disables debugger for given page." + }, + { + "name": "setBreakpointsActive", + "parameters": [ + { "name": "active", "type": "boolean", "description": "New value for breakpoints active state." } + ], + "description": "Activates / deactivates all breakpoints on the page." + }, + { + "name": "setBreakpointByUrl", + "parameters": [ + { "name": "lineNumber", "type": "integer", "description": "Line number to set breakpoint at." }, + { "name": "url", "type": "string", "optional": true, "description": "URL of the resources to set breakpoint on." }, + { "name": "urlRegex", "type": "string", "optional": true, "description": "Regex pattern for the URLs of the resources to set breakpoints on. Either url or urlRegex must be specified." }, + { "name": "columnNumber", "type": "integer", "optional": true, "description": "Offset in the line to set breakpoint at." }, + { "name": "options", "$ref": "BreakpointOptions", "optional": true, "description": "Options to apply to this breakpoint to modify its behavior." } + ], + "returns": [ + { "name": "breakpointId", "$ref": "BreakpointId", "description": "Id of the created breakpoint for further reference." }, + { "name": "locations", "type": "array", "items": { "$ref": "Location"}, "description": "List of the locations this breakpoint resolved into upon addition." } + ], + "description": "Sets JavaScript breakpoint at given location specified either by URL or URL regex. Once this command is issued, all existing parsed scripts will have breakpoints resolved and returned in locations property. Further matching script parsing will result in subsequent breakpointResolved events issued. This logical breakpoint will survive page reloads." + }, + { + "name": "setBreakpoint", + "parameters": [ + { "name": "location", "$ref": "Location", "description": "Location to set breakpoint in." }, + { "name": "options", "$ref": "BreakpointOptions", "optional": true, "description": "Options to apply to this breakpoint to modify its behavior." } + ], + "returns": [ + { "name": "breakpointId", "$ref": "BreakpointId", "description": "Id of the created breakpoint for further reference." }, + { "name": "actualLocation", "$ref": "Location", "description": "Location this breakpoint resolved into." } + ], + "description": "Sets JavaScript breakpoint at a given location." + }, + { + "name": "removeBreakpoint", + "parameters": [ + { "name": "breakpointId", "$ref": "BreakpointId" } + ], + "description": "Removes JavaScript breakpoint." + }, + { + "name": "continueToLocation", + "parameters": [ + { "name": "location", "$ref": "Location", "description": "Location to continue to." } + ], + "description": "Continues execution until specific location is reached." + }, + { + "name": "stepOver", + "description": "Steps over the statement." + }, + { + "name": "stepInto", + "description": "Steps into the function call." + }, + { + "name": "stepOut", + "description": "Steps out of the function call." + }, + { + "name": "pause", + "description": "Stops on the next JavaScript statement." + }, + { + "name": "resume", + "description": "Resumes JavaScript execution." + }, + { + "name": "searchInContent", + "parameters": [ + { "name": "scriptId", "$ref": "ScriptId", "description": "Id of the script to search in." }, + { "name": "query", "type": "string", "description": "String to search for." }, + { "name": "caseSensitive", "type": "boolean", "optional": true, "description": "If true, search is case sensitive." }, + { "name": "isRegex", "type": "boolean", "optional": true, "description": "If true, treats string parameter as regex." } + ], + "returns": [ + { "name": "result", "type": "array", "items": { "$ref": "GenericTypes.SearchMatch" }, "description": "List of search matches." } + ], + "description": "Searches for given string in script content." + }, + { + "name": "getScriptSource", + "parameters": [ + { "name": "scriptId", "$ref": "ScriptId", "description": "Id of the script to get source for." } + ], + "returns": [ + { "name": "scriptSource", "type": "string", "description": "Script source." } + ], + "description": "Returns source for the script with given id." + }, + { + "name": "getFunctionDetails", + "parameters": [ + { "name": "functionId", "$ref": "Runtime.RemoteObjectId", "description": "Id of the function to get location for." } + ], + "returns": [ + { "name": "details", "$ref": "FunctionDetails", "description": "Information about the function." } + ], + "description": "Returns detailed informtation on given function." + }, + { + "name": "setPauseOnExceptions", + "parameters": [ + { "name": "state", "type": "string", "enum": ["none", "uncaught", "all"], "description": "Pause on exceptions mode." } + ], + "description": "Defines pause on exceptions state. Can be set to stop on all exceptions, uncaught exceptions or no exceptions. Initial pause on exceptions state is none." + }, + { + "name": "evaluateOnCallFrame", + "parameters": [ + { "name": "callFrameId", "$ref": "CallFrameId", "description": "Call frame identifier to evaluate on." }, + { "name": "expression", "type": "string", "description": "Expression to evaluate." }, + { "name": "objectGroup", "type": "string", "optional": true, "description": "String object group name to put result into (allows rapid releasing resulting object handles using releaseObjectGroup)." }, + { "name": "includeCommandLineAPI", "type": "boolean", "optional": true, "description": "Specifies whether command line API should be available to the evaluated expression, defaults to false." }, + { "name": "doNotPauseOnExceptionsAndMuteConsole", "type": "boolean", "optional": true, "description": "Specifies whether evaluation should stop on exceptions and mute console. Overrides setPauseOnException state." }, + { "name": "returnByValue", "type": "boolean", "optional": true, "description": "Whether the result is expected to be a JSON object that should be sent by value." }, + { "name": "generatePreview", "type": "boolean", "optional": true, "description": "Whether preview should be generated for the result." } + ], + "returns": [ + { "name": "result", "$ref": "Runtime.RemoteObject", "description": "Object wrapper for the evaluation result." }, + { "name": "wasThrown", "type": "boolean", "optional": true, "description": "True if the result was thrown during the evaluation." } + ], + "description": "Evaluates expression on a given call frame." + }, + { + "name": "setOverlayMessage", + "parameters": [ + { "name": "message", "type": "string", "optional": true, "description": "Overlay message to display when paused in debugger." } + ], + "description": "Sets overlay message." + } + ], + "events": [ + { + "name": "globalObjectCleared", + "description": "Called when global has been cleared and debugger client should reset its state. Happens upon navigation or reload." + }, + { + "name": "scriptParsed", + "parameters": [ + { "name": "scriptId", "$ref": "ScriptId", "description": "Identifier of the script parsed." }, + { "name": "url", "type": "string", "description": "URL or name of the script parsed (if any)." }, + { "name": "startLine", "type": "integer", "description": "Line offset of the script within the resource with given URL (for script tags)." }, + { "name": "startColumn", "type": "integer", "description": "Column offset of the script within the resource with given URL." }, + { "name": "endLine", "type": "integer", "description": "Last line of the script." }, + { "name": "endColumn", "type": "integer", "description": "Length of the last line of the script." }, + { "name": "isContentScript", "type": "boolean", "optional": true, "description": "Determines whether this script is a user extension script." }, + { "name": "sourceMapURL", "type": "string", "optional": true, "description": "URL of source map associated with script (if any)." }, + { "name": "hasSourceURL", "type": "boolean", "optional": true, "description": "True, if this script has sourceURL." } + ], + "description": "Fired when virtual machine parses script. This event is also fired for all known and uncollected scripts upon enabling debugger." + }, + { + "name": "scriptFailedToParse", + "parameters": [ + { "name": "url", "type": "string", "description": "URL of the script that failed to parse." }, + { "name": "scriptSource", "type": "string", "description": "Source text of the script that failed to parse." }, + { "name": "startLine", "type": "integer", "description": "Line offset of the script within the resource." }, + { "name": "errorLine", "type": "integer", "description": "Line with error." }, + { "name": "errorMessage", "type": "string", "description": "Parse error message." } + ], + "description": "Fired when virtual machine fails to parse the script." + }, + { + "name": "breakpointResolved", + "parameters": [ + { "name": "breakpointId", "$ref": "BreakpointId", "description": "Breakpoint unique identifier." }, + { "name": "location", "$ref": "Location", "description": "Actual breakpoint location." } + ], + "description": "Fired when breakpoint is resolved to an actual script and location." + }, + { + "name": "paused", + "parameters": [ + { "name": "callFrames", "type": "array", "items": { "$ref": "CallFrame" }, "description": "Call stack the virtual machine stopped on." }, + { "name": "reason", "type": "string", "enum": [ "XHR", "DOM", "EventListener", "exception", "assert", "CSPViolation", "other" ], "description": "Pause reason." }, + { "name": "data", "type": "object", "optional": true, "description": "Object containing break-specific auxiliary properties." } + ], + "description": "Fired when the virtual machine stopped on breakpoint or exception or any other stop criteria." + }, + { + "name": "resumed", + "description": "Fired when the virtual machine resumed execution." + } + ] +} diff --git a/JavaScriptCore/inspector/protocol/GenericTypes.json b/JavaScriptCore/inspector/protocol/GenericTypes.json new file mode 100644 index 00000000..1a61257b --- /dev/null +++ b/JavaScriptCore/inspector/protocol/GenericTypes.json @@ -0,0 +1,15 @@ +{ + "domain": "GenericTypes", + "description": "Exposes generic types to be used by any domain.", + "types": [ + { + "id": "SearchMatch", + "type": "object", + "description": "Search match in a resource.", + "properties": [ + { "name": "lineNumber", "type": "number", "description": "Line number in resource content." }, + { "name": "lineContent", "type": "string", "description": "Line with match content." } + ] + } + ] +} diff --git a/JavaScriptCore/inspector/protocol/InspectorDomain.json b/JavaScriptCore/inspector/protocol/InspectorDomain.json new file mode 100644 index 00000000..83a21302 --- /dev/null +++ b/JavaScriptCore/inspector/protocol/InspectorDomain.json @@ -0,0 +1,41 @@ +{ + "domain": "Inspector", + "types": [], + "commands": [ + { + "name": "enable", + "description": "Enables inspector domain notifications." + }, + { + "name": "disable", + "description": "Disables inspector domain notifications." + } + ], + "events": [ + { + "name": "evaluateForTestInFrontend", + "parameters": [ + { "name": "testCallId", "type": "integer" }, + { "name": "script", "type": "string" } + ] + }, + { + "name": "inspect", + "parameters": [ + { "name": "object", "$ref": "Runtime.RemoteObject" }, + { "name": "hints", "type": "object" } + ] + }, + { + "name": "detached", + "description": "Fired when remote debugging connection is about to be terminated. Contains detach reason.", + "parameters": [ + { "name": "reason", "type": "string", "description": "The reason why connection has been terminated." } + ] + }, + { + "name": "targetCrashed", + "description": "Fired when debugging target has crashed" + } + ] +} diff --git a/JavaScriptCore/inspector/protocol/Runtime.json b/JavaScriptCore/inspector/protocol/Runtime.json new file mode 100644 index 00000000..f7bf133b --- /dev/null +++ b/JavaScriptCore/inspector/protocol/Runtime.json @@ -0,0 +1,210 @@ +{ + "domain": "Runtime", + "description": "Runtime domain exposes JavaScript runtime by means of remote evaluation and mirror objects. Evaluation results are returned as mirror object that expose object type, string representation and unique identifier that can be used for further object reference. Original objects are maintained in memory unless they are either explicitly released or are released along with the other objects in their object group.", + "types": [ + { + "id": "RemoteObjectId", + "type": "string", + "description": "Unique object identifier." + }, + { + "id": "RemoteObject", + "type": "object", + "description": "Mirror object referencing original JavaScript object.", + "properties": [ + { "name": "type", "type": "string", "enum": ["object", "function", "undefined", "string", "number", "boolean"], "description": "Object type." }, + { "name": "subtype", "type": "string", "optional": true, "enum": ["array", "null", "node", "regexp", "date"], "description": "Object subtype hint. Specified for object type values only." }, + { "name": "className", "type": "string", "optional": true, "description": "Object class (constructor) name. Specified for object type values only." }, + { "name": "value", "type": "any", "optional": true, "description": "Remote object value (in case of primitive values or JSON values if it was requested)." }, + { "name": "description", "type": "string", "optional": true, "description": "String representation of the object." }, + { "name": "objectId", "$ref": "RemoteObjectId", "optional": true, "description": "Unique object identifier (for non-primitive values)." }, + { "name": "preview", "$ref": "ObjectPreview", "optional": true, "description": "Preview containsing abbreviated property values." } + ] + }, + { + "id": "ObjectPreview", + "type": "object", + "description": "Object containing abbreviated remote object value.", + "properties": [ + { "name": "lossless", "type": "boolean", "description": "Determines whether preview is lossless (contains all information of the original object)." }, + { "name": "overflow", "type": "boolean", "description": "True iff some of the properties of the original did not fit." }, + { "name": "properties", "type": "array", "items": { "$ref": "PropertyPreview" }, "description": "List of the properties." } + ] + }, + { + "id": "PropertyPreview", + "type": "object", + "properties": [ + { "name": "name", "type": "string", "description": "Property name." }, + { "name": "type", "type": "string", "enum": ["object", "function", "undefined", "string", "number", "boolean"], "description": "Object type." }, + { "name": "value", "type": "string", "optional": true, "description": "User-friendly property value string." }, + { "name": "valuePreview", "$ref": "ObjectPreview", "optional": true, "description": "Nested value preview." }, + { "name": "subtype", "type": "string", "optional": true, "enum": ["array", "null", "node", "regexp", "date"], "description": "Object subtype hint. Specified for object type values only." } + ] + }, + { + "id": "PropertyDescriptor", + "type": "object", + "description": "Object property descriptor.", + "properties": [ + { "name": "name", "type": "string", "description": "Property name." }, + { "name": "value", "$ref": "RemoteObject", "optional": true, "description": "The value associated with the property." }, + { "name": "writable", "type": "boolean", "optional": true, "description": "True if the value associated with the property may be changed (data descriptors only)." }, + { "name": "get", "$ref": "RemoteObject", "optional": true, "description": "A function which serves as a getter for the property, or undefined if there is no getter (accessor descriptors only)." }, + { "name": "set", "$ref": "RemoteObject", "optional": true, "description": "A function which serves as a setter for the property, or undefined if there is no setter (accessor descriptors only)." }, + { "name": "configurable", "type": "boolean", "description": "True if the type of this property descriptor may be changed and if the property may be deleted from the corresponding object." }, + { "name": "enumerable", "type": "boolean", "description": "True if this property shows up during enumeration of the properties on the corresponding object." }, + { "name": "wasThrown", "type": "boolean", "optional": true, "description": "True if the result was thrown during the evaluation." }, + { "name": "isOwn", "optional": true, "type": "boolean", "description": "True if the property is owned for the object." } + ] + }, + { + "id": "InternalPropertyDescriptor", + "type": "object", + "description": "Object internal property descriptor. This property isn't normally visible in JavaScript code.", + "properties": [ + { "name": "name", "type": "string", "description": "Conventional property name." }, + { "name": "value", "$ref": "RemoteObject", "optional": true, "description": "The value associated with the property." } + ] + }, + { + "id": "CallArgument", + "type": "object", + "description": "Represents function call argument. Either remote object id objectId or primitive value or neither of (for undefined) them should be specified.", + "properties": [ + { "name": "value", "type": "any", "optional": true, "description": "Primitive value." }, + { "name": "objectId", "$ref": "RemoteObjectId", "optional": true, "description": "Remote object handle." } + ] + }, + { + "id": "ExecutionContextId", + "type": "integer", + "description": "Id of an execution context." + }, + { + "id": "RuntimeFrameId", + "type": "string", + "description": "Unique frame identifier. FIXME: Duplicate of Network.FrameId Web Inspector: FIX Type Dependency Issues" + }, + { + "id": "ExecutionContextDescription", + "type": "object", + "description": "Description of an isolated world.", + "properties": [ + { "name": "id", "$ref": "ExecutionContextId", "description": "Unique id of the execution context. It can be used to specify in which execution context script evaluation should be performed." }, + { "name": "isPageContext", "type": "boolean", "description": "True if this is a context where inpspected web page scripts run. False if it is a content script isolated context." }, + { "name": "name", "type": "string", "description": "Human readable name describing given context."}, + { "name": "frameId", "$ref": "RuntimeFrameId", "description": "Id of the owning frame." } + ] + }, + { + "id": "SyntaxErrorType", + "type": "string", + "enum": ["none", "irrecoverable", "unterminated-literal", "recoverable"], + "description": "Syntax error type: \"none\" for no error, \"irrecoverable\" for unrecoverable errors, \"unterminated-literal\" for when there is an unterminated literal, \"recoverable\" for when the expression is unfinished but valid so far." + }, + { + "id": "ErrorRange", + "type": "object", + "description": "Range of an error in source code.", + "properties": [ + { "name": "startOffset", "type": "integer", "description": "Start offset of range (inclusive)." }, + { "name": "endOffset", "type": "integer", "description": "End offset of range (exclusive)." } + ] + } + ], + "commands": [ + { + "name": "parse", + "parameters": [ + { "name": "source", "type": "string", "description": "Source code to parse." } + ], + "returns": [ + { "name": "result", "$ref": "SyntaxErrorType", "description": "Parse result." }, + { "name": "message", "type": "string", "optional": true, "description": "Parse error message." }, + { "name": "range", "$ref": "ErrorRange", "optional": true, "description": "Range in the source where the error occurred." } + ], + "description": "Parses JavaScript source code for errors." + }, + { + "name": "evaluate", + "parameters": [ + { "name": "expression", "type": "string", "description": "Expression to evaluate." }, + { "name": "objectGroup", "type": "string", "optional": true, "description": "Symbolic group name that can be used to release multiple objects." }, + { "name": "includeCommandLineAPI", "type": "boolean", "optional": true, "description": "Determines whether Command Line API should be available during the evaluation." }, + { "name": "doNotPauseOnExceptionsAndMuteConsole", "type": "boolean", "optional": true, "description": "Specifies whether evaluation should stop on exceptions and mute console. Overrides setPauseOnException state." }, + { "name": "contextId", "$ref": "Runtime.ExecutionContextId", "optional": true, "description": "Specifies in which isolated context to perform evaluation. Each content script lives in an isolated context and this parameter may be used to specify one of those contexts. If the parameter is omitted or 0 the evaluation will be performed in the context of the inspected page." }, + { "name": "returnByValue", "type": "boolean", "optional": true, "description": "Whether the result is expected to be a JSON object that should be sent by value." }, + { "name": "generatePreview", "type": "boolean", "optional": true, "description": "Whether preview should be generated for the result." } + ], + "returns": [ + { "name": "result", "$ref": "RemoteObject", "description": "Evaluation result." }, + { "name": "wasThrown", "type": "boolean", "optional": true, "description": "True if the result was thrown during the evaluation." } + ], + "description": "Evaluates expression on global object." + }, + { + "name": "callFunctionOn", + "parameters": [ + { "name": "objectId", "$ref": "RemoteObjectId", "description": "Identifier of the object to call function on." }, + { "name": "functionDeclaration", "type": "string", "description": "Declaration of the function to call." }, + { "name": "arguments", "type": "array", "items": { "$ref": "CallArgument", "description": "Call argument." }, "optional": true, "description": "Call arguments. All call arguments must belong to the same JavaScript world as the target object." }, + { "name": "doNotPauseOnExceptionsAndMuteConsole", "type": "boolean", "optional": true, "description": "Specifies whether function call should stop on exceptions and mute console. Overrides setPauseOnException state." }, + { "name": "returnByValue", "type": "boolean", "optional": true, "description": "Whether the result is expected to be a JSON object which should be sent by value." }, + { "name": "generatePreview", "type": "boolean", "optional": true, "description": "Whether preview should be generated for the result." } + ], + "returns": [ + { "name": "result", "$ref": "RemoteObject", "description": "Call result." }, + { "name": "wasThrown", "type": "boolean", "optional": true, "description": "True if the result was thrown during the evaluation." } + ], + "description": "Calls function with given declaration on the given object. Object group of the result is inherited from the target object." + }, + { + "name": "getProperties", + "parameters": [ + { "name": "objectId", "$ref": "RemoteObjectId", "description": "Identifier of the object to return properties for." }, + { "name": "ownProperties", "optional": true, "type": "boolean", "description": "If true, returns properties belonging only to the element itself, not to its prototype chain." } + ], + "returns": [ + { "name": "result", "type": "array", "items": { "$ref": "PropertyDescriptor"}, "description": "Object properties." }, + { "name": "internalProperties", "optional": true, "type": "array", "items": { "$ref": "InternalPropertyDescriptor"}, "description": "Internal object properties." } + ], + "description": "Returns properties of a given object. Object group of the result is inherited from the target object." + }, + { + "name": "releaseObject", + "parameters": [ + { "name": "objectId", "$ref": "RemoteObjectId", "description": "Identifier of the object to release." } + ], + "description": "Releases remote object with given id." + }, + { + "name": "releaseObjectGroup", + "parameters": [ + { "name": "objectGroup", "type": "string", "description": "Symbolic object group name." } + ], + "description": "Releases all remote objects that belong to a given group." + }, + { + "name": "run", + "description": "Tells inspected instance(worker or page) that it can run in case it was started paused." + }, + { + "name": "enable", + "description": "Enables reporting of execution contexts creation by means of executionContextCreated event. When the reporting gets enabled the event will be sent immediately for each existing execution context." + }, + { + "name": "disable", + "description": "Disables reporting of execution contexts creation." + } + ], + "events": [ + { + "name": "executionContextCreated", + "parameters": [ + { "name": "context", "$ref": "ExecutionContextDescription", "description": "A newly created execution contex." } + ], + "description": "Issued when new execution context is created." + } + ] +} diff --git a/JavaScriptCore/inspector/remote/RemoteInspector.h b/JavaScriptCore/inspector/remote/RemoteInspector.h new file mode 100644 index 00000000..43d403be --- /dev/null +++ b/JavaScriptCore/inspector/remote/RemoteInspector.h @@ -0,0 +1,106 @@ +/* + * Copyright (C) 2013 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. + */ + +#if ENABLE(REMOTE_INSPECTOR) + +#ifndef RemoteInspector_h +#define RemoteInspector_h + +#import "RemoteInspectorDebuggableConnection.h" +#import "RemoteInspectorXPCConnection.h" +#import +#import +#import +#import + +OBJC_CLASS NSString; +OBJC_CLASS NSDictionary; + +namespace Inspector { + +class RemoteInspectorDebuggable; +struct RemoteInspectorDebuggableInfo; + +class JS_EXPORT_PRIVATE RemoteInspector FINAL : public RemoteInspectorXPCConnection::Client { +public: + static RemoteInspector& shared(); + friend class NeverDestroyed; + + void registerDebuggable(RemoteInspectorDebuggable*); + void unregisterDebuggable(RemoteInspectorDebuggable*); + void updateDebuggable(RemoteInspectorDebuggable*); + void sendMessageToRemoteFrontend(unsigned identifier, const String& message); + + bool enabled() const { return m_enabled; } + bool hasActiveDebugSession() const { return m_hasActiveDebugSession; } + + void start(); + void stop(); + +private: + RemoteInspector(); + + unsigned nextAvailableIdentifier(); + + void setupXPCConnectionIfNeeded(); + + NSDictionary *listingForDebuggable(const RemoteInspectorDebuggableInfo&) const; + void pushListingNow(); + void pushListingSoon(); + + void updateHasActiveDebugSession(); + + virtual void xpcConnectionReceivedMessage(RemoteInspectorXPCConnection*, NSString *messageName, NSDictionary *userInfo) OVERRIDE; + virtual void xpcConnectionFailed(RemoteInspectorXPCConnection*) OVERRIDE; + virtual void xpcConnectionUnhandledMessage(RemoteInspectorXPCConnection*, xpc_object_t) OVERRIDE; + + void receivedSetupMessage(NSDictionary *userInfo); + void receivedDataMessage(NSDictionary *userInfo); + void receivedDidCloseMessage(NSDictionary *userInfo); + void receivedGetListingMessage(NSDictionary *userInfo); + void receivedIndicateMessage(NSDictionary *userInfo); + void receivedConnectionDiedMessage(NSDictionary *userInfo); + + // Debuggables can be registered from any thread at any time. + // Any debuggable can send messages over the XPC connection. + // So lock access to all maps and state as they can change + // from any thread. + Mutex m_lock; + + HashMap> m_debuggableMap; + HashMap> m_connectionMap; + std::unique_ptr m_xpcConnection; + unsigned m_nextAvailableIdentifier; + int m_notifyToken; + bool m_enabled; + bool m_hasActiveDebugSession; + bool m_pushScheduled; +}; + +} // namespace Inspector + +#endif // ENABLE(REMOTE_INSPECTOR) + +#endif // WebInspectorServer_h diff --git a/JavaScriptCore/inspector/remote/RemoteInspector.mm b/JavaScriptCore/inspector/remote/RemoteInspector.mm new file mode 100644 index 00000000..d6f0ae30 --- /dev/null +++ b/JavaScriptCore/inspector/remote/RemoteInspector.mm @@ -0,0 +1,494 @@ +/* + * Copyright (C) 2013 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. + */ + +#import "config.h" +#import "RemoteInspector.h" + +#if ENABLE(REMOTE_INSPECTOR) + +#import "InitializeThreading.h" +#import "RemoteInspectorConstants.h" +#import "RemoteInspectorDebuggable.h" +#import +#import +#import +#import +#import +#import + +#if PLATFORM(IOS) +#import +#endif + +namespace Inspector { + +static void dispatchAsyncOnQueueSafeForAnyDebuggable(void (^block)()) +{ +#if PLATFORM(IOS) + if (WebCoreWebThreadIsEnabled && WebCoreWebThreadIsEnabled()) { + WebCoreWebThreadRun(block); + return; + } +#endif + + dispatch_async(dispatch_get_main_queue(), block); +} + +RemoteInspector& RemoteInspector::shared() +{ + static NeverDestroyed shared; + + static dispatch_once_t once; + dispatch_once(&once, ^{ + JSC::initializeThreading(); + WTF::initializeMainThread(); + shared.get().start(); + }); + + return shared; +} + +RemoteInspector::RemoteInspector() + : m_nextAvailableIdentifier(1) + , m_notifyToken(0) + , m_enabled(false) + , m_hasActiveDebugSession(false) + , m_pushScheduled(false) +{ +} + +unsigned RemoteInspector::nextAvailableIdentifier() +{ + unsigned nextValidIdentifier; + do { + nextValidIdentifier = m_nextAvailableIdentifier++; + } while (!nextValidIdentifier || nextValidIdentifier == std::numeric_limits::max() || m_debuggableMap.contains(nextValidIdentifier)); + return nextValidIdentifier; +} + +void RemoteInspector::registerDebuggable(RemoteInspectorDebuggable* debuggable) +{ + MutexLocker locker(m_lock); + + unsigned identifier = nextAvailableIdentifier(); + debuggable->setIdentifier(identifier); + + auto result = m_debuggableMap.set(identifier, std::make_pair(debuggable, debuggable->info())); + ASSERT_UNUSED(result, result.isNewEntry); + + if (debuggable->remoteDebuggingAllowed()) + pushListingSoon(); +} + +void RemoteInspector::unregisterDebuggable(RemoteInspectorDebuggable* debuggable) +{ + MutexLocker locker(m_lock); + + unsigned identifier = debuggable->identifier(); + if (!identifier) + return; + + bool wasRemoved = m_debuggableMap.remove(identifier); + ASSERT_UNUSED(wasRemoved, wasRemoved); + + if (RefPtr connection = m_connectionMap.take(identifier)) + connection->closeFromDebuggable(); + + if (debuggable->remoteDebuggingAllowed()) + pushListingSoon(); +} + +void RemoteInspector::updateDebuggable(RemoteInspectorDebuggable* debuggable) +{ + MutexLocker locker(m_lock); + + unsigned identifier = debuggable->identifier(); + if (!identifier) + return; + + auto result = m_debuggableMap.set(identifier, std::make_pair(debuggable, debuggable->info())); + ASSERT_UNUSED(result, !result.isNewEntry); + + pushListingSoon(); +} + +void RemoteInspector::sendMessageToRemoteFrontend(unsigned identifier, const String& message) +{ + MutexLocker locker(m_lock); + + if (!m_xpcConnection) + return; + + RefPtr connection = m_connectionMap.get(identifier); + if (!connection) + return; + + NSDictionary *userInfo = @{ + WIRRawDataKey: [static_cast(message) dataUsingEncoding:NSUTF8StringEncoding], + WIRConnectionIdentifierKey: connection->connectionIdentifier(), + WIRDestinationKey: connection->destination() + }; + + m_xpcConnection->sendMessage(WIRRawDataMessage, userInfo); +} + +void RemoteInspector::start() +{ + MutexLocker locker(m_lock); + + if (m_enabled) + return; + + m_enabled = true; + + notify_register_dispatch(WIRServiceAvailableNotification, &m_notifyToken, dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), ^(int) { + RemoteInspector::shared().setupXPCConnectionIfNeeded(); + }); + + notify_post(WIRServiceAvailabilityCheckNotification); +} + +void RemoteInspector::stop() +{ + MutexLocker locker(m_lock); + + if (!m_enabled) + return; + + m_enabled = false; + + m_pushScheduled = false; + + for (auto it = m_connectionMap.begin(), end = m_connectionMap.end(); it != end; ++it) + it->value->close(); + m_connectionMap.clear(); + + updateHasActiveDebugSession(); + + if (m_xpcConnection) { + m_xpcConnection->close(); + m_xpcConnection = nullptr; + } + + notify_cancel(m_notifyToken); +} + +void RemoteInspector::setupXPCConnectionIfNeeded() +{ + MutexLocker locker(m_lock); + + if (m_xpcConnection) + return; + + xpc_connection_t connection = xpc_connection_create_mach_service(WIRXPCMachPortName, dispatch_get_main_queue(), 0); + if (!connection) + return; + + m_xpcConnection = std::make_unique(connection, this); + m_xpcConnection->sendMessage(@"syn", nil); // Send a simple message to initialize the XPC connection. + xpc_release(connection); + + pushListingSoon(); +} + +#pragma mark - RemoteInspectorXPCConnection::Client + +void RemoteInspector::xpcConnectionReceivedMessage(RemoteInspectorXPCConnection*, NSString *messageName, NSDictionary *userInfo) +{ + MutexLocker locker(m_lock); + + if ([messageName isEqualToString:WIRPermissionDenied]) { + stop(); + return; + } + + if ([messageName isEqualToString:WIRSocketDataMessage]) + receivedDataMessage(userInfo); + else if ([messageName isEqualToString:WIRSocketSetupMessage]) + receivedSetupMessage(userInfo); + else if ([messageName isEqualToString:WIRWebPageCloseMessage]) + receivedDidCloseMessage(userInfo); + else if ([messageName isEqualToString:WIRApplicationGetListingMessage]) + receivedGetListingMessage(userInfo); + else if ([messageName isEqualToString:WIRIndicateMessage]) + receivedIndicateMessage(userInfo); + else if ([messageName isEqualToString:WIRConnectionDiedMessage]) + receivedConnectionDiedMessage(userInfo); + else + NSLog(@"Unrecognized RemoteInspector XPC Message: %@", messageName); +} + +void RemoteInspector::xpcConnectionFailed(RemoteInspectorXPCConnection*) +{ + MutexLocker locker(m_lock); + + m_pushScheduled = false; + + for (auto it = m_connectionMap.begin(), end = m_connectionMap.end(); it != end; ++it) + it->value->close(); + m_connectionMap.clear(); + + updateHasActiveDebugSession(); + + if (m_xpcConnection) { + m_xpcConnection->close(); + m_xpcConnection = nullptr; + } +} + +void RemoteInspector::xpcConnectionUnhandledMessage(RemoteInspectorXPCConnection*, xpc_object_t) +{ + // Intentionally ignored. +} + +#pragma mark - Listings + +NSDictionary *RemoteInspector::listingForDebuggable(const RemoteInspectorDebuggableInfo& debuggableInfo) const +{ + NSMutableDictionary *debuggableDetails = [NSMutableDictionary dictionary]; + + [debuggableDetails setObject:@(debuggableInfo.identifier) forKey:WIRPageIdentifierKey]; + + switch (debuggableInfo.type) { + case RemoteInspectorDebuggable::JavaScript: { + NSString *name = debuggableInfo.name; + [debuggableDetails setObject:name forKey:WIRTitleKey]; + [debuggableDetails setObject:WIRTypeJavaScript forKey:WIRTypeKey]; + break; + } + case RemoteInspectorDebuggable::Web: { + NSString *url = debuggableInfo.url; + NSString *title = debuggableInfo.name; + [debuggableDetails setObject:url forKey:WIRURLKey]; + [debuggableDetails setObject:title forKey:WIRTitleKey]; + [debuggableDetails setObject:WIRTypeWeb forKey:WIRTypeKey]; + break; + } + default: + ASSERT_NOT_REACHED(); + break; + } + + if (RefPtr connection = m_connectionMap.get(debuggableInfo.identifier)) + [debuggableDetails setObject:connection->connectionIdentifier() forKey:WIRConnectionIdentifierKey]; + + if (debuggableInfo.hasLocalDebugger) + [debuggableDetails setObject:@YES forKey:WIRHasLocalDebuggerKey]; + + if (debuggableInfo.hasParentProcess()) { + NSString *parentApplicationIdentifier = [NSString stringWithFormat:@"PID:%lu", (unsigned long)debuggableInfo.parentProcessIdentifier]; + [debuggableDetails setObject:parentApplicationIdentifier forKey:WIRHostApplicationIdentifierKey]; + } + + return debuggableDetails; +} + +void RemoteInspector::pushListingNow() +{ + ASSERT(m_xpcConnection); + if (!m_xpcConnection) + return; + + m_pushScheduled = false; + + RetainPtr response = adoptNS([[NSMutableDictionary alloc] init]); + for (auto it = m_debuggableMap.begin(), end = m_debuggableMap.end(); it != end; ++it) { + const RemoteInspectorDebuggableInfo& debuggableInfo = it->value.second; + if (debuggableInfo.remoteDebuggingAllowed) { + NSDictionary *details = listingForDebuggable(debuggableInfo); + [response setObject:details forKey:[NSString stringWithFormat:@"%u", debuggableInfo.identifier]]; + } + } + + RetainPtr outgoing = adoptNS([[NSMutableDictionary alloc] init]); + [outgoing setObject:response.get() forKey:WIRListingKey]; + + m_xpcConnection->sendMessage(WIRListingMessage, outgoing.get()); +} + +void RemoteInspector::pushListingSoon() +{ + if (!m_xpcConnection) + return; + + if (m_pushScheduled) + return; + + m_pushScheduled = true; + dispatch_after(dispatch_time(DISPATCH_TIME_NOW, 0.02 * NSEC_PER_SEC), dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), ^{ + MutexLocker locker(m_lock); + if (m_pushScheduled) + pushListingNow(); + }); +} + +#pragma mark - Active Debugger Sessions + +void RemoteInspector::updateHasActiveDebugSession() +{ + bool hasActiveDebuggerSession = !m_connectionMap.isEmpty(); + if (hasActiveDebuggerSession == m_hasActiveDebugSession) + return; + + m_hasActiveDebugSession = hasActiveDebuggerSession; + + // FIXME: Expose some way to access this state in an embedder. + // Legacy iOS WebKit 1 had a notification. This will need to be smarter with WebKit2. +} + +#pragma mark - Received XPC Messages + +void RemoteInspector::receivedSetupMessage(NSDictionary *userInfo) +{ + NSNumber *pageId = [userInfo objectForKey:WIRPageIdentifierKey]; + if (!pageId) + return; + + NSString *connectionIdentifier = [userInfo objectForKey:WIRConnectionIdentifierKey]; + if (!connectionIdentifier) + return; + + NSString *sender = [userInfo objectForKey:WIRSenderKey]; + if (!sender) + return; + + unsigned identifier = [pageId unsignedIntValue]; + if (m_connectionMap.contains(identifier)) + return; + + auto it = m_debuggableMap.find(identifier); + if (it == m_debuggableMap.end()) + return; + + // Attempt to create a connection. This may fail if the page already has an inspector or if it disallows inspection. + RemoteInspectorDebuggable* debuggable = it->value.first; + RemoteInspectorDebuggableInfo debuggableInfo = it->value.second; + RefPtr connection = adoptRef(new RemoteInspectorDebuggableConnection(debuggable, connectionIdentifier, sender, debuggableInfo.type)); + if (!connection->setup()) { + connection->close(); + return; + } + + m_connectionMap.set(identifier, connection.release()); + + updateHasActiveDebugSession(); + + pushListingSoon(); +} + +void RemoteInspector::receivedDataMessage(NSDictionary *userInfo) +{ + NSNumber *pageId = [userInfo objectForKey:WIRPageIdentifierKey]; + if (!pageId) + return; + + unsigned pageIdentifier = [pageId unsignedIntValue]; + RefPtr connection = m_connectionMap.get(pageIdentifier); + if (!connection) + return; + + NSData *data = [userInfo objectForKey:WIRSocketDataKey]; + RetainPtr message = adoptNS([[NSString alloc] initWithData:data encoding:NSUTF8StringEncoding]); + connection->sendMessageToBackend(message.get()); +} + +void RemoteInspector::receivedDidCloseMessage(NSDictionary *userInfo) +{ + NSNumber *pageId = [userInfo objectForKey:WIRPageIdentifierKey]; + if (!pageId) + return; + + NSString *connectionIdentifier = [userInfo objectForKey:WIRConnectionIdentifierKey]; + if (!connectionIdentifier) + return; + + unsigned identifier = [pageId unsignedIntValue]; + RefPtr connection = m_connectionMap.get(identifier); + if (!connection) + return; + + if (![connectionIdentifier isEqualToString:connection->connectionIdentifier()]) + return; + + connection->close(); + m_connectionMap.remove(identifier); + + updateHasActiveDebugSession(); + + pushListingSoon(); +} + +void RemoteInspector::receivedGetListingMessage(NSDictionary *) +{ + pushListingNow(); +} + +void RemoteInspector::receivedIndicateMessage(NSDictionary *userInfo) +{ + NSNumber *pageId = [userInfo objectForKey:WIRPageIdentifierKey]; + if (!pageId) + return; + + unsigned identifier = [pageId unsignedIntValue]; + BOOL indicateEnabled = [[userInfo objectForKey:WIRIndicateEnabledKey] boolValue]; + + dispatchAsyncOnQueueSafeForAnyDebuggable(^{ + MutexLocker locker(m_lock); + + auto it = m_debuggableMap.find(identifier); + if (it == m_debuggableMap.end()) + return; + + RemoteInspectorDebuggable* debuggable = it->value.first; + debuggable->setIndicating(indicateEnabled); + }); +} + +void RemoteInspector::receivedConnectionDiedMessage(NSDictionary *userInfo) +{ + NSString *connectionIdentifier = [userInfo objectForKey:WIRConnectionIdentifierKey]; + if (!connectionIdentifier) + return; + + auto it = m_connectionMap.begin(); + auto end = m_connectionMap.end(); + for (; it != end; ++it) { + if ([connectionIdentifier isEqualToString:it->value->connectionIdentifier()]) + break; + } + + if (it == end) + return; + + RefPtr connection = it->value; + connection->close(); + m_connectionMap.remove(it); + + updateHasActiveDebugSession(); +} + +} // namespace Inspector + +#endif // ENABLE(REMOTE_INSPECTOR) diff --git a/JavaScriptCore/inspector/remote/RemoteInspectorConstants.h b/JavaScriptCore/inspector/remote/RemoteInspectorConstants.h new file mode 100644 index 00000000..4f4bc32d --- /dev/null +++ b/JavaScriptCore/inspector/remote/RemoteInspectorConstants.h @@ -0,0 +1,85 @@ +/* + * 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. ``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. + */ + +#ifndef RemoteInspectorConstants_h +#define RemoteInspectorConstants_h + +// WIRConstants are "Web Inspector Relay" constants shared between +// the WebInspector framework on the OS X side, webinspectord, and +// iOS WebKit on the device side. + +#define WIRSimulatorTCPPortNumber 27753 +#define WIRXPCMachPortName "com.apple.webinspector" +#define WIRXPCDebuggerServiceName "com.apple.webinspector.debugger" +#define WIRServiceAvailableNotification "com.apple.webinspectord.available" +#define WIRServiceAvailabilityCheckNotification "com.apple.webinspectord.availability_check" +#define WIRServiceEnabledNotification "com.apple.webinspectord.enabled" +#define WIRServiceDisabledNotification "com.apple.webinspectord.disabled" + + +#define WIRApplicationIdentifierKey @"WIRApplicationIdentifierKey" +#define WIRApplicationBundleIdentifierKey @"WIRApplicationBundleIdentifierKey" +#define WIRApplicationNameKey @"WIRApplicationNameKey" +#define WIRIsApplicationProxyKey @"WIRIsApplicationProxyKey" +#define WIRHostApplicationIdentifierKey @"WIRHostApplicationIdentifierKey" +#define WIRHostApplicationNameKey @"WIRHostApplicationNameKey" +#define WIRConnectionIdentifierKey @"WIRConnectionIdentifierKey" +#define WIRPageIdentifierKey @"WIRPageIdentifierKey" +#define WIRHasLocalDebuggerKey @"WIRHasLocalDebuggerKey" +#define WIRTitleKey @"WIRTitleKey" +#define WIRURLKey @"WIRURLKey" +#define WIRUserInfoKey @"WIRUserInfoKey" +#define WIRApplicationDictionaryKey @"WIRApplicationDictionaryKey" +#define WIRMessageDataKey @"WIRMessageDataKey" +#define WIRApplicationGetListingMessage @"WIRApplicationGetListingMessage" +#define WIRIndicateMessage @"WIRIndicateMessage" +#define WIRIndicateEnabledKey @"WIRIndicateEnabledKey" +#define WIRSenderKey @"WIRSenderKey" +#define WIRSocketDataKey @"WIRSocketDataKey" +#define WIRSocketDataMessage @"WIRSocketDataMessage" +#define WIRSocketSetupMessage @"WIRSocketSetupMessage" +#define WIRWebPageCloseMessage @"WIRWebPageCloseMessage" +#define WIRRawDataMessage @"WIRRawDataMessage" +#define WIRRawDataKey @"WIRRawDataKey" +#define WIRListingMessage @"WIRListingMessage" +#define WIRListingKey @"WIRListingKey" +#define WIRDestinationKey @"WIRDestinationKey" +#define WIRConnectionDiedMessage @"WIRConnectionDiedMessage" +#define WIRTypeKey @"WIRTypeKey" +#define WIRTypeJavaScript @"WIRTypeJavaScript" +#define WIRTypeWeb @"WIRTypeWeb" + +// These definitions are shared with a Simulator webinspectord and +// OS X process communicating with it. + +#define WIRSimulatorBuildKey @"WIRSimulatorBuildKey" +#define WIRSimulatorProductVersionKey @"WIRSimulatorProductVersionKey" +#define WIRSimulatorNameKey @"WIRSimulatorNameKey" + +// These definitions are shared between webinspectord and WebKit. + +#define WIRPermissionDenied @"WIRPermissionDenied" + +#endif diff --git a/JavaScriptCore/inspector/remote/RemoteInspectorDebuggable.cpp b/JavaScriptCore/inspector/remote/RemoteInspectorDebuggable.cpp new file mode 100644 index 00000000..1530b849 --- /dev/null +++ b/JavaScriptCore/inspector/remote/RemoteInspectorDebuggable.cpp @@ -0,0 +1,82 @@ +/* + * Copyright (C) 2013 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 "RemoteInspectorDebuggable.h" + +#if ENABLE(REMOTE_INSPECTOR) + +#include "InspectorFrontendChannel.h" +#include "RemoteInspector.h" + +namespace Inspector { + +RemoteInspectorDebuggable::RemoteInspectorDebuggable() + : m_identifier(0) + , m_allowed(false) +{ +} + +RemoteInspectorDebuggable::~RemoteInspectorDebuggable() +{ + RemoteInspector::shared().unregisterDebuggable(this); +} + +void RemoteInspectorDebuggable::init() +{ + RemoteInspector::shared().registerDebuggable(this); +} + +void RemoteInspectorDebuggable::update() +{ + RemoteInspector::shared().updateDebuggable(this); +} + +void RemoteInspectorDebuggable::setRemoteDebuggingAllowed(bool allowed) +{ + if (m_allowed == allowed) + return; + + m_allowed = allowed; + + update(); +} + +RemoteInspectorDebuggableInfo RemoteInspectorDebuggable::info() const +{ + RemoteInspectorDebuggableInfo info; + info.identifier = identifier(); + info.type = type(); + info.name = name(); + info.url = url(); + info.hasLocalDebugger = hasLocalDebugger(); + info.remoteDebuggingAllowed = remoteDebuggingAllowed(); + info.parentProcessIdentifier = parentProcessIdentifier(); + return info; +} + +} // namespace Inspector + +#endif // ENABLE(REMOTE_INSPECTOR) diff --git a/JavaScriptCore/inspector/remote/RemoteInspectorDebuggable.h b/JavaScriptCore/inspector/remote/RemoteInspectorDebuggable.h new file mode 100644 index 00000000..ec4de51f --- /dev/null +++ b/JavaScriptCore/inspector/remote/RemoteInspectorDebuggable.h @@ -0,0 +1,96 @@ +/* + * Copyright (C) 2013 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. + */ + +#if ENABLE(REMOTE_INSPECTOR) + +#ifndef RemoteInspectorDebuggable_h +#define RemoteInspectorDebuggable_h + +#include + +namespace Inspector { + +class InspectorFrontendChannel; +struct RemoteInspectorDebuggableInfo; + +class JS_EXPORT_PRIVATE RemoteInspectorDebuggable { +public: + RemoteInspectorDebuggable(); + virtual ~RemoteInspectorDebuggable(); + + void init(); + void update(); + + unsigned identifier() const { return m_identifier; } + void setIdentifier(unsigned identifier) { m_identifier = identifier; } + + bool remoteDebuggingAllowed() const { return m_allowed; } + void setRemoteDebuggingAllowed(bool); + + RemoteInspectorDebuggableInfo info() const; + + enum DebuggableType { JavaScript, Web }; + virtual DebuggableType type() const = 0; + virtual String name() const { return String(); } // JavaScript and Web + virtual String url() const { return String(); } // Web + virtual bool hasLocalDebugger() const = 0; + virtual pid_t parentProcessIdentifier() const { return 0; } + + virtual void connect(InspectorFrontendChannel*) = 0; + virtual void disconnect() = 0; + virtual void dispatchMessageFromRemoteFrontend(const String& message) = 0; + virtual void setIndicating(bool) { } // Default is to do nothing. + +private: + unsigned m_identifier; + bool m_allowed; +}; + +struct RemoteInspectorDebuggableInfo { + RemoteInspectorDebuggableInfo() + : identifier(0) + , type(RemoteInspectorDebuggable::JavaScript) + , hasLocalDebugger(false) + , remoteDebuggingAllowed(false) + , parentProcessIdentifier(0) + { + } + + bool hasParentProcess() const { return !!parentProcessIdentifier; } + + unsigned identifier; + RemoteInspectorDebuggable::DebuggableType type; + String name; + String url; + bool hasLocalDebugger; + bool remoteDebuggingAllowed; + pid_t parentProcessIdentifier; +}; + +} // namespace Inspector + +#endif // RemoteInspectorDebuggable_h + +#endif // ENABLE(REMOTE_INSPECTOR) diff --git a/JavaScriptCore/inspector/remote/RemoteInspectorDebuggableConnection.h b/JavaScriptCore/inspector/remote/RemoteInspectorDebuggableConnection.h new file mode 100644 index 00000000..c24d8824 --- /dev/null +++ b/JavaScriptCore/inspector/remote/RemoteInspectorDebuggableConnection.h @@ -0,0 +1,80 @@ +/* + * Copyright (C) 2013 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. + */ + +#if ENABLE(REMOTE_INSPECTOR) + +#ifndef RemoteInspectorDebuggableConnection_h +#define RemoteInspectorDebuggableConnection_h + +#import "InspectorFrontendChannel.h" +#import "RemoteInspectorDebuggable.h" +#import +#import +#import +#import + +OBJC_CLASS NSString; + +namespace Inspector { + +class RemoteInspectorDebuggableConnection FINAL : public ThreadSafeRefCounted, public InspectorFrontendChannel { +public: + RemoteInspectorDebuggableConnection(RemoteInspectorDebuggable*, NSString *connectionIdentifier, NSString *destination, RemoteInspectorDebuggable::DebuggableType); + virtual ~RemoteInspectorDebuggableConnection(); + + NSString *destination() const; + NSString *connectionIdentifier() const; + unsigned identifier() const { return m_identifier; } + + bool setup(); + + void close(); + void closeFromDebuggable(); + + void sendMessageToBackend(NSString *); + virtual bool sendMessageToFrontend(const String&) OVERRIDE; + +private: + void dispatchSyncOnDebuggable(void (^block)()); + void dispatchAsyncOnDebuggable(void (^block)()); + + // This connection from the RemoteInspector singleton to the Debuggable + // can be used on multiple threads. So any access to the debuggable + // itself must take this lock to ensure m_debuggable is valid. + Mutex m_debuggableLock; + + RemoteInspectorDebuggable* m_debuggable; + dispatch_queue_t m_queueForDebuggable; + RetainPtr m_connectionIdentifier; + RetainPtr m_destination; + unsigned m_identifier; + bool m_connected; +}; + +} // namespace Inspector + +#endif // RemoteInspectorDebuggableConnection_h + +#endif // ENABLE(REMOTE_INSPECTOR) diff --git a/JavaScriptCore/inspector/remote/RemoteInspectorDebuggableConnection.mm b/JavaScriptCore/inspector/remote/RemoteInspectorDebuggableConnection.mm new file mode 100644 index 00000000..5fffea72 --- /dev/null +++ b/JavaScriptCore/inspector/remote/RemoteInspectorDebuggableConnection.mm @@ -0,0 +1,164 @@ +/* + * Copyright (C) 2013 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. + */ + +#import "config.h" +#import "RemoteInspectorDebuggableConnection.h" + +#if ENABLE(REMOTE_INSPECTOR) + +#import "RemoteInspector.h" + +#if PLATFORM(IOS) +#import +#endif + +namespace Inspector { + +RemoteInspectorDebuggableConnection::RemoteInspectorDebuggableConnection(RemoteInspectorDebuggable* debuggable, NSString *connectionIdentifier, NSString *destination, RemoteInspectorDebuggable::DebuggableType type) + : m_debuggable(debuggable) + , m_queueForDebuggable(NULL) + , m_connectionIdentifier(connectionIdentifier) + , m_destination(destination) + , m_identifier(debuggable->identifier()) + , m_connected(false) +{ + // Web debuggables must be accessed on the main queue (or the WebThread on iOS). Signal that with a NULL m_queueForDebuggable. + // However, JavaScript debuggables can be accessed from any thread/queue, so we create a queue for each JavaScript debuggable. + if (type == RemoteInspectorDebuggable::JavaScript) + m_queueForDebuggable = dispatch_queue_create("com.apple.JavaScriptCore.remote-inspector-xpc-connection", DISPATCH_QUEUE_SERIAL); +} + +RemoteInspectorDebuggableConnection::~RemoteInspectorDebuggableConnection() +{ + if (m_queueForDebuggable) { + dispatch_release(m_queueForDebuggable); + m_queueForDebuggable = NULL; + } +} + +NSString *RemoteInspectorDebuggableConnection::destination() const +{ + return [[m_destination copy] autorelease]; +} + +NSString *RemoteInspectorDebuggableConnection::connectionIdentifier() const +{ + return [[m_connectionIdentifier copy] autorelease]; +} + +void RemoteInspectorDebuggableConnection::dispatchSyncOnDebuggable(void (^block)()) +{ + if (m_queueForDebuggable) + dispatch_sync(m_queueForDebuggable, block); +#if PLATFORM(IOS) + else if (WebCoreWebThreadIsEnabled && WebCoreWebThreadIsEnabled()) + WebCoreWebThreadRunSync(block); +#endif + else + dispatch_sync(dispatch_get_main_queue(), block); +} + +void RemoteInspectorDebuggableConnection::dispatchAsyncOnDebuggable(void (^block)()) +{ + if (m_queueForDebuggable) + dispatch_async(m_queueForDebuggable, block); +#if PLATFORM(IOS) + else if (WebCoreWebThreadIsEnabled && WebCoreWebThreadIsEnabled()) + WebCoreWebThreadRun(block); +#endif + else + dispatch_async(dispatch_get_main_queue(), block); +} + +bool RemoteInspectorDebuggableConnection::setup() +{ + MutexLocker locker(m_debuggableLock); + + if (!m_debuggable) + return false; + + dispatchSyncOnDebuggable(^{ + if (!m_debuggable->remoteDebuggingAllowed()) + return; + + if (m_debuggable->hasLocalDebugger()) + return; + + m_debuggable->connect(this); + m_connected = true; + }); + + return m_connected; +} + +void RemoteInspectorDebuggableConnection::closeFromDebuggable() +{ + MutexLocker locker(m_debuggableLock); + + m_debuggable = nullptr; +} + +void RemoteInspectorDebuggableConnection::close() +{ + ref(); + dispatchAsyncOnDebuggable(^{ + { + MutexLocker locker(m_debuggableLock); + + if (m_debuggable) { + if (m_connected) + m_debuggable->disconnect(); + + m_debuggable = nullptr; + } + } + deref(); + }); +} + +void RemoteInspectorDebuggableConnection::sendMessageToBackend(NSString *message) +{ + ref(); + dispatchAsyncOnDebuggable(^{ + { + MutexLocker locker(m_debuggableLock); + + if (m_debuggable) + m_debuggable->dispatchMessageFromRemoteFrontend(message); + } + deref(); + }); +} + +bool RemoteInspectorDebuggableConnection::sendMessageToFrontend(const String& message) +{ + RemoteInspector::shared().sendMessageToRemoteFrontend(identifier(), message); + + return true; +} + +} // namespace Inspector + +#endif // ENABLE(REMOTE_INSPECTOR) diff --git a/JavaScriptCore/inspector/remote/RemoteInspectorXPCConnection.h b/JavaScriptCore/inspector/remote/RemoteInspectorXPCConnection.h new file mode 100644 index 00000000..0bf36ad1 --- /dev/null +++ b/JavaScriptCore/inspector/remote/RemoteInspectorXPCConnection.h @@ -0,0 +1,71 @@ +/* + * Copyright (C) 2013 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. + */ + +#if ENABLE(REMOTE_INSPECTOR) + +#ifndef RemoteInspectorXPCConnection_h +#define RemoteInspectorXPCConnection_h + +#import +#import +#import + +OBJC_CLASS NSString; +OBJC_CLASS NSDictionary; + +namespace Inspector { + +class RemoteInspectorXPCConnection { + WTF_MAKE_NONCOPYABLE(RemoteInspectorXPCConnection); + +public: + class Client { + public: + virtual ~Client() { } + virtual void xpcConnectionReceivedMessage(RemoteInspectorXPCConnection*, NSString *messageName, NSDictionary *userInfo) = 0; + virtual void xpcConnectionFailed(RemoteInspectorXPCConnection*) = 0; + virtual void xpcConnectionUnhandledMessage(RemoteInspectorXPCConnection*, xpc_object_t) = 0; + }; + + RemoteInspectorXPCConnection(xpc_connection_t, Client*); + virtual ~RemoteInspectorXPCConnection(); + + void close(); + void sendMessage(NSString *messageName, NSDictionary *userInfo); + +private: + NSDictionary *deserializeMessage(xpc_object_t); + void handleEvent(xpc_object_t); + + xpc_connection_t m_connection; + dispatch_queue_t m_queue; + Client* m_client; +}; + +} // namespace Inspector + +#endif // RemoteInspectorXPCConnection_h + +#endif // ENABLE(REMOTE_INSPECTOR) diff --git a/JavaScriptCore/inspector/remote/RemoteInspectorXPCConnection.mm b/JavaScriptCore/inspector/remote/RemoteInspectorXPCConnection.mm new file mode 100644 index 00000000..ad169982 --- /dev/null +++ b/JavaScriptCore/inspector/remote/RemoteInspectorXPCConnection.mm @@ -0,0 +1,146 @@ +/* + * Copyright (C) 2013 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. + */ + +#import "config.h" +#import "RemoteInspectorXPCConnection.h" + +#if ENABLE(REMOTE_INSPECTOR) + +#import +#import + +#if __has_include() +#import +#else +extern "C" xpc_object_t _CFXPCCreateXPCMessageWithCFObject(CFTypeRef); +extern "C" CFTypeRef _CFXPCCreateCFObjectFromXPCMessage(xpc_object_t); +#endif + +namespace Inspector { + +// Constants private to this file for message serialization on both ends. +#define RemoteInspectorXPCConnectionMessageNameKey @"messageName" +#define RemoteInspectorXPCConnectionUserInfoKey @"userInfo" +#define RemoteInspectorXPCConnectionSerializedMessageKey "msgData" + +RemoteInspectorXPCConnection::RemoteInspectorXPCConnection(xpc_connection_t connection, Client* client) + : m_connection(connection) + , m_queue(dispatch_queue_create("com.apple.JavaScriptCore.remote-inspector-xpc-connection", DISPATCH_QUEUE_SERIAL)) + , m_client(client) +{ + xpc_retain(m_connection); + xpc_connection_set_target_queue(m_connection, m_queue); + RemoteInspectorXPCConnection* weakThis = this; + xpc_connection_set_event_handler(m_connection, ^(xpc_object_t object) { + weakThis->handleEvent(object); + }); + xpc_connection_resume(m_connection); +} + +RemoteInspectorXPCConnection::~RemoteInspectorXPCConnection() +{ + ASSERT(!m_client); + ASSERT(!m_connection); +} + +void RemoteInspectorXPCConnection::close() +{ + if (!m_connection) + return; + + xpc_connection_cancel(m_connection); + xpc_release(m_connection); + m_connection = NULL; + + dispatch_release(m_queue); + m_queue = NULL; + + m_client = nullptr; +} + +NSDictionary *RemoteInspectorXPCConnection::deserializeMessage(xpc_object_t object) +{ + if (xpc_get_type(object) != XPC_TYPE_DICTIONARY) + return nil; + + xpc_object_t xpcDictionary = xpc_dictionary_get_value(object, RemoteInspectorXPCConnectionSerializedMessageKey); + if (!xpcDictionary || xpc_get_type(xpcDictionary) != XPC_TYPE_DICTIONARY) { + if (m_client) + m_client->xpcConnectionUnhandledMessage(this, object); + return nil; + } + + NSDictionary *dictionary = static_cast(_CFXPCCreateCFObjectFromXPCMessage(xpcDictionary)); + ASSERT_WITH_MESSAGE(dictionary, "Unable to deserialize xpc message"); + return [dictionary autorelease]; +} + +void RemoteInspectorXPCConnection::handleEvent(xpc_object_t object) +{ + if (!m_connection) + return; + + if (xpc_get_type(object) == XPC_TYPE_ERROR) { + if (m_client) + m_client->xpcConnectionFailed(this); + return; + } + + NSDictionary *dataDictionary = deserializeMessage(object); + if (!dataDictionary) + return; + + NSString *message = [dataDictionary objectForKey:RemoteInspectorXPCConnectionMessageNameKey]; + NSDictionary *userInfo = [dataDictionary objectForKey:RemoteInspectorXPCConnectionUserInfoKey]; + if (m_client) + m_client->xpcConnectionReceivedMessage(this, message, userInfo); +} + +void RemoteInspectorXPCConnection::sendMessage(NSString *messageName, NSDictionary *userInfo) +{ + if (!m_connection) + return; + + NSMutableDictionary *dictionary = [NSMutableDictionary dictionaryWithObject:messageName forKey:RemoteInspectorXPCConnectionMessageNameKey]; + if (userInfo) + [dictionary setObject:userInfo forKey:RemoteInspectorXPCConnectionUserInfoKey]; + + xpc_object_t xpcDictionary = _CFXPCCreateXPCMessageWithCFObject((CFDictionaryRef)dictionary); + ASSERT_WITH_MESSAGE(xpcDictionary && xpc_get_type(xpcDictionary) == XPC_TYPE_DICTIONARY, "Unable to serialize xpc message"); + if (!xpcDictionary) + return; + + xpc_object_t msg = xpc_dictionary_create(NULL, NULL, 0); + xpc_dictionary_set_value(msg, RemoteInspectorXPCConnectionSerializedMessageKey, xpcDictionary); + xpc_release(xpcDictionary); + + xpc_connection_send_message(m_connection, msg); + + xpc_release(msg); +} + +} // namespace Inspector + +#endif // ENABLE(REMOTE_INSPECTOR) diff --git a/JavaScriptCore/inspector/scripts/CodeGeneratorInspector.py b/JavaScriptCore/inspector/scripts/CodeGeneratorInspector.py new file mode 100755 index 00000000..07e67423 --- /dev/null +++ b/JavaScriptCore/inspector/scripts/CodeGeneratorInspector.py @@ -0,0 +1,2616 @@ +#!/usr/bin/env python +# Copyright (c) 2011 Google Inc. All rights reserved. +# Copyright (c) 2012 Intel Corporation. All rights reserved. +# Copyright (c) 2013 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: +# +# * Redistributions of source code must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# * 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. +# * Neither the name of Google Inc. nor the names of its +# contributors may be used to endorse or promote products derived from +# this software without specific prior written permission. +# +# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND 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 THE COPYRIGHT +# OWNER 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. + +import os.path +import sys +import string +import optparse +import re +try: + import json +except ImportError: + import simplejson as json + +import CodeGeneratorInspectorStrings + + +DOMAIN_DEFINE_NAME_MAP = { + "Database": "SQL_DATABASE", + "Debugger": "JAVASCRIPT_DEBUGGER", + "DOMDebugger": "JAVASCRIPT_DEBUGGER", + "IndexedDB": "INDEXED_DATABASE", + "Profiler": "JAVASCRIPT_DEBUGGER", +} + + +# Manually-filled map of type name replacements. +TYPE_NAME_FIX_MAP = { + "RGBA": "Rgba", # RGBA is reported to be conflicting with a define name in Windows CE. + "": "Empty", +} + + +TYPES_WITH_RUNTIME_CAST_SET = frozenset(["Runtime.RemoteObject", "Runtime.PropertyDescriptor", "Runtime.InternalPropertyDescriptor", + "Debugger.FunctionDetails", "Debugger.CallFrame", + "Canvas.TraceLog", "Canvas.ResourceInfo", "Canvas.ResourceState", + # This should be a temporary hack. TimelineEvent should be created via generated C++ API. + "Timeline.TimelineEvent"]) + +TYPES_WITH_OPEN_FIELD_LIST_SET = frozenset(["Timeline.TimelineEvent", + # InspectorStyleSheet not only creates this property but wants to read it and modify it. + "CSS.CSSProperty", + # InspectorResourceAgent needs to update mime-type. + "Network.Response"]) + +EXACTLY_INT_SUPPORTED = False + +INSPECTOR_TYPES_GENERATOR_CONFIG_MAP = { + "JavaScript": { + "prefix": "JS", + "typebuilder_dependency": "", + "export_macro": "JS_EXPORT_PRIVATE", + }, + "Web": { + "prefix": "Web", + "typebuilder_dependency": "#include ", + "export_macro": "", + }, +} + +cmdline_parser = optparse.OptionParser(usage="usage: %prog [options] ") +cmdline_parser.add_option("--output_h_dir") +cmdline_parser.add_option("--output_cpp_dir") +cmdline_parser.add_option("--output_js_dir") +cmdline_parser.add_option("--output_type") # JavaScript, Web +cmdline_parser.add_option("--write_always", action="store_true") +cmdline_parser.add_option("--no_verification", action="store_true") + +try: + arg_options, arg_values = cmdline_parser.parse_args() + if (len(arg_values) < 1): + raise Exception("At least one plain argument expected") + + input_json_filename = arg_values[0] + dependency_json_filenames = arg_values[1:] + + output_header_dirname = arg_options.output_h_dir + output_cpp_dirname = arg_options.output_cpp_dir + output_js_dirname = arg_options.output_js_dir + output_type = arg_options.output_type + + write_always = arg_options.write_always + verification = not arg_options.no_verification + if not output_header_dirname: + raise Exception("Output .h directory must be specified") + if not output_cpp_dirname: + raise Exception("Output .cpp directory must be specified") + if not output_js_dirname: + raise Exception("Output .js directory must be specified") + if output_type not in INSPECTOR_TYPES_GENERATOR_CONFIG_MAP.keys(): + raise Exception("Unknown output type. Allowed types are: %s" % INSPECTOR_TYPES_GENERATOR_CONFIG_MAP.keys()) +except Exception: + # Work with python 2 and 3 http://docs.python.org/py3k/howto/pyporting.html + exc = sys.exc_info()[1] + sys.stderr.write("Failed to parse command-line arguments: %s\n\n" % exc) + sys.stderr.write("Usage: + +import cssmin +import jsmin +import os.path +import re +import sys + + +def main(argv): + + if len(argv) < 2: + print('usage: %s inputFile outputFile' % argv[0]) + return 1 + + inputFileName = argv[1] + outputFileName = argv[2] + importsDir = os.path.dirname(inputFileName) + + inputFile = open(inputFileName, 'r') + inputContent = inputFile.read() + inputFile.close() + + def inline(match, minifier, prefix, postfix): + importFileName = match.group(1) + fullPath = os.path.join(importsDir, importFileName) + if not os.access(fullPath, os.F_OK): + raise Exception('File %s referenced in %s not found' % (importFileName, inputFileName)) + importFile = open(fullPath, 'r') + importContent = minifier(importFile.read()) + importFile.close() + return '%s%s%s' % (prefix, importContent, postfix) + + def inlineStylesheet(match): + return inline(match, cssmin.cssminify, "") + + def inlineScript(match): + return inline(match, jsmin.jsmin, "") + + outputContent = re.sub(r'', inlineStylesheet, inputContent) + outputContent = re.sub(r'', inlineScript, outputContent) + + outputFile = open(outputFileName, 'w') + outputFile.write(outputContent) + outputFile.close() + + # Touch output file directory to make sure that Xcode will copy + # modified resource files. + if sys.platform == 'darwin': + outputDirName = os.path.dirname(outputFileName) + os.utime(outputDirName, None) + +if __name__ == '__main__': + sys.exit(main(sys.argv)) diff --git a/JavaScriptCore/inspector/scripts/jsmin.py b/JavaScriptCore/inspector/scripts/jsmin.py new file mode 100644 index 00000000..2339f7d8 --- /dev/null +++ b/JavaScriptCore/inspector/scripts/jsmin.py @@ -0,0 +1,218 @@ +#!/usr/bin/python + +# This code is original from jsmin by Douglas Crockford, it was translated to +# Python by Baruch Even. The original code had the following copyright and +# license. +# +# /* jsmin.c +# 2007-05-22 +# +# Copyright (c) 2002 Douglas Crockford (www.crockford.com) +# +# Permission is hereby granted, free of charge, to any person obtaining a copy of +# this software and associated documentation files (the "Software"), to deal in +# the Software without restriction, including without limitation the rights to +# use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies +# of the Software, and to permit persons to whom the Software is furnished to do +# so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in all +# copies or substantial portions of the Software. +# +# The Software shall be used for Good, not Evil. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +# SOFTWARE. +# */ + +from StringIO import StringIO + +def jsmin(js): + ins = StringIO(js) + outs = StringIO() + JavascriptMinify().minify(ins, outs) + str = outs.getvalue() + if len(str) > 0 and str[0] == '\n': + str = str[1:] + return str + +def isAlphanum(c): + """return true if the character is a letter, digit, underscore, + dollar sign, or non-ASCII character. + """ + return ((c >= 'a' and c <= 'z') or (c >= '0' and c <= '9') or + (c >= 'A' and c <= 'Z') or c == '_' or c == '$' or c == '\\' or (c is not None and ord(c) > 126)); + +class UnterminatedComment(Exception): + pass + +class UnterminatedStringLiteral(Exception): + pass + +class UnterminatedRegularExpression(Exception): + pass + +class JavascriptMinify(object): + + def _outA(self): + self.outstream.write(self.theA) + def _outB(self): + self.outstream.write(self.theB) + + def _get(self): + """return the next character from stdin. Watch out for lookahead. If + the character is a control character, translate it to a space or + linefeed. + """ + c = self.theLookahead + self.theLookahead = None + if c == None: + c = self.instream.read(1) + if c >= ' ' or c == '\n': + return c + if c == '': # EOF + return '\000' + if c == '\r': + return '\n' + return ' ' + + def _peek(self): + self.theLookahead = self._get() + return self.theLookahead + + def _next(self): + """get the next character, excluding comments. peek() is used to see + if an unescaped '/' is followed by a '/' or '*'. + """ + c = self._get() + if c == '/' and self.theA != '\\': + p = self._peek() + if p == '/': + c = self._get() + while c > '\n': + c = self._get() + return c + if p == '*': + c = self._get() + while 1: + c = self._get() + if c == '*': + if self._peek() == '/': + self._get() + return ' ' + if c == '\000': + raise UnterminatedComment() + + return c + + def _action(self, action): + """do something! What you do is determined by the argument: + 1 Output A. Copy B to A. Get the next B. + 2 Copy B to A. Get the next B. (Delete A). + 3 Get the next B. (Delete B). + action treats a string as a single character. Wow! + action recognizes a regular expression if it is preceded by ( or , or =. + """ + if action <= 1: + self._outA() + + if action <= 2: + self.theA = self.theB + if self.theA == "'" or self.theA == '"': + while 1: + self._outA() + self.theA = self._get() + if self.theA == self.theB: + break + if self.theA <= '\n': + raise UnterminatedStringLiteral() + if self.theA == '\\': + self._outA() + self.theA = self._get() + + + if action <= 3: + self.theB = self._next() + if self.theB == '/' and (self.theA == '(' or self.theA == ',' or + self.theA == '=' or self.theA == ':' or + self.theA == '[' or self.theA == '?' or + self.theA == '!' or self.theA == '&' or + self.theA == '|' or self.theA == ';' or + self.theA == '{' or self.theA == '}' or + self.theA == '\n'): + self._outA() + self._outB() + while 1: + self.theA = self._get() + if self.theA == '/': + break + elif self.theA == '\\': + self._outA() + self.theA = self._get() + elif self.theA <= '\n': + raise UnterminatedRegularExpression() + self._outA() + self.theB = self._next() + + + def _jsmin(self): + """Copy the input to the output, deleting the characters which are + insignificant to JavaScript. Comments will be removed. Tabs will be + replaced with spaces. Carriage returns will be replaced with linefeeds. + Most spaces and linefeeds will be removed. + """ + self.theA = '\n' + self._action(3) + + while self.theA != '\000': + if self.theA == ' ': + if isAlphanum(self.theB): + self._action(1) + else: + self._action(2) + elif self.theA == '\n': + if self.theB in ['{', '[', '(', '+', '-']: + self._action(1) + elif self.theB == ' ': + self._action(3) + else: + if isAlphanum(self.theB): + self._action(1) + else: + self._action(2) + else: + if self.theB == ' ': + if isAlphanum(self.theA): + self._action(1) + else: + self._action(3) + elif self.theB == '\n': + if self.theA in ['}', ']', ')', '+', '-', '"', '\'']: + self._action(1) + else: + if isAlphanum(self.theA): + self._action(1) + else: + self._action(3) + else: + self._action(1) + + def minify(self, instream, outstream): + self.instream = instream + self.outstream = outstream + self.theA = '\n' + self.theB = None + self.theLookahead = None + + self._jsmin() + self.instream.close() + +if __name__ == '__main__': + import sys + jsm = JavascriptMinify() + jsm.minify(sys.stdin, sys.stdout) diff --git a/JavaScriptCore/inspector/scripts/xxd.pl b/JavaScriptCore/inspector/scripts/xxd.pl new file mode 100644 index 00000000..5ee08a52 --- /dev/null +++ b/JavaScriptCore/inspector/scripts/xxd.pl @@ -0,0 +1,45 @@ +#! /usr/bin/perl + +# Copyright (C) 2010-2011 Google 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: +# +# # Redistributions of source code must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# # 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. +# # Neither the name of Google Inc. nor the names of its +# contributors may be used to endorse or promote products derived from +# this software without specific prior written permission. +# +# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND 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 THE COPYRIGHT +# OWNER 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. +# + +$varname = shift; +$fname = shift; +$output = shift; + +open($input, '<', $fname) or die "Can't open file for read: $fname $!"; +$/ = undef; +$text = <$input>; +close($input); + +$text = join(', ', map('0x' . unpack("H*", $_), split(undef, $text))); + +open($output, '>', $output) or die "Can't open file for write: $output $!"; +print $output "const unsigned char $varname\[\] = {\n$text\n};\n"; +close($output); diff --git a/JavaScriptCore/interpreter/CachedCall.h b/JavaScriptCore/interpreter/CachedCall.h index ddf9a40a..2ca3e979 100644 --- a/JavaScriptCore/interpreter/CachedCall.h +++ b/JavaScriptCore/interpreter/CachedCall.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2009 Apple Inc. All rights reserved. + * Copyright (C) 2009, 2013 Apple Inc. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -27,9 +27,12 @@ #define CachedCall_h #include "CallFrameClosure.h" +#include "ExceptionHelpers.h" #include "JSFunction.h" #include "JSGlobalObject.h" #include "Interpreter.h" +#include "ProtoCallFrame.h" +#include "VMEntryScope.h" namespace JSC { class CachedCall { @@ -38,10 +41,14 @@ namespace JSC { CachedCall(CallFrame* callFrame, JSFunction* function, int argumentCount) : m_valid(false) , m_interpreter(callFrame->interpreter()) - , m_globalObjectScope(callFrame->vm(), function->scope()->globalObject()) + , m_entryScope(callFrame->vm(), function->scope()->globalObject()) { ASSERT(!function->isHostFunction()); - m_closure = m_interpreter->prepareForRepeatCall(function->jsExecutable(), callFrame, function, argumentCount + 1, function->scope()); + if (callFrame->vm().isSafeToRecurse()) { + m_arguments.resize(argumentCount); + m_closure = m_interpreter->prepareForRepeatCall(function->jsExecutable(), callFrame, &m_protoCallFrame, function, argumentCount + 1, function->scope(), m_arguments.data()); + } else + throwStackOverflowError(callFrame); m_valid = !callFrame->hadException(); } @@ -50,26 +57,15 @@ namespace JSC { ASSERT(m_valid); return m_interpreter->execute(m_closure); } - void setThis(JSValue v) { m_closure.setThis(v); } - void setArgument(int n, JSValue v) { m_closure.setArgument(n, v); } + void setThis(JSValue v) { m_protoCallFrame.setThisValue(v); } + void setArgument(int n, JSValue v) { m_protoCallFrame.setArgument(n, v); } - CallFrame* newCallFrame(ExecState* exec) - { - CallFrame* callFrame = m_closure.newCallFrame; - callFrame->setScope(exec->scope()); - return callFrame; - } - - ~CachedCall() - { - if (m_valid) - m_interpreter->endRepeatCall(m_closure); - } - private: bool m_valid; Interpreter* m_interpreter; - DynamicGlobalObjectScope m_globalObjectScope; + VMEntryScope m_entryScope; + ProtoCallFrame m_protoCallFrame; + Vector m_arguments; CallFrameClosure m_closure; }; } diff --git a/JavaScriptCore/interpreter/CallFrame.cpp b/JavaScriptCore/interpreter/CallFrame.cpp index ef36160c..a226e984 100644 --- a/JavaScriptCore/interpreter/CallFrame.cpp +++ b/JavaScriptCore/interpreter/CallFrame.cpp @@ -30,6 +30,7 @@ #include "CodeBlock.h" #include "Interpreter.h" #include "Operations.h" +#include "VMEntryScope.h" namespace JSC { @@ -119,7 +120,18 @@ Register* CallFrame::frameExtentInternal() { CodeBlock* codeBlock = this->codeBlock(); ASSERT(codeBlock); - return registers() + virtualRegisterForLocal(codeBlock->m_numCalleeRegisters).offset(); + return registers() + virtualRegisterForLocal(codeBlock->frameRegisterCount()).offset(); +} + +JSGlobalObject* CallFrame::vmEntryGlobalObject() +{ + if (this == lexicalGlobalObject()->globalExec()) + return lexicalGlobalObject(); + + // For any ExecState that's not a globalExec, the + // dynamic global object must be set since code is running + ASSERT(vm().entryScope); + return vm().entryScope->globalObject(); } } // namespace JSC diff --git a/JavaScriptCore/interpreter/CallFrame.h b/JavaScriptCore/interpreter/CallFrame.h index 65064f21..21b0a6df 100644 --- a/JavaScriptCore/interpreter/CallFrame.h +++ b/JavaScriptCore/interpreter/CallFrame.h @@ -51,10 +51,10 @@ namespace JSC { } // Global object in which execution began. - JSGlobalObject* dynamicGlobalObject(); + JS_EXPORT_PRIVATE JSGlobalObject* vmEntryGlobalObject(); // Global object in which the currently executing code was defined. - // Differs from dynamicGlobalObject() during function calls across web browser frames. + // Differs from vmEntryGlobalObject() during function calls across web browser frames. JSGlobalObject* lexicalGlobalObject() const; // Differs from lexicalGlobalObject because this will have DOM window shell rather than @@ -104,7 +104,6 @@ namespace JSC { #if ENABLE(PROMISES) static const HashTable& promisePrototypeTable(CallFrame* callFrame) { return *callFrame->vm().promisePrototypeTable; } static const HashTable& promiseConstructorTable(CallFrame* callFrame) { return *callFrame->vm().promiseConstructorTable; } - static const HashTable& promiseResolverPrototypeTable(CallFrame* callFrame) { return *callFrame->vm().promiseResolverPrototypeTable; } #endif static CallFrame* create(Register* callFrameBase) { return static_cast(callFrameBase); } @@ -179,7 +178,7 @@ namespace JSC { Register* frameExtent() { - if (!codeBlock()) + if (isVMEntrySentinel() || !codeBlock()) return registers() - 1; return frameExtentInternal(); } @@ -189,10 +188,12 @@ namespace JSC { #if USE(JSVALUE32_64) Instruction* currentVPC() const { + ASSERT(!isVMEntrySentinel()); return bitwise_cast(this[JSStack::ArgumentCount].tag()); } void setCurrentVPC(Instruction* vpc) { + ASSERT(!isVMEntrySentinel()); this[JSStack::ArgumentCount].tag() = bitwise_cast(vpc); } #else @@ -206,8 +207,7 @@ namespace JSC { ALWAYS_INLINE void init(CodeBlock* codeBlock, Instruction* vPC, JSScope* scope, CallFrame* callerFrame, int argc, JSObject* callee) { - ASSERT(callerFrame); // Use noCaller() rather than 0 for the outer host call frame caller. - ASSERT(callerFrame == noCaller() || callerFrame->removeHostCallFrameFlag()->stack()->containsAddress(this)); + ASSERT(callerFrame == noCaller() || callerFrame->isVMEntrySentinel() || callerFrame->stack()->containsAddress(this)); setCodeBlock(codeBlock); setScope(scope); @@ -265,20 +265,42 @@ namespace JSC { int hostThisRegister() { return thisArgumentOffset(); } JSValue hostThisValue() { return thisValue(); } - static CallFrame* noCaller() { return reinterpret_cast(HostCallFrameFlag); } + static CallFrame* noCaller() { return 0; } - bool hasHostCallFrameFlag() const { return reinterpret_cast(this) & HostCallFrameFlag; } - CallFrame* addHostCallFrameFlag() const { return reinterpret_cast(reinterpret_cast(this) | HostCallFrameFlag); } - CallFrame* removeHostCallFrameFlag() { return reinterpret_cast(reinterpret_cast(this) & ~HostCallFrameFlag); } - static intptr_t hostCallFrameFlag() { return HostCallFrameFlag; } + bool isVMEntrySentinel() const + { + return !!this && codeBlock() == vmEntrySentinelCodeBlock(); + } + + CallFrame* vmEntrySentinelCallerFrame() const + { + ASSERT(isVMEntrySentinel()); + return this[JSStack::ScopeChain].callFrame(); + } + + void initializeVMEntrySentinelFrame(CallFrame* callFrame) + { + setCallerFrame(noCaller()); + setReturnPC(0); + setCodeBlock(vmEntrySentinelCodeBlock()); + static_cast(this)[JSStack::ScopeChain] = callFrame; + setCallee(0); + setArgumentCountIncludingThis(0); + } + + CallFrame* callerFrameSkippingVMEntrySentinel() + { + CallFrame* caller = callerFrame(); + if (caller->isVMEntrySentinel()) + return caller->vmEntrySentinelCallerFrame(); + return caller; + } void setArgumentCountIncludingThis(int count) { static_cast(this)[JSStack::ArgumentCount].payload() = count; } void setCallee(JSObject* callee) { static_cast(this)[JSStack::Callee] = Register::withCallee(callee); } void setCodeBlock(CodeBlock* codeBlock) { static_cast(this)[JSStack::CodeBlock] = codeBlock; } void setReturnPC(void* value) { callerFrameAndPC().pc = reinterpret_cast(value); } - CallFrame* callerFrameNoFlags() { return callerFrame()->removeHostCallFrameFlag(); } - // CallFrame::iterate() expects a Functor that implements the following method: // StackVisitor::Status operator()(StackVisitor&); @@ -288,7 +310,7 @@ namespace JSC { } private: - static const intptr_t HostCallFrameFlag = 1; + static const intptr_t s_VMEntrySentinel = 1; #ifndef NDEBUG JSStack* stack(); @@ -328,6 +350,8 @@ namespace JSC { CallerFrameAndPC& callerFrameAndPC() { return *reinterpret_cast(this); } const CallerFrameAndPC& callerFrameAndPC() const { return *reinterpret_cast(this); } + static CodeBlock* vmEntrySentinelCodeBlock() { return reinterpret_cast(s_VMEntrySentinel); } + friend class JSStack; friend class VMInspector; }; diff --git a/JavaScriptCore/interpreter/CallFrameClosure.h b/JavaScriptCore/interpreter/CallFrameClosure.h index 7ae1e6fd..e3326626 100644 --- a/JavaScriptCore/interpreter/CallFrameClosure.h +++ b/JavaScriptCore/interpreter/CallFrameClosure.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2009 Apple Inc. All rights reserved. + * Copyright (C) 2009, 2013 Apple Inc. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -26,11 +26,13 @@ #ifndef CallFrameClosure_h #define CallFrameClosure_h +#include "ProtoCallFrame.h" + namespace JSC { struct CallFrameClosure { CallFrame* oldCallFrame; - CallFrame* newCallFrame; + ProtoCallFrame* protoCallFrame; JSFunction* function; FunctionExecutable* functionExecutable; VM* vm; @@ -40,23 +42,17 @@ struct CallFrameClosure { void setThis(JSValue value) { - newCallFrame->setThisValue(value); + protoCallFrame->setThisValue(value); } void setArgument(int argument, JSValue value) { - newCallFrame->setArgument(argument, value); + protoCallFrame->setArgument(argument, value); } void resetCallFrame() { - newCallFrame->setScope(scope); - // setArgument() takes an arg index that starts from 0 for the first - // argument after the 'this' value. Since both argumentCountIncludingThis - // and parameterCountIncludingThis includes the 'this' value, we need to - // subtract 1 from them to make i a valid argument index for setArgument(). - for (int i = argumentCountIncludingThis-1; i < parameterCountIncludingThis-1; ++i) - newCallFrame->setArgument(i, jsUndefined()); + protoCallFrame->setScope(scope); } }; diff --git a/JavaScriptCore/interpreter/Interpreter.cpp b/JavaScriptCore/interpreter/Interpreter.cpp index 8bf518b2..f20754a6 100644 --- a/JavaScriptCore/interpreter/Interpreter.cpp +++ b/JavaScriptCore/interpreter/Interpreter.cpp @@ -53,12 +53,14 @@ #include "JSString.h" #include "JSWithScope.h" #include "LLIntCLoop.h" +#include "LLIntThunks.h" #include "LegacyProfiler.h" #include "LiteralParser.h" #include "NameInstance.h" #include "ObjectPrototype.h" #include "Operations.h" #include "Parser.h" +#include "ProtoCallFrame.h" #include "RegExpObject.h" #include "RegExpPrototype.h" #include "Register.h" @@ -66,7 +68,7 @@ #include "StackVisitor.h" #include "StrictEvalActivation.h" #include "StrongInlines.h" -#include "VMStackBounds.h" +#include "VMEntryScope.h" #include "VirtualRegister.h" #include @@ -150,7 +152,7 @@ JSValue eval(CallFrame* callFrame) return interpreter->execute(eval, callFrame, thisValue, callerScopeChain); } -CallFrame* loadVarargs(CallFrame* callFrame, JSStack* stack, JSValue thisValue, JSValue arguments, int firstFreeRegister) +CallFrame* sizeAndAllocFrameForVarargs(CallFrame* callFrame, JSStack* stack, JSValue arguments, int firstFreeRegister) { if (!arguments) { // f.apply(x, arguments), with arguments unmodified. unsigned argumentCountIncludingThis = callFrame->argumentCountIncludingThis(); @@ -159,11 +161,6 @@ CallFrame* loadVarargs(CallFrame* callFrame, JSStack* stack, JSValue thisValue, callFrame->vm().throwException(callFrame, createStackOverflowError(callFrame)); return 0; } - - newCallFrame->setArgumentCountIncludingThis(argumentCountIncludingThis); - newCallFrame->setThisValue(thisValue); - for (size_t i = 0; i < callFrame->argumentCount(); ++i) - newCallFrame->setArgument(i, callFrame->argumentAfterCapture(i)); return newCallFrame; } @@ -173,8 +170,6 @@ CallFrame* loadVarargs(CallFrame* callFrame, JSStack* stack, JSValue thisValue, callFrame->vm().throwException(callFrame, createStackOverflowError(callFrame)); return 0; } - newCallFrame->setArgumentCountIncludingThis(1); - newCallFrame->setThisValue(thisValue); return newCallFrame; } @@ -191,9 +186,6 @@ CallFrame* loadVarargs(CallFrame* callFrame, JSStack* stack, JSValue thisValue, callFrame->vm().throwException(callFrame, createStackOverflowError(callFrame)); return 0; } - newCallFrame->setArgumentCountIncludingThis(argCount + 1); - newCallFrame->setThisValue(thisValue); - argsObject->copyToArguments(callFrame, newCallFrame, argCount); return newCallFrame; } @@ -205,9 +197,6 @@ CallFrame* loadVarargs(CallFrame* callFrame, JSStack* stack, JSValue thisValue, callFrame->vm().throwException(callFrame, createStackOverflowError(callFrame)); return 0; } - newCallFrame->setArgumentCountIncludingThis(argCount + 1); - newCallFrame->setThisValue(thisValue); - array->copyToArguments(callFrame, newCallFrame, argCount); return newCallFrame; } @@ -218,14 +207,54 @@ CallFrame* loadVarargs(CallFrame* callFrame, JSStack* stack, JSValue thisValue, callFrame->vm().throwException(callFrame, createStackOverflowError(callFrame)); return 0; } + return newCallFrame; +} + +void loadVarargs(CallFrame* callFrame, CallFrame* newCallFrame, JSValue thisValue, JSValue arguments) +{ + if (!arguments) { // f.apply(x, arguments), with arguments unmodified. + unsigned argumentCountIncludingThis = callFrame->argumentCountIncludingThis(); + + newCallFrame->setArgumentCountIncludingThis(argumentCountIncludingThis); + newCallFrame->setThisValue(thisValue); + for (size_t i = 0; i < callFrame->argumentCount(); ++i) + newCallFrame->setArgument(i, callFrame->argumentAfterCapture(i)); + return; + } + + if (arguments.isUndefinedOrNull()) { + newCallFrame->setArgumentCountIncludingThis(1); + newCallFrame->setThisValue(thisValue); + return; + } + + if (asObject(arguments)->classInfo() == Arguments::info()) { + Arguments* argsObject = asArguments(arguments); + unsigned argCount = argsObject->length(callFrame); + newCallFrame->setArgumentCountIncludingThis(argCount + 1); + newCallFrame->setThisValue(thisValue); + argsObject->copyToArguments(callFrame, newCallFrame, argCount); + return; + } + + if (isJSArray(arguments)) { + JSArray* array = asArray(arguments); + unsigned argCount = array->length(); + newCallFrame->setArgumentCountIncludingThis(argCount + 1); + newCallFrame->setThisValue(thisValue); + array->copyToArguments(callFrame, newCallFrame, argCount); + return; + } + + JSObject* argObject = asObject(arguments); + unsigned argCount = argObject->get(callFrame, callFrame->propertyNames().length).toUInt32(callFrame); newCallFrame->setArgumentCountIncludingThis(argCount + 1); newCallFrame->setThisValue(thisValue); for (size_t i = 0; i < argCount; ++i) { newCallFrame->setArgument(i, asObject(arguments)->get(callFrame, i)); if (UNLIKELY(callFrame->vm().exception())) - return 0; + return; } - return newCallFrame; } Interpreter::Interpreter(VM& vm) @@ -395,7 +424,7 @@ static bool unwindCallFrame(StackVisitor& visitor) CodeBlock* oldCodeBlock = codeBlock; JSScope* scope = callFrame->scope(); - if (Debugger* debugger = callFrame->dynamicGlobalObject()->debugger()) { + if (Debugger* debugger = callFrame->vmEntryGlobalObject()->debugger()) { if (callFrame->callee()) debugger->returnEvent(callFrame); else @@ -426,8 +455,11 @@ static bool unwindCallFrame(StackVisitor& visitor) } CallFrame* callerFrame = callFrame->callerFrame(); - callFrame->vm().topCallFrame = callerFrame->removeHostCallFrameFlag(); - return !callerFrame->hasHostCallFrameFlag(); + if (callerFrame->isVMEntrySentinel()) { + callFrame->vm().topCallFrame = callerFrame->vmEntrySentinelCallerFrame(); + return false; + } + return true; } static StackFrameCodeType getStackFrameCodeType(StackVisitor& visitor) @@ -544,7 +576,7 @@ class GetStackTraceFunctor { void Interpreter::getStackTrace(Vector& results, size_t maxStackSize) { VM& vm = m_vm; - ASSERT(!vm.topCallFrame->hasHostCallFrameFlag()); + ASSERT(!vm.topCallFrame->isVMEntrySentinel()); CallFrame* callFrame = vm.topCallFrame; if (!callFrame) return; @@ -647,7 +679,7 @@ NEVER_INLINE HandlerInfo* Interpreter::unwind(CallFrame*& callFrame, JSValue& ex ASSERT(callFrame->vm().exceptionStack().size()); ASSERT(!exceptionValue.isObject() || asObject(exceptionValue)->hasProperty(callFrame, callFrame->vm().propertyNames->stack)); - Debugger* debugger = callFrame->dynamicGlobalObject()->debugger(); + Debugger* debugger = callFrame->vmEntryGlobalObject()->debugger(); if (debugger && debugger->needsExceptionCallbacks()) { // We need to clear the exception and the exception stack here in order to see if a new exception happens. // Afterwards, the values are put back to continue processing this error. @@ -736,15 +768,14 @@ JSValue Interpreter::execute(ProgramExecutable* program, CallFrame* callFrame, J if (vm.isCollectorBusy()) return jsNull(); - StackStats::CheckPoint stackCheckPoint; - const VMStackBounds vmStackBounds(vm, wtfThreadData().stack()); - if (!vmStackBounds.isSafeToRecurse()) + VMEntryScope entryScope(vm, scope->globalObject()); + if (!vm.isSafeToRecurse()) return checkedReturn(throwStackOverflowError(callFrame)); // First check if the "program" is actually just a JSON object. If so, // we'll handle the JSON object here. Else, we'll handle real JS code // below at failedJSONP. - DynamicGlobalObjectScope globalObjectScope(vm, scope->globalObject()); + Vector JSONPData; bool parseResult; const String programSource = program->source().toString(); @@ -767,7 +798,7 @@ JSValue Interpreter::execute(ProgramExecutable* program, CallFrame* callFrame, J JSValue JSONPValue = JSONPData[entry].m_value.get(); if (JSONPPath.size() == 1 && JSONPPath[0].m_type == JSONPPathEntryTypeDeclare) { globalObject->addVar(callFrame, JSONPPath[0].m_pathEntryName); - PutPropertySlot slot; + PutPropertySlot slot(globalObject); globalObject->methodTable()->put(globalObject, callFrame, JSONPPath[0].m_pathEntryName, JSONPValue, slot); result = jsUndefined(); continue; @@ -802,7 +833,7 @@ JSValue Interpreter::execute(ProgramExecutable* program, CallFrame* callFrame, J return jsUndefined(); } } - PutPropertySlot slot; + PutPropertySlot slot(baseObject); switch (JSONPPath.last().m_type) { case JSONPPathEntryTypeCall: { JSValue function = baseObject.get(callFrame, JSONPPath.last().m_pathEntryName); @@ -856,14 +887,13 @@ JSValue Interpreter::execute(ProgramExecutable* program, CallFrame* callFrame, J if (UNLIKELY(vm.watchdog.didFire(callFrame))) return throwTerminatedExecutionException(callFrame); - // Push the call frame for this invocation: ASSERT(codeBlock->numParameters() == 1); // 1 parameter for 'this'. - CallFrame* newCallFrame = m_stack.pushFrame(callFrame, codeBlock, scope, 1, 0); - if (UNLIKELY(!newCallFrame)) + + if (UNLIKELY(!m_stack.entryCheck(codeBlock, 1))) return checkedReturn(throwStackOverflowError(callFrame)); - // Set the arguments for the callee: - newCallFrame->setThisValue(thisObj); + ProtoCallFrame protoCallFrame; + protoCallFrame.init(codeBlock, scope, 0, thisObj, 1); if (LegacyProfiler* profiler = vm.enabledProfiler()) profiler->willExecute(callFrame, program->sourceURL(), program->lineNo()); @@ -874,18 +904,12 @@ JSValue Interpreter::execute(ProgramExecutable* program, CallFrame* callFrame, J SamplingTool::CallRecord callRecord(m_sampler.get()); Watchdog::Scope watchdogScope(vm.watchdog); -#if ENABLE(LLINT_C_LOOP) - result = LLInt::CLoop::execute(newCallFrame, llint_program_prologue); -#elif ENABLE(JIT) - result = program->generatedJITCode()->execute(&m_stack, newCallFrame, &vm); -#endif // ENABLE(JIT) + result = program->generatedJITCode()->execute(&vm, &protoCallFrame, m_stack.getTopOfStack()); } if (LegacyProfiler* profiler = vm.enabledProfiler()) profiler->didExecute(callFrame, program->sourceURL(), program->lineNo()); - m_stack.popFrame(newCallFrame); - return checkedReturn(result); } @@ -897,11 +921,6 @@ JSValue Interpreter::executeCall(CallFrame* callFrame, JSObject* function, CallT if (vm.isCollectorBusy()) return jsNull(); - StackStats::CheckPoint stackCheckPoint; - const VMStackBounds vmStackBounds(vm, wtfThreadData().stack()); - if (!vmStackBounds.isSafeToRecurse()) - return checkedReturn(throwStackOverflowError(callFrame)); - bool isJSCall = (callType == CallTypeJS); JSScope* scope; CodeBlock* newCodeBlock; @@ -913,7 +932,10 @@ JSValue Interpreter::executeCall(CallFrame* callFrame, JSObject* function, CallT ASSERT(callType == CallTypeHost); scope = callFrame->scope(); } - DynamicGlobalObjectScope globalObjectScope(vm, scope->globalObject()); + + VMEntryScope entryScope(vm, scope->globalObject()); + if (!vm.isSafeToRecurse()) + return checkedReturn(throwStackOverflowError(callFrame)); if (isJSCall) { // Compile the callee: @@ -930,14 +952,11 @@ JSValue Interpreter::executeCall(CallFrame* callFrame, JSObject* function, CallT if (UNLIKELY(vm.watchdog.didFire(callFrame))) return throwTerminatedExecutionException(callFrame); - CallFrame* newCallFrame = m_stack.pushFrame(callFrame, newCodeBlock, scope, argsCount, function); - if (UNLIKELY(!newCallFrame)) + if (UNLIKELY(!m_stack.entryCheck(newCodeBlock, argsCount))) return checkedReturn(throwStackOverflowError(callFrame)); - // Set the arguments for the callee: - newCallFrame->setThisValue(thisValue); - for (size_t i = 0; i < args.size(); ++i) - newCallFrame->setArgument(i, args.at(i)); + ProtoCallFrame protoCallFrame; + protoCallFrame.init(newCodeBlock, scope, function, thisValue, argsCount, args.data()); if (LegacyProfiler* profiler = vm.enabledProfiler()) profiler->willExecute(callFrame, function); @@ -948,20 +967,15 @@ JSValue Interpreter::executeCall(CallFrame* callFrame, JSObject* function, CallT Watchdog::Scope watchdogScope(vm.watchdog); // Execute the code: - if (isJSCall) { -#if ENABLE(LLINT_C_LOOP) - result = LLInt::CLoop::execute(newCallFrame, llint_function_for_call_prologue); -#elif ENABLE(JIT) - result = callData.js.functionExecutable->generatedJITCodeForCall()->execute(&m_stack, newCallFrame, &vm); -#endif // ENABLE(JIT) - } else - result = JSValue::decode(callData.native.function(newCallFrame)); + if (isJSCall) + result = callData.js.functionExecutable->generatedJITCodeForCall()->execute(&vm, &protoCallFrame, m_stack.getTopOfStack()); + else + result = JSValue::decode(callToNativeFunction(reinterpret_cast(callData.native.function), &vm.topCallFrame, &protoCallFrame, m_stack.getTopOfStack())); } if (LegacyProfiler* profiler = vm.enabledProfiler()) profiler->didExecute(callFrame, function); - m_stack.popFrame(newCallFrame); return checkedReturn(result); } @@ -975,11 +989,6 @@ JSObject* Interpreter::executeConstruct(CallFrame* callFrame, JSObject* construc if (vm.isCollectorBusy()) return checkedReturn(throwStackOverflowError(callFrame)); - StackStats::CheckPoint stackCheckPoint; - const VMStackBounds vmStackBounds(vm, wtfThreadData().stack()); - if (!vmStackBounds.isSafeToRecurse()) - return checkedReturn(throwStackOverflowError(callFrame)); - bool isJSConstruct = (constructType == ConstructTypeJS); JSScope* scope; CodeBlock* newCodeBlock; @@ -992,7 +1001,9 @@ JSObject* Interpreter::executeConstruct(CallFrame* callFrame, JSObject* construc scope = callFrame->scope(); } - DynamicGlobalObjectScope globalObjectScope(vm, scope->globalObject()); + VMEntryScope entryScope(vm, scope->globalObject()); + if (!vm.isSafeToRecurse()) + return checkedReturn(throwStackOverflowError(callFrame)); if (isJSConstruct) { // Compile the callee: @@ -1009,14 +1020,11 @@ JSObject* Interpreter::executeConstruct(CallFrame* callFrame, JSObject* construc if (UNLIKELY(vm.watchdog.didFire(callFrame))) return throwTerminatedExecutionException(callFrame); - CallFrame* newCallFrame = m_stack.pushFrame(callFrame, newCodeBlock, scope, argsCount, constructor); - if (UNLIKELY(!newCallFrame)) + if (UNLIKELY(!m_stack.entryCheck(newCodeBlock, argsCount))) return checkedReturn(throwStackOverflowError(callFrame)); - // Set the arguments for the callee: - newCallFrame->setThisValue(jsUndefined()); - for (size_t i = 0; i < args.size(); ++i) - newCallFrame->setArgument(i, args.at(i)); + ProtoCallFrame protoCallFrame; + protoCallFrame.init(newCodeBlock, scope, constructor, jsUndefined(), argsCount, args.data()); if (LegacyProfiler* profiler = vm.enabledProfiler()) profiler->willExecute(callFrame, constructor); @@ -1027,34 +1035,26 @@ JSObject* Interpreter::executeConstruct(CallFrame* callFrame, JSObject* construc Watchdog::Scope watchdogScope(vm.watchdog); // Execute the code. - if (isJSConstruct) { -#if ENABLE(LLINT_C_LOOP) - result = LLInt::CLoop::execute(newCallFrame, llint_function_for_construct_prologue); -#elif ENABLE(JIT) - result = constructData.js.functionExecutable->generatedJITCodeForConstruct()->execute(&m_stack, newCallFrame, &vm); -#endif // ENABLE(JIT) - } else { - result = JSValue::decode(constructData.native.function(newCallFrame)); - if (!callFrame->hadException()) { - ASSERT_WITH_MESSAGE(result.isObject(), "Host constructor returned non object."); - if (!result.isObject()) - throwTypeError(newCallFrame); - } + if (isJSConstruct) + result = constructData.js.functionExecutable->generatedJITCodeForConstruct()->execute(&vm, &protoCallFrame, m_stack.getTopOfStack()); + else { + result = JSValue::decode(callToNativeFunction(reinterpret_cast(constructData.native.function), &vm.topCallFrame, &protoCallFrame, m_stack.getTopOfStack())); + + if (!callFrame->hadException()) + RELEASE_ASSERT(result.isObject()); } } if (LegacyProfiler* profiler = vm.enabledProfiler()) profiler->didExecute(callFrame, constructor); - m_stack.popFrame(newCallFrame); - if (callFrame->hadException()) return 0; ASSERT(result.isObject()); return checkedReturn(asObject(result)); } -CallFrameClosure Interpreter::prepareForRepeatCall(FunctionExecutable* functionExecutable, CallFrame* callFrame, JSFunction* function, int argumentCountIncludingThis, JSScope* scope) +CallFrameClosure Interpreter::prepareForRepeatCall(FunctionExecutable* functionExecutable, CallFrame* callFrame, ProtoCallFrame* protoCallFrame, JSFunction* function, int argumentCountIncludingThis, JSScope* scope, JSValue* args) { VM& vm = *scope->vm(); ASSERT(!vm.exception()); @@ -1062,13 +1062,6 @@ CallFrameClosure Interpreter::prepareForRepeatCall(FunctionExecutable* functionE if (vm.isCollectorBusy()) return CallFrameClosure(); - StackStats::CheckPoint stackCheckPoint; - const VMStackBounds vmStackBounds(vm, wtfThreadData().stack()); - if (!vmStackBounds.isSafeToRecurse()) { - throwStackOverflowError(callFrame); - return CallFrameClosure(); - } - // Compile the callee: JSObject* error = functionExecutable->prepareForExecution(callFrame, scope, CodeForCall); if (error) { @@ -1080,19 +1073,14 @@ CallFrameClosure Interpreter::prepareForRepeatCall(FunctionExecutable* functionE size_t argsCount = argumentCountIncludingThis; - CallFrame* newCallFrame = m_stack.pushFrame(callFrame, newCodeBlock, scope, argsCount, function); - if (UNLIKELY(!newCallFrame)) { - throwStackOverflowError(callFrame); - return CallFrameClosure(); - } - - if (UNLIKELY(!newCallFrame)) { + if (UNLIKELY(!m_stack.entryCheck(newCodeBlock, argsCount))) { throwStackOverflowError(callFrame); return CallFrameClosure(); } + protoCallFrame->init(newCodeBlock, scope, function, jsUndefined(), argsCount, args); // Return the successful closure: - CallFrameClosure result = { callFrame, newCallFrame, function, functionExecutable, &vm, scope, newCodeBlock->numParameters(), argumentCountIncludingThis }; + CallFrameClosure result = { callFrame, protoCallFrame, function, functionExecutable, &vm, scope, newCodeBlock->numParameters(), argumentCountIncludingThis }; return result; } @@ -1106,9 +1094,7 @@ JSValue Interpreter::execute(CallFrameClosure& closure) return jsNull(); StackStats::CheckPoint stackCheckPoint; - m_stack.validateFence(closure.newCallFrame, "BEFORE"); closure.resetCallFrame(); - m_stack.validateFence(closure.newCallFrame, "STEP 1"); if (LegacyProfiler* profiler = vm.enabledProfiler()) profiler->willExecute(closure.oldCallFrame, closure.function); @@ -1116,41 +1102,21 @@ JSValue Interpreter::execute(CallFrameClosure& closure) if (UNLIKELY(vm.watchdog.didFire(closure.oldCallFrame))) return throwTerminatedExecutionException(closure.oldCallFrame); - // The code execution below may push more frames and point the topCallFrame - // to those newer frames, or it may pop to the top frame to the caller of - // the current repeat frame, or it may leave the top frame pointing to the - // current repeat frame. - // - // Hence, we need to preserve the topCallFrame here ourselves before - // repeating this call on a second callback function. - - TopCallFrameSetter topCallFrame(vm, closure.newCallFrame); - // Execute the code: JSValue result; { SamplingTool::CallRecord callRecord(m_sampler.get()); Watchdog::Scope watchdogScope(vm.watchdog); -#if ENABLE(LLINT_C_LOOP) - result = LLInt::CLoop::execute(closure.newCallFrame, llint_function_for_call_prologue); -#elif ENABLE(JIT) - result = closure.functionExecutable->generatedJITCodeForCall()->execute(&m_stack, closure.newCallFrame, &vm); -#endif // ENABLE(JIT) + result = closure.functionExecutable->generatedJITCodeForCall()->execute(&vm, closure.protoCallFrame, m_stack.getTopOfStack()); } if (LegacyProfiler* profiler = vm.enabledProfiler()) profiler->didExecute(closure.oldCallFrame, closure.function); - m_stack.validateFence(closure.newCallFrame, "AFTER"); return checkedReturn(result); } -void Interpreter::endRepeatCall(CallFrameClosure& closure) -{ - m_stack.popFrame(closure.newCallFrame); -} - JSValue Interpreter::execute(EvalExecutable* eval, CallFrame* callFrame, JSValue thisValue, JSScope* scope) { VM& vm = *scope->vm(); @@ -1162,12 +1128,9 @@ JSValue Interpreter::execute(EvalExecutable* eval, CallFrame* callFrame, JSValue if (vm.isCollectorBusy()) return jsNull(); - DynamicGlobalObjectScope globalObjectScope(vm, scope->globalObject()); - - StackStats::CheckPoint stackCheckPoint; - const VMStackBounds vmStackBounds(vm, wtfThreadData().stack()); - if (!vmStackBounds.isSafeToRecurse()) - return checkedReturn(throwStackOverflowError(callFrame)); + VMEntryScope entryScope(vm, scope->globalObject()); + if (!vm.isSafeToRecurse()) + return checkedReturn(throwStackOverflowError(callFrame)); unsigned numVariables = eval->numVariables(); int numFunctions = eval->numberOfFunctionDecls(); @@ -1194,19 +1157,19 @@ JSValue Interpreter::execute(EvalExecutable* eval, CallFrame* callFrame, JSValue if (numVariables || numFunctions) { BatchedTransitionOptimizer optimizer(vm, variableObject); if (variableObject->next()) - variableObject->globalObject()->varInjectionWatchpoint()->notifyWrite(); + variableObject->globalObject()->varInjectionWatchpoint()->fireAll(); for (unsigned i = 0; i < numVariables; ++i) { const Identifier& ident = codeBlock->variable(i); if (!variableObject->hasProperty(callFrame, ident)) { - PutPropertySlot slot; + PutPropertySlot slot(variableObject); variableObject->methodTable()->put(variableObject, callFrame, ident, jsUndefined(), slot); } } for (int i = 0; i < numFunctions; ++i) { FunctionExecutable* function = codeBlock->functionDecl(i); - PutPropertySlot slot; + PutPropertySlot slot(variableObject); variableObject->methodTable()->put(variableObject, callFrame, function->name(), JSFunction::create(vm, function, scope), slot); } } @@ -1214,14 +1177,13 @@ JSValue Interpreter::execute(EvalExecutable* eval, CallFrame* callFrame, JSValue if (UNLIKELY(vm.watchdog.didFire(callFrame))) return throwTerminatedExecutionException(callFrame); - // Push the frame: ASSERT(codeBlock->numParameters() == 1); // 1 parameter for 'this'. - CallFrame* newCallFrame = m_stack.pushFrame(callFrame, codeBlock, scope, 1, 0); - if (UNLIKELY(!newCallFrame)) + + if (UNLIKELY(!m_stack.entryCheck(codeBlock, 1))) return checkedReturn(throwStackOverflowError(callFrame)); - // Set the arguments for the callee: - newCallFrame->setThisValue(thisValue); + ProtoCallFrame protoCallFrame; + protoCallFrame.init(codeBlock, scope, 0, thisValue, 1); if (LegacyProfiler* profiler = vm.enabledProfiler()) profiler->willExecute(callFrame, eval->sourceURL(), eval->lineNo()); @@ -1232,23 +1194,18 @@ JSValue Interpreter::execute(EvalExecutable* eval, CallFrame* callFrame, JSValue SamplingTool::CallRecord callRecord(m_sampler.get()); Watchdog::Scope watchdogScope(vm.watchdog); -#if ENABLE(LLINT_C_LOOP) - result = LLInt::CLoop::execute(newCallFrame, llint_eval_prologue); -#elif ENABLE(JIT) - result = eval->generatedJITCode()->execute(&m_stack, newCallFrame, &vm); -#endif // ENABLE(JIT) + result = eval->generatedJITCode()->execute(&vm, &protoCallFrame, m_stack.getTopOfStack()); } if (LegacyProfiler* profiler = vm.enabledProfiler()) profiler->didExecute(callFrame, eval->sourceURL(), eval->lineNo()); - m_stack.popFrame(newCallFrame); return checkedReturn(result); } NEVER_INLINE void Interpreter::debug(CallFrame* callFrame, DebugHookID debugHookID) { - Debugger* debugger = callFrame->dynamicGlobalObject()->debugger(); + Debugger* debugger = callFrame->vmEntryGlobalObject()->debugger(); if (!debugger || !debugger->needsOpDebugCallbacks()) return; diff --git a/JavaScriptCore/interpreter/Interpreter.h b/JavaScriptCore/interpreter/Interpreter.h index 61589e69..cfc721b3 100644 --- a/JavaScriptCore/interpreter/Interpreter.h +++ b/JavaScriptCore/interpreter/Interpreter.h @@ -59,7 +59,8 @@ namespace JSC { struct CallFrameClosure; struct HandlerInfo; struct Instruction; - + struct ProtoCallFrame; + enum DebugHookID { WillExecuteProgram, DidExecuteProgram, @@ -156,13 +157,13 @@ namespace JSC { : vm(currentVM) , oldCallFrame(currentVM.topCallFrame) { - ASSERT(!callFrame->hasHostCallFrameFlag()); + ASSERT(!callFrame->isVMEntrySentinel()); currentVM.topCallFrame = callFrame; } ~TopCallFrameSetter() { - ASSERT(!oldCallFrame->hasHostCallFrameFlag()); + ASSERT(!oldCallFrame->isVMEntrySentinel()); vm.topCallFrame = oldCallFrame; } private: @@ -176,7 +177,7 @@ namespace JSC { { ASSERT(vm); ASSERT(callFrame); - ASSERT(!callFrame->hasHostCallFrameFlag()); + ASSERT(!callFrame->isVMEntrySentinel()); vm->topCallFrame = callFrame; } }; @@ -256,8 +257,8 @@ namespace JSC { private: enum ExecutionFlag { Normal, InitializeAndReturn }; - CallFrameClosure prepareForRepeatCall(FunctionExecutable*, CallFrame*, JSFunction*, int argumentCountIncludingThis, JSScope*); - void endRepeatCall(CallFrameClosure&); + CallFrameClosure prepareForRepeatCall(FunctionExecutable*, CallFrame*, ProtoCallFrame*, JSFunction*, int argumentCountIncludingThis, JSScope*, JSValue*); + JSValue execute(CallFrameClosure&); void getStackTrace(Vector& results, size_t maxStackSize = std::numeric_limits::max()); @@ -285,8 +286,8 @@ namespace JSC { }; JSValue eval(CallFrame*); - CallFrame* loadVarargs(CallFrame*, JSStack*, JSValue thisValue, JSValue arguments, int firstFreeRegister); - + CallFrame* sizeAndAllocFrameForVarargs(CallFrame*, JSStack*, JSValue, int); + void loadVarargs(CallFrame*, CallFrame*, JSValue, JSValue); } // namespace JSC #endif // Interpreter_h diff --git a/JavaScriptCore/interpreter/JSStack.cpp b/JavaScriptCore/interpreter/JSStack.cpp index ea571548..fa3e3d50 100644 --- a/JavaScriptCore/interpreter/JSStack.cpp +++ b/JavaScriptCore/interpreter/JSStack.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008 Apple Inc. All rights reserved. + * Copyright (C) 2008, 2013 Apple Inc. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -27,7 +27,6 @@ */ #include "config.h" -#include "JSStack.h" #include "JSStackInlines.h" #include "ConservativeRoots.h" @@ -44,14 +43,17 @@ static Mutex& stackStatisticsMutex() } JSStack::JSStack(VM& vm, size_t capacity) - : m_end(0) + : m_vm(vm) + , m_end(0) , m_topCallFrame(vm.topCallFrame) { ASSERT(capacity && isPageAligned(capacity)); m_reservation = PageReservation::reserve(roundUpAllocationSize(capacity * sizeof(Register), commitSize), OSAllocator::JSVMStackPages); - m_end = highAddress(); + updateStackLimit(highAddress()); m_commitEnd = highAddress(); + + m_lastStackTop = getBaseOfStack(); disableErrorStackReserve(); @@ -60,8 +62,8 @@ JSStack::JSStack(VM& vm, size_t capacity) JSStack::~JSStack() { - void* highAddress = reinterpret_cast_ptr(static_cast(m_reservation.base()) + m_reservation.size()); - m_reservation.decommit(reinterpret_cast_ptr(m_commitEnd), reinterpret_cast(highAddress) - reinterpret_cast(m_commitEnd)); + void* highAddress = reinterpret_cast(static_cast(m_reservation.base()) + m_reservation.size()); + m_reservation.decommit(reinterpret_cast(m_commitEnd), reinterpret_cast(highAddress) - reinterpret_cast(m_commitEnd)); addToCommittedByteCount(-(reinterpret_cast(highAddress) - reinterpret_cast(m_commitEnd))); m_reservation.deallocate(); } @@ -71,7 +73,7 @@ bool JSStack::growSlowCase(Register* newEnd) // If we have already committed enough memory to satisfy this request, // just update the end pointer and return. if (newEnd >= m_commitEnd) { - m_end = newEnd; + updateStackLimit(newEnd); return true; } @@ -87,7 +89,7 @@ bool JSStack::growSlowCase(Register* newEnd) m_reservation.commit(reinterpret_cast(m_commitEnd) - delta, delta); addToCommittedByteCount(delta); m_commitEnd = reinterpret_cast_ptr(reinterpret_cast(m_commitEnd) - delta); - m_end = newEnd; + updateStackLimit(newEnd); return true; } @@ -101,6 +103,19 @@ void JSStack::gatherConservativeRoots(ConservativeRoots& conservativeRoots, JITS conservativeRoots.add(getBaseOfStack(), getTopOfStack(), jitStubRoutines, codeBlocks); } +void JSStack::sanitizeStack() +{ + ASSERT(getTopOfStack() <= getBaseOfStack()); + + if (m_lastStackTop < getTopOfStack()) { + char* begin = reinterpret_cast(m_lastStackTop); + char* end = reinterpret_cast(getTopOfStack()); + memset(begin, 0, end - begin); + } + + m_lastStackTop = getTopOfStack(); +} + void JSStack::releaseExcessCapacity() { ptrdiff_t delta = reinterpret_cast(highAddress()) - reinterpret_cast(m_commitEnd); diff --git a/JavaScriptCore/interpreter/JSStack.h b/JavaScriptCore/interpreter/JSStack.h index 10463e43..91f93e2b 100644 --- a/JavaScriptCore/interpreter/JSStack.h +++ b/JavaScriptCore/interpreter/JSStack.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008, 2009 Apple Inc. All rights reserved. + * Copyright (C) 2008, 2009, 2013 Apple Inc. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -35,6 +35,7 @@ #include #include +#define ENABLE_DEBUG_JSSTACK 0 #if !defined(NDEBUG) && !defined(ENABLE_DEBUG_JSSTACK) #define ENABLE_DEBUG_JSSTACK 1 #endif @@ -81,13 +82,13 @@ namespace JSC { void gatherConservativeRoots(ConservativeRoots&); void gatherConservativeRoots(ConservativeRoots&, JITStubRoutineSet&, CodeBlockSet&); + void sanitizeStack(); Register* getBaseOfStack() const { return highAddress() - 1; } - Register* getLimitOfStack() const { return m_end; } size_t size() const { return highAddress() - lowAddress(); } bool grow(Register*); @@ -95,18 +96,13 @@ namespace JSC { static size_t committedByteCount(); static void initializeThreading(); - Register* const * addressOfEnd() const - { - return &m_end; - } - Register* getTopOfFrame(CallFrame*); Register* getStartOfFrame(CallFrame*); Register* getTopOfStack(); - Register* end() const { return m_end; } - CallFrame* pushFrame(CallFrame* callerFrame, class CodeBlock*, - JSScope*, int argsCount, JSObject* callee); + bool entryCheck(class CodeBlock*, int); + + CallFrame* pushFrame(class CodeBlock*, JSScope*, int argsCount, JSObject* callee); void popFrame(CallFrame*); @@ -153,31 +149,19 @@ namespace JSC { void releaseExcessCapacity(); void addToCommittedByteCount(long); + void updateStackLimit(Register* newEnd); + + VM& m_vm; Register* m_end; Register* m_commitEnd; Register* m_useableEnd; PageReservation m_reservation; CallFrame*& m_topCallFrame; + Register* m_lastStackTop; friend class LLIntOffsetsExtractor; }; - inline void JSStack::shrink(Register* newEnd) - { - if (newEnd >= m_end) - return; - m_end = newEnd; - if (m_end == getBaseOfStack() && (m_commitEnd - getBaseOfStack()) >= maxExcessCapacity) - releaseExcessCapacity(); - } - - inline bool JSStack::grow(Register* newEnd) - { - if (newEnd >= m_end) - return true; - return growSlowCase(newEnd); - } - } // namespace JSC #endif // JSStack_h diff --git a/JavaScriptCore/interpreter/JSStackInlines.h b/JavaScriptCore/interpreter/JSStackInlines.h index c321b82b..5a2aff11 100644 --- a/JavaScriptCore/interpreter/JSStackInlines.h +++ b/JavaScriptCore/interpreter/JSStackInlines.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2012 Apple Inc. All rights reserved. + * Copyright (C) 2012, 2013 Apple Inc. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -29,6 +29,7 @@ #include "CallFrame.h" #include "CodeBlock.h" #include "JSStack.h" +#include "VM.h" namespace JSC { @@ -46,12 +47,40 @@ inline Register* JSStack::getTopOfStack() inline Register* JSStack::getStartOfFrame(CallFrame* frame) { - CallFrame* callerFrame = frame->callerFrameNoFlags(); + CallFrame* callerFrame = frame->callerFrameSkippingVMEntrySentinel(); return getTopOfFrame(callerFrame); } -inline CallFrame* JSStack::pushFrame(CallFrame* callerFrame, - class CodeBlock* codeBlock, JSScope* scope, int argsCount, JSObject* callee) +inline bool JSStack::entryCheck(class CodeBlock* codeBlock, int argsCount) +{ + Register* oldEnd = getTopOfStack(); + + // Ensure that we have enough space for the parameters: + size_t paddedArgsCount = argsCount; + if (codeBlock) { + size_t numParameters = codeBlock->numParameters(); + if (paddedArgsCount < numParameters) + paddedArgsCount = numParameters; + } + + Register* newCallFrameSlot = oldEnd - paddedArgsCount - (2 * JSStack::CallFrameHeaderSize) + 1; + +#if ENABLE(DEBUG_JSSTACK) + newCallFrameSlot -= JSStack::FenceSize; +#endif + + Register* newEnd = newCallFrameSlot; + if (!!codeBlock) + newEnd += virtualRegisterForLocal(codeBlock->frameRegisterCount()).offset(); + + // Ensure that we have the needed stack capacity to push the new frame: + if (!grow(newEnd)) + return false; + + return true; +} + +inline CallFrame* JSStack::pushFrame(class CodeBlock* codeBlock, JSScope* scope, int argsCount, JSObject* callee) { ASSERT(!!scope); Register* oldEnd = getTopOfStack(); @@ -64,7 +93,7 @@ inline CallFrame* JSStack::pushFrame(CallFrame* callerFrame, paddedArgsCount = numParameters; } - Register* newCallFrameSlot = oldEnd - paddedArgsCount - JSStack::CallFrameHeaderSize; + Register* newCallFrameSlot = oldEnd - paddedArgsCount - (2 * JSStack::CallFrameHeaderSize) + 1; #if ENABLE(DEBUG_JSSTACK) newCallFrameSlot -= JSStack::FenceSize; @@ -72,12 +101,16 @@ inline CallFrame* JSStack::pushFrame(CallFrame* callerFrame, Register* newEnd = newCallFrameSlot; if (!!codeBlock) - newEnd += virtualRegisterForLocal(codeBlock->m_numCalleeRegisters).offset(); + newEnd += virtualRegisterForLocal(codeBlock->frameRegisterCount()).offset(); // Ensure that we have the needed stack capacity to push the new frame: if (!grow(newEnd)) return 0; + // Compute the address of the new VM sentinel frame for this invocation: + CallFrame* newVMEntrySentinelFrame = CallFrame::create(newCallFrameSlot + paddedArgsCount + JSStack::CallFrameHeaderSize); + ASSERT(!!newVMEntrySentinelFrame); + // Compute the address of the new frame for this invocation: CallFrame* newCallFrame = CallFrame::create(newCallFrameSlot); ASSERT(!!newCallFrame); @@ -85,11 +118,13 @@ inline CallFrame* JSStack::pushFrame(CallFrame* callerFrame, // The caller frame should always be the real previous frame on the stack, // and not a potential GlobalExec that was passed in. Point callerFrame to // the top frame on the stack. - callerFrame = m_topCallFrame; + CallFrame* callerFrame = m_topCallFrame; + + // Initialize the VM sentinel frame header: + newVMEntrySentinelFrame->initializeVMEntrySentinelFrame(callerFrame); - // Initialize the frame header: - newCallFrame->init(codeBlock, 0, scope, - callerFrame->addHostCallFrameFlag(), argsCount, callee); + // Initialize the callee frame header: + newCallFrame->init(codeBlock, 0, scope, newVMEntrySentinelFrame, argsCount, callee); ASSERT(!!newCallFrame->scope()); @@ -112,7 +147,9 @@ inline CallFrame* JSStack::pushFrame(CallFrame* callerFrame, inline void JSStack::popFrame(CallFrame* frame) { validateFence(frame, __FUNCTION__, __LINE__); - CallFrame* callerFrame = frame->callerFrameNoFlags(); + + // Pop off the callee frame and the sentinel frame. + CallFrame* callerFrame = frame->callerFrame()->vmEntrySentinelCallerFrame(); // Pop to the caller: m_topCallFrame = callerFrame; @@ -127,6 +164,29 @@ inline void JSStack::popFrame(CallFrame* frame) installTrapsAfterFrame(callerFrame); } +inline void JSStack::shrink(Register* newEnd) +{ + if (newEnd >= m_end) + return; + updateStackLimit(newEnd); + if (m_end == getBaseOfStack() && (m_commitEnd - getBaseOfStack()) >= maxExcessCapacity) + releaseExcessCapacity(); +} + +inline bool JSStack::grow(Register* newEnd) +{ + if (newEnd >= m_end) + return true; + return growSlowCase(newEnd); +} + +inline void JSStack::updateStackLimit(Register* newEnd) +{ + m_end = newEnd; +#if USE(SEPARATE_C_AND_JS_STACK) + m_vm.setJSStackLimit(newEnd); +#endif +} #if ENABLE(DEBUG_JSSTACK) inline JSValue JSStack::generateFenceValue(size_t argIndex) @@ -151,6 +211,8 @@ inline JSValue JSStack::generateFenceValue(size_t argIndex) // |--------------------------------------| // | *** the Fence *** | // |--------------------------------------| +// | VM entry sentinel frame header | +// |--------------------------------------| // | Args of new frame | // |--------------------------------------| // | Frame Header of new frame | diff --git a/JavaScriptCore/interpreter/ProtoCallFrame.cpp b/JavaScriptCore/interpreter/ProtoCallFrame.cpp new file mode 100644 index 00000000..a3600143 --- /dev/null +++ b/JavaScriptCore/interpreter/ProtoCallFrame.cpp @@ -0,0 +1,51 @@ +/* + * Copyright (C) 2013 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 "ProtoCallFrame.h" + +#include "CodeBlock.h" + +namespace JSC { + +void ProtoCallFrame::init(CodeBlock* codeBlock, JSScope* scope, JSObject* callee, JSValue thisValue, int argCountIncludingThis, JSValue* otherArgs) +{ + this->args = otherArgs; + this->setCodeBlock(codeBlock); + this->setScope(scope); + this->setCallee(callee); + this->setArgumentCountIncludingThis(argCountIncludingThis); + size_t paddedArgsCount = argCountIncludingThis; + if (codeBlock) { + size_t numParameters = codeBlock->numParameters(); + if (paddedArgsCount < numParameters) + paddedArgsCount = numParameters; + } + this->setPaddedArgsCount(paddedArgsCount); + this->clearCurrentVPC(); + this->setThisValue(thisValue); +} + +} // namespace JSC diff --git a/JavaScriptCore/interpreter/ProtoCallFrame.h b/JavaScriptCore/interpreter/ProtoCallFrame.h new file mode 100644 index 00000000..b7151eef --- /dev/null +++ b/JavaScriptCore/interpreter/ProtoCallFrame.h @@ -0,0 +1,77 @@ +/* + * Copyright (C) 2013 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. + */ + +#ifndef ProtoCallFrame_h +#define ProtoCallFrame_h + +#include "Register.h" + +namespace JSC { + +struct ProtoCallFrame { + Register codeBlockValue; + Register scopeChainValue; + Register calleeValue; + Register argCountAndCodeOriginValue; + Register thisArg; + size_t paddedArgCount; + JSValue *args; + + void init(CodeBlock*, JSScope*, JSObject*, JSValue, int, JSValue* otherArgs = 0); + + CodeBlock* codeBlock() const { return codeBlockValue.Register::codeBlock(); } + void setCodeBlock(CodeBlock* codeBlock) { codeBlockValue = codeBlock; } + + JSScope* scope() const { return scopeChainValue.Register::scope(); } + void setScope(JSScope* scope) { scopeChainValue = scope; } + + JSObject* callee() const { return calleeValue.Register::function(); } + void setCallee(JSObject* callee) { calleeValue = Register::withCallee(callee); } + + int argumentCountIncludingThis() const { return argCountAndCodeOriginValue.payload(); } + int argumentCount() const { return argumentCountIncludingThis() - 1; } + void setArgumentCountIncludingThis(int count) { argCountAndCodeOriginValue.payload() = count; } + void setPaddedArgsCount(size_t argCount) { paddedArgCount = argCount; } + + void clearCurrentVPC() { argCountAndCodeOriginValue.tag() = 0; } + + JSValue thisValue() const { return thisArg.Register::jsValue(); } + void setThisValue(JSValue value) { thisArg = value; } + + JSValue argument(size_t argumentIndex) + { + ASSERT(static_cast(argumentIndex) < argumentCount()); + return args[argumentIndex]; + } + void setArgument(size_t argumentIndex, JSValue value) + { + ASSERT(static_cast(argumentIndex) < argumentCount()); + args[argumentIndex] = value; + } +}; + +} // namespace JSC + +#endif // ProtoCallFrame_h diff --git a/JavaScriptCore/interpreter/Register.h b/JavaScriptCore/interpreter/Register.h index 8573ad11..13a7e586 100644 --- a/JavaScriptCore/interpreter/Register.h +++ b/JavaScriptCore/interpreter/Register.h @@ -54,11 +54,13 @@ namespace JSC { JSValue jsValue() const; EncodedJSValue encodedJSValue() const; + Register& operator=(CallFrame*); Register& operator=(CodeBlock*); Register& operator=(JSScope*); int32_t i() const; JSActivation* activation() const; + CallFrame* callFrame() const; CodeBlock* codeBlock() const; JSObject* function() const; JSPropertyNameIterator* propertyNameIterator() const; @@ -85,6 +87,7 @@ namespace JSC { private: union { EncodedJSValue value; + CallFrame* callFrame; CodeBlock* codeBlock; EncodedValueDescriptor encodedValue; double number; @@ -122,6 +125,12 @@ namespace JSC { // Interpreter functions + ALWAYS_INLINE Register& Register::operator=(CallFrame* callFrame) + { + u.callFrame = callFrame; + return *this; + } + ALWAYS_INLINE Register& Register::operator=(CodeBlock* codeBlock) { u.codeBlock = codeBlock; @@ -133,6 +142,11 @@ namespace JSC { return jsValue().asInt32(); } + ALWAYS_INLINE CallFrame* Register::callFrame() const + { + return u.callFrame; + } + ALWAYS_INLINE CodeBlock* Register::codeBlock() const { return u.codeBlock; diff --git a/JavaScriptCore/interpreter/StackVisitor.cpp b/JavaScriptCore/interpreter/StackVisitor.cpp index a9e23ad4..d922e7f8 100644 --- a/JavaScriptCore/interpreter/StackVisitor.cpp +++ b/JavaScriptCore/interpreter/StackVisitor.cpp @@ -56,7 +56,7 @@ void StackVisitor::gotoNextFrame() void StackVisitor::readFrame(CallFrame* callFrame) { - ASSERT(!callFrame->hasHostCallFrameFlag()); + ASSERT(!callFrame->isVMEntrySentinel()); if (!callFrame) { m_frame.setToEnd(); return; @@ -104,7 +104,7 @@ void StackVisitor::readNonInlinedFrame(CallFrame* callFrame, CodeOrigin* codeOri { m_frame.m_callFrame = callFrame; m_frame.m_argumentCountIncludingThis = callFrame->argumentCountIncludingThis(); - m_frame.m_callerFrame = callFrame->callerFrame()->removeHostCallFrameFlag(); + m_frame.m_callerFrame = callFrame->callerFrameSkippingVMEntrySentinel(); m_frame.m_callee = callFrame->callee(); m_frame.m_scope = callFrame->scope(); m_frame.m_codeBlock = callFrame->codeBlock(); @@ -127,7 +127,7 @@ static int inlinedFrameOffset(CodeOrigin* codeOrigin) void StackVisitor::readInlinedFrame(CallFrame* callFrame, CodeOrigin* codeOrigin) { ASSERT(codeOrigin); - ASSERT(!callFrame->hasHostCallFrameFlag()); + ASSERT(!callFrame->isVMEntrySentinel()); int frameOffset = inlinedFrameOffset(codeOrigin); bool isInlined = !!frameOffset; @@ -380,7 +380,7 @@ void StackVisitor::Frame::print(int indentLevel) printif(i, " name '%s'\n", functionName().utf8().data()); printif(i, " sourceURL '%s'\n", sourceURL().utf8().data()); - printif(i, " hostFlag %d\n", callerFrame->hasHostCallFrameFlag()); + printif(i, " isVMEntrySentinel %d\n", callerFrame->isVMEntrySentinel()); #if ENABLE(DFG_JIT) printif(i, " isInlinedFrame %d\n", isInlinedFrame()); @@ -390,7 +390,7 @@ void StackVisitor::Frame::print(int indentLevel) printif(i, " callee %p\n", callee()); printif(i, " returnPC %p\n", returnPC); - printif(i, " callerFrame %p\n", callerFrame->removeHostCallFrameFlag()); + printif(i, " callerFrame %p\n", callerFrame); unsigned locationRawBits = callFrame->locationAsRawBits(); printif(i, " rawLocationBits %u 0x%x\n", locationRawBits, locationRawBits); printif(i, " codeBlock %p\n", codeBlock); diff --git a/JavaScriptCore/interpreter/VMInspector.cpp b/JavaScriptCore/interpreter/VMInspector.cpp index 58bc1507..fbb49413 100644 --- a/JavaScriptCore/interpreter/VMInspector.cpp +++ b/JavaScriptCore/interpreter/VMInspector.cpp @@ -28,7 +28,6 @@ #if ENABLE(VMINSPECTOR) -#include #include #include @@ -102,7 +101,7 @@ void VMInspector::dumpFrame(CallFrame* frame, const char* prefix, int VMInspector::countFrames(CallFrame* frame) { int count = -1; - while (frame && !frame->hasHostCallFrameFlag()) { + while (frame && !frame->isVMEntrySentinel()) { count++; frame = frame->callerFrame(); } diff --git a/JavaScriptCore/jit/AssemblyHelpers.h b/JavaScriptCore/jit/AssemblyHelpers.h index b81d1e45..36d58313 100644 --- a/JavaScriptCore/jit/AssemblyHelpers.h +++ b/JavaScriptCore/jit/AssemblyHelpers.h @@ -46,7 +46,7 @@ class AssemblyHelpers : public MacroAssembler { AssemblyHelpers(VM* vm, CodeBlock* codeBlock) : m_vm(vm) , m_codeBlock(codeBlock) - , m_baselineCodeBlock(codeBlock ? codeBlock->baselineVersion() : 0) + , m_baselineCodeBlock(codeBlock ? codeBlock->baselineAlternative() : 0) { if (m_codeBlock) { ASSERT(m_baselineCodeBlock); @@ -176,6 +176,11 @@ class AssemblyHelpers : public MacroAssembler { { return Address(GPRInfo::callFrameRegister, byteOffset); } + static Address addressFor(VirtualRegister virtualRegister, GPRReg baseReg) + { + ASSERT(virtualRegister.isValid()); + return Address(baseReg, virtualRegister.offset() * sizeof(Register)); + } static Address addressFor(VirtualRegister virtualRegister) { ASSERT(virtualRegister.isValid()); @@ -320,6 +325,10 @@ class AssemblyHelpers : public MacroAssembler { return fpr; } + // Here are possible arrangements of source, target, scratch: + // - source, target, scratch can all be separate registers. + // - source and target can be the same but scratch is separate. + // - target and scratch can be the same but source is separate. void boxInt52(GPRReg source, GPRReg target, GPRReg scratch, FPRReg fpScratch) { // Is it an int32? @@ -426,7 +435,7 @@ class AssemblyHelpers : public MacroAssembler { return baselineArgumentsRegisterFor(codeOrigin.inlineCallFrame); } - SharedSymbolTable* symbolTableFor(const CodeOrigin& codeOrigin) + SymbolTable* symbolTableFor(const CodeOrigin& codeOrigin) { return baselineCodeBlockFor(codeOrigin)->symbolTable(); } diff --git a/JavaScriptCore/jit/CCallHelpers.h b/JavaScriptCore/jit/CCallHelpers.h index b86c9a71..836573be 100644 --- a/JavaScriptCore/jit/CCallHelpers.h +++ b/JavaScriptCore/jit/CCallHelpers.h @@ -95,6 +95,44 @@ class CCallHelpers : public AssemblyHelpers { addCallArgument(arg2); } + ALWAYS_INLINE void setupArguments(GPRReg arg1, GPRReg arg2, GPRReg arg3) + { + resetCallArguments(); + addCallArgument(arg1); + addCallArgument(arg2); + addCallArgument(arg3); + } + + ALWAYS_INLINE void setupArguments(GPRReg arg1, GPRReg arg2, TrustedImmPtr arg3, TrustedImmPtr arg4) + { + resetCallArguments(); + addCallArgument(arg1); + addCallArgument(arg2); + addCallArgument(arg3); + addCallArgument(arg4); + } + + ALWAYS_INLINE void setupArguments(GPRReg arg1, GPRReg arg2, TrustedImmPtr arg3, TrustedImm32 arg4, GPRReg arg5) + { + resetCallArguments(); + addCallArgument(arg1); + addCallArgument(arg2); + addCallArgument(arg3); + addCallArgument(arg4); + addCallArgument(arg5); + } + + ALWAYS_INLINE void setupArguments(GPRReg arg1, GPRReg arg2, TrustedImmPtr arg3, TrustedImm32 arg4, GPRReg arg5, GPRReg arg6) + { + resetCallArguments(); + addCallArgument(arg1); + addCallArgument(arg2); + addCallArgument(arg3); + addCallArgument(arg4); + addCallArgument(arg5); + addCallArgument(arg6); + } + ALWAYS_INLINE void setupArguments(TrustedImmPtr arg1) { resetCallArguments(); @@ -692,7 +730,7 @@ class CCallHelpers : public AssemblyHelpers { setupThreeStubArgsGPR(arg1, arg2, arg3); } -#if CPU(MIPS) +#if CPU(MIPS) || (OS(WINDOWS) && CPU(X86_64)) #define POKE_ARGUMENT_OFFSET 4 #else #define POKE_ARGUMENT_OFFSET 0 @@ -906,6 +944,24 @@ class CCallHelpers : public AssemblyHelpers { setupTwoStubArgsGPR(arg1, arg2); } + ALWAYS_INLINE void setupArguments(GPRReg arg1, GPRReg arg2, GPRReg arg3) + { + setupThreeStubArgsGPR(arg1, arg2, arg3); + } + + ALWAYS_INLINE void setupArguments(GPRReg arg1, GPRReg arg2, TrustedImmPtr arg3, TrustedImmPtr arg4) + { + setupTwoStubArgsGPR(arg1, arg2); + move(arg3, GPRInfo::argumentGPR2); + move(arg4, GPRInfo::argumentGPR3); + } + + ALWAYS_INLINE void setupArguments(GPRReg arg1, GPRReg arg2, GPRReg arg3, TrustedImmPtr arg4) + { + setupThreeStubArgsGPR(arg1, arg2, arg3); + move(arg4, GPRInfo::argumentGPR3); + } + ALWAYS_INLINE void setupArguments(GPRReg arg1, TrustedImmPtr arg2, GPRReg arg3, TrustedImmPtr arg4) { setupTwoStubArgsGPR(arg1, arg3); @@ -913,6 +969,15 @@ class CCallHelpers : public AssemblyHelpers { move(arg4, GPRInfo::argumentGPR3); } + ALWAYS_INLINE void setupArguments(GPRReg arg1, GPRReg arg2, TrustedImmPtr arg3, TrustedImm32 arg4, GPRReg arg5, GPRReg arg6) + { + poke(arg6, POKE_ARGUMENT_OFFSET + 1); + poke(arg5, POKE_ARGUMENT_OFFSET); + setupTwoStubArgsGPR(arg1, arg2); + move(arg3, GPRInfo::argumentGPR2); + move(arg4, GPRInfo::argumentGPR3); + } + ALWAYS_INLINE void setupArguments(TrustedImmPtr arg1) { move(arg1, GPRInfo::argumentGPR0); @@ -1427,6 +1492,23 @@ class CCallHelpers : public AssemblyHelpers { poke(arg4, POKE_ARGUMENT_OFFSET); setupArgumentsWithExecState(arg1, arg2, arg3); } + + ALWAYS_INLINE void setupArgumentsWithExecState(TrustedImm32 arg1, GPRReg arg2, GPRReg arg3, TrustedImm32 arg4, TrustedImm32 arg5, GPRReg arg6, GPRReg arg7) + { + poke(arg7, POKE_ARGUMENT_OFFSET + 3); + poke(arg6, POKE_ARGUMENT_OFFSET + 2); + poke(arg5, POKE_ARGUMENT_OFFSET + 1); + poke(arg4, POKE_ARGUMENT_OFFSET); + setupArgumentsWithExecState(arg1, arg2, arg3); + } + + ALWAYS_INLINE void setupArguments(GPRReg arg1, GPRReg arg2, TrustedImmPtr arg3, TrustedImm32 arg4, GPRReg arg5) + { + poke(arg5, POKE_ARGUMENT_OFFSET); + setupTwoStubArgsGPR(arg1, arg2); + move(arg3, GPRInfo::argumentGPR2); + move(arg4, GPRInfo::argumentGPR3); + } #endif // NUMBER_OF_ARGUMENT_REGISTERS == 4 #if NUMBER_OF_ARGUMENT_REGISTERS >= 5 @@ -1457,6 +1539,20 @@ class CCallHelpers : public AssemblyHelpers { move(arg4, GPRInfo::argumentGPR4); move(GPRInfo::callFrameRegister, GPRInfo::argumentGPR0); } + + ALWAYS_INLINE void setupArguments(GPRReg arg1, TrustedImmPtr arg2, GPRReg arg3, GPRReg arg4, TrustedImmPtr arg5) + { + setupThreeStubArgsGPR(arg1, arg3, arg4); + move(arg2, GPRInfo::argumentGPR1); + move(arg5, GPRInfo::argumentGPR4); + } + + ALWAYS_INLINE void setupArguments(GPRReg arg1, GPRReg arg2, TrustedImmPtr arg3, TrustedImm32 arg4, GPRReg arg5) + { + setupThreeStubArgsGPR(arg1, arg2, arg5); + move(arg3, GPRInfo::argumentGPR2); + move(arg4, GPRInfo::argumentGPR3); + } #endif void setupResults(GPRReg destA, GPRReg destB) @@ -1484,10 +1580,7 @@ class CCallHelpers : public AssemblyHelpers { { // genericUnwind() leaves the handler CallFrame* in vm->callFrameForThrow, // and the address of the handler in vm->targetMachinePCForThrow. - // The exception handler expects the CallFrame* in regT0. - move(TrustedImmPtr(vm()), GPRInfo::regT0); - loadPtr(Address(GPRInfo::regT0, VM::targetMachinePCForThrowOffset()), GPRInfo::regT1); - loadPtr(Address(GPRInfo::regT0, VM::callFrameForThrowOffset()), GPRInfo::regT0); + loadPtr(&vm()->targetMachinePCForThrow, GPRInfo::regT1); jump(GPRInfo::regT1); } }; diff --git a/JavaScriptCore/jit/ExecutableAllocator.h b/JavaScriptCore/jit/ExecutableAllocator.h index 1f3ad03a..01be7c1a 100644 --- a/JavaScriptCore/jit/ExecutableAllocator.h +++ b/JavaScriptCore/jit/ExecutableAllocator.h @@ -40,7 +40,7 @@ #include #endif -#if OS(IOS) || OS(QNX) +#if OS(IOS) #include #endif diff --git a/JavaScriptCore/jit/FPRInfo.h b/JavaScriptCore/jit/FPRInfo.h index 8027d01c..5bb0e16c 100644 --- a/JavaScriptCore/jit/FPRInfo.h +++ b/JavaScriptCore/jit/FPRInfo.h @@ -34,13 +34,14 @@ namespace JSC { typedef MacroAssembler::FPRegisterID FPRReg; #define InvalidFPRReg ((::JSC::FPRReg)-1) +#if ENABLE(JIT) + #if CPU(X86) || CPU(X86_64) class FPRInfo { public: typedef FPRReg RegisterType; static const unsigned numberOfRegisters = 6; - static const unsigned numberOfArgumentRegisters = 8; // Temporary registers. static const FPRReg fpRegT0 = X86Registers::xmm0; @@ -74,7 +75,10 @@ class FPRInfo { } static unsigned toIndex(FPRReg reg) { - return (unsigned)reg; + unsigned result = (unsigned)reg; + if (result >= numberOfRegisters) + return InvalidIndex; + return result; } static FPRReg toArgumentRegister(unsigned index) @@ -102,9 +106,11 @@ class FPRInfo { #endif return nameForRegister[reg]; } + + static const unsigned InvalidIndex = 0xffffffff; }; -#endif +#endif // CPU(X86) || CPU(X86_64) #if CPU(ARM) @@ -164,9 +170,11 @@ class FPRInfo { }; return nameForRegister[reg]; } + + static const unsigned InvalidIndex = 0xffffffff; }; -#endif +#endif // CPU(ARM) #if CPU(ARM64) @@ -251,11 +259,10 @@ class FPRInfo { return nameForRegister[reg]; } -private: static const unsigned InvalidIndex = 0xffffffff; }; -#endif +#endif // CPU(ARM64) #if CPU(MIPS) @@ -318,12 +325,11 @@ class FPRInfo { }; return nameForRegister[reg]; } -private: static const unsigned InvalidIndex = 0xffffffff; }; -#endif +#endif // CPU(MIPS) #if CPU(SH4) @@ -382,11 +388,12 @@ class FPRInfo { return nameForRegister[reg]; } -private: static const unsigned InvalidIndex = 0xffffffff; }; -#endif +#endif // CPU(SH4) + +#endif // ENABLE(JIT) } // namespace JSC diff --git a/JavaScriptCore/jit/GPRInfo.h b/JavaScriptCore/jit/GPRInfo.h index b2f3aeff..393a56b5 100644 --- a/JavaScriptCore/jit/GPRInfo.h +++ b/JavaScriptCore/jit/GPRInfo.h @@ -34,6 +34,8 @@ namespace JSC { typedef MacroAssembler::RegisterID GPRReg; #define InvalidGPRReg ((::JSC::GPRReg)-1) +#if ENABLE(JIT) + #if USE(JSVALUE64) class JSValueRegs { public: @@ -125,7 +127,7 @@ class JSValueSource { int32_t m_offset; GPRReg m_base; }; -#endif +#endif // USE(JSVALUE64) #if USE(JSVALUE32_64) class JSValueRegs { @@ -276,7 +278,9 @@ class JSValueSource { int8_t m_payload; int8_t m_tagType; // Contains the low bits of the tag. }; -#endif +#endif // USE(JSVALUE32_64) + +// The baseline JIT requires that regT3 be callee-preserved. #if CPU(X86) #define NUMBER_OF_ARGUMENT_REGISTERS 0u @@ -284,25 +288,28 @@ class JSValueSource { class GPRInfo { public: typedef GPRReg RegisterType; - static const unsigned numberOfRegisters = 5; + static const unsigned numberOfRegisters = 6; static const unsigned numberOfArgumentRegisters = NUMBER_OF_ARGUMENT_REGISTERS; + // Note: regT3 is required to be callee-preserved. + // Temporary registers. static const GPRReg regT0 = X86Registers::eax; static const GPRReg regT1 = X86Registers::edx; static const GPRReg regT2 = X86Registers::ecx; static const GPRReg regT3 = X86Registers::ebx; - static const GPRReg regT4 = X86Registers::esi; + static const GPRReg regT4 = X86Registers::edi; + static const GPRReg regT5 = X86Registers::esi; // These registers match the baseline JIT. static const GPRReg cachedResultRegister = regT0; static const GPRReg cachedResultRegister2 = regT1; - static const GPRReg callFrameRegister = X86Registers::edi; + static const GPRReg callFrameRegister = X86Registers::ebp; // These constants provide the names for the general purpose argument & return value registers. static const GPRReg argumentGPR0 = X86Registers::ecx; // regT2 static const GPRReg argumentGPR1 = X86Registers::edx; // regT1 - static const GPRReg nonArgGPR0 = X86Registers::eax; // regT0 - static const GPRReg nonArgGPR1 = X86Registers::ebx; // regT3 - static const GPRReg nonArgGPR2 = X86Registers::esi; // regT4 + static const GPRReg nonArgGPR0 = X86Registers::esi; // regT4 + static const GPRReg nonArgGPR1 = X86Registers::eax; // regT0 + static const GPRReg nonArgGPR2 = X86Registers::ebx; // regT3 static const GPRReg returnValueGPR = X86Registers::eax; // regT0 static const GPRReg returnValueGPR2 = X86Registers::edx; // regT1 static const GPRReg nonPreservedNonReturnGPR = X86Registers::ecx; @@ -310,7 +317,7 @@ class GPRInfo { static GPRReg toRegister(unsigned index) { ASSERT(index < numberOfRegisters); - static const GPRReg registerForIndex[numberOfRegisters] = { regT0, regT1, regT2, regT3, regT4 }; + static const GPRReg registerForIndex[numberOfRegisters] = { regT0, regT1, regT2, regT3, regT4, regT5 }; return registerForIndex[index]; } @@ -318,7 +325,7 @@ class GPRInfo { { ASSERT(reg != InvalidGPRReg); ASSERT(static_cast(reg) < 8); - static const unsigned indexForRegister[8] = { 0, 2, 1, 3, InvalidIndex, InvalidIndex, 4, InvalidIndex }; + static const unsigned indexForRegister[8] = { 0, 2, 1, 3, InvalidIndex, InvalidIndex, 5, 4 }; unsigned result = indexForRegister[reg]; ASSERT(result != InvalidIndex); return result; @@ -334,25 +341,30 @@ class GPRInfo { }; return nameForRegister[reg]; } -private: static const unsigned InvalidIndex = 0xffffffff; }; -#endif +#endif // CPU(X86) #if CPU(X86_64) +#if !OS(WINDOWS) #define NUMBER_OF_ARGUMENT_REGISTERS 6u +#else +#define NUMBER_OF_ARGUMENT_REGISTERS 4u +#endif class GPRInfo { public: typedef GPRReg RegisterType; - static const unsigned numberOfRegisters = 9; + static const unsigned numberOfRegisters = 11; static const unsigned numberOfArgumentRegisters = NUMBER_OF_ARGUMENT_REGISTERS; + // Note: regT3 is required to be callee-preserved. + // These registers match the baseline JIT. static const GPRReg cachedResultRegister = X86Registers::eax; - static const GPRReg callFrameRegister = X86Registers::r13; + static const GPRReg callFrameRegister = X86Registers::ebp; static const GPRReg tagTypeNumberRegister = X86Registers::r14; static const GPRReg tagMaskRegister = X86Registers::r15; // Temporary registers. @@ -365,16 +377,25 @@ class GPRInfo { static const GPRReg regT6 = X86Registers::r8; static const GPRReg regT7 = X86Registers::r9; static const GPRReg regT8 = X86Registers::r10; + static const GPRReg regT9 = X86Registers::r12; + static const GPRReg regT10 = X86Registers::r13; // These constants provide the names for the general purpose argument & return value registers. +#if !OS(WINDOWS) static const GPRReg argumentGPR0 = X86Registers::edi; // regT4 static const GPRReg argumentGPR1 = X86Registers::esi; // regT5 static const GPRReg argumentGPR2 = X86Registers::edx; // regT1 static const GPRReg argumentGPR3 = X86Registers::ecx; // regT2 static const GPRReg argumentGPR4 = X86Registers::r8; // regT6 static const GPRReg argumentGPR5 = X86Registers::r9; // regT7 - static const GPRReg nonArgGPR0 = X86Registers::eax; // regT0 +#else + static const GPRReg argumentGPR0 = X86Registers::ecx; + static const GPRReg argumentGPR1 = X86Registers::edx; + static const GPRReg argumentGPR2 = X86Registers::r8; // regT6 + static const GPRReg argumentGPR3 = X86Registers::r9; // regT7 +#endif + static const GPRReg nonArgGPR0 = X86Registers::r10; // regT8 static const GPRReg nonArgGPR1 = X86Registers::ebx; // regT3 - static const GPRReg nonArgGPR2 = X86Registers::r10; // regT8 + static const GPRReg nonArgGPR2 = X86Registers::r12; // regT9 static const GPRReg returnValueGPR = X86Registers::eax; // regT0 static const GPRReg returnValueGPR2 = X86Registers::edx; // regT1 static const GPRReg nonPreservedNonReturnGPR = X86Registers::esi; @@ -382,14 +403,18 @@ class GPRInfo { static GPRReg toRegister(unsigned index) { ASSERT(index < numberOfRegisters); - static const GPRReg registerForIndex[numberOfRegisters] = { regT0, regT1, regT2, regT3, regT4, regT5, regT6, regT7, regT8 }; + static const GPRReg registerForIndex[numberOfRegisters] = { regT0, regT1, regT2, regT3, regT4, regT5, regT6, regT7, regT8, regT9, regT10 }; return registerForIndex[index]; } static GPRReg toArgumentRegister(unsigned index) { ASSERT(index < numberOfArgumentRegisters); +#if !OS(WINDOWS) static const GPRReg registerForIndex[numberOfArgumentRegisters] = { argumentGPR0, argumentGPR1, argumentGPR2, argumentGPR3, argumentGPR4, argumentGPR5 }; +#else + static const GPRReg registerForIndex[numberOfArgumentRegisters] = { argumentGPR0, argumentGPR1, argumentGPR2, argumentGPR3 }; +#endif return registerForIndex[index]; } @@ -397,10 +422,8 @@ class GPRInfo { { ASSERT(reg != InvalidGPRReg); ASSERT(static_cast(reg) < 16); - static const unsigned indexForRegister[16] = { 0, 2, 1, 3, InvalidIndex, InvalidIndex, 5, 4, 6, 7, 8, InvalidIndex, InvalidIndex, InvalidIndex, InvalidIndex, InvalidIndex }; - unsigned result = indexForRegister[reg]; - ASSERT(result != InvalidIndex); - return result; + static const unsigned indexForRegister[16] = { 0, 2, 1, 3, InvalidIndex, InvalidIndex, 5, 4, 6, 7, 8, InvalidIndex, 9, 10, InvalidIndex, InvalidIndex }; + return indexForRegister[reg]; } static const char* debugName(GPRReg reg) @@ -415,12 +438,11 @@ class GPRInfo { }; return nameForRegister[reg]; } -private: static const unsigned InvalidIndex = 0xffffffff; }; -#endif +#endif // CPU(X86_64) #if CPU(ARM) #define NUMBER_OF_ARGUMENT_REGISTERS 4u @@ -431,6 +453,8 @@ class GPRInfo { static const unsigned numberOfRegisters = 9; static const unsigned numberOfArgumentRegisters = NUMBER_OF_ARGUMENT_REGISTERS; + // Note: regT3 is required to be callee-preserved. + // Temporary registers. static const GPRReg regT0 = ARMRegisters::r0; static const GPRReg regT1 = ARMRegisters::r1; @@ -439,12 +463,16 @@ class GPRInfo { static const GPRReg regT4 = ARMRegisters::r8; static const GPRReg regT5 = ARMRegisters::r9; static const GPRReg regT6 = ARMRegisters::r10; +#if CPU(ARM_THUMB2) static const GPRReg regT7 = ARMRegisters::r11; +#else + static const GPRReg regT7 = ARMRegisters::r7; +#endif static const GPRReg regT8 = ARMRegisters::r3; // These registers match the baseline JIT. static const GPRReg cachedResultRegister = regT0; static const GPRReg cachedResultRegister2 = regT1; - static const GPRReg callFrameRegister = ARMRegisters::r5; + static const GPRReg callFrameRegister = ARMRegisters::fp; // These constants provide the names for the general purpose argument & return value registers. static const GPRReg argumentGPR0 = ARMRegisters::r0; // regT0 static const GPRReg argumentGPR1 = ARMRegisters::r1; // regT1 @@ -455,7 +483,7 @@ class GPRInfo { static const GPRReg nonArgGPR2 = ARMRegisters::r9; // regT5 static const GPRReg returnValueGPR = ARMRegisters::r0; // regT0 static const GPRReg returnValueGPR2 = ARMRegisters::r1; // regT1 - static const GPRReg nonPreservedNonReturnGPR = ARMRegisters::r2; + static const GPRReg nonPreservedNonReturnGPR = ARMRegisters::r5; // regT7 static GPRReg toRegister(unsigned index) { @@ -466,9 +494,14 @@ class GPRInfo { static unsigned toIndex(GPRReg reg) { - ASSERT(static_cast(reg) != InvalidGPRReg); - ASSERT(static_cast(reg) < 16); - static const unsigned indexForRegister[16] = { 0, 1, 2, 8, 3, InvalidIndex, InvalidIndex, InvalidIndex, 4, 5, 6, 7, InvalidIndex, InvalidIndex, InvalidIndex, InvalidIndex }; + ASSERT(reg != InvalidGPRReg); + ASSERT(static_cast(reg) < 16); + static const unsigned indexForRegister[16] = +#if CPU(ARM_THUMB2) + { 0, 1, 2, 8, 3, 9, InvalidIndex, InvalidIndex, 4, 5, 6, 7, InvalidIndex, InvalidIndex, InvalidIndex, InvalidIndex }; +#else + { 0, 1, 2, 8, 3, 9, InvalidIndex, 7, 4, 5, 6, InvalidIndex, InvalidIndex, InvalidIndex, InvalidIndex, InvalidIndex }; +#endif unsigned result = indexForRegister[reg]; ASSERT(result != InvalidIndex); return result; @@ -476,8 +509,8 @@ class GPRInfo { static const char* debugName(GPRReg reg) { - ASSERT(static_cast(reg) != InvalidGPRReg); - ASSERT(static_cast(reg) < 16); + ASSERT(reg != InvalidGPRReg); + ASSERT(static_cast(reg) < 16); static const char* nameForRegister[16] = { "r0", "r1", "r2", "r3", "r4", "r5", "r6", "r7", @@ -486,12 +519,11 @@ class GPRInfo { }; return nameForRegister[reg]; } -private: static const unsigned InvalidIndex = 0xffffffff; }; -#endif +#endif // CPU(ARM) #if CPU(ARM64) #define NUMBER_OF_ARGUMENT_REGISTERS 8u @@ -501,18 +533,20 @@ class GPRInfo { typedef GPRReg RegisterType; static const unsigned numberOfRegisters = 16; + // Note: regT3 is required to be callee-preserved. + // These registers match the baseline JIT. static const GPRReg cachedResultRegister = ARM64Registers::x0; static const GPRReg timeoutCheckRegister = ARM64Registers::x26; - static const GPRReg callFrameRegister = ARM64Registers::x25; + static const GPRReg callFrameRegister = ARM64Registers::fp; static const GPRReg tagTypeNumberRegister = ARM64Registers::x27; static const GPRReg tagMaskRegister = ARM64Registers::x28; // Temporary registers. static const GPRReg regT0 = ARM64Registers::x0; static const GPRReg regT1 = ARM64Registers::x1; static const GPRReg regT2 = ARM64Registers::x2; - static const GPRReg regT3 = ARM64Registers::x3; - static const GPRReg regT4 = ARM64Registers::x4; + static const GPRReg regT3 = ARM64Registers::x23; + static const GPRReg regT4 = ARM64Registers::x24; static const GPRReg regT5 = ARM64Registers::x5; static const GPRReg regT6 = ARM64Registers::x6; static const GPRReg regT7 = ARM64Registers::x7; @@ -579,12 +613,11 @@ class GPRInfo { }; return nameForRegister[reg]; } -private: static const unsigned InvalidIndex = 0xffffffff; }; -#endif +#endif // CPU(ARM64) #if CPU(MIPS) #define NUMBER_OF_ARGUMENT_REGISTERS 4u @@ -592,20 +625,25 @@ class GPRInfo { class GPRInfo { public: typedef GPRReg RegisterType; - static const unsigned numberOfRegisters = 6; + static const unsigned numberOfRegisters = 7; static const unsigned numberOfArgumentRegisters = NUMBER_OF_ARGUMENT_REGISTERS; + // regT0 must be v0 for returning a 32-bit value. + // regT1 must be v1 for returning a pair of 32-bit value. + // regT3 must be saved in the callee, so use an S register. + // Temporary registers. static const GPRReg regT0 = MIPSRegisters::v0; static const GPRReg regT1 = MIPSRegisters::v1; static const GPRReg regT2 = MIPSRegisters::t4; - static const GPRReg regT3 = MIPSRegisters::t5; - static const GPRReg regT4 = MIPSRegisters::t6; - static const GPRReg regT5 = MIPSRegisters::t7; + static const GPRReg regT3 = MIPSRegisters::s2; + static const GPRReg regT4 = MIPSRegisters::t5; + static const GPRReg regT5 = MIPSRegisters::t6; + static const GPRReg regT6 = MIPSRegisters::s0; // These registers match the baseline JIT. static const GPRReg cachedResultRegister = regT0; static const GPRReg cachedResultRegister2 = regT1; - static const GPRReg callFrameRegister = MIPSRegisters::s0; + static const GPRReg callFrameRegister = MIPSRegisters::fp; // These constants provide the names for the general purpose argument & return value registers. static const GPRReg argumentGPR0 = MIPSRegisters::a0; static const GPRReg argumentGPR1 = MIPSRegisters::a1; @@ -621,15 +659,19 @@ class GPRInfo { static GPRReg toRegister(unsigned index) { ASSERT(index < numberOfRegisters); - static const GPRReg registerForIndex[numberOfRegisters] = { regT0, regT1, regT2, regT3, regT4, regT5 }; + static const GPRReg registerForIndex[numberOfRegisters] = { regT0, regT1, regT2, regT3, regT4, regT5, regT6 }; return registerForIndex[index]; } static unsigned toIndex(GPRReg reg) { ASSERT(reg != InvalidGPRReg); - ASSERT(reg < 16); - static const unsigned indexForRegister[16] = { InvalidIndex, InvalidIndex, 0, 1, InvalidIndex, InvalidIndex, InvalidIndex, InvalidIndex, InvalidIndex, InvalidIndex, InvalidIndex, InvalidIndex, 2, 3, 4, 5 }; + ASSERT(reg < 24); + static const unsigned indexForRegister[24] = { + InvalidIndex, InvalidIndex, 0, 1, InvalidIndex, InvalidIndex, InvalidIndex, InvalidIndex, + InvalidIndex, InvalidIndex, InvalidIndex, InvalidIndex, 2, 4, 5, InvalidIndex, + 6, InvalidIndex, 3, InvalidIndex, InvalidIndex, InvalidIndex, InvalidIndex, InvalidIndex + }; unsigned result = indexForRegister[reg]; ASSERT(result != InvalidIndex); return result; @@ -647,12 +689,11 @@ class GPRInfo { }; return nameForRegister[reg]; } -private: static const unsigned InvalidIndex = 0xffffffff; }; -#endif +#endif // CPU(MIPS) #if CPU(SH4) #define NUMBER_OF_ARGUMENT_REGISTERS 4u @@ -662,6 +703,8 @@ class GPRInfo { typedef GPRReg RegisterType; static const unsigned numberOfRegisters = 10; + // Note: regT3 is required to be callee-preserved. + // Temporary registers. static const GPRReg regT0 = SH4Registers::r0; static const GPRReg regT1 = SH4Registers::r1; @@ -717,12 +760,21 @@ class GPRInfo { return nameForRegister[reg]; } -private: static const unsigned InvalidIndex = 0xffffffff; }; +#endif // CPU(SH4) + +// The baseline JIT uses "accumulator" style execution with regT0 (for 64-bit) +// and regT0 + regT1 (for 32-bit) serving as the accumulator register(s) for +// passing results of one opcode to the next. Hence: +COMPILE_ASSERT(GPRInfo::regT0 == GPRInfo::returnValueGPR, regT0_must_equal_returnValueGPR); +#if USE(JSVALUE32_64) +COMPILE_ASSERT(GPRInfo::regT1 == GPRInfo::returnValueGPR2, regT1_must_equal_returnValueGPR2); #endif +#endif // ENABLE(JIT) + } // namespace JSC namespace WTF { diff --git a/JavaScriptCore/jit/JIT.cpp b/JavaScriptCore/jit/JIT.cpp index 16c95876..c3508b01 100644 --- a/JavaScriptCore/jit/JIT.cpp +++ b/JavaScriptCore/jit/JIT.cpp @@ -80,21 +80,9 @@ JIT::JIT(VM* vm, CodeBlock* codeBlock) , m_putByIdIndex(UINT_MAX) , m_byValInstructionIndex(UINT_MAX) , m_callLinkInfoIndex(UINT_MAX) -#if USE(JSVALUE32_64) - , m_jumpTargetIndex(0) - , m_mappedBytecodeOffset((unsigned)-1) - , m_mappedVirtualRegisterIndex(UINT_MAX) - , m_mappedTag((RegisterID)-1) - , m_mappedPayload((RegisterID)-1) -#else - , m_lastResultBytecodeRegister(std::numeric_limits::max()) - , m_jumpTargetsPosition(0) -#endif , m_randomGenerator(cryptographicallyRandomNumber()) -#if ENABLE(VALUE_PROFILER) , m_canBeOptimized(false) , m_shouldEmitProfiling(false) -#endif { } @@ -109,8 +97,8 @@ void JIT::emitEnterOptimizationCheck() skipOptimize.append(branchAdd32(Signed, TrustedImm32(Options::executionCounterIncrementForEntry()), AbsoluteAddress(m_codeBlock->addressOfJITExecuteCounter()))); ASSERT(!m_bytecodeOffset); callOperation(operationOptimize, m_bytecodeOffset); - skipOptimize.append(branchTestPtr(Zero, returnValueRegister)); - jump(returnValueRegister); + skipOptimize.append(branchTestPtr(Zero, returnValueGPR)); + jump(returnValueGPR); skipOptimize.link(this); } #endif @@ -119,37 +107,12 @@ void JIT::emitEnterOptimizationCheck() m_bytecodeOffset += OPCODE_LENGTH(name); \ break; -#if USE(JSVALUE32_64) -#define DEFINE_BINARY_OP(name) \ - case op_##name: { \ - JITSlowPathCall slowPathCall(this, currentInstruction, slow_path_##name); \ - slowPathCall.call(); \ - NEXT_OPCODE(op_##name); \ - } - -#define DEFINE_UNARY_OP(name) \ - case op_##name: { \ - JITSlowPathCall slowPathCall(this, currentInstruction, slow_path_##name); \ - slowPathCall.call(); \ - NEXT_OPCODE(op_##name); \ - } - -#else // USE(JSVALUE32_64) - -#define DEFINE_BINARY_OP(name) \ - case op_##name: { \ - JITSlowPathCall slowPathCall(this, currentInstruction, slow_path_##name); \ - slowPathCall.call(); \ - NEXT_OPCODE(op_##name); \ - } - -#define DEFINE_UNARY_OP(name) \ +#define DEFINE_SLOW_OP(name) \ case op_##name: { \ JITSlowPathCall slowPathCall(this, currentInstruction, slow_path_##name); \ slowPathCall.call(); \ NEXT_OPCODE(op_##name); \ } -#endif // USE(JSVALUE32_64) #define DEFINE_OP(name) \ case name: { \ @@ -181,11 +144,6 @@ void JIT::privateCompileMainPass() sampleInstruction(currentInstruction); #endif -#if USE(JSVALUE64) - if (atJumpTarget()) - killLastResultRegister(); -#endif - m_labels[m_bytecodeOffset] = label(); #if ENABLE(JIT_VERBOSE) @@ -202,16 +160,17 @@ void JIT::privateCompileMainPass() } switch (opcodeID) { - DEFINE_BINARY_OP(del_by_val) - DEFINE_BINARY_OP(in) - DEFINE_BINARY_OP(less) - DEFINE_BINARY_OP(lesseq) - DEFINE_BINARY_OP(greater) - DEFINE_BINARY_OP(greatereq) - DEFINE_UNARY_OP(is_function) - DEFINE_UNARY_OP(is_object) - DEFINE_UNARY_OP(typeof) - + DEFINE_SLOW_OP(del_by_val) + DEFINE_SLOW_OP(in) + DEFINE_SLOW_OP(less) + DEFINE_SLOW_OP(lesseq) + DEFINE_SLOW_OP(greater) + DEFINE_SLOW_OP(greatereq) + DEFINE_SLOW_OP(is_function) + DEFINE_SLOW_OP(is_object) + DEFINE_SLOW_OP(typeof) + + DEFINE_OP(op_touch_entry) DEFINE_OP(op_add) DEFINE_OP(op_bitand) DEFINE_OP(op_bitor) @@ -265,6 +224,7 @@ void JIT::privateCompileMainPass() DEFINE_OP(op_loop_hint) DEFINE_OP(op_lshift) DEFINE_OP(op_mod) + DEFINE_OP(op_captured_mov) DEFINE_OP(op_mov) DEFINE_OP(op_mul) DEFINE_OP(op_negate) @@ -274,6 +234,7 @@ void JIT::privateCompileMainPass() DEFINE_OP(op_new_array_with_size) DEFINE_OP(op_new_array_buffer) DEFINE_OP(op_new_func) + DEFINE_OP(op_new_captured_func) DEFINE_OP(op_new_func_exp) DEFINE_OP(op_new_object) DEFINE_OP(op_new_regexp) @@ -304,6 +265,7 @@ void JIT::privateCompileMainPass() DEFINE_OP(op_ret) DEFINE_OP(op_ret_object_or_this) DEFINE_OP(op_rshift) + DEFINE_OP(op_unsigned) DEFINE_OP(op_urshift) DEFINE_OP(op_strcat) DEFINE_OP(op_stricteq) @@ -365,7 +327,6 @@ void JIT::privateCompileSlowCases() m_byValInstructionIndex = 0; m_callLinkInfoIndex = 0; -#if ENABLE(VALUE_PROFILER) // Use this to assert that slow-path code associates new profiling sites with existing // ValueProfiles rather than creating new ones. This ensures that for a given instruction // (say, get_by_id) we get combined statistics for both the fast-path executions of that @@ -373,24 +334,17 @@ void JIT::privateCompileSlowCases() // new ValueProfiles then the ValueProfiles would no longer be sorted by bytecode offset, // which would break the invariant necessary to use CodeBlock::valueProfileForBytecodeOffset(). unsigned numberOfValueProfiles = m_codeBlock->numberOfValueProfiles(); -#endif for (Vector::iterator iter = m_slowCases.begin(); iter != m_slowCases.end();) { -#if USE(JSVALUE64) - killLastResultRegister(); -#endif - m_bytecodeOffset = iter->to; unsigned firstTo = m_bytecodeOffset; Instruction* currentInstruction = instructionsBegin + m_bytecodeOffset; -#if ENABLE(VALUE_PROFILER) RareCaseProfile* rareCaseProfile = 0; if (shouldEmitProfiling()) rareCaseProfile = m_codeBlock->addRareCaseProfile(m_bytecodeOffset); -#endif #if ENABLE(JIT_VERBOSE) dataLogF("Old JIT emitting slow code for bc#%u at offset 0x%lx.\n", m_bytecodeOffset, (long)debugOffset()); @@ -410,6 +364,7 @@ void JIT::privateCompileSlowCases() DEFINE_SLOWCASE_OP(op_construct) DEFINE_SLOWCASE_OP(op_to_this) DEFINE_SLOWCASE_OP(op_create_this) + DEFINE_SLOWCASE_OP(op_captured_mov) DEFINE_SLOWCASE_OP(op_div) DEFINE_SLOWCASE_OP(op_eq) DEFINE_SLOWCASE_OP(op_get_callee) @@ -452,6 +407,7 @@ void JIT::privateCompileSlowCases() case op_put_by_val_direct: DEFINE_SLOWCASE_OP(op_put_by_val) DEFINE_SLOWCASE_OP(op_rshift) + DEFINE_SLOWCASE_OP(op_unsigned) DEFINE_SLOWCASE_OP(op_urshift) DEFINE_SLOWCASE_OP(op_stricteq) DEFINE_SLOWCASE_OP(op_sub) @@ -469,10 +425,8 @@ void JIT::privateCompileSlowCases() RELEASE_ASSERT_WITH_MESSAGE(iter == m_slowCases.end() || firstTo != iter->to, "Not enough jumps linked in slow case codegen."); RELEASE_ASSERT_WITH_MESSAGE(firstTo == (iter - 1)->to, "Too many jumps linked in slow case codegen."); -#if ENABLE(VALUE_PROFILER) if (shouldEmitProfiling()) add32(TrustedImm32(1), AbsoluteAddress(&rareCaseProfile->m_counter)); -#endif emitJumpSlowToHot(jump(), 0); } @@ -480,9 +434,7 @@ void JIT::privateCompileSlowCases() RELEASE_ASSERT(m_getByIdIndex == m_getByIds.size()); RELEASE_ASSERT(m_putByIdIndex == m_putByIds.size()); RELEASE_ASSERT(m_callLinkInfoIndex == m_callStructureStubCompilationInfo.size()); -#if ENABLE(VALUE_PROFILER) RELEASE_ASSERT(numberOfValueProfiles == m_codeBlock->numberOfValueProfiles()); -#endif #ifndef NDEBUG // Reset this, in order to guard its use with ASSERTs. @@ -492,7 +444,6 @@ void JIT::privateCompileSlowCases() CompilationResult JIT::privateCompile(JITCompilationEffort effort) { -#if ENABLE(VALUE_PROFILER) DFG::CapabilityLevel level = m_codeBlock->capabilityLevel(); switch (level) { case DFG::CannotCompile: @@ -527,7 +478,6 @@ CompilationResult JIT::privateCompile(JITCompilationEffort effort) m_codeBlock->m_shouldAlwaysBeInlined &= canInline(level) && DFG::mightInlineFunction(m_codeBlock); break; } -#endif if (Options::showDisassembly() || m_vm->m_perBytecodeProfiler) m_disassembler = adoptPtr(new JITDisassembler(m_codeBlock)); @@ -559,14 +509,6 @@ CompilationResult JIT::privateCompile(JITCompilationEffort effort) Jump stackCheck; if (m_codeBlock->codeType() == FunctionCode) { -#if ENABLE(DFG_JIT) -#if DFG_ENABLE(SUCCESS_STATS) - static SamplingCounter counter("orignalJIT"); - emitCount(counter); -#endif -#endif - -#if ENABLE(VALUE_PROFILER) ASSERT(m_bytecodeOffset == (unsigned)-1); if (shouldEmitProfiling()) { for (int argument = 0; argument < m_codeBlock->numParameters(); ++argument) { @@ -581,13 +523,12 @@ CompilationResult JIT::privateCompile(JITCompilationEffort effort) load32(Address(callFrameRegister, offset + OBJECT_OFFSETOF(JSValue, u.asBits.payload)), regT0); load32(Address(callFrameRegister, offset + OBJECT_OFFSETOF(JSValue, u.asBits.tag)), regT1); #endif - emitValueProfilingSite(m_codeBlock->valueProfileForArgument(argument), regT4); + emitValueProfilingSite(m_codeBlock->valueProfileForArgument(argument)); } } -#endif - addPtr(TrustedImm32(virtualRegisterForLocal(m_codeBlock->m_numCalleeRegisters).offset() * sizeof(Register)), callFrameRegister, regT1); - stackCheck = branchPtr(Above, AbsoluteAddress(m_vm->interpreter->stack().addressOfEnd()), regT1); + addPtr(TrustedImm32(virtualRegisterForLocal(frameRegisterCountFor(m_codeBlock)).offset() * sizeof(Register)), callFrameRegister, regT1); + stackCheck = branchPtr(Above, AbsoluteAddress(m_vm->addressOfJSStackLimit()), regT1); } Label functionBody = label(); @@ -621,8 +562,8 @@ CompilationResult JIT::privateCompile(JITCompilationEffort effort) m_bytecodeOffset = 0; callOperationWithCallFrameRollbackOnException(m_codeBlock->m_isConstructor ? operationConstructArityCheck : operationCallArityCheck); - if (returnValueRegister != regT0) - move(returnValueRegister, regT0); + if (returnValueGPR != regT0) + move(returnValueGPR, regT0); branchTest32(Zero, regT0).linkTo(beginLabel, this); emitNakedCall(m_vm->getCTIStub(arityFixup).code()); @@ -800,10 +741,8 @@ void JIT::privateCompileExceptionHandlers() Jump doLookup; if (!m_exceptionChecksWithCallFrameRollback.empty()) { - // Remove hostCallFlag from caller m_exceptionChecksWithCallFrameRollback.link(this); emitGetCallerFrameFromCallFrameHeaderPtr(GPRInfo::argumentGPR0); - andPtr(TrustedImm32(safeCast(~CallFrame::hostCallFrameFlag())), GPRInfo::argumentGPR0); doLookup = jump(); } diff --git a/JavaScriptCore/jit/JIT.h b/JavaScriptCore/jit/JIT.h index f8f309f6..29807570 100644 --- a/JavaScriptCore/jit/JIT.h +++ b/JavaScriptCore/jit/JIT.h @@ -243,6 +243,11 @@ namespace JSC { static void linkFor(ExecState*, JSFunction* callee, CodeBlock* callerCodeBlock, CodeBlock* calleeCodeBlock, CodePtr, CallLinkInfo*, VM*, CodeSpecializationKind); static void linkSlowCall(CodeBlock* callerCodeBlock, CallLinkInfo*); + + static unsigned frameRegisterCountFor(CodeBlock* codeBlock) + { + return codeBlock->m_numCalleeRegisters; + } private: JIT(VM*, CodeBlock* = 0); @@ -266,11 +271,6 @@ namespace JSC { { Call functionCall = call(); m_calls.append(CallRecord(functionCall, m_bytecodeOffset, function.value())); -#if USE(JSVALUE32_64) - unmap(); -#else - killLastResultRegister(); -#endif return functionCall; } @@ -316,25 +316,26 @@ namespace JSC { void addStructureTransitionCheck(JSCell*, Structure*, StructureStubInfo*, JumpList& failureCases, RegisterID scratch); void testPrototype(JSValue, JumpList& failureCases, StructureStubInfo*); - enum WriteBarrierMode { UnconditionalWriteBarrier, ShouldFilterImmediates }; + enum WriteBarrierMode { UnconditionalWriteBarrier, ShouldFilterValue, ShouldFilterBaseAndValue }; // value register in write barrier is used before any scratch registers // so may safely be the same as either of the scratch registers. - void emitWriteBarrier(RegisterID owner, RegisterID valueTag, RegisterID scratch, RegisterID scratch2, WriteBarrierMode, WriteBarrierUseKind); - void emitWriteBarrier(JSCell* owner, RegisterID value, RegisterID scratch, WriteBarrierMode, WriteBarrierUseKind); + Jump checkMarkWord(RegisterID owner, RegisterID scratch1, RegisterID scratch2); + Jump checkMarkWord(JSCell* owner); + void emitWriteBarrier(unsigned owner, unsigned value, WriteBarrierMode); + void emitWriteBarrier(JSCell* owner, unsigned value, WriteBarrierMode); +/* + void emitWriteBarrier(RegisterID owner, RegisterID valueTag, RegisterID scratch1, RegisterID scratch2, WriteBarrierMode); + void emitWriteBarrier(JSCell* owner, RegisterID value, WriteBarrierMode); +*/ template // StructureType can be RegisterID or ImmPtr. void emitAllocateJSObject(RegisterID allocator, StructureType, RegisterID result, RegisterID scratch); -#if ENABLE(VALUE_PROFILER) // This assumes that the value to profile is in regT0 and that regT3 is available for // scratch. - void emitValueProfilingSite(ValueProfile*, RegisterID); - void emitValueProfilingSite(unsigned bytecodeOffset, RegisterID); - void emitValueProfilingSite(RegisterID); -#else - void emitValueProfilingSite(unsigned, RegisterID) { } - void emitValueProfilingSite(RegisterID) { } -#endif + void emitValueProfilingSite(ValueProfile*); + void emitValueProfilingSite(unsigned bytecodeOffset); + void emitValueProfilingSite(); void emitArrayProfilingSite(RegisterID structureAndIndexingType, RegisterID scratch, ArrayProfile*); void emitArrayProfilingSiteForBytecodeIndex(RegisterID structureAndIndexingType, RegisterID scratch, unsigned bytecodeIndex); void emitArrayProfileStoreToHoleSpecialCase(ArrayProfile*); @@ -390,19 +391,10 @@ namespace JSC { void emitStore(int index, const JSValue constant, RegisterID base = callFrameRegister); void emitStoreInt32(int index, RegisterID payload, bool indexIsInt32 = false); void emitStoreInt32(int index, TrustedImm32 payload, bool indexIsInt32 = false); - void emitStoreAndMapInt32(int index, RegisterID tag, RegisterID payload, bool indexIsInt32, size_t opcodeLength); void emitStoreCell(int index, RegisterID payload, bool indexIsCell = false); void emitStoreBool(int index, RegisterID payload, bool indexIsBool = false); void emitStoreDouble(int index, FPRegisterID value); - bool isLabeled(unsigned bytecodeOffset); - void map(unsigned bytecodeOffset, int virtualRegisterIndex, RegisterID tag, RegisterID payload); - void unmap(RegisterID); - void unmap(); - bool isMapped(int virtualRegisterIndex); - bool getMappedPayload(int virtualRegisterIndex, RegisterID& payload); - bool getMappedTag(int virtualRegisterIndex, RegisterID& tag); - void emitJumpSlowCaseIfNotJSCell(int virtualRegisterIndex); void emitJumpSlowCaseIfNotJSCell(int virtualRegisterIndex, RegisterID tag); @@ -435,8 +427,6 @@ namespace JSC { int32_t getConstantOperandImmediateInt(int src); - void killLastResultRegister(); - Jump emitJumpIfJSCell(RegisterID); Jump emitJumpIfBothJSCells(RegisterID, RegisterID, RegisterID); void emitJumpSlowCaseIfJSCell(RegisterID); @@ -466,6 +456,7 @@ namespace JSC { void emit_compareAndJump(OpcodeID, int op1, int op2, unsigned target, RelationalCondition); void emit_compareAndJumpSlow(int op1, int op2, unsigned target, DoubleCondition, size_t (JIT_OPERATION *operation)(ExecState*, EncodedJSValue, EncodedJSValue), bool invert, Vector::iterator&); + void emit_op_touch_entry(Instruction*); void emit_op_add(Instruction*); void emit_op_bitand(Instruction*); void emit_op_bitor(Instruction*); @@ -473,6 +464,7 @@ namespace JSC { void emit_op_call(Instruction*); void emit_op_call_eval(Instruction*); void emit_op_call_varargs(Instruction*); + void emit_op_captured_mov(Instruction*); void emit_op_catch(Instruction*); void emit_op_construct(Instruction*); void emit_op_get_callee(Instruction*); @@ -525,6 +517,7 @@ namespace JSC { void emit_op_new_array_with_size(Instruction*); void emit_op_new_array_buffer(Instruction*); void emit_op_new_func(Instruction*); + void emit_op_new_captured_func(Instruction*); void emit_op_new_func_exp(Instruction*); void emit_op_new_object(Instruction*); void emit_op_new_regexp(Instruction*); @@ -560,6 +553,7 @@ namespace JSC { void emit_op_to_number(Instruction*); void emit_op_to_primitive(Instruction*); void emit_op_unexpected_load(Instruction*); + void emit_op_unsigned(Instruction*); void emit_op_urshift(Instruction*); void emitSlow_op_add(Instruction*, Vector::iterator&); @@ -569,6 +563,7 @@ namespace JSC { void emitSlow_op_call(Instruction*, Vector::iterator&); void emitSlow_op_call_eval(Instruction*, Vector::iterator&); void emitSlow_op_call_varargs(Instruction*, Vector::iterator&); + void emitSlow_op_captured_mov(Instruction*, Vector::iterator&); void emitSlow_op_construct(Instruction*, Vector::iterator&); void emitSlow_op_to_this(Instruction*, Vector::iterator&); void emitSlow_op_create_this(Instruction*, Vector::iterator&); @@ -610,6 +605,7 @@ namespace JSC { void emitSlow_op_sub(Instruction*, Vector::iterator&); void emitSlow_op_to_number(Instruction*, Vector::iterator&); void emitSlow_op_to_primitive(Instruction*, Vector::iterator&); + void emitSlow_op_unsigned(Instruction*, Vector::iterator&); void emitSlow_op_urshift(Instruction*, Vector::iterator&); void emit_op_resolve_scope(Instruction*); @@ -629,7 +625,12 @@ namespace JSC { void emitGetGlobalVar(uintptr_t operand); void emitGetClosureVar(int scope, uintptr_t operand); void emitPutGlobalProperty(uintptr_t* operandSlot, int value); - void emitPutGlobalVar(uintptr_t operand, int value); +#if USE(JSVALUE64) + void emitNotifyWrite(RegisterID value, RegisterID scratch, VariableWatchpointSet*); +#else + void emitNotifyWrite(RegisterID tag, RegisterID payload, RegisterID scratch, VariableWatchpointSet*); +#endif + void emitPutGlobalVar(uintptr_t operand, int value, VariableWatchpointSet*); void emitPutClosureVar(int scope, uintptr_t operand, int value); void emitInitRegister(int dst); @@ -645,8 +646,6 @@ namespace JSC { bool isOperandConstantImmediateInt(int src); bool isOperandConstantImmediateChar(int src); - bool atJumpTarget(); - Jump getSlowCase(Vector::iterator& iter) { return iter++->from; @@ -674,12 +673,13 @@ namespace JSC { MacroAssembler::Call callOperation(C_JITOperation_EO, GPRReg); MacroAssembler::Call callOperation(C_JITOperation_ESt, Structure*); MacroAssembler::Call callOperation(C_JITOperation_EZ, int32_t); - MacroAssembler::Call callOperation(F_JITOperation_EJJZ, GPRReg, GPRReg, int32_t); + MacroAssembler::Call callOperation(F_JITOperation_EJZ, GPRReg, int32_t); MacroAssembler::Call callOperation(J_JITOperation_E, int); MacroAssembler::Call callOperation(J_JITOperation_EAapJ, int, ArrayAllocationProfile*, GPRReg); MacroAssembler::Call callOperation(J_JITOperation_EAapJcpZ, int, ArrayAllocationProfile*, GPRReg, int32_t); MacroAssembler::Call callOperation(J_JITOperation_EAapJcpZ, int, ArrayAllocationProfile*, const JSValue*, int32_t); MacroAssembler::Call callOperation(J_JITOperation_EC, int, JSCell*); + MacroAssembler::Call callOperation(V_JITOperation_EC, JSCell*); MacroAssembler::Call callOperation(J_JITOperation_EJ, int, GPRReg); #if USE(JSVALUE64) MacroAssembler::Call callOperation(WithProfileTag, J_JITOperation_ESsiJI, int, StructureStubInfo*, GPRReg, StringImpl*); @@ -715,6 +715,7 @@ namespace JSC { #endif MacroAssembler::Call callOperation(V_JITOperation_EJIdJJ, RegisterID, const Identifier*, RegisterID, RegisterID); #if USE(JSVALUE64) + MacroAssembler::Call callOperation(F_JITOperation_EFJJ, RegisterID, RegisterID, RegisterID); MacroAssembler::Call callOperation(V_JITOperation_ESsiJJI, StructureStubInfo*, RegisterID, RegisterID, StringImpl*); #else MacroAssembler::Call callOperation(V_JITOperation_ESsiJJI, StructureStubInfo*, RegisterID, RegisterID, RegisterID, RegisterID, StringImpl*); @@ -728,7 +729,8 @@ namespace JSC { MacroAssembler::Call callOperationWithCallFrameRollbackOnException(V_JITOperation_ECb, CodeBlock*); MacroAssembler::Call callOperationWithCallFrameRollbackOnException(Z_JITOperation_E); #if USE(JSVALUE32_64) - MacroAssembler::Call callOperation(F_JITOperation_EJJZ, GPRReg, GPRReg, GPRReg, GPRReg, int32_t); + MacroAssembler::Call callOperation(F_JITOperation_EFJJ, RegisterID, RegisterID, RegisterID, RegisterID, RegisterID); + MacroAssembler::Call callOperation(F_JITOperation_EJZ, GPRReg, GPRReg, int32_t); MacroAssembler::Call callOperation(J_JITOperation_EAapJ, int, ArrayAllocationProfile*, GPRReg, GPRReg); MacroAssembler::Call callOperation(J_JITOperation_EJ, int, GPRReg, GPRReg); MacroAssembler::Call callOperation(J_JITOperation_EJIdc, int, GPRReg, GPRReg, const Identifier*); @@ -815,27 +817,14 @@ namespace JSC { unsigned m_byValInstructionIndex; unsigned m_callLinkInfoIndex; -#if USE(JSVALUE32_64) - unsigned m_jumpTargetIndex; - unsigned m_mappedBytecodeOffset; - int m_mappedVirtualRegisterIndex; - RegisterID m_mappedTag; - RegisterID m_mappedPayload; -#else - int m_lastResultBytecodeRegister; -#endif - unsigned m_jumpTargetsPosition; - OwnPtr m_disassembler; RefPtr m_compilation; WeakRandom m_randomGenerator; static CodeRef stringGetByValStubGenerator(VM*); -#if ENABLE(VALUE_PROFILER) bool m_canBeOptimized; bool m_canBeOptimizedOrInlined; bool m_shouldEmitProfiling; -#endif } JIT_CLASS_ALIGNMENT; } // namespace JSC diff --git a/JavaScriptCore/jit/JITArithmetic.cpp b/JavaScriptCore/jit/JITArithmetic.cpp index 2bc71933..b9c70570 100644 --- a/JavaScriptCore/jit/JITArithmetic.cpp +++ b/JavaScriptCore/jit/JITArithmetic.cpp @@ -40,11 +40,6 @@ #include "SamplingTool.h" #include "SlowPathCall.h" -#ifndef NDEBUG -#include -#endif - -using namespace std; namespace JSC { @@ -220,14 +215,11 @@ void JIT::emit_op_negate(Instruction* currentInstruction) void JIT::emitSlow_op_negate(Instruction* currentInstruction, Vector::iterator& iter) { - int result = currentInstruction[1].u.operand; - linkSlowCase(iter); // 0x7fffffff check linkSlowCase(iter); // double check JITSlowPathCall slowPathCall(this, currentInstruction, slow_path_negate); slowPathCall.call(); - emitGetVirtualRegister(result, regT0); } void JIT::emit_op_lshift(Instruction* currentInstruction) @@ -249,13 +241,10 @@ void JIT::emit_op_lshift(Instruction* currentInstruction) void JIT::emitSlow_op_lshift(Instruction* currentInstruction, Vector::iterator& iter) { - int result = currentInstruction[1].u.operand; - linkSlowCase(iter); linkSlowCase(iter); JITSlowPathCall slowPathCall(this, currentInstruction, slow_path_lshift); slowPathCall.call(); - emitGetVirtualRegister(result, regT0); } void JIT::emit_op_rshift(Instruction* currentInstruction) @@ -295,12 +284,8 @@ void JIT::emit_op_rshift(Instruction* currentInstruction) void JIT::emitSlow_op_rshift(Instruction* currentInstruction, Vector::iterator& iter) { - int result = currentInstruction[1].u.operand; - int op1 = currentInstruction[2].u.operand; int op2 = currentInstruction[3].u.operand; - UNUSED_PARAM(op1); - if (isOperandConstantImmediateInt(op2)) linkSlowCase(iter); @@ -317,100 +302,84 @@ void JIT::emitSlow_op_rshift(Instruction* currentInstruction, Vector 1 SlowCase emitGetVirtualRegister(op1, regT0); emitJumpSlowCaseIfNotImmediateInteger(regT0); - emitFastArithImmToInt(regT0); - int shift = getConstantOperand(op2).asInt32(); - if (shift) - urshift32(Imm32(shift & 0x1f), regT0); - // unsigned shift < 0 or shift = k*2^32 may result in (essentially) - // a toUint conversion, which can result in a value we can represent - // as an immediate int. - if (shift < 0 || !(shift & 31)) - addSlowCase(branch32(LessThan, regT0, TrustedImm32(0))); - emitFastArithReTagImmediate(regT0, regT0); - emitPutVirtualRegister(dst, regT0); - return; + // Mask with 0x1f as per ecma-262 11.7.2 step 7. + urshift32(Imm32(getConstantOperandImmediateInt(op2) & 0x1f), regT0); + } else { + emitGetVirtualRegisters(op1, regT0, op2, regT2); + if (supportsFloatingPointTruncate()) { + Jump lhsIsInt = emitJumpIfImmediateInteger(regT0); + // supportsFloatingPoint() && USE(JSVALUE64) => 3 SlowCases + addSlowCase(emitJumpIfNotImmediateNumber(regT0)); + add64(tagTypeNumberRegister, regT0); + move64ToDouble(regT0, fpRegT0); + addSlowCase(branchTruncateDoubleToInt32(fpRegT0, regT0)); + lhsIsInt.link(this); + emitJumpSlowCaseIfNotImmediateInteger(regT2); + } else { + // !supportsFloatingPoint() => 2 SlowCases + emitJumpSlowCaseIfNotImmediateInteger(regT0); + emitJumpSlowCaseIfNotImmediateInteger(regT2); + } + emitFastArithImmToInt(regT2); + urshift32(regT2, regT0); } - emitGetVirtualRegisters(op1, regT0, op2, regT1); - if (!isOperandConstantImmediateInt(op1)) - emitJumpSlowCaseIfNotImmediateInteger(regT0); - emitJumpSlowCaseIfNotImmediateInteger(regT1); - emitFastArithImmToInt(regT0); - emitFastArithImmToInt(regT1); - urshift32(regT1, regT0); - addSlowCase(branch32(LessThan, regT0, TrustedImm32(0))); - emitFastArithReTagImmediate(regT0, regT0); - emitPutVirtualRegister(dst, regT0); + emitFastArithIntToImmNoCheck(regT0, regT0); + emitPutVirtualRegister(result); } void JIT::emitSlow_op_urshift(Instruction* currentInstruction, Vector::iterator& iter) { - int dst = currentInstruction[1].u.operand; - int op1 = currentInstruction[2].u.operand; int op2 = currentInstruction[3].u.operand; - if (isOperandConstantImmediateInt(op2)) { - int shift = getConstantOperand(op2).asInt32(); - // op1 = regT0 - linkSlowCase(iter); // int32 check + + if (isOperandConstantImmediateInt(op2)) + linkSlowCase(iter); + + else { if (supportsFloatingPointTruncate()) { - JumpList failures; - failures.append(emitJumpIfNotImmediateNumber(regT0)); // op1 is not a double - add64(tagTypeNumberRegister, regT0); - move64ToDouble(regT0, fpRegT0); - failures.append(branchTruncateDoubleToInt32(fpRegT0, regT0)); - if (shift) - urshift32(Imm32(shift & 0x1f), regT0); - if (shift < 0 || !(shift & 31)) - failures.append(branch32(LessThan, regT0, TrustedImm32(0))); - emitFastArithReTagImmediate(regT0, regT0); - emitPutVirtualRegister(dst, regT0); - emitJumpSlowToHot(jump(), OPCODE_LENGTH(op_rshift)); - failures.link(this); - } - if (shift < 0 || !(shift & 31)) - linkSlowCase(iter); // failed to box in hot path - } else { - // op1 = regT0 - // op2 = regT1 - if (!isOperandConstantImmediateInt(op1)) { - linkSlowCase(iter); // int32 check -- op1 is not an int - if (supportsFloatingPointTruncate()) { - JumpList failures; - failures.append(emitJumpIfNotImmediateNumber(regT0)); // op1 is not a double - add64(tagTypeNumberRegister, regT0); - move64ToDouble(regT0, fpRegT0); - failures.append(branchTruncateDoubleToInt32(fpRegT0, regT0)); - failures.append(emitJumpIfNotImmediateInteger(regT1)); // op2 is not an int - emitFastArithImmToInt(regT1); - urshift32(regT1, regT0); - failures.append(branch32(LessThan, regT0, TrustedImm32(0))); - emitFastArithReTagImmediate(regT0, regT0); - emitPutVirtualRegister(dst, regT0); - emitJumpSlowToHot(jump(), OPCODE_LENGTH(op_rshift)); - failures.link(this); - } + linkSlowCase(iter); + linkSlowCase(iter); + linkSlowCase(iter); + } else { + linkSlowCase(iter); + linkSlowCase(iter); } - - linkSlowCase(iter); // int32 check - op2 is not an int - linkSlowCase(iter); // Can't represent unsigned result as an immediate } - + JITSlowPathCall slowPathCall(this, currentInstruction, slow_path_urshift); slowPathCall.call(); - emitGetVirtualRegister(dst, regT0); +} + +void JIT::emit_op_unsigned(Instruction* currentInstruction) +{ + int result = currentInstruction[1].u.operand; + int op1 = currentInstruction[2].u.operand; + + emitGetVirtualRegister(op1, regT0); + emitJumpSlowCaseIfNotImmediateInteger(regT0); + addSlowCase(branch32(LessThan, regT0, TrustedImm32(0))); + emitFastArithReTagImmediate(regT0, regT0); + emitPutVirtualRegister(result, regT0); +} + +void JIT::emitSlow_op_unsigned(Instruction* currentInstruction, Vector::iterator& iter) +{ + linkSlowCase(iter); + linkSlowCase(iter); + + JITSlowPathCall slowPathCall(this, currentInstruction, slow_path_unsigned); + slowPathCall.call(); } void JIT::emit_compareAndJump(OpcodeID, int op1, int op2, unsigned target, RelationalCondition condition) @@ -477,10 +446,10 @@ void JIT::emit_compareAndJumpSlow(int op1, int op2, unsigned target, DoubleCondi linkSlowCase(iter); linkSlowCase(iter); - emitGetVirtualRegister(op1, firstArgumentRegister); - emitGetVirtualRegister(op2, secondArgumentRegister); - callOperation(operation, firstArgumentRegister, secondArgumentRegister); - emitJumpSlowToHot(branchTest32(invert ? Zero : NonZero, returnValueRegister), target); + emitGetVirtualRegister(op1, argumentGPR0); + emitGetVirtualRegister(op2, argumentGPR1); + callOperation(operation, argumentGPR0, argumentGPR1); + emitJumpSlowToHot(branchTest32(invert ? Zero : NonZero, returnValueGPR), target); return; } @@ -506,7 +475,7 @@ void JIT::emit_compareAndJumpSlow(int op1, int op2, unsigned target, DoubleCondi emitGetVirtualRegister(op2, regT1); callOperation(operation, regT0, regT1); - emitJumpSlowToHot(branchTest32(invert ? Zero : NonZero, returnValueRegister), target); + emitJumpSlowToHot(branchTest32(invert ? Zero : NonZero, returnValueGPR), target); } else if (isOperandConstantImmediateInt(op1)) { linkSlowCase(iter); @@ -529,7 +498,7 @@ void JIT::emit_compareAndJumpSlow(int op1, int op2, unsigned target, DoubleCondi emitGetVirtualRegister(op1, regT2); callOperation(operation, regT2, regT1); - emitJumpSlowToHot(branchTest32(invert ? Zero : NonZero, returnValueRegister), target); + emitJumpSlowToHot(branchTest32(invert ? Zero : NonZero, returnValueGPR), target); } else { linkSlowCase(iter); @@ -553,7 +522,7 @@ void JIT::emit_compareAndJumpSlow(int op1, int op2, unsigned target, DoubleCondi linkSlowCase(iter); callOperation(operation, regT0, regT1); - emitJumpSlowToHot(branchTest32(invert ? Zero : NonZero, returnValueRegister), target); + emitJumpSlowToHot(branchTest32(invert ? Zero : NonZero, returnValueGPR), target); } } @@ -587,13 +556,10 @@ void JIT::emit_op_bitand(Instruction* currentInstruction) void JIT::emitSlow_op_bitand(Instruction* currentInstruction, Vector::iterator& iter) { - int result = currentInstruction[1].u.operand; - linkSlowCase(iter); JITSlowPathCall slowPathCall(this, currentInstruction, slow_path_bitand); slowPathCall.call(); - emitGetVirtualRegister(result, regT0); } void JIT::emit_op_inc(Instruction* currentInstruction) @@ -609,13 +575,10 @@ void JIT::emit_op_inc(Instruction* currentInstruction) void JIT::emitSlow_op_inc(Instruction* currentInstruction, Vector::iterator& iter) { - int srcDst = currentInstruction[1].u.operand; - linkSlowCase(iter); linkSlowCase(iter); JITSlowPathCall slowPathCall(this, currentInstruction, slow_path_inc); slowPathCall.call(); - emitGetVirtualRegister(srcDst, regT0); } void JIT::emit_op_dec(Instruction* currentInstruction) @@ -631,13 +594,10 @@ void JIT::emit_op_dec(Instruction* currentInstruction) void JIT::emitSlow_op_dec(Instruction* currentInstruction, Vector::iterator& iter) { - int srcDst = currentInstruction[1].u.operand; - linkSlowCase(iter); linkSlowCase(iter); JITSlowPathCall slowPathCall(this, currentInstruction, slow_path_dec); slowPathCall.call(); - emitGetVirtualRegister(srcDst, regT0); } /* ------------------------------ BEGIN: OP_MOD ------------------------------ */ @@ -675,8 +635,6 @@ void JIT::emit_op_mod(Instruction* currentInstruction) void JIT::emitSlow_op_mod(Instruction* currentInstruction, Vector::iterator& iter) { - int result = currentInstruction[1].u.operand; - linkSlowCase(iter); linkSlowCase(iter); linkSlowCase(iter); @@ -684,23 +642,14 @@ void JIT::emitSlow_op_mod(Instruction* currentInstruction, Vector linkSlowCase(iter); JITSlowPathCall slowPathCall(this, currentInstruction, slow_path_mod); slowPathCall.call(); - emitGetVirtualRegister(result, regT0); } #else // CPU(X86) || CPU(X86_64) void JIT::emit_op_mod(Instruction* currentInstruction) { - int result = currentInstruction[1].u.operand; - int op1 = currentInstruction[2].u.operand; - int op2 = currentInstruction[3].u.operand; - - UNUSED_PARAM(op1); - UNUSED_PARAM(op2); - JITSlowPathCall slowPathCall(this, currentInstruction, slow_path_mod); slowPathCall.call(); - emitGetVirtualRegister(result, regT0); } void JIT::emitSlow_op_mod(Instruction*, Vector::iterator&) @@ -719,16 +668,13 @@ void JIT::compileBinaryArithOp(OpcodeID opcodeID, int, int op1, int op2, Operand emitGetVirtualRegisters(op1, regT0, op2, regT1); emitJumpSlowCaseIfNotImmediateInteger(regT0); emitJumpSlowCaseIfNotImmediateInteger(regT1); -#if ENABLE(VALUE_PROFILER) RareCaseProfile* profile = m_codeBlock->addSpecialFastCaseProfile(m_bytecodeOffset); -#endif if (opcodeID == op_add) addSlowCase(branchAdd32(Overflow, regT1, regT0)); else if (opcodeID == op_sub) addSlowCase(branchSub32(Overflow, regT1, regT0)); else { ASSERT(opcodeID == op_mul); -#if ENABLE(VALUE_PROFILER) if (shouldEmitProfiling()) { // We want to be able to measure if this is taking the slow case just // because of negative zero. If this produces positive zero, then we @@ -752,10 +698,6 @@ void JIT::compileBinaryArithOp(OpcodeID opcodeID, int, int op1, int op2, Operand addSlowCase(branchMul32(Overflow, regT1, regT0)); addSlowCase(branchTest32(Zero, regT0)); } -#else - addSlowCase(branchMul32(Overflow, regT1, regT0)); - addSlowCase(branchTest32(Zero, regT0)); -#endif } emitFastArithIntToImmNoCheck(regT0, regT0); } @@ -784,7 +726,6 @@ void JIT::compileBinaryArithOpSlowCase(Instruction* currentInstruction, OpcodeID JITSlowPathCall slowPathCall(this, currentInstruction, opcodeID == op_add ? slow_path_add : opcodeID == op_sub ? slow_path_sub : slow_path_mul); slowPathCall.call(); - emitGetVirtualRegister(result, regT0); Jump end = jump(); if (op1HasImmediateIntFastCase) { @@ -901,19 +842,15 @@ void JIT::emit_op_mul(Instruction* currentInstruction) // For now, only plant a fast int case if the constant operand is greater than zero. int32_t value; if (isOperandConstantImmediateInt(op1) && ((value = getConstantOperandImmediateInt(op1)) > 0)) { -#if ENABLE(VALUE_PROFILER) // Add a special fast case profile because the DFG JIT will expect one. m_codeBlock->addSpecialFastCaseProfile(m_bytecodeOffset); -#endif emitGetVirtualRegister(op2, regT0); emitJumpSlowCaseIfNotImmediateInteger(regT0); addSlowCase(branchMul32(Overflow, Imm32(value), regT0, regT1)); emitFastArithReTagImmediate(regT1, regT0); } else if (isOperandConstantImmediateInt(op2) && ((value = getConstantOperandImmediateInt(op2)) > 0)) { -#if ENABLE(VALUE_PROFILER) // Add a special fast case profile because the DFG JIT will expect one. m_codeBlock->addSpecialFastCaseProfile(m_bytecodeOffset); -#endif emitGetVirtualRegister(op1, regT0); emitJumpSlowCaseIfNotImmediateInteger(regT0); addSlowCase(branchMul32(Overflow, Imm32(value), regT0, regT1)); @@ -982,7 +919,6 @@ void JIT::emit_op_div(Instruction* currentInstruction) } divDouble(fpRegT1, fpRegT0); -#if ENABLE(VALUE_PROFILER) // Is the result actually an integer? The DFG JIT would really like to know. If it's // not an integer, we increment a count. If this together with the slow case counter // are below threshold then the DFG JIT will compile this division with a specualtion @@ -1009,18 +945,12 @@ void JIT::emit_op_div(Instruction* currentInstruction) move(tagTypeNumberRegister, regT0); trueDouble.link(this); isInteger.link(this); -#else - // Double result. - moveDoubleTo64(fpRegT0, regT0); - sub64(tagTypeNumberRegister, regT0); -#endif emitPutVirtualRegister(dst, regT0); } void JIT::emitSlow_op_div(Instruction* currentInstruction, Vector::iterator& iter) { - int result = currentInstruction[1].u.operand; int op1 = currentInstruction[2].u.operand; int op2 = currentInstruction[3].u.operand; OperandTypes types = OperandTypes::fromInt(currentInstruction[4].u.operand); @@ -1041,7 +971,6 @@ void JIT::emitSlow_op_div(Instruction* currentInstruction, Vector // There is an extra slow case for (op1 * -N) or (-N * op2), to check for 0 since this should produce a result of -0. JITSlowPathCall slowPathCall(this, currentInstruction, slow_path_div); slowPathCall.call(); - emitGetVirtualRegister(result, regT0); } void JIT::emit_op_sub(Instruction* currentInstruction) diff --git a/JavaScriptCore/jit/JITArithmetic32_64.cpp b/JavaScriptCore/jit/JITArithmetic32_64.cpp index 8167bae0..53ac7389 100644 --- a/JavaScriptCore/jit/JITArithmetic32_64.cpp +++ b/JavaScriptCore/jit/JITArithmetic32_64.cpp @@ -40,11 +40,6 @@ #include "SamplingTool.h" #include "SlowPathCall.h" -#ifndef NDEBUG -#include -#endif - -using namespace std; namespace JSC { @@ -75,14 +70,11 @@ void JIT::emit_op_negate(Instruction* currentInstruction) void JIT::emitSlow_op_negate(Instruction* currentInstruction, Vector::iterator& iter) { - int dst = currentInstruction[1].u.operand; - linkSlowCase(iter); // 0x7fffffff check linkSlowCase(iter); // double check JITSlowPathCall slowPathCall(this, currentInstruction, slow_path_negate); slowPathCall.call(); - emitLoad(dst, regT1, regT0); } void JIT::emit_compareAndJump(OpcodeID opcode, int op1, int op2, unsigned target, RelationalCondition condition) @@ -160,7 +152,7 @@ void JIT::emit_compareAndJumpSlow(int op1, int op2, unsigned target, DoubleCondi emitLoad(op1, regT1, regT0); emitLoad(op2, regT3, regT2); callOperation(operation, regT1, regT0, regT3, regT2); - emitJumpSlowToHot(branchTest32(invert ? Zero : NonZero, returnValueRegister), target); + emitJumpSlowToHot(branchTest32(invert ? Zero : NonZero, returnValueGPR), target); } // LeftShift (<<) @@ -175,7 +167,7 @@ void JIT::emit_op_lshift(Instruction* currentInstruction) emitLoad(op1, regT1, regT0); addSlowCase(branch32(NotEqual, regT1, TrustedImm32(JSValue::Int32Tag))); lshift32(Imm32(getConstantOperand(op2).asInt32()), regT0); - emitStoreAndMapInt32(dst, regT1, regT0, dst == op1, OPCODE_LENGTH(op_lshift)); + emitStoreInt32(dst, regT0, dst == op1); return; } @@ -184,12 +176,11 @@ void JIT::emit_op_lshift(Instruction* currentInstruction) addSlowCase(branch32(NotEqual, regT1, TrustedImm32(JSValue::Int32Tag))); addSlowCase(branch32(NotEqual, regT3, TrustedImm32(JSValue::Int32Tag))); lshift32(regT2, regT0); - emitStoreAndMapInt32(dst, regT1, regT0, dst == op1 || dst == op2, OPCODE_LENGTH(op_lshift)); + emitStoreInt32(dst, regT0, dst == op1 || dst == op2); } void JIT::emitSlow_op_lshift(Instruction* currentInstruction, Vector::iterator& iter) { - int dst = currentInstruction[1].u.operand; int op1 = currentInstruction[2].u.operand; int op2 = currentInstruction[3].u.operand; @@ -199,7 +190,6 @@ void JIT::emitSlow_op_lshift(Instruction* currentInstruction, Vector>) and UnsignedRightShift (>>>) helper @@ -221,20 +211,18 @@ void JIT::emitRightShift(Instruction* currentInstruction, bool isUnsigned) urshift32(Imm32(shift), regT0); else rshift32(Imm32(shift), regT0); - } else if (isUnsigned) // signed right shift by zero is simply toInt conversion - addSlowCase(branch32(LessThan, regT0, TrustedImm32(0))); - emitStoreAndMapInt32(dst, regT1, regT0, dst == op1, OPCODE_LENGTH(op_rshift)); + } + emitStoreInt32(dst, regT0, dst == op1); } else { emitLoad2(op1, regT1, regT0, op2, regT3, regT2); if (!isOperandConstantImmediateInt(op1)) addSlowCase(branch32(NotEqual, regT1, TrustedImm32(JSValue::Int32Tag))); addSlowCase(branch32(NotEqual, regT3, TrustedImm32(JSValue::Int32Tag))); - if (isUnsigned) { + if (isUnsigned) urshift32(regT2, regT0); - addSlowCase(branch32(LessThan, regT0, TrustedImm32(0))); - } else + else rshift32(regT2, regT0); - emitStoreAndMapInt32(dst, regT1, regT0, dst == op1, OPCODE_LENGTH(op_rshift)); + emitStoreInt32(dst, regT0, dst == op1); } } @@ -257,15 +245,12 @@ void JIT::emitRightShiftSlowCase(Instruction* currentInstruction, Vector>) @@ -323,6 +304,27 @@ void JIT::emitSlow_op_urshift(Instruction* currentInstruction, Vector::iterator& iter) +{ + linkSlowCase(iter); + linkSlowCase(iter); + + JITSlowPathCall slowPathCall(this, currentInstruction, slow_path_unsigned); + slowPathCall.call(); +} + // BitAnd (&) void JIT::emit_op_bitand(Instruction* currentInstruction) @@ -337,7 +339,7 @@ void JIT::emit_op_bitand(Instruction* currentInstruction) emitLoad(op, regT1, regT0); addSlowCase(branch32(NotEqual, regT1, TrustedImm32(JSValue::Int32Tag))); and32(Imm32(constant), regT0); - emitStoreAndMapInt32(dst, regT1, regT0, dst == op, OPCODE_LENGTH(op_bitand)); + emitStoreInt32(dst, regT0, dst == op); return; } @@ -345,12 +347,11 @@ void JIT::emit_op_bitand(Instruction* currentInstruction) addSlowCase(branch32(NotEqual, regT1, TrustedImm32(JSValue::Int32Tag))); addSlowCase(branch32(NotEqual, regT3, TrustedImm32(JSValue::Int32Tag))); and32(regT2, regT0); - emitStoreAndMapInt32(dst, regT1, regT0, (op1 == dst || op2 == dst), OPCODE_LENGTH(op_bitand)); + emitStoreInt32(dst, regT0, op1 == dst || op2 == dst); } void JIT::emitSlow_op_bitand(Instruction* currentInstruction, Vector::iterator& iter) { - int dst = currentInstruction[1].u.operand; int op1 = currentInstruction[2].u.operand; int op2 = currentInstruction[3].u.operand; @@ -360,7 +361,6 @@ void JIT::emitSlow_op_bitand(Instruction* currentInstruction, Vector::iterator& iter) { - int dst = currentInstruction[1].u.operand; int op1 = currentInstruction[2].u.operand; int op2 = currentInstruction[3].u.operand; @@ -400,7 +399,6 @@ void JIT::emitSlow_op_bitor(Instruction* currentInstruction, Vector::iterator& iter) { - int dst = currentInstruction[1].u.operand; int op1 = currentInstruction[2].u.operand; int op2 = currentInstruction[3].u.operand; @@ -440,7 +437,6 @@ void JIT::emitSlow_op_bitxor(Instruction* currentInstruction, Vector::iterator& iter) { - int srcDst = currentInstruction[1].u.operand; - linkSlowCase(iter); // int32 check linkSlowCase(iter); // overflow check JITSlowPathCall slowPathCall(this, currentInstruction, slow_path_inc); slowPathCall.call(); - emitLoad(srcDst, regT1, regT0); } void JIT::emit_op_dec(Instruction* currentInstruction) @@ -474,19 +467,16 @@ void JIT::emit_op_dec(Instruction* currentInstruction) addSlowCase(branch32(NotEqual, regT1, TrustedImm32(JSValue::Int32Tag))); addSlowCase(branchSub32(Overflow, TrustedImm32(1), regT0)); - emitStoreAndMapInt32(srcDst, regT1, regT0, true, OPCODE_LENGTH(op_dec)); + emitStoreInt32(srcDst, regT0, true); } void JIT::emitSlow_op_dec(Instruction* currentInstruction, Vector::iterator& iter) { - int srcDst = currentInstruction[1].u.operand; - linkSlowCase(iter); // int32 check linkSlowCase(iter); // overflow check JITSlowPathCall slowPathCall(this, currentInstruction, slow_path_dec); slowPathCall.call(); - emitLoad(srcDst, regT1, regT0); } // Addition (+) @@ -564,7 +554,6 @@ void JIT::emitAdd32Constant(int dst, int op, int32_t constant, ResultType opType void JIT::emitSlow_op_add(Instruction* currentInstruction, Vector::iterator& iter) { - int dst = currentInstruction[1].u.operand; int op1 = currentInstruction[2].u.operand; int op2 = currentInstruction[3].u.operand; OperandTypes types = OperandTypes::fromInt(currentInstruction[4].u.operand); @@ -605,7 +594,6 @@ void JIT::emitSlow_op_add(Instruction* currentInstruction, Vector JITSlowPathCall slowPathCall(this, currentInstruction, slow_path_add); slowPathCall.call(); - emitLoad(dst, regT1, regT0); } // Subtraction (-) @@ -674,7 +662,6 @@ void JIT::emitSub32Constant(int dst, int op, int32_t constant, ResultType opType void JIT::emitSlow_op_sub(Instruction* currentInstruction, Vector::iterator& iter) { - int dst = currentInstruction[1].u.operand; int op2 = currentInstruction[3].u.operand; OperandTypes types = OperandTypes::fromInt(currentInstruction[4].u.operand); @@ -702,7 +689,6 @@ void JIT::emitSlow_op_sub(Instruction* currentInstruction, Vector JITSlowPathCall slowPathCall(this, currentInstruction, slow_path_sub); slowPathCall.call(); - emitLoad(dst, regT1, regT0); } void JIT::emitBinaryDoubleOp(OpcodeID opcodeID, int dst, int op1, int op2, OperandTypes types, JumpList& notInt32Op1, JumpList& notInt32Op2, bool op1IsInRegisters, bool op2IsInRegisters) @@ -756,7 +742,6 @@ void JIT::emitBinaryDoubleOp(OpcodeID opcodeID, int dst, int op1, int op2, Opera emitLoadDouble(op1, fpRegT1); divDouble(fpRegT0, fpRegT1); -#if ENABLE(VALUE_PROFILER) // Is the result actually an integer? The DFG JIT would really like to know. If it's // not an integer, we increment a count. If this together with the slow case counter // are below threshold then the DFG JIT will compile this division with a specualtion @@ -780,9 +765,6 @@ void JIT::emitBinaryDoubleOp(OpcodeID opcodeID, int dst, int op1, int op2, Opera add32(TrustedImm32(1), AbsoluteAddress(&m_codeBlock->specialFastCaseProfileForBytecodeOffset(m_bytecodeOffset)->m_counter)); emitStoreDouble(dst, fpRegT1); isInteger.link(this); -#else - emitStoreDouble(dst, fpRegT1); -#endif break; } case op_jless: @@ -860,7 +842,6 @@ void JIT::emitBinaryDoubleOp(OpcodeID opcodeID, int dst, int op1, int op2, Opera case op_div: { emitLoadDouble(op2, fpRegT2); divDouble(fpRegT2, fpRegT0); -#if ENABLE(VALUE_PROFILER) // Is the result actually an integer? The DFG JIT would really like to know. If it's // not an integer, we increment a count. If this together with the slow case counter // are below threshold then the DFG JIT will compile this division with a specualtion @@ -884,9 +865,6 @@ void JIT::emitBinaryDoubleOp(OpcodeID opcodeID, int dst, int op1, int op2, Opera add32(TrustedImm32(1), AbsoluteAddress(&m_codeBlock->specialFastCaseProfileForBytecodeOffset(m_bytecodeOffset)->m_counter)); emitStoreDouble(dst, fpRegT0); isInteger.link(this); -#else - emitStoreDouble(dst, fpRegT0); -#endif break; } case op_jless: @@ -938,9 +916,7 @@ void JIT::emit_op_mul(Instruction* currentInstruction) int op2 = currentInstruction[3].u.operand; OperandTypes types = OperandTypes::fromInt(currentInstruction[4].u.operand); -#if ENABLE(VALUE_PROFILER) m_codeBlock->addSpecialFastCaseProfile(m_bytecodeOffset); -#endif JumpList notInt32Op1; JumpList notInt32Op2; @@ -983,12 +959,10 @@ void JIT::emitSlow_op_mul(Instruction* currentInstruction, Vector emitJumpSlowToHot(jump(), OPCODE_LENGTH(op_mul)); negZero.link(this); -#if ENABLE(VALUE_PROFILER) // We only get here if we have a genuine negative zero. Record this, // so that the speculative JIT knows that we failed speculation // because of a negative zero. add32(TrustedImm32(1), AbsoluteAddress(&m_codeBlock->specialFastCaseProfileForBytecodeOffset(m_bytecodeOffset)->m_counter)); -#endif overflow.link(this); if (!supportsFloatingPoint()) { @@ -1008,7 +982,6 @@ void JIT::emitSlow_op_mul(Instruction* currentInstruction, Vector JITSlowPathCall slowPathCall(this, currentInstruction, slow_path_mul); slowPathCall.call(); - emitLoad(dst, regT1, regT0); } // Division (/) @@ -1020,9 +993,7 @@ void JIT::emit_op_div(Instruction* currentInstruction) int op2 = currentInstruction[3].u.operand; OperandTypes types = OperandTypes::fromInt(currentInstruction[4].u.operand); -#if ENABLE(VALUE_PROFILER) m_codeBlock->addSpecialFastCaseProfile(m_bytecodeOffset); -#endif if (!supportsFloatingPoint()) { addSlowCase(jump()); @@ -1043,7 +1014,6 @@ void JIT::emit_op_div(Instruction* currentInstruction) convertInt32ToDouble(regT0, fpRegT0); convertInt32ToDouble(regT2, fpRegT1); divDouble(fpRegT1, fpRegT0); -#if ENABLE(VALUE_PROFILER) // Is the result actually an integer? The DFG JIT would really like to know. If it's // not an integer, we increment a count. If this together with the slow case counter // are below threshold then the DFG JIT will compile this division with a specualtion @@ -1066,9 +1036,6 @@ void JIT::emit_op_div(Instruction* currentInstruction) notInteger.link(this); add32(TrustedImm32(1), AbsoluteAddress(&m_codeBlock->specialFastCaseProfileForBytecodeOffset(m_bytecodeOffset)->m_counter)); emitStoreDouble(dst, fpRegT0); -#else - emitStoreDouble(dst, fpRegT0); -#endif end.append(jump()); // Double divide. @@ -1078,8 +1045,6 @@ void JIT::emit_op_div(Instruction* currentInstruction) void JIT::emitSlow_op_div(Instruction* currentInstruction, Vector::iterator& iter) { - int dst = currentInstruction[1].u.operand; - OperandTypes types = OperandTypes::fromInt(currentInstruction[4].u.operand); if (!supportsFloatingPoint()) @@ -1096,7 +1061,6 @@ void JIT::emitSlow_op_div(Instruction* currentInstruction, Vector JITSlowPathCall slowPathCall(this, currentInstruction, slow_path_div); slowPathCall.call(); - emitLoad(dst, regT1, regT0); } // Mod (%) diff --git a/JavaScriptCore/jit/JITCall.cpp b/JavaScriptCore/jit/JITCall.cpp index 6c920c06..90c2e4fb 100644 --- a/JavaScriptCore/jit/JITCall.cpp +++ b/JavaScriptCore/jit/JITCall.cpp @@ -42,26 +42,14 @@ #include "ThunkGenerators.h" #include -#ifndef NDEBUG -#include -#endif - -using namespace std; namespace JSC { void JIT::emitPutCallResult(Instruction* instruction) { int dst = instruction[1].u.operand; - emitValueProfilingSite(regT4); + emitValueProfilingSite(); emitPutVirtualRegister(dst); - if (canBeOptimizedOrInlined()) { - // Make lastResultRegister tracking simpler in the DFG. This is needed because - // the DFG may have the SetLocal corresponding to this Call's return value in - // a different basic block, if inlining happened. The DFG isn't smart enough to - // track the baseline JIT's last result register across basic blocks. - killLastResultRegister(); - } } void JIT::compileLoadVarargs(Instruction* instruction) @@ -70,8 +58,6 @@ void JIT::compileLoadVarargs(Instruction* instruction) int arguments = instruction[4].u.operand; int firstFreeRegister = instruction[5].u.operand; - killLastResultRegister(); - JumpList slowCase; JumpList end; bool canOptimize = m_codeBlock->usesArguments() @@ -93,7 +79,7 @@ void JIT::compileLoadVarargs(Instruction* instruction) addPtr(callFrameRegister, regT1); // regT1: newCallFrame - slowCase.append(branchPtr(Above, AbsoluteAddress(m_vm->interpreter->stack().addressOfEnd()), regT1)); + slowCase.append(branchPtr(Above, AbsoluteAddress(m_vm->addressOfJSStackLimit()), regT1)); // Initialize ArgumentCount. store32(regT0, Address(regT1, JSStack::ArgumentCount * static_cast(sizeof(Register)) + OBJECT_OFFSETOF(EncodedValueDescriptor, asBits.payload))); @@ -118,10 +104,12 @@ void JIT::compileLoadVarargs(Instruction* instruction) if (canOptimize) slowCase.link(this); - emitGetVirtualRegister(thisValue, regT0); emitGetVirtualRegister(arguments, regT1); - callOperation(operationLoadVarargs, regT0, regT1, firstFreeRegister); - move(returnValueRegister, regT1); + callOperation(operationSizeAndAllocFrameForVarargs, regT1, firstFreeRegister); + emitGetVirtualRegister(thisValue, regT1); + emitGetVirtualRegister(arguments, regT2); + callOperation(operationLoadVarargs, returnValueGPR, regT1, regT2); + move(returnValueGPR, regT1); if (canOptimize) end.link(this); diff --git a/JavaScriptCore/jit/JITCall32_64.cpp b/JavaScriptCore/jit/JITCall32_64.cpp index 55aa5d9c..6086038a 100644 --- a/JavaScriptCore/jit/JITCall32_64.cpp +++ b/JavaScriptCore/jit/JITCall32_64.cpp @@ -41,18 +41,13 @@ #include "SamplingTool.h" #include -#ifndef NDEBUG -#include -#endif - -using namespace std; namespace JSC { void JIT::emitPutCallResult(Instruction* instruction) { int dst = instruction[1].u.operand; - emitValueProfilingSite(regT4); + emitValueProfilingSite(); emitStore(dst, regT1, regT0); } @@ -162,7 +157,7 @@ void JIT::compileLoadVarargs(Instruction* instruction) addPtr(callFrameRegister, regT3); // regT3: newCallFrame - slowCase.append(branchPtr(Above, AbsoluteAddress(m_vm->interpreter->stack().addressOfEnd()), regT3)); + slowCase.append(branchPtr(Above, AbsoluteAddress(m_vm->addressOfJSStackLimit()), regT3)); // Initialize ArgumentCount. store32(regT2, payloadFor(JSStack::ArgumentCount, regT3)); @@ -189,10 +184,13 @@ void JIT::compileLoadVarargs(Instruction* instruction) if (canOptimize) slowCase.link(this); + emitLoad(arguments, regT1, regT0); + callOperation(operationSizeAndAllocFrameForVarargs, regT1, regT0, firstFreeRegister); + move(returnValueGPR, regT5); emitLoad(thisValue, regT1, regT0); emitLoad(arguments, regT3, regT2); - callOperation(operationLoadVarargs, regT1, regT0, regT3, regT2, firstFreeRegister); - move(returnValueRegister, regT3); + callOperation(operationLoadVarargs, regT5, regT1, regT0, regT3, regT2); + move(returnValueGPR, regT3); if (canOptimize) end.link(this); @@ -262,7 +260,7 @@ void JIT::compileOpCall(OpcodeID opcodeID, Instruction* instruction, unsigned ca store32(TrustedImm32(locationBits), tagFor(JSStack::ArgumentCount, callFrameRegister)); emitLoad(callee, regT1, regT0); // regT1, regT0 holds callee. - storePtr(callFrameRegister, Address(GPRInfo::regT3, CallFrame::callerFrameOffset())); + storePtr(callFrameRegister, Address(regT3, CallFrame::callerFrameOffset())); emitStore(JSStack::Callee, regT1, regT0, regT3); move(regT3, callFrameRegister); diff --git a/JavaScriptCore/jit/JITCode.cpp b/JavaScriptCore/jit/JITCode.cpp index a9d1610a..213b7000 100644 --- a/JavaScriptCore/jit/JITCode.cpp +++ b/JavaScriptCore/jit/JITCode.cpp @@ -26,6 +26,7 @@ #include "config.h" #include "JITCode.h" +#include "LLIntThunks.h" #include "Operations.h" #include @@ -40,13 +41,13 @@ JITCode::~JITCode() { } -#if ENABLE(JIT) -JSValue JITCode::execute(JSStack* stack, CallFrame* callFrame, VM* vm) +JSValue JITCode::execute(VM* vm, ProtoCallFrame* protoCallFrame, Register* topOfStack) { - JSValue result = JSValue::decode(ctiTrampoline(executableAddress(), stack, callFrame, 0, 0, vm)); + ASSERT(!vm->topCallFrame || ((Register*)(vm->topCallFrame) >= topOfStack)); + + JSValue result = JSValue::decode(callToJavaScript(executableAddress(), &vm->topCallFrame, protoCallFrame, topOfStack)); return vm->exception() ? jsNull() : result; } -#endif DFG::CommonData* JITCode::dfgCommon() { diff --git a/JavaScriptCore/jit/JITCode.h b/JavaScriptCore/jit/JITCode.h index 189863c5..d7f3ccdc 100644 --- a/JavaScriptCore/jit/JITCode.h +++ b/JavaScriptCore/jit/JITCode.h @@ -46,10 +46,8 @@ class ForOSREntryJITCode; class JITCode; } -#if ENABLE(JIT) +struct ProtoCallFrame; class VM; -class JSStack; -#endif class JITCode : public ThreadSafeRefCounted { public: @@ -177,7 +175,7 @@ class JITCode : public ThreadSafeRefCounted { virtual FTL::JITCode* ftl(); virtual FTL::ForOSREntryJITCode* ftlForOSREntry(); - JSValue execute(JSStack*, CallFrame*, VM*); + JSValue execute(VM*, ProtoCallFrame*, Register*); void* start() { return dataAddressAtOffset(0); } virtual size_t size() = 0; diff --git a/JavaScriptCore/jit/JITDisassembler.cpp b/JavaScriptCore/jit/JITDisassembler.cpp index 39953fa3..2d91a646 100644 --- a/JavaScriptCore/jit/JITDisassembler.cpp +++ b/JavaScriptCore/jit/JITDisassembler.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2012 Apple Inc. All rights reserved. + * Copyright (C) 2012, 2013 Apple Inc. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -26,7 +26,7 @@ #include "config.h" #include "JITDisassembler.h" -#if ENABLE(JIT) +#if ENABLE(JIT) && ENABLE(DISASSEMBLER) #include "CodeBlock.h" #include "CodeBlockWithJITType.h" @@ -87,7 +87,7 @@ void JITDisassembler::dumpHeader(PrintStream& out, LinkBuffer& linkBuffer) { out.print("Generated Baseline JIT code for ", CodeBlockWithJITType(m_codeBlock, JITCode::BaselineJIT), ", instruction count = ", m_codeBlock->instructionCount(), "\n"); out.print(" Source: ", m_codeBlock->sourceCodeOnOneLine(), "\n"); - out.print(" Code at [", RawPointer(linkBuffer.debugAddress()), ", ", RawPointer(static_cast(linkBuffer.debugAddress()) + linkBuffer.debugSize()), "):\n"); + out.print(" Code at [", RawPointer(linkBuffer.debugAddress()), ", ", RawPointer(static_cast(linkBuffer.debugAddress()) + linkBuffer.size()), "):\n"); } MacroAssembler::Label JITDisassembler::firstSlowLabel() @@ -164,5 +164,5 @@ void JITDisassembler::dumpDisassembly(PrintStream& out, LinkBuffer& linkBuffer, } // namespace JSC -#endif // ENABLE(JIT) +#endif // ENABLE(JIT) && ENABLE(DISASSEMBLER) diff --git a/JavaScriptCore/jit/JITDisassembler.h b/JavaScriptCore/jit/JITDisassembler.h index 7edbb9cf..7ea13f47 100644 --- a/JavaScriptCore/jit/JITDisassembler.h +++ b/JavaScriptCore/jit/JITDisassembler.h @@ -39,6 +39,8 @@ namespace JSC { class CodeBlock; +#if ENABLE(DISASSEMBLER) + class JITDisassembler { WTF_MAKE_FAST_ALLOCATED; public: @@ -84,6 +86,25 @@ class JITDisassembler { MacroAssembler::Label m_endOfCode; }; +#else // ENABLE(DISASSEMBLER) + +class JITDisassembler { + WTF_MAKE_FAST_ALLOCATED; +public: + JITDisassembler(CodeBlock*) { } + + void setStartOfCode(MacroAssembler::Label) { } + void setForBytecodeMainPath(unsigned, MacroAssembler::Label) { } + void setForBytecodeSlowPath(unsigned, MacroAssembler::Label) { } + void setEndOfSlowPath(MacroAssembler::Label) { } + void setEndOfCode(MacroAssembler::Label) { } + + void dump(LinkBuffer&) { } + void reportToProfiler(Profiler::Compilation*, LinkBuffer&) { } +}; + +#endif // ENABLE(DISASSEMBLER) + } // namespace JSC #endif // ENABLE(JIT) diff --git a/JavaScriptCore/jit/JITExceptions.cpp b/JavaScriptCore/jit/JITExceptions.cpp index 0a353e13..8084f773 100644 --- a/JavaScriptCore/jit/JITExceptions.cpp +++ b/JavaScriptCore/jit/JITExceptions.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2012 Apple Inc. All rights reserved. + * Copyright (C) 2012, 2013 Apple Inc. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -30,11 +30,14 @@ #include "CallFrameInlines.h" #include "CodeBlock.h" #include "Interpreter.h" +#include "JITStubs.h" #include "JSCJSValue.h" -#include "VM.h" +#include "LLIntData.h" +#include "LLIntOpcode.h" +#include "LLIntThunks.h" +#include "Opcode.h" #include "Operations.h" - -#if ENABLE(JIT) || ENABLE(LLINT) +#include "VM.h" namespace JSC { @@ -47,9 +50,13 @@ void genericUnwind(VM* vm, ExecState* callFrame, JSValue exceptionValue) Instruction* catchPCForInterpreter = 0; if (handler) { catchPCForInterpreter = &callFrame->codeBlock()->instructions()[handler->target]; - catchRoutine = ExecutableBase::catchRoutineFor(handler, catchPCForInterpreter); +#if ENABLE(JIT) + catchRoutine = handler->nativeCode.executableAddress(); +#else + catchRoutine = catchPCForInterpreter->u.pointer; +#endif } else - catchRoutine = FunctionPtr(LLInt::getCodePtr(ctiOpThrowNotCaught)).value(); + catchRoutine = LLInt::getCodePtr(returnFromJavaScript); vm->callFrameForThrow = callFrame; vm->targetMachinePCForThrow = catchRoutine; @@ -58,6 +65,4 @@ void genericUnwind(VM* vm, ExecState* callFrame, JSValue exceptionValue) RELEASE_ASSERT(catchRoutine); } -} - -#endif +} // namespace JSC diff --git a/JavaScriptCore/jit/JITInlineCacheGenerator.cpp b/JavaScriptCore/jit/JITInlineCacheGenerator.cpp index 7cee8e3b..74b086a7 100644 --- a/JavaScriptCore/jit/JITInlineCacheGenerator.cpp +++ b/JavaScriptCore/jit/JITInlineCacheGenerator.cpp @@ -49,7 +49,7 @@ JITInlineCacheGenerator::JITInlineCacheGenerator(CodeBlock* codeBlock, CodeOrigi JITByIdGenerator::JITByIdGenerator( CodeBlock* codeBlock, CodeOrigin codeOrigin, const RegisterSet& usedRegisters, - JSValueRegs base, JSValueRegs value, bool registersFlushed) + GPRReg callFrameRegister, JSValueRegs base, JSValueRegs value, bool registersFlushed) : JITInlineCacheGenerator(codeBlock, codeOrigin) , m_base(base) , m_value(value) @@ -62,6 +62,7 @@ JITByIdGenerator::JITByIdGenerator( m_stubInfo->patch.usedRegisters.set(base); m_stubInfo->patch.usedRegisters.set(value); + m_stubInfo->patch.callFrameRegister = static_cast(callFrameRegister); m_stubInfo->patch.baseGPR = static_cast(base.payloadGPR()); m_stubInfo->patch.valueGPR = static_cast(value.payloadGPR()); #if USE(JSVALUE32_64) @@ -75,7 +76,7 @@ void JITByIdGenerator::finalize(LinkBuffer& fastPath, LinkBuffer& slowPath) m_stubInfo->callReturnLocation = callReturnLocation; m_stubInfo->patch.deltaCheckImmToCall = MacroAssembler::differenceBetweenCodePtr( fastPath.locationOf(m_structureImm), callReturnLocation); - m_stubInfo->patch.deltaCallToStructCheck = MacroAssembler::differenceBetweenCodePtr( + m_stubInfo->patch.deltaCallToJump = MacroAssembler::differenceBetweenCodePtr( callReturnLocation, fastPath.locationOf(m_structureCheck)); #if USE(JSVALUE64) m_stubInfo->patch.deltaCallToLoadOrStore = MacroAssembler::differenceBetweenCodePtr( @@ -129,9 +130,11 @@ void JITGetByIdGenerator::generateFastPath(MacroAssembler& jit) JITPutByIdGenerator::JITPutByIdGenerator( CodeBlock* codeBlock, CodeOrigin codeOrigin, const RegisterSet& usedRegisters, - JSValueRegs base, JSValueRegs value, GPRReg scratch, bool registersFlushed, - ECMAMode ecmaMode, PutKind putKind) - : JITByIdGenerator(codeBlock, codeOrigin, usedRegisters, base, value, registersFlushed) + GPRReg callFrameRegister, JSValueRegs base, JSValueRegs value, GPRReg scratch, + bool registersFlushed, ECMAMode ecmaMode, PutKind putKind) + : JITByIdGenerator( + codeBlock, codeOrigin, usedRegisters, callFrameRegister, base, value, + registersFlushed) , m_scratch(scratch) , m_ecmaMode(ecmaMode) , m_putKind(putKind) diff --git a/JavaScriptCore/jit/JITInlineCacheGenerator.h b/JavaScriptCore/jit/JITInlineCacheGenerator.h index 6db9836d..6ff0c09b 100644 --- a/JavaScriptCore/jit/JITInlineCacheGenerator.h +++ b/JavaScriptCore/jit/JITInlineCacheGenerator.h @@ -56,8 +56,8 @@ class JITByIdGenerator : public JITInlineCacheGenerator { JITByIdGenerator() { } JITByIdGenerator( - CodeBlock*, CodeOrigin, const RegisterSet&, JSValueRegs base, JSValueRegs value, - bool registersFlushed); + CodeBlock*, CodeOrigin, const RegisterSet&, GPRReg callFrameRegister, + JSValueRegs base, JSValueRegs value, bool registersFlushed); public: void reportSlowPathCall(MacroAssembler::Label slowPathBegin, MacroAssembler::Call call) @@ -96,8 +96,11 @@ class JITGetByIdGenerator : public JITByIdGenerator { JITGetByIdGenerator( CodeBlock* codeBlock, CodeOrigin codeOrigin, const RegisterSet& usedRegisters, - JSValueRegs base, JSValueRegs value, bool registersFlushed) - : JITByIdGenerator(codeBlock, codeOrigin, usedRegisters, base, value, registersFlushed) + GPRReg callFrameRegister, JSValueRegs base, JSValueRegs value, + bool registersFlushed) + : JITByIdGenerator( + codeBlock, codeOrigin, usedRegisters, callFrameRegister, base, value, + registersFlushed) { } @@ -109,8 +112,9 @@ class JITPutByIdGenerator : public JITByIdGenerator { JITPutByIdGenerator() { } JITPutByIdGenerator( - CodeBlock*, CodeOrigin, const RegisterSet& usedRegisters, JSValueRegs base, - JSValueRegs value, GPRReg scratch, bool registersFlushed, ECMAMode, PutKind); + CodeBlock*, CodeOrigin, const RegisterSet& usedRegisters, GPRReg callFrameRegister, + JSValueRegs base, JSValueRegs value, GPRReg scratch, bool registersFlushed, + ECMAMode, PutKind); void generateFastPath(MacroAssembler&); diff --git a/JavaScriptCore/jit/JITInlines.h b/JavaScriptCore/jit/JITInlines.h index d76969f5..9330e773 100644 --- a/JavaScriptCore/jit/JITInlines.h +++ b/JavaScriptCore/jit/JITInlines.h @@ -57,24 +57,17 @@ ALWAYS_INLINE void JIT::emitPutIntToCallFrameHeader(RegisterID from, JSStack::Ca ALWAYS_INLINE void JIT::emitGetFromCallFrameHeaderPtr(JSStack::CallFrameHeaderEntry entry, RegisterID to, RegisterID from) { loadPtr(Address(from, entry * sizeof(Register)), to); -#if USE(JSVALUE64) - killLastResultRegister(); -#endif } ALWAYS_INLINE void JIT::emitGetFromCallFrameHeader32(JSStack::CallFrameHeaderEntry entry, RegisterID to, RegisterID from) { load32(Address(from, entry * sizeof(Register)), to); -#if USE(JSVALUE64) - killLastResultRegister(); -#endif } #if USE(JSVALUE64) ALWAYS_INLINE void JIT::emitGetFromCallFrameHeader64(JSStack::CallFrameHeaderEntry entry, RegisterID to, RegisterID from) { load64(Address(from, entry * sizeof(Register)), to); - killLastResultRegister(); } #endif @@ -106,16 +99,6 @@ ALWAYS_INLINE JIT::Call JIT::emitNakedCall(CodePtr function) return nakedCall; } -ALWAYS_INLINE bool JIT::atJumpTarget() -{ - while (m_jumpTargetsPosition < m_codeBlock->numberOfJumpTargets() && m_codeBlock->jumpTarget(m_jumpTargetsPosition) <= m_bytecodeOffset) { - if (m_codeBlock->jumpTarget(m_jumpTargetsPosition) == m_bytecodeOffset) - return true; - ++m_jumpTargetsPosition; - } - return false; -} - ALWAYS_INLINE void JIT::updateTopCallFrame() { ASSERT(static_cast(m_bytecodeOffset) >= 0); @@ -149,9 +132,9 @@ ALWAYS_INLINE MacroAssembler::Call JIT::appendCallWithExceptionCheckSetJSValueRe { MacroAssembler::Call call = appendCallWithExceptionCheck(function); #if USE(JSVALUE64) - emitPutVirtualRegister(dst, returnValueRegister); + emitPutVirtualRegister(dst, returnValueGPR); #else - emitStore(dst, returnValue2Register, returnValueRegister); + emitStore(dst, returnValueGPR2, returnValueGPR); #endif return call; } @@ -159,11 +142,11 @@ ALWAYS_INLINE MacroAssembler::Call JIT::appendCallWithExceptionCheckSetJSValueRe ALWAYS_INLINE MacroAssembler::Call JIT::appendCallWithExceptionCheckSetJSValueResultWithProfile(const FunctionPtr& function, int dst) { MacroAssembler::Call call = appendCallWithExceptionCheck(function); - emitValueProfilingSite(regT4); + emitValueProfilingSite(); #if USE(JSVALUE64) - emitPutVirtualRegister(dst, returnValueRegister); + emitPutVirtualRegister(dst, returnValueGPR); #else - emitStore(dst, returnValue2Register, returnValueRegister); + emitStore(dst, returnValueGPR2, returnValueGPR); #endif return call; } @@ -216,6 +199,12 @@ ALWAYS_INLINE MacroAssembler::Call JIT::callOperation(J_JITOperation_EC operatio return appendCallWithExceptionCheckSetJSValueResult(operation, dst); } +ALWAYS_INLINE MacroAssembler::Call JIT::callOperation(V_JITOperation_EC operation, JSCell* cell) +{ + setupArgumentsWithExecState(TrustedImmPtr(cell)); + return appendCallWithExceptionCheck(operation); +} + ALWAYS_INLINE MacroAssembler::Call JIT::callOperation(J_JITOperation_EP operation, int dst, void* pointer) { setupArgumentsWithExecState(TrustedImmPtr(pointer)); @@ -302,9 +291,15 @@ ALWAYS_INLINE MacroAssembler::Call JIT::callOperationWithCallFrameRollbackOnExce #if USE(JSVALUE64) -ALWAYS_INLINE MacroAssembler::Call JIT::callOperation(F_JITOperation_EJJZ operation, GPRReg arg1, GPRReg arg2, int32_t arg3) +ALWAYS_INLINE MacroAssembler::Call JIT::callOperation(F_JITOperation_EJZ operation, GPRReg arg1, int32_t arg3) +{ + setupArgumentsWithExecState(arg1, TrustedImm32(arg3)); + return appendCallWithExceptionCheck(operation); +} + +ALWAYS_INLINE MacroAssembler::Call JIT::callOperation(F_JITOperation_EFJJ operation, GPRReg arg1, GPRReg arg2, GPRReg arg3) { - setupArgumentsWithExecState(arg1, arg2, TrustedImm32(arg3)); + setupArgumentsWithExecState(arg1, arg2, arg3); return appendCallWithExceptionCheck(operation); } @@ -437,17 +432,23 @@ ALWAYS_INLINE MacroAssembler::Call JIT::callOperationNoExceptionCheck(V_JITOpera return appendCall(operation); } -ALWAYS_INLINE MacroAssembler::Call JIT::callOperation(F_JITOperation_EJJZ operation, GPRReg arg1Tag, GPRReg arg1Payload, GPRReg arg2Tag, GPRReg arg2Payload, int32_t arg3) +ALWAYS_INLINE MacroAssembler::Call JIT::callOperation(F_JITOperation_EJZ operation, GPRReg arg1Tag, GPRReg arg1Payload, int32_t arg2) { #if CPU(SH4) // We have to put arg3 in the 4th argument register (r7) as 64-bit value arg2 will be put on stack for sh4 architecure. - setupArgumentsWithExecState(arg1Payload, arg1Tag, TrustedImm32(arg3), arg2Payload, arg2Tag); + setupArgumentsWithExecState(arg1Payload, arg1Tag, TrustedImm32(arg2)); #else - setupArgumentsWithExecState(EABI_32BIT_DUMMY_ARG arg1Payload, arg1Tag, arg2Payload, arg2Tag, TrustedImm32(arg3)); + setupArgumentsWithExecState(EABI_32BIT_DUMMY_ARG arg1Payload, arg1Tag, TrustedImm32(arg2)); #endif return appendCallWithExceptionCheck(operation); } +ALWAYS_INLINE MacroAssembler::Call JIT::callOperation(F_JITOperation_EFJJ operation, GPRReg arg1, GPRReg arg2Tag, GPRReg arg2Payload, GPRReg arg3Tag, GPRReg arg3Payload) +{ + setupArgumentsWithExecState(arg1, arg2Payload, arg2Tag, arg3Payload, arg3Tag); + return appendCallWithExceptionCheck(operation); +} + ALWAYS_INLINE MacroAssembler::Call JIT::callOperation(J_JITOperation_EAapJ operation, int dst, ArrayAllocationProfile* arg1, GPRReg arg2Tag, GPRReg arg2Payload) { setupArgumentsWithExecState(TrustedImmPtr(arg1), arg2Payload, arg2Tag); @@ -540,7 +541,7 @@ ALWAYS_INLINE MacroAssembler::Call JIT::callOperation(V_JITOperation_EJZ operati ALWAYS_INLINE MacroAssembler::Call JIT::callOperation(V_JITOperation_EJZJ operation, RegisterID regOp1Tag, RegisterID regOp1Payload, int32_t op2, RegisterID regOp3Tag, RegisterID regOp3Payload) { - setupArgumentsWithExecState(EABI_32BIT_DUMMY_ARG regOp1Payload, regOp1Tag, TrustedImm32(op2), regOp3Payload, regOp3Tag); + setupArgumentsWithExecState(EABI_32BIT_DUMMY_ARG regOp1Payload, regOp1Tag, TrustedImm32(op2), EABI_32BIT_DUMMY_ARG regOp3Payload, regOp3Tag); return appendCallWithExceptionCheck(operation); } @@ -679,8 +680,7 @@ inline void JIT::emitAllocateJSObject(RegisterID allocator, StructureType struct storePtr(TrustedImmPtr(0), Address(result, JSObject::butterflyOffset())); } -#if ENABLE(VALUE_PROFILER) -inline void JIT::emitValueProfilingSite(ValueProfile* valueProfile, RegisterID bucketCounterRegister) +inline void JIT::emitValueProfilingSite(ValueProfile* valueProfile) { ASSERT(shouldEmitProfiling()); ASSERT(valueProfile); @@ -689,47 +689,29 @@ inline void JIT::emitValueProfilingSite(ValueProfile* valueProfile, RegisterID b #if USE(JSVALUE32_64) const RegisterID valueTag = regT1; #endif - const RegisterID scratch = regT3; - if (ValueProfile::numberOfBuckets == 1) { - // We're in a simple configuration: only one bucket, so we can just do a direct - // store. + // We're in a simple configuration: only one bucket, so we can just do a direct + // store. #if USE(JSVALUE64) - store64(value, valueProfile->m_buckets); + store64(value, valueProfile->m_buckets); #else - EncodedValueDescriptor* descriptor = bitwise_cast(valueProfile->m_buckets); - store32(value, &descriptor->asBits.payload); - store32(valueTag, &descriptor->asBits.tag); -#endif - return; - } - - if (m_randomGenerator.getUint32() & 1) - add32(TrustedImm32(1), bucketCounterRegister); - else - add32(TrustedImm32(3), bucketCounterRegister); - and32(TrustedImm32(ValueProfile::bucketIndexMask), bucketCounterRegister); - move(TrustedImmPtr(valueProfile->m_buckets), scratch); -#if USE(JSVALUE64) - store64(value, BaseIndex(scratch, bucketCounterRegister, TimesEight)); -#elif USE(JSVALUE32_64) - store32(value, BaseIndex(scratch, bucketCounterRegister, TimesEight, OBJECT_OFFSETOF(JSValue, u.asBits.payload))); - store32(valueTag, BaseIndex(scratch, bucketCounterRegister, TimesEight, OBJECT_OFFSETOF(JSValue, u.asBits.tag))); + EncodedValueDescriptor* descriptor = bitwise_cast(valueProfile->m_buckets); + store32(value, &descriptor->asBits.payload); + store32(valueTag, &descriptor->asBits.tag); #endif } -inline void JIT::emitValueProfilingSite(unsigned bytecodeOffset, RegisterID bucketCounterRegister) +inline void JIT::emitValueProfilingSite(unsigned bytecodeOffset) { if (!shouldEmitProfiling()) return; - emitValueProfilingSite(m_codeBlock->valueProfileForBytecodeOffset(bytecodeOffset), bucketCounterRegister); + emitValueProfilingSite(m_codeBlock->valueProfileForBytecodeOffset(bytecodeOffset)); } -inline void JIT::emitValueProfilingSite(RegisterID bucketCounterRegister) +inline void JIT::emitValueProfilingSite() { - emitValueProfilingSite(m_bytecodeOffset, bucketCounterRegister); + emitValueProfilingSite(m_bytecodeOffset); } -#endif // ENABLE(VALUE_PROFILER) inline void JIT::emitArrayProfilingSite(RegisterID structureAndIndexingType, RegisterID scratch, ArrayProfile* arrayProfile) { @@ -746,46 +728,26 @@ inline void JIT::emitArrayProfilingSite(RegisterID structureAndIndexingType, Reg inline void JIT::emitArrayProfilingSiteForBytecodeIndex(RegisterID structureAndIndexingType, RegisterID scratch, unsigned bytecodeIndex) { -#if ENABLE(VALUE_PROFILER) emitArrayProfilingSite(structureAndIndexingType, scratch, m_codeBlock->getOrAddArrayProfile(bytecodeIndex)); -#else - UNUSED_PARAM(bytecodeIndex); - emitArrayProfilingSite(structureAndIndexingType, scratch, 0); -#endif } inline void JIT::emitArrayProfileStoreToHoleSpecialCase(ArrayProfile* arrayProfile) { -#if ENABLE(VALUE_PROFILER) store8(TrustedImm32(1), arrayProfile->addressOfMayStoreToHole()); -#else - UNUSED_PARAM(arrayProfile); -#endif } inline void JIT::emitArrayProfileOutOfBoundsSpecialCase(ArrayProfile* arrayProfile) { -#if ENABLE(VALUE_PROFILER) store8(TrustedImm32(1), arrayProfile->addressOfOutOfBounds()); -#else - UNUSED_PARAM(arrayProfile); -#endif } static inline bool arrayProfileSaw(ArrayModes arrayModes, IndexingType capability) { -#if ENABLE(VALUE_PROFILER) return arrayModesInclude(arrayModes, capability); -#else - UNUSED_PARAM(arrayModes); - UNUSED_PARAM(capability); - return false; -#endif } inline JITArrayMode JIT::chooseArrayMode(ArrayProfile* profile) { -#if ENABLE(VALUE_PROFILER) ConcurrentJITLocker locker(m_codeBlock->m_lock); profile->computeUpdatedPrediction(locker, m_codeBlock); ArrayModes arrayModes = profile->observedArrayModes(locker); @@ -796,50 +758,28 @@ inline JITArrayMode JIT::chooseArrayMode(ArrayProfile* profile) if (arrayProfileSaw(arrayModes, ArrayStorageShape)) return JITArrayStorage; return JITContiguous; -#else - UNUSED_PARAM(profile); - return JITContiguous; -#endif } #if USE(JSVALUE32_64) inline void JIT::emitLoadTag(int index, RegisterID tag) { - RegisterID mappedTag; - if (getMappedTag(index, mappedTag)) { - move(mappedTag, tag); - unmap(tag); - return; - } - if (m_codeBlock->isConstantRegisterIndex(index)) { move(Imm32(getConstantOperand(index).tag()), tag); - unmap(tag); return; } load32(tagFor(index), tag); - unmap(tag); } inline void JIT::emitLoadPayload(int index, RegisterID payload) { - RegisterID mappedPayload; - if (getMappedPayload(index, mappedPayload)) { - move(mappedPayload, payload); - unmap(payload); - return; - } - if (m_codeBlock->isConstantRegisterIndex(index)) { move(Imm32(getConstantOperand(index).payload()), payload); - unmap(payload); return; } load32(payloadFor(index), payload); - unmap(payload); } inline void JIT::emitLoad(const JSValue& v, RegisterID tag, RegisterID payload) @@ -871,11 +811,6 @@ inline void JIT::emitLoad(int index, RegisterID tag, RegisterID payload, Registe inline void JIT::emitLoad2(int index1, RegisterID tag1, RegisterID payload1, int index2, RegisterID tag2, RegisterID payload2) { - if (isMapped(index1)) { - emitLoad(index1, tag1, payload1); - emitLoad(index2, tag2, payload2); - return; - } emitLoad(index2, tag2, payload2); emitLoad(index1, tag1, payload1); } @@ -912,12 +847,6 @@ inline void JIT::emitStoreInt32(int index, RegisterID payload, bool indexIsInt32 store32(TrustedImm32(JSValue::Int32Tag), tagFor(index, callFrameRegister)); } -inline void JIT::emitStoreAndMapInt32(int index, RegisterID tag, RegisterID payload, bool indexIsInt32, size_t opcodeLength) -{ - emitStoreInt32(index, payload, indexIsInt32); - map(m_bytecodeOffset + opcodeLength, index, tag, payload); -} - inline void JIT::emitStoreInt32(int index, TrustedImm32 payload, bool indexIsInt32) { store32(payload, payloadFor(index, callFrameRegister)); @@ -955,81 +884,6 @@ ALWAYS_INLINE void JIT::emitInitRegister(int dst) emitStore(dst, jsUndefined()); } -inline bool JIT::isLabeled(unsigned bytecodeOffset) -{ - for (size_t numberOfJumpTargets = m_codeBlock->numberOfJumpTargets(); m_jumpTargetIndex != numberOfJumpTargets; ++m_jumpTargetIndex) { - unsigned jumpTarget = m_codeBlock->jumpTarget(m_jumpTargetIndex); - if (jumpTarget == bytecodeOffset) - return true; - if (jumpTarget > bytecodeOffset) - return false; - } - return false; -} - -inline void JIT::map(unsigned bytecodeOffset, int virtualRegisterIndex, RegisterID tag, RegisterID payload) -{ - if (isLabeled(bytecodeOffset)) - return; - - m_mappedBytecodeOffset = bytecodeOffset; - m_mappedVirtualRegisterIndex = virtualRegisterIndex; - m_mappedTag = tag; - m_mappedPayload = payload; - - ASSERT(!canBeOptimizedOrInlined() || m_mappedPayload == regT0); - ASSERT(!canBeOptimizedOrInlined() || m_mappedTag == regT1); -} - -inline void JIT::unmap(RegisterID registerID) -{ - if (m_mappedTag == registerID) - m_mappedTag = (RegisterID)-1; - else if (m_mappedPayload == registerID) - m_mappedPayload = (RegisterID)-1; -} - -inline void JIT::unmap() -{ - m_mappedBytecodeOffset = (unsigned)-1; - m_mappedVirtualRegisterIndex = UINT_MAX; - m_mappedTag = (RegisterID)-1; - m_mappedPayload = (RegisterID)-1; -} - -inline bool JIT::isMapped(int virtualRegisterIndex) -{ - if (m_mappedBytecodeOffset != m_bytecodeOffset) - return false; - if (m_mappedVirtualRegisterIndex != virtualRegisterIndex) - return false; - return true; -} - -inline bool JIT::getMappedPayload(int virtualRegisterIndex, RegisterID& payload) -{ - if (m_mappedBytecodeOffset != m_bytecodeOffset) - return false; - if (m_mappedVirtualRegisterIndex != virtualRegisterIndex) - return false; - if (m_mappedPayload == (RegisterID)-1) - return false; - payload = m_mappedPayload; - return true; -} - -inline bool JIT::getMappedTag(int virtualRegisterIndex, RegisterID& tag) -{ - if (m_mappedBytecodeOffset != m_bytecodeOffset) - return false; - if (m_mappedVirtualRegisterIndex != virtualRegisterIndex) - return false; - if (m_mappedTag == (RegisterID)-1) - return false; - tag = m_mappedTag; - return true; -} - inline void JIT::emitJumpSlowCaseIfNotJSCell(int virtualRegisterIndex) { if (!m_codeBlock->isKnownNotImmediate(virtualRegisterIndex)) { @@ -1074,11 +928,6 @@ ALWAYS_INLINE bool JIT::getOperandConstantImmediateInt(int op1, int op2, int& op #else // USE(JSVALUE32_64) -ALWAYS_INLINE void JIT::killLastResultRegister() -{ - m_lastResultBytecodeRegister = std::numeric_limits::max(); -} - // get arg puts an arg from the SF register array into a h/w register ALWAYS_INLINE void JIT::emitGetVirtualRegister(int src, RegisterID dst) { @@ -1091,20 +940,10 @@ ALWAYS_INLINE void JIT::emitGetVirtualRegister(int src, RegisterID dst) move(TrustedImm64(JSValue::encode(value)), dst); else move(Imm64(JSValue::encode(value)), dst); - killLastResultRegister(); - return; - } - - if (src == m_lastResultBytecodeRegister && operandIsLocal(src) && m_codeBlock->isTemporaryRegisterIndex(VirtualRegister(src).toLocal()) && !atJumpTarget()) { - // The argument we want is already stored in eax - if (dst != cachedResultRegister) - move(cachedResultRegister, dst); - killLastResultRegister(); return; } load64(Address(callFrameRegister, src * sizeof(Register)), dst); - killLastResultRegister(); } ALWAYS_INLINE void JIT::emitGetVirtualRegister(VirtualRegister src, RegisterID dst) @@ -1114,13 +953,8 @@ ALWAYS_INLINE void JIT::emitGetVirtualRegister(VirtualRegister src, RegisterID d ALWAYS_INLINE void JIT::emitGetVirtualRegisters(int src1, RegisterID dst1, int src2, RegisterID dst2) { - if (src2 == m_lastResultBytecodeRegister) { - emitGetVirtualRegister(src2, dst2); - emitGetVirtualRegister(src1, dst1); - } else { - emitGetVirtualRegister(src1, dst1); - emitGetVirtualRegister(src2, dst2); - } + emitGetVirtualRegister(src1, dst1); + emitGetVirtualRegister(src2, dst2); } ALWAYS_INLINE void JIT::emitGetVirtualRegisters(VirtualRegister src1, RegisterID dst1, VirtualRegister src2, RegisterID dst2) @@ -1141,7 +975,6 @@ ALWAYS_INLINE bool JIT::isOperandConstantImmediateInt(int src) ALWAYS_INLINE void JIT::emitPutVirtualRegister(int dst, RegisterID from) { store64(from, Address(callFrameRegister, dst * sizeof(Register))); - m_lastResultBytecodeRegister = (from == cachedResultRegister) ? dst : std::numeric_limits::max(); } ALWAYS_INLINE void JIT::emitPutVirtualRegister(VirtualRegister dst, RegisterID from) diff --git a/JavaScriptCore/jit/JITOpcodes.cpp b/JavaScriptCore/jit/JITOpcodes.cpp index ffa22b9d..394d81ac 100644 --- a/JavaScriptCore/jit/JITOpcodes.cpp +++ b/JavaScriptCore/jit/JITOpcodes.cpp @@ -55,36 +55,24 @@ void JIT::emit_op_mov(Instruction* currentInstruction) int dst = currentInstruction[1].u.operand; int src = currentInstruction[2].u.operand; - if (canBeOptimizedOrInlined()) { - // Use simpler approach, since the DFG thinks that the last result register - // is always set to the destination on every operation. - emitGetVirtualRegister(src, regT0); - emitPutVirtualRegister(dst); - } else { - if (m_codeBlock->isConstantRegisterIndex(src)) { - if (!getConstantOperand(src).isNumber()) - store64(TrustedImm64(JSValue::encode(getConstantOperand(src))), Address(callFrameRegister, dst * sizeof(Register))); - else - store64(Imm64(JSValue::encode(getConstantOperand(src))), Address(callFrameRegister, dst * sizeof(Register))); - if (dst == m_lastResultBytecodeRegister) - killLastResultRegister(); - } else if ((src == m_lastResultBytecodeRegister) || (dst == m_lastResultBytecodeRegister)) { - // If either the src or dst is the cached register go though - // get/put registers to make sure we track this correctly. - emitGetVirtualRegister(src, regT0); - emitPutVirtualRegister(dst); - } else { - // Perform the copy via regT1; do not disturb any mapping in regT0. - load64(Address(callFrameRegister, src * sizeof(Register)), regT1); - store64(regT1, Address(callFrameRegister, dst * sizeof(Register))); - } - } + emitGetVirtualRegister(src, regT0); + emitPutVirtualRegister(dst); +} + +void JIT::emit_op_captured_mov(Instruction* currentInstruction) +{ + int dst = currentInstruction[1].u.operand; + int src = currentInstruction[2].u.operand; + + emitGetVirtualRegister(src, regT0); + emitNotifyWrite(regT0, regT1, currentInstruction[3].u.watchpointSet); + emitPutVirtualRegister(dst); } void JIT::emit_op_end(Instruction* currentInstruction) { - RELEASE_ASSERT(returnValueRegister != callFrameRegister); - emitGetVirtualRegister(currentInstruction[1].u.operand, returnValueRegister); + RELEASE_ASSERT(returnValueGPR != callFrameRegister); + emitGetVirtualRegister(currentInstruction[1].u.operand, returnValueGPR); restoreReturnAddressBeforeReturn(Address(callFrameRegister, CallFrame::returnPCOffset())); ret(); } @@ -116,7 +104,7 @@ void JIT::emitSlow_op_new_object(Instruction* currentInstruction, Vectorstructure(); callOperation(operationNewObject, structure); - emitStoreCell(dst, returnValueRegister); + emitStoreCell(dst, returnValueGPR); } void JIT::emit_op_check_has_instance(Instruction* currentInstruction) @@ -268,11 +256,11 @@ void JIT::emit_op_tear_off_arguments(Instruction* currentInstruction) void JIT::emit_op_ret(Instruction* currentInstruction) { ASSERT(callFrameRegister != regT1); - ASSERT(regT1 != returnValueRegister); - ASSERT(returnValueRegister != callFrameRegister); + ASSERT(regT1 != returnValueGPR); + ASSERT(returnValueGPR != callFrameRegister); // Return the result in %eax. - emitGetVirtualRegister(currentInstruction[1].u.operand, returnValueRegister); + emitGetVirtualRegister(currentInstruction[1].u.operand, returnValueGPR); // Grab the return address. emitGetReturnPCFromCallFrameHeaderPtr(regT1); @@ -288,13 +276,13 @@ void JIT::emit_op_ret(Instruction* currentInstruction) void JIT::emit_op_ret_object_or_this(Instruction* currentInstruction) { ASSERT(callFrameRegister != regT1); - ASSERT(regT1 != returnValueRegister); - ASSERT(returnValueRegister != callFrameRegister); + ASSERT(regT1 != returnValueGPR); + ASSERT(returnValueGPR != callFrameRegister); // Return the result in %eax. - emitGetVirtualRegister(currentInstruction[1].u.operand, returnValueRegister); - Jump notJSCell = emitJumpIfNotJSCell(returnValueRegister); - loadPtr(Address(returnValueRegister, JSCell::structureOffset()), regT2); + emitGetVirtualRegister(currentInstruction[1].u.operand, returnValueGPR); + Jump notJSCell = emitJumpIfNotJSCell(returnValueGPR); + loadPtr(Address(returnValueGPR, JSCell::structureOffset()), regT2); Jump notObject = emitJumpIfNotObject(regT2); // Grab the return address. @@ -310,7 +298,7 @@ void JIT::emit_op_ret_object_or_this(Instruction* currentInstruction) // Return 'this' in %eax. notJSCell.link(this); notObject.link(this); - emitGetVirtualRegister(currentInstruction[2].u.operand, returnValueRegister); + emitGetVirtualRegister(currentInstruction[2].u.operand, returnValueGPR); // Grab the return address. emitGetReturnPCFromCallFrameHeaderPtr(regT1); @@ -343,7 +331,6 @@ void JIT::emit_op_strcat(Instruction* currentInstruction) { JITSlowPathCall slowPathCall(this, currentInstruction, slow_path_strcat); slowPathCall.call(); - emitGetVirtualRegister(currentInstruction[1].u.operand, regT0); } void JIT::emit_op_not(Instruction* currentInstruction) @@ -483,7 +470,7 @@ void JIT::emit_op_bitor(Instruction* currentInstruction) void JIT::emit_op_throw(Instruction* currentInstruction) { - ASSERT(regT0 == returnValueRegister); + ASSERT(regT0 == returnValueGPR); emitGetVirtualRegister(currentInstruction[1].u.operand, regT0); callOperationNoExceptionCheck(operationThrow, regT0); jumpToExceptionHandler(); @@ -511,7 +498,7 @@ void JIT::emit_op_get_pnames(Instruction* currentInstruction) // this call doesn't seem to be hot. Label isObject(this); callOperation(operationGetPNames, regT0); - emitStoreCell(dst, returnValueRegister); + emitStoreCell(dst, returnValueGPR); load32(Address(regT0, OBJECT_OFFSETOF(JSPropertyNameIterator, m_jsStringsSize)), regT3); store64(tagTypeNumberRegister, addressFor(i)); store32(TrustedImm32(Int32Tag), intTagFor(size)); @@ -661,9 +648,8 @@ void JIT::emit_op_push_name_scope(Instruction* currentInstruction) void JIT::emit_op_catch(Instruction* currentInstruction) { - killLastResultRegister(); // FIXME: Implicitly treat op_catch as a labeled statement, and remove this line of code. - move(regT0, callFrameRegister); move(TrustedImmPtr(m_vm), regT3); + load64(Address(regT3, VM::callFrameForThrowOffset()), callFrameRegister); load64(Address(regT3, VM::exceptionOffset()), regT0); store64(TrustedImm64(JSValue::encode(JSValue())), Address(regT3, VM::exceptionOffset())); emitPutVirtualRegister(currentInstruction[1].u.operand); @@ -682,7 +668,7 @@ void JIT::emit_op_switch_imm(Instruction* currentInstruction) emitGetVirtualRegister(scrutinee, regT0); callOperation(operationSwitchImmWithUnknownKeyType, regT0, tableIndex); - jump(returnValueRegister); + jump(returnValueGPR); } void JIT::emit_op_switch_char(Instruction* currentInstruction) @@ -698,7 +684,7 @@ void JIT::emit_op_switch_char(Instruction* currentInstruction) emitGetVirtualRegister(scrutinee, regT0); callOperation(operationSwitchCharWithUnknownKeyType, regT0, tableIndex); - jump(returnValueRegister); + jump(returnValueGPR); } void JIT::emit_op_switch_string(Instruction* currentInstruction) @@ -713,7 +699,7 @@ void JIT::emit_op_switch_string(Instruction* currentInstruction) emitGetVirtualRegister(scrutinee, regT0); callOperation(operationSwitchStringWithUnknownKeyType, regT0, tableIndex); - jump(returnValueRegister); + jump(returnValueGPR); } void JIT::emit_op_throw_static_error(Instruction* currentInstruction) @@ -727,7 +713,7 @@ void JIT::emit_op_debug(Instruction* currentInstruction) #if ENABLE(DEBUG_WITH_BREAKPOINT) UNUSED_PARAM(currentInstruction); breakpoint(); -#else +#elif ENABLE(JAVASCRIPT_DEBUGGER) JSGlobalObject* globalObject = codeBlock()->globalObject(); Debugger* debugger = globalObject->debugger(); char* debuggerAddress = reinterpret_cast(globalObject) + JSGlobalObject::debuggerOffset(); @@ -737,6 +723,8 @@ void JIT::emit_op_debug(Instruction* currentInstruction) callOperation(operationDebug, currentInstruction[1].u.operand); skipDebugHook.link(this); noDebugger.link(this); +#else + UNUSED_PARAM(currentInstruction); #endif } @@ -803,7 +791,7 @@ void JIT::emit_op_neq_null(Instruction* currentInstruction) emitPutVirtualRegister(dst); } -void JIT::emit_op_enter(Instruction*) +void JIT::emit_op_enter(Instruction* currentInstruction) { emitEnterOptimizationCheck(); @@ -813,6 +801,9 @@ void JIT::emit_op_enter(Instruction*) size_t count = m_codeBlock->m_numVars; for (size_t j = 0; j < count; ++j) emitInitRegister(virtualRegisterForLocal(j).offset()); + + JITSlowPathCall slowPathCall(this, currentInstruction, slow_path_enter); + slowPathCall.call(); } void JIT::emit_op_create_activation(Instruction* currentInstruction) @@ -821,7 +812,7 @@ void JIT::emit_op_create_activation(Instruction* currentInstruction) Jump activationCreated = branchTest64(NonZero, Address(callFrameRegister, sizeof(Register) * dst)); callOperation(operationCreateActivation, 0); - emitStoreCell(dst, returnValueRegister); + emitStoreCell(dst, returnValueGPR); activationCreated.link(this); } @@ -832,8 +823,8 @@ void JIT::emit_op_create_arguments(Instruction* currentInstruction) Jump argsCreated = branchTest64(NonZero, Address(callFrameRegister, sizeof(Register) * dst)); callOperation(operationCreateArguments); - emitStoreCell(dst, returnValueRegister); - emitStoreCell(unmodifiedArgumentsRegister(VirtualRegister(dst)), returnValueRegister); + emitStoreCell(dst, returnValueGPR); + emitStoreCell(unmodifiedArgumentsRegister(VirtualRegister(dst)), returnValueGPR); argsCreated.link(this); } @@ -876,7 +867,6 @@ void JIT::emitSlow_op_get_callee(Instruction* currentInstruction, Vector::iterator& iter) @@ -939,7 +927,6 @@ void JIT::emitSlow_op_to_primitive(Instruction* currentInstruction, Vector::iterator& iter) @@ -948,21 +935,20 @@ void JIT::emitSlow_op_not(Instruction* currentInstruction, Vector JITSlowPathCall slowPathCall(this, currentInstruction, slow_path_not); slowPathCall.call(); - emitGetVirtualRegister(currentInstruction[1].u.operand, regT0); } void JIT::emitSlow_op_jfalse(Instruction* currentInstruction, Vector::iterator& iter) { linkSlowCase(iter); callOperation(operationConvertJSValueToBoolean, regT0); - emitJumpSlowToHot(branchTest32(Zero, returnValueRegister), currentInstruction[2].u.operand); // inverted! + emitJumpSlowToHot(branchTest32(Zero, returnValueGPR), currentInstruction[2].u.operand); // inverted! } void JIT::emitSlow_op_jtrue(Instruction* currentInstruction, Vector::iterator& iter) { linkSlowCase(iter); callOperation(operationConvertJSValueToBoolean, regT0); - emitJumpSlowToHot(branchTest32(NonZero, returnValueRegister), currentInstruction[2].u.operand); + emitJumpSlowToHot(branchTest32(NonZero, returnValueGPR), currentInstruction[2].u.operand); } void JIT::emitSlow_op_bitxor(Instruction* currentInstruction, Vector::iterator& iter) @@ -970,7 +956,6 @@ void JIT::emitSlow_op_bitxor(Instruction* currentInstruction, Vector::iterator& iter) @@ -978,15 +963,14 @@ void JIT::emitSlow_op_bitor(Instruction* currentInstruction, Vector::iterator& iter) { linkSlowCase(iter); callOperation(operationCompareEq, regT0, regT1); - emitTagAsBoolImmediate(returnValueRegister); - emitPutVirtualRegister(currentInstruction[1].u.operand, returnValueRegister); + emitTagAsBoolImmediate(returnValueGPR); + emitPutVirtualRegister(currentInstruction[1].u.operand, returnValueGPR); } void JIT::emitSlow_op_neq(Instruction* currentInstruction, Vector::iterator& iter) @@ -994,8 +978,8 @@ void JIT::emitSlow_op_neq(Instruction* currentInstruction, Vector linkSlowCase(iter); callOperation(operationCompareEq, regT0, regT1); xor32(TrustedImm32(0x1), regT0); - emitTagAsBoolImmediate(returnValueRegister); - emitPutVirtualRegister(currentInstruction[1].u.operand, returnValueRegister); + emitTagAsBoolImmediate(returnValueGPR); + emitPutVirtualRegister(currentInstruction[1].u.operand, returnValueGPR); } void JIT::emitSlow_op_stricteq(Instruction* currentInstruction, Vector::iterator& iter) @@ -1005,7 +989,6 @@ void JIT::emitSlow_op_stricteq(Instruction* currentInstruction, Vector::iterator& iter) @@ -1015,7 +998,6 @@ void JIT::emitSlow_op_nstricteq(Instruction* currentInstruction, Vector::iterator& iter) @@ -1053,7 +1035,6 @@ void JIT::emitSlow_op_to_number(Instruction* currentInstruction, Vector(sizeof(Register))), regT0); - emitValueProfilingSite(regT4); + emitValueProfilingSite(); emitPutVirtualRegister(dst, regT0); } @@ -1106,8 +1087,8 @@ void JIT::emitSlow_op_get_argument_by_val(Instruction* currentInstruction, Vecto linkSlowCase(iter); linkSlowCase(iter); callOperation(operationCreateArguments); - emitStoreCell(arguments, returnValueRegister); - emitStoreCell(unmodifiedArgumentsRegister(VirtualRegister(arguments)), returnValueRegister); + emitStoreCell(arguments, returnValueGPR); + emitStoreCell(unmodifiedArgumentsRegister(VirtualRegister(arguments)), returnValueGPR); skipArgumentsCreation.link(this); emitGetVirtualRegister(arguments, regT0); @@ -1117,6 +1098,15 @@ void JIT::emitSlow_op_get_argument_by_val(Instruction* currentInstruction, Vecto #endif // USE(JSVALUE64) +void JIT::emit_op_touch_entry(Instruction* currentInstruction) +{ + if (m_codeBlock->symbolTable()->m_functionEnteredOnce.hasBeenInvalidated()) + return; + + JITSlowPathCall slowPathCall(this, currentInstruction, slow_path_touch_entry); + slowPathCall.call(); +} + void JIT::emit_op_loop_hint(Instruction*) { // Emit the JIT optimization check: @@ -1150,8 +1140,8 @@ void JIT::emitSlow_op_loop_hint(Instruction*, Vector::iterator& i linkSlowCase(iter); callOperation(operationOptimize, m_bytecodeOffset); - Jump noOptimizedEntry = branchTestPtr(Zero, returnValueRegister); - jump(returnValueRegister); + Jump noOptimizedEntry = branchTestPtr(Zero, returnValueGPR); + jump(returnValueGPR); noOptimizedEntry.link(this); emitJumpSlowToHot(jump(), OPCODE_LENGTH(op_loop_hint)); @@ -1188,14 +1178,14 @@ void JIT::emit_op_new_func(Instruction* currentInstruction) FunctionExecutable* funcExec = m_codeBlock->functionDecl(currentInstruction[2].u.operand); callOperation(operationNewFunction, dst, funcExec); - if (currentInstruction[3].u.operand) { -#if USE(JSVALUE32_64) - unmap(); -#else - killLastResultRegister(); -#endif + if (currentInstruction[3].u.operand) lazyJump.link(this); - } +} + +void JIT::emit_op_new_captured_func(Instruction* currentInstruction) +{ + JITSlowPathCall slowPathCall(this, currentInstruction, slow_path_new_captured_func); + slowPathCall.call(); } void JIT::emit_op_new_func_exp(Instruction* currentInstruction) @@ -1239,6 +1229,16 @@ void JIT::emit_op_new_array_buffer(Instruction* currentInstruction) callOperation(operationNewArrayBufferWithProfile, dst, currentInstruction[4].u.arrayAllocationProfile, values, size); } +void JIT::emitSlow_op_captured_mov(Instruction* currentInstruction, Vector::iterator& iter) +{ + VariableWatchpointSet* set = currentInstruction[3].u.watchpointSet; + if (!set || set->state() == IsInvalidated) + return; + linkSlowCase(iter); + JITSlowPathCall slowPathCall(this, currentInstruction, slow_path_captured_mov); + slowPathCall.call(); +} + } // namespace JSC #endif // ENABLE(JIT) diff --git a/JavaScriptCore/jit/JITOpcodes32_64.cpp b/JavaScriptCore/jit/JITOpcodes32_64.cpp index 05561cb6..fd0c883c 100644 --- a/JavaScriptCore/jit/JITOpcodes32_64.cpp +++ b/JavaScriptCore/jit/JITOpcodes32_64.cpp @@ -74,9 +74,8 @@ JIT::CodeRef JIT::privateCompileCTINativeCall(VM* vm, NativeFunction func) addPtr(TrustedImm32(16 - sizeof(void*)), stackPointerRegister); -#elif CPU(ARM) - // Load caller frame's scope chain into this callframe so that whatever we call can - // get to its global data. +#elif CPU(ARM) || CPU(SH4) || CPU(MIPS) + // Load caller frame's scope chain into this callframe so that whatever we call can get to its global data. emitGetCallerFrameFromCallFrameHeaderPtr(regT2); emitGetFromCallFrameHeaderPtr(JSStack::ScopeChain, regT1, regT2); emitPutCellToCallFrameHeader(regT1, JSStack::ScopeChain); @@ -84,71 +83,26 @@ JIT::CodeRef JIT::privateCompileCTINativeCall(VM* vm, NativeFunction func) preserveReturnAddressAfterCall(regT3); // Callee preserved emitPutReturnPCToCallFrameHeader(regT3); - // Calling convention: f(r0 == regT0, r1 == regT1, ...); - // Host function signature: f(ExecState*); - move(callFrameRegister, ARMRegisters::r0); - - emitGetFromCallFrameHeaderPtr(JSStack::Callee, ARMRegisters::r1); - move(regT2, callFrameRegister); // Eagerly restore caller frame register to avoid loading from stack. - loadPtr(Address(ARMRegisters::r1, OBJECT_OFFSETOF(JSFunction, m_executable)), regT2); - - // call the function - nativeCall = call(); - - restoreReturnAddressBeforeReturn(regT3); - -#elif CPU(MIPS) - // Load caller frame's scope chain into this callframe so that whatever we call can - // get to its global data. - emitGetCallerFrameFromCallFrameHeaderPtr(regT0); - emitGetFromCallFrameHeaderPtr(JSStack::ScopeChain, regT1, regT0); - emitPutCellToCallFrameHeader(regT1, JSStack::ScopeChain); - - preserveReturnAddressAfterCall(regT3); // Callee preserved - emitPutReturnPCToCallFrameHeader(regT3); - - // Calling convention: f(a0, a1, a2, a3); - // Host function signature: f(ExecState*); - - // Allocate stack space for 16 bytes (8-byte aligned) - // 16 bytes (unused) for 4 arguments +#if CPU(MIPS) + // Allocate stack space for (unused) 16 bytes (8-byte aligned) for 4 arguments. subPtr(TrustedImm32(16), stackPointerRegister); +#endif - // Setup arg0 - move(callFrameRegister, MIPSRegisters::a0); + // Calling convention is f(argumentGPR0, argumentGPR1, ...). + // Host function signature is f(ExecState*). + move(callFrameRegister, argumentGPR0); + + emitGetFromCallFrameHeaderPtr(JSStack::Callee, argumentGPR1); + move(regT2, callFrameRegister); // Eagerly restore caller frame register to avoid loading from stack. + loadPtr(Address(argumentGPR1, OBJECT_OFFSETOF(JSFunction, m_executable)), regT2); - // Call - emitGetFromCallFrameHeaderPtr(JSStack::Callee, MIPSRegisters::a2); - loadPtr(Address(MIPSRegisters::a2, OBJECT_OFFSETOF(JSFunction, m_executable)), regT2); - move(regT0, callFrameRegister); // Eagerly restore caller frame register to avoid loading from stack. - // call the function nativeCall = call(); +#if CPU(MIPS) // Restore stack space addPtr(TrustedImm32(16), stackPointerRegister); - - restoreReturnAddressBeforeReturn(regT3); -#elif CPU(SH4) - // Load caller frame's scope chain into this callframe so that whatever we call can - // get to its global data. - emitGetCallerFrameFromCallFrameHeaderPtr(regT2); - emitGetFromCallFrameHeaderPtr(JSStack::ScopeChain, regT1, regT2); - emitPutCellToCallFrameHeader(regT1, JSStack::ScopeChain); - - preserveReturnAddressAfterCall(regT3); // Callee preserved - emitPutReturnPCToCallFrameHeader(regT3); - - // Calling convention: f(r0 == regT4, r1 == regT5, ...); - // Host function signature: f(ExecState*); - move(callFrameRegister, regT4); - - emitGetFromCallFrameHeaderPtr(JSStack::Callee, regT5); - move(regT2, callFrameRegister); // Eagerly restore caller frame register to avoid loading from stack. - loadPtr(Address(regT5, OBJECT_OFFSETOF(JSFunction, m_executable)), regT2); - - // call the function - nativeCall = call(); +#endif restoreReturnAddressBeforeReturn(regT3); #else @@ -176,7 +130,7 @@ JIT::CodeRef JIT::privateCompileCTINativeCall(VM* vm, NativeFunction func) addPtr(TrustedImm32(-12), stackPointerRegister); push(callFrameRegister); #else - move(callFrameRegister, firstArgumentRegister); + move(callFrameRegister, argumentGPR0); #endif move(TrustedImmPtr(FunctionPtr(operationVMHandleException).value()), regT3); call(regT3); @@ -198,19 +152,28 @@ void JIT::emit_op_mov(Instruction* currentInstruction) { int dst = currentInstruction[1].u.operand; int src = currentInstruction[2].u.operand; - + if (m_codeBlock->isConstantRegisterIndex(src)) emitStore(dst, getConstantOperand(src)); else { emitLoad(src, regT1, regT0); emitStore(dst, regT1, regT0); - map(m_bytecodeOffset + OPCODE_LENGTH(op_mov), dst, regT1, regT0); } } +void JIT::emit_op_captured_mov(Instruction* currentInstruction) +{ + int dst = currentInstruction[1].u.operand; + int src = currentInstruction[2].u.operand; + + emitLoad(src, regT1, regT0); + emitNotifyWrite(regT1, regT0, regT2, currentInstruction[3].u.watchpointSet); + emitStore(dst, regT1, regT0); +} + void JIT::emit_op_end(Instruction* currentInstruction) { - ASSERT(returnValueRegister != callFrameRegister); + ASSERT(returnValueGPR != callFrameRegister); emitLoad(currentInstruction[1].u.operand, regT1, regT0); restoreReturnAddressBeforeReturn(Address(callFrameRegister, CallFrame::returnPCOffset())); ret(); @@ -243,7 +206,7 @@ void JIT::emitSlow_op_new_object(Instruction* currentInstruction, Vectorstructure(); callOperation(operationNewObject, structure); - emitStoreCell(dst, returnValueRegister); + emitStoreCell(dst, returnValueGPR); } void JIT::emit_op_check_has_instance(Instruction* currentInstruction) @@ -432,18 +395,14 @@ void JIT::emit_op_to_primitive(Instruction* currentInstruction) if (dst != src) emitStore(dst, regT1, regT0); - map(m_bytecodeOffset + OPCODE_LENGTH(op_to_primitive), dst, regT1, regT0); } void JIT::emitSlow_op_to_primitive(Instruction* currentInstruction, Vector::iterator& iter) { - int dst = currentInstruction[1].u.operand; - linkSlowCase(iter); JITSlowPathCall slowPathCall(this, currentInstruction, slow_path_to_primitive); slowPathCall.call(); - emitLoad(dst, regT1, regT0, callFrameRegister); } void JIT::emit_op_strcat(Instruction* currentInstruction) @@ -468,13 +427,10 @@ void JIT::emit_op_not(Instruction* currentInstruction) void JIT::emitSlow_op_not(Instruction* currentInstruction, Vector::iterator& iter) { - int dst = currentInstruction[1].u.operand; - linkSlowCase(iter); JITSlowPathCall slowPathCall(this, currentInstruction, slow_path_not); slowPathCall.call(); - emitLoad(dst, regT1, regT0, callFrameRegister); } void JIT::emit_op_jfalse(Instruction* currentInstruction) @@ -508,7 +464,7 @@ void JIT::emitSlow_op_jfalse(Instruction* currentInstruction, Vector: callOperation(operationCompareEq, regT1, regT0, regT3, regT2); storeResult.link(this); - emitStoreBool(dst, returnValueRegister); + emitStoreBool(dst, returnValueGPR); } void JIT::emit_op_neq(Instruction* currentInstruction) @@ -693,8 +649,8 @@ void JIT::emitSlow_op_neq(Instruction* currentInstruction, Vector callOperation(operationCompareEq, regT1, regT0, regT3, regT2); storeResult.link(this); - xor32(TrustedImm32(0x1), returnValueRegister); - emitStoreBool(dst, returnValueRegister); + xor32(TrustedImm32(0x1), returnValueGPR); + emitStoreBool(dst, returnValueGPR); } void JIT::compileOpStrictEq(Instruction* currentInstruction, CompileOpStrictEqType type) @@ -732,15 +688,12 @@ void JIT::emit_op_stricteq(Instruction* currentInstruction) void JIT::emitSlow_op_stricteq(Instruction* currentInstruction, Vector::iterator& iter) { - int dst = currentInstruction[1].u.operand; - linkSlowCase(iter); linkSlowCase(iter); linkSlowCase(iter); JITSlowPathCall slowPathCall(this, currentInstruction, slow_path_stricteq); slowPathCall.call(); - emitLoad(dst, regT1, regT0, callFrameRegister); } void JIT::emit_op_nstricteq(Instruction* currentInstruction) @@ -750,15 +703,12 @@ void JIT::emit_op_nstricteq(Instruction* currentInstruction) void JIT::emitSlow_op_nstricteq(Instruction* currentInstruction, Vector::iterator& iter) { - int dst = currentInstruction[1].u.operand; - linkSlowCase(iter); linkSlowCase(iter); linkSlowCase(iter); JITSlowPathCall slowPathCall(this, currentInstruction, slow_path_nstricteq); slowPathCall.call(); - emitLoad(dst, regT1, regT0, callFrameRegister); } void JIT::emit_op_eq_null(Instruction* currentInstruction) @@ -825,7 +775,7 @@ void JIT::emit_op_neq_null(Instruction* currentInstruction) void JIT::emit_op_throw(Instruction* currentInstruction) { - ASSERT(regT0 == returnValueRegister); + ASSERT(regT0 == returnValueGPR); emitLoad(currentInstruction[1].u.operand, regT1, regT0); callOperationNoExceptionCheck(operationThrow, regT1, regT0); jumpToExceptionHandler(); @@ -853,7 +803,7 @@ void JIT::emit_op_get_pnames(Instruction* currentInstruction) // this call doesn't seem to be hot. Label isObject(this); callOperation(operationGetPNames, regT0); - emitStoreCell(dst, returnValueRegister); + emitStoreCell(dst, returnValueGPR); load32(Address(regT0, OBJECT_OFFSETOF(JSPropertyNameIterator, m_jsStringsSize)), regT3); store32(TrustedImm32(Int32Tag), intTagFor(i)); store32(TrustedImm32(0), intPayloadFor(i)); @@ -956,18 +906,14 @@ void JIT::emit_op_to_number(Instruction* currentInstruction) if (src != dst) emitStore(dst, regT1, regT0); - map(m_bytecodeOffset + OPCODE_LENGTH(op_to_number), dst, regT1, regT0); } void JIT::emitSlow_op_to_number(Instruction* currentInstruction, Vector::iterator& iter) { - int dst = currentInstruction[1].u.operand; - linkSlowCase(iter); JITSlowPathCall slowPathCall(this, currentInstruction, slow_path_to_number); slowPathCall.call(); - emitLoad(dst, regT1, regT0, callFrameRegister); } void JIT::emit_op_push_name_scope(Instruction* currentInstruction) @@ -978,11 +924,10 @@ void JIT::emit_op_push_name_scope(Instruction* currentInstruction) void JIT::emit_op_catch(Instruction* currentInstruction) { + move(TrustedImmPtr(m_vm), regT3); // operationThrow returns the callFrame for the handler. - move(regT0, callFrameRegister); - + load32(Address(regT3, VM::callFrameForThrowOffset()), callFrameRegister); // Now store the exception returned by operationThrow. - move(TrustedImmPtr(m_vm), regT3); load32(Address(regT3, VM::exceptionOffset() + OBJECT_OFFSETOF(JSValue, u.asBits.payload)), regT0); load32(Address(regT3, VM::exceptionOffset() + OBJECT_OFFSETOF(JSValue, u.asBits.tag)), regT1); store32(TrustedImm32(JSValue().payload()), Address(regT3, VM::exceptionOffset() + OBJECT_OFFSETOF(JSValue, u.asBits.payload))); @@ -990,7 +935,6 @@ void JIT::emit_op_catch(Instruction* currentInstruction) unsigned exception = currentInstruction[1].u.operand; emitStore(exception, regT1, regT0); - map(m_bytecodeOffset + OPCODE_LENGTH(op_catch), exception, regT1, regT0); } void JIT::emit_op_switch_imm(Instruction* currentInstruction) @@ -1006,7 +950,7 @@ void JIT::emit_op_switch_imm(Instruction* currentInstruction) emitLoad(scrutinee, regT1, regT0); callOperation(operationSwitchImmWithUnknownKeyType, regT1, regT0, tableIndex); - jump(returnValueRegister); + jump(returnValueGPR); } void JIT::emit_op_switch_char(Instruction* currentInstruction) @@ -1022,7 +966,7 @@ void JIT::emit_op_switch_char(Instruction* currentInstruction) emitLoad(scrutinee, regT1, regT0); callOperation(operationSwitchCharWithUnknownKeyType, regT1, regT0, tableIndex); - jump(returnValueRegister); + jump(returnValueGPR); } void JIT::emit_op_switch_string(Instruction* currentInstruction) @@ -1037,7 +981,7 @@ void JIT::emit_op_switch_string(Instruction* currentInstruction) emitLoad(scrutinee, regT1, regT0); callOperation(operationSwitchStringWithUnknownKeyType, regT1, regT0, tableIndex); - jump(returnValueRegister); + jump(returnValueGPR); } void JIT::emit_op_throw_static_error(Instruction* currentInstruction) @@ -1051,7 +995,7 @@ void JIT::emit_op_debug(Instruction* currentInstruction) #if ENABLE(DEBUG_WITH_BREAKPOINT) UNUSED_PARAM(currentInstruction); breakpoint(); -#else +#elif ENABLE(JAVASCRIPT_DEBUGGER) JSGlobalObject* globalObject = codeBlock()->globalObject(); Debugger* debugger = globalObject->debugger(); char* debuggerAddress = reinterpret_cast(globalObject) + JSGlobalObject::debuggerOffset(); @@ -1062,11 +1006,13 @@ void JIT::emit_op_debug(Instruction* currentInstruction) callOperation(operationDebug, currentInstruction[1].u.operand); skipDebugHook.link(this); noDebugger.link(this); +#else + UNUSED_PARAM(currentInstruction); #endif } -void JIT::emit_op_enter(Instruction*) +void JIT::emit_op_enter(Instruction* currentInstruction) { emitEnterOptimizationCheck(); @@ -1075,6 +1021,9 @@ void JIT::emit_op_enter(Instruction*) // object lifetime and increasing GC pressure. for (int i = 0; i < m_codeBlock->m_numVars; ++i) emitStore(virtualRegisterForLocal(i).offset(), jsUndefined()); + + JITSlowPathCall slowPathCall(this, currentInstruction, slow_path_enter); + slowPathCall.call(); } void JIT::emit_op_create_activation(Instruction* currentInstruction) @@ -1083,7 +1032,7 @@ void JIT::emit_op_create_activation(Instruction* currentInstruction) Jump activationCreated = branch32(NotEqual, tagFor(activation), TrustedImm32(JSValue::EmptyValueTag)); callOperation(operationCreateActivation, 0); - emitStoreCell(activation, returnValueRegister); + emitStoreCell(activation, returnValueGPR); activationCreated.link(this); } @@ -1093,8 +1042,8 @@ void JIT::emit_op_create_arguments(Instruction* currentInstruction) Jump argsCreated = branch32(NotEqual, tagFor(dst), TrustedImm32(JSValue::EmptyValueTag)); callOperation(operationCreateArguments); - emitStoreCell(dst, returnValueRegister); - emitStoreCell(unmodifiedArgumentsRegister(VirtualRegister(dst)).offset(), returnValueRegister); + emitStoreCell(dst, returnValueGPR); + emitStoreCell(unmodifiedArgumentsRegister(VirtualRegister(dst)).offset(), returnValueGPR); argsCreated.link(this); } @@ -1124,7 +1073,6 @@ void JIT::emitSlow_op_get_callee(Instruction* currentInstruction, Vector::iterator& iter) { - int dst = currentInstruction[1].u.operand; linkSlowCase(iter); // doesn't have an allocation profile linkSlowCase(iter); // allocation failed JITSlowPathCall slowPathCall(this, currentInstruction, slow_path_create_this); slowPathCall.call(); - emitLoad(dst, regT1, regT0); } void JIT::emit_op_to_this(Instruction* currentInstruction) @@ -1172,13 +1118,11 @@ void JIT::emit_op_to_this(Instruction* currentInstruction) void JIT::emitSlow_op_to_this(Instruction* currentInstruction, Vector::iterator& iter) { - int dst = currentInstruction[1].u.operand; linkSlowCase(iter); linkSlowCase(iter); linkSlowCase(iter); JITSlowPathCall slowPathCall(this, currentInstruction, slow_path_to_this); slowPathCall.call(); - emitLoad(dst, regT1, regT0); } void JIT::emit_op_profile_will_call(Instruction* currentInstruction) @@ -1226,7 +1170,7 @@ void JIT::emit_op_get_argument_by_val(Instruction* currentInstruction) loadPtr(BaseIndex(callFrameRegister, regT2, TimesEight, OBJECT_OFFSETOF(JSValue, u.asBits.payload) + CallFrame::thisArgumentOffset() * static_cast(sizeof(Register))), regT0); loadPtr(BaseIndex(callFrameRegister, regT2, TimesEight, OBJECT_OFFSETOF(JSValue, u.asBits.tag) + CallFrame::thisArgumentOffset() * static_cast(sizeof(Register))), regT1); - emitValueProfilingSite(regT4); + emitValueProfilingSite(); emitStore(dst, regT1, regT0); } @@ -1243,8 +1187,8 @@ void JIT::emitSlow_op_get_argument_by_val(Instruction* currentInstruction, Vecto linkSlowCase(iter); callOperation(operationCreateArguments); - emitStoreCell(arguments, returnValueRegister); - emitStoreCell(unmodifiedArgumentsRegister(VirtualRegister(arguments)).offset(), returnValueRegister); + emitStoreCell(arguments, returnValueGPR); + emitStoreCell(unmodifiedArgumentsRegister(VirtualRegister(arguments)).offset(), returnValueGPR); skipArgumentsCreation.link(this); emitLoad(arguments, regT1, regT0); diff --git a/JavaScriptCore/jit/JITOperations.cpp b/JavaScriptCore/jit/JITOperations.cpp index 52aa2fd1..5b660ada 100644 --- a/JavaScriptCore/jit/JITOperations.cpp +++ b/JavaScriptCore/jit/JITOperations.cpp @@ -44,6 +44,7 @@ #include "JSGlobalObjectFunctions.h" #include "JSNameScope.h" #include "JSPropertyNameIterator.h" +#include "JSStackInlines.h" #include "JSWithScope.h" #include "ObjectConstructor.h" #include "Operations.h" @@ -74,20 +75,23 @@ void JIT_OPERATION operationStackCheck(ExecState* exec, CodeBlock* codeBlock) { // We pass in our own code block, because the callframe hasn't been populated. VM* vm = codeBlock->vm(); - CallFrame* callerFrame = exec->callerFrame(); - NativeCallFrameTracer tracer(vm, callerFrame->removeHostCallFrameFlag()); + CallFrame* callerFrame = exec->callerFrameSkippingVMEntrySentinel(); + if (!callerFrame) + callerFrame = exec; + + NativeCallFrameTracer tracer(vm, callerFrame); JSStack& stack = vm->interpreter->stack(); - if (UNLIKELY(!stack.grow(&exec->registers()[virtualRegisterForLocal(codeBlock->m_numCalleeRegisters).offset()]))) + if (UNLIKELY(!stack.grow(&exec->registers()[virtualRegisterForLocal(codeBlock->frameRegisterCount()).offset()]))) vm->throwException(callerFrame, createStackOverflowError(callerFrame)); } int32_t JIT_OPERATION operationCallArityCheck(ExecState* exec) { VM* vm = &exec->vm(); - CallFrame* callerFrame = exec->callerFrame(); - NativeCallFrameTracer tracer(vm, callerFrame->removeHostCallFrameFlag()); + CallFrame* callerFrame = exec->callerFrameSkippingVMEntrySentinel(); + NativeCallFrameTracer tracer(vm, callerFrame); JSStack& stack = vm->interpreter->stack(); @@ -101,8 +105,8 @@ int32_t JIT_OPERATION operationCallArityCheck(ExecState* exec) int32_t JIT_OPERATION operationConstructArityCheck(ExecState* exec) { VM* vm = &exec->vm(); - CallFrame* callerFrame = exec->callerFrame(); - NativeCallFrameTracer tracer(vm, callerFrame->removeHostCallFrameFlag()); + CallFrame* callerFrame = exec->callerFrameSkippingVMEntrySentinel(); + NativeCallFrameTracer tracer(vm, callerFrame); JSStack& stack = vm->interpreter->stack(); @@ -218,7 +222,7 @@ EncodedJSValue JIT_OPERATION operationCallCustomGetter(ExecState* exec, JSCell* Identifier ident(vm, uid); - return JSValue::encode(function(exec, asObject(base), ident)); + return function(exec, JSValue::encode(base), JSValue::encode(base), ident); } EncodedJSValue JIT_OPERATION operationCallGetter(ExecState* exec, JSCell* base, JSCell* getterSetter) @@ -235,7 +239,7 @@ void JIT_OPERATION operationPutByIdStrict(ExecState* exec, StructureStubInfo*, E NativeCallFrameTracer tracer(vm, exec); Identifier ident(vm, uid); - PutPropertySlot slot(true, exec->codeBlock()->putByIdContext()); + PutPropertySlot slot(JSValue::decode(encodedBase), true, exec->codeBlock()->putByIdContext()); JSValue::decode(encodedBase).put(exec, ident, JSValue::decode(encodedValue), slot); } @@ -245,7 +249,7 @@ void JIT_OPERATION operationPutByIdNonStrict(ExecState* exec, StructureStubInfo* NativeCallFrameTracer tracer(vm, exec); Identifier ident(vm, uid); - PutPropertySlot slot(false, exec->codeBlock()->putByIdContext()); + PutPropertySlot slot(JSValue::decode(encodedBase), false, exec->codeBlock()->putByIdContext()); JSValue::decode(encodedBase).put(exec, ident, JSValue::decode(encodedValue), slot); } @@ -255,7 +259,7 @@ void JIT_OPERATION operationPutByIdDirectStrict(ExecState* exec, StructureStubIn NativeCallFrameTracer tracer(vm, exec); Identifier ident(vm, uid); - PutPropertySlot slot(true, exec->codeBlock()->putByIdContext()); + PutPropertySlot slot(JSValue::decode(encodedBase), true, exec->codeBlock()->putByIdContext()); asObject(JSValue::decode(encodedBase))->putDirect(exec->vm(), ident, JSValue::decode(encodedValue), slot); } @@ -265,7 +269,7 @@ void JIT_OPERATION operationPutByIdDirectNonStrict(ExecState* exec, StructureStu NativeCallFrameTracer tracer(vm, exec); Identifier ident(vm, uid); - PutPropertySlot slot(false, exec->codeBlock()->putByIdContext()); + PutPropertySlot slot(JSValue::decode(encodedBase), false, exec->codeBlock()->putByIdContext()); asObject(JSValue::decode(encodedBase))->putDirect(exec->vm(), ident, JSValue::decode(encodedValue), slot); } @@ -279,7 +283,7 @@ void JIT_OPERATION operationPutByIdStrictOptimize(ExecState* exec, StructureStub JSValue value = JSValue::decode(encodedValue); JSValue baseValue = JSValue::decode(encodedBase); - PutPropertySlot slot(true, exec->codeBlock()->putByIdContext()); + PutPropertySlot slot(baseValue, true, exec->codeBlock()->putByIdContext()); baseValue.put(exec, ident, value, slot); @@ -302,7 +306,7 @@ void JIT_OPERATION operationPutByIdNonStrictOptimize(ExecState* exec, StructureS JSValue value = JSValue::decode(encodedValue); JSValue baseValue = JSValue::decode(encodedBase); - PutPropertySlot slot(false, exec->codeBlock()->putByIdContext()); + PutPropertySlot slot(baseValue, false, exec->codeBlock()->putByIdContext()); baseValue.put(exec, ident, value, slot); @@ -325,7 +329,7 @@ void JIT_OPERATION operationPutByIdDirectStrictOptimize(ExecState* exec, Structu JSValue value = JSValue::decode(encodedValue); JSObject* baseObject = asObject(JSValue::decode(encodedBase)); - PutPropertySlot slot(true, exec->codeBlock()->putByIdContext()); + PutPropertySlot slot(baseObject, true, exec->codeBlock()->putByIdContext()); baseObject->putDirect(exec->vm(), ident, value, slot); @@ -348,7 +352,7 @@ void JIT_OPERATION operationPutByIdDirectNonStrictOptimize(ExecState* exec, Stru JSValue value = JSValue::decode(encodedValue); JSObject* baseObject = asObject(JSValue::decode(encodedBase)); - PutPropertySlot slot(false, exec->codeBlock()->putByIdContext()); + PutPropertySlot slot(baseObject, false, exec->codeBlock()->putByIdContext()); baseObject->putDirect(exec->vm(), ident, value, slot); @@ -371,7 +375,7 @@ void JIT_OPERATION operationPutByIdStrictBuildList(ExecState* exec, StructureStu JSValue value = JSValue::decode(encodedValue); JSValue baseValue = JSValue::decode(encodedBase); - PutPropertySlot slot(true, exec->codeBlock()->putByIdContext()); + PutPropertySlot slot(baseValue, true, exec->codeBlock()->putByIdContext()); baseValue.put(exec, ident, value, slot); @@ -391,7 +395,7 @@ void JIT_OPERATION operationPutByIdNonStrictBuildList(ExecState* exec, Structure JSValue value = JSValue::decode(encodedValue); JSValue baseValue = JSValue::decode(encodedBase); - PutPropertySlot slot(false, exec->codeBlock()->putByIdContext()); + PutPropertySlot slot(baseValue, false, exec->codeBlock()->putByIdContext()); baseValue.put(exec, ident, value, slot); @@ -411,7 +415,7 @@ void JIT_OPERATION operationPutByIdDirectStrictBuildList(ExecState* exec, Struct JSValue value = JSValue::decode(encodedValue); JSObject* baseObject = asObject(JSValue::decode(encodedBase)); - PutPropertySlot slot(true, exec->codeBlock()->putByIdContext()); + PutPropertySlot slot(baseObject, true, exec->codeBlock()->putByIdContext()); baseObject->putDirect(exec->vm(), ident, value, slot); @@ -431,7 +435,7 @@ void JIT_OPERATION operationPutByIdDirectNonStrictBuildList(ExecState* exec, Str JSValue value = JSValue::decode(encodedValue); JSObject* baseObject = asObject(JSValue::decode(encodedBase)); - PutPropertySlot slot(false, exec->codeBlock()->putByIdContext()); + PutPropertySlot slot(baseObject, false, exec->codeBlock()->putByIdContext()); baseObject ->putDirect(exec->vm(), ident, value, slot); @@ -465,12 +469,12 @@ static void putByVal(CallFrame* callFrame, JSValue baseValue, JSValue subscript, } else baseValue.putByIndex(callFrame, i, value, callFrame->codeBlock()->isStrictMode()); } else if (isName(subscript)) { - PutPropertySlot slot(callFrame->codeBlock()->isStrictMode()); + PutPropertySlot slot(baseValue, callFrame->codeBlock()->isStrictMode()); baseValue.put(callFrame, jsCast(subscript.asCell())->privateName(), value, slot); } else { Identifier property(callFrame, subscript.toString(callFrame)->value(callFrame)); if (!callFrame->vm().exception()) { // Don't put to an object if toString threw an exception. - PutPropertySlot slot(callFrame->codeBlock()->isStrictMode()); + PutPropertySlot slot(baseValue, callFrame->codeBlock()->isStrictMode()); baseValue.put(callFrame, property, value, slot); } } @@ -482,12 +486,12 @@ static void directPutByVal(CallFrame* callFrame, JSObject* baseObject, JSValue s uint32_t i = subscript.asUInt32(); baseObject->putDirectIndex(callFrame, i, value); } else if (isName(subscript)) { - PutPropertySlot slot(callFrame->codeBlock()->isStrictMode()); + PutPropertySlot slot(baseObject, callFrame->codeBlock()->isStrictMode()); baseObject->putDirect(callFrame->vm(), jsCast(subscript.asCell())->privateName(), value, slot); } else { Identifier property(callFrame, subscript.toString(callFrame)->value(callFrame)); if (!callFrame->vm().exception()) { // Don't put to an object if toString threw an exception. - PutPropertySlot slot(callFrame->codeBlock()->isStrictMode()); + PutPropertySlot slot(baseObject, callFrame->codeBlock()->isStrictMode()); baseObject->putDirect(callFrame->vm(), property, value, slot); } } @@ -1359,6 +1363,8 @@ EncodedJSValue JIT_OPERATION operationGetArgumentsLength(ExecState* exec, int32_ return JSValue::encode(baseValue.get(exec, ident, slot)); } +} + static JSValue getByVal(ExecState* exec, JSValue baseValue, JSValue subscript, ReturnAddressPtr returnAddress) { if (LIKELY(baseValue.isCell() && subscript.isString())) { @@ -1382,6 +1388,8 @@ static JSValue getByVal(ExecState* exec, JSValue baseValue, JSValue subscript, R return baseValue.get(exec, property); } +extern "C" { + EncodedJSValue JIT_OPERATION operationGetByValGeneric(ExecState* exec, EncodedJSValue encodedBase, EncodedJSValue encodedSubscript) { VM& vm = exec->vm(); @@ -1522,14 +1530,23 @@ EncodedJSValue JIT_OPERATION operationInstanceOf(ExecState* exec, EncodedJSValue return JSValue::encode(jsBoolean(result)); } -CallFrame* JIT_OPERATION operationLoadVarargs(ExecState* exec, EncodedJSValue encodedThis, EncodedJSValue encodedArguments, int32_t firstFreeRegister) +CallFrame* JIT_OPERATION operationSizeAndAllocFrameForVarargs(ExecState* exec, EncodedJSValue encodedArguments, int32_t firstFreeRegister) { VM& vm = exec->vm(); NativeCallFrameTracer tracer(&vm, exec); JSStack* stack = &exec->interpreter()->stack(); + JSValue arguments = JSValue::decode(encodedArguments); + CallFrame* newCallFrame = sizeAndAllocFrameForVarargs(exec, stack, arguments, firstFreeRegister); + return newCallFrame; +} + +CallFrame* JIT_OPERATION operationLoadVarargs(ExecState* exec, CallFrame* newCallFrame, EncodedJSValue encodedThis, EncodedJSValue encodedArguments) +{ + VM& vm = exec->vm(); + NativeCallFrameTracer tracer(&vm, exec); JSValue thisValue = JSValue::decode(encodedThis); JSValue arguments = JSValue::decode(encodedArguments); - CallFrame* newCallFrame = loadVarargs(exec, stack, thisValue, arguments, firstFreeRegister); + loadVarargs(exec, newCallFrame, thisValue, arguments); return newCallFrame; } @@ -1651,7 +1668,7 @@ void JIT_OPERATION operationPutToScope(ExecState* exec, Instruction* bytecodePC) return; } - PutPropertySlot slot(codeBlock->isStrictMode()); + PutPropertySlot slot(scope, codeBlock->isStrictMode()); scope->methodTable()->put(scope, exec, ident, value, slot); if (exec->vm().exception()) @@ -1679,6 +1696,39 @@ void JIT_OPERATION operationThrow(ExecState* exec, EncodedJSValue encodedExcepti genericUnwind(vm, exec, exceptionValue); } +void JIT_OPERATION operationFlushWriteBarrierBuffer(ExecState* exec, JSCell* cell) +{ + VM* vm = &exec->vm(); + NativeCallFrameTracer tracer(vm, exec); + vm->heap.flushWriteBarrierBuffer(cell); +} + +void JIT_OPERATION operationOSRWriteBarrier(ExecState* exec, JSCell* cell) +{ + VM* vm = &exec->vm(); + NativeCallFrameTracer tracer(vm, exec); + exec->heap()->writeBarrier(cell); +} + +// NB: We don't include the value as part of the barrier because the write barrier elision +// phase in the DFG only tracks whether the object being stored to has been barriered. It +// would be much more complicated to try to model the value being stored as well. +void JIT_OPERATION operationUnconditionalWriteBarrier(ExecState* exec, JSCell* cell) +{ + VM* vm = &exec->vm(); + NativeCallFrameTracer tracer(vm, exec); + Heap::writeBarrier(cell); +} + +void JIT_OPERATION operationInitGlobalConst(ExecState* exec, Instruction* pc) +{ + VM* vm = &exec->vm(); + NativeCallFrameTracer tracer(vm, exec); + + JSValue value = exec->r(pc[2].u.operand).jsValue(); + pc[1].u.registerPointer->set(*vm, exec->codeBlock()->globalObject(), value); +} + void JIT_OPERATION lookupExceptionHandler(ExecState* exec) { VM* vm = &exec->vm(); @@ -1696,7 +1746,7 @@ void JIT_OPERATION operationVMHandleException(ExecState* exec) VM* vm = &exec->vm(); NativeCallFrameTracer tracer(vm, exec); - ASSERT(!exec->hasHostCallFrameFlag()); + ASSERT(!exec->isVMEntrySentinel()); genericUnwind(vm, exec, vm->exception()); } @@ -1717,8 +1767,8 @@ asm ( ".globl " SYMBOL_STRING(getHostCallReturnValue) "\n" HIDE_SYMBOL(getHostCallReturnValue) "\n" SYMBOL_STRING(getHostCallReturnValue) ":" "\n" - "mov 0(%r13), %r13\n" // CallerFrameAndPC::callerFrame - "mov %r13, %rdi\n" + "mov 0(%rbp), %rbp\n" // CallerFrameAndPC::callerFrame + "mov %rbp, %rdi\n" "jmp " LOCAL_REFERENCE(getHostCallReturnValueWithExecState) "\n" ); @@ -1728,8 +1778,8 @@ asm ( ".globl " SYMBOL_STRING(getHostCallReturnValue) "\n" HIDE_SYMBOL(getHostCallReturnValue) "\n" SYMBOL_STRING(getHostCallReturnValue) ":" "\n" - "mov 0(%edi), %edi\n" // CallerFrameAndPC::callerFrame - "mov %edi, 4(%esp)\n" + "mov 0(%ebp), %ebp\n" // CallerFrameAndPC::callerFrame + "mov %ebp, 4(%esp)\n" "jmp " LOCAL_REFERENCE(getHostCallReturnValueWithExecState) "\n" ); @@ -1742,8 +1792,8 @@ HIDE_SYMBOL(getHostCallReturnValue) "\n" ".thumb" "\n" ".thumb_func " THUMB_FUNC_PARAM(getHostCallReturnValue) "\n" SYMBOL_STRING(getHostCallReturnValue) ":" "\n" - "ldr r5, [r5, #0]" "\n" // CallerFrameAndPC::callerFrame - "mov r0, r5" "\n" + "ldr r7, [r7, #0]" "\n" // CallerFrameAndPC::callerFrame + "mov r0, r7" "\n" "b " LOCAL_REFERENCE(getHostCallReturnValueWithExecState) "\n" ); @@ -1754,8 +1804,8 @@ asm ( HIDE_SYMBOL(getHostCallReturnValue) "\n" INLINE_ARM_FUNCTION(getHostCallReturnValue) SYMBOL_STRING(getHostCallReturnValue) ":" "\n" - "ldr r5, [r5, #0]" "\n" // CallerFrameAndPC::callerFrame - "mov r0, r5" "\n" + "ldr r11, [r11, #0]" "\n" // CallerFrameAndPC::callerFrame + "mov r0, r11" "\n" "b " LOCAL_REFERENCE(getHostCallReturnValueWithExecState) "\n" ); @@ -1766,8 +1816,8 @@ asm ( ".globl " SYMBOL_STRING(getHostCallReturnValue) "\n" HIDE_SYMBOL(getHostCallReturnValue) "\n" SYMBOL_STRING(getHostCallReturnValue) ":" "\n" - "ldur x25, [x25, #-32]" "\n" - "mov x0, x25" "\n" + "ldur x29, [x29, #0]" "\n" + "mov x0, x29" "\n" "b " LOCAL_REFERENCE(getHostCallReturnValueWithExecState) "\n" ); @@ -1778,8 +1828,8 @@ asm ( HIDE_SYMBOL(getHostCallReturnValue) "\n" SYMBOL_STRING(getHostCallReturnValue) ":" "\n" LOAD_FUNCTION_TO_T9(getHostCallReturnValueWithExecState) - "lw $s0, 0($s0)" "\n" // CallerFrameAndPC::callerFrame - "move $a0, $s0" "\n" + "lw $fp, 0($fp)" "\n" // CallerFrameAndPC::callerFrame + "move $a0, $fp" "\n" "b " LOCAL_REFERENCE(getHostCallReturnValueWithExecState) "\n" ); @@ -1802,11 +1852,9 @@ SYMBOL_STRING(getHostCallReturnValue) ":" "\n" extern "C" { __declspec(naked) EncodedJSValue HOST_CALL_RETURN_VALUE_OPTION getHostCallReturnValue() { - __asm { - mov edi, [edi + 0]; // CallerFrameAndPC::callerFrame - mov [esp + 4], edi; - jmp getHostCallReturnValueWithExecState - } + __asm mov ebp, [ebp + 0]; // CallerFrameAndPC::callerFrame + __asm mov [esp + 4], ebp; + __asm jmp getHostCallReturnValueWithExecState } } #endif diff --git a/JavaScriptCore/jit/JITOperations.h b/JavaScriptCore/jit/JITOperations.h index d88e9511..43ca6177 100644 --- a/JavaScriptCore/jit/JITOperations.h +++ b/JavaScriptCore/jit/JITOperations.h @@ -35,7 +35,7 @@ #include "MacroAssembler.h" #include "PutKind.h" #include "StructureStubInfo.h" -#include "Watchpoint.h" +#include "VariableWatchpointSet.h" namespace JSC { @@ -76,10 +76,12 @@ extern "C" { St: Structure* V: void Vm: VM* - W: WatchpointSet* + Vws: VariableWatchpointSet* Z: int32_t */ -typedef CallFrame* JIT_OPERATION (*F_JITOperation_EJJZ)(ExecState*, EncodedJSValue, EncodedJSValue, int32_t); + +typedef CallFrame* JIT_OPERATION (*F_JITOperation_EFJJ)(ExecState*, CallFrame*, EncodedJSValue, EncodedJSValue); +typedef CallFrame* JIT_OPERATION (*F_JITOperation_EJZ)(ExecState*, EncodedJSValue, int32_t); typedef EncodedJSValue JIT_OPERATION (*J_JITOperation_E)(ExecState*); typedef EncodedJSValue JIT_OPERATION (*J_JITOperation_EA)(ExecState*, JSArray*); typedef EncodedJSValue JIT_OPERATION (*J_JITOperation_EAZ)(ExecState*, JSArray*, int32_t); @@ -120,6 +122,7 @@ typedef JSCell* JIT_OPERATION (*C_JITOperation_EO)(ExecState*, JSObject*); typedef JSCell* JIT_OPERATION (*C_JITOperation_EOZ)(ExecState*, JSObject*, int32_t); typedef JSCell* JIT_OPERATION (*C_JITOperation_ESt)(ExecState*, Structure*); typedef JSCell* JIT_OPERATION (*C_JITOperation_EZ)(ExecState*, int32_t); +typedef double JIT_OPERATION (*D_JITOperation_D)(double); typedef double JIT_OPERATION (*D_JITOperation_DD)(double, double); typedef double JIT_OPERATION (*D_JITOperation_ZZ)(int32_t, int32_t); typedef double JIT_OPERATION (*D_JITOperation_EJ)(ExecState*, EncodedJSValue); @@ -138,6 +141,7 @@ typedef void JIT_OPERATION (*V_JITOperation_ECIcf)(ExecState*, JSCell*, InlineCa typedef void JIT_OPERATION (*V_JITOperation_ECICC)(ExecState*, JSCell*, Identifier*, JSCell*, JSCell*); typedef void JIT_OPERATION (*V_JITOperation_ECCIcf)(ExecState*, JSCell*, JSCell*, InlineCallFrame*); typedef void JIT_OPERATION (*V_JITOperation_ECJJ)(ExecState*, JSCell*, EncodedJSValue, EncodedJSValue); +typedef void JIT_OPERATION (*V_JITOperation_ECPSPS)(ExecState*, JSCell*, void*, size_t, void*, size_t); typedef void JIT_OPERATION (*V_JITOperation_ECZ)(ExecState*, JSCell*, int32_t); typedef void JIT_OPERATION (*V_JITOperation_ECC)(ExecState*, JSCell*, JSCell*); typedef void JIT_OPERATION (*V_JITOperation_EIdJZ)(ExecState*, Identifier*, EncodedJSValue, int32_t); @@ -153,7 +157,7 @@ typedef void JIT_OPERATION (*V_JITOperation_EOZJ)(ExecState*, JSObject*, int32_t typedef void JIT_OPERATION (*V_JITOperation_EPc)(ExecState*, Instruction*); typedef void JIT_OPERATION (*V_JITOperation_EPZJ)(ExecState*, void*, int32_t, EncodedJSValue); typedef void JIT_OPERATION (*V_JITOperation_ESsiJJI)(ExecState*, StructureStubInfo*, EncodedJSValue, EncodedJSValue, StringImpl*); -typedef void JIT_OPERATION (*V_JITOperation_W)(WatchpointSet*); +typedef void JIT_OPERATION (*V_JITOperation_EVws)(ExecState*, VariableWatchpointSet*); typedef void JIT_OPERATION (*V_JITOperation_EZ)(ExecState*, int32_t); typedef void JIT_OPERATION (*V_JITOperation_EVm)(ExecState*, VM*); typedef char* JIT_OPERATION (*P_JITOperation_E)(ExecState*); @@ -263,7 +267,8 @@ void JIT_OPERATION operationTearOffArguments(ExecState*, JSCell*, JSCell*) WTF_I EncodedJSValue JIT_OPERATION operationDeleteById(ExecState*, EncodedJSValue base, const Identifier*) WTF_INTERNAL; JSCell* JIT_OPERATION operationGetPNames(ExecState*, JSObject*) WTF_INTERNAL; EncodedJSValue JIT_OPERATION operationInstanceOf(ExecState*, EncodedJSValue, EncodedJSValue proto) WTF_INTERNAL; -CallFrame* JIT_OPERATION operationLoadVarargs(ExecState*, EncodedJSValue thisValue, EncodedJSValue arguments, int32_t firstFreeRegister) WTF_INTERNAL; +CallFrame* JIT_OPERATION operationSizeAndAllocFrameForVarargs(ExecState*, EncodedJSValue arguments, int32_t firstFreeRegister) WTF_INTERNAL; +CallFrame* JIT_OPERATION operationLoadVarargs(ExecState*, CallFrame*, EncodedJSValue thisValue, EncodedJSValue arguments) WTF_INTERNAL; EncodedJSValue JIT_OPERATION operationToObject(ExecState*, EncodedJSValue) WTF_INTERNAL; char* JIT_OPERATION operationSwitchCharWithUnknownKeyType(ExecState*, EncodedJSValue key, size_t tableIndex) WTF_INTERNAL; @@ -273,6 +278,13 @@ EncodedJSValue JIT_OPERATION operationResolveScope(ExecState*, int32_t identifie EncodedJSValue JIT_OPERATION operationGetFromScope(ExecState*, Instruction* bytecodePC) WTF_INTERNAL; void JIT_OPERATION operationPutToScope(ExecState*, Instruction* bytecodePC) WTF_INTERNAL; +void JIT_OPERATION operationFlushWriteBarrierBuffer(ExecState*, JSCell*); +void JIT_OPERATION operationWriteBarrier(ExecState*, JSCell*, JSCell*); +void JIT_OPERATION operationUnconditionalWriteBarrier(ExecState*, JSCell*); +void JIT_OPERATION operationOSRWriteBarrier(ExecState*, JSCell*); + +void JIT_OPERATION operationInitGlobalConst(ExecState*, Instruction*); + } // extern "C" } // namespace JSC diff --git a/JavaScriptCore/jit/JITOperationsMSVC64.cpp b/JavaScriptCore/jit/JITOperationsMSVC64.cpp new file mode 100644 index 00000000..0d17b4eb --- /dev/null +++ b/JavaScriptCore/jit/JITOperationsMSVC64.cpp @@ -0,0 +1,45 @@ +/* + * Copyright (C) 2013 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" + +#if !ENABLE(JIT) && COMPILER(MSVC) && CPU(X86_64) + +#include "CallFrame.h" +#include "JSCJSValue.h" + +namespace JSC { + +// FIXME: The following is a workaround that is only needed because JITStubsMSVC64.asm +// is built unconditionally even when the JIT is disable, and it references this function. +// We only need to provide a stub to satisfy the linkage. It will never be called. +extern "C" EncodedJSValue getHostCallReturnValueWithExecState(ExecState*) +{ + return JSValue::encode(JSValue()); +} + +} // namespace JSC + +#endif // !ENABLE(JIT) && COMPILER(MSVC) && CPU(X86_64) diff --git a/JavaScriptCore/jit/JITPropertyAccess.cpp b/JavaScriptCore/jit/JITPropertyAccess.cpp index 1ef25f20..4241baf3 100644 --- a/JavaScriptCore/jit/JITPropertyAccess.cpp +++ b/JavaScriptCore/jit/JITPropertyAccess.cpp @@ -43,11 +43,6 @@ #include "SamplingTool.h" #include -#ifndef NDEBUG -#include -#endif - -using namespace std; namespace JSC { #if USE(JSVALUE64) @@ -148,7 +143,7 @@ void JIT::emit_op_get_by_val(Instruction* currentInstruction) resultOK.link(this); #endif - emitValueProfilingSite(regT4); + emitValueProfilingSite(); emitPutVirtualRegister(dst); m_byValCompilationInfo.append(ByValCompilationInfo(m_bytecodeOffset, badType, mode, done)); @@ -237,7 +232,7 @@ void JIT::emitSlow_op_get_by_val(Instruction* currentInstruction, VectorecmaMode(), - direct ? Direct : NotDirect); + callFrameRegister, JSValueRegs(regT0), JSValueRegs(regT1), regT2, true, + m_codeBlock->ecmaMode(), direct ? Direct : NotDirect); gen.generateFastPath(*this); addSlowCase(gen.slowPathJump()); @@ -637,7 +633,7 @@ void JIT::emitVarInjectionCheck(bool needsVarInjectionChecks) { if (!needsVarInjectionChecks) return; - addSlowCase(branchTest8(NonZero, AbsoluteAddress(m_codeBlock->globalObject()->varInjectionWatchpoint()->addressOfIsInvalidated()))); + addSlowCase(branch8(Equal, AbsoluteAddress(m_codeBlock->globalObject()->varInjectionWatchpoint()->addressOfState()), TrustedImm32(IsInvalidated))); } void JIT::emitResolveClosure(int dst, bool needsVarInjectionChecks, unsigned depth) @@ -675,7 +671,6 @@ void JIT::emit_op_resolve_scope(Instruction* currentInstruction) emitResolveClosure(dst, needsVarInjectionChecks(resolveType), depth); break; case Dynamic: - killLastResultRegister(); addSlowCase(jump()); break; } @@ -744,12 +739,11 @@ void JIT::emit_op_get_from_scope(Instruction* currentInstruction) emitGetClosureVar(scope, *operandSlot); break; case Dynamic: - killLastResultRegister(); addSlowCase(jump()); break; } emitPutVirtualRegister(dst); - emitValueProfilingSite(regT4); + emitValueProfilingSite(); } void JIT::emitSlow_op_get_from_scope(Instruction* currentInstruction, Vector::iterator& iter) @@ -766,16 +760,48 @@ void JIT::emitSlow_op_get_from_scope(Instruction* currentInstruction, Vectorstate() == IsInvalidated) + return; + + load8(set->addressOfState(), scratch); + + JumpList ready; + + ready.append(branch32(Equal, scratch, TrustedImm32(IsInvalidated))); + + if (set->state() == ClearWatchpoint) { + Jump isWatched = branch32(NotEqual, scratch, TrustedImm32(ClearWatchpoint)); + + store64(value, set->addressOfInferredValue()); + store8(TrustedImm32(IsWatched), set->addressOfState()); + ready.append(jump()); + + isWatched.link(this); + } + + ready.append(branch64(Equal, AbsoluteAddress(set->addressOfInferredValue()), value)); + addSlowCase(branchTest8(NonZero, AbsoluteAddress(set->addressOfSetIsNotEmpty()))); + store8(TrustedImm32(IsInvalidated), set->addressOfState()); + move(TrustedImm64(JSValue::encode(JSValue())), scratch); + store64(scratch, set->addressOfInferredValue()); + + ready.link(this); +} + +void JIT::emitPutGlobalVar(uintptr_t operand, int value, VariableWatchpointSet* set) { emitGetVirtualRegister(value, regT0); + emitNotifyWrite(regT0, regT1, set); storePtr(regT0, reinterpret_cast(operand)); } @@ -798,21 +824,23 @@ void JIT::emit_op_put_to_scope(Instruction* currentInstruction) switch (resolveType) { case GlobalProperty: case GlobalPropertyWithVarInjectionChecks: + emitWriteBarrier(m_codeBlock->globalObject(), value, ShouldFilterValue); emitLoadWithStructureCheck(scope, structureSlot); // Structure check covers var injection. emitPutGlobalProperty(operandSlot, value); break; case GlobalVar: case GlobalVarWithVarInjectionChecks: + emitWriteBarrier(m_codeBlock->globalObject(), value, ShouldFilterValue); emitVarInjectionCheck(needsVarInjectionChecks(resolveType)); - emitPutGlobalVar(*operandSlot, value); + emitPutGlobalVar(*operandSlot, value, currentInstruction[5].u.watchpointSet); break; case ClosureVar: case ClosureVarWithVarInjectionChecks: + emitWriteBarrier(scope, value, ShouldFilterValue); emitVarInjectionCheck(needsVarInjectionChecks(resolveType)); emitPutClosureVar(scope, *operandSlot, value); break; case Dynamic: - killLastResultRegister(); addSlowCase(jump()); break; } @@ -821,55 +849,160 @@ void JIT::emit_op_put_to_scope(Instruction* currentInstruction) void JIT::emitSlow_op_put_to_scope(Instruction* currentInstruction, Vector::iterator& iter) { ResolveType resolveType = ResolveModeAndType(currentInstruction[4].u.operand).type(); - if (resolveType == GlobalVar || resolveType == ClosureVar) + unsigned linkCount = 0; + if (resolveType != GlobalVar && resolveType != ClosureVar) + linkCount++; + if ((resolveType == GlobalVar || resolveType == GlobalVarWithVarInjectionChecks) + && currentInstruction[5].u.watchpointSet->state() != IsInvalidated) + linkCount++; + if (!linkCount) return; - - linkSlowCase(iter); + while (linkCount--) + linkSlowCase(iter); callOperation(operationPutToScope, currentInstruction); } void JIT::emit_op_init_global_const(Instruction* currentInstruction) { JSGlobalObject* globalObject = m_codeBlock->globalObject(); - + emitWriteBarrier(globalObject, currentInstruction[2].u.operand, ShouldFilterValue); emitGetVirtualRegister(currentInstruction[2].u.operand, regT0); - store64(regT0, currentInstruction[1].u.registerPointer); - if (Heap::isWriteBarrierEnabled()) - emitWriteBarrier(globalObject, regT0, regT2, ShouldFilterImmediates, WriteBarrierForVariableAccess); } #endif // USE(JSVALUE64) -void JIT::emitWriteBarrier(RegisterID owner, RegisterID value, RegisterID scratch, RegisterID scratch2, WriteBarrierMode mode, WriteBarrierUseKind useKind) +JIT::Jump JIT::checkMarkWord(RegisterID owner, RegisterID scratch1, RegisterID scratch2) +{ + move(owner, scratch1); + move(owner, scratch2); + + andPtr(TrustedImmPtr(MarkedBlock::blockMask), scratch1); + andPtr(TrustedImmPtr(~MarkedBlock::blockMask), scratch2); + + rshift32(TrustedImm32(3 + 4), scratch2); + + return branchTest8(Zero, BaseIndex(scratch1, scratch2, TimesOne, MarkedBlock::offsetOfMarks())); +} + +JIT::Jump JIT::checkMarkWord(JSCell* owner) +{ + MarkedBlock* block = MarkedBlock::blockFor(owner); + size_t index = (reinterpret_cast(owner) & ~MarkedBlock::blockMask) >> (3 + 4); + void* address = (reinterpret_cast(block) + MarkedBlock::offsetOfMarks()) + index; + + return branchTest8(Zero, AbsoluteAddress(address)); +} + +#if USE(JSVALUE64) +void JIT::emitWriteBarrier(unsigned owner, unsigned value, WriteBarrierMode mode) { +#if ENABLE(GGC) + emitGetVirtualRegister(value, regT0); + Jump valueNotCell; + if (mode == ShouldFilterValue || mode == ShouldFilterBaseAndValue) + valueNotCell = branchTest64(NonZero, regT0, tagMaskRegister); + + emitGetVirtualRegister(owner, regT0); + Jump ownerNotCell; + if (mode == ShouldFilterBaseAndValue) + ownerNotCell = branchTest64(NonZero, regT0, tagMaskRegister); + + Jump ownerNotMarked = checkMarkWord(regT0, regT1, regT2); + callOperation(operationUnconditionalWriteBarrier, regT0); + ownerNotMarked.link(this); + + if (mode == ShouldFilterBaseAndValue) + ownerNotCell.link(this); + if (mode == ShouldFilterValue || mode == ShouldFilterBaseAndValue) + valueNotCell.link(this); +#else UNUSED_PARAM(owner); - UNUSED_PARAM(scratch); - UNUSED_PARAM(scratch2); - UNUSED_PARAM(useKind); UNUSED_PARAM(value); UNUSED_PARAM(mode); - ASSERT(owner != scratch); - ASSERT(owner != scratch2); - -#if ENABLE(WRITE_BARRIER_PROFILING) - emitCount(WriteBarrierCounters::jitCounterFor(useKind)); #endif } -void JIT::emitWriteBarrier(JSCell* owner, RegisterID value, RegisterID scratch, WriteBarrierMode mode, WriteBarrierUseKind useKind) +void JIT::emitWriteBarrier(JSCell* owner, unsigned value, WriteBarrierMode mode) { +#if ENABLE(GGC) + emitGetVirtualRegister(value, regT0); + Jump valueNotCell; + if (mode == ShouldFilterValue) + valueNotCell = branchTest64(NonZero, regT0, tagMaskRegister); + + if (!MarkedBlock::blockFor(owner)->isMarked(owner)) { + Jump ownerNotMarked = checkMarkWord(regT0, regT1, regT2); + callOperation(operationUnconditionalWriteBarrier, owner); + ownerNotMarked.link(this); + } else + callOperation(operationUnconditionalWriteBarrier, owner); + + if (mode == ShouldFilterValue) + valueNotCell.link(this); +#else + UNUSED_PARAM(owner); + UNUSED_PARAM(value); + UNUSED_PARAM(mode); +#endif +} + +#else // USE(JSVALUE64) + +void JIT::emitWriteBarrier(unsigned owner, unsigned value, WriteBarrierMode mode) +{ +#if ENABLE(GGC) + emitLoadTag(value, regT0); + Jump valueNotCell; + if (mode == ShouldFilterValue || mode == ShouldFilterBaseAndValue) + valueNotCell = branch32(NotEqual, regT0, TrustedImm32(JSValue::CellTag)); + + emitLoad(owner, regT0, regT1); + Jump ownerNotCell; + if (mode == ShouldFilterBaseAndValue) + ownerNotCell = branch32(NotEqual, regT0, TrustedImm32(JSValue::CellTag)); + + Jump ownerNotMarked = checkMarkWord(regT1, regT0, regT2); + callOperation(operationUnconditionalWriteBarrier, regT1); + ownerNotMarked.link(this); + + if (mode == ShouldFilterBaseAndValue) + ownerNotCell.link(this); + if (mode == ShouldFilterValue || mode == ShouldFilterBaseAndValue) + valueNotCell.link(this); +#else + UNUSED_PARAM(owner); + UNUSED_PARAM(value); + UNUSED_PARAM(mode); +#endif +} + +void JIT::emitWriteBarrier(JSCell* owner, unsigned value, WriteBarrierMode mode) +{ +#if ENABLE(GGC) + emitLoadTag(value, regT0); + Jump valueNotCell; + if (mode == ShouldFilterValue) + valueNotCell = branch32(NotEqual, regT0, TrustedImm32(JSValue::CellTag)); + + if (!MarkedBlock::blockFor(owner)->isMarked(owner)) { + Jump ownerNotMarked = checkMarkWord(regT0, regT1, regT2); + callOperation(operationUnconditionalWriteBarrier, owner); + ownerNotMarked.link(this); + } else + callOperation(operationUnconditionalWriteBarrier, owner); + + if (mode == ShouldFilterValue) + valueNotCell.link(this); +#else UNUSED_PARAM(owner); - UNUSED_PARAM(scratch); - UNUSED_PARAM(useKind); UNUSED_PARAM(value); UNUSED_PARAM(mode); - -#if ENABLE(WRITE_BARRIER_PROFILING) - emitCount(WriteBarrierCounters::jitCounterFor(useKind)); #endif } +#endif // USE(JSVALUE64) + JIT::Jump JIT::addStructureTransitionCheck(JSCell* object, Structure* structure, StructureStubInfo* stubInfo, RegisterID scratch) { if (object->structure() == structure && structure->transitionWatchpointSetIsStillValid()) { @@ -959,7 +1092,11 @@ void JIT::privateCompilePutByVal(ByValInfo* byValInfo, ReturnAddressPtr returnAd PatchableJump badType; JumpList slowCases; - + +#if ENABLE(GGC) + bool needsLinkForWriteBarrier = false; +#endif + switch (arrayMode) { case JITInt32: slowCases = emitInt32PutByVal(currentInstruction, badType); @@ -969,9 +1106,15 @@ void JIT::privateCompilePutByVal(ByValInfo* byValInfo, ReturnAddressPtr returnAd break; case JITContiguous: slowCases = emitContiguousPutByVal(currentInstruction, badType); +#if ENABLE(GGC) + needsLinkForWriteBarrier = true; +#endif break; case JITArrayStorage: slowCases = emitArrayStoragePutByVal(currentInstruction, badType); +#if ENABLE(GGC) + needsLinkForWriteBarrier = true; +#endif break; default: TypedArrayType type = typedArrayTypeForJITArrayMode(arrayMode); @@ -985,11 +1128,15 @@ void JIT::privateCompilePutByVal(ByValInfo* byValInfo, ReturnAddressPtr returnAd Jump done = jump(); LinkBuffer patchBuffer(*m_vm, this, m_codeBlock); - patchBuffer.link(badType, CodeLocationLabel(MacroAssemblerCodePtr::createFromExecutableAddress(returnAddress.value())).labelAtOffset(byValInfo->returnAddressToSlowPath)); patchBuffer.link(slowCases, CodeLocationLabel(MacroAssemblerCodePtr::createFromExecutableAddress(returnAddress.value())).labelAtOffset(byValInfo->returnAddressToSlowPath)); - patchBuffer.link(done, byValInfo->badTypeJump.labelAtOffset(byValInfo->badTypeJumpToDone)); +#if ENABLE(GGC) + if (needsLinkForWriteBarrier) { + ASSERT(m_calls.last().to == operationUnconditionalWriteBarrier); + patchBuffer.link(m_calls.last().from, operationUnconditionalWriteBarrier); + } +#endif bool isDirect = m_interpreter->getOpcodeID(currentInstruction->u.opcode) == op_put_by_val_direct; if (!isDirect) { diff --git a/JavaScriptCore/jit/JITPropertyAccess32_64.cpp b/JavaScriptCore/jit/JITPropertyAccess32_64.cpp index 527db934..5bc8d1ab 100644 --- a/JavaScriptCore/jit/JITPropertyAccess32_64.cpp +++ b/JavaScriptCore/jit/JITPropertyAccess32_64.cpp @@ -43,11 +43,6 @@ #include "SamplingTool.h" #include -#ifndef NDEBUG -#include -#endif - -using namespace std; namespace JSC { @@ -173,9 +168,8 @@ void JIT::emit_op_get_by_val(Instruction* currentInstruction) resultOK.link(this); #endif - emitValueProfilingSite(regT4); + emitValueProfilingSite(); emitStore(dst, regT1, regT0); - map(m_bytecodeOffset + OPCODE_LENGTH(op_get_by_val), dst, regT1, regT0); m_byValCompilationInfo.append(ByValCompilationInfo(m_bytecodeOffset, badType, mode, done)); } @@ -269,7 +263,7 @@ void JIT::emitSlow_op_get_by_val(Instruction* currentInstruction, Vector::iterator& iter) @@ -522,16 +519,19 @@ void JIT::emit_op_put_by_id(Instruction* currentInstruction) int value = currentInstruction[3].u.operand; int direct = currentInstruction[8].u.operand; + emitWriteBarrier(base, value, ShouldFilterBaseAndValue); + emitLoad2(base, regT1, regT0, value, regT3, regT2); emitJumpSlowCaseIfNotJSCell(base, regT1); - emitWriteBarrier(regT0, regT1, regT2, regT3, ShouldFilterImmediates, WriteBarrierForPropertyAccess); - + emitLoad(base, regT1, regT0); + emitLoad(value, regT3, regT2); + JITPutByIdGenerator gen( m_codeBlock, CodeOrigin(m_bytecodeOffset), RegisterSet::specialRegisters(), - JSValueRegs::payloadOnly(regT0), JSValueRegs(regT3, regT2), regT1, true, - m_codeBlock->ecmaMode(), direct ? Direct : NotDirect); + callFrameRegister, JSValueRegs::payloadOnly(regT0), JSValueRegs(regT3, regT2), + regT1, true, m_codeBlock->ecmaMode(), direct ? Direct : NotDirect); gen.generateFastPath(*this); addSlowCase(gen.slowPathJump()); @@ -646,7 +646,6 @@ void JIT::emit_op_get_by_pname(Instruction* currentInstruction) compileGetDirectOffset(regT2, regT1, regT0, regT3); emitStore(dst, regT1, regT0); - map(m_bytecodeOffset + OPCODE_LENGTH(op_get_by_pname), dst, regT1, regT0); } void JIT::emitSlow_op_get_by_pname(Instruction* currentInstruction, Vector::iterator& iter) @@ -670,7 +669,7 @@ void JIT::emitVarInjectionCheck(bool needsVarInjectionChecks) { if (!needsVarInjectionChecks) return; - addSlowCase(branchTest8(NonZero, AbsoluteAddress(m_codeBlock->globalObject()->varInjectionWatchpoint()->addressOfIsInvalidated()))); + addSlowCase(branch8(Equal, AbsoluteAddress(m_codeBlock->globalObject()->varInjectionWatchpoint()->addressOfState()), TrustedImm32(IsInvalidated))); } void JIT::emitResolveClosure(int dst, bool needsVarInjectionChecks, unsigned depth) @@ -687,7 +686,6 @@ void JIT::emitResolveClosure(int dst, bool needsVarInjectionChecks, unsigned dep for (unsigned i = 0; i < depth; ++i) loadPtr(Address(regT0, JSScope::offsetOfNext()), regT0); emitStore(dst, regT1, regT0); - map(m_bytecodeOffset + OPCODE_LENGTH(op_resolve_scope), dst, regT1, regT0); } void JIT::emit_op_resolve_scope(Instruction* currentInstruction) @@ -705,7 +703,6 @@ void JIT::emit_op_resolve_scope(Instruction* currentInstruction) move(TrustedImm32(JSValue::CellTag), regT1); move(TrustedImmPtr(m_codeBlock->globalObject()), regT0); emitStore(dst, regT1, regT0); - map(m_bytecodeOffset + OPCODE_LENGTH(op_resolve_scope), dst, regT1, regT0); break; case ClosureVar: case ClosureVarWithVarInjectionChecks: @@ -786,9 +783,8 @@ void JIT::emit_op_get_from_scope(Instruction* currentInstruction) addSlowCase(jump()); break; } - emitValueProfilingSite(regT4); + emitValueProfilingSite(); emitStore(dst, regT1, regT0); - map(m_bytecodeOffset + OPCODE_LENGTH(op_get_from_scope), dst, regT1, regT0); } void JIT::emitSlow_op_get_from_scope(Instruction* currentInstruction, Vector::iterator& iter) @@ -805,17 +801,55 @@ void JIT::emitSlow_op_get_from_scope(Instruction* currentInstruction, Vectorstate() == IsInvalidated) + return; + + load8(set->addressOfState(), scratch); + + JumpList ready; + + ready.append(branch32(Equal, scratch, TrustedImm32(IsInvalidated))); + + if (set->state() == ClearWatchpoint) { + Jump isWatched = branch32(NotEqual, scratch, TrustedImm32(ClearWatchpoint)); + + store32(tag, &set->addressOfInferredValue()->u.asBits.tag); + store32(payload, &set->addressOfInferredValue()->u.asBits.payload); + store8(TrustedImm32(IsWatched), set->addressOfState()); + ready.append(jump()); + + isWatched.link(this); + } + + Jump definitelyNotEqual = branch32( + NotEqual, AbsoluteAddress(&set->addressOfInferredValue()->u.asBits.payload), payload); + ready.append(branch32( + Equal, AbsoluteAddress(&set->addressOfInferredValue()->u.asBits.tag), tag)); + definitelyNotEqual.link(this); + addSlowCase(branchTest8(NonZero, AbsoluteAddress(set->addressOfSetIsNotEmpty()))); + store8(TrustedImm32(IsInvalidated), set->addressOfState()); + store32( + TrustedImm32(JSValue::EmptyValueTag), &set->addressOfInferredValue()->u.asBits.tag); + store32(TrustedImm32(0), &set->addressOfInferredValue()->u.asBits.payload); + + ready.link(this); +} + +void JIT::emitPutGlobalVar(uintptr_t operand, int value, VariableWatchpointSet* set) { emitLoad(value, regT1, regT0); + emitNotifyWrite(regT1, regT0, regT2, set); store32(regT1, reinterpret_cast(operand) + OBJECT_OFFSETOF(EncodedValueDescriptor, asBits.tag)); store32(regT0, reinterpret_cast(operand) + OBJECT_OFFSETOF(EncodedValueDescriptor, asBits.payload)); } @@ -840,16 +874,19 @@ void JIT::emit_op_put_to_scope(Instruction* currentInstruction) switch (resolveType) { case GlobalProperty: case GlobalPropertyWithVarInjectionChecks: + emitWriteBarrier(m_codeBlock->globalObject(), value, ShouldFilterValue); emitLoadWithStructureCheck(scope, structureSlot); // Structure check covers var injection. emitPutGlobalProperty(operandSlot, value); break; case GlobalVar: case GlobalVarWithVarInjectionChecks: + emitWriteBarrier(m_codeBlock->globalObject(), value, ShouldFilterValue); emitVarInjectionCheck(needsVarInjectionChecks(resolveType)); - emitPutGlobalVar(*operandSlot, value); + emitPutGlobalVar(*operandSlot, value, currentInstruction[5].u.watchpointSet); break; case ClosureVar: case ClosureVarWithVarInjectionChecks: + emitWriteBarrier(scope, value, ShouldFilterValue); emitVarInjectionCheck(needsVarInjectionChecks(resolveType)); emitPutClosureVar(scope, *operandSlot, value); break; @@ -862,11 +899,16 @@ void JIT::emit_op_put_to_scope(Instruction* currentInstruction) void JIT::emitSlow_op_put_to_scope(Instruction* currentInstruction, Vector::iterator& iter) { ResolveType resolveType = ResolveModeAndType(currentInstruction[4].u.operand).type(); - - if (resolveType == GlobalVar || resolveType == ClosureVar) + unsigned linkCount = 0; + if (resolveType != GlobalVar && resolveType != ClosureVar) + linkCount++; + if ((resolveType == GlobalVar || resolveType == GlobalVarWithVarInjectionChecks) + && currentInstruction[5].u.watchpointSet->state() != IsInvalidated) + linkCount++; + if (!linkCount) return; - - linkSlowCase(iter); + while (linkCount--) + linkSlowCase(iter); callOperation(operationPutToScope, currentInstruction); } @@ -877,17 +919,12 @@ void JIT::emit_op_init_global_const(Instruction* currentInstruction) JSGlobalObject* globalObject = m_codeBlock->globalObject(); + emitWriteBarrier(globalObject, value, ShouldFilterValue); + emitLoad(value, regT1, regT0); - if (Heap::isWriteBarrierEnabled()) { - move(TrustedImmPtr(globalObject), regT2); - - emitWriteBarrier(globalObject, regT1, regT3, ShouldFilterImmediates, WriteBarrierForVariableAccess); - } - store32(regT1, registerPointer->tagPointer()); store32(regT0, registerPointer->payloadPointer()); - map(m_bytecodeOffset + OPCODE_LENGTH(op_init_global_const), value, regT1, regT0); } } // namespace JSC diff --git a/JavaScriptCore/jit/JITStubs.cpp b/JavaScriptCore/jit/JITStubs.cpp index c26a2cca..47c509e3 100644 --- a/JavaScriptCore/jit/JITStubs.cpp +++ b/JavaScriptCore/jit/JITStubs.cpp @@ -33,82 +33,22 @@ #if ENABLE(JIT) #include "JITStubs.h" -#include "Arguments.h" -#include "ArrayConstructor.h" -#include "CallFrame.h" -#include "CallFrameInlines.h" -#include "CodeBlock.h" -#include "CodeProfiling.h" -#include "CommonSlowPaths.h" -#include "DFGCompilationMode.h" -#include "DFGDriver.h" -#include "DFGOSREntry.h" -#include "DFGWorklist.h" -#include "Debugger.h" -#include "DeferGC.h" -#include "ErrorInstance.h" -#include "ExceptionHelpers.h" -#include "GetterSetter.h" -#include "Heap.h" -#include -#include "JIT.h" -#include "JITExceptions.h" -#include "JITToDFGDeferredCompilationCallback.h" -#include "JSActivation.h" -#include "JSArray.h" -#include "JSFunction.h" -#include "JSGlobalObjectFunctions.h" -#include "JSNameScope.h" -#include "JSNotAnObject.h" -#include "JSPropertyNameIterator.h" -#include "JSString.h" -#include "JSWithScope.h" -#include "LegacyProfiler.h" -#include "NameInstance.h" -#include "ObjectConstructor.h" -#include "ObjectPrototype.h" -#include "Operations.h" -#include "Parser.h" -#include "RegExpObject.h" -#include "RegExpPrototype.h" -#include "Register.h" -#include "RepatchBuffer.h" -#include "SamplingTool.h" -#include "SlowPathCall.h" -#include "Strong.h" -#include "StructureRareDataInlines.h" -#include -#include -#include - -using namespace std; - #if CPU(ARM_TRADITIONAL) #include "JITStubsARM.h" #elif CPU(ARM_THUMB2) #include "JITStubsARMv7.h" -#elif CPU(MIPS) -#include "JITStubsMIPS.h" -#elif CPU(SH4) -#include "JITStubsSH4.h" #elif CPU(X86) #include "JITStubsX86.h" #elif CPU(X86_64) #include "JITStubsX86_64.h" #elif CPU(ARM64) -#include "JITStubsARM64.h" +// There isn't an ARM64 specific .h file +#elif CPU(MIPS) +// There isn't a MIPS specific .h file +#elif CPU(SH4) +// There isn't an SH4 specific .h file #else #error "JIT not supported on this platform." #endif -namespace JSC { - -#if ENABLE(OPCODE_SAMPLING) - #define CTI_SAMPLER stackFrame.vm->interpreter->sampler() -#else - #define CTI_SAMPLER 0 -#endif - -} // namespace JSC - #endif // ENABLE(JIT) diff --git a/JavaScriptCore/jit/JITStubs.h b/JavaScriptCore/jit/JITStubs.h index 1aff9a36..24d95dfd 100644 --- a/JavaScriptCore/jit/JITStubs.h +++ b/JavaScriptCore/jit/JITStubs.h @@ -30,57 +30,23 @@ #ifndef JITStubs_h #define JITStubs_h -#include "CallData.h" -#include "Intrinsic.h" -#include "JITExceptions.h" -#include "LowLevelInterpreter.h" -#include "MacroAssemblerCodeRef.h" -#include "Register.h" +#include "JSCJSValue.h" namespace JSC { #if ENABLE(JIT) -struct StructureStubInfo; +#if OS(WINDOWS) +class ExecState; +class Register; +struct ProtoCallFrame; -class ArrayAllocationProfile; -class CodeBlock; -class ExecutablePool; -class FunctionExecutable; -class Identifier; -class VM; -class JSGlobalObject; -class JSObject; -class JSPropertyNameIterator; -class JSStack; -class JSValue; -class JSValueEncodedAsPointer; -class LegacyProfiler; -class NativeExecutable; -class PropertySlot; -class PutPropertySlot; -class RegExp; -class Structure; - -#define STUB_ARGS_DECLARATION void** args -#define STUB_ARGS (args) - -#if CPU(X86) -#if COMPILER(MSVC) -#define JIT_STUB __fastcall -#elif COMPILER(GCC) -#define JIT_STUB __attribute__ ((fastcall)) -#elif COMPILER(SUNCC) -#define JIT_STUB -#else -#error "JIT_STUB function calls require fastcall conventions on x86, add appropriate directive/attribute here for your compiler!" +extern "C" { + EncodedJSValue callToJavaScript(void*, ExecState**, ProtoCallFrame*, Register*); + void returnFromJavaScript(); + EncodedJSValue callToNativeFunction(void*, ExecState**, ProtoCallFrame*, Register*); +} #endif -#else -#define JIT_STUB -#endif - -extern "C" void ctiOpThrowNotCaught(); -extern "C" EncodedJSValue ctiTrampoline(void* code, JSStack*, CallFrame*, void* /*unused1*/, void* /*unused2*/, VM*); #if USE(MASM_PROBE) extern "C" void ctiMasmProbeTrampoline(); diff --git a/JavaScriptCore/jit/JITStubsARM.h b/JavaScriptCore/jit/JITStubsARM.h index bd1c04a8..fd59188f 100644 --- a/JavaScriptCore/jit/JITStubsARM.h +++ b/JavaScriptCore/jit/JITStubsARM.h @@ -41,11 +41,6 @@ namespace JSC { -// Also update the MSVC section (defined at DEFINE_STUB_FUNCTION) -// when changing one of the following values. -#define THUNK_RETURN_ADDRESS_OFFSET 64 -#define PRESERVEDR4_OFFSET 68 - #if COMPILER(GCC) #if USE(MASM_PROBE) @@ -151,37 +146,6 @@ COMPILE_ASSERT(sizeof(MacroAssembler::ProbeContext) == PROBE_SIZE, ProbeContext_ #endif // USE(MASM_PROBE) -asm ( -".text" "\n" -".globl " SYMBOL_STRING(ctiTrampoline) "\n" -HIDE_SYMBOL(ctiTrampoline) "\n" -INLINE_ARM_FUNCTION(ctiTrampoline) -SYMBOL_STRING(ctiTrampoline) ":" "\n" - "stmdb sp!, {r1-r3}" "\n" - "stmdb sp!, {r4-r6, r8-r11, lr}" "\n" - "sub sp, sp, #" STRINGIZE_VALUE_OF(PRESERVEDR4_OFFSET) "\n" - "mov r5, r2" "\n" - // r0 contains the code - "blx r0" "\n" - "add sp, sp, #" STRINGIZE_VALUE_OF(PRESERVEDR4_OFFSET) "\n" - "ldmia sp!, {r4-r6, r8-r11, lr}" "\n" - "add sp, sp, #12" "\n" - "bx lr" "\n" -); - -asm ( -// Both has the same return sequence -".text" "\n" -".globl " SYMBOL_STRING(ctiOpThrowNotCaught) "\n" -HIDE_SYMBOL(ctiOpThrowNotCaught) "\n" -INLINE_ARM_FUNCTION(ctiOpThrowNotCaught) -SYMBOL_STRING(ctiOpThrowNotCaught) ":" "\n" - "add sp, sp, #" STRINGIZE_VALUE_OF(PRESERVEDR4_OFFSET) "\n" - "ldmia sp!, {r4-r6, r8-r11, lr}" "\n" - "add sp, sp, #12" "\n" - "bx lr" "\n" -); - #if USE(MASM_PROBE) asm ( ".text" "\n" @@ -330,121 +294,9 @@ SYMBOL_STRING(ctiMasmProbeTrampolineEnd) ":" "\n" #endif // USE(MASM_PROBE) -#define DEFINE_STUB_FUNCTION(rtype, op) \ - extern "C" { \ - rtype JITStubThunked_##op(STUB_ARGS_DECLARATION); \ - }; \ - asm ( \ - ".globl " SYMBOL_STRING(cti_##op) "\n" \ - INLINE_ARM_FUNCTION(cti_##op) \ - SYMBOL_STRING(cti_##op) ":" "\n" \ - "str lr, [sp, #" STRINGIZE_VALUE_OF(THUNK_RETURN_ADDRESS_OFFSET) "]" "\n" \ - "bl " SYMBOL_STRING(JITStubThunked_##op) "\n" \ - "ldr lr, [sp, #" STRINGIZE_VALUE_OF(THUNK_RETURN_ADDRESS_OFFSET) "]" "\n" \ - "bx lr" "\n" \ - ); \ - rtype JITStubThunked_##op(STUB_ARGS_DECLARATION) #endif // COMPILER(GCC) -#if COMPILER(RVCT) - -__asm EncodedJSValue ctiTrampoline(void*, JSStack*, CallFrame*, void* /*unused1*/, void* /*unused2*/, VM*) -{ - ARM - stmdb sp!, {r1-r3} - stmdb sp!, {r4-r6, r8-r11, lr} - sub sp, sp, # PRESERVEDR4_OFFSET - mov r5, r2 - mov lr, pc - bx r0 - add sp, sp, # PRESERVEDR4_OFFSET - ldmia sp!, {r4-r6, r8-r11, lr} - add sp, sp, #12 - bx lr -} - -__asm void ctiOpThrowNotCaught() -{ - ARM - add sp, sp, # PRESERVEDR4_OFFSET - ldmia sp!, {r4-r8, lr} - add sp, sp, #12 - bx lr -} - -#define DEFINE_STUB_FUNCTION(rtype, op) rtype JITStubThunked_##op(STUB_ARGS_DECLARATION) - -/* The following is a workaround for RVCT toolchain; precompiler macros are not expanded before the code is passed to the assembler */ - -/* The following section is a template to generate code for GeneratedJITStubs_RVCT.h */ -/* The pattern "#xxx#" will be replaced with "xxx" */ - -/* -RVCT(extern "C" #rtype# JITStubThunked_#op#(STUB_ARGS_DECLARATION);) -RVCT(__asm #rtype# cti_#op#(STUB_ARGS_DECLARATION)) -RVCT({) -RVCT( PRESERVE8) -RVCT( IMPORT JITStubThunked_#op#) -RVCT( str lr, [sp, # THUNK_RETURN_ADDRESS_OFFSET]) -RVCT( bl JITStubThunked_#op#) -RVCT( ldr lr, [sp, # THUNK_RETURN_ADDRESS_OFFSET]) -RVCT( bx lr) -RVCT(}) -RVCT() -*/ - -/* Include the generated file */ -#include "GeneratedJITStubs_RVCT.h" - -#endif // COMPILER(RVCT) - -#if COMPILER(MSVC) - -#define DEFINE_STUB_FUNCTION(rtype, op) extern "C" rtype JITStubThunked_##op(STUB_ARGS_DECLARATION) - -/* The following is a workaround for MSVC toolchain; inline assembler is not supported */ - -/* The following section is a template to generate code for GeneratedJITStubs_MSVC.asm */ -/* The pattern "#xxx#" will be replaced with "xxx" */ - -/* -MSVC_BEGIN( AREA Trampoline, CODE) -MSVC_BEGIN() -MSVC_BEGIN( EXPORT ctiTrampoline) -MSVC_BEGIN( EXPORT ctiTrampolineEnd) -MSVC_BEGIN( EXPORT ctiOpThrowNotCaught) -MSVC_BEGIN() -MSVC_BEGIN(ctiTrampoline PROC) -MSVC_BEGIN( stmdb sp!, {r1-r3}) -MSVC_BEGIN( stmdb sp!, {r4-r6, r8-r11, lr}) -MSVC_BEGIN( sub sp, sp, #68 ; sync with PRESERVEDR4_OFFSET) -MSVC_BEGIN( mov r5, r2) -MSVC_BEGIN( ; r0 contains the code) -MSVC_BEGIN( mov lr, pc) -MSVC_BEGIN( bx r0) -MSVC_BEGIN( add sp, sp, #68 ; sync with PRESERVEDR4_OFFSET) -MSVC_BEGIN( ldmia sp!, {r4-r6, r8-r11, lr}) -MSVC_BEGIN( add sp, sp, #12) -MSVC_BEGIN( bx lr) -MSVC_BEGIN(ctiTrampolineEnd) -MSVC_BEGIN(ctiTrampoline ENDP) -MSVC_BEGIN() - -MSVC( EXPORT cti_#op#) -MSVC( IMPORT JITStubThunked_#op#) -MSVC(cti_#op# PROC) -MSVC( str lr, [sp, #64] ; sync with THUNK_RETURN_ADDRESS_OFFSET) -MSVC( bl JITStubThunked_#op#) -MSVC( ldr lr, [sp, #64] ; sync with THUNK_RETURN_ADDRESS_OFFSET) -MSVC( bx lr) -MSVC(cti_#op# ENDP) -MSVC() - -MSVC_END( END) -*/ -#endif // COMPILER(MSVC) - } // namespace JSC #endif // JITStubsARM_h diff --git a/JavaScriptCore/jit/JITStubsARM64.h b/JavaScriptCore/jit/JITStubsARM64.h deleted file mode 100644 index 59aa1844..00000000 --- a/JavaScriptCore/jit/JITStubsARM64.h +++ /dev/null @@ -1,141 +0,0 @@ -/* - * Copyright (C) 2012, 2013 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. - * 3. Neither the name of Apple Computer, Inc. ("Apple") nor the names of - * its contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY APPLE 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 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. - */ - -#ifndef JITStubsARM64_h -#define JITStubsARM64_h - -#if !CPU(ARM64) -#error "JITStubsARM64.h should only be #included if CPU(ARM64)" -#endif - -#if !USE(JSVALUE64) -#error "JITStubsARM64.h only implements USE(JSVALUE64)" -#endif - -namespace JSC { - -#if COMPILER(GCC) - -#define THUNK_RETURN_ADDRESS_OFFSET 0x30 -#define PRESERVED_RETURN_ADDRESS_OFFSET 0x38 -#define PRESERVED_X19_OFFSET 0x40 -#define PRESERVED_X20_OFFSET 0x48 -#define PRESERVED_X21_OFFSET 0x50 -#define PRESERVED_X22_OFFSET 0x58 -#define PRESERVED_X23_OFFSET 0x60 -#define PRESERVED_X24_OFFSET 0x68 -#define PRESERVED_X25_OFFSET 0x70 -#define PRESERVED_X26_OFFSET 0x78 -#define PRESERVED_X27_OFFSET 0x80 -#define PRESERVED_X28_OFFSET 0x88 -#define REGISTER_FILE_OFFSET 0x90 -#define CALLFRAME_OFFSET 0x98 -#define PROFILER_REFERENCE_OFFSET 0xa0 -#define VM_OFFSET 0xa8 -#define SIZEOF_JITSTACKFRAME 0xb0 - -asm ( -".section __TEXT,__text,regular,pure_instructions" "\n" -".globl " SYMBOL_STRING(ctiTrampoline) "\n" -".align 2" "\n" -HIDE_SYMBOL(ctiTrampoline) "\n" -SYMBOL_STRING(ctiTrampoline) ":" "\n" - "sub sp, sp, #" STRINGIZE_VALUE_OF(SIZEOF_JITSTACKFRAME) "\n" - "str lr, [sp, #" STRINGIZE_VALUE_OF(PRESERVED_RETURN_ADDRESS_OFFSET) "]" "\n" - "str x19, [sp, #" STRINGIZE_VALUE_OF(PRESERVED_X19_OFFSET) "]" "\n" - "str x20, [sp, #" STRINGIZE_VALUE_OF(PRESERVED_X20_OFFSET) "]" "\n" - "str x21, [sp, #" STRINGIZE_VALUE_OF(PRESERVED_X21_OFFSET) "]" "\n" - "str x22, [sp, #" STRINGIZE_VALUE_OF(PRESERVED_X22_OFFSET) "]" "\n" - "str x23, [sp, #" STRINGIZE_VALUE_OF(PRESERVED_X23_OFFSET) "]" "\n" - "str x24, [sp, #" STRINGIZE_VALUE_OF(PRESERVED_X24_OFFSET) "]" "\n" - "str x25, [sp, #" STRINGIZE_VALUE_OF(PRESERVED_X25_OFFSET) "]" "\n" - "str x26, [sp, #" STRINGIZE_VALUE_OF(PRESERVED_X26_OFFSET) "]" "\n" - "str x27, [sp, #" STRINGIZE_VALUE_OF(PRESERVED_X27_OFFSET) "]" "\n" - "str x28, [sp, #" STRINGIZE_VALUE_OF(PRESERVED_X28_OFFSET) "]" "\n" - "str x1, [sp, #" STRINGIZE_VALUE_OF(REGISTER_FILE_OFFSET) "]" "\n" - "str x2, [sp, #" STRINGIZE_VALUE_OF(CALLFRAME_OFFSET) "]" "\n" - "str x4, [sp, #" STRINGIZE_VALUE_OF(PROFILER_REFERENCE_OFFSET) "]" "\n" - "str x5, [sp, #" STRINGIZE_VALUE_OF(VM_OFFSET) "]" "\n" - "mov x25, x2" "\n" // callFrameRegister = ARM64Registers::x25 - "mov x26, #512" "\n" // timeoutCheckRegister = ARM64Registers::x26 - "mov x27, #0xFFFF000000000000" "\n" // tagTypeNumberRegister = ARM64Registers::x27 - "add x28, x27, #2" "\n" // ( #0xFFFF000000000002 ) tagMaskRegister = ARM64Registers::x28 - "blr x0" "\n" - "ldr x28, [sp, #" STRINGIZE_VALUE_OF(PRESERVED_X28_OFFSET) "]" "\n" - "ldr x27, [sp, #" STRINGIZE_VALUE_OF(PRESERVED_X27_OFFSET) "]" "\n" - "ldr x26, [sp, #" STRINGIZE_VALUE_OF(PRESERVED_X26_OFFSET) "]" "\n" - "ldr x25, [sp, #" STRINGIZE_VALUE_OF(PRESERVED_X25_OFFSET) "]" "\n" - "ldr x24, [sp, #" STRINGIZE_VALUE_OF(PRESERVED_X24_OFFSET) "]" "\n" - "ldr x23, [sp, #" STRINGIZE_VALUE_OF(PRESERVED_X23_OFFSET) "]" "\n" - "ldr x22, [sp, #" STRINGIZE_VALUE_OF(PRESERVED_X22_OFFSET) "]" "\n" - "ldr x21, [sp, #" STRINGIZE_VALUE_OF(PRESERVED_X21_OFFSET) "]" "\n" - "ldr x20, [sp, #" STRINGIZE_VALUE_OF(PRESERVED_X20_OFFSET) "]" "\n" - "ldr x19, [sp, #" STRINGIZE_VALUE_OF(PRESERVED_X19_OFFSET) "]" "\n" - "ldr lr, [sp, #" STRINGIZE_VALUE_OF(PRESERVED_RETURN_ADDRESS_OFFSET) "]" "\n" - "add sp, sp, #" STRINGIZE_VALUE_OF(SIZEOF_JITSTACKFRAME) "\n" - "ret" "\n" - -HIDE_SYMBOL(ctiOpThrowNotCaught) "\n" -SYMBOL_STRING(ctiOpThrowNotCaught) ":" "\n" - "ldr x28, [sp, #" STRINGIZE_VALUE_OF(PRESERVED_X28_OFFSET) "]" "\n" - "ldr x27, [sp, #" STRINGIZE_VALUE_OF(PRESERVED_X27_OFFSET) "]" "\n" - "ldr x26, [sp, #" STRINGIZE_VALUE_OF(PRESERVED_X26_OFFSET) "]" "\n" - "ldr x25, [sp, #" STRINGIZE_VALUE_OF(PRESERVED_X25_OFFSET) "]" "\n" - "ldr x24, [sp, #" STRINGIZE_VALUE_OF(PRESERVED_X24_OFFSET) "]" "\n" - "ldr x23, [sp, #" STRINGIZE_VALUE_OF(PRESERVED_X23_OFFSET) "]" "\n" - "ldr x22, [sp, #" STRINGIZE_VALUE_OF(PRESERVED_X22_OFFSET) "]" "\n" - "ldr x21, [sp, #" STRINGIZE_VALUE_OF(PRESERVED_X21_OFFSET) "]" "\n" - "ldr x20, [sp, #" STRINGIZE_VALUE_OF(PRESERVED_X20_OFFSET) "]" "\n" - "ldr x19, [sp, #" STRINGIZE_VALUE_OF(PRESERVED_X19_OFFSET) "]" "\n" - "ldr lr, [sp, #" STRINGIZE_VALUE_OF(PRESERVED_RETURN_ADDRESS_OFFSET) "]" "\n" - "add sp, sp, #" STRINGIZE_VALUE_OF(SIZEOF_JITSTACKFRAME) "\n" - "ret" "\n" -); - -#define DEFINE_STUB_FUNCTION(rtype, op) \ - extern "C" { \ - rtype JITStubThunked_##op(STUB_ARGS_DECLARATION); \ - }; \ - asm ( \ - ".section __TEXT,__text,regular,pure_instructions" "\n" \ - ".globl " SYMBOL_STRING(cti_##op) "\n" \ - ".align 2" "\n" \ - HIDE_SYMBOL(cti_##op) "\n" \ - SYMBOL_STRING(cti_##op) ":" "\n" \ - "str lr, [sp, #" STRINGIZE_VALUE_OF(THUNK_RETURN_ADDRESS_OFFSET) "]" "\n" \ - "bl " SYMBOL_STRING(JITStubThunked_##op) "\n" \ - "ldr lr, [sp, #" STRINGIZE_VALUE_OF(THUNK_RETURN_ADDRESS_OFFSET) "]" "\n" \ - "ret" "\n" \ - ); \ - rtype JITStubThunked_##op(STUB_ARGS_DECLARATION) \ - -#endif // COMPILER(GCC) - -} // namespace JSC - -#endif // JITStubsARM64_h diff --git a/JavaScriptCore/jit/JITStubsARMv7.h b/JavaScriptCore/jit/JITStubsARMv7.h index 85f084c0..28bbf8a9 100644 --- a/JavaScriptCore/jit/JITStubsARMv7.h +++ b/JavaScriptCore/jit/JITStubsARMv7.h @@ -41,19 +41,6 @@ namespace JSC { -#define THUNK_RETURN_ADDRESS_OFFSET 0x38 -#define PRESERVED_RETURN_ADDRESS_OFFSET 0x3C -#define PRESERVED_R4_OFFSET 0x40 -#define PRESERVED_R5_OFFSET 0x44 -#define PRESERVED_R6_OFFSET 0x48 -#define PRESERVED_R7_OFFSET 0x4C -#define PRESERVED_R8_OFFSET 0x50 -#define PRESERVED_R9_OFFSET 0x54 -#define PRESERVED_R10_OFFSET 0x58 -#define PRESERVED_R11_OFFSET 0x5C -#define REGISTER_FILE_OFFSET 0x60 -#define FIRST_STACK_ARGUMENT 0x68 - #if COMPILER(GCC) #if USE(MASM_PROBE) @@ -198,65 +185,6 @@ COMPILE_ASSERT(sizeof(MacroAssembler::ProbeContext) == PROBE_SIZE, ProbeContext_ #undef PROBE_OFFSETOF -#endif // USE(MASM_PROBE) - - -asm ( -".text" "\n" -".align 2" "\n" -".globl " SYMBOL_STRING(ctiTrampoline) "\n" -HIDE_SYMBOL(ctiTrampoline) "\n" -".thumb" "\n" -".thumb_func " THUMB_FUNC_PARAM(ctiTrampoline) "\n" -SYMBOL_STRING(ctiTrampoline) ":" "\n" - "sub sp, sp, #" STRINGIZE_VALUE_OF(FIRST_STACK_ARGUMENT) "\n" - "str lr, [sp, #" STRINGIZE_VALUE_OF(PRESERVED_RETURN_ADDRESS_OFFSET) "]" "\n" - "str r4, [sp, #" STRINGIZE_VALUE_OF(PRESERVED_R4_OFFSET) "]" "\n" - "str r5, [sp, #" STRINGIZE_VALUE_OF(PRESERVED_R5_OFFSET) "]" "\n" - "str r6, [sp, #" STRINGIZE_VALUE_OF(PRESERVED_R6_OFFSET) "]" "\n" - "str r7, [sp, #" STRINGIZE_VALUE_OF(PRESERVED_R7_OFFSET) "]" "\n" - "str r8, [sp, #" STRINGIZE_VALUE_OF(PRESERVED_R8_OFFSET) "]" "\n" - "str r9, [sp, #" STRINGIZE_VALUE_OF(PRESERVED_R9_OFFSET) "]" "\n" - "str r10, [sp, #" STRINGIZE_VALUE_OF(PRESERVED_R10_OFFSET) "]" "\n" - "str r11, [sp, #" STRINGIZE_VALUE_OF(PRESERVED_R11_OFFSET) "]" "\n" - "str r1, [sp, #" STRINGIZE_VALUE_OF(REGISTER_FILE_OFFSET) "]" "\n" - "mov r5, r2" "\n" - "blx r0" "\n" - "ldr r11, [sp, #" STRINGIZE_VALUE_OF(PRESERVED_R11_OFFSET) "]" "\n" - "ldr r10, [sp, #" STRINGIZE_VALUE_OF(PRESERVED_R10_OFFSET) "]" "\n" - "ldr r9, [sp, #" STRINGIZE_VALUE_OF(PRESERVED_R9_OFFSET) "]" "\n" - "ldr r8, [sp, #" STRINGIZE_VALUE_OF(PRESERVED_R8_OFFSET) "]" "\n" - "ldr r7, [sp, #" STRINGIZE_VALUE_OF(PRESERVED_R7_OFFSET) "]" "\n" - "ldr r6, [sp, #" STRINGIZE_VALUE_OF(PRESERVED_R6_OFFSET) "]" "\n" - "ldr r5, [sp, #" STRINGIZE_VALUE_OF(PRESERVED_R5_OFFSET) "]" "\n" - "ldr r4, [sp, #" STRINGIZE_VALUE_OF(PRESERVED_R4_OFFSET) "]" "\n" - "ldr lr, [sp, #" STRINGIZE_VALUE_OF(PRESERVED_RETURN_ADDRESS_OFFSET) "]" "\n" - "add sp, sp, #" STRINGIZE_VALUE_OF(FIRST_STACK_ARGUMENT) "\n" - "bx lr" "\n" -); - -asm ( -".text" "\n" -".align 2" "\n" -".globl " SYMBOL_STRING(ctiOpThrowNotCaught) "\n" -HIDE_SYMBOL(ctiOpThrowNotCaught) "\n" -".thumb" "\n" -".thumb_func " THUMB_FUNC_PARAM(ctiOpThrowNotCaught) "\n" -SYMBOL_STRING(ctiOpThrowNotCaught) ":" "\n" - "ldr r11, [sp, #" STRINGIZE_VALUE_OF(PRESERVED_R11_OFFSET) "]" "\n" - "ldr r10, [sp, #" STRINGIZE_VALUE_OF(PRESERVED_R10_OFFSET) "]" "\n" - "ldr r9, [sp, #" STRINGIZE_VALUE_OF(PRESERVED_R9_OFFSET) "]" "\n" - "ldr r8, [sp, #" STRINGIZE_VALUE_OF(PRESERVED_R8_OFFSET) "]" "\n" - "ldr r7, [sp, #" STRINGIZE_VALUE_OF(PRESERVED_R7_OFFSET) "]" "\n" - "ldr r6, [sp, #" STRINGIZE_VALUE_OF(PRESERVED_R6_OFFSET) "]" "\n" - "ldr r5, [sp, #" STRINGIZE_VALUE_OF(PRESERVED_R5_OFFSET) "]" "\n" - "ldr r4, [sp, #" STRINGIZE_VALUE_OF(PRESERVED_R4_OFFSET) "]" "\n" - "ldr lr, [sp, #" STRINGIZE_VALUE_OF(PRESERVED_RETURN_ADDRESS_OFFSET) "]" "\n" - "add sp, sp, #" STRINGIZE_VALUE_OF(FIRST_STACK_ARGUMENT) "\n" - "bx lr" "\n" -); - -#if USE(MASM_PROBE) asm ( ".text" "\n" ".align 2" "\n" @@ -416,101 +344,8 @@ SYMBOL_STRING(ctiMasmProbeTrampolineEnd) ":" "\n" ); #endif // USE(MASM_PROBE) - -#define DEFINE_STUB_FUNCTION(rtype, op) \ - extern "C" { \ - rtype JITStubThunked_##op(STUB_ARGS_DECLARATION); \ - }; \ - asm ( \ - ".text" "\n" \ - ".align 2" "\n" \ - ".globl " SYMBOL_STRING(cti_##op) "\n" \ - HIDE_SYMBOL(cti_##op) "\n" \ - ".thumb" "\n" \ - ".thumb_func " THUMB_FUNC_PARAM(cti_##op) "\n" \ - SYMBOL_STRING(cti_##op) ":" "\n" \ - "str lr, [sp, #" STRINGIZE_VALUE_OF(THUNK_RETURN_ADDRESS_OFFSET) "]" "\n" \ - "bl " SYMBOL_STRING(JITStubThunked_##op) "\n" \ - "ldr lr, [sp, #" STRINGIZE_VALUE_OF(THUNK_RETURN_ADDRESS_OFFSET) "]" "\n" \ - "bx lr" "\n" \ - ); \ - rtype JITStubThunked_##op(STUB_ARGS_DECLARATION) \ - #endif // COMPILER(GCC) -#if COMPILER(RVCT) - -__asm EncodedJSValue ctiTrampoline(void*, JSStack*, CallFrame*, void* /*unused1*/, void* /*unused2*/, VM*) -{ - PRESERVE8 - sub sp, sp, # FIRST_STACK_ARGUMENT - str lr, [sp, # PRESERVED_RETURN_ADDRESS_OFFSET ] - str r4, [sp, # PRESERVED_R4_OFFSET ] - str r5, [sp, # PRESERVED_R5_OFFSET ] - str r6, [sp, # PRESERVED_R6_OFFSET ] - str r7, [sp, # PRESERVED_R7_OFFSET ] - str r8, [sp, # PRESERVED_R8_OFFSET ] - str r9, [sp, # PRESERVED_R9_OFFSET ] - str r10, [sp, # PRESERVED_R10_OFFSET ] - str r11, [sp, # PRESERVED_R11_OFFSET ] - str r1, [sp, # REGISTER_FILE_OFFSET ] - mov r5, r2 - blx r0 - ldr r11, [sp, # PRESERVED_R11_OFFSET ] - ldr r10, [sp, # PRESERVED_R10_OFFSET ] - ldr r9, [sp, # PRESERVED_R9_OFFSET ] - ldr r8, [sp, # PRESERVED_R8_OFFSET ] - ldr r7, [sp, # PRESERVED_R7_OFFSET ] - ldr r6, [sp, # PRESERVED_R6_OFFSET ] - ldr r5, [sp, # PRESERVED_R5_OFFSET ] - ldr r4, [sp, # PRESERVED_R4_OFFSET ] - ldr lr, [sp, # PRESERVED_RETURN_ADDRESS_OFFSET ] - add sp, sp, # FIRST_STACK_ARGUMENT - bx lr -} - -__asm void ctiOpThrowNotCaught() -{ - PRESERVE8 - ldr r11, [sp, # PRESERVED_R11_OFFSET ] - ldr r10, [sp, # PRESERVED_R10_OFFSET ] - ldr r9, [sp, # PRESERVED_R9_OFFSET ] - ldr r8, [sp, # PRESERVED_R8_OFFSET ] - ldr r7, [sp, # PRESERVED_R7_OFFSET ] - ldr r6, [sp, # PRESERVED_R6_OFFSET ] - ldr r5, [sp, # PRESERVED_R5_OFFSET ] - ldr r4, [sp, # PRESERVED_R4_OFFSET ] - ldr lr, [sp, # PRESERVED_RETURN_ADDRESS_OFFSET ] - add sp, sp, # FIRST_STACK_ARGUMENT - bx lr -} - -#define DEFINE_STUB_FUNCTION(rtype, op) rtype JITStubThunked_##op(STUB_ARGS_DECLARATION) - -/* The following is a workaround for RVCT toolchain; precompiler macros are not expanded before the code is passed to the assembler */ - -/* The following section is a template to generate code for GeneratedJITStubs_RVCT.h */ -/* The pattern "#xxx#" will be replaced with "xxx" */ - -/* -RVCT(extern "C" #rtype# JITStubThunked_#op#(STUB_ARGS_DECLARATION);) -RVCT(__asm #rtype# cti_#op#(STUB_ARGS_DECLARATION)) -RVCT({) -RVCT( PRESERVE8) -RVCT( IMPORT JITStubThunked_#op#) -RVCT( str lr, [sp, # THUNK_RETURN_ADDRESS_OFFSET]) -RVCT( bl JITStubThunked_#op#) -RVCT( ldr lr, [sp, # THUNK_RETURN_ADDRESS_OFFSET]) -RVCT( bx lr) -RVCT(}) -RVCT() -*/ - -/* Include the generated file */ -#include "GeneratedJITStubs_RVCT.h" - -#endif // COMPILER(RVCT) - } // namespace JSC #endif // JITStubsARMv7_h diff --git a/JavaScriptCore/jit/JITStubsMIPS.h b/JavaScriptCore/jit/JITStubsMIPS.h deleted file mode 100644 index c12029ff..00000000 --- a/JavaScriptCore/jit/JITStubsMIPS.h +++ /dev/null @@ -1,179 +0,0 @@ -/* - * Copyright (C) 2008, 2009, 2013 Apple Inc. All rights reserved. - * Copyright (C) 2008 Cameron Zwarich - * Copyright (C) Research In Motion Limited 2010, 2011. 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. - * 3. Neither the name of Apple Computer, Inc. ("Apple") nor the names of - * its contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY APPLE 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 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. - */ - -#ifndef JITStubsMIPS_h -#define JITStubsMIPS_h - -#if !CPU(MIPS) -#error "JITStubsMIPS.h should only be #included if CPU(MIPS)" -#endif - -#if !USE(JSVALUE32_64) -#error "JITStubsMIPS.h only implements USE(JSVALUE32_64)" -#endif - -namespace JSC { - -#define PRESERVED_GP_OFFSET 60 -#define PRESERVED_S0_OFFSET 64 -#define PRESERVED_S1_OFFSET 68 -#define PRESERVED_S2_OFFSET 72 -#define PRESERVED_S3_OFFSET 76 -#define PRESERVED_S4_OFFSET 80 -#define PRESERVED_RETURN_ADDRESS_OFFSET 84 -#define THUNK_RETURN_ADDRESS_OFFSET 88 -#define REGISTER_FILE_OFFSET 92 -#define VM_OFFSET 108 -#define STACK_LENGTH 112 - -asm ( -".text" "\n" -".align 2" "\n" -".set noreorder" "\n" -".set nomacro" "\n" -".set nomips16" "\n" -".globl " SYMBOL_STRING(ctiTrampoline) "\n" -".ent " SYMBOL_STRING(ctiTrampoline) "\n" -SYMBOL_STRING(ctiTrampoline) ":" "\n" - "addiu $29,$29,-" STRINGIZE_VALUE_OF(STACK_LENGTH) "\n" - "sw $31," STRINGIZE_VALUE_OF(PRESERVED_RETURN_ADDRESS_OFFSET) "($29)" "\n" - "sw $20," STRINGIZE_VALUE_OF(PRESERVED_S4_OFFSET) "($29)" "\n" - "sw $19," STRINGIZE_VALUE_OF(PRESERVED_S3_OFFSET) "($29)" "\n" - "sw $18," STRINGIZE_VALUE_OF(PRESERVED_S2_OFFSET) "($29)" "\n" - "sw $17," STRINGIZE_VALUE_OF(PRESERVED_S1_OFFSET) "($29)" "\n" - "sw $16," STRINGIZE_VALUE_OF(PRESERVED_S0_OFFSET) "($29)" "\n" -#if WTF_MIPS_PIC - "sw $28," STRINGIZE_VALUE_OF(PRESERVED_GP_OFFSET) "($29)" "\n" -#endif - "move $16,$6 # set callFrameRegister" "\n" - "li $17,512 # set timeoutCheckRegister" "\n" - "move $25,$4 # move executableAddress to t9" "\n" - "sw $5," STRINGIZE_VALUE_OF(REGISTER_FILE_OFFSET) "($29) # store JSStack to current stack" "\n" - "lw $9," STRINGIZE_VALUE_OF(STACK_LENGTH + 20) "($29) # load vm from previous stack" "\n" - "jalr $25" "\n" - "sw $9," STRINGIZE_VALUE_OF(VM_OFFSET) "($29) # store vm to current stack" "\n" - "lw $16," STRINGIZE_VALUE_OF(PRESERVED_S0_OFFSET) "($29)" "\n" - "lw $17," STRINGIZE_VALUE_OF(PRESERVED_S1_OFFSET) "($29)" "\n" - "lw $18," STRINGIZE_VALUE_OF(PRESERVED_S2_OFFSET) "($29)" "\n" - "lw $19," STRINGIZE_VALUE_OF(PRESERVED_S3_OFFSET) "($29)" "\n" - "lw $20," STRINGIZE_VALUE_OF(PRESERVED_S4_OFFSET) "($29)" "\n" - "lw $31," STRINGIZE_VALUE_OF(PRESERVED_RETURN_ADDRESS_OFFSET) "($29)" "\n" - "jr $31" "\n" - "addiu $29,$29," STRINGIZE_VALUE_OF(STACK_LENGTH) "\n" -".set reorder" "\n" -".set macro" "\n" -".end " SYMBOL_STRING(ctiTrampoline) "\n" -); - -asm ( -".text" "\n" -".align 2" "\n" -".set noreorder" "\n" -".set nomacro" "\n" -".set nomips16" "\n" -".globl " SYMBOL_STRING(ctiOpThrowNotCaught) "\n" -".ent " SYMBOL_STRING(ctiOpThrowNotCaught) "\n" -SYMBOL_STRING(ctiOpThrowNotCaught) ":" "\n" - "lw $16," STRINGIZE_VALUE_OF(PRESERVED_S0_OFFSET) "($29)" "\n" - "lw $17," STRINGIZE_VALUE_OF(PRESERVED_S1_OFFSET) "($29)" "\n" - "lw $18," STRINGIZE_VALUE_OF(PRESERVED_S2_OFFSET) "($29)" "\n" - "lw $19," STRINGIZE_VALUE_OF(PRESERVED_S3_OFFSET) "($29)" "\n" - "lw $20," STRINGIZE_VALUE_OF(PRESERVED_S4_OFFSET) "($29)" "\n" - "lw $31," STRINGIZE_VALUE_OF(PRESERVED_RETURN_ADDRESS_OFFSET) "($29)" "\n" - "jr $31" "\n" - "addiu $29,$29," STRINGIZE_VALUE_OF(STACK_LENGTH) "\n" -".set reorder" "\n" -".set macro" "\n" -".end " SYMBOL_STRING(ctiOpThrowNotCaught) "\n" -); - - -#if WTF_MIPS_PIC -#define DEFINE_STUB_FUNCTION(rtype, op) \ - extern "C" { \ - rtype JITStubThunked_##op(STUB_ARGS_DECLARATION); \ - }; \ - asm ( \ - ".text" "\n" \ - ".align 2" "\n" \ - ".set noreorder" "\n" \ - ".set nomacro" "\n" \ - ".set nomips16" "\n" \ - ".globl " SYMBOL_STRING(cti_##op) "\n" \ - ".ent " SYMBOL_STRING(cti_##op) "\n" \ - SYMBOL_STRING(cti_##op) ":" "\n" \ - ".set macro" "\n" \ - ".cpload $25" "\n" \ - "sw $31," STRINGIZE_VALUE_OF(THUNK_RETURN_ADDRESS_OFFSET) "($29)" "\n" \ - "la $25," SYMBOL_STRING(JITStubThunked_##op) "\n" \ - ".set nomacro" "\n" \ - ".reloc 1f,R_MIPS_JALR," SYMBOL_STRING(JITStubThunked_##op) "\n" \ - "1: jalr $25" "\n" \ - "nop" "\n" \ - "lw $31," STRINGIZE_VALUE_OF(THUNK_RETURN_ADDRESS_OFFSET) "($29)" "\n" \ - "jr $31" "\n" \ - "nop" "\n" \ - ".set reorder" "\n" \ - ".set macro" "\n" \ - ".end " SYMBOL_STRING(cti_##op) "\n" \ - ); \ - rtype JITStubThunked_##op(STUB_ARGS_DECLARATION) - -#else // WTF_MIPS_PIC -#define DEFINE_STUB_FUNCTION(rtype, op) \ - extern "C" { \ - rtype JITStubThunked_##op(STUB_ARGS_DECLARATION); \ - }; \ - asm ( \ - ".text" "\n" \ - ".align 2" "\n" \ - ".set noreorder" "\n" \ - ".set nomacro" "\n" \ - ".set nomips16" "\n" \ - ".globl " SYMBOL_STRING(cti_##op) "\n" \ - ".ent " SYMBOL_STRING(cti_##op) "\n" \ - SYMBOL_STRING(cti_##op) ":" "\n" \ - "sw $31," STRINGIZE_VALUE_OF(THUNK_RETURN_ADDRESS_OFFSET) "($29)" "\n" \ - "jal " SYMBOL_STRING(JITStubThunked_##op) "\n" \ - "nop" "\n" \ - "lw $31," STRINGIZE_VALUE_OF(THUNK_RETURN_ADDRESS_OFFSET) "($29)" "\n" \ - "jr $31" "\n" \ - "nop" "\n" \ - ".set reorder" "\n" \ - ".set macro" "\n" \ - ".end " SYMBOL_STRING(cti_##op) "\n" \ - ); \ - rtype JITStubThunked_##op(STUB_ARGS_DECLARATION) - -#endif // WTF_MIPS_PIC - -} // namespace JSC - -#endif // JITStubsMIPS_h diff --git a/JavaScriptCore/jit/JITStubsMSVC64.asm b/JavaScriptCore/jit/JITStubsMSVC64.asm index 1fa3bd8b..0bcd9ddb 100644 --- a/JavaScriptCore/jit/JITStubsMSVC64.asm +++ b/JavaScriptCore/jit/JITStubsMSVC64.asm @@ -25,38 +25,101 @@ EXTERN getHostCallReturnValueWithExecState : near -PUBLIC ctiTrampoline -PUBLIC ctiOpThrowNotCaught +PUBLIC callToJavaScript +PUBLIC returnFromJavaScript PUBLIC getHostCallReturnValue _TEXT SEGMENT -ctiTrampoline PROC - ; Dump register parameters to their home address - mov qword ptr[rsp+20h], r9 - mov qword ptr[rsp+18h], r8 - mov qword ptr[rsp+10h], rdx - mov qword ptr[rsp+8h], rcx - +callToJavaScript PROC + ;; This function is believed to be an accurate adaptation of the assembly created by the llint stub of the + ;; same name with changes for argument register differences. + mov r10, qword ptr[rsp] push rbp + mov rax, rbp ; Save previous frame pointer mov rbp, rsp push r12 push r13 push r14 push r15 push rbx + push rsi + push rdi ; JIT operations can use up to 6 args (4 in registers and 2 on the stack). ; In addition, X86_64 ABI specifies that the worse case stack alignment ; requirement is 32 bytes. Based on these factors, we need to pad the stack - ; and additional 28h bytes. + ; an additional 28h bytes. sub rsp, 28h - mov r12, 512 + + mov rbp, r9 + sub rbp, 40 + mov qword ptr[rbp + 40], 0 + mov qword ptr[rbp + 32], rdx + + mov rax, qword ptr[rdx] + mov qword ptr[rbp + 24], rax + mov qword ptr[rbp + 16], 1 + mov qword ptr[rbp + 8], r10 + mov qword ptr[rbp], rax + mov rax, rbp + + mov ebx, dword ptr[r8 + 40] + add rbx, 6 + sal rbx, 3 + sub rbp, rbx + mov qword ptr[rbp], rax + + mov rax, 5 + +copyHeaderLoop: + sub rax, 1 + mov r10, qword ptr[r8 + rax * 8] + mov qword ptr[rbp + rax * 8 + 16], r10 + test rax, rax + jnz copyHeaderLoop + + mov ebx, dword ptr[r8 + 24] + sub rbx, 1 + mov r10d, dword ptr[r8 + 40] + sub r10, 1 + cmp rbx, r10 + je copyArgs + mov rax, 0ah + +fillExtraArgsLoop: + sub r10, 1 + mov qword ptr[rbp + r10 * 8 + 56], rax + cmp rbx, r10 + jne fillExtraArgsLoop + +copyArgs: + mov rax, qword ptr[r8 + 48] + +copyArgsLoop: + test ebx, ebx + jz copyArgsDone + sub ebx, 1 + mov r10, qword ptr[rax + rbx * 8] + mov qword ptr[rbp + rbx * 8 + 56], r10 + jmp copyArgsLoop + +copyArgsDone: + mov qword ptr[rdx], rbp mov r14, 0FFFF000000000000h mov r15, 0FFFF000000000002h - mov r13, r8 call rcx + cmp qword ptr[rbp + 16], 1 + je calleeFramePopped + mov rbp, qword ptr[rbp] + +calleeFramePopped: + mov rbx, qword ptr[rbp + 32] ; VM.topCallFrame + mov r10, qword ptr[rbp + 24] + mov qword ptr[rbx], r10 add rsp, 28h + pop rdi + pop rsi pop rbx pop r15 pop r14 @@ -64,10 +127,101 @@ ctiTrampoline PROC pop r12 pop rbp ret -ctiTrampoline ENDP +callToJavaScript ENDP -ctiOpThrowNotCaught PROC +callToNativeFunction PROC + ;; This function is believed to be an accurate adaptation of the assembly created by the llint stub of the + ;; same name with changes for argument register differences. + mov r10, qword ptr[rsp] + push rbp + mov rax, rbp ; Save previous frame pointer + mov rbp, rsp + push r12 + push r13 + push r14 + push r15 + push rbx + push rsi + push rdi + + ; JIT operations can use up to 6 args (4 in registers and 2 on the stack). + ; In addition, X86_64 ABI specifies that the worse case stack alignment + ; requirement is 32 bytes. Based on these factors, we need to pad the stack + ; an additional 28h bytes. + sub rsp, 28h + + mov rbp, r9 + sub rbp, 40 + mov qword ptr[rbp + 40], 0 + mov qword ptr[rbp + 32], rdx + + mov rax, qword ptr[rdx] + mov qword ptr[rbp + 24], rax + mov qword ptr[rbp + 16], 1 + mov qword ptr[rbp + 8], r10 + mov qword ptr[rbp], rax + mov rax, rbp + + mov ebx, dword ptr[r8 + 40] + add rbx, 6 + sal rbx, 3 + sub rbp, rbx + mov qword ptr[rbp], rax + + mov rax, 5 + +copyHeaderLoop: + sub rax, 1 + mov r10, qword ptr[r8 + rax * 8] + mov qword ptr[rbp + rax * 8 + 16], r10 + test rax, rax + jnz copyHeaderLoop + + mov ebx, dword ptr[r8 + 24] + sub rbx, 1 + mov r10d, dword ptr[r8 + 40] + sub r10, 1 + cmp rbx, r10 + je copyArgs + mov rax, 0ah + +fillExtraArgsLoop: + sub r10, 1 + mov qword ptr[rbp + r10 * 8 + 56], rax + cmp rbx, r10 + jne fillExtraArgsLoop + +copyArgs: + mov rax, qword ptr[r8 + 48] + +copyArgsLoop: + test rbx, rbx + jz copyArgsDone + sub rbx, 1 + mov r10, qword ptr[rax + rbx * 8] + mov qword ptr[rbp + rbx * 8 + 56], r10 + jmp copyArgsLoop + +copyArgsDone: + mov qword ptr[rdx], rbp + mov r14, 0FFFF000000000000h + mov r15, 0FFFF000000000002h + + mov rax, rcx + mov rcx, rbp + call rax + + cmp qword ptr[rbp + 16], 1 + je calleeFramePopped + mov rbp, qword ptr[rbp] + +calleeFramePopped: + mov rbx, qword ptr[rbp + 32] ; VM.topCallFrame + mov r10, qword ptr[rbp + 24] + mov qword ptr[rbx], r10 add rsp, 28h + pop rdi + pop rsi pop rbx pop r15 pop r14 @@ -75,11 +229,24 @@ ctiOpThrowNotCaught PROC pop r12 pop rbp ret -ctiOpThrowNotCaught ENDP +callToNativeFunction ENDP +returnFromJavaScript PROC + add rsp, 28h + pop rdi + pop rsi + pop rbx + pop r15 + pop r14 + pop r13 + pop r12 + pop rbp + ret +returnFromJavaScript ENDP + getHostCallReturnValue PROC - sub r13, 40 - mov r13, rdi + mov rbp, [rbp] ; CallFrame + mov rcx, rbp ; rcx is first argument register on Windows jmp getHostCallReturnValueWithExecState getHostCallReturnValue ENDP diff --git a/JavaScriptCore/jit/JITStubsSH4.h b/JavaScriptCore/jit/JITStubsSH4.h deleted file mode 100644 index 40d883d4..00000000 --- a/JavaScriptCore/jit/JITStubsSH4.h +++ /dev/null @@ -1,125 +0,0 @@ -/* - * Copyright (C) 2008, 2009, 2013 Apple Inc. All rights reserved. - * Copyright (C) 2008 Cameron Zwarich - * Copyright (C) Research In Motion Limited 2010, 2011. 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. - * 3. Neither the name of Apple Computer, Inc. ("Apple") nor the names of - * its contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY APPLE 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 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. - */ - -#ifndef JITStubsSH4_h -#define JITStubsSH4_h - -#if !CPU(SH4) -#error "JITStubsSH4.h should only be #included if CPU(SH4)" -#endif - -#if !USE(JSVALUE32_64) -#error "JITStubsSH4.h only implements USE(JSVALUE32_64)" -#endif - -namespace JSC { - -#define THUNK_RETURN_ADDRESS_OFFSET 56 -#define SAVED_R8_OFFSET 60 - -#define SYMBOL_STRING(name) #name -/* code (r4), JSStack* (r5), CallFrame* (r6), void* unused1 (r7), void* unused2(sp), VM (sp)*/ - -asm volatile ( -".text\n" -".globl " SYMBOL_STRING(ctiTrampoline) "\n" -HIDE_SYMBOL(ctiTrampoline) "\n" -SYMBOL_STRING(ctiTrampoline) ":" "\n" - "mov.l r7, @-r15" "\n" - "mov.l r6, @-r15" "\n" - "mov.l r5, @-r15" "\n" - "mov.l r14, @-r15" "\n" - "sts.l pr, @-r15" "\n" - "mov.l r13, @-r15" "\n" - "mov.l r11, @-r15" "\n" - "mov.l r10, @-r15" "\n" - "mov.l r9, @-r15" "\n" - "mov.l r8, @-r15" "\n" - "add #-" STRINGIZE_VALUE_OF(SAVED_R8_OFFSET) ", r15" "\n" - "mov r6, r14" "\n" - "jsr @r4" "\n" - "nop" "\n" - "add #" STRINGIZE_VALUE_OF(SAVED_R8_OFFSET) ", r15" "\n" - "mov.l @r15+,r8" "\n" - "mov.l @r15+,r9" "\n" - "mov.l @r15+,r10" "\n" - "mov.l @r15+,r11" "\n" - "mov.l @r15+,r13" "\n" - "lds.l @r15+,pr" "\n" - "mov.l @r15+,r14" "\n" - "add #12, r15" "\n" - "rts" "\n" - "nop" "\n" -); - -asm volatile ( -".globl " SYMBOL_STRING(ctiOpThrowNotCaught) "\n" -HIDE_SYMBOL(ctiOpThrowNotCaught) "\n" -SYMBOL_STRING(ctiOpThrowNotCaught) ":" "\n" - "add #" STRINGIZE_VALUE_OF(SAVED_R8_OFFSET) ", r15" "\n" - "mov.l @r15+,r8" "\n" - "mov.l @r15+,r9" "\n" - "mov.l @r15+,r10" "\n" - "mov.l @r15+,r11" "\n" - "mov.l @r15+,r13" "\n" - "lds.l @r15+,pr" "\n" - "mov.l @r15+,r14" "\n" - "add #12, r15" "\n" - "rts" "\n" - "nop" "\n" -); - - -#define DEFINE_STUB_FUNCTION(rtype, op) \ - extern "C" { \ - rtype JITStubThunked_##op(STUB_ARGS_DECLARATION); \ - }; \ - asm volatile( \ - ".align 2" "\n" \ - ".globl " SYMBOL_STRING(cti_##op) "\n" \ - SYMBOL_STRING(cti_##op) ":" "\n" \ - "sts pr, r11" "\n" \ - "mov.l r11, @(" STRINGIZE_VALUE_OF(THUNK_RETURN_ADDRESS_OFFSET) ", r15)" "\n" \ - "mov.l .L2" SYMBOL_STRING(JITStubThunked_##op) ",r0" "\n" \ - "mov.l @(r0,r12),r11" "\n" \ - "jsr @r11" "\n" \ - "nop" "\n" \ - "mov.l @(" STRINGIZE_VALUE_OF(THUNK_RETURN_ADDRESS_OFFSET) ", r15), r11 " "\n" \ - "lds r11, pr " "\n" \ - "rts" "\n" \ - "nop" "\n" \ - ".align 2" "\n" \ - ".L2" SYMBOL_STRING(JITStubThunked_##op) ":.long " SYMBOL_STRING(JITStubThunked_##op) "@GOT \n" \ - ); \ - rtype JITStubThunked_##op(STUB_ARGS_DECLARATION) - -} // namespace JSC - -#endif // JITStubsSH4_h diff --git a/JavaScriptCore/jit/JITStubsX86.h b/JavaScriptCore/jit/JITStubsX86.h index 4180c4d6..a1fbdef2 100644 --- a/JavaScriptCore/jit/JITStubsX86.h +++ b/JavaScriptCore/jit/JITStubsX86.h @@ -45,45 +45,6 @@ namespace JSC { #if COMPILER(GCC) -asm ( -".text\n" -".globl " SYMBOL_STRING(ctiTrampoline) "\n" -HIDE_SYMBOL(ctiTrampoline) "\n" -SYMBOL_STRING(ctiTrampoline) ":" "\n" - "pushl %ebp" "\n" - "movl %esp, %ebp" "\n" - "pushl %esi" "\n" - "pushl %edi" "\n" - "pushl %ebx" "\n" - - // JIT Operation can use up to 6 arguments right now. So, we need to - // reserve space in this stack frame for the out-going args. To ensure that - // the stack remains aligned on an 16 byte boundary, we round the padding up - // by 0x1c bytes. - "subl $0x1c, %esp" "\n" - "movl 0x38(%esp), %edi" "\n" - "call *0x30(%esp)" "\n" - "addl $0x1c, %esp" "\n" - - "popl %ebx" "\n" - "popl %edi" "\n" - "popl %esi" "\n" - "popl %ebp" "\n" - "ret" "\n" -); - -asm ( -".globl " SYMBOL_STRING(ctiOpThrowNotCaught) "\n" -HIDE_SYMBOL(ctiOpThrowNotCaught) "\n" -SYMBOL_STRING(ctiOpThrowNotCaught) ":" "\n" - "addl $0x1c, %esp" "\n" - "popl %ebx" "\n" - "popl %edi" "\n" - "popl %esi" "\n" - "popl %ebp" "\n" - "ret" "\n" -); - #if USE(MASM_PROBE) asm ( ".globl " SYMBOL_STRING(ctiMasmProbeTrampoline) "\n" @@ -243,18 +204,99 @@ SYMBOL_STRING(ctiMasmProbeTrampolineEnd) ":" "\n" extern "C" { - __declspec(naked) EncodedJSValue ctiTrampoline(void* code, JSStack*, CallFrame*, void* /*unused1*/, void* /*unused2*/, VM*) + // FIXME: Since Windows doesn't use the LLInt, we have inline stubs here. + // Until the LLInt is changed to support Windows, these stub needs to be updated. + __declspec(naked) EncodedJSValue callToJavaScript(void* code, ExecState**, ProtoCallFrame*, Register*) { __asm { + mov edx, [esp] push ebp; + mov eax, ebp; mov ebp, esp; push esi; push edi; push ebx; sub esp, 0x1c; - mov ecx, esp; - mov edi, [esp + 0x38]; - call [esp + 0x30]; + mov ecx, dword ptr[esp + 0x34]; + mov esi, dword ptr[esp + 0x38]; + mov ebp, dword ptr[esp + 0x3c]; + sub ebp, 0x20; + mov dword ptr[ebp + 0x24], 0; + mov dword ptr[ebp + 0x20], 0; + mov dword ptr[ebp + 0x1c], 0; + mov dword ptr[ebp + 0x18], ecx; + mov ebx, [ecx]; + mov dword ptr[ebp + 0x14], 0; + mov dword ptr[ebp + 0x10], ebx; + mov dword ptr[ebp + 0xc], 0; + mov dword ptr[ebp + 0x8], 1; + mov dword ptr[ebp + 0x4], edx; + mov dword ptr[ebp], eax; + mov eax, ebp; + + mov edx, dword ptr[esi + 0x28]; + add edx, 5; + sal edx, 3; + sub ebp, edx; + mov dword ptr[ebp], eax; + + mov eax, 5; + + copyHeaderLoop: + sub eax, 1; + mov ecx, dword ptr[esi + eax * 8]; + mov dword ptr 8[ebp + eax * 8], ecx; + mov ecx, dword ptr 4[esi + eax * 8]; + mov dword ptr 12[ebp + eax * 8], ecx; + test eax, eax; + jnz copyHeaderLoop; + + mov edx, dword ptr[esi + 0x18]; + sub edx, 1; + mov ecx, dword ptr[esi + 0x28]; + sub ecx, 1; + + cmp edx, ecx; + je copyArgs; + + xor eax, eax; + mov ebx, -4; + + fillExtraArgsLoop: + sub ecx, 1; + mov dword ptr 0x30[ebp + ecx * 8], eax; + mov dword ptr 0x34[ebp + ecx * 8], ebx; + cmp edx, ecx; + jne fillExtraArgsLoop; + + copyArgs: + mov eax, dword ptr[esi + 0x2c]; + + copyArgsLoop: + test edx, edx; + jz copyArgsDone; + sub edx, 1; + mov ecx, dword ptr 0[eax + edx * 8]; + mov ebx, dword ptr 4[eax + edx * 8]; + mov dword ptr 0x30[ebp + edx * 8], ecx; + mov dword ptr 0x34[ebp + edx * 8], ebx; + jmp copyArgsLoop; + + copyArgsDone: + mov ecx, dword ptr[esp + 0x34]; + mov dword ptr[ecx], ebp; + + call dword ptr[esp + 0x30]; + + cmp dword ptr[ebp + 8], 1; + je calleeFramePopped; + mov ebp, dword ptr[ebp]; + + calleeFramePopped: + mov ecx, dword ptr[ebp + 0x18]; + mov ebx, dword ptr[ebp + 0x10]; + mov dword ptr[ecx], ebx; + add esp, 0x1c; pop ebx; pop edi; @@ -264,7 +306,7 @@ extern "C" { } } - __declspec(naked) void ctiOpThrowNotCaught() + __declspec(naked) void returnFromJavaScript() { __asm { add esp, 0x1c; @@ -275,6 +317,109 @@ extern "C" { ret; } } + + __declspec(naked) EncodedJSValue callToNativeFunction(void* code, ExecState**, ProtoCallFrame*, Register*) + { + __asm { + mov edx, [esp] + push ebp; + mov eax, ebp; + mov ebp, esp; + push esi; + push edi; + push ebx; + sub esp, 0x1c; + mov ecx, [esp + 0x34]; + mov esi, [esp + 0x38]; + mov ebp, [esp + 0x3c]; + sub ebp, 0x20; + mov dword ptr[ebp + 0x24], 0; + mov dword ptr[ebp + 0x20], 0; + mov dword ptr[ebp + 0x1c], 0; + mov dword ptr[ebp + 0x18], ecx; + mov ebx, [ecx]; + mov dword ptr[ebp + 0x14], 0; + mov dword ptr[ebp + 0x10], ebx; + mov dword ptr[ebp + 0xc], 0; + mov dword ptr[ebp + 0x8], 1; + mov dword ptr[ebp + 0x4], edx; + mov dword ptr[ebp], eax; + mov eax, ebp; + + mov edx, dword ptr[esi + 0x28]; + add edx, 5; + sal edx, 3; + sub ebp, edx; + mov dword ptr[ebp], eax; + + mov eax, 5; + + copyHeaderLoop: + sub eax, 1; + mov ecx, dword ptr[esi + eax * 8]; + mov dword ptr 8[ebp + eax * 8], ecx; + mov ecx, dword ptr 4[esi + eax * 8]; + mov dword ptr 12[ebp + eax * 8], ecx; + test eax, eax; + jnz copyHeaderLoop; + + mov edx, dword ptr[esi + 0x18]; + sub edx, 1; + mov ecx, dword ptr[esi + 0x28]; + sub ecx, 1; + + cmp edx, ecx; + je copyArgs; + + xor eax, eax; + mov ebx, -4; + + fillExtraArgsLoop: + sub ecx, 1; + mov dword ptr 0x30[ebp + ecx * 8], eax; + mov dword ptr 0x34[ebp + ecx * 8], ebx; + cmp edx, ecx; + jne fillExtraArgsLoop; + + copyArgs: + mov eax, dword ptr[esi + 0x2c]; + + copyArgsLoop: + test edx, edx; + jz copyArgsDone; + sub edx, 1; + mov ecx, dword ptr 0[eax + edx * 8]; + mov ebx, dword ptr 4[eax + edx * 8]; + mov dword ptr 0x30[ebp + edx * 8], ecx; + mov dword ptr 0x34[ebp + edx * 8], ebx; + jmp copyArgsLoop; + + copyArgsDone: + mov ecx, dword ptr[esp + 0x34]; + mov dword ptr[ecx], ebp; + + mov edi, dword ptr[esp + 0x30]; + mov dword ptr[esp + 0x30], ebp; + mov ecx, ebp; + call edi; + + cmp dword ptr[ebp + 8], 1; + je calleeFramePopped; + mov ebp, dword ptr[ebp]; + + calleeFramePopped: + mov ecx, dword ptr[ebp + 0x18]; + mov ebx, dword ptr[ebp + 0x10]; + mov dword ptr[ecx], ebx; + + add esp, 0x1c; + pop ebx; + pop edi; + pop esi; + pop ebp; + ret; + } + } } #endif // COMPILER(MSVC) diff --git a/JavaScriptCore/jit/JITStubsX86_64.h b/JavaScriptCore/jit/JITStubsX86_64.h index 68d80f0e..f2ed206a 100644 --- a/JavaScriptCore/jit/JITStubsX86_64.h +++ b/JavaScriptCore/jit/JITStubsX86_64.h @@ -45,52 +45,6 @@ namespace JSC { #if COMPILER(GCC) -asm ( -".text\n" -".globl " SYMBOL_STRING(ctiTrampoline) "\n" -HIDE_SYMBOL(ctiTrampoline) "\n" -SYMBOL_STRING(ctiTrampoline) ":" "\n" - "pushq %rbp" "\n" - "movq %rsp, %rbp" "\n" - "pushq %r12" "\n" - "pushq %r13" "\n" - "pushq %r14" "\n" - "pushq %r15" "\n" - "pushq %rbx" "\n" - - // The X86_64 ABI specifies that the worse case stack alignment requirement - // is 32 bytes. - "subq $0x8, %rsp" "\n" - - "movq $512, %r12" "\n" - "movq $0xFFFF000000000000, %r14" "\n" - "movq $0xFFFF000000000002, %r15" "\n" - "movq %rdx, %r13" "\n" - "call *%rdi" "\n" - "addq $0x8, %rsp" "\n" - "popq %rbx" "\n" - "popq %r15" "\n" - "popq %r14" "\n" - "popq %r13" "\n" - "popq %r12" "\n" - "popq %rbp" "\n" - "ret" "\n" -); - -asm ( -".globl " SYMBOL_STRING(ctiOpThrowNotCaught) "\n" -HIDE_SYMBOL(ctiOpThrowNotCaught) "\n" -SYMBOL_STRING(ctiOpThrowNotCaught) ":" "\n" - "addq $0x8, %rsp" "\n" - "popq %rbx" "\n" - "popq %r15" "\n" - "popq %r14" "\n" - "popq %r13" "\n" - "popq %r12" "\n" - "popq %rbp" "\n" - "ret" "\n" -); - #if USE(MASM_PROBE) asm ( ".globl " SYMBOL_STRING(ctiMasmProbeTrampoline) "\n" diff --git a/JavaScriptCore/jit/JSInterfaceJIT.h b/JavaScriptCore/jit/JSInterfaceJIT.h index f39f3446..ac1ab796 100644 --- a/JavaScriptCore/jit/JSInterfaceJIT.h +++ b/JavaScriptCore/jit/JSInterfaceJIT.h @@ -28,6 +28,8 @@ #include "BytecodeConventions.h" #include "CCallHelpers.h" +#include "FPRInfo.h" +#include "GPRInfo.h" #include "JITCode.h" #include "JITOperations.h" #include "JITStubs.h" @@ -40,178 +42,12 @@ #if ENABLE(JIT) namespace JSC { - class JSInterfaceJIT : public CCallHelpers { + class JSInterfaceJIT : public CCallHelpers, public GPRInfo, public FPRInfo { public: JSInterfaceJIT(VM* vm, CodeBlock* codeBlock = 0) : CCallHelpers(vm, codeBlock) { } - - // NOTES: - // - // regT0 has two special meanings. The return value from a stub - // call will always be in regT0, and by default (unless - // a register is specified) emitPutVirtualRegister() will store - // the value from regT0. - // - // regT3 is required to be callee-preserved. - // - // tempRegister2 is has no such dependencies. It is important that - // on x86/x86-64 it is ecx for performance reasons, since the - // MacroAssembler will need to plant register swaps if it is not - - // however the code will still function correctly. -#if CPU(X86_64) - static const RegisterID returnValueRegister = X86Registers::eax; - static const RegisterID returnValue2Register = X86Registers::edx; - static const RegisterID cachedResultRegister = X86Registers::eax; -#if !OS(WINDOWS) - static const RegisterID firstArgumentRegister = X86Registers::edi; - static const RegisterID secondArgumentRegister = X86Registers::esi; -#else - static const RegisterID firstArgumentRegister = X86Registers::ecx; - static const RegisterID secondArgumentRegister = X86Registers::edx; - static const RegisterID thirdArgumentRegister = X86Registers::r8; -#endif - - static const RegisterID callFrameRegister = X86Registers::r13; - static const RegisterID tagTypeNumberRegister = X86Registers::r14; - static const RegisterID tagMaskRegister = X86Registers::r15; - - static const RegisterID regT0 = X86Registers::eax; - static const RegisterID regT1 = X86Registers::edx; - static const RegisterID regT2 = X86Registers::ecx; - static const RegisterID regT3 = X86Registers::ebx; - static const RegisterID regT4 = X86Registers::r10; - - static const FPRegisterID fpRegT0 = X86Registers::xmm0; - static const FPRegisterID fpRegT1 = X86Registers::xmm1; - static const FPRegisterID fpRegT2 = X86Registers::xmm2; - static const FPRegisterID fpRegT3 = X86Registers::xmm3; - - static const RegisterID nonArgGPR1 = X86Registers::eax; // regT0 -#elif CPU(X86) - static const RegisterID returnValueRegister = X86Registers::eax; - static const RegisterID returnValue2Register = X86Registers::edx; - static const RegisterID cachedResultRegister = X86Registers::eax; - // On x86 we always use fastcall conventions = but on - // OS X if might make more sense to just use regparm. - static const RegisterID firstArgumentRegister = X86Registers::ecx; - static const RegisterID secondArgumentRegister = X86Registers::edx; - - static const RegisterID callFrameRegister = X86Registers::edi; - - static const RegisterID regT0 = X86Registers::eax; - static const RegisterID regT1 = X86Registers::edx; - static const RegisterID regT2 = X86Registers::ecx; - static const RegisterID regT3 = X86Registers::ebx; - static const RegisterID regT4 = X86Registers::esi; - - static const FPRegisterID fpRegT0 = X86Registers::xmm0; - static const FPRegisterID fpRegT1 = X86Registers::xmm1; - static const FPRegisterID fpRegT2 = X86Registers::xmm2; - static const FPRegisterID fpRegT3 = X86Registers::xmm3; -#elif CPU(ARM) - static const RegisterID returnValueRegister = ARMRegisters::r0; - static const RegisterID returnValue2Register = ARMRegisters::r1; - static const RegisterID cachedResultRegister = ARMRegisters::r0; - static const RegisterID firstArgumentRegister = ARMRegisters::r0; - static const RegisterID secondArgumentRegister = ARMRegisters::r1; - - static const RegisterID regT0 = ARMRegisters::r0; - static const RegisterID regT1 = ARMRegisters::r1; - static const RegisterID regT2 = ARMRegisters::r2; - static const RegisterID regT3 = ARMRegisters::r4; - static const RegisterID regT4 = ARMRegisters::r7; - static const RegisterID regT5 = ARMRegisters::r8; - - // Update ctiTrampoline in JITStubs.cpp if these values are changed! - static const RegisterID callFrameRegister = ARMRegisters::r5; - - static const FPRegisterID fpRegT0 = ARMRegisters::d0; - static const FPRegisterID fpRegT1 = ARMRegisters::d1; - static const FPRegisterID fpRegT2 = ARMRegisters::d2; - static const FPRegisterID fpRegT3 = ARMRegisters::d3; -#elif CPU(ARM64) - static const RegisterID returnValueRegister = ARM64Registers::x0; - static const RegisterID cachedResultRegister = ARM64Registers::x0; - static const RegisterID firstArgumentRegister = ARM64Registers::x0; - static const RegisterID secondArgumentRegister = ARM64Registers::x1; - -#if ENABLE(VALUE_PROFILER) - static const RegisterID bucketCounterRegister = ARM64Registers::x7; -#endif - - static const RegisterID regT0 = ARM64Registers::x0; - static const RegisterID regT1 = ARM64Registers::x1; - static const RegisterID regT2 = ARM64Registers::x2; - static const RegisterID regT3 = ARM64Registers::x23; - static const RegisterID regT4 = ARM64Registers::x24; - - static const RegisterID callFrameRegister = ARM64Registers::x25; - static const RegisterID timeoutCheckRegister = ARM64Registers::x26; - static const RegisterID tagTypeNumberRegister = ARM64Registers::x27; - static const RegisterID tagMaskRegister = ARM64Registers::x28; - - static const FPRegisterID fpRegT0 = ARM64Registers::q0; - static const FPRegisterID fpRegT1 = ARM64Registers::q1; - static const FPRegisterID fpRegT2 = ARM64Registers::q2; - static const FPRegisterID fpRegT3 = ARM64Registers::q3; - - static const RegisterID nonArgGPR1 = ARM64Registers::x9; -#elif CPU(MIPS) - static const RegisterID returnValueRegister = MIPSRegisters::v0; - static const RegisterID returnValue2Register = MIPSRegisters::v1; - static const RegisterID cachedResultRegister = MIPSRegisters::v0; - static const RegisterID firstArgumentRegister = MIPSRegisters::a0; - static const RegisterID secondArgumentRegister = MIPSRegisters::a1; - - // regT0 must be v0 for returning a 32-bit value. - static const RegisterID regT0 = MIPSRegisters::v0; - - // regT1 must be v1 for returning a pair of 32-bit value. - static const RegisterID regT1 = MIPSRegisters::v1; - - static const RegisterID regT2 = MIPSRegisters::t4; - - // regT3 must be saved in the callee, so use an S register. - static const RegisterID regT3 = MIPSRegisters::s2; - - static const RegisterID regT4 = MIPSRegisters::s3; - static const RegisterID regT5 = MIPSRegisters::s4; - - static const RegisterID callFrameRegister = MIPSRegisters::s0; - - static const FPRegisterID fpRegT0 = MIPSRegisters::f4; - static const FPRegisterID fpRegT1 = MIPSRegisters::f6; - static const FPRegisterID fpRegT2 = MIPSRegisters::f8; - static const FPRegisterID fpRegT3 = MIPSRegisters::f10; -#elif CPU(SH4) - static const RegisterID callFrameRegister = SH4Registers::fp; - - static const RegisterID regT0 = SH4Registers::r0; - static const RegisterID regT1 = SH4Registers::r1; - static const RegisterID regT2 = SH4Registers::r2; - static const RegisterID regT3 = SH4Registers::r10; - static const RegisterID regT4 = SH4Registers::r4; - static const RegisterID regT5 = SH4Registers::r5; - static const RegisterID regT6 = SH4Registers::r6; - static const RegisterID regT7 = SH4Registers::r7; - static const RegisterID firstArgumentRegister = regT4; - static const RegisterID secondArgumentRegister = regT5; - - static const RegisterID returnValueRegister = SH4Registers::r0; - static const RegisterID returnValue2Register = SH4Registers::r1; - static const RegisterID cachedResultRegister = SH4Registers::r0; - - static const FPRegisterID fpRegT0 = SH4Registers::dr0; - static const FPRegisterID fpRegT1 = SH4Registers::dr2; - static const FPRegisterID fpRegT2 = SH4Registers::dr4; - static const FPRegisterID fpRegT3 = SH4Registers::dr6; - static const FPRegisterID fpRegT4 = SH4Registers::dr8; - static const FPRegisterID fpRegT5 = SH4Registers::dr10; -#else -#error "JIT not supported on this platform." -#endif #if USE(JSVALUE32_64) // Can't just propogate JSValue::Int32Tag as visual studio doesn't like it diff --git a/JavaScriptCore/jit/RegisterSet.cpp b/JavaScriptCore/jit/RegisterSet.cpp index 6fc2fbab..362ada0d 100644 --- a/JavaScriptCore/jit/RegisterSet.cpp +++ b/JavaScriptCore/jit/RegisterSet.cpp @@ -59,7 +59,6 @@ RegisterSet RegisterSet::calleeSaveRegisters() #if CPU(X86_64) result.set(X86Registers::ebx); result.set(X86Registers::ebp); - result.set(X86Registers::r10); result.set(X86Registers::r12); result.set(X86Registers::r13); result.set(X86Registers::r14); diff --git a/JavaScriptCore/jit/RegisterSet.h b/JavaScriptCore/jit/RegisterSet.h index a1304a9d..84ad226a 100644 --- a/JavaScriptCore/jit/RegisterSet.h +++ b/JavaScriptCore/jit/RegisterSet.h @@ -81,6 +81,7 @@ class RegisterSet { bool get(FPRReg reg) const { return m_vector.get(MacroAssembler::registerIndex(reg)); } void merge(const RegisterSet& other) { m_vector.merge(other.m_vector); } + void filter(const RegisterSet& other) { m_vector.filter(other.m_vector); } void exclude(const RegisterSet& other) { m_vector.exclude(other.m_vector); } size_t numberOfSetRegisters() const { return m_vector.bitCount(); } diff --git a/JavaScriptCore/jit/Repatch.cpp b/JavaScriptCore/jit/Repatch.cpp index bbf90ac6..5c9aa965 100644 --- a/JavaScriptCore/jit/Repatch.cpp +++ b/JavaScriptCore/jit/Repatch.cpp @@ -30,13 +30,18 @@ #include "CCallHelpers.h" #include "CallFrameInlines.h" +#include "DFGOperations.h" +#include "DFGSpeculativeJIT.h" +#include "FTLThunks.h" #include "GCAwareJITStubRoutine.h" #include "LinkBuffer.h" #include "Operations.h" #include "PolymorphicPutByIdList.h" #include "RepatchBuffer.h" #include "ScratchRegisterAllocator.h" +#include "StackAlignment.h" #include "StructureRareDataInlines.h" +#include "StructureStubClearingWatchpoint.h" #include "ThunkGenerators.h" #include @@ -52,18 +57,56 @@ namespace JSC { // give the FTL closure call patching support until we switch to the C stack - but when we do that, // callFrameRegister will disappear. +static FunctionPtr readCallTarget(RepatchBuffer& repatchBuffer, CodeLocationCall call) +{ + FunctionPtr result = MacroAssembler::readCallTarget(call); +#if ENABLE(FTL_JIT) + CodeBlock* codeBlock = repatchBuffer.codeBlock(); + if (codeBlock->jitType() == JITCode::FTLJIT) { + return FunctionPtr(codeBlock->vm()->ftlThunks->keyForSlowPathCallThunk( + MacroAssemblerCodePtr::createFromExecutableAddress( + result.executableAddress())).callTarget()); + } +#else + UNUSED_PARAM(repatchBuffer); +#endif // ENABLE(FTL_JIT) + return result; +} + +static void repatchCall(RepatchBuffer& repatchBuffer, CodeLocationCall call, FunctionPtr newCalleeFunction) +{ +#if ENABLE(FTL_JIT) + CodeBlock* codeBlock = repatchBuffer.codeBlock(); + if (codeBlock->jitType() == JITCode::FTLJIT) { + VM& vm = *codeBlock->vm(); + FTL::Thunks& thunks = *vm.ftlThunks; + FTL::SlowPathCallKey key = thunks.keyForSlowPathCallThunk( + MacroAssemblerCodePtr::createFromExecutableAddress( + MacroAssembler::readCallTarget(call).executableAddress())); + key = key.withCallTarget(newCalleeFunction.executableAddress()); + newCalleeFunction = FunctionPtr( + thunks.getSlowPathCallThunk(vm, key).code().executableAddress()); + } +#endif // ENABLE(FTL_JIT) + repatchBuffer.relink(call, newCalleeFunction); +} + static void repatchCall(CodeBlock* codeblock, CodeLocationCall call, FunctionPtr newCalleeFunction) { RepatchBuffer repatchBuffer(codeblock); - repatchBuffer.relink(call, newCalleeFunction); + repatchCall(repatchBuffer, call, newCalleeFunction); } -static void repatchByIdSelfAccess(CodeBlock* codeBlock, StructureStubInfo& stubInfo, Structure* structure, PropertyOffset offset, const FunctionPtr &slowPathFunction, bool compact) +static void repatchByIdSelfAccess(VM& vm, CodeBlock* codeBlock, StructureStubInfo& stubInfo, Structure* structure, const Identifier& propertyName, PropertyOffset offset, + const FunctionPtr &slowPathFunction, bool compact) { + if (structure->typeInfo().newImpurePropertyFiresWatchpoints()) + vm.registerWatchpointForImpureProperty(propertyName, stubInfo.addWatchpoint(codeBlock)); + RepatchBuffer repatchBuffer(codeBlock); // Only optimize once! - repatchBuffer.relink(stubInfo.callReturnLocation, slowPathFunction); + repatchCall(repatchBuffer, stubInfo.callReturnLocation, slowPathFunction); // Patch the structure check & the offset of the load. repatchBuffer.repatch(stubInfo.callReturnLocation.dataLabelPtrAtOffset(-(intptr_t)stubInfo.patch.deltaCheckImmToCall), structure); @@ -139,7 +182,7 @@ static void replaceWithJump(RepatchBuffer& repatchBuffer, StructureStubInfo& stu repatchBuffer.relink( stubInfo.callReturnLocation.jumpAtOffset( - stubInfo.patch.deltaCallToStructCheck), + stubInfo.patch.deltaCallToJump), CodeLocationLabel(target)); } @@ -180,21 +223,27 @@ static void linkRestoreScratch(LinkBuffer& patchBuffer, bool needToRestoreScratc linkRestoreScratch(patchBuffer, needToRestoreScratch, success, fail, failureCases, stubInfo.callReturnLocation.labelAtOffset(stubInfo.patch.deltaCallToDone), stubInfo.callReturnLocation.labelAtOffset(stubInfo.patch.deltaCallToSlowCase)); } -static void generateProtoChainAccessStub(ExecState* exec, StructureStubInfo& stubInfo, StructureChain* chain, size_t count, PropertyOffset offset, Structure* structure, CodeLocationLabel successLabel, CodeLocationLabel slowCaseLabel, RefPtr& stubRoutine) +enum ProtoChainGenerationResult { + ProtoChainGenerationFailed, + ProtoChainGenerationSucceeded +}; + +static ProtoChainGenerationResult generateProtoChainAccessStub(ExecState*, const PropertySlot&, const Identifier&, StructureStubInfo&, StructureChain*, size_t, PropertyOffset, Structure*, CodeLocationLabel, CodeLocationLabel, RefPtr&) WARN_UNUSED_RETURN; +static ProtoChainGenerationResult generateProtoChainAccessStub(ExecState* exec, const PropertySlot& slot, const Identifier& propertyName, StructureStubInfo& stubInfo, StructureChain* chain, size_t count, PropertyOffset offset, Structure* structure, CodeLocationLabel successLabel, CodeLocationLabel slowCaseLabel, RefPtr& stubRoutine) { VM* vm = &exec->vm(); - - MacroAssembler stubJit; - GPRReg baseGPR = static_cast(stubInfo.patch.baseGPR); #if USE(JSVALUE32_64) GPRReg resultTagGPR = static_cast(stubInfo.patch.valueTagGPR); #endif GPRReg resultGPR = static_cast(stubInfo.patch.valueGPR); GPRReg scratchGPR = TempRegisterSet(stubInfo.patch.usedRegisters).getFreeGPR(); - bool needToRestoreScratch = false; + bool needToRestoreScratch = scratchGPR == InvalidGPRReg; + if (needToRestoreScratch && !slot.isCacheableValue()) + return ProtoChainGenerationFailed; - if (scratchGPR == InvalidGPRReg) { + CCallHelpers stubJit(&exec->vm(), exec->codeBlock()); + if (needToRestoreScratch) { #if USE(JSVALUE64) scratchGPR = AssemblyHelpers::selectScratchGPR(baseGPR, resultGPR); #else @@ -207,48 +256,105 @@ static void generateProtoChainAccessStub(ExecState* exec, StructureStubInfo& stu MacroAssembler::JumpList failureCases; failureCases.append(stubJit.branchPtr(MacroAssembler::NotEqual, MacroAssembler::Address(baseGPR, JSCell::structureOffset()), MacroAssembler::TrustedImmPtr(structure))); - + + CodeBlock* codeBlock = exec->codeBlock(); + if (structure->typeInfo().newImpurePropertyFiresWatchpoints()) + vm->registerWatchpointForImpureProperty(propertyName, stubInfo.addWatchpoint(codeBlock)); + Structure* currStructure = structure; WriteBarrier* it = chain->head(); JSObject* protoObject = 0; for (unsigned i = 0; i < count; ++i, ++it) { protoObject = asObject(currStructure->prototypeForLookup(exec)); + Structure* protoStructure = protoObject->structure(); + if (protoStructure->typeInfo().newImpurePropertyFiresWatchpoints()) + vm->registerWatchpointForImpureProperty(propertyName, stubInfo.addWatchpoint(codeBlock)); addStructureTransitionCheck( - protoObject, protoObject->structure(), exec->codeBlock(), stubInfo, stubJit, + protoObject, protoStructure, codeBlock, stubInfo, stubJit, failureCases, scratchGPR); currStructure = it->get(); } - if (isInlineOffset(offset)) { + bool isAccessor = slot.isCacheableGetter() || slot.isCacheableCustom(); + if (isAccessor) + stubJit.move(baseGPR, scratchGPR); + + if (!slot.isCacheableCustom()) { + if (isInlineOffset(offset)) { #if USE(JSVALUE64) - stubJit.load64(protoObject->locationForOffset(offset), resultGPR); + stubJit.load64(protoObject->locationForOffset(offset), resultGPR); #elif USE(JSVALUE32_64) - stubJit.move(MacroAssembler::TrustedImmPtr(protoObject->locationForOffset(offset)), resultGPR); - stubJit.load32(MacroAssembler::Address(resultGPR, OBJECT_OFFSETOF(EncodedValueDescriptor, asBits.tag)), resultTagGPR); - stubJit.load32(MacroAssembler::Address(resultGPR, OBJECT_OFFSETOF(EncodedValueDescriptor, asBits.payload)), resultGPR); + stubJit.move(MacroAssembler::TrustedImmPtr(protoObject->locationForOffset(offset)), resultGPR); + stubJit.load32(MacroAssembler::Address(resultGPR, OBJECT_OFFSETOF(EncodedValueDescriptor, asBits.tag)), resultTagGPR); + stubJit.load32(MacroAssembler::Address(resultGPR, OBJECT_OFFSETOF(EncodedValueDescriptor, asBits.payload)), resultGPR); #endif - } else { - stubJit.loadPtr(protoObject->butterflyAddress(), resultGPR); + } else { + stubJit.loadPtr(protoObject->butterflyAddress(), resultGPR); #if USE(JSVALUE64) - stubJit.load64(MacroAssembler::Address(resultGPR, offsetInButterfly(offset) * sizeof(WriteBarrier)), resultGPR); + stubJit.load64(MacroAssembler::Address(resultGPR, offsetInButterfly(offset) * sizeof(WriteBarrier)), resultGPR); #elif USE(JSVALUE32_64) - stubJit.load32(MacroAssembler::Address(resultGPR, offsetInButterfly(offset) * sizeof(WriteBarrier) + OBJECT_OFFSETOF(EncodedValueDescriptor, asBits.tag)), resultTagGPR); - stubJit.load32(MacroAssembler::Address(resultGPR, offsetInButterfly(offset) * sizeof(WriteBarrier) + OBJECT_OFFSETOF(EncodedValueDescriptor, asBits.payload)), resultGPR); + stubJit.load32(MacroAssembler::Address(resultGPR, offsetInButterfly(offset) * sizeof(WriteBarrier) + OBJECT_OFFSETOF(EncodedValueDescriptor, asBits.tag)), resultTagGPR); + stubJit.load32(MacroAssembler::Address(resultGPR, offsetInButterfly(offset) * sizeof(WriteBarrier) + OBJECT_OFFSETOF(EncodedValueDescriptor, asBits.payload)), resultGPR); #endif + } } - + MacroAssembler::Call operationCall; + MacroAssembler::Call handlerCall; + FunctionPtr operationFunction; MacroAssembler::Jump success, fail; - + if (isAccessor) { + GPRReg callFrameRegister = static_cast(stubInfo.patch.callFrameRegister); + if (slot.isCacheableGetter()) { + stubJit.setupArguments(callFrameRegister, scratchGPR, resultGPR); + operationFunction = operationCallGetter; + } else { +#if USE(JSVALUE64) + // EncodedJSValue (*GetValueFunc)(ExecState*, EncodedJSValue slotBase, EncodedJSValue thisValue, PropertyName); + stubJit.setupArguments(callFrameRegister, MacroAssembler::TrustedImmPtr(protoObject), scratchGPR, MacroAssembler::TrustedImmPtr(propertyName.impl())); + operationFunction = FunctionPtr(slot.customGetter()); +#else + stubJit.move(MacroAssembler::TrustedImmPtr(protoObject), scratchGPR); + stubJit.setupArguments(callFrameRegister, scratchGPR, + MacroAssembler::TrustedImmPtr(FunctionPtr(slot.customGetter()).executableAddress()), + MacroAssembler::TrustedImmPtr(propertyName.impl())); + operationFunction = operationCallCustomGetter; +#endif + } + + // Need to make sure that whenever this call is made in the future, we remember the + // place that we made it from. It just so happens to be the place that we are at + // right now! + stubJit.store32(MacroAssembler::TrustedImm32(exec->locationAsRawBits()), + CCallHelpers::tagFor(static_cast(JSStack::ArgumentCount))); + + operationCall = stubJit.call(); +#if USE(JSVALUE64) + stubJit.move(GPRInfo::returnValueGPR, resultGPR); +#else + stubJit.setupResults(resultGPR, resultTagGPR); +#endif + MacroAssembler::Jump noException = stubJit.emitExceptionCheck(CCallHelpers::InvertedExceptionCheck); + + stubJit.setupArgumentsExecState(); + handlerCall = stubJit.call(); + stubJit.jumpToExceptionHandler(); + + noException.link(&stubJit); + } emitRestoreScratch(stubJit, needToRestoreScratch, scratchGPR, success, fail, failureCases); LinkBuffer patchBuffer(*vm, &stubJit, exec->codeBlock()); linkRestoreScratch(patchBuffer, needToRestoreScratch, success, fail, failureCases, successLabel, slowCaseLabel); - + if (isAccessor) { + patchBuffer.link(operationCall, operationFunction); + patchBuffer.link(handlerCall, lookupExceptionHandler); + } stubRoutine = FINALIZE_CODE_FOR_DFG_STUB( patchBuffer, ("DFG prototype chain access stub for %s, return point %p", toCString(*exec->codeBlock()).data(), successLabel.executableAddress())); + return ProtoChainGenerationSucceeded; } static bool tryCacheGetByID(ExecState* exec, JSValue baseValue, const Identifier& propertyName, const PropertySlot& slot, StructureStubInfo& stubInfo) @@ -314,7 +420,7 @@ static bool tryCacheGetByID(ExecState* exec, JSValue baseValue, const Identifier RepatchBuffer repatchBuffer(codeBlock); replaceWithJump(repatchBuffer, stubInfo, stubInfo.stubRoutine->code().code()); - repatchBuffer.relink(stubInfo.callReturnLocation, operationGetById); + repatchCall(repatchBuffer, stubInfo.callReturnLocation, operationGetById); return true; } @@ -339,17 +445,21 @@ static bool tryCacheGetByID(ExecState* exec, JSValue baseValue, const Identifier return true; } - repatchByIdSelfAccess(codeBlock, stubInfo, structure, slot.cachedOffset(), operationGetByIdBuildList, true); + repatchByIdSelfAccess(*vm, codeBlock, stubInfo, structure, propertyName, slot.cachedOffset(), operationGetByIdBuildList, true); stubInfo.initGetByIdSelf(*vm, codeBlock->ownerExecutable(), structure); return true; } if (structure->isDictionary()) return false; - - // FIXME: optimize getters and setters - if (!slot.isCacheableValue()) - return false; + + if (!stubInfo.patch.registersFlushed) { + // We cannot do as much inline caching if the registers were not flushed prior to this GetById. In particular, + // non-Value cached properties require planting calls, which requires registers to have been flushed. Thus, + // if registers were not flushed, don't do non-Value caching. + if (!slot.isCacheableValue()) + return false; + } PropertyOffset offset = slot.cachedOffset(); size_t count = normalizePrototypeChainForChainAccess(exec, baseValue, slot.slotBase(), propertyName, offset); @@ -357,14 +467,16 @@ static bool tryCacheGetByID(ExecState* exec, JSValue baseValue, const Identifier return false; StructureChain* prototypeChain = structure->prototypeChain(exec); - - generateProtoChainAccessStub(exec, stubInfo, prototypeChain, count, offset, structure, stubInfo.callReturnLocation.labelAtOffset(stubInfo.patch.deltaCallToDone), stubInfo.callReturnLocation.labelAtOffset(stubInfo.patch.deltaCallToSlowCase), stubInfo.stubRoutine); + if (generateProtoChainAccessStub(exec, slot, propertyName, stubInfo, prototypeChain, count, offset, + structure, stubInfo.callReturnLocation.labelAtOffset(stubInfo.patch.deltaCallToDone), + stubInfo.callReturnLocation.labelAtOffset(stubInfo.patch.deltaCallToSlowCase), stubInfo.stubRoutine) == ProtoChainGenerationFailed) + return false; RepatchBuffer repatchBuffer(codeBlock); replaceWithJump(repatchBuffer, stubInfo, stubInfo.stubRoutine->code().code()); - repatchBuffer.relink(stubInfo.callReturnLocation, operationGetByIdBuildList); + repatchCall(repatchBuffer, stubInfo.callReturnLocation, operationGetByIdBuildList); - stubInfo.initGetByIdChain(*vm, codeBlock->ownerExecutable(), structure, prototypeChain, count, true); + stubInfo.initGetByIdChain(*vm, codeBlock->ownerExecutable(), structure, prototypeChain, count, slot.isCacheableValue()); return true; } @@ -422,7 +534,7 @@ static void patchJumpToGetByIdStub(CodeBlock* codeBlock, StructureStubInfo& stub if (stubInfo.u.getByIdSelfList.didSelfPatching) { repatchBuffer.relink( stubInfo.callReturnLocation.jumpAtOffset( - stubInfo.patch.deltaCallToStructCheck), + stubInfo.patch.deltaCallToJump), CodeLocationLabel(stubRoutine->code().code())); return; } @@ -460,6 +572,7 @@ static bool tryBuildGetByIDList(ExecState* exec, JSValue baseValue, const Identi stubInfo.u.getByIdSelfList.listSize++; + GPRReg callFrameRegister = static_cast(stubInfo.patch.callFrameRegister); GPRReg baseGPR = static_cast(stubInfo.patch.baseGPR); #if USE(JSVALUE32_64) GPRReg resultTagGPR = static_cast(stubInfo.patch.valueTagGPR); @@ -500,14 +613,20 @@ static bool tryBuildGetByIDList(ExecState* exec, JSValue baseValue, const Identi stubJit.load32(MacroAssembler::Address(scratchGPR, offsetRelativeToBase(slot.cachedOffset())), scratchGPR); #endif } - stubJit.setupArgumentsWithExecState(baseGPR, scratchGPR); + stubJit.setupArguments(callFrameRegister, baseGPR, scratchGPR); operationFunction = operationCallGetter; } else { - stubJit.setupArgumentsWithExecState( - baseGPR, +#if USE(JSVALUE64) + // EncodedJSValue (*GetValueFunc)(ExecState*, EncodedJSValue slotBase, EncodedJSValue thisValue, PropertyName); + stubJit.setupArguments(callFrameRegister, baseGPR, baseGPR, MacroAssembler::TrustedImmPtr(ident.impl())); + operationFunction = FunctionPtr(slot.customGetter()); +#else + stubJit.setupArguments( + callFrameRegister, baseGPR, MacroAssembler::TrustedImmPtr(FunctionPtr(slot.customGetter()).executableAddress()), MacroAssembler::TrustedImmPtr(ident.impl())); operationFunction = operationCallCustomGetter; +#endif } // Need to make sure that whenever this call is made in the future, we remember the @@ -581,9 +700,17 @@ static bool tryBuildGetByIDList(ExecState* exec, JSValue baseValue, const Identi } if (baseValue.asCell()->structure()->typeInfo().prohibitsPropertyCaching() - || baseValue.asCell()->structure()->isDictionary() - || !slot.isCacheableValue()) + || baseValue.asCell()->structure()->isDictionary()) return false; + + if (!stubInfo.patch.registersFlushed) { + // We cannot do as much inline caching if the registers were not flushed prior to this GetById. In particular, + // non-Value cached properties require planting calls, which requires registers to have been flushed. Thus, + // if registers were not flushed, don't do non-Value caching. + if (!slot.isCacheableValue()) + return false; + } + PropertyOffset offset = slot.cachedOffset(); size_t count = normalizePrototypeChainForChainAccess(exec, baseValue, slot.slotBase(), ident, offset); @@ -602,9 +729,12 @@ static bool tryBuildGetByIDList(ExecState* exec, JSValue baseValue, const Identi RefPtr stubRoutine; - generateProtoChainAccessStub(exec, stubInfo, prototypeChain, count, offset, structure, stubInfo.callReturnLocation.labelAtOffset(stubInfo.patch.deltaCallToDone), slowCase, stubRoutine); + if (generateProtoChainAccessStub(exec, slot, ident, stubInfo, prototypeChain, count, offset, structure, + stubInfo.callReturnLocation.labelAtOffset(stubInfo.patch.deltaCallToDone), + slowCase, stubRoutine) == ProtoChainGenerationFailed) + return false; - polymorphicStructureList->list[listIndex].set(*vm, codeBlock->ownerExecutable(), stubRoutine, structure, true); + polymorphicStructureList->list[listIndex].set(*vm, codeBlock->ownerExecutable(), stubRoutine, structure, slot.isCacheableValue()); patchJumpToGetByIdStub(codeBlock, stubInfo, stubRoutine.get()); @@ -644,6 +774,64 @@ static V_JITOperation_ESsiJJI appropriateListBuildingPutByIdFunction(const PutPr return operationPutByIdNonStrictBuildList; } +#if ENABLE(GGC) +static MacroAssembler::Call storeToWriteBarrierBuffer(CCallHelpers& jit, GPRReg cell, GPRReg scratch1, GPRReg scratch2, GPRReg callFrameRegister, ScratchRegisterAllocator& allocator) +{ + ASSERT(scratch1 != scratch2); + WriteBarrierBuffer* writeBarrierBuffer = &jit.vm()->heap.writeBarrierBuffer(); + jit.move(MacroAssembler::TrustedImmPtr(writeBarrierBuffer), scratch1); + jit.load32(MacroAssembler::Address(scratch1, WriteBarrierBuffer::currentIndexOffset()), scratch2); + MacroAssembler::Jump needToFlush = jit.branch32(MacroAssembler::AboveOrEqual, scratch2, MacroAssembler::Address(scratch1, WriteBarrierBuffer::capacityOffset())); + + jit.add32(MacroAssembler::TrustedImm32(1), scratch2); + jit.store32(scratch2, MacroAssembler::Address(scratch1, WriteBarrierBuffer::currentIndexOffset())); + + jit.loadPtr(MacroAssembler::Address(scratch1, WriteBarrierBuffer::bufferOffset()), scratch1); + // We use an offset of -sizeof(void*) because we already added 1 to scratch2. + jit.storePtr(cell, MacroAssembler::BaseIndex(scratch1, scratch2, MacroAssembler::ScalePtr, static_cast(-sizeof(void*)))); + + MacroAssembler::Jump done = jit.jump(); + needToFlush.link(&jit); + + ScratchBuffer* scratchBuffer = jit.vm()->scratchBufferForSize(allocator.desiredScratchBufferSize()); + allocator.preserveUsedRegistersToScratchBuffer(jit, scratchBuffer, scratch1); + + unsigned bytesFromBase = allocator.numberOfReusedRegisters() * sizeof(void*); + unsigned bytesToSubtract = 0; +#if CPU(X86) + bytesToSubtract += 2 * sizeof(void*); + bytesFromBase += bytesToSubtract; +#endif + unsigned currentAlignment = bytesFromBase % stackAlignmentBytes(); + bytesToSubtract += currentAlignment; + + if (bytesToSubtract) + jit.subPtr(MacroAssembler::TrustedImm32(bytesToSubtract), MacroAssembler::stackPointerRegister); + + jit.setupArguments(callFrameRegister, cell); + MacroAssembler::Call call = jit.call(); + + if (bytesToSubtract) + jit.addPtr(MacroAssembler::TrustedImm32(bytesToSubtract), MacroAssembler::stackPointerRegister); + allocator.restoreUsedRegistersFromScratchBuffer(jit, scratchBuffer, scratch1); + + done.link(&jit); + + return call; +} + +static MacroAssembler::Call writeBarrier(CCallHelpers& jit, GPRReg owner, GPRReg scratch1, GPRReg scratch2, GPRReg callFrameRegister, ScratchRegisterAllocator& allocator) +{ + ASSERT(owner != scratch1); + ASSERT(owner != scratch2); + + MacroAssembler::Jump definitelyNotMarked = DFG::SpeculativeJIT::genericWriteBarrier(jit, owner, scratch1, scratch2); + MacroAssembler::Call call = storeToWriteBarrierBuffer(jit, owner, scratch1, scratch2, callFrameRegister, allocator); + definitelyNotMarked.link(&jit); + return call; +} +#endif // ENABLE(GGC) + static void emitPutReplaceStub( ExecState* exec, JSValue, @@ -656,75 +844,67 @@ static void emitPutReplaceStub( RefPtr& stubRoutine) { VM* vm = &exec->vm(); +#if ENABLE(GGC) + GPRReg callFrameRegister = static_cast(stubInfo.patch.callFrameRegister); +#endif GPRReg baseGPR = static_cast(stubInfo.patch.baseGPR); #if USE(JSVALUE32_64) GPRReg valueTagGPR = static_cast(stubInfo.patch.valueTagGPR); #endif GPRReg valueGPR = static_cast(stubInfo.patch.valueGPR); - GPRReg scratchGPR = TempRegisterSet(stubInfo.patch.usedRegisters).getFreeGPR(); - bool needToRestoreScratch = false; -#if ENABLE(WRITE_BARRIER_PROFILING) - GPRReg scratchGPR2; - const bool writeBarrierNeeded = true; -#else - const bool writeBarrierNeeded = false; + + ScratchRegisterAllocator allocator(stubInfo.patch.usedRegisters); + allocator.lock(baseGPR); +#if USE(JSVALUE32_64) + allocator.lock(valueTagGPR); #endif + allocator.lock(valueGPR); - MacroAssembler stubJit; - - if (scratchGPR == InvalidGPRReg && (writeBarrierNeeded || isOutOfLineOffset(slot.cachedOffset()))) { -#if USE(JSVALUE64) - scratchGPR = AssemblyHelpers::selectScratchGPR(baseGPR, valueGPR); -#else - scratchGPR = AssemblyHelpers::selectScratchGPR(baseGPR, valueGPR, valueTagGPR); + GPRReg scratchGPR1 = allocator.allocateScratchGPR(); +#if ENABLE(GGC) + GPRReg scratchGPR2 = allocator.allocateScratchGPR(); #endif - needToRestoreScratch = true; - stubJit.pushToSave(scratchGPR); - } + + CCallHelpers stubJit(vm, exec->codeBlock()); + + allocator.preserveReusedRegistersByPushing(stubJit); MacroAssembler::Jump badStructure = stubJit.branchPtr( MacroAssembler::NotEqual, MacroAssembler::Address(baseGPR, JSCell::structureOffset()), MacroAssembler::TrustedImmPtr(structure)); - -#if ENABLE(WRITE_BARRIER_PROFILING) -#if USE(JSVALUE64) - scratchGPR2 = AssemblyHelpers::selectScratchGPR(baseGPR, valueGPR, scratchGPR); -#else - scratchGPR2 = AssemblyHelpers::selectScratchGPR(baseGPR, valueGPR, valueTagGPR, scratchGPR); -#endif - stubJit.pushToSave(scratchGPR2); - AssemblyHelpers::writeBarrier(stubJit, baseGPR, scratchGPR, scratchGPR2, WriteBarrierForPropertyAccess); - stubJit.popToRestore(scratchGPR2); -#endif - + #if USE(JSVALUE64) if (isInlineOffset(slot.cachedOffset())) stubJit.store64(valueGPR, MacroAssembler::Address(baseGPR, JSObject::offsetOfInlineStorage() + offsetInInlineStorage(slot.cachedOffset()) * sizeof(JSValue))); else { - stubJit.loadPtr(MacroAssembler::Address(baseGPR, JSObject::butterflyOffset()), scratchGPR); - stubJit.store64(valueGPR, MacroAssembler::Address(scratchGPR, offsetInButterfly(slot.cachedOffset()) * sizeof(JSValue))); + stubJit.loadPtr(MacroAssembler::Address(baseGPR, JSObject::butterflyOffset()), scratchGPR1); + stubJit.store64(valueGPR, MacroAssembler::Address(scratchGPR1, offsetInButterfly(slot.cachedOffset()) * sizeof(JSValue))); } #elif USE(JSVALUE32_64) if (isInlineOffset(slot.cachedOffset())) { stubJit.store32(valueGPR, MacroAssembler::Address(baseGPR, JSObject::offsetOfInlineStorage() + offsetInInlineStorage(slot.cachedOffset()) * sizeof(JSValue) + OBJECT_OFFSETOF(EncodedValueDescriptor, asBits.payload))); stubJit.store32(valueTagGPR, MacroAssembler::Address(baseGPR, JSObject::offsetOfInlineStorage() + offsetInInlineStorage(slot.cachedOffset()) * sizeof(JSValue) + OBJECT_OFFSETOF(EncodedValueDescriptor, asBits.tag))); } else { - stubJit.loadPtr(MacroAssembler::Address(baseGPR, JSObject::butterflyOffset()), scratchGPR); - stubJit.store32(valueGPR, MacroAssembler::Address(scratchGPR, offsetInButterfly(slot.cachedOffset()) * sizeof(JSValue) + OBJECT_OFFSETOF(EncodedValueDescriptor, asBits.payload))); - stubJit.store32(valueTagGPR, MacroAssembler::Address(scratchGPR, offsetInButterfly(slot.cachedOffset()) * sizeof(JSValue) + OBJECT_OFFSETOF(EncodedValueDescriptor, asBits.tag))); + stubJit.loadPtr(MacroAssembler::Address(baseGPR, JSObject::butterflyOffset()), scratchGPR1); + stubJit.store32(valueGPR, MacroAssembler::Address(scratchGPR1, offsetInButterfly(slot.cachedOffset()) * sizeof(JSValue) + OBJECT_OFFSETOF(EncodedValueDescriptor, asBits.payload))); + stubJit.store32(valueTagGPR, MacroAssembler::Address(scratchGPR1, offsetInButterfly(slot.cachedOffset()) * sizeof(JSValue) + OBJECT_OFFSETOF(EncodedValueDescriptor, asBits.tag))); } #endif +#if ENABLE(GGC) + MacroAssembler::Call writeBarrierOperation = writeBarrier(stubJit, baseGPR, scratchGPR1, scratchGPR2, callFrameRegister, allocator); +#endif + MacroAssembler::Jump success; MacroAssembler::Jump failure; - if (needToRestoreScratch) { - stubJit.popToRestore(scratchGPR); + if (allocator.didReuseRegisters()) { + allocator.restoreReusedRegistersByPopping(stubJit); success = stubJit.jump(); badStructure.link(&stubJit); - stubJit.popToRestore(scratchGPR); + allocator.restoreReusedRegistersByPopping(stubJit); failure = stubJit.jump(); } else { success = stubJit.jump(); @@ -732,6 +912,9 @@ static void emitPutReplaceStub( } LinkBuffer patchBuffer(*vm, &stubJit, exec->codeBlock()); +#if ENABLE(GGC) + patchBuffer.link(writeBarrierOperation, operationFlushWriteBarrierBuffer); +#endif patchBuffer.link(success, stubInfo.callReturnLocation.labelAtOffset(stubInfo.patch.deltaCallToDone)); patchBuffer.link(failure, failureLabel); @@ -757,6 +940,7 @@ static void emitPutTransitionStub( { VM* vm = &exec->vm(); + GPRReg callFrameRegister = static_cast(stubInfo.patch.callFrameRegister); GPRReg baseGPR = static_cast(stubInfo.patch.baseGPR); #if USE(JSVALUE32_64) GPRReg valueTagGPR = static_cast(stubInfo.patch.valueTagGPR); @@ -771,30 +955,22 @@ static void emitPutTransitionStub( allocator.lock(valueGPR); CCallHelpers stubJit(vm); - - GPRReg scratchGPR1 = allocator.allocateScratchGPR(); - ASSERT(scratchGPR1 != baseGPR); - ASSERT(scratchGPR1 != valueGPR); - bool needSecondScratch = false; bool needThirdScratch = false; -#if ENABLE(WRITE_BARRIER_PROFILING) - needSecondScratch = true; -#endif if (structure->outOfLineCapacity() != oldStructure->outOfLineCapacity() && oldStructure->outOfLineCapacity()) { - needSecondScratch = true; needThirdScratch = true; } - GPRReg scratchGPR2; - if (needSecondScratch) { - scratchGPR2 = allocator.allocateScratchGPR(); - ASSERT(scratchGPR2 != baseGPR); - ASSERT(scratchGPR2 != valueGPR); - ASSERT(scratchGPR2 != scratchGPR1); - } else - scratchGPR2 = InvalidGPRReg; + GPRReg scratchGPR1 = allocator.allocateScratchGPR(); + ASSERT(scratchGPR1 != baseGPR); + ASSERT(scratchGPR1 != valueGPR); + + GPRReg scratchGPR2 = allocator.allocateScratchGPR(); + ASSERT(scratchGPR2 != baseGPR); + ASSERT(scratchGPR2 != valueGPR); + ASSERT(scratchGPR2 != scratchGPR1); + GPRReg scratchGPR3; if (needThirdScratch) { scratchGPR3 = allocator.allocateScratchGPR(); @@ -804,7 +980,7 @@ static void emitPutTransitionStub( ASSERT(scratchGPR3 != scratchGPR2); } else scratchGPR3 = InvalidGPRReg; - + allocator.preserveReusedRegistersByPushing(stubJit); MacroAssembler::JumpList failureCases; @@ -825,13 +1001,6 @@ static void emitPutTransitionStub( } } -#if ENABLE(WRITE_BARRIER_PROFILING) - ASSERT(needSecondScratch); - ASSERT(scratchGPR2 != InvalidGPRReg); - // Must always emit this write barrier as the structure transition itself requires it - AssemblyHelpers::writeBarrier(stubJit, baseGPR, scratchGPR1, scratchGPR2, WriteBarrierForPropertyAccess); -#endif - MacroAssembler::JumpList slowPath; bool scratchGPR1HasStorage = false; @@ -859,9 +1028,9 @@ static void emitPutTransitionStub( stubJit.addPtr(MacroAssembler::AbsoluteAddress(&copiedAllocator->m_currentPayloadEnd), scratchGPR1); stubJit.addPtr(MacroAssembler::TrustedImm32(sizeof(JSValue)), scratchGPR1); // We have scratchGPR1 = new storage, scratchGPR3 = old storage, scratchGPR2 = available - for (ptrdiff_t offset = 0; offset < static_cast(oldSize); offset += sizeof(void*)) { - stubJit.loadPtr(MacroAssembler::Address(scratchGPR3, -(offset + sizeof(JSValue) + sizeof(void*))), scratchGPR2); - stubJit.storePtr(scratchGPR2, MacroAssembler::Address(scratchGPR1, -(offset + sizeof(JSValue) + sizeof(void*)))); + for (size_t offset = 0; offset < oldSize; offset += sizeof(void*)) { + stubJit.loadPtr(MacroAssembler::Address(scratchGPR3, -static_cast(offset + sizeof(JSValue) + sizeof(void*))), scratchGPR2); + stubJit.storePtr(scratchGPR2, MacroAssembler::Address(scratchGPR1, -static_cast(offset + sizeof(JSValue) + sizeof(void*)))); } } @@ -890,6 +1059,10 @@ static void emitPutTransitionStub( } #endif +#if ENABLE(GGC) + MacroAssembler::Call writeBarrierOperation = writeBarrier(stubJit, baseGPR, scratchGPR1, scratchGPR2, callFrameRegister, allocator); +#endif + MacroAssembler::Jump success; MacroAssembler::Jump failure; @@ -913,9 +1086,9 @@ static void emitPutTransitionStub( ScratchBuffer* scratchBuffer = vm->scratchBufferForSize(allocator.desiredScratchBufferSize()); allocator.preserveUsedRegistersToScratchBuffer(stubJit, scratchBuffer, scratchGPR1); #if USE(JSVALUE64) - stubJit.setupArgumentsWithExecState(baseGPR, MacroAssembler::TrustedImmPtr(structure), MacroAssembler::TrustedImm32(slot.cachedOffset()), valueGPR); + stubJit.setupArguments(callFrameRegister, baseGPR, MacroAssembler::TrustedImmPtr(structure), MacroAssembler::TrustedImm32(slot.cachedOffset()), valueGPR); #else - stubJit.setupArgumentsWithExecState(baseGPR, MacroAssembler::TrustedImmPtr(structure), MacroAssembler::TrustedImm32(slot.cachedOffset()), valueGPR, valueTagGPR); + stubJit.setupArguments(callFrameRegister, baseGPR, MacroAssembler::TrustedImmPtr(structure), MacroAssembler::TrustedImm32(slot.cachedOffset()), valueGPR, valueTagGPR); #endif operationCall = stubJit.call(); allocator.restoreUsedRegistersFromScratchBuffer(stubJit, scratchBuffer, scratchGPR1); @@ -923,6 +1096,9 @@ static void emitPutTransitionStub( } LinkBuffer patchBuffer(*vm, &stubJit, exec->codeBlock()); +#if ENABLE(GGC) + patchBuffer.link(writeBarrierOperation, operationFlushWriteBarrierBuffer); +#endif patchBuffer.link(success, stubInfo.callReturnLocation.labelAtOffset(stubInfo.patch.deltaCallToDone)); if (allocator.didReuseRegisters()) patchBuffer.link(failure, failureLabel); @@ -996,9 +1172,9 @@ static bool tryCachePutByID(ExecState* exec, JSValue baseValue, const Identifier RepatchBuffer repatchBuffer(codeBlock); repatchBuffer.relink( stubInfo.callReturnLocation.jumpAtOffset( - stubInfo.patch.deltaCallToStructCheck), + stubInfo.patch.deltaCallToJump), CodeLocationLabel(stubInfo.stubRoutine->code().code())); - repatchBuffer.relink(stubInfo.callReturnLocation, appropriateListBuildingPutByIdFunction(slot, putKind)); + repatchCall(repatchBuffer, stubInfo.callReturnLocation, appropriateListBuildingPutByIdFunction(slot, putKind)); stubInfo.initPutByIdTransition(*vm, codeBlock->ownerExecutable(), oldStructure, structure, prototypeChain, putKind == Direct); @@ -1008,7 +1184,7 @@ static bool tryCachePutByID(ExecState* exec, JSValue baseValue, const Identifier if (!MacroAssembler::isPtrAlignedAddressOffset(offsetRelativeToPatchedStorage(slot.cachedOffset()))) return false; - repatchByIdSelfAccess(codeBlock, stubInfo, structure, slot.cachedOffset(), appropriateListBuildingPutByIdFunction(slot, putKind), false); + repatchByIdSelfAccess(*vm, codeBlock, stubInfo, structure, ident, slot.cachedOffset(), appropriateListBuildingPutByIdFunction(slot, putKind), false); stubInfo.initPutByIdReplace(*vm, codeBlock->ownerExecutable(), structure); return true; } @@ -1100,10 +1276,10 @@ static bool tryBuildPutByIdList(ExecState* exec, JSValue baseValue, const Identi } RepatchBuffer repatchBuffer(codeBlock); - repatchBuffer.relink(stubInfo.callReturnLocation.jumpAtOffset(stubInfo.patch.deltaCallToStructCheck), CodeLocationLabel(stubRoutine->code().code())); + repatchBuffer.relink(stubInfo.callReturnLocation.jumpAtOffset(stubInfo.patch.deltaCallToJump), CodeLocationLabel(stubRoutine->code().code())); if (list->isFull()) - repatchBuffer.relink(stubInfo.callReturnLocation, appropriateGenericPutByIdFunction(slot, putKind)); + repatchCall(repatchBuffer, stubInfo.callReturnLocation, appropriateGenericPutByIdFunction(slot, putKind)); return true; } @@ -1144,7 +1320,7 @@ static bool tryRepatchIn( PolymorphicAccessStructureList* polymorphicStructureList; int listIndex; - CodeLocationLabel successLabel = stubInfo.hotPathBegin; + CodeLocationLabel successLabel = stubInfo.callReturnLocation.labelAtOffset(stubInfo.patch.deltaCallToDone); CodeLocationLabel slowCaseLabel; if (stubInfo.accessType == access_unset) { @@ -1186,14 +1362,21 @@ static bool tryRepatchIn( MacroAssembler::NotEqual, MacroAssembler::Address(baseGPR, JSCell::structureOffset()), MacroAssembler::TrustedImmPtr(structure))); - + + CodeBlock* codeBlock = exec->codeBlock(); + if (structure->typeInfo().newImpurePropertyFiresWatchpoints()) + vm->registerWatchpointForImpureProperty(ident, stubInfo.addWatchpoint(codeBlock)); + Structure* currStructure = structure; WriteBarrier* it = chain->head(); for (unsigned i = 0; i < count; ++i, ++it) { JSObject* prototype = asObject(currStructure->prototypeForLookup(exec)); + Structure* protoStructure = prototype->structure(); addStructureTransitionCheck( - prototype, prototype->structure(), exec->codeBlock(), stubInfo, stubJit, + prototype, protoStructure, exec->codeBlock(), stubInfo, stubJit, failureCases, scratchGPR); + if (protoStructure->typeInfo().newImpurePropertyFiresWatchpoints()) + vm->registerWatchpointForImpureProperty(ident, stubInfo.addWatchpoint(codeBlock)); currStructure = it->get(); } @@ -1222,7 +1405,7 @@ static bool tryRepatchIn( stubInfo.u.inList.listSize++; RepatchBuffer repatchBuffer(codeBlock); - repatchBuffer.relink(stubInfo.hotPathBegin.jumpAtOffset(0), CodeLocationLabel(stubRoutine->code().code())); + repatchBuffer.relink(stubInfo.callReturnLocation.jumpAtOffset(stubInfo.patch.deltaCallToJump), CodeLocationLabel(stubRoutine->code().code())); return listIndex < (POLYMORPHIC_LIST_CACHE_SIZE - 1); } @@ -1342,9 +1525,9 @@ void linkClosureCall(ExecState* exec, CallLinkInfo& callLinkInfo, CodeBlock* cal AssemblyHelpers::Jump done = stubJit.jump(); slowPath.link(&stubJit); - stubJit.move(calleeGPR, GPRInfo::nonArgGPR0); + stubJit.move(calleeGPR, GPRInfo::regT0); #if USE(JSVALUE32_64) - stubJit.move(CCallHelpers::TrustedImm32(JSValue::CellTag), GPRInfo::nonArgGPR1); + stubJit.move(CCallHelpers::TrustedImm32(JSValue::CellTag), GPRInfo::regT1); #endif stubJit.move(CCallHelpers::TrustedImmPtr(callLinkInfo.callReturnLocation.executableAddress()), GPRInfo::nonArgGPR2); stubJit.restoreReturnAddressBeforeReturn(GPRInfo::nonArgGPR2); @@ -1378,7 +1561,7 @@ void linkClosureCall(ExecState* exec, CallLinkInfo& callLinkInfo, CodeBlock* cal void resetGetByID(RepatchBuffer& repatchBuffer, StructureStubInfo& stubInfo) { - repatchBuffer.relink(stubInfo.callReturnLocation, operationGetByIdOptimize); + repatchCall(repatchBuffer, stubInfo.callReturnLocation, operationGetByIdOptimize); CodeLocationDataLabelPtr structureLabel = stubInfo.callReturnLocation.dataLabelPtrAtOffset(-(intptr_t)stubInfo.patch.deltaCheckImmToCall); if (MacroAssembler::canJumpReplacePatchableBranchPtrWithPatch()) { repatchBuffer.revertJumpReplacementToPatchableBranchPtrWithPatch( @@ -1395,12 +1578,12 @@ void resetGetByID(RepatchBuffer& repatchBuffer, StructureStubInfo& stubInfo) repatchBuffer.repatch(stubInfo.callReturnLocation.dataLabelCompactAtOffset(stubInfo.patch.deltaCallToTagLoadOrStore), 0); repatchBuffer.repatch(stubInfo.callReturnLocation.dataLabelCompactAtOffset(stubInfo.patch.deltaCallToPayloadLoadOrStore), 0); #endif - repatchBuffer.relink(stubInfo.callReturnLocation.jumpAtOffset(stubInfo.patch.deltaCallToStructCheck), stubInfo.callReturnLocation.labelAtOffset(stubInfo.patch.deltaCallToSlowCase)); + repatchBuffer.relink(stubInfo.callReturnLocation.jumpAtOffset(stubInfo.patch.deltaCallToJump), stubInfo.callReturnLocation.labelAtOffset(stubInfo.patch.deltaCallToSlowCase)); } void resetPutByID(RepatchBuffer& repatchBuffer, StructureStubInfo& stubInfo) { - V_JITOperation_ESsiJJI unoptimizedFunction = bitwise_cast(MacroAssembler::readCallTarget(stubInfo.callReturnLocation).executableAddress()); + V_JITOperation_ESsiJJI unoptimizedFunction = bitwise_cast(readCallTarget(repatchBuffer, stubInfo.callReturnLocation).executableAddress()); V_JITOperation_ESsiJJI optimizedFunction; if (unoptimizedFunction == operationPutByIdStrict || unoptimizedFunction == operationPutByIdStrictBuildList) optimizedFunction = operationPutByIdStrictOptimize; @@ -1412,7 +1595,7 @@ void resetPutByID(RepatchBuffer& repatchBuffer, StructureStubInfo& stubInfo) ASSERT(unoptimizedFunction == operationPutByIdDirectNonStrict || unoptimizedFunction == operationPutByIdDirectNonStrictBuildList); optimizedFunction = operationPutByIdDirectNonStrictOptimize; } - repatchBuffer.relink(stubInfo.callReturnLocation, optimizedFunction); + repatchCall(repatchBuffer, stubInfo.callReturnLocation, optimizedFunction); CodeLocationDataLabelPtr structureLabel = stubInfo.callReturnLocation.dataLabelPtrAtOffset(-(intptr_t)stubInfo.patch.deltaCheckImmToCall); if (MacroAssembler::canJumpReplacePatchableBranchPtrWithPatch()) { repatchBuffer.revertJumpReplacementToPatchableBranchPtrWithPatch( @@ -1429,12 +1612,12 @@ void resetPutByID(RepatchBuffer& repatchBuffer, StructureStubInfo& stubInfo) repatchBuffer.repatch(stubInfo.callReturnLocation.dataLabel32AtOffset(stubInfo.patch.deltaCallToTagLoadOrStore), 0); repatchBuffer.repatch(stubInfo.callReturnLocation.dataLabel32AtOffset(stubInfo.patch.deltaCallToPayloadLoadOrStore), 0); #endif - repatchBuffer.relink(stubInfo.callReturnLocation.jumpAtOffset(stubInfo.patch.deltaCallToStructCheck), stubInfo.callReturnLocation.labelAtOffset(stubInfo.patch.deltaCallToSlowCase)); + repatchBuffer.relink(stubInfo.callReturnLocation.jumpAtOffset(stubInfo.patch.deltaCallToJump), stubInfo.callReturnLocation.labelAtOffset(stubInfo.patch.deltaCallToSlowCase)); } void resetIn(RepatchBuffer& repatchBuffer, StructureStubInfo& stubInfo) { - repatchBuffer.relink(stubInfo.hotPathBegin.jumpAtOffset(0), stubInfo.callReturnLocation.labelAtOffset(stubInfo.patch.deltaCallToSlowCase)); + repatchBuffer.relink(stubInfo.callReturnLocation.jumpAtOffset(stubInfo.patch.deltaCallToJump), stubInfo.callReturnLocation.labelAtOffset(stubInfo.patch.deltaCallToSlowCase)); } } // namespace JSC diff --git a/JavaScriptCore/jit/ScratchRegisterAllocator.h b/JavaScriptCore/jit/ScratchRegisterAllocator.h index db3fbc67..1967226c 100644 --- a/JavaScriptCore/jit/ScratchRegisterAllocator.h +++ b/JavaScriptCore/jit/ScratchRegisterAllocator.h @@ -41,12 +41,24 @@ class ScratchRegisterAllocator { public: ScratchRegisterAllocator(const TempRegisterSet& usedRegisters) : m_usedRegisters(usedRegisters) - , m_didReuseRegisters(false) + , m_numberOfReusedRegisters(0) { } - - template - void lock(T reg) { m_lockedRegisters.set(reg); } + + void lock(GPRReg reg) + { + unsigned index = GPRInfo::toIndex(reg); + if (index == GPRInfo::InvalidIndex) + return; + m_lockedRegisters.setGPRByIndex(index); + } + void lock(FPRReg reg) + { + unsigned index = FPRInfo::toIndex(reg); + if (index == FPRInfo::InvalidIndex) + return; + m_lockedRegisters.setFPRByIndex(index); + } template typename BankInfo::RegisterType allocateScratch() @@ -68,7 +80,7 @@ class ScratchRegisterAllocator { typename BankInfo::RegisterType reg = BankInfo::toRegister(i); if (!m_lockedRegisters.get(reg) && !m_scratchRegisters.get(reg)) { m_scratchRegisters.set(reg); - m_didReuseRegisters = true; + m_numberOfReusedRegisters++; return reg; } } @@ -84,12 +96,17 @@ class ScratchRegisterAllocator { bool didReuseRegisters() const { - return m_didReuseRegisters; + return !!m_numberOfReusedRegisters; + } + + unsigned numberOfReusedRegisters() const + { + return m_numberOfReusedRegisters; } void preserveReusedRegistersByPushing(MacroAssembler& jit) { - if (!m_didReuseRegisters) + if (!didReuseRegisters()) return; for (unsigned i = 0; i < FPRInfo::numberOfRegisters; ++i) { @@ -104,7 +121,7 @@ class ScratchRegisterAllocator { void restoreReusedRegistersByPopping(MacroAssembler& jit) { - if (!m_didReuseRegisters) + if (!didReuseRegisters()) return; for (unsigned i = GPRInfo::numberOfRegisters; i--;) { @@ -187,7 +204,7 @@ class ScratchRegisterAllocator { TempRegisterSet m_usedRegisters; TempRegisterSet m_lockedRegisters; TempRegisterSet m_scratchRegisters; - bool m_didReuseRegisters; + unsigned m_numberOfReusedRegisters; }; } // namespace JSC diff --git a/JavaScriptCore/jit/SlowPathCall.h b/JavaScriptCore/jit/SlowPathCall.h index 522e02f2..f0aa28e8 100644 --- a/JavaScriptCore/jit/SlowPathCall.h +++ b/JavaScriptCore/jit/SlowPathCall.h @@ -55,12 +55,12 @@ class JITSlowPathCall { m_jit->push(JIT::callFrameRegister); #elif CPU(X86_64) && OS(WINDOWS) m_jit->addPtr(MacroAssembler::TrustedImm32(-16), MacroAssembler::stackPointerRegister); - m_jit->move(MacroAssembler::stackPointerRegister, JIT::firstArgumentRegister); - m_jit->move(JIT::callFrameRegister, JIT::secondArgumentRegister); - m_jit->move(JIT::TrustedImmPtr(m_pc), JIT::thirdArgumentRegister); + m_jit->move(MacroAssembler::stackPointerRegister, JIT::argumentGPR0); + m_jit->move(JIT::callFrameRegister, JIT::argumentGPR1); + m_jit->move(JIT::TrustedImmPtr(m_pc), JIT::argumentGPR2); #else - m_jit->move(JIT::callFrameRegister, JIT::firstArgumentRegister); - m_jit->move(JIT::TrustedImmPtr(m_pc), JIT::secondArgumentRegister); + m_jit->move(JIT::callFrameRegister, JIT::argumentGPR0); + m_jit->move(JIT::TrustedImmPtr(m_pc), JIT::argumentGPR1); #endif JIT::Call call = m_jit->call(); m_jit->m_calls.append(CallRecord(call, m_jit->m_bytecodeOffset, m_stub.value())); @@ -77,11 +77,6 @@ class JITSlowPathCall { m_jit->sampleInstruction(m_jit->m_codeBlock->instructions().begin() + m_jit->m_bytecodeOffset, false); #endif -#if USE(JSVALUE32_64) - m_jit->unmap(); -#else - m_jit->killLastResultRegister(); -#endif m_jit->exceptionCheck(); return call; } diff --git a/JavaScriptCore/jit/SpecializedThunkJIT.h b/JavaScriptCore/jit/SpecializedThunkJIT.h index 5fd7822b..6ec1e71a 100644 --- a/JavaScriptCore/jit/SpecializedThunkJIT.h +++ b/JavaScriptCore/jit/SpecializedThunkJIT.h @@ -120,10 +120,15 @@ namespace JSC { zero.link(this); move(tagTypeNumberRegister, regT0); done.link(this); +#else +#if !CPU(X86) + // The src register is not clobbered by moveDoubleToInts with ARM, MIPS and SH4 macro assemblers, so let's use it. + moveDoubleToInts(src, regT0, regT1); #else storeDouble(src, Address(stackPointerRegister, -(int)sizeof(double))); loadPtr(Address(stackPointerRegister, OBJECT_OFFSETOF(JSValue, u.asBits.tag) - sizeof(double)), regT1); loadPtr(Address(stackPointerRegister, OBJECT_OFFSETOF(JSValue, u.asBits.payload) - sizeof(double)), regT0); +#endif Jump lowNonZero = branchTestPtr(NonZero, regT1); Jump highNonZero = branchTestPtr(NonZero, regT0); move(TrustedImm32(0), regT0); diff --git a/JavaScriptCore/jit/ThunkGenerators.cpp b/JavaScriptCore/jit/ThunkGenerators.cpp index a63c78df..5a294328 100644 --- a/JavaScriptCore/jit/ThunkGenerators.cpp +++ b/JavaScriptCore/jit/ThunkGenerators.cpp @@ -47,9 +47,9 @@ inline void emitPointerValidation(CCallHelpers& jit, GPRReg pointerGPR) CCallHelpers::Jump isNonZero = jit.branchTestPtr(CCallHelpers::NonZero, pointerGPR); jit.breakpoint(); isNonZero.link(&jit); - jit.push(pointerGPR); + jit.pushToSave(pointerGPR); jit.load8(pointerGPR, pointerGPR); - jit.pop(pointerGPR); + jit.popToRestore(pointerGPR); #else UNUSED_PARAM(jit); UNUSED_PARAM(pointerGPR); @@ -109,7 +109,7 @@ static MacroAssemblerCodeRef linkForThunkGenerator( // The return address is on the stack or in the link register. We will hence // save the return address to the call frame while we make a C++ function call // to perform linking and lazy compilation if necessary. We expect the callee - // to be in nonArgGPR0/nonArgGPR1 (payload/tag), the CallFrame to have already + // to be in regT0/regT1 (payload/tag), the CallFrame to have already // been adjusted, and all other registers to be available for use. CCallHelpers jit(vm); @@ -147,6 +147,7 @@ MacroAssemblerCodeRef linkClosureCallThunkGenerator(VM* vm) static MacroAssemblerCodeRef virtualForThunkGenerator( VM* vm, CodeSpecializationKind kind) { + // The callee is in regT0 (for JSVALUE32_64, the tag is in regT1). // The return address is on the stack, or in the link register. We will hence // jump to the callee, or save the return address to the call frame while we // make a C++ function call to the appropriate JIT operation. @@ -161,14 +162,14 @@ static MacroAssemblerCodeRef virtualForThunkGenerator( #if USE(JSVALUE64) slowCase.append( jit.branchTest64( - CCallHelpers::NonZero, GPRInfo::nonArgGPR0, GPRInfo::tagMaskRegister)); + CCallHelpers::NonZero, GPRInfo::regT0, GPRInfo::tagMaskRegister)); #else slowCase.append( jit.branch32( - CCallHelpers::NotEqual, GPRInfo::nonArgGPR1, + CCallHelpers::NotEqual, GPRInfo::regT1, CCallHelpers::TrustedImm32(JSValue::CellTag))); #endif - jit.loadPtr(CCallHelpers::Address(GPRInfo::nonArgGPR0, JSCell::structureOffset()), GPRInfo::nonArgGPR2); + jit.loadPtr(CCallHelpers::Address(GPRInfo::regT0, JSCell::structureOffset()), GPRInfo::nonArgGPR2); slowCase.append( jit.branchPtr( CCallHelpers::NotEqual, @@ -178,7 +179,7 @@ static MacroAssemblerCodeRef virtualForThunkGenerator( // Now we know we have a JSFunction. jit.loadPtr( - CCallHelpers::Address(GPRInfo::nonArgGPR0, JSFunction::offsetOfExecutable()), + CCallHelpers::Address(GPRInfo::regT0, JSFunction::offsetOfExecutable()), GPRInfo::nonArgGPR2); slowCase.append( jit.branch32( @@ -191,17 +192,17 @@ static MacroAssemblerCodeRef virtualForThunkGenerator( // call. jit.loadPtr( - CCallHelpers::Address(GPRInfo::nonArgGPR0, JSFunction::offsetOfScopeChain()), - GPRInfo::nonArgGPR1); + CCallHelpers::Address(GPRInfo::regT0, JSFunction::offsetOfScopeChain()), + GPRInfo::regT1); #if USE(JSVALUE64) jit.store64( - GPRInfo::nonArgGPR1, + GPRInfo::regT1, CCallHelpers::Address( GPRInfo::callFrameRegister, static_cast(sizeof(Register)) * JSStack::ScopeChain)); #else jit.storePtr( - GPRInfo::nonArgGPR1, + GPRInfo::regT1, CCallHelpers::Address( GPRInfo::callFrameRegister, static_cast(sizeof(Register)) * JSStack::ScopeChain + @@ -342,30 +343,8 @@ static MacroAssemblerCodeRef nativeForGenerator(VM* vm, CodeSpecializationKind k jit.restoreReturnAddressBeforeReturn(JSInterfaceJIT::regT3); -#elif CPU(ARM) - // Load caller frame's scope chain into this callframe so that whatever we call can - // get to its global data. - jit.emitGetCallerFrameFromCallFrameHeaderPtr(JSInterfaceJIT::regT2); - jit.emitGetFromCallFrameHeaderPtr(JSStack::ScopeChain, JSInterfaceJIT::regT1, JSInterfaceJIT::regT2); - jit.emitPutCellToCallFrameHeader(JSInterfaceJIT::regT1, JSStack::ScopeChain); - - jit.preserveReturnAddressAfterCall(JSInterfaceJIT::regT3); // Callee preserved - jit.emitPutReturnPCToCallFrameHeader(JSInterfaceJIT::regT3); - - // Calling convention: f(r0 == regT0, r1 == regT1, ...); - // Host function signature: f(ExecState*); - jit.move(JSInterfaceJIT::callFrameRegister, ARMRegisters::r0); - - jit.emitGetFromCallFrameHeaderPtr(JSStack::Callee, ARMRegisters::r1); - jit.move(JSInterfaceJIT::regT2, JSInterfaceJIT::callFrameRegister); // Eagerly restore caller frame register to avoid loading from stack. - jit.loadPtr(JSInterfaceJIT::Address(ARMRegisters::r1, JSFunction::offsetOfExecutable()), JSInterfaceJIT::regT2); - jit.call(JSInterfaceJIT::Address(JSInterfaceJIT::regT2, executableOffsetToFunction)); - - jit.restoreReturnAddressBeforeReturn(JSInterfaceJIT::regT3); - -#elif CPU(SH4) - // Load caller frame's scope chain into this callframe so that whatever we call can - // get to its global data. +#elif CPU(ARM) || CPU(SH4) || CPU(MIPS) + // Load caller frame's scope chain into this callframe so that whatever we call can get to its global data. jit.emitGetCallerFrameFromCallFrameHeaderPtr(JSInterfaceJIT::regT2); jit.emitGetFromCallFrameHeaderPtr(JSStack::ScopeChain, JSInterfaceJIT::regT1, JSInterfaceJIT::regT2); jit.emitPutCellToCallFrameHeader(JSInterfaceJIT::regT1, JSStack::ScopeChain); @@ -373,45 +352,24 @@ static MacroAssemblerCodeRef nativeForGenerator(VM* vm, CodeSpecializationKind k jit.preserveReturnAddressAfterCall(JSInterfaceJIT::regT3); // Callee preserved jit.emitPutReturnPCToCallFrameHeader(JSInterfaceJIT::regT3); - // Calling convention: f(r0 == regT4, r1 == regT5, ...); - // Host function signature: f(ExecState*); - jit.move(JSInterfaceJIT::callFrameRegister, JSInterfaceJIT::regT4); - - jit.emitGetFromCallFrameHeaderPtr(JSStack::Callee, JSInterfaceJIT::regT5); - jit.move(JSInterfaceJIT::regT2, JSInterfaceJIT::callFrameRegister); // Eagerly restore caller frame register to avoid loading from stack. - jit.loadPtr(JSInterfaceJIT::Address(JSInterfaceJIT::regT5, JSFunction::offsetOfExecutable()), JSInterfaceJIT::regT2); - - jit.call(JSInterfaceJIT::Address(JSInterfaceJIT::regT2, executableOffsetToFunction), JSInterfaceJIT::regT0); - jit.restoreReturnAddressBeforeReturn(JSInterfaceJIT::regT3); - -#elif CPU(MIPS) - // Load caller frame's scope chain into this callframe so that whatever we call can - // get to its global data. - jit.emitGetCallerFrameFromCallFrameHeaderPtr(JSInterfaceJIT::regT0); - jit.emitGetFromCallFrameHeaderPtr(JSStack::ScopeChain, JSInterfaceJIT::regT1, JSInterfaceJIT::regT0); - jit.emitPutCellToCallFrameHeader(JSInterfaceJIT::regT1, JSStack::ScopeChain); - - jit.preserveReturnAddressAfterCall(JSInterfaceJIT::regT3); // Callee preserved - jit.emitPutReturnPCToCallFrameHeader(JSInterfaceJIT::regT3); - - // Calling convention: f(a0, a1, a2, a3); - // Host function signature: f(ExecState*); - - // Allocate stack space for 16 bytes (8-byte aligned) - // 16 bytes (unused) for 4 arguments +#if CPU(MIPS) + // Allocate stack space for (unused) 16 bytes (8-byte aligned) for 4 arguments. jit.subPtr(JSInterfaceJIT::TrustedImm32(16), JSInterfaceJIT::stackPointerRegister); +#endif - // Setup arg0 - jit.move(JSInterfaceJIT::callFrameRegister, MIPSRegisters::a0); + // Calling convention is f(argumentGPR0, argumentGPR1, ...). + // Host function signature is f(ExecState*). + jit.move(JSInterfaceJIT::callFrameRegister, JSInterfaceJIT::argumentGPR0); - // Call - jit.emitGetFromCallFrameHeaderPtr(JSStack::Callee, MIPSRegisters::a2); - jit.loadPtr(JSInterfaceJIT::Address(MIPSRegisters::a2, JSFunction::offsetOfExecutable()), JSInterfaceJIT::regT2); - jit.move(JSInterfaceJIT::regT0, JSInterfaceJIT::callFrameRegister); // Eagerly restore caller frame register to avoid loading from stack. + jit.emitGetFromCallFrameHeaderPtr(JSStack::Callee, JSInterfaceJIT::argumentGPR1); + jit.move(JSInterfaceJIT::regT2, JSInterfaceJIT::callFrameRegister); // Eagerly restore caller frame register to avoid loading from stack. + jit.loadPtr(JSInterfaceJIT::Address(JSInterfaceJIT::argumentGPR1, JSFunction::offsetOfExecutable()), JSInterfaceJIT::regT2); jit.call(JSInterfaceJIT::Address(JSInterfaceJIT::regT2, executableOffsetToFunction)); +#if CPU(MIPS) // Restore stack space jit.addPtr(JSInterfaceJIT::TrustedImm32(16), JSInterfaceJIT::stackPointerRegister); +#endif jit.restoreReturnAddressBeforeReturn(JSInterfaceJIT::regT3); #else @@ -449,7 +407,7 @@ static MacroAssemblerCodeRef nativeForGenerator(VM* vm, CodeSpecializationKind k jit.addPtr(JSInterfaceJIT::TrustedImm32(-12), JSInterfaceJIT::stackPointerRegister); jit.push(JSInterfaceJIT::callFrameRegister); #else - jit.move(JSInterfaceJIT::callFrameRegister, JSInterfaceJIT::firstArgumentRegister); + jit.move(JSInterfaceJIT::callFrameRegister, JSInterfaceJIT::argumentGPR0); #endif jit.move(JSInterfaceJIT::TrustedImmPtr(FunctionPtr(operationVMHandleException).value()), JSInterfaceJIT::regT3); jit.call(JSInterfaceJIT::regT3); diff --git a/JavaScriptCore/jsc.cpp b/JavaScriptCore/jsc.cpp index 13b0bd07..40784b49 100644 --- a/JavaScriptCore/jsc.cpp +++ b/JavaScriptCore/jsc.cpp @@ -33,6 +33,7 @@ #include "InitializeThreading.h" #include "Interpreter.h" #include "JSArray.h" +#include "JSArrayBuffer.h" #include "JSFunction.h" #include "JSLock.h" #include "JSProxy.h" @@ -46,6 +47,7 @@ #include #include #include +#include #include #include #include @@ -83,10 +85,6 @@ #include #endif -#if PLATFORM(BLACKBERRY) -#include -#endif - #if PLATFORM(EFL) #include #endif @@ -108,11 +106,13 @@ static EncodedJSValue JSC_HOST_CALL functionDumpCallFrame(ExecState*); static EncodedJSValue JSC_HOST_CALL functionVersion(ExecState*); static EncodedJSValue JSC_HOST_CALL functionRun(ExecState*); static EncodedJSValue JSC_HOST_CALL functionLoad(ExecState*); +static EncodedJSValue JSC_HOST_CALL functionReadFile(ExecState*); static EncodedJSValue JSC_HOST_CALL functionCheckSyntax(ExecState*); static EncodedJSValue JSC_HOST_CALL functionReadline(ExecState*); static EncodedJSValue JSC_HOST_CALL functionPreciseTime(ExecState*); static EncodedJSValue JSC_HOST_CALL functionNeverInlineFunction(ExecState*); static EncodedJSValue JSC_HOST_CALL functionNumberOfDFGCompiles(ExecState*); +static EncodedJSValue JSC_HOST_CALL functionTransferArrayBuffer(ExecState*); static NO_RETURN_WITH_VALUE EncodedJSValue JSC_HOST_CALL functionQuit(ExecState*); #if ENABLE(SAMPLING_FLAGS) @@ -226,12 +226,15 @@ class GlobalObject : public JSGlobalObject { addFunction(vm, "version", functionVersion, 1); addFunction(vm, "run", functionRun, 1); addFunction(vm, "load", functionLoad, 1); + addFunction(vm, "readFile", functionReadFile, 1); addFunction(vm, "checkSyntax", functionCheckSyntax, 1); addFunction(vm, "jscStack", functionJSCStack, 1); addFunction(vm, "readline", functionReadline, 0); addFunction(vm, "preciseTime", functionPreciseTime, 0); addFunction(vm, "neverInlineFunction", functionNeverInlineFunction, 1); + addFunction(vm, "noInline", functionNeverInlineFunction, 1); addFunction(vm, "numberOfDFGCompiles", functionNumberOfDFGCompiles, 1); + addFunction(vm, "transferArrayBuffer", functionTransferArrayBuffer, 1); #if ENABLE(SAMPLING_FLAGS) addFunction(vm, "setSamplingFlags", functionSetSamplingFlags, 1); addFunction(vm, "clearSamplingFlags", functionClearSamplingFlags, 1); @@ -306,7 +309,7 @@ EncodedJSValue JSC_HOST_CALL functionPrint(ExecState* exec) #ifndef NDEBUG EncodedJSValue JSC_HOST_CALL functionDumpCallFrame(ExecState* exec) { - if (!exec->callerFrame()->hasHostCallFrameFlag()) + if (!exec->callerFrame()->isVMEntrySentinel()) exec->vm().interpreter->dumpCallFrame(exec->callerFrame()); return JSValue::encode(jsUndefined()); } @@ -420,6 +423,16 @@ EncodedJSValue JSC_HOST_CALL functionLoad(ExecState* exec) return JSValue::encode(result); } +EncodedJSValue JSC_HOST_CALL functionReadFile(ExecState* exec) +{ + String fileName = exec->argument(0).toString(exec)->value(exec); + Vector script; + if (!fillBufferWithContentsOfFile(fileName, script)) + return JSValue::encode(exec->vm().throwException(exec, createError(exec, "Could not open file."))); + + return JSValue::encode(jsString(exec, stringFromUTF(script.data()))); +} + EncodedJSValue JSC_HOST_CALL functionCheckSyntax(ExecState* exec) { String fileName = exec->argument(0).toString(exec)->value(exec); @@ -492,6 +505,21 @@ EncodedJSValue JSC_HOST_CALL functionNumberOfDFGCompiles(ExecState* exec) return JSValue::encode(numberOfDFGCompiles(exec)); } +EncodedJSValue JSC_HOST_CALL functionTransferArrayBuffer(ExecState* exec) +{ + if (exec->argumentCount() < 1) + return JSValue::encode(exec->vm().throwException(exec, createError(exec, "Not enough arguments"))); + + JSArrayBuffer* buffer = jsDynamicCast(exec->argument(0)); + if (!buffer) + return JSValue::encode(exec->vm().throwException(exec, createError(exec, "Expected an array buffer"))); + + ArrayBufferContents dummyContents; + buffer->impl()->transfer(dummyContents); + + return JSValue::encode(jsUndefined()); +} + EncodedJSValue JSC_HOST_CALL functionQuit(ExecState*) { exit(EXIT_SUCCESS); @@ -507,7 +535,7 @@ EncodedJSValue JSC_HOST_CALL functionQuit(ExecState*) // be in a separate main function because the jscmain function requires object // unwinding. -#if COMPILER(MSVC) && !COMPILER(INTEL) && !defined(_DEBUG) && !OS(WINCE) +#if COMPILER(MSVC) && !defined(_DEBUG) && !OS(WINCE) #define TRY __try { #define EXCEPT(x) } __except (EXCEPTION_EXECUTE_HANDLER) { x; } #else @@ -518,17 +546,11 @@ EncodedJSValue JSC_HOST_CALL functionQuit(ExecState*) int jscmain(int argc, char** argv); static double s_desiredTimeout; -static double s_timeToWake; static NO_RETURN_DUE_TO_CRASH void timeoutThreadMain(void*) { - // WTF doesn't provide for a portable sleep(), so we use the ThreadCondition, which - // is close enough. - Mutex mutex; - ThreadCondition condition; - mutex.lock(); - while (currentTime() < s_timeToWake) - condition.timedWait(mutex, s_timeToWake); + auto timeout = std::chrono::microseconds(static_cast(s_desiredTimeout * 1000000)); + std::this_thread::sleep_for(timeout); dataLog("Timed out after ", s_desiredTimeout, " seconds!\n"); CRASH(); @@ -550,7 +572,6 @@ int main(int argc, char** argv) // testing/debugging, as it causes the post-mortem debugger not to be invoked. We reset the // error mode here to work around Cygwin's behavior. See . ::SetErrorMode(0); -#endif #if defined(_DEBUG) _CrtSetReportFile(_CRT_WARN, _CRTDBG_FILE_STDERR); @@ -560,13 +581,9 @@ int main(int argc, char** argv) _CrtSetReportFile(_CRT_ASSERT, _CRTDBG_FILE_STDERR); _CrtSetReportMode(_CRT_ASSERT, _CRTDBG_MODE_FILE); #endif - - timeBeginPeriod(1); #endif -#if PLATFORM(BLACKBERRY) - // Write all WTF logs to the system log - BlackBerry::Platform::setupApplicationLogging("jsc"); + timeBeginPeriod(1); #endif #if PLATFORM(EFL) @@ -585,10 +602,8 @@ int main(int argc, char** argv) dataLog( "WARNING: timeout string is malformed, got ", timeoutString, " but expected a number. Not using a timeout.\n"); - } else { - s_timeToWake = currentTime() + s_desiredTimeout; + } else createThread(timeoutThreadMain, 0, "jsc Timeout Thread"); - } } #endif diff --git a/JavaScriptCore/llint/LLIntCLoop.cpp b/JavaScriptCore/llint/LLIntCLoop.cpp index 14fc0493..18c2b99c 100644 --- a/JavaScriptCore/llint/LLIntCLoop.cpp +++ b/JavaScriptCore/llint/LLIntCLoop.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2011, 2012 Apple Inc. All rights reserved. + * Copyright (C) 2012, 2013 Apple Inc. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -26,51 +26,19 @@ #include "config.h" #include "LLIntCLoop.h" -#include "Instruction.h" +#if ENABLE(LLINT_C_LOOP) -namespace JSC { +#include "LLIntData.h" +namespace JSC { namespace LLInt { -#if ENABLE(LLINT_C_LOOP) - void CLoop::initialize() { - execute(0, llint_unused, true); + execute(0, getOpcode(llint_unused), true); } -void* CLoop::catchRoutineFor(Instruction* catchPCForInterpreter) -{ - return reinterpret_cast(catchPCForInterpreter->u.opcode); -} - -MacroAssemblerCodePtr CLoop::hostCodeEntryFor(CodeSpecializationKind kind) -{ - MacroAssemblerCodePtr codePtr; - codePtr = (kind == CodeForCall) ? - MacroAssemblerCodePtr::createLLIntCodePtr(llint_native_call_trampoline) : - MacroAssemblerCodePtr::createLLIntCodePtr(llint_native_construct_trampoline); - return codePtr; -} - -MacroAssemblerCodePtr CLoop::jsCodeEntryWithArityCheckFor(CodeSpecializationKind kind) -{ - MacroAssemblerCodePtr codePtr; - codePtr = (kind == CodeForCall) ? - MacroAssemblerCodePtr::createLLIntCodePtr(llint_function_for_call_arity_check) : - MacroAssemblerCodePtr::createLLIntCodePtr(llint_function_for_construct_arity_check); - return codePtr; -} - -MacroAssemblerCodePtr CLoop::jsCodeEntryFor(CodeSpecializationKind kind) -{ - MacroAssemblerCodePtr codePtr; - codePtr = (kind == CodeForCall) ? - MacroAssemblerCodePtr::createLLIntCodePtr(llint_function_for_call_prologue) : - MacroAssemblerCodePtr::createLLIntCodePtr(llint_function_for_construct_prologue); - return codePtr; -} +} // namespace LLInt +} // namespace JSC #endif // ENABLE(LLINT_C_LOOP) - -} } // namespace JSC::LLInt diff --git a/JavaScriptCore/llint/LLIntCLoop.h b/JavaScriptCore/llint/LLIntCLoop.h index 231e52f6..8759571f 100644 --- a/JavaScriptCore/llint/LLIntCLoop.h +++ b/JavaScriptCore/llint/LLIntCLoop.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2011, 2012 Apple Inc. All rights reserved. + * Copyright (C) 2012, 2013 Apple Inc. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -28,14 +28,11 @@ #if ENABLE(LLINT_C_LOOP) -#include "CodeSpecializationKind.h" +#include "CallFrame.h" #include "JSCJSValue.h" -#include "MacroAssemblerCodeRef.h" #include "Opcode.h" -#include "Register.h" namespace JSC { - namespace LLInt { const OpcodeID llint_unused = llint_end; @@ -43,17 +40,13 @@ const OpcodeID llint_unused = llint_end; class CLoop { public: static void initialize(); - static JSValue execute(CallFrame*, OpcodeID bootstrapOpcodeId, bool isInitializationPass = false); - - static void* catchRoutineFor(Instruction* catchPCForInterpreter); - - static MacroAssemblerCodePtr hostCodeEntryFor(CodeSpecializationKind); - static MacroAssemblerCodePtr jsCodeEntryWithArityCheckFor(CodeSpecializationKind); - static MacroAssemblerCodePtr jsCodeEntryFor(CodeSpecializationKind); + static JSValue execute(CallFrame*, Opcode entryOpcode, bool isInitializationPass = false); }; } } // namespace JSC::LLInt +using JSC::LLInt::CLoop; + #endif // ENABLE(LLINT_C_LOOP) #endif // LLIntCLoop_h diff --git a/JavaScriptCore/llint/LLIntCommon.h b/JavaScriptCore/llint/LLIntCommon.h index 61ffe183..d32a264e 100644 --- a/JavaScriptCore/llint/LLIntCommon.h +++ b/JavaScriptCore/llint/LLIntCommon.h @@ -43,14 +43,5 @@ // Disable inline caching of get_by_id and put_by_id. #define LLINT_ALWAYS_ACCESS_SLOW 0 -// Enable OSR into the JIT. Disabling this while the LLInt is enabled effectively -// turns off all JIT'ing, since in LLInt's parlance, OSR subsumes any form of JIT -// invocation. -#if ENABLE(JIT) && !ENABLE(ALLOCATION_LOGGING) -#define LLINT_OSR_TO_JIT 1 -#else -#define LLINT_OSR_TO_JIT 0 -#endif - #endif // LLIntCommon_h diff --git a/JavaScriptCore/llint/LLIntEntrypoint.cpp b/JavaScriptCore/llint/LLIntEntrypoint.cpp index 1ffb26fb..993ec67b 100644 --- a/JavaScriptCore/llint/LLIntEntrypoint.cpp +++ b/JavaScriptCore/llint/LLIntEntrypoint.cpp @@ -35,71 +35,73 @@ #include "LowLevelInterpreter.h" #include "VM.h" - namespace JSC { namespace LLInt { static void setFunctionEntrypoint(VM& vm, CodeBlock* codeBlock) { CodeSpecializationKind kind = codeBlock->specializationKind(); - if (!vm.canUseJIT()) { +#if ENABLE(JIT) + if (vm.canUseJIT()) { if (kind == CodeForCall) { codeBlock->setJITCode( - adoptRef(new DirectJITCode(MacroAssemblerCodeRef::createLLIntCodeRef(llint_function_for_call_prologue), JITCode::InterpreterThunk)), - MacroAssemblerCodePtr::createLLIntCodePtr(llint_function_for_call_arity_check)); + adoptRef(new DirectJITCode(vm.getCTIStub(functionForCallEntryThunkGenerator), JITCode::InterpreterThunk)), + vm.getCTIStub(functionForCallArityCheckThunkGenerator).code()); return; } - ASSERT(kind == CodeForConstruct); codeBlock->setJITCode( - adoptRef(new DirectJITCode(MacroAssemblerCodeRef::createLLIntCodeRef(llint_function_for_construct_prologue), JITCode::InterpreterThunk)), - MacroAssemblerCodePtr::createLLIntCodePtr(llint_function_for_construct_arity_check)); + adoptRef(new DirectJITCode(vm.getCTIStub(functionForConstructEntryThunkGenerator), JITCode::InterpreterThunk)), + vm.getCTIStub(functionForConstructArityCheckThunkGenerator).code()); return; } - -#if ENABLE(JIT) +#endif // ENABLE(JIT) + + UNUSED_PARAM(vm); if (kind == CodeForCall) { codeBlock->setJITCode( - adoptRef(new DirectJITCode(vm.getCTIStub(functionForCallEntryThunkGenerator), JITCode::InterpreterThunk)), - vm.getCTIStub(functionForCallArityCheckThunkGenerator).code()); + adoptRef(new DirectJITCode(MacroAssemblerCodeRef::createLLIntCodeRef(llint_function_for_call_prologue), JITCode::InterpreterThunk)), + MacroAssemblerCodePtr::createLLIntCodePtr(llint_function_for_call_arity_check)); return; } - ASSERT(kind == CodeForConstruct); codeBlock->setJITCode( - adoptRef(new DirectJITCode(vm.getCTIStub(functionForConstructEntryThunkGenerator), JITCode::InterpreterThunk)), - vm.getCTIStub(functionForConstructArityCheckThunkGenerator).code()); -#endif // ENABLE(JIT) + adoptRef(new DirectJITCode(MacroAssemblerCodeRef::createLLIntCodeRef(llint_function_for_construct_prologue), JITCode::InterpreterThunk)), + MacroAssemblerCodePtr::createLLIntCodePtr(llint_function_for_construct_arity_check)); } static void setEvalEntrypoint(VM& vm, CodeBlock* codeBlock) { - if (!vm.canUseJIT()) { +#if ENABLE(JIT) + if (vm.canUseJIT()) { codeBlock->setJITCode( - adoptRef(new DirectJITCode(MacroAssemblerCodeRef::createLLIntCodeRef(llint_eval_prologue), JITCode::InterpreterThunk)), + adoptRef(new DirectJITCode(vm.getCTIStub(evalEntryThunkGenerator), JITCode::InterpreterThunk)), MacroAssemblerCodePtr()); return; } -#if ENABLE(JIT) +#endif // ENABLE(JIT) + + UNUSED_PARAM(vm); codeBlock->setJITCode( - adoptRef(new DirectJITCode(vm.getCTIStub(evalEntryThunkGenerator), JITCode::InterpreterThunk)), + adoptRef(new DirectJITCode(MacroAssemblerCodeRef::createLLIntCodeRef(llint_eval_prologue), JITCode::InterpreterThunk)), MacroAssemblerCodePtr()); -#endif } static void setProgramEntrypoint(VM& vm, CodeBlock* codeBlock) { - if (!vm.canUseJIT()) { +#if ENABLE(JIT) + if (vm.canUseJIT()) { codeBlock->setJITCode( - adoptRef(new DirectJITCode(MacroAssemblerCodeRef::createLLIntCodeRef(llint_program_prologue), JITCode::InterpreterThunk)), + adoptRef(new DirectJITCode(vm.getCTIStub(programEntryThunkGenerator), JITCode::InterpreterThunk)), MacroAssemblerCodePtr()); return; } -#if ENABLE(JIT) +#endif // ENABLE(JIT) + + UNUSED_PARAM(vm); codeBlock->setJITCode( - adoptRef(new DirectJITCode(vm.getCTIStub(programEntryThunkGenerator), JITCode::InterpreterThunk)), + adoptRef(new DirectJITCode(MacroAssemblerCodeRef::createLLIntCodeRef(llint_program_prologue), JITCode::InterpreterThunk)), MacroAssemblerCodePtr()); -#endif } void setEntrypoint(VM& vm, CodeBlock* codeBlock) @@ -119,6 +121,11 @@ void setEntrypoint(VM& vm, CodeBlock* codeBlock) RELEASE_ASSERT_NOT_REACHED(); } +unsigned frameRegisterCountFor(CodeBlock* codeBlock) +{ + return codeBlock->m_numCalleeRegisters; +} + } } // namespace JSC::LLInt #endif // ENABLE(LLINT) diff --git a/JavaScriptCore/llint/LLIntEntrypoint.h b/JavaScriptCore/llint/LLIntEntrypoint.h index 056fe036..4b687c6d 100644 --- a/JavaScriptCore/llint/LLIntEntrypoint.h +++ b/JavaScriptCore/llint/LLIntEntrypoint.h @@ -41,6 +41,8 @@ namespace LLInt { void setEntrypoint(VM&, CodeBlock*); +unsigned frameRegisterCountFor(CodeBlock*); + } } // namespace JSC::LLInt #endif // ENABLE(LLINT) diff --git a/JavaScriptCore/llint/LLIntOfflineAsmConfig.h b/JavaScriptCore/llint/LLIntOfflineAsmConfig.h index 9a2d68f9..07a91bb7 100644 --- a/JavaScriptCore/llint/LLIntOfflineAsmConfig.h +++ b/JavaScriptCore/llint/LLIntOfflineAsmConfig.h @@ -38,6 +38,7 @@ #define OFFLINE_ASM_ARM 0 #define OFFLINE_ASM_ARMv7 0 #define OFFLINE_ASM_ARMv7_TRADITIONAL 0 +#define OFFLINE_ASM_ARM64 0 #define OFFLINE_ASM_X86_64 0 #define OFFLINE_ASM_ARMv7s 0 #define OFFLINE_ASM_MIPS 0 @@ -96,14 +97,27 @@ #define OFFLINE_ASM_SH4 0 #endif -#endif // !ENABLE(LLINT_C_LOOP) - #if CPU(ARM64) #define OFFLINE_ASM_ARM64 1 #else #define OFFLINE_ASM_ARM64 0 #endif +#if CPU(MIPS) +#ifdef WTF_MIPS_PIC +#define S(x) #x +#define SX(x) S(x) +#define OFFLINE_ASM_CPLOAD(reg) \ + ".set noreorder\n" \ + ".cpload " SX(reg) "\n" \ + ".set reorder\n" +#else +#define OFFLINE_ASM_CPLOAD(reg) +#endif +#endif + +#endif // !ENABLE(LLINT_C_LOOP) + #if USE(JSVALUE64) #define OFFLINE_ASM_JSVALUE64 1 #else @@ -122,12 +136,6 @@ #define OFFLINE_ASM_BIG_ENDIAN 0 #endif -#if LLINT_OSR_TO_JIT -#define OFFLINE_ASM_JIT_ENABLED 1 -#else -#define OFFLINE_ASM_JIT_ENABLED 0 -#endif - #if LLINT_EXECUTION_TRACING #define OFFLINE_ASM_EXECUTION_TRACING 1 #else @@ -140,23 +148,10 @@ #define OFFLINE_ASM_ALWAYS_ALLOCATE_SLOW 0 #endif -#if ENABLE(VALUE_PROFILER) -#define OFFLINE_ASM_VALUE_PROFILER 1 +#if ENABLE(GGC) +#define OFFLINE_ASM_GGC 1 #else -#define OFFLINE_ASM_VALUE_PROFILER 0 -#endif - -#if CPU(MIPS) -#ifdef WTF_MIPS_PIC -#define S(x) #x -#define SX(x) S(x) -#define OFFLINE_ASM_CPLOAD(reg) \ - ".set noreorder\n" \ - ".cpload " SX(reg) "\n" \ - ".set reorder\n" -#else -#define OFFLINE_ASM_CPLOAD(reg) -#endif +#define OFFLINE_ASM_GGC 0 #endif #endif // LLIntOfflineAsmConfig_h diff --git a/JavaScriptCore/llint/LLIntOffsetsExtractor.cpp b/JavaScriptCore/llint/LLIntOffsetsExtractor.cpp index 69c10206..a0cbfa0b 100644 --- a/JavaScriptCore/llint/LLIntOffsetsExtractor.cpp +++ b/JavaScriptCore/llint/LLIntOffsetsExtractor.cpp @@ -46,7 +46,7 @@ #include "JumpTable.h" #include "LLIntOfflineAsmConfig.h" #include "MarkedSpace.h" - +#include "ProtoCallFrame.h" #include "Structure.h" #include "StructureChain.h" #include "ValueProfile.h" diff --git a/JavaScriptCore/llint/LLIntOpcode.h b/JavaScriptCore/llint/LLIntOpcode.h index 3588f4ff..7ee53df8 100644 --- a/JavaScriptCore/llint/LLIntOpcode.h +++ b/JavaScriptCore/llint/LLIntOpcode.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2012 Apple Inc. All rights reserved. + * Copyright (C) 2012, 2013 Apple Inc. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -34,7 +34,7 @@ #define FOR_EACH_LLINT_NOJIT_NATIVE_HELPER(macro) \ macro(getHostCallReturnValue, 1) \ - macro(ctiOpThrowNotCaught, 1) + macro(returnFromJavaScript, 1) #else // !ENABLE(LLINT_C_LOOP) diff --git a/JavaScriptCore/llint/LLIntSlowPaths.cpp b/JavaScriptCore/llint/LLIntSlowPaths.cpp index 10b77a68..26264171 100644 --- a/JavaScriptCore/llint/LLIntSlowPaths.cpp +++ b/JavaScriptCore/llint/LLIntSlowPaths.cpp @@ -43,6 +43,7 @@ #include "JSGlobalObjectFunctions.h" #include "JSNameScope.h" #include "JSPropertyNameIterator.h" +#include "JSStackInlines.h" #include "JSString.h" #include "JSWithScope.h" #include "LLIntCommon.h" @@ -118,7 +119,6 @@ namespace JSC { namespace LLInt { LLINT_END_IMPL(); \ } while (false) -#if ENABLE(VALUE_PROFILER) #define LLINT_RETURN_PROFILED(opcode, value) do { \ JSValue __rp_returnValue = (value); \ LLINT_CHECK_EXCEPTION(); \ @@ -132,16 +132,9 @@ namespace JSC { namespace LLInt { JSValue::encode(value); \ } while (false) -#else // ENABLE(VALUE_PROFILER) -#define LLINT_RETURN_PROFILED(opcode, value) LLINT_RETURN(value) - -#define LLINT_PROFILE_VALUE(opcode, value) do { } while (false) - -#endif // ENABLE(VALUE_PROFILER) - #define LLINT_CALL_END_IMPL(exec, callTarget) LLINT_RETURN_TWO((callTarget), (exec)) -#define LLINT_CALL_THROW(exec, pc, exceptionToThrow) do { \ +#define LLINT_CALL_THROW(exec, exceptionToThrow) do { \ ExecState* __ct_exec = (exec); \ vm.throwException(__ct_exec, exceptionToThrow); \ LLINT_CALL_END_IMPL(__ct_exec, callToThrow(__ct_exec)); \ @@ -153,7 +146,7 @@ namespace JSC { namespace LLInt { LLINT_CALL_END_IMPL(__cce_exec, callToThrow(__cce_exec)); \ } while (false) -#define LLINT_CALL_RETURN(exec, pc, callTarget) do { \ +#define LLINT_CALL_RETURN(exec, callTarget) do { \ ExecState* __cr_exec = (exec); \ void* __cr_callTarget = (callTarget); \ LLINT_CALL_CHECK_EXCEPTION(__cr_exec->callerFrame()); \ @@ -267,6 +260,8 @@ LLINT_SLOW_PATH_DECL(special_trace) LLINT_END_IMPL(); } +enum EntryKind { Prologue, ArityCheck }; + #if ENABLE(JIT) inline bool shouldJIT(ExecState* exec) { @@ -320,7 +315,6 @@ inline bool jitCompileAndSetHeuristics(CodeBlock* codeBlock, ExecState* exec) } } -enum EntryKind { Prologue, ArityCheck }; static SlowPathReturnType entryOSR(ExecState* exec, Instruction*, CodeBlock* codeBlock, const char *name, EntryKind kind) { if (Options::verboseOSR()) { @@ -341,6 +335,13 @@ static SlowPathReturnType entryOSR(ExecState* exec, Instruction*, CodeBlock* cod ASSERT(kind == ArityCheck); LLINT_RETURN_TWO(codeBlock->jitCodeWithArityCheck().executableAddress(), exec); } +#else // ENABLE(JIT) +static SlowPathReturnType entryOSR(ExecState* exec, Instruction*, CodeBlock* codeBlock, const char*, EntryKind) +{ + codeBlock->dontJITAnytimeSoon(); + LLINT_RETURN_TWO(0, exec); +} +#endif // ENABLE(JIT) LLINT_SLOW_PATH_DECL(entry_osr) { @@ -371,6 +372,7 @@ LLINT_SLOW_PATH_DECL(loop_osr) { CodeBlock* codeBlock = exec->codeBlock(); +#if ENABLE(JIT) if (Options::verboseOSR()) { dataLog( *codeBlock, ": Entered loop_osr with executeCounter = ", @@ -397,12 +399,17 @@ LLINT_SLOW_PATH_DECL(loop_osr) ASSERT(jumpTarget); LLINT_RETURN_TWO(jumpTarget, exec); +#else // ENABLE(JIT) + codeBlock->dontJITAnytimeSoon(); + LLINT_RETURN_TWO(0, exec); +#endif // ENABLE(JIT) } LLINT_SLOW_PATH_DECL(replace) { CodeBlock* codeBlock = exec->codeBlock(); +#if ENABLE(JIT) if (Options::verboseOSR()) { dataLog( *codeBlock, ": Entered replace with executeCounter = ", @@ -414,8 +421,11 @@ LLINT_SLOW_PATH_DECL(replace) else codeBlock->dontJITAnytimeSoon(); LLINT_END_IMPL(); -} +#else // ENABLE(JIT) + codeBlock->dontJITAnytimeSoon(); + LLINT_END_IMPL(); #endif // ENABLE(JIT) +} LLINT_SLOW_PATH_DECL(stack_check) { @@ -547,16 +557,12 @@ LLINT_SLOW_PATH_DECL(slow_path_get_by_id) && isJSArray(baseValue) && ident == exec->propertyNames().length) { pc[0].u.opcode = LLInt::getOpcode(llint_op_get_array_length); -#if ENABLE(VALUE_PROFILER) ArrayProfile* arrayProfile = codeBlock->getOrAddArrayProfile(pc - codeBlock->instructions().begin()); arrayProfile->observeStructure(baseValue.asCell()->structure()); pc[4].u.arrayProfile = arrayProfile; -#endif } -#if ENABLE(VALUE_PROFILER) pc[OPCODE_LENGTH(op_get_by_id) - 1].u.profile->m_buckets[0] = JSValue::encode(result); -#endif LLINT_END(); } @@ -577,7 +583,7 @@ LLINT_SLOW_PATH_DECL(slow_path_put_by_id) const Identifier& ident = codeBlock->identifier(pc[2].u.operand); JSValue baseValue = LLINT_OP_C(1).jsValue(); - PutPropertySlot slot(codeBlock->isStrictMode(), codeBlock->putByIdContext()); + PutPropertySlot slot(baseValue, codeBlock->isStrictMode(), codeBlock->putByIdContext()); if (pc[8].u.operand) asObject(baseValue)->putDirect(vm, ident, LLINT_OP_C(3).jsValue(), slot); else @@ -733,14 +739,14 @@ LLINT_SLOW_PATH_DECL(slow_path_put_by_val) } if (isName(subscript)) { - PutPropertySlot slot(exec->codeBlock()->isStrictMode()); + PutPropertySlot slot(baseValue, exec->codeBlock()->isStrictMode()); baseValue.put(exec, jsCast(subscript.asCell())->privateName(), value, slot); LLINT_END(); } Identifier property(exec, subscript.toString(exec)->value(exec)); LLINT_CHECK_EXCEPTION(); - PutPropertySlot slot(exec->codeBlock()->isStrictMode()); + PutPropertySlot slot(baseValue, exec->codeBlock()->isStrictMode()); baseValue.put(exec, property, value, slot); LLINT_END(); } @@ -758,12 +764,12 @@ LLINT_SLOW_PATH_DECL(slow_path_put_by_val_direct) uint32_t i = subscript.asUInt32(); baseObject->putDirectIndex(exec, i, value); } else if (isName(subscript)) { - PutPropertySlot slot(exec->codeBlock()->isStrictMode()); + PutPropertySlot slot(baseObject, exec->codeBlock()->isStrictMode()); baseObject->putDirect(exec->vm(), jsCast(subscript.asCell())->privateName(), value, slot); } else { Identifier property(exec, subscript.toString(exec)->value(exec)); if (!exec->vm().exception()) { // Don't put to an object if toString threw an exception. - PutPropertySlot slot(exec->codeBlock()->isStrictMode()); + PutPropertySlot slot(baseObject, exec->codeBlock()->isStrictMode()); baseObject->putDirect(exec->vm(), property, value, slot); } } @@ -962,6 +968,8 @@ LLINT_SLOW_PATH_DECL(slow_path_new_func_exp) static SlowPathReturnType handleHostCall(ExecState* execCallee, Instruction* pc, JSValue callee, CodeSpecializationKind kind) { + UNUSED_PARAM(pc); + #if LLINT_SLOW_PATH_TRACING dataLog("Performing host call.\n"); #endif @@ -984,7 +992,7 @@ static SlowPathReturnType handleHostCall(ExecState* execCallee, Instruction* pc, execCallee->setCallee(asObject(callee)); vm.hostCallReturnValue = JSValue::decode(callData.native.function(execCallee)); - LLINT_CALL_RETURN(execCallee, pc, LLInt::getCodePtr(getHostCallReturnValue)); + LLINT_CALL_RETURN(execCallee, LLInt::getCodePtr(getHostCallReturnValue)); } #if LLINT_SLOW_PATH_TRACING @@ -992,7 +1000,7 @@ static SlowPathReturnType handleHostCall(ExecState* execCallee, Instruction* pc, #endif ASSERT(callType == CallTypeNone); - LLINT_CALL_THROW(exec, pc, createNotAFunctionError(exec, callee)); + LLINT_CALL_THROW(exec, createNotAFunctionError(exec, callee)); } ASSERT(kind == CodeForConstruct); @@ -1007,7 +1015,7 @@ static SlowPathReturnType handleHostCall(ExecState* execCallee, Instruction* pc, execCallee->setCallee(asObject(callee)); vm.hostCallReturnValue = JSValue::decode(constructData.native.function(execCallee)); - LLINT_CALL_RETURN(execCallee, pc, LLInt::getCodePtr(getHostCallReturnValue)); + LLINT_CALL_RETURN(execCallee, LLInt::getCodePtr(getHostCallReturnValue)); } #if LLINT_SLOW_PATH_TRACING @@ -1015,7 +1023,7 @@ static SlowPathReturnType handleHostCall(ExecState* execCallee, Instruction* pc, #endif ASSERT(constructType == ConstructTypeNone); - LLINT_CALL_THROW(exec, pc, createNotAConstructorError(exec, callee)); + LLINT_CALL_THROW(exec, createNotAConstructorError(exec, callee)); } inline SlowPathReturnType setUpCall(ExecState* execCallee, Instruction* pc, CodeSpecializationKind kind, JSValue calleeAsValue, LLIntCallLinkInfo* callLinkInfo = 0) @@ -1042,7 +1050,7 @@ inline SlowPathReturnType setUpCall(ExecState* execCallee, Instruction* pc, Code FunctionExecutable* functionExecutable = static_cast(executable); JSObject* error = functionExecutable->prepareForExecution(execCallee, callee->scope(), kind); if (error) - LLINT_CALL_THROW(execCallee->callerFrame(), pc, error); + LLINT_CALL_THROW(execCallee->callerFrame(), error); codeBlock = functionExecutable->codeBlockFor(kind); ASSERT(codeBlock); if (execCallee->argumentCountIncludingThis() < static_cast(codeBlock->numParameters())) @@ -1067,7 +1075,7 @@ inline SlowPathReturnType setUpCall(ExecState* execCallee, Instruction* pc, Code codeBlock->linkIncomingCall(execCaller, callLinkInfo); } - LLINT_CALL_RETURN(execCallee, pc, codePtr.executableAddress()); + LLINT_CALL_RETURN(execCallee, codePtr.executableAddress()); } inline SlowPathReturnType genericCall(ExecState* exec, Instruction* pc, CodeSpecializationKind kind) @@ -1102,19 +1110,33 @@ LLINT_SLOW_PATH_DECL(slow_path_construct) return genericCall(exec, pc, CodeForConstruct); } -LLINT_SLOW_PATH_DECL(slow_path_call_varargs) +LLINT_SLOW_PATH_DECL(slow_path_size_and_alloc_frame_for_varargs) { LLINT_BEGIN(); // This needs to: // - Set up a call frame while respecting the variable arguments. + + ExecState* execCallee = sizeAndAllocFrameForVarargs(exec, &vm.interpreter->stack(), + LLINT_OP_C(4).jsValue(), pc[5].u.operand); + LLINT_CALL_CHECK_EXCEPTION(exec); + + vm.newCallFrameReturnValue = execCallee; + + LLINT_END(); +} + +LLINT_SLOW_PATH_DECL(slow_path_call_varargs) +{ + LLINT_BEGIN_NO_SET_PC(); + // This needs to: // - Figure out what to call and compile it if necessary. // - Return a tuple of machine code address to call and the new call frame. JSValue calleeAsValue = LLINT_OP_C(2).jsValue(); - ExecState* execCallee = loadVarargs( - exec, &vm.interpreter->stack(), - LLINT_OP_C(3).jsValue(), LLINT_OP_C(4).jsValue(), pc[5].u.operand); + ExecState* execCallee = vm.newCallFrameReturnValue; + + loadVarargs(exec, execCallee, LLINT_OP_C(3).jsValue(), LLINT_OP_C(4).jsValue()); LLINT_CALL_CHECK_EXCEPTION(exec); execCallee->uncheckedR(JSStack::Callee) = calleeAsValue; @@ -1143,7 +1165,7 @@ LLINT_SLOW_PATH_DECL(slow_path_call_eval) return setUpCall(execCallee, pc, CodeForCall, calleeAsValue); vm.hostCallReturnValue = eval(execCallee); - LLINT_CALL_RETURN(execCallee, pc, LLInt::getCodePtr(getHostCallReturnValue)); + LLINT_CALL_RETURN(execCallee, LLInt::getCodePtr(getHostCallReturnValue)); } LLINT_SLOW_PATH_DECL(slow_path_tear_off_activation) @@ -1351,7 +1373,7 @@ LLINT_SLOW_PATH_DECL(slow_path_put_to_scope) if (modeAndType.mode() == ThrowIfNotFound && !scope->hasProperty(exec, ident)) LLINT_THROW(createUndefinedVariableError(exec, ident)); - PutPropertySlot slot(codeBlock->isStrictMode()); + PutPropertySlot slot(scope, codeBlock->isStrictMode()); scope->methodTable()->put(scope, exec, ident, value, slot); // Covers implicit globals. Since they don't exist until they first execute, we didn't know how to cache them at compile time. @@ -1366,6 +1388,11 @@ LLINT_SLOW_PATH_DECL(slow_path_put_to_scope) LLINT_END(); } +extern "C" void llint_write_barrier_slow(ExecState*, JSCell* cell) +{ + Heap::writeBarrier(cell); +} + } } // namespace JSC::LLInt #endif // ENABLE(LLINT) diff --git a/JavaScriptCore/llint/LLIntSlowPaths.h b/JavaScriptCore/llint/LLIntSlowPaths.h index 268665d3..8d60afa2 100644 --- a/JavaScriptCore/llint/LLIntSlowPaths.h +++ b/JavaScriptCore/llint/LLIntSlowPaths.h @@ -41,6 +41,7 @@ namespace LLInt { extern "C" SlowPathReturnType llint_trace_operand(ExecState*, Instruction*, int fromWhere, int operand); extern "C" SlowPathReturnType llint_trace_value(ExecState*, Instruction*, int fromWhere, int operand); +extern "C" void llint_write_barrier_slow(ExecState*, JSCell*); #define LLINT_SLOW_PATH_DECL(name) \ extern "C" SlowPathReturnType llint_##name(ExecState* exec, Instruction* pc) @@ -100,6 +101,7 @@ LLINT_SLOW_PATH_HIDDEN_DECL(slow_path_new_func); LLINT_SLOW_PATH_HIDDEN_DECL(slow_path_new_func_exp); LLINT_SLOW_PATH_HIDDEN_DECL(slow_path_call); LLINT_SLOW_PATH_HIDDEN_DECL(slow_path_construct); +LLINT_SLOW_PATH_HIDDEN_DECL(slow_path_size_and_alloc_frame_for_varargs); LLINT_SLOW_PATH_HIDDEN_DECL(slow_path_call_varargs); LLINT_SLOW_PATH_HIDDEN_DECL(slow_path_call_eval); LLINT_SLOW_PATH_HIDDEN_DECL(slow_path_tear_off_activation); diff --git a/JavaScriptCore/llint/LLIntThunks.cpp b/JavaScriptCore/llint/LLIntThunks.cpp index a7387d54..9429e6cb 100644 --- a/JavaScriptCore/llint/LLIntThunks.cpp +++ b/JavaScriptCore/llint/LLIntThunks.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2012 Apple Inc. All rights reserved. + * Copyright (C) 2012, 2013 Apple Inc. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -26,17 +26,24 @@ #include "config.h" #include "LLIntThunks.h" -#if ENABLE(LLINT) - +#include "CallData.h" +#include "ExceptionHelpers.h" +#include "Interpreter.h" #include "JSInterfaceJIT.h" #include "JSObject.h" +#include "JSStackInlines.h" +#include "LLIntCLoop.h" #include "LinkBuffer.h" #include "LowLevelInterpreter.h" +#include "ProtoCallFrame.h" +#include "VM.h" +namespace JSC { -namespace JSC { namespace LLInt { +#if ENABLE(JIT) +#if ENABLE(LLINT) -#if !ENABLE(LLINT_C_LOOP) +namespace LLInt { static MacroAssemblerCodeRef generateThunkWithJumpTo(VM* vm, void (*target)(), const char *thunkKind) { @@ -80,8 +87,67 @@ MacroAssemblerCodeRef programEntryThunkGenerator(VM* vm) return generateThunkWithJumpTo(vm, llint_program_prologue, "program"); } -#endif // !ENABLE(LLINT_C_LOOP) - -} } // namespace JSC::LLInt +} // namespace LLInt #endif // ENABLE(LLINT) +#else // ENABLE(JIT) + +// Non-JIT (i.e. C Loop LLINT) case: + +typedef JSValue (*ExecuteCode) (CallFrame*, void* executableAddress); + +template +EncodedJSValue doCallToJavaScript(void* executableAddress, ProtoCallFrame* protoCallFrame) +{ + CodeBlock* codeBlock = protoCallFrame->codeBlock(); + JSScope* scope = protoCallFrame->scope(); + JSObject* callee = protoCallFrame->callee(); + int argCountIncludingThis = protoCallFrame->argumentCountIncludingThis(); + int argCount = protoCallFrame->argumentCount(); + JSValue thisValue = protoCallFrame->thisValue(); + JSStack& stack = scope->vm()->interpreter->stack(); + + CallFrame* newCallFrame = stack.pushFrame(codeBlock, scope, argCountIncludingThis, callee); + if (UNLIKELY(!newCallFrame)) { + JSGlobalObject* globalObject = scope->globalObject(); + ExecState* exec = globalObject->globalExec(); + return JSValue::encode(throwStackOverflowError(exec)); + } + + // Set the arguments for the callee: + newCallFrame->setThisValue(thisValue); + for (int i = 0; i < argCount; ++i) + newCallFrame->setArgument(i, protoCallFrame->argument(i)); + + JSValue result = execute(newCallFrame, executableAddress); + + stack.popFrame(newCallFrame); + + return JSValue::encode(result); +} + +static inline JSValue executeJS(CallFrame* newCallFrame, void* executableAddress) +{ + Opcode entryOpcode = *reinterpret_cast(&executableAddress); + return CLoop::execute(newCallFrame, entryOpcode); +} + +EncodedJSValue callToJavaScript(void* executableAddress, ExecState**, ProtoCallFrame* protoCallFrame, Register*) +{ + return doCallToJavaScript(executableAddress, protoCallFrame); +} + +static inline JSValue executeNative(CallFrame* newCallFrame, void* executableAddress) +{ + NativeFunction function = reinterpret_cast(executableAddress); + return JSValue::decode(function(newCallFrame)); +} + +EncodedJSValue callToNativeFunction(void* executableAddress, ExecState**, ProtoCallFrame* protoCallFrame, Register*) +{ + return doCallToJavaScript(executableAddress, protoCallFrame); +} + +#endif // ENABLE(JIT) + +} // namespace JSC diff --git a/JavaScriptCore/llint/LLIntThunks.h b/JavaScriptCore/llint/LLIntThunks.h index b46cc00e..8a894aa4 100644 --- a/JavaScriptCore/llint/LLIntThunks.h +++ b/JavaScriptCore/llint/LLIntThunks.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2012 Apple Inc. All rights reserved. + * Copyright (C) 2012, 2013 Apple Inc. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -34,7 +34,18 @@ namespace JSC { +class ExecState; +class Register; class VM; +struct ProtoCallFrame; + +extern "C" { + EncodedJSValue callToJavaScript(void*, ExecState**, ProtoCallFrame*, Register*); + EncodedJSValue callToNativeFunction(void*, ExecState**, ProtoCallFrame*, Register*); +#if ENABLE(JIT) + void returnFromJavaScript(); +#endif +} namespace LLInt { diff --git a/JavaScriptCore/llint/LowLevelInterpreter.asm b/JavaScriptCore/llint/LowLevelInterpreter.asm index 9f9d8839..396551b9 100644 --- a/JavaScriptCore/llint/LowLevelInterpreter.asm +++ b/JavaScriptCore/llint/LowLevelInterpreter.asm @@ -71,6 +71,11 @@ const DeletedValueTag = -7 const LowestTag = DeletedValueTag end +# Watchpoint states +const ClearWatchpoint = 0 +const IsWatched = 1 +const IsInvalidated = 2 + # Some register conventions. if JSVALUE64 # - Use a pair of registers to represent the PC: one register for the @@ -165,7 +170,11 @@ const Dynamic = 6 const ResolveModeMask = 0xffff -const MarkedBlockMask = ~0xffff +const MarkedBlockSize = 64 * 1024 +const MarkedBlockMask = ~(MarkedBlockSize - 1) +# Constants for checking mark bits. +const AtomNumberShift = 3 +const BitMapWordShift = 4 # Allocation constants if JSVALUE64 @@ -202,11 +211,9 @@ macro assert(assertion) end macro preserveReturnAddressAfterCall(destinationRegister) - if C_LOOP or ARM or ARMv7 or ARMv7_TRADITIONAL or ARM64 or MIPS + if C_LOOP or ARM or ARMv7 or ARMv7_TRADITIONAL or ARM64 or MIPS or SH4 # In C_LOOP case, we're only preserving the bytecode vPC. move lr, destinationRegister - elsif SH4 - stspr destinationRegister elsif X86 or X86_64 pop destinationRegister else @@ -215,11 +222,9 @@ macro preserveReturnAddressAfterCall(destinationRegister) end macro restoreReturnAddressBeforeReturn(sourceRegister) - if C_LOOP or ARM or ARMv7 or ARMv7_TRADITIONAL or ARM64 or MIPS + if C_LOOP or ARM or ARMv7 or ARMv7_TRADITIONAL or ARM64 or MIPS or SH4 # In C_LOOP case, we're only restoring the bytecode vPC. move sourceRegister, lr - elsif SH4 - ldspr sourceRegister elsif X86 or X86_64 push sourceRegister else @@ -258,19 +263,27 @@ end macro arrayProfile(structureAndIndexingType, profile, scratch) const structure = structureAndIndexingType const indexingType = structureAndIndexingType - if VALUE_PROFILER - storep structure, ArrayProfile::m_lastSeenStructure[profile] - end + storep structure, ArrayProfile::m_lastSeenStructure[profile] loadb Structure::m_indexingType[structure], indexingType end +macro checkMarkByte(cell, scratch1, scratch2, continuation) + move cell, scratch1 + move cell, scratch2 + + andp MarkedBlockMask, scratch1 + andp ~MarkedBlockMask, scratch2 + + rshiftp AtomNumberShift + BitMapWordShift, scratch2 + loadb MarkedBlock::m_marks[scratch1, scratch2, 1], scratch1 + continuation(scratch1) +end + macro checkSwitchToJIT(increment, action) - if JIT_ENABLED - loadp CodeBlock[cfr], t0 - baddis increment, CodeBlock::m_llintExecuteCounter + ExecutionCounter::m_counter[t0], .continue - action() + loadp CodeBlock[cfr], t0 + baddis increment, CodeBlock::m_llintExecuteCounter + ExecutionCounter::m_counter[t0], .continue + action() .continue: - end end macro checkSwitchToJITForEpilogue() @@ -320,18 +333,16 @@ macro prologue(codeBlockGetter, codeBlockSetter, osrSlowPath, traceSlowPath) callSlowPath(traceSlowPath) end codeBlockGetter(t1) - if JIT_ENABLED - baddis 5, CodeBlock::m_llintExecuteCounter + ExecutionCounter::m_counter[t1], .continue - cCall2(osrSlowPath, cfr, PC) - move t1, cfr - btpz t0, .recover - loadp ReturnPC[cfr], t2 - restoreReturnAddressBeforeReturn(t2) - jmp t0 - .recover: - codeBlockGetter(t1) - .continue: - end + baddis 5, CodeBlock::m_llintExecuteCounter + ExecutionCounter::m_counter[t1], .continue + cCall2(osrSlowPath, cfr, PC) + move t1, cfr + btpz t0, .recover + loadp ReturnPC[cfr], t2 + restoreReturnAddressBeforeReturn(t2) + jmp t0 +.recover: + codeBlockGetter(t1) +.continue: codeBlockSetter(t1) # Set up the PC. @@ -346,46 +357,43 @@ end # Expects that CodeBlock is in t1, which is what prologue() leaves behind. # Must call dispatch(0) after calling this. macro functionInitialization(profileArgSkip) - if VALUE_PROFILER - # Profile the arguments. Unfortunately, we have no choice but to do this. This - # code is pretty horrendous because of the difference in ordering between - # arguments and value profiles, the desire to have a simple loop-down-to-zero - # loop, and the desire to use only three registers so as to preserve the PC and - # the code block. It is likely that this code should be rewritten in a more - # optimal way for architectures that have more than five registers available - # for arbitrary use in the interpreter. - loadi CodeBlock::m_numParameters[t1], t0 - addp -profileArgSkip, t0 # Use addi because that's what has the peephole - assert(macro (ok) bpgteq t0, 0, ok end) - btpz t0, .argumentProfileDone - loadp CodeBlock::m_argumentValueProfiles + VectorBufferOffset[t1], t3 - mulp sizeof ValueProfile, t0, t2 # Aaaaahhhh! Need strength reduction! - lshiftp 3, t0 - addp t2, t3 - .argumentProfileLoop: - if JSVALUE64 - loadq ThisArgumentOffset - 8 + profileArgSkip * 8[cfr, t0], t2 - subp sizeof ValueProfile, t3 - storeq t2, profileArgSkip * sizeof ValueProfile + ValueProfile::m_buckets[t3] - else - loadi ThisArgumentOffset + TagOffset - 8 + profileArgSkip * 8[cfr, t0], t2 - subp sizeof ValueProfile, t3 - storei t2, profileArgSkip * sizeof ValueProfile + ValueProfile::m_buckets + TagOffset[t3] - loadi ThisArgumentOffset + PayloadOffset - 8 + profileArgSkip * 8[cfr, t0], t2 - storei t2, profileArgSkip * sizeof ValueProfile + ValueProfile::m_buckets + PayloadOffset[t3] - end - baddpnz -8, t0, .argumentProfileLoop - .argumentProfileDone: + # Profile the arguments. Unfortunately, we have no choice but to do this. This + # code is pretty horrendous because of the difference in ordering between + # arguments and value profiles, the desire to have a simple loop-down-to-zero + # loop, and the desire to use only three registers so as to preserve the PC and + # the code block. It is likely that this code should be rewritten in a more + # optimal way for architectures that have more than five registers available + # for arbitrary use in the interpreter. + loadi CodeBlock::m_numParameters[t1], t0 + addp -profileArgSkip, t0 # Use addi because that's what has the peephole + assert(macro (ok) bpgteq t0, 0, ok end) + btpz t0, .argumentProfileDone + loadp CodeBlock::m_argumentValueProfiles + VectorBufferOffset[t1], t3 + mulp sizeof ValueProfile, t0, t2 # Aaaaahhhh! Need strength reduction! + lshiftp 3, t0 + addp t2, t3 +.argumentProfileLoop: + if JSVALUE64 + loadq ThisArgumentOffset - 8 + profileArgSkip * 8[cfr, t0], t2 + subp sizeof ValueProfile, t3 + storeq t2, profileArgSkip * sizeof ValueProfile + ValueProfile::m_buckets[t3] + else + loadi ThisArgumentOffset + TagOffset - 8 + profileArgSkip * 8[cfr, t0], t2 + subp sizeof ValueProfile, t3 + storei t2, profileArgSkip * sizeof ValueProfile + ValueProfile::m_buckets + TagOffset[t3] + loadi ThisArgumentOffset + PayloadOffset - 8 + profileArgSkip * 8[cfr, t0], t2 + storei t2, profileArgSkip * sizeof ValueProfile + ValueProfile::m_buckets + PayloadOffset[t3] end + baddpnz -8, t0, .argumentProfileLoop +.argumentProfileDone: # Check stack height. loadi CodeBlock::m_numCalleeRegisters[t1], t0 addi 1, t0 # Account that local0 goes at slot -1 loadp CodeBlock::m_vm[t1], t2 - loadp VM::interpreter[t2], t2 lshiftp 3, t0 subp cfr, t0, t0 - bpbeq Interpreter::m_stack + JSStack::m_end[t2], t0, .stackHeightOK + bpbeq VM::m_jsStackLimit[t2], t0, .stackHeightOK # Stack height check failed - need to call a slow_path. callSlowPath(_llint_stack_check) @@ -421,6 +429,19 @@ macro doReturn() ret end +if C_LOOP +else +# stub to call into JavaScript or Native functions +# EncodedJSValue callToJavaScript(void* code, ExecState** vm, ProtoCallFrame* protoFrame, Register* topOfStack) +# EncodedJSValue callToNativeFunction(void* code, ExecState** vm, ProtoCallFrame* protoFrame, Register* topOfStack) +# Note, if these stubs or one of their related macros are changed, make the +# equivalent changes in jit/JITStubsX86.h and/or jit/JITStubsMSVC64.asm +_callToJavaScript: + doCallToJavaScript(makeJavaScriptCall, doReturnFromJavaScript) + +_callToNativeFunction: + doCallToJavaScript(makeHostFunctionCall, doReturnFromHostFunction) +end # Indicate the beginning of LLInt. _llint_begin: @@ -470,6 +491,12 @@ end # Value-representation-agnostic code. +_llint_op_touch_entry: + traceExecution() + callSlowPath(_slow_path_touch_entry) + dispatch(1) + + _llint_op_new_array: traceExecution() callSlowPath(_llint_slow_path_new_array) @@ -704,6 +731,8 @@ _llint_op_construct: _llint_op_call_varargs: traceExecution() + callSlowPath(_llint_slow_path_size_and_alloc_frame_for_varargs) + branchIfException(_llint_throw_from_slow_path_trampoline) slowPathForCall(_llint_slow_path_call_varargs) diff --git a/JavaScriptCore/llint/LowLevelInterpreter.cpp b/JavaScriptCore/llint/LowLevelInterpreter.cpp index 6cc050aa..48148c6f 100644 --- a/JavaScriptCore/llint/LowLevelInterpreter.cpp +++ b/JavaScriptCore/llint/LowLevelInterpreter.cpp @@ -90,18 +90,22 @@ using namespace JSC::LLInt; #define OFFLINE_ASM_BEGIN #define OFFLINE_ASM_END +// To keep compilers happy in case of unused labels, force usage of the label: +#define USE_LABEL(label) \ + do { \ + if (false) \ + goto label; \ + } while (false) + +#define OFFLINE_ASM_OPCODE_LABEL(opcode) DEFINE_OPCODE(opcode) USE_LABEL(opcode); -#define OFFLINE_ASM_OPCODE_LABEL(opcode) DEFINE_OPCODE(opcode) #if ENABLE(COMPUTED_GOTO_OPCODES) - #define OFFLINE_ASM_GLUE_LABEL(label) label: +#define OFFLINE_ASM_GLUE_LABEL(label) label: USE_LABEL(label); #else - #define OFFLINE_ASM_GLUE_LABEL(label) case label: label: +#define OFFLINE_ASM_GLUE_LABEL(label) case label: label: USE_LABEL(label); #endif -#define OFFLINE_ASM_LOCAL_LABEL(label) \ - label: \ - if (false) \ - goto label; +#define OFFLINE_ASM_LOCAL_LABEL(label) label: USE_LABEL(label); //============================================================================ @@ -233,8 +237,7 @@ struct CLoopRegister { // The llint C++ interpreter loop: // -JSValue CLoop::execute(CallFrame* callFrame, OpcodeID bootstrapOpcodeId, - bool isInitializationPass) +JSValue CLoop::execute(CallFrame* callFrame, Opcode entryOpcode, bool isInitializationPass) { #define CAST reinterpret_cast #define SIGN_BIT32(x) ((x) & 0x80000000) @@ -348,7 +351,7 @@ JSValue CLoop::execute(CallFrame* callFrame, OpcodeID bootstrapOpcodeId, JSValue functionReturnValue; Opcode opcode; - opcode = LLInt::getOpcode(bootstrapOpcodeId); + opcode = entryOpcode; #if ENABLE(OPCODE_STATS) #define RECORD_OPCODE_STATS(__opcode) \ @@ -428,7 +431,7 @@ JSValue CLoop::execute(CallFrame* callFrame, OpcodeID bootstrapOpcodeId, goto doReturnHelper; } - OFFLINE_ASM_GLUE_LABEL(ctiOpThrowNotCaught) + OFFLINE_ASM_GLUE_LABEL(returnFromJavaScript) { return vm->exception(); } @@ -445,7 +448,7 @@ JSValue CLoop::execute(CallFrame* callFrame, OpcodeID bootstrapOpcodeId, doReturnHelper: { ASSERT(!!callFrame); - if (callFrame->hasHostCallFrameFlag()) { + if (callFrame->isVMEntrySentinel()) { #if USE(JSVALUE32_64) return JSValue(t1.i, t0.i); // returning JSValue(tag, payload); #else @@ -519,8 +522,17 @@ JSValue CLoop::execute(CallFrame* callFrame, OpcodeID bootstrapOpcodeId, // // These are for building an interpreter from generated assembly code: +#if CPU(X86_64) && COMPILER(CLANG) +#define OFFLINE_ASM_BEGIN asm ( \ + ".cfi_startproc\n" + +#define OFFLINE_ASM_END \ + ".cfi_endproc\n" \ +); +#else #define OFFLINE_ASM_BEGIN asm ( #define OFFLINE_ASM_END ); +#endif #define OFFLINE_ASM_OPCODE_LABEL(__opcode) OFFLINE_ASM_GLOBAL_LABEL(llint_##__opcode) #define OFFLINE_ASM_GLUE_LABEL(__opcode) OFFLINE_ASM_GLOBAL_LABEL(__opcode) @@ -533,6 +545,15 @@ JSValue CLoop::execute(CallFrame* callFrame, OpcodeID bootstrapOpcodeId, ".thumb\n" \ ".thumb_func " THUMB_FUNC_PARAM(label) "\n" \ SYMBOL_STRING(label) ":\n" +#elif CPU(X86_64) && COMPILER(CLANG) +#define OFFLINE_ASM_GLOBAL_LABEL(label) \ + ".text\n" \ + ".globl " SYMBOL_STRING(label) "\n" \ + HIDE_SYMBOL(label) "\n" \ + SYMBOL_STRING(label) ":\n" \ + ".cfi_def_cfa rbp, 0\n" \ + ".cfi_offset 16, 8\n" \ + ".cfi_offset 6, 0\n" #else #define OFFLINE_ASM_GLOBAL_LABEL(label) \ ".text\n" \ diff --git a/JavaScriptCore/llint/LowLevelInterpreter32_64.asm b/JavaScriptCore/llint/LowLevelInterpreter32_64.asm index 6a82bdc3..ae1f3d2e 100644 --- a/JavaScriptCore/llint/LowLevelInterpreter32_64.asm +++ b/JavaScriptCore/llint/LowLevelInterpreter32_64.asm @@ -97,17 +97,16 @@ macro dispatchAfterCall() end macro cCall2(function, arg1, arg2) - if ARM or ARMv7 or ARMv7_TRADITIONAL - move arg1, t0 - move arg2, t1 + if ARM or ARMv7 or ARMv7_TRADITIONAL or MIPS + move arg1, a0 + move arg2, a1 call function elsif X86 poke arg1, 0 poke arg2, 1 call function - elsif MIPS or SH4 - move arg1, a0 - move arg2, a1 + elsif SH4 + setargs arg1, arg2 call function elsif C_LOOP cloopCallSlowPath function, arg1, arg2 @@ -118,11 +117,11 @@ end # This barely works. arg3 and arg4 should probably be immediates. macro cCall4(function, arg1, arg2, arg3, arg4) - if ARM or ARMv7 or ARMv7_TRADITIONAL - move arg1, t0 - move arg2, t1 - move arg3, t2 - move arg4, t3 + if ARM or ARMv7 or ARMv7_TRADITIONAL or MIPS + move arg1, a0 + move arg2, a1 + move arg3, a2 + move arg4, a3 call function elsif X86 poke arg1, 0 @@ -130,11 +129,8 @@ macro cCall4(function, arg1, arg2, arg3, arg4) poke arg3, 2 poke arg4, 3 call function - elsif MIPS or SH4 - move arg1, a0 - move arg2, a1 - move arg3, a2 - move arg4, a3 + elsif SH4 + setargs arg1, arg2, arg3, arg4 call function elsif C_LOOP error @@ -149,6 +145,215 @@ macro callSlowPath(slowPath) move t1, cfr end +macro functionPrologue(extraStackSpace) + if X86 + push cfr + move sp, cfr + end + pushCalleeSaves + if ARM or ARMv7 or ARMv7_TRADITIONAL or MIPS + push cfr + push lr + end + subp extraStackSpace, sp +end + +macro functionEpilogue(extraStackSpace) + addp extraStackSpace, sp + if ARM or ARMv7 or ARMv7_TRADITIONAL or MIPS + pop lr + pop cfr + end + popCalleeSaves + if X86 + pop cfr + end +end + +macro doCallToJavaScript(makeCall, doReturn) + if X86 + const entry = t5 + const vmTopCallFrame = t2 + const protoCallFrame = t4 + + const extraStackSpace = 28 + const previousCFR = t0 + const previousPC = t1 + const temp1 = t0 # Same as previousCFR + const temp2 = t1 # Same as previousPC + const temp3 = t2 # same as vmTopCallFrame + const temp4 = t3 + elsif ARM or ARMv7_TRADITIONAL + const entry = a0 + const vmTopCallFrame = a1 + const protoCallFrame = a2 + const topOfStack = a3 + + const extraStackSpace = 16 + const previousCFR = t3 + const previousPC = lr + const temp1 = t3 # Same as previousCFR + const temp2 = a3 # Same as topOfStack + const temp3 = t4 + const temp4 = t5 + elsif ARMv7 + const entry = a0 + const vmTopCallFrame = a1 + const protoCallFrame = a2 + const topOfStack = a3 + + const extraStackSpace = 28 + const previousCFR = t3 + const previousPC = lr + const temp1 = t3 # Same as previousCFR + const temp2 = a3 # Same as topOfStack + const temp3 = t4 + const temp4 = t5 + elsif MIPS + const entry = a0 + const vmTopCallFrame = a1 + const protoCallFrame = a2 + const topOfStack = a3 + + const extraStackSpace = 36 + const previousCFR = t2 + const previousPC = lr + const temp1 = t3 + const temp2 = t4 + const temp3 = t5 + const temp4 = t6 + elsif SH4 + const entry = a0 + const vmTopCallFrame = a1 + const protoCallFrame = a2 + const topOfStack = a3 + + const extraStackSpace = 20 + const previousCFR = t3 + const previousPC = lr + const temp1 = t3 # Same as previousCFR + const temp2 = a3 # Same as topOfStack + const temp3 = t8 + const temp4 = t9 + end + + if X86 + loadp [sp], previousPC + move cfr, previousCFR + end + functionPrologue(extraStackSpace) + if X86 + loadp extraStackSpace+20[sp], entry + loadp extraStackSpace+24[sp], vmTopCallFrame + loadp extraStackSpace+28[sp], protoCallFrame + loadp extraStackSpace+32[sp], cfr + else + move cfr, previousCFR + move topOfStack, cfr + end + + subp (CallFrameHeaderSlots-1)*8, cfr + storep 0, ArgumentCount+4[cfr] + storep 0, ArgumentCount[cfr] + storep 0, Callee+4[cfr] + storep vmTopCallFrame, Callee[cfr] + loadp [vmTopCallFrame], temp4 + storep 0, ScopeChain+4[cfr] + storep temp4, ScopeChain[cfr] + storep 0, CodeBlock+4[cfr] + storep 1, CodeBlock[cfr] + storep previousPC, ReturnPC[cfr] + storep previousCFR, CallerFrame[cfr] + move cfr, temp1 + + loadi ProtoCallFrame::paddedArgCount[protoCallFrame], temp2 + addp CallFrameHeaderSlots, temp2, temp2 + lshiftp 3, temp2 + subp temp2, cfr + storep temp1, CallerFrame[cfr] + + move 5, temp1 + +.copyHeaderLoop: + subi 1, temp1 + loadp [protoCallFrame, temp1, 8], temp3 + storep temp3, CodeBlock[cfr, temp1, 8] + loadp 4[protoCallFrame, temp1, 8], temp3 + storep temp3, CodeBlock+4[cfr, temp1, 8] + btinz temp1, .copyHeaderLoop + + loadi ProtoCallFrame::argCountAndCodeOriginValue[protoCallFrame], temp2 + subi 1, temp2 + loadi ProtoCallFrame::paddedArgCount[protoCallFrame], temp3 + subi 1, temp3 + + bieq temp2, temp3, .copyArgs + move 0, temp1 + move UndefinedTag, temp4 +.fillExtraArgsLoop: + subi 1, temp3 + storep temp1, ThisArgumentOffset+8+PayloadOffset[cfr, temp3, 8] + storep temp4, ThisArgumentOffset+8+TagOffset[cfr, temp3, 8] + bineq temp2, temp3, .fillExtraArgsLoop + +.copyArgs: + loadp ProtoCallFrame::args[protoCallFrame], temp1 + +.copyArgsLoop: + btiz temp2, .copyArgsDone + subi 1, temp2 + loadp PayloadOffset[temp1, temp2, 8], temp3 + loadp TagOffset[temp1, temp2, 8], temp4 + storep temp3, ThisArgumentOffset+8+PayloadOffset[cfr, temp2, 8] + storep temp4, ThisArgumentOffset+8+TagOffset[cfr, temp2, 8] + jmp .copyArgsLoop + +.copyArgsDone: + if X86 + loadp extraStackSpace+24[sp], vmTopCallFrame + end + storep cfr, [vmTopCallFrame] + + makeCall(entry, temp1) + + bpeq CodeBlock[cfr], 1, .calleeFramePopped + loadp CallerFrame[cfr], cfr + +.calleeFramePopped: + loadp Callee[cfr], temp3 # VM.topCallFrame + loadp ScopeChain[cfr], temp4 + storep temp4, [temp3] + + doReturn(extraStackSpace) +end + +macro makeJavaScriptCall(entry, temp) + call entry +end + +macro makeHostFunctionCall(entry, temp) + move entry, temp + if X86 + # Put cfr on stack as arg0, also put it in ecx for "fastcall" targets + poke cfr, 0 + move cfr, t2 + else + move cfr, a0 + end + call temp +end + +macro doReturnFromJavaScript(extraStackSpace) +_returnFromJavaScript: + functionEpilogue(extraStackSpace) + ret +end + +macro doReturnFromHostFunction(extraStackSpace) + functionEpilogue(extraStackSpace) + ret +end + # Debugging operation if you'd like to print an operand in the instruction stream. fromWhere # should be an immediate integer - any integer you like; use it to identify the place you're # debugging from. operand should likewise be an immediate, and should identify the operand @@ -286,18 +491,64 @@ macro loadConstantOrVariablePayloadUnchecked(index, payload) payload) end -macro writeBarrier(tag, payload) - # Nothing to do, since we don't have a generational or incremental collector. +macro writeBarrierOnOperand(cellOperand) + if GGC + loadisFromInstruction(cellOperand, t1) + loadConstantOrVariablePayload(t1, CellTag, t0, .writeBarrierDone) + checkMarkByte(t0, t1, t2, + macro(marked) + btbz marked, .writeBarrierDone + push cfr, PC + # We make two extra slots because cCall2 will poke. + subp 8, sp + cCall2(_llint_write_barrier_slow, cfr, t0) + addp 8, sp + pop PC, cfr + end + ) + .writeBarrierDone: + end end -macro valueProfile(tag, payload, operand, scratch) - if VALUE_PROFILER - loadp operand[PC], scratch - storei tag, ValueProfile::m_buckets + TagOffset[scratch] - storei payload, ValueProfile::m_buckets + PayloadOffset[scratch] +macro writeBarrierOnOperands(cellOperand, valueOperand) + if GGC + loadisFromInstruction(valueOperand, t1) + loadConstantOrVariableTag(t1, t0) + bineq t0, CellTag, .writeBarrierDone + + writeBarrierOnOperand(cellOperand) + .writeBarrierDone: end end +macro writeBarrierOnGlobalObject(valueOperand) + if GGC + loadisFromInstruction(valueOperand, t1) + bineq t0, CellTag, .writeBarrierDone + + loadp CodeBlock[cfr], t0 + loadp CodeBlock::m_globalObject[t0], t0 + checkMarkByte(t0, t1, t2, + macro(marked) + btbz marked, .writeBarrierDone + push cfr, PC + # We make two extra slots because cCall2 will poke. + subp 8, sp + cCall2(_llint_write_barrier_slow, cfr, t0) + addp 8, sp + pop PC, cfr + end + ) + .writeBarrierDone: + end +end + +macro valueProfile(tag, payload, operand, scratch) + loadp operand[PC], scratch + storei tag, ValueProfile::m_buckets + TagOffset[scratch] + storei payload, ValueProfile::m_buckets + PayloadOffset[scratch] +end + # Entrypoints into the interpreter @@ -346,6 +597,16 @@ macro functionArityCheck(doneLabel, slow_path) end +macro branchIfException(label) + loadp ScopeChain[cfr], t3 + andp MarkedBlockMask, t3 + loadp MarkedBlock::m_weakSet + WeakSet::m_vm[t3], t3 + bieq VM::m_exception + TagOffset[t3], EmptyValueTag, .noException + jmp label +.noException: +end + + # Instruction implementations _llint_op_enter: @@ -362,6 +623,7 @@ _llint_op_enter: addi 1, t2 btinz t2, .opEnterLoop .opEnterDone: + callSlowPath(_slow_path_enter) dispatch(1) @@ -465,6 +727,45 @@ _llint_op_mov: dispatch(3) +macro notifyWrite(set, valueTag, valuePayload, scratch, slow) + loadb VariableWatchpointSet::m_state[set], scratch + bieq scratch, IsInvalidated, .done + bineq scratch, ClearWatchpoint, .overwrite + storei valueTag, VariableWatchpointSet::m_inferredValue + TagOffset[set] + storei valuePayload, VariableWatchpointSet::m_inferredValue + PayloadOffset[set] + storeb IsWatched, VariableWatchpointSet::m_state[set] + jmp .done + +.overwrite: + bineq valuePayload, VariableWatchpointSet::m_inferredValue + PayloadOffset[set], .definitelyDifferent + bieq valueTag, VariableWatchpointSet::m_inferredValue + TagOffset[set], .done +.definitelyDifferent: + btbnz VariableWatchpointSet::m_setIsNotEmpty[set], slow + storei EmptyValueTag, VariableWatchpointSet::m_inferredValue + TagOffset[set] + storei 0, VariableWatchpointSet::m_inferredValue + PayloadOffset[set] + storeb IsInvalidated, VariableWatchpointSet::m_state[set] + +.done: +end + +_llint_op_captured_mov: + traceExecution() + loadi 8[PC], t1 + loadConstantOrVariable(t1, t2, t3) + loadpFromInstruction(3, t0) + btpz t0, .opCapturedMovReady + notifyWrite(t0, t2, t3, t1, .opCapturedMovSlow) +.opCapturedMovReady: + loadi 4[PC], t0 + storei t2, TagOffset[cfr, t0, 8] + storei t3, PayloadOffset[cfr, t0, 8] + dispatch(4) + +.opCapturedMovSlow: + callSlowPath(_slow_path_captured_mov) + dispatch(4) + + _llint_op_not: traceExecution() loadi 8[PC], t0 @@ -790,7 +1091,7 @@ macro bitOp(operation, slowPath, advance) bineq t3, Int32Tag, .slow bineq t2, Int32Tag, .slow loadi 4[PC], t2 - operation(t1, t0, .slow) + operation(t1, t0) storei t3, TagOffset[cfr, t2, 8] storei t0, PayloadOffset[cfr, t2, 8] dispatch(advance) @@ -803,7 +1104,7 @@ end _llint_op_lshift: traceExecution() bitOp( - macro (left, right, slow) lshifti left, right end, + macro (left, right) lshifti left, right end, _slow_path_lshift, 4) @@ -811,7 +1112,7 @@ _llint_op_lshift: _llint_op_rshift: traceExecution() bitOp( - macro (left, right, slow) rshifti left, right end, + macro (left, right) rshifti left, right end, _slow_path_rshift, 4) @@ -819,18 +1120,29 @@ _llint_op_rshift: _llint_op_urshift: traceExecution() bitOp( - macro (left, right, slow) - urshifti left, right - bilt right, 0, slow - end, + macro (left, right) urshifti left, right end, _slow_path_urshift, 4) +_llint_op_unsigned: + traceExecution() + loadi 4[PC], t0 + loadi 8[PC], t1 + loadConstantOrVariablePayload(t1, Int32Tag, t2, .opUnsignedSlow) + bilt t2, 0, .opUnsignedSlow + storei t2, PayloadOffset[cfr, t0, 8] + storei Int32Tag, TagOffset[cfr, t0, 8] + dispatch(3) +.opUnsignedSlow: + callSlowPath(_slow_path_unsigned) + dispatch(3) + + _llint_op_bitand: traceExecution() bitOp( - macro (left, right, slow) andi left, right end, + macro (left, right) andi left, right end, _slow_path_bitand, 5) @@ -838,7 +1150,7 @@ _llint_op_bitand: _llint_op_bitxor: traceExecution() bitOp( - macro (left, right, slow) xori left, right end, + macro (left, right) xori left, right end, _slow_path_bitxor, 5) @@ -846,7 +1158,7 @@ _llint_op_bitxor: _llint_op_bitor: traceExecution() bitOp( - macro (left, right, slow) ori left, right end, + macro (left, right) ori left, right end, _slow_path_bitor, 5) @@ -992,10 +1304,10 @@ end _llint_op_init_global_const: traceExecution() + writeBarrierOnGlobalObject(2) loadi 8[PC], t1 loadi 4[PC], t0 loadConstantOrVariable(t1, t2, t3) - writeBarrier(t2, t3) storei t2, TagOffset[t0] storei t3, PayloadOffset[t0] dispatch(5) @@ -1081,6 +1393,7 @@ _llint_op_get_arguments_length: macro putById(getPropertyStorage) traceExecution() + writeBarrierOnOperands(1, 3) loadi 4[PC], t3 loadi 16[PC], t1 loadConstantOrVariablePayload(t3, CellTag, t0, .opPutByIdSlow) @@ -1092,7 +1405,6 @@ macro putById(getPropertyStorage) bpneq JSCell::m_structure[t0], t1, .opPutByIdSlow loadi 20[PC], t1 loadConstantOrVariable2Reg(t2, scratch, t2) - writeBarrier(scratch, t2) storei scratch, TagOffset[propertyStorage, t1] storei t2, PayloadOffset[propertyStorage, t1] dispatch(9) @@ -1113,6 +1425,7 @@ _llint_op_put_by_id_out_of_line: macro putByIdTransition(additionalChecks, getPropertyStorage) traceExecution() + writeBarrierOnOperand(1) loadi 4[PC], t3 loadi 16[PC], t1 loadConstantOrVariablePayload(t3, CellTag, t0, .opPutByIdSlow) @@ -1126,7 +1439,6 @@ macro putByIdTransition(additionalChecks, getPropertyStorage) macro (propertyStorage, scratch) addp t1, propertyStorage, t3 loadConstantOrVariable2Reg(t2, t1, t2) - writeBarrier(t1, t2) storei t1, TagOffset[t3] loadi 24[PC], t1 storei t2, PayloadOffset[t3] @@ -1218,10 +1530,8 @@ _llint_op_get_by_val: dispatch(6) .opGetByValOutOfBounds: - if VALUE_PROFILER - loadpFromInstruction(4, t0) - storeb 1, ArrayProfile::m_outOfBounds[t0] - end + loadpFromInstruction(4, t0) + storeb 1, ArrayProfile::m_outOfBounds[t0] .opGetByValSlow: callSlowPath(_llint_slow_path_get_by_val) dispatch(6) @@ -1291,10 +1601,8 @@ macro contiguousPutByVal(storeCallback) .outOfBounds: biaeq t3, -sizeof IndexingHeader + IndexingHeader::u.lengths.vectorLength[t0], .opPutByValOutOfBounds - if VALUE_PROFILER - loadp 16[PC], t2 - storeb 1, ArrayProfile::m_mayStoreToHole[t2] - end + loadp 16[PC], t2 + storeb 1, ArrayProfile::m_mayStoreToHole[t2] addi 1, t3, t2 storei t2, -sizeof IndexingHeader + IndexingHeader::u.lengths.publicLength[t0] jmp .storeResult @@ -1302,6 +1610,7 @@ end macro putByVal(holeCheck, slowPath) traceExecution() + writeBarrierOnOperands(1, 3) loadi 4[PC], t0 loadConstantOrVariablePayload(t0, CellTag, t1, .opPutByValSlow) loadp JSCell::m_structure[t1], t2 @@ -1343,7 +1652,6 @@ macro putByVal(holeCheck, slowPath) const tag = scratch const payload = operand loadConstantOrVariable2Reg(operand, tag, payload) - writeBarrier(tag, payload) storei tag, TagOffset[base, index, 8] storei payload, PayloadOffset[base, index, 8] end) @@ -1355,16 +1663,13 @@ macro putByVal(holeCheck, slowPath) .opPutByValArrayStorageStoreResult: loadi 12[PC], t2 loadConstantOrVariable2Reg(t2, t1, t2) - writeBarrier(t1, t2) storei t1, ArrayStorage::m_vector + TagOffset[t0, t3, 8] storei t2, ArrayStorage::m_vector + PayloadOffset[t0, t3, 8] dispatch(5) .opPutByValArrayStorageEmpty: - if VALUE_PROFILER - loadp 16[PC], t1 - storeb 1, ArrayProfile::m_mayStoreToHole[t1] - end + loadp 16[PC], t1 + storeb 1, ArrayProfile::m_mayStoreToHole[t1] addi 1, ArrayStorage::m_numValuesInVector[t0] bib t3, -sizeof IndexingHeader + IndexingHeader::u.lengths.publicLength[t0], .opPutByValArrayStorageStoreResult addi 1, t3, t1 @@ -1372,10 +1677,8 @@ macro putByVal(holeCheck, slowPath) jmp .opPutByValArrayStorageStoreResult .opPutByValOutOfBounds: - if VALUE_PROFILER - loadpFromInstruction(4, t0) - storeb 1, ArrayProfile::m_outOfBounds[t0] - end + loadpFromInstruction(4, t0) + storeb 1, ArrayProfile::m_outOfBounds[t0] .opPutByValSlow: callSlowPath(slowPath) dispatch(5) @@ -1585,17 +1888,21 @@ _llint_op_new_func: dispatch(4) +_llint_op_new_captured_func: + traceExecution() + callSlowPath(_slow_path_new_captured_func) + dispatch(4) + + macro arrayProfileForCall() - if VALUE_PROFILER - loadi 16[PC], t3 - negi t3 - bineq ThisArgumentOffset + TagOffset[cfr, t3, 8], CellTag, .done - loadi ThisArgumentOffset + PayloadOffset[cfr, t3, 8], t0 - loadp JSCell::m_structure[t0], t0 - loadp 24[PC], t1 - storep t0, ArrayProfile::m_lastSeenStructure[t1] - .done: - end + loadi 16[PC], t3 + negi t3 + bineq ThisArgumentOffset + TagOffset[cfr, t3, 8], CellTag, .done + loadi ThisArgumentOffset + PayloadOffset[cfr, t3, 8], t0 + loadp JSCell::m_structure[t0], t0 + loadp 24[PC], t1 + storep t0, ArrayProfile::m_lastSeenStructure[t1] +.done: end macro doCall(slowPath) @@ -1730,12 +2037,12 @@ _llint_op_catch: # This is where we end up from the JIT's throw trampoline (because the # machine code return address will be set to _llint_op_catch), and from # the interpreter's throw trampoline (see _llint_throw_trampoline). - # The JIT throwing protocol calls for the cfr to be in t0. The throwing - # code must have known that we were throwing to the interpreter, and have - # set VM::targetInterpreterPCForThrow. - move t0, cfr - loadp CodeBlock[cfr], t3 - loadp CodeBlock::m_vm[t3], t3 + # The throwing code must have known that we were throwing to the interpreter, + # and have set VM::targetInterpreterPCForThrow. + loadp ScopeChain[cfr], t3 + andp MarkedBlockMask, t3 + loadp MarkedBlock::m_weakSet + WeakSet::m_vm[t3], t3 + loadp VM::callFrameForThrow[t3], cfr loadi VM::targetInterpreterPCForThrow[t3], PC loadi VM::m_exception + PayloadOffset[t3], t0 loadi VM::m_exception + TagOffset[t3], t1 @@ -1800,8 +2107,6 @@ _llint_throw_from_slow_path_trampoline: # This essentially emulates the JIT's throwing protocol. loadp CodeBlock[cfr], t1 loadp CodeBlock::m_vm[t1], t1 - loadp VM::topCallFrame[t1], cfr - loadp VM::callFrameForThrow[t1], t0 jmp VM::targetMachinePCForThrow[t1] @@ -1833,24 +2138,7 @@ macro nativeCallTrampoline(executableOffsetToFunction) loadp ScopeChain[cfr], t3 andp MarkedBlockMask, t3 loadp MarkedBlock::m_weakSet + WeakSet::m_vm[t3], t3 - elsif ARM or ARMv7 or ARMv7_TRADITIONAL - loadp ScopeChain[cfr], t3 - andp MarkedBlockMask, t3 - loadp MarkedBlock::m_weakSet + WeakSet::m_vm[t3], t3 - storep cfr, VM::topCallFrame[t3] - move t0, t2 - preserveReturnAddressAfterCall(t3) - storep t3, ReturnPC[cfr] - move cfr, t0 - loadi Callee + PayloadOffset[cfr], t1 - loadp JSFunction::m_executable[t1], t1 - move t2, cfr - call executableOffsetToFunction[t1] - restoreReturnAddressBeforeReturn(t3) - loadp ScopeChain[cfr], t3 - andp MarkedBlockMask, t3 - loadp MarkedBlock::m_weakSet + WeakSet::m_vm[t3], t3 - elsif MIPS or SH4 + elsif ARM or ARMv7 or ARMv7_TRADITIONAL or MIPS or SH4 loadp ScopeChain[cfr], t3 andp MarkedBlockMask, t3 loadp MarkedBlock::m_weakSet + WeakSet::m_vm[t3], t3 @@ -1862,7 +2150,9 @@ macro nativeCallTrampoline(executableOffsetToFunction) loadi Callee + PayloadOffset[cfr], t1 loadp JSFunction::m_executable[t1], t1 move t2, cfr - move t0, a0 + if MIPS or SH4 + move t0, a0 + end call executableOffsetToFunction[t1] restoreReturnAddressBeforeReturn(t3) loadp ScopeChain[cfr], t3 @@ -1910,7 +2200,7 @@ macro varInjectionCheck(slowPath) loadp CodeBlock[cfr], t0 loadp CodeBlock::m_globalObject[t0], t0 loadp JSGlobalObject::m_varInjectionWatchpoint[t0], t0 - btbnz WatchpointSet::m_isInvalidated[t0], slowPath + bbeq WatchpointSet::m_state[t0], IsInvalidated, slowPath end macro resolveScope() @@ -1944,39 +2234,39 @@ _llint_op_resolve_scope: #rGlobalProperty: bineq t0, GlobalProperty, .rGlobalVar getGlobalObject(1) - dispatch(5) + dispatch(6) .rGlobalVar: bineq t0, GlobalVar, .rClosureVar getGlobalObject(1) - dispatch(5) + dispatch(6) .rClosureVar: bineq t0, ClosureVar, .rGlobalPropertyWithVarInjectionChecks resolveScope() - dispatch(5) + dispatch(6) .rGlobalPropertyWithVarInjectionChecks: bineq t0, GlobalPropertyWithVarInjectionChecks, .rGlobalVarWithVarInjectionChecks varInjectionCheck(.rDynamic) getGlobalObject(1) - dispatch(5) + dispatch(6) .rGlobalVarWithVarInjectionChecks: bineq t0, GlobalVarWithVarInjectionChecks, .rClosureVarWithVarInjectionChecks varInjectionCheck(.rDynamic) getGlobalObject(1) - dispatch(5) + dispatch(6) .rClosureVarWithVarInjectionChecks: bineq t0, ClosureVarWithVarInjectionChecks, .rDynamic varInjectionCheck(.rDynamic) resolveScope() - dispatch(5) + dispatch(6) .rDynamic: callSlowPath(_llint_slow_path_resolve_scope) - dispatch(5) + dispatch(6) macro loadWithStructureCheck(operand, slowPath) @@ -2073,6 +2363,8 @@ end macro putGlobalVar() loadisFromInstruction(3, t0) loadConstantOrVariable(t0, t1, t2) + loadpFromInstruction(5, t3) + notifyWrite(t3, t1, t2, t0, .pDynamic) loadpFromInstruction(6, t0) storei t1, TagOffset[t0] storei t2, PayloadOffset[t0] @@ -2095,35 +2387,41 @@ _llint_op_put_to_scope: #pGlobalProperty: bineq t0, GlobalProperty, .pGlobalVar + writeBarrierOnOperands(1, 3) loadWithStructureCheck(1, .pDynamic) putProperty() dispatch(7) .pGlobalVar: bineq t0, GlobalVar, .pClosureVar + writeBarrierOnGlobalObject(3) putGlobalVar() dispatch(7) .pClosureVar: bineq t0, ClosureVar, .pGlobalPropertyWithVarInjectionChecks + writeBarrierOnOperands(1, 3) loadVariable(1, t2, t1, t0) putClosureVar() dispatch(7) .pGlobalPropertyWithVarInjectionChecks: bineq t0, GlobalPropertyWithVarInjectionChecks, .pGlobalVarWithVarInjectionChecks + writeBarrierOnOperands(1, 3) loadWithStructureCheck(1, .pDynamic) putProperty() dispatch(7) .pGlobalVarWithVarInjectionChecks: bineq t0, GlobalVarWithVarInjectionChecks, .pClosureVarWithVarInjectionChecks + writeBarrierOnGlobalObject(3) varInjectionCheck(.pDynamic) putGlobalVar() dispatch(7) .pClosureVarWithVarInjectionChecks: bineq t0, ClosureVarWithVarInjectionChecks, .pDynamic + writeBarrierOnOperands(1, 3) varInjectionCheck(.pDynamic) loadVariable(1, t2, t1, t0) putClosureVar() diff --git a/JavaScriptCore/llint/LowLevelInterpreter64.asm b/JavaScriptCore/llint/LowLevelInterpreter64.asm index 9c234329..e5d73250 100644 --- a/JavaScriptCore/llint/LowLevelInterpreter64.asm +++ b/JavaScriptCore/llint/LowLevelInterpreter64.asm @@ -88,6 +88,155 @@ macro cCall4(function, arg1, arg2, arg3, arg4) end end +macro functionPrologue(extraStackSpace) + if X86_64 + push cfr + move sp, cfr + elsif ARM64 + pushLRAndFP + end + pushCalleeSaves + if X86_64 + subp extraStackSpace, sp + end +end + +macro functionEpilogue(extraStackSpace) + if X86_64 + addp extraStackSpace, sp + end + popCalleeSaves + if X86_64 + pop cfr + elsif ARM64 + popLRAndFP + end +end + +macro doCallToJavaScript(makeCall, doReturn) + if X86_64 + const entry = t5 + const vmTopCallFrame = t4 + const protoCallFrame = t1 + const topOfStack = t2 + + const extraStackSpace = 8 + const previousCFR = t0 + const previousPC = t6 + const temp1 = t0 + const temp2 = t3 + const temp3 = t6 + elsif ARM64 + const entry = a0 + const vmTopCallFrame = a1 + const protoCallFrame = a2 + const topOfStack = a3 + + const extraStackSpace = 0 + const previousCFR = t4 + const previousPC = lr + const temp1 = t3 + const temp2 = t5 + const temp3 = t6 + end + + functionPrologue(extraStackSpace) + + move topOfStack, cfr + subp (CallFrameHeaderSlots-1)*8, cfr + storep 0, ArgumentCount[cfr] + storep vmTopCallFrame, Callee[cfr] + loadp [vmTopCallFrame], temp1 + storep temp1, ScopeChain[cfr] + storep 1, CodeBlock[cfr] + if X86_64 + loadp 7*8[sp], previousPC + loadp 6*8[sp], previousCFR + end + storep previousPC, ReturnPC[cfr] + storep previousCFR, CallerFrame[cfr] + move cfr, temp1 + + loadi ProtoCallFrame::paddedArgCount[protoCallFrame], temp2 + addp CallFrameHeaderSlots, temp2, temp2 + lshiftp 3, temp2 + subp temp2, cfr + storep temp1, CallerFrame[cfr] + + move 5, temp1 + +.copyHeaderLoop: + subi 1, temp1 + loadp [protoCallFrame, temp1, 8], temp3 + storep temp3, CodeBlock[cfr, temp1, 8] + btinz temp1, .copyHeaderLoop + + loadi ProtoCallFrame::argCountAndCodeOriginValue[protoCallFrame], temp2 + subi 1, temp2 + loadi ProtoCallFrame::paddedArgCount[protoCallFrame], temp3 + subi 1, temp3 + + bieq temp2, temp3, .copyArgs + move ValueUndefined, temp1 +.fillExtraArgsLoop: + subi 1, temp3 + storep temp1, ThisArgumentOffset+8[cfr, temp3, 8] + bineq temp2, temp3, .fillExtraArgsLoop + +.copyArgs: + loadp ProtoCallFrame::args[protoCallFrame], temp1 + +.copyArgsLoop: + btiz temp2, .copyArgsDone + subi 1, temp2 + loadp [temp1, temp2, 8], temp3 + storep temp3, ThisArgumentOffset+8[cfr, temp2, 8] + jmp .copyArgsLoop + +.copyArgsDone: + storep cfr, [vmTopCallFrame] + + move 0xffff000000000000, csr1 + addp 2, csr1, csr2 + + makeCall(entry, temp1) + + bpeq CodeBlock[cfr], 1, .calleeFramePopped + loadp CallerFrame[cfr], cfr + +.calleeFramePopped: + loadp Callee[cfr], temp2 # VM.topCallFrame + loadp ScopeChain[cfr], temp3 + storep temp3, [temp2] + + doReturn(extraStackSpace) +end + +macro makeJavaScriptCall(entry, temp) + call entry +end + +macro makeHostFunctionCall(entry, temp) + move entry, temp + if X86_64 + move cfr, t5 + elsif ARM64 or C_LOOP + move cfr, a0 + end + call temp +end + +macro doReturnFromJavaScript(extraStackSpace) +_returnFromJavaScript: + functionEpilogue(extraStackSpace) + ret +end + +macro doReturnFromHostFunction(extraStackSpace) + functionEpilogue(extraStackSpace) + ret +end + macro prepareStateForCCall() leap [PB, PC, 8], PC move PB, t3 @@ -182,17 +331,58 @@ macro loadConstantOrVariableCell(index, value, slow) btqnz value, tagMask, slow end -macro writeBarrier(value) - # Nothing to do, since we don't have a generational or incremental collector. +macro writeBarrierOnOperand(cellOperand) + if GGC + loadisFromInstruction(cellOperand, t1) + loadConstantOrVariableCell(t1, t0, .writeBarrierDone) + checkMarkByte(t0, t1, t2, + macro(marked) + btbz marked, .writeBarrierDone + push PB, PC + cCall2(_llint_write_barrier_slow, cfr, t0) + pop PC, PB + end + ) + .writeBarrierDone: + end end -macro valueProfile(value, operand, scratch) - if VALUE_PROFILER - loadpFromInstruction(operand, scratch) - storeq value, ValueProfile::m_buckets[scratch] +macro writeBarrierOnOperands(cellOperand, valueOperand) + if GGC + loadisFromInstruction(valueOperand, t1) + loadConstantOrVariable(t1, t0) + btpz t0, .writeBarrierDone + + writeBarrierOnOperand(cellOperand) + .writeBarrierDone: + end +end + +macro writeBarrierOnGlobalObject(valueOperand) + if GGC + loadisFromInstruction(valueOperand, t1) + loadConstantOrVariable(t1, t0) + btpz t0, .writeBarrierDone + + loadp CodeBlock[cfr], t0 + loadp CodeBlock::m_globalObject[t0], t0 + checkMarkByte(t0, t1, t2, + macro(marked) + btbz marked, .writeBarrierDone + push PB, PC + cCall2(_llint_write_barrier_slow, cfr, t0) + pop PC, PB + end + ) + .writeBarrierDone: end end +macro valueProfile(value, operand, scratch) + loadpFromInstruction(operand, scratch) + storeq value, ValueProfile::m_buckets[scratch] +end + # Entrypoints into the interpreter. @@ -240,6 +430,16 @@ macro functionArityCheck(doneLabel, slow_path) end +macro branchIfException(label) + loadp ScopeChain[cfr], t3 + andp MarkedBlockMask, t3 + loadp MarkedBlock::m_weakSet + WeakSet::m_vm[t3], t3 + btqz VM::m_exception[t3], .noException + jmp label +.noException: +end + + # Instruction implementations _llint_op_enter: @@ -255,6 +455,7 @@ _llint_op_enter: addq 1, t2 btqnz t2, .opEnterLoop .opEnterDone: + callSlowPath(_slow_path_enter) dispatch(1) @@ -353,6 +554,40 @@ _llint_op_mov: dispatch(3) +macro notifyWrite(set, value, scratch, slow) + loadb VariableWatchpointSet::m_state[set], scratch + bieq scratch, IsInvalidated, .done + bineq scratch, ClearWatchpoint, .overwrite + storeq value, VariableWatchpointSet::m_inferredValue[set] + storeb IsWatched, VariableWatchpointSet::m_state[set] + jmp .done + +.overwrite: + bqeq value, VariableWatchpointSet::m_inferredValue[set], .done + btbnz VariableWatchpointSet::m_setIsNotEmpty[set], slow + storeq 0, VariableWatchpointSet::m_inferredValue[set] + storeb IsInvalidated, VariableWatchpointSet::m_state[set] + +.done: +end + +_llint_op_captured_mov: + traceExecution() + loadisFromInstruction(2, t1) + loadConstantOrVariable(t1, t2) + loadpFromInstruction(3, t0) + btpz t0, .opCapturedMovReady + notifyWrite(t0, t2, t1, .opCapturedMovSlow) +.opCapturedMovReady: + loadisFromInstruction(1, t0) + storeq t2, [cfr, t0, 8] + dispatch(4) + +.opCapturedMovSlow: + callSlowPath(_slow_path_captured_mov) + dispatch(4) + + _llint_op_not: traceExecution() loadisFromInstruction(2, t0) @@ -668,7 +903,7 @@ macro bitOp(operation, slowPath, advance) loadConstantOrVariable(t2, t0) bqb t0, tagTypeNumber, .slow bqb t1, tagTypeNumber, .slow - operation(t1, t0, .slow) + operation(t1, t0) orq tagTypeNumber, t0 storeq t0, [cfr, t3, 8] dispatch(advance) @@ -681,7 +916,7 @@ end _llint_op_lshift: traceExecution() bitOp( - macro (left, right, slow) lshifti left, right end, + macro (left, right) lshifti left, right end, _slow_path_lshift, 4) @@ -689,7 +924,7 @@ _llint_op_lshift: _llint_op_rshift: traceExecution() bitOp( - macro (left, right, slow) rshifti left, right end, + macro (left, right) rshifti left, right end, _slow_path_rshift, 4) @@ -697,18 +932,28 @@ _llint_op_rshift: _llint_op_urshift: traceExecution() bitOp( - macro (left, right, slow) - urshifti left, right - bilt right, 0, slow - end, + macro (left, right) urshifti left, right end, _slow_path_urshift, 4) +_llint_op_unsigned: + traceExecution() + loadisFromInstruction(1, t0) + loadisFromInstruction(2, t1) + loadConstantOrVariable(t1, t2) + bilt t2, 0, .opUnsignedSlow + storeq t2, [cfr, t0, 8] + dispatch(3) +.opUnsignedSlow: + callSlowPath(_slow_path_unsigned) + dispatch(3) + + _llint_op_bitand: traceExecution() bitOp( - macro (left, right, slow) andi left, right end, + macro (left, right) andi left, right end, _slow_path_bitand, 5) @@ -716,7 +961,7 @@ _llint_op_bitand: _llint_op_bitxor: traceExecution() bitOp( - macro (left, right, slow) xori left, right end, + macro (left, right) xori left, right end, _slow_path_bitxor, 5) @@ -724,7 +969,7 @@ _llint_op_bitxor: _llint_op_bitor: traceExecution() bitOp( - macro (left, right, slow) ori left, right end, + macro (left, right) ori left, right end, _slow_path_bitor, 5) @@ -863,10 +1108,10 @@ end _llint_op_init_global_const: traceExecution() + writeBarrierOnGlobalObject(2) loadisFromInstruction(2, t1) loadpFromInstruction(1, t0) loadConstantOrVariable(t1, t2) - writeBarrier(t2) storeq t2, [t0] dispatch(5) @@ -948,6 +1193,7 @@ _llint_op_get_arguments_length: macro putById(getPropertyStorage) traceExecution() + writeBarrierOnOperands(1, 3) loadisFromInstruction(1, t3) loadpFromInstruction(4, t1) loadConstantOrVariableCell(t3, t0, .opPutByIdSlow) @@ -959,7 +1205,6 @@ macro putById(getPropertyStorage) bpneq JSCell::m_structure[t0], t1, .opPutByIdSlow loadisFromInstruction(5, t1) loadConstantOrVariable(t2, scratch) - writeBarrier(t0) storeq scratch, [propertyStorage, t1] dispatch(9) end) @@ -979,6 +1224,7 @@ _llint_op_put_by_id_out_of_line: macro putByIdTransition(additionalChecks, getPropertyStorage) traceExecution() + writeBarrierOnOperand(1) loadisFromInstruction(1, t3) loadpFromInstruction(4, t1) loadConstantOrVariableCell(t3, t0, .opPutByIdSlow) @@ -992,7 +1238,6 @@ macro putByIdTransition(additionalChecks, getPropertyStorage) macro (propertyStorage, scratch) addp t1, propertyStorage, t3 loadConstantOrVariable(t2, t1) - writeBarrier(t1) storeq t1, [t3] loadpFromInstruction(6, t1) storep t1, JSCell::m_structure[t0] @@ -1081,10 +1326,8 @@ _llint_op_get_by_val: dispatch(6) .opGetByValOutOfBounds: - if VALUE_PROFILER - loadpFromInstruction(4, t0) - storeb 1, ArrayProfile::m_outOfBounds[t0] - end + loadpFromInstruction(4, t0) + storeb 1, ArrayProfile::m_outOfBounds[t0] .opGetByValSlow: callSlowPath(_llint_slow_path_get_by_val) dispatch(6) @@ -1154,10 +1397,8 @@ macro contiguousPutByVal(storeCallback) .outOfBounds: biaeq t3, -sizeof IndexingHeader + IndexingHeader::u.lengths.vectorLength[t0], .opPutByValOutOfBounds - if VALUE_PROFILER - loadp 32[PB, PC, 8], t2 - storeb 1, ArrayProfile::m_mayStoreToHole[t2] - end + loadp 32[PB, PC, 8], t2 + storeb 1, ArrayProfile::m_mayStoreToHole[t2] addi 1, t3, t2 storei t2, -sizeof IndexingHeader + IndexingHeader::u.lengths.publicLength[t0] jmp .storeResult @@ -1165,6 +1406,7 @@ end macro putByVal(holeCheck, slowPath) traceExecution() + writeBarrierOnOperands(1, 3) loadisFromInstruction(1, t0) loadConstantOrVariableCell(t0, t1, .opPutByValSlow) loadp JSCell::m_structure[t1], t2 @@ -1204,7 +1446,6 @@ macro putByVal(holeCheck, slowPath) contiguousPutByVal( macro (operand, scratch, address) loadConstantOrVariable(operand, scratch) - writeBarrier(scratch) storep scratch, address end) @@ -1215,15 +1456,12 @@ macro putByVal(holeCheck, slowPath) .opPutByValArrayStorageStoreResult: loadisFromInstruction(3, t2) loadConstantOrVariable(t2, t1) - writeBarrier(t1) storeq t1, ArrayStorage::m_vector[t0, t3, 8] dispatch(5) .opPutByValArrayStorageEmpty: - if VALUE_PROFILER - loadpFromInstruction(4, t1) - storeb 1, ArrayProfile::m_mayStoreToHole[t1] - end + loadpFromInstruction(4, t1) + storeb 1, ArrayProfile::m_mayStoreToHole[t1] addi 1, ArrayStorage::m_numValuesInVector[t0] bib t3, -sizeof IndexingHeader + IndexingHeader::u.lengths.publicLength[t0], .opPutByValArrayStorageStoreResult addi 1, t3, t1 @@ -1231,10 +1469,8 @@ macro putByVal(holeCheck, slowPath) jmp .opPutByValArrayStorageStoreResult .opPutByValOutOfBounds: - if VALUE_PROFILER - loadpFromInstruction(4, t0) - storeb 1, ArrayProfile::m_outOfBounds[t0] - end + loadpFromInstruction(4, t0) + storeb 1, ArrayProfile::m_outOfBounds[t0] .opPutByValSlow: callSlowPath(slowPath) dispatch(5) @@ -1449,17 +1685,21 @@ _llint_op_new_func: dispatch(4) +_llint_op_new_captured_func: + traceExecution() + callSlowPath(_slow_path_new_captured_func) + dispatch(4) + + macro arrayProfileForCall() - if VALUE_PROFILER - loadisFromInstruction(4, t3) - negp t3 - loadq ThisArgumentOffset[cfr, t3, 8], t0 - btqnz t0, tagMask, .done - loadp JSCell::m_structure[t0], t0 - loadpFromInstruction(6, t1) - storep t0, ArrayProfile::m_lastSeenStructure[t1] - .done: - end + loadisFromInstruction(4, t3) + negp t3 + loadq ThisArgumentOffset[cfr, t3, 8], t0 + btqnz t0, tagMask, .done + loadp JSCell::m_structure[t0], t0 + loadpFromInstruction(6, t1) + storep t0, ArrayProfile::m_lastSeenStructure[t1] +.done: end macro doCall(slowPath) @@ -1594,14 +1834,14 @@ _llint_op_catch: # This is where we end up from the JIT's throw trampoline (because the # machine code return address will be set to _llint_op_catch), and from # the interpreter's throw trampoline (see _llint_throw_trampoline). - # The JIT throwing protocol calls for the cfr to be in t0. The throwing - # code must have known that we were throwing to the interpreter, and have - # set VM::targetInterpreterPCForThrow. - move t0, cfr + # The throwing code must have known that we were throwing to the interpreter, + # and have set VM::targetInterpreterPCForThrow. + loadp ScopeChain[cfr], t3 + andp MarkedBlockMask, t3 + loadp MarkedBlock::m_weakSet + WeakSet::m_vm[t3], t3 + loadp VM::callFrameForThrow[t3], cfr loadp CodeBlock[cfr], PB loadp CodeBlock::m_instructions[PB], PB - loadp CodeBlock[cfr], t3 - loadp CodeBlock::m_vm[t3], t3 loadp VM::targetInterpreterPCForThrow[t3], PC subp PB, PC rshiftp 3, PC @@ -1630,8 +1870,6 @@ _llint_throw_from_slow_path_trampoline: # This essentially emulates the JIT's throwing protocol. loadp CodeBlock[cfr], t1 loadp CodeBlock::m_vm[t1], t1 - loadp VM::topCallFrame[t1], cfr - loadp VM::callFrameForThrow[t1], t0 jmp VM::targetMachinePCForThrow[t1] @@ -1733,7 +1971,7 @@ macro varInjectionCheck(slowPath) loadp CodeBlock[cfr], t0 loadp CodeBlock::m_globalObject[t0], t0 loadp JSGlobalObject::m_varInjectionWatchpoint[t0], t0 - btbnz WatchpointSet::m_isInvalidated[t0], slowPath + bbeq WatchpointSet::m_state[t0], IsInvalidated, slowPath end macro resolveScope() @@ -1766,39 +2004,39 @@ _llint_op_resolve_scope: #rGlobalProperty: bineq t0, GlobalProperty, .rGlobalVar getGlobalObject(1) - dispatch(5) + dispatch(6) .rGlobalVar: bineq t0, GlobalVar, .rClosureVar getGlobalObject(1) - dispatch(5) + dispatch(6) .rClosureVar: bineq t0, ClosureVar, .rGlobalPropertyWithVarInjectionChecks resolveScope() - dispatch(5) + dispatch(6) .rGlobalPropertyWithVarInjectionChecks: bineq t0, GlobalPropertyWithVarInjectionChecks, .rGlobalVarWithVarInjectionChecks varInjectionCheck(.rDynamic) getGlobalObject(1) - dispatch(5) + dispatch(6) .rGlobalVarWithVarInjectionChecks: bineq t0, GlobalVarWithVarInjectionChecks, .rClosureVarWithVarInjectionChecks varInjectionCheck(.rDynamic) getGlobalObject(1) - dispatch(5) + dispatch(6) .rClosureVarWithVarInjectionChecks: bineq t0, ClosureVarWithVarInjectionChecks, .rDynamic varInjectionCheck(.rDynamic) resolveScope() - dispatch(5) + dispatch(6) .rDynamic: callSlowPath(_llint_slow_path_resolve_scope) - dispatch(5) + dispatch(6) macro loadWithStructureCheck(operand, slowPath) @@ -1890,6 +2128,8 @@ end macro putGlobalVar() loadisFromInstruction(3, t0) loadConstantOrVariable(t0, t1) + loadpFromInstruction(5, t2) + notifyWrite(t2, t1, t0, .pDynamic) loadpFromInstruction(6, t0) storeq t1, [t0] end @@ -1910,35 +2150,41 @@ _llint_op_put_to_scope: #pGlobalProperty: bineq t0, GlobalProperty, .pGlobalVar + writeBarrierOnOperands(1, 3) loadWithStructureCheck(1, .pDynamic) putProperty() dispatch(7) .pGlobalVar: bineq t0, GlobalVar, .pClosureVar + writeBarrierOnGlobalObject(3) putGlobalVar() dispatch(7) .pClosureVar: bineq t0, ClosureVar, .pGlobalPropertyWithVarInjectionChecks + writeBarrierOnOperands(1, 3) loadVariable(1, t0) putClosureVar() dispatch(7) .pGlobalPropertyWithVarInjectionChecks: bineq t0, GlobalPropertyWithVarInjectionChecks, .pGlobalVarWithVarInjectionChecks + writeBarrierOnOperands(1, 3) loadWithStructureCheck(1, .pDynamic) putProperty() dispatch(7) .pGlobalVarWithVarInjectionChecks: bineq t0, GlobalVarWithVarInjectionChecks, .pClosureVarWithVarInjectionChecks + writeBarrierOnGlobalObject(3) varInjectionCheck(.pDynamic) putGlobalVar() dispatch(7) .pClosureVarWithVarInjectionChecks: bineq t0, ClosureVarWithVarInjectionChecks, .pDynamic + writeBarrierOnOperands(1, 3) varInjectionCheck(.pDynamic) loadVariable(1, t0) putClosureVar() diff --git a/JavaScriptCore/llvm/InitializeLLVM.cpp b/JavaScriptCore/llvm/InitializeLLVM.cpp index cbfadb83..2d43310a 100644 --- a/JavaScriptCore/llvm/InitializeLLVM.cpp +++ b/JavaScriptCore/llvm/InitializeLLVM.cpp @@ -35,22 +35,9 @@ namespace JSC { static pthread_once_t initializeLLVMOnceKey = PTHREAD_ONCE_INIT; -static NO_RETURN_DUE_TO_CRASH void llvmCrash(const char* reason) -{ - WTFLogAlways("LLVM failure: %s", reason); - CRASH(); -} - -static void initializeLLVMOnce() -{ - initializeLLVMImpl(); - - llvm->InstallFatalErrorHandler(llvmCrash); -} - void initializeLLVM() { - pthread_once(&initializeLLVMOnceKey, initializeLLVMOnce); + pthread_once(&initializeLLVMOnceKey, initializeLLVMImpl); } } // namespace JSC diff --git a/JavaScriptCore/llvm/InitializeLLVMLinux.cpp b/JavaScriptCore/llvm/InitializeLLVMLinux.cpp new file mode 100644 index 00000000..cbbd28f9 --- /dev/null +++ b/JavaScriptCore/llvm/InitializeLLVMLinux.cpp @@ -0,0 +1,43 @@ +/* + * Copyright (C) 2013 University of Szeged. All rights reserved. + * Copyright (C) 2013 Samsung Electronics. 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 UNIVERSITY OF SZEGED. ``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 "InitializeLLVM.h" + +#if HAVE(LLVM) + +#include "InitializeLLVMPOSIX.h" + +namespace JSC { + +void initializeLLVMImpl() +{ + initializeLLVMPOSIX("libllvmForJSC.so"); +} + +} // namespace JSC + +#endif // HAVE(LLVM) diff --git a/JavaScriptCore/llvm/InitializeLLVMPOSIX.cpp b/JavaScriptCore/llvm/InitializeLLVMPOSIX.cpp index 2740922a..156879dc 100644 --- a/JavaScriptCore/llvm/InitializeLLVMPOSIX.cpp +++ b/JavaScriptCore/llvm/InitializeLLVMPOSIX.cpp @@ -33,7 +33,7 @@ namespace JSC { -typedef LLVMAPI* (*InitializerFunction)(); +typedef LLVMAPI* (*InitializerFunction)(void (*)(const char*, ...)); void initializeLLVMPOSIX(const char* libraryName) { @@ -44,7 +44,7 @@ void initializeLLVMPOSIX(const char* libraryName) dlsym(library, "initializeAndGetJSCLLVMAPI")); ASSERT_WITH_MESSAGE(initializer, "%s", dlerror()); - llvm = initializer(); + llvm = initializer(WTFLogAlwaysAndCrash); } } // namespace JSC diff --git a/JavaScriptCore/llvm/LLVMAPIFunctions.h b/JavaScriptCore/llvm/LLVMAPIFunctions.h index bc44b7a2..9ff2a427 100644 --- a/JavaScriptCore/llvm/LLVMAPIFunctions.h +++ b/JavaScriptCore/llvm/LLVMAPIFunctions.h @@ -489,6 +489,7 @@ macro(LLVMValueRef, BuildIsNull, (LLVMBuilderRef, LLVMValueRef Val, const char *Name)) \ macro(LLVMValueRef, BuildIsNotNull, (LLVMBuilderRef, LLVMValueRef Val, const char *Name)) \ macro(LLVMValueRef, BuildPtrDiff, (LLVMBuilderRef, LLVMValueRef LHS, LLVMValueRef RHS, const char *Name)) \ + macro(LLVMValueRef, BuildFence, (LLVMBuilderRef B, LLVMAtomicOrdering Ordering, LLVMBool isSingleThread, const char *Name)) \ macro(LLVMValueRef, BuildAtomicRMW, (LLVMBuilderRef B, LLVMAtomicRMWBinOp op, LLVMValueRef PTR, LLVMValueRef Val, LLVMAtomicOrdering ordering, LLVMBool singleThread)) \ macro(LLVMModuleProviderRef, CreateModuleProviderForExistingModule, (LLVMModuleRef M)) \ macro(void, DisposeModuleProvider, (LLVMModuleProviderRef M)) \ @@ -535,7 +536,6 @@ macro(LLVMBool, TargetHasJIT, (LLVMTargetRef T)) \ macro(LLVMBool, TargetHasTargetMachine, (LLVMTargetRef T)) \ macro(LLVMBool, TargetHasAsmBackend, (LLVMTargetRef T)) \ - macro(LLVMTargetMachineRef, CreateTargetMachine, (LLVMTargetRef T, char *Triple, char *CPU, char *Features, LLVMCodeGenOptLevel Level, LLVMRelocMode Reloc, LLVMCodeModel CodeModel)) \ macro(void, DisposeTargetMachine, (LLVMTargetMachineRef T)) \ macro(LLVMTargetRef, GetTargetMachineTarget, (LLVMTargetMachineRef T)) \ macro(char *, GetTargetMachineTriple, (LLVMTargetMachineRef T)) \ diff --git a/JavaScriptCore/llvm/library/LLVMExports.cpp b/JavaScriptCore/llvm/library/LLVMExports.cpp index 2f5f9ae3..6e74b50a 100644 --- a/JavaScriptCore/llvm/library/LLVMExports.cpp +++ b/JavaScriptCore/llvm/library/LLVMExports.cpp @@ -28,11 +28,20 @@ #if HAVE(LLVM) #include "LLVMAPI.h" +#include "LLVMTrapCallback.h" -extern "C" WTF_EXPORT_PRIVATE JSC::LLVMAPI* initializeAndGetJSCLLVMAPI(); +extern "C" WTF_EXPORT_PRIVATE JSC::LLVMAPI* initializeAndGetJSCLLVMAPI(void (*)(const char*, ...)); -extern "C" JSC::LLVMAPI* initializeAndGetJSCLLVMAPI() +static void llvmCrash(const char* reason) { + g_llvmTrapCallback("LLVM fatal error: %s", reason); +} + +extern "C" JSC::LLVMAPI* initializeAndGetJSCLLVMAPI(void (*callback)(const char*, ...)) +{ + g_llvmTrapCallback = callback; + + LLVMInstallFatalErrorHandler(llvmCrash); LLVMLinkInMCJIT(); LLVMInitializeNativeTarget(); LLVMInitializeX86AsmPrinter(); diff --git a/JavaScriptCore/llvm/library/LLVMOverrides.cpp b/JavaScriptCore/llvm/library/LLVMOverrides.cpp index 463a49e7..ced4066f 100644 --- a/JavaScriptCore/llvm/library/LLVMOverrides.cpp +++ b/JavaScriptCore/llvm/library/LLVMOverrides.cpp @@ -25,9 +25,35 @@ #include "config_llvm.h" +#include "LLVMTrapCallback.h" + #if HAVE(LLVM) extern "C" int __cxa_atexit(); extern "C" int __cxa_atexit() { return 0; } +void (*g_llvmTrapCallback)(const char* message, ...); + +// If LLVM tries to raise signals, abort, or fail an assertion, then let +// WebKit handle it instead of trapping. +extern "C" int raise(int signal); +extern "C" void __assert_rtn(const char* function, const char* filename, int lineNumber, const char* expression); +extern "C" void abort(void); + +extern "C" int raise(int signal) +{ + g_llvmTrapCallback("raise(%d) called.", signal); + return 0; +} +extern "C" void __assert_rtn(const char* function, const char* filename, int lineNumber, const char* expression) +{ + if (function) + g_llvmTrapCallback("Assertion failed: (%s), function %s, file %s, line %d.", expression, function, filename, lineNumber); + g_llvmTrapCallback("Assertion failed: (%s), file %s, line %d.", expression, filename, lineNumber); +} +extern "C" void abort(void) +{ + g_llvmTrapCallback("abort() called."); +} + #endif // HAVE(LLVM) diff --git a/JavaScriptCore/llvm/library/LLVMTrapCallback.h b/JavaScriptCore/llvm/library/LLVMTrapCallback.h new file mode 100644 index 00000000..92620b09 --- /dev/null +++ b/JavaScriptCore/llvm/library/LLVMTrapCallback.h @@ -0,0 +1,32 @@ +/* + * Copyright (C) 2013 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. + */ + +#ifndef LLVMTrapCallback_h +#define LLVMTrapCallback_h + +extern void (*g_llvmTrapCallback)(const char* message, ...); + +#endif // LLVMTrapCallback_h + diff --git a/JavaScriptCore/llvm/library/config_llvm.h b/JavaScriptCore/llvm/library/config_llvm.h index 0c98f718..8e3018b4 100644 --- a/JavaScriptCore/llvm/library/config_llvm.h +++ b/JavaScriptCore/llvm/library/config_llvm.h @@ -23,6 +23,11 @@ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ +#if defined(HAVE_CONFIG_H) && HAVE_CONFIG_H +#ifdef BUILDING_WITH_CMAKE +#include "cmakeconfig.h" +#endif +#endif #include #include diff --git a/JavaScriptCore/make-generated-sources.sh b/JavaScriptCore/make-generated-sources.sh index b9e19e79..ccfeedd6 100755 --- a/JavaScriptCore/make-generated-sources.sh +++ b/JavaScriptCore/make-generated-sources.sh @@ -1,7 +1,6 @@ #!/bin/sh export SRCROOT=$PWD -export WebCore=$PWD export CREATE_HASH_TABLE="$SRCROOT/create_hash_table" export CREATE_REGEXP_TABLES="$SRCROOT/create_regex_tables" export CREATE_KEYWORD_LOOKUP="$SRCROOT/KeywordLookupGenerator.py" diff --git a/JavaScriptCore/offlineasm/arm.rb b/JavaScriptCore/offlineasm/arm.rb index 3c69ef02..7de75ead 100644 --- a/JavaScriptCore/offlineasm/arm.rb +++ b/JavaScriptCore/offlineasm/arm.rb @@ -63,7 +63,7 @@ def armOperand end end -ARM_EXTRA_GPRS = [SpecialRegister.new("r9"), SpecialRegister.new("r8"), SpecialRegister.new("r3")] +ARM_EXTRA_GPRS = [SpecialRegister.new("r10"), SpecialRegister.new("r12")] ARM_EXTRA_FPRS = [SpecialRegister.new("d7")] ARM_SCRATCH_FPR = SpecialRegister.new("d6") @@ -97,9 +97,11 @@ def armOperand when "t3" "r4" when "t4" - "r10" + "r8" + when "t5" + "r9" when "cfr" - "r5" + isARMv7 ? "r7" : "r11" when "lr" "lr" when "sp" @@ -221,7 +223,11 @@ def getModifiedListARMCommon result = riscLowerMalformedImmediates(result, 0..0xff) result = riscLowerMisplacedAddresses(result) result = riscLowerRegisterReuse(result) - result = assignRegistersToTemporaries(result, :gpr, ARM_EXTRA_GPRS) + if isARMv7 + result = assignRegistersToTemporaries(result, :gpr, ARM_EXTRA_GPRS.concat([SpecialRegister.new("r11")])) + else + result = assignRegistersToTemporaries(result, :gpr, ARM_EXTRA_GPRS.concat([SpecialRegister.new("r7")])) + end result = assignRegistersToTemporaries(result, :fpr, ARM_EXTRA_FPRS) return result end @@ -451,9 +457,27 @@ def lowerARMCommon # FIXME: either support this or remove it. raise "ARM does not support this opcode yet, #{codeOrigin}" when "pop" - $asm.puts "pop #{operands[0].armOperand}" + operands.each { + | op | + $asm.puts "pop { #{op.armOperand} }" + } when "push" - $asm.puts "push #{operands[0].armOperand}" + operands.each { + | op | + $asm.puts "push { #{op.armOperand} }" + } + when "popCalleeSaves" + if isARMv7 + $asm.puts "pop {r4-r6, r8-r11}" + else + $asm.puts "pop {r4-r10}" + end + when "pushCalleeSaves" + if isARMv7 + $asm.puts "push {r4-r6, r8-r11}" + else + $asm.puts "push {r4-r10}" + end when "move" if operands[0].immediate? armMoveImmediate(operands[0].value, operands[1]) @@ -579,6 +603,8 @@ def lowerARMCommon when "smulli" raise "Wrong number of arguments to smull in #{self.inspect} at #{codeOriginString}" unless operands.length == 4 $asm.puts "smull #{operands[2].armOperand}, #{operands[3].armOperand}, #{operands[0].armOperand}, #{operands[1].armOperand}" + when "memfence" + $asm.puts "dmb sy" else lowerDefault end diff --git a/JavaScriptCore/offlineasm/arm64.rb b/JavaScriptCore/offlineasm/arm64.rb index 2d9b1274..e0a23ff3 100644 --- a/JavaScriptCore/offlineasm/arm64.rb +++ b/JavaScriptCore/offlineasm/arm64.rb @@ -38,7 +38,8 @@ # # x0 => return value, cached result, first argument, t0, a0, r0 # x1 => t1, a1, r1 -# x2 => t2 +# x2 => t2, a2 +# x3 => a3 # x9 => (nonArgGPR1 in baseline) # x10 => t4 (unused in baseline) # x11 => t5 (unused in baseline) @@ -47,10 +48,9 @@ # x16 => scratch # x17 => scratch # x23 => t3 -# x25 => cfr -# x26 => timeout check (i.e. not touched by LLInt) # x27 => csr1 (tagTypeNumber) # x28 => csr2 (tagMask) +# x29 => cfr # sp => sp # lr => lr # @@ -106,8 +106,10 @@ def arm64Operand(kind) arm64GPRName('x0', kind) when 't1', 'a1', 'r1' arm64GPRName('x1', kind) - when 't2' + when 't2', 'a2' arm64GPRName('x2', kind) + when 'a3' + arm64GPRName('x3', kind) when 't3' arm64GPRName('x23', kind) when 't4' @@ -117,7 +119,7 @@ def arm64Operand(kind) when 't6' arm64GPRName('x12', kind) when 'cfr' - arm64GPRName('x25', kind) + arm64GPRName('x29', kind) when 'csr1' arm64GPRName('x27', kind) when 'csr2' @@ -564,9 +566,40 @@ def lowerARM64 # FIXME: Remove it or support it. raise "ARM64 does not support this opcode yet, #{codeOriginString}" when "pop" - emitARM64Unflipped("pop", operands, :ptr) + operands.each_slice(2) { + | ops | + # Note that the operands are in the reverse order of the case for push. + # This is due to the fact that order matters for pushing and popping, and + # on platforms that only push/pop one slot at a time they pop their + # arguments in the reverse order that they were pushed. In order to remain + # compatible with those platforms we assume here that that's what has been done. + + # So for example, if we did push(A, B, C, D), we would then pop(D, C, B, A). + # But since the ordering of arguments doesn't change on arm64 between the stp and ldp + # instructions we need to flip flop the argument positions that were passed to us. + $asm.puts "ldp #{ops[1].arm64Operand(:ptr)}, #{ops[0].arm64Operand(:ptr)}, [sp], #16" + } when "push" - emitARM64Unflipped("push", operands, :ptr) + operands.each_slice(2) { + | ops | + $asm.puts "stp #{ops[0].arm64Operand(:ptr)}, #{ops[1].arm64Operand(:ptr)}, [sp, #-16]!" + } + when "popLRAndFP" + $asm.puts "ldp fp, lr, [sp], #16" + when "pushLRAndFP" + $asm.puts "stp fp, lr, [sp, #-16]!" + when "popCalleeSaves" + $asm.puts "ldp x28, x27, [sp], #16" + $asm.puts "ldp x26, x25, [sp], #16" + $asm.puts "ldp x24, x23, [sp], #16" + $asm.puts "ldp x22, x21, [sp], #16" + $asm.puts "ldp x20, x19, [sp], #16" + when "pushCalleeSaves" + $asm.puts "stp x20, x19, [sp, #-16]!" + $asm.puts "stp x22, x21, [sp, #-16]!" + $asm.puts "stp x24, x23, [sp, #-16]!" + $asm.puts "stp x26, x25, [sp, #-16]!" + $asm.puts "stp x28, x27, [sp, #-16]!" when "move" if operands[0].immediate? emitARM64MoveImmediate(operands[0].value, operands[1]) @@ -783,6 +816,8 @@ def lowerARM64 operands[0].arm64EmitLea(operands[1], :ptr) when "smulli" $asm.puts "smaddl #{operands[2].arm64Operand(:ptr)}, #{operands[0].arm64Operand(:int)}, #{operands[1].arm64Operand(:int)}, xzr" + when "memfence" + $asm.puts "dmb sy" else lowerDefault end diff --git a/JavaScriptCore/offlineasm/cloop.rb b/JavaScriptCore/offlineasm/cloop.rb index cb05d83d..852e864e 100644 --- a/JavaScriptCore/offlineasm/cloop.rb +++ b/JavaScriptCore/offlineasm/cloop.rb @@ -68,6 +68,22 @@ def clValue(type=:int) class RegisterID def clDump case name + when "a0" + "a0" + when "a1" + "a1" + when "a2" + "a2" + when "a3" + "a3" + when "a4" + "a4" + when "a5" + "a5" + when "a6" + "a6" + when "a6" + "a6" when "t0" "t0" when "t1" @@ -245,7 +261,11 @@ def clValue(type=:int) end end def pointerExpr - "#{base.clValue(:int8Ptr)} + (#{index.clValue} << #{scaleShift}) + #{offset.clValue}" + if offset.value == 0 + "#{base.clValue(:int8Ptr)} + (#{index.clValue} << #{scaleShift})" + else + "#{base.clValue(:int8Ptr)} + (#{index.clValue} << #{scaleShift}) + #{offset.clValue}" + end end def int8MemRef "*CAST(#{pointerExpr})" @@ -538,7 +558,7 @@ def cloopEmitCallSlowPath(operands) $asm.putc " ExecState* exec = CAST(#{operands[1].clValue(:voidPtr)});" $asm.putc " Instruction* pc = CAST(#{operands[2].clValue(:voidPtr)});" $asm.putc " SlowPathReturnType result = #{operands[0].cLabel}(exec, pc);" - $asm.putc " decodeResult(result, t0.instruction, t1.execState);" + $asm.putc " decodeResult(result, t0.instruction, t1.vp);" $asm.putc "}" end @@ -1075,6 +1095,11 @@ def lowerC_LOOP cloopEmitOpAndBranch(operands, "|", :int32, "== 0") when "borrinz" cloopEmitOpAndBranch(operands, "|", :int32, "!= 0") + + when "memfence" + when "pushCalleeSaves" + when "popCalleeSaves" + # A convenience and compact call to crash because we don't want to use # the generic llint crash mechanism which relies on the availability diff --git a/JavaScriptCore/offlineasm/instructions.rb b/JavaScriptCore/offlineasm/instructions.rb index 271137ec..5a3463fc 100644 --- a/JavaScriptCore/offlineasm/instructions.rb +++ b/JavaScriptCore/offlineasm/instructions.rb @@ -206,8 +206,6 @@ "tqs", "tqz", "tqnz", - "peekq", - "pokeq", "bqeq", "bqneq", "bqa", @@ -249,6 +247,9 @@ "bnz", "leai", "leap", + "pushCalleeSaves", + "popCalleeSaves", + "memfence" ] X86_INSTRUCTIONS = @@ -257,6 +258,12 @@ "idivi" ] +ARM64_INSTRUCTIONS = + [ + "popLRAndFP", # ARM64 requires registers to be pushed and popped in pairs, + "pushLRAndFP" # therefore we do LR (link register) and FP (frame pointer) together. + ] + RISC_INSTRUCTIONS = [ "smulli", # Multiply two 32-bit words and produce a 64-bit word @@ -286,7 +293,8 @@ "loaddReversedAndIncrementAddress", "storedReversedAndDecrementAddress", "ldspr", - "stspr" + "stspr", + "setargs" ] CXX_INSTRUCTIONS = @@ -305,7 +313,7 @@ "cloopDo", # no operands ] -INSTRUCTIONS = MACRO_INSTRUCTIONS + X86_INSTRUCTIONS + RISC_INSTRUCTIONS + MIPS_INSTRUCTIONS + SH4_INSTRUCTIONS + CXX_INSTRUCTIONS +INSTRUCTIONS = MACRO_INSTRUCTIONS + X86_INSTRUCTIONS + ARM64_INSTRUCTIONS + RISC_INSTRUCTIONS + MIPS_INSTRUCTIONS + SH4_INSTRUCTIONS + CXX_INSTRUCTIONS INSTRUCTION_PATTERN = Regexp.new('\\A((' + INSTRUCTIONS.join(')|(') + '))\\Z') diff --git a/JavaScriptCore/offlineasm/mips.rb b/JavaScriptCore/offlineasm/mips.rb index d2ab6139..686f58f1 100644 --- a/JavaScriptCore/offlineasm/mips.rb +++ b/JavaScriptCore/offlineasm/mips.rb @@ -82,6 +82,10 @@ def mipsOperand "$a0" when "a1" "$a1" + when "a2" + "$a2" + when "a3" + "$a3" when "r0", "t0" "$v0" when "r1", "t1" @@ -101,7 +105,7 @@ def mipsOperand when "t8" "$t8" when "cfr" - "$s0" + "$fp" when "lr" "$ra" when "sp" @@ -307,46 +311,93 @@ def mipsLowerSimpleBranchOps(list) # class Node - def mipsLowerMalformedAddressesRecurse(list, topLevelNode, &block) + def mipsLowerMalformedAddressesRecurse(list) mapChildren { | subNode | - subNode.mipsLowerMalformedAddressesRecurse(list, topLevelNode, &block) + subNode.mipsLowerMalformedAddressesRecurse(list) } end -end -class Address - def mipsLowerMalformedAddressesRecurse(list, node, &block) - riscLowerMalformedAddressesRecurse(list, node, &block) + def mipsLowerShiftedAddressesRecurse(list, isFirst, tmp) + mapChildren { + | subNode | + subNode.mipsLowerShiftedAddressesRecurse(list, isFirst, tmp) + } end end class BaseIndex - def mipsLowerMalformedAddressesRecurse(list, node, &block) + def mipsLowerMalformedAddressesRecurse(list) + tmp = Tmp.new(codeOrigin, :gpr) if scaleShift == 0 - tmp0 = Tmp.new(codeOrigin, :gpr) - list << Instruction.new(codeOrigin, "addp", [base, index, tmp0]) - Address.new(codeOrigin, tmp0, Immediate.new(codeOrigin, offset.value)); - else - tmp0 = Tmp.new(codeOrigin, :gpr) - list << Instruction.new(codeOrigin, "lshifti", [index, Immediate.new(codeOrigin, scaleShift), tmp0]); - list << Instruction.new(codeOrigin, "addp", [base, tmp0]) - Address.new(codeOrigin, tmp0, Immediate.new(codeOrigin, offset.value)); + list << Instruction.new(codeOrigin, "addp", [base, index, tmp]) + Address.new(codeOrigin, tmp, Immediate.new(codeOrigin, offset.value)); end end -end -class AbsoluteAddress - def mipsLowerMalformedAddressesRecurse(list, node, &block) - riscLowerMalformedAddressesRecurse(list, node, &block) + def mipsLowerShiftedAddressesRecurse(list, isFirst, tmp) + if isFirst + list << Instruction.new(codeOrigin, "lshifti", [index, Immediate.new(codeOrigin, scaleShift), tmp]); + list << Instruction.new(codeOrigin, "addp", [base, tmp]) + end + Address.new(codeOrigin, tmp, Immediate.new(codeOrigin, offset.value)); end end -def mipsLowerMalformedAddresses(list, &block) - newList = [] - list.each { - | node | - newList << node.mipsLowerMalformedAddressesRecurse(newList, node, &block) +# +# Lowering of BaseIndex addresses with optimization for MIPS. +# +# offline asm instruction pair: +# loadi 4[cfr, t0, 8], t2 +# loadi 0[cfr, t0, 8], t0 +# +# lowered instructions: +# lshifti t0, 3, tmp +# addp cfr, tmp +# loadi 4[tmp], t2 +# loadi 0[tmp], t0 +# + +def mipsHasShiftedBaseIndexAddress(instruction) + instruction.operands.each_with_index { + | operand, index | + if operand.is_a? BaseIndex and operand.scaleShift != 0 + return index + end + } + -1 +end + +def mipsScaleOfBaseIndexMatches(baseIndex0, baseIndex1) + baseIndex0.base == baseIndex1.base and + baseIndex0.index == baseIndex1.index and + baseIndex0.scale == baseIndex1.scale +end + +def mipsLowerBaseIndexAddresses(list) + newList = [ list[0] ] + tmp = nil + list.each_cons(2) { + | nodes | + if nodes[1].is_a? Instruction + ind = mipsHasShiftedBaseIndexAddress(nodes[1]) + if ind != -1 + if nodes[0].is_a? Instruction and + nodes[0].opcode == nodes[1].opcode and + ind == mipsHasShiftedBaseIndexAddress(nodes[0]) and + mipsScaleOfBaseIndexMatches(nodes[0].operands[ind], nodes[1].operands[ind]) + + newList << nodes[1].mipsLowerShiftedAddressesRecurse(newList, false, tmp) + else + tmp = Tmp.new(codeOrigin, :gpr) + newList << nodes[1].mipsLowerShiftedAddressesRecurse(newList, true, tmp) + end + else + newList << nodes[1].mipsLowerMalformedAddressesRecurse(newList) + end + else + newList << nodes[1] + end } newList end @@ -559,7 +610,8 @@ def getModifiedListMIPS result = riscLowerSimpleBranchOps(result) result = riscLowerHardBranchOps(result) result = riscLowerShiftOps(result) - result = mipsLowerMalformedAddresses(result) { + result = mipsLowerBaseIndexAddresses(result) + result = riscLowerMalformedAddresses(result) { | node, address | if address.is_a? Address (-0xffff..0xffff).include? address.offset.value @@ -787,11 +839,31 @@ def lowerMIPS # FIXME: either support this or remove it. raise "MIPS does not support this opcode yet, #{codeOrigin}" when "pop" - $asm.puts "lw #{operands[0].mipsOperand}, 0($sp)" - $asm.puts "addiu $sp, $sp, 4" + operands.each { + | op | + $asm.puts "lw #{op.mipsOperand}, 0($sp)" + $asm.puts "addiu $sp, $sp, 4" + } when "push" - $asm.puts "addiu $sp, $sp, -4" - $asm.puts "sw #{operands[0].mipsOperand}, 0($sp)" + operands.each { + | op | + $asm.puts "addiu $sp, $sp, -4" + $asm.puts "sw #{op.mipsOperand}, 0($sp)" + } + when "popCalleeSaves" + $asm.puts "lw $16, 0($sp)" + $asm.puts "lw $17, 4($sp)" + $asm.puts "lw $18, 8($sp)" + $asm.puts "lw $19, 12($sp)" + $asm.puts "lw $20, 16($sp)" + $asm.puts "addiu $sp, $sp, 20" + when "pushCalleeSaves" + $asm.puts "addiu $sp, $sp, -20" + $asm.puts "sw $20, 16($sp)" + $asm.puts "sw $19, 12($sp)" + $asm.puts "sw $18, 8($sp)" + $asm.puts "sw $17, 4($sp)" + $asm.puts "sw $16, 0($sp)" when "move", "sxi2p", "zxi2p" if operands[0].is_a? Immediate mipsMoveImmediate(operands[0].value, operands[1]) @@ -887,6 +959,8 @@ def lowerMIPS when "pichdrra" $asm.putStr("OFFLINE_ASM_CPLOAD($31)") $asm.puts "move $s4, $gp" + when "memfence" + $asm.puts "sync" else lowerDefault end diff --git a/JavaScriptCore/offlineasm/registers.rb b/JavaScriptCore/offlineasm/registers.rb index f062ae6a..94e0767a 100644 --- a/JavaScriptCore/offlineasm/registers.rb +++ b/JavaScriptCore/offlineasm/registers.rb @@ -30,19 +30,24 @@ "t2", "t3", "t4", + "t5", + "t6", + "t7", + "t8", + "t9", "cfr", "a0", "a1", + "a2", + "a3", "r0", "r1", "sp", "lr", # 64-bit only registers: - "t5", - "t6", # r10 - "csr1", # r14, tag type number register - "csr2" # r15, tag mask register + "csr1", # tag type number register + "csr2" # tag mask register ] FPRS = diff --git a/JavaScriptCore/offlineasm/sh4.rb b/JavaScriptCore/offlineasm/sh4.rb index 277a0f49..a804b29c 100644 --- a/JavaScriptCore/offlineasm/sh4.rb +++ b/JavaScriptCore/offlineasm/sh4.rb @@ -57,10 +57,6 @@ def register? class RegisterID def sh4Operand case name - when "a0" - "r4" - when "a1" - "r5" when "t0" "r0" when "t1" @@ -69,8 +65,18 @@ def sh4Operand "r2" when "t3" "r10" - when "t4" + when "t4", "a0" + "r4" + when "t5", "a1" + "r5" + when "t6", "a2" "r6" + when "t7", "a3" + "r7" + when "t8" + "r8" + when "t9" + "r9" when "cfr" "r14" when "sp" @@ -442,16 +448,69 @@ def sh4LowerDoubleSpecials(list) # def sh4LowerMisplacedLabels(list) + newList = [] + list.each { + | node | + if node.is_a? Instruction + operands = node.operands + newOperands = [] + operands.each { + | operand | + if operand.is_a? LabelReference + tmp = Tmp.new(operand.codeOrigin, :gpr) + newList << Instruction.new(operand.codeOrigin, "move", [operand, tmp]) + newOperands << tmp + else + newOperands << operand + end + } + newList << Instruction.new(node.codeOrigin, node.opcode, newOperands, node.annotation) + else + newList << node + end + } + newList +end + + +# +# Lowering of misplaced special registers for SH4. For example: +# +# storep pr, foo +# +# becomes: +# +# stspr tmp +# storep tmp, foo +# + +def sh4LowerMisplacedSpecialRegisters(list) newList = [] list.each { | node | if node.is_a? Instruction case node.opcode - when "jmp", "call" - if node.operands[0].is_a? LabelReference + when "move" + if node.operands[0].is_a? RegisterID and node.operands[0].sh4Operand == "pr" + newList << Instruction.new(codeOrigin, "stspr", [node.operands[1]]) + elsif node.operands[1].is_a? RegisterID and node.operands[1].sh4Operand == "pr" + newList << Instruction.new(codeOrigin, "ldspr", [node.operands[0]]) + else + newList << node + end + when "loadi", "loadis", "loadp" + if node.operands[1].is_a? RegisterID and node.operands[1].sh4Operand == "pr" + tmp = Tmp.new(codeOrigin, :gpr) + newList << Instruction.new(codeOrigin, node.opcode, [node.operands[0], tmp]) + newList << Instruction.new(codeOrigin, "ldspr", [tmp]) + else + newList << node + end + when "storei", "storep" + if node.operands[0].is_a? RegisterID and node.operands[0].sh4Operand == "pr" tmp = Tmp.new(codeOrigin, :gpr) - newList << Instruction.new(codeOrigin, "move", [node.operands[0], tmp]) - newList << Instruction.new(codeOrigin, node.opcode, [tmp]) + newList << Instruction.new(codeOrigin, "stspr", [tmp]) + newList << Instruction.new(codeOrigin, node.opcode, [tmp, node.operands[1]]) else newList << node end @@ -557,6 +616,78 @@ def sh4LowerConstPool(list) end +# +# Lowering of argument setup for SH4. +# This phase avoids argument register trampling. For example, if a0 == t4: +# +# setargs t1, t4 +# +# becomes: +# +# move t4, a1 +# move t1, a0 +# + +def sh4LowerArgumentSetup(list) + a0 = RegisterID.forName(codeOrigin, "a0") + a1 = RegisterID.forName(codeOrigin, "a1") + a2 = RegisterID.forName(codeOrigin, "a2") + a3 = RegisterID.forName(codeOrigin, "a3") + newList = [] + list.each { + | node | + if node.is_a? Instruction + case node.opcode + when "setargs" + if node.operands.size == 2 + if node.operands[1].sh4Operand != a0.sh4Operand + newList << Instruction.new(codeOrigin, "move", [node.operands[0], a0]) + newList << Instruction.new(codeOrigin, "move", [node.operands[1], a1]) + elsif node.operands[0].sh4Operand != a1.sh4Operand + newList << Instruction.new(codeOrigin, "move", [node.operands[1], a1]) + newList << Instruction.new(codeOrigin, "move", [node.operands[0], a0]) + else + # As (operands[0] == a1) and (operands[1] == a0), we just need to swap a0 and a1. + newList << Instruction.new(codeOrigin, "xori", [a0, a1]) + newList << Instruction.new(codeOrigin, "xori", [a1, a0]) + newList << Instruction.new(codeOrigin, "xori", [a0, a1]) + end + elsif node.operands.size == 4 + # FIXME: We just raise an error if something is likely to go wrong for now. + # It would be better to implement a recovering algorithm. + if (node.operands[0].sh4Operand == a1.sh4Operand) or + (node.operands[0].sh4Operand == a2.sh4Operand) or + (node.operands[0].sh4Operand == a3.sh4Operand) or + (node.operands[1].sh4Operand == a0.sh4Operand) or + (node.operands[1].sh4Operand == a2.sh4Operand) or + (node.operands[1].sh4Operand == a3.sh4Operand) or + (node.operands[2].sh4Operand == a0.sh4Operand) or + (node.operands[2].sh4Operand == a1.sh4Operand) or + (node.operands[2].sh4Operand == a3.sh4Operand) or + (node.operands[3].sh4Operand == a0.sh4Operand) or + (node.operands[3].sh4Operand == a1.sh4Operand) or + (node.operands[3].sh4Operand == a2.sh4Operand) + raise "Potential argument register trampling detected." + end + + newList << Instruction.new(codeOrigin, "move", [node.operands[0], a0]) + newList << Instruction.new(codeOrigin, "move", [node.operands[1], a1]) + newList << Instruction.new(codeOrigin, "move", [node.operands[2], a2]) + newList << Instruction.new(codeOrigin, "move", [node.operands[3], a3]) + else + raise "Invalid operands number (#{node.operands.size}) for setargs" + end + else + newList << node + end + else + newList << node + end + } + newList +end + + class Sequence def getModifiedListSH4 result = @list @@ -600,13 +731,15 @@ def getModifiedListSH4 "bbeq", "bbneq", "bbb", "bieq", "bpeq", "bineq", "bpneq", "bia", "bpa", "biaeq", "bpaeq", "bib", "bpb", "bigteq", "bpgteq", "bilt", "bplt", "bigt", "bpgt", "bilteq", "bplteq", "btiz", "btpz", "btinz", "btpnz", "btbz", "btbnz"]) result = riscLowerMalformedImmediates(result, -128..127) - result = sh4LowerMisplacedLabels(result) result = riscLowerMisplacedAddresses(result) + result = sh4LowerMisplacedLabels(result) + result = sh4LowerMisplacedSpecialRegisters(result) result = assignRegistersToTemporaries(result, :gpr, SH4_TMP_GPRS) result = assignRegistersToTemporaries(result, :gpr, SH4_TMP_FPRS) result = sh4LowerConstPool(result) + result = sh4LowerArgumentSetup(result) return result end @@ -617,6 +750,7 @@ def sh4Operands(operands) end def emitSH4Branch(sh4opcode, operand) + raise "Invalid operand #{operand}" unless operand.is_a? RegisterID or operand.is_a? SpecialRegister $asm.puts "#{sh4opcode} @#{operand.sh4Operand}" $asm.puts "nop" end @@ -640,12 +774,16 @@ def emitSH4ShiftImm(val, operand, direction) end end -def emitSH4BranchIfT(label, neg) +def emitSH4BranchIfT(dest, neg) outlabel = LocalLabel.unique("branchIfT") sh4opcode = neg ? "bt" : "bf" $asm.puts "#{sh4opcode} #{LocalLabelReference.new(codeOrigin, outlabel).asmLabel}" - $asm.puts "bra #{label.asmLabel}" - $asm.puts "nop" + if dest.is_a? LocalLabelReference + $asm.puts "bra #{dest.asmLabel}" + $asm.puts "nop" + else + emitSH4Branch("jmp", dest) + end outlabel.lower("SH4") end @@ -877,7 +1015,7 @@ def lowerSH4 else $asm.puts "mov.l #{operands[0].labelref.asmLabel}, #{operands[1].sh4Operand}" end - else + elsif operands[0].sh4Operand != operands[1].sh4Operand $asm.puts "mov #{sh4Operands(operands)}" end when "leap" @@ -905,6 +1043,24 @@ def lowerSH4 $asm.puts "lds #{sh4Operands(operands)}, pr" when "stspr" $asm.puts "sts pr, #{sh4Operands(operands)}" + when "memfence" + $asm.puts "synco" + when "popCalleeSaves" + $asm.puts "mov.l @r15+, r8" + $asm.puts "mov.l @r15+, r9" + $asm.puts "mov.l @r15+, r10" + $asm.puts "mov.l @r15+, r11" + $asm.puts "mov.l @r15+, r13" + $asm.puts "lds.l @r15+, pr" + $asm.puts "mov.l @r15+, r14" + when "pushCalleeSaves" + $asm.puts "mov.l r14, @-r15" + $asm.puts "sts.l pr, @-r15" + $asm.puts "mov.l r13, @-r15" + $asm.puts "mov.l r11, @-r15" + $asm.puts "mov.l r10, @-r15" + $asm.puts "mov.l r9, @-r15" + $asm.puts "mov.l r8, @-r15" when "break" # This special opcode always generates an illegal instruction exception. $asm.puts ".word 0xfffd" diff --git a/JavaScriptCore/offlineasm/x86.rb b/JavaScriptCore/offlineasm/x86.rb index 4e2015ba..e47f2956 100644 --- a/JavaScriptCore/offlineasm/x86.rb +++ b/JavaScriptCore/offlineasm/x86.rb @@ -74,11 +74,11 @@ def x86CallOperand(kind) class RegisterID def supports8BitOnX86 case name - when "t0", "a0", "r0", "t1", "a1", "r1", "t2", "t3" + when "t0", "a0", "r0", "t1", "a1", "r1", "t2", "t3", "t4", "t5" true when "cfr", "ttnr", "tmr" false - when "t4", "t5" + when "t6" isX64 else raise @@ -100,7 +100,7 @@ def x86Operand(kind) when :quad isX64 ? "%rax" : raise else - raise + raise "Invalid kind #{kind} for name #{name}" end when "t1", "a1", "r1" case kind @@ -166,26 +166,24 @@ def x86Operand(kind) if isX64 case kind when :half - "%r13w" + "%bp" when :int - "%r13d" + "%ebp" when :ptr - "%r13" + "%rbp" when :quad - "%r13" + "%rbp" else raise end else case kind - when :byte - "%dil" when :half - "%di" + "%bp" when :int - "%edi" + "%ebp" when :ptr - "%edi" + "%ebp" else raise end @@ -206,7 +204,6 @@ def x86Operand(kind) raise end when "t5" - raise "Cannot use #{name} in 32-bit X86 at #{codeOriginString}" unless isX64 case kind when :byte "%dil" @@ -215,9 +212,9 @@ def x86Operand(kind) when :int "%edi" when :ptr - "%rdi" + isX64 ? "%rdi" : "%edi" when :quad - "%rdi" + isX64 ? "%rdi" : raise end when "t6" raise "Cannot use #{name} in 32-bit X86 at #{codeOriginString}" unless isX64 @@ -981,9 +978,39 @@ def lowerX86Common $asm.puts "xorpd #{operands[0].x86Operand(:double)}, #{operands[0].x86Operand(:double)}" end when "pop" - $asm.puts "pop #{operands[0].x86Operand(:ptr)}" + operands.each { + | op | + $asm.puts "pop #{op.x86Operand(:ptr)}" + } when "push" - $asm.puts "push #{operands[0].x86Operand(:ptr)}" + operands.each { + | op | + $asm.puts "push #{op.x86Operand(:ptr)}" + } + when "popCalleeSaves" + if isX64 + $asm.puts "pop %rbx" + $asm.puts "pop %r15" + $asm.puts "pop %r14" + $asm.puts "pop %r13" + $asm.puts "pop %r12" + else + $asm.puts "pop %ebx" + $asm.puts "pop %edi" + $asm.puts "pop %esi" + end + when "pushCalleeSaves" + if isX64 + $asm.puts "push %r12" + $asm.puts "push %r13" + $asm.puts "push %r14" + $asm.puts "push %r15" + $asm.puts "push %rbx" + else + $asm.puts "push %esi" + $asm.puts "push %edi" + $asm.puts "push %ebx" + end when "move" handleMove when "sxi2q" @@ -1265,15 +1292,9 @@ def lowerX86Common when "peek" sp = RegisterID.new(nil, "sp") $asm.puts "mov#{x86Suffix(:ptr)} #{operands[0].value * x86Bytes(:ptr)}(#{sp.x86Operand(:ptr)}), #{operands[1].x86Operand(:ptr)}" - when "peekq" - sp = RegisterID.new(nil, "sp") - $asm.puts "mov#{x86Suffix(:quad)} #{operands[0].value * x86Bytes(:quad)}(#{sp.x86Operand(:ptr)}), #{operands[1].x86Operand(:quad)}" when "poke" sp = RegisterID.new(nil, "sp") $asm.puts "mov#{x86Suffix(:ptr)} #{operands[0].x86Operand(:ptr)}, #{operands[1].value * x86Bytes(:ptr)}(#{sp.x86Operand(:ptr)})" - when "pokeq" - sp = RegisterID.new(nil, "sp") - $asm.puts "mov#{x86Suffix(:quad)} #{operands[0].x86Operand(:quad)}, #{operands[1].value * x86Bytes(:quad)}(#{sp.x86Operand(:ptr)})" when "cdqi" $asm.puts "cdq" when "idivi" @@ -1342,6 +1363,8 @@ def lowerX86Common $asm.puts "leal #{operands[0].x86AddressOperand(:int)}, #{operands[1].x86Operand(:int)}" when "leap" $asm.puts "lea#{x86Suffix(:ptr)} #{operands[0].x86AddressOperand(:ptr)}, #{operands[1].x86Operand(:ptr)}" + when "memfence" + $asm.puts "mfence" else lowerDefault end diff --git a/JavaScriptCore/parser/ASTBuilder.h b/JavaScriptCore/parser/ASTBuilder.h index c16a7fd0..58713864 100644 --- a/JavaScriptCore/parser/ASTBuilder.h +++ b/JavaScriptCore/parser/ASTBuilder.h @@ -283,17 +283,17 @@ class ASTBuilder { return result; } - FunctionBodyNode* createFunctionBody(const JSTokenLocation& startLocation, const JSTokenLocation& endLocation, unsigned startColumn, bool inStrictContext) + FunctionBodyNode* createFunctionBody(const JSTokenLocation& startLocation, const JSTokenLocation& endLocation, unsigned startColumn, unsigned endColumn, bool inStrictContext) { - return FunctionBodyNode::create(m_vm, startLocation, endLocation, startColumn, inStrictContext); + return FunctionBodyNode::create(m_vm, startLocation, endLocation, startColumn, endColumn, inStrictContext); } - void setFunctionStart(FunctionBodyNode* body, int functionStart) + void setFunctionNameStart(FunctionBodyNode* body, int functionNameStart) { - body->setFunctionStart(functionStart); + body->setFunctionNameStart(functionNameStart); } - template PropertyNode* createGetterOrSetterProperty(const JSTokenLocation& location, PropertyNode::Type type, const Identifier* name, ParameterNode* params, FunctionBodyNode* body, unsigned openBraceOffset, unsigned closeBraceOffset, int bodyStartLine, int bodyEndLine, unsigned bodyStartColumn) + NEVER_INLINE PropertyNode* createGetterOrSetterProperty(const JSTokenLocation& location, PropertyNode::Type type, bool, const Identifier* name, ParameterNode* params, FunctionBodyNode* body, unsigned openBraceOffset, unsigned closeBraceOffset, int bodyStartLine, int bodyEndLine, unsigned bodyStartColumn) { ASSERT(name); body->setLoc(bodyStartLine, bodyEndLine, location.startOffset, location.lineStartOffset); @@ -301,7 +301,7 @@ class ASTBuilder { return new (m_vm) PropertyNode(m_vm, *name, new (m_vm) FuncExprNode(location, m_vm->propertyNames->nullIdentifier, body, m_sourceCode->subExpression(openBraceOffset, closeBraceOffset, bodyStartLine, bodyStartColumn), params), type); } - template PropertyNode* createGetterOrSetterProperty(VM*, const JSTokenLocation& location, PropertyNode::Type type, double name, ParameterNode* params, FunctionBodyNode* body, unsigned openBraceOffset, unsigned closeBraceOffset, int bodyStartLine, int bodyEndLine, unsigned bodyStartColumn) + NEVER_INLINE PropertyNode* createGetterOrSetterProperty(VM*, const JSTokenLocation& location, PropertyNode::Type type, bool, double name, ParameterNode* params, FunctionBodyNode* body, unsigned openBraceOffset, unsigned closeBraceOffset, int bodyStartLine, int bodyEndLine, unsigned bodyStartColumn) { body->setLoc(bodyStartLine, bodyEndLine, location.startOffset, location.lineStartOffset); return new (m_vm) PropertyNode(m_vm, name, new (m_vm) FuncExprNode(location, m_vm->propertyNames->nullIdentifier, body, m_sourceCode->subExpression(openBraceOffset, closeBraceOffset, bodyStartLine, bodyStartColumn), params), type); @@ -312,14 +312,14 @@ class ASTBuilder { ArgumentListNode* createArgumentsList(const JSTokenLocation& location, ExpressionNode* arg) { return new (m_vm) ArgumentListNode(location, arg); } ArgumentListNode* createArgumentsList(const JSTokenLocation& location, ArgumentListNode* args, ExpressionNode* arg) { return new (m_vm) ArgumentListNode(location, args, arg); } - template PropertyNode* createProperty(const Identifier* propertyName, ExpressionNode* node, PropertyNode::Type type) + PropertyNode* createProperty(const Identifier* propertyName, ExpressionNode* node, PropertyNode::Type type, bool) { if (node->isFuncExprNode()) static_cast(node)->body()->setInferredName(*propertyName); return new (m_vm) PropertyNode(m_vm, *propertyName, node, type); } - template PropertyNode* createProperty(VM*, double propertyName, ExpressionNode* node, PropertyNode::Type type) { return new (m_vm) PropertyNode(m_vm, propertyName, node, type); } - template PropertyNode* createProperty(VM*, ExpressionNode* propertyName, ExpressionNode* node, PropertyNode::Type type) { return new (m_vm) PropertyNode(m_vm, propertyName, node, type); } + PropertyNode* createProperty(VM*, double propertyName, ExpressionNode* node, PropertyNode::Type type, bool) { return new (m_vm) PropertyNode(m_vm, propertyName, node, type); } + PropertyNode* createProperty(VM*, ExpressionNode* propertyName, ExpressionNode* node, PropertyNode::Type type, bool) { return new (m_vm) PropertyNode(m_vm, propertyName, node, type); } PropertyListNode* createPropertyList(const JSTokenLocation& location, PropertyNode* property) { return new (m_vm) PropertyListNode(location, property); } PropertyListNode* createPropertyList(const JSTokenLocation& location, PropertyNode* property, PropertyListNode* tail) { return new (m_vm) PropertyListNode(location, property, tail); } @@ -720,8 +720,8 @@ class ASTBuilder { Scope m_scope; Vector m_binaryOperandStack; Vector m_assignmentInfoStack; - Vector, 10, UnsafeVectorOverflow> m_binaryOperatorStack; - Vector, 10, UnsafeVectorOverflow> m_unaryTokenStack; + Vector, 10, UnsafeVectorOverflow> m_binaryOperatorStack; + Vector, 10, UnsafeVectorOverflow> m_unaryTokenStack; int m_evalCount; }; @@ -898,7 +898,7 @@ ExpressionNode* ASTBuilder::makeFunctionCallNode(const JSTokenLocation& location return node; } -ExpressionNode* ASTBuilder::makeBinaryNode(const JSTokenLocation& location, int token, pair lhs, pair rhs) +ExpressionNode* ASTBuilder::makeBinaryNode(const JSTokenLocation& location, int token, std::pair lhs, std::pair rhs) { switch (token) { case OR: diff --git a/JavaScriptCore/parser/Lexer.cpp b/JavaScriptCore/parser/Lexer.cpp index e5321f97..2211f552 100644 --- a/JavaScriptCore/parser/Lexer.cpp +++ b/JavaScriptCore/parser/Lexer.cpp @@ -618,6 +618,7 @@ void Lexer::shiftLineTerminator() { ASSERT(isLineTerminator(m_current)); + m_positionBeforeLastNewline = currentPosition(); T prev = m_current; shift(); @@ -1853,14 +1854,6 @@ void Lexer::clear() m_isReparsing = false; } -template -SourceCode Lexer::sourceCode(int openBrace, int closeBrace, int firstLine, unsigned startColumn) -{ - ASSERT(m_source->provider()->source()[openBrace] == '{'); - ASSERT(m_source->provider()->source()[closeBrace] == '}'); - return SourceCode(m_source->provider(), openBrace, closeBrace + 1, firstLine, startColumn); -} - // Instantiate the two flavors of Lexer we need instead of putting most of this file in Lexer.h template class Lexer; template class Lexer; diff --git a/JavaScriptCore/parser/Lexer.h b/JavaScriptCore/parser/Lexer.h index 91b32263..28c61ba1 100644 --- a/JavaScriptCore/parser/Lexer.h +++ b/JavaScriptCore/parser/Lexer.h @@ -95,10 +95,10 @@ class Lexer { { return JSTextPosition(m_lineNumber, currentOffset(), currentLineStartOffset()); } + JSTextPosition positionBeforeLastNewline() const { return m_positionBeforeLastNewline; } void setLastLineNumber(int lastLineNumber) { m_lastLineNumber = lastLineNumber; } int lastLineNumber() const { return m_lastLineNumber; } bool prevTerminator() const { return m_terminator; } - SourceCode sourceCode(int openBrace, int closeBrace, int firstLine, unsigned startColumn); bool scanRegExp(const Identifier*& pattern, const Identifier*& flags, UChar patternPrefix = 0); bool skipRegExp(); @@ -227,6 +227,7 @@ class Lexer { const T* m_codeEnd; const T* m_codeStartPlusOffset; const T* m_lineStart; + JSTextPosition m_positionBeforeLastNewline; bool m_isReparsing; bool m_atLineStart; bool m_error; diff --git a/JavaScriptCore/parser/Nodes.cpp b/JavaScriptCore/parser/Nodes.cpp index d8ddeafa..fc9ccd9f 100644 --- a/JavaScriptCore/parser/Nodes.cpp +++ b/JavaScriptCore/parser/Nodes.cpp @@ -114,15 +114,16 @@ StatementNode* ScopeNode::singleStatement() const // ------------------------------ ProgramNode ----------------------------- -inline ProgramNode::ProgramNode(VM* vm, const JSTokenLocation& startLocation, const JSTokenLocation& endLocation, unsigned startColumn, SourceElements* children, VarStack* varStack, FunctionStack* funcStack, IdentifierSet& capturedVariables, const SourceCode& source, CodeFeatures features, int numConstants) +inline ProgramNode::ProgramNode(VM* vm, const JSTokenLocation& startLocation, const JSTokenLocation& endLocation, unsigned startColumn, unsigned endColumn, SourceElements* children, VarStack* varStack, FunctionStack* funcStack, IdentifierSet& capturedVariables, const SourceCode& source, CodeFeatures features, int numConstants) : ScopeNode(vm, startLocation, endLocation, source, children, varStack, funcStack, capturedVariables, features, numConstants) , m_startColumn(startColumn) + , m_endColumn(endColumn) { } -PassRefPtr ProgramNode::create(VM* vm, const JSTokenLocation& startLocation, const JSTokenLocation& endLocation, unsigned startColumn, SourceElements* children, VarStack* varStack, FunctionStack* funcStack, IdentifierSet& capturedVariables, const SourceCode& source, CodeFeatures features, int numConstants) +PassRefPtr ProgramNode::create(VM* vm, const JSTokenLocation& startLocation, const JSTokenLocation& endLocation, unsigned startColumn, unsigned endColumn, SourceElements* children, VarStack* varStack, FunctionStack* funcStack, IdentifierSet& capturedVariables, const SourceCode& source, CodeFeatures features, int numConstants) { - RefPtr node = new ProgramNode(vm, startLocation, endLocation, startColumn, children, varStack, funcStack, capturedVariables, source, features, numConstants); + RefPtr node = new ProgramNode(vm, startLocation, endLocation, startColumn, endColumn, children, varStack, funcStack, capturedVariables, source, features, numConstants); ASSERT(node->m_arena.last() == node); node->m_arena.removeLast(); @@ -133,14 +134,15 @@ PassRefPtr ProgramNode::create(VM* vm, const JSTokenLocation& start // ------------------------------ EvalNode ----------------------------- -inline EvalNode::EvalNode(VM* vm, const JSTokenLocation& startLocation, const JSTokenLocation& endLocation, SourceElements* children, VarStack* varStack, FunctionStack* funcStack, IdentifierSet& capturedVariables, const SourceCode& source, CodeFeatures features, int numConstants) +inline EvalNode::EvalNode(VM* vm, const JSTokenLocation& startLocation, const JSTokenLocation& endLocation, unsigned endColumn, SourceElements* children, VarStack* varStack, FunctionStack* funcStack, IdentifierSet& capturedVariables, const SourceCode& source, CodeFeatures features, int numConstants) : ScopeNode(vm, startLocation, endLocation, source, children, varStack, funcStack, capturedVariables, features, numConstants) + , m_endColumn(endColumn) { } -PassRefPtr EvalNode::create(VM* vm, const JSTokenLocation& startLocation, const JSTokenLocation& endLocation, unsigned, SourceElements* children, VarStack* varStack, FunctionStack* funcStack, IdentifierSet& capturedVariables, const SourceCode& source, CodeFeatures features, int numConstants) +PassRefPtr EvalNode::create(VM* vm, const JSTokenLocation& startLocation, const JSTokenLocation& endLocation, unsigned, unsigned endColumn, SourceElements* children, VarStack* varStack, FunctionStack* funcStack, IdentifierSet& capturedVariables, const SourceCode& source, CodeFeatures features, int numConstants) { - RefPtr node = new EvalNode(vm, startLocation, endLocation, children, varStack, funcStack, capturedVariables, source, features, numConstants); + RefPtr node = new EvalNode(vm, startLocation, endLocation, endColumn, children, varStack, funcStack, capturedVariables, source, features, numConstants); ASSERT(node->m_arena.last() == node); node->m_arena.removeLast(); @@ -179,15 +181,17 @@ FunctionParameters::~FunctionParameters() patterns()[i]->deref(); } -inline FunctionBodyNode::FunctionBodyNode(VM* vm, const JSTokenLocation& startLocation, const JSTokenLocation& endLocation, unsigned startColumn, bool inStrictContext) +inline FunctionBodyNode::FunctionBodyNode(VM* vm, const JSTokenLocation& startLocation, const JSTokenLocation& endLocation, unsigned startColumn, unsigned endColumn, bool inStrictContext) : ScopeNode(vm, startLocation, endLocation, inStrictContext) , m_startColumn(startColumn) + , m_endColumn(endColumn) { } -inline FunctionBodyNode::FunctionBodyNode(VM* vm, const JSTokenLocation& startLocation, const JSTokenLocation& endLocation, unsigned startColumn, SourceElements* children, VarStack* varStack, FunctionStack* funcStack, IdentifierSet& capturedVariables, const SourceCode& sourceCode, CodeFeatures features, int numConstants) +inline FunctionBodyNode::FunctionBodyNode(VM* vm, const JSTokenLocation& startLocation, const JSTokenLocation& endLocation, unsigned startColumn, unsigned endColumn, SourceElements* children, VarStack* varStack, FunctionStack* funcStack, IdentifierSet& capturedVariables, const SourceCode& sourceCode, CodeFeatures features, int numConstants) : ScopeNode(vm, startLocation, endLocation, sourceCode, children, varStack, funcStack, capturedVariables, features, numConstants) , m_startColumn(startColumn) + , m_endColumn(endColumn) { } @@ -205,14 +209,14 @@ void FunctionBodyNode::finishParsing(PassRefPtr parameters, m_functionNameIsInScopeToggle = functionNameIsInScopeToggle; } -FunctionBodyNode* FunctionBodyNode::create(VM* vm, const JSTokenLocation& startLocation, const JSTokenLocation& endLocation, unsigned startColumn, bool inStrictContext) +FunctionBodyNode* FunctionBodyNode::create(VM* vm, const JSTokenLocation& startLocation, const JSTokenLocation& endLocation, unsigned startColumn, unsigned endColumn, bool inStrictContext) { - return new FunctionBodyNode(vm, startLocation, endLocation, startColumn, inStrictContext); + return new FunctionBodyNode(vm, startLocation, endLocation, startColumn, endColumn, inStrictContext); } -PassRefPtr FunctionBodyNode::create(VM* vm, const JSTokenLocation& startLocation, const JSTokenLocation& endLocation, unsigned startColumn, SourceElements* children, VarStack* varStack, FunctionStack* funcStack, IdentifierSet& capturedVariables, const SourceCode& sourceCode, CodeFeatures features, int numConstants) +PassRefPtr FunctionBodyNode::create(VM* vm, const JSTokenLocation& startLocation, const JSTokenLocation& endLocation, unsigned startColumn, unsigned endColumn, SourceElements* children, VarStack* varStack, FunctionStack* funcStack, IdentifierSet& capturedVariables, const SourceCode& sourceCode, CodeFeatures features, int numConstants) { - RefPtr node = new FunctionBodyNode(vm, startLocation, endLocation, startColumn, children, varStack, funcStack, capturedVariables, sourceCode, features, numConstants); + RefPtr node = new FunctionBodyNode(vm, startLocation, endLocation, startColumn, endColumn , children, varStack, funcStack, capturedVariables, sourceCode, features, numConstants); ASSERT(node->m_arena.last() == node); node->m_arena.removeLast(); @@ -221,4 +225,10 @@ PassRefPtr FunctionBodyNode::create(VM* vm, const JSTokenLocat return node.release(); } +void FunctionBodyNode::setEndPosition(JSTextPosition position) +{ + m_lastLine = position.line; + m_endColumn = position.offset - position.lineStartOffset; +} + } // namespace JSC diff --git a/JavaScriptCore/parser/Nodes.h b/JavaScriptCore/parser/Nodes.h index 6fe9b7cc..990ff569 100644 --- a/JavaScriptCore/parser/Nodes.h +++ b/JavaScriptCore/parser/Nodes.h @@ -112,6 +112,7 @@ namespace JSC { }; class ParserArenaRefCounted : public RefCounted { + WTF_FASTMALLOC_OPERATORS; protected: ParserArenaRefCounted(VM*); @@ -191,7 +192,7 @@ namespace JSC { virtual bool isContinue() const { return false; } virtual bool isBlock() const { return false; } - private: + protected: int m_lastLine; }; @@ -1467,33 +1468,38 @@ namespace JSC { class ProgramNode : public ScopeNode { public: static const bool isFunctionNode = false; - static PassRefPtr create(VM*, const JSTokenLocation& start, const JSTokenLocation& end, unsigned startColumn, SourceElements*, VarStack*, FunctionStack*, IdentifierSet&, const SourceCode&, CodeFeatures, int numConstants); + static PassRefPtr create(VM*, const JSTokenLocation& start, const JSTokenLocation& end, unsigned startColumn, unsigned endColumn, SourceElements*, VarStack*, FunctionStack*, IdentifierSet&, const SourceCode&, CodeFeatures, int numConstants); - unsigned startColumn() { return m_startColumn; } + unsigned startColumn() const { return m_startColumn; } + unsigned endColumn() const { return m_endColumn; } static const bool scopeIsFunction = false; private: - ProgramNode(VM*, const JSTokenLocation& start, const JSTokenLocation& end, unsigned startColumn, SourceElements*, VarStack*, FunctionStack*, IdentifierSet&, const SourceCode&, CodeFeatures, int numConstants); + ProgramNode(VM*, const JSTokenLocation& start, const JSTokenLocation& end, unsigned startColumn, unsigned endColumn, SourceElements*, VarStack*, FunctionStack*, IdentifierSet&, const SourceCode&, CodeFeatures, int numConstants); virtual void emitBytecode(BytecodeGenerator&, RegisterID* = 0) OVERRIDE; unsigned m_startColumn; + unsigned m_endColumn; }; class EvalNode : public ScopeNode { public: static const bool isFunctionNode = false; - static PassRefPtr create(VM*, const JSTokenLocation& start, const JSTokenLocation& end, unsigned, SourceElements*, VarStack*, FunctionStack*, IdentifierSet&, const SourceCode&, CodeFeatures, int numConstants); + static PassRefPtr create(VM*, const JSTokenLocation& start, const JSTokenLocation& end, unsigned, unsigned endColumn, SourceElements*, VarStack*, FunctionStack*, IdentifierSet&, const SourceCode&, CodeFeatures, int numConstants); - unsigned startColumn() { return 1; } + ALWAYS_INLINE unsigned startColumn() const { return 0; } + unsigned endColumn() const { return m_endColumn; } static const bool scopeIsFunction = false; private: - EvalNode(VM*, const JSTokenLocation& start, const JSTokenLocation& end, SourceElements*, VarStack*, FunctionStack*, IdentifierSet&, const SourceCode&, CodeFeatures, int numConstants); + EvalNode(VM*, const JSTokenLocation& start, const JSTokenLocation& end, unsigned endColumn, SourceElements*, VarStack*, FunctionStack*, IdentifierSet&, const SourceCode&, CodeFeatures, int numConstants); virtual void emitBytecode(BytecodeGenerator&, RegisterID* = 0) OVERRIDE; + + unsigned m_endColumn; }; class FunctionParameters : public RefCounted { @@ -1518,8 +1524,8 @@ namespace JSC { class FunctionBodyNode : public ScopeNode { public: static const bool isFunctionNode = true; - static FunctionBodyNode* create(VM*, const JSTokenLocation& start, const JSTokenLocation& end, unsigned startColumn, bool isStrictMode); - static PassRefPtr create(VM*, const JSTokenLocation& start, const JSTokenLocation& end, unsigned startColumn, SourceElements*, VarStack*, FunctionStack*, IdentifierSet&, const SourceCode&, CodeFeatures, int numConstants); + static FunctionBodyNode* create(VM*, const JSTokenLocation& start, const JSTokenLocation& end, unsigned startColumn, unsigned endColumn, bool isStrictMode); + static PassRefPtr create(VM*, const JSTokenLocation& start, const JSTokenLocation& end, unsigned startColumn, unsigned endColumn, SourceElements*, VarStack*, FunctionStack*, IdentifierSet&, const SourceCode&, CodeFeatures, int numConstants); FunctionParameters* parameters() const { return m_parameters.get(); } size_t parameterCount() const { return m_parameters->size(); } @@ -1536,22 +1542,26 @@ namespace JSC { bool functionNameIsInScope() { return m_functionNameIsInScopeToggle == FunctionNameIsInScope; } FunctionNameIsInScopeToggle functionNameIsInScopeToggle() { return m_functionNameIsInScopeToggle; } - void setFunctionStart(int functionStart) { m_functionStart = functionStart; } - int functionStart() const { return m_functionStart; } + void setFunctionNameStart(int functionNameStart) { m_functionNameStart = functionNameStart; } + int functionNameStart() const { return m_functionNameStart; } unsigned startColumn() const { return m_startColumn; } + unsigned endColumn() const { return m_endColumn; } + + void setEndPosition(JSTextPosition); static const bool scopeIsFunction = true; private: - FunctionBodyNode(VM*, const JSTokenLocation& start, const JSTokenLocation& end, unsigned startColumn, bool inStrictContext); - FunctionBodyNode(VM*, const JSTokenLocation& start, const JSTokenLocation& end, unsigned startColumn, SourceElements*, VarStack*, FunctionStack*, IdentifierSet&, const SourceCode&, CodeFeatures, int numConstants); + FunctionBodyNode(VM*, const JSTokenLocation& start, const JSTokenLocation& end, unsigned startColumn, unsigned endColumn, bool inStrictContext); + FunctionBodyNode(VM*, const JSTokenLocation& start, const JSTokenLocation& end, unsigned startColumn, unsigned endColumn, SourceElements*, VarStack*, FunctionStack*, IdentifierSet&, const SourceCode&, CodeFeatures, int numConstants); Identifier m_ident; Identifier m_inferredName; FunctionNameIsInScopeToggle m_functionNameIsInScopeToggle; RefPtr m_parameters; - int m_functionStart; + int m_functionNameStart; unsigned m_startColumn; + unsigned m_endColumn; }; class FuncExprNode : public ExpressionNode { diff --git a/JavaScriptCore/parser/Parser.cpp b/JavaScriptCore/parser/Parser.cpp index d9c760c3..f856baf5 100644 --- a/JavaScriptCore/parser/Parser.cpp +++ b/JavaScriptCore/parser/Parser.cpp @@ -37,22 +37,16 @@ #include #include + #define updateErrorMessage(shouldPrintToken, ...) do {\ - ASSERT(!hasError());\ - StringPrintStream stream;\ - if (shouldPrintToken) {\ - printUnexpectedTokenText(stream); \ - stream.print(". "); \ - }\ - stream.print(__VA_ARGS__);\ - stream.print(".");\ - setErrorMessage(stream.toString());\ + propagateError(); \ + logError(shouldPrintToken, __VA_ARGS__); \ } while (0) #define propagateError() do { if (hasError()) return 0; } while (0) -#define internalFailWithMessage(shouldPrintToken, ...) do { if (!hasError()) updateErrorMessage(shouldPrintToken, __VA_ARGS__); return 0; } while (0) +#define internalFailWithMessage(shouldPrintToken, ...) do { updateErrorMessage(shouldPrintToken, __VA_ARGS__); return 0; } while (0) #define handleErrorToken() do { if (m_token.m_type == EOFTOK || m_token.m_type & ErrorTokenFlag) { failDueToUnexpectedToken(); } } while (0) -#define failWithMessage(...) do { if (!hasError()) { handleErrorToken(); updateErrorMessage(true, __VA_ARGS__); } return 0; } while (0) +#define failWithMessage(...) do { { handleErrorToken(); updateErrorMessage(true, __VA_ARGS__); } return 0; } while (0) #define failWithStackOverflow() do { updateErrorMessage(false, "Stack exhausted"); m_hasStackOverflow = true; return 0; } while (0) #define failIfFalse(cond, ...) do { if (!(cond)) { handleErrorToken(); internalFailWithMessage(true, __VA_ARGS__); } } while (0) #define failIfTrue(cond, ...) do { if ((cond)) { handleErrorToken(); internalFailWithMessage(true, __VA_ARGS__); } } while (0) @@ -65,13 +59,9 @@ #define semanticFail(...) do { internalFailWithMessage(false, __VA_ARGS__); } while (0) #define semanticFailIfTrue(cond, ...) do { if ((cond)) internalFailWithMessage(false, __VA_ARGS__); } while (0) #define semanticFailIfFalse(cond, ...) do { if (!(cond)) internalFailWithMessage(false, __VA_ARGS__); } while (0) -#define regexFail(failure) do { if (!hasError()) setErrorMessage(failure); return 0; } while (0) +#define regexFail(failure) do { setErrorMessage(failure); return 0; } while (0) #define failDueToUnexpectedToken() do {\ - if (!hasError()) {\ - StringPrintStream stream;\ - printUnexpectedTokenText(stream); \ - setErrorMessage(stream.toString());\ - }\ + logError(true);\ return 0;\ } while (0) @@ -92,11 +82,118 @@ using namespace std; namespace JSC { +template +void Parser::logError(bool) +{ + if (hasError()) + return; + StringPrintStream stream; + printUnexpectedTokenText(stream); + setErrorMessage(stream.toString()); +} + +template template +void Parser::logError(bool shouldPrintToken, const A& value1) +{ + if (hasError()) + return; + StringPrintStream stream; + if (shouldPrintToken) { + printUnexpectedTokenText(stream); + stream.print(". "); + } + stream.print(value1, "."); + setErrorMessage(stream.toString()); +} + +template template +void Parser::logError(bool shouldPrintToken, const A& value1, const B& value2) +{ + if (hasError()) + return; + StringPrintStream stream; + if (shouldPrintToken) { + printUnexpectedTokenText(stream); + stream.print(". "); + } + stream.print(value1, value2, "."); + setErrorMessage(stream.toString()); +} + +template template +void Parser::logError(bool shouldPrintToken, const A& value1, const B& value2, const C& value3) +{ + if (hasError()) + return; + StringPrintStream stream; + if (shouldPrintToken) { + printUnexpectedTokenText(stream); + stream.print(". "); + } + stream.print(value1, value2, value3, "."); + setErrorMessage(stream.toString()); +} + +template template +void Parser::logError(bool shouldPrintToken, const A& value1, const B& value2, const C& value3, const D& value4) +{ + if (hasError()) + return; + StringPrintStream stream; + if (shouldPrintToken) { + printUnexpectedTokenText(stream); + stream.print(". "); + } + stream.print(value1, value2, value3, value4, "."); + setErrorMessage(stream.toString()); +} + +template template +void Parser::logError(bool shouldPrintToken, const A& value1, const B& value2, const C& value3, const D& value4, const E& value5) +{ + if (hasError()) + return; + StringPrintStream stream; + if (shouldPrintToken) { + printUnexpectedTokenText(stream); + stream.print(". "); + } + stream.print(value1, value2, value3, value4, value5, "."); + setErrorMessage(stream.toString()); +} + +template template +void Parser::logError(bool shouldPrintToken, const A& value1, const B& value2, const C& value3, const D& value4, const E& value5, const F& value6) +{ + if (hasError()) + return; + StringPrintStream stream; + if (shouldPrintToken) { + printUnexpectedTokenText(stream); + stream.print(". "); + } + stream.print(value1, value2, value3, value4, value5, value6, "."); + setErrorMessage(stream.toString()); +} + +template template +void Parser::logError(bool shouldPrintToken, const A& value1, const B& value2, const C& value3, const D& value4, const E& value5, const F& value6, const G& value7) +{ + if (hasError()) + return; + StringPrintStream stream; + if (shouldPrintToken) { + printUnexpectedTokenText(stream); + stream.print(". "); + } + stream.print(value1, value2, value3, value4, value5, value6, value7, "."); + setErrorMessage(stream.toString()); +} + template Parser::Parser(VM* vm, const SourceCode& source, FunctionParameters* parameters, const Identifier& name, JSParserStrictness strictness, JSParserMode parserMode) : m_vm(vm) , m_source(&source) - , m_stack(*vm, wtfThreadData().stack()) , m_hasStackOverflow(false) , m_allowsIn(true) , m_assignmentCount(0) @@ -148,7 +245,7 @@ String Parser::parseInner() if (m_lexer->isReparsing()) m_statementDepth--; ScopeRef scope = currentScope(); - SourceElements* sourceElements = parseSourceElements(context); + SourceElements* sourceElements = parseSourceElements(context, CheckForStrictMode); if (!sourceElements || !consume(EOFTOK)) { if (hasError()) parseError = m_errorMessage; @@ -192,7 +289,7 @@ bool Parser::allowAutomaticSemicolon() } template -template TreeSourceElements Parser::parseSourceElements(TreeBuilder& context) +template TreeSourceElements Parser::parseSourceElements(TreeBuilder& context, SourceElementsMode mode) { const unsigned lengthOfUseStrictLiteral = 12; // "use strict".length TreeSourceElements sourceElements = context.createSourceElements(); @@ -349,7 +446,7 @@ template TreeExpression Parser::parseVarDeclarati } } else { lastIdent = 0; - auto pattern = parseDeconstructionPattern(context); + auto pattern = parseDeconstructionPattern(context, DeconstructToVariables); failIfFalse(pattern, "Cannot parse this deconstruction pattern"); hasInitializer = match(EQUAL); lastPattern = pattern; @@ -368,12 +465,12 @@ template TreeExpression Parser::parseVarDeclarati } } while (match(COMMA)); if (lastIdent) - lastPattern = createBindingPattern(context, *lastIdent, 0); + lastPattern = createBindingPattern(context, DeconstructToVariables, *lastIdent, 0); return varDecls; } template -template TreeDeconstructionPattern Parser::createBindingPattern(TreeBuilder& context, const Identifier& name, int depth) +template TreeDeconstructionPattern Parser::createBindingPattern(TreeBuilder& context, DeconstructionKind kind, const Identifier& name, int depth) { ASSERT(!name.isEmpty()); ASSERT(!name.isNull()); @@ -400,7 +497,8 @@ template TreeDeconstructionPattern semanticFail("Cannot deconstruct to a parameter named '", name.impl(), "'"); } } - context.addVar(&name, kind == DeconstructToParameters ? 0 : DeclarationStacks::HasInitializer); + if (kind != DeconstructToExpressions) + context.addVar(&name, kind == DeconstructToParameters ? 0 : DeclarationStacks::HasInitializer); } else { if (kind == DeconstructToVariables) { failIfFalseIfStrict(declareVariable(&name), "Cannot declare a variable named '", name.impl(), "' in strict mode"); @@ -424,7 +522,13 @@ template TreeDeconstructionPattern } template -template TreeDeconstructionPattern Parser::parseDeconstructionPattern(TreeBuilder& context, int depth) +template TreeDeconstructionPattern Parser::tryParseDeconstructionPatternExpression(TreeBuilder& context) +{ + return parseDeconstructionPattern(context, DeconstructToExpressions); +} + +template +template TreeDeconstructionPattern Parser::parseDeconstructionPattern(TreeBuilder& context, DeconstructionKind kind, int depth) { failIfStackOverflow(); int nonLHSCount = m_nonLHSCount; @@ -433,6 +537,8 @@ template TreeDeconstructionPattern case OPENBRACKET: { auto arrayPattern = context.createArrayPattern(m_token.m_location); next(); + if (kind == DeconstructToExpressions && match(CLOSEBRACKET)) + return 0; failIfTrue(match(CLOSEBRACKET), "There must be at least one bound property in an array deconstruction pattern"); do { while (match(COMMA)) { @@ -441,16 +547,26 @@ template TreeDeconstructionPattern } propagateError(); JSTokenLocation location = m_token.m_location; - auto innerPattern = parseDeconstructionPattern(context, depth + 1); + auto innerPattern = parseDeconstructionPattern(context, kind, depth + 1); + if (kind == DeconstructToExpressions && !innerPattern) + return 0; failIfFalse(innerPattern, "Cannot parse this deconstruction pattern"); context.appendArrayPatternEntry(arrayPattern, location, innerPattern); } while (consume(COMMA)); + + if (kind == DeconstructToExpressions && !match(CLOSEBRACKET)) + return 0; + consumeOrFail(CLOSEBRACKET, "Expected either a closing ']' or a ',' following an element deconstruction pattern"); pattern = arrayPattern; break; } case OPENBRACE: { next(); + + if (kind == DeconstructToExpressions && match(CLOSEBRACE)) + return 0; + failIfTrue(match(CLOSEBRACE), "There must be at least one bound property in an object deconstruction pattern"); auto objectPattern = context.createObjectPattern(m_token.m_location); bool wasString = false; @@ -462,9 +578,9 @@ template TreeDeconstructionPattern propertyName = *m_token.m_data.ident; next(); if (consume(COLON)) - innerPattern = parseDeconstructionPattern(context, depth + 1); + innerPattern = parseDeconstructionPattern(context, kind, depth + 1); else - innerPattern = createBindingPattern(context, propertyName, depth); + innerPattern = createBindingPattern(context, kind, propertyName, depth); } else { JSTokenType tokenType = m_token.m_type; switch (m_token.m_type) { @@ -476,24 +592,33 @@ template TreeDeconstructionPattern wasString = true; break; default: - if (m_token.m_type != RESERVED && m_token.m_type != RESERVED_IF_STRICT && !(m_token.m_type & KeywordTokenFlag)) + if (m_token.m_type != RESERVED && m_token.m_type != RESERVED_IF_STRICT && !(m_token.m_type & KeywordTokenFlag)) { + if (kind == DeconstructToExpressions) + return 0; failWithMessage("Expected a property name"); + } propertyName = *m_token.m_data.ident; break; } next(); if (!consume(COLON)) { + if (kind == DeconstructToExpressions) + return 0; semanticFailIfTrue(tokenType == RESERVED, "Cannot use abbreviated deconstruction syntax for reserved name '", propertyName.impl(), "'"); semanticFailIfTrue(tokenType == RESERVED_IF_STRICT, "Cannot use abbreviated deconstruction syntax for reserved name '", propertyName.impl(), "' in strict mode"); semanticFailIfTrue(tokenType & KeywordTokenFlag, "Cannot use abbreviated deconstruction syntax for keyword '", propertyName.impl(), "'"); failWithMessage("Expected a ':' prior to named property deconstruction"); } - innerPattern = parseDeconstructionPattern(context, depth + 1); + innerPattern = parseDeconstructionPattern(context, kind, depth + 1); } + if (kind == DeconstructToExpressions && !innerPattern) + return 0; failIfFalse(innerPattern, "Cannot parse this deconstruction pattern"); context.appendObjectPatternEntry(objectPattern, location, wasString, propertyName, innerPattern); } while (consume(COMMA)); + if (kind == DeconstructToExpressions && !match(CLOSEBRACE)) + return 0; consumeOrFail(CLOSEBRACE, "Expected either a closing '}' or an ',' after a property deconstruction pattern"); pattern = objectPattern; break; @@ -501,10 +626,12 @@ template TreeDeconstructionPattern default: { if (!match(IDENT)) { + if (kind == DeconstructToExpressions) + return 0; semanticFailureDueToKeyword("variable name"); failWithMessage("Expected a parameter pattern or a ')' in parameter list"); } - pattern = createBindingPattern(context, *m_token.m_data.ident, depth); + pattern = createBindingPattern(context, kind, *m_token.m_data.ident, depth); next(); break; } @@ -533,6 +660,7 @@ template TreeConstDeclList Parser::parseConstDecl if (hasInitializer) { next(TreeBuilder::DontBuildStrings); // consume '=' initializer = parseAssignmentExpression(context); + failIfFalse(!!initializer, "Unable to parse initializer"); } tail = context.appendConstDecl(location, tail, name, initializer); if (!constDecls) @@ -554,6 +682,7 @@ template TreeStatement Parser::parseForStatement( JSTextPosition declsStart; JSTextPosition declsEnd; TreeExpression decls = 0; + TreeDeconstructionPattern pattern = 0; if (match(VAR)) { /* for (var IDENT in expression) statement @@ -603,6 +732,16 @@ template TreeStatement Parser::parseForStatement( } if (!match(SEMICOLON)) { + if (match(OPENBRACE) || match(OPENBRACKET)) { + SavePoint savePoint = createSavePoint(); + declsStart = tokenStartPosition(); + pattern = tryParseDeconstructionPatternExpression(context); + declsEnd = lastTokenEndPosition(); + if (pattern && (match(INTOKEN) || (match(IDENT) && *m_token.m_data.ident == m_vm->propertyNames->of))) + goto enumerationLoop; + pattern = 0; + restoreSavePoint(savePoint); + } m_allowsIn = false; declsStart = tokenStartPosition(); decls = parseExpression(context); @@ -639,6 +778,7 @@ template TreeStatement Parser::parseForStatement( } // For-in loop +enumerationLoop: failIfFalse(nonLHSCount == m_nonLHSCount, "Expected a reference on the left hand side of an enumeration statement"); bool isOfEnumeration = false; if (!consume(INTOKEN)) { @@ -657,6 +797,12 @@ template TreeStatement Parser::parseForStatement( TreeStatement statement = parseStatement(context, unused); endLoop(); failIfFalse(statement, "Expected a statement as the body of a for-", isOfEnumeration ? "of" : "in", "loop"); + if (pattern) { + ASSERT(!decls); + if (isOfEnumeration) + return context.createForOfLoop(location, pattern, expr, statement, declsStart, declsEnd, exprEnd, startLine, endLine); + return context.createForInLoop(location, pattern, expr, statement, declsStart, declsEnd, exprEnd, startLine, endLine); + } if (isOfEnumeration) return context.createForOfLoop(location, decls, expr, statement, declsStart, declsEnd, exprEnd, startLine, endLine); return context.createForInLoop(location, decls, expr, statement, declsStart, declsEnd, exprEnd, startLine, endLine); @@ -816,7 +962,7 @@ template TreeClauseList Parser::parseSwitchClause TreeExpression condition = parseExpression(context); failIfFalse(condition, "Cannot parse switch clause"); consumeOrFail(COLON, "Expected a ':' after switch clause expression"); - TreeSourceElements statements = parseSourceElements(context); + TreeSourceElements statements = parseSourceElements(context, DontCheckForStrictMode); failIfFalse(statements, "Cannot parse the body of a switch clause"); TreeClause clause = context.createClause(condition, statements); TreeClauseList clauseList = context.createClauseList(clause); @@ -827,7 +973,7 @@ template TreeClauseList Parser::parseSwitchClause TreeExpression condition = parseExpression(context); failIfFalse(condition, "Cannot parse switch case expression"); consumeOrFail(COLON, "Expected a ':' after switch clause expression"); - TreeSourceElements statements = parseSourceElements(context); + TreeSourceElements statements = parseSourceElements(context, DontCheckForStrictMode); failIfFalse(statements, "Cannot parse the body of a switch clause"); clause = context.createClause(condition, statements); tail = context.createClauseList(tail, clause); @@ -842,7 +988,7 @@ template TreeClause Parser::parseSwitchDefaultCla return 0; next(); consumeOrFail(COLON, "Expected a ':' after switch default clause"); - TreeSourceElements statements = parseSourceElements(context); + TreeSourceElements statements = parseSourceElements(context, DontCheckForStrictMode); failIfFalse(statements, "Cannot parse the body of a switch default clause"); return context.createClause(0, statements); } @@ -920,7 +1066,7 @@ template TreeStatement Parser::parseBlockStatemen next(); return context.createBlockStatement(location, 0, start, m_lastTokenEndPosition.line); } - TreeSourceElements subtree = parseSourceElements(context); + TreeSourceElements subtree = parseSourceElements(context, DontCheckForStrictMode); failIfFalse(subtree, "Cannot parse the body of the block statement"); matchOrFail(CLOSEBRACE, "Expected a closing '}' at the end of a block statement"); next(); @@ -998,12 +1144,12 @@ template TreeStatement Parser::parseStatement(Tre template template TreeFormalParameterList Parser::parseFormalParameters(TreeBuilder& context) { - auto parameter = parseDeconstructionPattern(context); + auto parameter = parseDeconstructionPattern(context, DeconstructToParameters); failIfFalse(parameter, "Cannot parse parameter pattern"); TreeFormalParameterList list = context.createFormalParameterList(parameter); TreeFormalParameterList tail = list; while (consume(COMMA)) { - parameter = parseDeconstructionPattern(context); + parameter = parseDeconstructionPattern(context, DeconstructToParameters); failIfFalse(parameter, "Cannot parse parameter pattern"); tail = context.createFormalParameterList(tail, parameter); } @@ -1017,13 +1163,16 @@ template TreeFunctionBody Parser::parseFunctionBo unsigned startColumn = tokenColumn(); next(); - if (match(CLOSEBRACE)) - return context.createFunctionBody(startLocation, tokenLocation(), startColumn, strictMode()); + if (match(CLOSEBRACE)) { + unsigned endColumn = tokenColumn(); + return context.createFunctionBody(startLocation, tokenLocation(), startColumn, endColumn, strictMode()); + } DepthManager statementDepth(&m_statementDepth); m_statementDepth = 0; typename TreeBuilder::FunctionBodyBuilder bodyBuilder(const_cast(m_vm), m_lexer.get()); - failIfFalse(parseSourceElements(bodyBuilder), "Cannot parse body of this function"); - return context.createFunctionBody(startLocation, tokenLocation(), startColumn, strictMode()); + failIfFalse(parseSourceElements(bodyBuilder, CheckForStrictMode), "Cannot parse body of this function"); + unsigned endColumn = tokenColumn(); + return context.createFunctionBody(startLocation, tokenLocation(), startColumn, endColumn, strictMode()); } static const char* stringForFunctionMode(FunctionParseMode mode) @@ -1041,11 +1190,11 @@ static const char* stringForFunctionMode(FunctionParseMode mode) } template -template bool Parser::parseFunctionInfo(TreeBuilder& context, const Identifier*& name, TreeFormalParameterList& parameters, TreeFunctionBody& body, unsigned& openBraceOffset, unsigned& closeBraceOffset, int& bodyStartLine, unsigned& bodyStartColumn) +template bool Parser::parseFunctionInfo(TreeBuilder& context, FunctionRequirements requirements, FunctionParseMode mode, bool nameIsInContainingScope, const Identifier*& name, TreeFormalParameterList& parameters, TreeFunctionBody& body, unsigned& openBraceOffset, unsigned& closeBraceOffset, int& bodyStartLine, unsigned& bodyStartColumn) { AutoPopScopeRef functionScope(this, pushScope()); functionScope->setIsFunction(); - int functionStart = m_token.m_location.startOffset; + int functionNameStart = m_token.m_location.startOffset; const Identifier* lastFunctionName = m_lastFunctionName; m_lastFunctionName = nullptr; if (match(IDENT)) { @@ -1086,16 +1235,21 @@ template closeBraceLine; endLocation.startOffset = cachedInfo->closeBraceOffset; endLocation.lineStartOffset = cachedInfo->closeBraceLineStartOffset; + + bool endColumnIsOnStartLine = (endLocation.line == bodyStartLine); ASSERT(endLocation.startOffset >= endLocation.lineStartOffset); + unsigned bodyEndColumn = endColumnIsOnStartLine ? + endLocation.startOffset - m_token.m_data.lineStartOffset : + endLocation.startOffset - endLocation.lineStartOffset; - body = context.createFunctionBody(startLocation, endLocation, bodyStartColumn, cachedInfo->strictMode); + body = context.createFunctionBody(startLocation, endLocation, bodyStartColumn, bodyEndColumn, cachedInfo->strictMode); functionScope->restoreFromSourceProviderCache(cachedInfo); failIfFalse(popScope(functionScope, TreeBuilder::NeedsFreeVariableInfo), "Parser error"); closeBraceOffset = cachedInfo->closeBraceOffset; - context.setFunctionStart(body, functionStart); + context.setFunctionNameStart(body, functionNameStart); m_token = cachedInfo->closeBraceToken(); m_lexer->setOffset(m_token.m_location.endOffset, m_token.m_location.lineStartOffset); @@ -1105,7 +1259,9 @@ template strictMode() && name) { RELEASE_ASSERT(mode == FunctionMode); @@ -1123,7 +1279,7 @@ template minimumFunctionLengthToCache) { SourceProviderCacheItemCreationParameters parameters; - parameters.functionStart = functionStart; + parameters.functionNameStart = functionNameStart; parameters.closeBraceLine = closeBraceLine; parameters.closeBraceOffset = closeBraceOffset; parameters.closeBraceLineStartOffset = closeBraceLineStartOffset; @@ -1131,7 +1287,7 @@ template TreeStatement Parser::parseFunctionDecla unsigned closeBraceOffset = 0; int bodyStartLine = 0; unsigned bodyStartColumn = 0; - failIfFalse((parseFunctionInfo(context, name, parameters, body, openBraceOffset, closeBraceOffset, bodyStartLine, bodyStartColumn)), "Cannot parse this function"); + failIfFalse((parseFunctionInfo(context, FunctionNeedsName, FunctionMode, true, name, parameters, body, openBraceOffset, closeBraceOffset, bodyStartLine, bodyStartColumn)), "Cannot parse this function"); failIfFalse(name, "Function statements must have a name"); failIfFalseIfStrict(declareVariable(name), "Cannot declare a function named '", name->impl(), "' in strict mode"); return context.createFuncDeclStatement(location, name, body, parameters, openBraceOffset, closeBraceOffset, bodyStartLine, m_lastTokenEndPosition.line, bodyStartColumn); @@ -1272,7 +1428,7 @@ template TreeStatement Parser::parseIfStatement(T return context.createIfStatement(ifLocation, condition, trueBlock, 0, start, end); Vector exprStack; - Vector> posStack; + Vector> posStack; Vector tokenLocationStack; Vector statementStack; bool trailingElse = false; @@ -1301,7 +1457,7 @@ template TreeStatement Parser::parseIfStatement(T failIfFalse(innerTrueBlock, "Expected a statement as the body of an if block"); tokenLocationStack.append(tempLocation); exprStack.append(innerCondition); - posStack.append(make_pair(innerStart, innerEnd)); + posStack.append(std::make_pair(innerStart, innerEnd)); statementStack.append(innerTrueBlock); } while (match(ELSE)); @@ -1310,7 +1466,7 @@ template TreeStatement Parser::parseIfStatement(T exprStack.removeLast(); TreeStatement trueBlock = statementStack.last(); statementStack.removeLast(); - pair pos = posStack.last(); + std::pair pos = posStack.last(); posStack.removeLast(); JSTokenLocation elseLocation = tokenLocationStack.last(); tokenLocationStack.removeLast(); @@ -1324,7 +1480,7 @@ template TreeStatement Parser::parseIfStatement(T statementStack.removeLast(); TreeStatement trueBlock = statementStack.last(); statementStack.removeLast(); - pair pos = posStack.last(); + std::pair pos = posStack.last(); posStack.removeLast(); JSTokenLocation elseLocation = tokenLocationStack.last(); tokenLocationStack.removeLast(); @@ -1366,11 +1522,21 @@ template TreeExpression Parser::parseAssignmen JSTokenLocation location(tokenLocation()); int initialAssignmentCount = m_assignmentCount; int initialNonLHSCount = m_nonLHSCount; + if (match(OPENBRACE) || match(OPENBRACKET)) { + SavePoint savePoint = createSavePoint(); + auto pattern = tryParseDeconstructionPatternExpression(context); + if (pattern && consume(EQUAL)) { + auto rhs = parseAssignmentExpression(context); + if (rhs) + return context.createDeconstructingAssignment(location, pattern, rhs); + } + restoreSavePoint(savePoint); + } TreeExpression lhs = parseConditionalExpression(context); failIfFalse(lhs, "Cannot parse expression"); if (initialNonLHSCount != m_nonLHSCount) { if (m_token.m_type >= EQUAL && m_token.m_type <= OREQUAL) - semanticFail("Left hand sign of operator '", getToken(), "' must be a reference"); + semanticFail("Left hand side of operator '", getToken(), "' must be a reference"); return lhs; } @@ -1411,7 +1577,7 @@ template TreeExpression Parser::parseAssignmen failIfFalse(lhs, "Cannot parse the right hand side of an assignment expression"); if (initialNonLHSCount != m_nonLHSCount) { if (m_token.m_type >= EQUAL && m_token.m_type <= OREQUAL) - semanticFail("Left hand sign of operator '", getToken(), "' must be a reference"); + semanticFail("Left hand side of operator '", getToken(), "' must be a reference"); break; } } @@ -1508,7 +1674,7 @@ template TreeExpression Parser::parseBinaryExpres } template -template TreeProperty Parser::parseProperty(TreeBuilder& context) +template TreeProperty Parser::parseProperty(TreeBuilder& context, bool complete) { bool wasIdent = false; switch (m_token.m_type) { @@ -1526,7 +1692,7 @@ template TreeProperty Parser::pars next(); TreeExpression node = parseAssignmentExpression(context); failIfFalse(node, "Cannot parse expression for property declaration"); - return context.template createProperty(ident, node, PropertyNode::Constant); + return context.createProperty(ident, node, PropertyNode::Constant, complete); } failIfFalse(wasIdent, "Expected an identifier as property name"); const Identifier* accessorName = 0; @@ -1555,14 +1721,14 @@ template TreeProperty Parser::pars next(); if (type == PropertyNode::Getter) { failIfFalse(match(OPENPAREN), "Expected a parameter list for getter definition"); - failIfFalse((parseFunctionInfo(context, accessorName, parameters, body, openBraceOffset, closeBraceOffset, bodyStartLine, bodyStartColumn)), "Cannot parse getter definition"); + failIfFalse((parseFunctionInfo(context, FunctionNoRequirements, GetterMode, false, accessorName, parameters, body, openBraceOffset, closeBraceOffset, bodyStartLine, bodyStartColumn)), "Cannot parse getter definition"); } else { failIfFalse(match(OPENPAREN), "Expected a parameter list for setter definition"); - failIfFalse((parseFunctionInfo(context, accessorName, parameters, body, openBraceOffset, closeBraceOffset, bodyStartLine, bodyStartColumn)), "Cannot parse setter definition"); + failIfFalse((parseFunctionInfo(context, FunctionNoRequirements, SetterMode, false, accessorName, parameters, body, openBraceOffset, closeBraceOffset, bodyStartLine, bodyStartColumn)), "Cannot parse setter definition"); } if (stringPropertyName) - return context.template createGetterOrSetterProperty(location, type, stringPropertyName, parameters, body, openBraceOffset, closeBraceOffset, bodyStartLine, m_lastTokenEndPosition.line, bodyStartColumn); - return context.template createGetterOrSetterProperty(const_cast(m_vm), location, type, numericPropertyName, parameters, body, openBraceOffset, closeBraceOffset, bodyStartLine, m_lastTokenEndPosition.line, bodyStartColumn); + return context.createGetterOrSetterProperty(location, type, complete, stringPropertyName, parameters, body, openBraceOffset, closeBraceOffset, bodyStartLine, m_lastTokenEndPosition.line, bodyStartColumn); + return context.createGetterOrSetterProperty(const_cast(m_vm), location, type, complete, numericPropertyName, parameters, body, openBraceOffset, closeBraceOffset, bodyStartLine, m_lastTokenEndPosition.line, bodyStartColumn); } case NUMBER: { double propertyName = m_token.m_data.doubleValue; @@ -1570,7 +1736,7 @@ template TreeProperty Parser::pars consumeOrFail(COLON, "Expected ':' after property name"); TreeExpression node = parseAssignmentExpression(context); failIfFalse(node, "Cannot parse expression for property declaration"); - return context.template createProperty(const_cast(m_vm), propertyName, node, PropertyNode::Constant); + return context.createProperty(const_cast(m_vm), propertyName, node, PropertyNode::Constant, complete); } case OPENBRACKET: { next(); @@ -1581,7 +1747,7 @@ template TreeProperty Parser::pars consumeOrFail(COLON, "Expected ':' after property name"); TreeExpression node = parseAssignmentExpression(context); failIfFalse(node, "Cannot parse expression for property declaration"); - return context.template createProperty(const_cast(m_vm), propertyName, node, PropertyNode::Constant); + return context.createProperty(const_cast(m_vm), propertyName, node, PropertyNode::Constant, complete); } default: failIfFalse(m_token.m_type & KeywordTokenFlag, "Expected a property name"); @@ -1603,7 +1769,7 @@ template TreeExpression Parser::parseObjectLitera return context.createObjectLiteral(location); } - TreeProperty property = parseProperty(context); + TreeProperty property = parseProperty(context, false); failIfFalse(property, "Cannot parse object literal property"); if (!m_syntaxAlreadyValidated && context.getType(property) != PropertyNode::Constant) { restoreSavePoint(savePoint); @@ -1617,7 +1783,7 @@ template TreeExpression Parser::parseObjectLitera if (match(CLOSEBRACE)) break; JSTokenLocation propertyLocation(tokenLocation()); - property = parseProperty(context); + property = parseProperty(context, false); failIfFalse(property, "Cannot parse object literal property"); if (!m_syntaxAlreadyValidated && context.getType(property) != PropertyNode::Constant) { restoreSavePoint(savePoint); @@ -1647,7 +1813,7 @@ template TreeExpression Parser::parseStrictObject return context.createObjectLiteral(location); } - TreeProperty property = parseProperty(context); + TreeProperty property = parseProperty(context, true); failIfFalse(property, "Cannot parse object literal property"); typedef HashMap, unsigned, IdentifierRepHash> ObjectValidationMap; @@ -1664,7 +1830,7 @@ template TreeExpression Parser::parseStrictObject if (match(CLOSEBRACE)) break; JSTokenLocation propertyLocation(tokenLocation()); - property = parseProperty(context); + property = parseProperty(context, true); failIfFalse(property, "Cannot parse object literal property"); if (!m_syntaxAlreadyValidated && context.getName(property)) { ObjectValidationMap::AddResult propertyEntry = objectValidator.add(context.getName(property)->impl(), context.getType(property)); @@ -1911,7 +2077,7 @@ template TreeExpression Parser::parseMemberExpres unsigned bodyStartColumn = 0; location = tokenLocation(); next(); - failIfFalse((parseFunctionInfo(context, name, parameters, body, openBraceOffset, closeBraceOffset, bodyStartLine, bodyStartColumn)), "Cannot parse function expression"); + failIfFalse((parseFunctionInfo(context, FunctionNoRequirements, FunctionMode, false, name, parameters, body, openBraceOffset, closeBraceOffset, bodyStartLine, bodyStartColumn)), "Cannot parse function expression"); base = context.createFunctionExpr(location, name, body, parameters, openBraceOffset, closeBraceOffset, bodyStartLine, m_lastTokenEndPosition.line, bodyStartColumn); } else base = parsePrimaryExpression(context); diff --git a/JavaScriptCore/parser/Parser.h b/JavaScriptCore/parser/Parser.h index e431dcf1..b698ef93 100644 --- a/JavaScriptCore/parser/Parser.h +++ b/JavaScriptCore/parser/Parser.h @@ -35,7 +35,6 @@ #include "SourceProvider.h" #include "SourceProviderCache.h" #include "SourceProviderCacheItem.h" -#include "VMStackBounds.h" #include #include #include @@ -414,6 +413,8 @@ class Parser { template PassRefPtr parse(ParserError&); + JSTextPosition positionBeforeLastNewline() const { return m_lexer->positionBeforeLastNewline(); } + private: struct AllowInOverride { AllowInOverride(Parser* parser) @@ -634,6 +635,15 @@ class Parser { m_errorMessage = msg; } + NEVER_INLINE void logError(bool); + template NEVER_INLINE void logError(bool, const A&); + template NEVER_INLINE void logError(bool, const A&, const B&); + template NEVER_INLINE void logError(bool, const A&, const B&, const C&); + template NEVER_INLINE void logError(bool, const A&, const B&, const C&, const D&); + template NEVER_INLINE void logError(bool, const A&, const B&, const C&, const D&, const E&); + template NEVER_INLINE void logError(bool, const A&, const B&, const C&, const D&, const E&, const F&); + template NEVER_INLINE void logError(bool, const A&, const B&, const C&, const D&, const E&, const F&, const G&); + NEVER_INLINE void updateErrorWithNameAndMessage(const char* beforeMsg, String name, const char* afterMsg) { m_errorMessage = makeString(beforeMsg, " '", name, "' ", afterMsg); @@ -689,7 +699,7 @@ class Parser { return result; } - template TreeSourceElements parseSourceElements(TreeBuilder&); + template TreeSourceElements parseSourceElements(TreeBuilder&, SourceElementsMode); template TreeStatement parseStatement(TreeBuilder&, const Identifier*& directive, unsigned* directiveLiteralLength = 0); template TreeStatement parseFunctionDeclaration(TreeBuilder&); template TreeStatement parseVarDeclaration(TreeBuilder&); @@ -710,7 +720,7 @@ class Parser { template TreeStatement parseExpressionStatement(TreeBuilder&); template TreeStatement parseExpressionOrLabelStatement(TreeBuilder&); template TreeStatement parseIfStatement(TreeBuilder&); - template ALWAYS_INLINE TreeStatement parseBlockStatement(TreeBuilder&); + template TreeStatement parseBlockStatement(TreeBuilder&); template TreeExpression parseExpression(TreeBuilder&); template TreeExpression parseAssignmentExpression(TreeBuilder&); template ALWAYS_INLINE TreeExpression parseConditionalExpression(TreeBuilder&); @@ -720,18 +730,19 @@ class Parser { template ALWAYS_INLINE TreeExpression parsePrimaryExpression(TreeBuilder&); template ALWAYS_INLINE TreeExpression parseArrayLiteral(TreeBuilder&); template ALWAYS_INLINE TreeExpression parseObjectLiteral(TreeBuilder&); - template ALWAYS_INLINE TreeExpression parseStrictObjectLiteral(TreeBuilder&); + template NEVER_INLINE TreeExpression parseStrictObjectLiteral(TreeBuilder&); enum SpreadMode { AllowSpread, DontAllowSpread }; template ALWAYS_INLINE TreeArguments parseArguments(TreeBuilder&, SpreadMode); - template ALWAYS_INLINE TreeProperty parseProperty(TreeBuilder&); + template TreeProperty parseProperty(TreeBuilder&, bool strict); template ALWAYS_INLINE TreeFunctionBody parseFunctionBody(TreeBuilder&); template ALWAYS_INLINE TreeFormalParameterList parseFormalParameters(TreeBuilder&); - template ALWAYS_INLINE TreeExpression parseVarDeclarationList(TreeBuilder&, int& declarations, TreeDeconstructionPattern& lastPattern, TreeExpression& lastInitializer, JSTextPosition& identStart, JSTextPosition& initStart, JSTextPosition& initEnd); - template ALWAYS_INLINE TreeConstDeclList parseConstDeclarationList(TreeBuilder&); + template TreeExpression parseVarDeclarationList(TreeBuilder&, int& declarations, TreeDeconstructionPattern& lastPattern, TreeExpression& lastInitializer, JSTextPosition& identStart, JSTextPosition& initStart, JSTextPosition& initEnd); + template NEVER_INLINE TreeConstDeclList parseConstDeclarationList(TreeBuilder&); - template ALWAYS_INLINE TreeDeconstructionPattern createBindingPattern(TreeBuilder&, const Identifier&, int depth); - template TreeDeconstructionPattern parseDeconstructionPattern(TreeBuilder&, int depth = 0); - template bool parseFunctionInfo(TreeBuilder&, const Identifier*&, TreeFormalParameterList&, TreeFunctionBody&, unsigned& openBraceOffset, unsigned& closeBraceOffset, int& bodyStartLine, unsigned& bodyStartColumn); + template NEVER_INLINE TreeDeconstructionPattern createBindingPattern(TreeBuilder&, DeconstructionKind, const Identifier&, int depth); + template NEVER_INLINE TreeDeconstructionPattern parseDeconstructionPattern(TreeBuilder&, DeconstructionKind, int depth = 0); + template NEVER_INLINE TreeDeconstructionPattern tryParseDeconstructionPatternExpression(TreeBuilder&); + template NEVER_INLINE bool parseFunctionInfo(TreeBuilder&, FunctionRequirements, FunctionParseMode, bool nameIsInContainingScope, const Identifier*&, TreeFormalParameterList&, TreeFunctionBody&, unsigned& openBraceOffset, unsigned& closeBraceOffset, int& bodyStartLine, unsigned& bodyStartColumn); ALWAYS_INLINE int isBinaryOperator(JSTokenType); bool allowAutomaticSemicolon(); @@ -746,7 +757,7 @@ class Parser { bool canRecurse() { - return m_stack.isSafeToRecurse(); + return m_vm->isSafeToRecurse(); } const JSTextPosition& lastTokenEndPosition() const @@ -759,7 +770,6 @@ class Parser { return !m_errorMessage.isNull(); } - struct SavePoint { int startOffset; unsigned oldLineStartOffset; @@ -769,6 +779,7 @@ class Parser { ALWAYS_INLINE SavePoint createSavePoint() { + ASSERT(!hasError()); SavePoint result; result.startOffset = m_token.m_location.startOffset; result.oldLineStartOffset = m_token.m_location.lineStartOffset; @@ -779,18 +790,42 @@ class Parser { ALWAYS_INLINE void restoreSavePoint(const SavePoint& savePoint) { + m_errorMessage = String(); m_lexer->setOffset(savePoint.startOffset, savePoint.oldLineStartOffset); next(); m_lexer->setLastLineNumber(savePoint.oldLastLineNumber); m_lexer->setLineNumber(savePoint.oldLineNumber); } + + struct ParserState { + int assignmentCount; + int nonLHSCount; + int nonTrivialExpressionCount; + }; + + ALWAYS_INLINE ParserState saveState() + { + ParserState result; + result.assignmentCount = m_assignmentCount; + result.nonLHSCount = m_nonLHSCount; + result.nonTrivialExpressionCount = m_nonTrivialExpressionCount; + return result; + } + ALWAYS_INLINE void restoreState(const ParserState& state) + { + m_assignmentCount = state.assignmentCount; + m_nonLHSCount = state.nonLHSCount; + m_nonTrivialExpressionCount = state.nonTrivialExpressionCount; + + } + + VM* m_vm; const SourceCode* m_source; ParserArena* m_arena; OwnPtr m_lexer; - VMStackBounds m_stack; bool m_hasStackOverflow; String m_errorMessage; JSToken m_token; @@ -846,7 +881,8 @@ PassRefPtr Parser::parse(ParserError& error) errMsg = String(); JSTokenLocation startLocation(tokenLocation()); - unsigned startColumn = m_source->startColumn(); + ASSERT(m_source->startColumn() > 0); + unsigned startColumn = m_source->startColumn() - 1; String parseError = parseInner(); @@ -865,13 +901,15 @@ PassRefPtr Parser::parse(ParserError& error) RefPtr result; if (m_sourceElements) { JSTokenLocation endLocation; - endLocation.line = m_lexer->lastLineNumber(); + endLocation.line = m_lexer->lineNumber(); endLocation.lineStartOffset = m_lexer->currentLineStartOffset(); endLocation.startOffset = m_lexer->currentOffset(); + unsigned endColumn = endLocation.startOffset - endLocation.lineStartOffset; result = ParsedNode::create(m_vm, startLocation, endLocation, startColumn, + endColumn, m_sourceElements, m_varDeclarations ? &m_varDeclarations->data : 0, m_funcDeclarations ? &m_funcDeclarations->data : 0, @@ -879,7 +917,7 @@ PassRefPtr Parser::parse(ParserError& error) *m_source, m_features, m_numConstants); - result->setLoc(m_source->firstLine(), m_lastTokenEndPosition.line, m_lexer->currentOffset(), m_lexer->currentLineStartOffset()); + result->setLoc(m_source->firstLine(), m_lexer->lineNumber(), m_lexer->currentOffset(), m_lexer->currentLineStartOffset()); } else { // We can never see a syntax error when reparsing a function, since we should have // reported the error when parsing the containing program or eval code. So if we're @@ -909,17 +947,23 @@ PassRefPtr Parser::parse(ParserError& error) } template -PassRefPtr parse(VM* vm, const SourceCode& source, FunctionParameters* parameters, const Identifier& name, JSParserStrictness strictness, JSParserMode parserMode, ParserError& error) +PassRefPtr parse(VM* vm, const SourceCode& source, FunctionParameters* parameters, const Identifier& name, JSParserStrictness strictness, JSParserMode parserMode, ParserError& error, JSTextPosition* positionBeforeLastNewline = 0) { SamplingRegion samplingRegion("Parsing"); ASSERT(!source.provider()->source().isNull()); if (source.provider()->source().is8Bit()) { Parser> parser(vm, source, parameters, name, strictness, parserMode); - return parser.parse(error); + RefPtr result = parser.parse(error); + if (positionBeforeLastNewline) + *positionBeforeLastNewline = parser.positionBeforeLastNewline(); + return result.release(); } Parser> parser(vm, source, parameters, name, strictness, parserMode); - return parser.parse(error); + RefPtr result = parser.parse(error); + if (positionBeforeLastNewline) + *positionBeforeLastNewline = parser.positionBeforeLastNewline(); + return result.release(); } } // namespace diff --git a/JavaScriptCore/parser/ParserArena.h b/JavaScriptCore/parser/ParserArena.h index 4f1352d3..e806d45e 100644 --- a/JavaScriptCore/parser/ParserArena.h +++ b/JavaScriptCore/parser/ParserArena.h @@ -27,6 +27,7 @@ #define ParserArena_h #include "Identifier.h" +#include #include namespace JSC { @@ -64,8 +65,8 @@ namespace JSC { private: IdentifierVector m_identifiers; - FixedArray m_shortIdentifiers; - FixedArray m_recentIdentifiers; + std::array m_shortIdentifiers; + std::array m_recentIdentifiers; }; template diff --git a/JavaScriptCore/parser/SourceProviderCacheItem.h b/JavaScriptCore/parser/SourceProviderCacheItem.h index 0e95db67..39621186 100644 --- a/JavaScriptCore/parser/SourceProviderCacheItem.h +++ b/JavaScriptCore/parser/SourceProviderCacheItem.h @@ -34,7 +34,7 @@ namespace JSC { struct SourceProviderCacheItemCreationParameters { - unsigned functionStart; + unsigned functionNameStart; unsigned closeBraceLine; unsigned closeBraceOffset; unsigned closeBraceLineStartOffset; @@ -70,7 +70,7 @@ class SourceProviderCacheItem { return token; } - unsigned functionStart : 31; + unsigned functionNameStart : 31; bool needsFullActivation : 1; unsigned closeBraceLine : 31; @@ -107,7 +107,7 @@ inline std::unique_ptr SourceProviderCacheItem::create( } inline SourceProviderCacheItem::SourceProviderCacheItem(const SourceProviderCacheItemCreationParameters& parameters) - : functionStart(parameters.functionStart) + : functionNameStart(parameters.functionNameStart) , needsFullActivation(parameters.needsFullActivation) , closeBraceLine(parameters.closeBraceLine) , usesEval(parameters.usesEval) diff --git a/JavaScriptCore/parser/SyntaxChecker.h b/JavaScriptCore/parser/SyntaxChecker.h index 2dab1e2d..71e871a8 100644 --- a/JavaScriptCore/parser/SyntaxChecker.h +++ b/JavaScriptCore/parser/SyntaxChecker.h @@ -153,27 +153,27 @@ class SyntaxChecker { ExpressionType createConditionalExpr(const JSTokenLocation&, ExpressionType, ExpressionType, ExpressionType) { return ConditionalExpr; } ExpressionType createAssignResolve(const JSTokenLocation&, const Identifier&, ExpressionType, int, int, int) { return AssignmentExpr; } ExpressionType createFunctionExpr(const JSTokenLocation&, const Identifier*, int, int, int, int, int, int, int) { return FunctionExpr; } - int createFunctionBody(const JSTokenLocation&, const JSTokenLocation&, int, bool) { return 1; } - void setFunctionStart(int, int) { } + int createFunctionBody(const JSTokenLocation&, const JSTokenLocation&, int, int, bool) { return 1; } + void setFunctionNameStart(int, int) { } int createArguments() { return 1; } int createArguments(int) { return 1; } ExpressionType createSpreadExpression(const JSTokenLocation&, ExpressionType, int, int, int) { return 1; } int createArgumentsList(const JSTokenLocation&, int) { return 1; } int createArgumentsList(const JSTokenLocation&, int, int) { return 1; } - template Property createProperty(const Identifier* name, int, PropertyNode::Type type) + Property createProperty(const Identifier* name, int, PropertyNode::Type type, bool complete) { if (!complete) return Property(type); ASSERT(name); return Property(name, type); } - template Property createProperty(VM* vm, double name, int, PropertyNode::Type type) + Property createProperty(VM* vm, double name, int, PropertyNode::Type type, bool complete) { if (!complete) return Property(type); return Property(&vm->parserArena->identifierArena().makeNumericIdentifier(vm, name), type); } - template Property createProperty(VM*, ExpressionNode*, int, PropertyNode::Type type) + Property createProperty(VM*, ExpressionNode*, int, PropertyNode::Type type, bool) { return Property(type); } @@ -212,14 +212,14 @@ class SyntaxChecker { int createDebugger(const JSTokenLocation&, int, int) { return 1; } int createConstStatement(const JSTokenLocation&, int, int, int) { return 1; } int appendConstDecl(const JSTokenLocation&, int, const Identifier*, int) { return 1; } - template Property createGetterOrSetterProperty(const JSTokenLocation&, PropertyNode::Type type, const Identifier* name, int, int, int, int, int, int, int) + Property createGetterOrSetterProperty(const JSTokenLocation&, PropertyNode::Type type, bool strict, const Identifier* name, int, int, int, int, int, int, int) { ASSERT(name); if (!strict) return Property(type); return Property(name, type); } - template Property createGetterOrSetterProperty(VM* vm, const JSTokenLocation&, PropertyNode::Type type, double name, int, int, int, int, int, int, int) + Property createGetterOrSetterProperty(VM* vm, const JSTokenLocation&, PropertyNode::Type type, bool strict, double name, int, int, int, int, int, int, int) { if (!strict) return Property(type); diff --git a/JavaScriptCore/profiler/LegacyProfiler.cpp b/JavaScriptCore/profiler/LegacyProfiler.cpp index bca7ce2d..bb635c38 100644 --- a/JavaScriptCore/profiler/LegacyProfiler.cpp +++ b/JavaScriptCore/profiler/LegacyProfiler.cpp @@ -40,7 +40,6 @@ #include "Profile.h" #include "ProfileGenerator.h" #include "ProfileNode.h" -#include namespace JSC { diff --git a/JavaScriptCore/profiler/Profile.cpp b/JavaScriptCore/profiler/Profile.cpp index 2274889a..c3a7600c 100644 --- a/JavaScriptCore/profiler/Profile.cpp +++ b/JavaScriptCore/profiler/Profile.cpp @@ -27,7 +27,6 @@ #include "Profile.h" #include "ProfileNode.h" -#include #include namespace JSC { diff --git a/JavaScriptCore/profiler/ProfileNode.cpp b/JavaScriptCore/profiler/ProfileNode.cpp index 5b6a2541..45e9839f 100644 --- a/JavaScriptCore/profiler/ProfileNode.cpp +++ b/JavaScriptCore/profiler/ProfileNode.cpp @@ -30,7 +30,6 @@ #include "ProfileNode.h" #include "LegacyProfiler.h" -#include #include #include #include diff --git a/JavaScriptCore/profiler/ProfilerBytecodeSequence.cpp b/JavaScriptCore/profiler/ProfilerBytecodeSequence.cpp index d00e371a..838153be 100644 --- a/JavaScriptCore/profiler/ProfilerBytecodeSequence.cpp +++ b/JavaScriptCore/profiler/ProfilerBytecodeSequence.cpp @@ -38,7 +38,6 @@ BytecodeSequence::BytecodeSequence(CodeBlock* codeBlock) { StringPrintStream out; -#if ENABLE(VALUE_PROFILER) for (unsigned i = 0; i < codeBlock->numberOfArgumentValueProfiles(); ++i) { ConcurrentJITLocker locker(codeBlock->m_lock); CString description = codeBlock->valueProfileForArgument(i)->briefDescription(locker); @@ -48,7 +47,6 @@ BytecodeSequence::BytecodeSequence(CodeBlock* codeBlock) out.print("arg", i, " (r", virtualRegisterForArgument(i).offset(), "): ", description); m_header.append(out.toCString()); } -#endif // ENABLE(VALUE_PROFILER) for (unsigned bytecodeIndex = 0; bytecodeIndex < codeBlock->instructions().size();) { out.reset(); diff --git a/JavaScriptCore/runtime/ArgList.h b/JavaScriptCore/runtime/ArgList.h index a54a1cd9..9aafc907 100644 --- a/JavaScriptCore/runtime/ArgList.h +++ b/JavaScriptCore/runtime/ArgList.h @@ -139,6 +139,7 @@ class MarkedArgumentBuffer { }; class ArgList { + friend class Interpreter; friend class JIT; public: ArgList() @@ -172,6 +173,8 @@ class ArgList { JS_EXPORT_PRIVATE void getSlice(int startIndex, ArgList& result) const; private: + JSValue* data() const { return m_args; } + JSValue* m_args; int m_argCount; }; diff --git a/JavaScriptCore/runtime/Arguments.cpp b/JavaScriptCore/runtime/Arguments.cpp index 31bb64bd..8fd195cb 100644 --- a/JavaScriptCore/runtime/Arguments.cpp +++ b/JavaScriptCore/runtime/Arguments.cpp @@ -27,6 +27,7 @@ #include "CallFrameInlines.h" #include "JSActivation.h" +#include "JSArgumentsIterator.h" #include "JSFunction.h" #include "JSGlobalObject.h" #include "Operations.h" @@ -50,6 +51,8 @@ void Arguments::visitChildren(JSCell* cell, SlotVisitor& visitor) visitor.append(&thisObject->m_callee); visitor.append(&thisObject->m_activation); } + +static EncodedJSValue JSC_HOST_CALL argumentsFuncIterator(ExecState*); void Arguments::destroy(JSCell* cell) { @@ -151,7 +154,16 @@ bool Arguments::getOwnPropertySlot(JSObject* object, ExecState* exec, PropertyNa if (propertyName == exec->propertyNames().caller && thisObject->m_isStrictMode) thisObject->createStrictModeCallerIfNecessary(exec); - return JSObject::getOwnPropertySlot(thisObject, exec, propertyName, slot); + if (JSObject::getOwnPropertySlot(thisObject, exec, propertyName, slot)) + return true; + if (propertyName == exec->propertyNames().iteratorPrivateName) { + VM& vm = exec->vm(); + JSGlobalObject* globalObject = exec->lexicalGlobalObject(); + thisObject->JSC_NATIVE_FUNCTION(exec->propertyNames().iteratorPrivateName, argumentsFuncIterator, DontEnum, 0); + if (JSObject::getOwnPropertySlot(thisObject, exec, propertyName, slot)) + return true; + } + return false; } void Arguments::getOwnPropertyNames(JSObject* object, ExecState* exec, PropertyNameArray& propertyNames, EnumerationMode mode) @@ -175,7 +187,7 @@ void Arguments::putByIndex(JSCell* cell, ExecState* exec, unsigned i, JSValue va if (thisObject->trySetArgument(exec->vm(), i, value)) return; - PutPropertySlot slot(shouldThrow); + PutPropertySlot slot(thisObject, shouldThrow); JSObject::put(thisObject, exec, Identifier::from(exec, i), value, slot); } @@ -361,5 +373,15 @@ void Arguments::tearOff(CallFrame* callFrame, InlineCallFrame* inlineCallFrame) trySetArgument(callFrame->vm(), i, recovery.recover(callFrame)); } } + +EncodedJSValue JSC_HOST_CALL argumentsFuncIterator(ExecState* exec) +{ + JSObject* thisObj = exec->hostThisValue().toThis(exec, StrictMode).toObject(exec); + Arguments* arguments = jsDynamicCast(thisObj); + if (!arguments) + return JSValue::encode(throwTypeError(exec, "Attempted to use Arguments iterator on non-Arguments object")); + return JSValue::encode(JSArgumentsIterator::create(exec->vm(), exec->callee()->globalObject()->argumentsIteratorStructure(), arguments)); +} + } // namespace JSC diff --git a/JavaScriptCore/runtime/Arguments.h b/JavaScriptCore/runtime/Arguments.h index 41072ef2..18f38917 100644 --- a/JavaScriptCore/runtime/Arguments.h +++ b/JavaScriptCore/runtime/Arguments.h @@ -37,6 +37,7 @@ namespace JSC { class Arguments : public JSDestructibleObject { friend class JIT; + friend class JSArgumentsIterator; public: typedef JSDestructibleObject Base; @@ -250,7 +251,7 @@ inline void Arguments::finishCreation(CallFrame* callFrame) CodeBlock* codeBlock = callFrame->codeBlock(); if (codeBlock->hasSlowArguments()) { - SharedSymbolTable* symbolTable = codeBlock->symbolTable(); + SymbolTable* symbolTable = codeBlock->symbolTable(); const SlowArgument* slowArguments = codeBlock->machineSlowArguments(); allocateSlowArguments(); size_t count = std::min(m_numArguments, symbolTable->parameterCount()); diff --git a/JavaScriptCore/runtime/ArgumentsIteratorConstructor.cpp b/JavaScriptCore/runtime/ArgumentsIteratorConstructor.cpp new file mode 100644 index 00000000..afb59790 --- /dev/null +++ b/JavaScriptCore/runtime/ArgumentsIteratorConstructor.cpp @@ -0,0 +1,45 @@ +/* + * Copyright (C) 2013 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 "ArgumentsIteratorConstructor.h" + +#include "ArgumentsIteratorPrototype.h" +#include "JSArgumentsIterator.h" +#include "JSCJSValueInlines.h" +#include "JSCellInlines.h" +#include "JSGlobalObject.h" + +namespace JSC { + +const ClassInfo ArgumentsIteratorConstructor::s_info = { "ArgumentsIterator", &Base::s_info, 0, 0, CREATE_METHOD_TABLE(ArgumentsIteratorConstructor) }; + +void ArgumentsIteratorConstructor::finishCreation(VM& vm, ArgumentsIteratorPrototype* prototype) +{ + Base::finishCreation(vm); + putDirectWithoutTransition(vm, vm.propertyNames->prototype, prototype, DontEnum | DontDelete | ReadOnly); +} + +} diff --git a/JavaScriptCore/runtime/ArgumentsIteratorConstructor.h b/JavaScriptCore/runtime/ArgumentsIteratorConstructor.h new file mode 100644 index 00000000..8360c59b --- /dev/null +++ b/JavaScriptCore/runtime/ArgumentsIteratorConstructor.h @@ -0,0 +1,63 @@ +/* + * Copyright (C) 2013 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. + */ + +#ifndef ArgumentsIteratorConstructor_h +#define ArgumentsIteratorConstructor_h + +#include "InternalFunction.h" + +namespace JSC { + +class ArgumentsIteratorPrototype; + +class ArgumentsIteratorConstructor : public JSNonFinalObject { +public: + typedef JSNonFinalObject Base; + + static ArgumentsIteratorConstructor* create(VM& vm, Structure* structure, ArgumentsIteratorPrototype* prototype) + { + ArgumentsIteratorConstructor* constructor = new (NotNull, allocateCell(vm.heap)) ArgumentsIteratorConstructor(vm, structure); + constructor->finishCreation(vm, prototype); + return constructor; + } + + DECLARE_INFO; + + static Structure* createStructure(VM& vm, JSGlobalObject* globalObject, JSValue prototype) + { + return Structure::create(vm, globalObject, prototype, TypeInfo(ObjectType, StructureFlags), info()); + } + +private: + ArgumentsIteratorConstructor(VM& vm, Structure* structure) + : Base(vm, structure) + { + } + void finishCreation(VM&, ArgumentsIteratorPrototype*); +}; + +} + +#endif // !defined(ArgumentsIteratorConstructor_h) diff --git a/JavaScriptCore/runtime/ArgumentsIteratorPrototype.cpp b/JavaScriptCore/runtime/ArgumentsIteratorPrototype.cpp new file mode 100644 index 00000000..dd0894f1 --- /dev/null +++ b/JavaScriptCore/runtime/ArgumentsIteratorPrototype.cpp @@ -0,0 +1,61 @@ +/* + * Copyright (C) 2013 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 "ArgumentsIteratorPrototype.h" + +#include "JSArgumentsIterator.h" + +namespace JSC { + +const ClassInfo ArgumentsIteratorPrototype::s_info = { "ArgumentsIterator", &Base::s_info, 0, 0, CREATE_METHOD_TABLE(ArgumentsIteratorPrototype) }; + +static EncodedJSValue JSC_HOST_CALL argumentsIteratorPrototypeFuncIterator(ExecState*); +static EncodedJSValue JSC_HOST_CALL argumentsIteratorPrototypeFuncNext(ExecState*); + +void ArgumentsIteratorPrototype::finishCreation(VM& vm, JSGlobalObject* globalObject) +{ + Base::finishCreation(vm); + ASSERT(inherits(info())); + vm.prototypeMap.addPrototype(this); + + JSC_NATIVE_FUNCTION(vm.propertyNames->iteratorPrivateName, argumentsIteratorPrototypeFuncIterator, DontEnum, 0); + JSC_NATIVE_FUNCTION(vm.propertyNames->iteratorNextPrivateName, argumentsIteratorPrototypeFuncNext, DontEnum, 0); +} + +EncodedJSValue JSC_HOST_CALL argumentsIteratorPrototypeFuncIterator(CallFrame* callFrame) +{ + return JSValue::encode(callFrame->thisValue()); +} + +EncodedJSValue JSC_HOST_CALL argumentsIteratorPrototypeFuncNext(CallFrame* callFrame) +{ + JSValue result; + if (jsCast(callFrame->thisValue())->next(callFrame, result)) + return JSValue::encode(result); + return JSValue::encode(callFrame->vm().iterationTerminator.get()); +} + +} diff --git a/JavaScriptCore/runtime/ArgumentsIteratorPrototype.h b/JavaScriptCore/runtime/ArgumentsIteratorPrototype.h new file mode 100644 index 00000000..21839bfa --- /dev/null +++ b/JavaScriptCore/runtime/ArgumentsIteratorPrototype.h @@ -0,0 +1,61 @@ +/* + * Copyright (C) 2013 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. + */ + +#ifndef ArgumentsIteratorPrototype_h +#define ArgumentsIteratorPrototype_h + +#include "JSObject.h" + +namespace JSC { + +class ArgumentsIteratorPrototype : public JSNonFinalObject { +public: + typedef JSNonFinalObject Base; + + static ArgumentsIteratorPrototype* create(VM& vm, JSGlobalObject* globalObject, Structure* structure) + { + ArgumentsIteratorPrototype* prototype = new (NotNull, allocateCell(vm.heap)) ArgumentsIteratorPrototype(vm, structure); + prototype->finishCreation(vm, globalObject); + return prototype; + } + + DECLARE_INFO; + + static Structure* createStructure(VM& vm, JSGlobalObject* globalObject, JSValue prototype) + { + return Structure::create(vm, globalObject, prototype, TypeInfo(ObjectType, StructureFlags), info()); + } + +private: + ArgumentsIteratorPrototype(VM& vm, Structure* structure) + : Base(vm, structure) + { + } + void finishCreation(VM&, JSGlobalObject*); +}; + +} + +#endif // !defined(ArgumentsIteratorPrototype_h) diff --git a/JavaScriptCore/runtime/ArrayBuffer.cpp b/JavaScriptCore/runtime/ArrayBuffer.cpp index a4322b22..2c49b697 100644 --- a/JavaScriptCore/runtime/ArrayBuffer.cpp +++ b/JavaScriptCore/runtime/ArrayBuffer.cpp @@ -26,6 +26,7 @@ #include "config.h" #include "ArrayBuffer.h" +#include "ArrayBufferNeuteringWatchpoint.h" #include "JSArrayBufferView.h" #include "Operations.h" #include @@ -52,9 +53,11 @@ bool ArrayBuffer::transfer(ArrayBufferContents& result) } for (size_t i = numberOfIncomingReferences(); i--;) { - JSArrayBufferView* view = jsDynamicCast(incomingReferenceAt(i)); - if (view) + JSCell* cell = incomingReferenceAt(i); + if (JSArrayBufferView* view = jsDynamicCast(cell)) view->neuter(); + else if (ArrayBufferNeuteringWatchpoint* watchpoint = jsDynamicCast(cell)) + watchpoint->set()->fireAll(); } return true; } diff --git a/JavaScriptCore/runtime/ArrayBuffer.h b/JavaScriptCore/runtime/ArrayBuffer.h index 204df41c..f0d7d271 100644 --- a/JavaScriptCore/runtime/ArrayBuffer.h +++ b/JavaScriptCore/runtime/ArrayBuffer.h @@ -160,6 +160,7 @@ PassRefPtr ArrayBuffer::create(const void* source, unsigned byteLen if (!contents.m_data) return 0; RefPtr buffer = adoptRef(new ArrayBuffer(contents)); + ASSERT(!byteLength || source); memcpy(buffer->data(), source, byteLength); return buffer.release(); } diff --git a/JavaScriptCore/runtime/ArrayBufferNeuteringWatchpoint.cpp b/JavaScriptCore/runtime/ArrayBufferNeuteringWatchpoint.cpp new file mode 100644 index 00000000..b11a0ad3 --- /dev/null +++ b/JavaScriptCore/runtime/ArrayBufferNeuteringWatchpoint.cpp @@ -0,0 +1,64 @@ +/* + * Copyright (C) 2013 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 "ArrayBufferNeuteringWatchpoint.h" + +#include "Operations.h" + +namespace JSC { + +const ClassInfo ArrayBufferNeuteringWatchpoint::s_info = { + "ArrayBufferNeuteringWatchpoint", 0, 0, 0, + CREATE_METHOD_TABLE(ArrayBufferNeuteringWatchpoint) +}; + +ArrayBufferNeuteringWatchpoint::ArrayBufferNeuteringWatchpoint(VM& vm) + : Base(vm, vm.arrayBufferNeuteringWatchpointStructure.get()) + , m_set(adoptRef(new WatchpointSet(IsWatched))) +{ +} + +void ArrayBufferNeuteringWatchpoint::destroy(JSCell* cell) +{ + static_cast(cell)->ArrayBufferNeuteringWatchpoint::~ArrayBufferNeuteringWatchpoint(); +} + +ArrayBufferNeuteringWatchpoint* ArrayBufferNeuteringWatchpoint::create(VM& vm) +{ + ArrayBufferNeuteringWatchpoint* result = new + (NotNull, allocateCell(vm.heap)) + ArrayBufferNeuteringWatchpoint(vm); + result->finishCreation(vm); + return result; +} + +Structure* ArrayBufferNeuteringWatchpoint::createStructure(VM& vm) +{ + return Structure::create(vm, 0, jsNull(), TypeInfo(CompoundType, StructureFlags), info()); +} + +} // namespace JSC + diff --git a/JavaScriptCore/runtime/ArrayBufferNeuteringWatchpoint.h b/JavaScriptCore/runtime/ArrayBufferNeuteringWatchpoint.h new file mode 100644 index 00000000..96dbd69c --- /dev/null +++ b/JavaScriptCore/runtime/ArrayBufferNeuteringWatchpoint.h @@ -0,0 +1,60 @@ +/* + * Copyright (C) 2013 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. + */ + +#ifndef ArrayBufferNeuteringWatchpoint_h +#define ArrayBufferNeuteringWatchpoint_h + +#include "JSCell.h" +#include "Watchpoint.h" + +namespace JSC { + +class ArrayBufferNeuteringWatchpoint : public JSCell { +public: + typedef JSCell Base; + +private: + ArrayBufferNeuteringWatchpoint(VM&); + +public: + DECLARE_INFO; + + static ArrayBufferNeuteringWatchpoint* create(VM&); + + static const bool needsDestruction = true; + static const bool hasImmortalStructure = true; + static void destroy(JSCell*); + + static Structure* createStructure(VM&); + + WatchpointSet* set() { return m_set.get(); } + +private: + RefPtr m_set; +}; + +} // namespace JSC + +#endif // ArrayBufferNeuteringWatchpoint_h diff --git a/JavaScriptCore/runtime/ArrayBufferView.h b/JavaScriptCore/runtime/ArrayBufferView.h index 77d22b0b..2b8f70d8 100644 --- a/JavaScriptCore/runtime/ArrayBufferView.h +++ b/JavaScriptCore/runtime/ArrayBufferView.h @@ -79,6 +79,8 @@ class ArrayBufferView : public RefCounted { // Helper to verify that a given sub-range of an ArrayBuffer is // within range. + // FIXME: This should distinguish between alignment errors and bounds errors. + // https://bugs.webkit.org/show_bug.cgi?id=125391 template static bool verifySubRange( PassRefPtr buffer, diff --git a/JavaScriptCore/runtime/ArrayPrototype.cpp b/JavaScriptCore/runtime/ArrayPrototype.cpp index 339da744..e9ef7817 100644 --- a/JavaScriptCore/runtime/ArrayPrototype.cpp +++ b/JavaScriptCore/runtime/ArrayPrototype.cpp @@ -116,7 +116,6 @@ const ClassInfo ArrayPrototype::s_info = {"Array", &JSArray::s_info, 0, ExecStat reduce arrayProtoFuncReduce DontEnum|Function 1 reduceRight arrayProtoFuncReduceRight DontEnum|Function 1 map arrayProtoFuncMap DontEnum|Function 1 - values arrayProtoFuncValues DontEnum|Function 0 entries arrayProtoFuncEntries DontEnum|Function 0 keys arrayProtoFuncKeys DontEnum|Function 0 @end @@ -161,7 +160,7 @@ static JSValue getProperty(ExecState* exec, JSObject* obj, unsigned index) static void putProperty(ExecState* exec, JSObject* obj, PropertyName propertyName, JSValue value) { - PutPropertySlot slot; + PutPropertySlot slot(obj); obj->methodTable()->put(obj, exec, propertyName, value, slot); } @@ -502,7 +501,7 @@ EncodedJSValue JSC_HOST_CALL arrayProtoFuncPush(ExecState* exec) if (length + n >= length) thisObj->methodTable()->putByIndex(thisObj, exec, length + n, exec->uncheckedArgument(n), true); else { - PutPropertySlot slot; + PutPropertySlot slot(thisObj); Identifier propertyName(exec, JSValue(static_cast(length) + static_cast(n)).toWTFString(exec)); thisObj->methodTable()->put(thisObj, exec, propertyName, exec->uncheckedArgument(n), slot); } diff --git a/JavaScriptCore/runtime/CachedTranscendentalFunction.h b/JavaScriptCore/runtime/CachedTranscendentalFunction.h deleted file mode 100644 index 392d64fa..00000000 --- a/JavaScriptCore/runtime/CachedTranscendentalFunction.h +++ /dev/null @@ -1,101 +0,0 @@ -/* - * Copyright (C) 2010 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. - */ - -#ifndef CachedTranscendentalFunction_h -#define CachedTranscendentalFunction_h - -#include "JSCJSValue.h" - -namespace JSC { - -typedef double (*TranscendentalFunctionPtr)(double); - -// CachedTranscendentalFunction provides a generic mechanism to cache results -// for pure functions with the signature "double func(double)", and where NaN -// maps to NaN. -template -class CachedTranscendentalFunction { - struct CacheEntry { - double operand; - double result; - }; - -public: - CachedTranscendentalFunction() - : m_cache(0) - { - } - - ~CachedTranscendentalFunction() - { - if (m_cache) - fastFree(m_cache); - } - - JSValue operator() (double operand) - { - if (UNLIKELY(!m_cache)) - initialize(); - CacheEntry* entry = &m_cache[hash(operand)]; - - if (entry->operand == operand) - return jsDoubleNumber(entry->result); - double result = orignalFunction(operand); - entry->operand = operand; - entry->result = result; - return jsDoubleNumber(result); - } - -private: - void initialize() - { - // Lazily allocate the table, populate with NaN->NaN mapping. - m_cache = static_cast(fastMalloc(s_cacheSize * sizeof(CacheEntry))); - for (unsigned x = 0; x < s_cacheSize; ++x) { - m_cache[x].operand = QNaN; - m_cache[x].result = QNaN; - } - } - - static unsigned hash(double d) - { - union doubleAndUInt64 { - double d; - uint32_t is[2]; - } u; - u.d = d; - - unsigned x = u.is[0] ^ u.is[1]; - x = (x >> 20) ^ (x >> 8); - return x & (s_cacheSize - 1); - } - - static const unsigned s_cacheSize = 0x1000; - CacheEntry* m_cache; -}; - -} - -#endif // CachedTranscendentalFunction_h diff --git a/JavaScriptCore/runtime/CodeCache.cpp b/JavaScriptCore/runtime/CodeCache.cpp index 02694244..510e383f 100644 --- a/JavaScriptCore/runtime/CodeCache.cpp +++ b/JavaScriptCore/runtime/CodeCache.cpp @@ -75,17 +75,20 @@ template <> struct CacheTypes { }; template -UnlinkedCodeBlockType* CodeCache::getCodeBlock(VM& vm, ExecutableType* executable, const SourceCode& source, JSParserStrictness strictness, DebuggerMode debuggerMode, ProfilerMode profilerMode, ParserError& error) +UnlinkedCodeBlockType* CodeCache::getGlobalCodeBlock(VM& vm, ExecutableType* executable, const SourceCode& source, JSParserStrictness strictness, DebuggerMode debuggerMode, ProfilerMode profilerMode, ParserError& error) { SourceCodeKey key = SourceCodeKey(source, String(), CacheTypes::codeType, strictness); CodeCacheMap::AddResult addResult = m_sourceCode.add(key, SourceCodeValue()); bool canCache = debuggerMode == DebuggerOff && profilerMode == ProfilerOff; if (!addResult.isNewEntry && canCache) { - UnlinkedCodeBlockType* unlinkedCode = jsCast(addResult.iterator->value.cell.get()); - unsigned firstLine = source.firstLine() + unlinkedCode->firstLine(); - unsigned startColumn = source.firstLine() ? source.startColumn() : 0; - executable->recordParse(unlinkedCode->codeFeatures(), unlinkedCode->hasCapturedVariables(), firstLine, firstLine + unlinkedCode->lineCount(), startColumn); - return unlinkedCode; + UnlinkedCodeBlockType* unlinkedCodeBlock = jsCast(addResult.iterator->value.cell.get()); + unsigned firstLine = source.firstLine() + unlinkedCodeBlock->firstLine(); + unsigned lineCount = unlinkedCodeBlock->lineCount(); + unsigned startColumn = unlinkedCodeBlock->startColumn() + source.startColumn(); + bool endColumnIsOnStartLine = !lineCount; + unsigned endColumn = unlinkedCodeBlock->endColumn() + (endColumnIsOnStartLine ? startColumn : 1); + executable->recordParse(unlinkedCodeBlock->codeFeatures(), unlinkedCodeBlock->hasCapturedVariables(), firstLine, firstLine + lineCount, startColumn, endColumn); + return unlinkedCodeBlock; } typedef typename CacheTypes::RootNode RootNode; @@ -94,11 +97,17 @@ UnlinkedCodeBlockType* CodeCache::getCodeBlock(VM& vm, ExecutableType* executabl m_sourceCode.remove(addResult.iterator); return 0; } - executable->recordParse(rootNode->features(), rootNode->hasCapturedVariables(), rootNode->lineNo(), rootNode->lastLine(), rootNode->startColumn()); + unsigned lineCount = rootNode->lastLine() - rootNode->lineNo(); + unsigned startColumn = rootNode->startColumn() + 1; + bool endColumnIsOnStartLine = !lineCount; + unsigned unlinkedEndColumn = rootNode->endColumn(); + unsigned endColumn = unlinkedEndColumn + (endColumnIsOnStartLine ? startColumn : 1); + executable->recordParse(rootNode->features(), rootNode->hasCapturedVariables(), rootNode->lineNo(), rootNode->lastLine(), startColumn, endColumn); - UnlinkedCodeBlockType* unlinkedCode = UnlinkedCodeBlockType::create(&vm, executable->executableInfo()); - unlinkedCode->recordParse(rootNode->features(), rootNode->hasCapturedVariables(), rootNode->lineNo() - source.firstLine(), rootNode->lastLine() - rootNode->lineNo()); - OwnPtr generator(adoptPtr(new BytecodeGenerator(vm, rootNode.get(), unlinkedCode, debuggerMode, profilerMode))); + UnlinkedCodeBlockType* unlinkedCodeBlock = UnlinkedCodeBlockType::create(&vm, executable->executableInfo()); + unlinkedCodeBlock->recordParse(rootNode->features(), rootNode->hasCapturedVariables(), rootNode->lineNo() - source.firstLine(), lineCount, unlinkedEndColumn); + + OwnPtr generator(adoptPtr(new BytecodeGenerator(vm, rootNode.get(), unlinkedCodeBlock, debuggerMode, profilerMode))); error = generator->generate(); rootNode->destroyData(); if (error.m_type != ParserError::ErrorNone) { @@ -108,21 +117,21 @@ UnlinkedCodeBlockType* CodeCache::getCodeBlock(VM& vm, ExecutableType* executabl if (!canCache) { m_sourceCode.remove(addResult.iterator); - return unlinkedCode; + return unlinkedCodeBlock; } - addResult.iterator->value = SourceCodeValue(vm, unlinkedCode, m_sourceCode.age()); - return unlinkedCode; + addResult.iterator->value = SourceCodeValue(vm, unlinkedCodeBlock, m_sourceCode.age()); + return unlinkedCodeBlock; } UnlinkedProgramCodeBlock* CodeCache::getProgramCodeBlock(VM& vm, ProgramExecutable* executable, const SourceCode& source, JSParserStrictness strictness, DebuggerMode debuggerMode, ProfilerMode profilerMode, ParserError& error) { - return getCodeBlock(vm, executable, source, strictness, debuggerMode, profilerMode, error); + return getGlobalCodeBlock(vm, executable, source, strictness, debuggerMode, profilerMode, error); } UnlinkedEvalCodeBlock* CodeCache::getEvalCodeBlock(VM& vm, EvalExecutable* executable, const SourceCode& source, JSParserStrictness strictness, DebuggerMode debuggerMode, ProfilerMode profilerMode, ParserError& error) { - return getCodeBlock(vm, executable, source, strictness, debuggerMode, profilerMode, error); + return getGlobalCodeBlock(vm, executable, source, strictness, debuggerMode, profilerMode, error); } UnlinkedFunctionExecutable* CodeCache::getFunctionExecutableFromGlobalCode(VM& vm, const Identifier& name, const SourceCode& source, ParserError& error) @@ -132,7 +141,8 @@ UnlinkedFunctionExecutable* CodeCache::getFunctionExecutableFromGlobalCode(VM& v if (!addResult.isNewEntry) return jsCast(addResult.iterator->value.cell.get()); - RefPtr program = parse(&vm, source, 0, Identifier(), JSParseNormal, JSParseProgramCode, error); + JSTextPosition positionBeforeLastNewline; + RefPtr program = parse(&vm, source, 0, Identifier(), JSParseNormal, JSParseProgramCode, error, &positionBeforeLastNewline); if (!program) { ASSERT(error.m_type != ParserError::ErrorNone); m_sourceCode.remove(addResult.iterator); @@ -147,10 +157,11 @@ UnlinkedFunctionExecutable* CodeCache::getFunctionExecutableFromGlobalCode(VM& v ASSERT(funcExpr); RELEASE_ASSERT(funcExpr->isFuncExprNode()); FunctionBodyNode* body = static_cast(funcExpr)->body(); + body->setEndPosition(positionBeforeLastNewline); ASSERT(body); ASSERT(body->ident().isNull()); - UnlinkedFunctionExecutable* functionExecutable = UnlinkedFunctionExecutable::create(&vm, source, body); + UnlinkedFunctionExecutable* functionExecutable = UnlinkedFunctionExecutable::create(&vm, source, body, true); functionExecutable->m_nameValue.set(vm, functionExecutable, jsString(&vm, name.string())); addResult.iterator->value = SourceCodeValue(vm, functionExecutable, m_sourceCode.age()); diff --git a/JavaScriptCore/runtime/CodeCache.h b/JavaScriptCore/runtime/CodeCache.h index 6dbcc57e..f3ff7478 100644 --- a/JavaScriptCore/runtime/CodeCache.h +++ b/JavaScriptCore/runtime/CodeCache.h @@ -32,7 +32,6 @@ #include "Strong.h" #include "WeakRandom.h" #include -#include #include #include #include @@ -253,7 +252,7 @@ class CodeCache { CodeCache(); template - UnlinkedCodeBlockType* getCodeBlock(VM&, ExecutableType*, const SourceCode&, JSParserStrictness, DebuggerMode, ProfilerMode, ParserError&); + UnlinkedCodeBlockType* getGlobalCodeBlock(VM&, ExecutableType*, const SourceCode&, JSParserStrictness, DebuggerMode, ProfilerMode, ParserError&); CodeCacheMap m_sourceCode; }; diff --git a/JavaScriptCore/runtime/CommonIdentifiers.cpp b/JavaScriptCore/runtime/CommonIdentifiers.cpp index 9fbdea6e..3f5c645c 100644 --- a/JavaScriptCore/runtime/CommonIdentifiers.cpp +++ b/JavaScriptCore/runtime/CommonIdentifiers.cpp @@ -27,6 +27,7 @@ namespace JSC { #define INITIALIZE_PROPERTY_NAME(name) , name(vm, #name) #define INITIALIZE_KEYWORD(name) , name##Keyword(vm, #name) +#define INITIALIZE_PRIVATE_NAME(name) , name##PrivateName(Identifier::from(PrivateName())) CommonIdentifiers::CommonIdentifiers(VM* vm) : nullIdentifier() @@ -34,11 +35,10 @@ CommonIdentifiers::CommonIdentifiers(VM* vm) , underscoreProto(vm, "__proto__") , thisIdentifier(vm, "this") , useStrictIdentifier(vm, "use strict") - , iteratorPrivateName(Identifier::from(PrivateName())) - , iteratorNextPrivateName(Identifier::from(PrivateName())) , hasNextIdentifier(vm, "hasNext") JSC_COMMON_IDENTIFIERS_EACH_KEYWORD(INITIALIZE_KEYWORD) JSC_COMMON_IDENTIFIERS_EACH_PROPERTY_NAME(INITIALIZE_PROPERTY_NAME) + JSC_COMMON_PRIVATE_IDENTIFIERS_EACH_PROPERTY_NAME(INITIALIZE_PRIVATE_NAME) { } diff --git a/JavaScriptCore/runtime/CommonIdentifiers.h b/JavaScriptCore/runtime/CommonIdentifiers.h index a91f5370..e8f9ed82 100644 --- a/JavaScriptCore/runtime/CommonIdentifiers.h +++ b/JavaScriptCore/runtime/CommonIdentifiers.h @@ -27,6 +27,7 @@ // MarkedArgumentBuffer of property names, passed to a macro so we can do set them up various // ways without repeating the list. #define JSC_COMMON_IDENTIFIERS_EACH_PROPERTY_NAME(macro) \ + macro(ArgumentsIterator) \ macro(Array) \ macro(ArrayBuffer) \ macro(ArrayIterator) \ @@ -38,24 +39,29 @@ macro(Function) \ macro(Infinity) \ macro(JSON) \ + macro(Map)\ + macro(MapIterator)\ macro(Math) \ macro(NaN) \ macro(Number) \ macro(Object) \ macro(Promise) \ - macro(PromiseResolver) \ macro(RangeError) \ macro(ReferenceError) \ macro(RegExp) \ + macro(Set)\ + macro(SetIterator)\ macro(String) \ macro(SyntaxError) \ macro(TypeError) \ macro(URIError) \ macro(UTC) \ + macro(WeakMap)\ macro(__defineGetter__) \ macro(__defineSetter__) \ macro(__lookupGetter__) \ macro(__lookupSetter__) \ + macro(add) \ macro(anonymous) \ macro(apply) \ macro(arguments) \ @@ -70,6 +76,8 @@ macro(call) \ macro(callee) \ macro(caller) \ + macro(cast) \ + macro(clear) \ macro(compilationKind) \ macro(compilations) \ macro(compile) \ @@ -82,14 +90,17 @@ macro(displayName) \ macro(document) \ macro(done) \ + macro(entries) \ macro(enumerable) \ macro(eval) \ macro(exec) \ macro(executionCount) \ macro(exitKind) \ + macro(forEach) \ macro(fromCharCode) \ macro(get) \ macro(global) \ + macro(has) \ macro(hasOwnProperty) \ macro(hash) \ macro(header) \ @@ -101,8 +112,10 @@ macro(instructionCount) \ macro(isArray) \ macro(isPrototypeOf) \ + macro(isView) \ macro(isWatchpoint) \ macro(join) \ + macro(keys) \ macro(lastIndex) \ macro(length) \ macro(message) \ @@ -123,6 +136,7 @@ macro(propertyIsEnumerable) \ macro(prototype) \ macro(set) \ + macro(size) \ macro(slice) \ macro(source) \ macro(sourceCode) \ @@ -138,66 +152,72 @@ macro(toPrecision) \ macro(toString) \ macro(value) \ + macro(values) \ macro(valueOf) \ macro(window) \ - macro(writable) \ - macro(has) \ - macro(forEach) \ - macro(clear) \ - macro(size) \ - macro(Map)\ - macro(Set)\ - macro(WeakMap)\ - macro(add) + macro(writable) #define JSC_COMMON_IDENTIFIERS_EACH_KEYWORD(macro) \ - macro(null) \ - macro(undefined) \ - macro(true) \ - macro(false) \ macro(break) \ macro(case) \ macro(catch) \ + macro(class) \ macro(const) \ - macro(default) \ - macro(finally) \ - macro(for) \ - macro(instanceof) \ - macro(new) \ - macro(var) \ macro(continue) \ - macro(function) \ - macro(return) \ - macro(void) \ + macro(debugger) \ + macro(default) \ macro(delete) \ - macro(if) \ - macro(this) \ macro(do) \ - macro(while) \ macro(else) \ - macro(in) \ - macro(switch) \ - macro(throw) \ - macro(try) \ - macro(typeof) \ - macro(with) \ - macro(debugger) \ - macro(class) \ macro(enum) \ macro(export) \ macro(extends) \ - macro(import) \ - macro(super) \ + macro(false) \ + macro(finally) \ + macro(for) \ + macro(function) \ + macro(if) \ macro(implements) \ + macro(import) \ + macro(in) \ + macro(instanceof) \ macro(interface) \ macro(let) \ + macro(new) \ + macro(null) \ macro(package) \ macro(private) \ macro(protected) \ macro(public) \ + macro(return) \ macro(static) \ + macro(super) \ + macro(switch) \ + macro(this) \ + macro(throw) \ + macro(true) \ + macro(try) \ + macro(typeof) \ + macro(undefined) \ + macro(var) \ + macro(void) \ + macro(while) \ + macro(with) \ macro(yield) +#define JSC_COMMON_PRIVATE_IDENTIFIERS_EACH_PROPERTY_NAME(macro) \ + macro(iterator) \ + macro(iteratorNext) \ + macro(resolve) \ + macro(reject) \ + macro(promise) \ + macro(fulfillmentHandler) \ + macro(rejectionHandler) \ + macro(index) \ + macro(values) \ + macro(deferred) \ + macro(countdownHolder) + namespace JSC { class CommonIdentifiers { @@ -212,10 +232,7 @@ namespace JSC { const Identifier underscoreProto; const Identifier thisIdentifier; const Identifier useStrictIdentifier; - const Identifier iteratorPrivateName; - const Identifier iteratorNextPrivateName; const Identifier hasNextIdentifier; - #define JSC_IDENTIFIER_DECLARE_KEYWORD_NAME_GLOBAL(name) const Identifier name##Keyword; JSC_COMMON_IDENTIFIERS_EACH_KEYWORD(JSC_IDENTIFIER_DECLARE_KEYWORD_NAME_GLOBAL) @@ -224,6 +241,10 @@ namespace JSC { #define JSC_IDENTIFIER_DECLARE_PROPERTY_NAME_GLOBAL(name) const Identifier name; JSC_COMMON_IDENTIFIERS_EACH_PROPERTY_NAME(JSC_IDENTIFIER_DECLARE_PROPERTY_NAME_GLOBAL) #undef JSC_IDENTIFIER_DECLARE_PROPERTY_NAME_GLOBAL + +#define JSC_IDENTIFIER_DECLARE_PRIVATE_PROPERTY_NAME_GLOBAL(name) const Identifier name##PrivateName; + JSC_COMMON_PRIVATE_IDENTIFIERS_EACH_PROPERTY_NAME(JSC_IDENTIFIER_DECLARE_PRIVATE_PROPERTY_NAME_GLOBAL) +#undef JSC_IDENTIFIER_DECLARE_PRIVATE_PROPERTY_NAME_GLOBAL }; } // namespace JSC diff --git a/JavaScriptCore/runtime/CommonSlowPaths.cpp b/JavaScriptCore/runtime/CommonSlowPaths.cpp index be6ac590..f6a142e6 100644 --- a/JavaScriptCore/runtime/CommonSlowPaths.cpp +++ b/JavaScriptCore/runtime/CommonSlowPaths.cpp @@ -124,7 +124,6 @@ namespace JSC { END_IMPL(); \ } while (false) -#if ENABLE(VALUE_PROFILER) #define RETURN_PROFILED(opcode, value) do { \ JSValue rpPeturnValue = (value); \ CHECK_EXCEPTION(); \ @@ -138,13 +137,6 @@ namespace JSC { JSValue::encode(value); \ } while (false) -#else // ENABLE(VALUE_PROFILER) -#define RETURN_PROFILED(opcode, value) RETURN(value) - -#define PROFILE_VALUE(opcode, value) do { } while (false) - -#endif // ENABLE(VALUE_PROFILER) - #define CALL_END_IMPL(exec, callTarget) RETURN_TWO((callTarget), (exec)) #define CALL_THROW(exec, pc, exceptionToThrow) do { \ @@ -193,6 +185,13 @@ SLOW_PATH_DECL(slow_path_construct_arityCheck) RETURN_TWO(0, reinterpret_cast(SlotsToAdd)); } +SLOW_PATH_DECL(slow_path_touch_entry) +{ + BEGIN(); + exec->codeBlock()->symbolTable()->m_functionEnteredOnce.touch(); + END(); +} + SLOW_PATH_DECL(slow_path_get_callee) { BEGIN(); @@ -237,6 +236,29 @@ SLOW_PATH_DECL(slow_path_to_this) RETURN(v1.toThis(exec, exec->codeBlock()->isStrictMode() ? StrictMode : NotStrictMode)); } +SLOW_PATH_DECL(slow_path_captured_mov) +{ + BEGIN(); + JSValue value = OP_C(2).jsValue(); + if (VariableWatchpointSet* set = pc[3].u.watchpointSet) + set->notifyWrite(value); + RETURN(value); +} + +SLOW_PATH_DECL(slow_path_new_captured_func) +{ + BEGIN(); + CodeBlock* codeBlock = exec->codeBlock(); + ASSERT( + codeBlock->codeType() != FunctionCode + || !codeBlock->needsFullScopeChain() + || exec->uncheckedR(codeBlock->activationRegister().offset()).jsValue()); + JSValue value = JSFunction::create(vm, codeBlock->functionDecl(pc[2].u.operand), exec->scope()); + if (VariableWatchpointSet* set = pc[3].u.watchpointSet) + set->notifyWrite(value); + RETURN(value); +} + SLOW_PATH_DECL(slow_path_not) { BEGIN(); @@ -387,7 +409,14 @@ SLOW_PATH_DECL(slow_path_urshift) BEGIN(); uint32_t a = OP_C(2).jsValue().toUInt32(exec); uint32_t b = OP_C(3).jsValue().toUInt32(exec); - RETURN(jsNumber(a >> (b & 31))); + RETURN(jsNumber(static_cast(a >> (b & 31)))); +} + +SLOW_PATH_DECL(slow_path_unsigned) +{ + BEGIN(); + uint32_t a = OP_C(2).jsValue().toUInt32(exec); + RETURN(jsNumber(a)); } SLOW_PATH_DECL(slow_path_bitand) @@ -478,6 +507,14 @@ SLOW_PATH_DECL(slow_path_to_primitive) RETURN(OP_C(2).jsValue().toPrimitive(exec)); } +SLOW_PATH_DECL(slow_path_enter) +{ + BEGIN(); + ScriptExecutable* ownerExecutable = exec->codeBlock()->ownerExecutable(); + Heap::heap(ownerExecutable)->writeBarrier(ownerExecutable); + END(); +} + } // namespace JSC #endif // ENABLE(JIT) || ENABLE(LLINT) diff --git a/JavaScriptCore/runtime/CommonSlowPaths.h b/JavaScriptCore/runtime/CommonSlowPaths.h index 8f92a8e3..cfc8bdbb 100644 --- a/JavaScriptCore/runtime/CommonSlowPaths.h +++ b/JavaScriptCore/runtime/CommonSlowPaths.h @@ -29,8 +29,12 @@ #include "CodeBlock.h" #include "CodeSpecializationKind.h" #include "ExceptionHelpers.h" +#include "JSStackInlines.h" #include "NameInstance.h" +#include "StackAlignment.h" +#include "VM.h" #include +#include #if ENABLE(JIT) || ENABLE(LLINT) @@ -52,15 +56,20 @@ ALWAYS_INLINE int arityCheckFor(ExecState* exec, JSStack* stack, CodeSpecializat CodeBlock* newCodeBlock = callee->jsExecutable()->codeBlockFor(kind); int argumentCountIncludingThis = exec->argumentCountIncludingThis(); - // This ensures enough space for the worst case scenario of zero arguments passed by the caller. - if (!stack->grow(exec->registers() - newCodeBlock->numParameters() + virtualRegisterForLocal(newCodeBlock->m_numCalleeRegisters).offset())) - return -1; - ASSERT(argumentCountIncludingThis < newCodeBlock->numParameters()); - - // Too few arguments, return the number of missing arguments so the caller can - // grow the frame in place and fill in undefined values for the missing args. - return(newCodeBlock->numParameters() - argumentCountIncludingThis); + int missingArgumentCount = newCodeBlock->numParameters() - argumentCountIncludingThis; + int paddedMissingArgumentCount = WTF::roundUpToMultipleOf(stackAlignmentRegisters(), missingArgumentCount); + +#if USE(SEPARATE_C_AND_JS_STACK) + if (!stack->grow(exec->registers() - paddedMissingArgumentCount)) + return -1; +#else + UNUSED_PARAM(stack); + if (!exec->vm().isSafeToRecurse(paddedMissingArgumentCount * sizeof(Register))) + return -1; +#endif // USE(SEPARATE_C_AND_JS_STACK) + + return paddedMissingArgumentCount; } inline bool opIn(ExecState* exec, JSValue propName, JSValue baseVal) @@ -96,10 +105,10 @@ struct Instruction; // warnings, or worse, a change in the ABI used to return these types. struct SlowPathReturnType { void* a; - ExecState* b; + void* b; }; -inline SlowPathReturnType encodeResult(void* a, ExecState* b) +inline SlowPathReturnType encodeResult(void* a, void* b) { SlowPathReturnType result; result.a = a; @@ -107,7 +116,7 @@ inline SlowPathReturnType encodeResult(void* a, ExecState* b) return result; } -inline void decodeResult(SlowPathReturnType result, void*& a, ExecState*& b) +inline void decodeResult(SlowPathReturnType result, void*& a, void*& b) { a = result.a; b = result.b; @@ -119,12 +128,12 @@ typedef int64_t SlowPathReturnType; typedef union { struct { void* a; - ExecState* b; + void* b; } pair; int64_t i; } SlowPathReturnTypeEncoding; -inline SlowPathReturnType encodeResult(void* a, ExecState* b) +inline SlowPathReturnType encodeResult(void* a, void* b) { SlowPathReturnTypeEncoding u; u.pair.a = a; @@ -132,7 +141,7 @@ inline SlowPathReturnType encodeResult(void* a, ExecState* b) return u.i; } -inline void decodeResult(SlowPathReturnType result, void*& a, ExecState*& b) +inline void decodeResult(SlowPathReturnType result, void*& a, void*& b) { SlowPathReturnTypeEncoding u; u.i = result; @@ -151,10 +160,14 @@ SLOW_PATH_DECL(name) WTF_INTERNAL SLOW_PATH_HIDDEN_DECL(slow_path_call_arityCheck); SLOW_PATH_HIDDEN_DECL(slow_path_construct_arityCheck); +SLOW_PATH_HIDDEN_DECL(slow_path_touch_entry); SLOW_PATH_HIDDEN_DECL(slow_path_create_arguments); SLOW_PATH_HIDDEN_DECL(slow_path_create_this); +SLOW_PATH_HIDDEN_DECL(slow_path_enter); SLOW_PATH_HIDDEN_DECL(slow_path_get_callee); SLOW_PATH_HIDDEN_DECL(slow_path_to_this); +SLOW_PATH_HIDDEN_DECL(slow_path_captured_mov); +SLOW_PATH_HIDDEN_DECL(slow_path_new_captured_func); SLOW_PATH_HIDDEN_DECL(slow_path_not); SLOW_PATH_HIDDEN_DECL(slow_path_eq); SLOW_PATH_HIDDEN_DECL(slow_path_neq); @@ -176,6 +189,7 @@ SLOW_PATH_HIDDEN_DECL(slow_path_mod); SLOW_PATH_HIDDEN_DECL(slow_path_lshift); SLOW_PATH_HIDDEN_DECL(slow_path_rshift); SLOW_PATH_HIDDEN_DECL(slow_path_urshift); +SLOW_PATH_HIDDEN_DECL(slow_path_unsigned); SLOW_PATH_HIDDEN_DECL(slow_path_bitand); SLOW_PATH_HIDDEN_DECL(slow_path_bitor); SLOW_PATH_HIDDEN_DECL(slow_path_bitxor); diff --git a/JavaScriptCore/runtime/Completion.cpp b/JavaScriptCore/runtime/Completion.cpp index eec95e11..9d7fd1a7 100644 --- a/JavaScriptCore/runtime/Completion.cpp +++ b/JavaScriptCore/runtime/Completion.cpp @@ -1,7 +1,7 @@ /* * Copyright (C) 1999-2001 Harri Porten (porten@kde.org) * Copyright (C) 2001 Peter Kelly (pmk@post.com) - * Copyright (C) 2003, 2007 Apple Inc. + * Copyright (C) 2003, 2007, 2013 Apple Inc. * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Library General Public @@ -32,7 +32,6 @@ #include "Operations.h" #include "Parser.h" #include -#include namespace JSC { @@ -78,7 +77,7 @@ JSValue evaluate(ExecState* exec, const SourceCode& source, JSValue thisValue, J } if (!thisValue || thisValue.isUndefinedOrNull()) - thisValue = exec->dynamicGlobalObject(); + thisValue = exec->vmEntryGlobalObject(); JSObject* thisObj = jsCast(thisValue.toThis(exec, NotStrictMode)); JSValue result = exec->interpreter()->execute(program, exec, thisObj); diff --git a/JavaScriptCore/runtime/ConstantMode.h b/JavaScriptCore/runtime/ConstantMode.h new file mode 100644 index 00000000..389a074f --- /dev/null +++ b/JavaScriptCore/runtime/ConstantMode.h @@ -0,0 +1,36 @@ +/* + * Copyright (C) 2013 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. + */ + +#ifndef ConstantMode_h +#define ConstantMode_h + +namespace JSC { + +enum ConstantMode { IsConstant, IsVariable }; + +} // namespace JSC + +#endif // ConstantMode_h + diff --git a/JavaScriptCore/runtime/DateInstanceCache.h b/JavaScriptCore/runtime/DateInstanceCache.h index e186516e..1c8c011e 100644 --- a/JavaScriptCore/runtime/DateInstanceCache.h +++ b/JavaScriptCore/runtime/DateInstanceCache.h @@ -26,8 +26,9 @@ #ifndef DateInstanceCache_h #define DateInstanceCache_h +#include "JSCJSValue.h" #include "JSDateMath.h" -#include +#include #include #include #include @@ -85,7 +86,7 @@ namespace JSC { CacheEntry& lookup(double d) { return m_cache[WTF::FloatHash::hash(d) & (cacheSize - 1)]; } - FixedArray m_cache; + std::array m_cache; }; } // namespace JSC diff --git a/JavaScriptCore/runtime/DumpContext.cpp b/JavaScriptCore/runtime/DumpContext.cpp index 84c80bba..0546f4c8 100644 --- a/JavaScriptCore/runtime/DumpContext.cpp +++ b/JavaScriptCore/runtime/DumpContext.cpp @@ -28,7 +28,11 @@ namespace JSC { -DumpContext::DumpContext() { } +DumpContext::DumpContext() + : graph(0) +{ +} + DumpContext::~DumpContext() { } bool DumpContext::isEmpty() const diff --git a/JavaScriptCore/runtime/DumpContext.h b/JavaScriptCore/runtime/DumpContext.h index e24ced09..9ec93131 100644 --- a/JavaScriptCore/runtime/DumpContext.h +++ b/JavaScriptCore/runtime/DumpContext.h @@ -32,6 +32,8 @@ namespace JSC { +namespace DFG { class Graph; } + struct DumpContext { DumpContext(); ~DumpContext(); @@ -41,6 +43,7 @@ struct DumpContext { void dump(PrintStream&, const char* prefix = "") const; StringHashDumpContext structures; + DFG::Graph* graph; }; } // namespace JSC diff --git a/JavaScriptCore/runtime/Executable.cpp b/JavaScriptCore/runtime/Executable.cpp index b3fec134..35ea833e 100644 --- a/JavaScriptCore/runtime/Executable.cpp +++ b/JavaScriptCore/runtime/Executable.cpp @@ -180,7 +180,9 @@ PassRefPtr ScriptExecutable::newCodeBlockFor( VM* vm = scope->vm(); ASSERT(vm->heap.isDeferred()); - + ASSERT(startColumn() != UINT_MAX); + ASSERT(endColumn() != UINT_MAX); + if (classInfo() == EvalExecutable::info()) { EvalExecutable* executable = jsCast(this); RELEASE_ASSERT(kind == CodeForCall); @@ -209,7 +211,7 @@ PassRefPtr ScriptExecutable::newCodeBlockFor( UnlinkedFunctionCodeBlock* unlinkedCodeBlock = executable->m_unlinkedExecutable->codeBlockFor( *vm, executable->m_source, kind, debuggerMode, profilerMode, error); - recordParse(executable->m_unlinkedExecutable->features(), executable->m_unlinkedExecutable->hasCapturedVariables(), lineNo(), lastLine(), startColumn()); + recordParse(executable->m_unlinkedExecutable->features(), executable->m_unlinkedExecutable->hasCapturedVariables(), lineNo(), lastLine(), startColumn(), endColumn()); if (!unlinkedCodeBlock) { exception = vm->throwException( globalObject->globalExec(), @@ -296,6 +298,9 @@ JSObject* ScriptExecutable::prepareForExecutionImpl( return exception; } + if (Options::validateBytecode()) + codeBlock->validate(); + bool shouldUseLLInt; #if !ENABLE(JIT) // No JIT implies use of the C Loop LLINT. Override the options to reflect this. @@ -362,15 +367,19 @@ void ProgramExecutable::destroy(JSCell* cell) const ClassInfo FunctionExecutable::s_info = { "FunctionExecutable", &ScriptExecutable::s_info, 0, 0, CREATE_METHOD_TABLE(FunctionExecutable) }; -FunctionExecutable::FunctionExecutable(VM& vm, const SourceCode& source, UnlinkedFunctionExecutable* unlinkedExecutable, unsigned firstLine, unsigned lastLine, unsigned startColumn) +FunctionExecutable::FunctionExecutable(VM& vm, const SourceCode& source, UnlinkedFunctionExecutable* unlinkedExecutable, unsigned firstLine, unsigned lastLine, unsigned startColumn, unsigned endColumn, bool bodyIncludesBraces) : ScriptExecutable(vm.functionExecutableStructure.get(), vm, source, unlinkedExecutable->isInStrictContext()) , m_unlinkedExecutable(vm, this, unlinkedExecutable) + , m_bodyIncludesBraces(bodyIncludesBraces) { RELEASE_ASSERT(!source.isNull()); ASSERT(source.length()); m_firstLine = firstLine; m_lastLine = lastLine; + ASSERT(startColumn != UINT_MAX); + ASSERT(endColumn != UINT_MAX); m_startColumn = startColumn; + m_endColumn = endColumn; } void FunctionExecutable::destroy(JSCell* cell) @@ -454,16 +463,16 @@ JSObject* ProgramExecutable::initializeGlobalProperties(VM& vm, CallFrame* callF ASSERT(&globalObject->vm() == &vm); JSObject* exception = 0; - UnlinkedProgramCodeBlock* unlinkedCode = globalObject->createProgramCodeBlock(callFrame, this, &exception); + UnlinkedProgramCodeBlock* unlinkedCodeBlock = globalObject->createProgramCodeBlock(callFrame, this, &exception); if (exception) return exception; - m_unlinkedProgramCodeBlock.set(vm, this, unlinkedCode); + m_unlinkedProgramCodeBlock.set(vm, this, unlinkedCodeBlock); BatchedTransitionOptimizer optimizer(vm, globalObject); - const UnlinkedProgramCodeBlock::VariableDeclations& variableDeclarations = unlinkedCode->variableDeclarations(); - const UnlinkedProgramCodeBlock::FunctionDeclations& functionDeclarations = unlinkedCode->functionDeclarations(); + const UnlinkedProgramCodeBlock::VariableDeclations& variableDeclarations = unlinkedCodeBlock->variableDeclarations(); + const UnlinkedProgramCodeBlock::FunctionDeclations& functionDeclarations = unlinkedCodeBlock->functionDeclarations(); for (size_t i = 0; i < functionDeclarations.size(); ++i) { UnlinkedFunctionExecutable* unlinkedFunctionExecutable = functionDeclarations[i].second.get(); @@ -510,11 +519,7 @@ FunctionCodeBlock* FunctionExecutable::baselineCodeBlockFor(CodeSpecializationKi } if (!result) return 0; - while (result->alternative()) - result = static_cast(result->alternative()); - RELEASE_ASSERT(result); - ASSERT(JITCode::isBaselineCode(result->jitType())); - return result; + return static_cast(result->baselineAlternative()); } void FunctionExecutable::visitChildren(JSCell* cell, SlotVisitor& visitor) @@ -531,6 +536,11 @@ void FunctionExecutable::visitChildren(JSCell* cell, SlotVisitor& visitor) visitor.append(&thisObject->m_unlinkedExecutable); } +SymbolTable* FunctionExecutable::symbolTable(CodeSpecializationKind kind) +{ + return codeBlockFor(kind)->symbolTable(); +} + void FunctionExecutable::clearCodeIfNotCompiling() { if (isCompiling()) @@ -568,15 +578,27 @@ void FunctionExecutable::unlinkCalls() FunctionExecutable* FunctionExecutable::fromGlobalCode(const Identifier& name, ExecState* exec, Debugger* debugger, const SourceCode& source, JSObject** exception) { - UnlinkedFunctionExecutable* unlinkedFunction = UnlinkedFunctionExecutable::fromGlobalCode(name, exec, debugger, source, exception); - if (!unlinkedFunction) + UnlinkedFunctionExecutable* unlinkedExecutable = UnlinkedFunctionExecutable::fromGlobalCode(name, exec, debugger, source, exception); + if (!unlinkedExecutable) return 0; - unsigned firstLine = source.firstLine() + unlinkedFunction->firstLineOffset(); - unsigned startOffset = source.startOffset() + unlinkedFunction->startOffset(); - unsigned startColumn = source.startColumn(); - unsigned sourceLength = unlinkedFunction->sourceLength(); - SourceCode functionSource(source.provider(), startOffset, startOffset + sourceLength, firstLine, startColumn); - return FunctionExecutable::create(exec->vm(), functionSource, unlinkedFunction, firstLine, unlinkedFunction->lineCount(), startColumn); + unsigned lineCount = unlinkedExecutable->lineCount(); + unsigned firstLine = source.firstLine() + unlinkedExecutable->firstLineOffset(); + unsigned startOffset = source.startOffset() + unlinkedExecutable->startOffset(); + + // We don't have any owner executable. The source string is effectively like a global + // string (like in the handling of eval). Hence, the startColumn is always 1. + unsigned startColumn = 1; + unsigned sourceLength = unlinkedExecutable->sourceLength(); + bool endColumnIsOnStartLine = !lineCount; + // The unlinkedBodyEndColumn is based-0. Hence, we need to add 1 to it. But if the + // endColumn is on the startLine, then we need to subtract back the adjustment for + // the open brace resulting in an adjustment of 0. + unsigned endColumnExcludingBraces = unlinkedExecutable->unlinkedBodyEndColumn() + (endColumnIsOnStartLine ? 0 : 1); + unsigned startOffsetExcludingOpenBrace = startOffset + 1; + unsigned endOffsetExcludingCloseBrace = startOffset + sourceLength - 1; + SourceCode bodySource(source.provider(), startOffsetExcludingOpenBrace, endOffsetExcludingCloseBrace, firstLine, startColumn); + + return FunctionExecutable::create(exec->vm(), bodySource, unlinkedExecutable, firstLine, firstLine + lineCount, startColumn, endColumnExcludingBraces, false); } String FunctionExecutable::paramString() const diff --git a/JavaScriptCore/runtime/Executable.h b/JavaScriptCore/runtime/Executable.h index 4a14f953..6ff27aee 100644 --- a/JavaScriptCore/runtime/Executable.h +++ b/JavaScriptCore/runtime/Executable.h @@ -36,7 +36,6 @@ #include "Interpreter.h" #include "JITCode.h" #include "JSGlobalObject.h" -#include "LLIntCLoop.h" #include "SamplingTool.h" #include "SourceCode.h" #include "UnlinkedCodeBlock.h" @@ -93,10 +92,18 @@ class ExecutableBase : public JSCell, public DoublyLinkedListNodetypeInfo().type() == EvalExecutableType; + } bool isFunctionExecutable() { return structure()->typeInfo().type() == FunctionExecutableType; } + bool isProgramExecutable() + { + return structure()->typeInfo().type() == ProgramExecutableType; + } bool isHostFunction() const { @@ -118,7 +125,6 @@ class ExecutableBase : public JSCell, public DoublyLinkedListNode generatedJITCodeForCall() { ASSERT(m_jitCodeForCall); @@ -176,7 +182,6 @@ class ExecutableBase : public JSCell, public DoublyLinkedListNodeaddressForCall(); -#else - return LLInt::CLoop::hostCodeEntryFor(kind); -#endif } MacroAssemblerCodePtr jsCodeEntryFor(CodeSpecializationKind kind) { -#if ENABLE(JIT) return generatedJITCodeFor(kind)->addressForCall(); -#else - return LLInt::CLoop::jsCodeEntryFor(kind); -#endif } MacroAssemblerCodePtr jsCodeWithArityCheckEntryFor(CodeSpecializationKind kind) { -#if ENABLE(JIT) return generatedJITCodeWithArityCheckFor(kind); -#else - return LLInt::CLoop::jsCodeEntryWithArityCheckFor(kind); -#endif - } - - static void* catchRoutineFor(HandlerInfo* handler, Instruction* catchPCForInterpreter) - { -#if ENABLE(JIT) - UNUSED_PARAM(catchPCForInterpreter); - return handler->nativeCode.executableAddress(); -#else - UNUSED_PARAM(handler); - return LLInt::CLoop::catchRoutineFor(catchPCForInterpreter); -#endif } - -#endif // ENABLE(JIT || ENABLE(LLINT_C_LOOP) protected: ExecutableBase* m_prev; @@ -263,30 +242,16 @@ class NativeExecutable : public ExecutableBase { public: typedef ExecutableBase Base; -#if ENABLE(JIT) static NativeExecutable* create(VM& vm, MacroAssemblerCodeRef callThunk, NativeFunction function, MacroAssemblerCodeRef constructThunk, NativeFunction constructor, Intrinsic intrinsic) { NativeExecutable* executable; - if (!callThunk) { - executable = new (NotNull, allocateCell(vm.heap)) NativeExecutable(vm, function, constructor); + executable = new (NotNull, allocateCell(vm.heap)) NativeExecutable(vm, function, constructor); + if (!callThunk) executable->finishCreation(vm, 0, 0, intrinsic); - } else { - executable = new (NotNull, allocateCell(vm.heap)) NativeExecutable(vm, function, constructor); + else executable->finishCreation(vm, JITCode::hostFunction(callThunk), JITCode::hostFunction(constructThunk), intrinsic); - } - return executable; - } -#endif - -#if ENABLE(LLINT_C_LOOP) - static NativeExecutable* create(VM& vm, NativeFunction function, NativeFunction constructor) - { - ASSERT(!vm.canUseJIT()); - NativeExecutable* executable = new (NotNull, allocateCell(vm.heap)) NativeExecutable(vm, function, constructor); - executable->finishCreation(vm); return executable; } -#endif #if ENABLE(JIT) static void destroy(JSCell*); @@ -320,7 +285,6 @@ class NativeExecutable : public ExecutableBase { Intrinsic intrinsic() const; protected: -#if ENABLE(JIT) void finishCreation(VM& vm, PassRefPtr callThunk, PassRefPtr constructThunk, Intrinsic intrinsic) { Base::finishCreation(vm); @@ -330,7 +294,6 @@ class NativeExecutable : public ExecutableBase { m_jitCodeForConstruct = constructThunk; m_intrinsic = intrinsic; } -#endif private: NativeExecutable(VM& vm, NativeFunction function, NativeFunction constructor) @@ -355,6 +318,8 @@ class ScriptExecutable : public ExecutableBase { , m_source(source) , m_features(isInStrictContext ? StrictModeFeature : 0) , m_neverInline(false) + , m_startColumn(UINT_MAX) + , m_endColumn(UINT_MAX) { } @@ -363,6 +328,8 @@ class ScriptExecutable : public ExecutableBase { , m_source(source) , m_features(isInStrictContext ? StrictModeFeature : 0) , m_neverInline(false) + , m_startColumn(UINT_MAX) + , m_endColumn(UINT_MAX) { } @@ -378,11 +345,13 @@ class ScriptExecutable : public ExecutableBase { int lineNo() const { return m_firstLine; } int lastLine() const { return m_lastLine; } unsigned startColumn() const { return m_startColumn; } + unsigned endColumn() const { return m_endColumn; } bool usesEval() const { return m_features & EvalFeature; } bool usesArguments() const { return m_features & ArgumentsFeature; } bool needsActivation() const { return m_hasCapturedVariables || m_features & (EvalFeature | WithFeature | CatchFeature); } bool isStrictMode() const { return m_features & StrictModeFeature; } + ECMAMode ecmaMode() const { return isStrictMode() ? StrictMode : NotStrictMode; } void setNeverInline(bool value) { m_neverInline = value; } bool neverInline() const { return m_neverInline; } @@ -394,13 +363,16 @@ class ScriptExecutable : public ExecutableBase { DECLARE_INFO; - void recordParse(CodeFeatures features, bool hasCapturedVariables, int firstLine, int lastLine, unsigned startColumn) + void recordParse(CodeFeatures features, bool hasCapturedVariables, int firstLine, int lastLine, unsigned startColumn, unsigned endColumn) { m_features = features; m_hasCapturedVariables = hasCapturedVariables; m_firstLine = firstLine; m_lastLine = lastLine; + ASSERT(startColumn != UINT_MAX); m_startColumn = startColumn; + ASSERT(endColumn != UINT_MAX); + m_endColumn = endColumn; } void installCode(CodeBlock*); @@ -436,6 +408,7 @@ class ScriptExecutable : public ExecutableBase { int m_firstLine; int m_lastLine; unsigned m_startColumn; + unsigned m_endColumn; }; class EvalExecutable : public ScriptExecutable { @@ -452,12 +425,11 @@ class EvalExecutable : public ScriptExecutable { static EvalExecutable* create(ExecState*, const SourceCode&, bool isInStrictContext); -#if ENABLE(JIT) PassRefPtr generatedJITCode() { return generatedJITCodeForCall(); } -#endif + static Structure* createStructure(VM& vm, JSGlobalObject* globalObject, JSValue proto) { return Structure::create(vm, globalObject, proto, TypeInfo(EvalExecutableType, StructureFlags), info()); @@ -509,12 +481,10 @@ class ProgramExecutable : public ScriptExecutable { JSObject* checkSyntax(ExecState*); -#if ENABLE(JIT) PassRefPtr generatedJITCode() { return generatedJITCodeForCall(); } -#endif static Structure* createStructure(VM& vm, JSGlobalObject* globalObject, JSValue proto) { @@ -548,9 +518,9 @@ class FunctionExecutable : public ScriptExecutable { public: typedef ScriptExecutable Base; - static FunctionExecutable* create(VM& vm, const SourceCode& source, UnlinkedFunctionExecutable* unlinkedExecutable, unsigned firstLine, unsigned lastLine, unsigned startColumn) + static FunctionExecutable* create(VM& vm, const SourceCode& source, UnlinkedFunctionExecutable* unlinkedExecutable, unsigned firstLine, unsigned lastLine, unsigned startColumn, unsigned endColumn, bool bodyIncludesBraces = true) { - FunctionExecutable* executable = new (NotNull, allocateCell(vm.heap)) FunctionExecutable(vm, source, unlinkedExecutable, firstLine, lastLine, startColumn); + FunctionExecutable* executable = new (NotNull, allocateCell(vm.heap)) FunctionExecutable(vm, source, unlinkedExecutable, firstLine, lastLine, startColumn, endColumn, bodyIncludesBraces); executable->finishCreation(vm); return executable; } @@ -621,7 +591,7 @@ class FunctionExecutable : public ScriptExecutable { JSString* nameValue() const { return m_unlinkedExecutable->nameValue(); } size_t parameterCount() const { return m_unlinkedExecutable->parameterCount(); } // Excluding 'this'! String paramString() const; - SharedSymbolTable* symbolTable(CodeSpecializationKind kind) const { return m_unlinkedExecutable->symbolTable(kind); } + SymbolTable* symbolTable(CodeSpecializationKind); void clearCodeIfNotCompiling(); void clearUnlinkedCodeForRecompilationIfNotCompiling(); @@ -637,8 +607,10 @@ class FunctionExecutable : public ScriptExecutable { void clearCode(); + bool bodyIncludesBraces() const { return m_bodyIncludesBraces; } + private: - FunctionExecutable(VM&, const SourceCode&, UnlinkedFunctionExecutable*, unsigned firstLine, unsigned lastLine, unsigned startColumn); + FunctionExecutable(VM&, const SourceCode&, UnlinkedFunctionExecutable*, unsigned firstLine, unsigned lastLine, unsigned startColumn, unsigned endColumn, bool bodyIncludesBraces); bool isCompiling() { @@ -657,6 +629,7 @@ class FunctionExecutable : public ScriptExecutable { WriteBarrier m_unlinkedExecutable; RefPtr m_codeBlockForCall; RefPtr m_codeBlockForConstruct; + bool m_bodyIncludesBraces; }; inline bool isHostFunction(JSValue value, NativeFunction nativeFunction) diff --git a/JavaScriptCore/runtime/FunctionConstructor.cpp b/JavaScriptCore/runtime/FunctionConstructor.cpp index ab8411b9..53de6327 100644 --- a/JavaScriptCore/runtime/FunctionConstructor.cpp +++ b/JavaScriptCore/runtime/FunctionConstructor.cpp @@ -1,6 +1,6 @@ /* * Copyright (C) 1999-2001 Harri Porten (porten@kde.org) - * Copyright (C) 2003, 2004, 2005, 2006, 2007, 2008 Apple Inc. All rights reserved. + * Copyright (C) 2003, 2004, 2005, 2006, 2007, 2008, 2013 Apple Inc. All rights reserved. * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public @@ -93,9 +93,9 @@ JSObject* constructFunctionSkippingEvalEnabledCheck(ExecState* exec, JSGlobalObj // We also need \n before the closing } to handle // comments at the end of the last line String program; if (args.isEmpty()) - program = ASCIILiteral("(function() { \n})"); + program = ASCIILiteral("(function() {\n})"); else if (args.size() == 1) - program = makeString("(function() { ", args.at(0).toString(exec)->value(exec), "\n})"); + program = makeString("(function() {", args.at(0).toString(exec)->value(exec), "\n})"); else { StringBuilder builder; builder.appendLiteral("(function("); @@ -104,7 +104,7 @@ JSObject* constructFunctionSkippingEvalEnabledCheck(ExecState* exec, JSGlobalObj builder.append(','); builder.append(args.at(i).toString(exec)->value(exec)); } - builder.appendLiteral(") { "); + builder.appendLiteral(") {"); builder.append(args.at(args.size() - 1).toString(exec)->value(exec)); builder.appendLiteral("\n})"); program = builder.toString(); @@ -112,7 +112,7 @@ JSObject* constructFunctionSkippingEvalEnabledCheck(ExecState* exec, JSGlobalObj SourceCode source = makeSource(program, sourceURL, position); JSObject* exception = 0; - FunctionExecutable* function = FunctionExecutable::fromGlobalCode(functionName, exec, exec->dynamicGlobalObject()->debugger(), source, &exception); + FunctionExecutable* function = FunctionExecutable::fromGlobalCode(functionName, exec, exec->vmEntryGlobalObject()->debugger(), source, &exception); if (!function) { ASSERT(exception); return exec->vm().throwException(exec, exception); diff --git a/JavaScriptCore/runtime/FunctionPrototype.cpp b/JavaScriptCore/runtime/FunctionPrototype.cpp index 2eb2a5cc..c1b08af2 100644 --- a/JavaScriptCore/runtime/FunctionPrototype.cpp +++ b/JavaScriptCore/runtime/FunctionPrototype.cpp @@ -85,8 +85,11 @@ CallType FunctionPrototype::getCallData(JSCell*, CallData& callData) // Functions // Compatibility hack for the Optimost JavaScript library. (See .) -static inline void insertSemicolonIfNeeded(String& functionBody) +static inline void insertSemicolonIfNeeded(String& functionBody, bool bodyIncludesBraces) { + if (!bodyIncludesBraces) + functionBody = makeString("{ ", functionBody, "}"); + ASSERT(functionBody[0] == '{'); ASSERT(functionBody[functionBody.length() - 1] == '}'); @@ -109,7 +112,7 @@ EncodedJSValue JSC_HOST_CALL functionProtoFuncToString(ExecState* exec) return JSValue::encode(jsMakeNontrivialString(exec, "function ", function->name(exec), "() {\n [native code]\n}")); FunctionExecutable* executable = function->jsExecutable(); String sourceString = executable->source().toString(); - insertSemicolonIfNeeded(sourceString); + insertSemicolonIfNeeded(sourceString, executable->bodyIncludesBraces()); return JSValue::encode(jsMakeNontrivialString(exec, "function ", function->name(exec), "(", executable->paramString(), ") ", sourceString)); } diff --git a/JavaScriptCore/runtime/GCActivityCallback.cpp b/JavaScriptCore/runtime/GCActivityCallback.cpp index c4bf7390..e1cc9886 100644 --- a/JavaScriptCore/runtime/GCActivityCallback.cpp +++ b/JavaScriptCore/runtime/GCActivityCallback.cpp @@ -95,7 +95,7 @@ void DefaultGCActivityCallback::doWork() return; } #endif - heap->collect(Heap::DoNotSweep); + heap->collect(); } #if USE(CF) diff --git a/JavaScriptCore/runtime/GCActivityCallbackBlackBerry.cpp b/JavaScriptCore/runtime/GCActivityCallbackBlackBerry.cpp deleted file mode 100644 index d7c9d53c..00000000 --- a/JavaScriptCore/runtime/GCActivityCallbackBlackBerry.cpp +++ /dev/null @@ -1,58 +0,0 @@ -/* - * Copyright (C) 2012 Research In Motion Limited. All rights reserved. - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - */ - -#include "config.h" -#include "GCActivityCallback.h" - -#include "Heap.h" -#include "VM.h" -#include - -namespace JSC { - -DefaultGCActivityCallback::DefaultGCActivityCallback(Heap* heap) - : GCActivityCallback(heap->vm()) -{ -} - -void DefaultGCActivityCallback::doWork() -{ - JSLockHolder lock(m_vm); - m_vm->heap.collect(Heap::DoNotSweep); -} - -void DefaultGCActivityCallback::didAllocate(size_t) -{ - if (m_timer.started()) - return; - - // Try using ~5% CPU time. - m_timer.start(m_vm->heap.lastGCLength() * 20); -} - -void DefaultGCActivityCallback::willCollect() -{ - cancel(); -} - -void DefaultGCActivityCallback::cancel() -{ - m_timer.stop(); -} - -} diff --git a/JavaScriptCore/runtime/Identifier.cpp b/JavaScriptCore/runtime/Identifier.cpp index e983e44e..3658d877 100644 --- a/JavaScriptCore/runtime/Identifier.cpp +++ b/JavaScriptCore/runtime/Identifier.cpp @@ -62,7 +62,7 @@ struct IdentifierASCIIStringTranslator { static void translate(StringImpl*& location, const LChar* c, unsigned hash) { size_t length = strlen(reinterpret_cast(c)); - location = StringImpl::createFromLiteral(reinterpret_cast(c), length).leakRef(); + location = &StringImpl::createFromLiteral(reinterpret_cast(c), length).leakRef(); location->setHash(hash); } }; @@ -81,10 +81,10 @@ struct IdentifierLCharFromUCharTranslator { static void translate(StringImpl*& location, const CharBuffer& buf, unsigned hash) { LChar* d; - StringImpl* r = StringImpl::createUninitialized(buf.length, d).leakRef(); + StringImpl& r = StringImpl::createUninitialized(buf.length, d).leakRef(); WTF::copyLCharsFromUCharSource(d, buf.s, buf.length); - r->setHash(hash); - location = r; + r.setHash(hash); + location = &r; } }; diff --git a/JavaScriptCore/runtime/Identifier.h b/JavaScriptCore/runtime/Identifier.h index db0498fa..0abb5272 100644 --- a/JavaScriptCore/runtime/Identifier.h +++ b/JavaScriptCore/runtime/Identifier.h @@ -169,11 +169,11 @@ namespace JSC { static void translate(StringImpl*& location, const CharBuffer& buf, unsigned hash) { T* d; - StringImpl* r = StringImpl::createUninitialized(buf.length, d).leakRef(); + StringImpl& r = StringImpl::createUninitialized(buf.length, d).leakRef(); for (unsigned i = 0; i != buf.length; i++) d[i] = buf.s[i]; - r->setHash(hash); - location = r; + r.setHash(hash); + location = &r; } }; diff --git a/JavaScriptCore/runtime/IndexingType.cpp b/JavaScriptCore/runtime/IndexingType.cpp index 404f6b3b..f7d54754 100644 --- a/JavaScriptCore/runtime/IndexingType.cpp +++ b/JavaScriptCore/runtime/IndexingType.cpp @@ -26,7 +26,6 @@ #include "config.h" #include "IndexingType.h" -#include #include namespace JSC { diff --git a/JavaScriptCore/runtime/InitializeThreading.cpp b/JavaScriptCore/runtime/InitializeThreading.cpp index dc8bddc4..1cb5e7ab 100644 --- a/JavaScriptCore/runtime/InitializeThreading.cpp +++ b/JavaScriptCore/runtime/InitializeThreading.cpp @@ -39,6 +39,7 @@ #include "JSLock.h" #include "LLIntData.h" #include "WriteBarrier.h" +#include #include #include #include @@ -47,44 +48,31 @@ using namespace WTF; namespace JSC { -#if OS(DARWIN) -static pthread_once_t initializeThreadingKeyOnce = PTHREAD_ONCE_INIT; -#endif - -static void initializeThreadingOnce() +void initializeThreading() { - WTF::double_conversion::initialize(); - WTF::initializeThreading(); - GlobalJSLock::initialize(); - Options::initialize(); - if (Options::recordGCPauseTimes()) - HeapStatistics::initialize(); + static std::once_flag initializeThreadingOnceFlag; + + std::call_once(initializeThreadingOnceFlag, []{ + WTF::double_conversion::initialize(); + WTF::initializeThreading(); + GlobalJSLock::initialize(); + Options::initialize(); + if (Options::recordGCPauseTimes()) + HeapStatistics::initialize(); #if ENABLE(WRITE_BARRIER_PROFILING) - WriteBarrierCounters::initialize(); + WriteBarrierCounters::initialize(); #endif #if ENABLE(ASSEMBLER) - ExecutableAllocator::initializeAllocator(); + ExecutableAllocator::initializeAllocator(); #endif - JSStack::initializeThreading(); + JSStack::initializeThreading(); #if ENABLE(LLINT) - LLInt::initialize(); + LLInt::initialize(); #endif #ifndef NDEBUG - DisallowGC::initialize(); -#endif -} - -void initializeThreading() -{ -#if OS(DARWIN) - pthread_once(&initializeThreadingKeyOnce, initializeThreadingOnce); -#else - static bool initializedThreading = false; - if (!initializedThreading) { - initializeThreadingOnce(); - initializedThreading = true; - } + DisallowGC::initialize(); #endif + }); } } // namespace JSC diff --git a/JavaScriptCore/runtime/Intrinsic.h b/JavaScriptCore/runtime/Intrinsic.h index cd06c7e3..1f741da1 100644 --- a/JavaScriptCore/runtime/Intrinsic.h +++ b/JavaScriptCore/runtime/Intrinsic.h @@ -34,6 +34,8 @@ enum Intrinsic { MinIntrinsic, MaxIntrinsic, SqrtIntrinsic, + SinIntrinsic, + CosIntrinsic, ArrayPushIntrinsic, ArrayPopIntrinsic, CharCodeAtIntrinsic, diff --git a/JavaScriptCore/runtime/JSActivation.cpp b/JavaScriptCore/runtime/JSActivation.cpp index a839c941..72ed1c71 100644 --- a/JavaScriptCore/runtime/JSActivation.cpp +++ b/JavaScriptCore/runtime/JSActivation.cpp @@ -210,17 +210,17 @@ JSValue JSActivation::toThis(JSCell*, ExecState* exec, ECMAMode ecmaMode) return exec->globalThisValue(); } -JSValue JSActivation::argumentsGetter(ExecState*, JSValue slotBase, PropertyName) +EncodedJSValue JSActivation::argumentsGetter(ExecState*, EncodedJSValue slotBase, EncodedJSValue, PropertyName) { - JSActivation* activation = jsCast(slotBase); + JSActivation* activation = jsCast(JSValue::decode(slotBase)); CallFrame* callFrame = CallFrame::create(reinterpret_cast(activation->m_registers)); ASSERT(!activation->isTornOff() && (callFrame->codeBlock()->usesArguments() || callFrame->codeBlock()->usesEval())); if (activation->isTornOff() || !(callFrame->codeBlock()->usesArguments() || callFrame->codeBlock()->usesEval())) - return jsUndefined(); + return JSValue::encode(jsUndefined()); VirtualRegister argumentsRegister = callFrame->codeBlock()->argumentsRegister(); if (JSValue arguments = callFrame->uncheckedR(argumentsRegister.offset()).jsValue()) - return arguments; + return JSValue::encode(arguments); int realArgumentsRegister = unmodifiedArgumentsRegister(argumentsRegister).offset(); JSValue arguments = JSValue(Arguments::create(callFrame->vm(), callFrame)); @@ -228,7 +228,7 @@ JSValue JSActivation::argumentsGetter(ExecState*, JSValue slotBase, PropertyName callFrame->uncheckedR(realArgumentsRegister) = arguments; ASSERT(callFrame->uncheckedR(realArgumentsRegister).jsValue().inherits(Arguments::info())); - return callFrame->uncheckedR(realArgumentsRegister).jsValue(); + return JSValue::encode(callFrame->uncheckedR(realArgumentsRegister).jsValue()); } } // namespace JSC diff --git a/JavaScriptCore/runtime/JSActivation.h b/JavaScriptCore/runtime/JSActivation.h index 3ee39b5d..67eafeee 100644 --- a/JavaScriptCore/runtime/JSActivation.h +++ b/JavaScriptCore/runtime/JSActivation.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008, 2009 Apple Inc. All rights reserved. + * Copyright (C) 2008, 2009, 2013 Apple Inc. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -37,171 +37,171 @@ namespace JSC { - class Register; +class Register; - class JSActivation : public JSVariableObject { - private: - JSActivation(VM&, CallFrame*, Register*, SharedSymbolTable*); +class JSActivation : public JSVariableObject { +private: + JSActivation(VM&, CallFrame*, Register*, SymbolTable*); - public: - typedef JSVariableObject Base; - - static JSActivation* create(VM& vm, CallFrame* callFrame, Register* registers, CodeBlock* codeBlock) - { - SharedSymbolTable* symbolTable = codeBlock->symbolTable(); - JSActivation* activation = new ( - NotNull, - allocateCell( - vm.heap, - allocationSize(symbolTable) - ) - ) JSActivation(vm, callFrame, registers, symbolTable); - activation->finishCreation(vm); - return activation; - } - - static JSActivation* create(VM& vm, CallFrame* callFrame, CodeBlock* codeBlock) - { - return create(vm, callFrame, callFrame->registers(), codeBlock); - } - - static void visitChildren(JSCell*, SlotVisitor&); - - static bool getOwnPropertySlot(JSObject*, ExecState*, PropertyName, PropertySlot&); - static void getOwnNonIndexPropertyNames(JSObject*, ExecState*, PropertyNameArray&, EnumerationMode); - - static void put(JSCell*, ExecState*, PropertyName, JSValue, PutPropertySlot&); - - static bool deleteProperty(JSCell*, ExecState*, PropertyName); - - static JSValue toThis(JSCell*, ExecState*, ECMAMode); - - void tearOff(VM&); - - DECLARE_INFO; - - static Structure* createStructure(VM& vm, JSGlobalObject* globalObject, JSValue proto) { return Structure::create(vm, globalObject, proto, TypeInfo(ActivationObjectType, StructureFlags), info()); } - - WriteBarrierBase& registerAt(int) const; - bool isValidIndex(int) const; - bool isValid(const SymbolTableEntry&) const; - bool isTornOff(); - int registersOffset(); - static int registersOffset(SharedSymbolTable*); - - protected: - static const unsigned StructureFlags = OverridesGetOwnPropertySlot | OverridesVisitChildren | OverridesGetPropertyNames | Base::StructureFlags; - - private: - bool symbolTableGet(PropertyName, PropertySlot&); - bool symbolTableGet(PropertyName, PropertyDescriptor&); - bool symbolTableGet(PropertyName, PropertySlot&, bool& slotIsWriteable); - bool symbolTablePut(ExecState*, PropertyName, JSValue, bool shouldThrow); - bool symbolTablePutWithAttributes(VM&, PropertyName, JSValue, unsigned attributes); - - static JSValue argumentsGetter(ExecState*, JSValue, PropertyName); - - static size_t allocationSize(SharedSymbolTable*); - static size_t storageOffset(); - - WriteBarrier* storage(); // captureCount() number of registers. - }; - - extern int activationCount; - extern int allTheThingsCount; - - inline JSActivation::JSActivation(VM& vm, CallFrame* callFrame, Register* registers, SharedSymbolTable* symbolTable) - : Base( - vm, - callFrame->lexicalGlobalObject()->activationStructure(), - registers, - callFrame->scope(), - symbolTable - ) - { - WriteBarrier* storage = this->storage(); - size_t captureCount = symbolTable->captureCount(); - for (size_t i = 0; i < captureCount; ++i) - new(&storage[i]) WriteBarrier; - } +public: + typedef JSVariableObject Base; - JSActivation* asActivation(JSValue); - - inline JSActivation* asActivation(JSValue value) - { - ASSERT(asObject(value)->inherits(JSActivation::info())); - return jsCast(asObject(value)); - } - - ALWAYS_INLINE JSActivation* Register::activation() const - { - return asActivation(jsValue()); - } - - inline int JSActivation::registersOffset(SharedSymbolTable* symbolTable) + static JSActivation* create(VM& vm, CallFrame* callFrame, Register* registers, CodeBlock* codeBlock) { - return storageOffset() + ((symbolTable->captureCount() - symbolTable->captureStart() - 1) * sizeof(WriteBarrier)); + SymbolTable* symbolTable = codeBlock->symbolTable(); + ASSERT(codeBlock->codeType() == FunctionCode); + JSActivation* activation = new ( + NotNull, + allocateCell( + vm.heap, + allocationSize(symbolTable) + ) + ) JSActivation(vm, callFrame, registers, symbolTable); + activation->finishCreation(vm); + return activation; } - - inline void JSActivation::tearOff(VM& vm) - { - ASSERT(!isTornOff()); - - WriteBarrierBase* dst = reinterpret_cast_ptr*>( - reinterpret_cast(this) + registersOffset(symbolTable())); - WriteBarrierBase* src = m_registers; - - int captureEnd = symbolTable()->captureEnd(); - for (int i = symbolTable()->captureStart(); i > captureEnd; --i) - dst[i].set(vm, this, src[i].get()); - - m_registers = dst; - ASSERT(isTornOff()); - } - - inline bool JSActivation::isTornOff() + + static JSActivation* create(VM& vm, CallFrame* callFrame, CodeBlock* codeBlock) { - return m_registers == reinterpret_cast_ptr*>( - reinterpret_cast(this) + registersOffset(symbolTable())); + return create(vm, callFrame, callFrame->registers(), codeBlock); } - inline size_t JSActivation::storageOffset() - { - return WTF::roundUpToMultipleOf)>(sizeof(JSActivation)); - } + static void visitChildren(JSCell*, SlotVisitor&); - inline WriteBarrier* JSActivation::storage() - { - return reinterpret_cast_ptr*>( - reinterpret_cast(this) + storageOffset()); - } + static bool getOwnPropertySlot(JSObject*, ExecState*, PropertyName, PropertySlot&); + static void getOwnNonIndexPropertyNames(JSObject*, ExecState*, PropertyNameArray&, EnumerationMode); - inline size_t JSActivation::allocationSize(SharedSymbolTable* symbolTable) - { - size_t objectSizeInBytes = WTF::roundUpToMultipleOf)>(sizeof(JSActivation)); - size_t storageSizeInBytes = symbolTable->captureCount() * sizeof(WriteBarrier); - return objectSizeInBytes + storageSizeInBytes; - } + static void put(JSCell*, ExecState*, PropertyName, JSValue, PutPropertySlot&); - inline bool JSActivation::isValidIndex(int index) const - { - if (index > symbolTable()->captureStart()) - return false; - if (index <= symbolTable()->captureEnd()) - return false; - return true; - } + static bool deleteProperty(JSCell*, ExecState*, PropertyName); - inline bool JSActivation::isValid(const SymbolTableEntry& entry) const - { - return isValidIndex(entry.getIndex()); - } + static JSValue toThis(JSCell*, ExecState*, ECMAMode); - inline WriteBarrierBase& JSActivation::registerAt(int index) const - { - ASSERT(isValidIndex(index)); - return Base::registerAt(index); - } + void tearOff(VM&); + + DECLARE_INFO; + + static Structure* createStructure(VM& vm, JSGlobalObject* globalObject, JSValue proto) { return Structure::create(vm, globalObject, proto, TypeInfo(ActivationObjectType, StructureFlags), info()); } + + WriteBarrierBase& registerAt(int) const; + bool isValidIndex(int) const; + bool isValid(const SymbolTableEntry&) const; + bool isTornOff(); + int registersOffset(); + static int registersOffset(SymbolTable*); + +protected: + static const unsigned StructureFlags = OverridesGetOwnPropertySlot | OverridesVisitChildren | OverridesGetPropertyNames | Base::StructureFlags; + +private: + bool symbolTableGet(PropertyName, PropertySlot&); + bool symbolTableGet(PropertyName, PropertyDescriptor&); + bool symbolTableGet(PropertyName, PropertySlot&, bool& slotIsWriteable); + bool symbolTablePut(ExecState*, PropertyName, JSValue, bool shouldThrow); + bool symbolTablePutWithAttributes(VM&, PropertyName, JSValue, unsigned attributes); + + static EncodedJSValue argumentsGetter(ExecState*, EncodedJSValue, EncodedJSValue, PropertyName); + + static size_t allocationSize(SymbolTable*); + static size_t storageOffset(); + + WriteBarrier* storage(); // captureCount() number of registers. +}; + +extern int activationCount; +extern int allTheThingsCount; + +inline JSActivation::JSActivation(VM& vm, CallFrame* callFrame, Register* registers, SymbolTable* symbolTable) + : Base( + vm, + callFrame->lexicalGlobalObject()->activationStructure(), + registers, + callFrame->scope(), + symbolTable) +{ + WriteBarrier* storage = this->storage(); + size_t captureCount = symbolTable->captureCount(); + for (size_t i = 0; i < captureCount; ++i) + new (NotNull, &storage[i]) WriteBarrier; +} + +JSActivation* asActivation(JSValue); + +inline JSActivation* asActivation(JSValue value) +{ + ASSERT(asObject(value)->inherits(JSActivation::info())); + return jsCast(asObject(value)); +} + +ALWAYS_INLINE JSActivation* Register::activation() const +{ + return asActivation(jsValue()); +} + +inline int JSActivation::registersOffset(SymbolTable* symbolTable) +{ + return storageOffset() + ((symbolTable->captureCount() - symbolTable->captureStart() - 1) * sizeof(WriteBarrier)); +} + +inline void JSActivation::tearOff(VM& vm) +{ + ASSERT(!isTornOff()); + + WriteBarrierBase* dst = reinterpret_cast_ptr*>( + reinterpret_cast(this) + registersOffset(symbolTable())); + WriteBarrierBase* src = m_registers; + + int captureEnd = symbolTable()->captureEnd(); + for (int i = symbolTable()->captureStart(); i > captureEnd; --i) + dst[i].set(vm, this, src[i].get()); + + m_registers = dst; + ASSERT(isTornOff()); +} + +inline bool JSActivation::isTornOff() +{ + return m_registers == reinterpret_cast_ptr*>( + reinterpret_cast(this) + registersOffset(symbolTable())); +} + +inline size_t JSActivation::storageOffset() +{ + return WTF::roundUpToMultipleOf)>(sizeof(JSActivation)); +} + +inline WriteBarrier* JSActivation::storage() +{ + return reinterpret_cast_ptr*>( + reinterpret_cast(this) + storageOffset()); +} + +inline size_t JSActivation::allocationSize(SymbolTable* symbolTable) +{ + size_t objectSizeInBytes = WTF::roundUpToMultipleOf)>(sizeof(JSActivation)); + size_t storageSizeInBytes = symbolTable->captureCount() * sizeof(WriteBarrier); + return objectSizeInBytes + storageSizeInBytes; +} + +inline bool JSActivation::isValidIndex(int index) const +{ + if (index > symbolTable()->captureStart()) + return false; + if (index <= symbolTable()->captureEnd()) + return false; + return true; +} + +inline bool JSActivation::isValid(const SymbolTableEntry& entry) const +{ + return isValidIndex(entry.getIndex()); +} + +inline WriteBarrierBase& JSActivation::registerAt(int index) const +{ + ASSERT(isValidIndex(index)); + return Base::registerAt(index); +} } // namespace JSC diff --git a/JavaScriptCore/runtime/JSArgumentsIterator.cpp b/JavaScriptCore/runtime/JSArgumentsIterator.cpp new file mode 100644 index 00000000..2fcf8815 --- /dev/null +++ b/JavaScriptCore/runtime/JSArgumentsIterator.cpp @@ -0,0 +1,41 @@ +/* + * Copyright (C) 2013 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 "JSArgumentsIterator.h" + +#include "Arguments.h" + +namespace JSC { + +const ClassInfo JSArgumentsIterator::s_info = { "ArgumentsIterator", &Base::s_info, 0, 0, CREATE_METHOD_TABLE(JSArgumentsIterator) }; + +void JSArgumentsIterator::finishCreation(VM& vm, Arguments* arguments) +{ + Base::finishCreation(vm); + m_arguments.set(vm, this, arguments); +} + +} diff --git a/JavaScriptCore/runtime/JSArgumentsIterator.h b/JavaScriptCore/runtime/JSArgumentsIterator.h new file mode 100644 index 00000000..0eed745c --- /dev/null +++ b/JavaScriptCore/runtime/JSArgumentsIterator.h @@ -0,0 +1,79 @@ +/* + * Copyright (C) 2013 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. + */ + +#ifndef JSArgumentsIterator_h +#define JSArgumentsIterator_h + +#include "Arguments.h" + +namespace JSC { + +class JSArgumentsIterator : public JSNonFinalObject { +public: + typedef JSNonFinalObject Base; + + DECLARE_EXPORT_INFO; + + static Structure* createStructure(VM& vm, JSGlobalObject* globalObject, JSValue prototype) + { + return Structure::create(vm, globalObject, prototype, TypeInfo(ObjectType, StructureFlags), info()); + } + + static JSArgumentsIterator* create(VM& vm, Structure* structure, Arguments* arguments) + { + JSArgumentsIterator* instance = new (NotNull, allocateCell(vm.heap)) JSArgumentsIterator(vm, structure); + instance->finishCreation(vm, arguments); + return instance; + } + + bool next(CallFrame* callFrame, JSValue& value) + { + if (m_nextIndex >= m_arguments->length(callFrame)) + return false; + value = m_arguments->tryGetArgument(m_nextIndex++); + if (!value) + value = jsUndefined(); + return true; + } + +private: + + static const unsigned StructureFlags = Base::StructureFlags; + + JSArgumentsIterator(VM& vm, Structure* structure) + : Base(vm, structure) + , m_nextIndex(0) + { + } + + void finishCreation(VM&, Arguments*); + + WriteBarrier m_arguments; + size_t m_nextIndex; +}; + +} + +#endif // !defined(JSArgumentsIterator_h) diff --git a/JavaScriptCore/runtime/JSArray.cpp b/JavaScriptCore/runtime/JSArray.cpp index a1c72f87..cb728cfb 100644 --- a/JavaScriptCore/runtime/JSArray.cpp +++ b/JavaScriptCore/runtime/JSArray.cpp @@ -1,6 +1,6 @@ /* * Copyright (C) 1999-2000 Harri Porten (porten@kde.org) - * Copyright (C) 2003, 2007, 2008, 2009, 2012 Apple Inc. All rights reserved. + * Copyright (C) 2003, 2007, 2008, 2009, 2012, 2013 Apple Inc. All rights reserved. * Copyright (C) 2003 Peter Kelly (pmk@post.com) * Copyright (C) 2006 Alexey Proskuryakov (ap@nypop.com) * @@ -321,8 +321,7 @@ bool JSArray::unshiftCountSlowCase(VM& vm, bool addToFront, unsigned count) newButterfly->arrayStorage()->setVectorLength(newVectorLength); newButterfly->arrayStorage()->m_indexBias = newIndexBias; - - m_butterfly = newButterfly; + setButterflyWithoutChangingStructure(vm, newButterfly); return true; } @@ -720,7 +719,7 @@ bool JSArray::shiftCountWithArrayStorage(unsigned startIndex, unsigned count, Ar // Adjust the Butterfly and the index bias. We only need to do this here because we're changing // the start of the Butterfly, which needs to point at the first indexed property in the used // portion of the vector. - m_butterfly = m_butterfly->shift(structure(), count); + m_butterfly.setWithoutWriteBarrier(m_butterfly->shift(structure(), count)); storage = m_butterfly->arrayStorage(); storage->m_indexBias += count; @@ -857,10 +856,11 @@ bool JSArray::unshiftCountWithArrayStorage(ExecState* exec, unsigned startIndex, unsigned vectorLength = storage->vectorLength(); if (moveFront && storage->m_indexBias >= count) { - m_butterfly = storage->butterfly()->unshift(structure(), count); - storage = m_butterfly->arrayStorage(); + Butterfly* newButterfly = storage->butterfly()->unshift(structure(), count); + storage = newButterfly->arrayStorage(); storage->m_indexBias -= count; storage->setVectorLength(vectorLength + count); + setButterflyWithoutChangingStructure(exec->vm(), newButterfly); } else if (!moveFront && vectorLength - length >= count) storage = storage->butterfly()->arrayStorage(); else if (unshiftCountSlowCase(exec->vm(), moveFront, count)) @@ -1320,7 +1320,7 @@ struct AVLTreeAbstractorForArrayCompare { m_cachedCall->setThis(jsUndefined()); m_cachedCall->setArgument(0, va); m_cachedCall->setArgument(1, vb); - compareResult = m_cachedCall->call().toNumber(m_cachedCall->newCallFrame(m_exec)); + compareResult = m_cachedCall->call().toNumber(m_exec); } else { MarkedArgumentBuffer arguments; arguments.append(va); diff --git a/JavaScriptCore/runtime/JSArrayBufferConstructor.cpp b/JavaScriptCore/runtime/JSArrayBufferConstructor.cpp index fdeb9ea9..ca7e030e 100644 --- a/JavaScriptCore/runtime/JSArrayBufferConstructor.cpp +++ b/JavaScriptCore/runtime/JSArrayBufferConstructor.cpp @@ -35,6 +35,8 @@ namespace JSC { +static EncodedJSValue JSC_HOST_CALL arrayBufferFuncIsView(ExecState*); + const ClassInfo JSArrayBufferConstructor::s_info = { "Function", &Base::s_info, 0, 0, CREATE_METHOD_TABLE(JSArrayBufferConstructor) @@ -50,6 +52,9 @@ void JSArrayBufferConstructor::finishCreation(VM& vm, JSArrayBufferPrototype* pr Base::finishCreation(vm, "ArrayBuffer"); putDirectWithoutTransition(vm, vm.propertyNames->prototype, prototype, DontEnum | DontDelete | ReadOnly); putDirectWithoutTransition(vm, vm.propertyNames->length, jsNumber(1), DontEnum | DontDelete | ReadOnly); + + JSGlobalObject* globalObject = this->globalObject(); + JSC_NATIVE_FUNCTION(vm.propertyNames->isView, arrayBufferFuncIsView, DontEnum, 1); } JSArrayBufferConstructor* JSArrayBufferConstructor::create(VM& vm, Structure* structure, JSArrayBufferPrototype* prototype) @@ -108,5 +113,14 @@ CallType JSArrayBufferConstructor::getCallData(JSCell*, CallData& callData) return CallTypeHost; } +// ------------------------------ Functions -------------------------------- + +// ECMA 24.1.3.1 +EncodedJSValue JSC_HOST_CALL arrayBufferFuncIsView(ExecState* exec) +{ + return JSValue::encode(jsBoolean(jsDynamicCast(exec->argument(0)))); +} + + } // namespace JSC diff --git a/JavaScriptCore/runtime/JSArrayBufferView.cpp b/JavaScriptCore/runtime/JSArrayBufferView.cpp index ccd166a3..c9812688 100644 --- a/JavaScriptCore/runtime/JSArrayBufferView.cpp +++ b/JavaScriptCore/runtime/JSArrayBufferView.cpp @@ -45,9 +45,10 @@ JSArrayBufferView::ConstructionContext::ConstructionContext( { if (length <= fastSizeLimit) { // Attempt GC allocation. - void* temp; + void* temp = 0; size_t size = sizeOf(length, elementSize); - if (!vm.heap.tryAllocateStorage(0, size, &temp)) + // CopiedSpace only allows non-zero size allocations. + if (size && !vm.heap.tryAllocateStorage(0, size, &temp)) return; m_structure = structure; diff --git a/JavaScriptCore/runtime/JSArrayIterator.cpp b/JavaScriptCore/runtime/JSArrayIterator.cpp index c1bf5b31..d506c4eb 100644 --- a/JavaScriptCore/runtime/JSArrayIterator.cpp +++ b/JavaScriptCore/runtime/JSArrayIterator.cpp @@ -73,7 +73,6 @@ void JSArrayIterator::visitChildren(JSCell* cell, SlotVisitor& visitor) static EncodedJSValue createIteratorResult(CallFrame* callFrame, ArrayIterationKind kind, size_t index, JSValue result, bool done) { - callFrame->setArgument(callFrame->argumentCount() - 1, jsBoolean(done)); if (done) return JSValue::encode(callFrame->vm().iterationTerminator.get()); @@ -101,8 +100,10 @@ static EncodedJSValue createIteratorResult(CallFrame* callFrame, ArrayIterationK static inline EncodedJSValue JSC_HOST_CALL arrayIteratorNext(CallFrame* callFrame) { JSArrayIterator* iterator = jsDynamicCast(callFrame->thisValue()); - if (!iterator) - throwTypeError(callFrame, ASCIILiteral("Cannot call ArrayIterator.next() on a non-ArrayIterator object")); + if (!iterator) { + ASSERT_NOT_REACHED(); + return JSValue::encode(throwTypeError(callFrame, ASCIILiteral("Cannot call ArrayIterator.next() on a non-ArrayIterator object"))); + } JSObject* iteratedObject = iterator->iteratedObject(); size_t index = iterator->nextIndex(); ArrayIterationKind kind = iterator->iterationKind(); diff --git a/JavaScriptCore/runtime/JSCJSValue.cpp b/JavaScriptCore/runtime/JSCJSValue.cpp index 5f8ad763..cca6888b 100644 --- a/JavaScriptCore/runtime/JSCJSValue.cpp +++ b/JavaScriptCore/runtime/JSCJSValue.cpp @@ -172,7 +172,7 @@ void JSValue::putToPrimitive(ExecState* exec, PropertyName propertyName, JSValue void JSValue::putToPrimitiveByIndex(ExecState* exec, unsigned propertyName, JSValue value, bool shouldThrow) { if (propertyName > MAX_ARRAY_INDEX) { - PutPropertySlot slot(shouldThrow); + PutPropertySlot slot(*this, shouldThrow); putToPrimitive(exec, Identifier::from(exec, propertyName), value, slot); return; } diff --git a/JavaScriptCore/runtime/JSCell.cpp b/JavaScriptCore/runtime/JSCell.cpp index c283f091..f472a967 100644 --- a/JavaScriptCore/runtime/JSCell.cpp +++ b/JavaScriptCore/runtime/JSCell.cpp @@ -96,7 +96,7 @@ void JSCell::put(JSCell* cell, ExecState* exec, PropertyName identifier, JSValue void JSCell::putByIndex(JSCell* cell, ExecState* exec, unsigned identifier, JSValue value, bool shouldThrow) { if (cell->isString()) { - PutPropertySlot slot(shouldThrow); + PutPropertySlot slot(cell, shouldThrow); JSValue(cell).putToPrimitive(exec, Identifier::from(exec, identifier), value, slot); return; } diff --git a/JavaScriptCore/runtime/JSCell.h b/JavaScriptCore/runtime/JSCell.h index 90f0a940..de85a4bd 100644 --- a/JavaScriptCore/runtime/JSCell.h +++ b/JavaScriptCore/runtime/JSCell.h @@ -146,7 +146,7 @@ class JSCell { } #if ENABLE(GC_VALIDATION) - Structure* unvalidatedStructure() { return m_structure.unvalidatedGet(); } + Structure* unvalidatedStructure() const { return m_structure.unvalidatedGet(); } #endif static const TypedArrayType TypedArrayStorageType = NotTypedArray; diff --git a/JavaScriptCore/runtime/JSCellInlines.h b/JavaScriptCore/runtime/JSCellInlines.h index 139b8622..f7c84464 100644 --- a/JavaScriptCore/runtime/JSCellInlines.h +++ b/JavaScriptCore/runtime/JSCellInlines.h @@ -88,10 +88,6 @@ void* allocateCell(Heap& heap, size_t size) { ASSERT(!DisallowGC::isGCDisallowedOnCurrentThread()); ASSERT(size >= sizeof(T)); -#if ENABLE(GC_VALIDATION) - ASSERT(!heap.vm()->isInitializingObject()); - heap.vm()->setInitializingObjectClass(T::info()); -#endif JSCell* result = 0; if (T::needsDestruction && T::hasImmortalStructure) result = static_cast(heap.allocateWithImmortalStructureDestructor(size)); @@ -99,6 +95,10 @@ void* allocateCell(Heap& heap, size_t size) result = static_cast(heap.allocateWithNormalDestructor(size)); else result = static_cast(heap.allocateWithoutDestructor(size)); +#if ENABLE(GC_VALIDATION) + ASSERT(!heap.vm()->isInitializingObject()); + heap.vm()->setInitializingObjectClass(T::info()); +#endif result->clearStructure(); return result; } diff --git a/JavaScriptCore/runtime/JSFunction.cpp b/JavaScriptCore/runtime/JSFunction.cpp index 27059578..24196461 100644 --- a/JavaScriptCore/runtime/JSFunction.cpp +++ b/JavaScriptCore/runtime/JSFunction.cpp @@ -96,7 +96,7 @@ JSFunction::JSFunction(VM& vm, JSGlobalObject* globalObject, Structure* structur // was clobbered exactly once, but that seems like overkill. In almost all cases it will be // clobbered once, and if it's clobbered more than once, that will probably only occur // before we started optimizing, anyway. - , m_allocationProfileWatchpoint(InitializedBlind) + , m_allocationProfileWatchpoint(ClearWatchpoint) { } @@ -212,12 +212,12 @@ static JSValue retrieveArguments(ExecState* exec, JSFunction* functionObj) return functor.result(); } -JSValue JSFunction::argumentsGetter(ExecState* exec, JSValue slotBase, PropertyName) +EncodedJSValue JSFunction::argumentsGetter(ExecState* exec, EncodedJSValue slotBase, EncodedJSValue, PropertyName) { - JSFunction* thisObj = jsCast(slotBase); + JSFunction* thisObj = jsCast(JSValue::decode(slotBase)); ASSERT(!thisObj->isHostFunction()); - return retrieveArguments(exec, thisObj); + return JSValue::encode(retrieveArguments(exec, thisObj)); } class RetrieveCallerFunctionFunctor { @@ -267,33 +267,33 @@ static JSValue retrieveCallerFunction(ExecState* exec, JSFunction* functionObj) return functor.result(); } -JSValue JSFunction::callerGetter(ExecState* exec, JSValue slotBase, PropertyName) +EncodedJSValue JSFunction::callerGetter(ExecState* exec, EncodedJSValue slotBase, EncodedJSValue, PropertyName) { - JSFunction* thisObj = jsCast(slotBase); + JSFunction* thisObj = jsCast(JSValue::decode(slotBase)); ASSERT(!thisObj->isHostFunction()); JSValue caller = retrieveCallerFunction(exec, thisObj); // See ES5.1 15.3.5.4 - Function.caller may not be used to retrieve a strict caller. if (!caller.isObject() || !asObject(caller)->inherits(JSFunction::info())) - return caller; + return JSValue::encode(caller); JSFunction* function = jsCast(caller); if (function->isHostFunction() || !function->jsExecutable()->isStrictMode()) - return caller; - return throwTypeError(exec, ASCIILiteral("Function.caller used to retrieve strict caller")); + return JSValue::encode(caller); + return JSValue::encode(throwTypeError(exec, ASCIILiteral("Function.caller used to retrieve strict caller"))); } -JSValue JSFunction::lengthGetter(ExecState*, JSValue slotBase, PropertyName) +EncodedJSValue JSFunction::lengthGetter(ExecState*, EncodedJSValue slotBase, EncodedJSValue, PropertyName) { - JSFunction* thisObj = jsCast(slotBase); + JSFunction* thisObj = jsCast(JSValue::decode(slotBase)); ASSERT(!thisObj->isHostFunction()); - return jsNumber(thisObj->jsExecutable()->parameterCount()); + return JSValue::encode(jsNumber(thisObj->jsExecutable()->parameterCount())); } -JSValue JSFunction::nameGetter(ExecState*, JSValue slotBase, PropertyName) +EncodedJSValue JSFunction::nameGetter(ExecState*, EncodedJSValue slotBase, EncodedJSValue, PropertyName) { - JSFunction* thisObj = jsCast(slotBase); + JSFunction* thisObj = jsCast(JSValue::decode(slotBase)); ASSERT(!thisObj->isHostFunction()); - return thisObj->jsExecutable()->nameValue(); + return JSValue::encode(thisObj->jsExecutable()->nameValue()); } bool JSFunction::getOwnPropertySlot(JSObject* object, ExecState* exec, PropertyName propertyName, PropertySlot& slot) @@ -387,9 +387,9 @@ void JSFunction::put(JSCell* cell, ExecState* exec, PropertyName propertyName, J PropertySlot slot(thisObject); thisObject->methodTable()->getOwnPropertySlot(thisObject, exec, propertyName, slot); thisObject->m_allocationProfile.clear(); - thisObject->m_allocationProfileWatchpoint.notifyWrite(); + thisObject->m_allocationProfileWatchpoint.fireAll(); // Don't allow this to be cached, since a [[Put]] must clear m_allocationProfile. - PutPropertySlot dontCache; + PutPropertySlot dontCache(thisObject); Base::put(thisObject, exec, propertyName, value, dontCache); return; } @@ -434,7 +434,7 @@ bool JSFunction::defineOwnProperty(JSObject* object, ExecState* exec, PropertyNa PropertySlot slot(thisObject); thisObject->methodTable()->getOwnPropertySlot(thisObject, exec, propertyName, slot); thisObject->m_allocationProfile.clear(); - thisObject->m_allocationProfileWatchpoint.notifyWrite(); + thisObject->m_allocationProfileWatchpoint.fireAll(); return Base::defineOwnProperty(object, exec, propertyName, descriptor, throwException); } diff --git a/JavaScriptCore/runtime/JSFunction.h b/JavaScriptCore/runtime/JSFunction.h index 4b28174b..7cd14b8c 100644 --- a/JavaScriptCore/runtime/JSFunction.h +++ b/JavaScriptCore/runtime/JSFunction.h @@ -137,22 +137,9 @@ namespace JSC { return createAllocationProfile(exec, inlineCapacity); return &m_allocationProfile; } - - ObjectAllocationProfile* tryGetAllocationProfile() - { - if (m_allocationProfile.isNull()) - return 0; - if (m_allocationProfileWatchpoint.hasBeenInvalidated()) - return 0; - return &m_allocationProfile; - } - - void addAllocationProfileWatchpoint(Watchpoint* watchpoint) - { - ASSERT(tryGetAllocationProfile()); - m_allocationProfileWatchpoint.add(watchpoint); - } + Structure* allocationStructure() { return m_allocationProfile.structure(); } + InlineWatchpointSet& allocationProfileWatchpointSet() { return m_allocationProfileWatchpoint; @@ -184,10 +171,10 @@ namespace JSC { JS_EXPORT_PRIVATE bool isHostFunctionNonInline() const; - static JSValue argumentsGetter(ExecState*, JSValue, PropertyName); - static JSValue callerGetter(ExecState*, JSValue, PropertyName); - static JSValue lengthGetter(ExecState*, JSValue, PropertyName); - static JSValue nameGetter(ExecState*, JSValue, PropertyName); + static EncodedJSValue argumentsGetter(ExecState*, EncodedJSValue, EncodedJSValue, PropertyName); + static EncodedJSValue callerGetter(ExecState*, EncodedJSValue, EncodedJSValue, PropertyName); + static EncodedJSValue lengthGetter(ExecState*, EncodedJSValue, EncodedJSValue, PropertyName); + static EncodedJSValue nameGetter(ExecState*, EncodedJSValue, EncodedJSValue, PropertyName); WriteBarrier m_executable; WriteBarrier m_scope; diff --git a/JavaScriptCore/runtime/JSFunctionInlines.h b/JavaScriptCore/runtime/JSFunctionInlines.h index 4f89acd7..fe4e114a 100644 --- a/JavaScriptCore/runtime/JSFunctionInlines.h +++ b/JavaScriptCore/runtime/JSFunctionInlines.h @@ -35,7 +35,7 @@ inline JSFunction::JSFunction(VM& vm, FunctionExecutable* executable, JSScope* s : Base(vm, scope->globalObject()->functionStructure()) , m_executable(vm, this, executable) , m_scope(vm, this, scope) - , m_allocationProfileWatchpoint(InitializedBlind) // See comment in JSFunction.cpp concerning the reason for using InitializedBlind as opposed to InitializedWatching. + , m_allocationProfileWatchpoint(ClearWatchpoint) // See comment in JSFunction.cpp concerning the reason for using ClearWatchpoint as opposed to IsWatched. { } diff --git a/JavaScriptCore/runtime/JSGenericTypedArrayViewConstructorInlines.h b/JavaScriptCore/runtime/JSGenericTypedArrayViewConstructorInlines.h index 870395a6..2ddc29f7 100644 --- a/JavaScriptCore/runtime/JSGenericTypedArrayViewConstructorInlines.h +++ b/JavaScriptCore/runtime/JSGenericTypedArrayViewConstructorInlines.h @@ -157,7 +157,7 @@ template CallType JSGenericTypedArrayViewConstructor::getCallData(JSCell*, CallData& callData) { callData.native.function = constructGenericTypedArrayView; - return CallTypeHost; + return CallTypeNone; } } // namespace JSC diff --git a/JavaScriptCore/runtime/JSGenericTypedArrayViewInlines.h b/JavaScriptCore/runtime/JSGenericTypedArrayViewInlines.h index 08c79617..6db86274 100644 --- a/JavaScriptCore/runtime/JSGenericTypedArrayViewInlines.h +++ b/JavaScriptCore/runtime/JSGenericTypedArrayViewInlines.h @@ -383,7 +383,7 @@ void JSGenericTypedArrayView::putByIndex( JSGenericTypedArrayView* thisObject = jsCast(cell); if (propertyName > MAX_ARRAY_INDEX) { - PutPropertySlot slot(shouldThrow); + PutPropertySlot slot(JSValue(thisObject), shouldThrow); thisObject->methodTable()->put( thisObject, exec, Identifier::from(exec, propertyName), value, slot); return; @@ -441,12 +441,13 @@ void JSGenericTypedArrayView::visitChildren(JSCell* cell, SlotVisitor& switch (thisObject->m_mode) { case FastTypedArray: { - visitor.copyLater(thisObject, TypedArrayVectorCopyToken, thisObject->m_vector, thisObject->byteSize()); + if (thisObject->m_vector) + visitor.copyLater(thisObject, TypedArrayVectorCopyToken, thisObject->m_vector, thisObject->byteSize()); break; } case OversizeTypedArray: { - visitor.reportExtraMemoryUsage(thisObject->byteSize()); + visitor.reportExtraMemoryUsage(thisObject, thisObject->byteSize()); break; } @@ -469,6 +470,7 @@ void JSGenericTypedArrayView::copyBackingStore( if (token == TypedArrayVectorCopyToken && visitor.checkIfShouldCopy(thisObject->m_vector)) { + ASSERT(thisObject->m_vector); void* oldVector = thisObject->m_vector; void* newVector = visitor.allocateNewSpace(thisObject->byteSize()); memcpy(newVector, oldVector, thisObject->byteSize()); @@ -504,14 +506,16 @@ ArrayBuffer* JSGenericTypedArrayView::slowDownAndWasteMemory(JSArrayBuf size_t size = thisObject->byteSize(); if (thisObject->m_mode == FastTypedArray - && !thisObject->m_butterfly && size >= sizeof(IndexingHeader)) { + && !thisObject->butterfly() && size >= sizeof(IndexingHeader)) { + ASSERT(thisObject->m_vector); // Reuse already allocated memory if at all possible. - thisObject->m_butterfly = - static_cast(thisObject->m_vector)->butterfly(); + thisObject->m_butterfly.setWithoutWriteBarrier( + static_cast(thisObject->m_vector)->butterfly()); } else { - thisObject->m_butterfly = Butterfly::createOrGrowArrayRight( - thisObject->m_butterfly, *heap->vm(), thisObject, thisObject->structure(), - thisObject->structure()->outOfLineCapacity(), false, 0, 0); + VM& vm = *heap->vm(); + thisObject->m_butterfly.set(vm, thisObject, Butterfly::createOrGrowArrayRight( + thisObject->butterfly(), vm, thisObject, thisObject->structure(), + thisObject->structure()->outOfLineCapacity(), false, 0, 0)); } RefPtr buffer; diff --git a/JavaScriptCore/runtime/JSGlobalObject.cpp b/JavaScriptCore/runtime/JSGlobalObject.cpp index 9cb326de..e2dec0e0 100644 --- a/JavaScriptCore/runtime/JSGlobalObject.cpp +++ b/JavaScriptCore/runtime/JSGlobalObject.cpp @@ -31,6 +31,8 @@ #include "JSGlobalObject.h" #include "Arguments.h" +#include "ArgumentsIteratorConstructor.h" +#include "ArgumentsIteratorPrototype.h" #include "ArrayConstructor.h" #include "ArrayIteratorConstructor.h" #include "ArrayIteratorPrototype.h" @@ -52,6 +54,7 @@ #include "Interpreter.h" #include "JSAPIWrapperObject.h" #include "JSActivation.h" +#include "JSArgumentsIterator.h" #include "JSArrayBuffer.h" #include "JSArrayBufferConstructor.h" #include "JSArrayBufferPrototype.h" @@ -69,9 +72,11 @@ #include "JSGlobalObjectFunctions.h" #include "JSLock.h" #include "JSMap.h" +#include "JSMapIterator.h" #include "JSNameScope.h" #include "JSONObject.h" #include "JSSet.h" +#include "JSSetIterator.h" #include "JSTypedArrayConstructors.h" #include "JSTypedArrayPrototypes.h" #include "JSTypedArrays.h" @@ -80,8 +85,11 @@ #include "LegacyProfiler.h" #include "Lookup.h" #include "MapConstructor.h" +#include "MapIteratorConstructor.h" +#include "MapIteratorPrototype.h" #include "MapPrototype.h" #include "MathObject.h" +#include "Microtask.h" #include "NameConstructor.h" #include "NameInstance.h" #include "NamePrototype.h" @@ -99,6 +107,8 @@ #include "RegExpObject.h" #include "RegExpPrototype.h" #include "SetConstructor.h" +#include "SetIteratorConstructor.h" +#include "SetIteratorPrototype.h" #include "SetPrototype.h" #include "StrictEvalActivation.h" #include "StringConstructor.h" @@ -108,14 +118,15 @@ #if ENABLE(PROMISES) #include "JSPromise.h" -#include "JSPromiseCallback.h" #include "JSPromiseConstructor.h" #include "JSPromisePrototype.h" -#include "JSPromiseResolver.h" -#include "JSPromiseResolverConstructor.h" -#include "JSPromiseResolverPrototype.h" #endif // ENABLE(PROMISES) +#if ENABLE(REMOTE_INSPECTOR) +#include "JSGlobalObjectDebuggable.h" +#include "RemoteInspector.h" +#endif + #include "JSGlobalObject.lut.h" namespace JSC { @@ -141,9 +152,9 @@ const GlobalObjectMethodTable JSGlobalObject::s_globalObjectMethodTable = { &all JSGlobalObject::JSGlobalObject(VM& vm, Structure* structure, const GlobalObjectMethodTable* globalObjectMethodTable) : Base(vm, structure, 0) - , m_masqueradesAsUndefinedWatchpoint(adoptRef(new WatchpointSet(InitializedWatching))) - , m_havingABadTimeWatchpoint(adoptRef(new WatchpointSet(InitializedWatching))) - , m_varInjectionWatchpoint(adoptRef(new WatchpointSet(InitializedWatching))) + , m_masqueradesAsUndefinedWatchpoint(adoptRef(new WatchpointSet(IsWatched))) + , m_havingABadTimeWatchpoint(adoptRef(new WatchpointSet(IsWatched))) + , m_varInjectionWatchpoint(adoptRef(new WatchpointSet(IsWatched))) , m_weakRandom(Options::forceWeakRandomSeed() ? Options::forcedWeakRandomSeed() : static_cast(randomNumber() * (std::numeric_limits::max() + 1.0))) , m_evalEnabled(true) , m_globalObjectMethodTable(globalObjectMethodTable ? globalObjectMethodTable : &s_globalObjectMethodTable) @@ -178,6 +189,12 @@ void JSGlobalObject::init(JSObject* thisValue) m_debugger = 0; +#if ENABLE(REMOTE_INSPECTOR) + m_inspectorDebuggable = std::make_unique(*this); + m_inspectorDebuggable->init(); + m_inspectorDebuggable->setRemoteDebuggingAllowed(true); +#endif + reset(prototype()); } @@ -201,21 +218,31 @@ bool JSGlobalObject::defineOwnProperty(JSObject* object, ExecState* exec, Proper return Base::defineOwnProperty(thisObject, exec, propertyName, descriptor, shouldThrow); } -int JSGlobalObject::addGlobalVar(const Identifier& ident, ConstantMode constantMode, FunctionMode functionMode) +JSGlobalObject::NewGlobalVar JSGlobalObject::addGlobalVar(const Identifier& ident, ConstantMode constantMode) { ConcurrentJITLocker locker(symbolTable()->m_lock); int index = symbolTable()->size(locker); SymbolTableEntry newEntry(index, (constantMode == IsConstant) ? ReadOnly : 0); - if (functionMode == IsFunctionToSpecialize) - newEntry.attemptToWatch(); + if (constantMode == IsVariable) + newEntry.prepareToWatch(); SymbolTable::Map::AddResult result = symbolTable()->add(locker, ident.impl(), newEntry); if (result.isNewEntry) addRegisters(1); - else { - result.iterator->value.notifyWrite(); + else index = result.iterator->value.getIndex(); - } - return index; + NewGlobalVar var; + var.registerNumber = index; + var.set = result.iterator->value.watchpointSet(); + return var; +} + +void JSGlobalObject::addFunction(ExecState* exec, const Identifier& propertyName, JSValue value) +{ + removeDirect(exec->vm(), propertyName); // Newly declared functions overwrite existing properties. + NewGlobalVar var = addGlobalVar(propertyName, IsVariable); + registerAt(var.registerNumber).set(exec->vm(), this, value); + if (var.set) + var.set->notifyWrite(value); } static inline JSObject* lastInPrototypeChain(JSObject* object) @@ -307,11 +334,6 @@ void JSGlobalObject::reset(JSValue prototype) #if ENABLE(PROMISES) m_promisePrototype.set(vm, this, JSPromisePrototype::create(exec, this, JSPromisePrototype::createStructure(vm, this, m_objectPrototype.get()))); m_promiseStructure.set(vm, this, JSPromise::createStructure(vm, this, m_promisePrototype.get())); - - m_promiseResolverPrototype.set(vm, this, JSPromiseResolverPrototype::create(exec, this, JSPromiseResolverPrototype::createStructure(vm, this, m_objectPrototype.get()))); - m_promiseResolverStructure.set(vm, this, JSPromiseResolver::createStructure(vm, this, m_promiseResolverPrototype.get())); - m_promiseCallbackStructure.set(vm, this, JSPromiseCallback::createStructure(vm, this, m_functionPrototype.get())); - m_promiseWrapperCallbackStructure.set(vm, this, JSPromiseWrapperCallback::createStructure(vm, this, m_functionPrototype.get())); #endif // ENABLE(PROMISES) #define CREATE_PROTOTYPE_FOR_SIMPLE_TYPE(capitalName, lowerName, properName, instanceType, jsName) \ @@ -328,11 +350,6 @@ void JSGlobalObject::reset(JSValue prototype) JSCell* functionConstructor = FunctionConstructor::create(vm, FunctionConstructor::createStructure(vm, this, m_functionPrototype.get()), m_functionPrototype.get()); JSCell* arrayConstructor = ArrayConstructor::create(vm, ArrayConstructor::createStructure(vm, this, m_functionPrototype.get()), m_arrayPrototype.get()); -#if ENABLE(PROMISES) - JSCell* promiseConstructor = JSPromiseConstructor::create(vm, JSPromiseConstructor::createStructure(vm, this, m_functionPrototype.get()), m_promisePrototype.get()); - JSCell* promiseResolverConstructor = JSPromiseResolverConstructor::create(vm, JSPromiseResolverConstructor::createStructure(vm, this, m_functionPrototype.get()), m_promiseResolverPrototype.get()); -#endif // ENABLE(PROMISES) - m_regExpConstructor.set(vm, this, RegExpConstructor::create(vm, RegExpConstructor::createStructure(vm, this, m_functionPrototype.get()), m_regExpPrototype.get())); #define CREATE_CONSTRUCTOR_FOR_SIMPLE_TYPE(capitalName, lowerName, properName, instanceType, jsName) \ @@ -353,14 +370,14 @@ void JSGlobalObject::reset(JSValue prototype) m_syntaxErrorConstructor.set(vm, this, NativeErrorConstructor::create(vm, this, nativeErrorStructure, nativeErrorPrototypeStructure, ASCIILiteral("SyntaxError"))); m_typeErrorConstructor.set(vm, this, NativeErrorConstructor::create(vm, this, nativeErrorStructure, nativeErrorPrototypeStructure, ASCIILiteral("TypeError"))); m_URIErrorConstructor.set(vm, this, NativeErrorConstructor::create(vm, this, nativeErrorStructure, nativeErrorPrototypeStructure, ASCIILiteral("URIError"))); + m_promiseConstructor.set(vm, this, JSPromiseConstructor::create(vm, JSPromiseConstructor::createStructure(vm, this, m_functionPrototype.get()), m_promisePrototype.get())); m_objectPrototype->putDirectWithoutTransition(vm, vm.propertyNames->constructor, objectConstructor, DontEnum); m_functionPrototype->putDirectWithoutTransition(vm, vm.propertyNames->constructor, functionConstructor, DontEnum); m_arrayPrototype->putDirectWithoutTransition(vm, vm.propertyNames->constructor, arrayConstructor, DontEnum); m_regExpPrototype->putDirectWithoutTransition(vm, vm.propertyNames->constructor, m_regExpConstructor.get(), DontEnum); #if ENABLE(PROMISES) - m_promisePrototype->putDirectWithoutTransition(vm, vm.propertyNames->constructor, promiseConstructor, DontEnum); - m_promiseResolverPrototype->putDirectWithoutTransition(vm, vm.propertyNames->constructor, promiseResolverConstructor, DontEnum); + m_promisePrototype->putDirectWithoutTransition(vm, vm.propertyNames->constructor, m_promiseConstructor.get(), DontEnum); #endif putDirectWithoutTransition(vm, vm.propertyNames->Object, objectConstructor, DontEnum); @@ -373,10 +390,7 @@ void JSGlobalObject::reset(JSValue prototype) putDirectWithoutTransition(vm, vm.propertyNames->SyntaxError, m_syntaxErrorConstructor.get(), DontEnum); putDirectWithoutTransition(vm, vm.propertyNames->TypeError, m_typeErrorConstructor.get(), DontEnum); putDirectWithoutTransition(vm, vm.propertyNames->URIError, m_URIErrorConstructor.get(), DontEnum); -#if ENABLE(PROMISES) - putDirectWithoutTransition(vm, vm.propertyNames->Promise, promiseConstructor, DontEnum); - putDirectWithoutTransition(vm, vm.propertyNames->PromiseResolver, promiseResolverConstructor, DontEnum); -#endif + putDirectWithoutTransition(vm, vm.propertyNames->Promise, m_promiseConstructor.get(), DontEnum); #define PUT_CONSTRUCTOR_FOR_SIMPLE_TYPE(capitalName, lowerName, properName, instanceType, jsName) \ @@ -398,7 +412,7 @@ void JSGlobalObject::reset(JSValue prototype) putDirectWithoutTransition(vm, vm.propertyNames->JSON, JSONObject::create(vm, JSONObject::createStructure(vm, this, m_objectPrototype.get())), DontEnum); putDirectWithoutTransition(vm, vm.propertyNames->Math, MathObject::create(vm, this, MathObject::createStructure(vm, this, m_objectPrototype.get())), DontEnum); - FixedArray typedArrayConstructors; + std::array typedArrayConstructors; typedArrayConstructors[toIndex(TypeInt8)] = JSInt8ArrayConstructor::create(vm, JSInt8ArrayConstructor::createStructure(vm, this, m_functionPrototype.get()), m_typedArrays[toIndex(TypeInt8)].prototype.get(), "Int8Array"); typedArrayConstructors[toIndex(TypeInt16)] = JSInt16ArrayConstructor::create(vm, JSInt16ArrayConstructor::createStructure(vm, this, m_functionPrototype.get()), m_typedArrays[toIndex(TypeInt16)].prototype.get(), "Int16Array"); typedArrayConstructors[toIndex(TypeInt32)] = JSInt32ArrayConstructor::create(vm, JSInt32ArrayConstructor::createStructure(vm, this, m_functionPrototype.get()), m_typedArrays[toIndex(TypeInt32)].prototype.get(), "Int32Array"); @@ -512,7 +526,7 @@ void JSGlobalObject::haveABadTime(VM& vm) // Make sure that all allocations or indexed storage transitions that are inlining // the assumption that it's safe to transition to a non-SlowPut array storage don't // do so anymore. - m_havingABadTimeWatchpoint->notifyWrite(); + m_havingABadTimeWatchpoint->fireAll(); ASSERT(isHavingABadTime()); // The watchpoint is what tells us that we're having a bad time. // Make sure that all JSArray allocations that load the appropriate structure from @@ -594,6 +608,7 @@ void JSGlobalObject::visitChildren(JSCell* cell, SlotVisitor& visitor) visitor.append(&thisObject->m_syntaxErrorConstructor); visitor.append(&thisObject->m_typeErrorConstructor); visitor.append(&thisObject->m_URIErrorConstructor); + visitor.append(&thisObject->m_promiseConstructor); visitor.append(&thisObject->m_evalFunction); visitor.append(&thisObject->m_callFunction); @@ -606,7 +621,6 @@ void JSGlobalObject::visitChildren(JSCell* cell, SlotVisitor& visitor) visitor.append(&thisObject->m_errorPrototype); #if ENABLE(PROMISES) visitor.append(&thisObject->m_promisePrototype); - visitor.append(&thisObject->m_promiseResolverPrototype); #endif visitor.append(&thisObject->m_withScopeStructure); @@ -638,9 +652,6 @@ void JSGlobalObject::visitChildren(JSCell* cell, SlotVisitor& visitor) #if ENABLE(PROMISES) visitor.append(&thisObject->m_promiseStructure); - visitor.append(&thisObject->m_promiseResolverStructure); - visitor.append(&thisObject->m_promiseCallbackStructure); - visitor.append(&thisObject->m_promiseWrapperCallbackStructure); #endif // ENABLE(PROMISES) #define VISIT_SIMPLE_TYPE(CapitalName, lowerName, properName, instanceType, jsName) \ @@ -697,26 +708,6 @@ void JSGlobalObject::clearRareData(JSCell* cell) jsCast(cell)->m_rareData.clear(); } -DynamicGlobalObjectScope::DynamicGlobalObjectScope(VM& vm, JSGlobalObject* dynamicGlobalObject) - : m_dynamicGlobalObjectSlot(vm.dynamicGlobalObject) - , m_savedDynamicGlobalObject(m_dynamicGlobalObjectSlot) -{ - if (!m_dynamicGlobalObjectSlot) { -#if ENABLE(ASSEMBLER) - if (ExecutableAllocator::underMemoryPressure()) - vm.heap.deleteAllCompiledCode(); -#endif - - m_dynamicGlobalObjectSlot = dynamicGlobalObject; - - // Reset the date cache between JS invocations to force the VM - // to observe time zone changes. - vm.resetDateCache(); - } - // Clear the exception stack between entries - vm.clearExceptionStack(); -} - void slowValidateCell(JSGlobalObject* globalObject) { RELEASE_ASSERT(globalObject->isGlobalObject()); @@ -729,7 +720,7 @@ UnlinkedProgramCodeBlock* JSGlobalObject::createProgramCodeBlock(CallFrame* call JSParserStrictness strictness = executable->isStrictMode() ? JSParseStrict : JSParseNormal; DebuggerMode debuggerMode = hasDebugger() ? DebuggerOn : DebuggerOff; ProfilerMode profilerMode = hasProfiler() ? ProfilerOn : ProfilerOff; - UnlinkedProgramCodeBlock* unlinkedCode = vm().codeCache()->getProgramCodeBlock(vm(), executable, executable->source(), strictness, debuggerMode, profilerMode, error); + UnlinkedProgramCodeBlock* unlinkedCodeBlock = vm().codeCache()->getProgramCodeBlock(vm(), executable, executable->source(), strictness, debuggerMode, profilerMode, error); if (hasDebugger()) debugger()->sourceParsed(callFrame, executable->source().provider(), error.m_line, error.m_message); @@ -739,7 +730,7 @@ UnlinkedProgramCodeBlock* JSGlobalObject::createProgramCodeBlock(CallFrame* call return 0; } - return unlinkedCode; + return unlinkedCodeBlock; } UnlinkedEvalCodeBlock* JSGlobalObject::createEvalCodeBlock(CallFrame* callFrame, EvalExecutable* executable) @@ -748,7 +739,7 @@ UnlinkedEvalCodeBlock* JSGlobalObject::createEvalCodeBlock(CallFrame* callFrame, JSParserStrictness strictness = executable->isStrictMode() ? JSParseStrict : JSParseNormal; DebuggerMode debuggerMode = hasDebugger() ? DebuggerOn : DebuggerOff; ProfilerMode profilerMode = hasProfiler() ? ProfilerOn : ProfilerOff; - UnlinkedEvalCodeBlock* unlinkedCode = vm().codeCache()->getEvalCodeBlock(vm(), executable, executable->source(), strictness, debuggerMode, profilerMode, error); + UnlinkedEvalCodeBlock* unlinkedCodeBlock = vm().codeCache()->getEvalCodeBlock(vm(), executable, executable->source(), strictness, debuggerMode, profilerMode, error); if (hasDebugger()) debugger()->sourceParsed(callFrame, executable->source().provider(), error.m_line, error.m_message); @@ -758,7 +749,42 @@ UnlinkedEvalCodeBlock* JSGlobalObject::createEvalCodeBlock(CallFrame* callFrame, return 0; } - return unlinkedCode; + return unlinkedCodeBlock; +} + +void JSGlobalObject::setRemoteDebuggingEnabled(bool enabled) +{ +#if ENABLE(REMOTE_INSPECTOR) + m_inspectorDebuggable->setRemoteDebuggingAllowed(enabled); +#else + UNUSED_PARAM(enabled); +#endif +} + +bool JSGlobalObject::remoteDebuggingEnabled() const +{ +#if ENABLE(REMOTE_INSPECTOR) + return m_inspectorDebuggable->remoteDebuggingAllowed(); +#else + return false; +#endif +} + +void JSGlobalObject::setName(const String& name) +{ + m_name = name; + +#if ENABLE(REMOTE_INSPECTOR) + m_inspectorDebuggable->update(); +#endif +} + +void JSGlobalObject::queueMicrotask(PassRefPtr task) +{ + if (globalObjectMethodTable()->queueTaskToEventLoop) + globalObjectMethodTable()->queueTaskToEventLoop(this, task); + else + WTFLogAlways("ERROR: Event loop not supported."); } } // namespace JSC diff --git a/JavaScriptCore/runtime/JSGlobalObject.h b/JavaScriptCore/runtime/JSGlobalObject.h index 4ff87ae4..f9d2900b 100644 --- a/JavaScriptCore/runtime/JSGlobalObject.h +++ b/JavaScriptCore/runtime/JSGlobalObject.h @@ -23,6 +23,7 @@ #define JSGlobalObject_h #include "ArrayAllocationProfile.h" +#include "ConstantMode.h" #include "JSArray.h" #include "JSArrayBufferPrototype.h" #include "JSClassRef.h" @@ -36,6 +37,7 @@ #include "VM.h" #include "Watchpoint.h" #include +#include #include #include #include @@ -58,10 +60,12 @@ class FunctionExecutable; class FunctionPrototype; class GetterSetter; class GlobalCodeBlock; +class JSGlobalObjectDebuggable; +class JSPromiseConstructor; class JSPromisePrototype; -class JSPromiseResolverPrototype; class JSStack; class LLIntOffsetsExtractor; +class Microtask; class NativeErrorConstructor; class ProgramCodeBlock; class ProgramExecutable; @@ -71,6 +75,8 @@ class SourceCode; struct ActivationStackNode; struct HashTable; +#define DEFINE_STANDARD_BUILTIN(macro, upperName, lowerName) macro(upperName, lowerName, lowerName, JS ## upperName, upperName) + #define FOR_EACH_SIMPLE_BUILTIN_TYPE(macro) \ macro(Set, set, set, JSSet, Set) \ macro(Map, map, map, JSMap, Map) \ @@ -80,8 +86,12 @@ struct HashTable; macro(Number, number, numberObject, NumberObject, Number) \ macro(Error, error, error, ErrorInstance, Error) \ macro(JSArrayBuffer, arrayBuffer, arrayBuffer, JSArrayBuffer, ArrayBuffer) \ - macro(WeakMap, weakMap, weakMap, JSWeakMap, WeakMap) \ - macro(ArrayIterator, arrayIterator, arrayIterator, JSArrayIterator, ArrayIterator) \ + DEFINE_STANDARD_BUILTIN(macro, WeakMap, weakMap) \ + DEFINE_STANDARD_BUILTIN(macro, ArrayIterator, arrayIterator) \ + DEFINE_STANDARD_BUILTIN(macro, ArgumentsIterator, argumentsIterator) \ + DEFINE_STANDARD_BUILTIN(macro, MapIterator, mapIterator) \ + DEFINE_STANDARD_BUILTIN(macro, SetIterator, setIterator) \ + #define DECLARE_SIMPLE_BUILTIN_TYPE(capitalName, lowerName, properName, instanceType, jsName) \ class JS ## capitalName; \ @@ -94,13 +104,6 @@ FOR_EACH_SIMPLE_BUILTIN_TYPE(DECLARE_SIMPLE_BUILTIN_TYPE) typedef Vector ExecStateStack; -class TaskContext : public RefCounted { -public: - virtual ~TaskContext() - { - } -}; - struct GlobalObjectMethodTable { typedef bool (*AllowsAccessFromFunctionPtr)(const JSGlobalObject*, ExecState*); AllowsAccessFromFunctionPtr allowsAccessFrom; @@ -117,8 +120,7 @@ struct GlobalObjectMethodTable { typedef bool (*JavaScriptExperimentsEnabledFunctionPtr)(const JSGlobalObject*); JavaScriptExperimentsEnabledFunctionPtr javaScriptExperimentsEnabled; - typedef void (*QueueTaskToEventLoopCallbackFunctionPtr)(ExecState*, TaskContext*); - typedef void (*QueueTaskToEventLoopFunctionPtr)(const JSGlobalObject*, QueueTaskToEventLoopCallbackFunctionPtr, PassRefPtr); + typedef void (*QueueTaskToEventLoopFunctionPtr)(const JSGlobalObject*, PassRefPtr); QueueTaskToEventLoopFunctionPtr queueTaskToEventLoop; typedef bool (*ShouldInterruptScriptBeforeTimeoutPtr)(const JSGlobalObject*); @@ -143,7 +145,6 @@ class JSGlobalObject : public JSSegmentedVariableObject { }; protected: - Register m_globalCallFrame[JSStack::CallFrameHeaderSize]; WriteBarrier m_globalThis; @@ -156,6 +157,7 @@ class JSGlobalObject : public JSSegmentedVariableObject { WriteBarrier m_syntaxErrorConstructor; WriteBarrier m_typeErrorConstructor; WriteBarrier m_URIErrorConstructor; + WriteBarrier m_promiseConstructor; WriteBarrier m_evalFunction; WriteBarrier m_callFunction; @@ -167,7 +169,6 @@ class JSGlobalObject : public JSSegmentedVariableObject { WriteBarrier m_arrayPrototype; WriteBarrier m_regExpPrototype; WriteBarrier m_promisePrototype; - WriteBarrier m_promiseResolverPrototype; WriteBarrier m_withScopeStructure; WriteBarrier m_strictEvalActivationStructure; @@ -201,9 +202,6 @@ class JSGlobalObject : public JSSegmentedVariableObject { #if ENABLE(PROMISES) WriteBarrier m_promiseStructure; - WriteBarrier m_promiseResolverStructure; - WriteBarrier m_promiseCallbackStructure; - WriteBarrier m_promiseWrapperCallbackStructure; #endif // ENABLE(PROMISES) #define DEFINE_STORAGE_FOR_SIMPLE_TYPE(capitalName, lowerName, properName, instanceType, jsName) \ @@ -219,12 +217,18 @@ class JSGlobalObject : public JSSegmentedVariableObject { WriteBarrier structure; }; - FixedArray m_typedArrays; + std::array m_typedArrays; void* m_specialPointers[Special::TableSize]; // Special pointers used by the LLInt and JIT. + String m_name; + Debugger* m_debugger; +#if ENABLE(REMOTE_INSPECTOR) + std::unique_ptr m_inspectorDebuggable; +#endif + RefPtr m_masqueradesAsUndefinedWatchpoint; RefPtr m_havingABadTimeWatchpoint; RefPtr m_varInjectionWatchpoint; @@ -282,9 +286,11 @@ class JSGlobalObject : public JSSegmentedVariableObject { init(thisValue); } - enum ConstantMode { IsConstant, IsVariable }; - enum FunctionMode { IsFunctionToSpecialize, NotFunctionOrNotSpecializable }; - int addGlobalVar(const Identifier&, ConstantMode, FunctionMode); + struct NewGlobalVar { + int registerNumber; + VariableWatchpointSet* set; + }; + NewGlobalVar addGlobalVar(const Identifier&, ConstantMode); public: JS_EXPORT_PRIVATE ~JSGlobalObject(); @@ -309,19 +315,14 @@ class JSGlobalObject : public JSSegmentedVariableObject { void addVar(ExecState* exec, const Identifier& propertyName) { if (!hasProperty(exec, propertyName)) - addGlobalVar(propertyName, IsVariable, NotFunctionOrNotSpecializable); + addGlobalVar(propertyName, IsVariable); } void addConst(ExecState* exec, const Identifier& propertyName) { if (!hasProperty(exec, propertyName)) - addGlobalVar(propertyName, IsConstant, NotFunctionOrNotSpecializable); - } - void addFunction(ExecState* exec, const Identifier& propertyName, JSValue value) - { - bool propertyDidExist = removeDirect(exec->vm(), propertyName); // Newly declared functions overwrite existing properties. - int index = addGlobalVar(propertyName, IsVariable, !propertyDidExist ? IsFunctionToSpecialize : NotFunctionOrNotSpecializable); - registerAt(index).set(exec->vm(), this, value); + addGlobalVar(propertyName, IsConstant); } + void addFunction(ExecState*, const Identifier&, JSValue); // The following accessors return pristine values, even if a script // replaces the global object's associated property. @@ -335,6 +336,7 @@ class JSGlobalObject : public JSSegmentedVariableObject { NativeErrorConstructor* syntaxErrorConstructor() const { return m_syntaxErrorConstructor.get(); } NativeErrorConstructor* typeErrorConstructor() const { return m_typeErrorConstructor.get(); } NativeErrorConstructor* URIErrorConstructor() const { return m_URIErrorConstructor.get(); } + JSPromiseConstructor* promiseConstructor() const { return m_promiseConstructor.get(); } JSFunction* evalFunction() const { return m_evalFunction.get(); } JSFunction* callFunction() const { return m_callFunction.get(); } @@ -356,7 +358,6 @@ class JSGlobalObject : public JSSegmentedVariableObject { RegExpPrototype* regExpPrototype() const { return m_regExpPrototype.get(); } ErrorPrototype* errorPrototype() const { return m_errorPrototype.get(); } JSPromisePrototype* promisePrototype() const { return m_promisePrototype.get(); } - JSPromiseResolverPrototype* promiseResolverPrototype() const { return m_promiseResolverPrototype.get(); } Structure* withScopeStructure() const { return m_withScopeStructure.get(); } Structure* strictEvalActivationStructure() const { return m_strictEvalActivationStructure.get(); } @@ -411,11 +412,14 @@ class JSGlobalObject : public JSSegmentedVariableObject { #if ENABLE(PROMISES) Structure* promiseStructure() const { return m_promiseStructure.get(); } - Structure* promiseResolverStructure() const { return m_promiseResolverStructure.get(); } - Structure* promiseCallbackStructure() const { return m_promiseCallbackStructure.get(); } - Structure* promiseWrapperCallbackStructure() const { return m_promiseWrapperCallbackStructure.get(); } #endif // ENABLE(PROMISES) + JS_EXPORT_PRIVATE void setRemoteDebuggingEnabled(bool); + JS_EXPORT_PRIVATE bool remoteDebuggingEnabled() const; + + void setName(const String&); + const String& name() const { return m_name; } + JSArrayBufferPrototype* arrayBufferPrototype() const { return m_arrayBufferPrototype.get(); } #define DEFINE_ACCESSORS_FOR_SIMPLE_TYPE(capitalName, lowerName, properName, instanceType, jsName) \ @@ -482,6 +486,8 @@ class JSGlobalObject : public JSSegmentedVariableObject { static bool shouldInterruptScriptBeforeTimeout(const JSGlobalObject*) { return false; } static bool javaScriptExperimentsEnabled(const JSGlobalObject*) { return false; } + void queueMicrotask(PassRefPtr); + bool evalEnabled() const { return m_evalEnabled; } const String& evalDisabledErrorMessage() const { return m_evalDisabledErrorMessage; } void setEvalEnabled(bool enabled, const String& errorMessage = String()) @@ -580,17 +586,6 @@ inline bool JSGlobalObject::symbolTableHasProperty(PropertyName propertyName) return !entry.isNull(); } -inline JSGlobalObject* ExecState::dynamicGlobalObject() -{ - if (this == lexicalGlobalObject()->globalExec()) - return lexicalGlobalObject(); - - // For any ExecState that's not a globalExec, the - // dynamic global object must be set since code is running - ASSERT(vm().dynamicGlobalObject); - return vm().dynamicGlobalObject; -} - inline JSArray* constructEmptyArray(ExecState* exec, ArrayAllocationProfile* profile, JSGlobalObject* globalObject, unsigned initialLength = 0) { return ArrayAllocationProfile::updateLastAllocationFor(profile, JSArray::create(exec->vm(), initialLength >= MIN_SPARSE_ARRAY_INDEX ? globalObject->arrayStructureForIndexingTypeDuringAllocation(ArrayWithArrayStorage) : globalObject->arrayStructureForProfileDuringAllocation(profile), initialLength)); @@ -631,21 +626,6 @@ inline JSArray* constructArrayNegativeIndexed(ExecState* exec, ArrayAllocationPr return constructArrayNegativeIndexed(exec, profile, exec->lexicalGlobalObject(), values, length); } -class DynamicGlobalObjectScope { - WTF_MAKE_NONCOPYABLE(DynamicGlobalObjectScope); -public: - JS_EXPORT_PRIVATE DynamicGlobalObjectScope(VM&, JSGlobalObject*); - - ~DynamicGlobalObjectScope() - { - m_dynamicGlobalObjectSlot = m_savedDynamicGlobalObject; - } - -private: - JSGlobalObject*& m_dynamicGlobalObjectSlot; - JSGlobalObject* m_savedDynamicGlobalObject; -}; - inline JSObject* JSScope::globalThis() { return globalObject()->globalThis(); diff --git a/JavaScriptCore/runtime/JSGlobalObjectDebuggable.cpp b/JavaScriptCore/runtime/JSGlobalObjectDebuggable.cpp new file mode 100644 index 00000000..c933aa6a --- /dev/null +++ b/JavaScriptCore/runtime/JSGlobalObjectDebuggable.cpp @@ -0,0 +1,83 @@ +/* + * Copyright (C) 2013 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 "JSGlobalObjectDebuggable.h" + +#if ENABLE(REMOTE_INSPECTOR) + +#include "APIShims.h" +#include "InspectorFrontendChannel.h" +#include "JSGlobalObject.h" +#include "RemoteInspector.h" + +using namespace Inspector; + +namespace JSC { + +JSGlobalObjectDebuggable::JSGlobalObjectDebuggable(JSGlobalObject& globalObject) + : m_globalObject(globalObject) +{ +} + +JSGlobalObjectDebuggable::~JSGlobalObjectDebuggable() +{ + if (m_inspectorController) + disconnect(); +} + +String JSGlobalObjectDebuggable::name() const +{ + String name = m_globalObject.name(); + return name.isEmpty() ? ASCIILiteral("JSContext") : name; +} + +void JSGlobalObjectDebuggable::connect(InspectorFrontendChannel* frontendChannel) +{ + APIEntryShim entryShim(&m_globalObject.vm()); + + ASSERT(!m_inspectorController); + m_inspectorController = std::make_unique(m_globalObject); + m_inspectorController->connectFrontend(frontendChannel); +} + +void JSGlobalObjectDebuggable::disconnect() +{ + APIEntryShim entryShim(&m_globalObject.vm()); + + m_inspectorController->disconnectFrontend(); + m_inspectorController = nullptr; +} + +void JSGlobalObjectDebuggable::dispatchMessageFromRemoteFrontend(const String& message) +{ + APIEntryShim entryShim(&m_globalObject.vm()); + + m_inspectorController->dispatchMessageFromFrontend(message); +} + +} // namespace JSC + +#endif // ENABLE(REMOTE_INSPECTOR) diff --git a/JavaScriptCore/runtime/JSGlobalObjectDebuggable.h b/JavaScriptCore/runtime/JSGlobalObjectDebuggable.h new file mode 100644 index 00000000..9371cce9 --- /dev/null +++ b/JavaScriptCore/runtime/JSGlobalObjectDebuggable.h @@ -0,0 +1,63 @@ +/* + * Copyright (C) 2013 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. + */ + +#ifndef JSGlobalObjectDebuggable_h +#define JSGlobalObjectDebuggable_h + +#if ENABLE(REMOTE_INSPECTOR) + +#include "JSGlobalObjectInspectorController.h" +#include "RemoteInspectorDebuggable.h" +#include + +namespace JSC { + +class JSGlobalObject; + +class JSGlobalObjectDebuggable FINAL : public Inspector::RemoteInspectorDebuggable { + WTF_MAKE_NONCOPYABLE(JSGlobalObjectDebuggable); +public: + JSGlobalObjectDebuggable(JSGlobalObject&); + ~JSGlobalObjectDebuggable(); + + virtual Inspector::RemoteInspectorDebuggable::DebuggableType type() const OVERRIDE { return Inspector::RemoteInspectorDebuggable::JavaScript; } + + virtual String name() const OVERRIDE; + virtual bool hasLocalDebugger() const OVERRIDE { return false; } + + virtual void connect(Inspector::InspectorFrontendChannel*) OVERRIDE; + virtual void disconnect() OVERRIDE; + virtual void dispatchMessageFromRemoteFrontend(const String& message) OVERRIDE; + +private: + JSGlobalObject& m_globalObject; + std::unique_ptr m_inspectorController; +}; + +} // namespace JSC + +#endif // ENABLE(REMOTE_INSPECTOR) + +#endif // !defined(JSGlobalObjectDebuggable_h) diff --git a/JavaScriptCore/runtime/JSGlobalObjectFunctions.cpp b/JavaScriptCore/runtime/JSGlobalObjectFunctions.cpp index 9200567e..9132d327 100644 --- a/JavaScriptCore/runtime/JSGlobalObjectFunctions.cpp +++ b/JavaScriptCore/runtime/JSGlobalObjectFunctions.cpp @@ -308,7 +308,7 @@ static double parseInt(const String& s, const CharType* data, int radix) if (number >= mantissaOverflowLowerBound) { if (radix == 10) { size_t parsedLength; - number = parseDouble(s.characters() + firstDigitPosition, p - firstDigitPosition, parsedLength); + number = parseDouble(s.deprecatedCharacters() + firstDigitPosition, p - firstDigitPosition, parsedLength); } else if (radix == 2 || radix == 4 || radix == 8 || radix == 16 || radix == 32) number = parseIntOverflow(s.substringSharingImpl(firstDigitPosition, p - firstDigitPosition).utf8().data(), p - firstDigitPosition, radix); } diff --git a/JavaScriptCore/runtime/JSMapIterator.cpp b/JavaScriptCore/runtime/JSMapIterator.cpp new file mode 100644 index 00000000..091d90b5 --- /dev/null +++ b/JavaScriptCore/runtime/JSMapIterator.cpp @@ -0,0 +1,64 @@ +/* + * Copyright (C) 2013 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 "JSMapIterator.h" + +#include "JSCJSValueInlines.h" +#include "JSCellInlines.h" +#include "JSMap.h" +#include "SlotVisitorInlines.h" + +namespace JSC { + +const ClassInfo JSMapIterator::s_info = { "Map Iterator", &Base::s_info, 0, 0, CREATE_METHOD_TABLE(JSMapIterator) }; + +void JSMapIterator::finishCreation(VM& vm, JSMap* iteratedObject) +{ + Base::finishCreation(vm); + m_iteratedObjectData.set(vm, this, iteratedObject->mapData()); +} + +void JSMapIterator::visitChildren(JSCell* cell, SlotVisitor& visitor) +{ + JSMapIterator* thisObject = jsCast(cell); + ASSERT_GC_OBJECT_INHERITS(thisObject, info()); + COMPILE_ASSERT(StructureFlags & OverridesVisitChildren, OverridesVisitChildrenWithoutSettingFlag); + ASSERT(thisObject->structure()->typeInfo().overridesVisitChildren()); + + Base::visitChildren(thisObject, visitor); + visitor.append(&thisObject->m_iteratedObjectData); +} + +JSValue JSMapIterator::createPair(CallFrame* callFrame, JSValue key, JSValue value) +{ + MarkedArgumentBuffer args; + args.append(key); + args.append(value); + JSGlobalObject* globalObject = callFrame->callee()->globalObject(); + return constructArray(callFrame, 0, globalObject, args); +} + +} diff --git a/JavaScriptCore/runtime/JSMapIterator.h b/JavaScriptCore/runtime/JSMapIterator.h new file mode 100644 index 00000000..0096d9e0 --- /dev/null +++ b/JavaScriptCore/runtime/JSMapIterator.h @@ -0,0 +1,95 @@ +/* + * Copyright (C) 2013 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. + */ + +#ifndef JSMapIterator_h +#define JSMapIterator_h + +#include "JSDestructibleObject.h" +#include "JSMap.h" +#include "MapData.h" + +namespace JSC { +enum MapIterationKind : uint32_t { + MapIterateKey, + MapIterateValue, + MapIterateKeyValue, +}; + +class JSMapIterator : public JSDestructibleObject { +public: + typedef JSDestructibleObject Base; + + DECLARE_EXPORT_INFO; + + static Structure* createStructure(VM& vm, JSGlobalObject* globalObject, JSValue prototype) + { + return Structure::create(vm, globalObject, prototype, TypeInfo(ObjectType, StructureFlags), info()); + } + + static JSMapIterator* create(VM& vm, Structure* structure, JSMap* iteratedObject, MapIterationKind kind) + { + JSMapIterator* instance = new (NotNull, allocateCell(vm.heap)) JSMapIterator(vm, structure, iteratedObject, kind); + instance->finishCreation(vm, iteratedObject); + return instance; + } + + bool next(CallFrame* callFrame, JSValue& value) + { + if (!m_iterator.ensureSlot()) + return false; + + if (m_kind == MapIterateValue) + value = m_iterator.value(); + else if (m_kind == MapIterateKey) + value = m_iterator.key(); + else + value = createPair(callFrame, m_iterator.key(), m_iterator.value()); + ++m_iterator; + return true; + } + +private: + + static const unsigned StructureFlags = Base::StructureFlags | OverridesVisitChildren; + + JSMapIterator(VM& vm, Structure* structure, JSMap* iteratedObject, MapIterationKind kind) + : Base(vm, structure) + , m_iterator(iteratedObject->mapData()->begin()) + , m_kind(kind) + { + } + + void finishCreation(VM&, JSMap*); + JSValue createPair(CallFrame*, JSValue, JSValue); + static void visitChildren(JSCell*, SlotVisitor&); + + WriteBarrier m_iteratedObjectData; + MapData::const_iterator m_iterator; + MapIterationKind m_kind; +}; + +} + +#endif // !defined(JSMapIterator_h) diff --git a/JavaScriptCore/runtime/JSONObject.cpp b/JavaScriptCore/runtime/JSONObject.cpp index c6803a62..99f2257b 100644 --- a/JavaScriptCore/runtime/JSONObject.cpp +++ b/JavaScriptCore/runtime/JSONObject.cpp @@ -746,7 +746,7 @@ NEVER_INLINE JSValue Walker::walk(JSValue unfiltered) case ObjectEndVisitMember: { JSObject* object = objectStack.peek(); Identifier prop = propertyStack.last()[indexStack.last()]; - PutPropertySlot slot; + PutPropertySlot slot(object); JSValue filteredValue = callReviver(object, jsString(m_exec, prop.string()), outValue); if (filteredValue.isUndefined()) object->methodTable()->deleteProperty(object, m_exec, prop); @@ -775,7 +775,7 @@ NEVER_INLINE JSValue Walker::walk(JSValue unfiltered) stateStack.removeLast(); } JSObject* finalHolder = constructEmptyObject(m_exec); - PutPropertySlot slot; + PutPropertySlot slot(finalHolder); finalHolder->methodTable()->put(finalHolder, m_exec, m_exec->vm().propertyNames->emptyIdentifier, outValue, slot); return callReviver(finalHolder, jsEmptyString(m_exec), outValue); } diff --git a/JavaScriptCore/runtime/JSONObject.h b/JavaScriptCore/runtime/JSONObject.h index c93c9c7f..cacfc5d6 100644 --- a/JavaScriptCore/runtime/JSONObject.h +++ b/JavaScriptCore/runtime/JSONObject.h @@ -61,7 +61,7 @@ namespace JSC { }; JS_EXPORT_PRIVATE JSValue JSONParse(ExecState*, const String&); - String JSONStringify(ExecState*, JSValue, unsigned indent); + JS_EXPORT_PRIVATE String JSONStringify(ExecState*, JSValue, unsigned indent); void escapeStringToBuilder(StringBuilder&, const String&); diff --git a/JavaScriptCore/runtime/JSObject.cpp b/JavaScriptCore/runtime/JSObject.cpp index be6d5502..11e7456f 100644 --- a/JavaScriptCore/runtime/JSObject.cpp +++ b/JavaScriptCore/runtime/JSObject.cpp @@ -159,7 +159,7 @@ ALWAYS_INLINE void JSObject::copyButterfly(CopyVisitor& visitor, Butterfly* butt memcpy(currentTarget, currentSource, count * sizeof(EncodedJSValue)); } - m_butterfly = newButterfly; + m_butterfly.setWithoutWriteBarrier(newButterfly); visitor.didCopy(butterfly->base(preCapacity, propertyCapacity), capacityInBytes); } } @@ -283,7 +283,7 @@ bool JSObject::getOwnPropertySlotByIndex(JSObject* thisObject, ExecState* exec, case ALL_INT32_INDEXING_TYPES: case ALL_CONTIGUOUS_INDEXING_TYPES: { - Butterfly* butterfly = thisObject->m_butterfly; + Butterfly* butterfly = thisObject->butterfly(); if (i >= butterfly->vectorLength()) return false; @@ -297,7 +297,7 @@ bool JSObject::getOwnPropertySlotByIndex(JSObject* thisObject, ExecState* exec, } case ALL_DOUBLE_INDEXING_TYPES: { - Butterfly* butterfly = thisObject->m_butterfly; + Butterfly* butterfly = thisObject->butterfly(); if (i >= butterfly->vectorLength()) return false; @@ -411,7 +411,7 @@ void JSObject::putByIndex(JSCell* cell, ExecState* exec, unsigned propertyName, JSObject* thisObject = jsCast(cell); if (propertyName > MAX_ARRAY_INDEX) { - PutPropertySlot slot(shouldThrow); + PutPropertySlot slot(cell, shouldThrow); thisObject->methodTable()->put(thisObject, exec, Identifier::from(exec, propertyName), value, slot); return; } @@ -437,7 +437,7 @@ void JSObject::putByIndex(JSCell* cell, ExecState* exec, unsigned propertyName, } case ALL_CONTIGUOUS_INDEXING_TYPES: { - Butterfly* butterfly = thisObject->m_butterfly; + Butterfly* butterfly = thisObject->butterfly(); if (propertyName >= butterfly->vectorLength()) break; butterfly->contiguous()[propertyName].set(exec->vm(), thisObject, value); @@ -460,7 +460,7 @@ void JSObject::putByIndex(JSCell* cell, ExecState* exec, unsigned propertyName, putByIndex(cell, exec, propertyName, value, shouldThrow); return; } - Butterfly* butterfly = thisObject->m_butterfly; + Butterfly* butterfly = thisObject->butterfly(); if (propertyName >= butterfly->vectorLength()) break; butterfly->contiguousDouble()[propertyName] = valueAsDouble; @@ -549,11 +549,10 @@ ArrayStorage* JSObject::enterDictionaryIndexingModeWhenArrayStorageAlreadyExists DeferGC deferGC(vm.heap); Butterfly* newButterfly = storage->butterfly()->resizeArray(vm, this, structure(), 0, ArrayStorage::sizeFor(0)); RELEASE_ASSERT(newButterfly); - - m_butterfly = newButterfly; newButterfly->arrayStorage()->m_indexBias = 0; newButterfly->arrayStorage()->setVectorLength(0); newButterfly->arrayStorage()->m_sparseMap.set(vm, this, map); + setButterflyWithoutChangingStructure(vm, newButterfly); return newButterfly->arrayStorage(); } @@ -601,7 +600,7 @@ Butterfly* JSObject::createInitialIndexedStorage(VM& vm, unsigned length, size_t ASSERT(!indexingShouldBeSparse()); unsigned vectorLength = std::max(length, BASE_VECTOR_LEN); Butterfly* newButterfly = Butterfly::createOrGrowArrayRight( - m_butterfly, vm, this, structure(), structure()->outOfLineCapacity(), false, 0, + m_butterfly.get(), vm, this, structure(), structure()->outOfLineCapacity(), false, 0, elementSize * vectorLength); newButterfly->setPublicLength(length); newButterfly->setVectorLength(vectorLength); @@ -652,7 +651,7 @@ ArrayStorage* JSObject::createArrayStorage(VM& vm, unsigned length, unsigned vec IndexingType oldType = structure()->indexingType(); ASSERT_UNUSED(oldType, !hasIndexedProperties(oldType)); Butterfly* newButterfly = Butterfly::createOrGrowArrayRight( - m_butterfly, vm, this, structure(), structure()->outOfLineCapacity(), false, 0, + m_butterfly.get(), vm, this, structure(), structure()->outOfLineCapacity(), false, 0, ArrayStorage::sizeFor(vectorLength)); RELEASE_ASSERT(newButterfly); @@ -906,7 +905,7 @@ void JSObject::convertUndecidedForValue(VM& vm, JSValue value) return; } - if (value.isDouble()) { + if (value.isDouble() && value.asNumber() == value.asNumber()) { convertUndecidedToDouble(vm); return; } @@ -914,6 +913,24 @@ void JSObject::convertUndecidedForValue(VM& vm, JSValue value) convertUndecidedToContiguous(vm); } +void JSObject::createInitialForValueAndSet(VM& vm, unsigned index, JSValue value) +{ + if (value.isInt32()) { + createInitialInt32(vm, index + 1)[index].set(vm, this, value); + return; + } + + if (value.isDouble()) { + double doubleValue = value.asNumber(); + if (doubleValue == doubleValue) { + createInitialDouble(vm, index + 1)[index] = doubleValue; + return; + } + } + + createInitialContiguous(vm, index + 1)[index].set(vm, this, value); +} + void JSObject::convertInt32ForValue(VM& vm, JSValue value) { ASSERT(!value.isInt32()); @@ -1197,7 +1214,7 @@ void JSObject::putDirectAccessor(ExecState* exec, PropertyName propertyName, JSV void JSObject::putDirectNonIndexAccessor(VM& vm, PropertyName propertyName, JSValue value, unsigned attributes) { - PutPropertySlot slot; + PutPropertySlot slot(this); putDirectInternal(vm, propertyName, value, attributes, slot, getCallableObject(value)); // putDirect will change our Structure if we add a new property. For @@ -1251,7 +1268,8 @@ bool JSObject::deleteProperty(JSCell* cell, ExecState* exec, PropertyName proper if (entry->attributes() & DontDelete && !exec->vm().isInDefineOwnProperty()) return false; // this builtin property can't be deleted - putEntry(exec, entry, propertyName, jsUndefined(), thisObject); + PutPropertySlot slot(thisObject); + putEntry(exec, entry, propertyName, jsUndefined(), slot); } return true; @@ -1277,7 +1295,7 @@ bool JSObject::deletePropertyByIndex(JSCell* cell, ExecState* exec, unsigned i) case ALL_INT32_INDEXING_TYPES: case ALL_CONTIGUOUS_INDEXING_TYPES: { - Butterfly* butterfly = thisObject->m_butterfly; + Butterfly* butterfly = thisObject->butterfly(); if (i >= butterfly->vectorLength()) return true; butterfly->contiguous()[i].clear(); @@ -1285,7 +1303,7 @@ bool JSObject::deletePropertyByIndex(JSCell* cell, ExecState* exec, unsigned i) } case ALL_DOUBLE_INDEXING_TYPES: { - Butterfly* butterfly = thisObject->m_butterfly; + Butterfly* butterfly = thisObject->butterfly(); if (i >= butterfly->vectorLength()) return true; butterfly->contiguousDouble()[i] = QNaN; @@ -1461,7 +1479,7 @@ void JSObject::getOwnPropertyNames(JSObject* object, ExecState* exec, PropertyNa case ALL_INT32_INDEXING_TYPES: case ALL_CONTIGUOUS_INDEXING_TYPES: { - Butterfly* butterfly = object->m_butterfly; + Butterfly* butterfly = object->butterfly(); unsigned usedLength = butterfly->publicLength(); for (unsigned i = 0; i < usedLength; ++i) { if (!butterfly->contiguous()[i]) @@ -1472,7 +1490,7 @@ void JSObject::getOwnPropertyNames(JSObject* object, ExecState* exec, PropertyNa } case ALL_DOUBLE_INDEXING_TYPES: { - Butterfly* butterfly = object->m_butterfly; + Butterfly* butterfly = object->butterfly(); unsigned usedLength = butterfly->publicLength(); for (unsigned i = 0; i < usedLength; ++i) { double value = butterfly->contiguousDouble()[i]; @@ -1856,7 +1874,7 @@ void JSObject::putByIndexBeyondVectorLengthWithoutAttributes(ExecState* exec, un if (i >= MAX_ARRAY_INDEX - 1 || (i >= MIN_SPARSE_ARRAY_INDEX - && !isDenseEnoughForVector(i, countElements(m_butterfly))) + && !isDenseEnoughForVector(i, countElements(butterfly()))) || indexIsSufficientlyBeyondLengthForSparseMap(i, m_butterfly->vectorLength())) { ASSERT(i <= MAX_ARRAY_INDEX); ensureArrayStorageSlow(vm); @@ -1993,8 +2011,8 @@ void JSObject::putByIndexBeyondVectorLength(ExecState* exec, unsigned i, JSValue storage->m_numValuesInVector++; break; } - - createInitialContiguous(vm, i + 1)[i].set(vm, this, value); + + createInitialForValueAndSet(vm, i, value); break; } @@ -2142,7 +2160,7 @@ bool JSObject::putDirectIndexBeyondVectorLength(ExecState* exec, unsigned i, JSV return true; } - createInitialContiguous(vm, i + 1)[i].set(vm, this, value); + createInitialForValueAndSet(vm, i, value); return true; } @@ -2293,13 +2311,13 @@ unsigned JSObject::countElements() return 0; case ALL_INT32_INDEXING_TYPES: - return countElements(m_butterfly); + return countElements(butterfly()); case ALL_DOUBLE_INDEXING_TYPES: - return countElements(m_butterfly); + return countElements(butterfly()); case ALL_CONTIGUOUS_INDEXING_TYPES: - return countElements(m_butterfly); + return countElements(butterfly()); default: CRASH(); @@ -2333,8 +2351,8 @@ bool JSObject::increaseVectorLength(VM& vm, unsigned newLength) ArrayStorage::sizeFor(vectorLength), ArrayStorage::sizeFor(newVectorLength)); if (!newButterfly) return false; - m_butterfly = newButterfly; newButterfly->arrayStorage()->setVectorLength(newVectorLength); + setButterflyWithoutChangingStructure(vm, newButterfly); return true; } @@ -2347,10 +2365,9 @@ bool JSObject::increaseVectorLength(VM& vm, unsigned newLength) newIndexBias, true, ArrayStorage::sizeFor(newVectorLength)); if (!newButterfly) return false; - - m_butterfly = newButterfly; newButterfly->arrayStorage()->setVectorLength(newVectorLength); newButterfly->arrayStorage()->m_indexBias = newIndexBias; + setButterflyWithoutChangingStructure(vm, newButterfly); return true; } @@ -2365,15 +2382,17 @@ void JSObject::ensureLengthSlow(VM& vm, unsigned length) MAX_STORAGE_VECTOR_LENGTH); unsigned oldVectorLength = m_butterfly->vectorLength(); DeferGC deferGC(vm.heap); - m_butterfly = m_butterfly->growArrayRight( + m_butterfly.set(vm, this, m_butterfly->growArrayRight( vm, this, structure(), structure()->outOfLineCapacity(), true, oldVectorLength * sizeof(EncodedJSValue), - newVectorLength * sizeof(EncodedJSValue)); + newVectorLength * sizeof(EncodedJSValue))); + + m_butterfly->setVectorLength(newVectorLength); + if (hasDouble(structure()->indexingType())) { for (unsigned i = oldVectorLength; i < newVectorLength; ++i) m_butterfly->contiguousDouble().data()[i] = QNaN; } - m_butterfly->setVectorLength(newVectorLength); } Butterfly* JSObject::growOutOfLineStorage(VM& vm, size_t oldSize, size_t newSize) diff --git a/JavaScriptCore/runtime/JSObject.h b/JavaScriptCore/runtime/JSObject.h index 60ae1680..d7dea623 100644 --- a/JavaScriptCore/runtime/JSObject.h +++ b/JavaScriptCore/runtime/JSObject.h @@ -27,10 +27,13 @@ #include "ArrayConventions.h" #include "ArrayStorage.h" #include "Butterfly.h" +#include "CallFrame.h" #include "ClassInfo.h" #include "CommonIdentifiers.h" -#include "CallFrame.h" +#include "CopyWriteBarrier.h" #include "DeferGC.h" +#include "Heap.h" +#include "IndexingHeaderInlines.h" #include "JSCell.h" #include "PropertySlot.h" #include "PropertyStorage.h" @@ -539,8 +542,8 @@ class JSObject : public JSCell { return inlineStorageUnsafe(); } - const Butterfly* butterfly() const { return m_butterfly; } - Butterfly* butterfly() { return m_butterfly; } + const Butterfly* butterfly() const { return m_butterfly.get(); } + Butterfly* butterfly() { return m_butterfly.get(); } ConstPropertyStorage outOfLineStorage() const { return m_butterfly->propertyStorage(); } PropertyStorage outOfLineStorage() { return m_butterfly->propertyStorage(); } @@ -605,7 +608,7 @@ class JSObject : public JSCell { void reifyStaticFunctionsForDelete(ExecState* exec); JS_EXPORT_PRIVATE Butterfly* growOutOfLineStorage(VM&, size_t oldSize, size_t newSize); - void setButterflyWithoutChangingStructure(Butterfly*); // You probably don't want to call this. + void setButterflyWithoutChangingStructure(VM&, Butterfly*); void setStructure(VM&, Structure*); void setStructureAndButterfly(VM&, Structure*, Butterfly*); @@ -757,6 +760,7 @@ class JSObject : public JSCell { ContiguousJSValues createInitialContiguous(VM&, unsigned length); void convertUndecidedForValue(VM&, JSValue); + void createInitialForValueAndSet(VM&, unsigned index, JSValue); void convertInt32ForValue(VM&, JSValue); ArrayStorage* createArrayStorage(VM&, unsigned length, unsigned vectorLength); @@ -974,7 +978,7 @@ class JSObject : public JSCell { ContiguousJSValues ensureContiguousSlow(VM&, DoubleToContiguousMode); protected: - Butterfly* m_butterfly; + CopyWriteBarrier m_butterfly; }; // JSNonFinalObject is a type of JSObject that has some internal storage, @@ -1134,7 +1138,9 @@ inline bool JSObject::isErrorInstance() const inline void JSObject::setStructureAndButterfly(VM& vm, Structure* structure, Butterfly* butterfly) { - m_butterfly = butterfly; + ASSERT(structure); + ASSERT(!butterfly == (!structure->outOfLineCapacity() && !structure->hasIndexingHeader(this))); + m_butterfly.set(vm, this, butterfly); setStructure(vm, structure); } @@ -1145,9 +1151,9 @@ inline void JSObject::setStructure(VM& vm, Structure* structure) JSCell::setStructure(vm, structure); } -inline void JSObject::setButterflyWithoutChangingStructure(Butterfly* butterfly) +inline void JSObject::setButterflyWithoutChangingStructure(VM& vm, Butterfly* butterfly) { - m_butterfly = butterfly; + m_butterfly.set(vm, this, butterfly); } inline CallType getCallData(JSValue value, CallData& callData) @@ -1177,7 +1183,7 @@ inline JSObject* asObject(JSValue value) inline JSObject::JSObject(VM& vm, Structure* structure, Butterfly* butterfly) : JSCell(vm, structure) - , m_butterfly(butterfly) + , m_butterfly(vm, this, butterfly) { vm.heap.ascribeOwner(this, butterfly); } @@ -1301,7 +1307,7 @@ inline bool JSObject::putDirectInternal(VM& vm, PropertyName propertyName, JSVal return false; DeferGC deferGC(vm.heap); - Butterfly* newButterfly = m_butterfly; + Butterfly* newButterfly = butterfly(); if (structure()->putWillGrowOutOfLineStorage()) newButterfly = growOutOfLineStorage(vm, structure()->outOfLineCapacity(), structure()->suggestedNewOutOfLineStorageCapacity()); offset = structure()->addPropertyWithoutTransition(vm, propertyName, attributes, specificFunction); @@ -1322,9 +1328,11 @@ inline bool JSObject::putDirectInternal(VM& vm, PropertyName propertyName, JSVal size_t currentCapacity = structure()->outOfLineCapacity(); if (Structure* structure = Structure::addPropertyTransitionToExistingStructure(this->structure(), propertyName, attributes, specificFunction, offset)) { DeferGC deferGC(vm.heap); - Butterfly* newButterfly = m_butterfly; - if (currentCapacity != structure->outOfLineCapacity()) + Butterfly* newButterfly = butterfly(); + if (currentCapacity != structure->outOfLineCapacity()) { + ASSERT(structure != this->structure()); newButterfly = growOutOfLineStorage(vm, currentCapacity, structure->outOfLineCapacity()); + } validateOffset(offset); ASSERT(structure->isValidOffset(offset)); @@ -1421,7 +1429,7 @@ inline bool JSObject::putOwnDataProperty(VM& vm, PropertyName propertyName, JSVa inline void JSObject::putDirect(VM& vm, PropertyName propertyName, JSValue value, unsigned attributes) { ASSERT(!value.isGetterSetter() && !(attributes & Accessor)); - PutPropertySlot slot; + PutPropertySlot slot(this); putDirectInternal(vm, propertyName, value, attributes, slot, getCallableObject(value)); } @@ -1435,7 +1443,7 @@ inline void JSObject::putDirectWithoutTransition(VM& vm, PropertyName propertyNa { DeferGC deferGC(vm.heap); ASSERT(!value.isGetterSetter() && !(attributes & Accessor)); - Butterfly* newButterfly = m_butterfly; + Butterfly* newButterfly = m_butterfly.get(); if (structure()->putWillGrowOutOfLineStorage()) newButterfly = growOutOfLineStorage(vm, structure()->outOfLineCapacity(), structure()->suggestedNewOutOfLineStorageCapacity()); PropertyOffset offset = structure()->addPropertyWithoutTransition(vm, propertyName, attributes, getCallableObject(value)); @@ -1535,10 +1543,10 @@ ALWAYS_INLINE JSValue PropertySlot::getValue(ExecState* exec, PropertyName prope if (m_propertyType == TypeValue) return JSValue::decode(m_data.value); if (m_propertyType == TypeCustomIndex) - return m_data.customIndex.getIndexValue(exec, slotBase(), m_data.customIndex.index); + return JSValue::decode(m_data.customIndex.getIndexValue(exec, JSValue::encode(slotBase()), JSValue::encode(m_thisValue), m_data.customIndex.index)); if (m_propertyType == TypeGetter) return functionGetter(exec); - return m_data.custom.getValue(exec, slotBase(), propertyName); + return JSValue::decode(m_data.custom.getValue(exec, JSValue::encode(slotBase()), JSValue::encode(m_thisValue), propertyName)); } ALWAYS_INLINE JSValue PropertySlot::getValue(ExecState* exec, unsigned propertyName) const @@ -1546,10 +1554,10 @@ ALWAYS_INLINE JSValue PropertySlot::getValue(ExecState* exec, unsigned propertyN if (m_propertyType == TypeValue) return JSValue::decode(m_data.value); if (m_propertyType == TypeCustomIndex) - return m_data.customIndex.getIndexValue(exec, slotBase(), m_data.customIndex.index); + return JSValue::decode(m_data.customIndex.getIndexValue(exec, JSValue::encode(slotBase()), JSValue::encode(m_thisValue), m_data.customIndex.index)); if (m_propertyType == TypeGetter) return functionGetter(exec); - return m_data.custom.getValue(exec, slotBase(), Identifier::from(exec, propertyName)); + return JSValue::decode(m_data.custom.getValue(exec, JSValue::encode(slotBase()), JSValue::encode(m_thisValue), Identifier::from(exec, propertyName))); } } // namespace JSC diff --git a/JavaScriptCore/runtime/JSPromise.cpp b/JavaScriptCore/runtime/JSPromise.cpp index 80e17ea0..9f182c95 100644 --- a/JavaScriptCore/runtime/JSPromise.cpp +++ b/JavaScriptCore/runtime/JSPromise.cpp @@ -31,48 +31,22 @@ #include "Error.h" #include "JSCJSValueInlines.h" #include "JSCellInlines.h" -#include "JSPromiseResolver.h" +#include "JSPromiseConstructor.h" +#include "JSPromiseReaction.h" +#include "Microtask.h" #include "SlotVisitorInlines.h" -#include "StrongInlines.h" #include "StructureInlines.h" namespace JSC { -class JSPromiseTaskContext : public TaskContext { -public: - static PassRefPtr create(VM& vm, JSPromise* promise) - { - return adoptRef(new JSPromiseTaskContext(vm, promise)); - } - - JSPromise& promise() const { return *m_promise.get(); } - -private: - JSPromiseTaskContext(VM& vm, JSPromise* promise) - { - m_promise.set(vm, promise); - } - - Strong m_promise; -}; +static void triggerPromiseReactions(VM&, JSGlobalObject*, Vector>&, JSValue); const ClassInfo JSPromise::s_info = { "Promise", &Base::s_info, 0, 0, CREATE_METHOD_TABLE(JSPromise) }; -JSPromise* JSPromise::create(VM& vm, Structure* structure) -{ - JSPromise* promise = new (NotNull, allocateCell(vm.heap)) JSPromise(vm, structure); - promise->finishCreation(vm); - return promise; -} - -JSPromise* JSPromise::createWithResolver(VM& vm, JSGlobalObject* globalObject) +JSPromise* JSPromise::create(VM& vm, JSGlobalObject* globalObject, JSPromiseConstructor* constructor) { JSPromise* promise = new (NotNull, allocateCell(vm.heap)) JSPromise(vm, globalObject->promiseStructure()); - promise->finishCreation(vm); - - JSPromiseResolver* resolver = JSPromiseResolver::create(vm, globalObject->promiseResolverStructure(), promise); - promise->setResolver(vm, resolver); - + promise->finishCreation(vm, constructor); return promise; } @@ -83,14 +57,16 @@ Structure* JSPromise::createStructure(VM& vm, JSGlobalObject* globalObject, JSVa JSPromise::JSPromise(VM& vm, Structure* structure) : JSDestructibleObject(vm, structure) - , m_state(Pending) + , m_status(Status::Unresolved) { } -void JSPromise::finishCreation(VM& vm) +void JSPromise::finishCreation(VM& vm, JSPromiseConstructor* constructor) { Base::finishCreation(vm); ASSERT(inherits(info())); + + m_constructor.set(vm, this, constructor); } void JSPromise::destroy(JSCell* cell) @@ -107,137 +83,87 @@ void JSPromise::visitChildren(JSCell* cell, SlotVisitor& visitor) Base::visitChildren(thisObject, visitor); - visitor.append(&thisObject->m_resolver); visitor.append(&thisObject->m_result); - - for (size_t i = 0; i < thisObject->m_fulfillCallbacks.size(); ++i) - visitor.append(&thisObject->m_fulfillCallbacks[i]); - for (size_t i = 0; i < thisObject->m_rejectCallbacks.size(); ++i) - visitor.append(&thisObject->m_rejectCallbacks[i]); + visitor.append(&thisObject->m_constructor); + visitor.append(thisObject->m_resolveReactions.begin(), thisObject->m_resolveReactions.end()); + visitor.append(thisObject->m_rejectReactions.begin(), thisObject->m_rejectReactions.end()); } -void JSPromise::setResolver(VM& vm, JSPromiseResolver* resolver) +void JSPromise::reject(VM& vm, JSValue reason) { - m_resolver.set(vm, this, resolver); -} + // 1. If the value of promise's internal slot [[PromiseStatus]] is not "unresolved", return. + if (m_status != Status::Unresolved) + return; -JSPromiseResolver* JSPromise::resolver() const -{ - return m_resolver.get(); -} + DeferGC deferGC(vm.heap); -void JSPromise::setResult(VM& vm, JSValue result) -{ - m_result.set(vm, this, result); -} + // 2. Let 'reactions' be the value of promise's [[RejectReactions]] internal slot. + Vector> reactions; + reactions.swap(m_rejectReactions); -JSValue JSPromise::result() const -{ - return m_result.get(); -} + // 3. Set the value of promise's [[Result]] internal slot to reason. + m_result.set(vm, this, reason); -void JSPromise::setState(JSPromise::State state) -{ - ASSERT(m_state == Pending); - m_state = state; -} + // 4. Set the value of promise's [[ResolveReactions]] internal slot to undefined. + m_resolveReactions.clear(); -JSPromise::State JSPromise::state() const -{ - return m_state; + // 5. Set the value of promise's [[RejectReactions]] internal slot to undefined. + // NOTE: Handled by the swap above. + + // 6. Set the value of promise's [[PromiseStatus]] internal slot to "has-rejection". + m_status = Status::HasRejection; + + // 7. Return the result of calling TriggerPromiseReactions(reactions, reason). + triggerPromiseReactions(vm, globalObject(), reactions, reason); } -void JSPromise::appendCallbacks(ExecState* exec, InternalFunction* fulfillCallback, InternalFunction* rejectCallback) +void JSPromise::resolve(VM& vm, JSValue resolution) { - // 1. Append fulfillCallback to promise's fulfill callbacks. - m_fulfillCallbacks.append(WriteBarrier(exec->vm(), this, fulfillCallback)); - - // 2. Append rejectCallback to promise' reject callbacks. - m_rejectCallbacks.append(WriteBarrier(exec->vm(), this, rejectCallback)); - - // 3. If promise's state is fulfilled, queue a task to process promise's fulfill callbacks with promise's result. - if (m_state == Fulfilled) { - queueTaskToProcessFulfillCallbacks(exec); + // 1. If the value of promise's internal slot [[PromiseStatus]] is not "unresolved", return. + if (m_status != Status::Unresolved) return; - } - // 4. If promise's state is rejected, queue a task to process promise's reject callbacks with promise's result. - if (m_state == Rejected) { - queueTaskToProcessRejectCallbacks(exec); - return; - } -} + DeferGC deferGC(vm.heap); -void JSPromise::queueTaskToProcessFulfillCallbacks(ExecState* exec) -{ - JSGlobalObject* globalObject = this->globalObject(); - if (globalObject->globalObjectMethodTable()->queueTaskToEventLoop) - globalObject->globalObjectMethodTable()->queueTaskToEventLoop(globalObject, processFulfillCallbacksForTask, JSPromiseTaskContext::create(exec->vm(), this)); - else - WTFLogAlways("ERROR: Event loop not supported."); -} + // 2. Let 'reactions' be the value of promise's [[ResolveReactions]] internal slot. + Vector> reactions; + reactions.swap(m_resolveReactions); + + // 3. Set the value of promise's [[Result]] internal slot to resolution. + m_result.set(vm, this, resolution); -void JSPromise::queueTaskToProcessRejectCallbacks(ExecState* exec) -{ - JSGlobalObject* globalObject = this->globalObject(); - if (globalObject->globalObjectMethodTable()->queueTaskToEventLoop) - globalObject->globalObjectMethodTable()->queueTaskToEventLoop(globalObject, processRejectCallbacksForTask, JSPromiseTaskContext::create(exec->vm(), this)); - else - WTFLogAlways("ERROR: Event loop not supported."); -} + // 4. Set the value of promise's [[ResolveReactions]] internal slot to undefined. + // NOTE: Handled by the swap above. -void JSPromise::processFulfillCallbacksForTask(ExecState* exec, TaskContext* taskContext) -{ - JSPromiseTaskContext* promiseTaskContext = static_cast(taskContext); - JSPromise& promise = promiseTaskContext->promise(); + // 5. Set the value of promise's [[RejectReactions]] internal slot to undefined. + m_rejectReactions.clear(); + + // 6. Set the value of promise's [[PromiseStatus]] internal slot to "has-resolution". + m_status = Status::HasResolution; - promise.processFulfillCallbacksWithValue(exec, promise.result()); + // 7. Return the result of calling TriggerPromiseReactions(reactions, resolution). + triggerPromiseReactions(vm, globalObject(), reactions, resolution); } -void JSPromise::processRejectCallbacksForTask(ExecState* exec, TaskContext* taskContext) +void JSPromise::appendResolveReaction(VM& vm, JSPromiseReaction* reaction) { - JSPromiseTaskContext* promiseTaskContext = static_cast(taskContext); - JSPromise& promise = promiseTaskContext->promise(); - - promise.processRejectCallbacksWithValue(exec, promise.result()); + m_resolveReactions.append(WriteBarrier(vm, this, reaction)); } -void JSPromise::processFulfillCallbacksWithValue(ExecState* exec, JSValue value) +void JSPromise::appendRejectReaction(VM& vm, JSPromiseReaction* reaction) { - ASSERT(m_state == Fulfilled); - - for (size_t i = 0; i < m_fulfillCallbacks.size(); ++i) { - JSValue callback = m_fulfillCallbacks[i].get(); - - CallData callData; - CallType callType = JSC::getCallData(callback, callData); - ASSERT(callType != CallTypeNone); - - MarkedArgumentBuffer arguments; - arguments.append(value); - call(exec, callback, callType, callData, this, arguments); - } - - m_fulfillCallbacks.clear(); + m_rejectReactions.append(WriteBarrier(vm, this, reaction)); } -void JSPromise::processRejectCallbacksWithValue(ExecState* exec, JSValue value) +void triggerPromiseReactions(VM& vm, JSGlobalObject* globalObject, Vector>& reactions, JSValue argument) { - ASSERT(m_state == Rejected); - - for (size_t i = 0; i < m_rejectCallbacks.size(); ++i) { - JSValue callback = m_rejectCallbacks[i].get(); - - CallData callData; - CallType callType = JSC::getCallData(callback, callData); - ASSERT(callType != CallTypeNone); - - MarkedArgumentBuffer arguments; - arguments.append(value); - call(exec, callback, callType, callData, this, arguments); + // 1. Repeat for each reaction in reactions, in original insertion order + for (auto& reaction : reactions) { + // i. Call QueueMicrotask(ExecutePromiseReaction, (reaction, argument)). + globalObject->queueMicrotask(createExecutePromiseReactionMicrotask(vm, reaction.get(), argument)); } - m_rejectCallbacks.clear(); + // 2. Return. } } // namespace JSC diff --git a/JavaScriptCore/runtime/JSPromise.h b/JavaScriptCore/runtime/JSPromise.h index 26d2e0b1..d1d1854d 100644 --- a/JavaScriptCore/runtime/JSPromise.h +++ b/JavaScriptCore/runtime/JSPromise.h @@ -32,61 +32,58 @@ namespace JSC { -class JSPromiseResolver; -class InternalFunction; -class TaskContext; +class JSPromiseReaction; +class JSPromiseConstructor; class JSPromise : public JSDestructibleObject { public: typedef JSDestructibleObject Base; - static JSPromise* create(VM&, Structure*); + static JSPromise* create(VM&, JSGlobalObject*, JSPromiseConstructor*); static Structure* createStructure(VM&, JSGlobalObject*, JSValue); - JS_EXPORT_PRIVATE static JSPromise* createWithResolver(VM&, JSGlobalObject*); - DECLARE_INFO; - void setResolver(VM&, JSPromiseResolver*); - JS_EXPORT_PRIVATE JSPromiseResolver* resolver() const; - - enum State { - Pending, - Fulfilled, - Rejected, + enum class Status { + Unresolved, + HasResolution, + HasRejection }; - void setState(State); - State state() const; + Status status() const + { + return m_status; + } - void setResult(VM&, JSValue); - JSValue result() const; + JSValue result() const + { + ASSERT(m_status != Status::Unresolved); + return m_result.get(); + } - void appendCallbacks(ExecState*, InternalFunction* fulfillCallback, InternalFunction* rejectCallback); + JSPromiseConstructor* constructor() const + { + return m_constructor.get(); + } - void queueTaskToProcessFulfillCallbacks(ExecState*); - void queueTaskToProcessRejectCallbacks(ExecState*); - void processFulfillCallbacksWithValue(ExecState*, JSValue); - void processRejectCallbacksWithValue(ExecState*, JSValue); + void reject(VM&, JSValue); + void resolve(VM&, JSValue); -protected: - void finishCreation(VM&); - static const unsigned StructureFlags = OverridesVisitChildren | JSObject::StructureFlags; + void appendResolveReaction(VM&, JSPromiseReaction*); + void appendRejectReaction(VM&, JSPromiseReaction*); private: JSPromise(VM&, Structure*); - - static void processFulfillCallbacksForTask(ExecState*, TaskContext*); - static void processRejectCallbacksForTask(ExecState*, TaskContext*); - + void finishCreation(VM&, JSPromiseConstructor*); + static const unsigned StructureFlags = OverridesVisitChildren | JSObject::StructureFlags; static void destroy(JSCell*); static void visitChildren(JSCell*, SlotVisitor&); - WriteBarrier m_resolver; + Status m_status; WriteBarrier m_result; - Vector> m_fulfillCallbacks; - Vector> m_rejectCallbacks; - State m_state; + WriteBarrier m_constructor; + Vector> m_resolveReactions; + Vector> m_rejectReactions; }; } // namespace JSC diff --git a/JavaScriptCore/runtime/JSPromiseCallback.cpp b/JavaScriptCore/runtime/JSPromiseCallback.cpp deleted file mode 100644 index 79d34214..00000000 --- a/JavaScriptCore/runtime/JSPromiseCallback.cpp +++ /dev/null @@ -1,196 +0,0 @@ -/* - * Copyright (C) 2013 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. - */ - -#include "config.h" -#include "JSPromiseCallback.h" - -#if ENABLE(PROMISES) - -#include "JSCJSValueInlines.h" -#include "JSCellInlines.h" -#include "JSPromise.h" -#include "JSPromiseResolver.h" -#include "SlotVisitorInlines.h" -#include "StructureInlines.h" - -namespace JSC { - -const ClassInfo JSPromiseCallback::s_info = { "Function", &Base::s_info, 0, 0, CREATE_METHOD_TABLE(JSPromiseCallback) }; - -JSPromiseCallback* JSPromiseCallback::create(VM& vm, Structure* structure, JSPromiseResolver* resolver, Algorithm algorithm) -{ - JSPromiseCallback* constructor = new (NotNull, allocateCell(vm.heap)) JSPromiseCallback(vm, structure, algorithm); - constructor->finishCreation(vm, resolver); - return constructor; -} - -Structure* JSPromiseCallback::createStructure(VM& vm, JSGlobalObject* globalObject, JSValue prototype) -{ - return Structure::create(vm, globalObject, prototype, TypeInfo(ObjectType, StructureFlags), info()); -} - -JSPromiseCallback::JSPromiseCallback(VM& vm, Structure* structure, Algorithm algorithm) - : InternalFunction(vm, structure) - , m_algorithm(algorithm) -{ -} - -void JSPromiseCallback::finishCreation(VM& vm, JSPromiseResolver* resolver) -{ - Base::finishCreation(vm, "PromiseCallback"); - m_resolver.set(vm, this, resolver); -} - -void JSPromiseCallback::visitChildren(JSCell* cell, SlotVisitor& visitor) -{ - JSPromiseCallback* thisObject = jsCast(cell); - ASSERT_GC_OBJECT_INHERITS(thisObject, info()); - COMPILE_ASSERT(StructureFlags & OverridesVisitChildren, OverridesVisitChildrenWithoutSettingFlag); - ASSERT(thisObject->structure()->typeInfo().overridesVisitChildren()); - - Base::visitChildren(thisObject, visitor); - - visitor.append(&thisObject->m_resolver); -} - -EncodedJSValue JSC_HOST_CALL JSPromiseCallback::callPromiseCallback(ExecState* exec) -{ - JSPromiseCallback* promiseCallback = jsCast(exec->callee()); - JSPromiseResolver* resolver = promiseCallback->m_resolver.get(); - - // 1. Let value be the first argument that is passed, and undefined otherwise. - JSValue value = exec->argument(0); - - // 2. Run resolver's algorithm with value and the synchronous flag set. - switch (promiseCallback->m_algorithm) { - case JSPromiseCallback::Fulfill: - resolver->fulfill(exec, value, JSPromiseResolver::ResolveSynchronously); - break; - - case JSPromiseCallback::Resolve: - resolver->resolve(exec, value, JSPromiseResolver::ResolveSynchronously); - break; - - case JSPromiseCallback::Reject: - resolver->reject(exec, value, JSPromiseResolver::ResolveSynchronously); - break; - } - - return JSValue::encode(jsUndefined()); -} - -CallType JSPromiseCallback::getCallData(JSCell*, CallData& callData) -{ - callData.native.function = callPromiseCallback; - return CallTypeHost; -} - - - - -const ClassInfo JSPromiseWrapperCallback::s_info = { "Function", &Base::s_info, 0, 0, CREATE_METHOD_TABLE(JSPromiseWrapperCallback) }; - -JSPromiseWrapperCallback* JSPromiseWrapperCallback::create(VM& vm, Structure* structure, JSPromiseResolver* resolver, JSValue callback) -{ - JSPromiseWrapperCallback* constructor = new (NotNull, allocateCell(vm.heap)) JSPromiseWrapperCallback(vm, structure); - constructor->finishCreation(vm, resolver, callback); - return constructor; -} - -Structure* JSPromiseWrapperCallback::createStructure(VM& vm, JSGlobalObject* globalObject, JSValue prototype) -{ - return Structure::create(vm, globalObject, prototype, TypeInfo(ObjectType, StructureFlags), info()); -} - -JSPromiseWrapperCallback::JSPromiseWrapperCallback(VM& vm, Structure* structure) - : InternalFunction(vm, structure) -{ -} - -void JSPromiseWrapperCallback::finishCreation(VM& vm, JSPromiseResolver* resolver, JSValue callback) -{ - Base::finishCreation(vm, "PromiseWrapperCallback"); - m_resolver.set(vm, this, resolver); - m_callback.set(vm, this, callback); -} - -void JSPromiseWrapperCallback::visitChildren(JSCell* cell, SlotVisitor& visitor) -{ - JSPromiseWrapperCallback* thisObject = jsCast(cell); - ASSERT_GC_OBJECT_INHERITS(thisObject, info()); - COMPILE_ASSERT(StructureFlags & OverridesVisitChildren, OverridesVisitChildrenWithoutSettingFlag); - ASSERT(thisObject->structure()->typeInfo().overridesVisitChildren()); - - Base::visitChildren(thisObject, visitor); - - visitor.append(&thisObject->m_resolver); - visitor.append(&thisObject->m_callback); -} - -EncodedJSValue JSC_HOST_CALL JSPromiseWrapperCallback::callPromiseWrapperCallback(ExecState* exec) -{ - JSPromiseWrapperCallback* promiseWrapperCallback = jsCast(exec->callee()); - - JSPromiseResolver* resolver = promiseWrapperCallback->m_resolver.get(); - JSValue callback = promiseWrapperCallback->m_callback.get(); - - // 1. Let argument be the first argument that is passed, and undefined otherwise. - JSValue argument = exec->argument(0); - - // 2. Set callback's callback this value to resolver's associated promise. - // 3. Let value be the result of invoking callback with argument as argument. - CallData callData; - CallType callType = JSC::getCallData(callback, callData); - ASSERT(callType != CallTypeNone); - - MarkedArgumentBuffer callbackArguments; - callbackArguments.append(argument); - JSValue value = JSC::call(exec, callback, callType, callData, resolver->promise(), callbackArguments); - - // 4. If invoking callback threw an exception, catch it and run resolver's reject - // with the thrown exception as argument and the synchronous flag set. - if (exec->hadException()) { - JSValue exception = exec->exception(); - exec->clearException(); - - resolver->reject(exec, exception, JSPromiseResolver::ResolveSynchronously); - return JSValue::encode(jsUndefined()); - } - - // 5. Otherwise, run resolver's resolve with value and the synchronous flag set. - resolver->resolve(exec, value, JSPromiseResolver::ResolveSynchronously); - - return JSValue::encode(jsUndefined()); -} - -CallType JSPromiseWrapperCallback::getCallData(JSCell*, CallData& callData) -{ - callData.native.function = callPromiseWrapperCallback; - return CallTypeHost; -} - -} // namespace JSC - -#endif // ENABLE(PROMISES) diff --git a/JavaScriptCore/runtime/JSPromiseCallback.h b/JavaScriptCore/runtime/JSPromiseCallback.h deleted file mode 100644 index ab9353ba..00000000 --- a/JavaScriptCore/runtime/JSPromiseCallback.h +++ /dev/null @@ -1,93 +0,0 @@ -/* - * Copyright (C) 2013 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. - */ - -#ifndef JSPromiseCallback_h -#define JSPromiseCallback_h - -#if ENABLE(PROMISES) - -#include "InternalFunction.h" - -namespace JSC { - -class JSPromiseResolver; - -class JSPromiseCallback : public InternalFunction { -public: - typedef InternalFunction Base; - - enum Algorithm { - Fulfill, - Resolve, - Reject, - }; - - static JSPromiseCallback* create(VM&, Structure*, JSPromiseResolver*, Algorithm); - static Structure* createStructure(VM&, JSGlobalObject*, JSValue); - - DECLARE_INFO; - -private: - JSPromiseCallback(VM&, Structure*, Algorithm); - void finishCreation(VM&, JSPromiseResolver*); - static const unsigned StructureFlags = OverridesVisitChildren | JSObject::StructureFlags; - - static EncodedJSValue JSC_HOST_CALL callPromiseCallback(ExecState*); - static CallType getCallData(JSCell*, CallData&); - - static void visitChildren(JSCell*, SlotVisitor&); - - WriteBarrier m_resolver; - Algorithm m_algorithm; -}; - -class JSPromiseWrapperCallback : public InternalFunction { -public: - typedef InternalFunction Base; - - static JSPromiseWrapperCallback* create(VM&, Structure*, JSPromiseResolver*, JSValue callback); - static Structure* createStructure(VM&, JSGlobalObject*, JSValue); - - DECLARE_INFO; - -private: - JSPromiseWrapperCallback(VM&, Structure*); - void finishCreation(VM&, JSPromiseResolver*, JSValue callback); - static const unsigned StructureFlags = OverridesVisitChildren | JSObject::StructureFlags; - - static EncodedJSValue JSC_HOST_CALL callPromiseWrapperCallback(ExecState*); - static CallType getCallData(JSCell*, CallData&); - - static void visitChildren(JSCell*, SlotVisitor&); - - WriteBarrier m_resolver; - WriteBarrier m_callback; -}; - -} // namespace JSC - -#endif // ENABLE(PROMISES) - -#endif // JSPromiseCallback_h diff --git a/JavaScriptCore/runtime/JSPromiseConstructor.cpp b/JavaScriptCore/runtime/JSPromiseConstructor.cpp index 88cfb489..e30ef326 100644 --- a/JavaScriptCore/runtime/JSPromiseConstructor.cpp +++ b/JavaScriptCore/runtime/JSPromiseConstructor.cpp @@ -32,23 +32,22 @@ #include "JSCJSValueInlines.h" #include "JSCellInlines.h" #include "JSPromise.h" -#include "JSPromiseCallback.h" +#include "JSPromiseDeferred.h" +#include "JSPromiseFunctions.h" #include "JSPromisePrototype.h" -#include "JSPromiseResolver.h" #include "Lookup.h" +#include "NumberObject.h" #include "StructureInlines.h" namespace JSC { STATIC_ASSERT_IS_TRIVIALLY_DESTRUCTIBLE(JSPromiseConstructor); -// static Promise fulfill(any value); -static EncodedJSValue JSC_HOST_CALL JSPromiseConstructorFuncFulfill(ExecState*); -// static Promise resolve(any value); // same as any(value) +static EncodedJSValue JSC_HOST_CALL JSPromiseConstructorFuncCast(ExecState*); static EncodedJSValue JSC_HOST_CALL JSPromiseConstructorFuncResolve(ExecState*); -// static Promise reject(any value); static EncodedJSValue JSC_HOST_CALL JSPromiseConstructorFuncReject(ExecState*); - +static EncodedJSValue JSC_HOST_CALL JSPromiseConstructorFuncRace(ExecState*); +static EncodedJSValue JSC_HOST_CALL JSPromiseConstructorFuncAll(ExecState*); } #include "JSPromiseConstructor.lut.h" @@ -59,9 +58,11 @@ const ClassInfo JSPromiseConstructor::s_info = { "Function", &InternalFunction:: /* Source for JSPromiseConstructor.lut.h @begin promiseConstructorTable - fulfill JSPromiseConstructorFuncFulfill DontEnum|Function 1 + cast JSPromiseConstructorFuncCast DontEnum|Function 1 resolve JSPromiseConstructorFuncResolve DontEnum|Function 1 reject JSPromiseConstructorFuncReject DontEnum|Function 1 + race JSPromiseConstructorFuncRace DontEnum|Function 1 + all JSPromiseConstructorFuncAll DontEnum|Function 1 @end */ @@ -91,39 +92,58 @@ void JSPromiseConstructor::finishCreation(VM& vm, JSPromisePrototype* promisePro static EncodedJSValue JSC_HOST_CALL constructPromise(ExecState* exec) { - if (!exec->argumentCount()) - return throwVMError(exec, createTypeError(exec, "Expected at least one argument")); + // NOTE: We ignore steps 1-4 as they only matter if you support subclassing, which we do not yet. + // 1. Let promise be the this value. + // 2. If Type(promise) is not Object, then throw a TypeError exception. + // 3. If promise does not have a [[PromiseStatus]] internal slot, then throw a TypeError exception. + // 4. If promise's [[PromiseStatus]] internal slot is not undefined, then throw a TypeError exception. - JSValue function = exec->uncheckedArgument(0); + JSValue resolver = exec->argument(0); + // 5. IsCallable(resolver) is false, then throw a TypeError exception CallData callData; - CallType callType = getCallData(function, callData); + CallType callType = getCallData(resolver, callData); if (callType == CallTypeNone) - return throwVMError(exec, createTypeError(exec, "Expected function as as first argument")); + return JSValue::encode(throwTypeError(exec, ASCIILiteral("Promise constructor takes a function argument"))); + + VM& vm = exec->vm(); + JSGlobalObject* globalObject = exec->callee()->globalObject(); + + JSPromise* promise = JSPromise::create(vm, globalObject, jsCast(exec->callee())); - JSGlobalObject* globalObject = asInternalFunction(exec->callee())->globalObject(); + // NOTE: Steps 6-8 are handled by JSPromise::create(). + // 6. Set promise's [[PromiseStatus]] internal slot to "unresolved". + // 7. Set promise's [[ResolveReactions]] internal slot to a new empty List. + // 8. Set promise's [[RejectReactions]] internal slot to a new empty List. - // 1. Let promise be a new promise. - JSPromise* promise = JSPromise::createWithResolver(exec->vm(), globalObject); + // 9. Let 'resolve' be a new built-in function object as defined in Resolve Promise Functions. + JSFunction* resolve = createResolvePromiseFunction(vm, globalObject); - // 2. Let resolver be promise's associated resolver. - JSPromiseResolver* resolver = promise->resolver(); + // 10. Set the [[Promise]] internal slot of 'resolve' to 'promise'. + resolve->putDirect(vm, vm.propertyNames->promisePrivateName, promise); + + // 11. Let 'reject' be a new built-in function object as defined in Reject Promise Functions + JSFunction* reject = createRejectPromiseFunction(vm, globalObject); + + // 12. Set the [[Promise]] internal slot of 'reject' to 'promise'. + reject->putDirect(vm, vm.propertyNames->promisePrivateName, promise); - // 3. Set init's callback this value to promise. - // 4. Invoke init with resolver passed as parameter. - MarkedArgumentBuffer initArguments; - initArguments.append(resolver); - call(exec, function, callType, callData, promise, initArguments); + // 13. Let 'result' be the result of calling the [[Call]] internal method of resolver with + // undefined as thisArgument and a List containing resolve and reject as argumentsList. + MarkedArgumentBuffer arguments; + arguments.append(resolve); + arguments.append(reject); + call(exec, resolver, callType, callData, jsUndefined(), arguments); - // 5. If init threw an exception, catch it, and then, if resolver's resolved flag - // is unset, run resolver's reject with the thrown exception as argument. + // 14. If result is an abrupt completion, call PromiseReject(promise, result.[[value]]). if (exec->hadException()) { JSValue exception = exec->exception(); exec->clearException(); - resolver->rejectIfNotResolved(exec, exception); + promise->reject(vm, exception); } + // 15. Return promise. return JSValue::encode(promise); } @@ -133,9 +153,10 @@ ConstructType JSPromiseConstructor::getConstructData(JSCell*, ConstructData& con return ConstructTypeHost; } -CallType JSPromiseConstructor::getCallData(JSCell*, CallData&) +CallType JSPromiseConstructor::getCallData(JSCell*, CallData& callData) { - return CallTypeNone; + callData.native.function = constructPromise; + return CallTypeHost; } bool JSPromiseConstructor::getOwnPropertySlot(JSObject* object, ExecState* exec, PropertyName propertyName, PropertySlot& slot) @@ -143,43 +164,391 @@ bool JSPromiseConstructor::getOwnPropertySlot(JSObject* object, ExecState* exec, return getStaticFunctionSlot(exec, ExecState::promiseConstructorTable(exec), jsCast(object), propertyName, slot); } -EncodedJSValue JSC_HOST_CALL JSPromiseConstructorFuncFulfill(ExecState* exec) +EncodedJSValue JSC_HOST_CALL JSPromiseConstructorFuncCast(ExecState* exec) { - if (!exec->argumentCount()) - return throwVMError(exec, createTypeError(exec, "Expected at least one argument")); + // -- Promise.cast(x) -- + JSValue x = exec->argument(0); + + // 1. Let 'C' be the this value. + JSValue C = exec->thisValue(); + + // 2. If IsPromise(x) is true, + JSPromise* promise = jsDynamicCast(x); + if (promise) { + // i. Let 'constructor' be the value of x's [[PromiseConstructor]] internal slot. + JSValue constructor = promise->constructor(); + // ii. If SameValue(constructor, C) is true, return x. + if (sameValue(exec, constructor, C)) + return JSValue::encode(x); + } - JSGlobalObject* globalObject = exec->callee()->globalObject(); + // 3. Let 'deferred' be the result of calling GetDeferred(C). + JSValue deferredValue = createJSPromiseDeferredFromConstructor(exec, C); + + // 4. ReturnIfAbrupt(deferred). + if (exec->hadException()) + return JSValue::encode(jsUndefined()); - JSPromise* promise = JSPromise::createWithResolver(exec->vm(), globalObject); - promise->resolver()->fulfill(exec, exec->uncheckedArgument(0)); + JSPromiseDeferred* deferred = jsCast(deferredValue); - return JSValue::encode(promise); + // 5. Let 'resolveResult' be the result of calling the [[Call]] internal method + // of deferred.[[Resolve]] with undefined as thisArgument and a List containing x + // as argumentsList. + performDeferredResolve(exec, deferred, x); + + // 6. ReturnIfAbrupt(resolveResult). + if (exec->hadException()) + return JSValue::encode(jsUndefined()); + + // 7. Return deferred.[[Promise]]. + return JSValue::encode(deferred->promise()); } EncodedJSValue JSC_HOST_CALL JSPromiseConstructorFuncResolve(ExecState* exec) { - if (!exec->argumentCount()) - return throwVMError(exec, createTypeError(exec, "Expected at least one argument")); + // -- Promise.resolve(x) -- + JSValue x = exec->argument(0); - JSGlobalObject* globalObject = exec->callee()->globalObject(); + // 1. Let 'C' be the this value. + JSValue C = exec->thisValue(); - JSPromise* promise = JSPromise::createWithResolver(exec->vm(), globalObject); - promise->resolver()->resolve(exec, exec->uncheckedArgument(0)); + // 2. Let 'deferred' be the result of calling GetDeferred(C). + JSValue deferredValue = createJSPromiseDeferredFromConstructor(exec, C); - return JSValue::encode(promise); + // 3. ReturnIfAbrupt(deferred). + if (exec->hadException()) + return JSValue::encode(jsUndefined()); + + JSPromiseDeferred* deferred = jsCast(deferredValue); + + // 4. Let 'resolveResult' be the result of calling the [[Call]] internal method + // of deferred.[[Resolve]] with undefined as thisArgument and a List containing x + // as argumentsList. + performDeferredResolve(exec, deferred, x); + + // 5. ReturnIfAbrupt(resolveResult). + if (exec->hadException()) + return JSValue::encode(jsUndefined()); + + // 6. Return deferred.[[Promise]]. + return JSValue::encode(deferred->promise()); } EncodedJSValue JSC_HOST_CALL JSPromiseConstructorFuncReject(ExecState* exec) { - if (!exec->argumentCount()) - return throwVMError(exec, createTypeError(exec, "Expected at least one argument")); + // -- Promise.reject(x) -- + JSValue r = exec->argument(0); - JSGlobalObject* globalObject = exec->callee()->globalObject(); + // 1. Let 'C' be the this value. + JSValue C = exec->thisValue(); - JSPromise* promise = JSPromise::createWithResolver(exec->vm(), globalObject); - promise->resolver()->reject(exec, exec->uncheckedArgument(0)); + // 2. Let 'deferred' be the result of calling GetDeferred(C). + JSValue deferredValue = createJSPromiseDeferredFromConstructor(exec, C); - return JSValue::encode(promise); + // 3. ReturnIfAbrupt(deferred). + if (exec->hadException()) + return JSValue::encode(jsUndefined()); + + JSPromiseDeferred* deferred = jsCast(deferredValue); + + // 4. Let 'rejectResult' be the result of calling the [[Call]] internal method + // of deferred.[[Reject]] with undefined as thisArgument and a List containing r + // as argumentsList. + performDeferredReject(exec, deferred, r); + + // 5. ReturnIfAbrupt(resolveResult). + if (exec->hadException()) + return JSValue::encode(jsUndefined()); + + // 6. Return deferred.[[Promise]]. + return JSValue::encode(deferred->promise()); +} + +EncodedJSValue JSC_HOST_CALL JSPromiseConstructorFuncRace(ExecState* exec) +{ + // -- Promise.race(iterable) -- + JSValue iterable = exec->argument(0); + VM& vm = exec->vm(); + + // 1. Let 'C' be the this value. + JSValue C = exec->thisValue(); + + // 2. Let 'deferred' be the result of calling GetDeferred(C). + JSValue deferredValue = createJSPromiseDeferredFromConstructor(exec, C); + + // 3. ReturnIfAbrupt(deferred). + if (exec->hadException()) + return JSValue::encode(jsUndefined()); + + JSPromiseDeferred* deferred = jsCast(deferredValue); + + // 4. Let 'iterator' be the result of calling GetIterator(iterable). + JSValue iteratorFunction = iterable.get(exec, vm.propertyNames->iteratorPrivateName); + if (exec->hadException()) + return JSValue::encode(abruptRejection(exec, deferred)); + + CallData iteratorFunctionCallData; + CallType iteratorFunctionCallType = getCallData(iteratorFunction, iteratorFunctionCallData); + if (iteratorFunctionCallType == CallTypeNone) { + throwTypeError(exec); + return JSValue::encode(abruptRejection(exec, deferred)); + } + + ArgList iteratorFunctionArguments; + JSValue iterator = call(exec, iteratorFunction, iteratorFunctionCallType, iteratorFunctionCallData, iterable, iteratorFunctionArguments); + + // 5. RejectIfAbrupt(iterator, deferred). + if (exec->hadException()) + return JSValue::encode(abruptRejection(exec, deferred)); + + // 6. Repeat + do { + // i. Let 'next' be the result of calling IteratorStep(iterator). + JSValue nextFunction = iterator.get(exec, exec->vm().propertyNames->iteratorNextPrivateName); + if (exec->hadException()) + return JSValue::encode(abruptRejection(exec, deferred)); + + CallData nextFunctionCallData; + CallType nextFunctionCallType = getCallData(nextFunction, nextFunctionCallData); + if (nextFunctionCallType == CallTypeNone) { + throwTypeError(exec); + return JSValue::encode(abruptRejection(exec, deferred)); + } + + MarkedArgumentBuffer nextFunctionArguments; + nextFunctionArguments.append(jsUndefined()); + JSValue next = call(exec, nextFunction, nextFunctionCallType, nextFunctionCallData, iterator, nextFunctionArguments); + + // ii. RejectIfAbrupt(next, deferred). + if (exec->hadException()) + return JSValue::encode(abruptRejection(exec, deferred)); + + // iii. If 'next' is false, return deferred.[[Promise]]. + // Note: We implement this as an iterationTerminator + if (next == vm.iterationTerminator.get()) + return JSValue::encode(deferred->promise()); + + // iv. Let 'nextValue' be the result of calling IteratorValue(next). + // v. RejectIfAbrupt(nextValue, deferred). + // Note: 'next' is already the value, so there is nothing to do here. + + // vi. Let 'nextPromise' be the result of calling Invoke(C, "cast", (nextValue)). + JSValue castFunction = C.get(exec, vm.propertyNames->cast); + if (exec->hadException()) + return JSValue::encode(abruptRejection(exec, deferred)); + + CallData castFunctionCallData; + CallType castFunctionCallType = getCallData(castFunction, castFunctionCallData); + if (castFunctionCallType == CallTypeNone) { + throwTypeError(exec); + return JSValue::encode(abruptRejection(exec, deferred)); + } + + MarkedArgumentBuffer castFunctionArguments; + castFunctionArguments.append(next); + JSValue nextPromise = call(exec, castFunction, castFunctionCallType, castFunctionCallData, C, castFunctionArguments); + + // vii. RejectIfAbrupt(nextPromise, deferred). + if (exec->hadException()) + return JSValue::encode(abruptRejection(exec, deferred)); + + // viii. Let 'result' be the result of calling Invoke(nextPromise, "then", (deferred.[[Resolve]], deferred.[[Reject]])). + JSValue thenFunction = nextPromise.get(exec, vm.propertyNames->then); + if (exec->hadException()) + return JSValue::encode(abruptRejection(exec, deferred)); + + CallData thenFunctionCallData; + CallType thenFunctionCallType = getCallData(thenFunction, thenFunctionCallData); + if (thenFunctionCallType == CallTypeNone) { + throwTypeError(exec); + return JSValue::encode(abruptRejection(exec, deferred)); + } + + MarkedArgumentBuffer thenFunctionArguments; + thenFunctionArguments.append(deferred->resolve()); + thenFunctionArguments.append(deferred->reject()); + + call(exec, thenFunction, thenFunctionCallType, thenFunctionCallData, nextPromise, thenFunctionArguments); + + // ix. RejectIfAbrupt(result, deferred). + if (exec->hadException()) + return JSValue::encode(abruptRejection(exec, deferred)); + } while (true); +} + +EncodedJSValue JSC_HOST_CALL JSPromiseConstructorFuncAll(ExecState* exec) +{ + // -- Promise.all(iterable) -- + + JSValue iterable = exec->argument(0); + VM& vm = exec->vm(); + + // 1. Let 'C' be the this value. + JSValue C = exec->thisValue(); + + // 2. Let 'deferred' be the result of calling GetDeferred(C). + JSValue deferredValue = createJSPromiseDeferredFromConstructor(exec, C); + + // 3. ReturnIfAbrupt(deferred). + if (exec->hadException()) + return JSValue::encode(jsUndefined()); + + // NOTE: A non-abrupt completion of createJSPromiseDeferredFromConstructor implies that + // C and deferredValue are objects. + JSObject* thisObject = asObject(C); + JSPromiseDeferred* deferred = jsCast(deferredValue); + + // 4. Let 'iterator' be the result of calling GetIterator(iterable). + JSValue iteratorFunction = iterable.get(exec, vm.propertyNames->iteratorPrivateName); + if (exec->hadException()) + return JSValue::encode(abruptRejection(exec, deferred)); + + CallData iteratorFunctionCallData; + CallType iteratorFunctionCallType = getCallData(iteratorFunction, iteratorFunctionCallData); + if (iteratorFunctionCallType == CallTypeNone) { + throwTypeError(exec); + return JSValue::encode(abruptRejection(exec, deferred)); + } + + ArgList iteratorFunctionArguments; + JSValue iterator = call(exec, iteratorFunction, iteratorFunctionCallType, iteratorFunctionCallData, iterable, iteratorFunctionArguments); + + // 5. RejectIfAbrupt(iterator, deferred). + if (exec->hadException()) + return JSValue::encode(abruptRejection(exec, deferred)); + + // 6. Let 'values' be the result of calling ArrayCreate(0). + JSArray* values = constructEmptyArray(exec, nullptr, thisObject->globalObject()); + + // 7. Let 'countdownHolder' be Record { [[Countdown]]: 0 }. + NumberObject* countdownHolder = constructNumber(exec, thisObject->globalObject(), JSValue(0)); + + // 8. Let 'index' be 0. + unsigned index = 0; + + // 9. Repeat. + do { + // i. Let 'next' be the result of calling IteratorStep(iterator). + JSValue nextFunction = iterator.get(exec, exec->vm().propertyNames->iteratorNextPrivateName); + if (exec->hadException()) + return JSValue::encode(abruptRejection(exec, deferred)); + + CallData nextFunctionCallData; + CallType nextFunctionCallType = getCallData(nextFunction, nextFunctionCallData); + if (nextFunctionCallType == CallTypeNone) { + throwTypeError(exec); + return JSValue::encode(abruptRejection(exec, deferred)); + } + + MarkedArgumentBuffer nextFunctionArguments; + nextFunctionArguments.append(jsUndefined()); + JSValue next = call(exec, nextFunction, nextFunctionCallType, nextFunctionCallData, iterator, nextFunctionArguments); + + // ii. RejectIfAbrupt(next, deferred). + if (exec->hadException()) + return JSValue::encode(abruptRejection(exec, deferred)); + + // iii. If 'next' is false, + // Note: We implement this as an iterationTerminator + if (next == vm.iterationTerminator.get()) { + // a. If 'index' is 0, + if (!index) { + // a. Let 'resolveResult' be the result of calling the [[Call]] internal method + // of deferred.[[Resolve]] with undefined as thisArgument and a List containing + // values as argumentsList. + performDeferredResolve(exec, deferred, values); + + // b. ReturnIfAbrupt(resolveResult). + if (exec->hadException()) + return JSValue::encode(jsUndefined()); + } + + // b. Return deferred.[[Promise]]. + return JSValue::encode(deferred->promise()); + } + + // iv. Let 'nextValue' be the result of calling IteratorValue(next). + // v. RejectIfAbrupt(nextValue, deferred). + // Note: 'next' is already the value, so there is nothing to do here. + + // vi. Let 'nextPromise' be the result of calling Invoke(C, "cast", (nextValue)). + JSValue castFunction = C.get(exec, vm.propertyNames->cast); + if (exec->hadException()) + return JSValue::encode(abruptRejection(exec, deferred)); + + CallData castFunctionCallData; + CallType castFunctionCallType = getCallData(castFunction, castFunctionCallData); + if (castFunctionCallType == CallTypeNone) { + throwTypeError(exec); + return JSValue::encode(abruptRejection(exec, deferred)); + } + + MarkedArgumentBuffer castFunctionArguments; + castFunctionArguments.append(next); + JSValue nextPromise = call(exec, castFunction, castFunctionCallType, castFunctionCallData, C, castFunctionArguments); + + // vii. RejectIfAbrupt(nextPromise, deferred). + if (exec->hadException()) + return JSValue::encode(abruptRejection(exec, deferred)); + + // viii. Let 'countdownFunction' be a new built-in function object as defined in Promise.all Countdown Functions. + JSFunction* countdownFunction = createPromiseAllCountdownFunction(vm, thisObject->globalObject()); + + // ix. Set the [[Index]] internal slot of 'countdownFunction' to 'index'. + countdownFunction->putDirect(vm, vm.propertyNames->indexPrivateName, JSValue(index)); + + // x. Set the [[Values]] internal slot of 'countdownFunction' to 'values'. + countdownFunction->putDirect(vm, vm.propertyNames->valuesPrivateName, values); + + // xi. Set the [[Deferred]] internal slot of 'countdownFunction' to 'deferred'. + countdownFunction->putDirect(vm, vm.propertyNames->deferredPrivateName, deferred); + + // xii. Set the [[CountdownHolder]] internal slot of 'countdownFunction' to 'countdownHolder'. + countdownFunction->putDirect(vm, vm.propertyNames->countdownHolderPrivateName, countdownHolder); + + // xiii. Let 'result' be the result of calling Invoke(nextPromise, "then", (countdownFunction, deferred.[[Reject]])). + JSValue thenFunction = nextPromise.get(exec, vm.propertyNames->then); + if (exec->hadException()) + return JSValue::encode(abruptRejection(exec, deferred)); + + CallData thenFunctionCallData; + CallType thenFunctionCallType = getCallData(thenFunction, thenFunctionCallData); + if (thenFunctionCallType == CallTypeNone) { + throwTypeError(exec); + return JSValue::encode(abruptRejection(exec, deferred)); + } + + MarkedArgumentBuffer thenFunctionArguments; + thenFunctionArguments.append(countdownFunction); + thenFunctionArguments.append(deferred->reject()); + + call(exec, thenFunction, thenFunctionCallType, thenFunctionCallData, nextPromise, thenFunctionArguments); + + // xiv. RejectIfAbrupt(result, deferred). + if (exec->hadException()) + return JSValue::encode(abruptRejection(exec, deferred)); + + // xv. Set index to index + 1. + index++; + + // xvi. Set countdownHolder.[[Countdown]] to countdownHolder.[[Countdown]] + 1. + uint32_t newCountdownValue = countdownHolder->internalValue().asUInt32() + 1; + countdownHolder->setInternalValue(vm, JSValue(newCountdownValue)); + } while (true); +} + +JSPromise* constructPromise(ExecState* exec, JSGlobalObject* globalObject, JSFunction* resolver) +{ + JSPromiseConstructor* promiseConstructor = globalObject->promiseConstructor(); + + ConstructData constructData; + ConstructType constructType = getConstructData(promiseConstructor, constructData); + ASSERT(constructType != ConstructTypeNone); + + MarkedArgumentBuffer arguments; + arguments.append(resolver); + + return jsCast(construct(exec, promiseConstructor, constructType, constructData, arguments)); } } // namespace JSC diff --git a/JavaScriptCore/runtime/JSPromiseConstructor.h b/JavaScriptCore/runtime/JSPromiseConstructor.h index 601e9551..498bb8b5 100644 --- a/JavaScriptCore/runtime/JSPromiseConstructor.h +++ b/JavaScriptCore/runtime/JSPromiseConstructor.h @@ -32,6 +32,7 @@ namespace JSC { +class JSPromise; class JSPromisePrototype; class JSPromiseConstructor : public InternalFunction { @@ -54,6 +55,8 @@ class JSPromiseConstructor : public InternalFunction { static bool getOwnPropertySlot(JSObject*, ExecState*, PropertyName, PropertySlot&); }; +JSPromise* constructPromise(ExecState*, JSGlobalObject*, JSFunction*); + } // namespace JSC #endif // ENABLE(PROMISES) diff --git a/JavaScriptCore/runtime/JSPromiseDeferred.cpp b/JavaScriptCore/runtime/JSPromiseDeferred.cpp new file mode 100644 index 00000000..cbc42eb9 --- /dev/null +++ b/JavaScriptCore/runtime/JSPromiseDeferred.cpp @@ -0,0 +1,246 @@ +/* + * Copyright (C) 2013 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. + */ + +#include "config.h" +#include "JSPromiseDeferred.h" + +#include "Error.h" +#include "JSCJSValueInlines.h" +#include "JSCellInlines.h" +#include "JSPromise.h" +#include "JSPromiseConstructor.h" +#include "JSPromiseFunctions.h" +#include "SlotVisitorInlines.h" + +namespace JSC { + +const ClassInfo JSPromiseDeferred::s_info = { "JSPromiseDeferred", 0, 0, 0, CREATE_METHOD_TABLE(JSPromiseDeferred) }; + +JSPromiseDeferred* JSPromiseDeferred::create(ExecState* exec, JSGlobalObject* globalObject) +{ + VM& vm = exec->vm(); + + JSFunction* resolver = createDeferredConstructionFunction(vm, globalObject); + + JSPromise* promise = constructPromise(exec, globalObject, resolver); + JSValue resolve = resolver->get(exec, vm.propertyNames->resolvePrivateName); + JSValue reject = resolver->get(exec, vm.propertyNames->rejectPrivateName); + + return JSPromiseDeferred::create(vm, promise, resolve, reject); +} + +JSPromiseDeferred* JSPromiseDeferred::create(VM& vm, JSObject* promise, JSValue resolve, JSValue reject) +{ + JSPromiseDeferred* deferred = new (NotNull, allocateCell(vm.heap)) JSPromiseDeferred(vm); + deferred->finishCreation(vm, promise, resolve, reject); + return deferred; +} + +JSPromiseDeferred::JSPromiseDeferred(VM& vm) + : Base(vm, vm.promiseDeferredStructure.get()) +{ +} + +void JSPromiseDeferred::finishCreation(VM& vm, JSObject* promise, JSValue resolve, JSValue reject) +{ + Base::finishCreation(vm); + m_promise.set(vm, this, promise); + m_resolve.set(vm, this, resolve); + m_reject.set(vm, this, reject); +} + +void JSPromiseDeferred::visitChildren(JSCell* cell, SlotVisitor& visitor) +{ + JSPromiseDeferred* thisObject = jsCast(cell); + ASSERT_GC_OBJECT_INHERITS(thisObject, info()); + COMPILE_ASSERT(StructureFlags & OverridesVisitChildren, OverridesVisitChildrenWithoutSettingFlag); + ASSERT(thisObject->structure()->typeInfo().overridesVisitChildren()); + + Base::visitChildren(thisObject, visitor); + + visitor.append(&thisObject->m_promise); + visitor.append(&thisObject->m_resolve); + visitor.append(&thisObject->m_reject); +} + +JSValue createJSPromiseDeferredFromConstructor(ExecState* exec, JSValue C) +{ + // -- This implements the GetDeferred(C) abstract operation -- + + // 1. If IsConstructor(C) is false, throw a TypeError. + if (!C.isObject()) + return throwTypeError(exec); + + ConstructData constructData; + ConstructType constructType = getConstructData(C, constructData); + if (constructType == ConstructTypeNone) + return throwTypeError(exec); + + VM& vm = exec->vm(); + + // 2. Let 'resolver' be a new built-in function object as defined in Deferred Construction Functions. + JSFunction* resolver = createDeferredConstructionFunction(vm, asObject(C)->globalObject()); + + // 3. Let 'promise' be the result of calling the [[Construct]] internal method of 'C' with + // an argument list containing the single item resolver. + MarkedArgumentBuffer constructArguments; + constructArguments.append(resolver); + JSObject* promise = construct(exec, C, constructType, constructData, constructArguments); + + // 4. ReturnIfAbrupt(promise). + if (exec->hadException()) + return jsUndefined(); + + // 5. Let 'resolve' be the value of resolver's [[Resolve]] internal slot. + JSValue resolve = resolver->get(exec, vm.propertyNames->resolvePrivateName); + + // 6. If IsCallable(resolve) is false, throw a TypeError. + CallData resolveCallData; + CallType resolveCallType = getCallData(resolve, resolveCallData); + if (resolveCallType == CallTypeNone) + return throwTypeError(exec); + + // 7. Let 'reject' be the value of resolver's [[Reject]] internal slot. + JSValue reject = resolver->get(exec, vm.propertyNames->rejectPrivateName); + + // 8. If IsCallable(reject) is false, throw a TypeError. + CallData rejectCallData; + CallType rejectCallType = getCallData(reject, rejectCallData); + if (rejectCallType == CallTypeNone) + return throwTypeError(exec); + + // 9. Return the Deferred { [[Promise]]: promise, [[Resolve]]: resolve, [[Reject]]: reject }. + return JSPromiseDeferred::create(exec->vm(), promise, resolve, reject); +} + +ThenableStatus updateDeferredFromPotentialThenable(ExecState* exec, JSValue x, JSPromiseDeferred* deferred) +{ + // 1. If Type(x) is not Object, return "not a thenable". + if (!x.isObject()) + return NotAThenable; + + // 2. Let 'then' be the result of calling Get(x, "then"). + JSValue thenValue = x.get(exec, exec->vm().propertyNames->then); + + // 3. If then is an abrupt completion, + if (exec->hadException()) { + // i. Let 'rejectResult' be the result of calling the [[Call]] internal method of + // deferred.[[Reject]] with undefined as thisArgument and a List containing + // then.[[value]] as argumentsList. + JSValue exception = exec->exception(); + exec->clearException(); + + performDeferredReject(exec, deferred, exception); + + // ii. ReturnIfAbrupt(rejectResult). + // NOTE: Nothing to do. + + // iii. Return. + return WasAThenable; + } + + // 4. Let 'then' be then.[[value]]. + // Note: Nothing to do. + + // 5. If IsCallable(then) is false, return "not a thenable". + CallData thenCallData; + CallType thenCallType = getCallData(thenValue, thenCallData); + if (thenCallType == CallTypeNone) + return NotAThenable; + + // 6. Let 'thenCallResult' be the result of calling the [[Call]] internal method of + // 'then' passing x as thisArgument and a List containing deferred.[[Resolve]] and + // deferred.[[Reject]] as argumentsList. + MarkedArgumentBuffer thenArguments; + thenArguments.append(deferred->resolve()); + thenArguments.append(deferred->reject()); + + call(exec, thenValue, thenCallType, thenCallData, x, thenArguments); + + // 7. If 'thenCallResult' is an abrupt completion, + if (exec->hadException()) { + // i. Let 'rejectResult' be the result of calling the [[Call]] internal method of + // deferred.[[Reject]] with undefined as thisArgument and a List containing + // thenCallResult.[[value]] as argumentsList. + JSValue exception = exec->exception(); + exec->clearException(); + + performDeferredReject(exec, deferred, exception); + + // ii. ReturnIfAbrupt(rejectResult). + // NOTE: Nothing to do. + } + + return WasAThenable; +} + +void performDeferredResolve(ExecState* exec, JSPromiseDeferred* deferred, JSValue argument) +{ + JSValue deferredResolve = deferred->resolve(); + + CallData resolveCallData; + CallType resolveCallType = getCallData(deferredResolve, resolveCallData); + ASSERT(resolveCallType != CallTypeNone); + + MarkedArgumentBuffer arguments; + arguments.append(argument); + + call(exec, deferredResolve, resolveCallType, resolveCallData, jsUndefined(), arguments); +} + +void performDeferredReject(ExecState* exec, JSPromiseDeferred* deferred, JSValue argument) +{ + JSValue deferredReject = deferred->reject(); + + CallData rejectCallData; + CallType rejectCallType = getCallData(deferredReject, rejectCallData); + ASSERT(rejectCallType != CallTypeNone); + + MarkedArgumentBuffer arguments; + arguments.append(argument); + + call(exec, deferredReject, rejectCallType, rejectCallData, jsUndefined(), arguments); +} + +JSValue abruptRejection(ExecState* exec, JSPromiseDeferred* deferred) +{ + ASSERT(exec->hadException()); + JSValue argument = exec->exception(); + exec->clearException(); + + // i. Let 'rejectResult' be the result of calling the [[Call]] internal method + // of deferred.[[Reject]] with undefined as thisArgument and a List containing + // argument.[[value]] as argumentsList. + performDeferredReject(exec, deferred, argument); + + // ii. ReturnIfAbrupt(rejectResult). + if (exec->hadException()) + return jsUndefined(); + + // iii. Return deferred.[[Promise]]. + return deferred->promise(); +} + +} // namespace JSC diff --git a/JavaScriptCore/runtime/JSPromiseDeferred.h b/JavaScriptCore/runtime/JSPromiseDeferred.h new file mode 100644 index 00000000..ff509d77 --- /dev/null +++ b/JavaScriptCore/runtime/JSPromiseDeferred.h @@ -0,0 +1,80 @@ +/* + * Copyright (C) 2013 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. + */ + +#ifndef JSPromiseDeferred_h +#define JSPromiseDeferred_h + +#include "JSCell.h" +#include "Structure.h" + +namespace JSC { + +class JSPromiseDeferred : public JSCell { +public: + typedef JSCell Base; + + JS_EXPORT_PRIVATE static JSPromiseDeferred* create(ExecState*, JSGlobalObject*); + JS_EXPORT_PRIVATE static JSPromiseDeferred* create(VM&, JSObject* promise, JSValue resolve, JSValue reject); + + static Structure* createStructure(VM& vm, JSGlobalObject* globalObject, JSValue prototype) + { + return Structure::create(vm, globalObject, prototype, TypeInfo(CompoundType, StructureFlags), info()); + } + + static const bool hasImmortalStructure = true; + + DECLARE_EXPORT_INFO; + + JSObject* promise() const { return m_promise.get(); } + JSValue resolve() const { return m_resolve.get(); } + JSValue reject() const { return m_reject.get(); } + +private: + JSPromiseDeferred(VM&); + void finishCreation(VM&, JSObject*, JSValue, JSValue); + static const unsigned StructureFlags = OverridesVisitChildren | Base::StructureFlags; + static void visitChildren(JSCell*, SlotVisitor&); + + WriteBarrier m_promise; + WriteBarrier m_resolve; + WriteBarrier m_reject; +}; + +enum ThenableStatus { + WasAThenable, + NotAThenable +}; + +JSValue createJSPromiseDeferredFromConstructor(ExecState*, JSValue constructor); +ThenableStatus updateDeferredFromPotentialThenable(ExecState*, JSValue, JSPromiseDeferred*); + +void performDeferredResolve(ExecState*, JSPromiseDeferred*, JSValue argument); +void performDeferredReject(ExecState*, JSPromiseDeferred*, JSValue argument); + +JSValue abruptRejection(ExecState*, JSPromiseDeferred*); + +} // namespace JSC + +#endif // JSPromiseDeferred_h diff --git a/JavaScriptCore/runtime/JSPromiseFunctions.cpp b/JavaScriptCore/runtime/JSPromiseFunctions.cpp new file mode 100644 index 00000000..139d280e --- /dev/null +++ b/JavaScriptCore/runtime/JSPromiseFunctions.cpp @@ -0,0 +1,274 @@ +/* + * Copyright (C) 2013 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. + */ + +#include "config.h" +#include "JSPromiseFunctions.h" + +#if ENABLE(PROMISES) + +#include "Error.h" +#include "JSCJSValueInlines.h" +#include "JSCellInlines.h" +#include "JSPromise.h" +#include "JSPromiseConstructor.h" +#include "JSPromiseDeferred.h" +#include "NumberObject.h" + +namespace JSC { + +// Deferred Construction Functions +static EncodedJSValue JSC_HOST_CALL deferredConstructionFunction(ExecState* exec) +{ + JSObject* F = exec->callee(); + + VM& vm = exec->vm(); + + // 1. Set F's [[Resolve]] internal slot to resolve. + F->putDirect(vm, vm.propertyNames->resolvePrivateName, exec->argument(0)); + + // 2. Set F's [[Reject]] internal slot to reject. + F->putDirect(vm, vm.propertyNames->rejectPrivateName, exec->argument(1)); + + // 3. Return. + return JSValue::encode(jsUndefined()); +} + +JSFunction* createDeferredConstructionFunction(VM& vm, JSGlobalObject* globalObject) +{ + return JSFunction::create(vm, globalObject, 2, ASCIILiteral("DeferredConstructionFunction"), deferredConstructionFunction); +} + +// Identity Functions + +static EncodedJSValue JSC_HOST_CALL identifyFunction(ExecState* exec) +{ + return JSValue::encode(exec->argument(0)); +} + +JSFunction* createIdentifyFunction(VM& vm, JSGlobalObject* globalObject) +{ + return JSFunction::create(vm, globalObject, 1, ASCIILiteral("IdentityFunction"), identifyFunction); +} + +// Promise.All Countdown Functions + +static EncodedJSValue JSC_HOST_CALL promiseAllCountdownFunction(ExecState* exec) +{ + JSValue x = exec->argument(0); + VM& vm = exec->vm(); + JSObject* F = exec->callee(); + + // 1. Let 'index' be the value of F's [[Index]] internal slot. + uint32_t index = F->get(exec, vm.propertyNames->indexPrivateName).asUInt32(); + + // 2. Let 'values' be the value of F's [[Values]] internal slot.. + JSArray* values = jsCast(F->get(exec, vm.propertyNames->valuesPrivateName)); + + // 3. Let 'deferred' be the value of F's [[Deferred]] internal slot. + JSPromiseDeferred* deferred = jsCast(F->get(exec, vm.propertyNames->deferredPrivateName)); + + // 4. Let 'countdownHolder' be the value of F's [[CountdownHolder]] internal slot. + NumberObject* countdownHolder = jsCast(F->get(exec, vm.propertyNames->countdownHolderPrivateName)); + + // 5. Let 'result' be the result of calling the [[DefineOwnProperty]] internal method + // of 'values' with arguments 'index' and Property Descriptor { [[Value]]: x, + // [[Writable]]: true, [[Enumerable]]: true, [[Configurable]]: true }. + values->putDirectIndex(exec, index, x); + + // 6. RejectIfAbrupt(result, deferred). + if (exec->hadException()) + abruptRejection(exec, deferred); + + // 7. Set countdownHolder.[[Countdown]] to countdownHolder.[[Countdown]] - 1. + uint32_t newCountdownValue = countdownHolder->internalValue().asUInt32() - 1; + countdownHolder->setInternalValue(vm, JSValue(newCountdownValue)); + + // 8. If countdownHolder.[[Countdown]] is 0, + if (!newCountdownValue) { + // i. Return the result of calling the [[Call]] internal method of deferred.[[Resolve]] + // with undefined as thisArgument and a List containing 'values' as argumentsList. + performDeferredResolve(exec, deferred, values); + } + + // 9. Return. + return JSValue::encode(jsUndefined()); +} + +JSFunction* createPromiseAllCountdownFunction(VM& vm, JSGlobalObject* globalObject) +{ + return JSFunction::create(vm, globalObject, 1, ASCIILiteral("PromiseAllCountdownFunction"), promiseAllCountdownFunction); +} + +// Promise Resolution Handler Functions + +static EncodedJSValue JSC_HOST_CALL promiseResolutionHandlerFunction(ExecState* exec) +{ + JSValue x = exec->argument(0); + VM& vm = exec->vm(); + JSObject* F = exec->callee(); + + // 1. Let 'promise' be the value of F's [[Promise]] internal slot + JSPromise* promise = jsCast(F->get(exec, vm.propertyNames->promisePrivateName)); + + // 2. Let 'fulfillmentHandler' be the value of F's [[FulfillmentHandler]] internal slot. + JSValue fulfillmentHandler = F->get(exec, vm.propertyNames->fulfillmentHandlerPrivateName); + + // 3. Let 'rejectionHandler' be the value of F's [[RejectionHandler]] internal slot. + JSValue rejectionHandler = F->get(exec, vm.propertyNames->rejectionHandlerPrivateName); + + // 4. If SameValue(x, promise) is true, + if (sameValue(exec, x, promise)) { + // i. Let 'selfResolutionError' be a newly-created TypeError object. + JSObject* selfResolutionError = createTypeError(exec, ASCIILiteral("Resolve a promise with itself")); + // ii. Return the result of calling the [[Call]] internal method of rejectionHandler with + // undefined as thisArgument and a List containing selfResolutionError as argumentsList. + CallData rejectCallData; + CallType rejectCallType = getCallData(rejectionHandler, rejectCallData); + ASSERT(rejectCallType != CallTypeNone); + + MarkedArgumentBuffer rejectArguments; + rejectArguments.append(selfResolutionError); + + return JSValue::encode(call(exec, rejectionHandler, rejectCallType, rejectCallData, jsUndefined(), rejectArguments)); + } + + // 5. Let 'C' be the value of promise's [[PromiseConstructor]] internal slot. + JSValue C = promise->constructor(); + + // 6. Let 'deferred' be the result of calling GetDeferred(C) + JSValue deferredValue = createJSPromiseDeferredFromConstructor(exec, C); + + // 7. ReturnIfAbrupt(deferred). + if (exec->hadException()) + return JSValue::encode(jsUndefined()); + + JSPromiseDeferred* deferred = jsCast(deferredValue); + + // 8. Let 'updateResult' be the result of calling UpdateDeferredFromPotentialThenable(x, deferred). + ThenableStatus updateResult = updateDeferredFromPotentialThenable(exec, x, deferred); + + // 9. ReturnIfAbrupt(updateResult). + if (exec->hadException()) + return JSValue::encode(jsUndefined()); + + // 10. If 'updateResult' is not "not a thenable", return the result of calling + // Invoke(deferred.[[Promise]], "then", (fulfillmentHandler, rejectionHandler)). + // NOTE: Invoke does not seem to be defined anywhere, so I am guessing here. + if (updateResult != NotAThenable) { + JSObject* deferredPromise = deferred->promise(); + + JSValue thenValue = deferredPromise->get(exec, exec->vm().propertyNames->then); + if (exec->hadException()) + return JSValue::encode(jsUndefined()); + + CallData thenCallData; + CallType thenCallType = getCallData(thenValue, thenCallData); + if (thenCallType == CallTypeNone) + return JSValue::encode(throwTypeError(exec)); + + MarkedArgumentBuffer arguments; + arguments.append(fulfillmentHandler); + arguments.append(rejectionHandler); + + return JSValue::encode(call(exec, thenValue, thenCallType, thenCallData, deferredPromise, arguments)); + } + + // 11. Return the result of calling the [[Call]] internal method of fulfillmentHandler + // with undefined as thisArgument and a List containing x as argumentsList. + CallData fulfillmentHandlerCallData; + CallType fulfillmentHandlerCallType = getCallData(fulfillmentHandler, fulfillmentHandlerCallData); + ASSERT(fulfillmentHandlerCallType != CallTypeNone); + + MarkedArgumentBuffer fulfillmentHandlerArguments; + fulfillmentHandlerArguments.append(x); + + return JSValue::encode(call(exec, fulfillmentHandler, fulfillmentHandlerCallType, fulfillmentHandlerCallData, jsUndefined(), fulfillmentHandlerArguments)); +} + +JSFunction* createPromiseResolutionHandlerFunction(VM& vm, JSGlobalObject* globalObject) +{ + return JSFunction::create(vm, globalObject, 1, ASCIILiteral("PromiseResolutionHandlerFunction"), promiseResolutionHandlerFunction); +} + +// Reject Promise Functions + +static EncodedJSValue JSC_HOST_CALL rejectPromiseFunction(ExecState* exec) +{ + JSValue reason = exec->argument(0); + JSObject* F = exec->callee(); + VM& vm = exec->vm(); + + // 1. Let 'promise' be the value of F's [[Promise]] internal slot. + JSPromise* promise = jsCast(F->get(exec, exec->vm().propertyNames->promisePrivateName)); + + // 2. Return the result of calling PromiseReject(promise, reason); + promise->reject(vm, reason); + + return JSValue::encode(jsUndefined()); +} + +JSFunction* createRejectPromiseFunction(VM& vm, JSGlobalObject* globalObject) +{ + return JSFunction::create(vm, globalObject, 1, ASCIILiteral("RejectPromiseFunction"), rejectPromiseFunction); +} + +// Resolve Promise Functions + +static EncodedJSValue JSC_HOST_CALL resolvePromiseFunction(ExecState* exec) +{ + JSValue resolution = exec->argument(0); + JSObject* F = exec->callee(); + VM& vm = exec->vm(); + + // 1. Let 'promise' be the value of F's [[Promise]] internal slot. + JSPromise* promise = jsCast(F->get(exec, vm.propertyNames->promisePrivateName)); + + // 2. Return the result of calling PromiseResolve(promise, resolution); + promise->resolve(vm, resolution); + + return JSValue::encode(jsUndefined()); +} + +JSFunction* createResolvePromiseFunction(VM& vm, JSGlobalObject* globalObject) +{ + return JSFunction::create(vm, globalObject, 1, ASCIILiteral("ResolvePromiseFunction"), resolvePromiseFunction); +} + +// Thrower Functions + +static EncodedJSValue JSC_HOST_CALL throwerFunction(ExecState* exec) +{ + return JSValue::encode(exec->vm().throwException(exec, exec->argument(0))); +} + +JSFunction* createThrowerFunction(VM& vm, JSGlobalObject* globalObject) +{ + return JSFunction::create(vm, globalObject, 1, ASCIILiteral("ThrowerFunction"), throwerFunction); +} + + +} // namespace JSC + +#endif // ENABLE(PROMISES) diff --git a/JavaScriptCore/runtime/JSPromiseResolverPrototype.h b/JavaScriptCore/runtime/JSPromiseFunctions.h similarity index 66% rename from JavaScriptCore/runtime/JSPromiseResolverPrototype.h rename to JavaScriptCore/runtime/JSPromiseFunctions.h index 071c1964..80212190 100644 --- a/JavaScriptCore/runtime/JSPromiseResolverPrototype.h +++ b/JavaScriptCore/runtime/JSPromiseFunctions.h @@ -23,35 +23,25 @@ * THE POSSIBILITY OF SUCH DAMAGE. */ -#ifndef JSPromiseResolverPrototype_h -#define JSPromiseResolverPrototype_h +#ifndef JSPromiseFunctions_h +#define JSPromiseFunctions_h #if ENABLE(PROMISES) -#include "JSObject.h" +#include "JSFunction.h" namespace JSC { -class JSPromiseResolverPrototype : public JSNonFinalObject { -public: - typedef JSNonFinalObject Base; - - static JSPromiseResolverPrototype* create(ExecState*, JSGlobalObject*, Structure*); - static Structure* createStructure(VM&, JSGlobalObject*, JSValue); - - DECLARE_INFO; - -protected: - void finishCreation(VM&, Structure*); - static const unsigned StructureFlags = OverridesGetOwnPropertySlot | JSObject::StructureFlags; - -private: - JSPromiseResolverPrototype(ExecState*, Structure*); - static bool getOwnPropertySlot(JSObject*, ExecState*, PropertyName, PropertySlot&); -}; +JSFunction* createDeferredConstructionFunction(VM&, JSGlobalObject*); +JSFunction* createIdentifyFunction(VM&, JSGlobalObject*); +JSFunction* createPromiseAllCountdownFunction(VM&, JSGlobalObject*); +JSFunction* createPromiseResolutionHandlerFunction(VM&, JSGlobalObject*); +JSFunction* createRejectPromiseFunction(VM&, JSGlobalObject*); +JSFunction* createResolvePromiseFunction(VM&, JSGlobalObject*); +JSFunction* createThrowerFunction(VM&, JSGlobalObject*); } // namespace JSC #endif // ENABLE(PROMISES) -#endif // JSPromiseResolverPrototype_h +#endif // JSPromiseFunctions_h diff --git a/JavaScriptCore/runtime/JSPromisePrototype.cpp b/JavaScriptCore/runtime/JSPromisePrototype.cpp index aaf3d2fd..69e54da5 100644 --- a/JavaScriptCore/runtime/JSPromisePrototype.cpp +++ b/JavaScriptCore/runtime/JSPromisePrototype.cpp @@ -33,17 +33,17 @@ #include "JSCellInlines.h" #include "JSGlobalObject.h" #include "JSPromise.h" -#include "JSPromiseCallback.h" -#include "JSPromiseResolver.h" +#include "JSPromiseDeferred.h" +#include "JSPromiseFunctions.h" +#include "JSPromiseReaction.h" +#include "Microtask.h" #include "StructureInlines.h" namespace JSC { STATIC_ASSERT_IS_TRIVIALLY_DESTRUCTIBLE(JSPromisePrototype); -// Promise then([TreatUndefinedAs=Missing] optional AnyCallback fulfillCallback, [TreatUndefinedAs=Missing] optional AnyCallback rejectCallback); static EncodedJSValue JSC_HOST_CALL JSPromisePrototypeFuncThen(ExecState*); -// Promise catch([TreatUndefinedAs=Missing] optional AnyCallback rejectCallback); static EncodedJSValue JSC_HOST_CALL JSPromisePrototypeFuncCatch(ExecState*); } @@ -56,8 +56,8 @@ const ClassInfo JSPromisePrototype::s_info = { "PromisePrototype", &JSNonFinalOb /* Source for JSPromisePrototype.lut.h @begin promisePrototypeTable - then JSPromisePrototypeFuncThen DontEnum|Function 0 - catch JSPromisePrototypeFuncCatch DontEnum|Function 0 + then JSPromisePrototypeFuncThen DontEnum|Function 2 + catch JSPromisePrototypeFuncCatch DontEnum|Function 1 @end */ @@ -89,95 +89,127 @@ bool JSPromisePrototype::getOwnPropertySlot(JSObject* object, ExecState* exec, P return getStaticFunctionSlot(exec, ExecState::promisePrototypeTable(exec), jsCast(object), propertyName, slot); } -static InternalFunction* wrapCallback(ExecState* exec, JSGlobalObject* globalObject, JSValue callback, JSPromiseResolver* resolver, JSPromiseCallback::Algorithm algorithm) -{ - if (!callback.isUndefined()) - return JSPromiseWrapperCallback::create(exec->vm(), globalObject->promiseWrapperCallbackStructure(), resolver, callback); - return JSPromiseCallback::create(exec->vm(), globalObject->promiseCallbackStructure(), resolver, algorithm); -} - EncodedJSValue JSC_HOST_CALL JSPromisePrototypeFuncThen(ExecState* exec) { - JSPromise* thisObject = jsDynamicCast(exec->thisValue()); - if (!thisObject) - return throwVMError(exec, createTypeError(exec, "Receiver of then must be a Promise")); - - JSValue fulfillCallback = exec->argument(0); - if (!fulfillCallback.isUndefined()) { - CallData callData; - CallType callType = getCallData(fulfillCallback, callData); - if (callType == CallTypeNone) - return throwVMError(exec, createTypeError(exec, "Expected function or undefined as as first argument")); - } + // -- Promise.prototype.then(onFulfilled, onRejected) -- + + // 1. Let promise be the this value. + // 2. If IsPromise(promise) is false, throw a TypeError exception. + JSPromise* promise = jsDynamicCast(exec->thisValue()); + if (!promise) + return JSValue::encode(throwTypeError(exec)); + + // 3. Let 'C' be the result of calling Get(promise, "constructor"). + JSValue C = promise->get(exec, exec->propertyNames().constructor); - JSValue rejectCallback = exec->argument(1); - if (!rejectCallback.isUndefined()) { - CallData callData; - CallType callType = getCallData(rejectCallback, callData); - if (callType == CallTypeNone) - return throwVMError(exec, createTypeError(exec, "Expected function or undefined as as second argument")); - } + // 4. ReturnIfAbrupt(C). + if (exec->hadException()) + return JSValue::encode(jsUndefined()); + + // 5. Let 'deferred' be the result of calling GetDeferred(C). + JSValue deferred = createJSPromiseDeferredFromConstructor(exec, C); - JSFunction* callee = jsCast(exec->callee()); - JSGlobalObject* globalObject = callee->globalObject(); + // 6. ReturnIfAbrupt(deferred). + if (exec->hadException()) + return JSValue::encode(jsUndefined()); - // 1. Let promise be a new promise. - JSPromise* promise = JSPromise::createWithResolver(exec->vm(), globalObject); + VM& vm = exec->vm(); + JSGlobalObject* globalObject = promise->globalObject(); + + // 7. Let 'rejectionHandler' be a new built-in function object as defined in Thrower Functions + // 8. If IsCallable(onRejected), set rejectionHandler to onRejected. + JSValue onRejected = exec->argument(1); + CallData onRejectedCallData; + CallType onRejectedCallType = getCallData(onRejected, onRejectedCallData); + JSObject* rejectionHandler = (onRejectedCallType == CallTypeNone) ? createThrowerFunction(vm, globalObject) : asObject(onRejected); + + // 9. Let 'fulfillmentHandler' be a new built-in function object as defined in Identity Functions + // 10. If IsCallable(onFulfilled), set fulfillmentHandler to onFulfilled + JSValue onFulfilled = exec->argument(0); + CallData onFulfilledCallData; + CallType onFulfilledCallType = getCallData(onFulfilled, onFulfilledCallData); + JSObject* fulfillmentHandler = (onFulfilledCallType == CallTypeNone) ? createIdentifyFunction(vm, globalObject) : asObject(onFulfilled); - // 2. Let resolver be promise's associated resolver. - JSPromiseResolver* resolver = promise->resolver(); + // 11. Let 'resolutionHandler' be a new built-in function object as defined in Promise Resolution Handler Functions + JSObject* resolutionHandler = createPromiseResolutionHandlerFunction(vm, globalObject); - // 3. Let fulfillWrapper be a promise wrapper callback for resolver and fulfillCallback if fulfillCallback is - // not omitted and a promise callback for resolver and its fulfill algorithm otherwise. - InternalFunction* fulfillWrapper = wrapCallback(exec, globalObject, fulfillCallback, resolver, JSPromiseCallback::Fulfill); + // 12. Set the [[Promise]] internal slot of resolutionHandler to promise. + resolutionHandler->putDirect(vm, vm.propertyNames->promisePrivateName, promise); - // 4. Let rejectWrapper be a promise wrapper callback for resolver and rejectCallback if rejectCallback is - // not omitted and a promise callback for resolver and its reject algorithm otherwise. - InternalFunction* rejectWrapper = wrapCallback(exec, globalObject, rejectCallback, resolver, JSPromiseCallback::Reject); + // 13. Set the [[FulfillmentHandler]] internal slot of resolutionHandler to fulfillmentHandler. + resolutionHandler->putDirect(vm, vm.propertyNames->fulfillmentHandlerPrivateName, fulfillmentHandler); - // 5. Append fulfillWrapper and rejectWrapper to the context object. - thisObject->appendCallbacks(exec, fulfillWrapper, rejectWrapper); + // 14. Set the [[RejectionHandler]] internal slot of resolutionHandler to rejectionHandler. + resolutionHandler->putDirect(vm, vm.propertyNames->rejectionHandlerPrivateName, rejectionHandler); - // 6. Return promise. - return JSValue::encode(promise); -} + // 15. Let 'resolveReaction' be the PromiseReaction { [[Deferred]]: deferred, [[Handler]]: resolutionHandler }. + JSPromiseReaction* resolveReaction = JSPromiseReaction::create(vm, jsCast(deferred), resolutionHandler); -EncodedJSValue JSC_HOST_CALL JSPromisePrototypeFuncCatch(ExecState* exec) -{ - JSPromise* thisObject = jsDynamicCast(exec->thisValue()); - if (!thisObject) - return throwVMError(exec, createTypeError(exec, "Receiver of catch must be a Promise")); - - JSValue rejectCallback = exec->argument(0); - if (!rejectCallback.isUndefined()) { - CallData callData; - CallType callType = getCallData(rejectCallback, callData); - if (callType == CallTypeNone) - return throwVMError(exec, createTypeError(exec, "Expected function or undefined as as first argument")); + // 16. Let 'rejectReaction' be the PromiseReaction { [[Deferred]]: deferred, [[Handler]]: rejectionHandler }. + JSPromiseReaction* rejectReaction = JSPromiseReaction::create(vm, jsCast(deferred), rejectionHandler); + + switch (promise->status()) { + case JSPromise::Status::Unresolved: { + // 17. If the value of promise's [[PromiseStatus]] internal slot is "unresolved", + + // i. Append resolveReaction as the last element of promise's [[ResolveReactions]] internal slot. + promise->appendResolveReaction(vm, resolveReaction); + + // ii. Append rejectReaction as the last element of promise's [[RejectReactions]] internal slot. + promise->appendRejectReaction(vm, rejectReaction); + break; } - JSFunction* callee = jsCast(exec->callee()); - JSGlobalObject* globalObject = callee->globalObject(); - VM& vm = exec->vm(); + case JSPromise::Status::HasResolution: { + // 18. If the value of promise's [[PromiseStatus]] internal slot is "has-resolution", - // 1. Let promise be a new promise. - JSPromise* promise = JSPromise::createWithResolver(vm, globalObject); + // i. Let 'resolution' be the value of promise's [[Result]] internal slot. + JSValue resolution = promise->result(); - // 2. Let resolver be promise's associated resolver. - JSPromiseResolver* resolver = promise->resolver(); + // ii. Call QueueMicrotask(ExecutePromiseReaction, (resolveReaction, resolution)). + globalObject->queueMicrotask(createExecutePromiseReactionMicrotask(vm, resolveReaction, resolution)); + break; + } - // 3. Let fulfillCallback be a new promise callback for resolver and its fulfill algorithm. - InternalFunction* fulfillWrapper = JSPromiseCallback::create(vm, globalObject->promiseCallbackStructure(), resolver, JSPromiseCallback::Fulfill); + case JSPromise::Status::HasRejection: { + // 19. If the value of promise's [[PromiseStatus]] internal slot is "has-rejection", - // 4. Let rejectWrapper be a promise wrapper callback for resolver and rejectCallback if rejectCallback is - // not omitted and a promise callback for resolver and its reject algorithm otherwise. - InternalFunction* rejectWrapper = wrapCallback(exec, globalObject, rejectCallback, resolver, JSPromiseCallback::Reject); + // i. Let reason be the value of promise's [[Result]] internal slot. + JSValue reason = promise->result(); - // 5. Append fulfillWrapper and rejectWrapper to the context object. - thisObject->appendCallbacks(exec, fulfillWrapper, rejectWrapper); + // ii. Call QueueMicrotask(ExecutePromiseReaction, (rejectReaction, reason)). + globalObject->queueMicrotask(createExecutePromiseReactionMicrotask(vm, rejectReaction, reason)); + break; + } + } - // 6. Return promise. - return JSValue::encode(promise); + // 20. Return deferred.[[Promise]]. + return JSValue::encode(jsCast(deferred)->promise()); +} + +EncodedJSValue JSC_HOST_CALL JSPromisePrototypeFuncCatch(ExecState* exec) +{ + // -- Promise.prototype.catch(onRejected) -- + + // 1. Let 'promise' be the this value. + JSValue promise = exec->thisValue(); + + // 2. Return the result of calling Invoke(promise, "then", (undefined, onRejected)). + // NOTE: Invoke does not seem to be defined anywhere, so I am guessing here. + JSValue thenValue = promise.get(exec, exec->vm().propertyNames->then); + if (exec->hadException()) + return JSValue::encode(jsUndefined()); + + CallData thenCallData; + CallType thenCallType = getCallData(thenValue, thenCallData); + if (thenCallType == CallTypeNone) + return JSValue::encode(throwTypeError(exec)); + + MarkedArgumentBuffer arguments; + arguments.append(jsUndefined()); + arguments.append(exec->argument(0)); + + return JSValue::encode(call(exec, thenValue, thenCallType, thenCallData, promise, arguments)); } } // namespace JSC diff --git a/JavaScriptCore/runtime/JSPromiseReaction.cpp b/JavaScriptCore/runtime/JSPromiseReaction.cpp new file mode 100644 index 00000000..c0e75dfb --- /dev/null +++ b/JavaScriptCore/runtime/JSPromiseReaction.cpp @@ -0,0 +1,158 @@ +/* + * Copyright (C) 2013 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. + */ + +#include "config.h" +#include "JSPromiseReaction.h" + +#include "Error.h" +#include "JSCJSValueInlines.h" +#include "JSCellInlines.h" +#include "JSGlobalObject.h" +#include "JSPromiseDeferred.h" +#include "Microtask.h" +#include "SlotVisitorInlines.h" +#include "StrongInlines.h" + +namespace JSC { + +class ExecutePromiseReactionMicrotask FINAL : public Microtask { +public: + ExecutePromiseReactionMicrotask(VM& vm, JSPromiseReaction* reaction, JSValue argument) + { + m_reaction.set(vm, reaction); + m_argument.set(vm, argument); + } + + virtual ~ExecutePromiseReactionMicrotask() + { + } + +private: + virtual void run(ExecState*) OVERRIDE; + + Strong m_reaction; + Strong m_argument; +}; + +PassRefPtr createExecutePromiseReactionMicrotask(VM& vm, JSPromiseReaction* reaction, JSValue argument) +{ + return adoptRef(new ExecutePromiseReactionMicrotask(vm, reaction, argument)); +} + +void ExecutePromiseReactionMicrotask::run(ExecState* exec) +{ + // 1. Let 'deferred' be reaction.[[Deferred]]. + JSPromiseDeferred* deferred = m_reaction->deferred(); + + // 2. Let 'handler' be reaction.[[Handler]]. + JSValue handler = m_reaction->handler(); + + // 3. Let 'handlerResult' be the result of calling the [[Call]] internal method of + // handler passing undefined as thisArgument and a List containing argument as + // argumentsList. + + CallData handlerCallData; + CallType handlerCallType = getCallData(handler, handlerCallData); + ASSERT(handlerCallType != CallTypeNone); + + MarkedArgumentBuffer handlerArguments; + handlerArguments.append(m_argument.get()); + + JSValue handlerResult = call(exec, handler, handlerCallType, handlerCallData, jsUndefined(), handlerArguments); + + // 4. If handlerResult is an abrupt completion, return the result of calling the + // [[Call]] internal method of deferred.[[Reject]] passing undefined as thisArgument + // and a List containing handlerResult.[[value]] as argumentsList. + if (exec->hadException()) { + JSValue exception = exec->exception(); + exec->clearException(); + + performDeferredReject(exec, deferred, exception); + } + + // 5. Let 'handlerResult' be handlerResult.[[value]]. + // Note: Nothing to do. + + // 6. If SameValue(handlerResult, deferred.[[Promise]]) is true, + if (sameValue(exec, handlerResult, deferred->promise())) { + // i. Let 'selfResolutionError' be a newly-created TypeError object. + JSObject* selfResolutionError = createTypeError(exec, ASCIILiteral("Resolve a promise with itself")); + + // ii. Return the result of calling the [[Call]] internal method of deferred.[[Reject]] passing + // undefined as thisArgument and a List containing selfResolutionError as argumentsList. + performDeferredReject(exec, deferred, selfResolutionError); + } + + // 7. Let 'updateResult' be the result of calling UpdateDeferredFromPotentialThenable(handlerResult, deferred). + ThenableStatus updateResult = updateDeferredFromPotentialThenable(exec, handlerResult, deferred); + + // 8. ReturnIfAbrupt(updateResult). + if (exec->hadException()) + return; + + // 9. If 'updateResult' is "not a thenable", + if (updateResult == NotAThenable) { + // i. Return the result of calling the [[Call]] internal method of deferred.[[Resolve]] + // passing undefined as thisArgument and a List containing handlerResult as argumentsList. + performDeferredResolve(exec, deferred, handlerResult); + } +} + + +const ClassInfo JSPromiseReaction::s_info = { "JSPromiseReaction", 0, 0, 0, CREATE_METHOD_TABLE(JSPromiseReaction) }; + +JSPromiseReaction* JSPromiseReaction::create(VM& vm, JSPromiseDeferred* deferred, JSValue handler) +{ + JSPromiseReaction* promiseReaction = new (NotNull, allocateCell(vm.heap)) JSPromiseReaction(vm); + promiseReaction->finishCreation(vm, deferred, handler); + return promiseReaction; +} + +JSPromiseReaction::JSPromiseReaction(VM& vm) + : Base(vm, vm.promiseReactionStructure.get()) +{ +} + +void JSPromiseReaction::finishCreation(VM& vm, JSPromiseDeferred* deferred, JSValue handler) +{ + Base::finishCreation(vm); + m_deferred.set(vm, this, deferred); + m_handler.set(vm, this, handler); +} + +void JSPromiseReaction::visitChildren(JSCell* cell, SlotVisitor& visitor) +{ + JSPromiseReaction* thisObject = jsCast(cell); + ASSERT_GC_OBJECT_INHERITS(thisObject, info()); + COMPILE_ASSERT(StructureFlags & OverridesVisitChildren, OverridesVisitChildrenWithoutSettingFlag); + ASSERT(thisObject->structure()->typeInfo().overridesVisitChildren()); + + Base::visitChildren(thisObject, visitor); + + visitor.append(&thisObject->m_deferred); + visitor.append(&thisObject->m_handler); +} + +} // namespace JSC diff --git a/JavaScriptCore/runtime/JSPromiseResolver.h b/JavaScriptCore/runtime/JSPromiseReaction.h similarity index 57% rename from JavaScriptCore/runtime/JSPromiseResolver.h rename to JavaScriptCore/runtime/JSPromiseReaction.h index 7fa4797e..fc7146c5 100644 --- a/JavaScriptCore/runtime/JSPromiseResolver.h +++ b/JavaScriptCore/runtime/JSPromiseReaction.h @@ -23,56 +23,46 @@ * THE POSSIBILITY OF SUCH DAMAGE. */ -#ifndef JSPromiseResolver_h -#define JSPromiseResolver_h +#ifndef JSPromiseReaction_h +#define JSPromiseReaction_h -#if ENABLE(PROMISES) - -#include "JSObject.h" +#include "JSCell.h" +#include "Structure.h" namespace JSC { -class JSPromise; +class JSPromiseDeferred; +class Microtask; -class JSPromiseResolver : public JSNonFinalObject { +class JSPromiseReaction : public JSCell { public: - typedef JSNonFinalObject Base; - - static JSPromiseResolver* create(VM&, Structure*, JSPromise*); - static Structure* createStructure(VM&, JSGlobalObject*, JSValue); - - DECLARE_INFO; - - JSPromise* promise() const; + typedef JSCell Base; - JS_EXPORT_PRIVATE void fulfillIfNotResolved(ExecState*, JSValue); - void resolveIfNotResolved(ExecState*, JSValue); - JS_EXPORT_PRIVATE void rejectIfNotResolved(ExecState*, JSValue); + static JSPromiseReaction* create(VM&, JSPromiseDeferred*, JSValue); + static Structure* createStructure(VM& vm, JSGlobalObject* globalObject, JSValue prototype) + { + return Structure::create(vm, globalObject, prototype, TypeInfo(CompoundType, StructureFlags), info()); + } - enum ResolverMode { - ResolveSynchronously, - ResolveAsynchronously, - }; + static const bool hasImmortalStructure = true; - void fulfill(ExecState*, JSValue, ResolverMode = ResolveAsynchronously); - void resolve(ExecState*, JSValue, ResolverMode = ResolveAsynchronously); - void reject(ExecState*, JSValue, ResolverMode = ResolveAsynchronously); + DECLARE_INFO; -protected: - void finishCreation(VM&, JSPromise*); - static const unsigned StructureFlags = OverridesVisitChildren | JSObject::StructureFlags; + JSPromiseDeferred* deferred() const { return m_deferred.get(); } + JSValue handler() const { return m_handler.get(); } private: - JSPromiseResolver(VM&, Structure*); - + JSPromiseReaction(VM&); + void finishCreation(VM&, JSPromiseDeferred*, JSValue); + static const unsigned StructureFlags = OverridesVisitChildren | Base::StructureFlags; static void visitChildren(JSCell*, SlotVisitor&); - WriteBarrier m_promise; - bool m_isResolved; + WriteBarrier m_deferred; + WriteBarrier m_handler; }; -} // namespace JSC +PassRefPtr createExecutePromiseReactionMicrotask(VM&, JSPromiseReaction*, JSValue); -#endif // ENABLE(PROMISES) +} // namespace JSC -#endif // JSPromiseResolver_h +#endif // JSPromiseReaction_h diff --git a/JavaScriptCore/runtime/JSPromiseResolver.cpp b/JavaScriptCore/runtime/JSPromiseResolver.cpp deleted file mode 100644 index 368b5981..00000000 --- a/JavaScriptCore/runtime/JSPromiseResolver.cpp +++ /dev/null @@ -1,203 +0,0 @@ -/* - * Copyright (C) 2013 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. - */ - -#include "config.h" -#include "JSPromiseResolver.h" - -#if ENABLE(PROMISES) - -#include "JSCJSValueInlines.h" -#include "JSCellInlines.h" -#include "JSGlobalObject.h" -#include "JSPromise.h" -#include "JSPromiseCallback.h" -#include "SlotVisitorInlines.h" -#include "StructureInlines.h" - -namespace JSC { - -const ClassInfo JSPromiseResolver::s_info = { "PromiseResolver", &Base::s_info, 0, 0, CREATE_METHOD_TABLE(JSPromiseResolver) }; - -JSPromiseResolver* JSPromiseResolver::create(VM& vm, Structure* structure, JSPromise* promise) -{ - JSPromiseResolver* object = new (NotNull, allocateCell(vm.heap)) JSPromiseResolver(vm, structure); - object->finishCreation(vm, promise); - return object; -} - -Structure* JSPromiseResolver::createStructure(VM& vm, JSGlobalObject* globalObject, JSValue prototype) -{ - return Structure::create(vm, globalObject, prototype, TypeInfo(ObjectType, StructureFlags), info()); -} - -JSPromiseResolver::JSPromiseResolver(VM& vm, Structure* structure) - : JSNonFinalObject(vm, structure) - , m_isResolved(false) -{ -} - -void JSPromiseResolver::finishCreation(VM& vm, JSPromise* promise) -{ - Base::finishCreation(vm); - ASSERT(inherits(info())); - m_promise.set(vm, this, promise); -} - -void JSPromiseResolver::visitChildren(JSCell* cell, SlotVisitor& visitor) -{ - JSPromiseResolver* thisObject = jsCast(cell); - ASSERT_GC_OBJECT_INHERITS(thisObject, info()); - COMPILE_ASSERT(StructureFlags & OverridesVisitChildren, OverridesVisitChildrenWithoutSettingFlag); - ASSERT(thisObject->structure()->typeInfo().overridesVisitChildren()); - - Base::visitChildren(thisObject, visitor); - visitor.append(&thisObject->m_promise); -} - -JSPromise* JSPromiseResolver::promise() const -{ - return m_promise.get(); -} - -void JSPromiseResolver::fulfillIfNotResolved(ExecState* exec, JSValue value) -{ - if (!m_isResolved) { - m_isResolved = true; - fulfill(exec, value); - } -} - -void JSPromiseResolver::resolveIfNotResolved(ExecState* exec, JSValue value) -{ - if (!m_isResolved) { - m_isResolved = true; - resolve(exec, value); - } -} - -void JSPromiseResolver::rejectIfNotResolved(ExecState* exec, JSValue value) -{ - if (!m_isResolved) { - m_isResolved = true; - reject(exec, value); - } -} - -void JSPromiseResolver::fulfill(ExecState* exec, JSValue value, ResolverMode mode) -{ - // 1. Let promise be the context object's associated promise. - // 2. Set promise's state to fulfilled. - m_promise->setState(JSPromise::Fulfilled); - - // 3. Set promise's result to value. - m_promise->setResult(exec->vm(), value); - - // 4. If the synchronous flag is set, process promise's fulfill callbacks with value. - if (mode == ResolveSynchronously) { - m_promise->processFulfillCallbacksWithValue(exec, value); - return; - } - - // 5. Otherwise, the synchronous flag is unset, queue a task to process promise's fulfill callbacks with value. - m_promise->queueTaskToProcessFulfillCallbacks(exec); -} - -void JSPromiseResolver::resolve(ExecState* exec, JSValue value, ResolverMode mode) -{ - // 1. Let then be null. - JSValue then = jsNull(); - - // 2. If value is a JavaScript Object, set then to the result of calling the JavaScript [[Get]] internal - // method of value with property name then. - if (value.isObject()) { - then = value.get(exec, exec->propertyNames().then); - - // 3. If calling the [[Get]] internal method threw an exception, catch it and run reject with the thrown - // exception and the synchronous flag if set, and then terminate these steps. - if (exec->hadException()) { - JSValue exception = exec->exception(); - exec->clearException(); - - reject(exec, exception, mode); - return; - } - - // 4. If JavaScript IsCallable(then) is true, run these substeps and then terminate these steps: - CallData callData; - CallType callType = JSC::getCallData(then, callData); - if (callType != CallTypeNone) { - VM& vm = exec->vm(); - // 4.1. Let fulfillCallback be a promise callback for the context object and its resolve algorithm. - JSPromiseCallback* fulfillCallback = JSPromiseCallback::create(vm, globalObject()->promiseCallbackStructure(), this, JSPromiseCallback::Resolve); - - // 4.2. Let rejectCallback be a promise callback for the context object and its reject algorithm. - JSPromiseCallback* rejectCallback = JSPromiseCallback::create(vm, globalObject()->promiseCallbackStructure(), this, JSPromiseCallback::Reject); - - // 4.3. Call the JavaScript [[Call]] internal method of then with this value value and fulfillCallback - // and rejectCallback as arguments. - MarkedArgumentBuffer thenArguments; - thenArguments.append(fulfillCallback); - thenArguments.append(rejectCallback); - call(exec, then, callType, callData, value, thenArguments); - - // 4.4 If calling the [[Call]] internal method threw an exception, catch it and run context object's - // reject with the thrown exception and the synchronous flag if set. - if (exec->hadException()) { - JSValue exception = exec->exception(); - exec->clearException(); - - reject(exec, exception, mode); - return; - } - return; - } - } - - // 5. Run context object's fulfill with value and the synchronous flag if set. - fulfill(exec, value, mode); -} - -void JSPromiseResolver::reject(ExecState* exec, JSValue value, ResolverMode mode) -{ - // 1. Let promise be the context object's associated promise. - // 2. Set promise's state to rejected. - m_promise->setState(JSPromise::Rejected); - - // 3. Set promise's result to value. - m_promise->setResult(exec->vm(), value); - - // 4. If the synchronous flag is set, process promise's reject callbacks with value. - if (mode == ResolveSynchronously) { - m_promise->processRejectCallbacksWithValue(exec, value); - return; - } - - // 5. Otherwise, the synchronous flag is unset, queue a task to process promise's reject callbacks with value. - m_promise->queueTaskToProcessRejectCallbacks(exec); -} - -} // namespace JSC - -#endif // ENABLE(PROMISES) diff --git a/JavaScriptCore/runtime/JSPromiseResolverConstructor.cpp b/JavaScriptCore/runtime/JSPromiseResolverConstructor.cpp deleted file mode 100644 index 47fc801f..00000000 --- a/JavaScriptCore/runtime/JSPromiseResolverConstructor.cpp +++ /dev/null @@ -1,78 +0,0 @@ -/* - * Copyright (C) 2013 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. - */ - -#include "config.h" -#include "JSPromiseResolverConstructor.h" - -#if ENABLE(PROMISES) - -#include "JSCJSValueInlines.h" -#include "JSCellInlines.h" -#include "JSPromiseResolverPrototype.h" -#include "Lookup.h" -#include "StructureInlines.h" - -namespace JSC { - -STATIC_ASSERT_IS_TRIVIALLY_DESTRUCTIBLE(JSPromiseResolverConstructor); - -const ClassInfo JSPromiseResolverConstructor::s_info = { "Function", &Base::s_info, 0, 0, CREATE_METHOD_TABLE(JSPromiseResolverConstructor) }; - -JSPromiseResolverConstructor* JSPromiseResolverConstructor::create(VM& vm, Structure* structure, JSPromiseResolverPrototype* promisePrototype) -{ - JSPromiseResolverConstructor* constructor = new (NotNull, allocateCell(vm.heap)) JSPromiseResolverConstructor(vm, structure); - constructor->finishCreation(vm, promisePrototype); - return constructor; -} - -Structure* JSPromiseResolverConstructor::createStructure(VM& vm, JSGlobalObject* globalObject, JSValue prototype) -{ - return Structure::create(vm, globalObject, prototype, TypeInfo(ObjectType, StructureFlags), info()); -} - -JSPromiseResolverConstructor::JSPromiseResolverConstructor(VM& vm, Structure* structure) - : InternalFunction(vm, structure) -{ -} - -void JSPromiseResolverConstructor::finishCreation(VM& vm, JSPromiseResolverPrototype* promiseResolverPrototype) -{ - Base::finishCreation(vm, "PromiseResolver"); - putDirectWithoutTransition(vm, vm.propertyNames->prototype, promiseResolverPrototype, DontEnum | DontDelete | ReadOnly); -} - -ConstructType JSPromiseResolverConstructor::getConstructData(JSCell*, ConstructData&) -{ - return ConstructTypeNone; -} - -CallType JSPromiseResolverConstructor::getCallData(JSCell*, CallData&) -{ - return CallTypeNone; -} - -} // namespace JSC - -#endif // ENABLE(PROMISES) diff --git a/JavaScriptCore/runtime/JSPromiseResolverPrototype.cpp b/JavaScriptCore/runtime/JSPromiseResolverPrototype.cpp deleted file mode 100644 index 93caa575..00000000 --- a/JavaScriptCore/runtime/JSPromiseResolverPrototype.cpp +++ /dev/null @@ -1,124 +0,0 @@ -/* - * Copyright (C) 2013 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. - */ - -#include "config.h" -#include "JSPromiseResolverPrototype.h" - -#if ENABLE(PROMISES) - -#include "Error.h" -#include "JSCJSValueInlines.h" -#include "JSCellInlines.h" -#include "JSPromiseResolver.h" -#include "StructureInlines.h" - -namespace JSC { - -STATIC_ASSERT_IS_TRIVIALLY_DESTRUCTIBLE(JSPromiseResolverPrototype); - -// void fulfill(optional any value); -static EncodedJSValue JSC_HOST_CALL JSPromiseResolverPrototypeFuncFulfill(ExecState*); -// void resolve(optional any value); -static EncodedJSValue JSC_HOST_CALL JSPromiseResolverPrototypeFuncResolve(ExecState*); -// void reject(optional any value); -static EncodedJSValue JSC_HOST_CALL JSPromiseResolverPrototypeFuncReject(ExecState*); - -} - -#include "JSPromiseResolverPrototype.lut.h" - -namespace JSC { - -const ClassInfo JSPromiseResolverPrototype::s_info = { "PromiseResolverPrototype", &Base::s_info, 0, ExecState::promiseResolverPrototypeTable, CREATE_METHOD_TABLE(JSPromiseResolverPrototype) }; - -/* Source for JSPromiseResolverPrototype.lut.h -@begin promiseResolverPrototypeTable - fulfill JSPromiseResolverPrototypeFuncFulfill DontEnum|Function 1 - resolve JSPromiseResolverPrototypeFuncResolve DontEnum|Function 1 - reject JSPromiseResolverPrototypeFuncReject DontEnum|Function 1 -@end -*/ - -JSPromiseResolverPrototype* JSPromiseResolverPrototype::create(ExecState* exec, JSGlobalObject*, Structure* structure) -{ - VM& vm = exec->vm(); - JSPromiseResolverPrototype* object = new (NotNull, allocateCell(vm.heap)) JSPromiseResolverPrototype(exec, structure); - object->finishCreation(vm, structure); - return object; -} - -Structure* JSPromiseResolverPrototype::createStructure(VM& vm, JSGlobalObject* globalObject, JSValue prototype) -{ - return Structure::create(vm, globalObject, prototype, TypeInfo(ObjectType, StructureFlags), info()); -} - -JSPromiseResolverPrototype::JSPromiseResolverPrototype(ExecState* exec, Structure* structure) - : JSNonFinalObject(exec->vm(), structure) -{ -} - -void JSPromiseResolverPrototype::finishCreation(VM& vm, Structure*) -{ - Base::finishCreation(vm); -} - -bool JSPromiseResolverPrototype::getOwnPropertySlot(JSObject* object, ExecState* exec, PropertyName propertyName, PropertySlot& slot) -{ - return getStaticFunctionSlot(exec, ExecState::promiseResolverPrototypeTable(exec), jsCast(object), propertyName, slot); -} - -EncodedJSValue JSC_HOST_CALL JSPromiseResolverPrototypeFuncFulfill(ExecState* exec) -{ - JSPromiseResolver* thisObject = jsDynamicCast(exec->thisValue()); - if (!thisObject) - return throwVMError(exec, createTypeError(exec, "Receiver of fulfill must be a PromiseResolver")); - - thisObject->fulfillIfNotResolved(exec, exec->argument(0)); - return JSValue::encode(jsUndefined()); -} - -EncodedJSValue JSC_HOST_CALL JSPromiseResolverPrototypeFuncResolve(ExecState* exec) -{ - JSPromiseResolver* thisObject = jsDynamicCast(exec->thisValue()); - if (!thisObject) - return throwVMError(exec, createTypeError(exec, "Receiver of resolve must be a PromiseResolver")); - - thisObject->resolveIfNotResolved(exec, exec->argument(0)); - return JSValue::encode(jsUndefined()); -} - -EncodedJSValue JSC_HOST_CALL JSPromiseResolverPrototypeFuncReject(ExecState* exec) -{ - JSPromiseResolver* thisObject = jsDynamicCast(exec->thisValue()); - if (!thisObject) - return throwVMError(exec, createTypeError(exec, "Receiver of reject must be a PromiseResolver")); - - thisObject->rejectIfNotResolved(exec, exec->argument(0)); - return JSValue::encode(jsUndefined()); -} - -} // namespace JSC - -#endif // ENABLE(PROMISES) diff --git a/JavaScriptCore/runtime/JSPropertyNameIterator.h b/JavaScriptCore/runtime/JSPropertyNameIterator.h index 59140304..f4362ff3 100644 --- a/JavaScriptCore/runtime/JSPropertyNameIterator.h +++ b/JavaScriptCore/runtime/JSPropertyNameIterator.h @@ -109,9 +109,9 @@ namespace JSC { return m_enumerationCache.get(); } - inline void StructureRareData::setEnumerationCache(VM& vm, const Structure* owner, JSPropertyNameIterator* value) + inline void StructureRareData::setEnumerationCache(VM& vm, const Structure*, JSPropertyNameIterator* value) { - m_enumerationCache.set(vm, owner, value); + m_enumerationCache.set(vm, this, value); } } // namespace JSC diff --git a/JavaScriptCore/runtime/JSScope.cpp b/JavaScriptCore/runtime/JSScope.cpp index 9779c477..3440bc61 100644 --- a/JavaScriptCore/runtime/JSScope.cpp +++ b/JavaScriptCore/runtime/JSScope.cpp @@ -53,19 +53,19 @@ static inline bool abstractAccess(ExecState* exec, JSScope* scope, const Identif if (JSActivation* activation = jsDynamicCast(scope)) { if (ident == exec->propertyNames().arguments) { // We know the property will be at this activation scope, but we don't know how to cache it. - op = ResolveOp(Dynamic, 0, 0, 0); + op = ResolveOp(Dynamic, 0, 0, 0, 0, 0); return true; } SymbolTableEntry entry = activation->symbolTable()->get(ident.impl()); if (entry.isReadOnly() && getOrPut == Put) { // We know the property will be at this activation scope, but we don't know how to cache it. - op = ResolveOp(Dynamic, 0, 0, 0); + op = ResolveOp(Dynamic, 0, 0, 0, 0, 0); return true; } if (!entry.isNull()) { - op = ResolveOp(makeType(ClosureVar, needsVarInjectionChecks), depth, activation->structure(), entry.getIndex()); + op = ResolveOp(makeType(ClosureVar, needsVarInjectionChecks), depth, 0, activation, entry.watchpointSet(), entry.getIndex()); return true; } @@ -77,18 +77,14 @@ static inline bool abstractAccess(ExecState* exec, JSScope* scope, const Identif if (JSGlobalObject* globalObject = jsDynamicCast(scope)) { SymbolTableEntry entry = globalObject->symbolTable()->get(ident.impl()); if (!entry.isNull()) { - if (getOrPut == Put) { - if (entry.isReadOnly()) { - // We know the property will be at global scope, but we don't know how to cache it. - op = ResolveOp(Dynamic, 0, 0, 0); - return true; - } - - // It's likely that we'll write to this var, so notify now and avoid the overhead of doing so at runtime. - entry.notifyWrite(); + if (getOrPut == Put && entry.isReadOnly()) { + // We know the property will be at global scope, but we don't know how to cache it. + op = ResolveOp(Dynamic, 0, 0, 0, 0, 0); + return true; } - op = ResolveOp(makeType(GlobalVar, needsVarInjectionChecks), depth, globalObject->structure(), + op = ResolveOp( + makeType(GlobalVar, needsVarInjectionChecks), depth, 0, 0, entry.watchpointSet(), reinterpret_cast(globalObject->registerAt(entry.getIndex()).slot())); return true; } @@ -100,15 +96,15 @@ static inline bool abstractAccess(ExecState* exec, JSScope* scope, const Identif || (globalObject->structure()->hasReadOnlyOrGetterSetterPropertiesExcludingProto() && getOrPut == Put)) { // We know the property will be at global scope, but we don't know how to cache it. ASSERT(!scope->next()); - op = ResolveOp(makeType(GlobalProperty, needsVarInjectionChecks), depth, 0, 0); + op = ResolveOp(makeType(GlobalProperty, needsVarInjectionChecks), depth, 0, 0, 0, 0); return true; } - op = ResolveOp(makeType(GlobalProperty, needsVarInjectionChecks), depth, globalObject->structure(), slot.cachedOffset()); + op = ResolveOp(makeType(GlobalProperty, needsVarInjectionChecks), depth, globalObject->structure(), 0, 0, slot.cachedOffset()); return true; } - op = ResolveOp(Dynamic, 0, 0, 0); + op = ResolveOp(Dynamic, 0, 0, 0, 0, 0); return true; } @@ -146,7 +142,7 @@ JSValue JSScope::resolve(ExecState* exec, JSScope* scope, const Identifier& iden ResolveOp JSScope::abstractResolve(ExecState* exec, JSScope* scope, const Identifier& ident, GetOrPut getOrPut, ResolveType unlinkedType) { - ResolveOp op(Dynamic, 0, 0, 0); + ResolveOp op(Dynamic, 0, 0, 0, 0, 0); if (unlinkedType == Dynamic) return op; diff --git a/JavaScriptCore/runtime/JSScope.h b/JavaScriptCore/runtime/JSScope.h index db66237d..3f62a45a 100644 --- a/JavaScriptCore/runtime/JSScope.h +++ b/JavaScriptCore/runtime/JSScope.h @@ -31,6 +31,7 @@ namespace JSC { class ScopeChainIterator; +class VariableWatchpointSet; enum ResolveMode { ThrowIfNotFound, @@ -95,10 +96,12 @@ inline bool needsVarInjectionChecks(ResolveType type) } struct ResolveOp { - ResolveOp(ResolveType type, size_t depth, Structure* structure, uintptr_t operand) + ResolveOp(ResolveType type, size_t depth, Structure* structure, JSActivation* activation, VariableWatchpointSet* watchpointSet, uintptr_t operand) : type(type) , depth(depth) , structure(structure) + , activation(activation) + , watchpointSet(watchpointSet) , operand(operand) { } @@ -106,6 +109,8 @@ struct ResolveOp { ResolveType type; size_t depth; Structure* structure; + JSActivation* activation; + VariableWatchpointSet* watchpointSet; uintptr_t operand; }; diff --git a/JavaScriptCore/runtime/JSSetIterator.cpp b/JavaScriptCore/runtime/JSSetIterator.cpp new file mode 100644 index 00000000..b1d8a651 --- /dev/null +++ b/JavaScriptCore/runtime/JSSetIterator.cpp @@ -0,0 +1,64 @@ +/* + * Copyright (C) 2013 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 "JSSetIterator.h" + +#include "JSCJSValueInlines.h" +#include "JSCellInlines.h" +#include "JSSet.h" +#include "SlotVisitorInlines.h" + +namespace JSC { + +const ClassInfo JSSetIterator::s_info = { "Set Iterator", &Base::s_info, 0, 0, CREATE_METHOD_TABLE(JSSetIterator) }; + +void JSSetIterator::finishCreation(VM& vm, JSSet* iteratedObject) +{ + Base::finishCreation(vm); + m_iteratedObjectData.set(vm, this, iteratedObject->mapData()); +} + +void JSSetIterator::visitChildren(JSCell* cell, SlotVisitor& visitor) +{ + JSSetIterator* thisObject = jsCast(cell); + ASSERT_GC_OBJECT_INHERITS(thisObject, info()); + COMPILE_ASSERT(StructureFlags & OverridesVisitChildren, OverridesVisitChildrenWithoutSettingFlag); + ASSERT(thisObject->structure()->typeInfo().overridesVisitChildren()); + + Base::visitChildren(thisObject, visitor); + visitor.append(&thisObject->m_iteratedObjectData); +} + +JSValue JSSetIterator::createPair(CallFrame* callFrame, JSValue key, JSValue value) +{ + MarkedArgumentBuffer args; + args.append(key); + args.append(value); + JSGlobalObject* globalObject = callFrame->callee()->globalObject(); + return constructArray(callFrame, 0, globalObject, args); +} + +} diff --git a/JavaScriptCore/runtime/JSSetIterator.h b/JavaScriptCore/runtime/JSSetIterator.h new file mode 100644 index 00000000..0ecd19e3 --- /dev/null +++ b/JavaScriptCore/runtime/JSSetIterator.h @@ -0,0 +1,93 @@ +/* + * Copyright (C) 2013 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. + */ + +#ifndef JSSetIterator_h +#define JSSetIterator_h + +#include "JSDestructibleObject.h" +#include "JSSet.h" + +#include "MapData.h" + +namespace JSC { +enum SetIterationKind : uint32_t { + SetIterateKey, + SetIterateValue, + SetIterateKeyValue, +}; + +class JSSetIterator : public JSDestructibleObject { +public: + typedef JSDestructibleObject Base; + + DECLARE_EXPORT_INFO; + + static Structure* createStructure(VM& vm, JSGlobalObject* globalObject, JSValue prototype) + { + return Structure::create(vm, globalObject, prototype, TypeInfo(ObjectType, StructureFlags), info()); + } + + static JSSetIterator* create(VM& vm, Structure* structure, JSSet* iteratedObject, SetIterationKind kind) + { + JSSetIterator* instance = new (NotNull, allocateCell(vm.heap)) JSSetIterator(vm, structure, iteratedObject, kind); + instance->finishCreation(vm, iteratedObject); + return instance; + } + + bool next(CallFrame* callFrame, JSValue& value) + { + if (!m_iterator.ensureSlot()) + return false; + if (m_kind == SetIterateValue || m_kind == SetIterateKey) + value = m_iterator.key(); + else + value = createPair(callFrame, m_iterator.key(), m_iterator.key()); + ++m_iterator; + return true; + } + +private: + + static const unsigned StructureFlags = Base::StructureFlags | OverridesVisitChildren; + + JSSetIterator(VM& vm, Structure* structure, JSSet* iteratedObject, SetIterationKind kind) + : Base(vm, structure) + , m_iterator(iteratedObject->mapData()->begin()) + , m_kind(kind) + { + } + + void finishCreation(VM&, JSSet*); + JSValue createPair(CallFrame*, JSValue, JSValue); + static void visitChildren(JSCell*, SlotVisitor&); + + WriteBarrier m_iteratedObjectData; + MapData::const_iterator m_iterator; + SetIterationKind m_kind; +}; + +} + +#endif // !defined(JSSetIterator_h) diff --git a/JavaScriptCore/runtime/JSString.cpp b/JavaScriptCore/runtime/JSString.cpp index a5bfe266..099b6234 100644 --- a/JavaScriptCore/runtime/JSString.cpp +++ b/JavaScriptCore/runtime/JSString.cpp @@ -72,7 +72,7 @@ void JSString::visitChildren(JSCell* cell, SlotVisitor& visitor) else { StringImpl* impl = thisObject->m_value.impl(); ASSERT(impl); - visitor.reportExtraMemoryUsage(impl->costDuringGC()); + visitor.reportExtraMemoryUsage(thisObject, impl->costDuringGC()); } } diff --git a/JavaScriptCore/runtime/JSString.h b/JavaScriptCore/runtime/JSString.h index e49e532d..2b1cdddc 100644 --- a/JavaScriptCore/runtime/JSString.h +++ b/JavaScriptCore/runtime/JSString.h @@ -22,12 +22,14 @@ #ifndef JSString_h #define JSString_h + #include "CallFrame.h" #include "CommonIdentifiers.h" #include "Identifier.h" #include "PropertyDescriptor.h" #include "PropertySlot.h" #include "Structure.h" +#include namespace JSC { @@ -322,7 +324,7 @@ namespace JSC { JS_EXPORT_PRIVATE JSString* getIndexSlowCase(ExecState*, unsigned); - mutable FixedArray, s_maxInternalRopeLength> m_fibers; + mutable std::array, s_maxInternalRopeLength> m_fibers; }; diff --git a/JavaScriptCore/runtime/JSSymbolTableObject.h b/JavaScriptCore/runtime/JSSymbolTableObject.h index 3d69a045..b5b20a84 100644 --- a/JavaScriptCore/runtime/JSSymbolTableObject.h +++ b/JavaScriptCore/runtime/JSSymbolTableObject.h @@ -39,7 +39,7 @@ class JSSymbolTableObject : public JSScope { public: typedef JSScope Base; - SharedSymbolTable* symbolTable() const { return m_symbolTable.get(); } + SymbolTable* symbolTable() const { return m_symbolTable.get(); } JS_EXPORT_PRIVATE static bool deleteProperty(JSCell*, ExecState*, PropertyName); JS_EXPORT_PRIVATE static void getOwnNonIndexPropertyNames(JSObject*, ExecState*, PropertyNameArray&, EnumerationMode); @@ -47,7 +47,7 @@ class JSSymbolTableObject : public JSScope { protected: static const unsigned StructureFlags = IsEnvironmentRecord | OverridesVisitChildren | OverridesGetPropertyNames | Base::StructureFlags; - JSSymbolTableObject(VM& vm, Structure* structure, JSScope* scope, SharedSymbolTable* symbolTable = 0) + JSSymbolTableObject(VM& vm, Structure* structure, JSScope* scope, SymbolTable* symbolTable = 0) : Base(vm, structure, scope) { if (symbolTable) @@ -58,12 +58,12 @@ class JSSymbolTableObject : public JSScope { { Base::finishCreation(vm); if (!m_symbolTable) - m_symbolTable.set(vm, this, SharedSymbolTable::create(vm)); + m_symbolTable.set(vm, this, SymbolTable::create(vm)); } static void visitChildren(JSCell*, SlotVisitor&); - WriteBarrier m_symbolTable; + WriteBarrier m_symbolTable; }; template @@ -137,8 +137,8 @@ inline bool symbolTablePut( throwTypeError(exec, StrictModeReadonlyPropertyWriteError); return true; } - if (UNLIKELY(wasFat)) - iter->value.notifyWrite(); + if (VariableWatchpointSet* set = iter->value.watchpointSet()) + set->notifyWrite(value); reg = &object->registerAt(fastEntry.getIndex()); } // I'd prefer we not hold lock while executing barriers, since I prefer to reserve @@ -164,7 +164,8 @@ inline bool symbolTablePutWithAttributes( return false; SymbolTableEntry& entry = iter->value; ASSERT(!entry.isNull()); - entry.notifyWrite(); + if (VariableWatchpointSet* set = entry.watchpointSet()) + set->notifyWrite(value); entry.setAttributes(attributes); reg = &object->registerAt(entry.getIndex()); } diff --git a/JavaScriptCore/runtime/JSTypeInfo.h b/JavaScriptCore/runtime/JSTypeInfo.h index 109a032b..d70d6512 100644 --- a/JavaScriptCore/runtime/JSTypeInfo.h +++ b/JavaScriptCore/runtime/JSTypeInfo.h @@ -47,7 +47,8 @@ namespace JSC { static const unsigned OverridesGetPropertyNames = 1 << 8; static const unsigned ProhibitsPropertyCaching = 1 << 9; static const unsigned HasImpureGetOwnPropertySlot = 1 << 10; - static const unsigned StructureHasRareData = 1 << 11; + static const unsigned NewImpurePropertyFiresWatchpoints = 1 << 11; + static const unsigned StructureHasRareData = 1 << 12; class TypeInfo { public: @@ -83,6 +84,7 @@ namespace JSC { bool overridesGetPropertyNames() const { return isSetOnFlags2(OverridesGetPropertyNames); } bool prohibitsPropertyCaching() const { return isSetOnFlags2(ProhibitsPropertyCaching); } bool hasImpureGetOwnPropertySlot() const { return isSetOnFlags2(HasImpureGetOwnPropertySlot); } + bool newImpurePropertyFiresWatchpoints() const { return isSetOnFlags2(NewImpurePropertyFiresWatchpoints); } bool structureHasRareData() const { return isSetOnFlags2(StructureHasRareData); } static ptrdiff_t flagsOffset() diff --git a/JavaScriptCore/runtime/JSVariableObject.h b/JavaScriptCore/runtime/JSVariableObject.h index 4dc9e996..9bbb3919 100644 --- a/JavaScriptCore/runtime/JSVariableObject.h +++ b/JavaScriptCore/runtime/JSVariableObject.h @@ -36,40 +36,40 @@ namespace JSC { - class LLIntOffsetsExtractor; - class Register; +class LLIntOffsetsExtractor; +class Register; - class JSVariableObject : public JSSymbolTableObject { - friend class JIT; - friend class LLIntOffsetsExtractor; +class JSVariableObject : public JSSymbolTableObject { + friend class JIT; + friend class LLIntOffsetsExtractor; - public: - typedef JSSymbolTableObject Base; +public: + typedef JSSymbolTableObject Base; - WriteBarrierBase& registerAt(int index) const { return m_registers[index]; } + WriteBarrierBase* registers() { return m_registers; } + WriteBarrierBase& registerAt(int index) const { return m_registers[index]; } - WriteBarrierBase* const * addressOfRegisters() const { return &m_registers; } - static size_t offsetOfRegisters() { return OBJECT_OFFSETOF(JSVariableObject, m_registers); } + WriteBarrierBase* const * addressOfRegisters() const { return &m_registers; } + static size_t offsetOfRegisters() { return OBJECT_OFFSETOF(JSVariableObject, m_registers); } - DECLARE_INFO; + DECLARE_INFO; - protected: - static const unsigned StructureFlags = Base::StructureFlags; +protected: + static const unsigned StructureFlags = Base::StructureFlags; - JSVariableObject( - VM& vm, - Structure* structure, - Register* registers, - JSScope* scope, - SharedSymbolTable* symbolTable = 0 - ) - : Base(vm, structure, scope, symbolTable) - , m_registers(reinterpret_cast*>(registers)) - { - } + JSVariableObject( + VM& vm, + Structure* structure, + Register* registers, + JSScope* scope, + SymbolTable* symbolTable = 0) + : Base(vm, structure, scope, symbolTable) + , m_registers(reinterpret_cast*>(registers)) + { + } - WriteBarrierBase* m_registers; // "r" in the stack. - }; + WriteBarrierBase* m_registers; // "r" in the stack. +}; } // namespace JSC diff --git a/JavaScriptCore/runtime/LiteralParser.h b/JavaScriptCore/runtime/LiteralParser.h index fac97571..f05f0320 100644 --- a/JavaScriptCore/runtime/LiteralParser.h +++ b/JavaScriptCore/runtime/LiteralParser.h @@ -29,6 +29,7 @@ #include "Identifier.h" #include "JSCJSValue.h" #include "JSGlobalObjectFunctions.h" +#include #include namespace JSC { @@ -155,8 +156,8 @@ class LiteralParser { ParserMode m_mode; String m_parseErrorMessage; static unsigned const MaximumCachableCharacter = 128; - FixedArray m_shortIdentifiers; - FixedArray m_recentIdentifiers; + std::array m_shortIdentifiers; + std::array m_recentIdentifiers; ALWAYS_INLINE const Identifier makeIdentifier(const LChar* characters, size_t length); ALWAYS_INLINE const Identifier makeIdentifier(const UChar* characters, size_t length); }; diff --git a/JavaScriptCore/runtime/Lookup.h b/JavaScriptCore/runtime/Lookup.h index d1c8b80b..1876a86a 100644 --- a/JavaScriptCore/runtime/Lookup.h +++ b/JavaScriptCore/runtime/Lookup.h @@ -26,7 +26,7 @@ #include "Identifier.h" #include "JSGlobalObject.h" #include "PropertySlot.h" -#include +#include "PutPropertySlot.h" #include namespace JSC { @@ -42,7 +42,7 @@ namespace JSC { // FIXME: There is no reason this get function can't be simpler. // ie. typedef JSValue (*GetFunction)(ExecState*, JSObject* baseObject) typedef PropertySlot::GetValueFunc GetFunction; - typedef void (*PutFunction)(ExecState*, JSObject* baseObject, JSValue value); + typedef PutPropertySlot::PutValueFunc PutFunction; class HashEntry { WTF_MAKE_FAST_ALLOCATED; @@ -291,15 +291,15 @@ namespace JSC { return true; } - template - inline void putEntry(ExecState* exec, const HashEntry* entry, PropertyName propertyName, JSValue value, ThisImp* thisObj, bool shouldThrow = false) + inline void putEntry(ExecState* exec, const HashEntry* entry, PropertyName propertyName, JSValue value, PutPropertySlot& slot) { // If this is a function put it as an override property. if (entry->attributes() & Function) - thisObj->putDirect(exec->vm(), propertyName, value); - else if (!(entry->attributes() & ReadOnly)) - entry->propertyPutter()(exec, thisObj, value); - else if (shouldThrow) + slot.base()->putDirect(exec->vm(), propertyName, value); + else if (!(entry->attributes() & ReadOnly)) { + entry->propertyPutter()(exec, JSValue::encode(slot.thisValue()), JSValue::encode(value)); + slot.setCustomProperty(slot.base(), entry->propertyPutter()); + } else if (slot.isStrictMode()) throwTypeError(exec, StrictModeReadonlyPropertyWriteError); } @@ -308,15 +308,14 @@ namespace JSC { * It looks up a hash entry for the property to be set. If an entry * is found it sets the value and returns true, else it returns false. */ - template - inline bool lookupPut(ExecState* exec, PropertyName propertyName, JSValue value, const HashTable& table, ThisImp* thisObj, bool shouldThrow = false) + inline bool lookupPut(ExecState* exec, PropertyName propertyName, JSValue value, const HashTable& table, PutPropertySlot& slot) { const HashEntry* entry = table.entry(exec, propertyName); if (!entry) return false; - putEntry(exec, entry, propertyName, value, thisObj, shouldThrow); + putEntry(exec, entry, propertyName, value, slot); return true; } @@ -329,7 +328,7 @@ namespace JSC { template inline void lookupPut(ExecState* exec, PropertyName propertyName, JSValue value, const HashTable& table, ThisImp* thisObj, PutPropertySlot& slot) { - if (!lookupPut(exec, propertyName, value, table, thisObj, slot.isStrictMode())) + if (!lookupPut(exec, propertyName, value, table, slot)) ParentImp::put(thisObj, exec, propertyName, value, slot); // not found: forward to parent } diff --git a/JavaScriptCore/runtime/MapData.cpp b/JavaScriptCore/runtime/MapData.cpp index 7fe835bd..f5a3e761 100644 --- a/JavaScriptCore/runtime/MapData.cpp +++ b/JavaScriptCore/runtime/MapData.cpp @@ -80,14 +80,15 @@ bool MapData::contains(CallFrame* callFrame, KeyType key) template MapData::Entry* MapData::add(CallFrame* callFrame, Map& map, Key key, KeyType keyValue) { - typename Map::AddResult result = map.add(key, m_size); - if (!result.isNewEntry) - return &m_entries[result.iterator->value]; - if (!ensureSpaceForAppend(callFrame)) { - map.remove(result.iterator); + typename Map::iterator location = map.find(key); + if (location != map.end()) + return &m_entries[location->value]; + + if (!ensureSpaceForAppend(callFrame)) return 0; - } + auto result = map.add(key, m_size); + RELEASE_ASSERT(result.isNewEntry); Entry* entry = &m_entries[m_size++]; new (entry) Entry(); entry->key.set(callFrame->vm(), this, keyValue.value); @@ -197,16 +198,17 @@ CheckedBoolean MapData::ensureSpaceForAppend(CallFrame* callFrame) size_t requiredSize = std::max(m_capacity + (m_capacity / 2) + 1, minimumMapSize); void* newStorage = 0; + DeferGC defer(*callFrame->heap()); if (!callFrame->heap()->tryAllocateStorage(this, requiredSize * sizeof(Entry), &newStorage)) { throwOutOfMemoryError(callFrame); return false; } - DeferGC defer(*callFrame->heap()); Entry* newEntries = static_cast(newStorage); if (shouldPack()) replaceAndPackBackingStore(newEntries, requiredSize); else replaceBackingStore(newEntries, requiredSize); + Heap::writeBarrier(this); return true; } diff --git a/JavaScriptCore/runtime/MapData.h b/JavaScriptCore/runtime/MapData.h index 8b96408d..e6c84613 100644 --- a/JavaScriptCore/runtime/MapData.h +++ b/JavaScriptCore/runtime/MapData.h @@ -44,11 +44,13 @@ class MapData : public JSCell { const WTF::KeyValuePair operator*() const; JSValue key() const { ASSERT(!atEnd()); return m_mapData->m_entries[m_index].key.get(); } JSValue value() const { ASSERT(!atEnd()); return m_mapData->m_entries[m_index].value.get(); } - void operator++(); + void operator++() { ASSERT(!atEnd()); internalIncrement(); } static const_iterator end(const MapData*); bool operator!=(const const_iterator& other); bool operator==(const const_iterator& other); + bool ensureSlot(); + private: // This is a bit gnarly. We use an index of -1 to indicate the // "end()" iterator. By casting to unsigned we can immediately @@ -56,6 +58,7 @@ class MapData : public JSCell { // We need this in order to keep the common case (eg. iter != end()) // fast. bool atEnd() const { return static_cast(m_index) >= static_cast(m_mapData->m_size); } + void internalIncrement(); const MapData* m_mapData; int32_t m_index; }; @@ -166,9 +169,8 @@ ALWAYS_INLINE MapData::KeyType::KeyType(JSValue v) value = jsNumber(i); } -ALWAYS_INLINE void MapData::const_iterator::operator++() +ALWAYS_INLINE void MapData::const_iterator::internalIncrement() { - ASSERT(!atEnd()); Entry* entries = m_mapData->m_entries; size_t index = m_index + 1; size_t end = m_mapData->m_size; @@ -176,12 +178,25 @@ ALWAYS_INLINE void MapData::const_iterator::operator++() index++; m_index = index; } + +ALWAYS_INLINE bool MapData::const_iterator::ensureSlot() +{ + // When an iterator exists outside of host cost it is possible for + // the containing map to be modified + Entry* entries = m_mapData->m_entries; + size_t index = m_index; + size_t end = m_mapData->m_size; + if (index < end && entries[index].key) + return true; + internalIncrement(); + return static_cast(m_index) < end; +} ALWAYS_INLINE MapData::const_iterator::const_iterator(const MapData* mapData) : m_mapData(mapData) - , m_index(0) + , m_index(-1) { - m_mapData->m_iteratorCount++; + internalIncrement(); } ALWAYS_INLINE MapData::const_iterator::~const_iterator() diff --git a/JavaScriptCore/runtime/MapIteratorConstructor.cpp b/JavaScriptCore/runtime/MapIteratorConstructor.cpp new file mode 100644 index 00000000..fbc6c8b7 --- /dev/null +++ b/JavaScriptCore/runtime/MapIteratorConstructor.cpp @@ -0,0 +1,45 @@ +/* + * Copyright (C) 2013 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 "MapIteratorConstructor.h" + +#include "JSCJSValueInlines.h" +#include "JSCellInlines.h" +#include "JSGlobalObject.h" +#include "JSMapIterator.h" +#include "MapIteratorPrototype.h" + +namespace JSC { + +const ClassInfo MapIteratorConstructor::s_info = { "MapIterator Iterator", &Base::s_info, 0, 0, CREATE_METHOD_TABLE(MapIteratorConstructor) }; + +void MapIteratorConstructor::finishCreation(VM& vm, MapIteratorPrototype* prototype) +{ + Base::finishCreation(vm); + putDirectWithoutTransition(vm, vm.propertyNames->prototype, prototype, DontEnum | DontDelete | ReadOnly); +} + +} diff --git a/JavaScriptCore/runtime/MapIteratorConstructor.h b/JavaScriptCore/runtime/MapIteratorConstructor.h new file mode 100644 index 00000000..45ba5b7f --- /dev/null +++ b/JavaScriptCore/runtime/MapIteratorConstructor.h @@ -0,0 +1,63 @@ +/* + * Copyright (C) 2013 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. + */ + +#ifndef MapIteratorConstructor_h +#define MapIteratorConstructor_h + +#include "JSObject.h" + +namespace JSC { + +class MapIteratorPrototype; + +class MapIteratorConstructor : public JSNonFinalObject { +public: + typedef JSNonFinalObject Base; + + static MapIteratorConstructor* create(VM& vm, Structure* structure, MapIteratorPrototype* prototype) + { + MapIteratorConstructor* constructor = new (NotNull, allocateCell(vm.heap)) MapIteratorConstructor(vm, structure); + constructor->finishCreation(vm, prototype); + return constructor; + } + + DECLARE_INFO; + + static Structure* createStructure(VM& vm, JSGlobalObject* globalObject, JSValue prototype) + { + return Structure::create(vm, globalObject, prototype, TypeInfo(ObjectType, StructureFlags), info()); + } + +private: + MapIteratorConstructor(VM& vm, Structure* structure) + : Base(vm, structure) + { + } + void finishCreation(VM&, MapIteratorPrototype*); +}; + +} + +#endif // !defined(MapConstructor_h) diff --git a/JavaScriptCore/runtime/MapIteratorPrototype.cpp b/JavaScriptCore/runtime/MapIteratorPrototype.cpp new file mode 100644 index 00000000..72310205 --- /dev/null +++ b/JavaScriptCore/runtime/MapIteratorPrototype.cpp @@ -0,0 +1,69 @@ +/* + * Copyright (C) 2013 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 "MapIteratorPrototype.h" + +#include "JSCJSValueInlines.h" +#include "JSCellInlines.h" +#include "JSMapIterator.h" + +namespace JSC { + +const ClassInfo MapIteratorPrototype::s_info = { "Map Iterator", &Base::s_info, 0, 0, CREATE_METHOD_TABLE(MapIteratorPrototype) }; + +static EncodedJSValue JSC_HOST_CALL MapIteratorPrototypeFuncIterator(ExecState*); +static EncodedJSValue JSC_HOST_CALL MapIteratorPrototypeFuncNext(ExecState*); + + +void MapIteratorPrototype::finishCreation(VM& vm, JSGlobalObject* globalObject) +{ + Base::finishCreation(vm); + ASSERT(inherits(info())); + vm.prototypeMap.addPrototype(this); + + JSC_NATIVE_FUNCTION(vm.propertyNames->iteratorPrivateName, MapIteratorPrototypeFuncIterator, DontEnum, 0); + JSC_NATIVE_FUNCTION(vm.propertyNames->iteratorNextPrivateName, MapIteratorPrototypeFuncNext, DontEnum, 0); +} + +EncodedJSValue JSC_HOST_CALL MapIteratorPrototypeFuncIterator(CallFrame* callFrame) +{ + return JSValue::encode(callFrame->thisValue()); +} + +EncodedJSValue JSC_HOST_CALL MapIteratorPrototypeFuncNext(CallFrame* callFrame) +{ + JSMapIterator* iterator = jsDynamicCast(callFrame->thisValue()); + if (!iterator) + return JSValue::encode(throwTypeError(callFrame, ASCIILiteral("Cannot call MapIterator.next() on a non-MapIterator object"))); + + JSValue result; + if (iterator->next(callFrame, result)) + return JSValue::encode(result); + return JSValue::encode(callFrame->vm().iterationTerminator.get()); +} + + +} diff --git a/JavaScriptCore/runtime/MapIteratorPrototype.h b/JavaScriptCore/runtime/MapIteratorPrototype.h new file mode 100644 index 00000000..c56034f8 --- /dev/null +++ b/JavaScriptCore/runtime/MapIteratorPrototype.h @@ -0,0 +1,61 @@ +/* + * Copyright (C) 2013 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. + */ + +#ifndef MapIteratorPrototype_h +#define MapIteratorPrototype_h + +#include "JSObject.h" + +namespace JSC { + +class MapIteratorPrototype : public JSNonFinalObject { +public: + typedef JSNonFinalObject Base; + + static MapIteratorPrototype* create(VM& vm, JSGlobalObject* globalObject, Structure* structure) + { + MapIteratorPrototype* prototype = new (NotNull, allocateCell(vm.heap)) MapIteratorPrototype(vm, structure); + prototype->finishCreation(vm, globalObject); + return prototype; + } + + DECLARE_INFO; + + static Structure* createStructure(VM& vm, JSGlobalObject* globalObject, JSValue prototype) + { + return Structure::create(vm, globalObject, prototype, TypeInfo(ObjectType, StructureFlags), info()); + } + +private: + MapIteratorPrototype(VM& vm, Structure* structure) + : Base(vm, structure) + { + } + void finishCreation(VM&, JSGlobalObject*); +}; + +} + +#endif // !defined(MapIteratorPrototype_h) diff --git a/JavaScriptCore/runtime/MapPrototype.cpp b/JavaScriptCore/runtime/MapPrototype.cpp index 25200f6a..889599e0 100644 --- a/JavaScriptCore/runtime/MapPrototype.cpp +++ b/JavaScriptCore/runtime/MapPrototype.cpp @@ -33,6 +33,7 @@ #include "JSCJSValueInlines.h" #include "JSFunctionInlines.h" #include "JSMap.h" +#include "JSMapIterator.h" #include "MapData.h" namespace JSC { @@ -45,6 +46,9 @@ static EncodedJSValue JSC_HOST_CALL mapProtoFuncForEach(ExecState*); static EncodedJSValue JSC_HOST_CALL mapProtoFuncGet(ExecState*); static EncodedJSValue JSC_HOST_CALL mapProtoFuncHas(ExecState*); static EncodedJSValue JSC_HOST_CALL mapProtoFuncSet(ExecState*); +static EncodedJSValue JSC_HOST_CALL mapProtoFuncKeys(ExecState*); +static EncodedJSValue JSC_HOST_CALL mapProtoFuncValues(ExecState*); +static EncodedJSValue JSC_HOST_CALL mapProtoFuncEntries(ExecState*); static EncodedJSValue JSC_HOST_CALL mapProtoFuncSize(ExecState*); @@ -60,6 +64,10 @@ void MapPrototype::finishCreation(VM& vm, JSGlobalObject* globalObject) JSC_NATIVE_FUNCTION(vm.propertyNames->get, mapProtoFuncGet, DontEnum, 1); JSC_NATIVE_FUNCTION(vm.propertyNames->has, mapProtoFuncHas, DontEnum, 1); JSC_NATIVE_FUNCTION(vm.propertyNames->set, mapProtoFuncSet, DontEnum, 2); + JSC_NATIVE_FUNCTION(vm.propertyNames->keys, mapProtoFuncKeys, DontEnum, 0); + JSC_NATIVE_FUNCTION(vm.propertyNames->values, mapProtoFuncValues, DontEnum, 0); + JSC_NATIVE_FUNCTION(vm.propertyNames->entries, mapProtoFuncEntries, DontEnum, 0); + JSC_NATIVE_FUNCTION(vm.propertyNames->iteratorPrivateName, mapProtoFuncEntries, DontEnum, 0); GetterSetter* accessor = GetterSetter::create(vm); JSFunction* function = JSFunction::create(vm, globalObject, 0, vm.propertyNames->size.string(), mapProtoFuncSize); @@ -166,4 +174,28 @@ EncodedJSValue JSC_HOST_CALL mapProtoFuncSize(CallFrame* callFrame) return JSValue::encode(jsNumber(data->size(callFrame))); } +EncodedJSValue JSC_HOST_CALL mapProtoFuncValues(CallFrame* callFrame) +{ + JSMap* thisObj = jsDynamicCast(callFrame->thisValue()); + if (!thisObj) + return JSValue::encode(throwTypeError(callFrame, ASCIILiteral("Cannot create a Map value iterator for a non-Map object."))); + return JSValue::encode(JSMapIterator::create(callFrame->vm(), callFrame->callee()->globalObject()->mapIteratorStructure(), thisObj, MapIterateValue)); +} + +EncodedJSValue JSC_HOST_CALL mapProtoFuncEntries(CallFrame* callFrame) +{ + JSMap* thisObj = jsDynamicCast(callFrame->thisValue()); + if (!thisObj) + return JSValue::encode(throwTypeError(callFrame, ASCIILiteral("Cannot create a Map key iterator for a non-Map object."))); + return JSValue::encode(JSMapIterator::create(callFrame->vm(), callFrame->callee()->globalObject()->mapIteratorStructure(), thisObj, MapIterateKeyValue)); +} + +EncodedJSValue JSC_HOST_CALL mapProtoFuncKeys(CallFrame* callFrame) +{ + JSMap* thisObj = jsDynamicCast(callFrame->thisValue()); + if (!thisObj) + return JSValue::encode(throwTypeError(callFrame, ASCIILiteral("Cannot create a Map entry iterator for a non-Map object."))); + return JSValue::encode(JSMapIterator::create(callFrame->vm(), callFrame->callee()->globalObject()->mapIteratorStructure(), thisObj, MapIterateKey)); +} + } diff --git a/JavaScriptCore/runtime/MathObject.cpp b/JavaScriptCore/runtime/MathObject.cpp index ebcdf299..ca355ed4 100644 --- a/JavaScriptCore/runtime/MathObject.cpp +++ b/JavaScriptCore/runtime/MathObject.cpp @@ -36,22 +36,35 @@ STATIC_ASSERT_IS_TRIVIALLY_DESTRUCTIBLE(MathObject); static EncodedJSValue JSC_HOST_CALL mathProtoFuncAbs(ExecState*); static EncodedJSValue JSC_HOST_CALL mathProtoFuncACos(ExecState*); +static EncodedJSValue JSC_HOST_CALL mathProtoFuncACosh(ExecState*); static EncodedJSValue JSC_HOST_CALL mathProtoFuncASin(ExecState*); +static EncodedJSValue JSC_HOST_CALL mathProtoFuncASinh(ExecState*); static EncodedJSValue JSC_HOST_CALL mathProtoFuncATan(ExecState*); +static EncodedJSValue JSC_HOST_CALL mathProtoFuncATanh(ExecState*); static EncodedJSValue JSC_HOST_CALL mathProtoFuncATan2(ExecState*); +static EncodedJSValue JSC_HOST_CALL mathProtoFuncCbrt(ExecState*); static EncodedJSValue JSC_HOST_CALL mathProtoFuncCeil(ExecState*); static EncodedJSValue JSC_HOST_CALL mathProtoFuncCos(ExecState*); +static EncodedJSValue JSC_HOST_CALL mathProtoFuncCosh(ExecState*); static EncodedJSValue JSC_HOST_CALL mathProtoFuncExp(ExecState*); +static EncodedJSValue JSC_HOST_CALL mathProtoFuncExpm1(ExecState*); static EncodedJSValue JSC_HOST_CALL mathProtoFuncFloor(ExecState*); +static EncodedJSValue JSC_HOST_CALL mathProtoFuncFround(ExecState*); static EncodedJSValue JSC_HOST_CALL mathProtoFuncLog(ExecState*); +static EncodedJSValue JSC_HOST_CALL mathProtoFuncLog1p(ExecState*); +static EncodedJSValue JSC_HOST_CALL mathProtoFuncLog10(ExecState*); +static EncodedJSValue JSC_HOST_CALL mathProtoFuncLog2(ExecState*); static EncodedJSValue JSC_HOST_CALL mathProtoFuncMax(ExecState*); static EncodedJSValue JSC_HOST_CALL mathProtoFuncMin(ExecState*); static EncodedJSValue JSC_HOST_CALL mathProtoFuncPow(ExecState*); static EncodedJSValue JSC_HOST_CALL mathProtoFuncRandom(ExecState*); static EncodedJSValue JSC_HOST_CALL mathProtoFuncRound(ExecState*); static EncodedJSValue JSC_HOST_CALL mathProtoFuncSin(ExecState*); +static EncodedJSValue JSC_HOST_CALL mathProtoFuncSinh(ExecState*); static EncodedJSValue JSC_HOST_CALL mathProtoFuncSqrt(ExecState*); static EncodedJSValue JSC_HOST_CALL mathProtoFuncTan(ExecState*); +static EncodedJSValue JSC_HOST_CALL mathProtoFuncTanh(ExecState*); +static EncodedJSValue JSC_HOST_CALL mathProtoFuncTrunc(ExecState*); static EncodedJSValue JSC_HOST_CALL mathProtoFuncIMul(ExecState*); } @@ -83,20 +96,33 @@ void MathObject::finishCreation(VM& vm, JSGlobalObject* globalObject) putDirectNativeFunctionWithoutTransition(vm, globalObject, Identifier(&vm, "acos"), 1, mathProtoFuncACos, NoIntrinsic, DontEnum | Function); putDirectNativeFunctionWithoutTransition(vm, globalObject, Identifier(&vm, "asin"), 1, mathProtoFuncASin, NoIntrinsic, DontEnum | Function); putDirectNativeFunctionWithoutTransition(vm, globalObject, Identifier(&vm, "atan"), 1, mathProtoFuncATan, NoIntrinsic, DontEnum | Function); + putDirectNativeFunctionWithoutTransition(vm, globalObject, Identifier(&vm, "acosh"), 1, mathProtoFuncACosh, NoIntrinsic, DontEnum | Function); + putDirectNativeFunctionWithoutTransition(vm, globalObject, Identifier(&vm, "asinh"), 1, mathProtoFuncASinh, NoIntrinsic, DontEnum | Function); + putDirectNativeFunctionWithoutTransition(vm, globalObject, Identifier(&vm, "atanh"), 1, mathProtoFuncATanh, NoIntrinsic, DontEnum | Function); putDirectNativeFunctionWithoutTransition(vm, globalObject, Identifier(&vm, "atan2"), 2, mathProtoFuncATan2, NoIntrinsic, DontEnum | Function); + putDirectNativeFunctionWithoutTransition(vm, globalObject, Identifier(&vm, "cbrt"), 1, mathProtoFuncCbrt, NoIntrinsic, DontEnum | Function); putDirectNativeFunctionWithoutTransition(vm, globalObject, Identifier(&vm, "ceil"), 1, mathProtoFuncCeil, CeilIntrinsic, DontEnum | Function); - putDirectNativeFunctionWithoutTransition(vm, globalObject, Identifier(&vm, "cos"), 1, mathProtoFuncCos, NoIntrinsic, DontEnum | Function); + putDirectNativeFunctionWithoutTransition(vm, globalObject, Identifier(&vm, "cos"), 1, mathProtoFuncCos, CosIntrinsic, DontEnum | Function); + putDirectNativeFunctionWithoutTransition(vm, globalObject, Identifier(&vm, "cosh"), 1, mathProtoFuncCosh, NoIntrinsic, DontEnum | Function); putDirectNativeFunctionWithoutTransition(vm, globalObject, Identifier(&vm, "exp"), 1, mathProtoFuncExp, ExpIntrinsic, DontEnum | Function); + putDirectNativeFunctionWithoutTransition(vm, globalObject, Identifier(&vm, "expm1"), 1, mathProtoFuncExpm1, NoIntrinsic, DontEnum | Function); putDirectNativeFunctionWithoutTransition(vm, globalObject, Identifier(&vm, "floor"), 1, mathProtoFuncFloor, FloorIntrinsic, DontEnum | Function); + putDirectNativeFunctionWithoutTransition(vm, globalObject, Identifier(&vm, "fround"), 1, mathProtoFuncFround, NoIntrinsic, DontEnum | Function); putDirectNativeFunctionWithoutTransition(vm, globalObject, Identifier(&vm, "log"), 1, mathProtoFuncLog, LogIntrinsic, DontEnum | Function); + putDirectNativeFunctionWithoutTransition(vm, globalObject, Identifier(&vm, "log10"), 1, mathProtoFuncLog10, NoIntrinsic, DontEnum | Function); + putDirectNativeFunctionWithoutTransition(vm, globalObject, Identifier(&vm, "log1p"), 1, mathProtoFuncLog1p, NoIntrinsic, DontEnum | Function); + putDirectNativeFunctionWithoutTransition(vm, globalObject, Identifier(&vm, "log2"), 1, mathProtoFuncLog2, NoIntrinsic, DontEnum | Function); putDirectNativeFunctionWithoutTransition(vm, globalObject, Identifier(&vm, "max"), 2, mathProtoFuncMax, MaxIntrinsic, DontEnum | Function); putDirectNativeFunctionWithoutTransition(vm, globalObject, Identifier(&vm, "min"), 2, mathProtoFuncMin, MinIntrinsic, DontEnum | Function); putDirectNativeFunctionWithoutTransition(vm, globalObject, Identifier(&vm, "pow"), 2, mathProtoFuncPow, PowIntrinsic, DontEnum | Function); putDirectNativeFunctionWithoutTransition(vm, globalObject, Identifier(&vm, "random"), 0, mathProtoFuncRandom, NoIntrinsic, DontEnum | Function); putDirectNativeFunctionWithoutTransition(vm, globalObject, Identifier(&vm, "round"), 1, mathProtoFuncRound, RoundIntrinsic, DontEnum | Function); - putDirectNativeFunctionWithoutTransition(vm, globalObject, Identifier(&vm, "sin"), 1, mathProtoFuncSin, NoIntrinsic, DontEnum | Function); + putDirectNativeFunctionWithoutTransition(vm, globalObject, Identifier(&vm, "sin"), 1, mathProtoFuncSin, SinIntrinsic, DontEnum | Function); + putDirectNativeFunctionWithoutTransition(vm, globalObject, Identifier(&vm, "sinh"), 1, mathProtoFuncSinh, NoIntrinsic, DontEnum | Function); putDirectNativeFunctionWithoutTransition(vm, globalObject, Identifier(&vm, "sqrt"), 1, mathProtoFuncSqrt, SqrtIntrinsic, DontEnum | Function); putDirectNativeFunctionWithoutTransition(vm, globalObject, Identifier(&vm, "tan"), 1, mathProtoFuncTan, NoIntrinsic, DontEnum | Function); + putDirectNativeFunctionWithoutTransition(vm, globalObject, Identifier(&vm, "tanh"), 1, mathProtoFuncTanh, NoIntrinsic, DontEnum | Function); + putDirectNativeFunctionWithoutTransition(vm, globalObject, Identifier(&vm, "trunc"), 1, mathProtoFuncTrunc, NoIntrinsic, DontEnum | Function); putDirectNativeFunctionWithoutTransition(vm, globalObject, Identifier(&vm, "imul"), 1, mathProtoFuncIMul, IMulIntrinsic, DontEnum | Function); } @@ -136,7 +162,7 @@ EncodedJSValue JSC_HOST_CALL mathProtoFuncCeil(ExecState* exec) EncodedJSValue JSC_HOST_CALL mathProtoFuncCos(ExecState* exec) { - return JSValue::encode(exec->vm().cachedCos(exec->argument(0).toNumber(exec))); + return JSValue::encode(jsDoubleNumber(cos(exec->argument(0).toNumber(exec)))); } EncodedJSValue JSC_HOST_CALL mathProtoFuncExp(ExecState* exec) @@ -251,7 +277,7 @@ EncodedJSValue JSC_HOST_CALL mathProtoFuncRound(ExecState* exec) EncodedJSValue JSC_HOST_CALL mathProtoFuncSin(ExecState* exec) { - return JSValue::encode(exec->vm().cachedSin(exec->argument(0).toNumber(exec))); + return JSValue::encode(jsDoubleNumber(sin(exec->argument(0).toNumber(exec)))); } EncodedJSValue JSC_HOST_CALL mathProtoFuncSqrt(ExecState* exec) @@ -273,6 +299,75 @@ EncodedJSValue JSC_HOST_CALL mathProtoFuncIMul(ExecState* exec) return JSValue::encode(jsNumber(left * right)); } +EncodedJSValue JSC_HOST_CALL mathProtoFuncACosh(ExecState* exec) +{ + return JSValue::encode(jsDoubleNumber(acosh(exec->argument(0).toNumber(exec)))); +} + +EncodedJSValue JSC_HOST_CALL mathProtoFuncASinh(ExecState* exec) +{ + return JSValue::encode(jsDoubleNumber(asinh(exec->argument(0).toNumber(exec)))); +} + +EncodedJSValue JSC_HOST_CALL mathProtoFuncATanh(ExecState* exec) +{ + return JSValue::encode(jsDoubleNumber(atanh(exec->argument(0).toNumber(exec)))); +} + +EncodedJSValue JSC_HOST_CALL mathProtoFuncCbrt(ExecState* exec) +{ + return JSValue::encode(jsDoubleNumber(cbrt(exec->argument(0).toNumber(exec)))); +} + +EncodedJSValue JSC_HOST_CALL mathProtoFuncCosh(ExecState* exec) +{ + return JSValue::encode(jsDoubleNumber(cosh(exec->argument(0).toNumber(exec)))); +} + +EncodedJSValue JSC_HOST_CALL mathProtoFuncExpm1(ExecState* exec) +{ + return JSValue::encode(jsDoubleNumber(expm1(exec->argument(0).toNumber(exec)))); +} + +EncodedJSValue JSC_HOST_CALL mathProtoFuncFround(ExecState* exec) +{ + return JSValue::encode(jsDoubleNumber(static_cast(exec->argument(0).toNumber(exec)))); +} + +EncodedJSValue JSC_HOST_CALL mathProtoFuncLog1p(ExecState* exec) +{ + double value = exec->argument(0).toNumber(exec); + if (value == 0) + return JSValue::encode(jsDoubleNumber(value)); + return JSValue::encode(jsDoubleNumber(log1p(value))); +} + +EncodedJSValue JSC_HOST_CALL mathProtoFuncLog10(ExecState* exec) +{ + return JSValue::encode(jsDoubleNumber(log10(exec->argument(0).toNumber(exec)))); +} + +EncodedJSValue JSC_HOST_CALL mathProtoFuncLog2(ExecState* exec) +{ + return JSValue::encode(jsDoubleNumber(log2(exec->argument(0).toNumber(exec)))); +} + +EncodedJSValue JSC_HOST_CALL mathProtoFuncSinh(ExecState* exec) +{ + return JSValue::encode(jsDoubleNumber(sinh(exec->argument(0).toNumber(exec)))); +} + +EncodedJSValue JSC_HOST_CALL mathProtoFuncTanh(ExecState* exec) +{ + return JSValue::encode(jsDoubleNumber(tanh(exec->argument(0).toNumber(exec)))); +} + +EncodedJSValue JSC_HOST_CALL mathProtoFuncTrunc(ExecState*exec) +{ + return JSValue::encode(jsNumber(exec->argument(0).toIntegerPreserveNaN(exec))); +} + + #if PLATFORM(IOS) && CPU(ARM_THUMB2) // The following code is taken from netlib.org: diff --git a/JavaScriptCore/runtime/MemoryStatistics.cpp b/JavaScriptCore/runtime/MemoryStatistics.cpp index 5459ff3d..a2eaf349 100644 --- a/JavaScriptCore/runtime/MemoryStatistics.cpp +++ b/JavaScriptCore/runtime/MemoryStatistics.cpp @@ -37,7 +37,7 @@ GlobalMemoryStatistics globalMemoryStatistics() GlobalMemoryStatistics stats; stats.stackBytes = JSStack::committedByteCount(); -#if ENABLE(EXECUTABLE_ALLOCATOR_FIXED) || ((PLATFORM(BLACKBERRY) || PLATFORM(EFL)) && ENABLE(JIT)) +#if ENABLE(EXECUTABLE_ALLOCATOR_FIXED) || (PLATFORM(EFL) && ENABLE(JIT)) stats.JITBytes = ExecutableAllocator::committedByteCount(); #else stats.JITBytes = 0; diff --git a/JavaScriptCore/runtime/JSChunk.cpp b/JavaScriptCore/runtime/Microtask.h similarity index 79% rename from JavaScriptCore/runtime/JSChunk.cpp rename to JavaScriptCore/runtime/Microtask.h index f064de8b..f996a7c7 100644 --- a/JavaScriptCore/runtime/JSChunk.cpp +++ b/JavaScriptCore/runtime/Microtask.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2011 Apple Inc. All rights reserved. + * Copyright (C) 2014 Apple Inc. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -23,6 +23,24 @@ * THE POSSIBILITY OF SUCH DAMAGE. */ -#include "config.h" -#include "JSChunk.h" +#ifndef Microtask_h +#define Microtask_h +#include + +namespace JSC { + +class ExecState; + +class Microtask : public RefCounted { +public: + virtual ~Microtask() + { + } + + virtual void run(ExecState*) = 0; +}; + +} // namespace JSC + +#endif // Microtask_h diff --git a/JavaScriptCore/runtime/NumberConstructor.cpp b/JavaScriptCore/runtime/NumberConstructor.cpp index 938f3d20..17963a15 100644 --- a/JavaScriptCore/runtime/NumberConstructor.cpp +++ b/JavaScriptCore/runtime/NumberConstructor.cpp @@ -29,11 +29,11 @@ namespace JSC { -static JSValue numberConstructorNaNValue(ExecState*, JSValue, PropertyName); -static JSValue numberConstructorNegInfinity(ExecState*, JSValue, PropertyName); -static JSValue numberConstructorPosInfinity(ExecState*, JSValue, PropertyName); -static JSValue numberConstructorMaxValue(ExecState*, JSValue, PropertyName); -static JSValue numberConstructorMinValue(ExecState*, JSValue, PropertyName); +static EncodedJSValue numberConstructorNaNValue(ExecState*, EncodedJSValue, EncodedJSValue, PropertyName); +static EncodedJSValue numberConstructorNegInfinity(ExecState*, EncodedJSValue, EncodedJSValue, PropertyName); +static EncodedJSValue numberConstructorPosInfinity(ExecState*, EncodedJSValue, EncodedJSValue, PropertyName); +static EncodedJSValue numberConstructorMaxValue(ExecState*, EncodedJSValue, EncodedJSValue, PropertyName); +static EncodedJSValue numberConstructorMinValue(ExecState*, EncodedJSValue, EncodedJSValue, PropertyName); } // namespace JSC @@ -60,8 +60,6 @@ NumberConstructor::NumberConstructor(VM& vm, Structure* structure) { } -static double MinValueAccountingForDenormals = DBL_MIN; - void NumberConstructor::finishCreation(VM& vm, NumberPrototype* numberPrototype) { Base::finishCreation(vm, NumberPrototype::info()->className); @@ -72,14 +70,6 @@ void NumberConstructor::finishCreation(VM& vm, NumberPrototype* numberPrototype) // no. of arguments for constructor putDirectWithoutTransition(vm, vm.propertyNames->length, jsNumber(1), ReadOnly | DontEnum | DontDelete); - - // Test for denormal support. Use 5E-324 as MIN_VALUE if we have denormals - // Careful: this test gets easily optimized away by the compiler, hence - // the assignment to another var. - double denormalTest = MinValueAccountingForDenormals / 2; - if( denormalTest != 0 ) { - MinValueAccountingForDenormals = 5E-324; - } } bool NumberConstructor::getOwnPropertySlot(JSObject* object, ExecState* exec, PropertyName propertyName, PropertySlot& slot) @@ -92,29 +82,29 @@ void NumberConstructor::put(JSCell* cell, ExecState* exec, PropertyName property lookupPut(exec, propertyName, value, ExecState::numberConstructorTable(exec), jsCast(cell), slot); } -static JSValue numberConstructorNaNValue(ExecState*, JSValue, PropertyName) +static EncodedJSValue numberConstructorNaNValue(ExecState*, EncodedJSValue, EncodedJSValue, PropertyName) { - return jsNaN(); + return JSValue::encode(jsNaN()); } -static JSValue numberConstructorNegInfinity(ExecState*, JSValue, PropertyName) +static EncodedJSValue numberConstructorNegInfinity(ExecState*, EncodedJSValue, EncodedJSValue, PropertyName) { - return jsNumber(-std::numeric_limits::infinity()); + return JSValue::encode(jsNumber(-std::numeric_limits::infinity())); } -static JSValue numberConstructorPosInfinity(ExecState*, JSValue, PropertyName) +static EncodedJSValue numberConstructorPosInfinity(ExecState*, EncodedJSValue, EncodedJSValue, PropertyName) { - return jsNumber(std::numeric_limits::infinity()); + return JSValue::encode(jsNumber(std::numeric_limits::infinity())); } -static JSValue numberConstructorMaxValue(ExecState*, JSValue, PropertyName) +static EncodedJSValue numberConstructorMaxValue(ExecState*, EncodedJSValue, EncodedJSValue, PropertyName) { - return jsNumber(1.7976931348623157E+308); + return JSValue::encode(jsNumber(1.7976931348623157E+308)); } -static JSValue numberConstructorMinValue(ExecState*, JSValue, PropertyName) +static EncodedJSValue numberConstructorMinValue(ExecState*, EncodedJSValue, EncodedJSValue, PropertyName) { - return jsNumber(MinValueAccountingForDenormals); + return JSValue::encode(jsNumber(5E-324)); } // ECMA 15.7.1 diff --git a/JavaScriptCore/runtime/NumericStrings.h b/JavaScriptCore/runtime/NumericStrings.h index 4cd92fc1..3bb5b91c 100644 --- a/JavaScriptCore/runtime/NumericStrings.h +++ b/JavaScriptCore/runtime/NumericStrings.h @@ -26,7 +26,7 @@ #ifndef NumericStrings_h #define NumericStrings_h -#include +#include #include #include @@ -87,10 +87,10 @@ namespace JSC { return smallIntCache[i]; } - FixedArray, cacheSize> doubleCache; - FixedArray, cacheSize> intCache; - FixedArray, cacheSize> unsignedCache; - FixedArray smallIntCache; + std::array, cacheSize> doubleCache; + std::array, cacheSize> intCache; + std::array, cacheSize> unsignedCache; + std::array smallIntCache; }; } // namespace JSC diff --git a/JavaScriptCore/runtime/Operations.cpp b/JavaScriptCore/runtime/Operations.cpp index d6cc0ff5..f0ffd566 100644 --- a/JavaScriptCore/runtime/Operations.cpp +++ b/JavaScriptCore/runtime/Operations.cpp @@ -25,8 +25,6 @@ #include "Error.h" #include "JSObject.h" #include "JSString.h" -#include -#include #include namespace JSC { diff --git a/JavaScriptCore/runtime/Operations.h b/JavaScriptCore/runtime/Operations.h index 1d5470b0..cbc7dd18 100644 --- a/JavaScriptCore/runtime/Operations.h +++ b/JavaScriptCore/runtime/Operations.h @@ -217,8 +217,9 @@ inline size_t normalizePrototypeChainForChainAccess(CallFrame* callFrame, JSValu while (!slotBase || slotBase != cell) { if (cell->isProxy()) return InvalidPrototypeChain; - - if (cell->structure()->typeInfo().hasImpureGetOwnPropertySlot()) + + const TypeInfo& typeInfo = cell->structure()->typeInfo(); + if (typeInfo.hasImpureGetOwnPropertySlot() && !typeInfo.newImpurePropertyFiresWatchpoints()) return InvalidPrototypeChain; JSValue v = cell->structure()->prototypeForLookup(callFrame); diff --git a/JavaScriptCore/runtime/Options.cpp b/JavaScriptCore/runtime/Options.cpp index 83887649..aa8ccc75 100644 --- a/JavaScriptCore/runtime/Options.cpp +++ b/JavaScriptCore/runtime/Options.cpp @@ -29,7 +29,6 @@ #include "HeapStatistics.h" #include #include -#include #include #include #include @@ -212,7 +211,7 @@ void Options::initialize() #if !ENABLE(YARR_JIT) useRegExpJIT() = false; #endif - + // Do range checks where needed and make corrections to the options: ASSERT(thresholdForOptimizeAfterLongWarmUp() >= thresholdForOptimizeAfterWarmUp()); ASSERT(thresholdForOptimizeAfterWarmUp() >= thresholdForOptimizeSoon()); diff --git a/JavaScriptCore/runtime/Options.h b/JavaScriptCore/runtime/Options.h index e800af4a..c88b3ac6 100644 --- a/JavaScriptCore/runtime/Options.h +++ b/JavaScriptCore/runtime/Options.h @@ -99,6 +99,8 @@ typedef OptionRange optionRange; v(bool, forceDFGCodeBlockLiveness, false) \ \ v(bool, dumpGeneratedBytecodes, false) \ + v(bool, dumpBytecodeLivenessResults, false) \ + v(bool, validateBytecode, false) \ \ /* showDisassembly implies showDFGDisassembly. */ \ v(bool, showDisassembly, false) \ @@ -124,13 +126,11 @@ typedef OptionRange optionRange; v(bool, useFTLTBAA, true) \ v(bool, enableLLVMFastISel, false) \ v(bool, useLLVMSmallCodeModel, false) \ - v(bool, ftlTrapsOnOSRExit, false) \ - v(bool, ftlOSRExitOmitsMarshalling, false) \ - v(bool, ftlUsesStackmaps, false) \ - v(bool, useLLVMOSRExitIntrinsic, false) \ v(bool, dumpLLVMIR, false) \ + v(bool, validateFTLOSRExitLiveness, false) \ v(bool, llvmAlwaysFailsBeforeCompile, false) \ v(bool, llvmAlwaysFailsBeforeLink, false) \ + v(bool, llvmSimpleOpt, true) \ v(unsigned, llvmBackendOptimizationLevel, 2) \ v(unsigned, llvmOptimizationLevel, 2) \ v(unsigned, llvmSizeLevel, 0) \ @@ -144,6 +144,8 @@ typedef OptionRange optionRange; v(bool, forceUDis86Disassembler, false) \ v(bool, forceLLVMDisassembler, false) \ \ + v(bool, enableArchitectureSpecificOptimizations, true) \ + \ v(unsigned, maximumOptimizationCandidateInstructionCount, 10000) \ \ v(unsigned, maximumFunctionForCallInlineCandidateInstructionCount, 180) \ diff --git a/JavaScriptCore/runtime/PropertySlot.h b/JavaScriptCore/runtime/PropertySlot.h index 714577e2..ae93455a 100644 --- a/JavaScriptCore/runtime/PropertySlot.h +++ b/JavaScriptCore/runtime/PropertySlot.h @@ -60,8 +60,8 @@ class PropertySlot { { } - typedef JSValue (*GetValueFunc)(ExecState*, JSValue slotBase, PropertyName); - typedef JSValue (*GetIndexValueFunc)(ExecState*, JSValue slotBase, unsigned); + typedef EncodedJSValue (*GetValueFunc)(ExecState*, EncodedJSValue slotBase, EncodedJSValue thisValue, PropertyName); + typedef EncodedJSValue (*GetIndexValueFunc)(ExecState*, EncodedJSValue slotBase, EncodedJSValue thisValue, unsigned); JSValue getValue(ExecState*, PropertyName) const; JSValue getValue(ExecState*, unsigned propertyName) const; @@ -226,7 +226,7 @@ class PropertySlot { PropertyType m_propertyType; PropertyOffset m_offset; - JSValue m_thisValue; + const JSValue m_thisValue; JSObject* m_slotBase; }; diff --git a/JavaScriptCore/runtime/PutPropertySlot.h b/JavaScriptCore/runtime/PutPropertySlot.h index 421a9ce0..f2403ca0 100644 --- a/JavaScriptCore/runtime/PutPropertySlot.h +++ b/JavaScriptCore/runtime/PutPropertySlot.h @@ -27,6 +27,8 @@ #ifndef PutPropertySlot_h #define PutPropertySlot_h +#include "JSCJSValue.h" + #include namespace JSC { @@ -36,14 +38,17 @@ namespace JSC { class PutPropertySlot { public: - enum Type { Uncachable, ExistingProperty, NewProperty }; + enum Type { Uncachable, ExistingProperty, NewProperty, CustomProperty }; enum Context { UnknownContext, PutById, PutByIdEval }; + typedef void (*PutValueFunc)(ExecState*, EncodedJSValue base, EncodedJSValue value); - PutPropertySlot(bool isStrictMode = false, Context context = UnknownContext) + PutPropertySlot(JSValue thisValue, bool isStrictMode = false, Context context = UnknownContext) : m_type(Uncachable) , m_base(0) + , m_thisValue(thisValue) , m_isStrictMode(isStrictMode) , m_context(context) + , m_putFunction(nullptr) { } @@ -60,14 +65,22 @@ namespace JSC { m_base = base; m_offset = offset; } + + void setCustomProperty(JSObject* base, PutValueFunc function) + { + m_type = CustomProperty; + m_base = base; + m_putFunction = function; + } Context context() const { return static_cast(m_context); } Type type() const { return m_type; } JSObject* base() const { return m_base; } + JSValue thisValue() const { return m_thisValue; } bool isStrictMode() const { return m_isStrictMode; } - bool isCacheable() const { return m_type != Uncachable; } + bool isCacheable() const { return m_type != Uncachable && m_type != CustomProperty; } PropertyOffset cachedOffset() const { ASSERT(isCacheable()); @@ -77,9 +90,12 @@ namespace JSC { private: Type m_type; JSObject* m_base; + JSValue m_thisValue; PropertyOffset m_offset; bool m_isStrictMode; uint8_t m_context; + PutValueFunc m_putFunction; + }; } // namespace JSC diff --git a/JavaScriptCore/runtime/RegExp.cpp b/JavaScriptCore/runtime/RegExp.cpp index e02a66e5..6c00409f 100644 --- a/JavaScriptCore/runtime/RegExp.cpp +++ b/JavaScriptCore/runtime/RegExp.cpp @@ -28,13 +28,16 @@ #include "RegExpCache.h" #include "Yarr.h" #include "YarrJIT.h" -#include -#include -#include #include #define REGEXP_FUNC_TEST_DATA_GEN 0 +#if REGEXP_FUNC_TEST_DATA_GEN +#include +#include +#include +#endif + namespace JSC { const ClassInfo RegExp::s_info = { "RegExp", 0, 0, 0, CREATE_METHOD_TABLE(RegExp) }; diff --git a/JavaScriptCore/runtime/RegExpCache.h b/JavaScriptCore/runtime/RegExpCache.h index 5193ac62..267eb356 100644 --- a/JavaScriptCore/runtime/RegExpCache.h +++ b/JavaScriptCore/runtime/RegExpCache.h @@ -30,7 +30,7 @@ #include "Strong.h" #include "Weak.h" #include "WeakInlines.h" -#include +#include #include #ifndef RegExpCache_h @@ -58,7 +58,7 @@ typedef HashMap> RegExpCacheMap; void addToStrongCache(RegExp*); RegExpCacheMap m_weakCache; // Holds all regular expressions currently live. int m_nextEntryInStrongCache; - WTF::FixedArray, maxStrongCacheableEntries> m_strongCache; // Holds a select few regular expressions that have compiled and executed + std::array, maxStrongCacheableEntries> m_strongCache; // Holds a select few regular expressions that have compiled and executed VM* m_vm; }; diff --git a/JavaScriptCore/runtime/RegExpConstructor.cpp b/JavaScriptCore/runtime/RegExpConstructor.cpp index 67560118..189b1751 100644 --- a/JavaScriptCore/runtime/RegExpConstructor.cpp +++ b/JavaScriptCore/runtime/RegExpConstructor.cpp @@ -29,24 +29,24 @@ namespace JSC { -static JSValue regExpConstructorInput(ExecState*, JSValue, PropertyName); -static JSValue regExpConstructorMultiline(ExecState*, JSValue, PropertyName); -static JSValue regExpConstructorLastMatch(ExecState*, JSValue, PropertyName); -static JSValue regExpConstructorLastParen(ExecState*, JSValue, PropertyName); -static JSValue regExpConstructorLeftContext(ExecState*, JSValue, PropertyName); -static JSValue regExpConstructorRightContext(ExecState*, JSValue, PropertyName); -static JSValue regExpConstructorDollar1(ExecState*, JSValue, PropertyName); -static JSValue regExpConstructorDollar2(ExecState*, JSValue, PropertyName); -static JSValue regExpConstructorDollar3(ExecState*, JSValue, PropertyName); -static JSValue regExpConstructorDollar4(ExecState*, JSValue, PropertyName); -static JSValue regExpConstructorDollar5(ExecState*, JSValue, PropertyName); -static JSValue regExpConstructorDollar6(ExecState*, JSValue, PropertyName); -static JSValue regExpConstructorDollar7(ExecState*, JSValue, PropertyName); -static JSValue regExpConstructorDollar8(ExecState*, JSValue, PropertyName); -static JSValue regExpConstructorDollar9(ExecState*, JSValue, PropertyName); - -static void setRegExpConstructorInput(ExecState*, JSObject*, JSValue); -static void setRegExpConstructorMultiline(ExecState*, JSObject*, JSValue); +static EncodedJSValue regExpConstructorInput(ExecState*, EncodedJSValue, EncodedJSValue, PropertyName); +static EncodedJSValue regExpConstructorMultiline(ExecState*, EncodedJSValue, EncodedJSValue, PropertyName); +static EncodedJSValue regExpConstructorLastMatch(ExecState*, EncodedJSValue, EncodedJSValue, PropertyName); +static EncodedJSValue regExpConstructorLastParen(ExecState*, EncodedJSValue, EncodedJSValue, PropertyName); +static EncodedJSValue regExpConstructorLeftContext(ExecState*, EncodedJSValue, EncodedJSValue, PropertyName); +static EncodedJSValue regExpConstructorRightContext(ExecState*, EncodedJSValue, EncodedJSValue, PropertyName); +static EncodedJSValue regExpConstructorDollar1(ExecState*, EncodedJSValue, EncodedJSValue, PropertyName); +static EncodedJSValue regExpConstructorDollar2(ExecState*, EncodedJSValue, EncodedJSValue, PropertyName); +static EncodedJSValue regExpConstructorDollar3(ExecState*, EncodedJSValue, EncodedJSValue, PropertyName); +static EncodedJSValue regExpConstructorDollar4(ExecState*, EncodedJSValue, EncodedJSValue, PropertyName); +static EncodedJSValue regExpConstructorDollar5(ExecState*, EncodedJSValue, EncodedJSValue, PropertyName); +static EncodedJSValue regExpConstructorDollar6(ExecState*, EncodedJSValue, EncodedJSValue, PropertyName); +static EncodedJSValue regExpConstructorDollar7(ExecState*, EncodedJSValue, EncodedJSValue, PropertyName); +static EncodedJSValue regExpConstructorDollar8(ExecState*, EncodedJSValue, EncodedJSValue, PropertyName); +static EncodedJSValue regExpConstructorDollar9(ExecState*, EncodedJSValue, EncodedJSValue, PropertyName); + +static void setRegExpConstructorInput(ExecState*, EncodedJSValue, EncodedJSValue); +static void setRegExpConstructorMultiline(ExecState*, EncodedJSValue, EncodedJSValue); } // namespace JSC @@ -158,79 +158,84 @@ bool RegExpConstructor::getOwnPropertySlot(JSObject* object, ExecState* exec, Pr return getStaticValueSlot(exec, ExecState::regExpConstructorTable(exec), jsCast(object), propertyName, slot); } -JSValue regExpConstructorDollar1(ExecState* exec, JSValue slotBase, PropertyName) +static inline RegExpConstructor* asRegExpConstructor(EncodedJSValue value) { - return asRegExpConstructor(slotBase)->getBackref(exec, 1); + return jsCast(JSValue::decode(value)); +} + +EncodedJSValue regExpConstructorDollar1(ExecState* exec, EncodedJSValue slotBase, EncodedJSValue, PropertyName) +{ + return JSValue::encode(asRegExpConstructor(slotBase)->getBackref(exec, 1)); } -JSValue regExpConstructorDollar2(ExecState* exec, JSValue slotBase, PropertyName) +EncodedJSValue regExpConstructorDollar2(ExecState* exec, EncodedJSValue slotBase, EncodedJSValue, PropertyName) { - return asRegExpConstructor(slotBase)->getBackref(exec, 2); + return JSValue::encode(asRegExpConstructor(slotBase)->getBackref(exec, 2)); } -JSValue regExpConstructorDollar3(ExecState* exec, JSValue slotBase, PropertyName) +EncodedJSValue regExpConstructorDollar3(ExecState* exec, EncodedJSValue slotBase, EncodedJSValue, PropertyName) { - return asRegExpConstructor(slotBase)->getBackref(exec, 3); + return JSValue::encode(asRegExpConstructor(slotBase)->getBackref(exec, 3)); } -JSValue regExpConstructorDollar4(ExecState* exec, JSValue slotBase, PropertyName) +EncodedJSValue regExpConstructorDollar4(ExecState* exec, EncodedJSValue slotBase, EncodedJSValue, PropertyName) { - return asRegExpConstructor(slotBase)->getBackref(exec, 4); + return JSValue::encode(asRegExpConstructor(slotBase)->getBackref(exec, 4)); } -JSValue regExpConstructorDollar5(ExecState* exec, JSValue slotBase, PropertyName) +EncodedJSValue regExpConstructorDollar5(ExecState* exec, EncodedJSValue slotBase, EncodedJSValue, PropertyName) { - return asRegExpConstructor(slotBase)->getBackref(exec, 5); + return JSValue::encode(asRegExpConstructor(slotBase)->getBackref(exec, 5)); } -JSValue regExpConstructorDollar6(ExecState* exec, JSValue slotBase, PropertyName) +EncodedJSValue regExpConstructorDollar6(ExecState* exec, EncodedJSValue slotBase, EncodedJSValue, PropertyName) { - return asRegExpConstructor(slotBase)->getBackref(exec, 6); + return JSValue::encode(asRegExpConstructor(slotBase)->getBackref(exec, 6)); } -JSValue regExpConstructorDollar7(ExecState* exec, JSValue slotBase, PropertyName) +EncodedJSValue regExpConstructorDollar7(ExecState* exec, EncodedJSValue slotBase, EncodedJSValue, PropertyName) { - return asRegExpConstructor(slotBase)->getBackref(exec, 7); + return JSValue::encode(asRegExpConstructor(slotBase)->getBackref(exec, 7)); } -JSValue regExpConstructorDollar8(ExecState* exec, JSValue slotBase, PropertyName) +EncodedJSValue regExpConstructorDollar8(ExecState* exec, EncodedJSValue slotBase, EncodedJSValue, PropertyName) { - return asRegExpConstructor(slotBase)->getBackref(exec, 8); + return JSValue::encode(asRegExpConstructor(slotBase)->getBackref(exec, 8)); } -JSValue regExpConstructorDollar9(ExecState* exec, JSValue slotBase, PropertyName) +EncodedJSValue regExpConstructorDollar9(ExecState* exec, EncodedJSValue slotBase, EncodedJSValue, PropertyName) { - return asRegExpConstructor(slotBase)->getBackref(exec, 9); + return JSValue::encode(asRegExpConstructor(slotBase)->getBackref(exec, 9)); } -JSValue regExpConstructorInput(ExecState*, JSValue slotBase, PropertyName) +EncodedJSValue regExpConstructorInput(ExecState*, EncodedJSValue slotBase, EncodedJSValue, PropertyName) { - return asRegExpConstructor(slotBase)->input(); + return JSValue::encode(asRegExpConstructor(slotBase)->input()); } -JSValue regExpConstructorMultiline(ExecState*, JSValue slotBase, PropertyName) +EncodedJSValue regExpConstructorMultiline(ExecState*, EncodedJSValue slotBase, EncodedJSValue, PropertyName) { - return jsBoolean(asRegExpConstructor(slotBase)->multiline()); + return JSValue::encode(jsBoolean(asRegExpConstructor(slotBase)->multiline())); } -JSValue regExpConstructorLastMatch(ExecState* exec, JSValue slotBase, PropertyName) +EncodedJSValue regExpConstructorLastMatch(ExecState* exec, EncodedJSValue slotBase, EncodedJSValue, PropertyName) { - return asRegExpConstructor(slotBase)->getBackref(exec, 0); + return JSValue::encode(asRegExpConstructor(slotBase)->getBackref(exec, 0)); } -JSValue regExpConstructorLastParen(ExecState* exec, JSValue slotBase, PropertyName) +EncodedJSValue regExpConstructorLastParen(ExecState* exec, EncodedJSValue slotBase, EncodedJSValue, PropertyName) { - return asRegExpConstructor(slotBase)->getLastParen(exec); + return JSValue::encode(asRegExpConstructor(slotBase)->getLastParen(exec)); } -JSValue regExpConstructorLeftContext(ExecState* exec, JSValue slotBase, PropertyName) +EncodedJSValue regExpConstructorLeftContext(ExecState* exec, EncodedJSValue slotBase, EncodedJSValue, PropertyName) { - return asRegExpConstructor(slotBase)->getLeftContext(exec); + return JSValue::encode(asRegExpConstructor(slotBase)->getLeftContext(exec)); } -JSValue regExpConstructorRightContext(ExecState* exec, JSValue slotBase, PropertyName) +EncodedJSValue regExpConstructorRightContext(ExecState* exec, EncodedJSValue slotBase, EncodedJSValue, PropertyName) { - return asRegExpConstructor(slotBase)->getRightContext(exec); + return JSValue::encode(asRegExpConstructor(slotBase)->getRightContext(exec)); } void RegExpConstructor::put(JSCell* cell, ExecState* exec, PropertyName propertyName, JSValue value, PutPropertySlot& slot) @@ -238,14 +243,14 @@ void RegExpConstructor::put(JSCell* cell, ExecState* exec, PropertyName property lookupPut(exec, propertyName, value, ExecState::regExpConstructorTable(exec), jsCast(cell), slot); } -void setRegExpConstructorInput(ExecState* exec, JSObject* baseObject, JSValue value) +void setRegExpConstructorInput(ExecState* exec, EncodedJSValue baseObject, EncodedJSValue value) { - asRegExpConstructor(baseObject)->setInput(exec, value.toString(exec)); + asRegExpConstructor(asObject(JSValue::decode(baseObject)))->setInput(exec, JSValue::decode(value).toString(exec)); } -void setRegExpConstructorMultiline(ExecState* exec, JSObject* baseObject, JSValue value) +void setRegExpConstructorMultiline(ExecState* exec, EncodedJSValue baseObject, EncodedJSValue value) { - asRegExpConstructor(baseObject)->setMultiline(value.toBoolean(exec)); + asRegExpConstructor(asObject(JSValue::decode(baseObject)))->setMultiline(JSValue::decode(value).toBoolean(exec)); } // ECMA 15.10.4 diff --git a/JavaScriptCore/runtime/RegExpObject.cpp b/JavaScriptCore/runtime/RegExpObject.cpp index ccea7088..009cac12 100644 --- a/JavaScriptCore/runtime/RegExpObject.cpp +++ b/JavaScriptCore/runtime/RegExpObject.cpp @@ -39,10 +39,10 @@ namespace JSC { -static JSValue regExpObjectGlobal(ExecState*, JSValue, PropertyName); -static JSValue regExpObjectIgnoreCase(ExecState*, JSValue, PropertyName); -static JSValue regExpObjectMultiline(ExecState*, JSValue, PropertyName); -static JSValue regExpObjectSource(ExecState*, JSValue, PropertyName); +static EncodedJSValue regExpObjectGlobal(ExecState*, EncodedJSValue, EncodedJSValue, PropertyName); +static EncodedJSValue regExpObjectIgnoreCase(ExecState*, EncodedJSValue, EncodedJSValue, PropertyName); +static EncodedJSValue regExpObjectMultiline(ExecState*, EncodedJSValue, EncodedJSValue, PropertyName); +static EncodedJSValue regExpObjectSource(ExecState*, EncodedJSValue, EncodedJSValue, PropertyName); } // namespace JSC @@ -155,19 +155,24 @@ bool RegExpObject::defineOwnProperty(JSObject* object, ExecState* exec, Property return Base::defineOwnProperty(object, exec, propertyName, descriptor, shouldThrow); } -JSValue regExpObjectGlobal(ExecState*, JSValue slotBase, PropertyName) +static inline RegExpObject* asRegExpObject(EncodedJSValue value) { - return jsBoolean(asRegExpObject(slotBase)->regExp()->global()); + return jsCast(JSValue::decode(value)); } -JSValue regExpObjectIgnoreCase(ExecState*, JSValue slotBase, PropertyName) +EncodedJSValue regExpObjectGlobal(ExecState*, EncodedJSValue slotBase, EncodedJSValue, PropertyName) { - return jsBoolean(asRegExpObject(slotBase)->regExp()->ignoreCase()); + return JSValue::encode(jsBoolean(asRegExpObject(slotBase)->regExp()->global())); +} + +EncodedJSValue regExpObjectIgnoreCase(ExecState*, EncodedJSValue slotBase, EncodedJSValue, PropertyName) +{ + return JSValue::encode(jsBoolean(asRegExpObject(slotBase)->regExp()->ignoreCase())); } -JSValue regExpObjectMultiline(ExecState*, JSValue slotBase, PropertyName) +EncodedJSValue regExpObjectMultiline(ExecState*, EncodedJSValue slotBase, EncodedJSValue, PropertyName) { - return jsBoolean(asRegExpObject(slotBase)->regExp()->multiline()); + return JSValue::encode(jsBoolean(asRegExpObject(slotBase)->regExp()->multiline())); } template @@ -276,12 +281,14 @@ static inline JSValue regExpObjectSourceInternal(ExecState* exec, String pattern return jsString(exec, result.toString()); } -JSValue regExpObjectSource(ExecState* exec, JSValue slotBase, PropertyName) + + +EncodedJSValue regExpObjectSource(ExecState* exec, EncodedJSValue slotBase, EncodedJSValue, PropertyName) { String pattern = asRegExpObject(slotBase)->regExp()->pattern(); if (pattern.is8Bit()) - return regExpObjectSourceInternal(exec, pattern, pattern.characters8(), pattern.length()); - return regExpObjectSourceInternal(exec, pattern, pattern.characters16(), pattern.length()); + return JSValue::encode(regExpObjectSourceInternal(exec, pattern, pattern.characters8(), pattern.length())); + return JSValue::encode(regExpObjectSourceInternal(exec, pattern, pattern.characters16(), pattern.length())); } void RegExpObject::put(JSCell* cell, ExecState* exec, PropertyName propertyName, JSValue value, PutPropertySlot& slot) diff --git a/JavaScriptCore/runtime/SetIteratorConstructor.cpp b/JavaScriptCore/runtime/SetIteratorConstructor.cpp new file mode 100644 index 00000000..c16ff9be --- /dev/null +++ b/JavaScriptCore/runtime/SetIteratorConstructor.cpp @@ -0,0 +1,45 @@ +/* + * Copyright (C) 2013 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 "SetIteratorConstructor.h" + +#include "JSCJSValueInlines.h" +#include "JSCellInlines.h" +#include "JSGlobalObject.h" +#include "JSSetIterator.h" +#include "SetIteratorPrototype.h" + +namespace JSC { + +const ClassInfo SetIteratorConstructor::s_info = { "Set Iterator", &Base::s_info, 0, 0, CREATE_METHOD_TABLE(SetIteratorConstructor) }; + +void SetIteratorConstructor::finishCreation(VM& vm, SetIteratorPrototype* prototype) +{ + Base::finishCreation(vm); + putDirectWithoutTransition(vm, vm.propertyNames->prototype, prototype, DontEnum | DontDelete | ReadOnly); +} + +} diff --git a/JavaScriptCore/runtime/SetIteratorConstructor.h b/JavaScriptCore/runtime/SetIteratorConstructor.h new file mode 100644 index 00000000..cfd954ee --- /dev/null +++ b/JavaScriptCore/runtime/SetIteratorConstructor.h @@ -0,0 +1,63 @@ +/* + * Copyright (C) 2013 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. + */ + +#ifndef SetIteratorConstructor_h +#define SetIteratorConstructor_h + +#include "JSObject.h" + +namespace JSC { + +class SetIteratorPrototype; + +class SetIteratorConstructor : public JSNonFinalObject { +public: + typedef JSNonFinalObject Base; + + static SetIteratorConstructor* create(VM& vm, Structure* structure, SetIteratorPrototype* prototype) + { + SetIteratorConstructor* constructor = new (NotNull, allocateCell(vm.heap)) SetIteratorConstructor(vm, structure); + constructor->finishCreation(vm, prototype); + return constructor; + } + + DECLARE_INFO; + + static Structure* createStructure(VM& vm, JSGlobalObject* globalObject, JSValue prototype) + { + return Structure::create(vm, globalObject, prototype, TypeInfo(ObjectType, StructureFlags), info()); + } + +private: + SetIteratorConstructor(VM& vm, Structure* structure) + : Base(vm, structure) + { + } + void finishCreation(VM&, SetIteratorPrototype*); +}; + +} + +#endif // !defined(SetConstructor_h) diff --git a/JavaScriptCore/runtime/SetIteratorPrototype.cpp b/JavaScriptCore/runtime/SetIteratorPrototype.cpp new file mode 100644 index 00000000..6fe508a0 --- /dev/null +++ b/JavaScriptCore/runtime/SetIteratorPrototype.cpp @@ -0,0 +1,70 @@ +/* + * Copyright (C) 2013 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 "SetIteratorPrototype.h" + +#include "JSCJSValueInlines.h" +#include "JSCellInlines.h" +#include "JSSetIterator.h" + +namespace JSC { + +const ClassInfo SetIteratorPrototype::s_info = { "Set Iterator", &Base::s_info, 0, 0, CREATE_METHOD_TABLE(SetIteratorPrototype) }; + +static EncodedJSValue JSC_HOST_CALL SetIteratorPrototypeFuncIterator(ExecState*); +static EncodedJSValue JSC_HOST_CALL SetIteratorPrototypeFuncNext(ExecState*); + + +void SetIteratorPrototype::finishCreation(VM& vm, JSGlobalObject* globalObject) +{ + Base::finishCreation(vm); + ASSERT(inherits(info())); + vm.prototypeMap.addPrototype(this); + + JSC_NATIVE_FUNCTION(vm.propertyNames->iteratorPrivateName, SetIteratorPrototypeFuncIterator, DontEnum, 0); + JSC_NATIVE_FUNCTION(vm.propertyNames->iteratorNextPrivateName, SetIteratorPrototypeFuncNext, DontEnum, 0); +} + +EncodedJSValue JSC_HOST_CALL SetIteratorPrototypeFuncIterator(CallFrame* callFrame) +{ + return JSValue::encode(callFrame->thisValue()); +} + +EncodedJSValue JSC_HOST_CALL SetIteratorPrototypeFuncNext(CallFrame* callFrame) +{ + JSValue result; + JSSetIterator* iterator = jsDynamicCast(callFrame->thisValue()); + if (!iterator) + return JSValue::encode(throwTypeError(callFrame, ASCIILiteral("Cannot call SetIterator.next() on a non-SetIterator object"))); + + if (iterator->next(callFrame, result)) + return JSValue::encode(result); + + return JSValue::encode(callFrame->vm().iterationTerminator.get()); +} + + +} diff --git a/JavaScriptCore/runtime/SetIteratorPrototype.h b/JavaScriptCore/runtime/SetIteratorPrototype.h new file mode 100644 index 00000000..72b3330b --- /dev/null +++ b/JavaScriptCore/runtime/SetIteratorPrototype.h @@ -0,0 +1,61 @@ +/* + * Copyright (C) 2013 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. + */ + +#ifndef SetIteratorPrototype_h +#define SetIteratorPrototype_h + +#include "JSObject.h" + +namespace JSC { + +class SetIteratorPrototype : public JSNonFinalObject { +public: + typedef JSNonFinalObject Base; + + static SetIteratorPrototype* create(VM& vm, JSGlobalObject* globalObject, Structure* structure) + { + SetIteratorPrototype* prototype = new (NotNull, allocateCell(vm.heap)) SetIteratorPrototype(vm, structure); + prototype->finishCreation(vm, globalObject); + return prototype; + } + + DECLARE_INFO; + + static Structure* createStructure(VM& vm, JSGlobalObject* globalObject, JSValue prototype) + { + return Structure::create(vm, globalObject, prototype, TypeInfo(ObjectType, StructureFlags), info()); + } + +private: + SetIteratorPrototype(VM& vm, Structure* structure) + : Base(vm, structure) + { + } + void finishCreation(VM&, JSGlobalObject*); +}; + +} + +#endif // !defined(SetIteratorPrototype_h) diff --git a/JavaScriptCore/runtime/SetPrototype.cpp b/JavaScriptCore/runtime/SetPrototype.cpp index 280523cf..5eac51ee 100644 --- a/JavaScriptCore/runtime/SetPrototype.cpp +++ b/JavaScriptCore/runtime/SetPrototype.cpp @@ -33,6 +33,7 @@ #include "JSCJSValueInlines.h" #include "JSFunctionInlines.h" #include "JSSet.h" +#include "JSSetIterator.h" #include "MapData.h" namespace JSC { @@ -44,6 +45,10 @@ static EncodedJSValue JSC_HOST_CALL setProtoFuncClear(ExecState*); static EncodedJSValue JSC_HOST_CALL setProtoFuncDelete(ExecState*); static EncodedJSValue JSC_HOST_CALL setProtoFuncForEach(ExecState*); static EncodedJSValue JSC_HOST_CALL setProtoFuncHas(ExecState*); +static EncodedJSValue JSC_HOST_CALL setProtoFuncKeys(ExecState*); +static EncodedJSValue JSC_HOST_CALL setProtoFuncValues(ExecState*); +static EncodedJSValue JSC_HOST_CALL setProtoFuncEntries(ExecState*); + static EncodedJSValue JSC_HOST_CALL setProtoFuncSize(ExecState*); @@ -53,11 +58,15 @@ void SetPrototype::finishCreation(VM& vm, JSGlobalObject* globalObject) ASSERT(inherits(info())); vm.prototypeMap.addPrototype(this); - JSC_NATIVE_FUNCTION(vm.propertyNames->add, setProtoFuncAdd, DontEnum, 0); - JSC_NATIVE_FUNCTION(vm.propertyNames->clear, setProtoFuncClear, DontEnum, 1); + JSC_NATIVE_FUNCTION(vm.propertyNames->add, setProtoFuncAdd, DontEnum, 1); + JSC_NATIVE_FUNCTION(vm.propertyNames->clear, setProtoFuncClear, DontEnum, 0); JSC_NATIVE_FUNCTION(vm.propertyNames->deleteKeyword, setProtoFuncDelete, DontEnum, 1); JSC_NATIVE_FUNCTION(vm.propertyNames->forEach, setProtoFuncForEach, DontEnum, 1); JSC_NATIVE_FUNCTION(vm.propertyNames->has, setProtoFuncHas, DontEnum, 1); + JSC_NATIVE_FUNCTION(vm.propertyNames->keys, setProtoFuncKeys, DontEnum, 0); + JSC_NATIVE_FUNCTION(vm.propertyNames->values, setProtoFuncValues, DontEnum, 0); + JSC_NATIVE_FUNCTION(vm.propertyNames->entries, setProtoFuncEntries, DontEnum, 0); + JSC_NATIVE_FUNCTION(vm.propertyNames->iteratorPrivateName, setProtoFuncKeys, DontEnum, 0); GetterSetter* accessor = GetterSetter::create(vm); JSFunction* function = JSFunction::create(vm, globalObject, 0, vm.propertyNames->size.string(), setProtoFuncSize); @@ -150,5 +159,29 @@ EncodedJSValue JSC_HOST_CALL setProtoFuncSize(CallFrame* callFrame) return JSValue::encode(jsUndefined()); return JSValue::encode(jsNumber(data->size(callFrame))); } + +EncodedJSValue JSC_HOST_CALL setProtoFuncValues(CallFrame* callFrame) +{ + JSSet* thisObj = jsDynamicCast(callFrame->thisValue()); + if (!thisObj) + return JSValue::encode(throwTypeError(callFrame, ASCIILiteral("Cannot create a Map value iterator for a non-Map object."))); + return JSValue::encode(JSSetIterator::create(callFrame->vm(), callFrame->callee()->globalObject()->setIteratorStructure(), thisObj, SetIterateValue)); +} + +EncodedJSValue JSC_HOST_CALL setProtoFuncEntries(CallFrame* callFrame) +{ + JSSet* thisObj = jsDynamicCast(callFrame->thisValue()); + if (!thisObj) + return JSValue::encode(throwTypeError(callFrame, ASCIILiteral("Cannot create a Map key iterator for a non-Map object."))); + return JSValue::encode(JSSetIterator::create(callFrame->vm(), callFrame->callee()->globalObject()->setIteratorStructure(), thisObj, SetIterateKeyValue)); +} + +EncodedJSValue JSC_HOST_CALL setProtoFuncKeys(CallFrame* callFrame) +{ + JSSet* thisObj = jsDynamicCast(callFrame->thisValue()); + if (!thisObj) + return JSValue::encode(throwTypeError(callFrame, ASCIILiteral("Cannot create a Map entry iterator for a non-Map object."))); + return JSValue::encode(JSSetIterator::create(callFrame->vm(), callFrame->callee()->globalObject()->setIteratorStructure(), thisObj, SetIterateKey)); +} } diff --git a/JavaScriptCore/runtime/SmallStrings.h b/JavaScriptCore/runtime/SmallStrings.h index aeb7bcc8..0e8646a7 100644 --- a/JavaScriptCore/runtime/SmallStrings.h +++ b/JavaScriptCore/runtime/SmallStrings.h @@ -27,8 +27,6 @@ #define SmallStrings_h #include "WriteBarrier.h" - -#include #include #include diff --git a/JavaScriptCore/heap/VTableSpectrum.h b/JavaScriptCore/runtime/StackAlignment.h similarity index 75% rename from JavaScriptCore/heap/VTableSpectrum.h rename to JavaScriptCore/runtime/StackAlignment.h index a50a04f4..b803e4de 100644 --- a/JavaScriptCore/heap/VTableSpectrum.h +++ b/JavaScriptCore/runtime/StackAlignment.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2011 Apple Inc. All rights reserved. + * Copyright (C) 2013 Apple Inc. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -23,27 +23,22 @@ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -#ifndef VTableSpectrum_h -#define VTableSpectrum_h +#ifndef StackAlignment_h +#define StackAlignment_h -#include -#include +#include "JSCJSValue.h" namespace JSC { -class JSCell; +// NB. Different platforms may have different requirements here. But 16 bytes is very common. +inline unsigned stackAlignmentBytes() { return 16; } -class VTableSpectrum : Spectrum { -public: - VTableSpectrum(); - ~VTableSpectrum(); - - void countVPtr(void*); - JS_EXPORT_PRIVATE void count(JSCell*); - - void dump(FILE* output, const char* comment); -}; +inline unsigned stackAlignmentRegisters() +{ + return stackAlignmentBytes() / sizeof(EncodedJSValue); +} } // namespace JSC -#endif // VTableSpectrum_h +#endif // StackAlignment_h + diff --git a/JavaScriptCore/runtime/StringPrototype.cpp b/JavaScriptCore/runtime/StringPrototype.cpp index 63b2afa4..d6a78bcd 100644 --- a/JavaScriptCore/runtime/StringPrototype.cpp +++ b/JavaScriptCore/runtime/StringPrototype.cpp @@ -237,7 +237,7 @@ static inline String substituteBackreferences(const String& replacement, const S static inline int localeCompare(const String& a, const String& b) { - return Collator::userDefault()->collate(reinterpret_cast(a.characters()), a.length(), reinterpret_cast(b.characters()), b.length()); + return Collator::userDefault()->collate(reinterpret_cast(a.deprecatedCharacters()), a.length(), reinterpret_cast(b.deprecatedCharacters()), b.length()); } struct StringRange { @@ -504,7 +504,7 @@ static NEVER_INLINE EncodedJSValue replaceUsingRegExpSearch(ExecState* exec, JSS cachedCall.setThis(jsUndefined()); JSValue jsResult = cachedCall.call(); - replacements.append(jsResult.toString(cachedCall.newCallFrame(exec))->value(exec)); + replacements.append(jsResult.toString(exec)->value(exec)); if (exec->hadException()) break; @@ -543,7 +543,7 @@ static NEVER_INLINE EncodedJSValue replaceUsingRegExpSearch(ExecState* exec, JSS cachedCall.setThis(jsUndefined()); JSValue jsResult = cachedCall.call(); - replacements.append(jsResult.toString(cachedCall.newCallFrame(exec))->value(exec)); + replacements.append(jsResult.toString(exec)->value(exec)); if (exec->hadException()) break; @@ -1427,7 +1427,7 @@ EncodedJSValue JSC_HOST_CALL stringProtoFuncFontsize(ExecState* exec) buffer[12] = '0' + smallInteger; buffer[13] = '"'; buffer[14] = '>'; - memcpy(&buffer[15], s.characters(), stringSize * sizeof(UChar)); + memcpy(&buffer[15], s.deprecatedCharacters(), stringSize * sizeof(UChar)); buffer[15 + stringSize] = '<'; buffer[16 + stringSize] = '/'; buffer[17 + stringSize] = 'f'; @@ -1483,10 +1483,10 @@ EncodedJSValue JSC_HOST_CALL stringProtoFuncLink(ExecState* exec) buffer[6] = 'f'; buffer[7] = '='; buffer[8] = '"'; - memcpy(&buffer[9], linkText.characters(), linkTextSize * sizeof(UChar)); + memcpy(&buffer[9], linkText.deprecatedCharacters(), linkTextSize * sizeof(UChar)); buffer[9 + linkTextSize] = '"'; buffer[10 + linkTextSize] = '>'; - memcpy(&buffer[11 + linkTextSize], s.characters(), stringSize * sizeof(UChar)); + memcpy(&buffer[11 + linkTextSize], s.deprecatedCharacters(), stringSize * sizeof(UChar)); buffer[11 + linkTextSize + stringSize] = '<'; buffer[12 + linkTextSize + stringSize] = '/'; buffer[13 + linkTextSize + stringSize] = 'a'; diff --git a/JavaScriptCore/runtime/StringRecursionChecker.h b/JavaScriptCore/runtime/StringRecursionChecker.h index 6f236f1f..c99dd4ff 100644 --- a/JavaScriptCore/runtime/StringRecursionChecker.h +++ b/JavaScriptCore/runtime/StringRecursionChecker.h @@ -21,7 +21,6 @@ #define StringRecursionChecker_h #include "Interpreter.h" -#include "VMStackBounds.h" #include #include @@ -51,8 +50,7 @@ class StringRecursionChecker { inline JSValue StringRecursionChecker::performCheck() { VM& vm = m_exec->vm(); - const VMStackBounds nativeStack(vm, wtfThreadData().stack()); - if (!nativeStack.isSafeToRecurse()) + if (!vm.isSafeToRecurse()) return throwStackOverflowError(); bool alreadyVisited = !vm.stringRecursionCheckVisitedObjects.add(m_thisObject).isNewEntry; if (alreadyVisited) diff --git a/JavaScriptCore/runtime/Structure.cpp b/JavaScriptCore/runtime/Structure.cpp index ba403129..2191b2ee 100644 --- a/JavaScriptCore/runtime/Structure.cpp +++ b/JavaScriptCore/runtime/Structure.cpp @@ -71,7 +71,7 @@ bool StructureTransitionTable::contains(StringImpl* rep, unsigned attributes) co Structure* transition = singleTransition(); return transition && transition->m_nameInPrevious == rep && transition->m_attributesInPrevious == attributes; } - return map()->get(make_pair(rep, attributes)); + return map()->get(std::make_pair(rep, attributes)); } inline Structure* StructureTransitionTable::get(StringImpl* rep, unsigned attributes) const @@ -80,7 +80,7 @@ inline Structure* StructureTransitionTable::get(StringImpl* rep, unsigned attrib Structure* transition = singleTransition(); return (transition && transition->m_nameInPrevious == rep && transition->m_attributesInPrevious == attributes) ? transition : 0; } - return map()->get(make_pair(rep, attributes)); + return map()->get(std::make_pair(rep, attributes)); } inline void StructureTransitionTable::add(VM& vm, Structure* structure) @@ -105,7 +105,7 @@ inline void StructureTransitionTable::add(VM& vm, Structure* structure) // Newer versions of the STL have an std::make_pair function that takes rvalue references. // When either of the parameters are bitfields, the C++ compiler will try to bind them as lvalues, which is invalid. To work around this, use unary "+" to make the parameter an rvalue. // See https://bugs.webkit.org/show_bug.cgi?id=59261 for more details - map()->set(make_pair(structure->m_nameInPrevious.get(), +structure->m_attributesInPrevious), structure); + map()->set(std::make_pair(structure->m_nameInPrevious.get(), +structure->m_attributesInPrevious), structure); } void Structure::dumpStatistics() @@ -158,7 +158,7 @@ Structure::Structure(VM& vm, JSGlobalObject* globalObject, JSValue prototype, co , m_globalObject(vm, this, globalObject, WriteBarrier::MayBeNull) , m_prototype(vm, this, prototype) , m_classInfo(classInfo) - , m_transitionWatchpointSet(InitializedWatching) + , m_transitionWatchpointSet(IsWatched) , m_offset(invalidOffset) , m_typeInfo(typeInfo) , m_indexingType(indexingType) @@ -185,7 +185,7 @@ Structure::Structure(VM& vm) : JSCell(CreatingEarlyCell) , m_prototype(vm, this, jsNull()) , m_classInfo(info()) - , m_transitionWatchpointSet(InitializedWatching) + , m_transitionWatchpointSet(IsWatched) , m_offset(invalidOffset) , m_typeInfo(CompoundType, OverridesVisitChildren) , m_indexingType(0) @@ -207,7 +207,7 @@ Structure::Structure(VM& vm, const Structure* previous) : JSCell(vm, vm.structureStructure.get()) , m_prototype(vm, this, previous->storedPrototype()) , m_classInfo(previous->m_classInfo) - , m_transitionWatchpointSet(InitializedWatching) + , m_transitionWatchpointSet(IsWatched) , m_offset(invalidOffset) , m_typeInfo(previous->typeInfo().type(), previous->typeInfo().flags() & ~StructureHasRareData) , m_indexingType(previous->indexingTypeIncludingHistory()) @@ -273,7 +273,7 @@ void Structure::materializePropertyMap(VM& vm) findStructuresAndMapForMaterialization(structures, structure, table); if (table) { - table = table->copy(vm, 0, numberOfSlotsForLastOffset(m_offset, m_inlineCapacity)); + table = table->copy(vm, structure, numberOfSlotsForLastOffset(m_offset, m_inlineCapacity)); structure->m_lock.unlock(); } diff --git a/JavaScriptCore/runtime/Structure.h b/JavaScriptCore/runtime/Structure.h index 231de892..c73e8cb9 100644 --- a/JavaScriptCore/runtime/Structure.h +++ b/JavaScriptCore/runtime/Structure.h @@ -134,6 +134,14 @@ class Structure : public JSCell { bool propertyAccessesAreCacheable() { return m_dictionaryKind != UncachedDictionaryKind && !typeInfo().prohibitsPropertyCaching(); } + // We use SlowPath in GetByIdStatus for structures that may get new impure properties later to prevent + // DFG from inlining property accesses since structures don't transition when a new impure property appears. + bool takesSlowPathInDFGForImpureProperty() + { + ASSERT(!typeInfo().hasImpureGetOwnPropertySlot() || typeInfo().newImpurePropertyFiresWatchpoints()); + return typeInfo().hasImpureGetOwnPropertySlot(); + } + // Type accessors. const TypeInfo& typeInfo() const { ASSERT(structure()->classInfo() == info()); return m_typeInfo; } bool isObject() const { return typeInfo().isObject(); } @@ -351,7 +359,7 @@ class Structure : public JSCell { void notifyTransitionFromThisStructure() const { - m_transitionWatchpointSet.notifyWrite(); + m_transitionWatchpointSet.fireAll(); } InlineWatchpointSet& transitionWatchpointSet() const @@ -508,7 +516,7 @@ class Structure : public JSCell { unsigned m_specificFunctionThrashCount : 2; unsigned m_preventExtensions : 1; unsigned m_didTransition : 1; - unsigned m_staticFunctionReified; + unsigned m_staticFunctionReified : 1; }; } // namespace JSC diff --git a/JavaScriptCore/runtime/StructureRareDataInlines.h b/JavaScriptCore/runtime/StructureRareDataInlines.h index 20b7f8b1..5b39bad1 100644 --- a/JavaScriptCore/runtime/StructureRareDataInlines.h +++ b/JavaScriptCore/runtime/StructureRareDataInlines.h @@ -35,9 +35,9 @@ inline Structure* StructureRareData::previousID() const return m_previous.get(); } -inline void StructureRareData::setPreviousID(VM& vm, Structure* transition, Structure* structure) +inline void StructureRareData::setPreviousID(VM& vm, Structure*, Structure* structure) { - m_previous.set(vm, transition, structure); + m_previous.set(vm, this, structure); } inline void StructureRareData::clearPreviousID() @@ -50,9 +50,9 @@ inline JSString* StructureRareData::objectToStringValue() const return m_objectToStringValue.get(); } -inline void StructureRareData::setObjectToStringValue(VM& vm, const JSCell* owner, JSString* value) +inline void StructureRareData::setObjectToStringValue(VM& vm, const JSCell*, JSString* value) { - m_objectToStringValue.set(vm, owner, value); + m_objectToStringValue.set(vm, this, value); } } // namespace JSC diff --git a/JavaScriptCore/runtime/SymbolTable.cpp b/JavaScriptCore/runtime/SymbolTable.cpp index a6e7a68a..556dbf7a 100644 --- a/JavaScriptCore/runtime/SymbolTable.cpp +++ b/JavaScriptCore/runtime/SymbolTable.cpp @@ -29,9 +29,13 @@ #include "config.h" #include "SymbolTable.h" +#include "JSDestructibleObject.h" +#include "Operations.h" +#include "SlotVisitorInlines.h" + namespace JSC { -const ClassInfo SharedSymbolTable::s_info = { "SharedSymbolTable", 0, 0, 0, CREATE_METHOD_TABLE(SharedSymbolTable) }; +const ClassInfo SymbolTable::s_info = { "SymbolTable", 0, 0, 0, CREATE_METHOD_TABLE(SymbolTable) }; SymbolTableEntry& SymbolTableEntry::copySlow(const SymbolTableEntry& other) { @@ -42,10 +46,10 @@ SymbolTableEntry& SymbolTableEntry::copySlow(const SymbolTableEntry& other) return *this; } -void SharedSymbolTable::destroy(JSCell* cell) +void SymbolTable::destroy(JSCell* cell) { - SharedSymbolTable* thisObject = jsCast(cell); - thisObject->SharedSymbolTable::~SharedSymbolTable(); + SymbolTable* thisObject = jsCast(cell); + thisObject->SymbolTable::~SymbolTable(); } void SymbolTableEntry::freeFatEntrySlow() @@ -54,41 +58,33 @@ void SymbolTableEntry::freeFatEntrySlow() delete fatEntry(); } -bool SymbolTableEntry::couldBeWatched() +JSValue SymbolTableEntry::inferredValue() { if (!isFat()) - return false; - WatchpointSet* watchpoints = fatEntry()->m_watchpoints.get(); - if (!watchpoints) - return false; - return watchpoints->isStillValid(); + return JSValue(); + return fatEntry()->m_watchpoints->inferredValue(); } -void SymbolTableEntry::attemptToWatch() +void SymbolTableEntry::prepareToWatch() { FatEntry* entry = inflate(); - if (!entry->m_watchpoints) - entry->m_watchpoints = adoptRef(new WatchpointSet(InitializedWatching)); -} - -bool* SymbolTableEntry::addressOfIsWatched() -{ - ASSERT(couldBeWatched()); - return fatEntry()->m_watchpoints->addressOfIsWatched(); + if (entry->m_watchpoints) + return; + entry->m_watchpoints = adoptRef(new VariableWatchpointSet()); } void SymbolTableEntry::addWatchpoint(Watchpoint* watchpoint) { - ASSERT(couldBeWatched()); fatEntry()->m_watchpoints->add(watchpoint); } -void SymbolTableEntry::notifyWriteSlow() +void SymbolTableEntry::notifyWriteSlow(JSValue value) { - WatchpointSet* watchpoints = fatEntry()->m_watchpoints.get(); + VariableWatchpointSet* watchpoints = fatEntry()->m_watchpoints.get(); if (!watchpoints) return; - watchpoints->notifyWrite(); + + watchpoints->notifyWrite(value); } SymbolTableEntry::FatEntry* SymbolTableEntry::inflateSlow() @@ -98,8 +94,71 @@ SymbolTableEntry::FatEntry* SymbolTableEntry::inflateSlow() return entry; } -SymbolTable::SymbolTable() { } +SymbolTable::SymbolTable(VM& vm) + : JSCell(vm, vm.symbolTableStructure.get()) + , m_parameterCountIncludingThis(0) + , m_usesNonStrictEval(false) + , m_captureStart(0) + , m_captureEnd(0) + , m_functionEnteredOnce(ClearWatchpoint) +{ +} + SymbolTable::~SymbolTable() { } +void SymbolTable::visitChildren(JSCell* thisCell, SlotVisitor& visitor) +{ + SymbolTable* thisSymbolTable = jsCast(thisCell); + if (!thisSymbolTable->m_watchpointCleanup) { + thisSymbolTable->m_watchpointCleanup = + std::make_unique(thisSymbolTable); + } + + visitor.addUnconditionalFinalizer(thisSymbolTable->m_watchpointCleanup.get()); +} + +SymbolTable::WatchpointCleanup::WatchpointCleanup(SymbolTable* symbolTable) + : m_symbolTable(symbolTable) +{ +} + +SymbolTable::WatchpointCleanup::~WatchpointCleanup() { } + +void SymbolTable::WatchpointCleanup::finalizeUnconditionally() +{ + Map::iterator iter = m_symbolTable->m_map.begin(); + Map::iterator end = m_symbolTable->m_map.end(); + for (; iter != end; ++iter) { + if (VariableWatchpointSet* set = iter->value.watchpointSet()) + set->finalizeUnconditionally(); + } +} + +SymbolTable* SymbolTable::clone(VM& vm) +{ + SymbolTable* result = SymbolTable::create(vm); + + result->m_parameterCountIncludingThis = m_parameterCountIncludingThis; + result->m_usesNonStrictEval = m_usesNonStrictEval; + result->m_captureStart = m_captureStart; + result->m_captureEnd = m_captureEnd; + + Map::iterator iter = m_map.begin(); + Map::iterator end = m_map.end(); + for (; iter != end; ++iter) { + result->m_map.add( + iter->key, + SymbolTableEntry(iter->value.getIndex(), iter->value.getAttributes())); + } + + if (m_slowArguments) { + result->m_slowArguments = std::make_unique(parameterCount()); + for (unsigned i = parameterCount(); i--;) + result->m_slowArguments[i] = m_slowArguments[i]; + } + + return result; +} + } // namespace JSC diff --git a/JavaScriptCore/runtime/SymbolTable.h b/JavaScriptCore/runtime/SymbolTable.h index c9583243..0a15f9da 100644 --- a/JavaScriptCore/runtime/SymbolTable.h +++ b/JavaScriptCore/runtime/SymbolTable.h @@ -31,16 +31,13 @@ #include "ConcurrentJITLock.h" #include "JSObject.h" -#include "Watchpoint.h" +#include "VariableWatchpointSet.h" #include #include #include namespace JSC { -class Watchpoint; -class WatchpointSet; - struct SlowArgument { enum Status { Normal = 0, @@ -79,11 +76,11 @@ static ALWAYS_INLINE int missingSymbolMarker() { return std::numeric_limits // counted pointer to a shared WatchpointSet. Thus, in-place edits of the // WatchpointSet will manifest in all copies. Here's a picture: // -// SymbolTableEntry --> FatEntry --> WatchpointSet +// SymbolTableEntry --> FatEntry --> VariableWatchpointSet // // If you make a copy of a SymbolTableEntry, you will have: // -// original: SymbolTableEntry --> FatEntry --> WatchpointSet +// original: SymbolTableEntry --> FatEntry --> VariableWatchpointSet // copy: SymbolTableEntry --> FatEntry -----^ struct SymbolTableEntry { @@ -218,32 +215,24 @@ struct SymbolTableEntry { return bits() & ReadOnlyFlag; } - bool couldBeWatched(); - - // Notify an opportunity to create a watchpoint for a variable. This is - // idempotent and fail-silent. It is idempotent in the sense that if - // a watchpoint set had already been created, then another one will not - // be created. Hence two calls to this method have the same effect as - // one call. It is also fail-silent, in the sense that if a watchpoint - // set had been created and had already been invalidated, then this will - // just return. This means that couldBeWatched() may return false even - // immediately after a call to attemptToWatch(). - void attemptToWatch(); + JSValue inferredValue(); - bool* addressOfIsWatched(); + void prepareToWatch(); void addWatchpoint(Watchpoint*); - WatchpointSet* watchpointSet() + VariableWatchpointSet* watchpointSet() { + if (!isFat()) + return 0; return fatEntry()->m_watchpoints.get(); } - ALWAYS_INLINE void notifyWrite() + ALWAYS_INLINE void notifyWrite(JSValue value) { if (LIKELY(!isFat())) return; - notifyWriteSlow(); + notifyWriteSlow(value); } private: @@ -263,11 +252,11 @@ struct SymbolTableEntry { intptr_t m_bits; // always has FatFlag set and exactly matches what the bits would have been if this wasn't fat. - RefPtr m_watchpoints; + RefPtr m_watchpoints; }; SymbolTableEntry& copySlow(const SymbolTableEntry&); - JS_EXPORT_PRIVATE void notifyWriteSlow(); + JS_EXPORT_PRIVATE void notifyWriteSlow(JSValue); bool isFat() const { @@ -341,13 +330,27 @@ struct SymbolTableIndexHashTraits : HashTraits { static const bool needsDestruction = true; }; -class SymbolTable { +class SymbolTable : public JSCell { public: + typedef JSCell Base; + typedef HashMap, SymbolTableEntry, IdentifierRepHash, HashTraits>, SymbolTableIndexHashTraits> Map; - JS_EXPORT_PRIVATE SymbolTable(); - JS_EXPORT_PRIVATE ~SymbolTable(); - + static SymbolTable* create(VM& vm) + { + SymbolTable* symbolTable = new (NotNull, allocateCell(vm.heap)) SymbolTable(vm); + symbolTable->finishCreation(vm); + return symbolTable; + } + static const bool needsDestruction = true; + static const bool hasImmortalStructure = true; + static void destroy(JSCell*); + + static Structure* createStructure(VM& vm, JSGlobalObject* globalObject, JSValue prototype) + { + return Structure::create(vm, globalObject, prototype, TypeInfo(LeafType, StructureFlags), info()); + } + // You must hold the lock until after you're done with the iterator. Map::iterator find(const ConcurrentJITLocker&, StringImpl* key) { @@ -440,42 +443,21 @@ class SymbolTable { return contains(locker, key); } -private: - Map m_map; -public: - mutable ConcurrentJITLock m_lock; -}; - - -class SharedSymbolTable : public JSCell, public SymbolTable { -public: - typedef JSCell Base; - - static SharedSymbolTable* create(VM& vm) - { - SharedSymbolTable* sharedSymbolTable = new (NotNull, allocateCell(vm.heap)) SharedSymbolTable(vm); - sharedSymbolTable->finishCreation(vm); - return sharedSymbolTable; - } - static const bool needsDestruction = true; - static const bool hasImmortalStructure = true; - static void destroy(JSCell*); - - static Structure* createStructure(VM& vm, JSGlobalObject* globalObject, JSValue prototype) - { - return Structure::create(vm, globalObject, prototype, TypeInfo(LeafType, StructureFlags), info()); - } - bool usesNonStrictEval() { return m_usesNonStrictEval; } void setUsesNonStrictEval(bool usesNonStrictEval) { m_usesNonStrictEval = usesNonStrictEval; } - int captureStart() { return m_captureStart; } + int captureStart() const { return m_captureStart; } void setCaptureStart(int captureStart) { m_captureStart = captureStart; } - int captureEnd() { return m_captureEnd; } + int captureEnd() const { return m_captureEnd; } void setCaptureEnd(int captureEnd) { m_captureEnd = captureEnd; } - int captureCount() { return -(m_captureEnd - m_captureStart); } + int captureCount() const { return -(m_captureEnd - m_captureStart); } + + bool isCaptured(int operand) + { + return operand <= captureStart() && operand > captureEnd(); + } int parameterCount() { return m_parameterCountIncludingThis - 1; } int parameterCountIncludingThis() { return m_parameterCountIncludingThis; } @@ -484,19 +466,31 @@ class SharedSymbolTable : public JSCell, public SymbolTable { // 0 if we don't capture any arguments; parameterCount() in length if we do. const SlowArgument* slowArguments() { return m_slowArguments.get(); } void setSlowArguments(std::unique_ptr slowArguments) { m_slowArguments = std::move(slowArguments); } + + SymbolTable* clone(VM&); + + static void visitChildren(JSCell*, SlotVisitor&); DECLARE_EXPORT_INFO; private: - SharedSymbolTable(VM& vm) - : JSCell(vm, vm.sharedSymbolTableStructure.get()) - , m_parameterCountIncludingThis(0) - , m_usesNonStrictEval(false) - , m_captureStart(0) - , m_captureEnd(0) - { - } + class WatchpointCleanup : public UnconditionalFinalizer { + public: + WatchpointCleanup(SymbolTable*); + virtual ~WatchpointCleanup(); + + protected: + virtual void finalizeUnconditionally() OVERRIDE; + + private: + SymbolTable* m_symbolTable; + }; + + JS_EXPORT_PRIVATE SymbolTable(VM&); + ~SymbolTable(); + Map m_map; + int m_parameterCountIncludingThis; bool m_usesNonStrictEval; @@ -504,6 +498,13 @@ class SharedSymbolTable : public JSCell, public SymbolTable { int m_captureEnd; std::unique_ptr m_slowArguments; + + std::unique_ptr m_watchpointCleanup; + +public: + InlineWatchpointSet m_functionEnteredOnce; + + mutable ConcurrentJITLock m_lock; }; } // namespace JSC diff --git a/JavaScriptCore/runtime/VM.cpp b/JavaScriptCore/runtime/VM.cpp index 0aeff5f0..9558b8d7 100644 --- a/JavaScriptCore/runtime/VM.cpp +++ b/JavaScriptCore/runtime/VM.cpp @@ -30,6 +30,7 @@ #include "VM.h" #include "ArgList.h" +#include "ArrayBufferNeuteringWatchpoint.h" #include "CallFrameInlines.h" #include "CodeBlock.h" #include "CodeCache.h" @@ -56,6 +57,8 @@ #include "JSLock.h" #include "JSNameScope.h" #include "JSNotAnObject.h" +#include "JSPromiseDeferred.h" +#include "JSPromiseReaction.h" #include "JSPropertyNameIterator.h" #include "JSWithScope.h" #include "Lexer.h" @@ -113,7 +116,6 @@ extern const HashTable stringConstructorTable; #if ENABLE(PROMISES) extern const HashTable promisePrototypeTable; extern const HashTable promiseConstructorTable; -extern const HashTable promiseResolverPrototypeTable; #endif // Note: Platform.h will enforce that ENABLE(ASSEMBLER) is true if either @@ -163,7 +165,7 @@ VM::VM(VMType vmType, HeapType heapType) , heap(this, heapType) , vmType(vmType) , clientData(0) - , topCallFrame(CallFrame::noCaller()->removeHostCallFrameFlag()) + , topCallFrame(CallFrame::noCaller()) , arrayConstructorTable(adoptPtr(new HashTable(JSC::arrayConstructorTable))) , arrayPrototypeTable(adoptPtr(new HashTable(JSC::arrayPrototypeTable))) , booleanPrototypeTable(adoptPtr(new HashTable(JSC::booleanPrototypeTable))) @@ -184,7 +186,6 @@ VM::VM(VMType vmType, HeapType heapType) #if ENABLE(PROMISES) , promisePrototypeTable(adoptPtr(new HashTable(JSC::promisePrototypeTable))) , promiseConstructorTable(adoptPtr(new HashTable(JSC::promiseConstructorTable))) - , promiseResolverPrototypeTable(adoptPtr(new HashTable(JSC::promiseResolverPrototypeTable))) #endif , identifierTable(vmType == Default ? wtfThreadData().currentIdentifierTable() : createIdentifierTable()) , propertyNames(new CommonIdentifiers(this)) @@ -195,7 +196,7 @@ VM::VM(VMType vmType, HeapType heapType) , jsArrayClassInfo(JSArray::info()) , jsFinalObjectClassInfo(JSFinalObject::info()) , sizeOfLastScratchBuffer(0) - , dynamicGlobalObject(0) + , entryScope(0) , m_enabledProfiler(0) , m_regExpCache(new RegExpCache(this)) #if ENABLE(REGEXP_TRACING) @@ -214,11 +215,17 @@ VM::VM(VMType vmType, HeapType heapType) #endif #if ENABLE(GC_VALIDATION) , m_initializingObjectClass(0) +#endif + , m_stackLimit(0) +#if USE(SEPARATE_C_AND_JS_STACK) + , m_jsStackLimit(0) #endif , m_inDefineOwnProperty(false) , m_codeCache(CodeCache::create()) { interpreter = new Interpreter(*this); + StackBounds stack = wtfThreadData().stack(); + setStackLimit(stack.recursionLimit()); // Need to be careful to keep everything consistent here JSLockHolder lock(this); @@ -239,9 +246,10 @@ VM::VM(VMType vmType, HeapType heapType) programExecutableStructure.set(*this, ProgramExecutable::createStructure(*this, 0, jsNull())); functionExecutableStructure.set(*this, FunctionExecutable::createStructure(*this, 0, jsNull())); regExpStructure.set(*this, RegExp::createStructure(*this, 0, jsNull())); - sharedSymbolTableStructure.set(*this, SharedSymbolTable::createStructure(*this, 0, jsNull())); + symbolTableStructure.set(*this, SymbolTable::createStructure(*this, 0, jsNull())); structureChainStructure.set(*this, StructureChain::createStructure(*this, 0, jsNull())); sparseArrayValueMapStructure.set(*this, SparseArrayValueMap::createStructure(*this, 0, jsNull())); + arrayBufferNeuteringWatchpointStructure.set(*this, ArrayBufferNeuteringWatchpoint::createStructure(*this)); withScopeStructure.set(*this, JSWithScope::createStructure(*this, 0, jsNull())); unlinkedFunctionExecutableStructure.set(*this, UnlinkedFunctionExecutable::createStructure(*this, 0, jsNull())); unlinkedProgramCodeBlockStructure.set(*this, UnlinkedProgramCodeBlock::createStructure(*this, 0, jsNull())); @@ -250,6 +258,8 @@ VM::VM(VMType vmType, HeapType heapType) propertyTableStructure.set(*this, PropertyTable::createStructure(*this, 0, jsNull())); mapDataStructure.set(*this, MapData::createStructure(*this, 0, jsNull())); weakMapDataStructure.set(*this, WeakMapData::createStructure(*this, 0, jsNull())); + promiseDeferredStructure.set(*this, JSPromiseDeferred::createStructure(*this, 0, jsNull())); + promiseReactionStructure.set(*this, JSPromiseReaction::createStructure(*this, 0, jsNull())); iterationTerminator.set(*this, JSFinalObject::create(*this, JSFinalObject::createStructure(*this, 0, jsNull(), 1))); smallStrings.initializeCommonStrings(*this); @@ -342,7 +352,6 @@ VM::~VM() #if ENABLE(PROMISES) promisePrototypeTable->deleteTable(); promiseConstructorTable->deleteTable(); - promiseResolverPrototypeTable->deleteTable(); #endif delete emptyList; @@ -448,10 +457,15 @@ NativeExecutable* VM::getHostFunction(NativeFunction function, Intrinsic intrins } #else // !ENABLE(JIT) + NativeExecutable* VM::getHostFunction(NativeFunction function, NativeFunction constructor) { - return NativeExecutable::create(*this, function, constructor); + return NativeExecutable::create(*this, + MacroAssemblerCodeRef::createLLIntCodeRef(llint_native_call_trampoline), function, + MacroAssemblerCodeRef::createLLIntCodeRef(llint_native_construct_trampoline), constructor, + NoIntrinsic); } + #endif // !ENABLE(JIT) VM::ClientData::~ClientData() @@ -532,7 +546,7 @@ void VM::releaseExecutableMemory() { prepareToDiscardCode(); - if (dynamicGlobalObject) { + if (entryScope) { StackPreservingRecompiler recompiler; HeapIterationScope iterationScope(heap); HashSet roots; @@ -618,7 +632,7 @@ static void appendSourceToError(CallFrame* callFrame, ErrorInstance* exception, JSValue VM::throwException(ExecState* exec, JSValue error) { - ASSERT(exec == topCallFrame || exec == exec->lexicalGlobalObject()->globalExec() || exec == exec->dynamicGlobalObject()->globalExec()); + ASSERT(exec == topCallFrame || exec == exec->lexicalGlobalObject()->globalExec() || exec == exec->vmEntryGlobalObject()->globalExec()); Vector stackTrace; interpreter->getStackTrace(stackTrace); @@ -650,8 +664,10 @@ JSValue VM::throwException(ExecState* exec, JSValue error) if (exception->isErrorInstance() && static_cast(exception)->appendSourceToMessage()) { unsigned stackIndex = 0; CallFrame* callFrame; - for (callFrame = exec; callFrame && !callFrame->codeBlock(); callFrame = callFrame->callerFrame()->removeHostCallFrameFlag()) + for (callFrame = exec; callFrame && !callFrame->codeBlock(); ) { stackIndex++; + callFrame = callFrame->callerFrameSkippingVMEntrySentinel(); + } if (callFrame && callFrame->codeBlock()) { stackFrame = stackTrace.at(stackIndex); bytecodeOffset = stackFrame.bytecodeOffset; @@ -750,4 +766,18 @@ void VM::dumpRegExpTrace() } #endif +void VM::registerWatchpointForImpureProperty(const Identifier& propertyName, Watchpoint* watchpoint) +{ + auto result = m_impurePropertyWatchpointSets.add(propertyName.string(), nullptr); + if (result.isNewEntry) + result.iterator->value = adoptRef(new WatchpointSet(IsWatched)); + result.iterator->value->add(watchpoint); +} + +void VM::addImpureProperty(const String& propertyName) +{ + if (RefPtr watchpointSet = m_impurePropertyWatchpointSets.take(propertyName)) + watchpointSet->fireAll(); +} + } // namespace JSC diff --git a/JavaScriptCore/runtime/VM.h b/JavaScriptCore/runtime/VM.h index 280c74f6..f2f2b553 100644 --- a/JavaScriptCore/runtime/VM.h +++ b/JavaScriptCore/runtime/VM.h @@ -29,9 +29,9 @@ #ifndef VM_h #define VM_h -#include "CachedTranscendentalFunction.h" #include "DateInstanceCache.h" #include "ExecutableAllocator.h" +#include "GPRInfo.h" #include "Heap.h" #include "Intrinsic.h" #include "JITThunks.h" @@ -48,16 +48,20 @@ #include "ThunkGenerators.h" #include "TypedArrayController.h" #include "Watchdog.h" +#include "Watchpoint.h" #include "WeakRandom.h" #include #include #include #include +#include #include #include +#include #include #include #include +#include #if ENABLE(REGEXP_TRACING) #include #endif @@ -69,6 +73,7 @@ namespace JSC { class CommonIdentifiers; class ExecState; class HandleStack; + class Identifier; class IdentifierTable; class Interpreter; class JSGlobalObject; @@ -91,6 +96,9 @@ namespace JSC { class UnlinkedEvalCodeBlock; class UnlinkedFunctionExecutable; class UnlinkedProgramCodeBlock; + class VMEntryScope; + class Watchpoint; + class WatchpointSet; #if ENABLE(DFG_JIT) namespace DFG { @@ -244,7 +252,6 @@ namespace JSC { #if ENABLE(PROMISES) const OwnPtr promisePrototypeTable; const OwnPtr promiseConstructorTable; - const OwnPtr promiseResolverPrototypeTable; #endif Strong structureStructure; @@ -263,9 +270,10 @@ namespace JSC { Strong programExecutableStructure; Strong functionExecutableStructure; Strong regExpStructure; - Strong sharedSymbolTableStructure; + Strong symbolTableStructure; Strong structureChainStructure; Strong sparseArrayValueMapStructure; + Strong arrayBufferNeuteringWatchpointStructure; Strong withScopeStructure; Strong unlinkedFunctionExecutableStructure; Strong unlinkedProgramCodeBlockStructure; @@ -274,6 +282,8 @@ namespace JSC { Strong propertyTableStructure; Strong mapDataStructure; Strong weakMapDataStructure; + Strong promiseDeferredStructure; + Strong promiseReactionStructure; Strong iterationTerminator; IdentifierTable* identifierTable; @@ -362,11 +372,26 @@ namespace JSC { JS_EXPORT_PRIVATE JSValue throwException(ExecState*, JSValue); JS_EXPORT_PRIVATE JSObject* throwException(ExecState*, JSObject*); + void** addressOfJSStackLimit() { return &m_jsStackLimit; } + void* jsStackLimit() { return m_jsStackLimit; } + void setJSStackLimit(void* limit) { m_jsStackLimit = limit; } + + void* stackLimit() { return m_stackLimit; } + void setStackLimit(void* limit) { m_stackLimit = limit; } + bool isSafeToRecurse(size_t neededStackInBytes = 0) const + { + ASSERT(wtfThreadData().stack().isGrowingDownward()); + int8_t* curr = reinterpret_cast(&curr); + int8_t* limit = reinterpret_cast(m_stackLimit); + return curr >= limit && static_cast(curr - limit) >= neededStackInBytes; + } + const ClassInfo* const jsArrayClassInfo; const ClassInfo* const jsFinalObjectClassInfo; ReturnAddressPtr exceptionLocation; JSValue hostCallReturnValue; + ExecState* newCallFrameReturnValue; ExecState* callFrameForThrow; void* targetMachinePCForThrow; Instruction* targetInterpreterPCForThrow; @@ -397,7 +422,7 @@ namespace JSC { void gatherConservativeRoots(ConservativeRoots&); - JSGlobalObject* dynamicGlobalObject; + VMEntryScope* entryScope; HashSet stringRecursionCheckVisitedObjects; @@ -419,9 +444,6 @@ namespace JSC { ThreadIdentifier exclusiveThread; - CachedTranscendentalFunction cachedSin; - CachedTranscendentalFunction cachedCos; - JS_EXPORT_PRIVATE void resetDateCache(); JS_EXPORT_PRIVATE void startSampling(); @@ -460,9 +482,14 @@ namespace JSC { JS_EXPORT_PRIVATE void discardAllCode(); + void registerWatchpointForImpureProperty(const Identifier&, Watchpoint*); + // FIXME: Use AtomicString once it got merged with Identifier. + JS_EXPORT_PRIVATE void addImpureProperty(const String&); + private: friend class LLIntOffsetsExtractor; friend class ClearExceptionScope; + friend class RecursiveAllocationScope; VM(VMType, HeapType); static VM*& sharedInstanceInternal(); @@ -479,10 +506,24 @@ namespace JSC { #if ENABLE(GC_VALIDATION) const ClassInfo* m_initializingObjectClass; #endif + +#if USE(SEPARATE_C_AND_JS_STACK) + struct { + void* m_stackLimit; + void* m_jsStackLimit; + }; +#else + union { + void* m_stackLimit; + void* m_jsStackLimit; + }; +#endif JSValue m_exception; bool m_inDefineOwnProperty; OwnPtr m_codeCache; RefCountedArray m_exceptionStack; + + HashMap> m_impurePropertyWatchpointSets; }; #if ENABLE(GC_VALIDATION) diff --git a/JavaScriptCore/runtime/VMEntryScope.cpp b/JavaScriptCore/runtime/VMEntryScope.cpp new file mode 100644 index 00000000..26b0028e --- /dev/null +++ b/JavaScriptCore/runtime/VMEntryScope.cpp @@ -0,0 +1,85 @@ +/* + * Copyright (C) 2013 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 "VMEntryScope.h" + +#include "VM.h" +#include + +namespace JSC { + +VMEntryScope::VMEntryScope(VM& vm, JSGlobalObject* globalObject) + : m_vm(vm) + , m_stack(wtfThreadData().stack()) + , m_globalObject(globalObject) + , m_prev(vm.entryScope) + , m_prevStackLimit(vm.stackLimit()) +{ + if (!vm.entryScope) { +#if ENABLE(ASSEMBLER) + if (ExecutableAllocator::underMemoryPressure()) + vm.heap.deleteAllCompiledCode(); +#endif + vm.entryScope = this; + + // Reset the date cache between JS invocations to force the VM to + // observe time xone changes. + vm.resetDateCache(); + } + // Clear the exception stack between entries + vm.clearExceptionStack(); + + void* limit = m_stack.recursionLimit(requiredCapacity()); + vm.setStackLimit(limit); +} + +VMEntryScope::~VMEntryScope() +{ + m_vm.entryScope = m_prev; + m_vm.setStackLimit(m_prevStackLimit); +} + +size_t VMEntryScope::requiredCapacity() const +{ + Interpreter* interpreter = m_vm.interpreter; + + // We require a smaller stack budget for the error stack. This is to allow + // some minimal JS execution to proceed and do the work of throwing a stack + // overflow error if needed. In contrast, arbitrary JS code will require the + // more generous stack budget in order to proceed. + // + // These sizes were derived from the stack usage of a number of sites when + // layout occurs when we've already consumed most of the C stack. + const size_t requiredStack = 128 * KB; + const size_t errorModeRequiredStack = 64 * KB; + + size_t requiredCapacity = interpreter->isInErrorHandlingMode() ? errorModeRequiredStack : requiredStack; + RELEASE_ASSERT(m_stack.size() >= requiredCapacity); + return requiredCapacity; +} + +} // namespace JSC + diff --git a/JavaScriptCore/runtime/VMStackBounds.h b/JavaScriptCore/runtime/VMEntryScope.h similarity index 54% rename from JavaScriptCore/runtime/VMStackBounds.h rename to JavaScriptCore/runtime/VMEntryScope.h index 76a3ebd3..8e1c44a7 100644 --- a/JavaScriptCore/runtime/VMStackBounds.h +++ b/JavaScriptCore/runtime/VMEntryScope.h @@ -23,49 +23,39 @@ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -#ifndef VMStackBounds_h -#define VMStackBounds_h +#ifndef VMEntryScope_h +#define VMEntryScope_h -#include "VM.h" +#include "Interpreter.h" #include +#include namespace JSC { -class VMStackBounds { +class JSGlobalObject; +class VM; + +class VMEntryScope { public: - VMStackBounds(VM& vm, const StackBounds& bounds) - : m_vm(vm) - , m_bounds(bounds) - { - } + JS_EXPORT_PRIVATE VMEntryScope(VM&, JSGlobalObject*); + JS_EXPORT_PRIVATE ~VMEntryScope(); - bool isSafeToRecurse() const { return m_bounds.isSafeToRecurse(requiredCapacity()); } + JSGlobalObject* globalObject() const { return m_globalObject; } private: - inline size_t requiredCapacity() const - { - Interpreter* interpreter = m_vm.interpreter; - - // We have two separate stack limits, one for regular JS execution, and one - // for when we're handling errors. We need the error stack to be smaller - // otherwise there would obviously not be any stack left to execute JS in when - // there's a stack overflow. - // - // These sizes were derived from the stack usage of a number of sites when - // layout occurs when we've already consumed most of the C stack. - const size_t requiredStack = 128 * KB; - const size_t errorModeRequiredStack = 64 * KB; - - size_t requiredCapacity = interpreter->isInErrorHandlingMode() ? errorModeRequiredStack : requiredStack; - RELEASE_ASSERT(m_bounds.size() >= requiredCapacity); - return requiredCapacity; - } + size_t requiredCapacity() const; VM& m_vm; - const StackBounds& m_bounds; + StackStats::CheckPoint m_stackCheckPoint; + StackBounds m_stack; + JSGlobalObject* m_globalObject; + + // m_prev and m_prevStackLimit may belong to a different thread's stack. + VMEntryScope* m_prev; + void* m_prevStackLimit; }; } // namespace JSC -#endif // VMStackBounds_h +#endif // VMEntryScope_h diff --git a/JavaScriptCore/runtime/WeakMapData.cpp b/JavaScriptCore/runtime/WeakMapData.cpp index ce60c8c2..224be8a4 100644 --- a/JavaScriptCore/runtime/WeakMapData.cpp +++ b/JavaScriptCore/runtime/WeakMapData.cpp @@ -64,7 +64,7 @@ void WeakMapData::visitChildren(JSCell* cell, SlotVisitor& visitor) // Rough approximation of the external storage needed for the hashtable. // This isn't exact, but it is close enough, and proportional to the actual // external mermory usage. - visitor.reportExtraMemoryUsage(thisObj->m_map.capacity() * (sizeof(JSObject*) + sizeof(WriteBarrier))); + visitor.reportExtraMemoryUsage(thisObj, thisObj->m_map.capacity() * (sizeof(JSObject*) + sizeof(WriteBarrier))); } void WeakMapData::set(VM& vm, JSObject* key, JSValue value) diff --git a/JavaScriptCore/shell/PlatformBlackBerry.cmake b/JavaScriptCore/shell/PlatformBlackBerry.cmake deleted file mode 100644 index 8f81ed44..00000000 --- a/JavaScriptCore/shell/PlatformBlackBerry.cmake +++ /dev/null @@ -1,16 +0,0 @@ -FIND_STAGING_LIBRARY(SLOG2_LIBRARY slog2) -list(APPEND JSC_LIBRARIES - ${ICUI18N_LIBRARY} - ${ICUUC_LIBRARY} - ${INTL_LIBRARY} # Required for x86 builds - ${M_LIBRARY} - ${SLOG2_LIBRARY} - ${Screen_LIBRARY} - ${WebKitPlatform_LIBRARY} -) - -if (PROFILING) - list(APPEND JSC_LIBRARIES - ${PROFILING_LIBRARY} - ) -endif () diff --git a/JavaScriptCore/testRegExp.cpp b/JavaScriptCore/testRegExp.cpp index 05df90ee..a76f2197 100644 --- a/JavaScriptCore/testRegExp.cpp +++ b/JavaScriptCore/testRegExp.cpp @@ -147,7 +147,7 @@ GlobalObject::GlobalObject(VM& vm, Structure* structure, const Vector& a // be in a separate main function because the realMain function requires object // unwinding. -#if COMPILER(MSVC) && !COMPILER(INTEL) && !defined(_DEBUG) && !OS(WINCE) +#if COMPILER(MSVC) && !defined(_DEBUG) && !OS(WINCE) #define TRY __try { #define EXCEPT(x) } __except (EXCEPTION_EXECUTE_HANDLER) { x; } #else diff --git a/JavaScriptCore/tests/stress/bit-op-value-to-int32-input-liveness.js b/JavaScriptCore/tests/stress/bit-op-value-to-int32-input-liveness.js new file mode 100644 index 00000000..d614db2c --- /dev/null +++ b/JavaScriptCore/tests/stress/bit-op-value-to-int32-input-liveness.js @@ -0,0 +1,20 @@ +function foo(a, b) { + return a.f ^ b.f; +} + +noInline(foo); + +for (var i = 0; i < 100000; ++i) { + var result = foo({f:5.5}, {f:6.5}); + if (result != 3) + throw "Error: bad result: " + result; +} + +var result = foo({f:"5.5"}, {f:6.5}); +if (result != 3) + throw "Error: bad result: " + result; + +var result = foo({f:5.5}, {f:"6.5"}); +if (result != 3) + throw "Error: bad result: " + result; + diff --git a/JavaScriptCore/tests/stress/dead-int32-to-double.js b/JavaScriptCore/tests/stress/dead-int32-to-double.js new file mode 100644 index 00000000..0713fd67 --- /dev/null +++ b/JavaScriptCore/tests/stress/dead-int32-to-double.js @@ -0,0 +1,16 @@ +function foo(int, o) { + var x = int; + o.f = x; + for (var i = 0; i < 100; ++i) + x += 0.5; +} + +noInline(foo); + +for (var i = 0; i < 100; ++i) + foo(42, {}); + +var o = {g: 43}; +foo(47, o); +if (o.f != 47) + throw "Error: o.f is " + o.f; diff --git a/JavaScriptCore/tests/stress/dead-uint32-to-number.js b/JavaScriptCore/tests/stress/dead-uint32-to-number.js new file mode 100644 index 00000000..4e398786 --- /dev/null +++ b/JavaScriptCore/tests/stress/dead-uint32-to-number.js @@ -0,0 +1,16 @@ +function foo(a, o) { + var x = a >>> 0; + o.f = x | 0; + for (var i = 0; i < 100; ++i) + x++; +} + +noInline(foo); + +for (var i = 0; i < 100; ++i) + foo(42, {}); + +var o = {g: 43}; +foo(47, o); +if (o.f != 47) + throw "Error: o.f is " + o.f; diff --git a/JavaScriptCore/tests/stress/double-as-int32.js b/JavaScriptCore/tests/stress/double-as-int32.js new file mode 100644 index 00000000..1939823a --- /dev/null +++ b/JavaScriptCore/tests/stress/double-as-int32.js @@ -0,0 +1,22 @@ +//@ defaultRun; runNoCJITNoASO + +function foo(a, b) { + return a.f / b.f; +} + +noInline(foo); + +function test(a, b, e) { + var result = foo({f:a}, {f:b}); + if (result != e) + throw "Error: " + a + " / " + b + " should be " + e + " but was " + result; +} + +for (var i = 1; i < 101; ++i) + test(i * 2, i, 2); + +test(9, 3, 3); +test(12, 4, 3); +test(-32, 8, -4); +test(-21, 7, -3); +test(7, 2, 3.5); diff --git a/JavaScriptCore/tests/stress/float32array-out-of-bounds.js b/JavaScriptCore/tests/stress/float32array-out-of-bounds.js new file mode 100644 index 00000000..02a02dda --- /dev/null +++ b/JavaScriptCore/tests/stress/float32array-out-of-bounds.js @@ -0,0 +1,29 @@ +function make(value) { + var result = new Float32Array(1); + result[0] = value; + return result; +} + +function foo(a, i) { + return a[i]; +} + +noInline(foo); + +function test(value) { + var result = foo(make(value), 0); + if (result != value) + throw "Error: bad result: " + result; +} + +for (var i = 0; i < 100000; ++i) + test(42); + +var result = foo(make(42), 1); +if (result !== void 0) + throw "Error: bad result: " + result; + +Float32Array.prototype[1] = 23; +result = foo(make(42), 1); +if (result !== 23) + throw "Error: bad result: " + result; diff --git a/JavaScriptCore/tests/stress/fold-typed-array-properties.js b/JavaScriptCore/tests/stress/fold-typed-array-properties.js new file mode 100644 index 00000000..65237920 --- /dev/null +++ b/JavaScriptCore/tests/stress/fold-typed-array-properties.js @@ -0,0 +1,39 @@ +var a = new Int32Array(new ArrayBuffer(100), 4, 1); + +if (a.length != 1) + throw "Error: bad length: " + a.length; +if (a.byteOffset != 4) + throw "Error: bad offset: " + a.byteOffset; +if (a.byteLength != 4) + throw "Error: bad byte length: " + a.byteLength; + +function foo() { + if (a.length != 1) + throw "Error: bad length: " + a.length; + if (a.byteOffset != 4) + throw "Error: bad offset: " + a.byteOffset; + if (a.byteLength != 4) + throw "Error: bad byte length: " + a.byteLength; +} + +for (var i = 0; i < 1000000; ++i) + foo(); + +transferArrayBuffer(a.buffer); + +var didThrow = false; +try { + foo(); +} catch (e) { + didThrow = true; +} + +if (!didThrow) + throw "Should have thrown."; + +if (a.length != 0) + throw "Error: bad length: " + a.length; +if (a.byteOffset != 0) + throw "Error: bad offset: " + a.byteOffset; +if (a.byteLength != 0) + throw "Error: bad byte length: " + a.byteLength; diff --git a/JavaScriptCore/tests/stress/int32-object-out-of-bounds.js b/JavaScriptCore/tests/stress/int32-object-out-of-bounds.js new file mode 100644 index 00000000..6d38679f --- /dev/null +++ b/JavaScriptCore/tests/stress/int32-object-out-of-bounds.js @@ -0,0 +1,37 @@ +function make(value) { + var result = {}; + result[0] = value; + return result; +} + +function foo(a, i) { + return a[i]; +} + +noInline(foo); + +function test(value) { + var result = foo(make(value), 0); + if (result != value) + throw "Error: bad result: " + result; +} + +for (var i = 0; i < 100000; ++i) + test(42); + +var result = foo(make(42), 1); +if (result !== void 0) + throw "Error: bad result: " + result; + +result = foo(make(42), 100); +if (result !== void 0) + throw "Error: bad result: " + result; + +result = foo(make(42), 10000); +if (result !== void 0) + throw "Error: bad result: " + result; + +Object.prototype[10000] = 23; +result = foo(make(42), 10000); +if (result !== 23) + throw "Error: bad result: " + result; diff --git a/JavaScriptCore/tests/stress/int32-out-of-bounds.js b/JavaScriptCore/tests/stress/int32-out-of-bounds.js new file mode 100644 index 00000000..878709dc --- /dev/null +++ b/JavaScriptCore/tests/stress/int32-out-of-bounds.js @@ -0,0 +1,31 @@ +function foo(a, i) { + return a[i]; +} + +noInline(foo); + +function test(value) { + var result = foo([value], 0); + if (result != value) + throw "Error: bad result: " + result; +} + +for (var i = 0; i < 100000; ++i) + test(42); + +var result = foo([42], 1); +if (result !== void 0) + throw "Error: bad result: " + result; + +result = foo([42], 100); +if (result !== void 0) + throw "Error: bad result: " + result; + +result = foo([42], 10000); +if (result !== void 0) + throw "Error: bad result: " + result; + +Array.prototype[10000] = 23; +result = foo([42], 10000); +if (result !== 23) + throw "Error: bad result: " + result; diff --git a/JavaScriptCore/tests/stress/phantom-arguments-set-local-then-exit-in-same-block.js b/JavaScriptCore/tests/stress/phantom-arguments-set-local-then-exit-in-same-block.js new file mode 100644 index 00000000..fe64414b --- /dev/null +++ b/JavaScriptCore/tests/stress/phantom-arguments-set-local-then-exit-in-same-block.js @@ -0,0 +1,17 @@ +function foo(o) { + var a = arguments; + var result = o.f; + for (var i = 1; i < a.length; ++i) + result += a[i]; + return result; +} + +noInline(foo); + +for (var i = 0; i < 100; ++i) + foo({f:42}, 1, 2, 3); + +var result = foo({g:40, f:41}, 1, 2.5, 3); +if (result != 47.5) + throw "Bad result: " + result; + diff --git a/JavaScriptCore/tests/stress/untyped-equality.js b/JavaScriptCore/tests/stress/untyped-equality.js new file mode 100644 index 00000000..093761b1 --- /dev/null +++ b/JavaScriptCore/tests/stress/untyped-equality.js @@ -0,0 +1,20 @@ +function foo(a, b) { + return a == b; +} + +noInline(foo); + +var data = [ + [5, 6.5, false], + ["foo", "bar", false], + [true, false, false], + ["42", 42, true], + [1.2, 1.2, true] +]; + +for (var i = 0; i < 100000; ++i) { + var test = data[i % data.length]; + var result = foo(test[0], test[1]); + if (result != test[2]) + throw "Error: bad result for " + test + ": " + result; +} diff --git a/JavaScriptCore/tests/stress/untyped-less-than.js b/JavaScriptCore/tests/stress/untyped-less-than.js new file mode 100644 index 00000000..c37f3671 --- /dev/null +++ b/JavaScriptCore/tests/stress/untyped-less-than.js @@ -0,0 +1,23 @@ +function foo(a, b) { + return a < b; +} + +noInline(foo); + +var data = [ + [5, 6.5, true], + ["foo", "bar", false], + [true, false, false], + [false, true, true], + ["42", 42, false], + [1.2, 1.2, false], + ["-1", 1, true], + [-1, "1", true] +]; + +for (var i = 0; i < 100000; ++i) { + var test = data[i % data.length]; + var result = foo(test[0], test[1]); + if (result != test[2]) + throw "Error: bad result for " + test + ": " + result; +} diff --git a/JavaScriptCore/tests/stress/use-arguments-as-object-pointer.js b/JavaScriptCore/tests/stress/use-arguments-as-object-pointer.js new file mode 100644 index 00000000..c9d24c12 --- /dev/null +++ b/JavaScriptCore/tests/stress/use-arguments-as-object-pointer.js @@ -0,0 +1,13 @@ +function foo() { + arguments = {f:42}; + return arguments.f; +} + +noInline(foo); + +for (var i = 0; i < 100000; ++i) { + var result = foo(); + if (result != 42) + throw "Error: bad result: " + result; +} + diff --git a/JavaScriptCore/yarr/YarrInterpreter.cpp b/JavaScriptCore/yarr/YarrInterpreter.cpp index 62e76975..fb3ba7e3 100644 --- a/JavaScriptCore/yarr/YarrInterpreter.cpp +++ b/JavaScriptCore/yarr/YarrInterpreter.cpp @@ -34,10 +34,6 @@ #include #include -#ifndef NDEBUG -#include -#endif - using namespace WTF; namespace JSC { namespace Yarr { diff --git a/WTF/ChangeLog b/WTF/ChangeLog index 74c2629e..0cf8679b 100644 --- a/WTF/ChangeLog +++ b/WTF/ChangeLog @@ -1,3 +1,2048 @@ +2014-01-14 Daniel Bates + + [iOS] Enable WTF_USE_UIKIT_EDITING + + * wtf/Platform.h: + +2014-01-14 Daniel Bates + + [iOS] Enable QuickLook + https://bugs.webkit.org/show_bug.cgi?id=126954 + + Reviewed by David Kilzer. + + * wtf/Platform.h: + +2014-01-14 Anders Carlsson + + Get rid of ThreadRestrictionVerifier + https://bugs.webkit.org/show_bug.cgi?id=127004 + + Reviewed by Sam Weinig. + + The ThreadRestrictionVerifier mechanism has been turned off for a while + since it doesn't really have a good solution for objects that are passed between threads. + Instead of having dead code in the tree, just get rid of it. + + * GNUmakefile.list.am: + * WTF.vcxproj/WTF.vcxproj: + * WTF.vcxproj/WTF.vcxproj.filters: + * WTF.xcodeproj/project.pbxproj: + * wtf/CMakeLists.txt: + * wtf/RefCounted.h: + (WTF::RefCountedBase::ref): + (WTF::RefCountedBase::hasOneRef): + (WTF::RefCountedBase::refCount): + (WTF::RefCountedBase::derefBase): + * wtf/ThreadRestrictionVerifier.h: Removed. + +2014-01-14 Benjamin Poulain + + Enable the experimental selector code generator by default + https://bugs.webkit.org/show_bug.cgi?id=126953 + + Reviewed by Gavin Barraclough. + + * wtf/Platform.h: + Enable CSS_SELECTOR_JIT on OS X x86_64 by default. + The feature is not ready to ship but it is stable enough to enable + for the bots and nightly. + +2014-01-14 Brian J. Burg + + Add ENABLE(WEB_REPLAY) feature flag to the build system + https://bugs.webkit.org/show_bug.cgi?id=126949 + + Reviewed by Joseph Pecoraro. + + * wtf/FeatureDefines.h: for now, disable the flag by default. + +2014-01-14 peavo@outlook.com + + [Win] Application name in user agent string is truncated. + https://bugs.webkit.org/show_bug.cgi?id=126810 + + Reviewed by Anders Carlsson. + + * wtf/text/StringConcatenate.h: + (WTF::tryMakeString): Add missing 8 bit check for last argument. + +2014-01-13 Anders Carlsson + + Move another deprecated symbol to DeprecatedSymbolsUsedBySafari.mm + https://bugs.webkit.org/show_bug.cgi?id=126909 + + Reviewed by Ryosuke Niwa. + + * wtf/MainThread.cpp: + * wtf/MainThread.h: + * wtf/mac/DeprecatedSymbolsUsedBySafari.mm: + (WTF::callOnMainThread): + +2014-01-13 Anders Carlsson + + Fix Windows build. + + * wtf/ThreadingWin.cpp: + (WTF::initializeThreading): + +2014-01-13 Anders Carlsson + + Remove AtomicallyInitializedStatic + https://bugs.webkit.org/show_bug.cgi?id=126864 + + Reviewed by Andreas Kling. + + Remove the lockAtomicallyInitializedStaticMutex and unlockAtomicallyInitializedStaticMutex functions + everywhere except on Mac (where they unfortunately were used by Safari). + + On Mac, add them to a separate file which will hold functions and symbols that we would like + to remove but that are used by Safari. Reimplement them in terms of std::call_once and std::mutex. + + * WTF.xcodeproj/project.pbxproj: + * wtf/Threading.h: + * wtf/ThreadingPthreads.cpp: + (WTF::initializeThreading): + * wtf/ThreadingWin.cpp: + (WTF::initializeThreading): + * wtf/mac/DeprecatedSymbolsUsedBySafari.mm: Added. + (WTF::atomicallyInitializedStaticMutex): + (WTF::lockAtomicallyInitializedStaticMutex): + (WTF::unlockAtomicallyInitializedStaticMutex): + +2014-01-13 Commit Queue + + Unreviewed, rolling out r161855. + http://trac.webkit.org/changeset/161855 + https://bugs.webkit.org/show_bug.cgi?id=126880 + + Sister commit of r161852 (Requested by kling on #webkit). + + * wtf/ThreadingPthreads.cpp: + (WTF::initializeThreading): + +2014-01-13 Commit Queue + + Unreviewed, rolling out r161852. + http://trac.webkit.org/changeset/161852 + https://bugs.webkit.org/show_bug.cgi?id=126877 + + Broke ToT with system Safari (Requested by kling on #webkit). + + * wtf/Threading.h: + * wtf/ThreadingPthreads.cpp: + (WTF::initializeThreading): + (WTF::lockAtomicallyInitializedStaticMutex): + (WTF::unlockAtomicallyInitializedStaticMutex): + * wtf/ThreadingWin.cpp: + (WTF::lockAtomicallyInitializedStaticMutex): + (WTF::unlockAtomicallyInitializedStaticMutex): + (WTF::initializeThreading): + +2014-01-12 Commit Queue + + Unreviewed, rolling out r161840. + http://trac.webkit.org/changeset/161840 + https://bugs.webkit.org/show_bug.cgi?id=126870 + + Caused jsscore and layout test failures (Requested by smfr on + #webkit). + + * wtf/text/StringImpl.cpp: + (WTF::StringImpl::replace): + * wtf/text/WTFString.h: + (WTF::String::isAllSpecialCharacters): + +2014-01-12 Dan Bernstein + + Fix an assertion failure in initializeDates() when launching Safari, which was introduced in r161852. + + Reviewed by Andy Estes. + + * wtf/ThreadingPthreads.cpp: + (WTF::initializeThreading): Set isInitialized to true. + +2014-01-12 Darin Adler + + Add PLATFORM(COCOA) and USE(FOUNDATION) + https://bugs.webkit.org/show_bug.cgi?id=126859 + + Reviewed by Anders Carlsson. + + * wtf/Platform.h: Added PLATFORM(COCOA), which for now is set at exactly the same + times that PLATFORM(MAC) is. Added USE(FOUNDATION), which is set at the same times + that PLATFORM(COCOA) is. Re-organize the PLATFORM(MAC) and PLATFORM(IOS) settings + in the header so they are a bit easier to read. Put HAVE_LANGINFO_H in with the + rest of the OS(UNIX) settings and put HAVE_READLINE in with the rest of the + OS(DARWIN) settings. Tweak formatting a bit. + +2014-01-12 Anders Carlsson + + Remove AtomicallyInitializedStatic + https://bugs.webkit.org/show_bug.cgi?id=126864 + + Reviewed by Darin Adler. + + * wtf/Threading.h: + * wtf/ThreadingPthreads.cpp: + (WTF::initializeThreading): + * wtf/ThreadingWin.cpp: + (WTF::initializeThreading): + +2014-01-12 Darin Adler + + Add deprecatedCharacters as a synonym for characters and convert most call sites + https://bugs.webkit.org/show_bug.cgi?id=126858 + + Reviewed by Anders Carlsson. + + * wtf/text/AtomicString.cpp: + (WTF::HashAndUTF8CharactersTranslator::equal): + (WTF::SubstringTranslator::hash): + (WTF::SubstringTranslator::equal): + * wtf/text/AtomicString.h: + (WTF::AtomicString::characters): + * wtf/text/Base64.cpp: + (WTF::base64Decode): + (WTF::base64URLDecode): + * wtf/text/StringBuilder.h: + (WTF::StringBuilder::characters): + (WTF::StringBuilder::deprecatedCharacters): + * wtf/text/StringImpl.cpp: + (WTF::StringImpl::getData16SlowCase): + (WTF::StringImpl::upper): + (WTF::StringImpl::lower): + (WTF::StringImpl::find): + (WTF::StringImpl::findIgnoringCase): + * wtf/text/StringImpl.h: + (WTF::StringImpl::characters): + (WTF::StringImpl::deprecatedCharacters): + (WTF::StringImpl::getCharacters): + (WTF::equalIgnoringNullity): + * wtf/text/WTFString.cpp: + (WTF::String::append): + (WTF::String::appendInternal): + (WTF::String::insert): + (WTF::String::truncate): + (WTF::String::percentage): + * wtf/text/WTFString.h: + (WTF::String::characters): + (WTF::String::deprecatedCharacters): + (WTF::String::getCharactersWithUpconvert): + (WTF::append): + Use deprecatedCharacters instead of characters. + +2014-01-12 Anders Carlsson + + Remove the last remaining uses of AtomicallyInitializedStatic + https://bugs.webkit.org/show_bug.cgi?id=126863 + + Reviewed by Darin Adler. + + * wtf/HashTable.cpp: + (WTF::hashTableStatsMutex): + (WTF::HashTableStats::recordCollisionAtCount): + (WTF::HashTableStats::dumpStats): + * wtf/unicode/icu/CollatorICU.cpp: + (WTF::cachedCollatorMutex): + (WTF::Collator::createCollator): + (WTF::Collator::releaseCollator): + +2014-01-12 Darin Adler + + Reduce use of String::characters + https://bugs.webkit.org/show_bug.cgi?id=126854 + + Reviewed by Sam Weinig. + + * wtf/text/StringImpl.cpp: + (WTF::StringImpl::replace): Use characters16 here since is8Bit was already checked. + * wtf/text/WTFString.h: + (WTF::String::isAllSpecialCharacters): Use characters16 here since is8Bit was + already checked. Also renamed "len" to "length". + +2014-01-12 Anders Carlsson + + Replace more uses of AtomicallyInitializedStatic with std::call_once + https://bugs.webkit.org/show_bug.cgi?id=126847 + + Reviewed by Sam Weinig. + + * wtf/Forward.h: + Forward declare NeverDestroyed. + +2014-01-11 Zan Dobersek + + Unreviewed build fix for ports using GCC after r161770. + + * wtf/IteratorAdaptors.h: + (WTF::FilterIterator::operator*): Replicating r161797, the const qualifier for + FilterIterator::operator*() is removed since it clashes with some iterator types + that are also const, causing compilation failures with GCC. + +2014-01-11 Anders Carlsson + + Use std::call_once instead of AtomicallyInitializedStatic when creating a HTTP header set + https://bugs.webkit.org/show_bug.cgi?id=126837 + + Reviewed by Sam Weinig. + + * wtf/HashSet.h: + (WTF::HashSet::HashSet): + Add a HashSet constructor that takes an initializer list. + +2014-01-11 Sam Weinig + + Fix the EFL build. + + * wtf/IteratorAdaptors.h: + (WTF::TransformIterator::operator*): + +2014-01-11 Sam Weinig + + Add support for null StringViews + https://bugs.webkit.org/show_bug.cgi?id=126827 + + Reviewed by Anders Carlsson. + + - Do some style cleanup while in the neighborhood. + + * wtf/text/StringView.h: + (WTF::StringView::StringView): + Add default constructor to create a null StringView. + + (WTF::StringView::isNull): + Add isNull(), matching the semantics of String. + + (WTF::StringView::operator bool): + Add an explicit operator bool() to allow use in if-statements. + +2014-01-11 Sam Weinig + + Clean up iterator filter / iterator range code + https://bugs.webkit.org/show_bug.cgi?id=126817 + + Reviewed by Anders Carlsson. + + - Renames IteratorPair to IteratorRange. + - Splits FilterIterator into FilterIterator (which now only filters) and + TransformIterator (which does the transform part of the old FilterIterator). + Move both of these to IteratorAdaptors.h + + * GNUmakefile.list.am: + * WTF.vcxproj/WTF.vcxproj: + * WTF.vcxproj/WTF.vcxproj.filters: + * WTF.xcodeproj/project.pbxproj: + * wtf/CMakeLists.txt: + * wtf/FilterIterator.h: Removed. + Add/remove files. + + * wtf/HashMap.h: + (WTF::HashMap::keys): + (WTF::HashMap::values): + * wtf/RefPtrHashMap.h: + Update for rename to IteratorRange. Simplify by using makeIteratorRange(). + + * wtf/IteratorAdaptors.h: Copied from wtf/FilterIterator.h. + (WTF::FilterIterator::FilterIterator): + (WTF::FilterIterator::operator*): + (WTF::makeFilterIterator): + (WTF::TransformIterator::TransformIterator): + (WTF::TransformIterator::operator++): + (WTF::TransformIterator::operator*): + (WTF::TransformIterator::operator==): + (WTF::TransformIterator::operator!=): + (WTF::makeTransformIterator): + Split up filtering and transforming. Add makeFilterIterator() and makeTransformIterator() + helpers. + + * wtf/IteratorPair.h: Removed. + * wtf/IteratorRange.h: Copied from wtf/IteratorPair.h. + (WTF::IteratorRange::IteratorRange): + (WTF::makeIteratorRange): + Renamed to IteratorRange and adds makeIteratorRange() helper. + +2014-01-10 David Kilzer + + Clean up architectures in xcconfig files + + + Reviewed by Andy Estes. + + * Configurations/Base.xcconfig: + - Add new arch. + +2014-01-10 Tamas Gergely + + [EFL][JSC] Enable udis86 disassembler on efl. + https://bugs.webkit.org/show_bug.cgi?id=125502 + + Reviewed by Michael Saboff. + + Enable udis86 disassembler on efl and fix build warnings. + + * wtf/Platform.h: + Enable udis86 disassembler on EFL. + +2014-01-10 Hunseop Jeong + + [EFL] Enable the DFG_JIT on ARMv7 + https://bugs.webkit.org/show_bug.cgi?id=126742 + + Reviewed by Gyuyoung Kim. + + Turn on ENABLE_DFG_JIT on ARMv7 for EFL. + + * wtf/Platform.h: + +2014-01-07 Mark Hahnenberg + + Marking should be generational + https://bugs.webkit.org/show_bug.cgi?id=126552 + + Reviewed by Geoffrey Garen. + + * wtf/Bitmap.h: + (WTF::WordType>::count): Added a cast that became necessary when Bitmap + is used with smaller types than int32_t. + +2014-01-09 Simon Fraser + + Enable async scrolling for iOS + https://bugs.webkit.org/show_bug.cgi?id=126730 + + Reviewed by Tim Horton. + + Turn on ENABLE_ASYNC_SCROLLING for iOS. + + * wtf/FeatureDefines.h: + +2014-01-09 Anders Carlsson + + Remove Blackberry and QNX bits from WTF + https://bugs.webkit.org/show_bug.cgi?id=126726 + + Reviewed by Benjamin Poulain. + + * wtf/Assertions.cpp: + * wtf/Atomics.h: + * wtf/CurrentTime.cpp: + (WTF::currentCPUTime): + * wtf/DateMath.cpp: + * wtf/DisallowCType.h: + * wtf/FeatureDefines.h: + * wtf/InlineASM.h: + * wtf/MathExtras.h: + * wtf/NumberOfCores.cpp: + (WTF::numberOfProcessorCores): + * wtf/OSAllocatorPosix.cpp: + (WTF::OSAllocator::reserveUncommitted): + (WTF::OSAllocator::commit): + (WTF::OSAllocator::decommit): + * wtf/Platform.h: + * wtf/PlatformBlackBerry.cmake: Removed. + * wtf/RAMSize.cpp: + (WTF::computeRAMSize): + * wtf/StackBounds.cpp: + * wtf/ThreadingPthreads.cpp: + (WTF::initializeThreading): + (WTF::initializeCurrentThreadInternal): + * wtf/blackberry/MainThreadBlackBerry.cpp: Removed. + * wtf/blackberry/RunLoopBlackBerry.cpp: Removed. + * wtf/text/AtomicString.h: + * wtf/text/StringImpl.h: + * wtf/text/WTFString.h: + +2014-01-09 Daniel Bates + + [iOS] Upstream WebCore/platform changes + https://bugs.webkit.org/show_bug.cgi?id=126654 + + Rubber-stamped by David Kilzer. + + * wtf/MainThread.cpp: + (WTF::canAccessThreadLocalDataForThread): + * wtf/MainThread.h: + +2014-01-09 Commit Queue + + Unreviewed, rolling out r161540. + http://trac.webkit.org/changeset/161540 + https://bugs.webkit.org/show_bug.cgi?id=126704 + + Caused assertion failures on multiple tests (Requested by ap + on #webkit). + + * wtf/Bitmap.h: + (WTF::WordType>::count): + +2014-01-07 Mark Hahnenberg + + Marking should be generational + https://bugs.webkit.org/show_bug.cgi?id=126552 + + Reviewed by Geoffrey Garen. + + * wtf/Bitmap.h: + (WTF::WordType>::count): Added a cast that became necessary when Bitmap + is used with smaller types than int32_t. + +2014-01-08 Anders Carlsson + + Add WTF::StringView and use it for grammar checking + https://bugs.webkit.org/show_bug.cgi?id=126644 + + Reviewed by Antti Koivisto. + + Add a new StringView class which is an immutable reference to either an 8-bit or a 16-bit string. + + This makes it easier to pass substrings around without having to either copy string data + or upconvert and use UChar pointers. + + The StringView class is very loosely based on the std::string_view class which is proposed for a future version of C++, + see http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2013/n3609.html for more details. + + * GNUmakefile.list.am: + * WTF.vcxproj/WTF.vcxproj: + * WTF.vcxproj/WTF.vcxproj.filters: + * WTF.xcodeproj/project.pbxproj: + * wtf/CMakeLists.txt: + * wtf/Forward.h: + * wtf/text/StringView.h: Added. + (WTF::StringView::StringView): + (WTF::StringView::empty): + (WTF::StringView::characters8): + (WTF::StringView::characters16): + (WTF::StringView::isEmpty): + (WTF::StringView::length): + (WTF::StringView::is8Bit): + (WTF::StringView::substring): + (WTF::StringView::toString): + (WTF::StringView::toStringWithoutCopying): + (WTF::StringView::encodedCharacters): + +2014-01-07 David Farler + + [ASAN] Building with trunk clang corrupts sandbox profile with comment from Compiler.h + https://bugs.webkit.org/show_bug.cgi?id=124532 + + Reviewed by David Kilzer. + + * wtf/Compiler.h: + Remove this quirk - it does nothing. + +2014-01-06 Filip Pizlo + + Get rid of ENABLE(VALUE_PROFILER). It's on all the time now. + + Rubber stamped by Mark Hahnenberg. + + * wtf/Platform.h: + +2014-01-06 Zan Dobersek + + Remove using directives for the std namespace from WTF + https://bugs.webkit.org/show_bug.cgi?id=126524 + + Reviewed by Alexey Proskuryakov. + + Remove the using directives for the std namespace throughout the WTF code. + The more explicit std:: nested name specifier should be used instead. + + * wtf/MediaTime.cpp: + (WTF::MediaTime::createWithFloat): + (WTF::MediaTime::createWithDouble): + * wtf/text/StringImpl.cpp: + (WTF::StringImpl::create): + (WTF::StringImpl::lower): + (WTF::StringImpl::upper): + (WTF::StringImpl::foldCase): + (WTF::StringImpl::find): + (WTF::StringImpl::findIgnoringCase): + (WTF::reverseFindInner): + (WTF::StringImpl::reverseFind): + (WTF::reverseFindIgnoringCaseInner): + (WTF::StringImpl::reverseFindIgnoringCase): + (WTF::StringImpl::replace): + (WTF::StringImpl::utf8ForCharacters): + (WTF::StringImpl::utf8ForRange): + * wtf/text/WTFString.cpp: + (WTF::String::append): + (WTF::String::appendInternal): + (WTF::String::insert): + (WTF::String::substringSharingImpl): + (WTF::String::fromUTF8): + (WTF::toIntegralType): + * wtf/win/RunLoopWin.cpp: + +2014-01-03 Mark Hahnenberg + + DoublyLinkedLists can't be concatenated + https://bugs.webkit.org/show_bug.cgi?id=125976 + + Reviewed by Filip Pizlo. + + * wtf/DoublyLinkedList.h: + (WTF::DoublyLinkedList::append): + +2014-01-04 Zan Dobersek + + Explicitly use the std:: nested name specifier when using std::pair, std::make_pair + https://bugs.webkit.org/show_bug.cgi?id=126439 + + Reviewed by Andreas Kling. + + * wtf/VectorTraits.h: Stop bringing std::pair into the current scope. + +2014-01-02 Gavin Barraclough + + Refactor NSActivity handling code from ChildProcess to UserActivity + https://bugs.webkit.org/show_bug.cgi?id=126330 + + Reviewed by Sam Weinig. + + UserActivity is a mechanism to express to the operating system (where appropriate) + that a user initiated activity is taking place, and as such that resources should be + made available to the process accordingly. + + Currently we hold a single NSActivity, at the WebKit layer. This refactoring allows us + to hold different activity tokens for different user actions (which simplifies the + handling, and aides debugging since the token can more accurately express the activity + taking place), and also will allow us to avoid the layering difficulty of calling back + up the stack to WebKit to register that an activity is taking place. + + * wtf/Platform.h: + - added HAVE_NS_ACTIVITY. + +2013-12-30 Commit Queue + + Unreviewed, rolling out r161157, r161158, r161160, r161161, + r161163, and r161165. + http://trac.webkit.org/changeset/161157 + http://trac.webkit.org/changeset/161158 + http://trac.webkit.org/changeset/161160 + http://trac.webkit.org/changeset/161161 + http://trac.webkit.org/changeset/161163 + http://trac.webkit.org/changeset/161165 + https://bugs.webkit.org/show_bug.cgi?id=126332 + + Broke WebKit2 on Mountain Lion (Requested by ap on #webkit). + + * GNUmakefile.list.am: + * WTF.vcxproj/WTF.vcxproj: + * WTF.vcxproj/WTF.vcxproj.filters: + * WTF.xcodeproj/project.pbxproj: + * wtf/CMakeLists.txt: + * wtf/Forward.h: + * wtf/PlatformWin.cmake: + * wtf/threads/BinarySemaphore.cpp: Added. + (WTF::BinarySemaphore::BinarySemaphore): + (WTF::BinarySemaphore::~BinarySemaphore): + (WTF::BinarySemaphore::signal): + (WTF::BinarySemaphore::wait): + * wtf/threads/BinarySemaphore.h: Added. + (WTF::BinarySemaphore::event): + * wtf/threads/win/BinarySemaphoreWin.cpp: Added. + (WTF::BinarySemaphore::BinarySemaphore): + (WTF::BinarySemaphore::~BinarySemaphore): + (WTF::BinarySemaphore::signal): + (WTF::BinarySemaphore::wait): + +2013-12-30 Anders Carlsson + + Replace yield() and pauseBriefly() with std::this_thread::yield() + https://bugs.webkit.org/show_bug.cgi?id=126105 + + Reviewed by Sam Weinig. + + * wtf/ByteSpinLock.h: + (WTF::ByteSpinLock::lock): + * wtf/Threading.h: + * wtf/ThreadingPrimitives.h: + * wtf/ThreadingPthreads.cpp: + * wtf/ThreadingWin.cpp: + +2013-12-30 Sam Weinig + + Remove unnecessary non-const overload in IteratorPair + https://bugs.webkit.org/show_bug.cgi?id=126314 + + Reviewed by Anders Carlsson. + + * wtf/IteratorPair.h: + +2013-12-30 Sam Weinig + + Remove WTF's BinarySemaphore + https://bugs.webkit.org/show_bug.cgi?id=126310 + + Reviewed by Anders Carlsson. + + It's unused. Also remove the now empty wtf/threads directory. + + * GNUmakefile.list.am: + * WTF.vcxproj/WTF.vcxproj: + * WTF.vcxproj/WTF.vcxproj.filters: + * WTF.xcodeproj/project.pbxproj: + * wtf/CMakeLists.txt: + * wtf/Forward.h: + * wtf/PlatformWin.cmake: + * wtf/threads: Removed. + * wtf/threads/BinarySemaphore.cpp: Removed. + * wtf/threads/BinarySemaphore.h: Removed. + * wtf/threads/win: Removed. + * wtf/threads/win/BinarySemaphoreWin.cpp: Removed. + +2013-12-30 Roger Fong + + [Windows] Unreviewed build fix following r160959. + + * wtf/Platform.h: + +2013-12-30 Anders Carlsson + + Replace WTF::ThreadingOnce with std::call_once + https://bugs.webkit.org/show_bug.cgi?id=126215 + + Reviewed by Sam Weinig. + + * GNUmakefile.list.am: + * wtf/CompilationThread.cpp: + (WTF::initializeCompilationThreads): + * wtf/ThreadingOnce.h: Removed. + +2013-12-26 Sam Weinig + + Move FilterIterator and IteratorPair to WTF and reimplement HashMap::keys() and HashMap::values() using IteratorPair + https://bugs.webkit.org/show_bug.cgi?id=126253 + + Reviewed by Anders Carlsson. + + * GNUmakefile.list.am: + * WTF.vcxproj/WTF.vcxproj: + * WTF.vcxproj/WTF.vcxproj.filters: + * WTF.xcodeproj/project.pbxproj: + * wtf/CMakeLists.txt: + Add new files. + + * wtf/HashMap.h: + * wtf/RefPtrHashMap.h: + Remove the old implementation of keys() and values() and replace it with one + that uses IteratorPair. + + * wtf/FilterIterator.h: Copied from Source/WebKit2/Shared/FilterIterator.h. + * wtf/IteratorPair.h: Copied from Source/WebKit2/Shared/IteratorPair.h. + +2013-12-27 Daniel Bates + + [iOS] Upstream WebCore/page changes + https://bugs.webkit.org/show_bug.cgi?id=126180 + + Reviewed by Darin Adler. + + * wtf/FeatureDefines.h: Define ENABLE_IOS_TOUCH_EVENTS to be enabled by default + when building iOS with ENABLE(TOUCH_EVENTS). + +2013-12-25 Thiago de Barros Lacerda + + [Nix] Building with DRAG_SUPPORT enabled + https://bugs.webkit.org/show_bug.cgi?id=126233 + + Reviewed by Daniel Bates. + + * wtf/nix/FeatureDefinesNix.h: + +2013-12-24 Commit Queue + + Unreviewed, rolling out r160959. + http://trac.webkit.org/changeset/160959 + https://bugs.webkit.org/show_bug.cgi?id=126222 + + Caused Windows build to fail (Requested by rfong on #webkit). + + * wtf/ByteSpinLock.h: + (WTF::ByteSpinLock::lock): + * wtf/Threading.h: + * wtf/ThreadingPrimitives.h: + (WTF::pauseBriefly): + * wtf/ThreadingPthreads.cpp: + (WTF::yield): + * wtf/ThreadingWin.cpp: + (WTF::yield): + +2013-12-23 Benjamin Poulain + + Fix the build after r161031 + + I enabled ENABLE_CSS_SELECTOR_JIT by accident. + + * wtf/Platform.h: + +2013-12-23 Zan Dobersek + + [GTK] Clean up compiler optimizations flags for libWTF, libJSC + https://bugs.webkit.org/show_bug.cgi?id=126157 + + Reviewed by Gustavo Noronha Silva. + + * GNUmakefile.am: Remove the -fstrict-aliasing and -O3 compiler flags for libWTF.la. -O3 gets + overridden by -O2 that's listed in CXXFLAGS (or -O0 in case of debug builds) and -fstrict-aliasing + is enabled when -O2 is used (and shouldn't be enabled in debug builds anyway). + +2013-12-20 Anders Carlsson + + Replace yield() and pauseBriefly() with std::this_thread::yield() + https://bugs.webkit.org/show_bug.cgi?id=126105 + + Reviewed by Sam Weinig. + + * wtf/ByteSpinLock.h: + (WTF::ByteSpinLock::lock): + * wtf/Threading.h: + * wtf/ThreadingPrimitives.h: + * wtf/ThreadingPthreads.cpp: + * wtf/ThreadingWin.cpp: + +2013-12-20 Anders Carlsson + + Speed up case folding for 8-bit strings + https://bugs.webkit.org/show_bug.cgi?id=126098 + + Reviewed by Geoffrey Garen. + + Add a case folding lookup table for 8-bit strings and use it instead of calling down to u_foldCase. + On a simple microbenchmark using a lookup table is about 15x faster. + + * wtf/text/StringHash.h: + (WTF::CaseFoldingHash::foldCase): + * wtf/text/StringImpl.cpp: + (WTF::equalIgnoringCase): + * wtf/text/StringImpl.h: + +2013-12-20 Myles C. Maxfield + + Faster implementation of text-decoration-skip: ink + https://bugs.webkit.org/show_bug.cgi?id=125718 + + Reviewed by Simon Fraser. + + This creates a new preprocessor define, CSS3_TEXT_DECORATION_SKIP_INK, + which enables the use of the text-decoration-skip: ink CSS value. + Creating this new value simplifies the logic about when to enable the + codepath for this CSS value. + + * wtf/Platform.h: + +2013-12-20 Simon Fraser + + Change "threaded scrolling" terminology to "asynchronous scrolling" + https://bugs.webkit.org/show_bug.cgi?id=126094 + + Reviewed by Tim Horton. + + Rename ENABLE_THREADED_SCROLLING to ENABLE_ASYNC_SCROLLING. + + * wtf/FeatureDefines.h: + +2013-12-20 Tamas Gergely + + Build fails in debug mode after r160834. + https://bugs.webkit.org/show_bug.cgi?id=126059 + + Reviewed by Csaba Osztrogonác. + + Debug mode build failed due to comparing signed and unsigned in + ASSERT(). Now both values are unsigned. + + * wtf/dtoa/double-conversion.cc: + +2013-12-19 Alex Christensen + + Final preparations for GStreamer on Windows. + https://bugs.webkit.org/show_bug.cgi?id=125958 + + Reviewed by Benjamin Poulain. + + * WTF.vcxproj/WTFDebugWinCairo.props: + * WTF.vcxproj/WTFReleaseWinCairo.props: + Include WinCairo.props. + * wtf/Platform.h: + Use GLib and GStreamer on WinCairo with video. + +2013-12-18 Daniel Bates + + WTF, JavaScriptCore fails to build with trunk clang: operators new, new[], + delete, delete[] cannot be declared inline + https://bugs.webkit.org/show_bug.cgi?id=124186 + + + Reviewed by Geoffrey Garen and Anders Carlsson. + + Following + (http://llvm.org/bugs/show_bug.cgi?id=17591>), Clang emits warnings when + operator new, delete are inlined. Such definitions cannot be inline per + replacement.functions (17.6.4.6/3) of the C++ standard. For now, + disable these warnings instead of exporting these functions. + + * wtf/FastMalloc.h: + +2013-12-19 Hugo Parente Lima + + WTF fails to compile with gcc 4.8.2 and -Werror=array-bounds + https://bugs.webkit.org/show_bug.cgi?id=125936 + + Reviewed by Anders Carlsson. + + * wtf/dtoa/double-conversion.cc: Use a unsigned instead of int on buffer_pos type. + +2013-12-19 Peter Szanka + + Delete RVCT related code parts. + https://bugs.webkit.org/show_bug.cgi?id=125626 + + Reviewed by Csaba Osztrogonác. + + * wtf/Compiler.h: follow-up fix for r160648, remove an unnecessary comment. + +2013-12-18 Alex Christensen + + [WinCairo] Preparation for GStreamer on Windows. + https://bugs.webkit.org/show_bug.cgi?id=125946 + + Reviewed by Brent Fulgham. + + * WTF.vcxproj/WTF.vcxproj: + Use new GStreamer property sheets for WinCairo. + +2013-12-18 Mark Hahnenberg + + DFG should have a separate StoreBarrier node + https://bugs.webkit.org/show_bug.cgi?id=125530 + + Reviewed by Filip Pizlo. + + * wtf/Platform.h: Added an #define for ENABLE(GGC) which will be used for landing things related to GenGC. + +2013-12-16 Daniel Bates + + [iOS] Upstream WebCore/html changes + https://bugs.webkit.org/show_bug.cgi?id=125765 + + Reviewed by Darin Adler. + + Defined ENABLE_IOS_AUTOCORRECT_AND_AUTOCAPITALIZE, enabled by default on iOS. + + * wtf/FeatureDefines.h: + +2013-12-17 Alex Christensen + + Compile fix for WebGL on Windows without GRAPHICS_SURFACE. + https://bugs.webkit.org/show_bug.cgi?id=125867 + + Reviewed by Martin Robinson. + + * wtf/FeatureDefines.h: + Removed unused ENABLE_GLIB_SUPPORT macro. + * wtf/Platform.h: + Don't use GRAPHICS_SURFACE for WebGL on Windows. + +2013-12-17 Alex Christensen + + [Win] Fixed linker error with GStreamer. + https://bugs.webkit.org/show_bug.cgi?id=124861 + + Reviewed by Martin Robinson. + + * wtf/gobject/GOwnPtr.cpp: + (WTF::GError): + * wtf/gobject/GOwnPtr.h: + Added WTF_EXPORT_PRIVATE to freeOwnedGPtr declaration and definition. + +2013-12-17 Benjamin Poulain + + Add a simple register allocator to WebCore for x86_64 + https://bugs.webkit.org/show_bug.cgi?id=125771 + + Reviewed by Geoffrey Garen. + + * wtf/Platform.h: Add a new flag "CSS_SELECTOR_JIT" to guard + an experimental JIT compiler in WebCore. + +2013-12-16 Anders Carlsson + + Remove EnumClass.h from WTF + https://bugs.webkit.org/show_bug.cgi?id=125820 + + Reviewed by Darin Adler. + + All compilers we build on now support real strongly typed enums, so we can remove the ENUM_CLASS version. + + * WTF.vcxproj/WTF.vcxproj: + * WTF.vcxproj/WTF.vcxproj.filters: + * WTF.xcodeproj/project.pbxproj: + * wtf/CheckedArithmetic.h: + * wtf/EnumClass.h: Removed. + +2013-12-16 Brent Fulgham + + [Win] Remove dead code after conversion to VS2013 + https://bugs.webkit.org/show_bug.cgi?id=125795 + + Reviewed by Darin Adler. + + * wtf/Assertions.h: Include now that it exists. + * wtf/Compiler.h: Update compiler checks for VS2013, and + enable support for NEVER_INLINE + * wtf/HashFunctions.h: + (WTF::PtrHash::hash): Remove compiler workaround. + * wtf/MathExtras.h: Remove C99 functions that are now supplied + by the MS runtime library. + * wtf/Platform.h: Remove old MSVC support flags. + * wtf/StdLibExtras.h: Remove old MSVC workaround code. + +2013-12-16 Alex Christensen + + Fixed Win64 build on VS2013. + https://bugs.webkit.org/show_bug.cgi?id=125753 + + Reviewed by Brent Fulgham. + + * WTF.vcxproj/WTF.vcxproj: + Added correct PlatformToolset for 64-bit builds. + +2013-12-16 Peter Szanka + + Delete RVCT related code parts. + https://bugs.webkit.org/show_bug.cgi?id=125626 + + Reviewed by Darin Adler. + + * wtf/Assertions.h: + * wtf/Compiler.h: + * wtf/FastMalloc.h: + * wtf/Platform.h: + +2013-12-13 Brent Fulgham + + [Win] Remove Pre-VS2013 support code. + https://bugs.webkit.org/show_bug.cgi?id=125693 + + Reviewed by Darin Adler. + + * wtf/StringPrintStream.cpp: + (WTF::StringPrintStream::vprintf): Use va_copy, like a civilized person. + +2013-12-12 Darin Adler + + Incorrect handling of non-ASCII characters in WTF::base64DecodeInternal + https://bugs.webkit.org/show_bug.cgi?id=125658 + + Reviewed by Alexey Proskuryakov. + + * wtf/text/Base64.cpp: + (WTF::base64EncodeInternal): Use a reference to an array instead of a pointer + for the table argument type so we check the size of the array at the call site. + (WTF::base64DecodeInternal): Ditto. Also added an bounds check before using the + table so we don't load some random value for non-ASCII characters. + +2013-12-13 Brent Fulgham + + [Win] Unreviewed build fix after r160548 + + * WTF.vcxproj/WTFGenerated.vcxproj: Specify that we are using + the vs12_xp target for Makefile-based projects. + +2013-12-13 Anders Carlsson + + Require variadic templates to build WebKit + https://bugs.webkit.org/show_bug.cgi?id=125701 + + Reviewed by Andreas Kling. + + * wtf/Compiler.h: + Add an #error if variadic templates are disabled. + + * wtf/NeverDestroyed.h: + * wtf/PassRef.h: + * wtf/StdLibExtras.h: + Remove a bunch of COMPILER_SUPPORTS(CXX_VARIADIC_TEMPLATES) #ifdefs. + +2013-12-13 Peter Szanka + + Delete INTEL C compiler related code parts. + https://bugs.webkit.org/show_bug.cgi?id=125625 + + Reviewed by Darin Adler. + + * wtf/Assertions.h: + * wtf/Compiler.h: + +2013-12-13 Brent Fulgham + + [Win] Switch WebKit solution to Visual Studio 2013 + https://bugs.webkit.org/show_bug.cgi?id=125192 + + Reviewed by Anders Carlsson. + + * WTF.vcxproj/WTF.vcxproj: Update for VS2013 + * WTF.vcxproj/WTF.vcxproj.filters: Ditto + +2013-12-12 Brady Eidson + + DatabaseProcess IndexedDB: Establish a metadata backing store on disk + https://bugs.webkit.org/show_bug.cgi?id=125258 + + Reviewed by Alexey Proskuryakov, Anders Carlsson, and Tim Horton. + + * wtf/text/WTFString.h: Export toUInt64Strict(). + +2013-12-12 Sam Weinig + + Replace uses of WTF::BitArray with std::bitset + https://bugs.webkit.org/show_bug.cgi?id=125642 + + Reviewed by Anders Carlsson. + + * GNUmakefile.list.am: + * WTF.vcxproj/WTF.vcxproj: + * WTF.vcxproj/WTF.vcxproj.filters: + * WTF.xcodeproj/project.pbxproj: + * wtf/BitArray.h: Removed. + * wtf/CMakeLists.txt: + +2013-12-11 David Kilzer + + Define m_hasBadParent in InlineBox if defined(ADDRESS_SANITIZER) + + + Reviewed by Darin Adler. + + * wtf/Assertions.h: Define macro + ASSERT_WITH_SECURITY_IMPLICATION_DISABLED based on whether + ASSERT_WITH_SECURITY_IMPLICATION() is enabled. + +2013-12-11 Brendan Long + + Type punning error in MD5.cpp + https://bugs.webkit.org/show_bug.cgi?id=125412 + + Reviewed by Darin Adler. + + * wtf/MD5.cpp: + (WTF::toLittleEndian): Renamed, and use memcpy instead of casting. + (WTF::MD5::addBytes): Renamed reverseBytes to toLittleEndian. + (WTF::MD5::checksum): Same, and use memcpy instead of casting to prevent type punning error. + +2013-12-11 Laszlo Vidacs + + Store SHA1 hash in std::array + https://bugs.webkit.org/show_bug.cgi?id=125446 + + Reviewed by Darin Adler. + + Change Vector to std::array and use typedef. + + * wtf/SHA1.cpp: + (WTF::SHA1::computeHash): + (WTF::SHA1::hexDigest): + (WTF::SHA1::computeHexDigest): + * wtf/SHA1.h: + +2013-12-11 Oliver Hunt + + Give Unique StringImpls a meaningful data pointer + https://bugs.webkit.org/show_bug.cgi?id=125598 + + Reviewed by Michael Saboff. + + Found by code inspection. If there is a collision in an Identifier + table when comparing to a string literal we attempt to use the data + pointer (essentially this ends up being a null termination check). + + Previously unique pointers just used the literal 1 as the data address + but this obviously fails when dereferenced. Instead we now make the + data pointer point to the location of the buffer pointer itself. As + the buffer pointer is initialised to 0, this satisfies the requirement + that the 0-length unique string is null terminated. + + * wtf/text/StringImpl.h: + (WTF::StringImpl::StringImpl): + +2013-12-10 Anders Carlsson + + Add a HashMap constructor that takes an initializer list + https://bugs.webkit.org/show_bug.cgi?id=125551 + + Reviewed by Dan Bernstein. + + * wtf/HashMap.h: + (WTF::HashMap::HashMap): + +2013-12-10 Laszlo Vidacs + + Use std::array when computing MD5 checksum + https://bugs.webkit.org/show_bug.cgi?id=125509 + + Reviewed by Anders Carlsson. + + Added MD5::Digest type and MD5::hashSize for computing MD5 checksum. + + * wtf/MD5.cpp: + (WTF::MD5::checksum): + * wtf/MD5.h: + +2013-12-10 Martin Robinson + + Various fixes for the CMake GTK+ build + + Reviewed by Gustavo Noronha. + + * wtf/PlatformGTK.cmake: Add Zlib library to the WTF build. + +2013-12-09 Sam Weinig + + Remove FixedArray + https://bugs.webkit.org/show_bug.cgi?id=125478 + + Reviewed by Anders Carlsson. + + * GNUmakefile.list.am: + * WTF.vcxproj/WTF.vcxproj: + * WTF.vcxproj/WTF.vcxproj.filters: + * WTF.xcodeproj/project.pbxproj: + * wtf/CMakeLists.txt: + * wtf/FixedArray.h: Removed. + +2013-12-09 Sam Weinig + + Replace use of WTF::FixedArray with std::array + https://bugs.webkit.org/show_bug.cgi?id=125475 + + Reviewed by Anders Carlsson. + + * wtf/AVLTree.h: + * wtf/Bitmap.h: + * wtf/SixCharacterHash.cpp: + (WTF::integerToSixCharacterHashString): + * wtf/SixCharacterHash.h: + +2013-12-06 Roger Fong and Brent Fulgham + + [Win] Support compiling with VS2013 + https://bugs.webkit.org/show_bug.cgi?id=125353 + + Reviewed by Anders Carlsson. + + * wtf/Compiler.h: Show proper features for VS2012 and VS2013. + * wtf/MathExtras.h: Don't implement common C99 routines when + they are available through the runtime libraries. + * wtf/RetainPtr.h: + (WTF::RetainPtr::operator bool): Added. + * wtf/StdLibExtras.h: Use Microsoft's version of make_unique + when it exists. + +2013-12-06 Laszlo Vidacs + + Define SHA1 hash size in SHA1.h and use it at various places. + https://bugs.webkit.org/show_bug.cgi?id=125345 + + Reviewed by Darin Adler. + + Use SHA1::hashSize instead of local variables. + + * wtf/SHA1.h: define SHA1 hash size + +2013-12-05 Iain Lane + + Remove USE(LOCKFREE_THREADSAFEREFCOUNTED) from Atomics.cpp since it is + no longer defined. + https://bugs.webkit.org/show_bug.cgi?id=124502 + + Reviewed by Anders Carlsson. + + * wtf/Atomics.cpp: + +2013-12-04 Ryosuke Niwa + + Enable HTMLTemplateElement by default + https://bugs.webkit.org/show_bug.cgi?id=123851 + + Reviewed by Antti Koivisto. + + * wtf/FeatureDefines.h: + +2013-12-04 Dan Bernstein + + Replace USE(SECURITY_FRAMEWORK) with finer-grained defines + https://bugs.webkit.org/show_bug.cgi?id=125242 + + Reviewed by Sam Weinig. + + * wtf/Platform.h: Removed definitions of WTF_USE_SECURITY_FRAMEWORK, and defined + HAVE_SEC_IDENTITY and HAVE_SEC_KEYCHAIN. + +2013-12-03 Joseph Pecoraro + + Web Inspector: Push Remote Inspector debugging connection management into JavaScriptCore + https://bugs.webkit.org/show_bug.cgi?id=124613 + + Reviewed by Timothy Hatcher. + + * wtf/ios/WebCoreThread.cpp: + * wtf/ios/WebCoreThread.h: + Expose WebThreadRun/WebThreadRunSync iOS methods defined in WebCore through + WTF so that JavaScriptCore can use it. Another such method already existed. + +2013-12-03 Mark Lam + + testapi test crashes on Windows in WTF::Vector::size(). + https://bugs.webkit.org/show_bug.cgi?id=121972. + + Reviewed by Brent Fulgham. + + * wtf/OSAllocatorWin.cpp: + (WTF::OSAllocator::decommit): + (WTF::OSAllocator::releaseDecommitted): + - Added a check to ensure that the bytes to decommit / release is not 0. + On Windows, a 0 length passed to VirtualFree() has a special meaning, + and it's not "decommit / release nothing" as one would expect. Adding + this check makes OSAllocatorWin consistent with OSAllocatorPosix for + these 2 functions. + +2013-12-02 Mark Lam + + Build failure when disabling JIT, YARR_JIT, and ASSEMBLER. + https://bugs.webkit.org/show_bug.cgi?id=123809. + + Reviewed by Geoffrey Garen. + + * wtf/Platform.h: + - Ensure that the ASSEMBLER is enabled when the DISASSEMBLER is enabled. + +2013-11-30 peavo@outlook.com + + [Win] Some JavaScript date tests are failing. + https://bugs.webkit.org/show_bug.cgi?id=124946 + + Reviewed by Brent Fulgham. + + Use native Win32 api functions to compute Daylight saving time offset. + + * wtf/DateMath.cpp: + (WTF::UnixTimeToFileTime): Added method to calculate Win32 specific struct FILETIME from time_t value. + (WTF::calculateDSTOffset): Use native Win32 api functions to compute Daylight saving time offset. + +2013-11-28 Thiago de Barros Lacerda + + Nix Upstream: Updating Nix WTF files + https://bugs.webkit.org/show_bug.cgi?id=124980 + + Reviewed by Csaba Osztrogonác. + + Just to sync our private repo files and the trunk, as part of the upstream process. + + * wtf/DisallowCType.h: + * wtf/PlatformNix.cmake: + * wtf/nix/FeatureDefinesNix.h: + * wtf/nix/PlatformNix.h: + * wtf/nix/RunLoopNix.cpp: Added. + +2013-11-28 Antti Koivisto + + Remove feature: CSS variables + https://bugs.webkit.org/show_bug.cgi?id=114119 + + Reviewed by Andreas Kling. + + * wtf/FeatureDefines.h: + +2013-11-26 Filip Pizlo + + Do bytecode validation as part of testing + https://bugs.webkit.org/show_bug.cgi?id=124913 + + Reviewed by Oliver Hunt. + + * GNUmakefile.list.am: + * WTF.vcxproj/WTF.vcxproj: + * WTF.xcodeproj/project.pbxproj: + * wtf/CMakeLists.txt: + * wtf/FastBitVector.cpp: Added. + (WTF::FastBitVector::dump): + * wtf/FastBitVector.h: + (WTF::FastBitVector::resize): + (WTF::FastBitVector::bitCount): + (WTF::FastBitVector::arrayLength): + +2013-11-27 Tamas Gergely + + Remove Sparc specific code. + https://bugs.webkit.org/show_bug.cgi?id=124941 + + Reviewed by Michael Saboff. + + Sparc is not supported, remove leftover code. + + * wtf/Platform.h: + * wtf/dtoa/utils.h: + +2013-11-26 Marcelo Lira + + Nix upstreaming - Adding build files and supporting scripts + https://bugs.webkit.org/show_bug.cgi?id=118367 + + Reviewed by Ryosuke Niwa. + + * wtf/FeatureDefines.h: + * wtf/Platform.h: + * wtf/PlatformNix.cmake: Added. + +2013-11-26 Drew Yao + + ASSERT_WITH_SECURITY_IMPLICATION should crash in a distinct way. + https://bugs.webkit.org/show_bug.cgi?id=124757 + + Change ASSERT_WITH_SECURITY_IMPLICATION to access a different address from CRASH() + in order to help screen fuzzing bugs. + + Reviewed by Brent Fulgham. + + * wtf/Assertions.cpp: + * wtf/Assertions.h: + +2013-11-24 Tim Horton + + Upstream USE(IOSURFACE) from the iOS port + https://bugs.webkit.org/show_bug.cgi?id=124814 + + Reviewed by Sam Weinig. + + Some code guarded by USE(IOSURFACE) was recently upstreamed, + but not the definition of WTF_USE_IOSURFACE itself. + + * wtf/Platform.h: + +2013-11-23 Xabier Rodriguez Calvar + + [GStreamer] Remove 0.10 codepath + https://bugs.webkit.org/show_bug.cgi?id=124534 + + Reviewed by Philippe Normand. + + * wtf/Platform.h: Removed macro for GStreamer 1.0 as it is the + only codepath now. + +2013-11-21 Peter Molnar + + Remove ENABLE_WORKERS + https://bugs.webkit.org/show_bug.cgi?id=105784 + + Reviewed by Darin Adler. + + * wtf/FeatureDefines.h: + * wtf/nix/FeatureDefinesNix.h: + +2013-11-21 Mark Rowe + + Fix an error in a few Xcode configuration setting files. + + Reviewed by Alexey Proskuryakov. + + * Configurations/Base.xcconfig: + +2013-11-20 Mark Lam + + Introducing VMEntryScope to update the VM stack limit. + https://bugs.webkit.org/show_bug.cgi?id=124634. + + Reviewed by Geoffrey Garen. + + * wtf/Platform.h: + * wtf/StackBounds.h: + (WTF::StackBounds::StackBounds): + +2013-11-18 Filip Pizlo + + Allow the FTL debug dumps to include the new size field + https://bugs.webkit.org/show_bug.cgi?id=124479 + + Reviewed by Mark Hahnenberg. + + * wtf/PrintStream.cpp: + (WTF::printInternal): + * wtf/PrintStream.h: + +2013-11-17 Jer Noble + + [WTF] Media time should not have a constructor which accepts a single int or float. + https://bugs.webkit.org/show_bug.cgi?id=124470 + + Having a constructor taking a single number value, as it's very easy to accidentially mis- + initialize a MediaTime with a double (automatically casted to a int64_t). + + Reviewed by Eric Carlson. + + * wtf/MediaTime.h: + +2013-11-18 Csaba Osztrogonác + + URTBF after r159432 to make WinCairo build happy. + + * wtf/text/WTFString.h: + +2013-11-18 Carlos Garcia Campos + + Unreviewed. Fix make distcheck. + + * GNUmakefile.list.am: Add missing header file. + +2013-11-16 Alexey Proskuryakov + + Use uint8_t vectors for WebCrypto data + https://bugs.webkit.org/show_bug.cgi?id=124466 + + Reviewed by Sam Weinig. + + Binary data can be UTF-8, in which case "char*" is idiomatic, or it can be arbitrary + binary data, in which case "uint8_t*" is more common. + + Changed encode functions that took "const char *" to "const void*", and decode + functions that took "Vector&" now take an adapter class. + + The adapter relies on Vector and Vector classes having an identical layout. + + * wtf/text/Base64.cpp: + (WTF::base64Encode): + (WTF::base64URLEncode): + (WTF::base64DecodeInternal): + (WTF::base64Decode): + (WTF::base64URLDecode): + * wtf/text/Base64.h: + (WTF::SignedOrUnsignedCharVectorAdapter): + (WTF::ConstSignedOrUnsignedCharVectorAdapter): + (WTF::base64Encode): + (WTF::base64URLEncode): + +2013-11-15 Alexey Proskuryakov + + Support exporting symmetric keys as JWK + https://bugs.webkit.org/show_bug.cgi?id=124442 + + Reviewed by Sam Weinig. + + Base64URL encoding doesn't use '=' padding, and doesn't need any other options. + Added this mode for encode, and removed policy arguments from exposed functions. + + * wtf/text/Base64.cpp: + (WTF::base64EncodeInternal): + (WTF::base64URLEncode): + (WTF::base64URLDecode): + * wtf/text/Base64.h: + (WTF::base64URLEncode): + +2013-11-15 Mark Hahnenberg + + Remove VTableSpectrum + https://bugs.webkit.org/show_bug.cgi?id=124427 + + Reviewed by Filip Pizlo. + + * wtf/Platform.h: + +2013-11-15 Jer Noble + + MediaTime addition and subtraction operators have errors when the rhs is infinite. + https://bugs.webkit.org/show_bug.cgi?id=124413 + + Reviewed by Eric Carlson. + + Correctly account for infinities that can occur on the right-hand side of addition or + subtraction operators. + + * wtf/MediaTime.cpp: + (WTF::MediaTime::operator+): + (WTF::MediaTime::operator-): + +2013-11-14 Oliver Hunt + + Make CLoop easier to build, and make it work + https://bugs.webkit.org/show_bug.cgi?id=124359 + + Reviewed by Geoffrey Garen. + + Make building with the CLoop forcibly enabled manually + disable the JITs + + * wtf/Platform.h: + +2013-11-14 Andreas Kling + + FontDescription copies should share families list, not duplicate it. + + + Add RefCountedArray::operator==. + + Reviewed by Antti Koivisto. + +2013-11-13 Anders Carlsson + + Add a Vector constructor that takes an std::initializer_list + https://bugs.webkit.org/show_bug.cgi?id=124287 + + Reviewed by Antti Koivisto. + + * wtf/Compiler.h: + * wtf/Vector.h: + (WTF::Vector::Vector): + +2013-11-12 Brent Fulgham + + [Win] Unreviewed gardening. + + * WTF.vcxproj/WTF.vcxproj.filters: Tidy up filters so files show up + in their proper directories. + +2013-11-12 Alex Christensen + + Build GStreamer files on Windows. + https://bugs.webkit.org/show_bug.cgi?id=124180 + + Reviewed by Brent Fulgham. + + * WTF.vcxproj/WTF.vcxproj: + * WTF.vcxproj/WTF.vcxproj.filters: + * WTF.vcxproj/copy-files.cmd: + Include gobject files in WinCairo build. + +2013-11-09 Filip Pizlo + + Switch FTL GetById/PutById IC's over to using AnyRegCC + https://bugs.webkit.org/show_bug.cgi?id=124094 + + Reviewed by Sam Weinig. + + I needed to add another set operation, namely filter(), which is an in-place set + intersection. + + * wtf/BitVector.cpp: + (WTF::BitVector::filterSlow): + * wtf/BitVector.h: + (WTF::BitVector::filter): + +2013-11-10 Ryuan Choi + + [EFL] Build break on Ubuntu 13.10 + https://bugs.webkit.org/show_bug.cgi?id=124131 + + Reviewed by Gyuyoung Kim. + + Turned DisallowCType macros off on EFL port because gtest-internal.h uses isspace(). + + * wtf/DisallowCType.h: Added !PLATFORM(EFL) guard. + +2013-11-09 Patrick Gansterer + + Move RunLoop from WebCore to WTF + https://bugs.webkit.org/show_bug.cgi?id=116606 + + Reviewed by Anders Carlsson. + + With this change RunLoop can be used in JavaScriptCore too. + + * GNUmakefile.list.am: + * WTF.vcxproj/WTF.vcxproj: + * WTF.xcodeproj/project.pbxproj: + * wtf/CMakeLists.txt: + * wtf/PlatformBlackBerry.cmake: + * wtf/PlatformEfl.cmake: + * wtf/PlatformGTK.cmake: + * wtf/PlatformWin.cmake: + * wtf/RunLoop.cpp: Renamed from Source/WebCore/platform/RunLoop.cpp. + (WTF::RunLoop::Holder::Holder): + (WTF::RunLoop::Holder::runLoop): + (WTF::RunLoop::initializeMainRunLoop): + (WTF::RunLoop::current): + (WTF::RunLoop::main): + (WTF::RunLoop::isMain): + (WTF::RunLoop::performWork): + (WTF::RunLoop::dispatch): + * wtf/RunLoop.h: Renamed from Source/WebCore/platform/RunLoop.h. + (WTF::RunLoop::TimerBase::startRepeating): + (WTF::RunLoop::TimerBase::startOneShot): + (WTF::RunLoop::TimerBase::isRepeating): + (WTF::RunLoop::Timer::Timer): + (WTF::RunLoop::Timer::fired): + * wtf/blackberry/RunLoopBlackBerry.cpp: Renamed from Source/WebCore/platform/blackberry/RunLoopBlackBerry.cpp. + (WTF::RunLoop::RunLoop): + (WTF::RunLoop::~RunLoop): + (WTF::RunLoop::wakeUp): + * wtf/cf/RunLoopCF.cpp: Renamed from Source/WebCore/platform/cf/RunLoopCF.cpp. + (WTF::RunLoop::performWork): + (WTF::RunLoop::RunLoop): + (WTF::RunLoop::~RunLoop): + (WTF::RunLoop::runForDuration): + (WTF::RunLoop::wakeUp): + (WTF::RunLoop::run): + (WTF::RunLoop::stop): + (WTF::RunLoop::TimerBase::timerFired): + (WTF::RunLoop::TimerBase::TimerBase): + (WTF::RunLoop::TimerBase::~TimerBase): + (WTF::RunLoop::TimerBase::start): + (WTF::RunLoop::TimerBase::stop): + (WTF::RunLoop::TimerBase::isActive): + * wtf/efl/RunLoopEfl.cpp: Renamed from Source/WebCore/platform/efl/RunLoopEfl.cpp. + (WTF::RunLoop::RunLoop): + (WTF::RunLoop::~RunLoop): + (WTF::RunLoop::run): + (WTF::RunLoop::stop): + (WTF::RunLoop::wakeUpEvent): + (WTF::RunLoop::wakeUp): + (WTF::RunLoop::TimerBase::TimerBase): + (WTF::RunLoop::TimerBase::~TimerBase): + (WTF::RunLoop::TimerBase::timerFired): + (WTF::RunLoop::TimerBase::start): + (WTF::RunLoop::TimerBase::stop): + (WTF::RunLoop::TimerBase::isActive): + * wtf/gtk/RunLoopGtk.cpp: Renamed from Source/WebCore/platform/gtk/RunLoopGtk.cpp. + (WTF::RunLoop::RunLoop): + (WTF::RunLoop::~RunLoop): + (WTF::RunLoop::run): + (WTF::RunLoop::innermostLoop): + (WTF::RunLoop::pushNestedMainLoop): + (WTF::RunLoop::popNestedMainLoop): + (WTF::RunLoop::stop): + (WTF::RunLoop::queueWork): + (WTF::RunLoop::wakeUp): + (WTF::RunLoop::TimerBase::TimerBase): + (WTF::RunLoop::TimerBase::~TimerBase): + (WTF::RunLoop::TimerBase::clearTimerSource): + (WTF::RunLoop::TimerBase::timerFiredCallback): + (WTF::RunLoop::TimerBase::start): + (WTF::RunLoop::TimerBase::stop): + (WTF::RunLoop::TimerBase::isActive): + * wtf/win/RunLoopWin.cpp: Renamed from Source/WebCore/platform/win/RunLoopWin.cpp. + (WTF::RunLoop::RunLoopWndProc): + (WTF::RunLoop::wndProc): + (WTF::RunLoop::run): + (WTF::RunLoop::stop): + (WTF::RunLoop::registerRunLoopMessageWindowClass): + (WTF::RunLoop::RunLoop): + (WTF::RunLoop::~RunLoop): + (WTF::RunLoop::wakeUp): + (WTF::RunLoop::TimerBase::timerFired): + (WTF::generateTimerID): + (WTF::RunLoop::TimerBase::TimerBase): + (WTF::RunLoop::TimerBase::~TimerBase): + (WTF::RunLoop::TimerBase::start): + (WTF::RunLoop::TimerBase::stop): + (WTF::RunLoop::TimerBase::isActive): + +2013-11-08 Alexey Proskuryakov + + Make base64url decoding actually work + https://bugs.webkit.org/show_bug.cgi?id=124050 + + Reviewed by Sam Weinig. + + * wtf/text/Base64.cpp: (WTF::base64DecodeInternal): Don't hardcode knowledge about + alphabet, put it into the map. + +2013-11-07 Denis Nomiyama + + [GTK] Glyphs in vertical text tests are rotated 90 degrees clockwise + https://bugs.webkit.org/show_bug.cgi?id=50619 + + Reviewed by Martin Robinson. + + Enabled OPENTYPE_VERTICAL by default on GTK+ and EFL ports, which are + currently using Freetype. + + * wtf/Platform.h: + +2013-11-06 Daniel Bates + + [iOS] Upstream Letterpress effect + https://bugs.webkit.org/show_bug.cgi?id=123932 + + Reviewed by Sam Weinig. + + Add feature define ENABLE_LETTERPRESS disabled by default. We only enable + letterpress on iOS. + + * wtf/FeatureDefines.h: + +2013-11-06 Nick Diego Yamane + + Disable "unused local typedefs" warning for GCC 4.7 + https://bugs.webkit.org/show_bug.cgi?id=123913 + + Reviewed by Martin Robinson. + + That warning was actually introduced in gcc 4.7.0. + See: http://gcc.gnu.org/gcc-4.7/changes.html + + * wtf/Compiler.h: + +2013-11-06 Daniel Bates + + Add ENABLE(TEXT_SELECTION) + https://bugs.webkit.org/show_bug.cgi?id=123827 + + Reviewed by Ryosuke Niwa. + + Enable selection painting by default on all ports except iOS. + + * wtf/FeatureDefines.h: + +2013-11-04 Alexey Proskuryakov + + Implement base64url encoding from RFC 4648 + https://bugs.webkit.org/show_bug.cgi?id=123767 + + Reviewed by Sam Weinig. + + No tests yet, will be covered by JWK tests for WebCrypto. + + * wtf/text/Base64.cpp: + (WTF::base64EncodeInternal): + (WTF::base64Encode): + (WTF::base64URLEncode): + (WTF::base64DecodeInternal): + (WTF::base64Decode): + (WTF::base64URLDecode): + * wtf/text/Base64.h: + (WTF::base64URLEncode): + +2013-11-04 Brent Fulgham + + [Win] User VersionStamper for official builds + https://bugs.webkit.org/show_bug.cgi?id=123758 + + Reviewed by Tim Horton. + + * WTF.vcxproj/WTFPostBuild.cmd: Add missing command to run VersionStamper.exe. + +2013-11-01 Jer Noble + + [PluginProxy] Add a setting to disable video plugin proxy support in HTMLMediaElement. + https://bugs.webkit.org/show_bug.cgi?id=123621 + + Reviewed by Eric Carlson. + + Enable WTF_USE_AVFOUNDATION and add some HAVE_AVFOUNDATION_* defines + to replace the existing __MAC_OS_X_VERSION_MIN_REQUIRED macros in + MediaPlayerPrivateAVFoundationObjC.mm. + + * wtf/Platform.h: + +2013-11-02 Patrick Gansterer + + Fix compilation of DateMath.cpp with MSVC + https://bugs.webkit.org/show_bug.cgi?id=123680 + + Reviewed by Darin Adler. + + * wtf/DateMath.cpp: + (WTF::appendTwoDigitNumber): Help the compiler finding the + correct overload by casting the characters to LChar. + +2013-11-02 Filip Pizlo + + LLVM assertion failures should funnel into WTF's crash handling + https://bugs.webkit.org/show_bug.cgi?id=123682 + + Reviewed by Geoffrey Garen. + + Give JSC some new toys to play with for crash handling. + + * wtf/Assertions.cpp: + * wtf/Assertions.h: + +2013-11-02 Patrick Gansterer + + Fix UnicodeWchar after r157330. + https://bugs.webkit.org/show_bug.cgi?id=123668 + + Reviewed by Darin Adler. + + * wtf/unicode/wchar/UnicodeWchar.cpp: + (unorm_normalize): + (u_strFoldCase): + (u_strToLower): + (u_strToUpper): + * wtf/unicode/wchar/UnicodeWchar.h: + (u_foldCase): + (u_isprint): + (u_isspace): + +2013-11-02 Andreas Kling + + Make remaining StringImpl functions return PassRef. + + + Okay, this seems to work well! Let's go all in and convert the + remaining StringImpl functions to return PassRef instead + of PassRefPtr where we know that null is never returned. + + Reviewed by Anders Carlsson. + +2013-11-02 Andreas Kling + + StringImpl::upper() should return PassRef. + + + Make upper() return PassRef. Spotted and removed some + ref churning in implementations. + + Reviewed by Darin Adler. + +2013-11-01 Alexey Proskuryakov + + Add WebCrypto AES-CBC + https://bugs.webkit.org/show_bug.cgi?id=123647 + + Reviewed by Anders Carlsson. + + * wtf/FixedArray.h: (WTF::FixedArray::data): Added a const version of the function. + + * wtf/Vector.h: Added a comment to Vector constructor about how it is different + from std::vector. + +2013-11-01 Joseph Pecoraro + + Unreviewed extended attempt at Windows build fix after r158471. + + * wtf/text/cf/AtomicStringCF.cpp: + * wtf/text/cf/StringCF.cpp: + * wtf/text/cf/StringImplCF.cpp: + +2013-11-01 Joseph Pecoraro + + Unreviewed attempt at Windows build fix after r158471. + + * wtf/text/cf/AtomicStringCF.cpp: + * wtf/text/cf/StringCF.cpp: + * wtf/text/cf/StringImplCF.cpp: + +2013-11-01 Andreas Kling + + Make more StringImpl construction helpers return PassRef. + + + Tweak another handful of StringImpl constructor functions to return + PassRef instead of PassRefPtr. + + Reviewed by Anders Carlsson. + +2013-11-01 Andreas Kling + + Neuter WTF_MAKE_FAST_ALLOCATED in GLOBAL_FASTMALLOC_NEW builds. + + + When building with GLOBAL_FASTMALLOC_NEW, we don't need to expand + operator new/delete overrides in every class. + + This change makes allocations group up nicely in Instruments, + instead of being split between "WTF::fastMalloc" and "operator new" + depending on whether the class had WTF_MAKE_FAST_ALLOCATED. + + Reviewed by Anders Carlsson. + +2013-11-01 Joseph Pecoraro + + Move CF/Mac WTF String implementations down into WTF + https://bugs.webkit.org/show_bug.cgi?id=123635 + + Reviewed by Sam Weinig. + + * WTF.vcxproj/WTF.vcxproj: + * WTF.vcxproj/WTF.vcxproj.filters: + * WTF.xcodeproj/project.pbxproj: + * wtf/text/AtomicString.h: + * wtf/text/StringImpl.h: + * wtf/text/WTFString.h: + * wtf/text/cf/AtomicStringCF.cpp: Renamed from Source/WebCore/platform/text/cf/AtomicStringCF.cpp. + (WTF::AtomicString::add): + * wtf/text/cf/StringCF.cpp: Renamed from Source/WebCore/platform/text/cf/StringCF.cpp. + (WTF::String::String): + (WTF::String::createCFString): + * wtf/text/cf/StringImplCF.cpp: Renamed from Source/WebCore/platform/text/cf/StringImplCF.cpp. + (garbageCollectionEnabled): + (WTF::StringWrapperCFAllocator::retain): + (WTF::StringWrapperCFAllocator::release): + (WTF::StringWrapperCFAllocator::copyDescription): + (WTF::StringWrapperCFAllocator::allocate): + (WTF::StringWrapperCFAllocator::reallocate): + (WTF::StringWrapperCFAllocator::deallocateOnMainThread): + (WTF::StringWrapperCFAllocator::deallocate): + (WTF::StringWrapperCFAllocator::preferredSize): + (WTF::StringWrapperCFAllocator::create): + (WTF::StringWrapperCFAllocator::allocator): + (WTF::StringImpl::createCFString): + * wtf/text/mac/StringImplMac.mm: Renamed from Source/WebCore/platform/text/mac/StringImplMac.mm. + (WTF::StringImpl::operator NSString *): + * wtf/text/mac/StringMac.mm: Renamed from Source/WebCore/platform/text/mac/StringMac.mm. + (WTF::String::String): + +2013-11-01 Emilio Pozuelo Monfort + + HPPA build fixes + https://bugs.webkit.org/show_bug.cgi?id=123625 + + Original patch from John David Anglin + + Reviewed by Darin Adler. + + * wtf/Platform.h: + * wtf/dtoa/utils.h: + +2013-11-01 Patrick Gansterer + + Buildfix for !USE(ICU_UNICODE) after 156968. + + * wtf/unicode/CollatorDefault.cpp: + (WTF::Collator::userDefault): + +2013-10-30 Oliver Hunt + + Implement basic ES6 Math functions + https://bugs.webkit.org/show_bug.cgi?id=123536 + + Reviewed by Michael Saboff. + + Add basic implementations of necessary methods to MathExtras to + deal with MSVC not supplying them + + * wtf/MathExtras.h: + (asinh): + (acosh): + (atanh): + (expm1): + (log1p): + (cbrt): + +2013-10-30 Commit Queue + + Unreviewed, rolling out r158299. + http://trac.webkit.org/changeset/158299 + https://bugs.webkit.org/show_bug.cgi?id=123558 + + caused assertion failures in fast/canvas/canvas-color- + serialization.html and fast/forms/input-text-paste- + maxlength.html (Requested by rniwa on #webkit). + + * wtf/text/StringStatics.cpp: + (WTF::StringImpl::empty): + +2013-10-30 Ryosuke Niwa + + Remove code for Mac Lion + https://bugs.webkit.org/show_bug.cgi?id=123542 + + Reviewed by Anders Carlsson. + + * wtf/Platform.h: + 2013-10-30 Peter Molnar Remove PCRE workaround. diff --git a/WTF/Configurations/Base.xcconfig b/WTF/Configurations/Base.xcconfig index 30192b0a..5e8a78b8 100644 --- a/WTF/Configurations/Base.xcconfig +++ b/WTF/Configurations/Base.xcconfig @@ -42,10 +42,7 @@ GCC_ENABLE_OBJC_EXCEPTIONS = YES; GCC_ENABLE_OBJC_GC = $(GCC_ENABLE_OBJC_GC_$(PLATFORM_NAME)); GCC_ENABLE_OBJC_GC_iphoneos = NO; GCC_ENABLE_OBJC_GC_iphonesimulator = NO; -GCC_ENABLE_OBJC_GC_macosx = $(GCC_ENABLE_OBJC_GC_macosx_$(MAC_OS_X_VERSION_MAJOR)); -GCC_ENABLE_OBJC_GC_macosx_1080 = supported; -GCC_ENABLE_OBJC_GC_macosx_1090 = supported; -GCC_ENABLE_OBJC_GC_macosx_101000 = NO; +GCC_ENABLE_OBJC_GC_macosx = supported; GCC_ENABLE_SYMBOL_SEPARATION = NO; GCC_FAST_OBJC_DISPATCH = YES; GCC_GENERATE_DEBUGGING_SYMBOLS = YES; @@ -63,6 +60,7 @@ GCC_VERSION = com.apple.compilers.llvm.clang.1_0; GCC_WARN_64_TO_32_BIT_CONVERSION = $(GCC_WARN_64_TO_32_BIT_CONVERSION_$(CURRENT_ARCH)); GCC_WARN_64_TO_32_BIT_CONVERSION_ = YES; GCC_WARN_64_TO_32_BIT_CONVERSION_armv7 = YES; +GCC_WARN_64_TO_32_BIT_CONVERSION_armv7k = YES; GCC_WARN_64_TO_32_BIT_CONVERSION_armv7s = YES; GCC_WARN_64_TO_32_BIT_CONVERSION_arm64 = NO; GCC_WARN_64_TO_32_BIT_CONVERSION_i386 = YES; diff --git a/WTF/GNUmakefile.am b/WTF/GNUmakefile.am index f211a56e..f3af82df 100644 --- a/WTF/GNUmakefile.am +++ b/WTF/GNUmakefile.am @@ -29,8 +29,6 @@ libWTF_la_CXXFLAGS = \ $(libWTF_la_CFLAGS) libWTF_la_CFLAGS = \ - -fstrict-aliasing \ - -O3 \ $(global_cflags) \ $(GLIB_CFLAGS) \ $(UNICODE_CFLAGS) diff --git a/WTF/GNUmakefile.list.am b/WTF/GNUmakefile.list.am index 270ebb4f..f876ddf2 100644 --- a/WTF/GNUmakefile.list.am +++ b/WTF/GNUmakefile.list.am @@ -10,7 +10,6 @@ wtf_sources += \ Source/WTF/wtf/AutodrainedPool.h \ Source/WTF/wtf/Bag.h \ Source/WTF/wtf/BagToHashMap.h \ - Source/WTF/wtf/BitArray.h \ Source/WTF/wtf/BitVector.cpp \ Source/WTF/wtf/BitVector.h \ Source/WTF/wtf/Bitmap.h \ @@ -46,15 +45,14 @@ wtf_sources += \ Source/WTF/wtf/DynamicAnnotations.cpp \ Source/WTF/wtf/DynamicAnnotations.h \ Source/WTF/wtf/Encoder.h \ - Source/WTF/wtf/EnumClass.h \ Source/WTF/wtf/ExportMacros.h \ + Source/WTF/wtf/FastBitVector.cpp \ Source/WTF/wtf/FastBitVector.h \ Source/WTF/wtf/FastMalloc.cpp \ Source/WTF/wtf/FastMalloc.h \ Source/WTF/wtf/FeatureDefines.h \ Source/WTF/wtf/FilePrintStream.cpp \ Source/WTF/wtf/FilePrintStream.h \ - Source/WTF/wtf/FixedArray.h \ Source/WTF/wtf/FlipBytes.h \ Source/WTF/wtf/Forward.h \ Source/WTF/wtf/FunctionDispatcher.cpp \ @@ -74,6 +72,8 @@ wtf_sources += \ Source/WTF/wtf/HexNumber.h \ Source/WTF/wtf/InlineASM.h \ Source/WTF/wtf/Insertion.h \ + Source/WTF/wtf/IteratorAdaptors.h \ + Source/WTF/wtf/IteratorRange.h \ Source/WTF/wtf/ListDump.h \ Source/WTF/wtf/ListHashSet.h \ Source/WTF/wtf/Locker.h \ @@ -137,6 +137,8 @@ wtf_sources += \ Source/WTF/wtf/RefPtr.h \ Source/WTF/wtf/RefPtrHashMap.h \ Source/WTF/wtf/RetainPtr.h \ + Source/WTF/wtf/RunLoop.cpp \ + Source/WTF/wtf/RunLoop.h \ Source/WTF/wtf/SHA1.cpp \ Source/WTF/wtf/SHA1.h \ Source/WTF/wtf/SaturatedArithmetic.h \ @@ -155,9 +157,9 @@ wtf_sources += \ Source/WTF/wtf/StreamBuffer.h \ Source/WTF/wtf/StringExtras.h \ Source/WTF/wtf/StringHashDumpContext.h \ + Source/WTF/wtf/StringHasher.h \ Source/WTF/wtf/StringPrintStream.cpp \ Source/WTF/wtf/StringPrintStream.h \ - Source/WTF/wtf/StringHasher.h \ Source/WTF/wtf/TCPackedCache.h \ Source/WTF/wtf/TCPageMap.h \ Source/WTF/wtf/TCSpinLock.h \ @@ -167,7 +169,6 @@ wtf_sources += \ Source/WTF/wtf/ThreadFunctionInvocation.h \ Source/WTF/wtf/ThreadIdentifierDataPthreads.cpp \ Source/WTF/wtf/ThreadIdentifierDataPthreads.h \ - Source/WTF/wtf/ThreadRestrictionVerifier.h \ Source/WTF/wtf/ThreadSafeRefCounted.h \ Source/WTF/wtf/ThreadSpecific.h \ Source/WTF/wtf/ThreadSpecificWin.cpp \ @@ -216,6 +217,7 @@ wtf_sources += \ Source/WTF/wtf/gobject/GlibUtilities.cpp \ Source/WTF/wtf/gobject/GlibUtilities.h \ Source/WTF/wtf/gtk/MainThreadGtk.cpp \ + Source/WTF/wtf/gtk/RunLoopGtk.cpp \ Source/WTF/wtf/text/ASCIIFastPath.h \ Source/WTF/wtf/text/AtomicString.cpp \ Source/WTF/wtf/text/AtomicString.h \ @@ -238,6 +240,7 @@ wtf_sources += \ Source/WTF/wtf/text/StringImpl.h \ Source/WTF/wtf/text/StringOperators.h \ Source/WTF/wtf/text/StringStatics.cpp \ + Source/WTF/wtf/text/StringView.h \ Source/WTF/wtf/text/TextPosition.h \ Source/WTF/wtf/text/WTFString.cpp \ Source/WTF/wtf/text/WTFString.h \ diff --git a/WTF/WTF.vcxproj/WTF.vcxproj b/WTF/WTF.vcxproj/WTF.vcxproj index c1db399b..b5ce14f4 100644 --- a/WTF/WTF.vcxproj/WTF.vcxproj +++ b/WTF/WTF.vcxproj/WTF.vcxproj @@ -1,725 +1,786 @@ - - - - - DebugSuffix - Win32 - - - DebugSuffix - x64 - - - Debug_WinCairo - Win32 - - - Debug_WinCairo - x64 - - - Debug - Win32 - - - Debug - x64 - - - Production - Win32 - - - Production - x64 - - - Release_WinCairo - Win32 - - - Release_WinCairo - x64 - - - Release - Win32 - - - Release - x64 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - {f7366596-0520-4433-b8ff-d843e31e5199} - - - - {8EF73779-BED3-45BB-816D-9FF58399AFA5} - Win32Proj - WTFvcproj - WTF - - - - DynamicLibrary - true - Unicode - - - DynamicLibrary - true - Unicode - - - DynamicLibrary - true - Unicode - - - DynamicLibrary - true - Unicode - - - DynamicLibrary - true - Unicode - - - DynamicLibrary - true - Unicode - - - DynamicLibrary - false - Unicode - - - DynamicLibrary - false - Unicode - - - DynamicLibrary - false - Unicode - - - DynamicLibrary - false - Unicode - - - DynamicLibrary - false - Unicode - - - DynamicLibrary - false - Unicode - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - WIN32;_LIB;%(PreprocessorDefinitions) - - - Windows - true - - - - $(OutDir)\$(ProjectName).lib - - - - - - - - - - - - - - - - - - $(OutDir)\$(TargetName).bsc - - - - - - - - - - - - - WIN32;_LIB;%(PreprocessorDefinitions) - - - Windows - true - - - - $(OutDir)\$(ProjectName).lib - - - - - - - - - - - - - - - - - - $(OutDir)\$(TargetName).bsc - - - - - - - - - - - - - WIN32;_LIB;%(PreprocessorDefinitions) - - - Windows - true - - - - $(OutDir)\$(ProjectName).lib - - - - - - - - - - - - - - - - - - $(OutDir)\$(TargetName).bsc - - - - - - - - - - - - - WIN32;_LIB;%(PreprocessorDefinitions) - - - Windows - true - - - - $(OutDir)\$(ProjectName).lib - - - - - - - - - - - - - - - - - - $(OutDir)\$(TargetName).bsc - - - - - - - - - - - - - WIN32;_LIB;%(PreprocessorDefinitions) - - - Windows - true - - - - - - - - - - - - - - - - - - - - $(OutDir)\$(TargetName).bsc - - - - - - - - - - - - - WIN32;_LIB;%(PreprocessorDefinitions) - - - Windows - true - - - - - - - - - - - - - - - - - - - - $(OutDir)\$(TargetName).bsc - - - - - - - - - - - Windows - true - true - true - - - - - - - - - - - Windows - true - true - true - - - - - - - - - - - Windows - true - true - true - - - - - - - - - - - Windows - true - true - true - - - - - - - - - - - Windows - true - true - true - - - - - - - - - - - Windows - true - true - true - - - - - - + + + + + DebugSuffix + Win32 + + + DebugSuffix + x64 + + + Debug_WinCairo + Win32 + + + Debug_WinCairo + x64 + + + Debug + Win32 + + + Debug + x64 + + + Production + Win32 + + + Production + x64 + + + Release_WinCairo + Win32 + + + Release_WinCairo + x64 + + + Release + Win32 + + + Release + x64 + + + + + + + + + + + + + + + + + + + + + + + + + + + + true + true + true + true + true + true + true + true + + + true + true + true + true + true + true + true + true + + + true + true + true + true + true + true + true + true + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + {f7366596-0520-4433-b8ff-d843e31e5199} + + + + {8EF73779-BED3-45BB-816D-9FF58399AFA5} + Win32Proj + WTFvcproj + WTF + + + + DynamicLibrary + true + Unicode + v120_xp + + + DynamicLibrary + true + Unicode + v120 + + + DynamicLibrary + true + Unicode + v120_xp + + + DynamicLibrary + true + Unicode + v120_xp + + + DynamicLibrary + true + Unicode + v120_xp + + + DynamicLibrary + true + Unicode + v120 + + + DynamicLibrary + false + Unicode + v120_xp + + + DynamicLibrary + false + Unicode + v120 + + + DynamicLibrary + false + Unicode + v120_xp + + + DynamicLibrary + false + Unicode + v120_xp + + + DynamicLibrary + false + Unicode + v120_xp + + + DynamicLibrary + false + Unicode + v120 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + WIN32;_LIB;%(PreprocessorDefinitions) + + + Windows + true + + + + $(OutDir)\$(ProjectName).lib + + + + + + + + + + + + + + + + + + $(OutDir)\$(TargetName).bsc + + + + + + + + + + + + + WIN32;_LIB;%(PreprocessorDefinitions) + + + Windows + true + + + + $(OutDir)\$(ProjectName).lib + + + + + + + + + + + + + + + + + + $(OutDir)\$(TargetName).bsc + + + + + + + + + + + + + WIN32;_LIB;%(PreprocessorDefinitions) + + + Windows + true + + + + $(OutDir)\$(ProjectName).lib + + + + + + + + + + + + + + + + + + $(OutDir)\$(TargetName).bsc + + + + + + + + + + + + + WIN32;_LIB;%(PreprocessorDefinitions) + + + Windows + true + + + + $(OutDir)\$(ProjectName).lib + + + + + + + + + + + + + + + + + + $(OutDir)\$(TargetName).bsc + + + + + + + + + + + + + WIN32;_LIB;%(PreprocessorDefinitions) + + + Windows + true + + + + + + + + + + + + + + + + + + + + $(OutDir)\$(TargetName).bsc + + + + + + + + + + + + + WIN32;_LIB;%(PreprocessorDefinitions) + + + Windows + true + + + + + + + + + + + + + + + + + + + + $(OutDir)\$(TargetName).bsc + + + + + + + + + + + Windows + true + true + true + + + + + + + + + + + Windows + true + true + true + + + + + + + + + + + Windows + true + true + true + + + + + + + + + + + Windows + true + true + true + + + + + + + + + + + Windows + true + true + true + + + + + + + + + + + Windows + true + true + true + + + + + + \ No newline at end of file diff --git a/WTF/WTF.vcxproj/WTF.vcxproj.filters b/WTF/WTF.vcxproj/WTF.vcxproj.filters index cffa4ef9..2284ac28 100644 --- a/WTF/WTF.vcxproj/WTF.vcxproj.filters +++ b/WTF/WTF.vcxproj/WTF.vcxproj.filters @@ -1,674 +1,723 @@ - - - - - {b7d787cb-2b2b-4898-8d03-b94115e596d1} - - - {eaa36939-1976-495f-b9ed-90074ee4f2be} - - - {c59a3c5d-6352-441c-acf9-9bbe1957a0f8} - - - {5c8eb2f2-873f-4915-869c-d4713c7adca0} - - - {978a0e93-7937-4a85-9fd1-76319fbd9d78} - - - {d9afa800-d0b4-4284-a99d-334a5ce3d252} - - - {805e00d3-198a-44a5-8c0c-849ce6ca3252} - - - {da29baba-10a2-4a74-ab87-2fea5e1382da} - - - - - dtoa - - - dtoa - - - dtoa - - - dtoa - - - dtoa - - - dtoa - - - dtoa - - - dtoa - - - dtoa - - - text - - - text - - - text - - - text - - - text - - - text - - - text - - - win - - - threads\win - - - threads - - - wtf - - - wtf\unicode\icu - - - wtf\unicode - - - wtf - - - wtf - - - wtf - - - wtf - - - wtf - - - wtf - - - wtf - - - wtf - - - wtf - - - wtf - - - wtf - - - wtf - - - wtf - - - wtf - - - wtf - - - wtf - - - wtf - - - wtf - - - wtf - - - wtf - - - wtf - - - wtf - - - wtf - - - wtf - - - wtf - - - wtf - - - wtf - - - wtf - - - wtf - - - wtf - - - wtf - - - wtf - - - wtf - - - wtf - - - wtf - - - wtf - - - text - - - wtf - - - wtf - - - wtf - - - - - dtoa - - - dtoa - - - dtoa - - - dtoa - - - dtoa - - - dtoa - - - dtoa - - - dtoa - - - dtoa - - - dtoa - - - dtoa - - - text - - - text - - - text - - - text - - - text - - - text - - - text - - - text - - - text - - - text - - - text - - - text - - - text - - - text - - - text - - - threads - - - wtf - - - wtf - - - wtf\unicode\icu - - - wtf\unicode - - - wtf\unicode - - - wtf\unicode - - - wtf\unicode - - - wtf\unicode - - - wtf - - - wtf - - - wtf - - - wtf - - - wtf - - - wtf - - - wtf - - - wtf - - - wtf - - - wtf - - - wtf - - - wtf - - - wtf - - - wtf - - - wtf - - - wtf - - - wtf - - - wtf - - - wtf - - - wtf - - - wtf - - - wtf - - - wtf - - - wtf - - - wtf - - - wtf - - - wtf - - - wtf - - - wtf - - - wtf - - - wtf - - - wtf - - - wtf - - - wtf - - - wtf - - - wtf - - - wtf - - - wtf - - - wtf - - - wtf - - - wtf - - - wtf - - - wtf - - - wtf - - - wtf - - - wtf - - - wtf - - - wtf - - - wtf - - - wtf - - - wtf - - - wtf - - - wtf - - - wtf - - - wtf - - - wtf - - - wtf - - - wtf - - - wtf - - - wtf - - - wtf - - - wtf - - - wtf - - - wtf - - - wtf - - - wtf - - - wtf - - - wtf - - - wtf - - - wtf - - - wtf - - - wtf - - - wtf - - - wtf - - - wtf - - - wtf - - - wtf - - - wtf - - - wtf - - - wtf - - - wtf - - - wtf - - - wtf - - - wtf - - - wtf - - - wtf - - - wtf - - - wtf - - - wtf - - - wtf - - - wtf - - - wtf - - - wtf - - - wtf - - - wtf - - - wtf - - - wtf - - - wtf - - - wtf - - - wtf - - - wtf - - - wtf - - - wtf - - - wtf - - - wtf - - - wtf - - - wtf - - - - wtf - - - wtf - - - wtf - - - wtf - - - wtf - - - wtf - - - wtf - - - win - - - - - - - + + + + + {b7d787cb-2b2b-4898-8d03-b94115e596d1} + + + {eaa36939-1976-495f-b9ed-90074ee4f2be} + + + {c59a3c5d-6352-441c-acf9-9bbe1957a0f8} + + + {5c8eb2f2-873f-4915-869c-d4713c7adca0} + + + {978a0e93-7937-4a85-9fd1-76319fbd9d78} + + + {d9afa800-d0b4-4284-a99d-334a5ce3d252} + + + {805e00d3-198a-44a5-8c0c-849ce6ca3252} + + + {da29baba-10a2-4a74-ab87-2fea5e1382da} + + + {edd6ccc8-e6ee-41ec-a58d-9404a30c0c7e} + + + + + dtoa + + + dtoa + + + dtoa + + + dtoa + + + dtoa + + + dtoa + + + dtoa + + + dtoa + + + dtoa + + + text + + + text + + + text + + + text + + + text + + + text + + + text + + + text + + + text + + + win + + + threads\win + + + threads + + + wtf + + + wtf\unicode\icu + + + wtf\unicode + + + wtf + + + wtf + + + wtf + + + wtf + + + wtf + + + wtf + + + wtf + + + wtf + + + wtf + + + wtf + + + wtf + + + wtf + + + wtf + + + wtf + + + wtf + + + wtf + + + wtf + + + wtf + + + wtf + + + wtf + + + wtf + + + wtf + + + wtf + + + wtf + + + wtf + + + wtf + + + wtf + + + wtf + + + wtf + + + wtf + + + wtf + + + wtf + + + wtf + + + wtf + + + wtf + + + wtf + + + text + + + wtf + + + wtf + + + wtf + + + wtf\gobject + + + wtf\gobject + + + wtf\gobject + + + wtf + + + win + + + text + + + + + + dtoa + + + dtoa + + + dtoa + + + dtoa + + + dtoa + + + dtoa + + + dtoa + + + dtoa + + + dtoa + + + dtoa + + + dtoa + + + text + + + text + + + text + + + text + + + text + + + text + + + text + + + text + + + text + + + text + + + text + + + text + + + text + + + text + + + wtf + + + text + + + threads + + + wtf + + + wtf + + + wtf\unicode\icu + + + wtf\unicode + + + wtf\unicode + + + wtf\unicode + + + wtf\unicode + + + wtf\unicode + + + wtf + + + wtf + + + wtf + + + wtf + + + wtf + + + wtf + + + wtf + + + wtf + + + wtf + + + wtf + + + wtf + + + wtf + + + wtf + + + wtf + + + wtf + + + wtf + + + wtf + + + wtf + + + wtf + + + wtf + + + wtf + + + wtf + + + wtf + + + wtf + + + wtf + + + wtf + + + wtf + + + wtf + + + wtf + + + wtf + + + wtf + + + wtf + + + wtf + + + wtf + + + wtf + + + wtf + + + wtf + + + wtf + + + wtf + + + wtf + + + wtf + + + wtf + + + wtf + + + wtf + + + wtf + + + wtf + + + wtf + + + wtf + + + wtf + + + wtf + + + wtf + + + wtf + + + wtf + + + wtf + + + wtf + + + wtf + + + wtf + + + wtf + + + wtf + + + wtf + + + wtf + + + wtf + + + wtf + + + wtf + + + wtf + + + wtf + + + wtf + + + wtf + + + wtf + + + wtf + + + wtf + + + wtf + + + wtf + + + wtf + + + wtf + + + wtf + + + wtf + + + wtf + + + wtf + + + wtf + + + wtf + + + wtf + + + wtf + + + wtf + + + wtf + + + wtf + + + wtf + + + wtf + + + wtf + + + wtf + + + wtf + + + wtf + + + wtf + + + wtf + + + wtf + + + wtf + + + wtf + + + wtf + + + wtf + + + wtf + + + wtf + + + wtf + + + wtf + + + wtf + + + wtf + + + + wtf + + + wtf + + + wtf + + + wtf + + + wtf + + + wtf + + + wtf + + + win + + + wtf\gobject + + + wtf\gobject + + + wtf\gobject + + + wtf\gobject + + + wtf\gobject + + + wtf + + + wtf + + + wtf + + + + + + + \ No newline at end of file diff --git a/WTF/WTF.vcxproj/WTFCFLite.props b/WTF/WTF.vcxproj/WTFCFLite.props index 8b3e18bf..d2cb6019 100644 --- a/WTF/WTF.vcxproj/WTFCFLite.props +++ b/WTF/WTF.vcxproj/WTFCFLite.props @@ -1,12 +1,12 @@ - - - - <_ProjectFileVersion>10.0.40219.1 - <_PropertySheetDisplayName>WebKitCFLite - - - - CFLite.lib;%(AdditionalDependencies) - - - + + + + <_ProjectFileVersion>10.0.40219.1 + <_PropertySheetDisplayName>WebKitCFLite + + + + CFLite.lib;%(AdditionalDependencies) + + + diff --git a/WTF/WTF.vcxproj/WTFCommon.props b/WTF/WTF.vcxproj/WTFCommon.props index 15e5d042..83fb820d 100644 --- a/WTF/WTF.vcxproj/WTFCommon.props +++ b/WTF/WTF.vcxproj/WTFCommon.props @@ -1,29 +1,29 @@ - - - - - - - - ../;../wtf/;../wtf/threads/;../wtf/unicode/;$(ConfigurationBuildDir)\include\private;$(ConfigurationBuildDir)\include\JavaScriptCore;$(WebKit_Libraries)\include\private;$(WebKit_Libraries)\include;$(WebKit_Libraries)\include\zlib;%(AdditionalIncludeDirectories) - _CRT_SECURE_NO_WARNINGS;__STD_C;_LIB;%(PreprocessorDefinitions) - ICUVersion.h;%(ForcedIncludeFiles) - %(DisableSpecificWarnings) - - - - - user32.lib;%(AdditionalDependencies) - $(OutDir)\$(ProjectName).lib - false - true - Windows - - - $(OutDir)\$(TargetName).bsc - - - winmm.lib;libicuuc$(DebugSuffix).lib;libicuin$(DebugSuffix).lib;zdll$(DebugSuffix).lib;%(AdditionalDependencies) - - + + + + + + + + ../;../wtf/;../wtf/threads/;../wtf/unicode/;$(ConfigurationBuildDir)\include\private;$(ConfigurationBuildDir)\include\JavaScriptCore;$(WebKit_Libraries)\include\private;$(WebKit_Libraries)\include;$(WebKit_Libraries)\include\zlib;%(AdditionalIncludeDirectories) + _CRT_SECURE_NO_WARNINGS;__STD_C;_LIB;%(PreprocessorDefinitions) + ICUVersion.h;%(ForcedIncludeFiles) + %(DisableSpecificWarnings) + + + + + user32.lib;%(AdditionalDependencies) + $(OutDir)\$(ProjectName).lib + false + true + Windows + + + $(OutDir)\$(TargetName).bsc + + + winmm.lib;libicuuc$(DebugSuffix).lib;libicuin$(DebugSuffix).lib;zdll$(DebugSuffix).lib;%(AdditionalDependencies) + + \ No newline at end of file diff --git a/WTF/WTF.vcxproj/WTFCoreFoundation.props b/WTF/WTF.vcxproj/WTFCoreFoundation.props index 019533d6..6335f2b1 100644 --- a/WTF/WTF.vcxproj/WTFCoreFoundation.props +++ b/WTF/WTF.vcxproj/WTFCoreFoundation.props @@ -1,10 +1,10 @@ - - - - - - - CoreFoundation$(DebugSuffix).lib;%(AdditionalDependencies) - - - + + + + + + + CoreFoundation$(DebugSuffix).lib;%(AdditionalDependencies) + + + diff --git a/WTF/WTF.vcxproj/WTFDebug.props b/WTF/WTF.vcxproj/WTFDebug.props index 6b9ed025..3255b164 100644 --- a/WTF/WTF.vcxproj/WTFDebug.props +++ b/WTF/WTF.vcxproj/WTFDebug.props @@ -1,15 +1,15 @@ - - - - - - - - - - - - - - + + + + + + + + + + + + + + \ No newline at end of file diff --git a/WTF/WTF.vcxproj/WTFDebugWinCairo.props b/WTF/WTF.vcxproj/WTFDebugWinCairo.props index ba2dd94e..98196441 100644 --- a/WTF/WTF.vcxproj/WTFDebugWinCairo.props +++ b/WTF/WTF.vcxproj/WTFDebugWinCairo.props @@ -1,15 +1,16 @@ - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/WTF/WTF.vcxproj/WTFGenerated.vcxproj b/WTF/WTF.vcxproj/WTFGenerated.vcxproj index b5490069..f59a253e 100644 --- a/WTF/WTF.vcxproj/WTFGenerated.vcxproj +++ b/WTF/WTF.vcxproj/WTFGenerated.vcxproj @@ -1,241 +1,253 @@ - - - - - DebugSuffix - Win32 - - - DebugSuffix - x64 - - - Debug_WinCairo - Win32 - - - Debug_WinCairo - x64 - - - Debug - Win32 - - - Debug - x64 - - - Production - Win32 - - - Production - x64 - - - Release_WinCairo - Win32 - - - Release_WinCairo - x64 - - - Release - Win32 - - - Release - x64 - - - - - - - - - - {F7366596-0520-4433-B8FF-D843E31E5199} - MakeFileProj - - - - Makefile - true - - - Makefile - true - - - Makefile - true - - - Makefile - true - - - Makefile - true - - - Makefile - true - - - Makefile - false - - - Makefile - false - - - Makefile - false - - - Makefile - false - - - Makefile - false - - - Makefile - false - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file + + + + + DebugSuffix + Win32 + + + DebugSuffix + x64 + + + Debug_WinCairo + Win32 + + + Debug_WinCairo + x64 + + + Debug + Win32 + + + Debug + x64 + + + Production + Win32 + + + Production + x64 + + + Release_WinCairo + Win32 + + + Release_WinCairo + x64 + + + Release + Win32 + + + Release + x64 + + + + + + + + + + {F7366596-0520-4433-B8FF-D843E31E5199} + MakeFileProj + + + + Makefile + true + v120_xp + + + Makefile + true + v120 + + + Makefile + true + v120_xp + + + Makefile + true + v120_xp + + + Makefile + true + v120_xp + + + Makefile + true + v120 + + + Makefile + false + v120_xp + + + Makefile + false + v120 + + + Makefile + false + v120_xp + + + Makefile + false + v120_xp + + + Makefile + false + v120_xp + + + Makefile + false + v120 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/WTF/WTF.vcxproj/WTFGenerated.vcxproj.filters b/WTF/WTF.vcxproj/WTFGenerated.vcxproj.filters index d901ea5d..bfaf74c4 100644 --- a/WTF/WTF.vcxproj/WTFGenerated.vcxproj.filters +++ b/WTF/WTF.vcxproj/WTFGenerated.vcxproj.filters @@ -1,9 +1,9 @@ - - - - - - - - + + + + + + + + \ No newline at end of file diff --git a/WTF/WTF.vcxproj/WTFGeneratedCommon.props b/WTF/WTF.vcxproj/WTFGeneratedCommon.props index 5baab696..139cc1b7 100644 --- a/WTF/WTF.vcxproj/WTFGeneratedCommon.props +++ b/WTF/WTF.vcxproj/WTFGeneratedCommon.props @@ -1,22 +1,22 @@ - - - - - 32 - - - - - - $(ConfigurationBuildDir)\lib$(PlatformArchitecture)\ - - - - - - - $(PLATFORMARCHITECTURE) - true - - + + + + + 32 + + + + + + $(ConfigurationBuildDir)\lib$(PlatformArchitecture)\ + + + + + + + $(PLATFORMARCHITECTURE) + true + + \ No newline at end of file diff --git a/WTF/WTF.vcxproj/WTFGeneratedDebug.props b/WTF/WTF.vcxproj/WTFGeneratedDebug.props index ffff17d1..ec9d570a 100644 --- a/WTF/WTF.vcxproj/WTFGeneratedDebug.props +++ b/WTF/WTF.vcxproj/WTFGeneratedDebug.props @@ -1,13 +1,13 @@ - - - - - - - - - - - - + + + + + + + + + + + + \ No newline at end of file diff --git a/WTF/WTF.vcxproj/WTFGeneratedProduction.props b/WTF/WTF.vcxproj/WTFGeneratedProduction.props index 3430017d..7b1fc518 100644 --- a/WTF/WTF.vcxproj/WTFGeneratedProduction.props +++ b/WTF/WTF.vcxproj/WTFGeneratedProduction.props @@ -1,13 +1,13 @@ - - - - - - - - - - - - + + + + + + + + + + + + \ No newline at end of file diff --git a/WTF/WTF.vcxproj/WTFGeneratedRelease.props b/WTF/WTF.vcxproj/WTFGeneratedRelease.props index 95f2a13a..3317437d 100644 --- a/WTF/WTF.vcxproj/WTFGeneratedRelease.props +++ b/WTF/WTF.vcxproj/WTFGeneratedRelease.props @@ -1,12 +1,12 @@ - - - - - - - - - - - + + + + + + + + + + + \ No newline at end of file diff --git a/WTF/WTF.vcxproj/WTFPostBuild.cmd b/WTF/WTF.vcxproj/WTFPostBuild.cmd index 26707cac..7cb75352 100644 --- a/WTF/WTF.vcxproj/WTFPostBuild.cmd +++ b/WTF/WTF.vcxproj/WTFPostBuild.cmd @@ -1 +1,2 @@ if exist "%CONFIGURATIONBUILDDIR%\buildfailed" del "%CONFIGURATIONBUILDDIR%\buildfailed" +if exist "%WEBKIT_LIBRARIES%\tools\VersionStamper\VersionStamper.exe" "%WEBKIT_LIBRARIES%\tools\VersionStamper\VersionStamper.exe" --verbose "%TARGETPATH%" \ No newline at end of file diff --git a/WTF/WTF.vcxproj/WTFProduction.props b/WTF/WTF.vcxproj/WTFProduction.props index 770693dd..65e829c4 100644 --- a/WTF/WTF.vcxproj/WTFProduction.props +++ b/WTF/WTF.vcxproj/WTFProduction.props @@ -1,14 +1,14 @@ - - - - - - - - - - - - - + + + + + + + + + + + + + \ No newline at end of file diff --git a/WTF/WTF.vcxproj/WTFRelease.props b/WTF/WTF.vcxproj/WTFRelease.props index 2fe05f98..0491423e 100644 --- a/WTF/WTF.vcxproj/WTFRelease.props +++ b/WTF/WTF.vcxproj/WTFRelease.props @@ -1,14 +1,14 @@ - - - - - - - - - - - - - + + + + + + + + + + + + + \ No newline at end of file diff --git a/WTF/WTF.vcxproj/WTFReleaseWinCairo.props b/WTF/WTF.vcxproj/WTFReleaseWinCairo.props index 71dc69c8..c5b996fe 100644 --- a/WTF/WTF.vcxproj/WTFReleaseWinCairo.props +++ b/WTF/WTF.vcxproj/WTFReleaseWinCairo.props @@ -1,14 +1,15 @@ - - - - - - - - - - - - - - + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/WTF/WTF.vcxproj/copy-files.cmd b/WTF/WTF.vcxproj/copy-files.cmd index e0b4d2d2..bad73fce 100755 --- a/WTF/WTF.vcxproj/copy-files.cmd +++ b/WTF/WTF.vcxproj/copy-files.cmd @@ -11,6 +11,7 @@ if "%1" EQU "rebuild" call :clean for %%d in ( wtf wtf\dtoa + wtf\gobject wtf\text wtf\threads wtf\unicode diff --git a/WTF/WTF.xcodeproj/project.pbxproj b/WTF/WTF.xcodeproj/project.pbxproj index 24a76bae..8063eba5 100644 --- a/WTF/WTF.xcodeproj/project.pbxproj +++ b/WTF/WTF.xcodeproj/project.pbxproj @@ -18,18 +18,6 @@ name = "Copy WTF Headers"; productName = "Copy WTF Headers"; }; - B64797511829123B00CCF60F /* Combine iOS libs */ = { - isa = PBXAggregateTarget; - buildConfigurationList = B64797521829123B00CCF60F /* Build configuration list for PBXAggregateTarget "Combine iOS libs" */; - buildPhases = ( - B64797591829135600CCF60F /* ShellScript */, - ); - dependencies = ( - B64797571829124500CCF60F /* PBXTargetDependency */, - ); - name = "Combine iOS libs"; - productName = "Combine iOS libs"; - }; /* End PBXAggregateTarget section */ /* Begin PBXBuildFile section */ @@ -37,6 +25,7 @@ 0F2B66A617B6B4FB00A7AE3F /* DeferrableRefCounted.h in Headers */ = {isa = PBXBuildFile; fileRef = 0F2B66A417B6B4F700A7AE3F /* DeferrableRefCounted.h */; }; 0F2B66A717B6B4FD00A7AE3F /* FlipBytes.h in Headers */ = {isa = PBXBuildFile; fileRef = 0F2B66A517B6B4F700A7AE3F /* FlipBytes.h */; }; 0F87105A16643F190090B0AD /* RawPointer.h in Headers */ = {isa = PBXBuildFile; fileRef = 0F87105916643F190090B0AD /* RawPointer.h */; }; + 0F885E0F1845AEA900F1E3FA /* FastBitVector.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 0F885E0E1845AE9F00F1E3FA /* FastBitVector.cpp */; }; 0F8F2B91172E00FC007DBDA5 /* CompilationThread.h in Headers */ = {isa = PBXBuildFile; fileRef = 0F8F2B90172E00F0007DBDA5 /* CompilationThread.h */; }; 0F8F2B92172E0103007DBDA5 /* CompilationThread.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 0F8F2B8F172E00F0007DBDA5 /* CompilationThread.cpp */; }; 0F8F2B9C172F2596007DBDA5 /* ConversionMode.h in Headers */ = {isa = PBXBuildFile; fileRef = 0F8F2B9B172F2594007DBDA5 /* ConversionMode.h */; }; @@ -66,14 +55,19 @@ 1A1D8B9E1731879800141DA4 /* FunctionDispatcher.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A1D8B9D1731879800141DA4 /* FunctionDispatcher.cpp */; }; 1A233C7D17DAA6E300A93ACF /* MallocPtr.h in Headers */ = {isa = PBXBuildFile; fileRef = 1A233C7C17DAA6E300A93ACF /* MallocPtr.h */; }; 1A6BB769162F300500DD16DB /* StreamBuffer.h in Headers */ = {isa = PBXBuildFile; fileRef = 1A6BB768162F300500DD16DB /* StreamBuffer.h */; }; + 1A6EB1E0187D0BD30030126F /* StringView.h in Headers */ = {isa = PBXBuildFile; fileRef = 1A6EB1DF187D0BD30030126F /* StringView.h */; }; + 1ACADD841884480100D8B71D /* DeprecatedSymbolsUsedBySafari.mm in Sources */ = {isa = PBXBuildFile; fileRef = 1ACADD821884480100D8B71D /* DeprecatedSymbolsUsedBySafari.mm */; }; 1FA47C8A152502DA00568D1B /* WebCoreThread.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1FA47C88152502DA00568D1B /* WebCoreThread.cpp */; }; 1FA47C8B152502DA00568D1B /* WebCoreThread.h in Headers */ = {isa = PBXBuildFile; fileRef = 1FA47C89152502DA00568D1B /* WebCoreThread.h */; }; 26147B0A15DDCCDC00DDB907 /* IntegerToStringConversion.h in Headers */ = {isa = PBXBuildFile; fileRef = 26147B0815DDCCDC00DDB907 /* IntegerToStringConversion.h */; }; 26299B6E17A9E5B800ADEBE5 /* Ref.h in Headers */ = {isa = PBXBuildFile; fileRef = 26299B6D17A9E5B800ADEBE5 /* Ref.h */; }; 2C05385415BC819000F21B96 /* GregorianDateTime.h in Headers */ = {isa = PBXBuildFile; fileRef = 2C05385315BC819000F21B96 /* GregorianDateTime.h */; }; 2CCD892A15C0390200285083 /* GregorianDateTime.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 2CCD892915C0390200285083 /* GregorianDateTime.cpp */; }; - 44F66008171AFAE600E4AD19 /* EnumClass.h in Headers */ = {isa = PBXBuildFile; fileRef = 44F66007171AFAA900E4AD19 /* EnumClass.h */; }; - 4F0321BC156AA8D1006EBAF6 /* BitArray.h in Headers */ = {isa = PBXBuildFile; fileRef = 4F0321BB156AA8D1006EBAF6 /* BitArray.h */; }; + 2CDED0EF18115C38004DBA70 /* RunLoopCF.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 2CDED0EE18115C38004DBA70 /* RunLoopCF.cpp */; }; + 2CDED0F318115C85004DBA70 /* RunLoop.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 2CDED0F118115C85004DBA70 /* RunLoop.cpp */; }; + 2CDED0F418115C85004DBA70 /* RunLoop.h in Headers */ = {isa = PBXBuildFile; fileRef = 2CDED0F218115C85004DBA70 /* RunLoop.h */; }; + 7CDD7FF8186D291E007433CD /* IteratorAdaptors.h in Headers */ = {isa = PBXBuildFile; fileRef = 7CDD7FF7186D291E007433CD /* IteratorAdaptors.h */; }; + 7CDD7FFA186D2A54007433CD /* IteratorRange.h in Headers */ = {isa = PBXBuildFile; fileRef = 7CDD7FF9186D2A54007433CD /* IteratorRange.h */; }; 7E29C33E15FFD79B00516D61 /* ObjcRuntimeExtras.h in Headers */ = {isa = PBXBuildFile; fileRef = 7E29C33D15FFD79B00516D61 /* ObjcRuntimeExtras.h */; }; 8134013815B092FD001FF0B8 /* Base64.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 8134013615B092FD001FF0B8 /* Base64.cpp */; }; 8134013915B092FD001FF0B8 /* Base64.h in Headers */ = {isa = PBXBuildFile; fileRef = 8134013715B092FD001FF0B8 /* Base64.h */; }; @@ -81,6 +75,11 @@ 974CFC8E16A4F327006D5404 /* WeakPtr.h in Headers */ = {isa = PBXBuildFile; fileRef = 974CFC8D16A4F327006D5404 /* WeakPtr.h */; }; 9BC70F05176C379D00101DEC /* AtomicStringTable.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 9BC70F04176C379D00101DEC /* AtomicStringTable.cpp */; }; 9BD8F40B176C2B470002D865 /* AtomicStringTable.h in Headers */ = {isa = PBXBuildFile; fileRef = 9BD8F40A176C2AD80002D865 /* AtomicStringTable.h */; }; + A5BA15F3182433A900A82E69 /* StringMac.mm in Sources */ = {isa = PBXBuildFile; fileRef = A5BA15F2182433A900A82E69 /* StringMac.mm */; }; + A5BA15F51824348000A82E69 /* StringImplMac.mm in Sources */ = {isa = PBXBuildFile; fileRef = A5BA15F41824348000A82E69 /* StringImplMac.mm */; }; + A5BA15FA182435A600A82E69 /* AtomicStringCF.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A5BA15F7182435A600A82E69 /* AtomicStringCF.cpp */; }; + A5BA15FB182435A600A82E69 /* StringCF.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A5BA15F8182435A600A82E69 /* StringCF.cpp */; }; + A5BA15FC182435A600A82E69 /* StringImplCF.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A5BA15F9182435A600A82E69 /* StringImplCF.cpp */; }; A70DA0841799F04D00529A9B /* Insertion.h in Headers */ = {isa = PBXBuildFile; fileRef = A70DA0821799F04D00529A9B /* Insertion.h */; }; A70DA0851799F04D00529A9B /* ListDump.h in Headers */ = {isa = PBXBuildFile; fileRef = A70DA0831799F04D00529A9B /* ListDump.h */; }; A748745217A0BDAE00FA04CB /* SixCharacterHash.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A748744F17A0BDAE00FA04CB /* SixCharacterHash.cpp */; }; @@ -144,7 +143,6 @@ A8A473C1151A825B004123FF /* ExportMacros.h in Headers */ = {isa = PBXBuildFile; fileRef = A8A4729F151A825A004123FF /* ExportMacros.h */; }; A8A473C3151A825B004123FF /* FastMalloc.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A8A472A1151A825A004123FF /* FastMalloc.cpp */; }; A8A473C4151A825B004123FF /* FastMalloc.h in Headers */ = {isa = PBXBuildFile; fileRef = A8A472A2151A825A004123FF /* FastMalloc.h */; }; - A8A473C5151A825B004123FF /* FixedArray.h in Headers */ = {isa = PBXBuildFile; fileRef = A8A472A3151A825A004123FF /* FixedArray.h */; }; A8A473C8151A825B004123FF /* Forward.h in Headers */ = {isa = PBXBuildFile; fileRef = A8A472A6151A825A004123FF /* Forward.h */; }; A8A473C9151A825B004123FF /* Functional.h in Headers */ = {isa = PBXBuildFile; fileRef = A8A472A7151A825A004123FF /* Functional.h */; }; A8A473CA151A825B004123FF /* GetPtr.h in Headers */ = {isa = PBXBuildFile; fileRef = A8A472A8151A825A004123FF /* GetPtr.h */; }; @@ -248,7 +246,6 @@ A8A4744B151A825B004123FF /* Threading.h in Headers */ = {isa = PBXBuildFile; fileRef = A8A47333151A825B004123FF /* Threading.h */; }; A8A4744D151A825B004123FF /* ThreadingPrimitives.h in Headers */ = {isa = PBXBuildFile; fileRef = A8A47335151A825B004123FF /* ThreadingPrimitives.h */; }; A8A4744E151A825B004123FF /* ThreadingPthreads.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A8A47336151A825B004123FF /* ThreadingPthreads.cpp */; }; - A8A47450151A825B004123FF /* ThreadRestrictionVerifier.h in Headers */ = {isa = PBXBuildFile; fileRef = A8A47338151A825B004123FF /* ThreadRestrictionVerifier.h */; }; A8A47451151A825B004123FF /* BinarySemaphore.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A8A4733A151A825B004123FF /* BinarySemaphore.cpp */; }; A8A47452151A825B004123FF /* BinarySemaphore.h in Headers */ = {isa = PBXBuildFile; fileRef = A8A4733B151A825B004123FF /* BinarySemaphore.h */; }; A8A47454151A825B004123FF /* ThreadSafeRefCounted.h in Headers */ = {isa = PBXBuildFile; fileRef = A8A4733E151A825B004123FF /* ThreadSafeRefCounted.h */; }; @@ -272,250 +269,6 @@ A8A47487151A825B004123FF /* WTFThreadData.h in Headers */ = {isa = PBXBuildFile; fileRef = A8A4737B151A825B004123FF /* WTFThreadData.h */; }; A8A4748C151A8264004123FF /* config.h in Headers */ = {isa = PBXBuildFile; fileRef = A8A4748B151A8264004123FF /* config.h */; }; B38FD7BD168953E80065C969 /* FeatureDefines.h in Headers */ = {isa = PBXBuildFile; fileRef = B38FD7BC168953E80065C969 /* FeatureDefines.h */; }; - B6F09BAC18290CFA00D62E5F /* Assertions.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A8A4725B151A825A004123FF /* Assertions.cpp */; }; - B6F09BAD18290CFA00D62E5F /* AtomicString.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A8A4731D151A825B004123FF /* AtomicString.cpp */; }; - B6F09BAE18290CFA00D62E5F /* AtomicStringTable.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 9BC70F04176C379D00101DEC /* AtomicStringTable.cpp */; }; - B6F09BAF18290CFA00D62E5F /* AutodrainedPoolMac.mm in Sources */ = {isa = PBXBuildFile; fileRef = 1469419B16EAB10A0024E146 /* AutodrainedPoolMac.mm */; }; - B6F09BB018290CFA00D62E5F /* Base64.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 8134013615B092FD001FF0B8 /* Base64.cpp */; }; - B6F09BB118290CFA00D62E5F /* bignum-dtoa.cc in Sources */ = {isa = PBXBuildFile; fileRef = A8A47282151A825A004123FF /* bignum-dtoa.cc */; }; - B6F09BB218290CFA00D62E5F /* bignum.cc in Sources */ = {isa = PBXBuildFile; fileRef = A8A47284151A825A004123FF /* bignum.cc */; }; - B6F09BB318290CFA00D62E5F /* BinarySemaphore.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A8A4733A151A825B004123FF /* BinarySemaphore.cpp */; }; - B6F09BB418290CFA00D62E5F /* BitVector.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A8A47260151A825A004123FF /* BitVector.cpp */; }; - B6F09BB518290CFA00D62E5F /* cached-powers.cc in Sources */ = {isa = PBXBuildFile; fileRef = A8A47286151A825A004123FF /* cached-powers.cc */; }; - B6F09BB618290CFA00D62E5F /* CollatorDefault.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A8A4734B151A825B004123FF /* CollatorDefault.cpp */; }; - B6F09BB718290CFA00D62E5F /* CollatorICU.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A8A47350151A825B004123FF /* CollatorICU.cpp */; }; - B6F09BB818290CFA00D62E5F /* CompilationThread.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 0F8F2B8F172E00F0007DBDA5 /* CompilationThread.cpp */; }; - B6F09BB918290CFA00D62E5F /* Compression.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A7E643C417C5423B003BB16B /* Compression.cpp */; }; - B6F09BBA18290CFA00D62E5F /* CryptographicallyRandomNumber.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A8A47273151A825A004123FF /* CryptographicallyRandomNumber.cpp */; }; - B6F09BBB18290CFA00D62E5F /* CString.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A8A47321151A825B004123FF /* CString.cpp */; }; - B6F09BBC18290CFA00D62E5F /* CurrentTime.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A8A47275151A825A004123FF /* CurrentTime.cpp */; }; - B6F09BBD18290CFA00D62E5F /* DataLog.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A8A47277151A825A004123FF /* DataLog.cpp */; }; - B6F09BBE18290CFA00D62E5F /* DateMath.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A8A47279151A825A004123FF /* DateMath.cpp */; }; - B6F09BBF18290CFA00D62E5F /* DecimalNumber.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A8A4727B151A825A004123FF /* DecimalNumber.cpp */; }; - B6F09BC018290CFA00D62E5F /* diy-fp.cc in Sources */ = {isa = PBXBuildFile; fileRef = A8A47289151A825A004123FF /* diy-fp.cc */; }; - B6F09BC118290CFA00D62E5F /* double-conversion.cc in Sources */ = {isa = PBXBuildFile; fileRef = A8A4728B151A825A004123FF /* double-conversion.cc */; }; - B6F09BC218290CFA00D62E5F /* dtoa.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A8A47297151A825A004123FF /* dtoa.cpp */; }; - B6F09BC318290CFA00D62E5F /* DynamicAnnotations.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A8A47299151A825A004123FF /* DynamicAnnotations.cpp */; }; - B6F09BC418290CFA00D62E5F /* fast-dtoa.cc in Sources */ = {isa = PBXBuildFile; fileRef = A8A4728E151A825A004123FF /* fast-dtoa.cc */; }; - B6F09BC518290CFA00D62E5F /* FastMalloc.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A8A472A1151A825A004123FF /* FastMalloc.cpp */; }; - B6F09BC618290CFA00D62E5F /* FilePrintStream.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 0F9D335B165DBA73005AD387 /* FilePrintStream.cpp */; }; - B6F09BC718290CFA00D62E5F /* fixed-dtoa.cc in Sources */ = {isa = PBXBuildFile; fileRef = A8A47290151A825A004123FF /* fixed-dtoa.cc */; }; - B6F09BC818290CFA00D62E5F /* FunctionDispatcher.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A1D8B9D1731879800141DA4 /* FunctionDispatcher.cpp */; }; - B6F09BC918290CFA00D62E5F /* GregorianDateTime.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 2CCD892915C0390200285083 /* GregorianDateTime.cpp */; }; - B6F09BCA18290CFA00D62E5F /* HashTable.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A8A472B8151A825A004123FF /* HashTable.cpp */; }; - B6F09BCB18290CFA00D62E5F /* MainThread.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A8A472C6151A825A004123FF /* MainThread.cpp */; }; - B6F09BCC18290CFA00D62E5F /* MainThreadMac.mm in Sources */ = {isa = PBXBuildFile; fileRef = A8A472C5151A825A004123FF /* MainThreadMac.mm */; }; - B6F09BCD18290CFA00D62E5F /* MD5.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A8A472CA151A825B004123FF /* MD5.cpp */; }; - B6F09BCE18290CFA00D62E5F /* MediaTime.cpp in Sources */ = {isa = PBXBuildFile; fileRef = CD5497AA15857D0300B5BC30 /* MediaTime.cpp */; }; - B6F09BCF18290CFA00D62E5F /* MetaAllocator.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A8A472CD151A825B004123FF /* MetaAllocator.cpp */; }; - B6F09BD018290CFA00D62E5F /* NumberOfCores.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A8A472D5151A825B004123FF /* NumberOfCores.cpp */; }; - B6F09BD118290CFA00D62E5F /* OSAllocatorPosix.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A8A472D8151A825B004123FF /* OSAllocatorPosix.cpp */; }; - B6F09BD218290CFA00D62E5F /* OSRandomSource.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A8A472DA151A825B004123FF /* OSRandomSource.cpp */; }; - B6F09BD318290CFA00D62E5F /* PageAllocationAligned.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A8A472E1151A825B004123FF /* PageAllocationAligned.cpp */; }; - B6F09BD418290CFA00D62E5F /* PageBlock.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A8A472E3151A825B004123FF /* PageBlock.cpp */; }; - B6F09BD518290CFA00D62E5F /* PrintStream.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 0F9D335D165DBA73005AD387 /* PrintStream.cpp */; }; - B6F09BD618290CFA00D62E5F /* RAMSize.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 143F611D1565F0F900DB514A /* RAMSize.cpp */; }; - B6F09BD718290CFA00D62E5F /* RandomNumber.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A8A472FB151A825B004123FF /* RandomNumber.cpp */; }; - B6F09BD818290CFA00D62E5F /* RefCountedLeakCounter.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A8A47301151A825B004123FF /* RefCountedLeakCounter.cpp */; }; - B6F09BD918290CFA00D62E5F /* RunLoopTimerCF.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1469419116EAAF6D0024E146 /* RunLoopTimerCF.cpp */; }; - B6F09BDA18290CFA00D62E5F /* SchedulePairCF.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1469419816EAB0410024E146 /* SchedulePairCF.cpp */; }; - B6F09BDB18290CFA00D62E5F /* SchedulePairMac.mm in Sources */ = {isa = PBXBuildFile; fileRef = 1469419516EAAFF80024E146 /* SchedulePairMac.mm */; }; - B6F09BDC18290CFA00D62E5F /* SHA1.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A8A47308151A825B004123FF /* SHA1.cpp */; }; - B6F09BDD18290CFA00D62E5F /* SixCharacterHash.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A748744F17A0BDAE00FA04CB /* SixCharacterHash.cpp */; }; - B6F09BDE18290CFA00D62E5F /* SizeLimits.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A8A4730C151A825B004123FF /* SizeLimits.cpp */; }; - B6F09BDF18290CFA00D62E5F /* StackBounds.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A8A4730E151A825B004123FF /* StackBounds.cpp */; }; - B6F09BE018290CFA00D62E5F /* StackStats.cpp in Sources */ = {isa = PBXBuildFile; fileRef = FEDACD3B1630F83F00C69634 /* StackStats.cpp */; }; - B6F09BE118290CFA00D62E5F /* StringBuilder.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A8A47324151A825B004123FF /* StringBuilder.cpp */; }; - B6F09BE218290CFA00D62E5F /* StringImpl.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A8A47328151A825B004123FF /* StringImpl.cpp */; }; - B6F09BE318290CFA00D62E5F /* StringPrintStream.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 0FDDBFA51666DFA300C55FEF /* StringPrintStream.cpp */; }; - B6F09BE418290CFA00D62E5F /* StringStatics.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A8A4732B151A825B004123FF /* StringStatics.cpp */; }; - B6F09BE518290CFA00D62E5F /* strtod.cc in Sources */ = {isa = PBXBuildFile; fileRef = A8A47294151A825A004123FF /* strtod.cc */; }; - B6F09BE618290CFA00D62E5F /* TCSystemAlloc.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A8A47318151A825B004123FF /* TCSystemAlloc.cpp */; }; - B6F09BE718290CFA00D62E5F /* ThreadIdentifierDataPthreads.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A8A47330151A825B004123FF /* ThreadIdentifierDataPthreads.cpp */; }; - B6F09BE818290CFA00D62E5F /* Threading.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A8A47332151A825B004123FF /* Threading.cpp */; }; - B6F09BE918290CFA00D62E5F /* ThreadingPthreads.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A8A47336151A825B004123FF /* ThreadingPthreads.cpp */; }; - B6F09BEA18290CFA00D62E5F /* UTF8.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A8A47357151A825B004123FF /* UTF8.cpp */; }; - B6F09BEB18290CFA00D62E5F /* WebCoreThread.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1FA47C88152502DA00568D1B /* WebCoreThread.cpp */; }; - B6F09BEC18290CFA00D62E5F /* WTFString.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A8A4732D151A825B004123FF /* WTFString.cpp */; }; - B6F09BED18290CFA00D62E5F /* WTFThreadData.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A8A4737A151A825B004123FF /* WTFThreadData.cpp */; }; - B6F09BF018290CFA00D62E5F /* ASCIICType.h in Headers */ = {isa = PBXBuildFile; fileRef = A8A4725A151A825A004123FF /* ASCIICType.h */; }; - B6F09BF118290CFA00D62E5F /* ASCIIFastPath.h in Headers */ = {isa = PBXBuildFile; fileRef = A8A4731C151A825B004123FF /* ASCIIFastPath.h */; }; - B6F09BF218290CFA00D62E5F /* Assertions.h in Headers */ = {isa = PBXBuildFile; fileRef = A8A4725C151A825A004123FF /* Assertions.h */; }; - B6F09BF318290CFA00D62E5F /* Atomics.h in Headers */ = {isa = PBXBuildFile; fileRef = A8A4725D151A825A004123FF /* Atomics.h */; }; - B6F09BF418290CFA00D62E5F /* AtomicString.h in Headers */ = {isa = PBXBuildFile; fileRef = A8A4731E151A825B004123FF /* AtomicString.h */; }; - B6F09BF518290CFA00D62E5F /* AtomicStringHash.h in Headers */ = {isa = PBXBuildFile; fileRef = A8A4731F151A825B004123FF /* AtomicStringHash.h */; }; - B6F09BF618290CFA00D62E5F /* AtomicStringImpl.h in Headers */ = {isa = PBXBuildFile; fileRef = A8A47320151A825B004123FF /* AtomicStringImpl.h */; }; - B6F09BF718290CFA00D62E5F /* AtomicStringTable.h in Headers */ = {isa = PBXBuildFile; fileRef = 9BD8F40A176C2AD80002D865 /* AtomicStringTable.h */; }; - B6F09BF818290CFA00D62E5F /* AutodrainedPool.h in Headers */ = {isa = PBXBuildFile; fileRef = 1469419A16EAB10A0024E146 /* AutodrainedPool.h */; }; - B6F09BF918290CFA00D62E5F /* AVLTree.h in Headers */ = {isa = PBXBuildFile; fileRef = A8A4725E151A825A004123FF /* AVLTree.h */; }; - B6F09BFA18290CFA00D62E5F /* Base64.h in Headers */ = {isa = PBXBuildFile; fileRef = 8134013715B092FD001FF0B8 /* Base64.h */; }; - B6F09BFB18290CFA00D62E5F /* bignum-dtoa.h in Headers */ = {isa = PBXBuildFile; fileRef = A8A47283151A825A004123FF /* bignum-dtoa.h */; }; - B6F09BFC18290CFA00D62E5F /* bignum.h in Headers */ = {isa = PBXBuildFile; fileRef = A8A47285151A825A004123FF /* bignum.h */; }; - B6F09BFD18290CFA00D62E5F /* BinarySemaphore.h in Headers */ = {isa = PBXBuildFile; fileRef = A8A4733B151A825B004123FF /* BinarySemaphore.h */; }; - B6F09BFE18290CFA00D62E5F /* BitArray.h in Headers */ = {isa = PBXBuildFile; fileRef = 4F0321BB156AA8D1006EBAF6 /* BitArray.h */; }; - B6F09BFF18290CFA00D62E5F /* Bitmap.h in Headers */ = {isa = PBXBuildFile; fileRef = A8A4725F151A825A004123FF /* Bitmap.h */; }; - B6F09C0018290CFA00D62E5F /* BitVector.h in Headers */ = {isa = PBXBuildFile; fileRef = A8A47261151A825A004123FF /* BitVector.h */; }; - B6F09C0118290CFA00D62E5F /* BlockStack.h in Headers */ = {isa = PBXBuildFile; fileRef = A8A47264151A825A004123FF /* BlockStack.h */; }; - B6F09C0218290CFA00D62E5F /* BloomFilter.h in Headers */ = {isa = PBXBuildFile; fileRef = A8A47265151A825A004123FF /* BloomFilter.h */; }; - B6F09C0318290CFA00D62E5F /* BoundsCheckedPointer.h in Headers */ = {isa = PBXBuildFile; fileRef = A8A47266151A825A004123FF /* BoundsCheckedPointer.h */; }; - B6F09C0418290CFA00D62E5F /* BumpPointerAllocator.h in Headers */ = {isa = PBXBuildFile; fileRef = A8A47267151A825A004123FF /* BumpPointerAllocator.h */; }; - B6F09C0518290CFA00D62E5F /* ByteOrder.h in Headers */ = {isa = PBXBuildFile; fileRef = EB95E1EF161A72410089A2F5 /* ByteOrder.h */; }; - B6F09C0618290CFA00D62E5F /* cached-powers.h in Headers */ = {isa = PBXBuildFile; fileRef = A8A47287151A825A004123FF /* cached-powers.h */; }; - B6F09C0718290CFA00D62E5F /* CharacterNames.h in Headers */ = {isa = PBXBuildFile; fileRef = A8A47349151A825B004123FF /* CharacterNames.h */; }; - B6F09C0818290CFA00D62E5F /* CheckedArithmetic.h in Headers */ = {isa = PBXBuildFile; fileRef = A8A4726A151A825A004123FF /* CheckedArithmetic.h */; }; - B6F09C0918290CFA00D62E5F /* CheckedBoolean.h in Headers */ = {isa = PBXBuildFile; fileRef = A8A4726B151A825A004123FF /* CheckedBoolean.h */; }; - B6F09C0A18290CFA00D62E5F /* Collator.h in Headers */ = {isa = PBXBuildFile; fileRef = A8A4734A151A825B004123FF /* Collator.h */; }; - B6F09C0B18290CFA00D62E5F /* CommaPrinter.h in Headers */ = {isa = PBXBuildFile; fileRef = 0FC4EDE51696149600F65041 /* CommaPrinter.h */; }; - B6F09C0C18290CFA00D62E5F /* CompilationThread.h in Headers */ = {isa = PBXBuildFile; fileRef = 0F8F2B90172E00F0007DBDA5 /* CompilationThread.h */; }; - B6F09C0D18290CFA00D62E5F /* Compiler.h in Headers */ = {isa = PBXBuildFile; fileRef = A8A47270151A825A004123FF /* Compiler.h */; }; - B6F09C0E18290CFA00D62E5F /* Compression.h in Headers */ = {isa = PBXBuildFile; fileRef = A7E643C517C5423B003BB16B /* Compression.h */; }; - B6F09C0F18290CFA00D62E5F /* config.h in Headers */ = {isa = PBXBuildFile; fileRef = A8A4748B151A8264004123FF /* config.h */; }; - B6F09C1018290CFA00D62E5F /* ConversionMode.h in Headers */ = {isa = PBXBuildFile; fileRef = 0F8F2B9B172F2594007DBDA5 /* ConversionMode.h */; }; - B6F09C1118290CFA00D62E5F /* CryptographicallyRandomNumber.h in Headers */ = {isa = PBXBuildFile; fileRef = A8A47274151A825A004123FF /* CryptographicallyRandomNumber.h */; }; - B6F09C1218290CFA00D62E5F /* CString.h in Headers */ = {isa = PBXBuildFile; fileRef = A8A47322151A825B004123FF /* CString.h */; }; - B6F09C1318290CFA00D62E5F /* CurrentTime.h in Headers */ = {isa = PBXBuildFile; fileRef = A8A47276151A825A004123FF /* CurrentTime.h */; }; - B6F09C1418290CFA00D62E5F /* DataLog.h in Headers */ = {isa = PBXBuildFile; fileRef = A8A47278151A825A004123FF /* DataLog.h */; }; - B6F09C1518290CFA00D62E5F /* DateMath.h in Headers */ = {isa = PBXBuildFile; fileRef = A8A4727A151A825A004123FF /* DateMath.h */; }; - B6F09C1618290CFA00D62E5F /* DecimalNumber.h in Headers */ = {isa = PBXBuildFile; fileRef = A8A4727C151A825A004123FF /* DecimalNumber.h */; }; - B6F09C1718290CFA00D62E5F /* Decoder.h in Headers */ = {isa = PBXBuildFile; fileRef = A8A4727D151A825A004123FF /* Decoder.h */; }; - B6F09C1818290CFA00D62E5F /* DeferrableRefCounted.h in Headers */ = {isa = PBXBuildFile; fileRef = 0F2B66A417B6B4F700A7AE3F /* DeferrableRefCounted.h */; }; - B6F09C1918290CFA00D62E5F /* Deque.h in Headers */ = {isa = PBXBuildFile; fileRef = A8A4727E151A825A004123FF /* Deque.h */; }; - B6F09C1A18290CFA00D62E5F /* DisallowCType.h in Headers */ = {isa = PBXBuildFile; fileRef = A8A4727F151A825A004123FF /* DisallowCType.h */; }; - B6F09C1B18290CFA00D62E5F /* diy-fp.h in Headers */ = {isa = PBXBuildFile; fileRef = A8A4728A151A825A004123FF /* diy-fp.h */; }; - B6F09C1C18290CFA00D62E5F /* double-conversion.h in Headers */ = {isa = PBXBuildFile; fileRef = A8A4728C151A825A004123FF /* double-conversion.h */; }; - B6F09C1D18290CFA00D62E5F /* double.h in Headers */ = {isa = PBXBuildFile; fileRef = A8A4728D151A825A004123FF /* double.h */; }; - B6F09C1E18290CFA00D62E5F /* DoublyLinkedList.h in Headers */ = {isa = PBXBuildFile; fileRef = A8A47280151A825A004123FF /* DoublyLinkedList.h */; }; - B6F09C1F18290CFA00D62E5F /* dtoa.h in Headers */ = {isa = PBXBuildFile; fileRef = A8A47298151A825A004123FF /* dtoa.h */; }; - B6F09C2018290CFA00D62E5F /* DynamicAnnotations.h in Headers */ = {isa = PBXBuildFile; fileRef = A8A4729A151A825A004123FF /* DynamicAnnotations.h */; }; - B6F09C2118290CFA00D62E5F /* Encoder.h in Headers */ = {isa = PBXBuildFile; fileRef = A8A4729E151A825A004123FF /* Encoder.h */; }; - B6F09C2218290CFA00D62E5F /* EnumClass.h in Headers */ = {isa = PBXBuildFile; fileRef = 44F66007171AFAA900E4AD19 /* EnumClass.h */; }; - B6F09C2318290CFA00D62E5F /* ExportMacros.h in Headers */ = {isa = PBXBuildFile; fileRef = A8A4729F151A825A004123FF /* ExportMacros.h */; }; - B6F09C2418290CFA00D62E5F /* fast-dtoa.h in Headers */ = {isa = PBXBuildFile; fileRef = A8A4728F151A825A004123FF /* fast-dtoa.h */; }; - B6F09C2518290CFA00D62E5F /* FastBitVector.h in Headers */ = {isa = PBXBuildFile; fileRef = 0FD81AC4154FB22E00983E72 /* FastBitVector.h */; settings = {ATTRIBUTES = (); }; }; - B6F09C2618290CFA00D62E5F /* FastMalloc.h in Headers */ = {isa = PBXBuildFile; fileRef = A8A472A2151A825A004123FF /* FastMalloc.h */; }; - B6F09C2718290CFA00D62E5F /* FeatureDefines.h in Headers */ = {isa = PBXBuildFile; fileRef = B38FD7BC168953E80065C969 /* FeatureDefines.h */; }; - B6F09C2818290CFA00D62E5F /* FilePrintStream.h in Headers */ = {isa = PBXBuildFile; fileRef = 0F9D335C165DBA73005AD387 /* FilePrintStream.h */; }; - B6F09C2918290CFA00D62E5F /* fixed-dtoa.h in Headers */ = {isa = PBXBuildFile; fileRef = A8A47291151A825A004123FF /* fixed-dtoa.h */; }; - B6F09C2A18290CFA00D62E5F /* FixedArray.h in Headers */ = {isa = PBXBuildFile; fileRef = A8A472A3151A825A004123FF /* FixedArray.h */; }; - B6F09C2B18290CFA00D62E5F /* FlipBytes.h in Headers */ = {isa = PBXBuildFile; fileRef = 0F2B66A517B6B4F700A7AE3F /* FlipBytes.h */; }; - B6F09C2C18290CFA00D62E5F /* Forward.h in Headers */ = {isa = PBXBuildFile; fileRef = A8A472A6151A825A004123FF /* Forward.h */; }; - B6F09C2D18290CFA00D62E5F /* Functional.h in Headers */ = {isa = PBXBuildFile; fileRef = A8A472A7151A825A004123FF /* Functional.h */; }; - B6F09C2E18290CFA00D62E5F /* FunctionDispatcher.h in Headers */ = {isa = PBXBuildFile; fileRef = 1A1D8B9B173186CE00141DA4 /* FunctionDispatcher.h */; }; - B6F09C2F18290CFA00D62E5F /* GetPtr.h in Headers */ = {isa = PBXBuildFile; fileRef = A8A472A8151A825A004123FF /* GetPtr.h */; }; - B6F09C3018290CFA00D62E5F /* GregorianDateTime.h in Headers */ = {isa = PBXBuildFile; fileRef = 2C05385315BC819000F21B96 /* GregorianDateTime.h */; }; - B6F09C3118290CFA00D62E5F /* HashCountedSet.h in Headers */ = {isa = PBXBuildFile; fileRef = A8A472B3151A825A004123FF /* HashCountedSet.h */; }; - B6F09C3218290CFA00D62E5F /* HashFunctions.h in Headers */ = {isa = PBXBuildFile; fileRef = A8A472B4151A825A004123FF /* HashFunctions.h */; }; - B6F09C3318290CFA00D62E5F /* HashIterators.h in Headers */ = {isa = PBXBuildFile; fileRef = A8A472B5151A825A004123FF /* HashIterators.h */; }; - B6F09C3418290CFA00D62E5F /* HashMap.h in Headers */ = {isa = PBXBuildFile; fileRef = A8A472B6151A825A004123FF /* HashMap.h */; }; - B6F09C3518290CFA00D62E5F /* MallocPtr.h in Headers */ = {isa = PBXBuildFile; fileRef = 1A233C7C17DAA6E300A93ACF /* MallocPtr.h */; }; - B6F09C3618290CFA00D62E5F /* HashSet.h in Headers */ = {isa = PBXBuildFile; fileRef = A8A472B7151A825A004123FF /* HashSet.h */; }; - B6F09C3718290CFA00D62E5F /* HashTable.h in Headers */ = {isa = PBXBuildFile; fileRef = A8A472B9151A825A004123FF /* HashTable.h */; }; - B6F09C3818290CFA00D62E5F /* HashTraits.h in Headers */ = {isa = PBXBuildFile; fileRef = A8A472BA151A825A004123FF /* HashTraits.h */; }; - B6F09C3918290CFA00D62E5F /* HexNumber.h in Headers */ = {isa = PBXBuildFile; fileRef = A8A472BB151A825A004123FF /* HexNumber.h */; }; - B6F09C3A18290CFA00D62E5F /* InlineASM.h in Headers */ = {isa = PBXBuildFile; fileRef = A8A472BC151A825A004123FF /* InlineASM.h */; }; - B6F09C3B18290CFA00D62E5F /* Ref.h in Headers */ = {isa = PBXBuildFile; fileRef = 26299B6D17A9E5B800ADEBE5 /* Ref.h */; }; - B6F09C3C18290CFA00D62E5F /* Insertion.h in Headers */ = {isa = PBXBuildFile; fileRef = A70DA0821799F04D00529A9B /* Insertion.h */; }; - B6F09C3D18290CFA00D62E5F /* IntegerToStringConversion.h in Headers */ = {isa = PBXBuildFile; fileRef = 26147B0815DDCCDC00DDB907 /* IntegerToStringConversion.h */; }; - B6F09C3E18290CFA00D62E5F /* ListDump.h in Headers */ = {isa = PBXBuildFile; fileRef = A70DA0831799F04D00529A9B /* ListDump.h */; }; - B6F09C3F18290CFA00D62E5F /* ListHashSet.h in Headers */ = {isa = PBXBuildFile; fileRef = A8A472C1151A825A004123FF /* ListHashSet.h */; }; - B6F09C4018290CFA00D62E5F /* Locker.h in Headers */ = {isa = PBXBuildFile; fileRef = A8A472C3151A825A004123FF /* Locker.h */; }; - B6F09C4118290CFA00D62E5F /* MainThread.h in Headers */ = {isa = PBXBuildFile; fileRef = A8A472C7151A825B004123FF /* MainThread.h */; }; - B6F09C4218290CFA00D62E5F /* MathExtras.h in Headers */ = {isa = PBXBuildFile; fileRef = A8A472C9151A825B004123FF /* MathExtras.h */; }; - B6F09C4318290CFA00D62E5F /* PassRef.h in Headers */ = {isa = PBXBuildFile; fileRef = 93B1AA7F180E5AF3004A2F05 /* PassRef.h */; }; - B6F09C4418290CFA00D62E5F /* MD5.h in Headers */ = {isa = PBXBuildFile; fileRef = A8A472CB151A825B004123FF /* MD5.h */; }; - B6F09C4518290CFA00D62E5F /* MediaTime.h in Headers */ = {isa = PBXBuildFile; fileRef = CD5497AB15857D0300B5BC30 /* MediaTime.h */; }; - B6F09C4618290CFA00D62E5F /* MessageQueue.h in Headers */ = {isa = PBXBuildFile; fileRef = A8A472CC151A825B004123FF /* MessageQueue.h */; }; - B6F09C4718290CFA00D62E5F /* MetaAllocator.h in Headers */ = {isa = PBXBuildFile; fileRef = A8A472CE151A825B004123FF /* MetaAllocator.h */; }; - B6F09C4818290CFA00D62E5F /* MetaAllocatorHandle.h in Headers */ = {isa = PBXBuildFile; fileRef = A8A472CF151A825B004123FF /* MetaAllocatorHandle.h */; }; - B6F09C4918290CFA00D62E5F /* NoLock.h in Headers */ = {isa = PBXBuildFile; fileRef = 0F0D85B317234CB100338210 /* NoLock.h */; }; - B6F09C4A18290CFA00D62E5F /* Noncopyable.h in Headers */ = {isa = PBXBuildFile; fileRef = A8A472D0151A825B004123FF /* Noncopyable.h */; }; - B6F09C4B18290CFA00D62E5F /* NumberOfCores.h in Headers */ = {isa = PBXBuildFile; fileRef = A8A472D6151A825B004123FF /* NumberOfCores.h */; }; - B6F09C4C18290CFA00D62E5F /* ObjcRuntimeExtras.h in Headers */ = {isa = PBXBuildFile; fileRef = 7E29C33D15FFD79B00516D61 /* ObjcRuntimeExtras.h */; }; - B6F09C4D18290CFA00D62E5F /* OSAllocator.h in Headers */ = {isa = PBXBuildFile; fileRef = A8A472D7151A825B004123FF /* OSAllocator.h */; }; - B6F09C4E18290CFA00D62E5F /* OSRandomSource.h in Headers */ = {isa = PBXBuildFile; fileRef = A8A472DB151A825B004123FF /* OSRandomSource.h */; }; - B6F09C4F18290CFA00D62E5F /* OwnPtr.h in Headers */ = {isa = PBXBuildFile; fileRef = A8A472DD151A825B004123FF /* OwnPtr.h */; }; - B6F09C5018290CFA00D62E5F /* OwnPtrCommon.h in Headers */ = {isa = PBXBuildFile; fileRef = A8A472DE151A825B004123FF /* OwnPtrCommon.h */; }; - B6F09C5118290CFA00D62E5F /* BagToHashMap.h in Headers */ = {isa = PBXBuildFile; fileRef = 0FB14E1A1810E1DA009B6B4D /* BagToHashMap.h */; }; - B6F09C5218290CFA00D62E5F /* PackedIntVector.h in Headers */ = {isa = PBXBuildFile; fileRef = A8A472DF151A825B004123FF /* PackedIntVector.h */; }; - B6F09C5318290CFA00D62E5F /* PageAllocation.h in Headers */ = {isa = PBXBuildFile; fileRef = A8A472E0151A825B004123FF /* PageAllocation.h */; }; - B6F09C5418290CFA00D62E5F /* PageAllocationAligned.h in Headers */ = {isa = PBXBuildFile; fileRef = A8A472E2151A825B004123FF /* PageAllocationAligned.h */; }; - B6F09C5518290CFA00D62E5F /* PageBlock.h in Headers */ = {isa = PBXBuildFile; fileRef = A8A472E4151A825B004123FF /* PageBlock.h */; }; - B6F09C5618290CFA00D62E5F /* PageReservation.h in Headers */ = {isa = PBXBuildFile; fileRef = A8A472E5151A825B004123FF /* PageReservation.h */; }; - B6F09C5718290CFA00D62E5F /* ParallelJobs.h in Headers */ = {isa = PBXBuildFile; fileRef = A8A472E6151A825B004123FF /* ParallelJobs.h */; }; - B6F09C5818290CFA00D62E5F /* ParallelJobsLibdispatch.h in Headers */ = {isa = PBXBuildFile; fileRef = A8A472E9151A825B004123FF /* ParallelJobsLibdispatch.h */; }; - B6F09C5918290CFA00D62E5F /* PassOwnPtr.h in Headers */ = {isa = PBXBuildFile; fileRef = A8A472EC151A825B004123FF /* PassOwnPtr.h */; }; - B6F09C5A18290CFA00D62E5F /* PassRefPtr.h in Headers */ = {isa = PBXBuildFile; fileRef = A8A472ED151A825B004123FF /* PassRefPtr.h */; }; - B6F09C5B18290CFA00D62E5F /* Platform.h in Headers */ = {isa = PBXBuildFile; fileRef = A876DBD7151816E500DADB95 /* Platform.h */; }; - B6F09C5C18290CFA00D62E5F /* PossiblyNull.h in Headers */ = {isa = PBXBuildFile; fileRef = A8A472F3151A825B004123FF /* PossiblyNull.h */; }; - B6F09C5D18290CFA00D62E5F /* Bag.h in Headers */ = {isa = PBXBuildFile; fileRef = 0FB14E18180FA218009B6B4D /* Bag.h */; }; - B6F09C5E18290CFA00D62E5F /* PrintStream.h in Headers */ = {isa = PBXBuildFile; fileRef = 0F9D335E165DBA73005AD387 /* PrintStream.h */; }; - B6F09C5F18290CFA00D62E5F /* ProcessID.h in Headers */ = {isa = PBXBuildFile; fileRef = 0FC4488216FE9FE100844BE9 /* ProcessID.h */; }; - B6F09C6018290CFA00D62E5F /* RAMSize.h in Headers */ = {isa = PBXBuildFile; fileRef = 143F611E1565F0F900DB514A /* RAMSize.h */; settings = {ATTRIBUTES = (); }; }; - B6F09C6118290CFA00D62E5F /* RandomNumber.h in Headers */ = {isa = PBXBuildFile; fileRef = A8A472FC151A825B004123FF /* RandomNumber.h */; }; - B6F09C6218290CFA00D62E5F /* RandomNumberSeed.h in Headers */ = {isa = PBXBuildFile; fileRef = A8A472FD151A825B004123FF /* RandomNumberSeed.h */; }; - B6F09C6318290CFA00D62E5F /* RawPointer.h in Headers */ = {isa = PBXBuildFile; fileRef = 0F87105916643F190090B0AD /* RawPointer.h */; }; - B6F09C6418290CFA00D62E5F /* RedBlackTree.h in Headers */ = {isa = PBXBuildFile; fileRef = A8A472FE151A825B004123FF /* RedBlackTree.h */; }; - B6F09C6518290CFA00D62E5F /* RefCounted.h in Headers */ = {isa = PBXBuildFile; fileRef = A8A472FF151A825B004123FF /* RefCounted.h */; }; - B6F09C6618290CFA00D62E5F /* RefCountedArray.h in Headers */ = {isa = PBXBuildFile; fileRef = A8A47300151A825B004123FF /* RefCountedArray.h */; }; - B6F09C6718290CFA00D62E5F /* RefCountedLeakCounter.h in Headers */ = {isa = PBXBuildFile; fileRef = A8A47302151A825B004123FF /* RefCountedLeakCounter.h */; }; - B6F09C6818290CFA00D62E5F /* RefPtr.h in Headers */ = {isa = PBXBuildFile; fileRef = A8A47303151A825B004123FF /* RefPtr.h */; }; - B6F09C6918290CFA00D62E5F /* RefPtrHashMap.h in Headers */ = {isa = PBXBuildFile; fileRef = A8A47304151A825B004123FF /* RefPtrHashMap.h */; }; - B6F09C6A18290CFA00D62E5F /* RetainPtr.h in Headers */ = {isa = PBXBuildFile; fileRef = A8A47305151A825B004123FF /* RetainPtr.h */; }; - B6F09C6B18290CFA00D62E5F /* RunLoopTimer.h in Headers */ = {isa = PBXBuildFile; fileRef = 1469419016EAAF6D0024E146 /* RunLoopTimer.h */; settings = {ATTRIBUTES = (); }; }; - B6F09C6C18290CFA00D62E5F /* SaturatedArithmetic.h in Headers */ = {isa = PBXBuildFile; fileRef = 14F3B0F615E45E4600210069 /* SaturatedArithmetic.h */; settings = {ATTRIBUTES = (); }; }; - B6F09C6D18290CFA00D62E5F /* SchedulePair.h in Headers */ = {isa = PBXBuildFile; fileRef = 1469419416EAAFF80024E146 /* SchedulePair.h */; }; - B6F09C6E18290CFA00D62E5F /* ScriptCodesFromICU.h in Headers */ = {isa = PBXBuildFile; fileRef = A8A47354151A825B004123FF /* ScriptCodesFromICU.h */; }; - B6F09C6F18290CFA00D62E5F /* SegmentedVector.h in Headers */ = {isa = PBXBuildFile; fileRef = A8A47306151A825B004123FF /* SegmentedVector.h */; }; - B6F09C7018290CFA00D62E5F /* SentinelLinkedList.h in Headers */ = {isa = PBXBuildFile; fileRef = A8A47307151A825B004123FF /* SentinelLinkedList.h */; }; - B6F09C7118290CFA00D62E5F /* SHA1.h in Headers */ = {isa = PBXBuildFile; fileRef = A8A47309151A825B004123FF /* SHA1.h */; }; - B6F09C7218290CFA00D62E5F /* SimpleStats.h in Headers */ = {isa = PBXBuildFile; fileRef = A8A4730A151A825B004123FF /* SimpleStats.h */; }; - B6F09C7318290CFA00D62E5F /* SinglyLinkedList.h in Headers */ = {isa = PBXBuildFile; fileRef = A8A4730B151A825B004123FF /* SinglyLinkedList.h */; }; - B6F09C7418290CFA00D62E5F /* SixCharacterHash.h in Headers */ = {isa = PBXBuildFile; fileRef = A748745017A0BDAE00FA04CB /* SixCharacterHash.h */; }; - B6F09C7518290CFA00D62E5F /* Spectrum.h in Headers */ = {isa = PBXBuildFile; fileRef = A8A4730D151A825B004123FF /* Spectrum.h */; }; - B6F09C7618290CFA00D62E5F /* StackBounds.h in Headers */ = {isa = PBXBuildFile; fileRef = A8A4730F151A825B004123FF /* StackBounds.h */; }; - B6F09C7718290CFA00D62E5F /* StackStats.h in Headers */ = {isa = PBXBuildFile; fileRef = FEDACD3C1630F83F00C69634 /* StackStats.h */; }; - B6F09C7818290CFA00D62E5F /* StaticConstructors.h in Headers */ = {isa = PBXBuildFile; fileRef = A8A47310151A825B004123FF /* StaticConstructors.h */; }; - B6F09C7918290CFA00D62E5F /* StdLibExtras.h in Headers */ = {isa = PBXBuildFile; fileRef = A8A47311151A825B004123FF /* StdLibExtras.h */; }; - B6F09C7A18290CFA00D62E5F /* StreamBuffer.h in Headers */ = {isa = PBXBuildFile; fileRef = 1A6BB768162F300500DD16DB /* StreamBuffer.h */; }; - B6F09C7B18290CFA00D62E5F /* StringBuffer.h in Headers */ = {isa = PBXBuildFile; fileRef = A8A47323151A825B004123FF /* StringBuffer.h */; }; - B6F09C7C18290CFA00D62E5F /* StringBuilder.h in Headers */ = {isa = PBXBuildFile; fileRef = A8A47325151A825B004123FF /* StringBuilder.h */; }; - B6F09C7D18290CFA00D62E5F /* StringConcatenate.h in Headers */ = {isa = PBXBuildFile; fileRef = A8A47326151A825B004123FF /* StringConcatenate.h */; }; - B6F09C7E18290CFA00D62E5F /* StringExtras.h in Headers */ = {isa = PBXBuildFile; fileRef = A8A47313151A825B004123FF /* StringExtras.h */; }; - B6F09C7F18290CFA00D62E5F /* StringHash.h in Headers */ = {isa = PBXBuildFile; fileRef = A8A47327151A825B004123FF /* StringHash.h */; }; - B6F09C8018290CFA00D62E5F /* StringHashDumpContext.h in Headers */ = {isa = PBXBuildFile; fileRef = A748745117A0BDAE00FA04CB /* StringHashDumpContext.h */; }; - B6F09C8118290CFA00D62E5F /* StringHasher.h in Headers */ = {isa = PBXBuildFile; fileRef = A8A47314151A825B004123FF /* StringHasher.h */; }; - B6F09C8218290CFA00D62E5F /* StringImpl.h in Headers */ = {isa = PBXBuildFile; fileRef = A8A47329151A825B004123FF /* StringImpl.h */; }; - B6F09C8318290CFA00D62E5F /* StringOperators.h in Headers */ = {isa = PBXBuildFile; fileRef = A8A4732A151A825B004123FF /* StringOperators.h */; }; - B6F09C8418290CFA00D62E5F /* StringPrintStream.h in Headers */ = {isa = PBXBuildFile; fileRef = 0FDDBFA61666DFA300C55FEF /* StringPrintStream.h */; }; - B6F09C8518290CFA00D62E5F /* strtod.h in Headers */ = {isa = PBXBuildFile; fileRef = A8A47295151A825A004123FF /* strtod.h */; }; - B6F09C8618290CFA00D62E5F /* TCPackedCache.h in Headers */ = {isa = PBXBuildFile; fileRef = A8A47315151A825B004123FF /* TCPackedCache.h */; }; - B6F09C8718290CFA00D62E5F /* TCPageMap.h in Headers */ = {isa = PBXBuildFile; fileRef = A8A47316151A825B004123FF /* TCPageMap.h */; }; - B6F09C8818290CFA00D62E5F /* TCSpinLock.h in Headers */ = {isa = PBXBuildFile; fileRef = A8A47317151A825B004123FF /* TCSpinLock.h */; }; - B6F09C8918290CFA00D62E5F /* TCSystemAlloc.h in Headers */ = {isa = PBXBuildFile; fileRef = A8A47319151A825B004123FF /* TCSystemAlloc.h */; }; - B6F09C8A18290CFA00D62E5F /* TemporaryChange.h in Headers */ = {isa = PBXBuildFile; fileRef = A8A4731A151A825B004123FF /* TemporaryChange.h */; }; - B6F09C8B18290CFA00D62E5F /* TextPosition.h in Headers */ = {isa = PBXBuildFile; fileRef = A8A4732C151A825B004123FF /* TextPosition.h */; }; - B6F09C8C18290CFA00D62E5F /* ThreadFunctionInvocation.h in Headers */ = {isa = PBXBuildFile; fileRef = A8A4732F151A825B004123FF /* ThreadFunctionInvocation.h */; }; - B6F09C8D18290CFA00D62E5F /* ThreadIdentifierDataPthreads.h in Headers */ = {isa = PBXBuildFile; fileRef = A8A47331151A825B004123FF /* ThreadIdentifierDataPthreads.h */; }; - B6F09C8E18290CFA00D62E5F /* Threading.h in Headers */ = {isa = PBXBuildFile; fileRef = A8A47333151A825B004123FF /* Threading.h */; }; - B6F09C8F18290CFA00D62E5F /* ThreadingPrimitives.h in Headers */ = {isa = PBXBuildFile; fileRef = A8A47335151A825B004123FF /* ThreadingPrimitives.h */; }; - B6F09C9018290CFA00D62E5F /* ThreadRestrictionVerifier.h in Headers */ = {isa = PBXBuildFile; fileRef = A8A47338151A825B004123FF /* ThreadRestrictionVerifier.h */; }; - B6F09C9118290CFA00D62E5F /* ThreadSafeRefCounted.h in Headers */ = {isa = PBXBuildFile; fileRef = A8A4733E151A825B004123FF /* ThreadSafeRefCounted.h */; }; - B6F09C9218290CFA00D62E5F /* ThreadSpecific.h in Headers */ = {isa = PBXBuildFile; fileRef = A8A4733F151A825B004123FF /* ThreadSpecific.h */; }; - B6F09C9318290CFA00D62E5F /* TriState.h in Headers */ = {isa = PBXBuildFile; fileRef = 149EF16216BBFE0D000A4331 /* TriState.h */; settings = {ATTRIBUTES = (); }; }; - B6F09C9418290CFA00D62E5F /* Unicode.h in Headers */ = {isa = PBXBuildFile; fileRef = A8A47355151A825B004123FF /* Unicode.h */; }; - B6F09C9518290CFA00D62E5F /* UnicodeIcu.h in Headers */ = {isa = PBXBuildFile; fileRef = A8A47351151A825B004123FF /* UnicodeIcu.h */; }; - B6F09C9618290CFA00D62E5F /* UnicodeMacrosFromICU.h in Headers */ = {isa = PBXBuildFile; fileRef = A8A47356151A825B004123FF /* UnicodeMacrosFromICU.h */; }; - B6F09C9718290CFA00D62E5F /* UnionFind.h in Headers */ = {isa = PBXBuildFile; fileRef = A8A4735C151A825B004123FF /* UnionFind.h */; }; - B6F09C9818290CFA00D62E5F /* UTF8.h in Headers */ = {isa = PBXBuildFile; fileRef = A8A47358151A825B004123FF /* UTF8.h */; }; - B6F09C9918290CFA00D62E5F /* utils.h in Headers */ = {isa = PBXBuildFile; fileRef = A8A47296151A825A004123FF /* utils.h */; }; - B6F09C9A18290CFA00D62E5F /* ValueCheck.h in Headers */ = {isa = PBXBuildFile; fileRef = A8A4736F151A825B004123FF /* ValueCheck.h */; }; - B6F09C9B18290CFA00D62E5F /* Vector.h in Headers */ = {isa = PBXBuildFile; fileRef = A8A47370151A825B004123FF /* Vector.h */; }; - B6F09C9C18290CFA00D62E5F /* VectorTraits.h in Headers */ = {isa = PBXBuildFile; fileRef = A8A47371151A825B004123FF /* VectorTraits.h */; }; - B6F09C9D18290CFA00D62E5F /* VMTags.h in Headers */ = {isa = PBXBuildFile; fileRef = A8A47372151A825B004123FF /* VMTags.h */; }; - B6F09C9E18290CFA00D62E5F /* WeakPtr.h in Headers */ = {isa = PBXBuildFile; fileRef = 974CFC8D16A4F327006D5404 /* WeakPtr.h */; }; - B6F09C9F18290CFA00D62E5F /* WebCoreThread.h in Headers */ = {isa = PBXBuildFile; fileRef = 1FA47C89152502DA00568D1B /* WebCoreThread.h */; }; - B6F09CA018290CFA00D62E5F /* WTFString.h in Headers */ = {isa = PBXBuildFile; fileRef = A8A4732E151A825B004123FF /* WTFString.h */; }; - B6F09CA118290CFA00D62E5F /* WTFThreadData.h in Headers */ = {isa = PBXBuildFile; fileRef = A8A4737B151A825B004123FF /* WTFThreadData.h */; }; CD5497AC15857D0300B5BC30 /* MediaTime.cpp in Sources */ = {isa = PBXBuildFile; fileRef = CD5497AA15857D0300B5BC30 /* MediaTime.cpp */; }; CD5497AD15857D0300B5BC30 /* MediaTime.h in Headers */ = {isa = PBXBuildFile; fileRef = CD5497AB15857D0300B5BC30 /* MediaTime.h */; }; EB95E1F0161A72410089A2F5 /* ByteOrder.h in Headers */ = {isa = PBXBuildFile; fileRef = EB95E1EF161A72410089A2F5 /* ByteOrder.h */; }; @@ -531,20 +284,6 @@ remoteGlobalIDString = 65AFA16F1630B977003D723C; remoteInfo = "Copy Headers"; }; - B64797561829124500CCF60F /* PBXContainerItemProxy */ = { - isa = PBXContainerItemProxy; - containerPortal = 5D247B5914689B8600E78B76 /* Project object */; - proxyType = 1; - remoteGlobalIDString = B6F09BA818290CFA00D62E5F; - remoteInfo = "WTF iOS"; - }; - B6F09BAA18290CFA00D62E5F /* PBXContainerItemProxy */ = { - isa = PBXContainerItemProxy; - containerPortal = 5D247B5914689B8600E78B76 /* Project object */; - proxyType = 1; - remoteGlobalIDString = 65AFA16F1630B977003D723C; - remoteInfo = "Copy Headers"; - }; /* End PBXContainerItemProxy section */ /* Begin PBXFileReference section */ @@ -552,6 +291,7 @@ 0F2B66A417B6B4F700A7AE3F /* DeferrableRefCounted.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = DeferrableRefCounted.h; sourceTree = ""; }; 0F2B66A517B6B4F700A7AE3F /* FlipBytes.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = FlipBytes.h; sourceTree = ""; }; 0F87105916643F190090B0AD /* RawPointer.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RawPointer.h; sourceTree = ""; }; + 0F885E0E1845AE9F00F1E3FA /* FastBitVector.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = FastBitVector.cpp; sourceTree = ""; }; 0F8F2B8F172E00F0007DBDA5 /* CompilationThread.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = CompilationThread.cpp; sourceTree = ""; }; 0F8F2B90172E00F0007DBDA5 /* CompilationThread.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = CompilationThread.h; sourceTree = ""; }; 0F8F2B9B172F2594007DBDA5 /* ConversionMode.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = ConversionMode.h; sourceTree = ""; }; @@ -583,20 +323,25 @@ 1A233C7C17DAA6E300A93ACF /* MallocPtr.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MallocPtr.h; sourceTree = ""; }; 1A3F6BE6174ADA2100B2EEA7 /* NeverDestroyed.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = NeverDestroyed.h; sourceTree = ""; }; 1A6BB768162F300500DD16DB /* StreamBuffer.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = StreamBuffer.h; sourceTree = ""; }; + 1A6EB1DF187D0BD30030126F /* StringView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = StringView.h; sourceTree = ""; }; + 1ACADD821884480100D8B71D /* DeprecatedSymbolsUsedBySafari.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = DeprecatedSymbolsUsedBySafari.mm; sourceTree = ""; }; 1FA47C88152502DA00568D1B /* WebCoreThread.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = WebCoreThread.cpp; sourceTree = ""; }; 1FA47C89152502DA00568D1B /* WebCoreThread.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WebCoreThread.h; sourceTree = ""; }; 26147B0815DDCCDC00DDB907 /* IntegerToStringConversion.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = IntegerToStringConversion.h; sourceTree = ""; }; 26299B6D17A9E5B800ADEBE5 /* Ref.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Ref.h; sourceTree = ""; }; 2C05385315BC819000F21B96 /* GregorianDateTime.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = GregorianDateTime.h; sourceTree = ""; }; 2CCD892915C0390200285083 /* GregorianDateTime.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = GregorianDateTime.cpp; sourceTree = ""; }; + 2CDED0EE18115C38004DBA70 /* RunLoopCF.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = RunLoopCF.cpp; path = cf/RunLoopCF.cpp; sourceTree = ""; }; + 2CDED0F118115C85004DBA70 /* RunLoop.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = RunLoop.cpp; sourceTree = ""; }; + 2CDED0F218115C85004DBA70 /* RunLoop.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RunLoop.h; sourceTree = ""; }; 44DEE74A152274BB00C6EC37 /* iOS.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; path = iOS.xcconfig; sourceTree = ""; }; - 44F66007171AFAA900E4AD19 /* EnumClass.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = EnumClass.h; sourceTree = ""; }; - 4F0321BB156AA8D1006EBAF6 /* BitArray.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = BitArray.h; sourceTree = ""; }; 5D247B6214689B8600E78B76 /* libWTF.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = libWTF.a; sourceTree = BUILT_PRODUCTS_DIR; }; 5D247B6E14689C4700E78B76 /* Base.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; path = Base.xcconfig; sourceTree = ""; }; 5D247B7014689C4700E78B76 /* DebugRelease.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; path = DebugRelease.xcconfig; sourceTree = ""; }; 5D247B7314689C4700E78B76 /* WTF.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; path = WTF.xcconfig; sourceTree = ""; }; 6541CAF41630DB26006D0DEC /* CopyWTFHeaders.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; path = CopyWTFHeaders.xcconfig; sourceTree = ""; }; + 7CDD7FF7186D291E007433CD /* IteratorAdaptors.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = IteratorAdaptors.h; sourceTree = ""; }; + 7CDD7FF9186D2A54007433CD /* IteratorRange.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = IteratorRange.h; sourceTree = ""; }; 7E29C33D15FFD79B00516D61 /* ObjcRuntimeExtras.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ObjcRuntimeExtras.h; sourceTree = ""; }; 8134013615B092FD001FF0B8 /* Base64.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = Base64.cpp; sourceTree = ""; }; 8134013715B092FD001FF0B8 /* Base64.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Base64.h; sourceTree = ""; }; @@ -604,6 +349,11 @@ 974CFC8D16A4F327006D5404 /* WeakPtr.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WeakPtr.h; sourceTree = ""; }; 9BC70F04176C379D00101DEC /* AtomicStringTable.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = AtomicStringTable.cpp; sourceTree = ""; }; 9BD8F40A176C2AD80002D865 /* AtomicStringTable.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = AtomicStringTable.h; sourceTree = ""; }; + A5BA15F2182433A900A82E69 /* StringMac.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; name = StringMac.mm; path = mac/StringMac.mm; sourceTree = ""; }; + A5BA15F41824348000A82E69 /* StringImplMac.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; name = StringImplMac.mm; path = mac/StringImplMac.mm; sourceTree = ""; }; + A5BA15F7182435A600A82E69 /* AtomicStringCF.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = AtomicStringCF.cpp; path = cf/AtomicStringCF.cpp; sourceTree = ""; }; + A5BA15F8182435A600A82E69 /* StringCF.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = StringCF.cpp; path = cf/StringCF.cpp; sourceTree = ""; }; + A5BA15F9182435A600A82E69 /* StringImplCF.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = StringImplCF.cpp; path = cf/StringImplCF.cpp; sourceTree = ""; }; A70DA0821799F04D00529A9B /* Insertion.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Insertion.h; sourceTree = ""; }; A70DA0831799F04D00529A9B /* ListDump.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ListDump.h; sourceTree = ""; }; A748744F17A0BDAE00FA04CB /* SixCharacterHash.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = SixCharacterHash.cpp; sourceTree = ""; }; @@ -670,7 +420,6 @@ A8A4729F151A825A004123FF /* ExportMacros.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ExportMacros.h; sourceTree = ""; }; A8A472A1151A825A004123FF /* FastMalloc.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = FastMalloc.cpp; sourceTree = ""; }; A8A472A2151A825A004123FF /* FastMalloc.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = FastMalloc.h; sourceTree = ""; }; - A8A472A3151A825A004123FF /* FixedArray.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = FixedArray.h; sourceTree = ""; }; A8A472A6151A825A004123FF /* Forward.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Forward.h; sourceTree = ""; }; A8A472A7151A825A004123FF /* Functional.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Functional.h; sourceTree = ""; }; A8A472A8151A825A004123FF /* GetPtr.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = GetPtr.h; sourceTree = ""; }; @@ -774,7 +523,6 @@ A8A47333151A825B004123FF /* Threading.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Threading.h; sourceTree = ""; }; A8A47335151A825B004123FF /* ThreadingPrimitives.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ThreadingPrimitives.h; sourceTree = ""; }; A8A47336151A825B004123FF /* ThreadingPthreads.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = ThreadingPthreads.cpp; sourceTree = ""; }; - A8A47338151A825B004123FF /* ThreadRestrictionVerifier.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ThreadRestrictionVerifier.h; sourceTree = ""; }; A8A4733A151A825B004123FF /* BinarySemaphore.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = BinarySemaphore.cpp; sourceTree = ""; }; A8A4733B151A825B004123FF /* BinarySemaphore.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = BinarySemaphore.h; sourceTree = ""; }; A8A4733E151A825B004123FF /* ThreadSafeRefCounted.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ThreadSafeRefCounted.h; sourceTree = ""; }; @@ -798,16 +546,6 @@ A8A4737B151A825B004123FF /* WTFThreadData.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WTFThreadData.h; sourceTree = ""; }; A8A4748B151A8264004123FF /* config.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = config.h; sourceTree = ""; }; B38FD7BC168953E80065C969 /* FeatureDefines.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = FeatureDefines.h; sourceTree = ""; }; - B647972B18290F1000CCF60F /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = System/Library/Frameworks/Foundation.framework; sourceTree = SDKROOT; }; - B647972F18290F1100CCF60F /* xkcd-Prefix.pch */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "xkcd-Prefix.pch"; sourceTree = ""; }; - B647973018290F1100CCF60F /* xkcd.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = xkcd.h; sourceTree = ""; }; - B647973218290F1100CCF60F /* xkcd.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = xkcd.m; sourceTree = ""; }; - B647973918290F1100CCF60F /* XCTest.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = XCTest.framework; path = Library/Frameworks/XCTest.framework; sourceTree = DEVELOPER_DIR; }; - B647973C18290F1100CCF60F /* UIKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = UIKit.framework; path = Library/Frameworks/UIKit.framework; sourceTree = DEVELOPER_DIR; }; - B647974318290F1100CCF60F /* xkcdTests-Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = "xkcdTests-Info.plist"; sourceTree = ""; }; - B647974518290F1100CCF60F /* en */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = en; path = en.lproj/InfoPlist.strings; sourceTree = ""; }; - B647974718290F1100CCF60F /* xkcdTests.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = xkcdTests.m; sourceTree = ""; }; - B6F09CA618290CFA00D62E5F /* libWTF.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = libWTF.a; sourceTree = BUILT_PRODUCTS_DIR; }; CD5497AA15857D0300B5BC30 /* MediaTime.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = MediaTime.cpp; sourceTree = ""; }; CD5497AB15857D0300B5BC30 /* MediaTime.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MediaTime.h; sourceTree = ""; }; EB95E1EF161A72410089A2F5 /* ByteOrder.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ByteOrder.h; sourceTree = ""; }; @@ -823,13 +561,6 @@ ); runOnlyForDeploymentPostprocessing = 0; }; - B6F09BEE18290CFA00D62E5F /* Frameworks */ = { - isa = PBXFrameworksBuildPhase; - buildActionMask = 2147483647; - files = ( - ); - runOnlyForDeploymentPostprocessing = 0; - }; /* End PBXFrameworksBuildPhase section */ /* Begin PBXGroup section */ @@ -842,13 +573,18 @@ path = ios; sourceTree = ""; }; + 2CDED0F018115C3F004DBA70 /* cf */ = { + isa = PBXGroup; + children = ( + 2CDED0EE18115C38004DBA70 /* RunLoopCF.cpp */, + ); + name = cf; + sourceTree = ""; + }; 5D247B5714689B8600E78B76 = { isa = PBXGroup; children = ( 5D247B6D14689C4700E78B76 /* Configurations */, - B647972D18290F1000CCF60F /* xkcd */, - B647974118290F1100CCF60F /* xkcdTests */, - B647972A18290F1000CCF60F /* Frameworks */, 5D247B6314689B8600E78B76 /* Products */, 5D247B7614689D7600E78B76 /* Source */, ); @@ -858,7 +594,6 @@ isa = PBXGroup; children = ( 5D247B6214689B8600E78B76 /* libWTF.a */, - B6F09CA618290CFA00D62E5F /* libWTF.a */, ); name = Products; sourceTree = ""; @@ -884,9 +619,29 @@ name = Source; sourceTree = ""; }; + A5BA15F11824339F00A82E69 /* mac */ = { + isa = PBXGroup; + children = ( + A5BA15F41824348000A82E69 /* StringImplMac.mm */, + A5BA15F2182433A900A82E69 /* StringMac.mm */, + ); + name = mac; + sourceTree = ""; + }; + A5BA15F61824359E00A82E69 /* cf */ = { + isa = PBXGroup; + children = ( + A5BA15F7182435A600A82E69 /* AtomicStringCF.cpp */, + A5BA15F8182435A600A82E69 /* StringCF.cpp */, + A5BA15F9182435A600A82E69 /* StringImplCF.cpp */, + ); + name = cf; + sourceTree = ""; + }; A876DBD6151816E500DADB95 /* wtf */ = { isa = PBXGroup; children = ( + 2CDED0F018115C3F004DBA70 /* cf */, A8A47281151A825A004123FF /* dtoa */, 1FA47C87152502DA00568D1B /* ios */, A8A472C4151A825A004123FF /* mac */, @@ -902,7 +657,6 @@ A8A4725E151A825A004123FF /* AVLTree.h */, 0FB14E18180FA218009B6B4D /* Bag.h */, 0FB14E1A1810E1DA009B6B4D /* BagToHashMap.h */, - 4F0321BB156AA8D1006EBAF6 /* BitArray.h */, A8A4725F151A825A004123FF /* Bitmap.h */, A8A47260151A825A004123FF /* BitVector.cpp */, A8A47261151A825A004123FF /* BitVector.h */, @@ -940,15 +694,14 @@ A8A47299151A825A004123FF /* DynamicAnnotations.cpp */, A8A4729A151A825A004123FF /* DynamicAnnotations.h */, A8A4729E151A825A004123FF /* Encoder.h */, - 44F66007171AFAA900E4AD19 /* EnumClass.h */, A8A4729F151A825A004123FF /* ExportMacros.h */, + 0F885E0E1845AE9F00F1E3FA /* FastBitVector.cpp */, 0FD81AC4154FB22E00983E72 /* FastBitVector.h */, A8A472A1151A825A004123FF /* FastMalloc.cpp */, A8A472A2151A825A004123FF /* FastMalloc.h */, B38FD7BC168953E80065C969 /* FeatureDefines.h */, 0F9D335B165DBA73005AD387 /* FilePrintStream.cpp */, 0F9D335C165DBA73005AD387 /* FilePrintStream.h */, - A8A472A3151A825A004123FF /* FixedArray.h */, 0F2B66A517B6B4F700A7AE3F /* FlipBytes.h */, A8A472A6151A825A004123FF /* Forward.h */, A8A472A7151A825A004123FF /* Functional.h */, @@ -968,6 +721,8 @@ A8A472BB151A825A004123FF /* HexNumber.h */, A8A472BC151A825A004123FF /* InlineASM.h */, A70DA0821799F04D00529A9B /* Insertion.h */, + 7CDD7FF7186D291E007433CD /* IteratorAdaptors.h */, + 7CDD7FF9186D2A54007433CD /* IteratorRange.h */, A70DA0831799F04D00529A9B /* ListDump.h */, A8A472C1151A825A004123FF /* ListHashSet.h */, A8A472C3151A825A004123FF /* Locker.h */, @@ -1027,6 +782,8 @@ A8A47303151A825B004123FF /* RefPtr.h */, A8A47304151A825B004123FF /* RefPtrHashMap.h */, A8A47305151A825B004123FF /* RetainPtr.h */, + 2CDED0F118115C85004DBA70 /* RunLoop.cpp */, + 2CDED0F218115C85004DBA70 /* RunLoop.h */, 1469419016EAAF6D0024E146 /* RunLoopTimer.h */, 1469419116EAAF6D0024E146 /* RunLoopTimerCF.cpp */, 14F3B0F615E45E4600210069 /* SaturatedArithmetic.h */, @@ -1068,7 +825,6 @@ A8A47333151A825B004123FF /* Threading.h */, A8A47335151A825B004123FF /* ThreadingPrimitives.h */, A8A47336151A825B004123FF /* ThreadingPthreads.cpp */, - A8A47338151A825B004123FF /* ThreadRestrictionVerifier.h */, A8A4733E151A825B004123FF /* ThreadSafeRefCounted.h */, A8A4733F151A825B004123FF /* ThreadSpecific.h */, 149EF16216BBFE0D000A4331 /* TriState.h */, @@ -1116,6 +872,7 @@ isa = PBXGroup; children = ( A8A472C5151A825A004123FF /* MainThreadMac.mm */, + 1ACADD821884480100D8B71D /* DeprecatedSymbolsUsedBySafari.mm */, ); path = mac; sourceTree = ""; @@ -1123,6 +880,8 @@ A8A4731B151A825B004123FF /* text */ = { isa = PBXGroup; children = ( + A5BA15F61824359E00A82E69 /* cf */, + A5BA15F11824339F00A82E69 /* mac */, A8A4731C151A825B004123FF /* ASCIIFastPath.h */, A8A4731D151A825B004123FF /* AtomicString.cpp */, A8A4731E151A825B004123FF /* AtomicString.h */, @@ -1148,6 +907,7 @@ A8A4732C151A825B004123FF /* TextPosition.h */, A8A4732D151A825B004123FF /* WTFString.cpp */, A8A4732E151A825B004123FF /* WTFString.h */, + 1A6EB1DF187D0BD30030126F /* StringView.h */, ); path = text; sourceTree = ""; @@ -1186,52 +946,6 @@ path = icu; sourceTree = ""; }; - B647972A18290F1000CCF60F /* Frameworks */ = { - isa = PBXGroup; - children = ( - B647972B18290F1000CCF60F /* Foundation.framework */, - B647973918290F1100CCF60F /* XCTest.framework */, - B647973C18290F1100CCF60F /* UIKit.framework */, - ); - name = Frameworks; - sourceTree = ""; - }; - B647972D18290F1000CCF60F /* xkcd */ = { - isa = PBXGroup; - children = ( - B647973018290F1100CCF60F /* xkcd.h */, - B647973218290F1100CCF60F /* xkcd.m */, - B647972E18290F1100CCF60F /* Supporting Files */, - ); - path = xkcd; - sourceTree = ""; - }; - B647972E18290F1100CCF60F /* Supporting Files */ = { - isa = PBXGroup; - children = ( - B647972F18290F1100CCF60F /* xkcd-Prefix.pch */, - ); - name = "Supporting Files"; - sourceTree = ""; - }; - B647974118290F1100CCF60F /* xkcdTests */ = { - isa = PBXGroup; - children = ( - B647974718290F1100CCF60F /* xkcdTests.m */, - B647974218290F1100CCF60F /* Supporting Files */, - ); - path = xkcdTests; - sourceTree = ""; - }; - B647974218290F1100CCF60F /* Supporting Files */ = { - isa = PBXGroup; - children = ( - B647974318290F1100CCF60F /* xkcdTests-Info.plist */, - B647974418290F1100CCF60F /* InfoPlist.strings */, - ); - name = "Supporting Files"; - sourceTree = ""; - }; /* End PBXGroup section */ /* Begin PBXHeadersBuildPhase section */ @@ -1244,6 +958,7 @@ A8A47387151A825B004123FF /* Assertions.h in Headers */, A8A47388151A825B004123FF /* Atomics.h in Headers */, A8A47436151A825B004123FF /* AtomicString.h in Headers */, + 7CDD7FF8186D291E007433CD /* IteratorAdaptors.h in Headers */, A8A47437151A825B004123FF /* AtomicStringHash.h in Headers */, A8A47438151A825B004123FF /* AtomicStringImpl.h in Headers */, 9BD8F40B176C2B470002D865 /* AtomicStringTable.h in Headers */, @@ -1252,8 +967,8 @@ 8134013915B092FD001FF0B8 /* Base64.h in Headers */, A8A473A9151A825B004123FF /* bignum-dtoa.h in Headers */, A8A473AB151A825B004123FF /* bignum.h in Headers */, + 7CDD7FFA186D2A54007433CD /* IteratorRange.h in Headers */, A8A47452151A825B004123FF /* BinarySemaphore.h in Headers */, - 4F0321BC156AA8D1006EBAF6 /* BitArray.h in Headers */, A8A4738A151A825B004123FF /* Bitmap.h in Headers */, A8A4738C151A825B004123FF /* BitVector.h in Headers */, A8A4738E151A825B004123FF /* BlockStack.h in Headers */, @@ -1289,7 +1004,6 @@ A8A473BB151A825B004123FF /* dtoa.h in Headers */, A8A473BD151A825B004123FF /* DynamicAnnotations.h in Headers */, A8A473C0151A825B004123FF /* Encoder.h in Headers */, - 44F66008171AFAE600E4AD19 /* EnumClass.h in Headers */, A8A473C1151A825B004123FF /* ExportMacros.h in Headers */, A8A473B4151A825B004123FF /* fast-dtoa.h in Headers */, 0FD81AC5154FB22E00983E72 /* FastBitVector.h in Headers */, @@ -1297,7 +1011,6 @@ B38FD7BD168953E80065C969 /* FeatureDefines.h in Headers */, 0F9D3361165DBA73005AD387 /* FilePrintStream.h in Headers */, A8A473B6151A825B004123FF /* fixed-dtoa.h in Headers */, - A8A473C5151A825B004123FF /* FixedArray.h in Headers */, 0F2B66A717B6B4FD00A7AE3F /* FlipBytes.h in Headers */, A8A473C8151A825B004123FF /* Forward.h in Headers */, A8A473C9151A825B004123FF /* Functional.h in Headers */, @@ -1362,6 +1075,7 @@ A8A4741C151A825B004123FF /* RefPtr.h in Headers */, A8A4741D151A825B004123FF /* RefPtrHashMap.h in Headers */, A8A4741E151A825B004123FF /* RetainPtr.h in Headers */, + 2CDED0F418115C85004DBA70 /* RunLoop.h in Headers */, 1469419216EAAF6D0024E146 /* RunLoopTimer.h in Headers */, 14F3B0F715E45E4600210069 /* SaturatedArithmetic.h in Headers */, 1469419616EAAFF80024E146 /* SchedulePair.h in Headers */, @@ -1393,13 +1107,13 @@ A8A4742F151A825B004123FF /* TCPageMap.h in Headers */, A8A47430151A825B004123FF /* TCSpinLock.h in Headers */, A8A47432151A825B004123FF /* TCSystemAlloc.h in Headers */, + 1A6EB1E0187D0BD30030126F /* StringView.h in Headers */, A8A47433151A825B004123FF /* TemporaryChange.h in Headers */, A8A47444151A825B004123FF /* TextPosition.h in Headers */, A8A47447151A825B004123FF /* ThreadFunctionInvocation.h in Headers */, A8A47449151A825B004123FF /* ThreadIdentifierDataPthreads.h in Headers */, A8A4744B151A825B004123FF /* Threading.h in Headers */, A8A4744D151A825B004123FF /* ThreadingPrimitives.h in Headers */, - A8A47450151A825B004123FF /* ThreadRestrictionVerifier.h in Headers */, A8A47454151A825B004123FF /* ThreadSafeRefCounted.h in Headers */, A8A47455151A825B004123FF /* ThreadSpecific.h in Headers */, 149EF16316BBFE0D000A4331 /* TriState.h in Headers */, @@ -1420,191 +1134,6 @@ ); runOnlyForDeploymentPostprocessing = 0; }; - B6F09BEF18290CFA00D62E5F /* Headers */ = { - isa = PBXHeadersBuildPhase; - buildActionMask = 2147483647; - files = ( - B6F09BF018290CFA00D62E5F /* ASCIICType.h in Headers */, - B6F09BF118290CFA00D62E5F /* ASCIIFastPath.h in Headers */, - B6F09BF218290CFA00D62E5F /* Assertions.h in Headers */, - B6F09BF318290CFA00D62E5F /* Atomics.h in Headers */, - B6F09BF418290CFA00D62E5F /* AtomicString.h in Headers */, - B6F09BF518290CFA00D62E5F /* AtomicStringHash.h in Headers */, - B6F09BF618290CFA00D62E5F /* AtomicStringImpl.h in Headers */, - B6F09BF718290CFA00D62E5F /* AtomicStringTable.h in Headers */, - B6F09BF818290CFA00D62E5F /* AutodrainedPool.h in Headers */, - B6F09BF918290CFA00D62E5F /* AVLTree.h in Headers */, - B6F09BFA18290CFA00D62E5F /* Base64.h in Headers */, - B6F09BFB18290CFA00D62E5F /* bignum-dtoa.h in Headers */, - B6F09BFC18290CFA00D62E5F /* bignum.h in Headers */, - B6F09BFD18290CFA00D62E5F /* BinarySemaphore.h in Headers */, - B6F09BFE18290CFA00D62E5F /* BitArray.h in Headers */, - B6F09BFF18290CFA00D62E5F /* Bitmap.h in Headers */, - B6F09C0018290CFA00D62E5F /* BitVector.h in Headers */, - B6F09C0118290CFA00D62E5F /* BlockStack.h in Headers */, - B6F09C0218290CFA00D62E5F /* BloomFilter.h in Headers */, - B6F09C0318290CFA00D62E5F /* BoundsCheckedPointer.h in Headers */, - B6F09C0418290CFA00D62E5F /* BumpPointerAllocator.h in Headers */, - B6F09C0518290CFA00D62E5F /* ByteOrder.h in Headers */, - B6F09C0618290CFA00D62E5F /* cached-powers.h in Headers */, - B6F09C0718290CFA00D62E5F /* CharacterNames.h in Headers */, - B6F09C0818290CFA00D62E5F /* CheckedArithmetic.h in Headers */, - B6F09C0918290CFA00D62E5F /* CheckedBoolean.h in Headers */, - B6F09C0A18290CFA00D62E5F /* Collator.h in Headers */, - B6F09C0B18290CFA00D62E5F /* CommaPrinter.h in Headers */, - B6F09C0C18290CFA00D62E5F /* CompilationThread.h in Headers */, - B6F09C0D18290CFA00D62E5F /* Compiler.h in Headers */, - B6F09C0E18290CFA00D62E5F /* Compression.h in Headers */, - B6F09C0F18290CFA00D62E5F /* config.h in Headers */, - B6F09C1018290CFA00D62E5F /* ConversionMode.h in Headers */, - B6F09C1118290CFA00D62E5F /* CryptographicallyRandomNumber.h in Headers */, - B6F09C1218290CFA00D62E5F /* CString.h in Headers */, - B6F09C1318290CFA00D62E5F /* CurrentTime.h in Headers */, - B6F09C1418290CFA00D62E5F /* DataLog.h in Headers */, - B6F09C1518290CFA00D62E5F /* DateMath.h in Headers */, - B6F09C1618290CFA00D62E5F /* DecimalNumber.h in Headers */, - B6F09C1718290CFA00D62E5F /* Decoder.h in Headers */, - B6F09C1818290CFA00D62E5F /* DeferrableRefCounted.h in Headers */, - B6F09C1918290CFA00D62E5F /* Deque.h in Headers */, - B6F09C1A18290CFA00D62E5F /* DisallowCType.h in Headers */, - B6F09C1B18290CFA00D62E5F /* diy-fp.h in Headers */, - B6F09C1C18290CFA00D62E5F /* double-conversion.h in Headers */, - B6F09C1D18290CFA00D62E5F /* double.h in Headers */, - B6F09C1E18290CFA00D62E5F /* DoublyLinkedList.h in Headers */, - B6F09C1F18290CFA00D62E5F /* dtoa.h in Headers */, - B6F09C2018290CFA00D62E5F /* DynamicAnnotations.h in Headers */, - B6F09C2118290CFA00D62E5F /* Encoder.h in Headers */, - B6F09C2218290CFA00D62E5F /* EnumClass.h in Headers */, - B6F09C2318290CFA00D62E5F /* ExportMacros.h in Headers */, - B6F09C2418290CFA00D62E5F /* fast-dtoa.h in Headers */, - B6F09C2518290CFA00D62E5F /* FastBitVector.h in Headers */, - B6F09C2618290CFA00D62E5F /* FastMalloc.h in Headers */, - B6F09C2718290CFA00D62E5F /* FeatureDefines.h in Headers */, - B6F09C2818290CFA00D62E5F /* FilePrintStream.h in Headers */, - B6F09C2918290CFA00D62E5F /* fixed-dtoa.h in Headers */, - B6F09C2A18290CFA00D62E5F /* FixedArray.h in Headers */, - B6F09C2B18290CFA00D62E5F /* FlipBytes.h in Headers */, - B6F09C2C18290CFA00D62E5F /* Forward.h in Headers */, - B6F09C2D18290CFA00D62E5F /* Functional.h in Headers */, - B6F09C2E18290CFA00D62E5F /* FunctionDispatcher.h in Headers */, - B6F09C2F18290CFA00D62E5F /* GetPtr.h in Headers */, - B6F09C3018290CFA00D62E5F /* GregorianDateTime.h in Headers */, - B6F09C3118290CFA00D62E5F /* HashCountedSet.h in Headers */, - B6F09C3218290CFA00D62E5F /* HashFunctions.h in Headers */, - B6F09C3318290CFA00D62E5F /* HashIterators.h in Headers */, - B6F09C3418290CFA00D62E5F /* HashMap.h in Headers */, - B6F09C3518290CFA00D62E5F /* MallocPtr.h in Headers */, - B6F09C3618290CFA00D62E5F /* HashSet.h in Headers */, - B6F09C3718290CFA00D62E5F /* HashTable.h in Headers */, - B6F09C3818290CFA00D62E5F /* HashTraits.h in Headers */, - B6F09C3918290CFA00D62E5F /* HexNumber.h in Headers */, - B6F09C3A18290CFA00D62E5F /* InlineASM.h in Headers */, - B6F09C3B18290CFA00D62E5F /* Ref.h in Headers */, - B6F09C3C18290CFA00D62E5F /* Insertion.h in Headers */, - B6F09C3D18290CFA00D62E5F /* IntegerToStringConversion.h in Headers */, - B6F09C3E18290CFA00D62E5F /* ListDump.h in Headers */, - B6F09C3F18290CFA00D62E5F /* ListHashSet.h in Headers */, - B6F09C4018290CFA00D62E5F /* Locker.h in Headers */, - B6F09C4118290CFA00D62E5F /* MainThread.h in Headers */, - B6F09C4218290CFA00D62E5F /* MathExtras.h in Headers */, - B6F09C4318290CFA00D62E5F /* PassRef.h in Headers */, - B6F09C4418290CFA00D62E5F /* MD5.h in Headers */, - B6F09C4518290CFA00D62E5F /* MediaTime.h in Headers */, - B6F09C4618290CFA00D62E5F /* MessageQueue.h in Headers */, - B6F09C4718290CFA00D62E5F /* MetaAllocator.h in Headers */, - B6F09C4818290CFA00D62E5F /* MetaAllocatorHandle.h in Headers */, - B6F09C4918290CFA00D62E5F /* NoLock.h in Headers */, - B6F09C4A18290CFA00D62E5F /* Noncopyable.h in Headers */, - B6F09C4B18290CFA00D62E5F /* NumberOfCores.h in Headers */, - B6F09C4C18290CFA00D62E5F /* ObjcRuntimeExtras.h in Headers */, - B6F09C4D18290CFA00D62E5F /* OSAllocator.h in Headers */, - B6F09C4E18290CFA00D62E5F /* OSRandomSource.h in Headers */, - B6F09C4F18290CFA00D62E5F /* OwnPtr.h in Headers */, - B6F09C5018290CFA00D62E5F /* OwnPtrCommon.h in Headers */, - B6F09C5118290CFA00D62E5F /* BagToHashMap.h in Headers */, - B6F09C5218290CFA00D62E5F /* PackedIntVector.h in Headers */, - B6F09C5318290CFA00D62E5F /* PageAllocation.h in Headers */, - B6F09C5418290CFA00D62E5F /* PageAllocationAligned.h in Headers */, - B6F09C5518290CFA00D62E5F /* PageBlock.h in Headers */, - B6F09C5618290CFA00D62E5F /* PageReservation.h in Headers */, - B6F09C5718290CFA00D62E5F /* ParallelJobs.h in Headers */, - B6F09C5818290CFA00D62E5F /* ParallelJobsLibdispatch.h in Headers */, - B6F09C5918290CFA00D62E5F /* PassOwnPtr.h in Headers */, - B6F09C5A18290CFA00D62E5F /* PassRefPtr.h in Headers */, - B6F09C5B18290CFA00D62E5F /* Platform.h in Headers */, - B6F09C5C18290CFA00D62E5F /* PossiblyNull.h in Headers */, - B6F09C5D18290CFA00D62E5F /* Bag.h in Headers */, - B6F09C5E18290CFA00D62E5F /* PrintStream.h in Headers */, - B6F09C5F18290CFA00D62E5F /* ProcessID.h in Headers */, - B6F09C6018290CFA00D62E5F /* RAMSize.h in Headers */, - B6F09C6118290CFA00D62E5F /* RandomNumber.h in Headers */, - B6F09C6218290CFA00D62E5F /* RandomNumberSeed.h in Headers */, - B6F09C6318290CFA00D62E5F /* RawPointer.h in Headers */, - B6F09C6418290CFA00D62E5F /* RedBlackTree.h in Headers */, - B6F09C6518290CFA00D62E5F /* RefCounted.h in Headers */, - B6F09C6618290CFA00D62E5F /* RefCountedArray.h in Headers */, - B6F09C6718290CFA00D62E5F /* RefCountedLeakCounter.h in Headers */, - B6F09C6818290CFA00D62E5F /* RefPtr.h in Headers */, - B6F09C6918290CFA00D62E5F /* RefPtrHashMap.h in Headers */, - B6F09C6A18290CFA00D62E5F /* RetainPtr.h in Headers */, - B6F09C6B18290CFA00D62E5F /* RunLoopTimer.h in Headers */, - B6F09C6C18290CFA00D62E5F /* SaturatedArithmetic.h in Headers */, - B6F09C6D18290CFA00D62E5F /* SchedulePair.h in Headers */, - B6F09C6E18290CFA00D62E5F /* ScriptCodesFromICU.h in Headers */, - B6F09C6F18290CFA00D62E5F /* SegmentedVector.h in Headers */, - B6F09C7018290CFA00D62E5F /* SentinelLinkedList.h in Headers */, - B6F09C7118290CFA00D62E5F /* SHA1.h in Headers */, - B6F09C7218290CFA00D62E5F /* SimpleStats.h in Headers */, - B6F09C7318290CFA00D62E5F /* SinglyLinkedList.h in Headers */, - B6F09C7418290CFA00D62E5F /* SixCharacterHash.h in Headers */, - B6F09C7518290CFA00D62E5F /* Spectrum.h in Headers */, - B6F09C7618290CFA00D62E5F /* StackBounds.h in Headers */, - B6F09C7718290CFA00D62E5F /* StackStats.h in Headers */, - B6F09C7818290CFA00D62E5F /* StaticConstructors.h in Headers */, - B6F09C7918290CFA00D62E5F /* StdLibExtras.h in Headers */, - B6F09C7A18290CFA00D62E5F /* StreamBuffer.h in Headers */, - B6F09C7B18290CFA00D62E5F /* StringBuffer.h in Headers */, - B6F09C7C18290CFA00D62E5F /* StringBuilder.h in Headers */, - B6F09C7D18290CFA00D62E5F /* StringConcatenate.h in Headers */, - B6F09C7E18290CFA00D62E5F /* StringExtras.h in Headers */, - B6F09C7F18290CFA00D62E5F /* StringHash.h in Headers */, - B6F09C8018290CFA00D62E5F /* StringHashDumpContext.h in Headers */, - B6F09C8118290CFA00D62E5F /* StringHasher.h in Headers */, - B6F09C8218290CFA00D62E5F /* StringImpl.h in Headers */, - B6F09C8318290CFA00D62E5F /* StringOperators.h in Headers */, - B6F09C8418290CFA00D62E5F /* StringPrintStream.h in Headers */, - B6F09C8518290CFA00D62E5F /* strtod.h in Headers */, - B6F09C8618290CFA00D62E5F /* TCPackedCache.h in Headers */, - B6F09C8718290CFA00D62E5F /* TCPageMap.h in Headers */, - B6F09C8818290CFA00D62E5F /* TCSpinLock.h in Headers */, - B6F09C8918290CFA00D62E5F /* TCSystemAlloc.h in Headers */, - B6F09C8A18290CFA00D62E5F /* TemporaryChange.h in Headers */, - B6F09C8B18290CFA00D62E5F /* TextPosition.h in Headers */, - B6F09C8C18290CFA00D62E5F /* ThreadFunctionInvocation.h in Headers */, - B6F09C8D18290CFA00D62E5F /* ThreadIdentifierDataPthreads.h in Headers */, - B6F09C8E18290CFA00D62E5F /* Threading.h in Headers */, - B6F09C8F18290CFA00D62E5F /* ThreadingPrimitives.h in Headers */, - B6F09C9018290CFA00D62E5F /* ThreadRestrictionVerifier.h in Headers */, - B6F09C9118290CFA00D62E5F /* ThreadSafeRefCounted.h in Headers */, - B6F09C9218290CFA00D62E5F /* ThreadSpecific.h in Headers */, - B6F09C9318290CFA00D62E5F /* TriState.h in Headers */, - B6F09C9418290CFA00D62E5F /* Unicode.h in Headers */, - B6F09C9518290CFA00D62E5F /* UnicodeIcu.h in Headers */, - B6F09C9618290CFA00D62E5F /* UnicodeMacrosFromICU.h in Headers */, - B6F09C9718290CFA00D62E5F /* UnionFind.h in Headers */, - B6F09C9818290CFA00D62E5F /* UTF8.h in Headers */, - B6F09C9918290CFA00D62E5F /* utils.h in Headers */, - B6F09C9A18290CFA00D62E5F /* ValueCheck.h in Headers */, - B6F09C9B18290CFA00D62E5F /* Vector.h in Headers */, - B6F09C9C18290CFA00D62E5F /* VectorTraits.h in Headers */, - B6F09C9D18290CFA00D62E5F /* VMTags.h in Headers */, - B6F09C9E18290CFA00D62E5F /* WeakPtr.h in Headers */, - B6F09C9F18290CFA00D62E5F /* WebCoreThread.h in Headers */, - B6F09CA018290CFA00D62E5F /* WTFString.h in Headers */, - B6F09CA118290CFA00D62E5F /* WTFThreadData.h in Headers */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; /* End PBXHeadersBuildPhase section */ /* Begin PBXNativeTarget section */ @@ -1626,25 +1155,6 @@ productReference = 5D247B6214689B8600E78B76 /* libWTF.a */; productType = "com.apple.product-type.library.static"; }; - B6F09BA818290CFA00D62E5F /* WTF iOS */ = { - isa = PBXNativeTarget; - buildConfigurationList = B6F09CA218290CFA00D62E5F /* Build configuration list for PBXNativeTarget "WTF iOS" */; - buildPhases = ( - B6F09BAB18290CFA00D62E5F /* Sources */, - B6F09BEE18290CFA00D62E5F /* Frameworks */, - B6F09BEF18290CFA00D62E5F /* Headers */, - B6479758182912B400CCF60F /* ShellScript */, - ); - buildRules = ( - ); - dependencies = ( - B6F09BA918290CFA00D62E5F /* PBXTargetDependency */, - ); - name = "WTF iOS"; - productName = WTF; - productReference = B6F09CA618290CFA00D62E5F /* libWTF.a */; - productType = "com.apple.product-type.library.static"; - }; /* End PBXNativeTarget section */ /* Begin PBXProject section */ @@ -1667,8 +1177,6 @@ targets = ( 5D247B6114689B8600E78B76 /* WTF */, 65AFA16F1630B977003D723C /* Copy WTF Headers */, - B6F09BA818290CFA00D62E5F /* WTF iOS */, - B64797511829123B00CCF60F /* Combine iOS libs */, ); }; /* End PBXProject section */ @@ -1688,32 +1196,6 @@ shellPath = /bin/sh; shellScript = "if [[ \"${DEPLOYMENT_LOCATION}\" == \"NO\" ]]; then\n PRIVATE_HEADERS_PATH=\"${TARGET_BUILD_DIR%/}/${PRIVATE_HEADERS_FOLDER_PATH}\"\nelse\n PRIVATE_HEADERS_PATH=\"${DSTROOT}${INSTALL_PATH_PREFIX%/}/${PRIVATE_HEADERS_FOLDER_PATH}\"\nfi;\n\nmkdir -p \"${PRIVATE_HEADERS_PATH}\"\nrsync -av --no-owner --no-group --prune-empty-dirs --exclude \".svn\" --exclude \"usr\" --exclude \"DerivedSources\" --include \"*/\" --include \"*.h\" --exclude \"*\" \"${SRCROOT}/wtf/\" \"${PRIVATE_HEADERS_PATH}\"\n"; }; - B6479758182912B400CCF60F /* ShellScript */ = { - isa = PBXShellScriptBuildPhase; - buildActionMask = 2147483647; - files = ( - ); - inputPaths = ( - ); - outputPaths = ( - ); - runOnlyForDeploymentPostprocessing = 0; - shellPath = /bin/sh; - shellScript = ""; - }; - B64797591829135600CCF60F /* ShellScript */ = { - isa = PBXShellScriptBuildPhase; - buildActionMask = 2147483647; - files = ( - ); - inputPaths = ( - ); - outputPaths = ( - ); - runOnlyForDeploymentPostprocessing = 0; - shellPath = /bin/sh; - shellScript = "lipo -create \"${BUILD_DIR%%/}/Release-iphoneos/libWTF.a\" \"${BUILD_DIR%%/}/Release-iphonesimulator/libWTF.a\" -output \"${SOURCE_ROOT}/../Build/libWTF.a\"\n"; - }; /* End PBXShellScriptBuildPhase section */ /* Begin PBXSourcesBuildPhase section */ @@ -1724,6 +1206,7 @@ A8A47386151A825B004123FF /* Assertions.cpp in Sources */, A8A47435151A825B004123FF /* AtomicString.cpp in Sources */, 9BC70F05176C379D00101DEC /* AtomicStringTable.cpp in Sources */, + A5BA15FB182435A600A82E69 /* StringCF.cpp in Sources */, 1469419D16EAB10A0024E146 /* AutodrainedPoolMac.mm in Sources */, 8134013815B092FD001FF0B8 /* Base64.cpp in Sources */, A8A473A8151A825B004123FF /* bignum-dtoa.cc in Sources */, @@ -1744,9 +1227,12 @@ A8A473AE151A825B004123FF /* diy-fp.cc in Sources */, A8A473B0151A825B004123FF /* double-conversion.cc in Sources */, A8A473BA151A825B004123FF /* dtoa.cpp in Sources */, + 0F885E0F1845AEA900F1E3FA /* FastBitVector.cpp in Sources */, A8A473BC151A825B004123FF /* DynamicAnnotations.cpp in Sources */, A8A473B3151A825B004123FF /* fast-dtoa.cc in Sources */, A8A473C3151A825B004123FF /* FastMalloc.cpp in Sources */, + A5BA15FC182435A600A82E69 /* StringImplCF.cpp in Sources */, + A5BA15FA182435A600A82E69 /* AtomicStringCF.cpp in Sources */, 0F9D3360165DBA73005AD387 /* FilePrintStream.cpp in Sources */, A8A473B5151A825B004123FF /* fixed-dtoa.cc in Sources */, 1A1D8B9E1731879800141DA4 /* FunctionDispatcher.cpp in Sources */, @@ -1763,11 +1249,15 @@ A8A47400151A825B004123FF /* PageAllocationAligned.cpp in Sources */, A8A47402151A825B004123FF /* PageBlock.cpp in Sources */, 0F9D3362165DBA73005AD387 /* PrintStream.cpp in Sources */, + A5BA15F51824348000A82E69 /* StringImplMac.mm in Sources */, 143F611F1565F0F900DB514A /* RAMSize.cpp in Sources */, A8A47414151A825B004123FF /* RandomNumber.cpp in Sources */, A8A4741A151A825B004123FF /* RefCountedLeakCounter.cpp in Sources */, + 2CDED0F318115C85004DBA70 /* RunLoop.cpp in Sources */, + 2CDED0EF18115C38004DBA70 /* RunLoopCF.cpp in Sources */, 1469419316EAAF6D0024E146 /* RunLoopTimerCF.cpp in Sources */, 1469419916EAB0410024E146 /* SchedulePairCF.cpp in Sources */, + A5BA15F3182433A900A82E69 /* StringMac.mm in Sources */, 1469419716EAAFF80024E146 /* SchedulePairMac.mm in Sources */, A8A47421151A825B004123FF /* SHA1.cpp in Sources */, A748745217A0BDAE00FA04CB /* SixCharacterHash.cpp in Sources */, @@ -1781,6 +1271,7 @@ A8A473B7151A825B004123FF /* strtod.cc in Sources */, A8A47431151A825B004123FF /* TCSystemAlloc.cpp in Sources */, A8A47448151A825B004123FF /* ThreadIdentifierDataPthreads.cpp in Sources */, + 1ACADD841884480100D8B71D /* DeprecatedSymbolsUsedBySafari.mm in Sources */, A8A4744A151A825B004123FF /* Threading.cpp in Sources */, A8A4744E151A825B004123FF /* ThreadingPthreads.cpp in Sources */, A8A47469151A825B004123FF /* UTF8.cpp in Sources */, @@ -1790,79 +1281,6 @@ ); runOnlyForDeploymentPostprocessing = 0; }; - B6F09BAB18290CFA00D62E5F /* Sources */ = { - isa = PBXSourcesBuildPhase; - buildActionMask = 2147483647; - files = ( - B6F09BAC18290CFA00D62E5F /* Assertions.cpp in Sources */, - B6F09BAD18290CFA00D62E5F /* AtomicString.cpp in Sources */, - B6F09BAE18290CFA00D62E5F /* AtomicStringTable.cpp in Sources */, - B6F09BAF18290CFA00D62E5F /* AutodrainedPoolMac.mm in Sources */, - B6F09BB018290CFA00D62E5F /* Base64.cpp in Sources */, - B6F09BB118290CFA00D62E5F /* bignum-dtoa.cc in Sources */, - B6F09BB218290CFA00D62E5F /* bignum.cc in Sources */, - B6F09BB318290CFA00D62E5F /* BinarySemaphore.cpp in Sources */, - B6F09BB418290CFA00D62E5F /* BitVector.cpp in Sources */, - B6F09BB518290CFA00D62E5F /* cached-powers.cc in Sources */, - B6F09BB618290CFA00D62E5F /* CollatorDefault.cpp in Sources */, - B6F09BB718290CFA00D62E5F /* CollatorICU.cpp in Sources */, - B6F09BB818290CFA00D62E5F /* CompilationThread.cpp in Sources */, - B6F09BB918290CFA00D62E5F /* Compression.cpp in Sources */, - B6F09BBA18290CFA00D62E5F /* CryptographicallyRandomNumber.cpp in Sources */, - B6F09BBB18290CFA00D62E5F /* CString.cpp in Sources */, - B6F09BBC18290CFA00D62E5F /* CurrentTime.cpp in Sources */, - B6F09BBD18290CFA00D62E5F /* DataLog.cpp in Sources */, - B6F09BBE18290CFA00D62E5F /* DateMath.cpp in Sources */, - B6F09BBF18290CFA00D62E5F /* DecimalNumber.cpp in Sources */, - B6F09BC018290CFA00D62E5F /* diy-fp.cc in Sources */, - B6F09BC118290CFA00D62E5F /* double-conversion.cc in Sources */, - B6F09BC218290CFA00D62E5F /* dtoa.cpp in Sources */, - B6F09BC318290CFA00D62E5F /* DynamicAnnotations.cpp in Sources */, - B6F09BC418290CFA00D62E5F /* fast-dtoa.cc in Sources */, - B6F09BC518290CFA00D62E5F /* FastMalloc.cpp in Sources */, - B6F09BC618290CFA00D62E5F /* FilePrintStream.cpp in Sources */, - B6F09BC718290CFA00D62E5F /* fixed-dtoa.cc in Sources */, - B6F09BC818290CFA00D62E5F /* FunctionDispatcher.cpp in Sources */, - B6F09BC918290CFA00D62E5F /* GregorianDateTime.cpp in Sources */, - B6F09BCA18290CFA00D62E5F /* HashTable.cpp in Sources */, - B6F09BCB18290CFA00D62E5F /* MainThread.cpp in Sources */, - B6F09BCC18290CFA00D62E5F /* MainThreadMac.mm in Sources */, - B6F09BCD18290CFA00D62E5F /* MD5.cpp in Sources */, - B6F09BCE18290CFA00D62E5F /* MediaTime.cpp in Sources */, - B6F09BCF18290CFA00D62E5F /* MetaAllocator.cpp in Sources */, - B6F09BD018290CFA00D62E5F /* NumberOfCores.cpp in Sources */, - B6F09BD118290CFA00D62E5F /* OSAllocatorPosix.cpp in Sources */, - B6F09BD218290CFA00D62E5F /* OSRandomSource.cpp in Sources */, - B6F09BD318290CFA00D62E5F /* PageAllocationAligned.cpp in Sources */, - B6F09BD418290CFA00D62E5F /* PageBlock.cpp in Sources */, - B6F09BD518290CFA00D62E5F /* PrintStream.cpp in Sources */, - B6F09BD618290CFA00D62E5F /* RAMSize.cpp in Sources */, - B6F09BD718290CFA00D62E5F /* RandomNumber.cpp in Sources */, - B6F09BD818290CFA00D62E5F /* RefCountedLeakCounter.cpp in Sources */, - B6F09BD918290CFA00D62E5F /* RunLoopTimerCF.cpp in Sources */, - B6F09BDA18290CFA00D62E5F /* SchedulePairCF.cpp in Sources */, - B6F09BDB18290CFA00D62E5F /* SchedulePairMac.mm in Sources */, - B6F09BDC18290CFA00D62E5F /* SHA1.cpp in Sources */, - B6F09BDD18290CFA00D62E5F /* SixCharacterHash.cpp in Sources */, - B6F09BDE18290CFA00D62E5F /* SizeLimits.cpp in Sources */, - B6F09BDF18290CFA00D62E5F /* StackBounds.cpp in Sources */, - B6F09BE018290CFA00D62E5F /* StackStats.cpp in Sources */, - B6F09BE118290CFA00D62E5F /* StringBuilder.cpp in Sources */, - B6F09BE218290CFA00D62E5F /* StringImpl.cpp in Sources */, - B6F09BE318290CFA00D62E5F /* StringPrintStream.cpp in Sources */, - B6F09BE418290CFA00D62E5F /* StringStatics.cpp in Sources */, - B6F09BE518290CFA00D62E5F /* strtod.cc in Sources */, - B6F09BE618290CFA00D62E5F /* TCSystemAlloc.cpp in Sources */, - B6F09BE718290CFA00D62E5F /* ThreadIdentifierDataPthreads.cpp in Sources */, - B6F09BE818290CFA00D62E5F /* Threading.cpp in Sources */, - B6F09BE918290CFA00D62E5F /* ThreadingPthreads.cpp in Sources */, - B6F09BEA18290CFA00D62E5F /* UTF8.cpp in Sources */, - B6F09BEB18290CFA00D62E5F /* WebCoreThread.cpp in Sources */, - B6F09BEC18290CFA00D62E5F /* WTFString.cpp in Sources */, - B6F09BED18290CFA00D62E5F /* WTFThreadData.cpp in Sources */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; /* End PBXSourcesBuildPhase section */ /* Begin PBXTargetDependency section */ @@ -1871,29 +1289,8 @@ target = 65AFA16F1630B977003D723C /* Copy WTF Headers */; targetProxy = 65AFA28D1630B99E003D723C /* PBXContainerItemProxy */; }; - B64797571829124500CCF60F /* PBXTargetDependency */ = { - isa = PBXTargetDependency; - target = B6F09BA818290CFA00D62E5F /* WTF iOS */; - targetProxy = B64797561829124500CCF60F /* PBXContainerItemProxy */; - }; - B6F09BA918290CFA00D62E5F /* PBXTargetDependency */ = { - isa = PBXTargetDependency; - target = 65AFA16F1630B977003D723C /* Copy WTF Headers */; - targetProxy = B6F09BAA18290CFA00D62E5F /* PBXContainerItemProxy */; - }; /* End PBXTargetDependency section */ -/* Begin PBXVariantGroup section */ - B647974418290F1100CCF60F /* InfoPlist.strings */ = { - isa = PBXVariantGroup; - children = ( - B647974518290F1100CCF60F /* en */, - ); - name = InfoPlist.strings; - sourceTree = ""; - }; -/* End PBXVariantGroup section */ - /* Begin XCBuildConfiguration section */ 5D247B6414689B8600E78B76 /* Debug */ = { isa = XCBuildConfiguration; @@ -1924,7 +1321,6 @@ isa = XCBuildConfiguration; baseConfigurationReference = 5D247B7314689C4700E78B76 /* WTF.xcconfig */; buildSettings = { - GCC_TREAT_WARNINGS_AS_ERRORS = NO; }; name = Release; }; @@ -1939,7 +1335,6 @@ isa = XCBuildConfiguration; baseConfigurationReference = 5D247B7314689C4700E78B76 /* WTF.xcconfig */; buildSettings = { - GCC_TREAT_WARNINGS_AS_ERRORS = NO; }; name = Production; }; @@ -1967,108 +1362,6 @@ }; name = Production; }; - B64797531829123B00CCF60F /* Debug */ = { - isa = XCBuildConfiguration; - buildSettings = { - PRODUCT_NAME = "$(TARGET_NAME)"; - }; - name = Debug; - }; - B64797541829123B00CCF60F /* Release */ = { - isa = XCBuildConfiguration; - buildSettings = { - PRODUCT_NAME = "$(TARGET_NAME)"; - }; - name = Release; - }; - B64797551829123B00CCF60F /* Production */ = { - isa = XCBuildConfiguration; - buildSettings = { - PRODUCT_NAME = "$(TARGET_NAME)"; - }; - name = Production; - }; - B6F09CA318290CFA00D62E5F /* Debug */ = { - isa = XCBuildConfiguration; - baseConfigurationReference = 5D247B7314689C4700E78B76 /* WTF.xcconfig */; - buildSettings = { - ARCHS = ( - arm64, - armv7s, - armv7, - ); - GCC_GENERATE_DEBUGGING_SYMBOLS = NO; - GCC_PREPROCESSOR_DEFINITIONS = ( - "$(DEBUG_DEFINES)", - "WEBKIT_VERSION_MIN_REQUIRED=WEBKIT_VERSION_LATEST", - HAVE_HEADER_DETECTION_H, - "$(GCC_PREPROCESSOR_DEFINITIONS)", - TARGET_OS_IPHONE, - "__MAC_OS_X_VERSION_MIN_REQUIRED=0", - "UCONFIG_NO_COLLATION=1", - ); - IPHONEOS_DEPLOYMENT_TARGET = 5.1; - PRODUCT_NAME = WTF; - SDKROOT = iphoneos; - SUPPORTED_PLATFORMS = "iphoneos iphonesimulator"; - TARGETED_DEVICE_FAMILY = "1,2"; - }; - name = Debug; - }; - B6F09CA418290CFA00D62E5F /* Release */ = { - isa = XCBuildConfiguration; - baseConfigurationReference = 5D247B7314689C4700E78B76 /* WTF.xcconfig */; - buildSettings = { - ARCHS = ( - arm64, - armv7s, - armv7, - ); - GCC_GENERATE_DEBUGGING_SYMBOLS = NO; - GCC_PREPROCESSOR_DEFINITIONS = ( - "$(DEBUG_DEFINES)", - "WEBKIT_VERSION_MIN_REQUIRED=WEBKIT_VERSION_LATEST", - HAVE_HEADER_DETECTION_H, - "$(GCC_PREPROCESSOR_DEFINITIONS)", - TARGET_OS_IPHONE, - "__MAC_OS_X_VERSION_MIN_REQUIRED=0", - "UCONFIG_NO_COLLATION=1", - ); - IPHONEOS_DEPLOYMENT_TARGET = 5.1; - PRODUCT_NAME = WTF; - SDKROOT = iphoneos; - SUPPORTED_PLATFORMS = "iphoneos iphonesimulator"; - TARGETED_DEVICE_FAMILY = "1,2"; - }; - name = Release; - }; - B6F09CA518290CFA00D62E5F /* Production */ = { - isa = XCBuildConfiguration; - baseConfigurationReference = 5D247B7314689C4700E78B76 /* WTF.xcconfig */; - buildSettings = { - ARCHS = ( - arm64, - armv7s, - armv7, - ); - GCC_GENERATE_DEBUGGING_SYMBOLS = NO; - GCC_PREPROCESSOR_DEFINITIONS = ( - "$(DEBUG_DEFINES)", - "WEBKIT_VERSION_MIN_REQUIRED=WEBKIT_VERSION_LATEST", - HAVE_HEADER_DETECTION_H, - "$(GCC_PREPROCESSOR_DEFINITIONS)", - TARGET_OS_IPHONE, - "__MAC_OS_X_VERSION_MIN_REQUIRED=0", - "UCONFIG_NO_COLLATION=1", - ); - IPHONEOS_DEPLOYMENT_TARGET = 5.1; - PRODUCT_NAME = WTF; - SDKROOT = iphoneos; - SUPPORTED_PLATFORMS = "iphoneos iphonesimulator"; - TARGETED_DEVICE_FAMILY = "1,2"; - }; - name = Production; - }; /* End XCBuildConfiguration section */ /* Begin XCConfigurationList section */ @@ -2102,26 +1395,6 @@ defaultConfigurationIsVisible = 0; defaultConfigurationName = Production; }; - B64797521829123B00CCF60F /* Build configuration list for PBXAggregateTarget "Combine iOS libs" */ = { - isa = XCConfigurationList; - buildConfigurations = ( - B64797531829123B00CCF60F /* Debug */, - B64797541829123B00CCF60F /* Release */, - B64797551829123B00CCF60F /* Production */, - ); - defaultConfigurationIsVisible = 0; - defaultConfigurationName = Production; - }; - B6F09CA218290CFA00D62E5F /* Build configuration list for PBXNativeTarget "WTF iOS" */ = { - isa = XCConfigurationList; - buildConfigurations = ( - B6F09CA318290CFA00D62E5F /* Debug */, - B6F09CA418290CFA00D62E5F /* Release */, - B6F09CA518290CFA00D62E5F /* Production */, - ); - defaultConfigurationIsVisible = 0; - defaultConfigurationName = Production; - }; /* End XCConfigurationList section */ }; rootObject = 5D247B5914689B8600E78B76 /* Project object */; diff --git a/WTF/wtf/AVLTree.h b/WTF/wtf/AVLTree.h index bc3acadd..61d76fb9 100644 --- a/WTF/wtf/AVLTree.h +++ b/WTF/wtf/AVLTree.h @@ -32,8 +32,8 @@ #ifndef AVL_TREE_H_ #define AVL_TREE_H_ +#include #include -#include namespace WTF { @@ -71,7 +71,7 @@ class AVLTreeDefaultBSet { void reset() { for (unsigned i = 0; i < maxDepth; ++i) m_data[i] = false; } private: - FixedArray m_data; + std::array m_data; }; // How to determine maxDepth: diff --git a/WTF/wtf/Assertions.cpp b/WTF/wtf/Assertions.cpp index aa902c66..a3703024 100644 --- a/WTF/wtf/Assertions.cpp +++ b/WTF/wtf/Assertions.cpp @@ -41,7 +41,6 @@ #include #include -#include #include #if HAVE(SIGNAL_H) @@ -70,10 +69,6 @@ #include #endif -#if PLATFORM(BLACKBERRY) -#include -#endif - extern "C" { WTF_ATTRIBUTE_PRINTF(1, 0) @@ -116,8 +111,6 @@ static void vprintf_stderr_common(const char* format, va_list args) // Fall through to write to stderr in the same manner as other platforms. -#elif PLATFORM(BLACKBERRY) - BBLOGV(BlackBerry::Platform::LogLevelCritical, format, args); #elif HAVE(ISDEBUGGERPRESENT) if (IsDebuggerPresent()) { size_t size = 1024; @@ -152,9 +145,7 @@ static void vprintf_stderr_common(const char* format, va_list args) } while (size > 1024); } #endif -#if !PLATFORM(BLACKBERRY) vfprintf(stderr, format, args); -#endif } #if COMPILER(CLANG) || (COMPILER(GCC) && GCC_VERSION_AT_LEAST(4, 6, 0)) @@ -347,6 +338,20 @@ void WTFCrash() ((void(*)())0)(); #endif } + +void WTFCrashWithSecurityImplication() +{ + if (globalHook) + globalHook(); + WTFReportBacktrace(); + *(int *)(uintptr_t)0xfbadbeef = 0; + // More reliable, but doesn't say fbadbeef. +#if COMPILER(CLANG) + __builtin_trap(); +#else + ((void(*)())0)(); +#endif +} #if HAVE(SIGNAL_H) static NO_RETURN void dumpBacktraceSignalHandler(int sig) @@ -428,12 +433,26 @@ void WTFLogVerbose(const char* file, int line, const char* function, WTFLogChann printCallSite(file, line, function); } +void WTFLogAlwaysV(const char* format, va_list args) +{ + vprintf_stderr_with_trailing_newline(format, args); +} + void WTFLogAlways(const char* format, ...) { va_list args; va_start(args, format); - vprintf_stderr_with_trailing_newline(format, args); + WTFLogAlwaysV(format, args); + va_end(args); +} + +void WTFLogAlwaysAndCrash(const char* format, ...) +{ + va_list args; + va_start(args, format); + WTFLogAlwaysV(format, args); va_end(args); + WTFCrash(); } WTFLogChannel* WTFLogChannelByName(WTFLogChannel* channels[], size_t count, const char* name) diff --git a/WTF/wtf/Assertions.h b/WTF/wtf/Assertions.h index be7570af..109fa959 100644 --- a/WTF/wtf/Assertions.h +++ b/WTF/wtf/Assertions.h @@ -36,13 +36,10 @@ Defining any of the symbols explicitly prevents this from having any effect. */ -#include - -#include - -#if !COMPILER(MSVC) #include -#endif +#include +#include +#include #ifdef NDEBUG /* Disable ASSERT* macros in release mode. */ @@ -107,6 +104,20 @@ extern "C" { #endif +/* CRASH() - Raises a fatal error resulting in program termination and triggering either the debugger or the crash reporter. + + Use CRASH() in response to known, unrecoverable errors like out-of-memory. + Macro is enabled in both debug and release mode. + To test for unknown errors and verify assumptions, use ASSERT instead, to avoid impacting performance in release builds. + + Signals are ignored by the crash reporter on OS X so we must do better. +*/ +#if COMPILER(CLANG) +#define NO_RETURN_DUE_TO_CRASH NO_RETURN +#else +#define NO_RETURN_DUE_TO_CRASH +#endif + typedef enum { WTFLogChannelOff, WTFLogChannelOn } WTFLogChannelState; typedef struct { @@ -121,7 +132,9 @@ WTF_EXPORT_PRIVATE void WTFReportFatalError(const char* file, int line, const ch WTF_EXPORT_PRIVATE void WTFReportError(const char* file, int line, const char* function, const char* format, ...) WTF_ATTRIBUTE_PRINTF(4, 5); WTF_EXPORT_PRIVATE void WTFLog(WTFLogChannel*, const char* format, ...) WTF_ATTRIBUTE_PRINTF(2, 3); WTF_EXPORT_PRIVATE void WTFLogVerbose(const char* file, int line, const char* function, WTFLogChannel*, const char* format, ...) WTF_ATTRIBUTE_PRINTF(5, 6); +WTF_EXPORT_PRIVATE void WTFLogAlwaysV(const char* format, va_list); WTF_EXPORT_PRIVATE void WTFLogAlways(const char* format, ...) WTF_ATTRIBUTE_PRINTF(1, 2); +WTF_EXPORT_PRIVATE void WTFLogAlwaysAndCrash(const char* format, ...) WTF_ATTRIBUTE_PRINTF(1, 2) NO_RETURN_DUE_TO_CRASH; WTF_EXPORT_PRIVATE WTFLogChannel* WTFLogChannelByName(WTFLogChannel*[], size_t count, const char*); WTF_EXPORT_PRIVATE void WTFInitializeLogChannelStatesFromString(WTFLogChannel*[], size_t count, const char*); @@ -139,20 +152,6 @@ WTF_EXPORT_PRIVATE void WTFInvokeCrashHook(); } #endif -/* CRASH() - Raises a fatal error resulting in program termination and triggering either the debugger or the crash reporter. - - Use CRASH() in response to known, unrecoverable errors like out-of-memory. - Macro is enabled in both debug and release mode. - To test for unknown errors and verify assumptions, use ASSERT instead, to avoid impacting performance in release builds. - - Signals are ignored by the crash reporter on OS X so we must do better. -*/ -#if COMPILER(CLANG) -#define NO_RETURN_DUE_TO_CRASH NO_RETURN -#else -#define NO_RETURN_DUE_TO_CRASH -#endif - #ifndef CRASH #define CRASH() WTFCrash() #endif @@ -165,6 +164,18 @@ WTF_EXPORT_PRIVATE void WTFCrash() NO_RETURN_DUE_TO_CRASH; } #endif +#ifndef CRASH_WITH_SECURITY_IMPLICATION +#define CRASH_WITH_SECURITY_IMPLICATION() WTFCrashWithSecurityImplication() +#endif + +#ifdef __cplusplus +extern "C" { +#endif + WTF_EXPORT_PRIVATE void WTFCrashWithSecurityImplication() NO_RETURN_DUE_TO_CRASH; +#ifdef __cplusplus +} +#endif + /* BACKTRACE Print a backtrace to the same location as ASSERT messages. @@ -208,12 +219,19 @@ WTF_EXPORT_PRIVATE void WTFCrash() NO_RETURN_DUE_TO_CRASH; #define ASSERT_NOT_REACHED() ((void)0) #define NO_RETURN_DUE_TO_ASSERT -#if COMPILER(INTEL) && !OS(WINDOWS) || COMPILER(RVCT) -template -inline void assertUnused(T& x) { (void)x; } -#define ASSERT_UNUSED(variable, assertion) (assertUnused(variable)) -#else #define ASSERT_UNUSED(variable, assertion) ((void)variable) + +#ifdef ADDRESS_SANITIZER +#define ASSERT_WITH_SECURITY_IMPLICATION(assertion) \ + (!(assertion) ? \ + (WTFReportAssertionFailure(__FILE__, __LINE__, WTF_PRETTY_FUNCTION, #assertion), \ + CRASH_WITH_SECURITY_IMPLICATION()) : \ + (void)0) + +#define ASSERT_WITH_SECURITY_IMPLICATION_DISABLED 0 +#else +#define ASSERT_WITH_SECURITY_IMPLICATION(assertion) ((void)0) +#define ASSERT_WITH_SECURITY_IMPLICATION_DISABLED 1 #endif #else @@ -239,28 +257,20 @@ inline void assertUnused(T& x) { (void)x; } #define NO_RETURN_DUE_TO_ASSERT NO_RETURN_DUE_TO_CRASH -#endif - /* ASSERT_WITH_SECURITY_IMPLICATION - + Failure of this assertion indicates a possible security vulnerability. Class of vulnerabilities that it tests include bad casts, out of bounds accesses, use-after-frees, etc. Please file a bug using the security template - https://bugs.webkit.org/enter_bug.cgi?product=Security. - + */ -#ifdef ADDRESS_SANITIZER - #define ASSERT_WITH_SECURITY_IMPLICATION(assertion) \ (!(assertion) ? \ (WTFReportAssertionFailure(__FILE__, __LINE__, WTF_PRETTY_FUNCTION, #assertion), \ - CRASH()) : \ + CRASH_WITH_SECURITY_IMPLICATION()) : \ (void)0) - -#else - -#define ASSERT_WITH_SECURITY_IMPLICATION(assertion) ASSERT(assertion) - +#define ASSERT_WITH_SECURITY_IMPLICATION_DISABLED 0 #endif /* ASSERT_WITH_MESSAGE */ @@ -279,13 +289,7 @@ while (0) /* ASSERT_WITH_MESSAGE_UNUSED */ #if ASSERT_MSG_DISABLED -#if COMPILER(INTEL) && !OS(WINDOWS) || COMPILER(RVCT) -template -inline void assertWithMessageUnused(T& x) { (void)x; } -#define ASSERT_WITH_MESSAGE_UNUSED(variable, assertion, ...) (assertWithMessageUnused(variable)) -#else #define ASSERT_WITH_MESSAGE_UNUSED(variable, assertion, ...) ((void)variable) -#endif #else #define ASSERT_WITH_MESSAGE_UNUSED(variable, assertion, ...) do \ if (!(assertion)) { \ diff --git a/WTF/wtf/Atomics.cpp b/WTF/wtf/Atomics.cpp index 0feea153..01a4650c 100644 --- a/WTF/wtf/Atomics.cpp +++ b/WTF/wtf/Atomics.cpp @@ -65,7 +65,7 @@ // (http://gcc.gnu.org/bugzilla/show_bug.cgi?id=56296). GCC >= 4.8 will support __atomic_* builtin // functions for this purpose for all the GCC targets, but for current compilers we have to include // our own implementation. -#if COMPILER(GCC) && !defined(__GCC_HAVE_SYNC_COMPARE_AND_SWAP_8) && USE(LOCKFREE_THREADSAFEREFCOUNTED) && USE(PTHREADS) +#if COMPILER(GCC) && !defined(__GCC_HAVE_SYNC_COMPARE_AND_SWAP_8) && USE(PTHREADS) #include "ThreadingPrimitives.h" diff --git a/WTF/wtf/Atomics.h b/WTF/wtf/Atomics.h index 60bb0b20..e4011abf 100644 --- a/WTF/wtf/Atomics.h +++ b/WTF/wtf/Atomics.h @@ -68,8 +68,6 @@ extern "C" void _ReadWriteBarrier(void); #pragma intrinsic(_ReadWriteBarrier) #endif #include -#elif OS(QNX) -#include #endif namespace WTF { @@ -93,12 +91,6 @@ inline int64_t atomicIncrement(int64_t volatile* addend) { return InterlockedInc inline int64_t atomicDecrement(int64_t volatile* addend) { return InterlockedDecrement64(reinterpret_cast(addend)); } #endif -#elif OS(QNX) - -// Note, atomic_{add, sub}_value() return the previous value of addend's content. -inline int atomicIncrement(int volatile* addend) { return static_cast(atomic_add_value(reinterpret_cast(addend), 1)) + 1; } -inline int atomicDecrement(int volatile* addend) { return static_cast(atomic_sub_value(reinterpret_cast(addend), 1)) - 1; } - #elif COMPILER(GCC) inline int atomicIncrement(int volatile* addend) { return __sync_add_and_fetch(addend, 1); } diff --git a/WTF/wtf/BitVector.cpp b/WTF/wtf/BitVector.cpp index 50dbd821..f60856c3 100644 --- a/WTF/wtf/BitVector.cpp +++ b/WTF/wtf/BitVector.cpp @@ -124,6 +124,31 @@ void BitVector::mergeSlow(const BitVector& other) a->bits()[i] |= b->bits()[i]; } +void BitVector::filterSlow(const BitVector& other) +{ + if (other.isInline()) { + ASSERT(!isInline()); + *bits() &= cleanseInlineBits(other.m_bitsOrPointer); + return; + } + + if (isInline()) { + ASSERT(!other.isInline()); + m_bitsOrPointer &= *other.outOfLineBits()->bits(); + m_bitsOrPointer |= (static_cast(1) << maxInlineBits()); + ASSERT(isInline()); + return; + } + + OutOfLineBits* a = outOfLineBits(); + const OutOfLineBits* b = other.outOfLineBits(); + for (unsigned i = std::min(a->numWords(), b->numWords()); i--;) + a->bits()[i] &= b->bits()[i]; + + for (unsigned i = b->numWords(); i < a->numWords(); ++i) + a->bits()[i] = 0; +} + void BitVector::excludeSlow(const BitVector& other) { if (other.isInline()) { diff --git a/WTF/wtf/BitVector.h b/WTF/wtf/BitVector.h index d6eb9f82..77d95f6d 100644 --- a/WTF/wtf/BitVector.h +++ b/WTF/wtf/BitVector.h @@ -181,6 +181,16 @@ class BitVector { ASSERT(isInline()); } + void filter(const BitVector& other) + { + if (!isInline() || !other.isInline()) { + filterSlow(other); + return; + } + m_bitsOrPointer &= other.m_bitsOrPointer; + ASSERT(isInline()); + } + void exclude(const BitVector& other) { if (!isInline() || !other.isInline()) { @@ -302,6 +312,7 @@ class BitVector { WTF_EXPORT_PRIVATE void setSlow(const BitVector& other); WTF_EXPORT_PRIVATE void mergeSlow(const BitVector& other); + WTF_EXPORT_PRIVATE void filterSlow(const BitVector& other); WTF_EXPORT_PRIVATE void excludeSlow(const BitVector& other); WTF_EXPORT_PRIVATE size_t bitCountSlow() const; diff --git a/WTF/wtf/Bitmap.h b/WTF/wtf/Bitmap.h index 492e0b86..7b288f9e 100644 --- a/WTF/wtf/Bitmap.h +++ b/WTF/wtf/Bitmap.h @@ -19,8 +19,8 @@ #ifndef Bitmap_h #define Bitmap_h +#include #include -#include #include #include #include @@ -66,7 +66,7 @@ class Bitmap { // a 64 bit unsigned int would give 0xffff8000 static const WordType one = 1; - FixedArray bits; + std::array bits; }; template @@ -196,7 +196,7 @@ inline size_t Bitmap::count(size_t start) const ++result; } for (size_t i = start / wordSize; i < words; ++i) - result += WTF::bitCount(bits[i]); + result += WTF::bitCount(static_cast(bits[i])); return result; } diff --git a/WTF/wtf/ByteSpinLock.h b/WTF/wtf/ByteSpinLock.h index 228125a5..9ee00333 100644 --- a/WTF/wtf/ByteSpinLock.h +++ b/WTF/wtf/ByteSpinLock.h @@ -26,11 +26,11 @@ #ifndef ByteSpinLock_h #define ByteSpinLock_h +#include #include #include #include #include -#include namespace WTF { @@ -45,7 +45,7 @@ class ByteSpinLock { void lock() { while (!weakCompareAndSwap(&m_lock, 0, 1)) - pauseBriefly(); + std::this_thread::yield(); memoryBarrierAfterLock(); } diff --git a/WTF/wtf/CMakeLists.txt b/WTF/wtf/CMakeLists.txt index b617b7df..56aa1145 100644 --- a/WTF/wtf/CMakeLists.txt +++ b/WTF/wtf/CMakeLists.txt @@ -5,7 +5,6 @@ set(WTF_HEADERS Atomics.h Bag.h BagToHashMap.h - BitArray.h BitVector.h Bitmap.h BoundsCheckedPointer.h @@ -29,7 +28,6 @@ set(WTF_HEADERS FastMalloc.h FeatureDefines.h FilePrintStream.h - FixedArray.h FlipBytes.h Forward.h FunctionDispatcher.h @@ -44,6 +42,8 @@ set(WTF_HEADERS HashTable.h HashTraits.h HexNumber.h + IteratorAdaptors.h + IteratorRange.h ListHashSet.h Locker.h MD5.h @@ -86,6 +86,7 @@ set(WTF_HEADERS RefPtr.h RefPtrHashMap.h RetainPtr.h + RunLoop.h SHA1.h SaturatedArithmetic.h SegmentedVector.h @@ -100,7 +101,6 @@ set(WTF_HEADERS TCSpinLock.h TCSystemAlloc.h ThreadIdentifierDataPthreads.h - ThreadRestrictionVerifier.h ThreadSafeRefCounted.h ThreadSpecific.h Threading.h @@ -133,6 +133,7 @@ set(WTF_HEADERS text/StringBuffer.h text/StringHash.h text/StringImpl.h + text/StringView.h text/WTFString.h threads/BinarySemaphore.h @@ -155,6 +156,7 @@ set(WTF_SOURCES DateMath.cpp DecimalNumber.cpp DynamicAnnotations.cpp + FastBitVector.cpp FastMalloc.cpp FilePrintStream.cpp FunctionDispatcher.cpp @@ -173,6 +175,7 @@ set(WTF_SOURCES RAMSize.cpp RandomNumber.cpp RefCountedLeakCounter.cpp + RunLoop.cpp SHA1.cpp SixCharacterHash.cpp StackBounds.cpp diff --git a/WTF/wtf/CheckedArithmetic.h b/WTF/wtf/CheckedArithmetic.h index 67726e8c..caf66c92 100644 --- a/WTF/wtf/CheckedArithmetic.h +++ b/WTF/wtf/CheckedArithmetic.h @@ -27,7 +27,6 @@ #define CheckedArithmetic_h #include -#include #include #include @@ -67,12 +66,11 @@ namespace WTF { -ENUM_CLASS(CheckedState) -{ +enum class CheckedState { DidOverflow, DidNotOverflow -} ENUM_CLASS_END(CheckedState); - +}; + class CrashOnOverflow { public: static NO_RETURN_DUE_TO_CRASH void overflowed() diff --git a/WTF/wtf/CompilationThread.cpp b/WTF/wtf/CompilationThread.cpp index 355d4292..4b026ac5 100644 --- a/WTF/wtf/CompilationThread.cpp +++ b/WTF/wtf/CompilationThread.cpp @@ -29,21 +29,18 @@ #include "StdLibExtras.h" #include "ThreadSpecific.h" #include "Threading.h" -#include "ThreadingOnce.h" +#include namespace WTF { static ThreadSpecific* s_isCompilationThread; -static void initializeCompilationThreadsOnce() -{ - s_isCompilationThread = new ThreadSpecific(); -} - static void initializeCompilationThreads() { - static ThreadingOnce initializeCompilationThreadsKeyOnce; - initializeCompilationThreadsKeyOnce.callOnce(initializeCompilationThreadsOnce); + static std::once_flag initializeCompilationThreadsOnceFlag; + std::call_once(initializeCompilationThreadsOnceFlag, []{ + s_isCompilationThread = new ThreadSpecific(); + }); } bool isCompilationThread() diff --git a/WTF/wtf/Compiler.h b/WTF/wtf/Compiler.h index 971dd423..d7b958a5 100644 --- a/WTF/wtf/Compiler.h +++ b/WTF/wtf/Compiler.h @@ -54,51 +54,38 @@ #define WTF_COMPILER_SUPPORTS_CXX_STRONG_ENUMS __has_feature(cxx_strong_enums) #define WTF_COMPILER_SUPPORTS_CXX_REFERENCE_QUALIFIED_FUNCTIONS __has_feature(cxx_reference_qualified_functions) #define WTF_COMPILER_SUPPORTS_CXX_AUTO_TYPE __has_feature(cxx_auto_type) - -/* Disable final on versions of Apple clang earlier than 4.2 to avoid bugs like http://webkit.org/b/119165 */ -#if defined(__APPLE__) && (__clang_major__ < 4 || (__clang_major__ == 4 && __clang_minor__ < 2)) -#define WTF_COMPILER_QUIRK_FINAL_IS_BUGGY 1 -// #error "Please use a newer version of Xcode, this version has code generation bugs when using 'final' in C++ code" -#endif +#define WTF_COMPILER_SUPPORTS_CXX_GENERALIZED_INITIALIZERS __has_feature(cxx_generalized_initializers) #endif /* COMPILER(MSVC) - Microsoft Visual C++ */ -/* COMPILER(MSVC9_OR_LOWER) - Microsoft Visual C++ 2008 or lower*/ #if defined(_MSC_VER) -#define WTF_COMPILER_MSVC 1 -#if _MSC_VER < 1600 -#define WTF_COMPILER_MSVC9_OR_LOWER 1 +#if _MSC_VER < 1800 +#error "Please use a newer version of Visual Studio. WebKit requires VS2013 or newere to compile." #endif +#define WTF_COMPILER_MSVC 1 /* Specific compiler features */ -#if !COMPILER(CLANG) && _MSC_VER >= 1600 +#if !COMPILER(CLANG) #define WTF_COMPILER_SUPPORTS_CXX_NULLPTR 1 #endif #if !COMPILER(CLANG) #define WTF_COMPILER_SUPPORTS_CXX_OVERRIDE_CONTROL 1 -#define WTF_COMPILER_QUIRK_FINAL_IS_CALLED_SEALED 1 #endif -/* Check for VS2010 or newer */ -#if _MSC_VER >= 1600 #define WTF_COMPILER_SUPPORTS_CXX_RVALUE_REFERENCES 1 #define WTF_COMPILER_SUPPORTS_CXX_STATIC_ASSERT 1 #define WTF_COMPILER_SUPPORTS_CXX_AUTO_TYPE 1 -#endif +#define WTF_COMPILER_SUPPORTS_CXX_STRONG_ENUMS 1 +#define WTF_COMPILER_SUPPORTS_CXX_OVERRIDE_CONTROL 1 +#define WTF_COMPILER_SUPPORTS_CXX_DELETED_FUNCTIONS 1 +#define WTF_COMPILER_SUPPORTS_CXX_EXPLICIT_CONVERSIONS 1 +#define WTF_COMPILER_SUPPORTS_CXX_GENERALIZED_INITIALIZERS 1 +#define WTF_COMPILER_SUPPORTS_CXX_VARIADIC_TEMPLATES 1 #endif /* defined(_MSC_VER) */ -/* COMPILER(RVCT) - ARM RealView Compilation Tools */ -#if defined(__CC_ARM) || defined(__ARMCC__) -#define WTF_COMPILER_RVCT 1 -#define RVCT_VERSION_AT_LEAST(major, minor, patch, build) (__ARMCC_VERSION >= (major * 100000 + minor * 10000 + patch * 1000 + build)) -#else -/* Define this for !RVCT compilers, just so we can write things like RVCT_VERSION_AT_LEAST(3, 0, 0, 0). */ -#define RVCT_VERSION_AT_LEAST(major, minor, patch, build) 0 -#endif - /* COMPILER(GCCE) - GNU Compiler Collection for Embedded */ #if defined(__GCCE__) #define WTF_COMPILER_GCCE 1 @@ -107,8 +94,7 @@ #endif /* COMPILER(GCC) - GNU Compiler Collection */ -/* --gnu option of the RVCT compiler also defines __GNUC__ */ -#if defined(__GNUC__) && !COMPILER(RVCT) +#if defined(__GNUC__) #define WTF_COMPILER_GCC 1 #define GCC_VERSION (__GNUC__ * 10000 + __GNUC_MINOR__ * 100 + __GNUC_PATCHLEVEL__) #define GCC_VERSION_AT_LEAST(major, minor, patch) (GCC_VERSION >= (major * 10000 + minor * 100 + patch)) @@ -120,7 +106,6 @@ /* Specific compiler features */ #if COMPILER(GCC) && !COMPILER(CLANG) #if GCC_VERSION_AT_LEAST(4, 8, 0) -#pragma GCC diagnostic ignored "-Wunused-local-typedefs" #pragma GCC diagnostic ignored "-Wmaybe-uninitialized" #endif #if defined(__STDC_VERSION__) && __STDC_VERSION__ >= 201112L @@ -147,6 +132,7 @@ #define WTF_COMPILER_SUPPORTS_CXX_STRONG_ENUMS 1 #endif #if GCC_VERSION_AT_LEAST(4, 7, 0) +#pragma GCC diagnostic ignored "-Wunused-local-typedefs" #define WTF_COMPILER_SUPPORTS_CXX_OVERRIDE_CONTROL 1 #endif #endif /* defined(__GXX_EXPERIMENTAL_CXX0X__) || (defined(__cplusplus) && __cplusplus >= 201103L) */ @@ -162,11 +148,6 @@ #endif /* __MINGW64_VERSION_MAJOR */ #endif /* __MINGW32__ */ -/* COMPILER(INTEL) - Intel C++ Compiler */ -#if defined(__INTEL_COMPILER) -#define WTF_COMPILER_INTEL 1 -#endif - /* COMPILER(SUNCC) */ #if defined(__SUNPRO_CC) || defined(__SUNPRO_C) #define WTF_COMPILER_SUNCC 1 @@ -191,6 +172,9 @@ #if !COMPILER_SUPPORTS(CXX_AUTO_TYPE) #error "Please use a compiler that supports C++11 auto." #endif +#if !COMPILER_SUPPORTS(CXX_VARIADIC_TEMPLATES) +#error "Please use a compiler that supports C++11 variadic templates." +#endif #endif /* PURE_FUNCTION */ @@ -206,7 +190,7 @@ #ifndef ALWAYS_INLINE #if COMPILER(GCC) && defined(NDEBUG) && !COMPILER(MINGW) #define ALWAYS_INLINE inline __attribute__((__always_inline__)) -#elif (COMPILER(MSVC) || COMPILER(RVCT)) && defined(NDEBUG) +#elif COMPILER(MSVC) && defined(NDEBUG) #define ALWAYS_INLINE __forceinline #else #define ALWAYS_INLINE inline @@ -219,7 +203,7 @@ #ifndef NEVER_INLINE #if COMPILER(GCC) #define NEVER_INLINE __attribute__((__noinline__)) -#elif COMPILER(RVCT) +#elif COMPILER(MSVC) || COMPILER(RVCT) #define NEVER_INLINE __declspec(noinline) #else #define NEVER_INLINE @@ -230,7 +214,7 @@ /* UNLIKELY */ #ifndef UNLIKELY -#if COMPILER(GCC) || (COMPILER(RVCT) && defined(__GNUC__)) +#if COMPILER(GCC) #define UNLIKELY(x) __builtin_expect(!!(x), 0) #else #define UNLIKELY(x) (x) @@ -241,7 +225,7 @@ /* LIKELY */ #ifndef LIKELY -#if COMPILER(GCC) || (COMPILER(RVCT) && defined(__GNUC__)) +#if COMPILER(GCC) #define LIKELY(x) __builtin_expect(!!(x), 1) #else #define LIKELY(x) (x) @@ -255,7 +239,7 @@ #ifndef NO_RETURN #if COMPILER(GCC) #define NO_RETURN __attribute((__noreturn__)) -#elif COMPILER(MSVC) || COMPILER(RVCT) +#elif COMPILER(MSVC) #define NO_RETURN __declspec(noreturn) #else #define NO_RETURN @@ -329,11 +313,7 @@ /* UNUSED_PARAM */ -#if COMPILER(INTEL) && !(defined(WIN32) || defined(_WIN32)) || COMPILER(RVCT) -template -inline void unusedParam(T& x) { (void)x; } -#define UNUSED_PARAM(variable) unusedParam(variable) -#elif COMPILER(MSVC) +#if COMPILER(MSVC) #define UNUSED_PARAM(variable) (void)&variable #else #define UNUSED_PARAM(variable) (void)variable @@ -351,6 +331,4 @@ inline void unusedParam(T& x) { (void)x; } #define UNUSED_LABEL(label) UNUSED_PARAM(&& label) #endif - - #endif /* WTF_Compiler_h */ diff --git a/WTF/wtf/CurrentTime.cpp b/WTF/wtf/CurrentTime.cpp index 55e2ab35..a50da415 100644 --- a/WTF/wtf/CurrentTime.cpp +++ b/WTF/wtf/CurrentTime.cpp @@ -238,16 +238,6 @@ double currentTime() return ecore_time_unix_get(); } -#elif OS(QNX) - -double currentTime() -{ - struct timespec time; - if (clock_gettime(CLOCK_REALTIME, &time)) - CRASH(); - return time.tv_sec + time.tv_nsec / 1.0e9; -} - #else double currentTime() @@ -286,16 +276,6 @@ double monotonicallyIncreasingTime() return static_cast(g_get_monotonic_time() / 1000000.0); } -#elif OS(QNX) - -double monotonicallyIncreasingTime() -{ - struct timespec time; - if (clock_gettime(CLOCK_MONOTONIC, &time)) - CRASH(); - return time.tv_sec + time.tv_nsec / 1.0e9; -} - #else double monotonicallyIncreasingTime() @@ -338,11 +318,6 @@ double currentCPUTime() GetThreadTimes(GetCurrentThread(), &creationTime, &exitTime, &kernelTime.fileTime, &userTime.fileTime); return userTime.fileTimeAsLong / 10000000. + kernelTime.fileTimeAsLong / 10000000.; -#elif OS(QNX) - struct timespec time; - if (clock_gettime(CLOCK_THREAD_CPUTIME_ID, &time)) - CRASH(); - return time.tv_sec + time.tv_nsec / 1.0e9; #else // FIXME: We should return the time the current thread has spent executing. diff --git a/WTF/wtf/DateMath.cpp b/WTF/wtf/DateMath.cpp index 5f30a4c7..9792023c 100644 --- a/WTF/wtf/DateMath.cpp +++ b/WTF/wtf/DateMath.cpp @@ -102,11 +102,6 @@ #include #endif -#if OS(QNX) -// qnx6 defines timegm in nbutil.h -#include -#endif - using namespace WTF; namespace WTF { @@ -183,8 +178,8 @@ static void appendTwoDigitNumber(StringBuilder& builder, int number) { ASSERT(number >= 0); ASSERT(number < 100); - builder.append('0' + number / 10); - builder.append('0' + number % 10); + builder.append(static_cast('0' + number / 10)); + builder.append(static_cast('0' + number % 10)); } int msToYear(double ms) @@ -411,6 +406,19 @@ static int32_t calculateUTCOffset() #endif } +#if OS(WINDOWS) +// Code taken from http://support.microsoft.com/kb/167296 +static void UnixTimeToFileTime(time_t t, LPFILETIME pft) +{ + // Note that LONGLONG is a 64-bit value + LONGLONG ll; + + ll = Int32x32To64(t, 10000000) + 116444736000000000; + pft->dwLowDateTime = (DWORD)ll; + pft->dwHighDateTime = ll >> 32; +} +#endif + /* * Get the DST offset for the time passed in. */ @@ -420,6 +428,22 @@ static double calculateDSTOffset(time_t localTime, double utcOffset) UNUSED_PARAM(localTime); UNUSED_PARAM(utcOffset); return 0; +#elif OS(WINDOWS) + FILETIME utcFileTime; + UnixTimeToFileTime(localTime, &utcFileTime); + SYSTEMTIME utcSystemTime, localSystemTime; + FileTimeToSystemTime(&utcFileTime, &utcSystemTime); + SystemTimeToTzSpecificLocalTime(0, &utcSystemTime, &localSystemTime); + + double offsetTime = (localTime * msPerSecond) + utcOffset; + + // Offset from UTC but doesn't include DST obviously + int offsetHour = msToHours(offsetTime); + int offsetMinute = msToMinutes(offsetTime); + + double diff = ((localSystemTime.wHour - offsetHour) * secondsPerHour) + ((localSystemTime.wMinute - offsetMinute) * 60); + + return diff * msPerSecond; #else //input is UTC so we have to shift back to local time to determine DST thus the + getUTCOffset() double offsetTime = (localTime * msPerSecond) + utcOffset; diff --git a/WTF/wtf/DisallowCType.h b/WTF/wtf/DisallowCType.h index 89fc170b..072e9ca4 100644 --- a/WTF/wtf/DisallowCType.h +++ b/WTF/wtf/DisallowCType.h @@ -41,7 +41,7 @@ // or , which in turn include which uses // isacii(). #include -#if !(OS(DARWIN) && PLATFORM(GTK)) && !OS(QNX) && !defined(_LIBCPP_VERSION) +#if !(OS(DARWIN) && PLATFORM(GTK)) && !PLATFORM(EFL) && !defined(_LIBCPP_VERSION) && !PLATFORM(NIX) #include diff --git a/WTF/wtf/DoublyLinkedList.h b/WTF/wtf/DoublyLinkedList.h index cd067ef0..64d6d478 100644 --- a/WTF/wtf/DoublyLinkedList.h +++ b/WTF/wtf/DoublyLinkedList.h @@ -82,6 +82,7 @@ template class DoublyLinkedList { void push(T*); void append(T*); void remove(T*); + void append(DoublyLinkedList&); private: T* m_head; @@ -186,6 +187,31 @@ template inline T* DoublyLinkedList::removeHead() return node; } +template inline void DoublyLinkedList::append(DoublyLinkedList& other) +{ + if (!other.head()) + return; + + if (!head()) { + m_head = other.head(); + m_tail = other.tail(); + other.clear(); + return; + } + + ASSERT(tail()); + ASSERT(other.head()); + T* otherHead = other.head(); + T* otherTail = other.tail(); + other.clear(); + + ASSERT(!m_tail->next()); + m_tail->setNext(otherHead); + ASSERT(!otherHead->prev()); + otherHead->setPrev(m_tail); + m_tail = otherTail; +} + } // namespace WTF using WTF::DoublyLinkedListNode; diff --git a/WTF/wtf/EnumClass.h b/WTF/wtf/EnumClass.h deleted file mode 100644 index a5729b3b..00000000 --- a/WTF/wtf/EnumClass.h +++ /dev/null @@ -1,134 +0,0 @@ -/* - * Copyright (C) 2013 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. - */ - -#ifndef WTF_EnumClass_h -#define WTF_EnumClass_h - -#include - -namespace WTF { - -// How to define a type safe enum list using the ENUM_CLASS macros? -// =============================================================== -// To get an enum list like this: -// -// enum class MyEnums { -// Value1, -// Value2, -// ... -// ValueN -// }; -// -// ... write this: -// -// ENUM_CLASS(MyEnums) { -// Value1, -// Value2, -// ... -// ValueN -// } ENUM_CLASS_END(MyEnums); -// -// The ENUM_CLASS macros will use C++11's enum class if the compiler supports it. -// Otherwise, it will use the EnumClass template below. - -#if COMPILER_SUPPORTS(CXX_STRONG_ENUMS) - -#define ENUM_CLASS(__enumName) \ - enum class __enumName - -#define ENUM_CLASS_END(__enumName) - -#else // !COMPILER_SUPPORTS(CXX_STRONG_ENUMS) - -// How to define a type safe enum list using the EnumClass template? -// ================================================================ -// Definition should be a struct that encapsulates an enum list. -// The enum list should be names Enums. -// -// Here's an example of how to define a type safe enum named MyEnum using -// the EnumClass template: -// -// struct MyEnumDefinition { -// enum Enums { -// ValueDefault, -// Value1, -// ... -// ValueN -// }; -// }; -// typedef EnumClass MyEnum; -// -// With that, you can now use MyEnum enum values as follow: -// -// MyEnum value1; // value1 is assigned MyEnum::ValueDefault by default. -// MyEnum value2 = MyEnum::Value1; // value2 is assigned MyEnum::Value1; - -template -class EnumClass : public Definition { - typedef enum Definition::Enums Value; -public: - ALWAYS_INLINE EnumClass() { } - ALWAYS_INLINE EnumClass(Value value) : m_value(value) { } - - ALWAYS_INLINE Value value() const { return m_value; } - - ALWAYS_INLINE bool operator==(const EnumClass other) { return m_value == other.m_value; } - ALWAYS_INLINE bool operator!=(const EnumClass other) { return m_value != other.m_value; } - ALWAYS_INLINE bool operator<(const EnumClass other) { return m_value < other.m_value; } - ALWAYS_INLINE bool operator<=(const EnumClass other) { return m_value <= other.m_value; } - ALWAYS_INLINE bool operator>(const EnumClass other) { return m_value > other.m_value; } - ALWAYS_INLINE bool operator>=(const EnumClass other) { return m_value >= other.m_value; } - - ALWAYS_INLINE bool operator==(const Value value) { return m_value == value; } - ALWAYS_INLINE bool operator!=(const Value value) { return m_value != value; } - ALWAYS_INLINE bool operator<(const Value value) { return m_value < value; } - ALWAYS_INLINE bool operator<=(const Value value) { return m_value <= value; } - ALWAYS_INLINE bool operator>(const Value value) { return m_value > value; } - ALWAYS_INLINE bool operator>=(const Value value) { return m_value >= value; } - - ALWAYS_INLINE operator Value() { return m_value; } - -private: - Value m_value; -}; - -#define ENUM_CLASS(__enumName) \ - struct __enumName ## Definition { \ - enum Enums - -#define ENUM_CLASS_END(__enumName) \ - ; \ - }; \ - typedef EnumClass< __enumName ## Definition > __enumName - -#endif // !COMPILER_SUPPORTS(CXX_STRONG_ENUMS) - -} // namespace WTF - -#if !COMPILER_SUPPORTS(CXX_STRONG_ENUMS) -using WTF::EnumClass; -#endif - -#endif // WTF_EnumClass_h diff --git a/WTF/wtf/BitArray.h b/WTF/wtf/FastBitVector.cpp similarity index 65% rename from WTF/wtf/BitArray.h rename to WTF/wtf/FastBitVector.cpp index 9ad1e0a1..3abccea7 100644 --- a/WTF/wtf/BitArray.h +++ b/WTF/wtf/FastBitVector.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2012 Apple Inc. All rights reserved. + * Copyright (C) 2013 Apple Inc. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -23,40 +23,18 @@ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -#ifndef BitArray_h -#define BitArray_h +#include "config.h" +#include "FastBitVector.h" -#include -#include +#include "PrintStream.h" namespace WTF { -template -class BitArray { -public: - BitArray() - { - memset(m_data, 0, sizeof(m_data)); - } - - void set(unsigned index) - { - ASSERT_WITH_SECURITY_IMPLICATION(index < arraySize); - m_data[index / 8] |= 1 << (index & 7); - } - - bool get(unsigned index) const - { - ASSERT_WITH_SECURITY_IMPLICATION(index < arraySize); - return !!(m_data[index / 8] & (1 << (index & 7))); - } - -private: - unsigned char m_data[arraySize / 8 + 1]; -}; +void FastBitVector::dump(PrintStream& out) const +{ + for (unsigned i = 0; i < m_numBits; ++i) + out.print(get(i) ? "1" : "-"); +} } // namespace WTF -using WTF::BitArray; - -#endif // BitArray_h diff --git a/WTF/wtf/FastBitVector.h b/WTF/wtf/FastBitVector.h index 8c8f3d21..f96180d9 100644 --- a/WTF/wtf/FastBitVector.h +++ b/WTF/wtf/FastBitVector.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2012 Apple Inc. All rights reserved. + * Copyright (C) 2012, 2013 Apple Inc. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -26,11 +26,14 @@ #ifndef FastBitVector_h #define FastBitVector_h +#include #include #include namespace WTF { +class PrintStream; + class FastBitVector { public: FastBitVector() @@ -71,7 +74,7 @@ class FastBitVector { // Use fastCalloc instead of fastRealloc because we expect the common // use case for this method to be initializing the size of the bitvector. - size_t newLength = (numBits + 31) >> 5; + size_t newLength = arrayLength(numBits); uint32_t* newArray = static_cast(fastCalloc(newLength, 4)); memcpy(newArray, m_array, arrayLength() * 4); if (m_array) @@ -165,8 +168,20 @@ class FastBitVector { ASSERT_WITH_SECURITY_IMPLICATION(i < m_numBits); return !!(m_array[i >> 5] & (1 << (i & 31))); } + + size_t bitCount() const + { + size_t result = 0; + for (unsigned i = arrayLength(); i--;) + result += WTF::bitCount(m_array[i]); + return result; + } + + WTF_EXPORT_PRIVATE void dump(PrintStream&) const; + private: - size_t arrayLength() const { return (m_numBits + 31) >> 5; } + static size_t arrayLength(size_t numBits) { return (numBits + 31) >> 5; } + size_t arrayLength() const { return arrayLength(m_numBits); } uint32_t* m_array; // No, this can't be an std::unique_ptr. size_t m_numBits; diff --git a/WTF/wtf/FastMalloc.cpp b/WTF/wtf/FastMalloc.cpp index f115c6d1..dcf0937b 100644 --- a/WTF/wtf/FastMalloc.cpp +++ b/WTF/wtf/FastMalloc.cpp @@ -1506,7 +1506,7 @@ class FastMallocZone { }; // This method declaration, and the constants below, are taken from Libc/gen/malloc.c. -//extern "C" void (*malloc_logger)(uint32_t typeFlags, uintptr_t zone, uintptr_t size, uintptr_t pointer, uintptr_t returnValue, uint32_t numberOfFramesToSkip); +extern "C" void (*malloc_logger)(uint32_t typeFlags, uintptr_t zone, uintptr_t size, uintptr_t pointer, uintptr_t returnValue, uint32_t numberOfFramesToSkip); #endif @@ -1522,13 +1522,7 @@ class MallocHook { static void record(uint32_t typeFlags, uintptr_t zone, uintptr_t size, void* pointer, void* returnValue, uint32_t numberOfFramesToSkip) { - #pragma unused (typeFlags) - #pragma unused (zone) - #pragma unused (size) - #pragma unused (pointer) - #pragma unused (returnValue) - #pragma unused (numberOfFramesToSkip) -// malloc_logger(typeFlags, zone, size, reinterpret_cast(pointer), reinterpret_cast(returnValue), numberOfFramesToSkip); + malloc_logger(typeFlags, zone, size, reinterpret_cast(pointer), reinterpret_cast(returnValue), numberOfFramesToSkip); } static NEVER_INLINE void recordAllocation(void* pointer, size_t size) @@ -1551,7 +1545,7 @@ class MallocHook { { #if OS(DARWIN) // If the system allocator's malloc_logger has been set up then stack logging is enabled. -// stackLoggingEnabled = malloc_logger; + stackLoggingEnabled = malloc_logger; #endif } diff --git a/WTF/wtf/FastMalloc.h b/WTF/wtf/FastMalloc.h index ac68b117..f04dc97d 100644 --- a/WTF/wtf/FastMalloc.h +++ b/WTF/wtf/FastMalloc.h @@ -242,7 +242,7 @@ using WTF::fastMallocAllow; #define WTF_PRIVATE_INLINE __private_extern__ inline __attribute__((always_inline)) #elif COMPILER(GCC) #define WTF_PRIVATE_INLINE inline __attribute__((always_inline)) -#elif COMPILER(MSVC) || COMPILER(RVCT) +#elif COMPILER(MSVC) #define WTF_PRIVATE_INLINE __forceinline #else #define WTF_PRIVATE_INLINE inline @@ -262,6 +262,13 @@ using WTF::fastMallocAllow; #if COMPILER(MSVC) #pragma warning(push) #pragma warning(disable: 4290) // Disable the C++ exception specification ignored warning. +#elif COMPILER(CLANG) && defined(__has_warning) +#pragma clang diagnostic push +#if __has_warning("-Winline-new-delete") +// FIXME: The operator new, delete definitions cannot be inline per replacement.functions (17.6.4.6/3) of the C++ +// standard. As a workaround, disable warnings for such usage. See . +#pragma clang diagnostic ignored "-Winline-new-delete" +#endif #endif WTF_PRIVATE_INLINE void* operator new(size_t size) throw (std::bad_alloc) { return fastMalloc(size); } WTF_PRIVATE_INLINE void* operator new(size_t size, const std::nothrow_t&) throw() { return fastMalloc(size); } @@ -273,12 +280,14 @@ WTF_PRIVATE_INLINE void operator delete[](void* p) throw() { fastFree(p); } WTF_PRIVATE_INLINE void operator delete[](void* p, const std::nothrow_t&) throw() { fastFree(p); } #if COMPILER(MSVC) #pragma warning(pop) +#elif COMPILER(CLANG) && defined(__has_warning) +#pragma clang diagnostic pop #endif #endif // ENABLE(GLOBAL_FASTMALLOC_NEW) #endif // !defined(_CRTDBG_MAP_ALLOC) && !(defined(USE_SYSTEM_MALLOC) && USE_SYSTEM_MALLOC) -#define WTF_MAKE_FAST_ALLOCATED \ +#define WTF_FASTMALLOC_OPERATORS \ public: \ void* operator new(size_t, void* p) { return p; } \ void* operator new[](size_t, void* p) { return p; } \ @@ -316,4 +325,11 @@ public: \ private: \ typedef int __thisIsHereToForceASemicolonAfterThisMacro +#if ENABLE(GLOBAL_FASTMALLOC_NEW) +#define WTF_MAKE_FAST_ALLOCATED +#else +#define WTF_MAKE_FAST_ALLOCATED WTF_FASTMALLOC_OPERATORS +#endif + + #endif /* WTF_FastMalloc_h */ diff --git a/WTF/wtf/FeatureDefines.h b/WTF/wtf/FeatureDefines.h index be38232e..1d041633 100644 --- a/WTF/wtf/FeatureDefines.h +++ b/WTF/wtf/FeatureDefines.h @@ -56,6 +56,10 @@ /* PLATFORM(MAC) is always enabled when PLATFORM(IOS) is enabled. */ #if PLATFORM(IOS) +#if !defined(ENABLE_ASYNC_SCROLLING) +#define ENABLE_ASYNC_SCROLLING 1 +#endif + #if !defined(ENABLE_8BIT_TEXTRUN) #define ENABLE_8BIT_TEXTRUN 1 #endif @@ -68,6 +72,10 @@ #define ENABLE_CSS_IMAGE_SET 1 #endif +#if !defined(ENABLE_CURSOR_SUPPORT) +#define ENABLE_CURSOR_SUPPORT 0 +#endif + #if !defined(ENABLE_DISK_IMAGE_CACHE) #define ENABLE_DISK_IMAGE_CACHE 1 #endif @@ -84,18 +92,26 @@ #define ENABLE_ICONDATABASE 0 #endif -#if !defined(ENABLE_IOS_GESTURE_EVENTS) -#define ENABLE_IOS_GESTURE_EVENTS 1 -#endif - #if !defined(ENABLE_LETTERPRESS) #define ENABLE_LETTERPRESS 1 #endif +#if !defined(ENABLE_IOS_AUTOCORRECT_AND_AUTOCAPITALIZE) +#define ENABLE_IOS_AUTOCORRECT_AND_AUTOCAPITALIZE 1 +#endif + +#if !defined(ENABLE_IOS_GESTURE_EVENTS) +#define ENABLE_IOS_GESTURE_EVENTS 1 +#endif + #if !defined(ENABLE_IOS_TEXT_AUTOSIZING) #define ENABLE_IOS_TEXT_AUTOSIZING 1 #endif +#if !defined(ENABLE_IOS_TOUCH_EVENTS) +#define ENABLE_IOS_TOUCH_EVENTS 1 +#endif + #if !defined(ENABLE_METER_ELEMENT) #define ENABLE_METER_ELEMENT 0 #endif @@ -128,6 +144,10 @@ #define ENABLE_TEXT_CARET 0 #endif +#if !defined(ENABLE_TEXT_SELECTION) +#define ENABLE_TEXT_SELECTION 0 +#endif + #if !defined(ENABLE_TOUCH_EVENTS) #define ENABLE_TOUCH_EVENTS 1 #endif @@ -190,8 +210,8 @@ #define ENABLE_SMOOTH_SCROLLING 1 #endif -#if !defined(ENABLE_THREADED_SCROLLING) -#define ENABLE_THREADED_SCROLLING 1 +#if !defined(ENABLE_ASYNC_SCROLLING) +#define ENABLE_ASYNC_SCROLLING 1 #endif #if ENABLE(VIDEO) @@ -281,6 +301,11 @@ #endif /* PLATFORM(WIN_CAIRO) */ +/* --------- NIX port (Unix) --------- */ +#if PLATFORM(NIX) +#include "nix/FeatureDefinesNix.h" +#endif /* PLATFORM(NIX) */ + /* --------- EFL port (Unix) --------- */ #if PLATFORM(EFL) @@ -313,15 +338,6 @@ #endif /* PLATFORM(GTK) */ -/* --------- Blackberry port (QNX) --------- */ -#if PLATFORM(BLACKBERRY) - -#if !defined(ENABLE_BLACKBERRY_CREDENTIAL_PERSIST) -#define ENABLE_BLACKBERRY_CREDENTIAL_PERSIST 1 -#endif - -#endif /* PLATFORM(BLACKBERRY) */ - /* ENABLE macro defaults for WebCore */ /* Do not use PLATFORM() tests in this section ! */ @@ -417,8 +433,8 @@ #define ENABLE_CSS_TRANSFORMS_ANIMATIONS_TRANSITIONS_UNPREFIXED 0 #endif -#if !defined(ENABLE_CSS_VARIABLES) -#define ENABLE_CSS_VARIABLES 0 +#if !defined(ENABLE_CURSOR_SUPPORT) +#define ENABLE_CURSOR_SUPPORT 1 #endif #if !defined(ENABLE_CUSTOM_SCHEME_HANDLER) @@ -501,10 +517,6 @@ #define ENABLE_GEOLOCATION 0 #endif -#if !defined(ENABLE_GLIB_SUPPORT) -#define ENABLE_GLIB_SUPPORT 0 -#endif - #if !defined(ENABLE_HIDDEN_PAGE_DOM_TIMER_THROTTLING) #define ENABLE_HIDDEN_PAGE_DOM_TIMER_THROTTLING 0 #endif @@ -599,6 +611,10 @@ #define ENABLE_LEGACY_VIEWPORT_ADAPTION 0 #endif +#if !defined(ENABLE_LETTERPRESS) +#define ENABLE_LETTERPRESS 0 +#endif + #if !defined(ENABLE_LINK_PREFETCH) #define ENABLE_LINK_PREFETCH 0 #endif @@ -776,7 +792,7 @@ #endif #if !defined(ENABLE_TEMPLATE_ELEMENT) -#define ENABLE_TEMPLATE_ELEMENT 0 +#define ENABLE_TEMPLATE_ELEMENT 1 #endif #if !defined(ENABLE_TEXT_AUTOSIZING) @@ -787,12 +803,16 @@ #define ENABLE_TEXT_CARET 1 #endif +#if !defined(ENABLE_TEXT_SELECTION) +#define ENABLE_TEXT_SELECTION 1 +#endif + #if !defined(ENABLE_THREADED_HTML_PARSER) #define ENABLE_THREADED_HTML_PARSER 0 #endif -#if !defined(ENABLE_THREADED_SCROLLING) -#define ENABLE_THREADED_SCROLLING 0 +#if !defined(ENABLE_ASYNC_SCROLLING) +#define ENABLE_ASYNC_SCROLLING 0 #endif #if !defined(ENABLE_TOUCH_EVENTS) @@ -843,6 +863,10 @@ #define ENABLE_WEB_AUDIO 0 #endif +#if !defined(ENABLE_WEB_REPLAY) +#define ENABLE_WEB_REPLAY 0 +#endif + #if !defined(ENABLE_WEB_SOCKETS) #define ENABLE_WEB_SOCKETS 1 #endif @@ -851,10 +875,6 @@ #define ENABLE_WEB_TIMING 0 #endif -#if !defined(ENABLE_WORKERS) -#define ENABLE_WORKERS 0 -#endif - #if !defined(ENABLE_XHR_TIMEOUT) #define ENABLE_XHR_TIMEOUT 0 #endif @@ -885,4 +905,8 @@ #error "ENABLE(REMOTE_INSPECTOR) requires ENABLE(INSPECTOR)" #endif +#if ENABLE(IOS_TOUCH_EVENTS) && !ENABLE(TOUCH_EVENTS) +#error "ENABLE(IOS_TOUCH_EVENTS) requires ENABLE(TOUCH_EVENTS)" +#endif + #endif /* WTF_FeatureDefines_h */ diff --git a/WTF/wtf/Forward.h b/WTF/wtf/Forward.h index f1c223ff..215247fa 100644 --- a/WTF/wtf/Forward.h +++ b/WTF/wtf/Forward.h @@ -26,6 +26,7 @@ namespace WTF { template class Function; +template class NeverDestroyed; template class OwnPtr; template class PassOwnPtr; template class PassRef; @@ -47,6 +48,7 @@ class PrintStream; class String; class StringBuilder; class StringImpl; +class StringView; } @@ -58,6 +60,7 @@ using WTF::Decoder; using WTF::Encoder; using WTF::Function; using WTF::FunctionDispatcher; +using WTF::NeverDestroyed; using WTF::OwnPtr; using WTF::PassOwnPtr; using WTF::PassRef; @@ -69,6 +72,7 @@ using WTF::String; using WTF::StringBuffer; using WTF::StringBuilder; using WTF::StringImpl; +using WTF::StringView; using WTF::Vector; #endif // WTF_Forward_h diff --git a/WTF/wtf/HashFunctions.h b/WTF/wtf/HashFunctions.h index 98da9e95..471a8f37 100644 --- a/WTF/wtf/HashFunctions.h +++ b/WTF/wtf/HashFunctions.h @@ -122,14 +122,7 @@ namespace WTF { template struct PtrHash { static unsigned hash(T key) { -#if COMPILER(MSVC) -#pragma warning(push) -#pragma warning(disable: 4244) // work around what seems to be a bug in MSVC's conversion warnings -#endif return IntHash::hash(reinterpret_cast(key)); -#if COMPILER(MSVC) -#pragma warning(pop) -#endif } static bool equal(T a, T b) { return a == b; } static const bool safeToCompareToEmptyOrDeleted = true; @@ -177,7 +170,7 @@ namespace WTF { template<> struct DefaultHash { typedef IntHash Hash; }; template<> struct DefaultHash { typedef IntHash Hash; }; -#if !COMPILER(MSVC) || defined(_NATIVE_WCHAR_T_DEFINED) +#if defined(_NATIVE_WCHAR_T_DEFINED) template<> struct DefaultHash { typedef IntHash Hash; }; #endif diff --git a/WTF/wtf/HashMap.h b/WTF/wtf/HashMap.h index c46f76e3..dbd17b42 100644 --- a/WTF/wtf/HashMap.h +++ b/WTF/wtf/HashMap.h @@ -22,6 +22,7 @@ #define WTF_HashMap_h #include +#include namespace WTF { @@ -67,6 +68,18 @@ class HashMap { typedef typename HashTableType::AddResult AddResult; public: + HashMap() + { + } + +#if COMPILER_SUPPORTS(CXX_GENERALIZED_INITIALIZERS) + HashMap(std::initializer_list initializerList) + { + for (const auto& keyValuePair : initializerList) + add(keyValuePair.key, keyValuePair.value); + } +#endif + void swap(HashMap&); int size() const; @@ -79,11 +92,11 @@ class HashMap { const_iterator begin() const; const_iterator end() const; - HashMapKeysProxy& keys() { return static_cast(*this); } - const HashMapKeysProxy& keys() const { return static_cast(*this); } + IteratorRange keys() { return makeIteratorRange(begin().keys(), end().keys()); } + const IteratorRange keys() const { return makeIteratorRange(begin().keys(), end().keys()); } - HashMapValuesProxy& values() { return static_cast(*this); } - const HashMapValuesProxy& values() const { return static_cast(*this); } + IteratorRange values() { return makeIteratorRange(begin().values(), end().values()); } + const IteratorRange values() const { return makeIteratorRange(begin().values(), end().values()); } iterator find(const KeyType&); const_iterator find(const KeyType&) const; @@ -139,81 +152,6 @@ class HashMap { HashTableType m_impl; }; -template -class HashMap::HashMapKeysProxy : - private HashMap { - public: - typedef HashMap HashMapType; - typedef typename HashMapType::iterator::Keys iterator; - typedef typename HashMapType::const_iterator::Keys const_iterator; - - iterator begin() - { - return HashMapType::begin().keys(); - } - - iterator end() - { - return HashMapType::end().keys(); - } - - const_iterator begin() const - { - return HashMapType::begin().keys(); - } - - const_iterator end() const - { - return HashMapType::end().keys(); - } - - private: - friend class HashMap; - - HashMapKeysProxy() WTF_DELETED_FUNCTION; - HashMapKeysProxy(const HashMapKeysProxy&) WTF_DELETED_FUNCTION; - HashMapKeysProxy& operator=(const HashMapKeysProxy&) WTF_DELETED_FUNCTION; - ~HashMapKeysProxy() WTF_DELETED_FUNCTION; -}; - -template -class HashMap::HashMapValuesProxy : - private HashMap { - public: - typedef HashMap HashMapType; - typedef typename HashMapType::iterator::Values iterator; - typedef typename HashMapType::const_iterator::Values const_iterator; - - iterator begin() - { - return HashMapType::begin().values(); - } - - iterator end() - { - return HashMapType::end().values(); - } - - const_iterator begin() const - { - return HashMapType::begin().values(); - } - - const_iterator end() const - { - return HashMapType::end().values(); - } - - private: - friend class HashMap; - - // These are intentionally not implemented. - HashMapValuesProxy() WTF_DELETED_FUNCTION; - HashMapValuesProxy(const HashMapValuesProxy&) WTF_DELETED_FUNCTION; - HashMapValuesProxy& operator=(const HashMapValuesProxy&) WTF_DELETED_FUNCTION; - ~HashMapValuesProxy() WTF_DELETED_FUNCTION; -}; - template struct HashMapTranslator { template static unsigned hash(const T& key) { return HashFunctions::hash(key); } diff --git a/WTF/wtf/HashSet.h b/WTF/wtf/HashSet.h index 7408f4e7..46c3fe5d 100644 --- a/WTF/wtf/HashSet.h +++ b/WTF/wtf/HashSet.h @@ -21,6 +21,7 @@ #ifndef WTF_HashSet_h #define WTF_HashSet_h +#include #include #include @@ -49,6 +50,16 @@ namespace WTF { typedef HashTableConstIteratorAdapter const_iterator; typedef typename HashTableType::AddResult AddResult; + HashSet() + { + } + + HashSet(std::initializer_list initializerList) + { + for (const auto& value : initializerList) + add(value); + } + void swap(HashSet&); int size() const; diff --git a/WTF/wtf/HashTable.cpp b/WTF/wtf/HashTable.cpp index 518a4c8c..a578f52f 100644 --- a/WTF/wtf/HashTable.cpp +++ b/WTF/wtf/HashTable.cpp @@ -19,7 +19,9 @@ #include "config.h" #include "HashTable.h" + #include "DataLog.h" +#include namespace WTF { @@ -33,15 +35,21 @@ int HashTableStats::numRehashes; int HashTableStats::numRemoves; int HashTableStats::numReinserts; -static Mutex& hashTableStatsMutex() +static std::mutex& hashTableStatsMutex() { - AtomicallyInitializedStatic(Mutex&, mutex = *new Mutex); - return mutex; + static std::once_flag onceFlag; + static std::mutex* mutex; + std::call_once(onceFlag, []{ + mutex = std::make_unique().release(); + }); + + return *mutex; } void HashTableStats::recordCollisionAtCount(int count) { - MutexLocker lock(hashTableStatsMutex()); + std::lock_guard lock(hashTableStatsMutex()); + if (count > maxCollisions) maxCollisions = count; numCollisions++; @@ -50,7 +58,7 @@ void HashTableStats::recordCollisionAtCount(int count) void HashTableStats::dumpStats() { - MutexLocker lock(hashTableStatsMutex()); + std::lock_guard lock(hashTableStatsMutex()); dataLogF("\nWTF::HashTable statistics\n\n"); dataLogF("%d accesses\n", numAccesses); diff --git a/WTF/wtf/InlineASM.h b/WTF/wtf/InlineASM.h index 0a2fe78b..ffda698e 100644 --- a/WTF/wtf/InlineASM.h +++ b/WTF/wtf/InlineASM.h @@ -82,8 +82,7 @@ #elif OS(LINUX) \ || OS(FREEBSD) \ || OS(OPENBSD) \ - || OS(NETBSD) \ - || OS(QNX) + || OS(NETBSD) // GNU as-compatible syntax. #define LOCAL_LABEL_STRING(name) ".L" #name #endif diff --git a/WTF/wtf/IteratorAdaptors.h b/WTF/wtf/IteratorAdaptors.h new file mode 100644 index 00000000..9115d4da --- /dev/null +++ b/WTF/wtf/IteratorAdaptors.h @@ -0,0 +1,111 @@ +/* + * Copyright (C) 2013 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. + */ + +#ifndef WTF_IteratorAdaptors_h +#define WTF_IteratorAdaptors_h + +namespace WTF { + +template +class FilterIterator { +public: + FilterIterator(Predicate pred, Iterator begin, Iterator end) + : m_pred(std::move(pred)) + , m_iter(std::move(begin)) + , m_end(std::move(end)) + { + while (m_iter != m_end && !m_pred(*m_iter)) + ++m_iter; + } + + FilterIterator& operator++() + { + while (m_iter != m_end) { + ++m_iter; + if (m_iter == m_end || m_pred(*m_iter)) + break; + } + return *this; + } + + decltype(*std::declval()) operator*() const + { + ASSERT(m_iter != m_end); + ASSERT(m_pred(*m_iter)); + return *m_iter; + } + + inline bool operator==(FilterIterator& other) const { return m_iter == other.m_iter; } + inline bool operator!=(FilterIterator& other) const { return m_iter != other.m_iter; } + +private: + const Predicate m_pred; + Iterator m_iter; + Iterator m_end; +}; + +template +inline FilterIterator makeFilterIterator(Predicate&& pred, Iterator&& begin, Iterator&& end) +{ + return FilterIterator(std::forward(pred), std::forward(begin), std::forward(end)); +} + +template +class TransformIterator { +public: + TransformIterator(const Transform& transform, const Iterator& iter) + : m_transform(std::move(transform)) + , m_iter(std::move(iter)) + { + } + + TransformIterator& operator++() + { + ++m_iter; + return *this; + } + + decltype(std::declval()(*std::declval())) operator*() const + { + return m_transform(*m_iter); + } + + inline bool operator==(TransformIterator& other) const { return m_iter == other.m_iter; } + inline bool operator!=(TransformIterator& other) const { return m_iter != other.m_iter; } + +private: + const Transform m_transform; + Iterator m_iter; +}; + +template +inline TransformIterator makeTransformIterator(Transform&& transform, Iterator&& iter) +{ + return TransformIterator(std::forward(transform), std::forward(iter)); +} + +} // namespace WTF + +#endif // WTF_IteratorAdaptors_h diff --git a/WTF/wtf/FixedArray.h b/WTF/wtf/IteratorRange.h similarity index 68% rename from WTF/wtf/FixedArray.h rename to WTF/wtf/IteratorRange.h index c50a12b9..295c2142 100644 --- a/WTF/wtf/FixedArray.h +++ b/WTF/wtf/IteratorRange.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2010 Apple Inc. All rights reserved. + * Copyright (C) 2013 Apple Inc. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -23,36 +23,34 @@ * THE POSSIBILITY OF SUCH DAMAGE. */ -#ifndef FixedArray_h -#define FixedArray_h - -#include +#ifndef WTF_IteratorRange_h +#define WTF_IteratorRange_h namespace WTF { -template class FixedArray { +template +class IteratorRange { public: - T& operator[](size_t i) - { - ASSERT_WITH_SECURITY_IMPLICATION(i < Size); - return m_data[i]; - } - - const T& operator[](size_t i) const + IteratorRange(Iterator begin, Iterator end) + : m_begin(std::move(begin)) + , m_end(std::move(end)) { - ASSERT_WITH_SECURITY_IMPLICATION(i < Size); - return m_data[i]; } - T* data() { return m_data; } - size_t size() const { return Size; } + Iterator begin() const { return m_begin; } + Iterator end() const { return m_end; } private: - T m_data[Size]; + Iterator m_begin; + Iterator m_end; }; -} // namespace WTF +template +IteratorRange makeIteratorRange(Iterator&& begin, Iterator&& end) +{ + return IteratorRange(std::forward(begin), std::forward(end)); +} -using WTF::FixedArray; +} // namespace WTF -#endif // FixedArray_h +#endif // WTF_IteratorRange_h diff --git a/WTF/wtf/MD5.cpp b/WTF/wtf/MD5.cpp index 7d0100d0..36549be8 100644 --- a/WTF/wtf/MD5.cpp +++ b/WTF/wtf/MD5.cpp @@ -60,14 +60,14 @@ namespace WTF { // Note: this code is harmless on little-endian machines. -static void reverseBytes(uint8_t* buf, unsigned longs) +static void toLittleEndian(uint8_t* buf, unsigned longs) { ASSERT(longs > 0); do { uint32_t t = static_cast(buf[3] << 8 | buf[2]) << 16 | buf[1] << 8 | buf[0]; ASSERT_WITH_MESSAGE(!(reinterpret_cast(buf) % sizeof(t)), "alignment error of buf"); - *reinterpret_cast_ptr(buf) = t; - buf += 4; + memcpy(buf, &t, sizeof(t)); + buf += sizeof(t); } while (--longs); } @@ -199,7 +199,7 @@ void MD5::addBytes(const uint8_t* input, size_t length) return; } memcpy(p, buf, t); - reverseBytes(m_in, 16); + toLittleEndian(m_in, 16); MD5Transform(m_buf, reinterpret_cast_ptr(m_in)); // m_in is 4-byte aligned. buf += t; length -= t; @@ -209,7 +209,7 @@ void MD5::addBytes(const uint8_t* input, size_t length) while (length >= 64) { memcpy(m_in, buf, 64); - reverseBytes(m_in, 16); + toLittleEndian(m_in, 16); MD5Transform(m_buf, reinterpret_cast_ptr(m_in)); // m_in is 4-byte aligned. buf += 64; length -= 64; @@ -219,7 +219,7 @@ void MD5::addBytes(const uint8_t* input, size_t length) memcpy(m_in, buf, length); } -void MD5::checksum(Vector& digest) +void MD5::checksum(Digest& digest) { // Compute number of bytes mod 64 unsigned count = (m_bits[0] >> 3) & 0x3F; @@ -236,7 +236,7 @@ void MD5::checksum(Vector& digest) if (count < 8) { // Two lots of padding: Pad the first block to 64 bytes memset(p, 0, count); - reverseBytes(m_in, 16); + toLittleEndian(m_in, 16); MD5Transform(m_buf, reinterpret_cast_ptr(m_in)); // m_in is 4-byte aligned. // Now fill the next block with 56 bytes @@ -245,20 +245,18 @@ void MD5::checksum(Vector& digest) // Pad block to 56 bytes memset(p, 0, count - 8); } - reverseBytes(m_in, 14); + toLittleEndian(m_in, 14); // Append length in bits and transform - // m_in is 4-byte aligned. - (reinterpret_cast_ptr(m_in))[14] = m_bits[0]; - (reinterpret_cast_ptr(m_in))[15] = m_bits[1]; + memcpy(m_in + 56, m_bits, sizeof(m_bits)); MD5Transform(m_buf, reinterpret_cast_ptr(m_in)); - reverseBytes(reinterpret_cast(m_buf), 4); + toLittleEndian(reinterpret_cast(m_buf), 4); // Now, m_buf contains checksum result. - if (!digest.isEmpty()) - digest.clear(); - digest.append(reinterpret_cast(m_buf), 16); + uint8_t* mBufUInt8 = reinterpret_cast(m_buf); + for (size_t i = 0; i < hashSize; ++i) + digest[i] = mBufUInt8[i]; // In case it's sensitive memset(m_buf, 0, sizeof(m_buf)); diff --git a/WTF/wtf/MD5.h b/WTF/wtf/MD5.h index ef027cca..fa59ca23 100644 --- a/WTF/wtf/MD5.h +++ b/WTF/wtf/MD5.h @@ -31,6 +31,7 @@ #ifndef WTF_MD5_h #define WTF_MD5_h +#include #include namespace WTF { @@ -45,8 +46,14 @@ class MD5 { } WTF_EXPORT_PRIVATE void addBytes(const uint8_t* input, size_t length); + // Size of the SHA1 hash + WTF_EXPORT_PRIVATE static const size_t hashSize = 16; + + // type for computing MD5 hash + typedef std::array Digest; + // checksum has a side effect of resetting the state of the object. - WTF_EXPORT_PRIVATE void checksum(Vector&); + WTF_EXPORT_PRIVATE void checksum(Digest&); private: uint32_t m_buf[4]; diff --git a/WTF/wtf/MainThread.cpp b/WTF/wtf/MainThread.cpp index 044a6472..94cf0b8b 100644 --- a/WTF/wtf/MainThread.cpp +++ b/WTF/wtf/MainThread.cpp @@ -241,11 +241,6 @@ void callOnMainThread(std::function function) callOnMainThread(callFunctionObject, std::make_unique>(std::move(function)).release()); } -void callOnMainThread(const Function& function) -{ - callOnMainThread(std::function(function)); -} - void setMainThreadCallbacksPaused(bool paused) { ASSERT(isMainThread()); @@ -266,6 +261,13 @@ bool isMainThread() } #endif +#if !USE(WEB_THREAD) +bool canAccessThreadLocalDataForThread(ThreadIdentifier threadId) +{ + return threadId == currentThread(); +} +#endif + #if ENABLE(PARALLEL_GC) static ThreadSpecific* isGCThread; #endif diff --git a/WTF/wtf/MainThread.h b/WTF/wtf/MainThread.h index 50deb9a9..1ad2d852 100644 --- a/WTF/wtf/MainThread.h +++ b/WTF/wtf/MainThread.h @@ -47,21 +47,18 @@ WTF_EXPORT_PRIVATE void cancelCallOnMainThread(MainThreadFunction*, void* contex WTF_EXPORT_PRIVATE void callOnMainThread(std::function); -// FIXME: This symbol is used by Safari and should be removed once Safari is no longer using it. -template class Function; -WTF_EXPORT_PRIVATE void callOnMainThread(const Function&); - WTF_EXPORT_PRIVATE void setMainThreadCallbacksPaused(bool paused); WTF_EXPORT_PRIVATE bool isMainThread(); +WTF_EXPORT_PRIVATE bool canAccessThreadLocalDataForThread(ThreadIdentifier); + #if USE(WEB_THREAD) WTF_EXPORT_PRIVATE bool isWebThread(); WTF_EXPORT_PRIVATE bool isUIThread(); WTF_EXPORT_PRIVATE void initializeWebThread(); WTF_EXPORT_PRIVATE void initializeApplicationUIThreadIdentifier(); WTF_EXPORT_PRIVATE void initializeWebThreadIdentifier(); -WTF_EXPORT_PRIVATE bool canAccessThreadLocalDataForThread(ThreadIdentifier); void initializeWebThreadPlatform(); #else inline bool isWebThread() { return isMainThread(); } @@ -102,11 +99,13 @@ using WTF::cancelCallOnMainThread; using WTF::setMainThreadCallbacksPaused; using WTF::isMainThread; using WTF::isMainThreadOrGCThread; +using WTF::canAccessThreadLocalDataForThread; +using WTF::isUIThread; +using WTF::isWebThread; #if USE(WEB_THREAD) using WTF::initializeWebThread; using WTF::initializeApplicationUIThreadIdentifier; using WTF::initializeWebThreadIdentifier; -using WTF::canAccessThreadLocalDataForThread; #endif #endif // MainThread_h diff --git a/WTF/wtf/MathExtras.h b/WTF/wtf/MathExtras.h index a38d2e7f..b6f41d06 100644 --- a/WTF/wtf/MathExtras.h +++ b/WTF/wtf/MathExtras.h @@ -43,18 +43,6 @@ #include #endif -#if OS(QNX) -// FIXME: Look into a way to have cmath import its functions into both the standard and global -// namespace. For now, we include math.h since the QNX cmath header only imports its functions -// into the standard namespace. -#include -// These macros from math.h conflict with the real functions in the std namespace. -#undef signbit -#undef isnan -#undef isinf -#undef isfinite -#endif - #ifndef M_PI const double piDouble = 3.14159265358979323846; const float piFloat = 3.14159265358979323846f; @@ -123,83 +111,6 @@ inline bool signbit(double x) { struct ieee_double *p = (struct ieee_double *)&x #if COMPILER(MSVC) -// We must not do 'num + 0.5' or 'num - 0.5' because they can cause precision loss. -static double round(double num) -{ - double integer = ceil(num); - if (num > 0) - return integer - num > 0.5 ? integer - 1.0 : integer; - return integer - num >= 0.5 ? integer - 1.0 : integer; -} -static float roundf(float num) -{ - float integer = ceilf(num); - if (num > 0) - return integer - num > 0.5f ? integer - 1.0f : integer; - return integer - num >= 0.5f ? integer - 1.0f : integer; -} -inline long long llround(double num) { return static_cast(round(num)); } -inline long long llroundf(float num) { return static_cast(roundf(num)); } -inline long lround(double num) { return static_cast(round(num)); } -inline long lroundf(float num) { return static_cast(roundf(num)); } -inline double trunc(double num) { return num > 0 ? floor(num) : ceil(num); } - -#if _MSC_VER < 1800 - -inline double remainder(double numerator, double denominator) -{ - double result = fmod(numerator, denominator); - if (result > 0.5 * denominator) - return result - denominator; - - return result; -} - -#endif - - -#endif - -#if COMPILER(GCC) && OS(QNX) -// The stdlib on QNX doesn't contain long abs(long). See PR #104666. -inline long long abs(long num) { return labs(num); } -#endif - -#if COMPILER(MSVC) -// MSVC's math.h does not currently supply log2 or log2f. -inline double log2(double num) -{ - // This constant is roughly M_LN2, which is not provided by default on Windows. - return log(num) / 0.693147180559945309417232121458176568; -} - -inline float log2f(float num) -{ - // This constant is roughly M_LN2, which is not provided by default on Windows. - return logf(num) / 0.693147180559945309417232121458176568f; -} -#endif - -#if COMPILER(MSVC) -// The 64bit version of abs() is already defined in stdlib.h which comes with VC10 -#if COMPILER(MSVC9_OR_LOWER) -inline long long abs(long long num) { return _abs64(num); } -#endif - -namespace std { - -inline bool isinf(double num) { return !_finite(num) && !_isnan(num); } -inline bool isnan(double num) { return !!_isnan(num); } -inline bool isfinite(double x) { return _finite(x); } -inline bool signbit(double num) { return _copysign(1.0, num) < 0; } - -} // namespace std - -inline double nextafter(double x, double y) { return _nextafter(x, y); } -inline float nextafterf(float x, float y) { return x > y ? x - FLT_EPSILON : x + FLT_EPSILON; } - -inline double copysign(double x, double y) { return _copysign(x, y); } - // Work around a bug in Win, where atan2(+-infinity, +-infinity) yields NaN instead of specific values. extern "C" inline double wtf_atan2(double x, double y) { diff --git a/WTF/wtf/MediaTime.cpp b/WTF/wtf/MediaTime.cpp index 58211232..f856714d 100644 --- a/WTF/wtf/MediaTime.cpp +++ b/WTF/wtf/MediaTime.cpp @@ -33,8 +33,6 @@ #include #include -using namespace std; - namespace WTF { static int32_t greatestCommonDivisor(int32_t a, int32_t b) @@ -90,12 +88,12 @@ MediaTime MediaTime::createWithFloat(float floatTime, int32_t timeScale) return invalidTime(); if (std::isinf(floatTime)) return std::signbit(floatTime) ? negativeInfiniteTime() : positiveInfiniteTime(); - if (floatTime > numeric_limits::max()) + if (floatTime > std::numeric_limits::max()) return positiveInfiniteTime(); - if (floatTime < numeric_limits::min()) + if (floatTime < std::numeric_limits::min()) return negativeInfiniteTime(); - while (floatTime * timeScale > numeric_limits::max()) + while (floatTime * timeScale > std::numeric_limits::max()) timeScale /= 2; return MediaTime(static_cast(floatTime * timeScale), timeScale, Valid); } @@ -106,12 +104,12 @@ MediaTime MediaTime::createWithDouble(double doubleTime, int32_t timeScale) return invalidTime(); if (std::isinf(doubleTime)) return std::signbit(doubleTime) ? negativeInfiniteTime() : positiveInfiniteTime(); - if (doubleTime > numeric_limits::max()) + if (doubleTime > std::numeric_limits::max()) return positiveInfiniteTime(); - if (doubleTime < numeric_limits::min()) + if (doubleTime < std::numeric_limits::min()) return negativeInfiniteTime(); - while (doubleTime * timeScale > numeric_limits::max()) + while (doubleTime * timeScale > std::numeric_limits::max()) timeScale /= 2; return MediaTime(static_cast(doubleTime * timeScale), timeScale, Valid); } @@ -154,17 +152,17 @@ MediaTime MediaTime::operator+(const MediaTime& rhs) const if (rhs.isIndefinite() || isIndefinite()) return indefiniteTime(); - if (isPositiveInfinite()) { - if (rhs.isNegativeInfinite()) - return invalidTime(); + if (isPositiveInfinite() && rhs.isNegativeInfinite()) + return invalidTime(); + + if (isNegativeInfinite() && rhs.isPositiveInfinite()) + return invalidTime(); + + if (isPositiveInfinite() || rhs.isPositiveInfinite()) return positiveInfiniteTime(); - } - if (isNegativeInfinite()) { - if (rhs.isPositiveInfinite()) - return invalidTime(); + if (isNegativeInfinite() || rhs.isNegativeInfinite()) return negativeInfiniteTime(); - } int32_t commonTimeScale; if (!leastCommonMultiple(this->m_timeScale, rhs.m_timeScale, commonTimeScale) || commonTimeScale > MaximumTimeScale) @@ -191,17 +189,17 @@ MediaTime MediaTime::operator-(const MediaTime& rhs) const if (rhs.isIndefinite() || isIndefinite()) return indefiniteTime(); - if (isPositiveInfinite()) { - if (rhs.isPositiveInfinite()) - return invalidTime(); + if (isPositiveInfinite() && rhs.isPositiveInfinite()) + return invalidTime(); + + if (isNegativeInfinite() && rhs.isNegativeInfinite()) + return invalidTime(); + + if (isPositiveInfinite() || rhs.isNegativeInfinite()) return positiveInfiniteTime(); - } - if (isNegativeInfinite()) { - if (rhs.isNegativeInfinite()) - return invalidTime(); + if (isNegativeInfinite() || rhs.isPositiveInfinite()) return negativeInfiniteTime(); - } int32_t commonTimeScale; if (!leastCommonMultiple(this->m_timeScale, rhs.m_timeScale, commonTimeScale) || commonTimeScale > MaximumTimeScale) diff --git a/WTF/wtf/MediaTime.h b/WTF/wtf/MediaTime.h index 36764ad9..af6561ae 100644 --- a/WTF/wtf/MediaTime.h +++ b/WTF/wtf/MediaTime.h @@ -50,7 +50,7 @@ class WTF_EXPORT_PRIVATE MediaTime { }; MediaTime(); - MediaTime(int64_t value, int32_t scale = DefaultTimeScale, uint32_t flags = Valid); + MediaTime(int64_t value, int32_t scale, uint32_t flags = Valid); MediaTime(const MediaTime& rhs); ~MediaTime(); diff --git a/WTF/wtf/NeverDestroyed.h b/WTF/wtf/NeverDestroyed.h index 22320ff0..e021f98d 100644 --- a/WTF/wtf/NeverDestroyed.h +++ b/WTF/wtf/NeverDestroyed.h @@ -46,24 +46,11 @@ template class NeverDestroyed { WTF_MAKE_NONCOPYABLE(NeverDestroyed); public: -#if COMPILER_SUPPORTS(CXX_VARIADIC_TEMPLATES) template NeverDestroyed(Args&&... args) { new (asPtr()) T(std::forward(args)...); } -#else - NeverDestroyed() - { - new (NotNull, asPtr()) T; - } - - template - NeverDestroyed(A1&& a1) - { - new (NotNull, asPtr()) T(std::forward(a1)); - } -#endif operator T&() { return *asPtr(); } T& get() { return *asPtr(); } diff --git a/WTF/wtf/NumberOfCores.cpp b/WTF/wtf/NumberOfCores.cpp index 191731ac..75d8af70 100644 --- a/WTF/wtf/NumberOfCores.cpp +++ b/WTF/wtf/NumberOfCores.cpp @@ -36,8 +36,6 @@ #include #elif OS(WINDOWS) #include -#elif OS(QNX) -#include #endif namespace WTF { @@ -70,10 +68,6 @@ int numberOfProcessorCores() GetSystemInfo(&sysInfo); s_numberOfCores = sysInfo.dwNumberOfProcessors; -#elif OS(QNX) - UNUSED_PARAM(defaultIfUnavailable); - - s_numberOfCores = _syspage_ptr->num_cpu; #else s_numberOfCores = defaultIfUnavailable; #endif diff --git a/WTF/wtf/OSAllocatorPosix.cpp b/WTF/wtf/OSAllocatorPosix.cpp index a71f3913..61661eec 100644 --- a/WTF/wtf/OSAllocatorPosix.cpp +++ b/WTF/wtf/OSAllocatorPosix.cpp @@ -37,17 +37,7 @@ namespace WTF { void* OSAllocator::reserveUncommitted(size_t bytes, Usage usage, bool writable, bool executable, bool includesGuardPages) { -#if OS(QNX) - UNUSED_PARAM(usage); - UNUSED_PARAM(writable); - UNUSED_PARAM(executable); - UNUSED_PARAM(includesGuardPages); - - // Reserve memory with PROT_NONE and MAP_LAZY so it isn't committed now. - void* result = mmap(0, bytes, PROT_NONE, MAP_LAZY | MAP_PRIVATE | MAP_ANON, -1, 0); - if (result == MAP_FAILED) - CRASH(); -#elif OS(LINUX) +#if OS(LINUX) UNUSED_PARAM(usage); UNUSED_PARAM(writable); UNUSED_PARAM(executable); @@ -64,7 +54,7 @@ void* OSAllocator::reserveUncommitted(size_t bytes, Usage usage, bool writable, while (madvise(result, bytes, MADV_FREE_REUSABLE) == -1 && errno == EAGAIN) { } #endif -#endif // OS(QNX) +#endif return result; } @@ -134,15 +124,7 @@ void* OSAllocator::reserveAndCommit(size_t bytes, Usage usage, bool writable, bo void OSAllocator::commit(void* address, size_t bytes, bool writable, bool executable) { -#if OS(QNX) - int protection = PROT_READ; - if (writable) - protection |= PROT_WRITE; - if (executable) - protection |= PROT_EXEC; - if (MAP_FAILED == mmap(address, bytes, protection, MAP_FIXED | MAP_PRIVATE | MAP_ANON, -1, 0)) - CRASH(); -#elif OS(LINUX) +#if OS(LINUX) int protection = PROT_READ; if (writable) protection |= PROT_WRITE; @@ -166,10 +148,7 @@ void OSAllocator::commit(void* address, size_t bytes, bool writable, bool execut void OSAllocator::decommit(void* address, size_t bytes) { -#if OS(QNX) - // Use PROT_NONE and MAP_LAZY to decommit the pages. - mmap(address, bytes, PROT_NONE, MAP_FIXED | MAP_LAZY | MAP_PRIVATE | MAP_ANON, -1, 0); -#elif OS(LINUX) +#if OS(LINUX) madvise(address, bytes, MADV_DONTNEED); if (mprotect(address, bytes, PROT_NONE)) CRASH(); diff --git a/WTF/wtf/OSAllocatorWin.cpp b/WTF/wtf/OSAllocatorWin.cpp index 78300dc7..37e01301 100644 --- a/WTF/wtf/OSAllocatorWin.cpp +++ b/WTF/wtf/OSAllocatorWin.cpp @@ -65,6 +65,14 @@ void OSAllocator::commit(void* address, size_t bytes, bool writable, bool execut void OSAllocator::decommit(void* address, size_t bytes) { + // According to http://msdn.microsoft.com/en-us/library/aa366892(VS.85).aspx, + // bytes (i.e. dwSize) being 0 when dwFreeType is MEM_DECOMMIT means that we'll + // decommit the entire region allocated by VirtualAlloc() instead of decommitting + // nothing as we would expect. Hence, we should check if bytes is 0 and handle it + // appropriately before calling VirtualFree(). + // See: https://bugs.webkit.org/show_bug.cgi?id=121972. + if (!bytes) + return; bool result = VirtualFree(address, bytes, MEM_DECOMMIT); if (!result) CRASH(); @@ -72,6 +80,10 @@ void OSAllocator::decommit(void* address, size_t bytes) void OSAllocator::releaseDecommitted(void* address, size_t bytes) { + // See comment in OSAllocator::decommit(). Similarly, when bytes is 0, we + // don't want to release anything. So, don't call VirtualFree() below. + if (!bytes) + return; // According to http://msdn.microsoft.com/en-us/library/aa366892(VS.85).aspx, // dwSize must be 0 if dwFreeType is MEM_RELEASE. bool result = VirtualFree(address, 0, MEM_RELEASE); diff --git a/WTF/wtf/PassRef.h b/WTF/wtf/PassRef.h index 0384240c..587374c6 100644 --- a/WTF/wtf/PassRef.h +++ b/WTF/wtf/PassRef.h @@ -148,72 +148,11 @@ template inline PassRef adoptRef(T& reference) return PassRef(reference, PassRef::Adopt); } -#if COMPILER_SUPPORTS(CXX_VARIADIC_TEMPLATES) - template inline PassRef createRefCounted(Args&&... args) { return adoptRef(*new T(std::forward(args)...)); } -#else - -template inline PassRef createRefCounted() -{ - return adoptRef(*new T); -} - -template inline PassRef createRefCounted(A1&& a1) -{ - return adoptRef(*new T(std::forward(a1))); -} - -template inline PassRef createRefCounted(A1&& a1, A2&& a2) -{ - return adoptRef(*new T(std::forward(a1), std::forward(a2))); -} - -template inline PassRef createRefCounted(A1&& a1, A2&& a2, A3&& a3) -{ - return adoptRef(*new T(std::forward(a1), std::forward(a2), std::forward(a3))); -} - -template inline PassRef createRefCounted(A1&& a1, A2&& a2, A3&& a3, A4&& a4) -{ - return adoptRef(*new T(std::forward(a1), std::forward(a2), std::forward(a3), std::forward(a4))); -} - -template inline PassRef createRefCounted(A1&& a1, A2&& a2, A3&& a3, A4&& a4, A5&& a5) -{ - return adoptRef(*new T(std::forward(a1), std::forward(a2), std::forward(a3), std::forward(a4), std::forward(a5))); -} - -template inline PassRef createRefCounted(A1&& a1, A2&& a2, A3&& a3, A4&& a4, A5&& a5, A6&& a6) -{ - return adoptRef(*new T(std::forward(a1), std::forward(a2), std::forward(a3), std::forward(a4), std::forward(a5), std::forward(a6))); -} - -template inline PassRef createRefCounted(A1&& a1, A2&& a2, A3&& a3, A4&& a4, A5&& a5, A6&& a6, A7&& a7) -{ - return adoptRef(*new T(std::forward(a1), std::forward(a2), std::forward(a3), std::forward(a4), std::forward(a5), std::forward(a6), std::forward(a7))); -} - -template inline PassRef createRefCounted(A1&& a1, A2&& a2, A3&& a3, A4&& a4, A5&& a5, A6&& a6, A7&& a7, A8&& a8) -{ - return adoptRef(*new T(std::forward(a1), std::forward(a2), std::forward(a3), std::forward(a4), std::forward(a5), std::forward(a6), std::forward(a7), std::forward(a8))); -} - -template inline PassRef createRefCounted(A1&& a1, A2&& a2, A3&& a3, A4&& a4, A5&& a5, A6&& a6, A7&& a7, A8&& a8, A9&& a9) -{ - return adoptRef(*new T(std::forward(a1), std::forward(a2), std::forward(a3), std::forward(a4), std::forward(a5), std::forward(a6), std::forward(a7), std::forward(a8), std::forward(a9))); -} - -template inline PassRef createRefCounted(A1&& a1, A2&& a2, A3&& a3, A4&& a4, A5&& a5, A6&& a6, A7&& a7, A8&& a8, A9&& a9, A10&& a10) -{ - return adoptRef(*new T(std::forward(a1), std::forward(a2), std::forward(a3), std::forward(a4), std::forward(a5), std::forward(a6), std::forward(a7), std::forward(a8), std::forward(a9), std::forward(a10))); -} - -#endif - } // namespace WTF using WTF::PassRef; diff --git a/WTF/wtf/Platform.h b/WTF/wtf/Platform.h index b88d62f5..6cc115e3 100644 --- a/WTF/wtf/Platform.h +++ b/WTF/wtf/Platform.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2006, 2007, 2008, 2009, 2013 Apple Inc. All rights reserved. + * Copyright (C) 2006, 2007, 2008, 2009, 2013, 2014 Apple Inc. All rights reserved. * Copyright (C) 2007-2009 Torch Mobile, Inc. * Copyright (C) 2010, 2011 Research In Motion Limited. All rights reserved. * @@ -68,6 +68,7 @@ /* CPU(HPPA) - HP PA-RISC */ #if defined(__hppa__) || defined(__hppa64__) #define WTF_CPU_HPPA 1 +#define WTF_CPU_BIG_ENDIAN 1 #endif /* CPU(IA64) - Itanium / IA-64 */ @@ -123,23 +124,6 @@ #define WTF_CPU_SH4 1 #endif -/* CPU(SPARC32) - SPARC 32-bit */ -#if defined(__sparc) && !defined(__arch64__) || defined(__sparcv8) -#define WTF_CPU_SPARC32 1 -#define WTF_CPU_BIG_ENDIAN 1 -#endif - -/* CPU(SPARC64) - SPARC 64-bit */ -#if defined(__sparc__) && defined(__arch64__) || defined (__sparcv9) -#define WTF_CPU_SPARC64 1 -#define WTF_CPU_BIG_ENDIAN 1 -#endif - -/* CPU(SPARC) - any SPARC, true for CPU(SPARC32) and CPU(SPARC64) */ -#if CPU(SPARC32) || CPU(SPARC64) -#define WTF_CPU_SPARC 1 -#endif - /* CPU(S390X) - S390 64-bit */ #if defined(__s390x__) #define WTF_CPU_S390X 1 @@ -185,7 +169,7 @@ #define WTF_CPU_ARM_HARDFP 1 #endif -#if defined(__ARMEB__) || (COMPILER(RVCT) && defined(__BIG_ENDIAN)) +#if defined(__ARMEB__) #define WTF_CPU_BIG_ENDIAN 1 #elif !defined(__ARM_EABI__) \ @@ -329,7 +313,7 @@ #endif /* ARM */ -#if CPU(ARM) || CPU(MIPS) || CPU(SH4) || CPU(SPARC) +#if CPU(ARM) || CPU(MIPS) || CPU(SH4) #define WTF_CPU_NEEDS_ALIGNED_ACCESS 1 #endif @@ -398,11 +382,6 @@ #define WTF_OS_OPENBSD 1 #endif -/* OS(QNX) - QNX */ -#if defined(__QNXNTO__) -#define WTF_OS_QNX 1 -#endif - /* OS(SOLARIS) - Solaris */ #if defined(sun) || defined(__sun) #define WTF_OS_SOLARIS 1 @@ -429,7 +408,6 @@ || OS(LINUX) \ || OS(NETBSD) \ || OS(OPENBSD) \ - || OS(QNX) \ || OS(SOLARIS) \ || defined(unix) \ || defined(__unix) \ @@ -442,16 +420,16 @@ /* FIXME: these are all mixes of OS, operating environment and policy choices. */ /* PLATFORM(EFL) */ /* PLATFORM(GTK) */ -/* PLATFORM(BLACKBERRY) */ /* PLATFORM(MAC) */ /* PLATFORM(WIN) */ #if defined(BUILDING_EFL__) #define WTF_PLATFORM_EFL 1 #elif defined(BUILDING_GTK__) #define WTF_PLATFORM_GTK 1 -#elif defined(BUILDING_BLACKBERRY__) -#define WTF_PLATFORM_BLACKBERRY 1 +#elif defined(BUILDING_NIX__) +#include "nix/PlatformNix.h" #elif OS(DARWIN) +#define WTF_PLATFORM_COCOA 1 #define WTF_PLATFORM_MAC 1 #elif OS(WINDOWS) #define WTF_PLATFORM_WIN 1 @@ -479,12 +457,6 @@ #define WTF_USE_CA 1 #endif -#if PLATFORM(BLACKBERRY) -#define WTF_USE_LOW_QUALITY_IMAGE_INTERPOLATION 1 -#define WTF_USE_LOW_QUALITY_IMAGE_NO_JPEG_DITHERING 1 -#define WTF_USE_LOW_QUALITY_IMAGE_NO_JPEG_FANCY_UPSAMPLING 1 -#endif - #if PLATFORM(GTK) #define WTF_USE_CAIRO 1 #define WTF_USE_GLIB 1 @@ -493,7 +465,6 @@ #define WTF_USE_SOUP 1 #define WTF_USE_WEBP 1 #define ENABLE_GLOBAL_FASTMALLOC_NEW 0 -#define GST_API_VERSION_1 1 #endif /* On Windows, use QueryPerformanceCounter by default */ @@ -505,46 +476,54 @@ #define WTF_USE_ICU_UNICODE 1 #endif +#if PLATFORM(COCOA) + +#define WTF_USE_CF 1 +#define WTF_USE_FOUNDATION 1 + +#endif + #if PLATFORM(MAC) && !PLATFORM(IOS) + +#define WTF_USE_APPKIT 1 +#define HAVE_RUNLOOP_TIMER 1 +#define HAVE_SEC_IDENTITY 1 +#define HAVE_SEC_KEYCHAIN 1 + #if CPU(X86_64) #define WTF_USE_PLUGIN_HOST_PROCESS 1 #endif -#define WTF_USE_CF 1 -#define HAVE_READLINE 1 -#define HAVE_RUNLOOP_TIMER 1 + #if __MAC_OS_X_VERSION_MIN_REQUIRED >= 1080 #define HAVE_LAYER_HOSTING_IN_WINDOW_SERVER 1 #endif -#define WTF_USE_APPKIT 1 -#define WTF_USE_SECURITY_FRAMEWORK 1 /* OS X defines a series of platform macros for debugging. */ /* Some of them are really annoying because they use common names (e.g. check()). */ /* Disable those macros so that we are not limited in how we name methods and functions. */ #undef __ASSERT_MACROS_DEFINE_VERSIONS_WITHOUT_UNDERSCORES #define __ASSERT_MACROS_DEFINE_VERSIONS_WITHOUT_UNDERSCORES 0 -#endif /* PLATFORM(MAC) && !PLATFORM(IOS) */ -#if PLATFORM(IOS) -#define DONT_FINALIZE_ON_MAIN_THREAD 1 -#endif +#endif /* PLATFORM(MAC) && !PLATFORM(IOS) */ #if OS(DARWIN) && !PLATFORM(GTK) #define ENABLE_PURGEABLE_MEMORY 1 #endif #if PLATFORM(IOS) + +#define DONT_FINALIZE_ON_MAIN_THREAD 1 #define HAVE_READLINE 1 -#define WTF_USE_APPKIT 0 -#define WTF_USE_CF 1 #define WTF_USE_CFNETWORK 1 #define WTF_USE_NETWORK_CFDATA_ARRAY_CALLBACK 1 -#define WTF_USE_SECURITY_FRAMEWORK 0 +#define WTF_USE_UIKIT_EDITING 1 #define WTF_USE_WEB_THREAD 1 +#define WTF_USE_QUICK_LOOK 1 #if CPU(ARM64) #define ENABLE_JIT_CONSTANT_BLINDING 0 #endif + #endif /* PLATFORM(IOS) */ #if PLATFORM(WIN) && !USE(WINGDI) @@ -567,7 +546,8 @@ #if OS(UNIX) #define HAVE_ERRNO_H 1 -#define HAVE_MMAP 1 +#define HAVE_LANGINFO_H 1 +#define HAVE_MMAP 1 #define HAVE_SIGNAL_H 1 #define HAVE_STRINGS_H 1 #define HAVE_SYS_PARAM_H 1 @@ -575,16 +555,12 @@ #define WTF_USE_PTHREADS 1 #endif /* OS(UNIX) */ -#if OS(UNIX) && !OS(QNX) -#define HAVE_LANGINFO_H 1 -#endif - #if (OS(FREEBSD) || OS(OPENBSD)) && !defined(__GLIBC__) #define HAVE_PTHREAD_NP_H 1 #endif #if !defined(HAVE_VASPRINTF) -#if !COMPILER(MSVC) && !COMPILER(RVCT) && !COMPILER(MINGW) && !(COMPILER(GCC) && OS(QNX)) +#if !COMPILER(MSVC) && !COMPILER(MINGW) #define HAVE_VASPRINTF 1 #endif #endif @@ -608,16 +584,18 @@ #define HAVE_MADV_FREE_REUSE 1 #define HAVE_MERGESORT 1 #define HAVE_PTHREAD_SETNAME_NP 1 +#define HAVE_READLINE 1 #define HAVE_SYS_TIMEB_H 1 #define WTF_USE_ACCELERATE 1 #if !PLATFORM(IOS) #define HAVE_HOSTED_CORE_ANIMATION 1 -#endif /* !PLATFORM(IOS) */ +#endif #endif /* OS(DARWIN) */ #if OS(WINDOWS) && !OS(WINCE) + #define HAVE_SYS_TIMEB_H 1 #define HAVE_ALIGNED_MALLOC 1 #define HAVE_ISDEBUGGERPRESENT 1 @@ -630,11 +608,6 @@ #define HAVE_VIRTUALALLOC 1 #endif -#if OS(QNX) -#define HAVE_MADV_FREE_REUSE 1 -#define HAVE_MADV_FREE 1 -#endif - /* ENABLE macro defaults */ /* FIXME: move out all ENABLE() defines from here to FeatureDefines.h */ @@ -673,7 +646,6 @@ || (CPU(IA64) && !CPU(IA64_32)) \ || CPU(ALPHA) \ || CPU(ARM64) \ - || CPU(SPARC64) \ || CPU(S390X) \ || CPU(PPC64) #define WTF_USE_JSVALUE64 1 @@ -682,6 +654,13 @@ #endif #endif /* !defined(WTF_USE_JSVALUE64) && !defined(WTF_USE_JSVALUE32_64) */ +/* Disable the JITs if we're forcing the cloop to be enabled */ +#if defined(ENABLE_LLINT_C_LOOP) && ENABLE_LLINT_C_LOOP +#define ENABLE_JIT 0 +#define ENABLE_DFG_JIT 0 +#define ENABLE_FTL_JIT 0 +#endif + /* Disable the JIT on versions of GCC prior to 4.1 */ #if !defined(ENABLE_JIT) && COMPILER(GCC) && !GCC_VERSION_AT_LEAST(4, 1, 0) #define ENABLE_JIT 0 @@ -692,7 +671,6 @@ && (CPU(X86) || CPU(X86_64) || CPU(ARM) || CPU(ARM64) || CPU(MIPS)) \ && (OS(DARWIN) || !COMPILER(GCC) || GCC_VERSION_AT_LEAST(4, 1, 0)) \ && !OS(WINCE) \ - && !OS(QNX) \ && !(OS(WINDOWS) && CPU(X86_64)) #define ENABLE_JIT 1 #endif @@ -715,7 +693,7 @@ /* If possible, try to enable a disassembler. This is optional. We proceed in two steps: first we try to find some disassembler that we can use, and then we decide if the high-level disassembler API can be enabled. */ -#if !defined(WTF_USE_UDIS86) && ENABLE(JIT) && PLATFORM(MAC) \ +#if !defined(WTF_USE_UDIS86) && ENABLE(JIT) && (PLATFORM(MAC) || (PLATFORM(EFL) && OS(LINUX))) \ && (CPU(X86) || CPU(X86_64)) #define WTF_USE_UDIS86 1 #endif @@ -748,7 +726,7 @@ #define ENABLE_DFG_JIT 1 #endif /* Enable the DFG JIT on ARMv7. Only tested on iOS and Qt/GTK+ Linux. */ -#if (CPU(ARM_THUMB2) || CPU(ARM64)) && (PLATFORM(IOS) || PLATFORM(BLACKBERRY) || PLATFORM(GTK)) +#if (CPU(ARM_THUMB2) || CPU(ARM64)) && (PLATFORM(IOS) || PLATFORM(GTK) || PLATFORM(EFL)) #define ENABLE_DFG_JIT 1 #endif /* Enable the DFG JIT on ARM, MIPS and SH4. */ @@ -781,20 +759,9 @@ #error You have to have at least one execution model enabled to build JSC #endif -/* Profiling of types and values used by JIT code. DFG_JIT depends on it, but you - can enable it manually with DFG turned off if you want to use it as a standalone - profiler. In that case, you probably want to also enable VERBOSE_VALUE_PROFILE - below. */ -#if !defined(ENABLE_VALUE_PROFILER) && ENABLE(DFG_JIT) -#define ENABLE_VALUE_PROFILER 1 -#endif - -#if !defined(ENABLE_VERBOSE_VALUE_PROFILE) && ENABLE(VALUE_PROFILER) -#define ENABLE_VERBOSE_VALUE_PROFILE 0 -#endif - -#if !defined(ENABLE_SIMPLE_HEAP_PROFILING) -#define ENABLE_SIMPLE_HEAP_PROFILING 0 +/* Generational collector for JSC */ +#if !defined(ENABLE_GGC) +#define ENABLE_GGC 0 #endif /* Counts uses of write barriers using sampling counters. Be sure to also @@ -833,7 +800,7 @@ #endif /* Configure the interpreter */ -#if COMPILER(GCC) || (COMPILER(RVCT) && defined(__GNUC__)) +#if COMPILER(GCC) #define HAVE_COMPUTED_GOTO 1 #endif @@ -864,6 +831,24 @@ #endif #endif +/* If the Disassembler is enabled, then the Assembler must be enabled as well: */ +#if ENABLE(DISASSEMBLER) +#if defined(ENABLE_ASSEMBLER) && !ENABLE_ASSEMBLER +#error "Cannot enable the Disassembler without enabling the Assembler" +#else +#undef ENABLE_ASSEMBLER +#define ENABLE_ASSEMBLER 1 +#endif +#endif + +/* FIXME: We currently unconditionally use spearate stacks. When we switch to using the + C stack for JS frames, we'll need to make the following conditional on ENABLE(LLINT_CLOOP) + only. +*/ +#if ENABLE(LLINT_CLOOP) || 1 +#define WTF_USE_SEPARATE_C_AND_JS_STACK 1 +#endif + /* Pick which allocator to use; we only need an executable allocator if the assembler is compiled in. On x86-64 we use a single fixed mmap, on other platforms we mmap on demand. */ #if ENABLE(ASSEMBLER) @@ -874,6 +859,15 @@ #endif #endif +/* CSS Selector JIT Compiler */ +#if !defined(ENABLE_CSS_SELECTOR_JIT) +#if CPU(X86_64) && ENABLE(JIT) && PLATFORM(MAC) +#define ENABLE_CSS_SELECTOR_JIT 1 +#else +#define ENABLE_CSS_SELECTOR_JIT 0 +#endif +#endif + /* Accelerated compositing */ #if PLATFORM(MAC) || PLATFORM(IOS) || (PLATFORM(WIN) && !USE(WINGDI) && !PLATFORM(WIN_CAIRO)) #define WTF_USE_ACCELERATED_COMPOSITING 1 @@ -887,7 +881,12 @@ #define WTF_USE_OPENGL 1 #define WTF_USE_OPENGL_ES_2 1 #define WTF_USE_EGL 1 -#define WTF_USE_GRAPHICS_SURFACE 1 +#endif + +#if ENABLE(VIDEO) && PLATFORM(WIN_CAIRO) +#define WTF_USE_GLIB 1 +#define WTF_USE_GSTREAMER 1 +#define GST_API_VERSION_1 1 #endif #if USE(TEXTURE_MAPPER) && USE(3D_GRAPHICS) && !defined(WTF_USE_TEXTURE_MAPPER_GL) @@ -930,7 +929,7 @@ since most ports try to support sub-project independence, adding new headers to WTF causes many ports to break, and so this way we can address the build breakages one port at a time. */ -#if !defined(WTF_USE_EXPORT_MACROS) && (PLATFORM(MAC) || (PLATFORM(WIN) && (defined(_MSC_VER) && _MSC_VER >= 1600))) +#if !defined(WTF_USE_EXPORT_MACROS) && (PLATFORM(MAC) || PLATFORM(WIN)) #define WTF_USE_EXPORT_MACROS 1 #endif @@ -952,7 +951,7 @@ #define ENABLE_OBJECT_MARK_LOGGING 0 -#if !defined(ENABLE_PARALLEL_GC) && !ENABLE(OBJECT_MARK_LOGGING) && (PLATFORM(MAC) || PLATFORM(IOS) || PLATFORM(BLACKBERRY) || PLATFORM(GTK)) && ENABLE(COMPARE_AND_SWAP) +#if !defined(ENABLE_PARALLEL_GC) && !ENABLE(OBJECT_MARK_LOGGING) && (PLATFORM(MAC) || PLATFORM(IOS) || PLATFORM(GTK)) && ENABLE(COMPARE_AND_SWAP) #define ENABLE_PARALLEL_GC 1 #endif @@ -964,24 +963,30 @@ #define ENABLE_BINDING_INTEGRITY 1 #endif -#if PLATFORM(MAC) && !PLATFORM(IOS) && __MAC_OS_X_VERSION_MIN_REQUIRED >= 1070 +#if PLATFORM(IOS) || PLATFORM(MAC) #define WTF_USE_AVFOUNDATION 1 #endif -#if (PLATFORM(IOS) && __IPHONE_OS_VERSION_MIN_REQUIRED >= 60000) || (PLATFORM(MAC) && __MAC_OS_X_VERSION_MIN_REQUIRED >= 1080) +#if (PLATFORM(IOS) && __IPHONE_OS_VERSION_MIN_REQUIRED >= 60000) || ((PLATFORM(MAC) && !PLATFORM(IOS)) && __MAC_OS_X_VERSION_MIN_REQUIRED >= 1080) #define WTF_USE_COREMEDIA 1 +#define HAVE_AVFOUNDATION_VIDEO_OUTPUT 1 #endif -#if (PLATFORM(MAC) || (OS(WINDOWS) && USE(CG))) && !PLATFORM(IOS) && __MAC_OS_X_VERSION_MIN_REQUIRED >= 1080 +#if (PLATFORM(IOS) && __IPHONE_OS_VERSION_MIN_REQUIRED >= 50000) || ((PLATFORM(MAC) && !PLATFORM(IOS)) || (OS(WINDOWS) && USE(CG)) && __MAC_OS_X_VERSION_MIN_REQUIRED >= 1080) #define HAVE_AVFOUNDATION_MEDIA_SELECTION_GROUP 1 #endif -#if (PLATFORM(MAC) || (OS(WINDOWS) && USE(CG))) && !PLATFORM(IOS) && __MAC_OS_X_VERSION_MIN_REQUIRED >= 1090 +#if (PLATFORM(IOS) && __IPHONE_OS_VERSION_MIN_REQUIRED >= 70000) || (((PLATFORM(MAC) && !PLATFORM(IOS)) || (OS(WINDOWS) && USE(CG))) && __MAC_OS_X_VERSION_MIN_REQUIRED >= 1090) #define HAVE_AVFOUNDATION_LEGIBLE_OUTPUT_SUPPORT 1 +#define HAVE_MEDIA_ACCESSIBILITY_FRAMEWORK 1 #endif -#if (PLATFORM(IOS) && __IPHONE_OS_VERSION_MIN_REQUIRED >= 70000) || ((PLATFORM(MAC) || (OS(WINDOWS) && USE(CG))) && !PLATFORM(IOS) && __MAC_OS_X_VERSION_MIN_REQUIRED >= 1090) -#define HAVE_MEDIA_ACCESSIBILITY_FRAMEWORK 1 +#if (PLATFORM(IOS) && __IPHONE_OS_VERSION_MIN_REQUIRED >= 60000) || ((PLATFORM(MAC) && !PLATFORM(IOS)) && __MAC_OS_X_VERSION_MIN_REQUIRED >= 1090) +#define HAVE_AVFOUNDATION_LOADER_DELEGATE 1 +#endif + +#if (PLATFORM(MAC) && !PLATFORM(IOS)) && __MAC_OS_X_VERSION_MIN_REQUIRED >= 1080 +#define WTF_USE_VIDEOTOOLBOX 1 #endif #if PLATFORM(MAC) || PLATFORM(GTK) || (PLATFORM(WIN) && !USE(WINGDI) && !PLATFORM(WIN_CAIRO)) @@ -992,10 +997,6 @@ #define WTF_USE_REQUEST_ANIMATION_FRAME_DISPLAY_MONITOR 1 #endif -#if PLATFORM(MAC) && (PLATFORM(IOS) || __MAC_OS_X_VERSION_MIN_REQUIRED >= 1070) -#define HAVE_INVERTED_WHEEL_EVENTS 1 -#endif - #if PLATFORM(MAC) && !PLATFORM(IOS) #define WTF_USE_COREAUDIO 1 #endif @@ -1011,18 +1012,19 @@ #define WTF_USE_GRAMMAR_CHECKING 1 -#if PLATFORM(IOS) || PLATFORM(MAC) || PLATFORM(BLACKBERRY) || PLATFORM(EFL) +#if PLATFORM(IOS) || PLATFORM(MAC) || PLATFORM(EFL) #define WTF_USE_UNIFIED_TEXT_CHECKING 1 #endif #if !PLATFORM(IOS) && PLATFORM(MAC) #define WTF_USE_AUTOMATIC_TEXT_REPLACEMENT 1 #endif -#if !PLATFORM(IOS) && (PLATFORM(MAC) && __MAC_OS_X_VERSION_MIN_REQUIRED >= 1070) +#if PLATFORM(MAC) && !PLATFORM(IOS) /* Some platforms provide UI for suggesting autocorrection. */ #define WTF_USE_AUTOCORRECTION_PANEL 1 #endif -#if PLATFORM(IOS) || (PLATFORM(MAC) && __MAC_OS_X_VERSION_MIN_REQUIRED >= 1070) + +#if PLATFORM(MAC) /* Some platforms use spelling and autocorrection markers to provide visual cue. On such platform, if word with marker is edited, we need to remove the marker. */ #define WTF_USE_MARKER_REMOVAL_UPON_EDITING 1 #endif @@ -1035,4 +1037,28 @@ #define WTF_USE_AUDIO_SESSION 1 #endif +#if PLATFORM(MAC) && !PLATFORM(IOS_SIMULATOR) +#define WTF_USE_IOSURFACE 1 +#endif + +#if PLATFORM(GTK) || PLATFORM(EFL) +#undef ENABLE_OPENTYPE_VERTICAL +#define ENABLE_OPENTYPE_VERTICAL 1 +#endif + +#if ENABLE(CSS3_TEXT_DECORATION) && PLATFORM(MAC) +#define ENABLE_CSS3_TEXT_DECORATION_SKIP_INK 1 +#endif + +#if COMPILER(MSVC) +#undef __STDC_LIMIT_MACROS +#define __STDC_LIMIT_MACROS +#undef _HAS_EXCEPTIONS +#define _HAS_EXCEPTIONS 1 +#endif + +#if PLATFORM(MAC) && !PLATFORM(IOS) && __MAC_OS_X_VERSION_MIN_REQUIRED >= 1090 +#define HAVE_NS_ACTIVITY 1 +#endif + #endif /* WTF_Platform_h */ diff --git a/WTF/wtf/PlatformBlackBerry.cmake b/WTF/wtf/PlatformBlackBerry.cmake deleted file mode 100644 index b5de3052..00000000 --- a/WTF/wtf/PlatformBlackBerry.cmake +++ /dev/null @@ -1,3 +0,0 @@ -list(APPEND WTF_SOURCES - blackberry/MainThreadBlackBerry.cpp -) diff --git a/WTF/wtf/PlatformEfl.cmake b/WTF/wtf/PlatformEfl.cmake index 771c82e2..e10a4423 100644 --- a/WTF/wtf/PlatformEfl.cmake +++ b/WTF/wtf/PlatformEfl.cmake @@ -2,6 +2,7 @@ list(APPEND WTF_SOURCES efl/MainThreadEfl.cpp efl/OwnPtrEfl.cpp efl/RefPtrEfl.cpp + efl/RunLoopEfl.cpp gobject/GOwnPtr.cpp gobject/GRefPtr.cpp diff --git a/WTF/wtf/PlatformGTK.cmake b/WTF/wtf/PlatformGTK.cmake index 68940ff2..32e1feb9 100644 --- a/WTF/wtf/PlatformGTK.cmake +++ b/WTF/wtf/PlatformGTK.cmake @@ -4,6 +4,7 @@ list(APPEND WTF_SOURCES gobject/GlibUtilities.cpp gtk/MainThreadGtk.cpp + gtk/RunLoopGtk.cpp ) list(APPEND WTF_LIBRARIES @@ -11,6 +12,7 @@ list(APPEND WTF_LIBRARIES ${GLIB_GOBJECT_LIBRARIES} ${GLIB_LIBRARIES} pthread + ${ZLIB_LIBRARIES} ) list(APPEND WTF_INCLUDE_DIRECTORIES diff --git a/WTF/wtf/PlatformNix.cmake b/WTF/wtf/PlatformNix.cmake new file mode 100644 index 00000000..1f313a0a --- /dev/null +++ b/WTF/wtf/PlatformNix.cmake @@ -0,0 +1,20 @@ +list(APPEND WTF_SOURCES + gobject/GOwnPtr.cpp + gobject/GRefPtr.cpp + gobject/GlibUtilities.cpp + + gtk/MainThreadGtk.cpp + + nix/RunLoopNix.cpp +) + +list(APPEND WTF_LIBRARIES + pthread + ${GLIB_LIBRARIES} + ${GLIB_GIO_LIBRARIES} + ${ZLIB_LIBRARIES} +) + +list(APPEND WTF_INCLUDE_DIRECTORIES + ${GLIB_INCLUDE_DIRS} +) diff --git a/WTF/wtf/PlatformWin.cmake b/WTF/wtf/PlatformWin.cmake index 88bdaf71..8834d252 100644 --- a/WTF/wtf/PlatformWin.cmake +++ b/WTF/wtf/PlatformWin.cmake @@ -2,6 +2,7 @@ list(APPEND WTF_SOURCES threads/win/BinarySemaphoreWin.cpp win/MainThreadWin.cpp + win/RunLoopWin.cpp ) if (WINCE) diff --git a/WTF/wtf/PrintStream.cpp b/WTF/wtf/PrintStream.cpp index b068a6f3..bb7d39db 100644 --- a/WTF/wtf/PrintStream.cpp +++ b/WTF/wtf/PrintStream.cpp @@ -89,6 +89,16 @@ void printInternal(PrintStream& out, unsigned value) out.printf("%u", value); } +void printInternal(PrintStream& out, signed char value) +{ + out.printf("%d", static_cast(value)); +} + +void printInternal(PrintStream& out, unsigned char value) +{ + out.printf("%u", static_cast(value)); +} + void printInternal(PrintStream& out, short value) { out.printf("%d", static_cast(value)); diff --git a/WTF/wtf/PrintStream.h b/WTF/wtf/PrintStream.h index 290f1432..329ad078 100644 --- a/WTF/wtf/PrintStream.h +++ b/WTF/wtf/PrintStream.h @@ -257,6 +257,8 @@ inline void printInternal(PrintStream& out, CString& value) { printInternal(out, inline void printInternal(PrintStream& out, String& value) { printInternal(out, static_cast(value)); } inline void printInternal(PrintStream& out, StringImpl* value) { printInternal(out, static_cast(value)); } WTF_EXPORT_PRIVATE void printInternal(PrintStream&, bool); +WTF_EXPORT_PRIVATE void printInternal(PrintStream&, signed char); // NOTE: this prints as a number, not as a character; use CharacterDump if you want the character +WTF_EXPORT_PRIVATE void printInternal(PrintStream&, unsigned char); // NOTE: see above. WTF_EXPORT_PRIVATE void printInternal(PrintStream&, short); WTF_EXPORT_PRIVATE void printInternal(PrintStream&, unsigned short); WTF_EXPORT_PRIVATE void printInternal(PrintStream&, int); diff --git a/WTF/wtf/RAMSize.cpp b/WTF/wtf/RAMSize.cpp index 5b2cc67b..50b5222e 100644 --- a/WTF/wtf/RAMSize.cpp +++ b/WTF/wtf/RAMSize.cpp @@ -35,8 +35,6 @@ #include #elif OS(WINDOWS) #include -#elif OS(QNX) -#include #endif namespace WTF { @@ -77,11 +75,6 @@ static size_t computeRAMSize() if (!result) return ramSizeGuess; return status.ullTotalPhys; -#elif OS(QNX) - struct stat mst; - if (stat("/proc", &mst)) - return ramSizeGuess; - return mst.st_size; #endif } diff --git a/WTF/wtf/RefCounted.h b/WTF/wtf/RefCounted.h index 74a185dd..47ec758f 100644 --- a/WTF/wtf/RefCounted.h +++ b/WTF/wtf/RefCounted.h @@ -25,7 +25,6 @@ #include #include #include -#include namespace WTF { @@ -43,18 +42,6 @@ class RefCountedBase { void ref() { #if CHECK_REF_COUNTED_LIFECYCLE - // Start thread verification as soon as the ref count gets to 2. This - // heuristic reflects the fact that items are often created on one thread - // and then given to another thread to be used. - // FIXME: Make this restriction tigher. Especially as we move to more - // common methods for sharing items across threads like CrossThreadCopier.h - // We should be able to add a "detachFromThread" method to make this explicit. - if (m_refCount == 1) - m_verifier.setShared(true); - // If this assert fires, it either indicates a thread safety issue or - // that the verification needs to change. See ThreadRestrictionVerifier for - // the different modes. - ASSERT(m_verifier.isSafeToUse()); ASSERT(!m_deletionHasBegun); ASSERT(!m_adoptionIsRequired); #endif @@ -64,7 +51,6 @@ class RefCountedBase { bool hasOneRef() const { #if CHECK_REF_COUNTED_LIFECYCLE - ASSERT(m_verifier.isSafeToUse()); ASSERT(!m_deletionHasBegun); #endif return m_refCount == 1; @@ -72,35 +58,9 @@ class RefCountedBase { unsigned refCount() const { -#if CHECK_REF_COUNTED_LIFECYCLE - ASSERT(m_verifier.isSafeToUse()); -#endif return m_refCount; } - void setMutexForVerifier(Mutex&); - -#if HAVE(DISPATCH_H) - void setDispatchQueueForVerifier(dispatch_queue_t); -#endif - - // Turns off verification. Use of this method is discouraged (instead extend - // ThreadRestrictionVerifier to verify your case). - // NB. It is necessary to call this in the constructor of many objects in - // JavaScriptCore, because JavaScriptCore objects may be used from multiple - // threads even if the reference counting is done in a racy manner. This is - // because a JSC instance may be used from multiple threads so long as all - // accesses into that instance are protected by a per-instance lock. It would - // be absolutely wrong to prohibit this pattern, and it would be a disastrous - // regression to require that the objects within that instance use a thread- - // safe version of reference counting. - void turnOffVerifier() - { -#if CHECK_REF_COUNTED_LIFECYCLE - m_verifier.turnOffVerification(); -#endif - } - void relaxAdoptionRequirement() { #if CHECK_REF_COUNTED_LIFECYCLE @@ -132,7 +92,6 @@ class RefCountedBase { bool derefBase() { #if CHECK_REF_COUNTED_LIFECYCLE - ASSERT(m_verifier.isSafeToUse()); ASSERT(!m_deletionHasBegun); ASSERT(!m_adoptionIsRequired); #endif @@ -146,13 +105,6 @@ class RefCountedBase { return true; } m_refCount = tempRefCount; - -#if CHECK_REF_COUNTED_LIFECYCLE - // Stop thread verification when the ref goes to 1 because it - // is safe to be passed to another thread at this point. - if (m_refCount == 1) - m_verifier.setShared(false); -#endif return false; } @@ -173,7 +125,6 @@ class RefCountedBase { #if CHECK_REF_COUNTED_LIFECYCLE bool m_deletionHasBegun; bool m_adoptionIsRequired; - ThreadRestrictionVerifier m_verifier; #endif }; @@ -219,26 +170,6 @@ template class RefCountedCustomAllocated : public RefCountedBase { } }; -#if CHECK_REF_COUNTED_LIFECYCLE -inline void RefCountedBase::setMutexForVerifier(Mutex& mutex) -{ - m_verifier.setMutexMode(mutex); -} -#else -inline void RefCountedBase::setMutexForVerifier(Mutex&) { } -#endif - -#if HAVE(DISPATCH_H) -#if CHECK_REF_COUNTED_LIFECYCLE -inline void RefCountedBase::setDispatchQueueForVerifier(dispatch_queue_t queue) -{ - m_verifier.setDispatchQueueMode(queue); -} -#else -inline void RefCountedBase::setDispatchQueueForVerifier(dispatch_queue_t) { } -#endif -#endif // HAVE(DISPATCH_H) - } // namespace WTF using WTF::RefCounted; diff --git a/WTF/wtf/RefCountedArray.h b/WTF/wtf/RefCountedArray.h index 55abe253..a55d7aee 100644 --- a/WTF/wtf/RefCountedArray.h +++ b/WTF/wtf/RefCountedArray.h @@ -155,6 +155,22 @@ class RefCountedArray { T& operator[](size_t i) { return at(i); } const T& operator[](size_t i) const { return at(i); } + + bool operator==(const RefCountedArray& other) const + { + if (m_data == other.m_data) + return true; + if (!m_data || !other.m_data) + return false; + unsigned length = Header::fromPayload(m_data)->length; + if (length != Header::fromPayload(other.m_data)->length) + return false; + for (unsigned i = 0; i < length; ++i) { + if (m_data[i] != other.m_data[i]) + return false; + } + return true; + } private: struct Header { diff --git a/WTF/wtf/RefPtrHashMap.h b/WTF/wtf/RefPtrHashMap.h index d6e6ea54..152bdeec 100644 --- a/WTF/wtf/RefPtrHashMap.h +++ b/WTF/wtf/RefPtrHashMap.h @@ -70,6 +70,12 @@ namespace WTF { const_iterator begin() const; const_iterator end() const; + IteratorRange keys() { return makeIteratorRange(begin().keys(), end().keys()); } + const IteratorRange keys() const { return makeIteratorRange(begin().keys(), end().keys()); } + + IteratorRange values() { return makeIteratorRange(begin().values(), end().values()); } + const IteratorRange values() const { return makeIteratorRange(begin().values(), end().values()); } + iterator find(const KeyType&); iterator find(RawKeyType); const_iterator find(const KeyType&) const; diff --git a/WTF/wtf/RetainPtr.h b/WTF/wtf/RetainPtr.h index 1f38309f..01a340f2 100644 --- a/WTF/wtf/RetainPtr.h +++ b/WTF/wtf/RetainPtr.h @@ -119,6 +119,7 @@ namespace WTF { PtrType operator->() const { return fromStorageType(m_ptr); } #if COMPILER_SUPPORTS(CXX_EXPLICIT_CONVERSIONS) explicit operator PtrType() const { return fromStorageType(m_ptr); } + explicit operator bool() const { return m_ptr; } #endif bool operator!() const { return !m_ptr; } diff --git a/WTF/wtf/RunLoop.cpp b/WTF/wtf/RunLoop.cpp new file mode 100644 index 00000000..11a860fd --- /dev/null +++ b/WTF/wtf/RunLoop.cpp @@ -0,0 +1,131 @@ +/* + * Copyright (C) 2010 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. + */ + +#include "config.h" +#include "RunLoop.h" + +#include +#include + +namespace WTF { + +static RunLoop* s_mainRunLoop; + +// Helper class for ThreadSpecificData. +class RunLoop::Holder { +public: + Holder() + : m_runLoop(adoptRef(new RunLoop)) + { + } + + RunLoop* runLoop() const { return m_runLoop.get(); } + +private: + RefPtr m_runLoop; +}; + +void RunLoop::initializeMainRunLoop() +{ + if (s_mainRunLoop) + return; + s_mainRunLoop = RunLoop::current(); +} + +RunLoop* RunLoop::current() +{ + DEFINE_STATIC_LOCAL(WTF::ThreadSpecific, runLoopHolder, ()); + return runLoopHolder->runLoop(); +} + +RunLoop* RunLoop::main() +{ + ASSERT(s_mainRunLoop); + return s_mainRunLoop; +} + +bool RunLoop::isMain() +{ + ASSERT(s_mainRunLoop); + return s_mainRunLoop == RunLoop::current(); +} + +void RunLoop::performWork() +{ + // It is important to handle the functions in the queue one at a time because while inside one of these + // functions we might re-enter RunLoop::performWork() and we need to be able to pick up where we left off. + // See http://webkit.org/b/89590 for more discussion. + + // One possible scenario when handling the function queue is as follows: + // - RunLoop::performWork() is invoked with 1 function on the queue + // - Handling that function results in 1 more function being enqueued + // - Handling that one results in yet another being enqueued + // - And so on + // + // In this situation one invocation of performWork() never returns so all other event sources are blocked. + // By only handling up to the number of functions that were in the queue when performWork() is called + // we guarantee to occasionally return from the run loop so other event sources will be allowed to spin. + + std::function function; + size_t functionsToHandle = 0; + + { + MutexLocker locker(m_functionQueueLock); + functionsToHandle = m_functionQueue.size(); + + if (m_functionQueue.isEmpty()) + return; + + function = m_functionQueue.takeFirst(); + } + + function(); + + for (size_t functionsHandled = 1; functionsHandled < functionsToHandle; ++functionsHandled) { + { + MutexLocker locker(m_functionQueueLock); + + // Even if we start off with N functions to handle and we've only handled less than N functions, the queue + // still might be empty because those functions might have been handled in an inner RunLoop::performWork(). + // In that case we should bail here. + if (m_functionQueue.isEmpty()) + break; + + function = m_functionQueue.takeFirst(); + } + + function(); + } +} + +void RunLoop::dispatch(std::function function) +{ + MutexLocker locker(m_functionQueueLock); + m_functionQueue.append(std::move(function)); + + wakeUp(); +} + +} // namespace WTF diff --git a/WTF/wtf/RunLoop.h b/WTF/wtf/RunLoop.h new file mode 100644 index 00000000..528b44ed --- /dev/null +++ b/WTF/wtf/RunLoop.h @@ -0,0 +1,177 @@ +/* + * Copyright (C) 2010 Apple Inc. All rights reserved. + * Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies) + * Portions Copyright (c) 2010 Motorola Mobility, 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. + */ + +#ifndef RunLoop_h +#define RunLoop_h + +#include +#include +#include +#include +#include +#include +#include + +#if USE(GLIB) +#include +#endif + +#if PLATFORM(EFL) +#include +#endif + +namespace WTF { + +class RunLoop : public FunctionDispatcher { +public: + // Must be called from the main thread (except for the Mac platform, where it + // can be called from any thread). + WTF_EXPORT_PRIVATE static void initializeMainRunLoop(); + + WTF_EXPORT_PRIVATE static RunLoop* current(); + WTF_EXPORT_PRIVATE static RunLoop* main(); + WTF_EXPORT_PRIVATE static bool isMain(); + ~RunLoop(); + + virtual void dispatch(std::function) OVERRIDE; + + WTF_EXPORT_PRIVATE static void run(); + WTF_EXPORT_PRIVATE void stop(); + WTF_EXPORT_PRIVATE void wakeUp(); + +#if PLATFORM(MAC) + WTF_EXPORT_PRIVATE void runForDuration(double duration); +#endif + + class TimerBase { + friend class RunLoop; + public: + WTF_EXPORT_PRIVATE explicit TimerBase(RunLoop*); + WTF_EXPORT_PRIVATE virtual ~TimerBase(); + + void startRepeating(double repeatInterval) { start(repeatInterval, true); } + void startOneShot(double interval) { start(interval, false); } + + WTF_EXPORT_PRIVATE void stop(); + WTF_EXPORT_PRIVATE bool isActive() const; + + virtual void fired() = 0; + + private: + WTF_EXPORT_PRIVATE void start(double nextFireInterval, bool repeat); + + RunLoop* m_runLoop; + +#if PLATFORM(WIN) + static void timerFired(RunLoop*, uint64_t ID); + uint64_t m_ID; + bool m_isRepeating; +#elif PLATFORM(MAC) + static void timerFired(CFRunLoopTimerRef, void*); + RetainPtr m_timer; +#elif PLATFORM(EFL) + static bool timerFired(void* data); + Ecore_Timer* m_timer; + bool m_isRepeating; +#elif USE(GLIB) + static gboolean timerFiredCallback(RunLoop::TimerBase*); + gboolean isRepeating() const { return m_isRepeating; } + void clearTimerSource(); + GRefPtr m_timerSource; + gboolean m_isRepeating; +#endif + }; + + template + class Timer : public TimerBase { + public: + typedef void (TimerFiredClass::*TimerFiredFunction)(); + + Timer(RunLoop* runLoop, TimerFiredClass* o, TimerFiredFunction f) + : TimerBase(runLoop) + , m_object(o) + , m_function(f) + { + } + + private: + virtual void fired() { (m_object->*m_function)(); } + + TimerFiredClass* m_object; + TimerFiredFunction m_function; + }; + + class Holder; + +private: + RunLoop(); + + void performWork(); + + Mutex m_functionQueueLock; + Deque> m_functionQueue; + +#if PLATFORM(WIN) + static bool registerRunLoopMessageWindowClass(); + static LRESULT CALLBACK RunLoopWndProc(HWND, UINT, WPARAM, LPARAM); + LRESULT wndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam); + HWND m_runLoopMessageWindow; + + typedef HashMap TimerMap; + TimerMap m_activeTimers; +#elif PLATFORM(MAC) + static void performWork(void*); + RetainPtr m_runLoop; + RetainPtr m_runLoopSource; + int m_nestingLevel; +#elif PLATFORM(EFL) + bool m_initEfl; + + Mutex m_pipeLock; + OwnPtr m_pipe; + + Mutex m_wakeUpEventRequestedLock; + bool m_wakeUpEventRequested; + + static void wakeUpEvent(void* data, void*, unsigned); +#elif USE(GLIB) +public: + static gboolean queueWork(RunLoop*); + GMainLoop* innermostLoop(); + void pushNestedMainLoop(GMainLoop*); + void popNestedMainLoop(); +private: + GRefPtr m_runLoopContext; + Vector> m_runLoopMainLoops; +#endif +}; + +} // namespace WTF + +using WTF::RunLoop; + +#endif // RunLoop_h diff --git a/WTF/wtf/SHA1.cpp b/WTF/wtf/SHA1.cpp index 52b5529f..5db824fd 100644 --- a/WTF/wtf/SHA1.cpp +++ b/WTF/wtf/SHA1.cpp @@ -88,12 +88,10 @@ void SHA1::addBytes(const uint8_t* input, size_t length) } } -void SHA1::computeHash(Vector& digest) +void SHA1::computeHash(Digest& digest) { finalize(); - digest.clear(); - digest.resize(20); for (size_t i = 0; i < 5; ++i) { // Treat hashValue as a big-endian value. uint32_t hashValue = m_hash[i]; @@ -106,12 +104,12 @@ void SHA1::computeHash(Vector& digest) reset(); } -CString SHA1::hexDigest(const Vector& digest) +CString SHA1::hexDigest(const Digest& digest) { char* start = 0; CString result = CString::newUninitialized(40, start); char* buffer = start; - for (size_t i = 0; i < 20; ++i) { + for (size_t i = 0; i < hashSize; ++i) { snprintf(buffer, 3, "%02X", digest.at(i)); buffer += 2; } @@ -120,7 +118,7 @@ CString SHA1::hexDigest(const Vector& digest) CString SHA1::computeHexDigest() { - Vector digest; + Digest digest; computeHash(digest); return hexDigest(digest); } diff --git a/WTF/wtf/SHA1.h b/WTF/wtf/SHA1.h index 186a20a8..907072b7 100644 --- a/WTF/wtf/SHA1.h +++ b/WTF/wtf/SHA1.h @@ -31,6 +31,7 @@ #ifndef WTF_SHA1_h #define WTF_SHA1_h +#include #include #include @@ -56,15 +57,21 @@ class SHA1 { } WTF_EXPORT_PRIVATE void addBytes(const uint8_t* input, size_t length); + // Size of the SHA1 hash + WTF_EXPORT_PRIVATE static const size_t hashSize = 20; + + // type for computing SHA1 hash + typedef std::array Digest; + // computeHash has a side effect of resetting the state of the object. - WTF_EXPORT_PRIVATE void computeHash(Vector&); + WTF_EXPORT_PRIVATE void computeHash(Digest&); - // Get a hex hash from the digest. Pass a limit less than 40 if you want a shorter digest. - WTF_EXPORT_PRIVATE static CString hexDigest(const Vector&); + // Get a hex hash from the digest. + WTF_EXPORT_PRIVATE static CString hexDigest(const Digest&); - // Compute the hex digest directly. Pass a limit less than 40 if you want a shorter digest. + // Compute the hex digest directly. WTF_EXPORT_PRIVATE CString computeHexDigest(); - + private: void finalize(); void processBlock(); diff --git a/WTF/wtf/SixCharacterHash.cpp b/WTF/wtf/SixCharacterHash.cpp index cbfede4b..a5c7367c 100644 --- a/WTF/wtf/SixCharacterHash.cpp +++ b/WTF/wtf/SixCharacterHash.cpp @@ -58,11 +58,11 @@ unsigned sixCharacterHashStringToInteger(const char* string) return hash; } -FixedArray integerToSixCharacterHashString(unsigned hash) +std::array integerToSixCharacterHashString(unsigned hash) { - ASSERT(strlen(TABLE) == 62); - - FixedArray buffer; + static_assert(WTF_ARRAY_LENGTH(TABLE) - 1 == 62, "Six character hash table is not 62 characters long."); + + std::array buffer; unsigned accumulator = hash; for (unsigned i = 6; i--;) { buffer[i] = TABLE[accumulator % 62]; diff --git a/WTF/wtf/SixCharacterHash.h b/WTF/wtf/SixCharacterHash.h index ac340ba3..c5287d81 100644 --- a/WTF/wtf/SixCharacterHash.h +++ b/WTF/wtf/SixCharacterHash.h @@ -26,7 +26,7 @@ #ifndef SixCharacterHash_h #define SixCharacterHash_h -#include +#include namespace WTF { @@ -37,7 +37,7 @@ WTF_EXPORT_PRIVATE unsigned sixCharacterHashStringToInteger(const char*); // Takes a 32-bit integer and constructs a six-character string that contains // the character hash. -WTF_EXPORT_PRIVATE FixedArray integerToSixCharacterHashString(unsigned); +WTF_EXPORT_PRIVATE std::array integerToSixCharacterHashString(unsigned); } // namespace WTF diff --git a/WTF/wtf/StackBounds.cpp b/WTF/wtf/StackBounds.cpp index 62e2665a..4cb031cb 100644 --- a/WTF/wtf/StackBounds.cpp +++ b/WTF/wtf/StackBounds.cpp @@ -35,15 +35,6 @@ #include -#elif OS(QNX) - -#include -#include -#include -#include -#include -#include - #elif OS(UNIX) #include @@ -74,31 +65,6 @@ void StackBounds::initialize() m_bound = static_cast(m_origin) - size; } -#elif OS(QNX) - -void StackBounds::initialize() -{ - void* stackBase = 0; - size_t stackSize = 0; - - struct _debug_thread_info threadInfo; - memset(&threadInfo, 0, sizeof(threadInfo)); - threadInfo.tid = pthread_self(); - int fd = open("/proc/self", O_RDONLY); - if (fd == -1) { - LOG_ERROR("Unable to open /proc/self (errno: %d)", errno); - CRASH(); - } - devctl(fd, DCMD_PROC_TIDSTATUS, &threadInfo, sizeof(threadInfo), 0); - close(fd); - stackBase = reinterpret_cast(threadInfo.stkbase); - stackSize = threadInfo.stksize; - ASSERT(stackBase); - - m_bound = static_cast(stackBase) + 0x1000; // 4kb guard page - m_origin = static_cast(stackBase) + stackSize; -} - #elif OS(SOLARIS) void StackBounds::initialize() diff --git a/WTF/wtf/StackBounds.h b/WTF/wtf/StackBounds.h index a595c1b2..ca397496 100644 --- a/WTF/wtf/StackBounds.h +++ b/WTF/wtf/StackBounds.h @@ -30,9 +30,6 @@ namespace WTF { class StackBounds { - // isSafeToRecurse() / recursionLimit() tests (by default) - // that we are at least this far from the end of the stack. - // // This 64k number was picked because a sampling of stack usage differences // between consecutive entries into one of the Interpreter::execute...() // functions was seen to be as high as 27k. Hence, 64k is chosen as a @@ -49,14 +46,6 @@ class StackBounds { return bounds; } - bool isSafeToRecurse(size_t minAvailableDelta = s_defaultAvailabilityDelta) const - { - checkConsistency(); - if (isGrowingDownward()) - return current() >= recursionLimit(minAvailableDelta); - return current() <= recursionLimit(minAvailableDelta); - } - void* origin() const { ASSERT(m_origin); @@ -70,22 +59,6 @@ class StackBounds { return static_cast(m_bound) - static_cast(m_origin); } -private: - StackBounds() - : m_origin(0) - , m_bound(0) - { - } - - WTF_EXPORT_PRIVATE void initialize(); - - void* current() const - { - checkConsistency(); - void* currentPosition = ¤tPosition; - return currentPosition; - } - void* recursionLimit(size_t minAvailableDelta = s_defaultAvailabilityDelta) const { checkConsistency(); @@ -104,6 +77,15 @@ class StackBounds { #endif } +private: + StackBounds() + : m_origin(0) + , m_bound(0) + { + } + + WTF_EXPORT_PRIVATE void initialize(); + void checkConsistency() const { #if !ASSERT_DISABLED diff --git a/WTF/wtf/StdLibExtras.h b/WTF/wtf/StdLibExtras.h index 4bdb1039..a04a4f58 100644 --- a/WTF/wtf/StdLibExtras.h +++ b/WTF/wtf/StdLibExtras.h @@ -84,25 +84,23 @@ * - http://gcc.gnu.org/bugzilla/show_bug.cgi?id=43976 */ #if (CPU(ARM) || CPU(MIPS)) && COMPILER(GCC) - -// HACK, throwing an error -//template -//inline bool isPointerTypeAlignmentOkay(Type* ptr) -//{ -// return !(reinterpret_cast(ptr) % __alignof__(Type)); -//} +template +inline bool isPointerTypeAlignmentOkay(Type* ptr) +{ + return !(reinterpret_cast(ptr) % __alignof__(Type)); +} template inline TypePtr reinterpret_cast_ptr(void* ptr) { -// ASSERT(isPointerTypeAlignmentOkay(reinterpret_cast(ptr))); + ASSERT(isPointerTypeAlignmentOkay(reinterpret_cast(ptr))); return reinterpret_cast(ptr); } template inline TypePtr reinterpret_cast_ptr(const void* ptr) { -// ASSERT(isPointerTypeAlignmentOkay(reinterpret_cast(ptr))); + ASSERT(isPointerTypeAlignmentOkay(reinterpret_cast(ptr))); return reinterpret_cast(ptr); } #else @@ -312,7 +310,7 @@ inline void* operator new(size_t, NotNullTag, void* location) return location; } -#if (defined(_MSC_VER) && _MSC_VER < 1700) || (COMPILER(GCC) && !COMPILER(CLANG) && !GCC_VERSION_AT_LEAST(4, 8, 1)) +#if (COMPILER(GCC) && !COMPILER(CLANG) && !GCC_VERSION_AT_LEAST(4, 8, 1)) // Work-around for Pre-C++11 syntax in MSVC 2010, and prior as well as GCC < 4.8.1. namespace std { @@ -324,6 +322,8 @@ namespace std { // This adds various C++14 features for versions of the STL that may not yet have them. namespace std { +// MSVC 2013 supports std::make_unique already. +#if !defined(_MSC_VER) || _MSC_VER < 1800 template struct _Unique_if { typedef unique_ptr _Single_object; }; @@ -336,79 +336,11 @@ namespace std { typedef void _Known_bound; }; -#if COMPILER_SUPPORTS(CXX_VARIADIC_TEMPLATES) template inline typename _Unique_if::_Single_object make_unique(Args&&... args) { return unique_ptr(new T(std::forward(args)...)); } -#else - template inline typename _Unique_if::_Single_object - make_unique() - { - return unique_ptr(new T); - } - - template inline typename _Unique_if::_Single_object - make_unique(A1&& a1) - { - return unique_ptr(new T(std::forward(a1))); - } - - template inline typename _Unique_if::_Single_object - make_unique(A1&& a1, A2&& a2) - { - return unique_ptr(new T(std::forward(a1), std::forward(a2))); - } - - template inline typename _Unique_if::_Single_object - make_unique(A1&& a1, A2&& a2, A3&& a3) - { - return unique_ptr(new T(std::forward(a1), std::forward(a2), std::forward(a3))); - } - - template inline typename _Unique_if::_Single_object - make_unique(A1&& a1, A2&& a2, A3&& a3, A4&& a4) - { - return unique_ptr(new T(std::forward(a1), std::forward(a2), std::forward(a3), std::forward(a4))); - } - - template inline typename _Unique_if::_Single_object - make_unique(A1&& a1, A2&& a2, A3&& a3, A4&& a4, A5&& a5) - { - return unique_ptr(new T(std::forward(a1), std::forward(a2), std::forward(a3), std::forward(a4), std::forward(a5))); - } - - template inline typename _Unique_if::_Single_object - make_unique(A1&& a1, A2&& a2, A3&& a3, A4&& a4, A5&& a5, A6&& a6) - { - return unique_ptr(new T(std::forward(a1), std::forward(a2), std::forward(a3), std::forward(a4), std::forward(a5), std::forward(a6))); - } - - template inline typename _Unique_if::_Single_object - make_unique(A1&& a1, A2&& a2, A3&& a3, A4&& a4, A5&& a5, A6&& a6, A7&& a7) - { - return unique_ptr(new T(std::forward(a1), std::forward(a2), std::forward(a3), std::forward(a4), std::forward(a5), std::forward(a6), std::forward(a7))); - } - - template inline typename _Unique_if::_Single_object - make_unique(A1&& a1, A2&& a2, A3&& a3, A4&& a4, A5&& a5, A6&& a6, A7&& a7, A8&& a8) - { - return unique_ptr(new T(std::forward(a1), std::forward(a2), std::forward(a3), std::forward(a4), std::forward(a5), std::forward(a6), std::forward(a7), std::forward(a8))); - } - - template inline typename _Unique_if::_Single_object - make_unique(A1&& a1, A2&& a2, A3&& a3, A4&& a4, A5&& a5, A6&& a6, A7&& a7, A8&& a8, A9&& a9) - { - return unique_ptr(new T(std::forward(a1), std::forward(a2), std::forward(a3), std::forward(a4), std::forward(a5), std::forward(a6), std::forward(a7), std::forward(a8), std::forward(a9))); - } - - template inline typename _Unique_if::_Single_object - make_unique(A1&& a1, A2&& a2, A3&& a3, A4&& a4, A5&& a5, A6&& a6, A7&& a7, A8&& a8, A9&& a9, A10&& a10) - { - return unique_ptr(new T(std::forward(a1), std::forward(a2), std::forward(a3), std::forward(a4), std::forward(a5), std::forward(a6), std::forward(a7), std::forward(a8), std::forward(a9), std::forward(a10))); - } -#endif template inline typename _Unique_if::_Unknown_bound make_unique(size_t n) @@ -417,12 +349,10 @@ namespace std { return unique_ptr(new U[n]()); } -#if COMPILER_SUPPORTS(CXX_VARIADIC_TEMPLATES) template typename _Unique_if::_Known_bound make_unique(Args&&...) = delete; #endif -#if COMPILER_SUPPORTS(CXX_VARIADIC_TEMPLATES) // Compile-time integer sequences // http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2013/n3658.html // (Note that we only implement index_sequence, and not the more generic integer_sequence). @@ -441,7 +371,6 @@ namespace std { }; template struct make_index_sequence : public make_index_sequence_helper::type { }; -#endif } using WTF::KB; diff --git a/WTF/wtf/StringPrintStream.cpp b/WTF/wtf/StringPrintStream.cpp index 070af055..0fd6e476 100644 --- a/WTF/wtf/StringPrintStream.cpp +++ b/WTF/wtf/StringPrintStream.cpp @@ -54,11 +54,7 @@ void StringPrintStream::vprintf(const char* format, va_list argList) ASSERT(!m_buffer[m_next]); va_list firstPassArgList; -#if OS(WINDOWS) - firstPassArgList = argList; -#else va_copy(firstPassArgList, argList); -#endif int numberOfBytesNotIncludingTerminatorThatWouldHaveBeenWritten = vsnprintf(m_buffer + m_next, m_size - m_next, format, firstPassArgList); diff --git a/WTF/wtf/ThreadRestrictionVerifier.h b/WTF/wtf/ThreadRestrictionVerifier.h deleted file mode 100644 index f7ada509..00000000 --- a/WTF/wtf/ThreadRestrictionVerifier.h +++ /dev/null @@ -1,214 +0,0 @@ -/* - * Copyright (C) 2011 Google 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: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * 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. - * * Neither the name of Google Inc. nor the names of its - * contributors may be used to endorse or promote products derived from - * this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND 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 THE COPYRIGHT - * OWNER 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. - */ - -#ifndef ThreadRestrictionVerifier_h -#define ThreadRestrictionVerifier_h - -#include -#include -#include - -#if HAVE(DISPATCH_H) -#include -#endif - -#ifndef NDEBUG - -namespace WTF { - -// Verifies that a class is used in a way that respects its lack of thread-safety. -// The default mode is to verify that the object will only be used on a single thread. The -// thread gets captured when setShared(true) is called. -// The mode may be changed by calling useMutexMode (or turnOffVerification). - -// FIXME: This verifier is switched off because it fires false positives for -// objects that are used on multiple threads. Instead of an opt-out verifier, -// we probably need an opt-in verifier that marks select objects as being -// tied to select threads. -#if 0 -class ThreadRestrictionVerifier { -public: - ThreadRestrictionVerifier() - : m_mode(SingleThreadVerificationMode) - , m_shared(false) - , m_owningThread(0) - , m_mutex(0) -#if HAVE(DISPATCH_H) - , m_owningQueue(0) -#endif - { - } - -#if HAVE(DISPATCH_H) - ~ThreadRestrictionVerifier() - { - if (m_owningQueue) - dispatch_release(m_owningQueue); - } -#endif - - void setMutexMode(Mutex& mutex) - { - m_mode = MutexVerificationMode; - m_mutex = &mutex; - } - -#if HAVE(DISPATCH_H) - void setDispatchQueueMode(dispatch_queue_t queue) - { - m_mode = SingleDispatchQueueVerificationMode; - m_owningQueue = queue; - dispatch_retain(m_owningQueue); - } -#endif - - void turnOffVerification() - { - m_mode = NoVerificationMode; - } - - // Indicates that the object may (or may not) be owned by more than one place. - void setShared(bool shared) - { -#if !ASSERT_DISABLED - bool previouslyShared = m_shared; -#endif - m_shared = shared; - - if (!m_shared) - return; - - switch (m_mode) { - case SingleThreadVerificationMode: - ASSERT(shared != previouslyShared); - // Capture the current thread to verify that subsequent ref/deref happen on this thread. - m_owningThread = currentThread(); - return; - -#if HAVE(DISPATCH_H) - case SingleDispatchQueueVerificationMode: -#endif - case MutexVerificationMode: - case NoVerificationMode: - return; - } - ASSERT_NOT_REACHED(); - } - - // Is it OK to use the object at this moment on the current thread? - bool isSafeToUse() const - { - if (!m_shared) - return true; - - switch (m_mode) { - case SingleThreadVerificationMode: - return m_owningThread == currentThread(); - - case MutexVerificationMode: - if (!m_mutex->tryLock()) - return true; - m_mutex->unlock(); - return false; - -#if HAVE(DISPATCH_H) - case SingleDispatchQueueVerificationMode: - return m_owningQueue == dispatch_get_current_queue(); -#endif - - case NoVerificationMode: - return true; - } - ASSERT_NOT_REACHED(); - return true; - } - -private: - enum VerificationMode { - SingleThreadVerificationMode, - MutexVerificationMode, - NoVerificationMode, -#if HAVE(DISPATCH_H) - SingleDispatchQueueVerificationMode, -#endif - }; - - VerificationMode m_mode; - bool m_shared; - - // Used by SingleThreadVerificationMode - ThreadIdentifier m_owningThread; - - // Used by MutexVerificationMode. - Mutex* m_mutex; - -#if HAVE(DISPATCH_H) - // Used by SingleDispatchQueueVerificationMode. - dispatch_queue_t m_owningQueue; -#endif -}; -#else -class ThreadRestrictionVerifier { -public: - ThreadRestrictionVerifier() - { - } - - void setMutexMode(Mutex&) - { - } - -#if HAVE(DISPATCH_H) - void setDispatchQueueMode(dispatch_queue_t) - { - } -#endif - - void turnOffVerification() - { - } - - // Indicates that the object may (or may not) be owned by more than one place. - void setShared(bool) - { - } - - // Is it OK to use the object at this moment on the current thread? - bool isSafeToUse() const - { - return true; - } -}; -#endif - -} - -#endif -#endif diff --git a/WTF/wtf/Threading.h b/WTF/wtf/Threading.h index 3e558fc6..31f9d2f3 100644 --- a/WTF/wtf/Threading.h +++ b/WTF/wtf/Threading.h @@ -69,12 +69,6 @@ #include #include -// For portability, we do not use thread-safe statics natively supported by some compilers (e.g. gcc). -#define AtomicallyInitializedStatic(T, name) \ - WTF::lockAtomicallyInitializedStaticMutex(); \ - static T name; \ - WTF::unlockAtomicallyInitializedStaticMutex(); - namespace WTF { typedef uint32_t ThreadIdentifier; @@ -100,11 +94,6 @@ WTF_EXPORT_PRIVATE ThreadIdentifier currentThread(); WTF_EXPORT_PRIVATE int waitForThreadCompletion(ThreadIdentifier); WTF_EXPORT_PRIVATE void detachThread(ThreadIdentifier); -WTF_EXPORT_PRIVATE void yield(); - -WTF_EXPORT_PRIVATE void lockAtomicallyInitializedStaticMutex(); -WTF_EXPORT_PRIVATE void unlockAtomicallyInitializedStaticMutex(); - } // namespace WTF using WTF::ThreadIdentifier; @@ -112,6 +101,5 @@ using WTF::createThread; using WTF::currentThread; using WTF::detachThread; using WTF::waitForThreadCompletion; -using WTF::yield; #endif // Threading_h diff --git a/WTF/wtf/ThreadingOnce.h b/WTF/wtf/ThreadingOnce.h deleted file mode 100644 index 69d93c73..00000000 --- a/WTF/wtf/ThreadingOnce.h +++ /dev/null @@ -1,74 +0,0 @@ -/* - * Copyright (C) 2013 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. - * 3. Neither the name of Apple Computer, Inc. ("Apple") nor the names of - * its contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY APPLE 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 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. - * - */ - -#ifndef ThreadingOnce_h -#define ThreadingOnce_h - -#include - -namespace WTF { - -class ThreadingOnce { - WTF_MAKE_NONCOPYABLE(ThreadingOnce); -public: - ThreadingOnce() -#if USE(PTHREADS) - : m_onceHandle(PTHREAD_ONCE_INIT) -#else - : m_calledOnce(false) -#endif - { - } - - void callOnce(void (*initRoutine)()) - { -#if USE(PTHREADS) - pthread_once(&m_onceHandle, initRoutine); -#else - m_mutex.lock(); - if (!m_calledOnce) { - initRoutine(); - m_calledOnce = true; - } - m_mutex.unlock(); -#endif - } - -private: -#if USE(PTHREADS) - pthread_once_t m_onceHandle; -#else - Mutex m_mutex; - bool m_calledOnce; -#endif -}; - -} // namespace WTF - -#endif // ThreadingOnce_h diff --git a/WTF/wtf/ThreadingPrimitives.h b/WTF/wtf/ThreadingPrimitives.h index cf190794..16146c29 100644 --- a/WTF/wtf/ThreadingPrimitives.h +++ b/WTF/wtf/ThreadingPrimitives.h @@ -130,22 +130,12 @@ class ThreadCondition { WTF_EXPORT_PRIVATE DWORD absoluteTimeToWaitTimeoutInterval(double absoluteTime); #endif -inline void pauseBriefly() -{ -#if OS(WINDOWS) - Sleep(0); -#else - sched_yield(); -#endif -} - } // namespace WTF using WTF::Mutex; using WTF::MutexLocker; using WTF::MutexTryLocker; using WTF::ThreadCondition; -using WTF::pauseBriefly; #if OS(WINDOWS) using WTF::absoluteTimeToWaitTimeoutInterval; diff --git a/WTF/wtf/ThreadingPthreads.cpp b/WTF/wtf/ThreadingPthreads.cpp index c684aa4a..dab2d447 100644 --- a/WTF/wtf/ThreadingPthreads.cpp +++ b/WTF/wtf/ThreadingPthreads.cpp @@ -98,8 +98,6 @@ class PthreadState { typedef HashMap> ThreadMap; -static Mutex* atomicallyInitializedStaticMutex; - void unsafeThreadWasDetached(ThreadIdentifier); void threadDidExit(ThreadIdentifier); void threadWasJoined(ThreadIdentifier); @@ -110,31 +108,19 @@ static Mutex& threadMapMutex() return mutex; } -#if OS(QNX) && CPU(ARM_THUMB2) -static void enableIEEE754Denormal() -{ - // Clear the ARM_VFP_FPSCR_FZ flag in FPSCR. - unsigned fpscr; - asm volatile("vmrs %0, fpscr" : "=r"(fpscr)); - fpscr &= ~0x01000000u; - asm volatile("vmsr fpscr, %0" : : "r"(fpscr)); -} -#endif - void initializeThreading() { - if (atomicallyInitializedStaticMutex) + static bool isInitialized; + + if (isInitialized) return; -#if OS(QNX) && CPU(ARM_THUMB2) - enableIEEE754Denormal(); -#endif + isInitialized = true; WTF::double_conversion::initialize(); // StringImpl::empty() does not construct its static string in a threadsafe fashion, // so ensure it has been initialized from here. StringImpl::empty(); - atomicallyInitializedStaticMutex = new Mutex; threadMapMutex(); initializeRandomNumberGenerator(); ThreadIdentifierData::initializeOnce(); @@ -144,17 +130,6 @@ void initializeThreading() initializeDates(); } -void lockAtomicallyInitializedStaticMutex() -{ - ASSERT(atomicallyInitializedStaticMutex); - atomicallyInitializedStaticMutex->lock(); -} - -void unlockAtomicallyInitializedStaticMutex() -{ - atomicallyInitializedStaticMutex->unlock(); -} - static ThreadMap& threadMap() { DEFINE_STATIC_LOCAL(ThreadMap, map, ()); @@ -216,8 +191,6 @@ void initializeCurrentThreadInternal(const char* threadName) { #if HAVE(PTHREAD_SETNAME_NP) pthread_setname_np(threadName); -#elif OS(QNX) - pthread_setname_np(pthread_self(), threadName); #else UNUSED_PARAM(threadName); #endif @@ -228,10 +201,6 @@ void initializeCurrentThreadInternal(const char* threadName) objc_registerThreadWithCollector(); #endif -#if OS(QNX) && CPU(ARM_THUMB2) - enableIEEE754Denormal(); -#endif - ThreadIdentifier id = identifierByPthreadHandle(pthread_self()); ASSERT(id); ThreadIdentifierData::initialize(id); @@ -303,11 +272,6 @@ void threadDidExit(ThreadIdentifier threadID) threadMap().remove(threadID); } -void yield() -{ - sched_yield(); -} - ThreadIdentifier currentThread() { ThreadIdentifier id = ThreadIdentifierData::identifier(); diff --git a/WTF/wtf/ThreadingWin.cpp b/WTF/wtf/ThreadingWin.cpp index 49ecc1ae..e37c77e0 100644 --- a/WTF/wtf/ThreadingWin.cpp +++ b/WTF/wtf/ThreadingWin.cpp @@ -148,19 +148,6 @@ void initializeCurrentThreadInternal(const char* szThreadName) #endif } -static Mutex* atomicallyInitializedStaticMutex; - -void lockAtomicallyInitializedStaticMutex() -{ - ASSERT(atomicallyInitializedStaticMutex); - atomicallyInitializedStaticMutex->lock(); -} - -void unlockAtomicallyInitializedStaticMutex() -{ - atomicallyInitializedStaticMutex->unlock(); -} - static Mutex& threadMapMutex() { static Mutex mutex; @@ -169,14 +156,17 @@ static Mutex& threadMapMutex() void initializeThreading() { - if (atomicallyInitializedStaticMutex) + static bool isInitialized; + + if (isInitialized) return; + isInitialized = true; + WTF::double_conversion::initialize(); // StringImpl::empty() does not construct its static string in a threadsafe fashion, // so ensure it has been initialized from here. StringImpl::empty(); - atomicallyInitializedStaticMutex = new Mutex; threadMapMutex(); initializeRandomNumberGenerator(); wtfThreadData(); @@ -284,11 +274,6 @@ void detachThread(ThreadIdentifier threadID) clearThreadHandleForIdentifier(threadID); } -void yield() -{ - ::Sleep(1); -} - ThreadIdentifier currentThread() { return static_cast(GetCurrentThreadId()); diff --git a/WTF/wtf/Vector.h b/WTF/wtf/Vector.h index 4d325851..954f612b 100644 --- a/WTF/wtf/Vector.h +++ b/WTF/wtf/Vector.h @@ -532,7 +532,8 @@ class Vector : private VectorBuffer { Vector() { } - + + // Unlike in std::vector, this constructor does not initialize POD types. explicit Vector(size_t size) : Base(size, size) { @@ -547,6 +548,15 @@ class Vector : private VectorBuffer { TypeOperations::uninitializedFill(begin(), end(), val); } +#if COMPILER_SUPPORTS(CXX_GENERALIZED_INITIALIZERS) + Vector(std::initializer_list initializerList) + { + reserveInitialCapacity(initializerList.size()); + for (const auto& element : initializerList) + uncheckedAppend(element); + } +#endif + ~Vector() { if (m_size) diff --git a/WTF/wtf/VectorTraits.h b/WTF/wtf/VectorTraits.h index 3f2d7c27..e3595cde 100644 --- a/WTF/wtf/VectorTraits.h +++ b/WTF/wtf/VectorTraits.h @@ -27,8 +27,6 @@ #include #include -using std::pair; - namespace WTF { class AtomicString; diff --git a/WTF/wtf/blackberry/MainThreadBlackBerry.cpp b/WTF/wtf/blackberry/MainThreadBlackBerry.cpp deleted file mode 100644 index ec7a364d..00000000 --- a/WTF/wtf/blackberry/MainThreadBlackBerry.cpp +++ /dev/null @@ -1,36 +0,0 @@ -/* - * Copyright (C) 2009, 2010, 2011 Research In Motion Limited. All rights reserved. - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - */ - -#include "config.h" -#include "MainThread.h" - -#include -#include - -namespace WTF { - -void initializeMainThreadPlatform() -{ -} - -void scheduleDispatchFunctionsOnMainThread() -{ - BlackBerry::Platform::webKitThreadMessageClient()->dispatchMessage(BlackBerry::Platform::createFunctionCallMessage(dispatchFunctionsFromMainThread)); -} - -} // namespace WTF diff --git a/WTF/wtf/cf/RunLoopCF.cpp b/WTF/wtf/cf/RunLoopCF.cpp new file mode 100644 index 00000000..96758670 --- /dev/null +++ b/WTF/wtf/cf/RunLoopCF.cpp @@ -0,0 +1,129 @@ +/* + * Copyright (C) 2010, 2012 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. + */ + +#include "config.h" +#include "RunLoop.h" + +#include +#include +#include + +namespace WTF { + +void RunLoop::performWork(void* context) +{ + AutodrainedPool pool; + static_cast(context)->performWork(); +} + +RunLoop::RunLoop() + : m_runLoop(CFRunLoopGetCurrent()) + , m_nestingLevel(0) +{ + CFRunLoopSourceContext context = { 0, this, 0, 0, 0, 0, 0, 0, 0, performWork }; + m_runLoopSource = adoptCF(CFRunLoopSourceCreate(kCFAllocatorDefault, 0, &context)); + CFRunLoopAddSource(m_runLoop.get(), m_runLoopSource.get(), kCFRunLoopCommonModes); +} + +RunLoop::~RunLoop() +{ + CFRunLoopSourceInvalidate(m_runLoopSource.get()); +} + +void RunLoop::runForDuration(double duration) +{ + CFRunLoopRunInMode(kCFRunLoopDefaultMode, duration, true); +} + +void RunLoop::wakeUp() +{ + CFRunLoopSourceSignal(m_runLoopSource.get()); + CFRunLoopWakeUp(m_runLoop.get()); +} + +void RunLoop::run() +{ + current()->m_nestingLevel++; + + { + AutodrainedPool pool; + CFRunLoopRun(); + } + + current()->m_nestingLevel--; +} + +void RunLoop::stop() +{ + ASSERT(m_runLoop == CFRunLoopGetCurrent()); + CFRunLoopStop(m_runLoop.get()); +} + +// RunLoop::Timer + +void RunLoop::TimerBase::timerFired(CFRunLoopTimerRef, void* context) +{ + TimerBase* timer = static_cast(context); + + AutodrainedPool pool; + timer->fired(); +} + +RunLoop::TimerBase::TimerBase(RunLoop* runLoop) + : m_runLoop(runLoop) +{ +} + +RunLoop::TimerBase::~TimerBase() +{ + stop(); +} + +void RunLoop::TimerBase::start(double nextFireInterval, bool repeat) +{ + if (m_timer) + stop(); + + CFRunLoopTimerContext context = { 0, this, 0, 0, 0 }; + CFTimeInterval repeatInterval = repeat ? nextFireInterval : 0; + m_timer = adoptCF(CFRunLoopTimerCreate(kCFAllocatorDefault, CFAbsoluteTimeGetCurrent() + nextFireInterval, repeatInterval, 0, 0, timerFired, &context)); + CFRunLoopAddTimer(m_runLoop->m_runLoop.get(), m_timer.get(), kCFRunLoopCommonModes); +} + +void RunLoop::TimerBase::stop() +{ + if (!m_timer) + return; + + CFRunLoopTimerInvalidate(m_timer.get()); + m_timer = nullptr; +} + +bool RunLoop::TimerBase::isActive() const +{ + return m_timer && CFRunLoopTimerIsValid(m_timer.get()); +} + +} // namespace WTF diff --git a/WTF/wtf/dtoa/double-conversion.cc b/WTF/wtf/dtoa/double-conversion.cc index 5ab50249..abf287a8 100644 --- a/WTF/wtf/dtoa/double-conversion.cc +++ b/WTF/wtf/dtoa/double-conversion.cc @@ -444,9 +444,9 @@ namespace double_conversion { if (current == end) return 0.0; // The longest form of simplified number is: "-.1eXXX\0". - const int kBufferSize = kMaxSignificantDigits + 10; + const unsigned kBufferSize = kMaxSignificantDigits + 10; char buffer[kBufferSize]; // NOLINT: size is known at compile time. - int buffer_pos = 0; + unsigned buffer_pos = 0; // Exponent will be adjusted if insignificant digits of the integer part // or insignificant leading zeros of the fractional part are dropped. diff --git a/WTF/wtf/dtoa/utils.h b/WTF/wtf/dtoa/utils.h index 88594fec..0a970c54 100644 --- a/WTF/wtf/dtoa/utils.h +++ b/WTF/wtf/dtoa/utils.h @@ -49,7 +49,7 @@ defined(__ARMEL__) || \ defined(_MIPS_ARCH_MIPS32R2) #define DOUBLE_CONVERSION_CORRECT_DOUBLE_OPERATIONS 1 -#elif CPU(MIPS) || CPU(PPC) || CPU(PPC64) || OS(WINCE) || CPU(SH4) || CPU(S390) || CPU(S390X) || CPU(IA64) || CPU(SPARC) || CPU(ALPHA) || CPU(ARM64) +#elif CPU(MIPS) || CPU(PPC) || CPU(PPC64) || OS(WINCE) || CPU(SH4) || CPU(S390) || CPU(S390X) || CPU(IA64) || CPU(ALPHA) || CPU(ARM64) || CPU(HPPA) #define DOUBLE_CONVERSION_CORRECT_DOUBLE_OPERATIONS 1 #elif defined(_M_IX86) || defined(__i386__) #if defined(_WIN32) diff --git a/WTF/wtf/efl/RunLoopEfl.cpp b/WTF/wtf/efl/RunLoopEfl.cpp new file mode 100644 index 00000000..4a38497e --- /dev/null +++ b/WTF/wtf/efl/RunLoopEfl.cpp @@ -0,0 +1,134 @@ +/* + * Copyright (C) 2012 ProFUSION embedded systems. All rights reserved. + * Copyright (C) 2012 Samsung Electronics + * + * 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 THE COPYRIGHT HOLDERS AND 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 THE COPYRIGHT + * OWNER 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 "RunLoop.h" + +#include +#include +#include + +static const int ecorePipeMessageSize = 1; +static const char wakupEcorePipeMessage[] = "W"; + +namespace WTF { + +RunLoop::RunLoop() + : m_initEfl(false) + , m_wakeUpEventRequested(false) +{ + m_pipe = adoptPtr(ecore_pipe_add(wakeUpEvent, this)); + m_initEfl = true; +} + +RunLoop::~RunLoop() +{ +} + +void RunLoop::run() +{ + ecore_main_loop_begin(); +} + +void RunLoop::stop() +{ + ecore_main_loop_quit(); +} + +void RunLoop::wakeUpEvent(void* data, void*, unsigned) +{ + RunLoop* loop = static_cast(data); + + { + MutexLocker locker(loop->m_wakeUpEventRequestedLock); + loop->m_wakeUpEventRequested = false; + } + + loop->performWork(); +} + +void RunLoop::wakeUp() +{ + { + MutexLocker locker(m_wakeUpEventRequestedLock); + if (m_wakeUpEventRequested) + return; + m_wakeUpEventRequested = true; + } + + { + MutexLocker locker(m_pipeLock); + ecore_pipe_write(m_pipe.get(), wakupEcorePipeMessage, ecorePipeMessageSize); + } +} + +RunLoop::TimerBase::TimerBase(RunLoop*) + : m_timer(0) + , m_isRepeating(false) +{ +} + +RunLoop::TimerBase::~TimerBase() +{ + stop(); +} + +bool RunLoop::TimerBase::timerFired(void* data) +{ + RunLoop::TimerBase* timer = static_cast(data); + + if (!timer->m_isRepeating) + timer->m_timer = 0; + + timer->fired(); + + return timer->m_isRepeating ? ECORE_CALLBACK_RENEW : ECORE_CALLBACK_CANCEL; +} + +void RunLoop::TimerBase::start(double nextFireInterval, bool repeat) +{ + if (isActive()) + stop(); + + m_isRepeating = repeat; + ASSERT(!m_timer); + m_timer = ecore_timer_add(nextFireInterval, reinterpret_cast(timerFired), this); +} + +void RunLoop::TimerBase::stop() +{ + if (m_timer) { + ecore_timer_del(m_timer); + m_timer = 0; + } +} + +bool RunLoop::TimerBase::isActive() const +{ + return (m_timer) ? true : false; +} + +} // namespace WTF diff --git a/WTF/wtf/gobject/GOwnPtr.cpp b/WTF/wtf/gobject/GOwnPtr.cpp index 312dcff4..59356d62 100644 --- a/WTF/wtf/gobject/GOwnPtr.cpp +++ b/WTF/wtf/gobject/GOwnPtr.cpp @@ -26,7 +26,7 @@ namespace WTF { -template <> void freeOwnedGPtr(GError* ptr) +template <> WTF_EXPORT_PRIVATE void freeOwnedGPtr(GError* ptr) { if (ptr) g_error_free(ptr); diff --git a/WTF/wtf/gobject/GOwnPtr.h b/WTF/wtf/gobject/GOwnPtr.h index 02413023..cd2623b8 100644 --- a/WTF/wtf/gobject/GOwnPtr.h +++ b/WTF/wtf/gobject/GOwnPtr.h @@ -33,7 +33,7 @@ extern "C" void g_free(void*); namespace WTF { template inline void freeOwnedGPtr(T* ptr); -template<> void freeOwnedGPtr(GError*); +template<> WTF_EXPORT_PRIVATE void freeOwnedGPtr(GError*); template<> void freeOwnedGPtr(GList*); template<> void freeOwnedGPtr(GSList*); template<> void freeOwnedGPtr(GPatternSpec*); diff --git a/WTF/wtf/gtk/RunLoopGtk.cpp b/WTF/wtf/gtk/RunLoopGtk.cpp new file mode 100644 index 00000000..8a2ea220 --- /dev/null +++ b/WTF/wtf/gtk/RunLoopGtk.cpp @@ -0,0 +1,169 @@ +/* + * Copyright (C) 2010 Apple Inc. All rights reserved. + * Portions Copyright (c) 2010 Motorola Mobility, 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. + */ + +#include "config.h" +#include "RunLoop.h" + +#include +#include + +namespace WTF { + +RunLoop::RunLoop() +{ + // g_main_context_default() doesn't add an extra reference. + m_runLoopContext = isMainThread() ? g_main_context_default() : adoptGRef(g_main_context_new()); + ASSERT(m_runLoopContext); + GRefPtr innermostLoop = adoptGRef(g_main_loop_new(m_runLoopContext.get(), FALSE)); + ASSERT(innermostLoop); + m_runLoopMainLoops.append(innermostLoop); +} + +RunLoop::~RunLoop() +{ + for (int i = m_runLoopMainLoops.size() - 1; i >= 0; --i) { + if (!g_main_loop_is_running(m_runLoopMainLoops[i].get())) + continue; + g_main_loop_quit(m_runLoopMainLoops[i].get()); + } +} + +void RunLoop::run() +{ + RunLoop* mainRunLoop = RunLoop::current(); + GMainLoop* innermostLoop = mainRunLoop->innermostLoop(); + if (!g_main_loop_is_running(innermostLoop)) { + g_main_loop_run(innermostLoop); + return; + } + + // Create and run a nested loop if the innermost one was already running. + GMainLoop* nestedMainLoop = g_main_loop_new(0, FALSE); + mainRunLoop->pushNestedMainLoop(nestedMainLoop); + g_main_loop_run(nestedMainLoop); + mainRunLoop->popNestedMainLoop(); +} + +GMainLoop* RunLoop::innermostLoop() +{ + // The innermost main loop should always be there. + ASSERT(!m_runLoopMainLoops.isEmpty()); + return m_runLoopMainLoops[0].get(); +} + +void RunLoop::pushNestedMainLoop(GMainLoop* nestedLoop) +{ + // The innermost main loop should always be there. + ASSERT(!m_runLoopMainLoops.isEmpty()); + m_runLoopMainLoops.append(adoptGRef(nestedLoop)); +} + +void RunLoop::popNestedMainLoop() +{ + // The innermost main loop should always be there. + ASSERT(!m_runLoopMainLoops.isEmpty()); + m_runLoopMainLoops.removeLast(); +} + +void RunLoop::stop() +{ + // The innermost main loop should always be there. + ASSERT(!m_runLoopMainLoops.isEmpty()); + GRefPtr lastMainLoop = m_runLoopMainLoops.last(); + if (g_main_loop_is_running(lastMainLoop.get())) + g_main_loop_quit(lastMainLoop.get()); +} + +gboolean RunLoop::queueWork(RunLoop* runLoop) +{ + runLoop->performWork(); + return FALSE; +} + +void RunLoop::wakeUp() +{ + GRefPtr source = adoptGRef(g_idle_source_new()); + g_source_set_priority(source.get(), G_PRIORITY_DEFAULT); + g_source_set_callback(source.get(), reinterpret_cast(&RunLoop::queueWork), this, 0); + g_source_attach(source.get(), m_runLoopContext.get()); + + g_main_context_wakeup(m_runLoopContext.get()); +} + +RunLoop::TimerBase::TimerBase(RunLoop* runLoop) + : m_runLoop(runLoop) + , m_timerSource(0) +{ +} + +RunLoop::TimerBase::~TimerBase() +{ + stop(); +} + +void RunLoop::TimerBase::clearTimerSource() +{ + m_timerSource = 0; +} + +gboolean RunLoop::TimerBase::timerFiredCallback(RunLoop::TimerBase* timer) +{ + GSource* currentTimerSource = timer->m_timerSource.get(); + bool isRepeating = timer->isRepeating(); + // This can change the timerSource by starting a new timer within the callback. + if (!isRepeating && currentTimerSource == timer->m_timerSource.get()) + timer->clearTimerSource(); + + timer->fired(); + return isRepeating; +} + +void RunLoop::TimerBase::start(double fireInterval, bool repeat) +{ + if (m_timerSource) + stop(); + + m_timerSource = adoptGRef(g_timeout_source_new(static_cast(fireInterval * 1000))); + m_isRepeating = repeat; + g_source_set_callback(m_timerSource.get(), reinterpret_cast(&RunLoop::TimerBase::timerFiredCallback), this, 0); + g_source_attach(m_timerSource.get(), m_runLoop->m_runLoopContext.get()); +} + +void RunLoop::TimerBase::stop() +{ + if (!m_timerSource) + return; + + g_source_destroy(m_timerSource.get()); + clearTimerSource(); +} + +bool RunLoop::TimerBase::isActive() const +{ + return m_timerSource; +} + +} // namespace WTF diff --git a/WTF/wtf/ios/WebCoreThread.cpp b/WTF/wtf/ios/WebCoreThread.cpp index 42744660..f07dc30e 100644 --- a/WTF/wtf/ios/WebCoreThread.cpp +++ b/WTF/wtf/ios/WebCoreThread.cpp @@ -28,4 +28,7 @@ #if USE(WEB_THREAD) WTF_EXPORT_PRIVATE bool (*WebCoreWebThreadIsLockedOrDisabled)(void); +WTF_EXPORT_PRIVATE bool (*WebCoreWebThreadIsEnabled)(void); +WTF_EXPORT_PRIVATE void (*WebCoreWebThreadRun)(void (^block)()); +WTF_EXPORT_PRIVATE void (*WebCoreWebThreadRunSync)(void (^block)()); #endif diff --git a/WTF/wtf/ios/WebCoreThread.h b/WTF/wtf/ios/WebCoreThread.h index 10e26a77..819ceefa 100644 --- a/WTF/wtf/ios/WebCoreThread.h +++ b/WTF/wtf/ios/WebCoreThread.h @@ -33,6 +33,9 @@ extern "C" { #endif extern bool (*WebCoreWebThreadIsLockedOrDisabled)(void); +extern bool (*WebCoreWebThreadIsEnabled)(void); +extern void (*WebCoreWebThreadRun)(void (^block)()); +extern void (*WebCoreWebThreadRunSync)(void (^block)()); #ifdef __cplusplus } diff --git a/WTF/wtf/mac/DeprecatedSymbolsUsedBySafari.mm b/WTF/wtf/mac/DeprecatedSymbolsUsedBySafari.mm new file mode 100644 index 00000000..0f897d10 --- /dev/null +++ b/WTF/wtf/mac/DeprecatedSymbolsUsedBySafari.mm @@ -0,0 +1,68 @@ +/* + * Copyright (C) 2014 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. + */ + +#include "config.h" + +#include "Functional.h" +#include "MainThread.h" +#include "StdLibExtras.h" +#include + +// This file contains deprecated symbols that the last released version of Safari uses. +// Once Safari stops using them, we should remove them. + +namespace WTF { + +WTF_EXPORT_PRIVATE void callOnMainThread(const Function&); +WTF_EXPORT_PRIVATE void lockAtomicallyInitializedStaticMutex(); +WTF_EXPORT_PRIVATE void unlockAtomicallyInitializedStaticMutex(); + +void callOnMainThread(const Function& function) +{ + callOnMainThread(std::function(function)); +} + +static std::mutex& atomicallyInitializedStaticMutex() +{ + static std::once_flag onceFlag; + static std::mutex* mutex; + std::call_once(onceFlag, []{ + mutex = std::make_unique().release(); + }); + + return *mutex; +} + +void lockAtomicallyInitializedStaticMutex() +{ + atomicallyInitializedStaticMutex().lock(); +} + +void unlockAtomicallyInitializedStaticMutex() +{ + atomicallyInitializedStaticMutex().unlock(); +} + +} // namespace WTF diff --git a/WTF/wtf/nix/FeatureDefinesNix.h b/WTF/wtf/nix/FeatureDefinesNix.h index 745d8d05..acde3f40 100644 --- a/WTF/wtf/nix/FeatureDefinesNix.h +++ b/WTF/wtf/nix/FeatureDefinesNix.h @@ -1,16 +1,16 @@ /* -* Copyright (C) 2013 Nokia Corporation and/or its subsidiary(-ies). -* -* 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 THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * Copyright (C) 2013 Nokia Corporation and/or its subsidiary(-ies). + * + * 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 THE COPYRIGHT HOLDERS AND 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 THE COPYRIGHT @@ -30,6 +30,10 @@ #define ENABLE_3D_RENDERING 1 #endif +#if !defined(ENABLE_8BIT_TEXTRUN) +#define ENABLE_8BIT_TEXTRUN 1 +#endif + #if !defined(ENABLE_ACCELERATED_2D_CANVAS) #define ENABLE_ACCELERATED_2D_CANVAS 0 #endif @@ -94,10 +98,6 @@ #define ENABLE_CSS_SHADERS 1 #endif -#if !defined(ENABLE_CSS_VARIABLES) -#define ENABLE_CSS_VARIABLES 1 -#endif - #if !defined(ENABLE_DATALIST_ELEMENT) #define ENABLE_DATALIST_ELEMENT 1 #endif @@ -107,7 +107,7 @@ #endif #if !defined(ENABLE_DRAG_SUPPORT) -#define ENABLE_DRAG_SUPPORT 0 +#define ENABLE_DRAG_SUPPORT 1 #endif #if !defined(ENABLE_FAST_MOBILE_SCROLLING) @@ -154,6 +154,10 @@ #define ENABLE_INSPECTOR_SERVER 1 #endif +#if !defined(ENABLE_INPUT_SPEECH) +#define ENABLE_INPUT_SPEECH 1 +#endif + #if !defined(ENABLE_JAVASCRIPT_DEBUGGER) #define ENABLE_JAVASCRIPT_DEBUGGER 1 #endif @@ -178,6 +182,10 @@ #define ENABLE_MATHML 1 #endif +#if !defined(ENABLE_MEDIA_STREAM) +#define ENABLE_MEDIA_STREAM 0 +#endif + #if !defined(ENABLE_METER_ELEMENT) #define ENABLE_METER_ELEMENT 1 #endif @@ -194,6 +202,14 @@ #define ENABLE_NETWORK_INFO 1 #endif +#if !defined(ENABLE_NETWORK_PROCESS) +#define ENABLE_NETWORK_PROCESS 0 +#endif + +#if !defined(ENABLE_OPENTYPE_VERTICAL) +#define ENABLE_OPENTYPE_VERTICAL 1 +#endif + #if !defined(ENABLE_PAGE_VISIBILITY_API) #define ENABLE_PAGE_VISIBILITY_API 1 #endif @@ -278,10 +294,6 @@ #define ENABLE_WEB_TIMING 1 #endif -#if !defined(ENABLE_WORKERS) -#define ENABLE_WORKERS 1 -#endif - #if !defined(ENABLE_XHR_RESPONSE_BLOB) #define ENABLE_XHR_RESPONSE_BLOB 1 #endif diff --git a/WTF/wtf/nix/PlatformNix.h b/WTF/wtf/nix/PlatformNix.h index 710be443..8e5c7853 100644 --- a/WTF/wtf/nix/PlatformNix.h +++ b/WTF/wtf/nix/PlatformNix.h @@ -39,7 +39,6 @@ #define WTF_USE_HARFBUZZ 1 #define WTF_USE_HARFBUZZ_NG 1 #define WTF_USE_ICU_UNICODE 1 -#define WTF_USE_IOSURFACE_CANVAS_BACKING_STORE 1 #define WTF_USE_LEVELDB 1 #define WTF_USE_PTHREADS 1 #define WTF_USE_TEXTURE_MAPPER 1 diff --git a/WTF/wtf/nix/RunLoopNix.cpp b/WTF/wtf/nix/RunLoopNix.cpp new file mode 100644 index 00000000..c0ddf4ed --- /dev/null +++ b/WTF/wtf/nix/RunLoopNix.cpp @@ -0,0 +1,172 @@ +/* + * Copyright (C) 2010 Apple Inc. All rights reserved. + * Portions Copyright (c) 2010 Motorola Mobility, Inc. All rights reserved. + * Copyright (C) 2013 Nokia Corporation and/or its subsidiary(-ies). + * + * 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. + */ + +#include "config.h" +#include "RunLoop.h" + +#include + +#include + +namespace WTF { + +RunLoop::RunLoop() +{ + // g_main_context_default() doesn't add an extra reference. + m_runLoopContext = isMainThread() ? g_main_context_default() : adoptGRef(g_main_context_new()); + ASSERT(m_runLoopContext); + GRefPtr innermostLoop = adoptGRef(g_main_loop_new(m_runLoopContext.get(), FALSE)); + ASSERT(innermostLoop); + m_runLoopMainLoops.append(innermostLoop); +} + +RunLoop::~RunLoop() +{ + for (int i = m_runLoopMainLoops.size() - 1; i >= 0; --i) { + if (!g_main_loop_is_running(m_runLoopMainLoops[i].get())) + continue; + g_main_loop_quit(m_runLoopMainLoops[i].get()); + } +} + +void RunLoop::run() +{ + RunLoop* mainRunLoop = RunLoop::current(); + GMainLoop* innermostLoop = mainRunLoop->innermostLoop(); + if (!g_main_loop_is_running(innermostLoop)) { + g_main_loop_run(innermostLoop); + return; + } + + // Create and run a nested loop if the innermost one was already running. + GMainLoop* nestedMainLoop = g_main_loop_new(0, FALSE); + mainRunLoop->pushNestedMainLoop(nestedMainLoop); + g_main_loop_run(nestedMainLoop); + mainRunLoop->popNestedMainLoop(); +} + +GMainLoop* RunLoop::innermostLoop() +{ + // The innermost main loop should always be there. + ASSERT(!m_runLoopMainLoops.isEmpty()); + return m_runLoopMainLoops[0].get(); +} + +void RunLoop::pushNestedMainLoop(GMainLoop* nestedLoop) +{ + // The innermost main loop should always be there. + ASSERT(!m_runLoopMainLoops.isEmpty()); + m_runLoopMainLoops.append(adoptGRef(nestedLoop)); +} + +void RunLoop::popNestedMainLoop() +{ + // The innermost main loop should always be there. + ASSERT(!m_runLoopMainLoops.isEmpty()); + m_runLoopMainLoops.removeLast(); +} + +void RunLoop::stop() +{ + // The innermost main loop should always be there. + ASSERT(!m_runLoopMainLoops.isEmpty()); + GRefPtr lastMainLoop = m_runLoopMainLoops.last(); + if (g_main_loop_is_running(lastMainLoop.get())) + g_main_loop_quit(lastMainLoop.get()); +} + +gboolean RunLoop::queueWork(RunLoop* runLoop) +{ + runLoop->performWork(); + return FALSE; +} + +void RunLoop::wakeUp() +{ + GRefPtr source = adoptGRef(g_idle_source_new()); + g_source_set_priority(source.get(), G_PRIORITY_DEFAULT); + g_source_set_callback(source.get(), reinterpret_cast(&RunLoop::queueWork), this, 0); + g_source_attach(source.get(), m_runLoopContext.get()); + + g_main_context_wakeup(m_runLoopContext.get()); +} + +RunLoop::TimerBase::TimerBase(RunLoop* runLoop) + : m_runLoop(runLoop) + , m_timerSource(0) +{ +} + +RunLoop::TimerBase::~TimerBase() +{ + stop(); +} + +void RunLoop::TimerBase::clearTimerSource() +{ + m_timerSource = 0; +} + +gboolean RunLoop::TimerBase::timerFiredCallback(RunLoop::TimerBase* timer) +{ + GSource* currentTimerSource = timer->m_timerSource.get(); + bool isRepeating = timer->isRepeating(); + // This can change the timerSource by starting a new timer within the callback. + if (!isRepeating && currentTimerSource == timer->m_timerSource.get()) + timer->clearTimerSource(); + + timer->fired(); + return isRepeating; +} + +void RunLoop::TimerBase::start(double fireInterval, bool repeat) +{ + if (m_timerSource) + stop(); + + m_timerSource = adoptGRef(g_timeout_source_new(static_cast(fireInterval * 1000))); + m_isRepeating = repeat; + g_source_set_callback(m_timerSource.get(), reinterpret_cast(&RunLoop::TimerBase::timerFiredCallback), this, 0); + g_source_attach(m_timerSource.get(), m_runLoop->m_runLoopContext.get()); +} + +void RunLoop::TimerBase::stop() +{ + if (!m_timerSource) + return; + + g_source_destroy(m_timerSource.get()); + clearTimerSource(); +} + +bool RunLoop::TimerBase::isActive() const +{ + return m_timerSource; +} + +} // namespace WTF + diff --git a/WTF/wtf/text/AtomicString.cpp b/WTF/wtf/text/AtomicString.cpp index 1d149cbb..5803dd01 100644 --- a/WTF/wtf/text/AtomicString.cpp +++ b/WTF/wtf/text/AtomicString.cpp @@ -97,7 +97,7 @@ struct CStringTranslator { static void translate(StringImpl*& location, const LChar* const& c, unsigned hash) { - location = StringImpl::create(c).leakRef(); + location = &StringImpl::create(c).leakRef(); location->setHash(hash); location->setIsAtomic(true); } @@ -187,7 +187,7 @@ struct HashAndUTF8CharactersTranslator { // If buffer contains only ASCII characters UTF-8 and UTF16 length are the same. if (buffer.utf16Length != buffer.length) { - const UChar* stringCharacters = string->characters(); + const UChar* stringCharacters = string->deprecatedCharacters(); return equalUTF16WithUTF8(stringCharacters, stringCharacters + string->length(), buffer.characters, buffer.characters + buffer.length); } @@ -283,17 +283,17 @@ struct SubstringLocation { struct SubstringTranslator { static unsigned hash(const SubstringLocation& buffer) { - return StringHasher::computeHashAndMaskTop8Bits(buffer.baseString->characters() + buffer.start, buffer.length); + return StringHasher::computeHashAndMaskTop8Bits(buffer.baseString->deprecatedCharacters() + buffer.start, buffer.length); } static bool equal(StringImpl* const& string, const SubstringLocation& buffer) { - return WTF::equal(string, buffer.baseString->characters() + buffer.start, buffer.length); + return WTF::equal(string, buffer.baseString->deprecatedCharacters() + buffer.start, buffer.length); } static void translate(StringImpl*& location, const SubstringLocation& buffer, unsigned hash) { - location = StringImpl::create(buffer.baseString, buffer.start, buffer.length).leakRef(); + location = &StringImpl::create(buffer.baseString, buffer.start, buffer.length).leakRef(); location->setHash(hash); location->setIsAtomic(true); } @@ -352,7 +352,7 @@ struct CharBufferFromLiteralDataTranslator { static void translate(StringImpl*& location, const CharBuffer& buf, unsigned hash) { - location = StringImpl::createFromLiteral(buf.s, buf.length).leakRef(); + location = &StringImpl::createFromLiteral(buf.s, buf.length).leakRef(); location->setHash(hash); location->setIsAtomic(true); } diff --git a/WTF/wtf/text/AtomicString.h b/WTF/wtf/text/AtomicString.h index 2ac2406d..4142de14 100644 --- a/WTF/wtf/text/AtomicString.h +++ b/WTF/wtf/text/AtomicString.h @@ -93,7 +93,7 @@ class AtomicString { AtomicStringImpl* impl() const { return static_cast(m_string.impl()); } bool is8Bit() const { return m_string.is8Bit(); } - const UChar* characters() const { return m_string.characters(); } + const UChar* characters() const { return m_string.deprecatedCharacters(); } // FIXME: Delete this. const LChar* characters8() const { return m_string.characters8(); } const UChar* characters16() const { return m_string.characters16(); } unsigned length() const { return m_string.length(); } @@ -153,10 +153,6 @@ class AtomicString { AtomicString(NSString* s) : m_string(add((CFStringRef)s)) { } operator NSString*() const { return m_string; } #endif -#if PLATFORM(BLACKBERRY) - AtomicString(const BlackBerry::Platform::String& s) : m_string(add(String(s).impl())) { } - operator BlackBerry::Platform::String() const { return m_string; } -#endif // AtomicString::fromUTF8 will return a null string if // the input data contains invalid UTF-8 sequences. @@ -192,7 +188,7 @@ class AtomicString { WTF_EXPORT_STRING_API static PassRefPtr addFromLiteralData(const char* characters, unsigned length); WTF_EXPORT_STRING_API static PassRefPtr addSlowCase(StringImpl*); #if USE(CF) - static PassRefPtr add(CFStringRef); + WTF_EXPORT_STRING_API static PassRefPtr add(CFStringRef); #endif WTF_EXPORT_STRING_API static AtomicString fromUTF8Internal(const char*, const char*); diff --git a/WTF/wtf/text/Base64.cpp b/WTF/wtf/text/Base64.cpp index 25d528a6..2323f3fa 100644 --- a/WTF/wtf/text/Base64.cpp +++ b/WTF/wtf/text/Base64.cpp @@ -1,7 +1,7 @@ /* Copyright (C) 2000-2001 Dawit Alemayehu Copyright (C) 2006 Alexey Proskuryakov - Copyright (C) 2007, 2008 Apple Inc. All rights reserved. + Copyright (C) 2007, 2008, 2013 Apple Inc. All rights reserved. Copyright (C) 2010 Patrick Gansterer This program is free software; you can redistribute it and/or modify @@ -30,6 +30,8 @@ namespace WTF { +const char nonAlphabet = -1; + static const char base64EncMap[64] = { 0x41, 0x42, 0x43, 0x44, 0x45, 0x46, 0x47, 0x48, 0x49, 0x4A, 0x4B, 0x4C, 0x4D, 0x4E, 0x4F, 0x50, @@ -42,32 +44,55 @@ static const char base64EncMap[64] = { }; static const char base64DecMap[128] = { - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x3E, 0x00, 0x00, 0x00, 0x3F, + nonAlphabet, nonAlphabet, nonAlphabet, nonAlphabet, nonAlphabet, nonAlphabet, nonAlphabet, nonAlphabet, + nonAlphabet, nonAlphabet, nonAlphabet, nonAlphabet, nonAlphabet, nonAlphabet, nonAlphabet, nonAlphabet, + nonAlphabet, nonAlphabet, nonAlphabet, nonAlphabet, nonAlphabet, nonAlphabet, nonAlphabet, nonAlphabet, + nonAlphabet, nonAlphabet, nonAlphabet, nonAlphabet, nonAlphabet, nonAlphabet, nonAlphabet, nonAlphabet, + nonAlphabet, nonAlphabet, nonAlphabet, nonAlphabet, nonAlphabet, nonAlphabet, nonAlphabet, nonAlphabet, + nonAlphabet, nonAlphabet, nonAlphabet, 0x3E, nonAlphabet, nonAlphabet, nonAlphabet, 0x3F, 0x34, 0x35, 0x36, 0x37, 0x38, 0x39, 0x3A, 0x3B, - 0x3C, 0x3D, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, + 0x3C, 0x3D, nonAlphabet, nonAlphabet, nonAlphabet, nonAlphabet, nonAlphabet, nonAlphabet, + nonAlphabet, 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0A, 0x0B, 0x0C, 0x0D, 0x0E, 0x0F, 0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, - 0x17, 0x18, 0x19, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x1A, 0x1B, 0x1C, 0x1D, 0x1E, 0x1F, 0x20, + 0x17, 0x18, 0x19, nonAlphabet, nonAlphabet, nonAlphabet, nonAlphabet, nonAlphabet, + nonAlphabet, 0x1A, 0x1B, 0x1C, 0x1D, 0x1E, 0x1F, 0x20, 0x21, 0x22, 0x23, 0x24, 0x25, 0x26, 0x27, 0x28, 0x29, 0x2A, 0x2B, 0x2C, 0x2D, 0x2E, 0x2F, 0x30, - 0x31, 0x32, 0x33, 0x00, 0x00, 0x00, 0x00, 0x00 + 0x31, 0x32, 0x33, nonAlphabet, nonAlphabet, nonAlphabet, nonAlphabet, nonAlphabet }; -String base64Encode(const char* data, unsigned length, Base64EncodePolicy policy) -{ - Vector result; - base64Encode(data, length, result, policy); - return String(result.data(), result.size()); -} +static const char base64URLEncMap[64] = { + 0x41, 0x42, 0x43, 0x44, 0x45, 0x46, 0x47, 0x48, + 0x49, 0x4A, 0x4B, 0x4C, 0x4D, 0x4E, 0x4F, 0x50, + 0x51, 0x52, 0x53, 0x54, 0x55, 0x56, 0x57, 0x58, + 0x59, 0x5A, 0x61, 0x62, 0x63, 0x64, 0x65, 0x66, + 0x67, 0x68, 0x69, 0x6A, 0x6B, 0x6C, 0x6D, 0x6E, + 0x6F, 0x70, 0x71, 0x72, 0x73, 0x74, 0x75, 0x76, + 0x77, 0x78, 0x79, 0x7A, 0x30, 0x31, 0x32, 0x33, + 0x34, 0x35, 0x36, 0x37, 0x38, 0x39, 0x2D, 0x5F +}; -void base64Encode(const char* data, unsigned len, Vector& out, Base64EncodePolicy policy) +static const char base64URLDecMap[128] = { + nonAlphabet, nonAlphabet, nonAlphabet, nonAlphabet, nonAlphabet, nonAlphabet, nonAlphabet, nonAlphabet, + nonAlphabet, nonAlphabet, nonAlphabet, nonAlphabet, nonAlphabet, nonAlphabet, nonAlphabet, nonAlphabet, + nonAlphabet, nonAlphabet, nonAlphabet, nonAlphabet, nonAlphabet, nonAlphabet, nonAlphabet, nonAlphabet, + nonAlphabet, nonAlphabet, nonAlphabet, nonAlphabet, nonAlphabet, nonAlphabet, nonAlphabet, nonAlphabet, + nonAlphabet, nonAlphabet, nonAlphabet, nonAlphabet, nonAlphabet, nonAlphabet, nonAlphabet, nonAlphabet, + nonAlphabet, nonAlphabet, nonAlphabet, nonAlphabet, nonAlphabet, 0x3E, nonAlphabet, nonAlphabet, + 0x34, 0x35, 0x36, 0x37, 0x38, 0x39, 0x3A, 0x3B, + 0x3C, 0x3D, nonAlphabet, nonAlphabet, nonAlphabet, nonAlphabet, nonAlphabet, nonAlphabet, + nonAlphabet, 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, + 0x07, 0x08, 0x09, 0x0A, 0x0B, 0x0C, 0x0D, 0x0E, + 0x0F, 0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, + 0x17, 0x18, 0x19, nonAlphabet, nonAlphabet, nonAlphabet, nonAlphabet, 0x3F, + nonAlphabet, 0x1A, 0x1B, 0x1C, 0x1D, 0x1E, 0x1F, 0x20, + 0x21, 0x22, 0x23, 0x24, 0x25, 0x26, 0x27, 0x28, + 0x29, 0x2A, 0x2B, 0x2C, 0x2D, 0x2E, 0x2F, 0x30, + 0x31, 0x32, 0x33, nonAlphabet, nonAlphabet, nonAlphabet, nonAlphabet, nonAlphabet +}; + +static inline void base64EncodeInternal(const char* data, unsigned len, Vector& out, Base64EncodePolicy policy, const char (&encodeMap)[64]) { out.clear(); if (!len) @@ -101,10 +126,10 @@ void base64Encode(const char* data, unsigned len, Vector& out, Base64Encod out[didx++] = '\n'; count += 4; } - out[didx++] = base64EncMap[(data[sidx] >> 2) & 077]; - out[didx++] = base64EncMap[((data[sidx + 1] >> 4) & 017) | ((data[sidx] << 4) & 077)]; - out[didx++] = base64EncMap[((data[sidx + 2] >> 6) & 003) | ((data[sidx + 1] << 2) & 077)]; - out[didx++] = base64EncMap[data[sidx + 2] & 077]; + out[didx++] = encodeMap[(data[sidx] >> 2) & 077]; + out[didx++] = encodeMap[((data[sidx + 1] >> 4) & 017) | ((data[sidx] << 4) & 077)]; + out[didx++] = encodeMap[((data[sidx + 2] >> 6) & 003) | ((data[sidx + 1] << 2) & 077)]; + out[didx++] = encodeMap[data[sidx + 2] & 077]; sidx += 3; } } @@ -113,34 +138,51 @@ void base64Encode(const char* data, unsigned len, Vector& out, Base64Encod if (insertLFs && (count > 0) && !(count % 76)) out[didx++] = '\n'; - out[didx++] = base64EncMap[(data[sidx] >> 2) & 077]; + out[didx++] = encodeMap[(data[sidx] >> 2) & 077]; if (sidx < len - 1) { - out[didx++] = base64EncMap[((data[sidx + 1] >> 4) & 017) | ((data[sidx] << 4) & 077)]; - out[didx++] = base64EncMap[(data[sidx + 1] << 2) & 077]; + out[didx++] = encodeMap[((data[sidx + 1] >> 4) & 017) | ((data[sidx] << 4) & 077)]; + out[didx++] = encodeMap[(data[sidx + 1] << 2) & 077]; } else - out[didx++] = base64EncMap[(data[sidx] << 4) & 077]; + out[didx++] = encodeMap[(data[sidx] << 4) & 077]; } // Add padding - while (didx < out.size()) { - out[didx] = '='; - ++didx; + if (policy == Base64URLPolicy) + out.resize(didx); + else { + while (didx < out.size()) { + out[didx] = '='; + ++didx; + } } } -bool base64Decode(const Vector& in, Vector& out, Base64DecodePolicy policy) +String base64Encode(const void* data, unsigned length, Base64EncodePolicy policy) { - out.clear(); + Vector result; + base64EncodeInternal(static_cast(data), length, result, policy, base64EncMap); + return String(result.data(), result.size()); +} - // If the input string is pathologically large, just return nothing. - if (in.size() > UINT_MAX) - return false; +void base64Encode(const void* data, unsigned len, Vector& out, Base64EncodePolicy policy) +{ + base64EncodeInternal(static_cast(data), len, out, policy, base64EncMap); +} - return base64Decode(in.data(), in.size(), out, policy); +String base64URLEncode(const void* data, unsigned length) +{ + Vector result; + base64EncodeInternal(static_cast(data), length, result, Base64URLPolicy, base64URLEncMap); + return String(result.data(), result.size()); +} + +void base64URLEncode(const void* data, unsigned len, Vector& out) +{ + base64EncodeInternal(static_cast(data), len, out, Base64URLPolicy, base64URLEncMap); } template -static inline bool base64DecodeInternal(const T* data, unsigned length, Vector& out, Base64DecodePolicy policy) +static inline bool base64DecodeInternal(const T* data, unsigned length, Vector& out, Base64DecodePolicy policy, const char (&decodeMap)[128]) { out.clear(); if (!length) @@ -158,13 +200,16 @@ static inline bool base64DecodeInternal(const T* data, unsigned length, Vector 2)) return false; - } else if (('0' <= ch && ch <= '9') || ('A' <= ch && ch <= 'Z') || ('a' <= ch && ch <= 'z') || ch == '+' || ch == '/') { - if (equalsSignCount) + } else { + char decodedCharacter = ch < WTF_ARRAY_LENGTH(decodeMap) ? decodeMap[ch] : nonAlphabet; + if (decodedCharacter != nonAlphabet) { + if (equalsSignCount) + return false; + out[outLength] = decodedCharacter; + ++outLength; + } else if (policy == Base64FailOnInvalidCharacterOrExcessPadding || policy == Base64FailOnInvalidCharacter || (policy == Base64IgnoreWhitespace && !isSpaceOrNewline(ch))) return false; - out[outLength] = base64DecMap[ch]; - ++outLength; - } else if (policy == Base64FailOnInvalidCharacterOrExcessPadding || policy == Base64FailOnInvalidCharacter || (policy == Base64IgnoreWhitespace && !isSpaceOrNewline(ch))) - return false; + } } if (!outLength) @@ -203,14 +248,46 @@ static inline bool base64DecodeInternal(const T* data, unsigned length, Vector& out, Base64DecodePolicy policy) +bool base64Decode(const String& in, SignedOrUnsignedCharVectorAdapter out, Base64DecodePolicy policy) +{ + return base64DecodeInternal(in.deprecatedCharacters(), in.length(), out, policy, base64DecMap); +} + +bool base64Decode(const Vector& in, SignedOrUnsignedCharVectorAdapter out, Base64DecodePolicy policy) +{ + out.clear(); + + // If the input string is pathologically large, just return nothing. + if (in.size() > UINT_MAX) + return false; + + return base64DecodeInternal(in.data(), in.size(), out, policy, base64DecMap); +} + +bool base64Decode(const char* data, unsigned len, SignedOrUnsignedCharVectorAdapter out, Base64DecodePolicy policy) +{ + return base64DecodeInternal(data, len, out, policy, base64DecMap); +} + +bool base64URLDecode(const String& in, SignedOrUnsignedCharVectorAdapter out) { - return base64DecodeInternal(data, len, out, policy); + return base64DecodeInternal(in.deprecatedCharacters(), in.length(), out, Base64FailOnInvalidCharacter, base64URLDecMap); +} + +bool base64URLDecode(const Vector& in, SignedOrUnsignedCharVectorAdapter out) +{ + out.clear(); + + // If the input string is pathologically large, just return nothing. + if (in.size() > UINT_MAX) + return false; + + return base64DecodeInternal(in.data(), in.size(), out, Base64FailOnInvalidCharacter, base64URLDecMap); } -bool base64Decode(const String& in, Vector& out, Base64DecodePolicy policy) +bool base64URLDecode(const char* data, unsigned len, SignedOrUnsignedCharVectorAdapter out) { - return base64DecodeInternal(in.characters(), in.length(), out, policy); + return base64DecodeInternal(data, len, out, Base64FailOnInvalidCharacter, base64URLDecMap); } } // namespace WTF diff --git a/WTF/wtf/text/Base64.h b/WTF/wtf/text/Base64.h index b89c3b52..1dfcf269 100644 --- a/WTF/wtf/text/Base64.h +++ b/WTF/wtf/text/Base64.h @@ -1,6 +1,7 @@ /* * Copyright (C) 2006 Alexey Proskuryakov * Copyright (C) 2010 Patrick Gansterer + * Copyright (C) 2013 Apple Inc. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -35,7 +36,8 @@ namespace WTF { enum Base64EncodePolicy { Base64DoNotInsertLFs, - Base64InsertLFs + Base64InsertLFs, + Base64URLPolicy // No padding, no LFs. }; enum Base64DecodePolicy { @@ -45,18 +47,49 @@ enum Base64DecodePolicy { Base64IgnoreInvalidCharacters }; -WTF_EXPORT_PRIVATE void base64Encode(const char*, unsigned, Vector&, Base64EncodePolicy = Base64DoNotInsertLFs); -WTF_EXPORT_PRIVATE void base64Encode(const Vector&, Vector&, Base64EncodePolicy = Base64DoNotInsertLFs); +class SignedOrUnsignedCharVectorAdapter { +public: + SignedOrUnsignedCharVectorAdapter(Vector& vector) { m_vector.c = &vector; } + SignedOrUnsignedCharVectorAdapter(Vector& vector) { m_vector.u = &vector; } + + operator Vector&() { return *m_vector.c; } + void clear() { m_vector.c->clear(); } + +private: + union { + Vector* c; + Vector* u; + } m_vector; +}; + +class ConstSignedOrUnsignedCharVectorAdapter { +public: + ConstSignedOrUnsignedCharVectorAdapter(const Vector& vector) { m_vector.c = &vector; } + ConstSignedOrUnsignedCharVectorAdapter(const Vector& vector) { m_vector.u = &vector; } + + operator const Vector&() { return *m_vector.c; } + const char* data() const { return m_vector.c->data(); } + size_t size() const { return m_vector.c->size(); } + +private: + union { + const Vector* c; + const Vector* u; + } m_vector; +}; + +WTF_EXPORT_PRIVATE void base64Encode(const void*, unsigned, Vector&, Base64EncodePolicy = Base64DoNotInsertLFs); +WTF_EXPORT_PRIVATE void base64Encode(ConstSignedOrUnsignedCharVectorAdapter, Vector&, Base64EncodePolicy = Base64DoNotInsertLFs); WTF_EXPORT_PRIVATE void base64Encode(const CString&, Vector&, Base64EncodePolicy = Base64DoNotInsertLFs); -WTF_EXPORT_PRIVATE String base64Encode(const char*, unsigned, Base64EncodePolicy = Base64DoNotInsertLFs); -WTF_EXPORT_PRIVATE String base64Encode(const Vector&, Base64EncodePolicy = Base64DoNotInsertLFs); +WTF_EXPORT_PRIVATE String base64Encode(const void*, unsigned, Base64EncodePolicy = Base64DoNotInsertLFs); +WTF_EXPORT_PRIVATE String base64Encode(ConstSignedOrUnsignedCharVectorAdapter, Base64EncodePolicy = Base64DoNotInsertLFs); WTF_EXPORT_PRIVATE String base64Encode(const CString&, Base64EncodePolicy = Base64DoNotInsertLFs); -WTF_EXPORT_PRIVATE bool base64Decode(const String&, Vector&, Base64DecodePolicy = Base64FailOnInvalidCharacter); -WTF_EXPORT_PRIVATE bool base64Decode(const Vector&, Vector&, Base64DecodePolicy = Base64FailOnInvalidCharacter); -WTF_EXPORT_PRIVATE bool base64Decode(const char*, unsigned, Vector&, Base64DecodePolicy = Base64FailOnInvalidCharacter); +WTF_EXPORT_PRIVATE bool base64Decode(const String&, SignedOrUnsignedCharVectorAdapter, Base64DecodePolicy = Base64FailOnInvalidCharacter); +WTF_EXPORT_PRIVATE bool base64Decode(const Vector&, SignedOrUnsignedCharVectorAdapter, Base64DecodePolicy = Base64FailOnInvalidCharacter); +WTF_EXPORT_PRIVATE bool base64Decode(const char*, unsigned, SignedOrUnsignedCharVectorAdapter, Base64DecodePolicy = Base64FailOnInvalidCharacter); -inline void base64Encode(const Vector& in, Vector& out, Base64EncodePolicy policy) +inline void base64Encode(ConstSignedOrUnsignedCharVectorAdapter in, Vector& out, Base64EncodePolicy policy) { base64Encode(in.data(), in.size(), out, policy); } @@ -66,7 +99,7 @@ inline void base64Encode(const CString& in, Vector& out, Base64EncodePolic base64Encode(in.data(), in.length(), out, policy); } -inline String base64Encode(const Vector& in, Base64EncodePolicy policy) +inline String base64Encode(ConstSignedOrUnsignedCharVectorAdapter in, Base64EncodePolicy policy) { return base64Encode(in.data(), in.size(), policy); } @@ -76,6 +109,42 @@ inline String base64Encode(const CString& in, Base64EncodePolicy policy) return base64Encode(in.data(), in.length(), policy); } +// ====================================================================================== +// All the same functions modified for base64url, as defined in RFC 4648. +// This format uses '-' and '_' instead of '+' and '/' respectively. +// ====================================================================================== + +WTF_EXPORT_PRIVATE void base64URLEncode(const void*, unsigned, Vector&); +WTF_EXPORT_PRIVATE void base64URLEncode(ConstSignedOrUnsignedCharVectorAdapter, Vector&); +WTF_EXPORT_PRIVATE void base64URLEncode(const CString&, Vector&); +WTF_EXPORT_PRIVATE String base64URLEncode(const void*, unsigned); +WTF_EXPORT_PRIVATE String base64URLEncode(ConstSignedOrUnsignedCharVectorAdapter); +WTF_EXPORT_PRIVATE String base64URLEncode(const CString&); + +WTF_EXPORT_PRIVATE bool base64URLDecode(const String&, SignedOrUnsignedCharVectorAdapter); +WTF_EXPORT_PRIVATE bool base64URLDecode(const Vector&, SignedOrUnsignedCharVectorAdapter); +WTF_EXPORT_PRIVATE bool base64URLDecode(const char*, unsigned, SignedOrUnsignedCharVectorAdapter); + +inline void base64URLEncode(ConstSignedOrUnsignedCharVectorAdapter in, Vector& out) +{ + base64URLEncode(in.data(), in.size(), out); +} + +inline void base64URLEncode(const CString& in, Vector& out) +{ + base64URLEncode(in.data(), in.length(), out); +} + +inline String base64URLEncode(ConstSignedOrUnsignedCharVectorAdapter in) +{ + return base64URLEncode(in.data(), in.size()); +} + +inline String base64URLEncode(const CString& in) +{ + return base64URLEncode(in.data(), in.length()); +} + } // namespace WTF using WTF::Base64EncodePolicy; @@ -88,5 +157,6 @@ using WTF::Base64IgnoreWhitespace; using WTF::Base64IgnoreInvalidCharacters; using WTF::base64Encode; using WTF::base64Decode; +using WTF::base64URLDecode; #endif // Base64_h diff --git a/WTF/wtf/text/StringBuilder.cpp b/WTF/wtf/text/StringBuilder.cpp index b6721492..6b6752d0 100644 --- a/WTF/wtf/text/StringBuilder.cpp +++ b/WTF/wtf/text/StringBuilder.cpp @@ -55,9 +55,10 @@ void StringBuilder::reifyString() const // Must be valid in the buffer, take a substring (unless string fills the buffer). ASSERT(m_buffer && m_length <= m_buffer->length()); - m_string = (m_length == m_buffer->length()) - ? m_buffer.get() - : StringImpl::create(m_buffer, 0, m_length); + if (m_length == m_buffer->length()) + m_string = m_buffer.get(); + else + m_string = StringImpl::create(m_buffer, 0, m_length); if (m_buffer->has16BitShadow() && m_valid16BitShadowLength < m_length) m_buffer->upconvertCharacters(m_valid16BitShadowLength, m_length); diff --git a/WTF/wtf/text/StringBuilder.h b/WTF/wtf/text/StringBuilder.h index f5344cb9..26be9063 100644 --- a/WTF/wtf/text/StringBuilder.h +++ b/WTF/wtf/text/StringBuilder.h @@ -248,21 +248,22 @@ class StringBuilder { return m_buffer->characters16(); } - const UChar* characters() const + const UChar* characters() const { return deprecatedCharacters(); } // FIXME: Delete this. + const UChar* deprecatedCharacters() const { if (!m_length) return 0; if (!m_string.isNull()) - return m_string.characters(); + return m_string.deprecatedCharacters(); ASSERT(m_buffer); if (m_buffer->has16BitShadow() && m_valid16BitShadowLength < m_length) m_buffer->upconvertCharacters(m_valid16BitShadowLength, m_length); m_valid16BitShadowLength = m_length; - return m_buffer->characters(); + return m_buffer->deprecatedCharacters(); } - + bool is8Bit() const { return m_is8Bit; } void clear() diff --git a/WTF/wtf/text/StringConcatenate.h b/WTF/wtf/text/StringConcatenate.h index d8e45a12..baeccc1d 100644 --- a/WTF/wtf/text/StringConcatenate.h +++ b/WTF/wtf/text/StringConcatenate.h @@ -701,7 +701,7 @@ PassRefPtr tryMakeString(StringType1 string1, StringType2 string2, S if (overflow) return 0; - if (adapter1.is8Bit() && adapter2.is8Bit() && adapter3.is8Bit() && adapter4.is8Bit() && adapter5.is8Bit() && adapter6.is8Bit()) { + if (adapter1.is8Bit() && adapter2.is8Bit() && adapter3.is8Bit() && adapter4.is8Bit() && adapter5.is8Bit() && adapter6.is8Bit() && adapter7.is8Bit()) { LChar* buffer; RefPtr resultImpl = StringImpl::tryCreateUninitialized(length, buffer); if (!resultImpl) diff --git a/WTF/wtf/text/StringHash.h b/WTF/wtf/text/StringHash.h index f04604b4..88bdd936 100644 --- a/WTF/wtf/text/StringHash.h +++ b/WTF/wtf/text/StringHash.h @@ -75,6 +75,9 @@ namespace WTF { public: template static inline UChar foldCase(T character) { + if (std::is_same::value) + return StringImpl::latin1CaseFoldTable[character]; + return u_foldCase(character, U_FOLD_CASE_DEFAULT); } diff --git a/WTF/wtf/text/StringImpl.cpp b/WTF/wtf/text/StringImpl.cpp index 6140ca19..fe8213cf 100644 --- a/WTF/wtf/text/StringImpl.cpp +++ b/WTF/wtf/text/StringImpl.cpp @@ -40,8 +40,6 @@ #include #endif -using namespace std; - namespace WTF { using namespace Unicode; @@ -149,14 +147,14 @@ void StringImpl::destroy(StringImpl* stringImpl) fastFree(stringImpl); } -PassRefPtr StringImpl::createFromLiteral(const char* characters, unsigned length) +PassRef StringImpl::createFromLiteral(const char* characters, unsigned length) { ASSERT_WITH_MESSAGE(length, "Use StringImpl::empty() to create an empty string"); ASSERT(charactersAreAllASCII(reinterpret_cast(characters), length)); - return adoptRef(new StringImpl(reinterpret_cast(characters), length, ConstructWithoutCopying)); + return adoptRef(*new StringImpl(reinterpret_cast(characters), length, ConstructWithoutCopying)); } -PassRefPtr StringImpl::createFromLiteral(const char* characters) +PassRef StringImpl::createFromLiteral(const char* characters) { return createFromLiteral(characters, strlen(characters)); } @@ -204,25 +202,25 @@ inline PassRef StringImpl::createUninitializedInternalNonEmpty(unsig return constructInternal(string, length); } -PassRefPtr StringImpl::createUninitialized(unsigned length, LChar*& data) +PassRef StringImpl::createUninitialized(unsigned length, LChar*& data) { return createUninitializedInternal(length, data); } -PassRefPtr StringImpl::createUninitialized(unsigned length, UChar*& data) +PassRef StringImpl::createUninitialized(unsigned length, UChar*& data) { return createUninitializedInternal(length, data); } template -inline PassRefPtr StringImpl::reallocateInternal(PassRefPtr originalString, unsigned length, CharType*& data) +inline PassRef StringImpl::reallocateInternal(PassRefPtr originalString, unsigned length, CharType*& data) { ASSERT(originalString->hasOneRef()); ASSERT(originalString->bufferOwnership() == BufferInternal); if (!length) { data = 0; - return empty(); + return *empty(); } // Same as createUninitialized() except here we use fastRealloc. @@ -236,13 +234,13 @@ inline PassRefPtr StringImpl::reallocateInternal(PassRefPtr(string, length); } -PassRefPtr StringImpl::reallocate(PassRefPtr originalString, unsigned length, LChar*& data) +PassRef StringImpl::reallocate(PassRefPtr originalString, unsigned length, LChar*& data) { ASSERT(originalString->is8Bit()); return reallocateInternal(originalString, length, data); } -PassRefPtr StringImpl::reallocate(PassRefPtr originalString, unsigned length, UChar*& data) +PassRef StringImpl::reallocate(PassRefPtr originalString, unsigned length, UChar*& data) { ASSERT(!originalString->is8Bit()); return reallocateInternal(originalString, length, data); @@ -292,12 +290,12 @@ PassRef StringImpl::create8BitIfPossible(const UChar* string) return StringImpl::create8BitIfPossible(string, lengthOfNullTerminatedString(string)); } -PassRefPtr StringImpl::create(const LChar* string) +PassRef StringImpl::create(const LChar* string) { if (!string) - return empty(); + return *empty(); size_t length = strlen(reinterpret_cast(string)); - if (length > numeric_limits::max()) + if (length > std::numeric_limits::max()) CRASH(); return create(string, length); } @@ -311,7 +309,7 @@ const UChar* StringImpl::getData16SlowCase() const // If this is a substring, return a pointer into the parent string. // TODO: Consider severing this string from the parent string unsigned offset = m_data8 - m_substringBuffer->characters8(); - return m_substringBuffer->characters() + offset; + return m_substringBuffer->deprecatedCharacters() + offset; } STRING_STATS_ADD_UPCONVERTED_STRING(m_length); @@ -360,14 +358,14 @@ bool StringImpl::containsOnlyWhitespace() return true; } -PassRefPtr StringImpl::substring(unsigned start, unsigned length) +PassRef StringImpl::substring(unsigned start, unsigned length) { if (start >= m_length) - return empty(); + return *empty(); unsigned maxLength = m_length - start; if (length >= maxLength) { if (!start) - return this; + return *this; length = maxLength; } if (is8Bit()) @@ -447,7 +445,7 @@ PassRef StringImpl::lower() return newImpl; } - if (m_length > static_cast(numeric_limits::max())) + if (m_length > static_cast(std::numeric_limits::max())) CRASH(); int32_t length = m_length; @@ -468,13 +466,13 @@ PassRef StringImpl::lower() return newImpl.releaseNonNull(); } -PassRefPtr StringImpl::upper() +PassRef StringImpl::upper() { // This function could be optimized for no-op cases the way lower() is, // but in empirical testing, few actual calls to upper() are no-ops, so // it wouldn't be worth the extra time for pre-scanning. - if (m_length > static_cast(numeric_limits::max())) + if (m_length > static_cast(std::numeric_limits::max())) CRASH(); int32_t length = m_length; @@ -497,7 +495,7 @@ PassRefPtr StringImpl::upper() #endif } if (!(ored & ~0x7F)) - return newImpl.release(); + return newImpl.releaseNonNull(); // Do a slower implementation for cases that include non-ASCII Latin-1 characters. int numberSharpSCharacters = 0; @@ -519,7 +517,7 @@ PassRefPtr StringImpl::upper() } if (!numberSharpSCharacters) - return newImpl.release(); + return newImpl.releaseNonNull(); // We have numberSSCharacters sharp-s characters, but none of the other special characters. newImpl = createUninitialized(m_length + numberSharpSCharacters, data8); @@ -537,11 +535,11 @@ PassRefPtr StringImpl::upper() } } - return newImpl.release(); + return newImpl.releaseNonNull(); } upconvert: - const UChar* source16 = characters(); + const UChar* source16 = deprecatedCharacters(); UChar* data16; RefPtr newImpl = createUninitialized(m_length, data16); @@ -554,19 +552,19 @@ PassRefPtr StringImpl::upper() data16[i] = toASCIIUpper(c); } if (!(ored & ~0x7F)) - return newImpl.release(); + return newImpl.releaseNonNull(); // Do a slower implementation for cases that include non-ASCII characters. UErrorCode status = U_ZERO_ERROR; int32_t realLength = u_strToUpper(data16, length, source16, m_length, "", &status); if (U_SUCCESS(status) && realLength == length) - return newImpl; + return newImpl.releaseNonNull(); newImpl = createUninitialized(realLength, data16); status = U_ZERO_ERROR; u_strToUpper(data16, realLength, source16, m_length, "", &status); if (U_FAILURE(status)) - return this; - return newImpl.release(); + return *this; + return newImpl.releaseNonNull(); } static inline bool needsTurkishCasingRules(const AtomicString& localeIdentifier) @@ -592,14 +590,14 @@ PassRef StringImpl::lower(const AtomicString& localeIdentifier) // this last part into a shared function that takes a locale string, since this is // just like the end of that function. - if (m_length > static_cast(numeric_limits::max())) + if (m_length > static_cast(std::numeric_limits::max())) CRASH(); int length = m_length; // Below, we pass in the hardcoded locale "tr". Passing that is more efficient than // allocating memory just to turn localeIdentifier into a C string, and we assume // there is no difference between the uppercasing for "tr" and "az" locales. - const UChar* source16 = characters(); + const UChar* source16 = deprecatedCharacters(); UChar* data16; RefPtr newString = createUninitialized(length, data16); UErrorCode status = U_ZERO_ERROR; @@ -614,7 +612,7 @@ PassRef StringImpl::lower(const AtomicString& localeIdentifier) return newString.releaseNonNull(); } -RefPtr StringImpl::upper(const AtomicString& localeIdentifier) +PassRef StringImpl::upper(const AtomicString& localeIdentifier) { // Use the more-optimized code path most of the time. // Assuming here that the only locale-specific lowercasing is the Turkish casing rules, @@ -622,54 +620,54 @@ RefPtr StringImpl::upper(const AtomicString& localeIdentifier) if (!needsTurkishCasingRules(localeIdentifier) || find('i') == notFound) return upper(); - if (m_length > static_cast(numeric_limits::max())) + if (m_length > static_cast(std::numeric_limits::max())) CRASH(); int length = m_length; // Below, we pass in the hardcoded locale "tr". Passing that is more efficient than // allocating memory just to turn localeIdentifier into a C string, and we assume // there is no difference between the uppercasing for "tr" and "az" locales. - const UChar* source16 = characters(); + const UChar* source16 = deprecatedCharacters(); UChar* data16; RefPtr newString = createUninitialized(length, data16); UErrorCode status = U_ZERO_ERROR; int realLength = u_strToUpper(data16, length, source16, length, "tr", &status); if (U_SUCCESS(status) && realLength == length) - return newString; + return newString.releaseNonNull(); newString = createUninitialized(realLength, data16); status = U_ZERO_ERROR; u_strToUpper(data16, realLength, source16, length, "tr", &status); if (U_FAILURE(status)) - return this; - return newString.release(); + return *this; + return newString.releaseNonNull(); } -PassRefPtr StringImpl::fill(UChar character) +PassRef StringImpl::fill(UChar character) { if (!(character & ~0x7F)) { LChar* data; - RefPtr newImpl = createUninitialized(m_length, data); + auto newImpl = createUninitialized(m_length, data); for (unsigned i = 0; i < m_length; ++i) data[i] = character; - return newImpl.release(); + return newImpl; } UChar* data; - RefPtr newImpl = createUninitialized(m_length, data); + auto newImpl = createUninitialized(m_length, data); for (unsigned i = 0; i < m_length; ++i) data[i] = character; - return newImpl.release(); + return newImpl; } -PassRefPtr StringImpl::foldCase() +PassRef StringImpl::foldCase() { - if (m_length > static_cast(numeric_limits::max())) + if (m_length > static_cast(std::numeric_limits::max())) CRASH(); int32_t length = m_length; if (is8Bit()) { // Do a faster loop for the case where all the characters are ASCII. LChar* data; - RefPtr newImpl = createUninitialized(m_length, data); + auto newImpl = createUninitialized(m_length, data); LChar ored = 0; for (int32_t i = 0; i < length; ++i) { @@ -679,7 +677,7 @@ PassRefPtr StringImpl::foldCase() } if (!(ored & ~0x7F)) - return newImpl.release(); + return newImpl; // Do a slower implementation for cases that include non-ASCII Latin-1 characters. // FIXME: Shouldn't this use u_foldCase instead of u_tolower? @@ -688,7 +686,7 @@ PassRefPtr StringImpl::foldCase() data[i] = static_cast(u_tolower(m_data8[i])); } - return newImpl.release(); + return newImpl; } // Do a faster loop for the case where all the characters are ASCII. @@ -701,26 +699,26 @@ PassRefPtr StringImpl::foldCase() data[i] = toASCIILower(c); } if (!(ored & ~0x7F)) - return newImpl.release(); + return newImpl.releaseNonNull(); // Do a slower implementation for cases that include non-ASCII characters. UErrorCode status = U_ZERO_ERROR; int32_t realLength = u_strFoldCase(data, length, m_data16, m_length, U_FOLD_CASE_DEFAULT, &status); if (U_SUCCESS(status) && realLength == length) - return newImpl.release(); + return newImpl.releaseNonNull(); newImpl = createUninitialized(realLength, data); status = U_ZERO_ERROR; u_strFoldCase(data, realLength, m_data16, m_length, U_FOLD_CASE_DEFAULT, &status); if (U_FAILURE(status)) - return this; - return newImpl.release(); + return *this; + return newImpl.releaseNonNull(); } template -inline PassRefPtr StringImpl::stripMatchedCharacters(UCharPredicate predicate) +inline PassRef StringImpl::stripMatchedCharacters(UCharPredicate predicate) { if (!m_length) - return this; + return *this; unsigned start = 0; unsigned end = m_length - 1; @@ -731,14 +729,14 @@ inline PassRefPtr StringImpl::stripMatchedCharacters(UCharPredicate // only white space if (start > end) - return empty(); + return *empty(); // skip white space from end while (end && predicate(is8Bit() ? m_data8[end] : m_data16[end])) --end; if (!start && end == m_length - 1) - return this; + return *this; if (is8Bit()) return create(m_data8 + start, end + 1 - start); return create(m_data16 + start, end + 1 - start); @@ -765,18 +763,18 @@ class SpaceOrNewlinePredicate { } }; -PassRefPtr StringImpl::stripWhiteSpace() +PassRef StringImpl::stripWhiteSpace() { return stripMatchedCharacters(SpaceOrNewlinePredicate()); } -PassRefPtr StringImpl::stripWhiteSpace(IsWhiteSpaceFunctionPtr isWhiteSpace) +PassRef StringImpl::stripWhiteSpace(IsWhiteSpaceFunctionPtr isWhiteSpace) { return stripMatchedCharacters(UCharPredicate(isWhiteSpace)); } template -ALWAYS_INLINE PassRefPtr StringImpl::removeCharacters(const CharType* characters, CharacterMatchFunctionPtr findMatch) +ALWAYS_INLINE PassRef StringImpl::removeCharacters(const CharType* characters, CharacterMatchFunctionPtr findMatch) { const CharType* from = characters; const CharType* fromend = from + m_length; @@ -785,7 +783,7 @@ ALWAYS_INLINE PassRefPtr StringImpl::removeCharacters(const CharType while (from != fromend && !findMatch(*from)) ++from; if (from == fromend) - return this; + return *this; StringBuffer data(m_length); CharType* to = data.characters(); @@ -808,7 +806,7 @@ ALWAYS_INLINE PassRefPtr StringImpl::removeCharacters(const CharType return adopt(data); } -PassRefPtr StringImpl::removeCharacters(CharacterMatchFunctionPtr findMatch) +PassRef StringImpl::removeCharacters(CharacterMatchFunctionPtr findMatch) { if (is8Bit()) return removeCharacters(characters8(), findMatch); @@ -816,7 +814,7 @@ PassRefPtr StringImpl::removeCharacters(CharacterMatchFunctionPtr fi } template -inline PassRefPtr StringImpl::simplifyMatchedCharactersToSpace(UCharPredicate predicate) +inline PassRef StringImpl::simplifyMatchedCharactersToSpace(UCharPredicate predicate) { StringBuffer data(m_length); @@ -845,21 +843,21 @@ inline PassRefPtr StringImpl::simplifyMatchedCharactersToSpace(UChar --outc; if (static_cast(outc) == m_length && !changedToSpace) - return this; + return *this; data.shrink(outc); return adopt(data); } -PassRefPtr StringImpl::simplifyWhiteSpace() +PassRef StringImpl::simplifyWhiteSpace() { if (is8Bit()) return StringImpl::simplifyMatchedCharactersToSpace(SpaceOrNewlinePredicate()); return StringImpl::simplifyMatchedCharactersToSpace(SpaceOrNewlinePredicate()); } -PassRefPtr StringImpl::simplifyWhiteSpace(IsWhiteSpaceFunctionPtr isWhiteSpace) +PassRef StringImpl::simplifyWhiteSpace(IsWhiteSpaceFunctionPtr isWhiteSpace) { if (is8Bit()) return StringImpl::simplifyMatchedCharactersToSpace(UCharPredicate(isWhiteSpace)); @@ -953,7 +951,7 @@ float StringImpl::toFloat(bool* ok) bool equalIgnoringCase(const LChar* a, const LChar* b, unsigned length) { while (length--) { - if (u_foldCase(*a++, U_FOLD_CASE_DEFAULT) != u_foldCase(*b++, U_FOLD_CASE_DEFAULT)) + if (StringImpl::latin1CaseFoldTable[*a++] != StringImpl::latin1CaseFoldTable[*b++]) return false; } return true; @@ -962,7 +960,7 @@ bool equalIgnoringCase(const LChar* a, const LChar* b, unsigned length) bool equalIgnoringCase(const UChar* a, const LChar* b, unsigned length) { while (length--) { - if (u_foldCase(*a++, U_FOLD_CASE_DEFAULT) != u_foldCase(*b++, U_FOLD_CASE_DEFAULT)) + if (u_foldCase(*a++, U_FOLD_CASE_DEFAULT) != StringImpl::latin1CaseFoldTable[*b++]) return false; } return true; @@ -981,11 +979,11 @@ size_t StringImpl::find(const LChar* matchString, unsigned index) if (!matchString) return notFound; size_t matchStringLength = strlen(reinterpret_cast(matchString)); - if (matchStringLength > numeric_limits::max()) + if (matchStringLength > std::numeric_limits::max()) CRASH(); unsigned matchLength = matchStringLength; if (!matchLength) - return min(index, length()); + return std::min(index, length()); // Optimization 1: fast case for strings of length 1. if (matchLength == 1) @@ -1000,7 +998,7 @@ size_t StringImpl::find(const LChar* matchString, unsigned index) // delta is the number of additional times to test; delta == 0 means test only once. unsigned delta = searchLength - matchLength; - const UChar* searchCharacters = characters() + index; + const UChar* searchCharacters = deprecatedCharacters() + index; // Optimization 2: keep a running hash of the strings, // only call equal if the hashes match. @@ -1029,11 +1027,11 @@ size_t StringImpl::findIgnoringCase(const LChar* matchString, unsigned index) if (!matchString) return notFound; size_t matchStringLength = strlen(reinterpret_cast(matchString)); - if (matchStringLength > numeric_limits::max()) + if (matchStringLength > std::numeric_limits::max()) CRASH(); unsigned matchLength = matchStringLength; if (!matchLength) - return min(index, length()); + return std::min(index, length()); // Check index & matchLength are in range. if (index > length()) @@ -1044,7 +1042,7 @@ size_t StringImpl::findIgnoringCase(const LChar* matchString, unsigned index) // delta is the number of additional times to test; delta == 0 means test only once. unsigned delta = searchLength - matchLength; - const UChar* searchCharacters = characters() + index; + const UChar* searchCharacters = deprecatedCharacters() + index; unsigned i = 0; // keep looping until we match @@ -1140,7 +1138,7 @@ size_t StringImpl::find(StringImpl* matchString, unsigned index) } if (UNLIKELY(!matchLength)) - return min(index, length()); + return std::min(index, length()); // Check index & matchLength are in range. if (index > length()) @@ -1184,7 +1182,7 @@ size_t StringImpl::findIgnoringCase(StringImpl* matchString, unsigned index) return notFound; unsigned matchLength = matchString->length(); if (!matchLength) - return min(index, length()); + return std::min(index, length()); // Check index & matchLength are in range. if (index > length()) @@ -1226,7 +1224,7 @@ ALWAYS_INLINE static size_t reverseFindInner(const SearchCharacterType* searchCh // only call equal if the hashes match. // delta is the number of additional times to test; delta == 0 means test only once. - unsigned delta = min(index, length - matchLength); + unsigned delta = std::min(index, length - matchLength); unsigned searchHash = 0; unsigned matchHash = 0; @@ -1254,7 +1252,7 @@ size_t StringImpl::reverseFind(StringImpl* matchString, unsigned index) unsigned matchLength = matchString->length(); unsigned ourLength = length(); if (!matchLength) - return min(index, ourLength); + return std::min(index, ourLength); // Optimization 1: fast case for strings of length 1. if (matchLength == 1) { @@ -1283,7 +1281,7 @@ template ALWAYS_INLINE static size_t reverseFindIgnoringCaseInner(const SearchCharacterType* searchCharacters, const MatchCharacterType* matchCharacters, unsigned index, unsigned length, unsigned matchLength) { // delta is the number of additional times to test; delta == 0 means test only once. - unsigned delta = min(index, length - matchLength); + unsigned delta = std::min(index, length - matchLength); // keep looping until we match while (!equalIgnoringCase(searchCharacters + delta, matchCharacters, matchLength)) { @@ -1302,7 +1300,7 @@ size_t StringImpl::reverseFindIgnoringCase(StringImpl* matchString, unsigned ind unsigned matchLength = matchString->length(); unsigned ourLength = length(); if (!matchLength) - return min(index, ourLength); + return std::min(index, ourLength); // Check index & matchLength are in range. if (matchLength > ourLength) @@ -1391,10 +1389,10 @@ bool StringImpl::endsWith(const char* matchString, unsigned matchLength, bool ca return equalInner(this, startOffset, matchString, matchLength, caseSensitive); } -PassRefPtr StringImpl::replace(UChar oldC, UChar newC) +PassRef StringImpl::replace(UChar oldC, UChar newC) { if (oldC == newC) - return this; + return *this; unsigned i; for (i = 0; i != m_length; ++i) { UChar c = is8Bit() ? m_data8[i] : m_data16[i]; @@ -1402,19 +1400,19 @@ PassRefPtr StringImpl::replace(UChar oldC, UChar newC) break; } if (i == m_length) - return this; + return *this; if (is8Bit()) { if (oldC > 0xff) // Looking for a 16 bit char in an 8 bit string, we're done. - return this; + return *this; if (newC <= 0xff) { LChar* data; LChar oldChar = static_cast(oldC); LChar newChar = static_cast(newC); - RefPtr newImpl = createUninitializedInternalNonEmpty(m_length, data); + auto newImpl = createUninitializedInternalNonEmpty(m_length, data); for (i = 0; i != m_length; ++i) { LChar ch = m_data8[i]; @@ -1422,13 +1420,13 @@ PassRefPtr StringImpl::replace(UChar oldC, UChar newC) ch = newChar; data[i] = ch; } - return newImpl.release(); + return newImpl; } // There is the possibility we need to up convert from 8 to 16 bit, // create a 16 bit string for the result. UChar* data; - RefPtr newImpl = createUninitializedInternalNonEmpty(m_length, data); + auto newImpl = createUninitializedInternalNonEmpty(m_length, data); for (i = 0; i != m_length; ++i) { UChar ch = m_data8[i]; @@ -1437,11 +1435,11 @@ PassRefPtr StringImpl::replace(UChar oldC, UChar newC) data[i] = ch; } - return newImpl.release(); + return newImpl; } UChar* data; - RefPtr newImpl = createUninitializedInternalNonEmpty(m_length, data); + auto newImpl = createUninitializedInternalNonEmpty(m_length, data); for (i = 0; i != m_length; ++i) { UChar ch = m_data16[i]; @@ -1449,34 +1447,32 @@ PassRefPtr StringImpl::replace(UChar oldC, UChar newC) ch = newC; data[i] = ch; } - return newImpl.release(); + return newImpl; } -PassRefPtr StringImpl::replace(unsigned position, unsigned lengthToReplace, StringImpl* str) +PassRef StringImpl::replace(unsigned position, unsigned lengthToReplace, StringImpl* str) { - position = min(position, length()); - lengthToReplace = min(lengthToReplace, length() - position); + position = std::min(position, length()); + lengthToReplace = std::min(lengthToReplace, length() - position); unsigned lengthToInsert = str ? str->length() : 0; if (!lengthToReplace && !lengthToInsert) - return this; + return *this; - if ((length() - lengthToReplace) >= (numeric_limits::max() - lengthToInsert)) + if ((length() - lengthToReplace) >= (std::numeric_limits::max() - lengthToInsert)) CRASH(); if (is8Bit() && (!str || str->is8Bit())) { LChar* data; - RefPtr newImpl = - createUninitialized(length() - lengthToReplace + lengthToInsert, data); + auto newImpl = createUninitialized(length() - lengthToReplace + lengthToInsert, data); memcpy(data, m_data8, position * sizeof(LChar)); if (str) memcpy(data + position, str->m_data8, lengthToInsert * sizeof(LChar)); memcpy(data + position + lengthToInsert, m_data8 + position + lengthToReplace, (length() - position - lengthToReplace) * sizeof(LChar)); - return newImpl.release(); + return newImpl; } UChar* data; - RefPtr newImpl = - createUninitialized(length() - lengthToReplace + lengthToInsert, data); + auto newImpl = createUninitialized(length() - lengthToReplace + lengthToInsert, data); if (is8Bit()) for (unsigned i = 0; i < position; ++i) data[i] = m_data8[i]; @@ -1496,13 +1492,13 @@ PassRefPtr StringImpl::replace(unsigned position, unsigned lengthToR memcpy(data + position + lengthToInsert, characters() + position + lengthToReplace, (length() - position - lengthToReplace) * sizeof(UChar)); } - return newImpl.release(); + return newImpl; } -PassRefPtr StringImpl::replace(UChar pattern, StringImpl* replacement) +PassRef StringImpl::replace(UChar pattern, StringImpl* replacement) { if (!replacement) - return this; + return *this; if (replacement->is8Bit()) return replace(pattern, replacement->m_data8, replacement->length()); @@ -1510,7 +1506,7 @@ PassRefPtr StringImpl::replace(UChar pattern, StringImpl* replacemen return replace(pattern, replacement->m_data16, replacement->length()); } -PassRefPtr StringImpl::replace(UChar pattern, const LChar* replacement, unsigned repStrLength) +PassRef StringImpl::replace(UChar pattern, const LChar* replacement, unsigned repStrLength) { ASSERT(replacement); @@ -1525,14 +1521,14 @@ PassRefPtr StringImpl::replace(UChar pattern, const LChar* replaceme // If we have 0 matches then we don't have to do any more work. if (!matchCount) - return this; + return *this; - if (repStrLength && matchCount > numeric_limits::max() / repStrLength) + if (repStrLength && matchCount > std::numeric_limits::max() / repStrLength) CRASH(); unsigned replaceSize = matchCount * repStrLength; unsigned newSize = m_length - matchCount; - if (newSize >= (numeric_limits::max() - replaceSize)) + if (newSize >= (std::numeric_limits::max() - replaceSize)) CRASH(); newSize += replaceSize; @@ -1545,7 +1541,7 @@ PassRefPtr StringImpl::replace(UChar pattern, const LChar* replaceme if (is8Bit()) { LChar* data; - RefPtr newImpl = createUninitialized(newSize, data); + auto newImpl = createUninitialized(newSize, data); while ((srcSegmentEnd = find(pattern, srcSegmentStart)) != notFound) { srcSegmentLength = srcSegmentEnd - srcSegmentStart; @@ -1559,13 +1555,13 @@ PassRefPtr StringImpl::replace(UChar pattern, const LChar* replaceme srcSegmentLength = m_length - srcSegmentStart; memcpy(data + dstOffset, m_data8 + srcSegmentStart, srcSegmentLength * sizeof(LChar)); - ASSERT(dstOffset + srcSegmentLength == newImpl->length()); + ASSERT(dstOffset + srcSegmentLength == newImpl.get().length()); - return newImpl.release(); + return newImpl; } UChar* data; - RefPtr newImpl = createUninitialized(newSize, data); + auto newImpl = createUninitialized(newSize, data); while ((srcSegmentEnd = find(pattern, srcSegmentStart)) != notFound) { srcSegmentLength = srcSegmentEnd - srcSegmentStart; @@ -1582,12 +1578,12 @@ PassRefPtr StringImpl::replace(UChar pattern, const LChar* replaceme srcSegmentLength = m_length - srcSegmentStart; memcpy(data + dstOffset, m_data16 + srcSegmentStart, srcSegmentLength * sizeof(UChar)); - ASSERT(dstOffset + srcSegmentLength == newImpl->length()); + ASSERT(dstOffset + srcSegmentLength == newImpl.get().length()); - return newImpl.release(); + return newImpl; } -PassRefPtr StringImpl::replace(UChar pattern, const UChar* replacement, unsigned repStrLength) +PassRef StringImpl::replace(UChar pattern, const UChar* replacement, unsigned repStrLength) { ASSERT(replacement); @@ -1602,14 +1598,14 @@ PassRefPtr StringImpl::replace(UChar pattern, const UChar* replaceme // If we have 0 matches then we don't have to do any more work. if (!matchCount) - return this; + return *this; - if (repStrLength && matchCount > numeric_limits::max() / repStrLength) + if (repStrLength && matchCount > std::numeric_limits::max() / repStrLength) CRASH(); unsigned replaceSize = matchCount * repStrLength; unsigned newSize = m_length - matchCount; - if (newSize >= (numeric_limits::max() - replaceSize)) + if (newSize >= (std::numeric_limits::max() - replaceSize)) CRASH(); newSize += replaceSize; @@ -1622,7 +1618,7 @@ PassRefPtr StringImpl::replace(UChar pattern, const UChar* replaceme if (is8Bit()) { UChar* data; - RefPtr newImpl = createUninitialized(newSize, data); + auto newImpl = createUninitialized(newSize, data); while ((srcSegmentEnd = find(pattern, srcSegmentStart)) != notFound) { srcSegmentLength = srcSegmentEnd - srcSegmentStart; @@ -1640,13 +1636,13 @@ PassRefPtr StringImpl::replace(UChar pattern, const UChar* replaceme for (unsigned i = 0; i < srcSegmentLength; ++i) data[i + dstOffset] = m_data8[i + srcSegmentStart]; - ASSERT(dstOffset + srcSegmentLength == newImpl->length()); + ASSERT(dstOffset + srcSegmentLength == newImpl.get().length()); - return newImpl.release(); + return newImpl; } UChar* data; - RefPtr newImpl = createUninitialized(newSize, data); + auto newImpl = createUninitialized(newSize, data); while ((srcSegmentEnd = find(pattern, srcSegmentStart)) != notFound) { srcSegmentLength = srcSegmentEnd - srcSegmentStart; @@ -1662,19 +1658,19 @@ PassRefPtr StringImpl::replace(UChar pattern, const UChar* replaceme srcSegmentLength = m_length - srcSegmentStart; memcpy(data + dstOffset, m_data16 + srcSegmentStart, srcSegmentLength * sizeof(UChar)); - ASSERT(dstOffset + srcSegmentLength == newImpl->length()); + ASSERT(dstOffset + srcSegmentLength == newImpl.get().length()); - return newImpl.release(); + return newImpl; } -PassRefPtr StringImpl::replace(StringImpl* pattern, StringImpl* replacement) +PassRef StringImpl::replace(StringImpl* pattern, StringImpl* replacement) { if (!pattern || !replacement) - return this; + return *this; unsigned patternLength = pattern->length(); if (!patternLength) - return this; + return *this; unsigned repStrLength = replacement->length(); size_t srcSegmentStart = 0; @@ -1688,13 +1684,13 @@ PassRefPtr StringImpl::replace(StringImpl* pattern, StringImpl* repl // If we have 0 matches, we don't have to do any more work if (!matchCount) - return this; + return *this; unsigned newSize = m_length - matchCount * patternLength; - if (repStrLength && matchCount > numeric_limits::max() / repStrLength) + if (repStrLength && matchCount > std::numeric_limits::max() / repStrLength) CRASH(); - if (newSize > (numeric_limits::max() - matchCount * repStrLength)) + if (newSize > (std::numeric_limits::max() - matchCount * repStrLength)) CRASH(); newSize += matchCount * repStrLength; @@ -1716,7 +1712,7 @@ PassRefPtr StringImpl::replace(StringImpl* pattern, StringImpl* repl if (srcIs8Bit && replacementIs8Bit) { // Case 1 LChar* data; - RefPtr newImpl = createUninitialized(newSize, data); + auto newImpl = createUninitialized(newSize, data); while ((srcSegmentEnd = find(pattern, srcSegmentStart)) != notFound) { srcSegmentLength = srcSegmentEnd - srcSegmentStart; memcpy(data + dstOffset, m_data8 + srcSegmentStart, srcSegmentLength * sizeof(LChar)); @@ -1729,13 +1725,13 @@ PassRefPtr StringImpl::replace(StringImpl* pattern, StringImpl* repl srcSegmentLength = m_length - srcSegmentStart; memcpy(data + dstOffset, m_data8 + srcSegmentStart, srcSegmentLength * sizeof(LChar)); - ASSERT(dstOffset + srcSegmentLength == newImpl->length()); + ASSERT(dstOffset + srcSegmentLength == newImpl.get().length()); - return newImpl.release(); + return newImpl; } UChar* data; - RefPtr newImpl = createUninitialized(newSize, data); + auto newImpl = createUninitialized(newSize, data); while ((srcSegmentEnd = find(pattern, srcSegmentStart)) != notFound) { srcSegmentLength = srcSegmentEnd - srcSegmentStart; if (srcIs8Bit) { @@ -1769,9 +1765,9 @@ PassRefPtr StringImpl::replace(StringImpl* pattern, StringImpl* repl memcpy(data + dstOffset, m_data16 + srcSegmentStart, srcSegmentLength * sizeof(UChar)); } - ASSERT(dstOffset + srcSegmentLength == newImpl->length()); + ASSERT(dstOffset + srcSegmentLength == newImpl.get().length()); - return newImpl.release(); + return newImpl; } static inline bool stringImplContentEqual(const StringImpl* a, const StringImpl* b) @@ -2084,7 +2080,7 @@ CString StringImpl::utf8ForCharacters( { if (!length) return CString("", 0); - if (length > numeric_limits::max() / 3) + if (length > std::numeric_limits::max() / 3) return CString(); Vector bufferVector(length * 3); char* buffer = bufferVector.data(); @@ -2111,7 +2107,7 @@ CString StringImpl::utf8ForRange(unsigned offset, unsigned length, ConversionMod // * We could allocate a CStringBuffer with an appropriate size to // have a good chance of being able to write the string into the // buffer without reallocing (say, 1.5 x length). - if (length > numeric_limits::max() / 3) + if (length > std::numeric_limits::max() / 3) return CString(); Vector bufferVector(length * 3); @@ -2135,4 +2131,25 @@ CString StringImpl::utf8(ConversionMode mode) const return utf8ForRange(0, length(), mode); } +// Table is based on ftp://ftp.unicode.org/Public/UNIDATA/CaseFolding.txt +const UChar StringImpl::latin1CaseFoldTable[256] = { + 0x0000, 0x0001, 0x0002, 0x0003, 0x0004, 0x0005, 0x0006, 0x0007, 0x0008, 0x0009, 0x000a, 0x000b, 0x000c, 0x000d, 0x000e, 0x000f, + 0x0010, 0x0011, 0x0012, 0x0013, 0x0014, 0x0015, 0x0016, 0x0017, 0x0018, 0x0019, 0x001a, 0x001b, 0x001c, 0x001d, 0x001e, 0x001f, + 0x0020, 0x0021, 0x0022, 0x0023, 0x0024, 0x0025, 0x0026, 0x0027, 0x0028, 0x0029, 0x002a, 0x002b, 0x002c, 0x002d, 0x002e, 0x002f, + 0x0030, 0x0031, 0x0032, 0x0033, 0x0034, 0x0035, 0x0036, 0x0037, 0x0038, 0x0039, 0x003a, 0x003b, 0x003c, 0x003d, 0x003e, 0x003f, + 0x0040, 0x0061, 0x0062, 0x0063, 0x0064, 0x0065, 0x0066, 0x0067, 0x0068, 0x0069, 0x006a, 0x006b, 0x006c, 0x006d, 0x006e, 0x006f, + 0x0070, 0x0071, 0x0072, 0x0073, 0x0074, 0x0075, 0x0076, 0x0077, 0x0078, 0x0079, 0x007a, 0x005b, 0x005c, 0x005d, 0x005e, 0x005f, + 0x0060, 0x0061, 0x0062, 0x0063, 0x0064, 0x0065, 0x0066, 0x0067, 0x0068, 0x0069, 0x006a, 0x006b, 0x006c, 0x006d, 0x006e, 0x006f, + 0x0070, 0x0071, 0x0072, 0x0073, 0x0074, 0x0075, 0x0076, 0x0077, 0x0078, 0x0079, 0x007a, 0x007b, 0x007c, 0x007d, 0x007e, 0x007f, + 0x0080, 0x0081, 0x0082, 0x0083, 0x0084, 0x0085, 0x0086, 0x0087, 0x0088, 0x0089, 0x008a, 0x008b, 0x008c, 0x008d, 0x008e, 0x008f, + 0x0090, 0x0091, 0x0092, 0x0093, 0x0094, 0x0095, 0x0096, 0x0097, 0x0098, 0x0099, 0x009a, 0x009b, 0x009c, 0x009d, 0x009e, 0x009f, + 0x00a0, 0x00a1, 0x00a2, 0x00a3, 0x00a4, 0x00a5, 0x00a6, 0x00a7, 0x00a8, 0x00a9, 0x00aa, 0x00ab, 0x00ac, 0x00ad, 0x00ae, 0x00af, + 0x00b0, 0x00b1, 0x00b2, 0x00b3, 0x00b4, 0x03bc, 0x00b6, 0x00b7, 0x00b8, 0x00b9, 0x00ba, 0x00bb, 0x00bc, 0x00bd, 0x00be, 0x00bf, + 0x00e0, 0x00e1, 0x00e2, 0x00e3, 0x00e4, 0x00e5, 0x00e6, 0x00e7, 0x00e8, 0x00e9, 0x00ea, 0x00eb, 0x00ec, 0x00ed, 0x00ee, 0x00ef, + 0x00f0, 0x00f1, 0x00f2, 0x00f3, 0x00f4, 0x00f5, 0x00f6, 0x00d7, 0x00f8, 0x00f9, 0x00fa, 0x00fb, 0x00fc, 0x00fd, 0x00fe, 0x00df, + 0x00e0, 0x00e1, 0x00e2, 0x00e3, 0x00e4, 0x00e5, 0x00e6, 0x00e7, 0x00e8, 0x00e9, 0x00ea, 0x00eb, 0x00ec, 0x00ed, 0x00ee, 0x00ef, + 0x00f0, 0x00f1, 0x00f2, 0x00f3, 0x00f4, 0x00f5, 0x00f6, 0x00f7, 0x00f8, 0x00f9, 0x00fa, 0x00fb, 0x00fc, 0x00fd, 0x00fe, 0x00ff, +}; + + } // namespace WTF diff --git a/WTF/wtf/text/StringImpl.h b/WTF/wtf/text/StringImpl.h index 4719ce41..770acf00 100644 --- a/WTF/wtf/text/StringImpl.h +++ b/WTF/wtf/text/StringImpl.h @@ -43,10 +43,6 @@ typedef const struct __CFString * CFStringRef; @class NSString; #endif -#if PLATFORM(BLACKBERRY) -#include -#endif - // FIXME: This is a temporary layering violation while we move string code to WTF. // Landing the file moves in one patch, will follow on with patches to change the namespaces. namespace JSC { @@ -315,7 +311,9 @@ class StringImpl { StringImpl(CreateEmptyUnique_T) : m_refCount(s_refCountIncrement) , m_length(0) - , m_data16(reinterpret_cast(1)) + // We expect m_buffer to be initialized to 0 as we use it + // to represent a null terminated buffer. + , m_data16(reinterpret_cast(&m_buffer)) , m_buffer(0) { ASSERT(m_data16); @@ -348,39 +346,39 @@ class StringImpl { } WTF_EXPORT_STRING_API static PassRef create8BitIfPossible(const UChar*); - ALWAYS_INLINE static PassRefPtr create(const char* s, unsigned length) { return create(reinterpret_cast(s), length); } - WTF_EXPORT_STRING_API static PassRefPtr create(const LChar*); - ALWAYS_INLINE static PassRefPtr create(const char* s) { return create(reinterpret_cast(s)); } + ALWAYS_INLINE static PassRef create(const char* s, unsigned length) { return create(reinterpret_cast(s), length); } + WTF_EXPORT_STRING_API static PassRef create(const LChar*); + ALWAYS_INLINE static PassRef create(const char* s) { return create(reinterpret_cast(s)); } - static ALWAYS_INLINE PassRefPtr create8(PassRefPtr rep, unsigned offset, unsigned length) + static ALWAYS_INLINE PassRef create8(PassRefPtr rep, unsigned offset, unsigned length) { ASSERT(rep); ASSERT(length <= rep->length()); if (!length) - return empty(); + return *empty(); ASSERT(rep->is8Bit()); StringImpl* ownerRep = (rep->bufferOwnership() == BufferSubstring) ? rep->m_substringBuffer : rep.get(); - return adoptRef(new StringImpl(rep->m_data8 + offset, length, ownerRep)); + return adoptRef(*new StringImpl(rep->m_data8 + offset, length, ownerRep)); } - static ALWAYS_INLINE PassRefPtr create(PassRefPtr rep, unsigned offset, unsigned length) + static ALWAYS_INLINE PassRef create(PassRefPtr rep, unsigned offset, unsigned length) { ASSERT(rep); ASSERT(length <= rep->length()); if (!length) - return empty(); + return *empty(); StringImpl* ownerRep = (rep->bufferOwnership() == BufferSubstring) ? rep->m_substringBuffer : rep.get(); if (rep->is8Bit()) - return adoptRef(new StringImpl(rep->m_data8 + offset, length, ownerRep)); - return adoptRef(new StringImpl(rep->m_data16 + offset, length, ownerRep)); + return adoptRef(*new StringImpl(rep->m_data8 + offset, length, ownerRep)); + return adoptRef(*new StringImpl(rep->m_data16 + offset, length, ownerRep)); } template - ALWAYS_INLINE static PassRefPtr createFromLiteral(const char (&characters)[charactersCount]) + ALWAYS_INLINE static PassRef createFromLiteral(const char (&characters)[charactersCount]) { COMPILE_ASSERT(charactersCount > 1, StringImplFromLiteralNotEmpty); COMPILE_ASSERT((charactersCount - 1 <= ((unsigned(~0) - sizeof(StringImpl)) / sizeof(LChar))), StringImplFromLiteralCannotOverflow); @@ -389,14 +387,14 @@ class StringImpl { } // FIXME: Transition off of these functions to createWithoutCopying instead. - WTF_EXPORT_STRING_API static PassRefPtr createFromLiteral(const char* characters, unsigned length); - WTF_EXPORT_STRING_API static PassRefPtr createFromLiteral(const char* characters); + WTF_EXPORT_STRING_API static PassRef createFromLiteral(const char* characters, unsigned length); + WTF_EXPORT_STRING_API static PassRef createFromLiteral(const char* characters); WTF_EXPORT_STRING_API static PassRef createWithoutCopying(const UChar* characters, unsigned length); WTF_EXPORT_STRING_API static PassRef createWithoutCopying(const LChar* characters, unsigned length); - WTF_EXPORT_STRING_API static PassRefPtr createUninitialized(unsigned length, LChar*& data); - WTF_EXPORT_STRING_API static PassRefPtr createUninitialized(unsigned length, UChar*& data); + WTF_EXPORT_STRING_API static PassRef createUninitialized(unsigned length, LChar*& data); + WTF_EXPORT_STRING_API static PassRef createUninitialized(unsigned length, UChar*& data); template static ALWAYS_INLINE PassRefPtr tryCreateUninitialized(unsigned length, T*& output) { if (!length) { @@ -418,16 +416,16 @@ class StringImpl { return constructInternal(resultImpl, length); } - static PassRefPtr createEmptyUnique() + static PassRef createEmptyUnique() { - return adoptRef(new StringImpl(CreateEmptyUnique)); + return adoptRef(*new StringImpl(CreateEmptyUnique)); } // Reallocate the StringImpl. The originalString must be only owned by the PassRefPtr, // and the buffer ownership must be BufferInternal. Just like the input pointer of realloc(), // the originalString can't be used after this function. - static PassRefPtr reallocate(PassRefPtr originalString, unsigned length, LChar*& data); - static PassRefPtr reallocate(PassRefPtr originalString, unsigned length, UChar*& data); + static PassRef reallocate(PassRefPtr originalString, unsigned length, LChar*& data); + static PassRef reallocate(PassRefPtr originalString, unsigned length, UChar*& data); static unsigned flagsOffset() { return OBJECT_OFFSETOF(StringImpl, m_hashAndFlags); } static unsigned flagIs8Bit() { return s_hashFlag8BitBuffer; } @@ -452,10 +450,10 @@ class StringImpl { unsigned length() const { return m_length; } bool is8Bit() const { return m_hashAndFlags & s_hashFlag8BitBuffer; } - // FIXME: Remove all unnecessary usages of characters() ALWAYS_INLINE const LChar* characters8() const { ASSERT(is8Bit()); return m_data8; } ALWAYS_INLINE const UChar* characters16() const { ASSERT(!is8Bit()); return m_data16; } - ALWAYS_INLINE const UChar* characters() const + const UChar* characters() const { return deprecatedCharacters(); } // FIXME: Delete this. + ALWAYS_INLINE const UChar* deprecatedCharacters() const { if (!is8Bit()) return m_data16; @@ -656,7 +654,7 @@ class StringImpl { // its own copy of the string. PassRef isolatedCopy() const; - WTF_EXPORT_STRING_API PassRefPtr substring(unsigned pos, unsigned len = UINT_MAX); + WTF_EXPORT_STRING_API PassRef substring(unsigned pos, unsigned len = UINT_MAX); UChar at(unsigned i) const { @@ -689,22 +687,22 @@ class StringImpl { float toFloat(bool* ok = 0); WTF_EXPORT_STRING_API PassRef lower(); - WTF_EXPORT_STRING_API PassRefPtr upper(); + WTF_EXPORT_STRING_API PassRef upper(); WTF_EXPORT_STRING_API PassRef lower(const AtomicString& localeIdentifier); - WTF_EXPORT_STRING_API RefPtr upper(const AtomicString& localeIdentifier); + WTF_EXPORT_STRING_API PassRef upper(const AtomicString& localeIdentifier); - WTF_EXPORT_STRING_API PassRefPtr fill(UChar); + WTF_EXPORT_STRING_API PassRef fill(UChar); // FIXME: Do we need fill(char) or can we just do the right thing if UChar is ASCII? - PassRefPtr foldCase(); + PassRef foldCase(); - PassRefPtr stripWhiteSpace(); - PassRefPtr stripWhiteSpace(IsWhiteSpaceFunctionPtr); - WTF_EXPORT_STRING_API PassRefPtr simplifyWhiteSpace(); - PassRefPtr simplifyWhiteSpace(IsWhiteSpaceFunctionPtr); + PassRef stripWhiteSpace(); + PassRef stripWhiteSpace(IsWhiteSpaceFunctionPtr); + WTF_EXPORT_STRING_API PassRef simplifyWhiteSpace(); + PassRef simplifyWhiteSpace(IsWhiteSpaceFunctionPtr); - PassRefPtr removeCharacters(CharacterMatchFunctionPtr); + PassRef removeCharacters(CharacterMatchFunctionPtr); template - ALWAYS_INLINE PassRefPtr removeCharacters(const CharType* characters, CharacterMatchFunctionPtr); + ALWAYS_INLINE PassRef removeCharacters(const CharType* characters, CharacterMatchFunctionPtr); size_t find(LChar character, unsigned start = 0); size_t find(char character, unsigned start = 0); @@ -737,13 +735,13 @@ class StringImpl { template bool endsWith(const char (&prefix)[matchLength], bool caseSensitive = true) const { return endsWith(prefix, matchLength - 1, caseSensitive); } - WTF_EXPORT_STRING_API PassRefPtr replace(UChar, UChar); - WTF_EXPORT_STRING_API PassRefPtr replace(UChar, StringImpl*); - ALWAYS_INLINE PassRefPtr replace(UChar pattern, const char* replacement, unsigned replacementLength) { return replace(pattern, reinterpret_cast(replacement), replacementLength); } - WTF_EXPORT_STRING_API PassRefPtr replace(UChar, const LChar*, unsigned replacementLength); - PassRefPtr replace(UChar, const UChar*, unsigned replacementLength); - WTF_EXPORT_STRING_API PassRefPtr replace(StringImpl*, StringImpl*); - WTF_EXPORT_STRING_API PassRefPtr replace(unsigned index, unsigned len, StringImpl*); + WTF_EXPORT_STRING_API PassRef replace(UChar, UChar); + WTF_EXPORT_STRING_API PassRef replace(UChar, StringImpl*); + ALWAYS_INLINE PassRef replace(UChar pattern, const char* replacement, unsigned replacementLength) { return replace(pattern, reinterpret_cast(replacement), replacementLength); } + WTF_EXPORT_STRING_API PassRef replace(UChar, const LChar*, unsigned replacementLength); + PassRef replace(UChar, const UChar*, unsigned replacementLength); + WTF_EXPORT_STRING_API PassRef replace(StringImpl*, StringImpl*); + WTF_EXPORT_STRING_API PassRef replace(unsigned index, unsigned len, StringImpl*); WTF_EXPORT_STRING_API UCharDirection defaultWritingDirection(bool* hasStrongDirectionality = nullptr); @@ -751,13 +749,15 @@ class StringImpl { RetainPtr createCFString(); #endif #ifdef __OBJC__ - operator NSString*(); + WTF_EXPORT_STRING_API operator NSString*(); #endif #ifdef STRING_STATS ALWAYS_INLINE static StringStats& stringStats() { return m_stringStats; } #endif + WTF_EXPORT_STRING_API static const UChar latin1CaseFoldTable[256]; + private: bool requiresCopy() const { @@ -773,12 +773,12 @@ class StringImpl { static const unsigned s_copyCharsInlineCutOff = 20; BufferOwnership bufferOwnership() const { return static_cast(m_hashAndFlags & s_hashMaskBufferOwnership); } - template PassRefPtr stripMatchedCharacters(UCharPredicate); - template PassRefPtr simplifyMatchedCharactersToSpace(UCharPredicate); + template PassRef stripMatchedCharacters(UCharPredicate); + template PassRef simplifyMatchedCharactersToSpace(UCharPredicate); template static PassRef constructInternal(StringImpl*, unsigned); template static PassRef createUninitializedInternal(unsigned, CharType*&); template static PassRef createUninitializedInternalNonEmpty(unsigned, CharType*&); - template static PassRefPtr reallocateInternal(PassRefPtr, unsigned, CharType*&); + template static PassRef reallocateInternal(PassRefPtr, unsigned, CharType*&); template static PassRef createInternal(const CharType*, unsigned); WTF_EXPORT_STRING_API NEVER_INLINE const UChar* getData16SlowCase() const; WTF_EXPORT_PRIVATE NEVER_INLINE unsigned hashSlowCase() const; @@ -865,7 +865,7 @@ template <> ALWAYS_INLINE const LChar* StringImpl::getCharacters() const { return characters8(); } template <> -ALWAYS_INLINE const UChar* StringImpl::getCharacters() const { return characters(); } +ALWAYS_INLINE const UChar* StringImpl::getCharacters() const { return deprecatedCharacters(); } WTF_EXPORT_STRING_API bool equal(const StringImpl*, const StringImpl*); WTF_EXPORT_STRING_API bool equal(const StringImpl*, const LChar*); @@ -1255,7 +1255,7 @@ bool equalIgnoringNullity(const Vector& a, StringImpl* b) return !a.size(); if (a.size() != b->length()) return false; - return !memcmp(a.data(), b->characters(), b->length() * sizeof(UChar)); + return !memcmp(a.data(), b->deprecatedCharacters(), b->length() * sizeof(UChar)); } template diff --git a/WTF/wtf/text/StringStatics.cpp b/WTF/wtf/text/StringStatics.cpp index a8eb3a9b..8f0c74cc 100644 --- a/WTF/wtf/text/StringStatics.cpp +++ b/WTF/wtf/text/StringStatics.cpp @@ -43,7 +43,15 @@ namespace WTF { StringImpl* StringImpl::empty() { - DEFINE_STATIC_LOCAL(StringImpl, emptyString, (reinterpret_cast(static_cast(8)), 0, ConstructStaticString)); + // FIXME: This works around a bug in our port of PCRE, that a regular expression + // run on the empty string may still perform a read from the first element, and + // as such we need this to be a valid pointer. No code should ever be reading + // from a zero length string, so this should be able to be a non-null pointer + // into the zero-page. + // Replace this with 'reinterpret_cast(static_cast(1))' once + // PCRE goes away. + static LChar emptyLCharData = 0; + DEFINE_STATIC_LOCAL(StringImpl, emptyString, (&emptyLCharData, 0, ConstructStaticString)); WTF_ANNOTATE_BENIGN_RACE(&emptyString, "Benign race on StringImpl::emptyString reference counter"); return &emptyString; } diff --git a/WTF/wtf/text/StringView.h b/WTF/wtf/text/StringView.h new file mode 100644 index 00000000..70f4eb0c --- /dev/null +++ b/WTF/wtf/text/StringView.h @@ -0,0 +1,157 @@ +/* + * Copyright (C) 2014 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. + */ + +#ifndef StringView_h +#define StringView_h + +#include + +namespace WTF { + +// StringView is a non-owning reference to a string, similar to the proposed std::string_view. +// Whether the string is 8-bit or 16-bit is encoded in the upper bit of the length member. +// This means that strings longer than 2 Gigabytes can not be represented. If that turns out to be +// a problem we can investigate alternative solutions. + +class StringView { +public: + StringView() + : m_characters(nullptr) + , m_length(0) + { + } + + StringView(const LChar* characters, unsigned length) + { + initialize(characters, length); + } + + StringView(const UChar* characters, unsigned length) + { + initialize(characters, length); + } + + StringView(const String& string) + : m_characters(nullptr) + , m_length(0) + { + if (!string.impl()) + return; + + if (string.is8Bit()) + initialize(string.characters8(), string.length()); + else + initialize(string.characters16(), string.length()); + } + + static StringView empty() + { + return StringView(reinterpret_cast(""), 0); + } + + const LChar* characters8() const + { + ASSERT(is8Bit()); + + return static_cast(m_characters); + } + + const UChar* characters16() const + { + ASSERT(!is8Bit()); + + return static_cast(m_characters); + } + + bool isNull() const { return !m_characters; } + bool isEmpty() const { return !length(); } + unsigned length() const { return m_length & ~is16BitStringFlag; } + + explicit operator bool() const { return !isNull(); } + + bool is8Bit() const { return !(m_length & is16BitStringFlag); } + + StringView substring(unsigned start, unsigned length = std::numeric_limits::max()) const + { + if (start >= this->length()) + return empty(); + unsigned maxLength = this->length() - start; + + if (length >= maxLength) { + if (!start) + return *this; + length = maxLength; + } + + if (is8Bit()) + return StringView(characters8() + start, length); + + return StringView(characters16() + start, length); + } + + String toString() const + { + if (is8Bit()) + return String(characters8(), length()); + + return String(characters16(), length()); + } + + String toStringWithoutCopying() const + { + if (is8Bit()) + return StringImpl::createWithoutCopying(characters8(), length()); + + return StringImpl::createWithoutCopying(characters16(), length()); + } + +private: + void initialize(const LChar* characters, unsigned length) + { + ASSERT(!(length & is16BitStringFlag)); + + m_characters = characters; + m_length = length; + } + + void initialize(const UChar* characters, unsigned length) + { + ASSERT(!(length & is16BitStringFlag)); + + m_characters = characters; + m_length = is16BitStringFlag | length; + } + + static const unsigned is16BitStringFlag = 1u << 31; + + const void* m_characters; + unsigned m_length; +}; + +} // namespace WTF + +using WTF::StringView; + +#endif // StringView_h diff --git a/WTF/wtf/text/WTFString.cpp b/WTF/wtf/text/WTFString.cpp index ba2d222c..45ba8af5 100644 --- a/WTF/wtf/text/WTFString.cpp +++ b/WTF/wtf/text/WTFString.cpp @@ -37,12 +37,9 @@ #include #include -using namespace std; - namespace WTF { using namespace Unicode; -using namespace std; // Construct a string with UTF-16 data. String::String(const UChar* characters, unsigned length) @@ -75,13 +72,15 @@ String::String(const char* characters, unsigned length) // Construct a string with latin1 data, from a null-terminated source. String::String(const LChar* characters) - : m_impl(characters ? StringImpl::create(characters) : 0) { + if (characters) + m_impl = StringImpl::create(characters); } String::String(const char* characters) - : m_impl(characters ? StringImpl::create(reinterpret_cast(characters)) : 0) { + if (characters) + m_impl = StringImpl::create(reinterpret_cast(characters)); } String::String(ASCIILiteral characters) @@ -102,7 +101,7 @@ void String::append(const String& str) if (m_impl) { if (m_impl->is8Bit() && str.m_impl->is8Bit()) { LChar* data; - if (str.length() > numeric_limits::max() - m_impl->length()) + if (str.length() > std::numeric_limits::max() - m_impl->length()) CRASH(); RefPtr newImpl = StringImpl::createUninitialized(m_impl->length() + str.length(), data); memcpy(data, m_impl->characters8(), m_impl->length() * sizeof(LChar)); @@ -111,11 +110,11 @@ void String::append(const String& str) return; } UChar* data; - if (str.length() > numeric_limits::max() - m_impl->length()) + if (str.length() > std::numeric_limits::max() - m_impl->length()) CRASH(); RefPtr newImpl = StringImpl::createUninitialized(m_impl->length() + str.length(), data); - memcpy(data, m_impl->characters(), m_impl->length() * sizeof(UChar)); - memcpy(data + m_impl->length(), str.characters(), str.length() * sizeof(UChar)); + memcpy(data, m_impl->deprecatedCharacters(), m_impl->length() * sizeof(UChar)); + memcpy(data + m_impl->length(), str.deprecatedCharacters(), str.length() * sizeof(UChar)); m_impl = newImpl.release(); } else m_impl = str.m_impl; @@ -131,10 +130,10 @@ inline void String::appendInternal(CharacterType c) // call to fastMalloc every single time. if (m_impl) { UChar* data; - if (m_impl->length() >= numeric_limits::max()) + if (m_impl->length() >= std::numeric_limits::max()) CRASH(); RefPtr newImpl = StringImpl::createUninitialized(m_impl->length() + 1, data); - memcpy(data, m_impl->characters(), m_impl->length() * sizeof(UChar)); + memcpy(data, m_impl->deprecatedCharacters(), m_impl->length() * sizeof(UChar)); data[m_impl->length()] = c; m_impl = newImpl.release(); } else @@ -165,7 +164,7 @@ void String::insert(const String& str, unsigned pos) m_impl = str.impl(); return; } - insert(str.characters(), str.length(), pos); + insert(str.deprecatedCharacters(), str.length(), pos); } void String::append(const LChar* charactersToAppend, unsigned lengthToAppend) @@ -185,7 +184,7 @@ void String::append(const LChar* charactersToAppend, unsigned lengthToAppend) unsigned strLength = m_impl->length(); if (m_impl->is8Bit()) { - if (lengthToAppend > numeric_limits::max() - strLength) + if (lengthToAppend > std::numeric_limits::max() - strLength) CRASH(); LChar* data; RefPtr newImpl = StringImpl::createUninitialized(strLength + lengthToAppend, data); @@ -195,7 +194,7 @@ void String::append(const LChar* charactersToAppend, unsigned lengthToAppend) return; } - if (lengthToAppend > numeric_limits::max() - strLength) + if (lengthToAppend > std::numeric_limits::max() - strLength) CRASH(); UChar* data; RefPtr newImpl = StringImpl::createUninitialized(length() + lengthToAppend, data); @@ -219,7 +218,7 @@ void String::append(const UChar* charactersToAppend, unsigned lengthToAppend) unsigned strLength = m_impl->length(); ASSERT(charactersToAppend); - if (lengthToAppend > numeric_limits::max() - strLength) + if (lengthToAppend > std::numeric_limits::max() - strLength) CRASH(); UChar* data; RefPtr newImpl = StringImpl::createUninitialized(strLength + lengthToAppend, data); @@ -246,12 +245,12 @@ void String::insert(const UChar* charactersToInsert, unsigned lengthToInsert, un ASSERT(charactersToInsert); UChar* data; - if (lengthToInsert > numeric_limits::max() - length()) + if (lengthToInsert > std::numeric_limits::max() - length()) CRASH(); RefPtr newImpl = StringImpl::createUninitialized(length() + lengthToInsert, data); - memcpy(data, characters(), position * sizeof(UChar)); + memcpy(data, deprecatedCharacters(), position * sizeof(UChar)); memcpy(data + position, charactersToInsert, lengthToInsert * sizeof(UChar)); - memcpy(data + position + lengthToInsert, characters() + position, (length() - position) * sizeof(UChar)); + memcpy(data + position + lengthToInsert, deprecatedCharacters() + position, (length() - position) * sizeof(UChar)); m_impl = newImpl.release(); } @@ -268,7 +267,7 @@ void String::truncate(unsigned position) return; UChar* data; RefPtr newImpl = StringImpl::createUninitialized(position, data); - memcpy(data, characters(), position * sizeof(UChar)); + memcpy(data, deprecatedCharacters(), position * sizeof(UChar)); m_impl = newImpl.release(); } @@ -314,8 +313,8 @@ String String::substringSharingImpl(unsigned offset, unsigned length) const // FIXME: We used to check against a limit of Heap::minExtraCost / sizeof(UChar). unsigned stringLength = this->length(); - offset = min(offset, stringLength); - length = min(length, stringLength - offset); + offset = std::min(offset, stringLength); + length = std::min(length, stringLength - offset); if (!offset && length == stringLength) return *this; @@ -400,7 +399,7 @@ bool String::percentage(int& result) const if ((*m_impl)[m_impl->length() - 1] != '%') return false; - result = charactersToIntStrict(m_impl->characters(), m_impl->length() - 1); + result = charactersToIntStrict(m_impl->deprecatedCharacters(), m_impl->length() - 1); return true; } @@ -831,7 +830,7 @@ String String::make16BitFrom8BitSource(const LChar* source, size_t length) String String::fromUTF8(const LChar* stringStart, size_t length) { - if (length > numeric_limits::max()) + if (length > std::numeric_limits::max()) CRASH(); if (!stringStart) @@ -896,8 +895,8 @@ static bool isCharacterAllowedInBase(UChar c, int base) template static inline IntegralType toIntegralType(const CharType* data, size_t length, bool* ok, int base) { - static const IntegralType integralMax = numeric_limits::max(); - static const bool isSigned = numeric_limits::is_signed; + static const IntegralType integralMax = std::numeric_limits::max(); + static const bool isSigned = std::numeric_limits::is_signed; const IntegralType maxMultiplier = integralMax / base; IntegralType value = 0; diff --git a/WTF/wtf/text/WTFString.h b/WTF/wtf/text/WTFString.h index 53a23685..c4011bc8 100644 --- a/WTF/wtf/text/WTFString.h +++ b/WTF/wtf/text/WTFString.h @@ -32,14 +32,6 @@ #include #endif -#if PLATFORM(BLACKBERRY) -namespace BlackBerry { -namespace Platform { -class String; -} -} -#endif - namespace WTF { class CString; @@ -164,13 +156,14 @@ class String { return m_impl->length(); } - const UChar* characters() const + const UChar* characters() const { return deprecatedCharacters(); } // FIXME: Delete this. + const UChar* deprecatedCharacters() const { if (!m_impl) return 0; - return m_impl->characters(); + return m_impl->deprecatedCharacters(); } - + const LChar* characters8() const { if (!m_impl) @@ -368,12 +361,12 @@ class String { WTF_EXPORT_STRING_API int toIntStrict(bool* ok = 0, int base = 10) const; WTF_EXPORT_STRING_API unsigned toUIntStrict(bool* ok = 0, int base = 10) const; WTF_EXPORT_STRING_API int64_t toInt64Strict(bool* ok = 0, int base = 10) const; - uint64_t toUInt64Strict(bool* ok = 0, int base = 10) const; + WTF_EXPORT_STRING_API uint64_t toUInt64Strict(bool* ok = 0, int base = 10) const; intptr_t toIntPtrStrict(bool* ok = 0, int base = 10) const; WTF_EXPORT_STRING_API int toInt(bool* ok = 0) const; WTF_EXPORT_STRING_API unsigned toUInt(bool* ok = 0) const; - int64_t toInt64(bool* ok = 0) const; + WTF_EXPORT_STRING_API int64_t toInt64(bool* ok = 0) const; WTF_EXPORT_STRING_API uint64_t toUInt64(bool* ok = 0) const; WTF_EXPORT_STRING_API intptr_t toIntPtr(bool* ok = 0) const; @@ -402,23 +395,18 @@ class String { operator UnspecifiedBoolTypeB() const; #if USE(CF) - String(CFStringRef); - RetainPtr createCFString() const; + WTF_EXPORT_STRING_API String(CFStringRef); + WTF_EXPORT_STRING_API RetainPtr createCFString() const; #endif #ifdef __OBJC__ - String(NSString*); + WTF_EXPORT_STRING_API String(NSString*); - // This conversion maps NULL to "", which loses the meaning of NULL, but we + // This conversion maps NULL to "", which loses the meaning of NULL, but we // need this mapping because AppKit crashes when passed nil NSStrings. operator NSString*() const { if (!m_impl) return @""; return *m_impl; } #endif -#if PLATFORM(BLACKBERRY) - String(const BlackBerry::Platform::String&); - operator BlackBerry::Platform::String() const; -#endif - WTF_EXPORT_STRING_API static String make8BitFrom16BitSource(const UChar*, size_t); template static String make8BitFrom16BitSource(const Vector& buffer) @@ -553,7 +541,7 @@ inline const LChar* String::getCharactersWithUpconvert() const template<> inline const UChar* String::getCharactersWithUpconvert() const { - return characters(); + return deprecatedCharacters(); } inline bool String::containsOnlyLatin1() const @@ -600,7 +588,7 @@ inline bool codePointCompareLessThan(const String& a, const String& b) template inline void append(Vector& vector, const String& string) { - vector.append(string.characters(), string.length()); + vector.append(string.deprecatedCharacters(), string.length()); } template diff --git a/WTF/wtf/text/cf/AtomicStringCF.cpp b/WTF/wtf/text/cf/AtomicStringCF.cpp new file mode 100644 index 00000000..b1737376 --- /dev/null +++ b/WTF/wtf/text/cf/AtomicStringCF.cpp @@ -0,0 +1,56 @@ +/* + * Copyright (C) 2012 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. + */ + +#include "config.h" +#include + +#if USE(CF) + +#include +#include + +namespace WTF { + +PassRefPtr AtomicString::add(CFStringRef string) +{ + if (!string) + return 0; + + CFIndex length = CFStringGetLength(string); + + if (const LChar* ptr = reinterpret_cast(CFStringGetCStringPtr(string, kCFStringEncodingISOLatin1))) + return add(ptr, length); + + if (const UniChar* ptr = CFStringGetCharactersPtr(string)) + return add(reinterpret_cast(ptr), length); + + Vector ucharBuffer(length); + CFStringGetCharacters(string, CFRangeMake(0, length), ucharBuffer.data()); + return add(reinterpret_cast(ucharBuffer.data()), length); +} + +} // namespace WTF + +#endif // USE(CF) diff --git a/WTF/wtf/text/cf/StringCF.cpp b/WTF/wtf/text/cf/StringCF.cpp new file mode 100644 index 00000000..2b1f198a --- /dev/null +++ b/WTF/wtf/text/cf/StringCF.cpp @@ -0,0 +1,64 @@ +/* + * Copyright (C) 2006, 2012 Apple Computer, Inc. + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Library General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Library General Public License for more details. + * + * You should have received a copy of the GNU Library General Public License + * along with this library; see the file COPYING.LIB. If not, write to + * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + * Boston, MA 02110-1301, USA. + * + */ + +#include "config.h" +#include + +#if USE(CF) + +#include +#include + +namespace WTF { + +String::String(CFStringRef str) +{ + if (!str) + return; + + CFIndex size = CFStringGetLength(str); + if (size == 0) + m_impl = StringImpl::empty(); + else { + Vector lcharBuffer(size); + CFIndex usedBufLen; + CFIndex convertedsize = CFStringGetBytes(str, CFRangeMake(0, size), kCFStringEncodingISOLatin1, 0, false, lcharBuffer.data(), size, &usedBufLen); + if ((convertedsize == size) && (usedBufLen == size)) { + m_impl = StringImpl::create(lcharBuffer.data(), size); + return; + } + + Vector buffer(size); + CFStringGetCharacters(str, CFRangeMake(0, size), (UniChar*)buffer.data()); + m_impl = StringImpl::create(buffer.data(), size); + } +} + +RetainPtr String::createCFString() const +{ + if (!m_impl) + return CFSTR(""); + + return m_impl->createCFString(); +} + +} + +#endif // USE(CF) diff --git a/WTF/wtf/text/cf/StringImplCF.cpp b/WTF/wtf/text/cf/StringImplCF.cpp new file mode 100644 index 00000000..278b5eda --- /dev/null +++ b/WTF/wtf/text/cf/StringImplCF.cpp @@ -0,0 +1,176 @@ +/* + * Copyright (C) 2006, 2009, 2012 Apple Inc. All rights reserved. + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Library General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Library General Public License for more details. + * + * You should have received a copy of the GNU Library General Public License + * along with this library; see the file COPYING.LIB. If not, write to + * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + * Boston, MA 02110-1301, USA. + * + */ + +#include "config.h" +#include + +#if USE(CF) + +#include +#include +#include +#include +#include + +#if PLATFORM(MAC) && !PLATFORM(IOS) +#include +#endif + +static inline bool garbageCollectionEnabled() +{ +#if PLATFORM(MAC) && !PLATFORM(IOS) + return objc_collectingEnabled(); +#else + return false; +#endif +} + +namespace WTF { + +namespace StringWrapperCFAllocator { + + static StringImpl* currentString; + + static const void* retain(const void* info) + { + return info; + } + + NO_RETURN_DUE_TO_ASSERT + static void release(const void*) + { + ASSERT_NOT_REACHED(); + } + + static CFStringRef copyDescription(const void*) + { + return CFSTR("WTF::String-based allocator"); + } + + static void* allocate(CFIndex size, CFOptionFlags, void*) + { + StringImpl* underlyingString = 0; + if (isMainThread()) { + underlyingString = currentString; + if (underlyingString) { + currentString = 0; + underlyingString->ref(); // Balanced by call to deref in deallocate below. + } + } + StringImpl** header = static_cast(fastMalloc(sizeof(StringImpl*) + size)); + *header = underlyingString; + return header + 1; + } + + static void* reallocate(void* pointer, CFIndex newSize, CFOptionFlags, void*) + { + size_t newAllocationSize = sizeof(StringImpl*) + newSize; + StringImpl** header = static_cast(pointer) - 1; + ASSERT(!*header); + header = static_cast(fastRealloc(header, newAllocationSize)); + return header + 1; + } + + static void deallocateOnMainThread(void* headerPointer) + { + StringImpl** header = static_cast(headerPointer); + StringImpl* underlyingString = *header; + ASSERT(underlyingString); + underlyingString->deref(); // Balanced by call to ref in allocate above. + fastFree(header); + } + + static void deallocate(void* pointer, void*) + { + StringImpl** header = static_cast(pointer) - 1; + StringImpl* underlyingString = *header; + if (!underlyingString) + fastFree(header); + else { + if (!isMainThread()) + callOnMainThread(deallocateOnMainThread, header); + else { + underlyingString->deref(); // Balanced by call to ref in allocate above. + fastFree(header); + } + } + } + + static CFIndex preferredSize(CFIndex size, CFOptionFlags, void*) + { + // FIXME: If FastMalloc provided a "good size" callback, we'd want to use it here. + // Note that this optimization would help performance for strings created with the + // allocator that are mutable, and those typically are only created by callers who + // make a new string using the old string's allocator, such as some of the call + // sites in CFURL. + return size; + } + + static CFAllocatorRef create() + { + ASSERT(!garbageCollectionEnabled()); + CFAllocatorContext context = { 0, 0, retain, release, copyDescription, allocate, reallocate, deallocate, preferredSize }; + return CFAllocatorCreate(0, &context); + } + + static CFAllocatorRef allocator() + { + static CFAllocatorRef allocator = create(); + return allocator; + } + +} + +RetainPtr StringImpl::createCFString() +{ + // Since garbage collection isn't compatible with custom allocators, we + // can't use the NoCopy variants of CFStringCreate*() when GC is enabled. + if (!m_length || !isMainThread() || garbageCollectionEnabled()) { + if (is8Bit()) + return adoptCF(CFStringCreateWithBytes(0, reinterpret_cast(characters8()), m_length, kCFStringEncodingISOLatin1, false)); + return adoptCF(CFStringCreateWithCharacters(0, reinterpret_cast(characters16()), m_length)); + } + CFAllocatorRef allocator = StringWrapperCFAllocator::allocator(); + + // Put pointer to the StringImpl in a global so the allocator can store it with the CFString. + ASSERT(!StringWrapperCFAllocator::currentString); + StringWrapperCFAllocator::currentString = this; + + CFStringRef string; + if (is8Bit()) + string = CFStringCreateWithBytesNoCopy(allocator, reinterpret_cast(characters8()), m_length, kCFStringEncodingISOLatin1, false, kCFAllocatorNull); + else + string = CFStringCreateWithCharactersNoCopy(allocator, reinterpret_cast(characters16()), m_length, kCFAllocatorNull); + // CoreFoundation might not have to allocate anything, we clear currentString in case we did not execute allocate(). + StringWrapperCFAllocator::currentString = 0; + + return adoptCF(string); +} + +// On StringImpl creation we could check if the allocator is the StringWrapperCFAllocator. +// If it is, then we could find the original StringImpl and just return that. But to +// do that we'd have to compute the offset from CFStringRef to the allocated block; +// the CFStringRef is *not* at the start of an allocated block. Testing shows 1000x +// more calls to createCFString than calls to the create functions with the appropriate +// allocator, so it's probably not urgent optimize that case. + +} + +#endif // USE(CF) diff --git a/WTF/wtf/text/mac/StringImplMac.mm b/WTF/wtf/text/mac/StringImplMac.mm new file mode 100644 index 00000000..1e88b294 --- /dev/null +++ b/WTF/wtf/text/mac/StringImplMac.mm @@ -0,0 +1,34 @@ +/* + * Copyright (C) 2006, 2009 Apple Inc. All rights reserved. + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Library General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Library General Public License for more details. + * + * You should have received a copy of the GNU Library General Public License + * along with this library; see the file COPYING.LIB. If not, write to + * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + * Boston, MA 02110-1301, USA. + * + */ + +#import "config.h" +#import "StringImpl.h" + +#import "ObjcRuntimeExtras.h" +#import "RetainPtr.h" + +namespace WTF { + +StringImpl::operator NSString *() +{ + return CFBridgingRelease(createCFString().leakRef()); +} + +} diff --git a/WTF/wtf/text/mac/StringMac.mm b/WTF/wtf/text/mac/StringMac.mm new file mode 100644 index 00000000..1d279185 --- /dev/null +++ b/WTF/wtf/text/mac/StringMac.mm @@ -0,0 +1,51 @@ +/* + * Copyright (C) 2006 Apple Computer, Inc. + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Library General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Library General Public License for more details. + * + * You should have received a copy of the GNU Library General Public License + * along with this library; see the file COPYING.LIB. If not, write to + * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + * Boston, MA 02110-1301, USA. + * + */ + +#include "config.h" +#include "WTFString.h" + +#include + +namespace WTF { + +String::String(NSString *str) +{ + if (!str) + return; + + CFIndex size = CFStringGetLength(reinterpret_cast(str)); + if (size == 0) + m_impl = StringImpl::empty(); + else { + Vector lcharBuffer(size); + CFIndex usedBufLen; + CFIndex convertedsize = CFStringGetBytes(reinterpret_cast(str), CFRangeMake(0, size), kCFStringEncodingISOLatin1, 0, false, lcharBuffer.data(), size, &usedBufLen); + if ((convertedsize == size) && (usedBufLen == size)) { + m_impl = StringImpl::create(lcharBuffer.data(), size); + return; + } + + Vector ucharBuffer(size); + CFStringGetCharacters(reinterpret_cast(str), CFRangeMake(0, size), ucharBuffer.data()); + m_impl = StringImpl::create(ucharBuffer.data(), size); + } +} + +} diff --git a/WTF/wtf/unicode/Collator.h b/WTF/wtf/unicode/Collator.h index 0f2039ee..913b1378 100644 --- a/WTF/wtf/unicode/Collator.h +++ b/WTF/wtf/unicode/Collator.h @@ -58,11 +58,8 @@ namespace WTF { void releaseCollator(); mutable UCollator* m_collator; #endif - -#if !UCONFIG_NO_COLLATION char* m_locale; bool m_lowerFirst; -#endif }; } diff --git a/WTF/wtf/unicode/CollatorDefault.cpp b/WTF/wtf/unicode/CollatorDefault.cpp index 840ac677..4e81fef7 100644 --- a/WTF/wtf/unicode/CollatorDefault.cpp +++ b/WTF/wtf/unicode/CollatorDefault.cpp @@ -45,7 +45,6 @@ void Collator::setOrderLowerFirst(bool) { } -//OwnPtr Collator::userDefault() HACK std::unique_ptr Collator::userDefault() { return std::make_unique(nullptr); diff --git a/WTF/wtf/unicode/icu/CollatorICU.cpp b/WTF/wtf/unicode/icu/CollatorICU.cpp index 6de6404c..209c0230 100644 --- a/WTF/wtf/unicode/icu/CollatorICU.cpp +++ b/WTF/wtf/unicode/icu/CollatorICU.cpp @@ -31,9 +31,9 @@ #if USE(ICU_UNICODE) && !UCONFIG_NO_COLLATION +#include #include #include -#include #include #include @@ -45,10 +45,16 @@ namespace WTF { static UCollator* cachedCollator; -static Mutex& cachedCollatorMutex() + +static std::mutex& cachedCollatorMutex() { - AtomicallyInitializedStatic(Mutex&, mutex = *new Mutex); - return mutex; + static std::once_flag onceFlag; + static std::mutex* mutex; + std::call_once(onceFlag, []{ + mutex = std::make_unique().release(); + }); + + return *mutex; } Collator::Collator(const char* locale) @@ -104,7 +110,7 @@ void Collator::createCollator() const UErrorCode status = U_ZERO_ERROR; { - Locker lock(cachedCollatorMutex()); + std::lock_guard lock(cachedCollatorMutex()); if (cachedCollator) { const char* cachedCollatorLocale = ucol_getLocaleByType(cachedCollator, ULOC_REQUESTED_LOCALE, &status); ASSERT(U_SUCCESS(status)); @@ -117,7 +123,7 @@ void Collator::createCollator() const if (m_locale && 0 == strcmp(cachedCollatorLocale, m_locale) && ((UCOL_LOWER_FIRST == cachedCollatorLowerFirst && m_lowerFirst) || (UCOL_UPPER_FIRST == cachedCollatorLowerFirst && !m_lowerFirst))) { m_collator = cachedCollator; - cachedCollator = 0; + cachedCollator = nullptr; return; } } @@ -140,11 +146,11 @@ void Collator::createCollator() const void Collator::releaseCollator() { { - Locker lock(cachedCollatorMutex()); + std::lock_guard lock(cachedCollatorMutex()); if (cachedCollator) ucol_close(cachedCollator); cachedCollator = m_collator; - m_collator = 0; + m_collator = nullptr; } } diff --git a/WTF/wtf/unicode/wchar/UnicodeWchar.cpp b/WTF/wtf/unicode/wchar/UnicodeWchar.cpp index f17c0526..dfdc73d0 100644 --- a/WTF/wtf/unicode/wchar/UnicodeWchar.cpp +++ b/WTF/wtf/unicode/wchar/UnicodeWchar.cpp @@ -30,6 +30,7 @@ int unorm_normalize(const UChar*, int32_t, UNormalizationMode, int32_t, UChar*, int32_t, UErrorCode*) { ASSERT_NOT_REACHED(); + return 0; } UCharDirection u_charDirection(UChar32) @@ -82,7 +83,7 @@ int u_memcasecmp(const UChar* a, const UChar* b, int length, unsigned options) return 0; } -template +template static inline int convertWithFunction(UChar* result, int resultLength, const UChar* source, int sourceLength, UErrorCode& status) { UChar* resultIterator = result; @@ -100,15 +101,15 @@ static inline int convertWithFunction(UChar* result, int resultLength, const UCh int u_strFoldCase(UChar* result, int resultLength, const UChar* source, int sourceLength, unsigned options, UErrorCode* status) { ASSERT_UNUSED(options, options == U_FOLD_CASE_DEFAULT); - return convertWithFunction(result, resultLength, source, sourceLength, *status); + return convertWithFunction(result, resultLength, source, sourceLength, *status); } int u_strToLower(UChar* result, int resultLength, const UChar* source, int sourceLength, const char*, UErrorCode* status) { - return convertWithFunction(result, resultLength, source, sourceLength, *status); + return convertWithFunction(result, resultLength, source, sourceLength, *status); } int u_strToUpper(UChar* result, int resultLength, const UChar* source, int sourceLength, const char*, UErrorCode* status) { - return convertWithFunction(result, resultLength, source, sourceLength, *status); + return convertWithFunction(result, resultLength, source, sourceLength, *status); } diff --git a/WTF/wtf/unicode/wchar/UnicodeWchar.h b/WTF/wtf/unicode/wchar/UnicodeWchar.h index 2206ede8..08212b6c 100644 --- a/WTF/wtf/unicode/wchar/UnicodeWchar.h +++ b/WTF/wtf/unicode/wchar/UnicodeWchar.h @@ -63,7 +63,7 @@ enum UCharDirection { U_BOUNDARY_NEUTRAL }; -enum UDecompositionType { U_DT_NONE, U_DT_COMPAT, U_DT_FONT } +enum UDecompositionType { U_DT_NONE, U_DT_COMPAT, U_DT_FONT }; enum UErrorCode { U_ZERO_ERROR = 0, U_ERROR }; @@ -79,6 +79,7 @@ enum { UNORM_UNICODE_3_2 }; // is implemented, that's not really worth the time. #define U_GC_CC_MASK 0 +#define U_GC_CS_MASK 0 #define U_GC_CF_MASK 0 #define U_GC_CN_MASK 0 #define U_GC_LL_MASK 0 @@ -114,12 +115,14 @@ inline UBlockCode ublock_getCode(UChar32 character) { return (character & ~0xFF) WTF_EXPORT_PRIVATE int unorm_normalize(const UChar* source, int32_t sourceLength, UNormalizationMode mode, int32_t options, UChar* result, int32_t resultLength, UErrorCode* status); WTF_EXPORT_PRIVATE UCharDirection u_charDirection(UChar32); WTF_EXPORT_PRIVATE UChar32 u_charMirror(UChar32); -WTF_EXPORT_PRIVATE UCharCategory u_charType(UChar32); -inline UChar32 u_foldCase(UChar32 character, unsigned option) { ASSERT_UNUSED(options, options == U_FOLD_CASE_DEFAULT); return towlower(character); } +WTF_EXPORT_PRIVATE int8_t u_charType(UChar32); +inline UChar32 u_foldCase(UChar32 character, unsigned options) { ASSERT_UNUSED(options, options == U_FOLD_CASE_DEFAULT); return towlower(character); } WTF_EXPORT_PRIVATE uint8_t u_getCombiningClass(UChar32); WTF_EXPORT_PRIVATE int u_getIntPropertyValue(UChar32, UProperty); inline bool u_isalnum(UChar32 character) { return iswalnum(character); } +inline bool u_isprint(UChar32 character) { return iswprint(character); } inline bool u_ispunct(UChar32 character) { return iswpunct(character); } +inline bool u_isspace(UChar32 character) { return iswspace(character); } WTF_EXPORT_PRIVATE int u_memcasecmp(const UChar*, const UChar*, int sourceLength, unsigned options); inline bool u_print(UChar32 character) { return iswprint(character); } WTF_EXPORT_PRIVATE int u_strFoldCase(UChar* result, int resultLength, const UChar* source, int sourceLength, unsigned options, UErrorCode*); diff --git a/WTF/wtf/win/RunLoopWin.cpp b/WTF/wtf/win/RunLoopWin.cpp new file mode 100644 index 00000000..17bee6f7 --- /dev/null +++ b/WTF/wtf/win/RunLoopWin.cpp @@ -0,0 +1,176 @@ +/* + * Copyright (C) 2010 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. + */ + +#include "config.h" +#include "RunLoop.h" + +#include +#include + +namespace WTF { + +static const UINT PerformWorkMessage = WM_USER + 1; +static const LPWSTR kRunLoopMessageWindowClassName = L"RunLoopMessageWindow"; + +LRESULT CALLBACK RunLoop::RunLoopWndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam) +{ + if (RunLoop* runLoop = static_cast(getWindowPointer(hWnd, 0))) + return runLoop->wndProc(hWnd, message, wParam, lParam); + + if (message == WM_CREATE) { + LPCREATESTRUCT createStruct = reinterpret_cast(lParam); + + // Associate the RunLoop with the window. + setWindowPointer(hWnd, 0, createStruct->lpCreateParams); + return 0; + } + + return ::DefWindowProc(hWnd, message, wParam, lParam); +} + +LRESULT RunLoop::wndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam) +{ + switch (message) { + case PerformWorkMessage: + performWork(); + return 0; + case WM_TIMER: + RunLoop::TimerBase::timerFired(this, wParam); + return 0; + } + + return ::DefWindowProc(hWnd, message, wParam, lParam); +} + +void RunLoop::run() +{ + MSG message; + while (BOOL result = ::GetMessage(&message, 0, 0, 0)) { + if (result == -1) + break; + ::TranslateMessage(&message); + ::DispatchMessage(&message); + } +} + +void RunLoop::stop() +{ + ::PostQuitMessage(0); +} + +bool RunLoop::registerRunLoopMessageWindowClass() +{ + // FIXME: This really only needs to be called once. + + WNDCLASS windowClass = { 0 }; + windowClass.lpfnWndProc = RunLoop::RunLoopWndProc; + windowClass.cbWndExtra = sizeof(RunLoop*); + windowClass.lpszClassName = kRunLoopMessageWindowClassName; + + return !!::RegisterClass(&windowClass); +} + +RunLoop::RunLoop() +{ + registerRunLoopMessageWindowClass(); + + m_runLoopMessageWindow = ::CreateWindow(kRunLoopMessageWindowClassName, 0, 0, + CW_USEDEFAULT, 0, CW_USEDEFAULT, 0, HWND_MESSAGE, 0, 0, this); + ASSERT(::IsWindow(m_runLoopMessageWindow)); +} + +RunLoop::~RunLoop() +{ + // FIXME: Tear down the work item queue here. +} + +void RunLoop::wakeUp() +{ + // FIXME: No need to wake up the run loop if we've already called dispatch + // before the run loop has had the time to respond. + ::PostMessage(m_runLoopMessageWindow, PerformWorkMessage, reinterpret_cast(this), 0); +} + +// RunLoop::Timer + +void RunLoop::TimerBase::timerFired(RunLoop* runLoop, uint64_t ID) +{ + TimerMap::iterator it = runLoop->m_activeTimers.find(ID); + if (it == runLoop->m_activeTimers.end()) { + // The timer must have been stopped after the WM_TIMER message was posted to the message queue. + return; + } + + TimerBase* timer = it->value; + + if (!timer->m_isRepeating) { + runLoop->m_activeTimers.remove(it); + ::KillTimer(runLoop->m_runLoopMessageWindow, ID); + } + + timer->fired(); +} + +static uint64_t generateTimerID() +{ + static uint64_t uniqueTimerID = 1; + return uniqueTimerID++; +} + +RunLoop::TimerBase::TimerBase(RunLoop* runLoop) + : m_runLoop(runLoop) + , m_ID(generateTimerID()) + , m_isRepeating(false) +{ +} + +RunLoop::TimerBase::~TimerBase() +{ + stop(); +} + +void RunLoop::TimerBase::start(double nextFireInterval, bool repeat) +{ + m_isRepeating = repeat; + m_runLoop->m_activeTimers.set(m_ID, this); + ::SetTimer(m_runLoop->m_runLoopMessageWindow, m_ID, nextFireInterval * 1000, 0); +} + +void RunLoop::TimerBase::stop() +{ + TimerMap::iterator it = m_runLoop->m_activeTimers.find(m_ID); + if (it == m_runLoop->m_activeTimers.end()) + return; + + m_runLoop->m_activeTimers.remove(it); + ::KillTimer(m_runLoop->m_runLoopMessageWindow, m_ID); +} + +bool RunLoop::TimerBase::isActive() const +{ + return m_runLoop->m_activeTimers.contains(m_ID); +} + +} // namespace WTF From 76b6b97cec29cb8683e2b3cc14d138888f9c3a86 Mon Sep 17 00:00:00 2001 From: Martijn The Date: Fri, 17 Jan 2014 14:40:13 -0800 Subject: [PATCH 24/69] =?UTF-8?q?-=20Created=20.xcconfig=20files=20from=20?= =?UTF-8?q?phoboslabs=E2=80=99=20configurations=20-=20Disabled=20REMOTE=5F?= =?UTF-8?q?INSPECTOR.=20This=20requires=20XPC=20(still=20private=20in=20iO?= =?UTF-8?q?S=207)=20-=20Duped=20targets=20for=20JavaScriptCore,=20Derived?= =?UTF-8?q?=20Sources=20and=20JSCLLIntOffsetsExtractor,=20but=20using=20th?= =?UTF-8?q?e=20new=20.xcconfig=20files?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- JavaScriptCore-iOS-Static.xcconfig | 27 + .../JavaScriptCore.xcodeproj/project.pbxproj | 2872 +++++++++++++++++ ToolExecutable-iOS-Static.xcconfig | 12 + 3 files changed, 2911 insertions(+) create mode 100644 JavaScriptCore-iOS-Static.xcconfig create mode 100644 ToolExecutable-iOS-Static.xcconfig diff --git a/JavaScriptCore-iOS-Static.xcconfig b/JavaScriptCore-iOS-Static.xcconfig new file mode 100644 index 00000000..52c3ee01 --- /dev/null +++ b/JavaScriptCore-iOS-Static.xcconfig @@ -0,0 +1,27 @@ +// +// JavaScriptCore-iOS-Static.xcconfig +// JavaScriptCore +// +// Created by Martijn The on 1/17/14. +// +// + +#include "JavaScriptCore.xcconfig" + +ARCHS = arm64; +ONLY_ACTIVE_ARCH = NO; +SDKROOT = iphoneos; +VALID_ARCHS = arm64 armv7 i386; +BUILD_VARIANTS = normal; +IPHONEOS_DEPLOYMENT_TARGET = 5.1; +STRIP_INSTALLED_PRODUCT = YES; +OTHER_LDFLAGS = ; +PRODUCT_NAME = JavaScriptCore; +HEADER_SEARCH_PATHS = "${BUILT_PRODUCTS_DIR}/DerivedSources/JavaScriptCore" "${SOURCE_ROOT}/../WTF/" $(HEADER_SEARCH_PATHS); +LIBRARY_SEARCH_PATHS = "${SOURCE_ROOT}/../Build/"; + +GCC_GENERATE_DEBUGGING_SYMBOLS = NO; +GCC_OPTIMIZATION_LEVEL = 3; +GCC_PREPROCESSOR_DEFINITIONS = $(DEBUG_DEFINES) HAVE_DTRACE=$(HAVE_DTRACE) WEBKIT_VERSION_MIN_REQUIRED=WEBKIT_VERSION_LATEST HAVE_HEADER_DETECTION_H JSC_OBJC_API_ENABLED=0 JSC_OBJC_API_AVAILABLE_MAC_OS_X_1080 $(FEATURE_DEFINES) $(GCC_PREPROCESSOR_DEFINITIONS) __MAC_OS_X_VERSION_MIN_REQUIRED=0; + +ENABLE_REMOTE_INSPECTOR = ENABLE_REMOTE_INSPECTOR=0; // Requires XPC diff --git a/JavaScriptCore/JavaScriptCore.xcodeproj/project.pbxproj b/JavaScriptCore/JavaScriptCore.xcodeproj/project.pbxproj index 18b66ea0..90521810 100644 --- a/JavaScriptCore/JavaScriptCore.xcodeproj/project.pbxproj +++ b/JavaScriptCore/JavaScriptCore.xcodeproj/project.pbxproj @@ -16,6 +16,19 @@ name = "LLInt Offsets"; productName = "Derived Sources"; }; + 10D592F61889C55E00C05A0D /* Derived Sources iOS */ = { + isa = PBXAggregateTarget; + buildConfigurationList = 10D592FB1889C55E00C05A0D /* Build configuration list for PBXAggregateTarget "Derived Sources iOS" */; + buildPhases = ( + 10D592F91889C55E00C05A0D /* Generate Derived Sources */, + 10D592FA1889C55E00C05A0D /* Generate DTrace header */, + ); + dependencies = ( + 10D593021889C59100C05A0D /* PBXTargetDependency */, + ); + name = "Derived Sources iOS"; + productName = "Derived Sources"; + }; 5D6B2A47152B9E17005231DE /* Test Tools */ = { isa = PBXAggregateTarget; buildConfigurationList = 5D6B2A4C152B9E17005231DE /* Build configuration list for PBXAggregateTarget "Test Tools" */; @@ -559,6 +572,1243 @@ 0FFFC95E14EF90B700C72532 /* DFGPredictionPropagationPhase.h in Headers */ = {isa = PBXBuildFile; fileRef = 0FFFC95214EF909500C72532 /* DFGPredictionPropagationPhase.h */; settings = {ATTRIBUTES = (Private, ); }; }; 0FFFC95F14EF90BB00C72532 /* DFGVirtualRegisterAllocationPhase.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 0FFFC95314EF909500C72532 /* DFGVirtualRegisterAllocationPhase.cpp */; }; 0FFFC96014EF90BD00C72532 /* DFGVirtualRegisterAllocationPhase.h in Headers */ = {isa = PBXBuildFile; fileRef = 0FFFC95414EF909500C72532 /* DFGVirtualRegisterAllocationPhase.h */; settings = {ATTRIBUTES = (Private, ); }; }; + 10D58E051889C1A000C05A0D /* LLIntOffsetsExtractor.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 0F4680A114BA7F8200BFE272 /* LLIntOffsetsExtractor.cpp */; }; + 10D58E141889C3DF00C05A0D /* A64DOpcode.h in Headers */ = {isa = PBXBuildFile; fileRef = 652A3A231651C69700A80AFE /* A64DOpcode.h */; settings = {ATTRIBUTES = (Private, ); }; }; + 10D58E151889C3DF00C05A0D /* AbstractMacroAssembler.h in Headers */ = {isa = PBXBuildFile; fileRef = 860161DF0F3A83C100F84710 /* AbstractMacroAssembler.h */; settings = {ATTRIBUTES = (Private, ); }; }; + 10D58E161889C3DF00C05A0D /* AbstractPC.h in Headers */ = {isa = PBXBuildFile; fileRef = 0F55F0F214D1063600AC7649 /* AbstractPC.h */; settings = {ATTRIBUTES = (Private, ); }; }; + 10D58E171889C3DF00C05A0D /* APICallbackFunction.h in Headers */ = {isa = PBXBuildFile; fileRef = C211B574176A224D000E2A23 /* APICallbackFunction.h */; }; + 10D58E181889C3DF00C05A0D /* APICast.h in Headers */ = {isa = PBXBuildFile; fileRef = 1482B78A0A4305AB00517CFC /* APICast.h */; settings = {ATTRIBUTES = (Private, ); }; }; + 10D58E191889C3DF00C05A0D /* InspectorJSTypeBuilders.h in Headers */ = {isa = PBXBuildFile; fileRef = A532438618568317002ED692 /* InspectorJSTypeBuilders.h */; settings = {ATTRIBUTES = (Private, ); }; }; + 10D58E1A1889C3DF00C05A0D /* APIShims.h in Headers */ = {isa = PBXBuildFile; fileRef = 865F408710E7D56300947361 /* APIShims.h */; settings = {ATTRIBUTES = (Private, ); }; }; + 10D58E1B1889C3DF00C05A0D /* ArgList.h in Headers */ = {isa = PBXBuildFile; fileRef = BCF605120E203EF800B9A64D /* ArgList.h */; settings = {ATTRIBUTES = (Private, ); }; }; + 10D58E1C1889C3DF00C05A0D /* Arguments.h in Headers */ = {isa = PBXBuildFile; fileRef = BC257DE60E1F51C50016B6C9 /* Arguments.h */; }; + 10D58E1D1889C3DF00C05A0D /* ArgumentsIteratorConstructor.h in Headers */ = {isa = PBXBuildFile; fileRef = A76140C8182982CB00750624 /* ArgumentsIteratorConstructor.h */; }; + 10D58E1E1889C3DF00C05A0D /* ArgumentsIteratorPrototype.h in Headers */ = {isa = PBXBuildFile; fileRef = A76140CA182982CB00750624 /* ArgumentsIteratorPrototype.h */; }; + 10D58E1F1889C3DF00C05A0D /* ARMAssembler.h in Headers */ = {isa = PBXBuildFile; fileRef = 86D3B2C010156BDE002865E7 /* ARMAssembler.h */; settings = {ATTRIBUTES = (Private, ); }; }; + 10D58E201889C3DF00C05A0D /* ARMv7Assembler.h in Headers */ = {isa = PBXBuildFile; fileRef = 86ADD1430FDDEA980006EEC2 /* ARMv7Assembler.h */; settings = {ATTRIBUTES = (Private, ); }; }; + 10D58E211889C3DF00C05A0D /* InspectorAgent.h in Headers */ = {isa = PBXBuildFile; fileRef = A5CEEE13187F3BAD00E55C99 /* InspectorAgent.h */; settings = {ATTRIBUTES = (Private, ); }; }; + 10D58E221889C3DF00C05A0D /* ARMv7DOpcode.h in Headers */ = {isa = PBXBuildFile; fileRef = 65C0285B1717966800351E35 /* ARMv7DOpcode.h */; }; + 10D58E231889C3DF00C05A0D /* CopyWriteBarrier.h in Headers */ = {isa = PBXBuildFile; fileRef = 2A68295A1875F80500B6C3E2 /* CopyWriteBarrier.h */; settings = {ATTRIBUTES = (Private, ); }; }; + 10D58E241889C3DF00C05A0D /* WriteBarrierBuffer.h in Headers */ = {isa = PBXBuildFile; fileRef = 2A4EC90A1860D6C20094F782 /* WriteBarrierBuffer.h */; settings = {ATTRIBUTES = (Private, ); }; }; + 10D58E251889C3DF00C05A0D /* VMEntryScope.h in Headers */ = {isa = PBXBuildFile; fileRef = FE5932A6183C5A2600A1ECCC /* VMEntryScope.h */; settings = {ATTRIBUTES = (Private, ); }; }; + 10D58E261889C3DF00C05A0D /* CodeGeneratorInspectorStrings.py in Headers */ = {isa = PBXBuildFile; fileRef = A5324390185696E6002ED692 /* CodeGeneratorInspectorStrings.py */; settings = {ATTRIBUTES = (Private, ); }; }; + 10D58E271889C3DF00C05A0D /* CodeGeneratorInspector.py in Headers */ = {isa = PBXBuildFile; fileRef = A532438F185696E6002ED692 /* CodeGeneratorInspector.py */; settings = {ATTRIBUTES = (Private, ); }; }; + 10D58E281889C3DF00C05A0D /* TempRegisterSet.h in Headers */ = {isa = PBXBuildFile; fileRef = 0F24E54817EE274900ABB217 /* TempRegisterSet.h */; settings = {ATTRIBUTES = (Private, ); }; }; + 10D58E291889C3DF00C05A0D /* DFGFiltrationResult.h in Headers */ = {isa = PBXBuildFile; fileRef = A7BFF3BF179868940002F462 /* DFGFiltrationResult.h */; settings = {ATTRIBUTES = (Private, ); }; }; + 10D58E2A1889C3DF00C05A0D /* cssmin.py in Headers */ = {isa = PBXBuildFile; fileRef = A5840E26187C980700843B10 /* cssmin.py */; settings = {ATTRIBUTES = (Private, ); }; }; + 10D58E2B1889C3DF00C05A0D /* BytecodeBasicBlock.h in Headers */ = {isa = PBXBuildFile; fileRef = C2FCAE0D17A9C24E0034C735 /* BytecodeBasicBlock.h */; settings = {ATTRIBUTES = (Private, ); }; }; + 10D58E2C1889C3DF00C05A0D /* generate-combined-inspector-json.py in Headers */ = {isa = PBXBuildFile; fileRef = A5324391185696E6002ED692 /* generate-combined-inspector-json.py */; settings = {ATTRIBUTES = (Private, ); }; }; + 10D58E2D1889C3DF00C05A0D /* BytecodeLivenessAnalysis.h in Headers */ = {isa = PBXBuildFile; fileRef = C2FCAE0F17A9C24E0034C735 /* BytecodeLivenessAnalysis.h */; settings = {ATTRIBUTES = (Private, ); }; }; + 10D58E2E1889C3DF00C05A0D /* ArrayAllocationProfile.h in Headers */ = {isa = PBXBuildFile; fileRef = 0F8335B51639C1E3001443B5 /* ArrayAllocationProfile.h */; settings = {ATTRIBUTES = (Private, ); }; }; + 10D58E2F1889C3DF00C05A0D /* inline-and-minify-stylesheets-and-scripts.py in Headers */ = {isa = PBXBuildFile; fileRef = A5840E28187CA5B800843B10 /* inline-and-minify-stylesheets-and-scripts.py */; settings = {ATTRIBUTES = (Private, ); }; }; + 10D58E301889C3DF00C05A0D /* jsmin.py in Headers */ = {isa = PBXBuildFile; fileRef = A513E5C4185F92DC007E95AD /* jsmin.py */; settings = {ATTRIBUTES = (Private, ); }; }; + 10D58E311889C3DF00C05A0D /* InspectorJS.json in Headers */ = {isa = PBXBuildFile; fileRef = A53243951856A475002ED692 /* InspectorJS.json */; settings = {ATTRIBUTES = (Private, ); }; }; + 10D58E321889C3DF00C05A0D /* xxd.pl in Headers */ = {isa = PBXBuildFile; fileRef = A513E5C5185F92F0007E95AD /* xxd.pl */; settings = {ATTRIBUTES = (Private, ); }; }; + 10D58E331889C3DF00C05A0D /* Breakpoint.h in Headers */ = {isa = PBXBuildFile; fileRef = FEA0861E182B7A0400F6D851 /* Breakpoint.h */; settings = {ATTRIBUTES = (Private, ); }; }; + 10D58E341889C3DF00C05A0D /* ArrayBuffer.h in Headers */ = {isa = PBXBuildFile; fileRef = A7A8AF2617ADB5F3005AB174 /* ArrayBuffer.h */; settings = {ATTRIBUTES = (Private, ); }; }; + 10D58E351889C3DF00C05A0D /* DebuggerPrimitives.h in Headers */ = {isa = PBXBuildFile; fileRef = FEA0861F182B7A0400F6D851 /* DebuggerPrimitives.h */; settings = {ATTRIBUTES = (Private, ); }; }; + 10D58E361889C3DF00C05A0D /* ArrayBufferView.h in Headers */ = {isa = PBXBuildFile; fileRef = A7A8AF2817ADB5F3005AB174 /* ArrayBufferView.h */; settings = {ATTRIBUTES = (Private, ); }; }; + 10D58E371889C3DF00C05A0D /* ArrayConstructor.h in Headers */ = {isa = PBXBuildFile; fileRef = BC7952070E15E8A800A898AB /* ArrayConstructor.h */; }; + 10D58E381889C3DF00C05A0D /* ArrayConventions.h in Headers */ = {isa = PBXBuildFile; fileRef = 0FB7F38915ED8E3800F167B2 /* ArrayConventions.h */; settings = {ATTRIBUTES = (Private, ); }; }; + 10D58E391889C3DF00C05A0D /* ArrayIteratorConstructor.h in Headers */ = {isa = PBXBuildFile; fileRef = A7BDAEC117F4EA1400F6140C /* ArrayIteratorConstructor.h */; }; + 10D58E3A1889C3DF00C05A0D /* ArrayIteratorPrototype.h in Headers */ = {isa = PBXBuildFile; fileRef = A7BDAEC317F4EA1400F6140C /* ArrayIteratorPrototype.h */; }; + 10D58E3B1889C3DF00C05A0D /* ArrayProfile.h in Headers */ = {isa = PBXBuildFile; fileRef = 0F63945215D07051006A597C /* ArrayProfile.h */; settings = {ATTRIBUTES = (Private, ); }; }; + 10D58E3C1889C3DF00C05A0D /* ArrayPrototype.h in Headers */ = {isa = PBXBuildFile; fileRef = F692A84E0255597D01FF60F7 /* ArrayPrototype.h */; settings = {ATTRIBUTES = (Private, ); }; }; + 10D58E3D1889C3DF00C05A0D /* ArrayPrototype.lut.h in Headers */ = {isa = PBXBuildFile; fileRef = BC18C5230E16FC8A00B34460 /* ArrayPrototype.lut.h */; }; + 10D58E3E1889C3DF00C05A0D /* ArrayStorage.h in Headers */ = {isa = PBXBuildFile; fileRef = 0FB7F38A15ED8E3800F167B2 /* ArrayStorage.h */; settings = {ATTRIBUTES = (Private, ); }; }; + 10D58E3F1889C3DF00C05A0D /* AssemblerBuffer.h in Headers */ = {isa = PBXBuildFile; fileRef = 9688CB130ED12B4E001D649F /* AssemblerBuffer.h */; settings = {ATTRIBUTES = (Private, ); }; }; + 10D58E401889C3DF00C05A0D /* AssemblerBufferWithConstantPool.h in Headers */ = {isa = PBXBuildFile; fileRef = 86D3B2C110156BDE002865E7 /* AssemblerBufferWithConstantPool.h */; settings = {ATTRIBUTES = (Private, ); }; }; + 10D58E411889C3DF00C05A0D /* AssemblyHelpers.h in Headers */ = {isa = PBXBuildFile; fileRef = 0F24E53C17EA9F5900ABB217 /* AssemblyHelpers.h */; settings = {ATTRIBUTES = (Private, ); }; }; + 10D58E421889C3DF00C05A0D /* ASTBuilder.h in Headers */ = {isa = PBXBuildFile; fileRef = A7A7EE7411B98B8D0065A14F /* ASTBuilder.h */; settings = {ATTRIBUTES = (Private, ); }; }; + 10D58E431889C3DF00C05A0D /* BatchedTransitionOptimizer.h in Headers */ = {isa = PBXBuildFile; fileRef = 147B83AA0E6DB8C9004775A4 /* BatchedTransitionOptimizer.h */; }; + 10D58E441889C3DF00C05A0D /* BigInteger.h in Headers */ = {isa = PBXBuildFile; fileRef = 866739D013BFDE710023D87C /* BigInteger.h */; }; + 10D58E451889C3DF00C05A0D /* BlockAllocator.h in Headers */ = {isa = PBXBuildFile; fileRef = 14816E1A154CC56C00B8054C /* BlockAllocator.h */; settings = {ATTRIBUTES = (Private, ); }; }; + 10D58E461889C3DF00C05A0D /* BooleanObject.h in Headers */ = {isa = PBXBuildFile; fileRef = 704FD35305697E6D003DBED9 /* BooleanObject.h */; settings = {ATTRIBUTES = (Private, ); }; }; + 10D58E471889C3DF00C05A0D /* RemoteInspectorConstants.h in Headers */ = {isa = PBXBuildFile; fileRef = A5BA15E3182340B300A82E69 /* RemoteInspectorConstants.h */; settings = {ATTRIBUTES = (Private, ); }; }; + 10D58E481889C3DF00C05A0D /* Butterfly.h in Headers */ = {isa = PBXBuildFile; fileRef = 0FB7F38B15ED8E3800F167B2 /* Butterfly.h */; settings = {ATTRIBUTES = (Private, ); }; }; + 10D58E491889C3DF00C05A0D /* ButterflyInlines.h in Headers */ = {isa = PBXBuildFile; fileRef = 0FB7F38C15ED8E3800F167B2 /* ButterflyInlines.h */; settings = {ATTRIBUTES = (Private, ); }; }; + 10D58E4A1889C3DF00C05A0D /* BytecodeConventions.h in Headers */ = {isa = PBXBuildFile; fileRef = 0F21C27E14BEAA8000ADC64B /* BytecodeConventions.h */; settings = {ATTRIBUTES = (Private, ); }; }; + 10D58E4B1889C3DF00C05A0D /* BytecodeGenerator.h in Headers */ = {isa = PBXBuildFile; fileRef = 969A07210ED1CE3300F1F681 /* BytecodeGenerator.h */; }; + 10D58E4C1889C3DF00C05A0D /* ByValInfo.h in Headers */ = {isa = PBXBuildFile; fileRef = 0F8023E91613832300A0BA45 /* ByValInfo.h */; settings = {ATTRIBUTES = (Private, ); }; }; + 10D58E4D1889C3DF00C05A0D /* CallData.h in Headers */ = {isa = PBXBuildFile; fileRef = 145C507F0D9DF63B0088F6B9 /* CallData.h */; settings = {ATTRIBUTES = (Private, ); }; }; + 10D58E4E1889C3DF00C05A0D /* CallFrame.h in Headers */ = {isa = PBXBuildFile; fileRef = 1429D8DC0ED2205B00B89619 /* CallFrame.h */; settings = {ATTRIBUTES = (Private, ); }; }; + 10D58E4F1889C3DF00C05A0D /* CallFrameInlines.h in Headers */ = {isa = PBXBuildFile; fileRef = A7C1EAEA17987AB600299DB2 /* CallFrameInlines.h */; settings = {ATTRIBUTES = (Private, ); }; }; + 10D58E501889C3DF00C05A0D /* CallIdentifier.h in Headers */ = {isa = PBXBuildFile; fileRef = 95E3BC040E1AE68200B2D1C1 /* CallIdentifier.h */; settings = {ATTRIBUTES = (Private, ); }; }; + 10D58E511889C3DF00C05A0D /* CallLinkInfo.h in Headers */ = {isa = PBXBuildFile; fileRef = 0F0B83AF14BCF71400885B4F /* CallLinkInfo.h */; settings = {ATTRIBUTES = (Private, ); }; }; + 10D58E521889C3DF00C05A0D /* CallLinkStatus.h in Headers */ = {isa = PBXBuildFile; fileRef = 0F93329414CA7DC10085F3C6 /* CallLinkStatus.h */; settings = {ATTRIBUTES = (Private, ); }; }; + 10D58E531889C3DF00C05A0D /* CallReturnOffsetToBytecodeOffset.h in Headers */ = {isa = PBXBuildFile; fileRef = 0F0B83B814BCF95B00885B4F /* CallReturnOffsetToBytecodeOffset.h */; settings = {ATTRIBUTES = (Private, ); }; }; + 10D58E541889C3DF00C05A0D /* CCallHelpers.h in Headers */ = {isa = PBXBuildFile; fileRef = 0F24E53D17EA9F5900ABB217 /* CCallHelpers.h */; settings = {ATTRIBUTES = (Private, ); }; }; + 10D58E551889C3DF00C05A0D /* ClassInfo.h in Headers */ = {isa = PBXBuildFile; fileRef = BC6AAAE40E1F426500AD87D8 /* ClassInfo.h */; settings = {ATTRIBUTES = (Private, ); }; }; + 10D58E561889C3DF00C05A0D /* ClosureCallStubRoutine.h in Headers */ = {isa = PBXBuildFile; fileRef = 0F73D7AC165A142A00ACAB71 /* ClosureCallStubRoutine.h */; settings = {ATTRIBUTES = (Private, ); }; }; + 10D58E571889C3DF00C05A0D /* CodeBlock.h in Headers */ = {isa = PBXBuildFile; fileRef = 969A07910ED1D3AE00F1F681 /* CodeBlock.h */; settings = {ATTRIBUTES = (Private, ); }; }; + 10D58E581889C3DF00C05A0D /* CodeBlockHash.h in Headers */ = {isa = PBXBuildFile; fileRef = 0F8F943E1667632D00D61971 /* CodeBlockHash.h */; settings = {ATTRIBUTES = (Private, ); }; }; + 10D58E591889C3DF00C05A0D /* CodeBlockJettisoningWatchpoint.h in Headers */ = {isa = PBXBuildFile; fileRef = 0FC97F30182020D7002C9B26 /* CodeBlockJettisoningWatchpoint.h */; settings = {ATTRIBUTES = (Private, ); }; }; + 10D58E5A1889C3DF00C05A0D /* CodeBlockSet.h in Headers */ = {isa = PBXBuildFile; fileRef = 0FD8A31217D4326C00CA2C40 /* CodeBlockSet.h */; settings = {ATTRIBUTES = (Private, ); }; }; + 10D58E5B1889C3DF00C05A0D /* CodeBlockWithJITType.h in Headers */ = {isa = PBXBuildFile; fileRef = 0F96EBB116676EF4008BADE3 /* CodeBlockWithJITType.h */; settings = {ATTRIBUTES = (Private, ); }; }; + 10D58E5C1889C3DF00C05A0D /* CodeCache.h in Headers */ = {isa = PBXBuildFile; fileRef = A77F1820164088B200640A47 /* CodeCache.h */; settings = {ATTRIBUTES = (Private, ); }; }; + 10D58E5D1889C3DF00C05A0D /* CodeLocation.h in Headers */ = {isa = PBXBuildFile; fileRef = 86E116B00FE75AC800B512BC /* CodeLocation.h */; settings = {ATTRIBUTES = (Private, ); }; }; + 10D58E5E1889C3DF00C05A0D /* CodeOrigin.h in Headers */ = {isa = PBXBuildFile; fileRef = 0FBD7E671447998F00481315 /* CodeOrigin.h */; settings = {ATTRIBUTES = (Private, ); }; }; + 10D58E5F1889C3DF00C05A0D /* CodeSpecializationKind.h in Headers */ = {isa = PBXBuildFile; fileRef = 0F21C27914BE727300ADC64B /* CodeSpecializationKind.h */; settings = {ATTRIBUTES = (Private, ); }; }; + 10D58E601889C3DF00C05A0D /* CodeType.h in Headers */ = {isa = PBXBuildFile; fileRef = 0F0B83A514BCF50400885B4F /* CodeType.h */; settings = {ATTRIBUTES = (Private, ); }; }; + 10D58E611889C3DF00C05A0D /* CommonIdentifiers.h in Headers */ = {isa = PBXBuildFile; fileRef = 65EA73630BAE35D1001BB560 /* CommonIdentifiers.h */; settings = {ATTRIBUTES = (Private, ); }; }; + 10D58E621889C3DF00C05A0D /* CommonSlowPaths.h in Headers */ = {isa = PBXBuildFile; fileRef = 0F15F15D14B7A73A005DE37D /* CommonSlowPaths.h */; settings = {ATTRIBUTES = (Private, ); }; }; + 10D58E631889C3DF00C05A0D /* CommonSlowPathsExceptions.h in Headers */ = {isa = PBXBuildFile; fileRef = 6553A33017A1F1EE008CF6F3 /* CommonSlowPathsExceptions.h */; }; + 10D58E641889C3DF00C05A0D /* CompactJITCodeMap.h in Headers */ = {isa = PBXBuildFile; fileRef = 0FD82E37141AB14200179C94 /* CompactJITCodeMap.h */; settings = {ATTRIBUTES = (Private, ); }; }; + 10D58E651889C3DF00C05A0D /* CompilationResult.h in Headers */ = {isa = PBXBuildFile; fileRef = A7E5A3A61797432D00E893C0 /* CompilationResult.h */; settings = {ATTRIBUTES = (Private, ); }; }; + 10D58E661889C3DF00C05A0D /* Completion.h in Headers */ = {isa = PBXBuildFile; fileRef = F5BB2BC5030F772101FCFE1D /* Completion.h */; settings = {ATTRIBUTES = (Private, ); }; }; + 10D58E671889C3DF00C05A0D /* ConcurrentJITLock.h in Headers */ = {isa = PBXBuildFile; fileRef = 0FDB2CE9174896C7007B3C1B /* ConcurrentJITLock.h */; settings = {ATTRIBUTES = (Private, ); }; }; + 10D58E681889C3DF00C05A0D /* JSInjectedScriptHostPrototype.h in Headers */ = {isa = PBXBuildFile; fileRef = A513E5BD185BFACC007E95AD /* JSInjectedScriptHostPrototype.h */; }; + 10D58E691889C3DF00C05A0D /* config.h in Headers */ = {isa = PBXBuildFile; fileRef = F68EBB8C0255D4C601FF60F7 /* config.h */; settings = {ATTRIBUTES = (Private, ); }; }; + 10D58E6A1889C3DF00C05A0D /* ConservativeRoots.h in Headers */ = {isa = PBXBuildFile; fileRef = 149DAAF212EB559D0083B12B /* ConservativeRoots.h */; settings = {ATTRIBUTES = (Private, ); }; }; + 10D58E6B1889C3DF00C05A0D /* ConstructData.h in Headers */ = {isa = PBXBuildFile; fileRef = BC8F3CCF0DAF17BA00577A80 /* ConstructData.h */; settings = {ATTRIBUTES = (Private, ); }; }; + 10D58E6C1889C3DF00C05A0D /* CopiedAllocator.h in Headers */ = {isa = PBXBuildFile; fileRef = C2EAD2FB14F0249800A4B159 /* CopiedAllocator.h */; settings = {ATTRIBUTES = (Private, ); }; }; + 10D58E6D1889C3DF00C05A0D /* CopiedBlock.h in Headers */ = {isa = PBXBuildFile; fileRef = C2C8D02E14A3CEFC00578E65 /* CopiedBlock.h */; settings = {ATTRIBUTES = (Private, ); }; }; + 10D58E6E1889C3DF00C05A0D /* CopiedBlockInlines.h in Headers */ = {isa = PBXBuildFile; fileRef = C2FC9BD216644DFB00810D33 /* CopiedBlockInlines.h */; settings = {ATTRIBUTES = (Private, ); }; }; + 10D58E6F1889C3DF00C05A0D /* CopiedSpace.h in Headers */ = {isa = PBXBuildFile; fileRef = C2EAA3F8149A830800FCE112 /* CopiedSpace.h */; settings = {ATTRIBUTES = (Private, ); }; }; + 10D58E701889C3DF00C05A0D /* CopiedSpaceInlines.h in Headers */ = {isa = PBXBuildFile; fileRef = C2C8D02B14A3C6B200578E65 /* CopiedSpaceInlines.h */; settings = {ATTRIBUTES = (Private, ); }; }; + 10D58E711889C3DF00C05A0D /* CopyToken.h in Headers */ = {isa = PBXBuildFile; fileRef = 0F5A52CF17ADD717008ECB2D /* CopyToken.h */; settings = {ATTRIBUTES = (Private, ); }; }; + 10D58E721889C3DF00C05A0D /* CopyVisitor.h in Headers */ = {isa = PBXBuildFile; fileRef = C2239D1316262BDD005AC5FD /* CopyVisitor.h */; settings = {ATTRIBUTES = (Private, ); }; }; + 10D58E731889C3DF00C05A0D /* CopyVisitorInlines.h in Headers */ = {isa = PBXBuildFile; fileRef = C2239D1416262BDD005AC5FD /* CopyVisitorInlines.h */; settings = {ATTRIBUTES = (Private, ); }; }; + 10D58E741889C3DF00C05A0D /* CopyWorkList.h in Headers */ = {isa = PBXBuildFile; fileRef = C218D13F1655CFD50062BB81 /* CopyWorkList.h */; settings = {ATTRIBUTES = (Private, ); }; }; + 10D58E751889C3DF00C05A0D /* create_hash_table in Headers */ = {isa = PBXBuildFile; fileRef = F692A8540255597D01FF60F7 /* create_hash_table */; settings = {ATTRIBUTES = (); }; }; + 10D58E761889C3DF00C05A0D /* DataFormat.h in Headers */ = {isa = PBXBuildFile; fileRef = 0F426A4A1460CD6B00131F8F /* DataFormat.h */; settings = {ATTRIBUTES = (Private, ); }; }; + 10D58E771889C3DF00C05A0D /* DataView.h in Headers */ = {isa = PBXBuildFile; fileRef = 0F2B66B117B6B5AB00A7AE3F /* DataView.h */; settings = {ATTRIBUTES = (Private, ); }; }; + 10D58E781889C3DF00C05A0D /* DateConstructor.h in Headers */ = {isa = PBXBuildFile; fileRef = BCD203460E17135E002C7E82 /* DateConstructor.h */; }; + 10D58E791889C3DF00C05A0D /* DateConversion.h in Headers */ = {isa = PBXBuildFile; fileRef = D21202290AD4310C00ED79B6 /* DateConversion.h */; }; + 10D58E7A1889C3DF00C05A0D /* InspectorAgentBase.h in Headers */ = {isa = PBXBuildFile; fileRef = A593CF7E1840362C00BFCE27 /* InspectorAgentBase.h */; settings = {ATTRIBUTES = (Private, ); }; }; + 10D58E7B1889C3DF00C05A0D /* DateInstance.h in Headers */ = {isa = PBXBuildFile; fileRef = BC1166010E1997B1008066DD /* DateInstance.h */; settings = {ATTRIBUTES = (Private, ); }; }; + 10D58E7C1889C3DF00C05A0D /* DateInstanceCache.h in Headers */ = {isa = PBXBuildFile; fileRef = 14A1563010966365006FA260 /* DateInstanceCache.h */; settings = {ATTRIBUTES = (Private, ); }; }; + 10D58E7D1889C3DF00C05A0D /* DatePrototype.h in Headers */ = {isa = PBXBuildFile; fileRef = BCD203480E17135E002C7E82 /* DatePrototype.h */; }; + 10D58E7E1889C3DF00C05A0D /* DatePrototype.lut.h in Headers */ = {isa = PBXBuildFile; fileRef = BCD203E70E1718F4002C7E82 /* DatePrototype.lut.h */; }; + 10D58E7F1889C3DF00C05A0D /* Debugger.h in Headers */ = {isa = PBXBuildFile; fileRef = F692A8590255597D01FF60F7 /* Debugger.h */; settings = {ATTRIBUTES = (Private, ); }; }; + 10D58E801889C3DF00C05A0D /* DebuggerActivation.h in Headers */ = {isa = PBXBuildFile; fileRef = BC3135620F302FA3003DFD3A /* DebuggerActivation.h */; settings = {ATTRIBUTES = (Private, ); }; }; + 10D58E811889C3DF00C05A0D /* DebuggerCallFrame.h in Headers */ = {isa = PBXBuildFile; fileRef = 1480DB9B0DDC227F003CFDF2 /* DebuggerCallFrame.h */; settings = {ATTRIBUTES = (Private, ); }; }; + 10D58E821889C3DF00C05A0D /* DeferGC.h in Headers */ = {isa = PBXBuildFile; fileRef = 0F136D4B174AD69B0075B354 /* DeferGC.h */; settings = {ATTRIBUTES = (Private, ); }; }; + 10D58E831889C3DF00C05A0D /* BytecodeUseDef.h in Headers */ = {isa = PBXBuildFile; fileRef = 0F885E101849A3BE00F1E3FA /* BytecodeUseDef.h */; settings = {ATTRIBUTES = (Private, ); }; }; + 10D58E841889C3DF00C05A0D /* DeferredCompilationCallback.h in Headers */ = {isa = PBXBuildFile; fileRef = 0FC712DD17CD8778008CC93C /* DeferredCompilationCallback.h */; settings = {ATTRIBUTES = (Private, ); }; }; + 10D58E851889C3DF00C05A0D /* DFGAbstractHeap.h in Headers */ = {isa = PBXBuildFile; fileRef = A77A423717A0BBFD00A8DB81 /* DFGAbstractHeap.h */; settings = {ATTRIBUTES = (Private, ); }; }; + 10D58E861889C3DF00C05A0D /* DFGAbstractInterpreter.h in Headers */ = {isa = PBXBuildFile; fileRef = A704D8FE17A0BAA8006BA554 /* DFGAbstractInterpreter.h */; settings = {ATTRIBUTES = (Private, ); }; }; + 10D58E871889C3DF00C05A0D /* DFGAbstractInterpreterInlines.h in Headers */ = {isa = PBXBuildFile; fileRef = A704D8FF17A0BAA8006BA554 /* DFGAbstractInterpreterInlines.h */; settings = {ATTRIBUTES = (Private, ); }; }; + 10D58E881889C3DF00C05A0D /* DFGAbstractValue.h in Headers */ = {isa = PBXBuildFile; fileRef = 0F62016F143FCD2F0068B77C /* DFGAbstractValue.h */; settings = {ATTRIBUTES = (Private, ); }; }; + 10D58E891889C3DF00C05A0D /* DFGAdjacencyList.h in Headers */ = {isa = PBXBuildFile; fileRef = 0F66E16814DF3F1300B7B2E4 /* DFGAdjacencyList.h */; settings = {ATTRIBUTES = (Private, ); }; }; + 10D58E8A1889C3DF00C05A0D /* DFGAllocator.h in Headers */ = {isa = PBXBuildFile; fileRef = 0FB4B51916B62772003F696B /* DFGAllocator.h */; settings = {ATTRIBUTES = (Private, ); }; }; + 10D58E8B1889C3DF00C05A0D /* DFGAnalysis.h in Headers */ = {isa = PBXBuildFile; fileRef = A73781091799EA2E00817533 /* DFGAnalysis.h */; settings = {ATTRIBUTES = (Private, ); }; }; + 10D58E8C1889C3DF00C05A0D /* DFGArgumentPosition.h in Headers */ = {isa = PBXBuildFile; fileRef = 0F1E3A431534CBAD000F9456 /* DFGArgumentPosition.h */; settings = {ATTRIBUTES = (Private, ); }; }; + 10D58E8D1889C3DF00C05A0D /* DFGArgumentsSimplificationPhase.h in Headers */ = {isa = PBXBuildFile; fileRef = 0F16015B156198BF00C2587C /* DFGArgumentsSimplificationPhase.h */; settings = {ATTRIBUTES = (Private, ); }; }; + 10D58E8E1889C3DF00C05A0D /* DFGArrayifySlowPathGenerator.h in Headers */ = {isa = PBXBuildFile; fileRef = 0F05C3B21683CF8F00BAF45B /* DFGArrayifySlowPathGenerator.h */; settings = {ATTRIBUTES = (Private, ); }; }; + 10D58E8F1889C3DF00C05A0D /* DFGArrayMode.h in Headers */ = {isa = PBXBuildFile; fileRef = 0F63948215E48114006A597C /* DFGArrayMode.h */; settings = {ATTRIBUTES = (Private, ); }; }; + 10D58E901889C3DF00C05A0D /* RemoteInspectorDebuggableConnection.h in Headers */ = {isa = PBXBuildFile; fileRef = A5BA15E4182340B300A82E69 /* RemoteInspectorDebuggableConnection.h */; }; + 10D58E911889C3DF00C05A0D /* DFGAtTailAbstractState.h in Headers */ = {isa = PBXBuildFile; fileRef = A7D9A29017A0BC7400EE2618 /* DFGAtTailAbstractState.h */; settings = {ATTRIBUTES = (Private, ); }; }; + 10D58E921889C3DF00C05A0D /* DFGBackwardsPropagationPhase.h in Headers */ = {isa = PBXBuildFile; fileRef = 0F714CA216EA92ED00F3EBEB /* DFGBackwardsPropagationPhase.h */; settings = {ATTRIBUTES = (Private, ); }; }; + 10D58E931889C3DF00C05A0D /* DFGBasicBlock.h in Headers */ = {isa = PBXBuildFile; fileRef = 0F620170143FCD2F0068B77C /* DFGBasicBlock.h */; settings = {ATTRIBUTES = (Private, ); }; }; + 10D58E941889C3DF00C05A0D /* DFGBasicBlockInlines.h in Headers */ = {isa = PBXBuildFile; fileRef = 0FD5652216AB780A00197653 /* DFGBasicBlockInlines.h */; settings = {ATTRIBUTES = (Private, ); }; }; + 10D58E951889C3DF00C05A0D /* DFGBinarySwitch.h in Headers */ = {isa = PBXBuildFile; fileRef = A70B083117A0B79B00DAF14B /* DFGBinarySwitch.h */; }; + 10D58E961889C3DF00C05A0D /* DFGBlockInsertionSet.h in Headers */ = {isa = PBXBuildFile; fileRef = A7D89CE517A0B8CC00773AD8 /* DFGBlockInsertionSet.h */; settings = {ATTRIBUTES = (Private, ); }; }; + 10D58E971889C3DF00C05A0D /* DFGBranchDirection.h in Headers */ = {isa = PBXBuildFile; fileRef = 0F8364B5164B0C0E0053329A /* DFGBranchDirection.h */; settings = {ATTRIBUTES = (Private, ); }; }; + 10D58E981889C3DF00C05A0D /* MacroAssemblerARM64.h in Headers */ = {isa = PBXBuildFile; fileRef = 8640923C156EED3B00566CB2 /* MacroAssemblerARM64.h */; settings = {ATTRIBUTES = (Private, ); }; }; + 10D58E991889C3DF00C05A0D /* DFGByteCodeParser.h in Headers */ = {isa = PBXBuildFile; fileRef = 86EC9DB51328DF82002B2AD7 /* DFGByteCodeParser.h */; settings = {ATTRIBUTES = (Private, ); }; }; + 10D58E9A1889C3DF00C05A0D /* InspectorAgentRegistry.h in Headers */ = {isa = PBXBuildFile; fileRef = A593CF85184038CA00BFCE27 /* InspectorAgentRegistry.h */; settings = {ATTRIBUTES = (Private, ); }; }; + 10D58E9B1889C3DF00C05A0D /* DFGCallArrayAllocatorSlowPathGenerator.h in Headers */ = {isa = PBXBuildFile; fileRef = 0F256C341627B0AA007F2783 /* DFGCallArrayAllocatorSlowPathGenerator.h */; settings = {ATTRIBUTES = (Private, ); }; }; + 10D58E9C1889C3DF00C05A0D /* DFGCapabilities.h in Headers */ = {isa = PBXBuildFile; fileRef = 0FD82E1F14172C2F00179C94 /* DFGCapabilities.h */; settings = {ATTRIBUTES = (Private, ); }; }; + 10D58E9D1889C3DF00C05A0D /* DFGCFAPhase.h in Headers */ = {isa = PBXBuildFile; fileRef = 0FFFC94C14EF909500C72532 /* DFGCFAPhase.h */; settings = {ATTRIBUTES = (Private, ); }; }; + 10D58E9E1889C3DF00C05A0D /* DFGCFGSimplificationPhase.h in Headers */ = {isa = PBXBuildFile; fileRef = 0F3B3A251544C991003ED0FF /* DFGCFGSimplificationPhase.h */; settings = {ATTRIBUTES = (Private, ); }; }; + 10D58E9F1889C3DF00C05A0D /* DFGClobberize.h in Headers */ = {isa = PBXBuildFile; fileRef = A77A423917A0BBFD00A8DB81 /* DFGClobberize.h */; settings = {ATTRIBUTES = (Private, ); }; }; + 10D58EA01889C3DF00C05A0D /* DFGClobberSet.h in Headers */ = {isa = PBXBuildFile; fileRef = A77A423B17A0BBFD00A8DB81 /* DFGClobberSet.h */; settings = {ATTRIBUTES = (Private, ); }; }; + 10D58EA11889C3DF00C05A0D /* DFGCommon.h in Headers */ = {isa = PBXBuildFile; fileRef = 0FC0977E1469EBC400CF2442 /* DFGCommon.h */; settings = {ATTRIBUTES = (Private, ); }; }; + 10D58EA21889C3DF00C05A0D /* DFGCommonData.h in Headers */ = {isa = PBXBuildFile; fileRef = 0FEA0A2E170D40BF00BB722C /* DFGCommonData.h */; settings = {ATTRIBUTES = (Private, ); }; }; + 10D58EA31889C3DF00C05A0D /* DFGCompilationKey.h in Headers */ = {isa = PBXBuildFile; fileRef = 0F38B01417CFE75500B144D3 /* DFGCompilationKey.h */; settings = {ATTRIBUTES = (Private, ); }; }; + 10D58EA41889C3DF00C05A0D /* DFGCompilationMode.h in Headers */ = {isa = PBXBuildFile; fileRef = 0F38B01617CFE75500B144D3 /* DFGCompilationMode.h */; settings = {ATTRIBUTES = (Private, ); }; }; + 10D58EA51889C3DF00C05A0D /* DFGConstantFoldingPhase.h in Headers */ = {isa = PBXBuildFile; fileRef = 0F3B3A18153E68EF003ED0FF /* DFGConstantFoldingPhase.h */; settings = {ATTRIBUTES = (Private, ); }; }; + 10D58EA61889C3DF00C05A0D /* DFGCPSRethreadingPhase.h in Headers */ = {isa = PBXBuildFile; fileRef = 0FBE0F6C16C1DB010082C5E8 /* DFGCPSRethreadingPhase.h */; settings = {ATTRIBUTES = (Private, ); }; }; + 10D58EA71889C3DF00C05A0D /* DFGCriticalEdgeBreakingPhase.h in Headers */ = {isa = PBXBuildFile; fileRef = A7D89CE717A0B8CC00773AD8 /* DFGCriticalEdgeBreakingPhase.h */; settings = {ATTRIBUTES = (Private, ); }; }; + 10D58EA81889C3DF00C05A0D /* DFGCSEPhase.h in Headers */ = {isa = PBXBuildFile; fileRef = 0FFFC94E14EF909500C72532 /* DFGCSEPhase.h */; settings = {ATTRIBUTES = (Private, ); }; }; + 10D58EA91889C3DF00C05A0D /* DFGDCEPhase.h in Headers */ = {isa = PBXBuildFile; fileRef = 0F2FC77116E12F6F0038D976 /* DFGDCEPhase.h */; settings = {ATTRIBUTES = (Private, ); }; }; + 10D58EAA1889C3DF00C05A0D /* DFGDesiredIdentifiers.h in Headers */ = {isa = PBXBuildFile; fileRef = 0F8F2B98172F04FD007DBDA5 /* DFGDesiredIdentifiers.h */; settings = {ATTRIBUTES = (Private, ); }; }; + 10D58EAB1889C3DF00C05A0D /* DFGDesiredStructureChains.h in Headers */ = {isa = PBXBuildFile; fileRef = A73E132D179624CD00E4DEA8 /* DFGDesiredStructureChains.h */; settings = {ATTRIBUTES = (Private, ); }; }; + 10D58EAC1889C3DF00C05A0D /* DFGDesiredTransitions.h in Headers */ = {isa = PBXBuildFile; fileRef = C2C0F7CC17BBFC5B00464FE4 /* DFGDesiredTransitions.h */; settings = {ATTRIBUTES = (Private, ); }; }; + 10D58EAD1889C3DF00C05A0D /* DFGDesiredWatchpoints.h in Headers */ = {isa = PBXBuildFile; fileRef = 0FE8534A1723CDA500B618F5 /* DFGDesiredWatchpoints.h */; settings = {ATTRIBUTES = (Private, ); }; }; + 10D58EAE1889C3DF00C05A0D /* DFGSSALoweringPhase.h in Headers */ = {isa = PBXBuildFile; fileRef = 0FC20CB818556A3500C9E954 /* DFGSSALoweringPhase.h */; settings = {ATTRIBUTES = (Private, ); }; }; + 10D58EAF1889C3DF00C05A0D /* DFGDesiredWeakReferences.h in Headers */ = {isa = PBXBuildFile; fileRef = C2981FD717BAEE4B00A3BC98 /* DFGDesiredWeakReferences.h */; settings = {ATTRIBUTES = (Private, ); }; }; + 10D58EB01889C3DF00C05A0D /* DFGDesiredWriteBarriers.h in Headers */ = {isa = PBXBuildFile; fileRef = C2981FDB17BAFF4400A3BC98 /* DFGDesiredWriteBarriers.h */; settings = {ATTRIBUTES = (Private, ); }; }; + 10D58EB11889C3DF00C05A0D /* DFGDisassembler.h in Headers */ = {isa = PBXBuildFile; fileRef = 0FF427621591A1C9004CB9FF /* DFGDisassembler.h */; settings = {ATTRIBUTES = (Private, ); }; }; + 10D58EB21889C3DF00C05A0D /* DFGDominators.h in Headers */ = {isa = PBXBuildFile; fileRef = 0FD81AD0154FB4EB00983E72 /* DFGDominators.h */; settings = {ATTRIBUTES = (Private, ); }; }; + 10D58EB31889C3DF00C05A0D /* DFGDoubleFormatState.h in Headers */ = {isa = PBXBuildFile; fileRef = 0F1E3A441534CBAD000F9456 /* DFGDoubleFormatState.h */; settings = {ATTRIBUTES = (Private, ); }; }; + 10D58EB41889C3DF00C05A0D /* DFGDriver.h in Headers */ = {isa = PBXBuildFile; fileRef = 0FD3C82214115D0E00FD81CB /* DFGDriver.h */; }; + 10D58EB51889C3DF00C05A0D /* DFGEdge.h in Headers */ = {isa = PBXBuildFile; fileRef = 0F66E16914DF3F1300B7B2E4 /* DFGEdge.h */; settings = {ATTRIBUTES = (Private, ); }; }; + 10D58EB61889C3DF00C05A0D /* DFGEdgeDominates.h in Headers */ = {isa = PBXBuildFile; fileRef = A7D9A29117A0BC7400EE2618 /* DFGEdgeDominates.h */; settings = {ATTRIBUTES = (Private, ); }; }; + 10D58EB71889C3DF00C05A0D /* DFGEdgeUsesStructure.h in Headers */ = {isa = PBXBuildFile; fileRef = A7986D5617A0BB1E00A95DD0 /* DFGEdgeUsesStructure.h */; settings = {ATTRIBUTES = (Private, ); }; }; + 10D58EB81889C3DF00C05A0D /* DFGExitProfile.h in Headers */ = {isa = PBXBuildFile; fileRef = 0FBC0AE51496C7C100D4FBDD /* DFGExitProfile.h */; settings = {ATTRIBUTES = (Private, ); }; }; + 10D58EB91889C3DF00C05A0D /* DFGFailedFinalizer.h in Headers */ = {isa = PBXBuildFile; fileRef = A78A976D179738B8009DF744 /* DFGFailedFinalizer.h */; }; + 10D58EBA1889C3DF00C05A0D /* DFGFinalizer.h in Headers */ = {isa = PBXBuildFile; fileRef = A78A976F179738B8009DF744 /* DFGFinalizer.h */; settings = {ATTRIBUTES = (Private, ); }; }; + 10D58EBB1889C3DF00C05A0D /* DFGFixupPhase.h in Headers */ = {isa = PBXBuildFile; fileRef = 0F2BDC13151C5D4A00CD8910 /* DFGFixupPhase.h */; settings = {ATTRIBUTES = (Private, ); }; }; + 10D58EBC1889C3DF00C05A0D /* DFGFlushedAt.h in Headers */ = {isa = PBXBuildFile; fileRef = 0F9D339517FFC4E60073C2BC /* DFGFlushedAt.h */; settings = {ATTRIBUTES = (Private, ); }; }; + 10D58EBD1889C3DF00C05A0D /* DFGFlushFormat.h in Headers */ = {isa = PBXBuildFile; fileRef = A7D89CE917A0B8CC00773AD8 /* DFGFlushFormat.h */; settings = {ATTRIBUTES = (Private, ); }; }; + 10D58EBE1889C3DF00C05A0D /* DFGFlushLivenessAnalysisPhase.h in Headers */ = {isa = PBXBuildFile; fileRef = A7D89CEB17A0B8CC00773AD8 /* DFGFlushLivenessAnalysisPhase.h */; settings = {ATTRIBUTES = (Private, ); }; }; + 10D58EBF1889C3DF00C05A0D /* DFGGenerationInfo.h in Headers */ = {isa = PBXBuildFile; fileRef = 86EC9DB61328DF82002B2AD7 /* DFGGenerationInfo.h */; settings = {ATTRIBUTES = (Private, ); }; }; + 10D58EC01889C3DF00C05A0D /* DFGGraph.h in Headers */ = {isa = PBXBuildFile; fileRef = 86EC9DB81328DF82002B2AD7 /* DFGGraph.h */; settings = {ATTRIBUTES = (Private, ); }; }; + 10D58EC11889C3DF00C05A0D /* DFGInlineCacheWrapper.h in Headers */ = {isa = PBXBuildFile; fileRef = 0FB14E201812570B009B6B4D /* DFGInlineCacheWrapper.h */; settings = {ATTRIBUTES = (Private, ); }; }; + 10D58EC21889C3DF00C05A0D /* DFGInlineCacheWrapperInlines.h in Headers */ = {isa = PBXBuildFile; fileRef = 0FB14E2218130955009B6B4D /* DFGInlineCacheWrapperInlines.h */; settings = {ATTRIBUTES = (Private, ); }; }; + 10D58EC31889C3DF00C05A0D /* DFGInPlaceAbstractState.h in Headers */ = {isa = PBXBuildFile; fileRef = A704D90117A0BAA8006BA554 /* DFGInPlaceAbstractState.h */; settings = {ATTRIBUTES = (Private, ); }; }; + 10D58EC41889C3DF00C05A0D /* DFGInsertionSet.h in Headers */ = {isa = PBXBuildFile; fileRef = 0F2BDC1F151E803800CD8910 /* DFGInsertionSet.h */; settings = {ATTRIBUTES = (Private, ); }; }; + 10D58EC51889C3DF00C05A0D /* DFGInvalidationPointInjectionPhase.h in Headers */ = {isa = PBXBuildFile; fileRef = 0FC97F3818202119002C9B26 /* DFGInvalidationPointInjectionPhase.h */; settings = {ATTRIBUTES = (Private, ); }; }; + 10D58EC61889C3DF00C05A0D /* DFGJITCode.h in Headers */ = {isa = PBXBuildFile; fileRef = 0FEA0A30170D40BF00BB722C /* DFGJITCode.h */; settings = {ATTRIBUTES = (Private, ); }; }; + 10D58EC71889C3DF00C05A0D /* DFGJITCompiler.h in Headers */ = {isa = PBXBuildFile; fileRef = 86EC9DBC1328DF82002B2AD7 /* DFGJITCompiler.h */; settings = {ATTRIBUTES = (Private, ); }; }; + 10D58EC81889C3DF00C05A0D /* DFGJITFinalizer.h in Headers */ = {isa = PBXBuildFile; fileRef = A78A9771179738B8009DF744 /* DFGJITFinalizer.h */; }; + 10D58EC91889C3DF00C05A0D /* DFGJumpReplacement.h in Headers */ = {isa = PBXBuildFile; fileRef = 0FC97F3A18202119002C9B26 /* DFGJumpReplacement.h */; settings = {ATTRIBUTES = (Private, ); }; }; + 10D58ECA1889C3DF00C05A0D /* DFGLazyJSValue.h in Headers */ = {isa = PBXBuildFile; fileRef = A73A53591799CD5D00170C19 /* DFGLazyJSValue.h */; settings = {ATTRIBUTES = (Private, ); }; }; + 10D58ECB1889C3DF00C05A0D /* DFGLICMPhase.h in Headers */ = {isa = PBXBuildFile; fileRef = A7D9A29317A0BC7400EE2618 /* DFGLICMPhase.h */; settings = {ATTRIBUTES = (Private, ); }; }; + 10D58ECC1889C3DF00C05A0D /* DFGLivenessAnalysisPhase.h in Headers */ = {isa = PBXBuildFile; fileRef = A7D89CED17A0B8CC00773AD8 /* DFGLivenessAnalysisPhase.h */; settings = {ATTRIBUTES = (Private, ); }; }; + 10D58ECD1889C3DF00C05A0D /* DFGLongLivedState.h in Headers */ = {isa = PBXBuildFile; fileRef = 0FB4B51D16B62772003F696B /* DFGLongLivedState.h */; settings = {ATTRIBUTES = (Private, ); }; }; + 10D58ECE1889C3DF00C05A0D /* DFGLoopPreHeaderCreationPhase.h in Headers */ = {isa = PBXBuildFile; fileRef = A767B5B417A0B9650063D940 /* DFGLoopPreHeaderCreationPhase.h */; settings = {ATTRIBUTES = (Private, ); }; }; + 10D58ECF1889C3DF00C05A0D /* DFGMergeMode.h in Headers */ = {isa = PBXBuildFile; fileRef = A704D90217A0BAA8006BA554 /* DFGMergeMode.h */; settings = {ATTRIBUTES = (Private, ); }; }; + 10D58ED01889C3DF00C05A0D /* DFGMinifiedGraph.h in Headers */ = {isa = PBXBuildFile; fileRef = 0F2BDC3D1522801700CD8910 /* DFGMinifiedGraph.h */; settings = {ATTRIBUTES = (Private, ); }; }; + 10D58ED11889C3DF00C05A0D /* DFGMinifiedID.h in Headers */ = {isa = PBXBuildFile; fileRef = 0FB4B51016B3A964003F696B /* DFGMinifiedID.h */; settings = {ATTRIBUTES = (Private, ); }; }; + 10D58ED21889C3DF00C05A0D /* DFGMinifiedNode.h in Headers */ = {isa = PBXBuildFile; fileRef = 0F2BDC3E1522801700CD8910 /* DFGMinifiedNode.h */; settings = {ATTRIBUTES = (Private, ); }; }; + 10D58ED31889C3DF00C05A0D /* DFGNaturalLoops.h in Headers */ = {isa = PBXBuildFile; fileRef = A737810B1799EA2E00817533 /* DFGNaturalLoops.h */; settings = {ATTRIBUTES = (Private, ); }; }; + 10D58ED41889C3DF00C05A0D /* DFGNode.h in Headers */ = {isa = PBXBuildFile; fileRef = 86ECA3E9132DEF1C002B2AD7 /* DFGNode.h */; settings = {ATTRIBUTES = (Private, ); }; }; + 10D58ED51889C3DF00C05A0D /* DFGNodeAllocator.h in Headers */ = {isa = PBXBuildFile; fileRef = 0FB4B51F16B62772003F696B /* DFGNodeAllocator.h */; settings = {ATTRIBUTES = (Private, ); }; }; + 10D58ED61889C3DF00C05A0D /* DFGNodeFlags.h in Headers */ = {isa = PBXBuildFile; fileRef = 0FA581B8150E952A00B9A2D9 /* DFGNodeFlags.h */; settings = {ATTRIBUTES = (Private, ); }; }; + 10D58ED71889C3DF00C05A0D /* DFGNodeType.h in Headers */ = {isa = PBXBuildFile; fileRef = 0FA581B9150E952A00B9A2D9 /* DFGNodeType.h */; settings = {ATTRIBUTES = (Private, ); }; }; + 10D58ED81889C3DF00C05A0D /* DFGOperations.h in Headers */ = {isa = PBXBuildFile; fileRef = 86EC9DC01328DF82002B2AD7 /* DFGOperations.h */; settings = {ATTRIBUTES = (Private, ); }; }; + 10D58ED91889C3DF00C05A0D /* DFGOSRAvailabilityAnalysisPhase.h in Headers */ = {isa = PBXBuildFile; fileRef = A7D89CEF17A0B8CC00773AD8 /* DFGOSRAvailabilityAnalysisPhase.h */; settings = {ATTRIBUTES = (Private, ); }; }; + 10D58EDA1889C3DF00C05A0D /* DFGOSREntry.h in Headers */ = {isa = PBXBuildFile; fileRef = 0FD82E53141DAEDE00179C94 /* DFGOSREntry.h */; settings = {ATTRIBUTES = (Private, ); }; }; + 10D58EDB1889C3DF00C05A0D /* DFGOSREntrypointCreationPhase.h in Headers */ = {isa = PBXBuildFile; fileRef = 0FD8A31E17D51F5700CA2C40 /* DFGOSREntrypointCreationPhase.h */; settings = {ATTRIBUTES = (Private, ); }; }; + 10D58EDC1889C3DF00C05A0D /* DFGOSRExit.h in Headers */ = {isa = PBXBuildFile; fileRef = 0FC097681468A6EF00CF2442 /* DFGOSRExit.h */; settings = {ATTRIBUTES = (Private, ); }; }; + 10D58EDD1889C3DF00C05A0D /* ConstantMode.h in Headers */ = {isa = PBXBuildFile; fileRef = 0FFC99D0184EC8AD009C10AB /* ConstantMode.h */; settings = {ATTRIBUTES = (Private, ); }; }; + 10D58EDE1889C3DF00C05A0D /* DFGOSRExitBase.h in Headers */ = {isa = PBXBuildFile; fileRef = 0F235BE817178E7300690C7F /* DFGOSRExitBase.h */; settings = {ATTRIBUTES = (Private, ); }; }; + 10D58EDF1889C3DF00C05A0D /* RemoteInspectorXPCConnection.h in Headers */ = {isa = PBXBuildFile; fileRef = A5BA15E6182340B300A82E69 /* RemoteInspectorXPCConnection.h */; }; + 10D58EE01889C3DF00C05A0D /* DFGOSRExitCompilationInfo.h in Headers */ = {isa = PBXBuildFile; fileRef = 65987F2C167FE84B003C2F8D /* DFGOSRExitCompilationInfo.h */; settings = {ATTRIBUTES = (Private, ); }; }; + 10D58EE11889C3DF00C05A0D /* DFGOSRExitCompiler.h in Headers */ = {isa = PBXBuildFile; fileRef = 0FC0976F14693AEF00CF2442 /* DFGOSRExitCompiler.h */; settings = {ATTRIBUTES = (Private, ); }; }; + 10D58EE21889C3DF00C05A0D /* DFGOSRExitCompilerCommon.h in Headers */ = {isa = PBXBuildFile; fileRef = 0F7025A81714B0F800382C0E /* DFGOSRExitCompilerCommon.h */; settings = {ATTRIBUTES = (Private, ); }; }; + 10D58EE31889C3DF00C05A0D /* DFGOSRExitJumpPlaceholder.h in Headers */ = {isa = PBXBuildFile; fileRef = 0FEFC9A81681A3B000567F53 /* DFGOSRExitJumpPlaceholder.h */; settings = {ATTRIBUTES = (Private, ); }; }; + 10D58EE41889C3DF00C05A0D /* DFGOSRExitPreparation.h in Headers */ = {isa = PBXBuildFile; fileRef = 0F235BEA17178E7300690C7F /* DFGOSRExitPreparation.h */; settings = {ATTRIBUTES = (Private, ); }; }; + 10D58EE51889C3DF00C05A0D /* DFGPhase.h in Headers */ = {isa = PBXBuildFile; fileRef = 0FFFC95014EF909500C72532 /* DFGPhase.h */; settings = {ATTRIBUTES = (Private, ); }; }; + 10D58EE61889C3DF00C05A0D /* DFGPlan.h in Headers */ = {isa = PBXBuildFile; fileRef = A78A9773179738B8009DF744 /* DFGPlan.h */; settings = {ATTRIBUTES = (Private, ); }; }; + 10D58EE71889C3DF00C05A0D /* DFGPredictionInjectionPhase.h in Headers */ = {isa = PBXBuildFile; fileRef = 0FBE0F6E16C1DB010082C5E8 /* DFGPredictionInjectionPhase.h */; settings = {ATTRIBUTES = (Private, ); }; }; + 10D58EE81889C3DF00C05A0D /* DFGPredictionPropagationPhase.h in Headers */ = {isa = PBXBuildFile; fileRef = 0FFFC95214EF909500C72532 /* DFGPredictionPropagationPhase.h */; settings = {ATTRIBUTES = (Private, ); }; }; + 10D58EE91889C3DF00C05A0D /* DFGRegisterBank.h in Headers */ = {isa = PBXBuildFile; fileRef = 86EC9DC11328DF82002B2AD7 /* DFGRegisterBank.h */; settings = {ATTRIBUTES = (Private, ); }; }; + 10D58EEA1889C3DF00C05A0D /* DFGSafeToExecute.h in Headers */ = {isa = PBXBuildFile; fileRef = A77A423C17A0BBFD00A8DB81 /* DFGSafeToExecute.h */; settings = {ATTRIBUTES = (Private, ); }; }; + 10D58EEB1889C3DF00C05A0D /* DFGSaneStringGetByValSlowPathGenerator.h in Headers */ = {isa = PBXBuildFile; fileRef = A741017E179DAF80002EB8BA /* DFGSaneStringGetByValSlowPathGenerator.h */; settings = {ATTRIBUTES = (Private, ); }; }; + 10D58EEC1889C3DF00C05A0D /* DFGScoreBoard.h in Headers */ = {isa = PBXBuildFile; fileRef = 86ECA3F9132DF25A002B2AD7 /* DFGScoreBoard.h */; settings = {ATTRIBUTES = (Private, ); }; }; + 10D58EED1889C3DF00C05A0D /* DFGSilentRegisterSavePlan.h in Headers */ = {isa = PBXBuildFile; fileRef = 0F1E3A65153A21DF000F9456 /* DFGSilentRegisterSavePlan.h */; settings = {ATTRIBUTES = (Private, ); }; }; + 10D58EEE1889C3DF00C05A0D /* DFGSlowPathGenerator.h in Headers */ = {isa = PBXBuildFile; fileRef = 0F1E3A501537C2CB000F9456 /* DFGSlowPathGenerator.h */; settings = {ATTRIBUTES = (Private, ); }; }; + 10D58EEF1889C3DF00C05A0D /* DFGSpeculativeJIT.h in Headers */ = {isa = PBXBuildFile; fileRef = 86EC9DC31328DF82002B2AD7 /* DFGSpeculativeJIT.h */; settings = {ATTRIBUTES = (Private, ); }; }; + 10D58EF01889C3DF00C05A0D /* DFGSSAConversionPhase.h in Headers */ = {isa = PBXBuildFile; fileRef = A7D89CF117A0B8CC00773AD8 /* DFGSSAConversionPhase.h */; settings = {ATTRIBUTES = (Private, ); }; }; + 10D58EF11889C3DF00C05A0D /* DFGStackLayoutPhase.h in Headers */ = {isa = PBXBuildFile; fileRef = 0F9FB4F317FCB91700CB67F8 /* DFGStackLayoutPhase.h */; settings = {ATTRIBUTES = (Private, ); }; }; + 10D58EF21889C3DF00C05A0D /* InspectorValues.h in Headers */ = {isa = PBXBuildFile; fileRef = A593CF811840377100BFCE27 /* InspectorValues.h */; settings = {ATTRIBUTES = (Private, ); }; }; + 10D58EF31889C3DF00C05A0D /* DFGStructureAbstractValue.h in Headers */ = {isa = PBXBuildFile; fileRef = 0F63947615DCE347006A597C /* DFGStructureAbstractValue.h */; settings = {ATTRIBUTES = (Private, ); }; }; + 10D58EF41889C3DF00C05A0D /* DFGThunks.h in Headers */ = {isa = PBXBuildFile; fileRef = 0FC097A0146B28C700CF2442 /* DFGThunks.h */; settings = {ATTRIBUTES = (Private, ); }; }; + 10D58EF51889C3DF00C05A0D /* DFGTierUpCheckInjectionPhase.h in Headers */ = {isa = PBXBuildFile; fileRef = 0FD8A32017D51F5700CA2C40 /* DFGTierUpCheckInjectionPhase.h */; settings = {ATTRIBUTES = (Private, ); }; }; + 10D58EF61889C3DF00C05A0D /* DFGToFTLDeferredCompilationCallback.h in Headers */ = {isa = PBXBuildFile; fileRef = 0FD8A32217D51F5700CA2C40 /* DFGToFTLDeferredCompilationCallback.h */; settings = {ATTRIBUTES = (Private, ); }; }; + 10D58EF71889C3DF00C05A0D /* VariableWatchpointSet.h in Headers */ = {isa = PBXBuildFile; fileRef = 0F9181C618415CA50057B669 /* VariableWatchpointSet.h */; settings = {ATTRIBUTES = (Private, ); }; }; + 10D58EF81889C3DF00C05A0D /* DFGToFTLForOSREntryDeferredCompilationCallback.h in Headers */ = {isa = PBXBuildFile; fileRef = 0FD8A32417D51F5700CA2C40 /* DFGToFTLForOSREntryDeferredCompilationCallback.h */; settings = {ATTRIBUTES = (Private, ); }; }; + 10D58EF91889C3DF00C05A0D /* DFGTypeCheckHoistingPhase.h in Headers */ = {isa = PBXBuildFile; fileRef = 0F63943D15C75F14006A597C /* DFGTypeCheckHoistingPhase.h */; settings = {ATTRIBUTES = (Private, ); }; }; + 10D58EFA1889C3DF00C05A0D /* DFGUnificationPhase.h in Headers */ = {isa = PBXBuildFile; fileRef = 0FBE0F7016C1DB010082C5E8 /* DFGUnificationPhase.h */; settings = {ATTRIBUTES = (Private, ); }; }; + 10D58EFB1889C3DF00C05A0D /* DFGUseKind.h in Headers */ = {isa = PBXBuildFile; fileRef = 0F34B14816D4200E001CDA5A /* DFGUseKind.h */; settings = {ATTRIBUTES = (Private, ); }; }; + 10D58EFC1889C3DF00C05A0D /* DFGValidate.h in Headers */ = {isa = PBXBuildFile; fileRef = 0F3B3A2A15474FF4003ED0FF /* DFGValidate.h */; settings = {ATTRIBUTES = (Private, ); }; }; + 10D58EFD1889C3DF00C05A0D /* DFGValueRecoveryOverride.h in Headers */ = {isa = PBXBuildFile; fileRef = 0F2BDC3F1522801700CD8910 /* DFGValueRecoveryOverride.h */; settings = {ATTRIBUTES = (Private, ); }; }; + 10D58EFE1889C3DF00C05A0D /* DFGValueSource.h in Headers */ = {isa = PBXBuildFile; fileRef = 0F2BDC401522801700CD8910 /* DFGValueSource.h */; settings = {ATTRIBUTES = (Private, ); }; }; + 10D58EFF1889C3DF00C05A0D /* DFGVariableAccessData.h in Headers */ = {isa = PBXBuildFile; fileRef = 0F620172143FCD2F0068B77C /* DFGVariableAccessData.h */; settings = {ATTRIBUTES = (Private, ); }; }; + 10D58F001889C3DF00C05A0D /* DFGVariableAccessDataDump.h in Headers */ = {isa = PBXBuildFile; fileRef = 0FDDBFB31666EED500C55FEF /* DFGVariableAccessDataDump.h */; settings = {ATTRIBUTES = (Private, ); }; }; + 10D58F011889C3DF00C05A0D /* DFGVariableEvent.h in Headers */ = {isa = PBXBuildFile; fileRef = 0F2BDC411522801700CD8910 /* DFGVariableEvent.h */; settings = {ATTRIBUTES = (Private, ); }; }; + 10D58F021889C3DF00C05A0D /* DFGVariableEventStream.h in Headers */ = {isa = PBXBuildFile; fileRef = 0F2BDC431522801700CD8910 /* DFGVariableEventStream.h */; settings = {ATTRIBUTES = (Private, ); }; }; + 10D58F031889C3DF00C05A0D /* InjectedScriptBase.h in Headers */ = {isa = PBXBuildFile; fileRef = A514B2C1185A684400F3C7CB /* InjectedScriptBase.h */; settings = {ATTRIBUTES = (Private, ); }; }; + 10D58F041889C3DF00C05A0D /* DFGVariadicFunction.h in Headers */ = {isa = PBXBuildFile; fileRef = 0F85A31E16AB76AE0077571E /* DFGVariadicFunction.h */; settings = {ATTRIBUTES = (Private, ); }; }; + 10D58F051889C3DF00C05A0D /* InspectorEnvironment.h in Headers */ = {isa = PBXBuildFile; fileRef = A5D0A1BA1862301B00C7B496 /* InspectorEnvironment.h */; settings = {ATTRIBUTES = (Private, ); }; }; + 10D58F061889C3DF00C05A0D /* DFGVirtualRegisterAllocationPhase.h in Headers */ = {isa = PBXBuildFile; fileRef = 0FFFC95414EF909500C72532 /* DFGVirtualRegisterAllocationPhase.h */; settings = {ATTRIBUTES = (Private, ); }; }; + 10D58F071889C3DF00C05A0D /* DFGWatchpointCollectionPhase.h in Headers */ = {isa = PBXBuildFile; fileRef = 0FC97F3C18202119002C9B26 /* DFGWatchpointCollectionPhase.h */; settings = {ATTRIBUTES = (Private, ); }; }; + 10D58F081889C3DF00C05A0D /* DFGWorklist.h in Headers */ = {isa = PBXBuildFile; fileRef = 0FDB2CE6174830A2007B3C1B /* DFGWorklist.h */; settings = {ATTRIBUTES = (Private, ); }; }; + 10D58F091889C3DF00C05A0D /* Disassembler.h in Headers */ = {isa = PBXBuildFile; fileRef = 0FF4272F158EBD44004CB9FF /* Disassembler.h */; settings = {ATTRIBUTES = (Private, ); }; }; + 10D58F0A1889C3DF00C05A0D /* DumpContext.h in Headers */ = {isa = PBXBuildFile; fileRef = A70447EC17A0BD7000F5898E /* DumpContext.h */; settings = {ATTRIBUTES = (Private, ); }; }; + 10D58F0B1889C3DF00C05A0D /* Error.h in Headers */ = {isa = PBXBuildFile; fileRef = BC3046060E1F497F003232CF /* Error.h */; settings = {ATTRIBUTES = (Private, ); }; }; + 10D58F0C1889C3DF00C05A0D /* ErrorConstructor.h in Headers */ = {isa = PBXBuildFile; fileRef = BC02E9050E1839DB000F9297 /* ErrorConstructor.h */; }; + 10D58F0D1889C3DF00C05A0D /* ErrorInstance.h in Headers */ = {isa = PBXBuildFile; fileRef = BC02E98B0E183E38000F9297 /* ErrorInstance.h */; settings = {ATTRIBUTES = (Private, ); }; }; + 10D58F0E1889C3DF00C05A0D /* ErrorPrototype.h in Headers */ = {isa = PBXBuildFile; fileRef = BC02E9070E1839DB000F9297 /* ErrorPrototype.h */; settings = {ATTRIBUTES = (Private, ); }; }; + 10D58F0F1889C3DF00C05A0D /* EvalCodeCache.h in Headers */ = {isa = PBXBuildFile; fileRef = 969A07920ED1D3AE00F1F681 /* EvalCodeCache.h */; settings = {ATTRIBUTES = (Private, ); }; }; + 10D58F101889C3DF00C05A0D /* ExceptionHelpers.h in Headers */ = {isa = PBXBuildFile; fileRef = A72701B30DADE94900E548D7 /* ExceptionHelpers.h */; settings = {ATTRIBUTES = (Private, ); }; }; + 10D58F111889C3DF00C05A0D /* Executable.h in Headers */ = {isa = PBXBuildFile; fileRef = 86CAFEE21035DDE60028A609 /* Executable.h */; settings = {ATTRIBUTES = (Private, ); }; }; + 10D58F121889C3DF00C05A0D /* ExecutableAllocator.h in Headers */ = {isa = PBXBuildFile; fileRef = A7B48DB50EE74CFC00DCBDB6 /* ExecutableAllocator.h */; settings = {ATTRIBUTES = (Private, ); }; }; + 10D58F131889C3DF00C05A0D /* ExecutionCounter.h in Headers */ = {isa = PBXBuildFile; fileRef = 0F56A1D115000F31002992B1 /* ExecutionCounter.h */; settings = {ATTRIBUTES = (Private, ); }; }; + 10D58F141889C3DF00C05A0D /* ExitKind.h in Headers */ = {isa = PBXBuildFile; fileRef = 0FB105831675480C00F8AB6E /* ExitKind.h */; settings = {ATTRIBUTES = (Private, ); }; }; + 10D58F151889C3DF00C05A0D /* ExpressionRangeInfo.h in Headers */ = {isa = PBXBuildFile; fileRef = 0F0B83AA14BCF5B900885B4F /* ExpressionRangeInfo.h */; settings = {ATTRIBUTES = (Private, ); }; }; + 10D58F161889C3DF00C05A0D /* Float32Array.h in Headers */ = {isa = PBXBuildFile; fileRef = A7A8AF2917ADB5F3005AB174 /* Float32Array.h */; settings = {ATTRIBUTES = (Private, ); }; }; + 10D58F171889C3DF00C05A0D /* ScriptValue.h in Headers */ = {isa = PBXBuildFile; fileRef = A54CF2F3184EAB2400237F19 /* ScriptValue.h */; settings = {ATTRIBUTES = (Private, ); }; }; + 10D58F181889C3DF00C05A0D /* Float64Array.h in Headers */ = {isa = PBXBuildFile; fileRef = A7A8AF2A17ADB5F3005AB174 /* Float64Array.h */; settings = {ATTRIBUTES = (Private, ); }; }; + 10D58F191889C3DF00C05A0D /* FPRInfo.h in Headers */ = {isa = PBXBuildFile; fileRef = 0F24E53E17EA9F5900ABB217 /* FPRInfo.h */; settings = {ATTRIBUTES = (Private, ); }; }; + 10D58F1A1889C3DF00C05A0D /* ArrayBufferNeuteringWatchpoint.h in Headers */ = {isa = PBXBuildFile; fileRef = 0FFC99D3184EE318009C10AB /* ArrayBufferNeuteringWatchpoint.h */; settings = {ATTRIBUTES = (Private, ); }; }; + 10D58F1B1889C3DF00C05A0D /* FTLAbbreviatedTypes.h in Headers */ = {isa = PBXBuildFile; fileRef = 0FDB2CC7173DA51E007B3C1B /* FTLAbbreviatedTypes.h */; settings = {ATTRIBUTES = (Private, ); }; }; + 10D58F1C1889C3DF00C05A0D /* FTLAbbreviations.h in Headers */ = {isa = PBXBuildFile; fileRef = 0FEA09FD170513DB00BB722C /* FTLAbbreviations.h */; settings = {ATTRIBUTES = (Private, ); }; }; + 10D58F1D1889C3DF00C05A0D /* FTLAbstractHeap.h in Headers */ = {isa = PBXBuildFile; fileRef = 0FEA0A181708B00700BB722C /* FTLAbstractHeap.h */; settings = {ATTRIBUTES = (Private, ); }; }; + 10D58F1E1889C3DF00C05A0D /* FTLAbstractHeapRepository.h in Headers */ = {isa = PBXBuildFile; fileRef = 0FEA0A1A1708B00700BB722C /* FTLAbstractHeapRepository.h */; settings = {ATTRIBUTES = (Private, ); }; }; + 10D58F1F1889C3DF00C05A0D /* JSGlobalObjectDebuggable.h in Headers */ = {isa = PBXBuildFile; fileRef = A59455911824744700CC3843 /* JSGlobalObjectDebuggable.h */; }; + 10D58F201889C3DF00C05A0D /* FTLCapabilities.h in Headers */ = {isa = PBXBuildFile; fileRef = 0FEA09FF170513DB00BB722C /* FTLCapabilities.h */; settings = {ATTRIBUTES = (Private, ); }; }; + 10D58F211889C3DF00C05A0D /* FTLCommonValues.h in Headers */ = {isa = PBXBuildFile; fileRef = 0FEA0A211709606900BB722C /* FTLCommonValues.h */; settings = {ATTRIBUTES = (Private, ); }; }; + 10D58F221889C3DF00C05A0D /* FTLCompile.h in Headers */ = {isa = PBXBuildFile; fileRef = 0FEA0A01170513DB00BB722C /* FTLCompile.h */; settings = {ATTRIBUTES = (Private, ); }; }; + 10D58F231889C3DF00C05A0D /* FTLExitArgument.h in Headers */ = {isa = PBXBuildFile; fileRef = 0F235BBE17178E1C00690C7F /* FTLExitArgument.h */; settings = {ATTRIBUTES = (Private, ); }; }; + 10D58F241889C3DF00C05A0D /* FTLExitArgumentForOperand.h in Headers */ = {isa = PBXBuildFile; fileRef = 0F235BC017178E1C00690C7F /* FTLExitArgumentForOperand.h */; settings = {ATTRIBUTES = (Private, ); }; }; + 10D58F251889C3DF00C05A0D /* FTLExitArgumentList.h in Headers */ = {isa = PBXBuildFile; fileRef = 0F235BC117178E1C00690C7F /* FTLExitArgumentList.h */; settings = {ATTRIBUTES = (Private, ); }; }; + 10D58F261889C3DF00C05A0D /* FTLExitThunkGenerator.h in Headers */ = {isa = PBXBuildFile; fileRef = 0F235BC317178E1C00690C7F /* FTLExitThunkGenerator.h */; settings = {ATTRIBUTES = (Private, ); }; }; + 10D58F271889C3DF00C05A0D /* FTLExitValue.h in Headers */ = {isa = PBXBuildFile; fileRef = 0F235BC517178E1C00690C7F /* FTLExitValue.h */; settings = {ATTRIBUTES = (Private, ); }; }; + 10D58F281889C3DF00C05A0D /* FTLFail.h in Headers */ = {isa = PBXBuildFile; fileRef = A7F2996A17A0BB670010417A /* FTLFail.h */; settings = {ATTRIBUTES = (Private, ); }; }; + 10D58F291889C3DF00C05A0D /* FTLFormattedValue.h in Headers */ = {isa = PBXBuildFile; fileRef = 0FEA0A2B170B661900BB722C /* FTLFormattedValue.h */; settings = {ATTRIBUTES = (Private, ); }; }; + 10D58F2A1889C3DF00C05A0D /* FTLForOSREntryJITCode.h in Headers */ = {isa = PBXBuildFile; fileRef = 0FD8A31617D51F2200CA2C40 /* FTLForOSREntryJITCode.h */; settings = {ATTRIBUTES = (Private, ); }; }; + 10D58F2B1889C3DF00C05A0D /* FTLGeneratedFunction.h in Headers */ = {isa = PBXBuildFile; fileRef = A78A977C179738D5009DF744 /* FTLGeneratedFunction.h */; }; + 10D58F2C1889C3DF00C05A0D /* FTLInlineCacheDescriptor.h in Headers */ = {isa = PBXBuildFile; fileRef = 0F25F1A7181635F300522F39 /* FTLInlineCacheDescriptor.h */; settings = {ATTRIBUTES = (Private, ); }; }; + 10D58F2D1889C3DF00C05A0D /* FTLInlineCacheSize.h in Headers */ = {isa = PBXBuildFile; fileRef = 0F25F1A9181635F300522F39 /* FTLInlineCacheSize.h */; settings = {ATTRIBUTES = (Private, ); }; }; + 10D58F2E1889C3DF00C05A0D /* FTLIntrinsicRepository.h in Headers */ = {isa = PBXBuildFile; fileRef = 0FEA0A221709606900BB722C /* FTLIntrinsicRepository.h */; settings = {ATTRIBUTES = (Private, ); }; }; + 10D58F2F1889C3DF00C05A0D /* FTLJITCode.h in Headers */ = {isa = PBXBuildFile; fileRef = 0FEA0A03170513DB00BB722C /* FTLJITCode.h */; settings = {ATTRIBUTES = (Private, ); }; }; + 10D58F301889C3DF00C05A0D /* FTLJITFinalizer.h in Headers */ = {isa = PBXBuildFile; fileRef = A78A977E179738D5009DF744 /* FTLJITFinalizer.h */; }; + 10D58F311889C3DF00C05A0D /* FTLLink.h in Headers */ = {isa = PBXBuildFile; fileRef = 0F8F2B94172E049E007DBDA5 /* FTLLink.h */; settings = {ATTRIBUTES = (Private, ); }; }; + 10D58F321889C3DF00C05A0D /* FTLLocation.h in Headers */ = {isa = PBXBuildFile; fileRef = 0FCEFADE180738C000472CE4 /* FTLLocation.h */; settings = {ATTRIBUTES = (Private, ); }; }; + 10D58F331889C3DF00C05A0D /* FTLLowerDFGToLLVM.h in Headers */ = {isa = PBXBuildFile; fileRef = 0FEA0A05170513DB00BB722C /* FTLLowerDFGToLLVM.h */; settings = {ATTRIBUTES = (Private, ); }; }; + 10D58F341889C3DF00C05A0D /* FTLLoweredNodeValue.h in Headers */ = {isa = PBXBuildFile; fileRef = A7D89D0117A0B90400773AD8 /* FTLLoweredNodeValue.h */; settings = {ATTRIBUTES = (Private, ); }; }; + 10D58F351889C3DF00C05A0D /* FTLOSREntry.h in Headers */ = {isa = PBXBuildFile; fileRef = 0FD8A31817D51F2200CA2C40 /* FTLOSREntry.h */; settings = {ATTRIBUTES = (Private, ); }; }; + 10D58F361889C3DF00C05A0D /* FTLOSRExit.h in Headers */ = {isa = PBXBuildFile; fileRef = 0F235BC717178E1C00690C7F /* FTLOSRExit.h */; settings = {ATTRIBUTES = (Private, ); }; }; + 10D58F371889C3DF00C05A0D /* FTLOSRExitCompilationInfo.h in Headers */ = {isa = PBXBuildFile; fileRef = 0F235BC817178E1C00690C7F /* FTLOSRExitCompilationInfo.h */; settings = {ATTRIBUTES = (Private, ); }; }; + 10D58F381889C3DF00C05A0D /* FTLOSRExitCompiler.h in Headers */ = {isa = PBXBuildFile; fileRef = 0F235BCA17178E1C00690C7F /* FTLOSRExitCompiler.h */; settings = {ATTRIBUTES = (Private, ); }; }; + 10D58F391889C3DF00C05A0D /* FTLOutput.h in Headers */ = {isa = PBXBuildFile; fileRef = 0FEA0A06170513DB00BB722C /* FTLOutput.h */; settings = {ATTRIBUTES = (Private, ); }; }; + 10D58F3A1889C3DF00C05A0D /* FTLSaveRestore.h in Headers */ = {isa = PBXBuildFile; fileRef = 0FCEFAAA1804C13E00472CE4 /* FTLSaveRestore.h */; settings = {ATTRIBUTES = (Private, ); }; }; + 10D58F3B1889C3DF00C05A0D /* FTLSlowPathCall.h in Headers */ = {isa = PBXBuildFile; fileRef = 0F25F1AB181635F300522F39 /* FTLSlowPathCall.h */; settings = {ATTRIBUTES = (Private, ); }; }; + 10D58F3C1889C3DF00C05A0D /* FTLSlowPathCallKey.h in Headers */ = {isa = PBXBuildFile; fileRef = 0F25F1AD181635F300522F39 /* FTLSlowPathCallKey.h */; settings = {ATTRIBUTES = (Private, ); }; }; + 10D58F3D1889C3DF00C05A0D /* FTLStackMaps.h in Headers */ = {isa = PBXBuildFile; fileRef = 0F9D33991803ADB70073C2BC /* FTLStackMaps.h */; settings = {ATTRIBUTES = (Private, ); }; }; + 10D58F3E1889C3DF00C05A0D /* FTLState.h in Headers */ = {isa = PBXBuildFile; fileRef = 0FEA0A07170513DB00BB722C /* FTLState.h */; settings = {ATTRIBUTES = (Private, ); }; }; + 10D58F3F1889C3DF00C05A0D /* FTLSwitchCase.h in Headers */ = {isa = PBXBuildFile; fileRef = A7FCC26C17A0B6AA00786D1A /* FTLSwitchCase.h */; settings = {ATTRIBUTES = (Private, ); }; }; + 10D58F401889C3DF00C05A0D /* FTLThunks.h in Headers */ = {isa = PBXBuildFile; fileRef = 0F235BCC17178E1C00690C7F /* FTLThunks.h */; settings = {ATTRIBUTES = (Private, ); }; }; + 10D58F411889C3DF00C05A0D /* FTLTypedPointer.h in Headers */ = {isa = PBXBuildFile; fileRef = 0FEA0A1B1708B00700BB722C /* FTLTypedPointer.h */; }; + 10D58F421889C3DF00C05A0D /* FTLValueFormat.h in Headers */ = {isa = PBXBuildFile; fileRef = 0F235BCE17178E1C00690C7F /* FTLValueFormat.h */; settings = {ATTRIBUTES = (Private, ); }; }; + 10D58F431889C3DF00C05A0D /* FTLValueFromBlock.h in Headers */ = {isa = PBXBuildFile; fileRef = 0FDB2CC8173DA51E007B3C1B /* FTLValueFromBlock.h */; settings = {ATTRIBUTES = (Private, ); }; }; + 10D58F441889C3DF00C05A0D /* FunctionConstructor.h in Headers */ = {isa = PBXBuildFile; fileRef = BC2680C10E16D4E900A06E92 /* FunctionConstructor.h */; settings = {ATTRIBUTES = (Private, ); }; }; + 10D58F451889C3DF00C05A0D /* FunctionExecutableDump.h in Headers */ = {isa = PBXBuildFile; fileRef = 0FB4B52216B6278D003F696B /* FunctionExecutableDump.h */; settings = {ATTRIBUTES = (Private, ); }; }; + 10D58F461889C3DF00C05A0D /* FunctionPrototype.h in Headers */ = {isa = PBXBuildFile; fileRef = F692A85D0255597D01FF60F7 /* FunctionPrototype.h */; settings = {ATTRIBUTES = (Private, ); }; }; + 10D58F471889C3DF00C05A0D /* GCActivityCallback.h in Headers */ = {isa = PBXBuildFile; fileRef = DDF7ABD211F60ED200108E36 /* GCActivityCallback.h */; settings = {ATTRIBUTES = (Private, ); }; }; + 10D58F481889C3DF00C05A0D /* GCAssertions.h in Headers */ = {isa = PBXBuildFile; fileRef = BCBE2CAD14E985AA000593AD /* GCAssertions.h */; settings = {ATTRIBUTES = (Private, ); }; }; + 10D58F491889C3DF00C05A0D /* GCAwareJITStubRoutine.h in Headers */ = {isa = PBXBuildFile; fileRef = 0F766D2E15A8DCDD008F363E /* GCAwareJITStubRoutine.h */; settings = {ATTRIBUTES = (Private, ); }; }; + 10D58F4A1889C3DF00C05A0D /* GCIncomingRefCounted.h in Headers */ = {isa = PBXBuildFile; fileRef = 0F2B66A817B6B53D00A7AE3F /* GCIncomingRefCounted.h */; settings = {ATTRIBUTES = (Private, ); }; }; + 10D58F4B1889C3DF00C05A0D /* GCIncomingRefCountedInlines.h in Headers */ = {isa = PBXBuildFile; fileRef = 0F2B66A917B6B53D00A7AE3F /* GCIncomingRefCountedInlines.h */; settings = {ATTRIBUTES = (Private, ); }; }; + 10D58F4C1889C3DF00C05A0D /* GCIncomingRefCountedSet.h in Headers */ = {isa = PBXBuildFile; fileRef = 0F2B66AA17B6B53D00A7AE3F /* GCIncomingRefCountedSet.h */; settings = {ATTRIBUTES = (Private, ); }; }; + 10D58F4D1889C3DF00C05A0D /* GCIncomingRefCountedSetInlines.h in Headers */ = {isa = PBXBuildFile; fileRef = 0F2B66AB17B6B53D00A7AE3F /* GCIncomingRefCountedSetInlines.h */; settings = {ATTRIBUTES = (Private, ); }; }; + 10D58F4E1889C3DF00C05A0D /* GCThread.h in Headers */ = {isa = PBXBuildFile; fileRef = C2239D1616262BDD005AC5FD /* GCThread.h */; }; + 10D58F4F1889C3DF00C05A0D /* GCThreadSharedData.h in Headers */ = {isa = PBXBuildFile; fileRef = C21122DF15DD9AB300790E3A /* GCThreadSharedData.h */; settings = {ATTRIBUTES = (Private, ); }; }; + 10D58F501889C3DF00C05A0D /* GenericTypedArrayView.h in Headers */ = {isa = PBXBuildFile; fileRef = 0F2B66B217B6B5AB00A7AE3F /* GenericTypedArrayView.h */; settings = {ATTRIBUTES = (Private, ); }; }; + 10D58F511889C3DF00C05A0D /* GenericTypedArrayViewInlines.h in Headers */ = {isa = PBXBuildFile; fileRef = 0F2B66B317B6B5AB00A7AE3F /* GenericTypedArrayViewInlines.h */; settings = {ATTRIBUTES = (Private, ); }; }; + 10D58F521889C3DF00C05A0D /* GetByIdStatus.h in Headers */ = {isa = PBXBuildFile; fileRef = 0F93329614CA7DC10085F3C6 /* GetByIdStatus.h */; settings = {ATTRIBUTES = (Private, ); }; }; + 10D58F531889C3DF00C05A0D /* GPRInfo.h in Headers */ = {isa = PBXBuildFile; fileRef = 0F24E53F17EA9F5900ABB217 /* GPRInfo.h */; settings = {ATTRIBUTES = (Private, ); }; }; + 10D58F541889C3DF00C05A0D /* Handle.h in Headers */ = {isa = PBXBuildFile; fileRef = 142E312B134FF0A600AFADB5 /* Handle.h */; settings = {ATTRIBUTES = (Private, ); }; }; + 10D58F551889C3DF00C05A0D /* HandleBlock.h in Headers */ = {isa = PBXBuildFile; fileRef = C28318FF16FE4B7D00157BFD /* HandleBlock.h */; settings = {ATTRIBUTES = (Private, ); }; }; + 10D58F561889C3DF00C05A0D /* HandleBlockInlines.h in Headers */ = {isa = PBXBuildFile; fileRef = C283190116FE533E00157BFD /* HandleBlockInlines.h */; }; + 10D58F571889C3DF00C05A0D /* HandlerInfo.h in Headers */ = {isa = PBXBuildFile; fileRef = 0F0B83A814BCF55E00885B4F /* HandlerInfo.h */; settings = {ATTRIBUTES = (Private, ); }; }; + 10D58F581889C3DF00C05A0D /* HandleSet.h in Headers */ = {isa = PBXBuildFile; fileRef = 142E312D134FF0A600AFADB5 /* HandleSet.h */; settings = {ATTRIBUTES = (Private, ); }; }; + 10D58F591889C3DF00C05A0D /* HandleStack.h in Headers */ = {isa = PBXBuildFile; fileRef = 142E312F134FF0A600AFADB5 /* HandleStack.h */; settings = {ATTRIBUTES = (Private, ); }; }; + 10D58F5A1889C3DF00C05A0D /* HandleTypes.h in Headers */ = {isa = PBXBuildFile; fileRef = 146FA5A81378F6B0003627A3 /* HandleTypes.h */; settings = {ATTRIBUTES = (Private, ); }; }; + 10D58F5B1889C3DF00C05A0D /* Heap.h in Headers */ = {isa = PBXBuildFile; fileRef = 14BA7A9613AADFF8005B7C2C /* Heap.h */; settings = {ATTRIBUTES = (Private, ); }; }; + 10D58F5C1889C3DF00C05A0D /* HeapBlock.h in Headers */ = {isa = PBXBuildFile; fileRef = C2C8D02F14A3CEFC00578E65 /* HeapBlock.h */; settings = {ATTRIBUTES = (Private, ); }; }; + 10D58F5D1889C3DF00C05A0D /* HeapIterationScope.h in Headers */ = {isa = PBXBuildFile; fileRef = 2AD8932917E3868F00668276 /* HeapIterationScope.h */; }; + 10D58F5E1889C3DF00C05A0D /* HeapOperation.h in Headers */ = {isa = PBXBuildFile; fileRef = 2A6F462517E959CE00C45C98 /* HeapOperation.h */; settings = {ATTRIBUTES = (Private, ); }; }; + 10D58F5F1889C3DF00C05A0D /* HeapRootVisitor.h in Headers */ = {isa = PBXBuildFile; fileRef = 14F97446138C853E00DA1C67 /* HeapRootVisitor.h */; settings = {ATTRIBUTES = (Private, ); }; }; + 10D58F601889C3DF00C05A0D /* HeapStatistics.h in Headers */ = {isa = PBXBuildFile; fileRef = C24D31E1161CD695002AA4DB /* HeapStatistics.h */; settings = {ATTRIBUTES = (Private, ); }; }; + 10D58F611889C3DF00C05A0D /* FullBytecodeLiveness.h in Headers */ = {isa = PBXBuildFile; fileRef = 0F666EBF183566F900D017F1 /* FullBytecodeLiveness.h */; settings = {ATTRIBUTES = (Private, ); }; }; + 10D58F621889C3DF00C05A0D /* HeapTimer.h in Headers */ = {isa = PBXBuildFile; fileRef = C2E526BC1590EF000054E48D /* HeapTimer.h */; settings = {ATTRIBUTES = (Private, ); }; }; + 10D58F631889C3DF00C05A0D /* HostCallReturnValue.h in Headers */ = {isa = PBXBuildFile; fileRef = 0F4680D114BBC5F800BFE272 /* HostCallReturnValue.h */; settings = {ATTRIBUTES = (Private, ); }; }; + 10D58F641889C3DF00C05A0D /* Identifier.h in Headers */ = {isa = PBXBuildFile; fileRef = 933A349A038AE7C6008635CE /* Identifier.h */; settings = {ATTRIBUTES = (Private, ); }; }; + 10D58F651889C3DF00C05A0D /* IncrementalSweeper.h in Headers */ = {isa = PBXBuildFile; fileRef = C25F8BCC157544A900245B71 /* IncrementalSweeper.h */; settings = {ATTRIBUTES = (Private, ); }; }; + 10D58F661889C3DF00C05A0D /* IndexingHeader.h in Headers */ = {isa = PBXBuildFile; fileRef = 0FB7F38D15ED8E3800F167B2 /* IndexingHeader.h */; settings = {ATTRIBUTES = (Private, ); }; }; + 10D58F671889C3DF00C05A0D /* IndexingHeaderInlines.h in Headers */ = {isa = PBXBuildFile; fileRef = 0FB7F38E15ED8E3800F167B2 /* IndexingHeaderInlines.h */; settings = {ATTRIBUTES = (Private, ); }; }; + 10D58F681889C3DF00C05A0D /* IndexingType.h in Headers */ = {isa = PBXBuildFile; fileRef = 0FB7F38F15ED8E3800F167B2 /* IndexingType.h */; settings = {ATTRIBUTES = (Private, ); }; }; + 10D58F691889C3DF00C05A0D /* InitializeLLVM.h in Headers */ = {isa = PBXBuildFile; fileRef = 0FCEFAAE1805CA6D00472CE4 /* InitializeLLVM.h */; settings = {ATTRIBUTES = (Private, ); }; }; + 10D58F6A1889C3DF00C05A0D /* InitializeLLVMPOSIX.h in Headers */ = {isa = PBXBuildFile; fileRef = 0FCEFAC61805E75500472CE4 /* InitializeLLVMPOSIX.h */; settings = {ATTRIBUTES = (Private, ); }; }; + 10D58F6B1889C3DF00C05A0D /* InitializeThreading.h in Headers */ = {isa = PBXBuildFile; fileRef = E178633F0D9BEC0000D74E75 /* InitializeThreading.h */; settings = {ATTRIBUTES = (Private, ); }; }; + 10D58F6C1889C3DF00C05A0D /* InlineCallFrameSet.h in Headers */ = {isa = PBXBuildFile; fileRef = 0F24E55417F0B71C00ABB217 /* InlineCallFrameSet.h */; settings = {ATTRIBUTES = (Private, ); }; }; + 10D58F6D1889C3DF00C05A0D /* Instruction.h in Headers */ = {isa = PBXBuildFile; fileRef = 969A07930ED1D3AE00F1F681 /* Instruction.h */; settings = {ATTRIBUTES = (Private, ); }; }; + 10D58F6E1889C3DF00C05A0D /* Int16Array.h in Headers */ = {isa = PBXBuildFile; fileRef = A7A8AF2C17ADB5F3005AB174 /* Int16Array.h */; settings = {ATTRIBUTES = (Private, ); }; }; + 10D58F6F1889C3DF00C05A0D /* Int32Array.h in Headers */ = {isa = PBXBuildFile; fileRef = A7A8AF2D17ADB5F3005AB174 /* Int32Array.h */; settings = {ATTRIBUTES = (Private, ); }; }; + 10D58F701889C3DF00C05A0D /* Int8Array.h in Headers */ = {isa = PBXBuildFile; fileRef = A7A8AF2B17ADB5F3005AB174 /* Int8Array.h */; settings = {ATTRIBUTES = (Private, ); }; }; + 10D58F711889C3DF00C05A0D /* IntendedStructureChain.h in Headers */ = {isa = PBXBuildFile; fileRef = A78853F817972629001440E4 /* IntendedStructureChain.h */; settings = {ATTRIBUTES = (Private, ); }; }; + 10D58F721889C3DF00C05A0D /* InternalFunction.h in Headers */ = {isa = PBXBuildFile; fileRef = BC11667A0E199C05008066DD /* InternalFunction.h */; settings = {ATTRIBUTES = (Private, ); }; }; + 10D58F731889C3DF00C05A0D /* Interpreter.h in Headers */ = {isa = PBXBuildFile; fileRef = 1429D77B0ED20D7300B89619 /* Interpreter.h */; settings = {ATTRIBUTES = (Private, ); }; }; + 10D58F741889C3DF00C05A0D /* Intrinsic.h in Headers */ = {isa = PBXBuildFile; fileRef = 86BF642A148DB2B5004DE36A /* Intrinsic.h */; settings = {ATTRIBUTES = (Private, ); }; }; + 10D58F751889C3DF00C05A0D /* JavaScript.h in Headers */ = {isa = PBXBuildFile; fileRef = 1CAA8B4A0D32C39A0041BCFF /* JavaScript.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 10D58F761889C3DF00C05A0D /* JavaScriptCore.h in Headers */ = {isa = PBXBuildFile; fileRef = 1CAA8B4B0D32C39A0041BCFF /* JavaScriptCore.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 10D58F771889C3DF00C05A0D /* JavaScriptCorePrefix.h in Headers */ = {isa = PBXBuildFile; fileRef = F5C290E60284F98E018635CA /* JavaScriptCorePrefix.h */; }; + 10D58F781889C3DF00C05A0D /* JIT.h in Headers */ = {isa = PBXBuildFile; fileRef = 1429D92E0ED22D7000B89619 /* JIT.h */; }; + 10D58F791889C3DF00C05A0D /* JITCode.h in Headers */ = {isa = PBXBuildFile; fileRef = 86CCEFDD0F413F8900FD7F9E /* JITCode.h */; settings = {ATTRIBUTES = (Private, ); }; }; + 10D58F7A1889C3DF00C05A0D /* JITCompilationEffort.h in Headers */ = {isa = PBXBuildFile; fileRef = 0F0776BD14FF002800102332 /* JITCompilationEffort.h */; settings = {ATTRIBUTES = (Private, ); }; }; + 10D58F7B1889C3DF00C05A0D /* JITDisassembler.h in Headers */ = {isa = PBXBuildFile; fileRef = 0FAF7EFB165BA919000C8455 /* JITDisassembler.h */; settings = {ATTRIBUTES = (Private, ); }; }; + 10D58F7C1889C3DF00C05A0D /* RemoteInspectorDebuggable.h in Headers */ = {isa = PBXBuildFile; fileRef = A5BA15EF182345AF00A82E69 /* RemoteInspectorDebuggable.h */; settings = {ATTRIBUTES = (Private, ); }; }; + 10D58F7D1889C3DF00C05A0D /* JITExceptions.h in Headers */ = {isa = PBXBuildFile; fileRef = 0F46808014BA572700BFE272 /* JITExceptions.h */; settings = {ATTRIBUTES = (Private, ); }; }; + 10D58F7E1889C3DF00C05A0D /* DFGStrengthReductionPhase.h in Headers */ = {isa = PBXBuildFile; fileRef = 0FC20CB41852E2C600C9E954 /* DFGStrengthReductionPhase.h */; settings = {ATTRIBUTES = (Private, ); }; }; + 10D58F7F1889C3DF00C05A0D /* JITInlineCacheGenerator.h in Headers */ = {isa = PBXBuildFile; fileRef = 0FB14E1D18124ACE009B6B4D /* JITInlineCacheGenerator.h */; settings = {ATTRIBUTES = (Private, ); }; }; + 10D58F801889C3DF00C05A0D /* JITInlines.h in Headers */ = {isa = PBXBuildFile; fileRef = 86CC85A00EE79A4700288682 /* JITInlines.h */; }; + 10D58F811889C3DF00C05A0D /* JITOperations.h in Headers */ = {isa = PBXBuildFile; fileRef = 0F24E54617EE274900ABB217 /* JITOperations.h */; }; + 10D58F821889C3DF00C05A0D /* JSSetIterator.h in Headers */ = {isa = PBXBuildFile; fileRef = A790DD6A182F499700588807 /* JSSetIterator.h */; }; + 10D58F831889C3DF00C05A0D /* JITOperationWrappers.h in Headers */ = {isa = PBXBuildFile; fileRef = 0F24E54717EE274900ABB217 /* JITOperationWrappers.h */; }; + 10D58F841889C3DF00C05A0D /* JITStubRoutine.h in Headers */ = {isa = PBXBuildFile; fileRef = 0F766D1C15A5028D008F363E /* JITStubRoutine.h */; settings = {ATTRIBUTES = (Private, ); }; }; + 10D58F851889C3DF00C05A0D /* JITStubRoutineSet.h in Headers */ = {isa = PBXBuildFile; fileRef = 0F766D2A15A8CC34008F363E /* JITStubRoutineSet.h */; settings = {ATTRIBUTES = (Private, ); }; }; + 10D58F861889C3DF00C05A0D /* JITStubs.h in Headers */ = {isa = PBXBuildFile; fileRef = 14A6581A0F4E36F4000150FD /* JITStubs.h */; settings = {ATTRIBUTES = (Private, ); }; }; + 10D58F871889C3DF00C05A0D /* JITStubsARM.h in Headers */ = {isa = PBXBuildFile; fileRef = FEF6835A174343CC00A32E25 /* JITStubsARM.h */; settings = {ATTRIBUTES = (Private, ); }; }; + 10D58F881889C3DF00C05A0D /* JITStubsARMv7.h in Headers */ = {isa = PBXBuildFile; fileRef = FEF6835B174343CC00A32E25 /* JITStubsARMv7.h */; settings = {ATTRIBUTES = (Private, ); }; }; + 10D58F891889C3DF00C05A0D /* JITStubsX86.h in Headers */ = {isa = PBXBuildFile; fileRef = FEF6835D174343CC00A32E25 /* JITStubsX86.h */; settings = {ATTRIBUTES = (Private, ); }; }; + 10D58F8A1889C3DF00C05A0D /* JITStubsX86_64.h in Headers */ = {isa = PBXBuildFile; fileRef = FEF6835C174343CC00A32E25 /* JITStubsX86_64.h */; settings = {ATTRIBUTES = (Private, ); }; }; + 10D58F8B1889C3DF00C05A0D /* JITStubsX86Common.h in Headers */ = {isa = PBXBuildFile; fileRef = A7A4AE0C17973B4D005612B1 /* JITStubsX86Common.h */; }; + 10D58F8C1889C3DF00C05A0D /* JITThunks.h in Headers */ = {isa = PBXBuildFile; fileRef = 0F5EF91C16878F78003E5C25 /* JITThunks.h */; settings = {ATTRIBUTES = (Private, ); }; }; + 10D58F8D1889C3DF00C05A0D /* JITToDFGDeferredCompilationCallback.h in Headers */ = {isa = PBXBuildFile; fileRef = 0FC712E117CD878F008CC93C /* JITToDFGDeferredCompilationCallback.h */; settings = {ATTRIBUTES = (Private, ); }; }; + 10D58F8E1889C3DF00C05A0D /* JITWriteBarrier.h in Headers */ = {isa = PBXBuildFile; fileRef = A76F54A213B28AAB00EF2BCE /* JITWriteBarrier.h */; settings = {ATTRIBUTES = (Private, ); }; }; + 10D58F8F1889C3DF00C05A0D /* JSActivation.h in Headers */ = {isa = PBXBuildFile; fileRef = 14DA818E0D99FD2000B0A4FB /* JSActivation.h */; settings = {ATTRIBUTES = (); }; }; + 10D58F901889C3DF00C05A0D /* JSAPIValueWrapper.h in Headers */ = {isa = PBXBuildFile; fileRef = BC0894D60FAFBA2D00001865 /* JSAPIValueWrapper.h */; settings = {ATTRIBUTES = (Private, ); }; }; + 10D58F911889C3DF00C05A0D /* JSAPIWrapperObject.h in Headers */ = {isa = PBXBuildFile; fileRef = C2CF39C016E15A8100DD69BE /* JSAPIWrapperObject.h */; }; + 10D58F921889C3DF00C05A0D /* JSArgumentsIterator.h in Headers */ = {isa = PBXBuildFile; fileRef = A76140CC182982CB00750624 /* JSArgumentsIterator.h */; }; + 10D58F931889C3DF00C05A0D /* JSArray.h in Headers */ = {isa = PBXBuildFile; fileRef = 938772E5038BFE19008635CE /* JSArray.h */; settings = {ATTRIBUTES = (Private, ); }; }; + 10D58F941889C3DF00C05A0D /* JSArrayBuffer.h in Headers */ = {isa = PBXBuildFile; fileRef = 0F2B66B517B6B5AB00A7AE3F /* JSArrayBuffer.h */; settings = {ATTRIBUTES = (Private, ); }; }; + 10D58F951889C3DF00C05A0D /* JSArrayBufferConstructor.h in Headers */ = {isa = PBXBuildFile; fileRef = 0F2B66B717B6B5AB00A7AE3F /* JSArrayBufferConstructor.h */; settings = {ATTRIBUTES = (Private, ); }; }; + 10D58F961889C3DF00C05A0D /* JSArrayBufferPrototype.h in Headers */ = {isa = PBXBuildFile; fileRef = 0F2B66B917B6B5AB00A7AE3F /* JSArrayBufferPrototype.h */; settings = {ATTRIBUTES = (Private, ); }; }; + 10D58F971889C3DF00C05A0D /* JSArrayBufferView.h in Headers */ = {isa = PBXBuildFile; fileRef = 0F2B66BB17B6B5AB00A7AE3F /* JSArrayBufferView.h */; settings = {ATTRIBUTES = (Private, ); }; }; + 10D58F981889C3DF00C05A0D /* JSArrayBufferViewInlines.h in Headers */ = {isa = PBXBuildFile; fileRef = 0F2B66BC17B6B5AB00A7AE3F /* JSArrayBufferViewInlines.h */; settings = {ATTRIBUTES = (Private, ); }; }; + 10D58F991889C3DF00C05A0D /* JSArrayIterator.h in Headers */ = {isa = PBXBuildFile; fileRef = A7BDAEC517F4EA1400F6140C /* JSArrayIterator.h */; }; + 10D58F9A1889C3DF00C05A0D /* JSBase.h in Headers */ = {isa = PBXBuildFile; fileRef = 142711380A460BBB0080EEEA /* JSBase.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 10D58F9B1889C3DF00C05A0D /* RecursiveAllocationScope.h in Headers */ = {isa = PBXBuildFile; fileRef = 2AAD964918569417001F93BE /* RecursiveAllocationScope.h */; }; + 10D58F9C1889C3DF00C05A0D /* JSBasePrivate.h in Headers */ = {isa = PBXBuildFile; fileRef = 140D17D60E8AD4A9000CD17D /* JSBasePrivate.h */; settings = {ATTRIBUTES = (Private, ); }; }; + 10D58F9D1889C3DF00C05A0D /* JSBoundFunction.h in Headers */ = {isa = PBXBuildFile; fileRef = 86FA9E90142BBB2E001773B7 /* JSBoundFunction.h */; }; + 10D58F9E1889C3DF00C05A0D /* JSCallbackConstructor.h in Headers */ = {isa = PBXBuildFile; fileRef = 1440F8AC0A508D200005F061 /* JSCallbackConstructor.h */; }; + 10D58F9F1889C3DF00C05A0D /* JSCallbackFunction.h in Headers */ = {isa = PBXBuildFile; fileRef = 1440F88F0A508B100005F061 /* JSCallbackFunction.h */; }; + 10D58FA01889C3DF00C05A0D /* JSCallbackObject.h in Headers */ = {isa = PBXBuildFile; fileRef = 14ABDF5D0A437FEF00ECCA01 /* JSCallbackObject.h */; }; + 10D58FA11889C3DF00C05A0D /* JSCallbackObjectFunctions.h in Headers */ = {isa = PBXBuildFile; fileRef = A8E894310CD0602400367179 /* JSCallbackObjectFunctions.h */; }; + 10D58FA21889C3DF00C05A0D /* JSCell.h in Headers */ = {isa = PBXBuildFile; fileRef = BC1167D80E19BCC9008066DD /* JSCell.h */; settings = {ATTRIBUTES = (Private, ); }; }; + 10D58FA31889C3DF00C05A0D /* JSCellInlines.h in Headers */ = {isa = PBXBuildFile; fileRef = 0F97496F1687ADE200A4FF6A /* JSCellInlines.h */; settings = {ATTRIBUTES = (Private, ); }; }; + 10D58FA41889C3DF00C05A0D /* JSCJSValue.h in Headers */ = {isa = PBXBuildFile; fileRef = 14ABB36E099C076400E2A24F /* JSCJSValue.h */; settings = {ATTRIBUTES = (Private, ); }; }; + 10D58FA51889C3DF00C05A0D /* JSCJSValueInlines.h in Headers */ = {isa = PBXBuildFile; fileRef = 865A30F0135007E100CDB49E /* JSCJSValueInlines.h */; settings = {ATTRIBUTES = (Private, ); }; }; + 10D58FA61889C3DF00C05A0D /* JSClassRef.h in Headers */ = {isa = PBXBuildFile; fileRef = 1440FCE10A51E46B0005F061 /* JSClassRef.h */; settings = {ATTRIBUTES = (Private, ); }; }; + 10D58FA71889C3DF00C05A0D /* JSContext.h in Headers */ = {isa = PBXBuildFile; fileRef = 86E3C607167BAB87006D760A /* JSContext.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 10D58FA81889C3DF00C05A0D /* JSContextInternal.h in Headers */ = {isa = PBXBuildFile; fileRef = 86E3C609167BAB87006D760A /* JSContextInternal.h */; settings = {ATTRIBUTES = (Private, ); }; }; + 10D58FA91889C3DF00C05A0D /* JSContextRef.h in Headers */ = {isa = PBXBuildFile; fileRef = 14BD5A2A0A3E91F600BAF59C /* JSContextRef.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 10D58FAA1889C3DF00C05A0D /* JSContextRefPrivate.h in Headers */ = {isa = PBXBuildFile; fileRef = 148CD1D7108CF902008163C6 /* JSContextRefPrivate.h */; settings = {ATTRIBUTES = (Private, ); }; }; + 10D58FAB1889C3DF00C05A0D /* JSCTestRunnerUtils.h in Headers */ = {isa = PBXBuildFile; fileRef = A72028B51797601E0098028C /* JSCTestRunnerUtils.h */; settings = {ATTRIBUTES = (Private, ); }; }; + 10D58FAC1889C3DF00C05A0D /* JSDataView.h in Headers */ = {isa = PBXBuildFile; fileRef = 0F2B66BE17B6B5AB00A7AE3F /* JSDataView.h */; settings = {ATTRIBUTES = (Private, ); }; }; + 10D58FAD1889C3DF00C05A0D /* JSDataViewPrototype.h in Headers */ = {isa = PBXBuildFile; fileRef = 0F2B66C017B6B5AB00A7AE3F /* JSDataViewPrototype.h */; settings = {ATTRIBUTES = (Private, ); }; }; + 10D58FAE1889C3DF00C05A0D /* JSDateMath.h in Headers */ = {isa = PBXBuildFile; fileRef = 9788FC231471AD0C0068CE2D /* JSDateMath.h */; settings = {ATTRIBUTES = (Private, ); }; }; + 10D58FAF1889C3DF00C05A0D /* JSDestructibleObject.h in Headers */ = {isa = PBXBuildFile; fileRef = C2A7F687160432D400F76B98 /* JSDestructibleObject.h */; settings = {ATTRIBUTES = (Private, ); }; }; + 10D58FB01889C3DF00C05A0D /* JSExport.h in Headers */ = {isa = PBXBuildFile; fileRef = 86E3C60A167BAB87006D760A /* JSExport.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 10D58FB11889C3DF00C05A0D /* JSExportMacros.h in Headers */ = {isa = PBXBuildFile; fileRef = A7B4ACAE1484C9CE00B38A36 /* JSExportMacros.h */; settings = {ATTRIBUTES = (Private, ); }; }; + 10D58FB21889C3DF00C05A0D /* JSFloat32Array.h in Headers */ = {isa = PBXBuildFile; fileRef = 0F2B66C117B6B5AB00A7AE3F /* JSFloat32Array.h */; settings = {ATTRIBUTES = (Private, ); }; }; + 10D58FB31889C3DF00C05A0D /* JSFloat64Array.h in Headers */ = {isa = PBXBuildFile; fileRef = 0F2B66C217B6B5AB00A7AE3F /* JSFloat64Array.h */; settings = {ATTRIBUTES = (Private, ); }; }; + 10D58FB41889C3DF00C05A0D /* JSFunction.h in Headers */ = {isa = PBXBuildFile; fileRef = F692A85F0255597D01FF60F7 /* JSFunction.h */; settings = {ATTRIBUTES = (Private, ); }; }; + 10D58FB51889C3DF00C05A0D /* JSFunctionInlines.h in Headers */ = {isa = PBXBuildFile; fileRef = A72028B91797603D0098028C /* JSFunctionInlines.h */; settings = {ATTRIBUTES = (Private, ); }; }; + 10D58FB61889C3DF00C05A0D /* JSGenericTypedArrayView.h in Headers */ = {isa = PBXBuildFile; fileRef = 0F2B66C317B6B5AB00A7AE3F /* JSGenericTypedArrayView.h */; settings = {ATTRIBUTES = (Private, ); }; }; + 10D58FB71889C3DF00C05A0D /* JSGenericTypedArrayViewConstructor.h in Headers */ = {isa = PBXBuildFile; fileRef = 0F2B66C417B6B5AB00A7AE3F /* JSGenericTypedArrayViewConstructor.h */; settings = {ATTRIBUTES = (Private, ); }; }; + 10D58FB81889C3DF00C05A0D /* JSGenericTypedArrayViewConstructorInlines.h in Headers */ = {isa = PBXBuildFile; fileRef = 0F2B66C517B6B5AB00A7AE3F /* JSGenericTypedArrayViewConstructorInlines.h */; settings = {ATTRIBUTES = (Private, ); }; }; + 10D58FB91889C3DF00C05A0D /* JSGenericTypedArrayViewInlines.h in Headers */ = {isa = PBXBuildFile; fileRef = 0F2B66C617B6B5AB00A7AE3F /* JSGenericTypedArrayViewInlines.h */; settings = {ATTRIBUTES = (Private, ); }; }; + 10D58FBA1889C3DF00C05A0D /* JSGenericTypedArrayViewPrototype.h in Headers */ = {isa = PBXBuildFile; fileRef = 0F2B66C717B6B5AB00A7AE3F /* JSGenericTypedArrayViewPrototype.h */; settings = {ATTRIBUTES = (Private, ); }; }; + 10D58FBB1889C3DF00C05A0D /* JSGenericTypedArrayViewPrototypeInlines.h in Headers */ = {isa = PBXBuildFile; fileRef = 0F2B66C817B6B5AB00A7AE3F /* JSGenericTypedArrayViewPrototypeInlines.h */; settings = {ATTRIBUTES = (Private, ); }; }; + 10D58FBC1889C3DF00C05A0D /* JSGlobalObject.h in Headers */ = {isa = PBXBuildFile; fileRef = A8E894330CD0603F00367179 /* JSGlobalObject.h */; settings = {ATTRIBUTES = (Private, ); }; }; + 10D58FBD1889C3DF00C05A0D /* JSGlobalObjectFunctions.h in Headers */ = {isa = PBXBuildFile; fileRef = BC756FC70E2031B200DE7D12 /* JSGlobalObjectFunctions.h */; }; + 10D58FBE1889C3DF00C05A0D /* JSInt16Array.h in Headers */ = {isa = PBXBuildFile; fileRef = 0F2B66CA17B6B5AB00A7AE3F /* JSInt16Array.h */; settings = {ATTRIBUTES = (Private, ); }; }; + 10D58FBF1889C3DF00C05A0D /* JSInt32Array.h in Headers */ = {isa = PBXBuildFile; fileRef = 0F2B66CB17B6B5AB00A7AE3F /* JSInt32Array.h */; settings = {ATTRIBUTES = (Private, ); }; }; + 10D58FC01889C3DF00C05A0D /* JSInt8Array.h in Headers */ = {isa = PBXBuildFile; fileRef = 0F2B66C917B6B5AB00A7AE3F /* JSInt8Array.h */; settings = {ATTRIBUTES = (Private, ); }; }; + 10D58FC11889C3DF00C05A0D /* JSInterfaceJIT.h in Headers */ = {isa = PBXBuildFile; fileRef = A76C51741182748D00715B05 /* JSInterfaceJIT.h */; settings = {ATTRIBUTES = (Private, ); }; }; + 10D58FC21889C3DF00C05A0D /* JSLock.h in Headers */ = {isa = PBXBuildFile; fileRef = 65EA4C9A092AF9E20093D800 /* JSLock.h */; settings = {ATTRIBUTES = (Private, ); }; }; + 10D58FC31889C3DF00C05A0D /* JSManagedValue.h in Headers */ = {isa = PBXBuildFile; fileRef = C25D709A16DE99F400FCA6BC /* JSManagedValue.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 10D58FC41889C3DF00C05A0D /* JSMap.h in Headers */ = {isa = PBXBuildFile; fileRef = A700874017CBE8EB00C3E643 /* JSMap.h */; settings = {ATTRIBUTES = (Private, ); }; }; + 10D58FC51889C3DF00C05A0D /* JSNameScope.h in Headers */ = {isa = PBXBuildFile; fileRef = 14874AE015EBDE4A002E3587 /* JSNameScope.h */; settings = {ATTRIBUTES = (Private, ); }; }; + 10D58FC61889C3DF00C05A0D /* JSObject.h in Headers */ = {isa = PBXBuildFile; fileRef = BC22A3990E16E14800AF21C8 /* JSObject.h */; settings = {ATTRIBUTES = (Private, ); }; }; + 10D58FC71889C3DF00C05A0D /* JSObjectRef.h in Headers */ = {isa = PBXBuildFile; fileRef = 1482B7E10A43076000517CFC /* JSObjectRef.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 10D58FC81889C3DF00C05A0D /* JSObjectRefPrivate.h in Headers */ = {isa = PBXBuildFile; fileRef = A79EDB0811531CD60019E912 /* JSObjectRefPrivate.h */; settings = {ATTRIBUTES = (Private, ); }; }; + 10D58FC91889C3DF00C05A0D /* JSONObject.h in Headers */ = {isa = PBXBuildFile; fileRef = A7F9935D0FD7325100A0B2D0 /* JSONObject.h */; settings = {ATTRIBUTES = (Private, ); }; }; + 10D58FCA1889C3DF00C05A0D /* JSONObject.lut.h in Headers */ = {isa = PBXBuildFile; fileRef = BC87CDB810712ACA000614CF /* JSONObject.lut.h */; }; + 10D58FCB1889C3DF00C05A0D /* JSProfilerPrivate.h in Headers */ = {isa = PBXBuildFile; fileRef = 952C63AC0E4777D600C13936 /* JSProfilerPrivate.h */; settings = {ATTRIBUTES = (Private, ); }; }; + 10D58FCC1889C3DF00C05A0D /* JSPromise.h in Headers */ = {isa = PBXBuildFile; fileRef = 7C184E1917BEDBD3007CB63A /* JSPromise.h */; settings = {ATTRIBUTES = (Private, ); }; }; + 10D58FCD1889C3DF00C05A0D /* JSPromiseConstructor.h in Headers */ = {isa = PBXBuildFile; fileRef = 7C184E2117BEE240007CB63A /* JSPromiseConstructor.h */; }; + 10D58FCE1889C3DF00C05A0D /* JSPromisePrototype.h in Headers */ = {isa = PBXBuildFile; fileRef = 7C184E1D17BEE22E007CB63A /* JSPromisePrototype.h */; }; + 10D58FCF1889C3DF00C05A0D /* JSMapIterator.h in Headers */ = {isa = PBXBuildFile; fileRef = A74DEF90182D991400522C22 /* JSMapIterator.h */; }; + 10D58FD01889C3DF00C05A0D /* JSProxy.h in Headers */ = {isa = PBXBuildFile; fileRef = 862553CF16136AA5009F17D0 /* JSProxy.h */; settings = {ATTRIBUTES = (Private, ); }; }; + 10D58FD11889C3DF00C05A0D /* JSRetainPtr.h in Headers */ = {isa = PBXBuildFile; fileRef = 95C18D3E0C90E7EF00E72F73 /* JSRetainPtr.h */; settings = {ATTRIBUTES = (Private, ); }; }; + 10D58FD21889C3DF00C05A0D /* JSScope.h in Headers */ = {isa = PBXBuildFile; fileRef = 14874AE215EBDE4A002E3587 /* JSScope.h */; settings = {ATTRIBUTES = (Private, ); }; }; + 10D58FD31889C3DF00C05A0D /* JSScriptRefPrivate.h in Headers */ = {isa = PBXBuildFile; fileRef = A7C0C4AB167C08CD0017011D /* JSScriptRefPrivate.h */; settings = {ATTRIBUTES = (Private, ); }; }; + 10D58FD41889C3DF00C05A0D /* JSSegmentedVariableObject.h in Headers */ = {isa = PBXBuildFile; fileRef = 0F919D0F157F3327004A4E7D /* JSSegmentedVariableObject.h */; settings = {ATTRIBUTES = (Private, ); }; }; + 10D58FD51889C3DF00C05A0D /* JSSet.h in Headers */ = {isa = PBXBuildFile; fileRef = A7299D9C17D12837005F5FF9 /* JSSet.h */; settings = {ATTRIBUTES = (Private, ); }; }; + 10D58FD61889C3DF00C05A0D /* DFGArithMode.h in Headers */ = {isa = PBXBuildFile; fileRef = 0F485320187750560083B687 /* DFGArithMode.h */; settings = {ATTRIBUTES = (Private, ); }; }; + 10D58FD71889C3DF00C05A0D /* JSStack.h in Headers */ = {isa = PBXBuildFile; fileRef = 14D792640DAA03FB001A9F05 /* JSStack.h */; settings = {ATTRIBUTES = (Private, ); }; }; + 10D58FD81889C3DF00C05A0D /* JSStackInlines.h in Headers */ = {isa = PBXBuildFile; fileRef = A7C1EAEB17987AB600299DB2 /* JSStackInlines.h */; }; + 10D58FD91889C3DF00C05A0D /* JSString.h in Headers */ = {isa = PBXBuildFile; fileRef = F692A8620255597D01FF60F7 /* JSString.h */; settings = {ATTRIBUTES = (Private, ); }; }; + 10D58FDA1889C3DF00C05A0D /* JSStringBuilder.h in Headers */ = {isa = PBXBuildFile; fileRef = 86E85538111B9968001AF51E /* JSStringBuilder.h */; }; + 10D58FDB1889C3DF00C05A0D /* JSStringJoiner.h in Headers */ = {isa = PBXBuildFile; fileRef = 2600B5A5152BAAA70091EE5F /* JSStringJoiner.h */; }; + 10D58FDC1889C3DF00C05A0D /* JSStringRef.h in Headers */ = {isa = PBXBuildFile; fileRef = 1482B74B0A43032800517CFC /* JSStringRef.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 10D58FDD1889C3DF00C05A0D /* JSStringRefCF.h in Headers */ = {isa = PBXBuildFile; fileRef = 146AAB2A0B66A84900E55F16 /* JSStringRefCF.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 10D58FDE1889C3DF00C05A0D /* JSStringRefPrivate.h in Headers */ = {isa = PBXBuildFile; fileRef = 1A28D4A7177B71C80007FA3C /* JSStringRefPrivate.h */; settings = {ATTRIBUTES = (Private, ); }; }; + 10D58FDF1889C3DF00C05A0D /* JSSymbolTableObject.h in Headers */ = {isa = PBXBuildFile; fileRef = 0F919D0A157EE09D004A4E7D /* JSSymbolTableObject.h */; settings = {ATTRIBUTES = (Private, ); }; }; + 10D58FE01889C3DF00C05A0D /* JSType.h in Headers */ = {isa = PBXBuildFile; fileRef = 14ABB454099C2A0F00E2A24F /* JSType.h */; settings = {ATTRIBUTES = (Private, ); }; }; + 10D58FE11889C3DF00C05A0D /* JSTypedArrayConstructors.h in Headers */ = {isa = PBXBuildFile; fileRef = 0F2B66CD17B6B5AB00A7AE3F /* JSTypedArrayConstructors.h */; settings = {ATTRIBUTES = (Private, ); }; }; + 10D58FE21889C3DF00C05A0D /* JSTypedArrayPrototypes.h in Headers */ = {isa = PBXBuildFile; fileRef = 0F2B66CF17B6B5AB00A7AE3F /* JSTypedArrayPrototypes.h */; settings = {ATTRIBUTES = (Private, ); }; }; + 10D58FE31889C3DF00C05A0D /* JSTypedArrays.h in Headers */ = {isa = PBXBuildFile; fileRef = 0F2B66D117B6B5AB00A7AE3F /* JSTypedArrays.h */; settings = {ATTRIBUTES = (Private, ); }; }; + 10D58FE41889C3DF00C05A0D /* JSTypeInfo.h in Headers */ = {isa = PBXBuildFile; fileRef = 6507D2970E871E4A00D7D896 /* JSTypeInfo.h */; settings = {ATTRIBUTES = (Private, ); }; }; + 10D58FE51889C3DF00C05A0D /* JSUint16Array.h in Headers */ = {isa = PBXBuildFile; fileRef = 0F2B66D417B6B5AB00A7AE3F /* JSUint16Array.h */; settings = {ATTRIBUTES = (Private, ); }; }; + 10D58FE61889C3DF00C05A0D /* JSUint32Array.h in Headers */ = {isa = PBXBuildFile; fileRef = 0F2B66D517B6B5AB00A7AE3F /* JSUint32Array.h */; settings = {ATTRIBUTES = (Private, ); }; }; + 10D58FE71889C3DF00C05A0D /* JSUint8Array.h in Headers */ = {isa = PBXBuildFile; fileRef = 0F2B66D217B6B5AB00A7AE3F /* JSUint8Array.h */; settings = {ATTRIBUTES = (Private, ); }; }; + 10D58FE81889C3DF00C05A0D /* JSUint8ClampedArray.h in Headers */ = {isa = PBXBuildFile; fileRef = 0F2B66D317B6B5AB00A7AE3F /* JSUint8ClampedArray.h */; settings = {ATTRIBUTES = (Private, ); }; }; + 10D58FE91889C3DF00C05A0D /* JSValue.h in Headers */ = {isa = PBXBuildFile; fileRef = 86E3C606167BAB87006D760A /* JSValue.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 10D58FEA1889C3DF00C05A0D /* JSValueInternal.h in Headers */ = {isa = PBXBuildFile; fileRef = 86E3C60E167BAB87006D760A /* JSValueInternal.h */; settings = {ATTRIBUTES = (Private, ); }; }; + 10D58FEB1889C3DF00C05A0D /* JSValueRef.h in Headers */ = {isa = PBXBuildFile; fileRef = 1482B6EA0A4300B300517CFC /* JSValueRef.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 10D58FEC1889C3DF00C05A0D /* JSVariableObject.h in Headers */ = {isa = PBXBuildFile; fileRef = 14F252560D08DD8D004ECFFF /* JSVariableObject.h */; settings = {ATTRIBUTES = (Private, ); }; }; + 10D58FED1889C3DF00C05A0D /* JSVirtualMachine.h in Headers */ = {isa = PBXBuildFile; fileRef = 86E3C60F167BAB87006D760A /* JSVirtualMachine.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 10D58FEE1889C3DF00C05A0D /* JSVirtualMachineInternal.h in Headers */ = {isa = PBXBuildFile; fileRef = 86E3C611167BAB87006D760A /* JSVirtualMachineInternal.h */; settings = {ATTRIBUTES = (Private, ); }; }; + 10D58FEF1889C3DF00C05A0D /* JSWeakMap.h in Headers */ = {isa = PBXBuildFile; fileRef = A7CA3AE217DA41AE006538AF /* JSWeakMap.h */; }; + 10D58FF01889C3DF00C05A0D /* JSWeakObjectMapRefInternal.h in Headers */ = {isa = PBXBuildFile; fileRef = A7482E37116A697B003B0712 /* JSWeakObjectMapRefInternal.h */; settings = {ATTRIBUTES = (Private, ); }; }; + 10D58FF11889C3DF00C05A0D /* JSWeakObjectMapRefPrivate.h in Headers */ = {isa = PBXBuildFile; fileRef = A7482B791166CDEA003B0712 /* JSWeakObjectMapRefPrivate.h */; settings = {ATTRIBUTES = (Private, ); }; }; + 10D58FF21889C3DF00C05A0D /* JSWithScope.h in Headers */ = {isa = PBXBuildFile; fileRef = 1442566015EDE98D0066A49B /* JSWithScope.h */; settings = {ATTRIBUTES = (Private, ); }; }; + 10D58FF31889C3DF00C05A0D /* JSWrapperMap.h in Headers */ = {isa = PBXBuildFile; fileRef = 86E3C60C167BAB87006D760A /* JSWrapperMap.h */; }; + 10D58FF41889C3DF00C05A0D /* JSWrapperObject.h in Headers */ = {isa = PBXBuildFile; fileRef = 65C7A1720A8EAACB00FA37EA /* JSWrapperObject.h */; settings = {ATTRIBUTES = (Private, ); }; }; + 10D58FF51889C3DF00C05A0D /* JumpTable.h in Headers */ = {isa = PBXBuildFile; fileRef = BCFD8C910EEB2EE700283848 /* JumpTable.h */; settings = {ATTRIBUTES = (Private, ); }; }; + 10D58FF61889C3DF00C05A0D /* MapIteratorPrototype.h in Headers */ = {isa = PBXBuildFile; fileRef = A74DEF8E182D991400522C22 /* MapIteratorPrototype.h */; }; + 10D58FF71889C3DF00C05A0D /* KeywordLookup.h in Headers */ = {isa = PBXBuildFile; fileRef = A7C225CD1399849C00FF1662 /* KeywordLookup.h */; }; + 10D58FF81889C3DF00C05A0D /* Label.h in Headers */ = {isa = PBXBuildFile; fileRef = 969A07270ED1CE6900F1F681 /* Label.h */; }; + 10D58FF91889C3DF00C05A0D /* LabelScope.h in Headers */ = {isa = PBXBuildFile; fileRef = 960097A50EBABB58007A7297 /* LabelScope.h */; }; + 10D58FFA1889C3DF00C05A0D /* LazyOperandValueProfile.h in Headers */ = {isa = PBXBuildFile; fileRef = 0FB5467614F59AD1002C2989 /* LazyOperandValueProfile.h */; settings = {ATTRIBUTES = (Private, ); }; }; + 10D58FFB1889C3DF00C05A0D /* LegacyProfiler.h in Headers */ = {isa = PBXBuildFile; fileRef = 95AB832F0DA42CAD00BC83F3 /* LegacyProfiler.h */; settings = {ATTRIBUTES = (Private, ); }; }; + 10D58FFC1889C3DF00C05A0D /* Lexer.h in Headers */ = {isa = PBXBuildFile; fileRef = F692A8660255597D01FF60F7 /* Lexer.h */; settings = {ATTRIBUTES = (Private, ); }; }; + 10D58FFD1889C3DF00C05A0D /* Lexer.lut.h in Headers */ = {isa = PBXBuildFile; fileRef = BC18C52D0E16FCE100B34460 /* Lexer.lut.h */; }; + 10D58FFE1889C3DF00C05A0D /* InjectedScriptManager.h in Headers */ = {isa = PBXBuildFile; fileRef = A513E5C9185F9624007E95AD /* InjectedScriptManager.h */; settings = {ATTRIBUTES = (Private, ); }; }; + 10D58FFF1889C3DF00C05A0D /* LineInfo.h in Headers */ = {isa = PBXBuildFile; fileRef = 0F0B83AC14BCF60200885B4F /* LineInfo.h */; settings = {ATTRIBUTES = (Private, ); }; }; + 10D590001889C3DF00C05A0D /* LinkBuffer.h in Headers */ = {isa = PBXBuildFile; fileRef = 86D3B3C110159D7F002865E7 /* LinkBuffer.h */; settings = {ATTRIBUTES = (Private, ); }; }; + 10D590011889C3DF00C05A0D /* ListableHandler.h in Headers */ = {isa = PBXBuildFile; fileRef = 0F431736146BAC65007E3890 /* ListableHandler.h */; settings = {ATTRIBUTES = (Private, ); }; }; + 10D590021889C3DF00C05A0D /* LiteralParser.h in Headers */ = {isa = PBXBuildFile; fileRef = A7E2EA690FB460CF00601F06 /* LiteralParser.h */; }; + 10D590031889C3DF00C05A0D /* LLIntCallLinkInfo.h in Headers */ = {isa = PBXBuildFile; fileRef = 0F0FC45814BD15F100B81154 /* LLIntCallLinkInfo.h */; settings = {ATTRIBUTES = (Private, ); }; }; + 10D590041889C3DF00C05A0D /* LLIntCLoop.h in Headers */ = {isa = PBXBuildFile; fileRef = FE20CE9C15F04A9500DF3430 /* LLIntCLoop.h */; settings = {ATTRIBUTES = (Private, ); }; }; + 10D590051889C3DF00C05A0D /* LLIntCommon.h in Headers */ = {isa = PBXBuildFile; fileRef = 0F4680C514BBB16900BFE272 /* LLIntCommon.h */; settings = {ATTRIBUTES = (Private, ); }; }; + 10D590061889C3DF00C05A0D /* LLIntData.h in Headers */ = {isa = PBXBuildFile; fileRef = 0F4680CF14BBB3D100BFE272 /* LLIntData.h */; settings = {ATTRIBUTES = (Private, ); }; }; + 10D590071889C3DF00C05A0D /* LLIntEntrypoint.h in Headers */ = {isa = PBXBuildFile; fileRef = 0F38B01017CF077F00B144D3 /* LLIntEntrypoint.h */; settings = {ATTRIBUTES = (Private, ); }; }; + 10D590081889C3DF00C05A0D /* LLIntExceptions.h in Headers */ = {isa = PBXBuildFile; fileRef = 0F46809E14BA7F8200BFE272 /* LLIntExceptions.h */; settings = {ATTRIBUTES = (Private, ); }; }; + 10D590091889C3DF00C05A0D /* LLIntOfflineAsmConfig.h in Headers */ = {isa = PBXBuildFile; fileRef = 0F4680C614BBB16900BFE272 /* LLIntOfflineAsmConfig.h */; settings = {ATTRIBUTES = (Private, ); }; }; + 10D5900A1889C3DF00C05A0D /* LLIntOpcode.h in Headers */ = {isa = PBXBuildFile; fileRef = FED287B115EC9A5700DA8161 /* LLIntOpcode.h */; settings = {ATTRIBUTES = (Private, ); }; }; + 10D5900B1889C3DF00C05A0D /* JSPromiseDeferred.h in Headers */ = {isa = PBXBuildFile; fileRef = 7C008CD9187124BB00955C24 /* JSPromiseDeferred.h */; settings = {ATTRIBUTES = (Private, ); }; }; + 10D5900C1889C3DF00C05A0D /* LLIntSlowPaths.h in Headers */ = {isa = PBXBuildFile; fileRef = 0F4680A014BA7F8200BFE272 /* LLIntSlowPaths.h */; settings = {ATTRIBUTES = (Private, ); }; }; + 10D5900D1889C3DF00C05A0D /* LLIntThunks.h in Headers */ = {isa = PBXBuildFile; fileRef = 0F0B839814BCF45A00885B4F /* LLIntThunks.h */; settings = {ATTRIBUTES = (Private, ); }; }; + 10D5900E1889C3DF00C05A0D /* LLVMAPI.h in Headers */ = {isa = PBXBuildFile; fileRef = 0FCEFAC81805E75500472CE4 /* LLVMAPI.h */; settings = {ATTRIBUTES = (Private, ); }; }; + 10D5900F1889C3DF00C05A0D /* LLVMAPIFunctions.h in Headers */ = {isa = PBXBuildFile; fileRef = 0FCEFAC91805E75500472CE4 /* LLVMAPIFunctions.h */; settings = {ATTRIBUTES = (Private, ); }; }; + 10D590101889C3DF00C05A0D /* LLVMDisassembler.h in Headers */ = {isa = PBXBuildFile; fileRef = A7E5AB341799E4B200D2833D /* LLVMDisassembler.h */; settings = {ATTRIBUTES = (Private, ); }; }; + 10D590111889C3DF00C05A0D /* LLVMHeaders.h in Headers */ = {isa = PBXBuildFile; fileRef = 0FCEFAD21805EDCC00472CE4 /* LLVMHeaders.h */; settings = {ATTRIBUTES = (Private, ); }; }; + 10D590121889C3DF00C05A0D /* Local.h in Headers */ = {isa = PBXBuildFile; fileRef = 142E3130134FF0A600AFADB5 /* Local.h */; }; + 10D590131889C3DF00C05A0D /* LocalScope.h in Headers */ = {isa = PBXBuildFile; fileRef = 142E3131134FF0A600AFADB5 /* LocalScope.h */; }; + 10D590141889C3DF00C05A0D /* Lookup.h in Headers */ = {isa = PBXBuildFile; fileRef = F692A8690255597D01FF60F7 /* Lookup.h */; settings = {ATTRIBUTES = (Private, ); }; }; + 10D590151889C3DF00C05A0D /* LowLevelInterpreter.h in Headers */ = {isa = PBXBuildFile; fileRef = 0F4680C814BBB16900BFE272 /* LowLevelInterpreter.h */; settings = {ATTRIBUTES = (Private, ); }; }; + 10D590161889C3DF00C05A0D /* MachineStackMarker.h in Headers */ = {isa = PBXBuildFile; fileRef = 14B7234012D7D0DA003BD5ED /* MachineStackMarker.h */; settings = {ATTRIBUTES = (Private, ); }; }; + 10D590171889C3DF00C05A0D /* MacroAssembler.h in Headers */ = {isa = PBXBuildFile; fileRef = 86C36EE90EE1289D00B3DF59 /* MacroAssembler.h */; settings = {ATTRIBUTES = (Private, ); }; }; + 10D590181889C3DF00C05A0D /* MacroAssemblerARM.h in Headers */ = {isa = PBXBuildFile; fileRef = 86D3B2C210156BDE002865E7 /* MacroAssemblerARM.h */; settings = {ATTRIBUTES = (Private, ); }; }; + 10D590191889C3DF00C05A0D /* MacroAssemblerARMv7.h in Headers */ = {isa = PBXBuildFile; fileRef = 86ADD1440FDDEA980006EEC2 /* MacroAssemblerARMv7.h */; settings = {ATTRIBUTES = (Private, ); }; }; + 10D5901A1889C3DF00C05A0D /* MacroAssemblerCodeRef.h in Headers */ = {isa = PBXBuildFile; fileRef = 863B23DF0FC60E6200703AA4 /* MacroAssemblerCodeRef.h */; settings = {ATTRIBUTES = (Private, ); }; }; + 10D5901B1889C3DF00C05A0D /* InspectorJSFrontendDispatchers.h in Headers */ = {isa = PBXBuildFile; fileRef = A532438418568317002ED692 /* InspectorJSFrontendDispatchers.h */; settings = {ATTRIBUTES = (Private, ); }; }; + 10D5901C1889C3DF00C05A0D /* MacroAssemblerMIPS.h in Headers */ = {isa = PBXBuildFile; fileRef = 86C568DE11A213EE0007F7F0 /* MacroAssemblerMIPS.h */; settings = {ATTRIBUTES = (Private, ); }; }; + 10D5901D1889C3DF00C05A0D /* MacroAssemblerSH4.h in Headers */ = {isa = PBXBuildFile; fileRef = 86AE64A6135E5E1C00963012 /* MacroAssemblerSH4.h */; settings = {ATTRIBUTES = (Private, ); }; }; + 10D5901E1889C3DF00C05A0D /* MacroAssemblerX86.h in Headers */ = {isa = PBXBuildFile; fileRef = 860161E00F3A83C100F84710 /* MacroAssemblerX86.h */; settings = {ATTRIBUTES = (Private, ); }; }; + 10D5901F1889C3DF00C05A0D /* MacroAssemblerX86_64.h in Headers */ = {isa = PBXBuildFile; fileRef = 860161E10F3A83C100F84710 /* MacroAssemblerX86_64.h */; settings = {ATTRIBUTES = (Private, ); }; }; + 10D590201889C3DF00C05A0D /* MacroAssemblerX86Common.h in Headers */ = {isa = PBXBuildFile; fileRef = 860161E20F3A83C100F84710 /* MacroAssemblerX86Common.h */; settings = {ATTRIBUTES = (Private, ); }; }; + 10D590211889C3DF00C05A0D /* MapConstructor.h in Headers */ = {isa = PBXBuildFile; fileRef = A700873817CBE85300C3E643 /* MapConstructor.h */; }; + 10D590221889C3DF00C05A0D /* MapData.h in Headers */ = {isa = PBXBuildFile; fileRef = A78507D517CBC6FD0011F6E7 /* MapData.h */; settings = {ATTRIBUTES = (Private, ); }; }; + 10D590231889C3DF00C05A0D /* MapPrototype.h in Headers */ = {isa = PBXBuildFile; fileRef = A700873C17CBE8D300C3E643 /* MapPrototype.h */; }; + 10D590241889C3DF00C05A0D /* MarkedAllocator.h in Headers */ = {isa = PBXBuildFile; fileRef = C2B916C114DA014E00CBAC86 /* MarkedAllocator.h */; settings = {ATTRIBUTES = (Private, ); }; }; + 10D590251889C3DF00C05A0D /* JSGlobalObjectInspectorController.h in Headers */ = {isa = PBXBuildFile; fileRef = A51007BF187CC3C600B38879 /* JSGlobalObjectInspectorController.h */; }; + 10D590261889C3DF00C05A0D /* MarkedBlock.h in Headers */ = {isa = PBXBuildFile; fileRef = 142D6F0713539A2800B02E86 /* MarkedBlock.h */; settings = {ATTRIBUTES = (Private, ); }; }; + 10D590271889C3DF00C05A0D /* MarkedBlockSet.h in Headers */ = {isa = PBXBuildFile; fileRef = 141448CA13A176EC00F5BA1A /* MarkedBlockSet.h */; settings = {ATTRIBUTES = (Private, ); }; }; + 10D590281889C3DF00C05A0D /* MarkedSpace.h in Headers */ = {isa = PBXBuildFile; fileRef = 14D2F3D9139F4BE200491031 /* MarkedSpace.h */; settings = {ATTRIBUTES = (Private, ); }; }; + 10D590291889C3DF00C05A0D /* MarkStack.h in Headers */ = {isa = PBXBuildFile; fileRef = 142D6F0F13539A4100B02E86 /* MarkStack.h */; settings = {ATTRIBUTES = (Private, ); }; }; + 10D5902A1889C3DF00C05A0D /* MarkStackInlines.h in Headers */ = {isa = PBXBuildFile; fileRef = C21122E015DD9AB300790E3A /* MarkStackInlines.h */; settings = {ATTRIBUTES = (Private, ); }; }; + 10D5902B1889C3DF00C05A0D /* InspectorFrontendChannel.h in Headers */ = {isa = PBXBuildFile; fileRef = A5945594182479EB00CC3843 /* InspectorFrontendChannel.h */; settings = {ATTRIBUTES = (Private, ); }; }; + 10D5902C1889C3DF00C05A0D /* MatchResult.h in Headers */ = {isa = PBXBuildFile; fileRef = 8612E4CB1522918400C836BE /* MatchResult.h */; settings = {ATTRIBUTES = (Private, ); }; }; + 10D5902D1889C3DF00C05A0D /* InjectedScriptModule.h in Headers */ = {isa = PBXBuildFile; fileRef = A5840E1F187B7B8600843B10 /* InjectedScriptModule.h */; settings = {ATTRIBUTES = (Private, ); }; }; + 10D5902E1889C3DF00C05A0D /* MathObject.h in Headers */ = {isa = PBXBuildFile; fileRef = F692A86B0255597D01FF60F7 /* MathObject.h */; settings = {ATTRIBUTES = (Private, ); }; }; + 10D5902F1889C3DF00C05A0D /* MemoryStatistics.h in Headers */ = {isa = PBXBuildFile; fileRef = 90213E3C123A40C200D422F3 /* MemoryStatistics.h */; settings = {ATTRIBUTES = (Private, ); }; }; + 10D590301889C3DF00C05A0D /* MethodOfGettingAValueProfile.h in Headers */ = {isa = PBXBuildFile; fileRef = 0FB5467A14F5C7D4002C2989 /* MethodOfGettingAValueProfile.h */; settings = {ATTRIBUTES = (Private, ); }; }; + 10D590311889C3DF00C05A0D /* MIPSAssembler.h in Headers */ = {isa = PBXBuildFile; fileRef = 86C568DF11A213EE0007F7F0 /* MIPSAssembler.h */; settings = {ATTRIBUTES = (Private, ); }; }; + 10D590321889C3DF00C05A0D /* NameConstructor.h in Headers */ = {isa = PBXBuildFile; fileRef = 86EBF2FA1560F036008E9222 /* NameConstructor.h */; }; + 10D590331889C3DF00C05A0D /* SetIteratorPrototype.h in Headers */ = {isa = PBXBuildFile; fileRef = A790DD68182F499700588807 /* SetIteratorPrototype.h */; }; + 10D590341889C3DF00C05A0D /* NameInstance.h in Headers */ = {isa = PBXBuildFile; fileRef = 86EBF2FC1560F036008E9222 /* NameInstance.h */; }; + 10D590351889C3DF00C05A0D /* NamePrototype.h in Headers */ = {isa = PBXBuildFile; fileRef = 86EBF2FE1560F036008E9222 /* NamePrototype.h */; }; + 10D590361889C3DF00C05A0D /* NativeErrorConstructor.h in Headers */ = {isa = PBXBuildFile; fileRef = BC02E9090E1839DB000F9297 /* NativeErrorConstructor.h */; }; + 10D590371889C3DF00C05A0D /* NativeErrorPrototype.h in Headers */ = {isa = PBXBuildFile; fileRef = BC02E90B0E1839DB000F9297 /* NativeErrorPrototype.h */; }; + 10D590381889C3DF00C05A0D /* NodeConstructors.h in Headers */ = {isa = PBXBuildFile; fileRef = 930DAD030FB1EB1A0082D205 /* NodeConstructors.h */; settings = {ATTRIBUTES = (Private, ); }; }; + 10D590391889C3DF00C05A0D /* NodeInfo.h in Headers */ = {isa = PBXBuildFile; fileRef = 7EFF00630EC05A9A00AA7C93 /* NodeInfo.h */; settings = {ATTRIBUTES = (Private, ); }; }; + 10D5903A1889C3DF00C05A0D /* Nodes.h in Headers */ = {isa = PBXBuildFile; fileRef = F692A86E0255597D01FF60F7 /* Nodes.h */; settings = {ATTRIBUTES = (Private, ); }; }; + 10D5903B1889C3DF00C05A0D /* NumberConstructor.h in Headers */ = {isa = PBXBuildFile; fileRef = BC2680C30E16D4E900A06E92 /* NumberConstructor.h */; }; + 10D5903C1889C3DF00C05A0D /* NumberConstructor.lut.h in Headers */ = {isa = PBXBuildFile; fileRef = BC2680E60E16D52300A06E92 /* NumberConstructor.lut.h */; }; + 10D5903D1889C3DF00C05A0D /* NumberObject.h in Headers */ = {isa = PBXBuildFile; fileRef = F692A8710255597D01FF60F7 /* NumberObject.h */; settings = {ATTRIBUTES = (Private, ); }; }; + 10D5903E1889C3DF00C05A0D /* NumberPrototype.h in Headers */ = {isa = PBXBuildFile; fileRef = BC2680C50E16D4E900A06E92 /* NumberPrototype.h */; settings = {ATTRIBUTES = (Private, ); }; }; + 10D5903F1889C3DF00C05A0D /* NumericStrings.h in Headers */ = {isa = PBXBuildFile; fileRef = 142D3938103E4560007DCB52 /* NumericStrings.h */; settings = {ATTRIBUTES = (Private, ); }; }; + 10D590401889C3DF00C05A0D /* ObjCCallbackFunction.h in Headers */ = {isa = PBXBuildFile; fileRef = 86F3EEB9168CCF750077B92A /* ObjCCallbackFunction.h */; }; + 10D590411889C3DF00C05A0D /* ObjcRuntimeExtras.h in Headers */ = {isa = PBXBuildFile; fileRef = 86F3EEB616855A5B0077B92A /* ObjcRuntimeExtras.h */; }; + 10D590421889C3DF00C05A0D /* ObjectAllocationProfile.h in Headers */ = {isa = PBXBuildFile; fileRef = 14CA958C16AB50FA00938A06 /* ObjectAllocationProfile.h */; settings = {ATTRIBUTES = (Private, ); }; }; + 10D590431889C3DF00C05A0D /* ObjectConstructor.h in Headers */ = {isa = PBXBuildFile; fileRef = BC2680C70E16D4E900A06E92 /* ObjectConstructor.h */; settings = {ATTRIBUTES = (Private, ); }; }; + 10D590441889C3DF00C05A0D /* ObjectPrototype.h in Headers */ = {isa = PBXBuildFile; fileRef = BC2680C90E16D4E900A06E92 /* ObjectPrototype.h */; settings = {ATTRIBUTES = (Private, ); }; }; + 10D590451889C3DF00C05A0D /* OpaqueJSString.h in Headers */ = {isa = PBXBuildFile; fileRef = E124A8F50E555775003091F1 /* OpaqueJSString.h */; settings = {ATTRIBUTES = (Private, ); }; }; + 10D590461889C3DF00C05A0D /* Opcode.h in Headers */ = {isa = PBXBuildFile; fileRef = 969A07950ED1D3AE00F1F681 /* Opcode.h */; settings = {ATTRIBUTES = (Private, ); }; }; + 10D590471889C3DF00C05A0D /* Operands.h in Headers */ = {isa = PBXBuildFile; fileRef = 0F2BDC2B151FDE8B00CD8910 /* Operands.h */; settings = {ATTRIBUTES = (Private, ); }; }; + 10D590481889C3DF00C05A0D /* ARM64Assembler.h in Headers */ = {isa = PBXBuildFile; fileRef = 8640923B156EED3B00566CB2 /* ARM64Assembler.h */; settings = {ATTRIBUTES = (Private, ); }; }; + 10D590491889C3DF00C05A0D /* OperandsInlines.h in Headers */ = {isa = PBXBuildFile; fileRef = A70447E917A0BD4600F5898E /* OperandsInlines.h */; settings = {ATTRIBUTES = (Private, ); }; }; + 10D5904A1889C3DF00C05A0D /* Operations.h in Headers */ = {isa = PBXBuildFile; fileRef = F692A8780255597D01FF60F7 /* Operations.h */; settings = {ATTRIBUTES = (Private, ); }; }; + 10D5904B1889C3DF00C05A0D /* Options.h in Headers */ = {isa = PBXBuildFile; fileRef = 0FE228EB1436AB2300196C48 /* Options.h */; settings = {ATTRIBUTES = (Private, ); }; }; + 10D5904C1889C3DF00C05A0D /* Parser.h in Headers */ = {isa = PBXBuildFile; fileRef = 93F0B3AA09BB4DC00068FCE3 /* Parser.h */; settings = {ATTRIBUTES = (Private, ); }; }; + 10D5904D1889C3DF00C05A0D /* ParserArena.h in Headers */ = {isa = PBXBuildFile; fileRef = 93052C330FB792190048FDC3 /* ParserArena.h */; settings = {ATTRIBUTES = (Private, ); }; }; + 10D5904E1889C3DF00C05A0D /* ParserError.h in Headers */ = {isa = PBXBuildFile; fileRef = 0FCCAE4316D0CF6E00D0C65B /* ParserError.h */; settings = {ATTRIBUTES = (Private, ); }; }; + 10D5904F1889C3DF00C05A0D /* ParserModes.h in Headers */ = {isa = PBXBuildFile; fileRef = A77F18241641925400640A47 /* ParserModes.h */; settings = {ATTRIBUTES = (Private, ); }; }; + 10D590501889C3DF00C05A0D /* ParserTokens.h in Headers */ = {isa = PBXBuildFile; fileRef = 65303D631447B9E100D3F904 /* ParserTokens.h */; settings = {ATTRIBUTES = (Private, ); }; }; + 10D590511889C3DF00C05A0D /* PolymorphicAccessStructureList.h in Headers */ = {isa = PBXBuildFile; fileRef = 0F34B14B16D43E0C001CDA5A /* PolymorphicAccessStructureList.h */; settings = {ATTRIBUTES = (Private, ); }; }; + 10D590521889C3DF00C05A0D /* PolymorphicPutByIdList.h in Headers */ = {isa = PBXBuildFile; fileRef = 0F9FC8C014E1B5FB00D52AE0 /* PolymorphicPutByIdList.h */; settings = {ATTRIBUTES = (Private, ); }; }; + 10D590531889C3DF00C05A0D /* PreciseJumpTargets.h in Headers */ = {isa = PBXBuildFile; fileRef = 0F98205E16BFE37F00240D02 /* PreciseJumpTargets.h */; settings = {ATTRIBUTES = (Private, ); }; }; + 10D590541889C3DF00C05A0D /* PrivateName.h in Headers */ = {isa = PBXBuildFile; fileRef = 868916A9155F285400CB2B9A /* PrivateName.h */; settings = {ATTRIBUTES = (Private, ); }; }; + 10D590551889C3DF00C05A0D /* Profile.h in Headers */ = {isa = PBXBuildFile; fileRef = 95742F640DD11F5A000917FB /* Profile.h */; settings = {ATTRIBUTES = (Private, ); }; }; + 10D590561889C3DF00C05A0D /* ProfiledCodeBlockJettisoningWatchpoint.h in Headers */ = {isa = PBXBuildFile; fileRef = 0FC97F32182020D7002C9B26 /* ProfiledCodeBlockJettisoningWatchpoint.h */; settings = {ATTRIBUTES = (Private, ); }; }; + 10D590571889C3DF00C05A0D /* ProfileGenerator.h in Headers */ = {isa = PBXBuildFile; fileRef = 95CD45750E1C4FDD0085358E /* ProfileGenerator.h */; settings = {ATTRIBUTES = (); }; }; + 10D590581889C3DF00C05A0D /* ProfileNode.h in Headers */ = {isa = PBXBuildFile; fileRef = 95AB83550DA43B4400BC83F3 /* ProfileNode.h */; settings = {ATTRIBUTES = (Private, ); }; }; + 10D590591889C3DF00C05A0D /* ProfilerBytecode.h in Headers */ = {isa = PBXBuildFile; fileRef = 0FF72993166AD347000F5BA3 /* ProfilerBytecode.h */; settings = {ATTRIBUTES = (Private, ); }; }; + 10D5905A1889C3DF00C05A0D /* BytecodeLivenessAnalysisInlines.h in Headers */ = {isa = PBXBuildFile; fileRef = 0F666EBE183566F900D017F1 /* BytecodeLivenessAnalysisInlines.h */; settings = {ATTRIBUTES = (Private, ); }; }; + 10D5905B1889C3DF00C05A0D /* ProfilerBytecodes.h in Headers */ = {isa = PBXBuildFile; fileRef = 0FF72995166AD347000F5BA3 /* ProfilerBytecodes.h */; settings = {ATTRIBUTES = (Private, ); }; }; + 10D5905C1889C3DF00C05A0D /* ProfilerBytecodeSequence.h in Headers */ = {isa = PBXBuildFile; fileRef = 0F13912516771C30009CCB07 /* ProfilerBytecodeSequence.h */; settings = {ATTRIBUTES = (Private, ); }; }; + 10D5905D1889C3DF00C05A0D /* ProfilerCompilation.h in Headers */ = {isa = PBXBuildFile; fileRef = 0FF72997166AD347000F5BA3 /* ProfilerCompilation.h */; settings = {ATTRIBUTES = (Private, ); }; }; + 10D5905E1889C3DF00C05A0D /* ProfilerCompilationKind.h in Headers */ = {isa = PBXBuildFile; fileRef = 0FF72999166AD347000F5BA3 /* ProfilerCompilationKind.h */; settings = {ATTRIBUTES = (Private, ); }; }; + 10D5905F1889C3DF00C05A0D /* ProfilerCompiledBytecode.h in Headers */ = {isa = PBXBuildFile; fileRef = 0FF7299B166AD347000F5BA3 /* ProfilerCompiledBytecode.h */; settings = {ATTRIBUTES = (Private, ); }; }; + 10D590601889C3DF00C05A0D /* ProfilerDatabase.h in Headers */ = {isa = PBXBuildFile; fileRef = 0FF7299D166AD347000F5BA3 /* ProfilerDatabase.h */; settings = {ATTRIBUTES = (Private, ); }; }; + 10D590611889C3DF00C05A0D /* ProfilerExecutionCounter.h in Headers */ = {isa = PBXBuildFile; fileRef = 0FF7299E166AD347000F5BA3 /* ProfilerExecutionCounter.h */; settings = {ATTRIBUTES = (Private, ); }; }; + 10D590621889C3DF00C05A0D /* ProfilerOrigin.h in Headers */ = {isa = PBXBuildFile; fileRef = 0FF729A0166AD347000F5BA3 /* ProfilerOrigin.h */; settings = {ATTRIBUTES = (Private, ); }; }; + 10D590631889C3DF00C05A0D /* ProfilerOriginStack.h in Headers */ = {isa = PBXBuildFile; fileRef = 0FF729A2166AD347000F5BA3 /* ProfilerOriginStack.h */; settings = {ATTRIBUTES = (Private, ); }; }; + 10D590641889C3DF00C05A0D /* ProfilerOSRExit.h in Headers */ = {isa = PBXBuildFile; fileRef = 0FB105881675482E00F8AB6E /* ProfilerOSRExit.h */; settings = {ATTRIBUTES = (Private, ); }; }; + 10D590651889C3DF00C05A0D /* ProfilerOSRExitSite.h in Headers */ = {isa = PBXBuildFile; fileRef = 0FB1058A1675482E00F8AB6E /* ProfilerOSRExitSite.h */; settings = {ATTRIBUTES = (Private, ); }; }; + 10D590661889C3DF00C05A0D /* ProfilerProfiledBytecodes.h in Headers */ = {isa = PBXBuildFile; fileRef = 0F13912716771C30009CCB07 /* ProfilerProfiledBytecodes.h */; settings = {ATTRIBUTES = (Private, ); }; }; + 10D590671889C3DF00C05A0D /* PropertyDescriptor.h in Headers */ = {isa = PBXBuildFile; fileRef = A7FB604B103F5EAB0017A286 /* PropertyDescriptor.h */; settings = {ATTRIBUTES = (Private, ); }; }; + 10D590681889C3DF00C05A0D /* PropertyMapHashTable.h in Headers */ = {isa = PBXBuildFile; fileRef = BC95437C0EBA70FD0072B6D3 /* PropertyMapHashTable.h */; settings = {ATTRIBUTES = (Private, ); }; }; + 10D590691889C3DF00C05A0D /* PropertyName.h in Headers */ = {isa = PBXBuildFile; fileRef = 86158AB2155C8B3F00B45C9C /* PropertyName.h */; settings = {ATTRIBUTES = (Private, ); }; }; + 10D5906A1889C3DF00C05A0D /* PropertyNameArray.h in Headers */ = {isa = PBXBuildFile; fileRef = 65400C100A69BAF200509887 /* PropertyNameArray.h */; settings = {ATTRIBUTES = (Private, ); }; }; + 10D5906B1889C3DF00C05A0D /* PropertyOffset.h in Headers */ = {isa = PBXBuildFile; fileRef = 0FF7168A15A3B231008F5DAA /* PropertyOffset.h */; settings = {ATTRIBUTES = (Private, ); }; }; + 10D5906C1889C3DF00C05A0D /* PropertySlot.h in Headers */ = {isa = PBXBuildFile; fileRef = 65621E6C089E859700760F35 /* PropertySlot.h */; settings = {ATTRIBUTES = (Private, ); }; }; + 10D5906D1889C3DF00C05A0D /* PropertyStorage.h in Headers */ = {isa = PBXBuildFile; fileRef = 0FB7F39015ED8E3800F167B2 /* PropertyStorage.h */; settings = {ATTRIBUTES = (Private, ); }; }; + 10D5906E1889C3DF00C05A0D /* InspectorJSBackendDispatchers.h in Headers */ = {isa = PBXBuildFile; fileRef = A532438218568317002ED692 /* InspectorJSBackendDispatchers.h */; settings = {ATTRIBUTES = (Private, ); }; }; + 10D5906F1889C3DF00C05A0D /* Protect.h in Headers */ = {isa = PBXBuildFile; fileRef = 65C02FBB0637462A003E7EE6 /* Protect.h */; settings = {ATTRIBUTES = (Private, ); }; }; + 10D590701889C3DF00C05A0D /* PrototypeMap.h in Headers */ = {isa = PBXBuildFile; fileRef = 14D844A316AA2C7000A65AF0 /* PrototypeMap.h */; settings = {ATTRIBUTES = (Private, ); }; }; + 10D590711889C3DF00C05A0D /* PutByIdStatus.h in Headers */ = {isa = PBXBuildFile; fileRef = 0F93329A14CA7DC10085F3C6 /* PutByIdStatus.h */; settings = {ATTRIBUTES = (Private, ); }; }; + 10D590721889C3DF00C05A0D /* PutDirectIndexMode.h in Headers */ = {isa = PBXBuildFile; fileRef = 0F0CD4C015F1A6040032F1C0 /* PutDirectIndexMode.h */; settings = {ATTRIBUTES = (Private, ); }; }; + 10D590731889C3DF00C05A0D /* Microtask.h in Headers */ = {isa = PBXBuildFile; fileRef = 7C008CE5187631B600955C24 /* Microtask.h */; settings = {ATTRIBUTES = (Private, ); }; }; + 10D590741889C3DF00C05A0D /* PutKind.h in Headers */ = {isa = PBXBuildFile; fileRef = 0F9FC8C114E1B5FB00D52AE0 /* PutKind.h */; settings = {ATTRIBUTES = (Private, ); }; }; + 10D590751889C3DF00C05A0D /* PutPropertySlot.h in Headers */ = {isa = PBXBuildFile; fileRef = 147B84620E6DE6B1004775A4 /* PutPropertySlot.h */; settings = {ATTRIBUTES = (Private, ); }; }; + 10D590761889C3DF00C05A0D /* InspectorBackendDispatcher.h in Headers */ = {isa = PBXBuildFile; fileRef = A593CF7B1840360300BFCE27 /* InspectorBackendDispatcher.h */; settings = {ATTRIBUTES = (Private, ); }; }; + 10D590771889C3DF00C05A0D /* ReduceWhitespace.h in Headers */ = {isa = PBXBuildFile; fileRef = 0FF60AC016740F8100029779 /* ReduceWhitespace.h */; settings = {ATTRIBUTES = (Private, ); }; }; + 10D590781889C3DF00C05A0D /* RegExp.h in Headers */ = {isa = PBXBuildFile; fileRef = F692A87E0255597D01FF60F7 /* RegExp.h */; settings = {ATTRIBUTES = (Private, ); }; }; + 10D590791889C3DF00C05A0D /* RegExpCache.h in Headers */ = {isa = PBXBuildFile; fileRef = A1712B3E11C7B228007A5315 /* RegExpCache.h */; settings = {ATTRIBUTES = (Private, ); }; }; + 10D5907A1889C3DF00C05A0D /* RegExpConstructor.h in Headers */ = {isa = PBXBuildFile; fileRef = BCD202BE0E1706A7002C7E82 /* RegExpConstructor.h */; }; + 10D5907B1889C3DF00C05A0D /* JSPromiseReaction.h in Headers */ = {isa = PBXBuildFile; fileRef = 7C008CDD1871258D00955C24 /* JSPromiseReaction.h */; }; + 10D5907C1889C3DF00C05A0D /* RegExpConstructor.lut.h in Headers */ = {isa = PBXBuildFile; fileRef = BCD202D50E170708002C7E82 /* RegExpConstructor.lut.h */; }; + 10D5907D1889C3DF00C05A0D /* RegExpKey.h in Headers */ = {isa = PBXBuildFile; fileRef = A1712B4011C7B235007A5315 /* RegExpKey.h */; settings = {ATTRIBUTES = (Private, ); }; }; + 10D5907E1889C3DF00C05A0D /* StackAlignment.h in Headers */ = {isa = PBXBuildFile; fileRef = 0F3AC751183EA1040032029F /* StackAlignment.h */; settings = {ATTRIBUTES = (Private, ); }; }; + 10D5907F1889C3DF00C05A0D /* RegExpObject.h in Headers */ = {isa = PBXBuildFile; fileRef = F692A87C0255597D01FF60F7 /* RegExpObject.h */; settings = {ATTRIBUTES = (Private, ); }; }; + 10D590801889C3DF00C05A0D /* RegExpObject.lut.h in Headers */ = {isa = PBXBuildFile; fileRef = BC18C52B0E16FCD200B34460 /* RegExpObject.lut.h */; }; + 10D590811889C3DF00C05A0D /* RegExpPrototype.h in Headers */ = {isa = PBXBuildFile; fileRef = BCD202C00E1706A7002C7E82 /* RegExpPrototype.h */; }; + 10D590821889C3DF00C05A0D /* Region.h in Headers */ = {isa = PBXBuildFile; fileRef = C20B25981706536200C21F4E /* Region.h */; settings = {ATTRIBUTES = (Private, ); }; }; + 10D590831889C3DF00C05A0D /* Register.h in Headers */ = {isa = PBXBuildFile; fileRef = 149B24FF0D8AF6D1009CB8C7 /* Register.h */; settings = {ATTRIBUTES = (Private, ); }; }; + 10D590841889C3DF00C05A0D /* RegisterID.h in Headers */ = {isa = PBXBuildFile; fileRef = 969A07280ED1CE6900F1F681 /* RegisterID.h */; }; + 10D590851889C3DF00C05A0D /* RegisterSet.h in Headers */ = {isa = PBXBuildFile; fileRef = 0FC314101814559100033232 /* RegisterSet.h */; settings = {ATTRIBUTES = (Private, ); }; }; + 10D590861889C3DF00C05A0D /* Reject.h in Headers */ = {isa = PBXBuildFile; fileRef = 0FB7F39115ED8E3800F167B2 /* Reject.h */; settings = {ATTRIBUTES = (Private, ); }; }; + 10D590871889C3DF00C05A0D /* Repatch.h in Headers */ = {isa = PBXBuildFile; fileRef = 0F24E54A17EE274900ABB217 /* Repatch.h */; }; + 10D590881889C3DF00C05A0D /* RepatchBuffer.h in Headers */ = {isa = PBXBuildFile; fileRef = 86D3B3C210159D7F002865E7 /* RepatchBuffer.h */; settings = {ATTRIBUTES = (Private, ); }; }; + 10D590891889C3DF00C05A0D /* InjectedScript.h in Headers */ = {isa = PBXBuildFile; fileRef = A513E5B6185B8BD3007E95AD /* InjectedScript.h */; settings = {ATTRIBUTES = (Private, ); }; }; + 10D5908A1889C3DF00C05A0D /* ResultType.h in Headers */ = {isa = PBXBuildFile; fileRef = 869EBCB60E8C6D4A008722CC /* ResultType.h */; settings = {ATTRIBUTES = (Private, ); }; }; + 10D5908B1889C3DF00C05A0D /* SamplingCounter.h in Headers */ = {isa = PBXBuildFile; fileRef = 0F77008E1402FDD60078EB39 /* SamplingCounter.h */; settings = {ATTRIBUTES = (Private, ); }; }; + 10D5908C1889C3DF00C05A0D /* SamplingTool.h in Headers */ = {isa = PBXBuildFile; fileRef = 1429D8840ED21C3D00B89619 /* SamplingTool.h */; settings = {ATTRIBUTES = (Private, ); }; }; + 10D5908D1889C3DF00C05A0D /* ScratchRegisterAllocator.h in Headers */ = {isa = PBXBuildFile; fileRef = 0F24E54B17EE274900ABB217 /* ScratchRegisterAllocator.h */; }; + 10D5908E1889C3DF00C05A0D /* DelayedReleaseScope.h in Headers */ = {isa = PBXBuildFile; fileRef = 2A2825CF18341F2D0087FBA9 /* DelayedReleaseScope.h */; }; + 10D5908F1889C3DF00C05A0D /* SetConstructor.h in Headers */ = {isa = PBXBuildFile; fileRef = A7299DA417D12858005F5FF9 /* SetConstructor.h */; }; + 10D590901889C3DF00C05A0D /* SetPrototype.h in Headers */ = {isa = PBXBuildFile; fileRef = A7299DA017D12848005F5FF9 /* SetPrototype.h */; }; + 10D590911889C3DF00C05A0D /* SH4Assembler.h in Headers */ = {isa = PBXBuildFile; fileRef = 86AE64A7135E5E1C00963012 /* SH4Assembler.h */; settings = {ATTRIBUTES = (Private, ); }; }; + 10D590921889C3DF00C05A0D /* SimpleTypedArrayController.h in Headers */ = {isa = PBXBuildFile; fileRef = 0F2B66D717B6B5AB00A7AE3F /* SimpleTypedArrayController.h */; settings = {ATTRIBUTES = (Private, ); }; }; + 10D590931889C3DF00C05A0D /* JSPromiseFunctions.h in Headers */ = {isa = PBXBuildFile; fileRef = 7C008CD1186F8A9300955C24 /* JSPromiseFunctions.h */; settings = {ATTRIBUTES = (Private, ); }; }; + 10D590941889C3DF00C05A0D /* SetIteratorConstructor.h in Headers */ = {isa = PBXBuildFile; fileRef = A790DD66182F499700588807 /* SetIteratorConstructor.h */; }; + 10D590951889C3DF00C05A0D /* SlotVisitor.h in Headers */ = {isa = PBXBuildFile; fileRef = 14BA78F013AAB88F005B7C2C /* SlotVisitor.h */; settings = {ATTRIBUTES = (Private, ); }; }; + 10D590961889C3DF00C05A0D /* SlotVisitorInlines.h in Headers */ = {isa = PBXBuildFile; fileRef = 0FCB408515C0A3C30048932B /* SlotVisitorInlines.h */; settings = {ATTRIBUTES = (Private, ); }; }; + 10D590971889C3DF00C05A0D /* SlowPathCall.h in Headers */ = {isa = PBXBuildFile; fileRef = A709F2EF17A0AC0400512E98 /* SlowPathCall.h */; settings = {ATTRIBUTES = (Private, ); }; }; + 10D590981889C3DF00C05A0D /* SmallStrings.h in Headers */ = {isa = PBXBuildFile; fileRef = 93303FEA0E6A72C000786E6A /* SmallStrings.h */; settings = {ATTRIBUTES = (Private, ); }; }; + 10D590991889C3DF00C05A0D /* SourceCode.h in Headers */ = {isa = PBXBuildFile; fileRef = 65E866EE0DD59AFA00A2B2A1 /* SourceCode.h */; settings = {ATTRIBUTES = (Private, ); }; }; + 10D5909A1889C3DF00C05A0D /* SourceProvider.h in Headers */ = {isa = PBXBuildFile; fileRef = 65E866ED0DD59AFA00A2B2A1 /* SourceProvider.h */; settings = {ATTRIBUTES = (Private, ); }; }; + 10D5909B1889C3DF00C05A0D /* SourceProviderCache.h in Headers */ = {isa = PBXBuildFile; fileRef = E49DC15112EF272200184A1F /* SourceProviderCache.h */; settings = {ATTRIBUTES = (Private, ); }; }; + 10D5909C1889C3DF00C05A0D /* SourceProviderCacheItem.h in Headers */ = {isa = PBXBuildFile; fileRef = E49DC14912EF261A00184A1F /* SourceProviderCacheItem.h */; settings = {ATTRIBUTES = (Private, ); }; }; + 10D5909D1889C3DF00C05A0D /* SparseArrayValueMap.h in Headers */ = {isa = PBXBuildFile; fileRef = 0FB7F39215ED8E3800F167B2 /* SparseArrayValueMap.h */; settings = {ATTRIBUTES = (Private, ); }; }; + 10D5909E1889C3DF00C05A0D /* SpecializedThunkJIT.h in Headers */ = {isa = PBXBuildFile; fileRef = A7386551118697B400540279 /* SpecializedThunkJIT.h */; }; + 10D5909F1889C3DF00C05A0D /* SpecialPointer.h in Headers */ = {isa = PBXBuildFile; fileRef = 0F5541B01613C1FB00CE3E25 /* SpecialPointer.h */; settings = {ATTRIBUTES = (Private, ); }; }; + 10D590A01889C3DF00C05A0D /* SpeculatedType.h in Headers */ = {isa = PBXBuildFile; fileRef = 0FD82E4F141DAEA100179C94 /* SpeculatedType.h */; settings = {ATTRIBUTES = (Private, ); }; }; + 10D590A11889C3DF00C05A0D /* StackVisitor.h in Headers */ = {isa = PBXBuildFile; fileRef = A7C1EAED17987AB600299DB2 /* StackVisitor.h */; settings = {ATTRIBUTES = (Private, ); }; }; + 10D590A21889C3DF00C05A0D /* StaticPropertyAnalysis.h in Headers */ = {isa = PBXBuildFile; fileRef = 14DF04D916B3996D0016A513 /* StaticPropertyAnalysis.h */; settings = {ATTRIBUTES = (Private, ); }; }; + 10D590A31889C3DF00C05A0D /* ScriptObject.h in Headers */ = {isa = PBXBuildFile; fileRef = A54CF2F8184EAEDA00237F19 /* ScriptObject.h */; settings = {ATTRIBUTES = (Private, ); }; }; + 10D590A41889C3DF00C05A0D /* StaticPropertyAnalyzer.h in Headers */ = {isa = PBXBuildFile; fileRef = 14CA958A16AB50DE00938A06 /* StaticPropertyAnalyzer.h */; settings = {ATTRIBUTES = (Private, ); }; }; + 10D590A51889C3DF00C05A0D /* StrictEvalActivation.h in Headers */ = {isa = PBXBuildFile; fileRef = A730B6101250068F009D25B1 /* StrictEvalActivation.h */; }; + 10D590A61889C3DF00C05A0D /* StringConstructor.h in Headers */ = {isa = PBXBuildFile; fileRef = BC18C3C10E16EE3300B34460 /* StringConstructor.h */; }; + 10D590A71889C3DF00C05A0D /* StringObject.h in Headers */ = {isa = PBXBuildFile; fileRef = BC18C3C30E16EE3300B34460 /* StringObject.h */; settings = {ATTRIBUTES = (Private, ); }; }; + 10D590A81889C3DF00C05A0D /* StringPrototype.h in Headers */ = {isa = PBXBuildFile; fileRef = BC18C3C60E16EE3300B34460 /* StringPrototype.h */; settings = {ATTRIBUTES = (Private, ); }; }; + 10D590A91889C3DF00C05A0D /* Strong.h in Headers */ = {isa = PBXBuildFile; fileRef = 142E3132134FF0A600AFADB5 /* Strong.h */; settings = {ATTRIBUTES = (Private, ); }; }; + 10D590AA1889C3DF00C05A0D /* StrongInlines.h in Headers */ = {isa = PBXBuildFile; fileRef = 145722851437E140005FDE26 /* StrongInlines.h */; settings = {ATTRIBUTES = (Private, ); }; }; + 10D590AB1889C3DF00C05A0D /* Structure.h in Headers */ = {isa = PBXBuildFile; fileRef = BCDE3AB10E6C82CF001453A7 /* Structure.h */; settings = {ATTRIBUTES = (Private, ); }; }; + 10D590AC1889C3DF00C05A0D /* StructureChain.h in Headers */ = {isa = PBXBuildFile; fileRef = 7E4EE7080EBB7963005934AA /* StructureChain.h */; settings = {ATTRIBUTES = (Private, ); }; }; + 10D590AD1889C3DF00C05A0D /* StructureInlines.h in Headers */ = {isa = PBXBuildFile; fileRef = 0FD2C92316D01EE900C7803F /* StructureInlines.h */; settings = {ATTRIBUTES = (Private, ); }; }; + 10D590AE1889C3DF00C05A0D /* StructureRareData.h in Headers */ = {isa = PBXBuildFile; fileRef = C2FE18A316BAEC4000AF3061 /* StructureRareData.h */; settings = {ATTRIBUTES = (Private, ); }; }; + 10D590AF1889C3DF00C05A0D /* StructureRareDataInlines.h in Headers */ = {isa = PBXBuildFile; fileRef = C20BA92C16BB1C1500B3AEA2 /* StructureRareDataInlines.h */; settings = {ATTRIBUTES = (Private, ); }; }; + 10D590B01889C3DF00C05A0D /* StructureSet.h in Headers */ = {isa = PBXBuildFile; fileRef = 0F93329B14CA7DC10085F3C6 /* StructureSet.h */; settings = {ATTRIBUTES = (Private, ); }; }; + 10D590B11889C3DF00C05A0D /* StructureStubClearingWatchpoint.h in Headers */ = {isa = PBXBuildFile; fileRef = 0F766D3715AE4A1A008F363E /* StructureStubClearingWatchpoint.h */; settings = {ATTRIBUTES = (Private, ); }; }; + 10D590B21889C3DF00C05A0D /* StructureStubInfo.h in Headers */ = {isa = PBXBuildFile; fileRef = BCCF0D070EF0AAB900413C8F /* StructureStubInfo.h */; settings = {ATTRIBUTES = (Private, ); }; }; + 10D590B31889C3DF00C05A0D /* StructureTransitionTable.h in Headers */ = {isa = PBXBuildFile; fileRef = BC9041470EB9250900FE26FA /* StructureTransitionTable.h */; settings = {ATTRIBUTES = (Private, ); }; }; + 10D590B41889C3DF00C05A0D /* SuperRegion.h in Headers */ = {isa = PBXBuildFile; fileRef = C2DF442E1707AC0100A5CA96 /* SuperRegion.h */; settings = {ATTRIBUTES = (Private, ); }; }; + 10D590B51889C3DF00C05A0D /* SymbolTable.h in Headers */ = {isa = PBXBuildFile; fileRef = 14A396A60CD2933100B5B4FF /* SymbolTable.h */; settings = {ATTRIBUTES = (Private, ); }; }; + 10D590B61889C3DF00C05A0D /* SyntaxChecker.h in Headers */ = {isa = PBXBuildFile; fileRef = A7A7EE7711B98B8D0065A14F /* SyntaxChecker.h */; settings = {ATTRIBUTES = (Private, ); }; }; + 10D590B71889C3DF00C05A0D /* TestRunnerUtils.h in Headers */ = {isa = PBXBuildFile; fileRef = 0FA2C17A17D7CF84009D015F /* TestRunnerUtils.h */; settings = {ATTRIBUTES = (Private, ); }; }; + 10D590B81889C3DF00C05A0D /* ThunkGenerator.h in Headers */ = {isa = PBXBuildFile; fileRef = 0F572D4D16879FDB00E57FBD /* ThunkGenerator.h */; settings = {ATTRIBUTES = (Private, ); }; }; + 10D590B91889C3DF00C05A0D /* ThunkGenerators.h in Headers */ = {isa = PBXBuildFile; fileRef = A7386553118697B400540279 /* ThunkGenerators.h */; settings = {ATTRIBUTES = (Private, ); }; }; + 10D590BA1889C3DF00C05A0D /* TinyBloomFilter.h in Headers */ = {isa = PBXBuildFile; fileRef = 141448CC13A1783700F5BA1A /* TinyBloomFilter.h */; settings = {ATTRIBUTES = (Private, ); }; }; + 10D590BB1889C3DF00C05A0D /* ToNativeFromValue.h in Headers */ = {isa = PBXBuildFile; fileRef = 0F55989717C86C5600A1E543 /* ToNativeFromValue.h */; settings = {ATTRIBUTES = (Private, ); }; }; + 10D590BC1889C3DF00C05A0D /* Tracing.h in Headers */ = {isa = PBXBuildFile; fileRef = 5D53726E0E1C54880021E549 /* Tracing.h */; }; + 10D590BD1889C3DF00C05A0D /* TypedArrayAdaptors.h in Headers */ = {isa = PBXBuildFile; fileRef = 0F2B66D817B6B5AB00A7AE3F /* TypedArrayAdaptors.h */; settings = {ATTRIBUTES = (Private, ); }; }; + 10D590BE1889C3DF00C05A0D /* TypedArrayController.h in Headers */ = {isa = PBXBuildFile; fileRef = 0F2B66DA17B6B5AB00A7AE3F /* TypedArrayController.h */; settings = {ATTRIBUTES = (Private, ); }; }; + 10D590BF1889C3DF00C05A0D /* TypedArrayInlines.h in Headers */ = {isa = PBXBuildFile; fileRef = 0F4B94DB17B9F07500DD03A4 /* TypedArrayInlines.h */; settings = {ATTRIBUTES = (Private, ); }; }; + 10D590C01889C3DF00C05A0D /* TypedArrays.h in Headers */ = {isa = PBXBuildFile; fileRef = 0F2B66DB17B6B5AB00A7AE3F /* TypedArrays.h */; settings = {ATTRIBUTES = (Private, ); }; }; + 10D590C11889C3DF00C05A0D /* TypedArrayType.h in Headers */ = {isa = PBXBuildFile; fileRef = 0F2B66DD17B6B5AB00A7AE3F /* TypedArrayType.h */; settings = {ATTRIBUTES = (Private, ); }; }; + 10D590C21889C3DF00C05A0D /* udis86.h in Headers */ = {isa = PBXBuildFile; fileRef = 0FF4273F158EBD94004CB9FF /* udis86.h */; }; + 10D590C31889C3DF00C05A0D /* udis86_decode.h in Headers */ = {isa = PBXBuildFile; fileRef = 0FF42735158EBD94004CB9FF /* udis86_decode.h */; }; + 10D590C41889C3DF00C05A0D /* udis86_extern.h in Headers */ = {isa = PBXBuildFile; fileRef = 0FF42736158EBD94004CB9FF /* udis86_extern.h */; }; + 10D590C51889C3DF00C05A0D /* udis86_input.h in Headers */ = {isa = PBXBuildFile; fileRef = 0FF42738158EBD94004CB9FF /* udis86_input.h */; }; + 10D590C61889C3DF00C05A0D /* udis86_syn.h in Headers */ = {isa = PBXBuildFile; fileRef = 0FF4273C158EBD94004CB9FF /* udis86_syn.h */; }; + 10D590C71889C3DF00C05A0D /* udis86_types.h in Headers */ = {isa = PBXBuildFile; fileRef = 0FF4273D158EBD94004CB9FF /* udis86_types.h */; }; + 10D590C81889C3DF00C05A0D /* UDis86Disassembler.h in Headers */ = {isa = PBXBuildFile; fileRef = A7E5AB351799E4B200D2833D /* UDis86Disassembler.h */; settings = {ATTRIBUTES = (Private, ); }; }; + 10D590C91889C3DF00C05A0D /* Uint16Array.h in Headers */ = {isa = PBXBuildFile; fileRef = A7A8AF3217ADB5F3005AB174 /* Uint16Array.h */; settings = {ATTRIBUTES = (Private, ); }; }; + 10D590CA1889C3DF00C05A0D /* Uint16WithFraction.h in Headers */ = {isa = PBXBuildFile; fileRef = 866739D113BFDE710023D87C /* Uint16WithFraction.h */; }; + 10D590CB1889C3DF00C05A0D /* Uint32Array.h in Headers */ = {isa = PBXBuildFile; fileRef = A7A8AF3317ADB5F3005AB174 /* Uint32Array.h */; settings = {ATTRIBUTES = (Private, ); }; }; + 10D590CC1889C3DF00C05A0D /* Uint8Array.h in Headers */ = {isa = PBXBuildFile; fileRef = A7A8AF3017ADB5F3005AB174 /* Uint8Array.h */; settings = {ATTRIBUTES = (Private, ); }; }; + 10D590CD1889C3DF00C05A0D /* Uint8ClampedArray.h in Headers */ = {isa = PBXBuildFile; fileRef = A7A8AF3117ADB5F3005AB174 /* Uint8ClampedArray.h */; settings = {ATTRIBUTES = (Private, ); }; }; + 10D590CE1889C3DF00C05A0D /* UnconditionalFinalizer.h in Headers */ = {isa = PBXBuildFile; fileRef = 0F5F08CE146C762F000472A9 /* UnconditionalFinalizer.h */; settings = {ATTRIBUTES = (Private, ); }; }; + 10D590CF1889C3DF00C05A0D /* DFGAvailability.h in Headers */ = {isa = PBXBuildFile; fileRef = 0F666EC31835672B00D017F1 /* DFGAvailability.h */; settings = {ATTRIBUTES = (Private, ); }; }; + 10D590D01889C3DF00C05A0D /* UnlinkedCodeBlock.h in Headers */ = {isa = PBXBuildFile; fileRef = A79E781F15EECBA80047C855 /* UnlinkedCodeBlock.h */; settings = {ATTRIBUTES = (Private, ); }; }; + 10D590D11889C3DF00C05A0D /* UnusedPointer.h in Headers */ = {isa = PBXBuildFile; fileRef = 65987F2F16828A7E003C2F8D /* UnusedPointer.h */; settings = {ATTRIBUTES = (Private, ); }; }; + 10D590D21889C3DF00C05A0D /* ValueProfile.h in Headers */ = {isa = PBXBuildFile; fileRef = 0F963B3613FC6FDE0002D9B2 /* ValueProfile.h */; settings = {ATTRIBUTES = (Private, ); }; }; + 10D590D31889C3DF00C05A0D /* InjectedScriptHost.h in Headers */ = {isa = PBXBuildFile; fileRef = A513E5B9185BFACC007E95AD /* InjectedScriptHost.h */; settings = {ATTRIBUTES = (Private, ); }; }; + 10D590D41889C3DF00C05A0D /* ValueRecovery.h in Headers */ = {isa = PBXBuildFile; fileRef = 0F426A451460CBAB00131F8F /* ValueRecovery.h */; settings = {ATTRIBUTES = (Private, ); }; }; + 10D590D51889C3DF00C05A0D /* VirtualRegister.h in Headers */ = {isa = PBXBuildFile; fileRef = 0F426A461460CBAB00131F8F /* VirtualRegister.h */; settings = {ATTRIBUTES = (Private, ); }; }; + 10D590D61889C3DF00C05A0D /* VM.h in Headers */ = {isa = PBXBuildFile; fileRef = E18E3A560DF9278C00D90B34 /* VM.h */; settings = {ATTRIBUTES = (Private, ); }; }; + 10D590D71889C3DF00C05A0D /* VMInspector.h in Headers */ = {isa = PBXBuildFile; fileRef = FE4A331E15BD2E07006F54F3 /* VMInspector.h */; settings = {ATTRIBUTES = (Private, ); }; }; + 10D590D81889C3DF00C05A0D /* InjectedScriptSource.h in Headers */ = {isa = PBXBuildFile; fileRef = A513E5C6185F9436007E95AD /* InjectedScriptSource.h */; }; + 10D590D91889C3DF00C05A0D /* Watchdog.h in Headers */ = {isa = PBXBuildFile; fileRef = FED94F2C171E3E2300BE77A4 /* Watchdog.h */; settings = {ATTRIBUTES = (Private, ); }; }; + 10D590DA1889C3DF00C05A0D /* Watchpoint.h in Headers */ = {isa = PBXBuildFile; fileRef = 0F919D2315853CDE004A4E7D /* Watchpoint.h */; settings = {ATTRIBUTES = (Private, ); }; }; + 10D590DB1889C3DF00C05A0D /* Weak.h in Headers */ = {isa = PBXBuildFile; fileRef = 142E3133134FF0A600AFADB5 /* Weak.h */; settings = {ATTRIBUTES = (Private, ); }; }; + 10D590DC1889C3DF00C05A0D /* JSInjectedScriptHost.h in Headers */ = {isa = PBXBuildFile; fileRef = A513E5BB185BFACC007E95AD /* JSInjectedScriptHost.h */; }; + 10D590DD1889C3DF00C05A0D /* WeakBlock.h in Headers */ = {isa = PBXBuildFile; fileRef = 14E84F9A14EE1ACC00D6D5D4 /* WeakBlock.h */; settings = {ATTRIBUTES = (Private, ); }; }; + 10D590DE1889C3DF00C05A0D /* WeakGCMap.h in Headers */ = {isa = PBXBuildFile; fileRef = 14BFCE6810CDB1FC00364CCE /* WeakGCMap.h */; settings = {ATTRIBUTES = (Private, ); }; }; + 10D590DF1889C3DF00C05A0D /* RemoteInspector.h in Headers */ = {isa = PBXBuildFile; fileRef = A5BA15E1182340B300A82E69 /* RemoteInspector.h */; settings = {ATTRIBUTES = (Private, ); }; }; + 10D590E01889C3DF00C05A0D /* WeakHandleOwner.h in Headers */ = {isa = PBXBuildFile; fileRef = 14F7256414EE265E00B1652B /* WeakHandleOwner.h */; settings = {ATTRIBUTES = (Private, ); }; }; + 10D590E11889C3DF00C05A0D /* WeakImpl.h in Headers */ = {isa = PBXBuildFile; fileRef = 14E84F9D14EE1ACC00D6D5D4 /* WeakImpl.h */; settings = {ATTRIBUTES = (Private, ); }; }; + 10D590E21889C3DF00C05A0D /* WeakInlines.h in Headers */ = {isa = PBXBuildFile; fileRef = 14BE7D3217135CF400D1807A /* WeakInlines.h */; settings = {ATTRIBUTES = (Private, ); }; }; + 10D590E31889C3DF00C05A0D /* WeakMapConstructor.h in Headers */ = {isa = PBXBuildFile; fileRef = A7CA3ADE17DA41AE006538AF /* WeakMapConstructor.h */; }; + 10D590E41889C3DF00C05A0D /* WeakMapData.h in Headers */ = {isa = PBXBuildFile; fileRef = A7CA3AEA17DA5168006538AF /* WeakMapData.h */; }; + 10D590E51889C3DF00C05A0D /* DFGStoreBarrierElisionPhase.h in Headers */ = {isa = PBXBuildFile; fileRef = 2ACCF3DD185FE26B0083E2AD /* DFGStoreBarrierElisionPhase.h */; }; + 10D590E61889C3DF00C05A0D /* InspectorTypeBuilder.h in Headers */ = {isa = PBXBuildFile; fileRef = A55D93AB18514F7900400DED /* InspectorTypeBuilder.h */; settings = {ATTRIBUTES = (Private, ); }; }; + 10D590E71889C3DF00C05A0D /* WeakMapPrototype.h in Headers */ = {isa = PBXBuildFile; fileRef = A7CA3AE017DA41AE006538AF /* WeakMapPrototype.h */; }; + 10D590E81889C3DF00C05A0D /* WeakRandom.h in Headers */ = {isa = PBXBuildFile; fileRef = 1420BE7A10AA6DDB00F455D2 /* WeakRandom.h */; settings = {ATTRIBUTES = (Private, ); }; }; + 10D590E91889C3DF00C05A0D /* WeakReferenceHarvester.h in Headers */ = {isa = PBXBuildFile; fileRef = 0F242DA513F3B1BB007ADD4C /* WeakReferenceHarvester.h */; settings = {ATTRIBUTES = (Private, ); }; }; + 10D590EA1889C3DF00C05A0D /* WeakSet.h in Headers */ = {isa = PBXBuildFile; fileRef = 14E84F9C14EE1ACC00D6D5D4 /* WeakSet.h */; settings = {ATTRIBUTES = (Private, ); }; }; + 10D590EB1889C3DF00C05A0D /* WeakSetInlines.h in Headers */ = {isa = PBXBuildFile; fileRef = 14150132154BB13F005D8C98 /* WeakSetInlines.h */; settings = {ATTRIBUTES = (Private, ); }; }; + 10D590EC1889C3DF00C05A0D /* WebKitAvailability.h in Headers */ = {isa = PBXBuildFile; fileRef = 5DE3D0F40DD8DDFB00468714 /* WebKitAvailability.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 10D590ED1889C3DF00C05A0D /* MapIteratorConstructor.h in Headers */ = {isa = PBXBuildFile; fileRef = A74DEF8C182D991400522C22 /* MapIteratorConstructor.h */; }; + 10D590EE1889C3DF00C05A0D /* WriteBarrier.h in Headers */ = {isa = PBXBuildFile; fileRef = A7DCB77912E3D90500911940 /* WriteBarrier.h */; settings = {ATTRIBUTES = (Private, ); }; }; + 10D590EF1889C3DF00C05A0D /* WriteBarrierSupport.h in Headers */ = {isa = PBXBuildFile; fileRef = 0FC8150914043BD200CFA603 /* WriteBarrierSupport.h */; settings = {ATTRIBUTES = (Private, ); }; }; + 10D590F01889C3DF00C05A0D /* X86Assembler.h in Headers */ = {isa = PBXBuildFile; fileRef = 9688CB140ED12B4E001D649F /* X86Assembler.h */; settings = {ATTRIBUTES = (Private, ); }; }; + 10D590F11889C3DF00C05A0D /* Yarr.h in Headers */ = {isa = PBXBuildFile; fileRef = 451539B812DC994500EF7AC4 /* Yarr.h */; settings = {ATTRIBUTES = (Private, ); }; }; + 10D590F21889C3DF00C05A0D /* DFGResurrectionForValidationPhase.h in Headers */ = {isa = PBXBuildFile; fileRef = 0F666ECB1836B37E00D017F1 /* DFGResurrectionForValidationPhase.h */; settings = {ATTRIBUTES = (Private, ); }; }; + 10D590F31889C3DF00C05A0D /* YarrInterpreter.h in Headers */ = {isa = PBXBuildFile; fileRef = 86704B7E12DBA33700A9FE7B /* YarrInterpreter.h */; settings = {ATTRIBUTES = (Private, ); }; }; + 10D590F41889C3DF00C05A0D /* ScriptFunctionCall.h in Headers */ = {isa = PBXBuildFile; fileRef = A55D93A4185012A800400DED /* ScriptFunctionCall.h */; settings = {ATTRIBUTES = (Private, ); }; }; + 10D590F51889C3DF00C05A0D /* YarrJIT.h in Headers */ = {isa = PBXBuildFile; fileRef = 86704B8012DBA33700A9FE7B /* YarrJIT.h */; settings = {ATTRIBUTES = (Private, ); }; }; + 10D590F61889C3DF00C05A0D /* YarrParser.h in Headers */ = {isa = PBXBuildFile; fileRef = 86704B8112DBA33700A9FE7B /* YarrParser.h */; settings = {ATTRIBUTES = (); }; }; + 10D590F71889C3DF00C05A0D /* YarrPattern.h in Headers */ = {isa = PBXBuildFile; fileRef = 86704B8312DBA33700A9FE7B /* YarrPattern.h */; settings = {ATTRIBUTES = (Private, ); }; }; + 10D590F81889C3DF00C05A0D /* YarrSyntaxChecker.h in Headers */ = {isa = PBXBuildFile; fileRef = 86704B4112DB8A8100A9FE7B /* YarrSyntaxChecker.h */; }; + 10D590FB1889C3DF00C05A0D /* ProtoCallFrame.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 65FB5116184EE9BC00C12B70 /* ProtoCallFrame.cpp */; }; + 10D590FC1889C3DF00C05A0D /* A64DOpcode.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 652A3A221651C69700A80AFE /* A64DOpcode.cpp */; }; + 10D590FD1889C3DF00C05A0D /* AbstractPC.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 0F55F0F114D1063600AC7649 /* AbstractPC.cpp */; }; + 10D590FE1889C3DF00C05A0D /* ArgList.cpp in Sources */ = {isa = PBXBuildFile; fileRef = BCF605110E203EF800B9A64D /* ArgList.cpp */; }; + 10D590FF1889C3DF00C05A0D /* Arguments.cpp in Sources */ = {isa = PBXBuildFile; fileRef = BC257DE50E1F51C50016B6C9 /* Arguments.cpp */; }; + 10D591001889C3DF00C05A0D /* ArgumentsIteratorConstructor.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A76140C7182982CB00750624 /* ArgumentsIteratorConstructor.cpp */; }; + 10D591011889C3DF00C05A0D /* ArgumentsIteratorPrototype.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A76140C9182982CB00750624 /* ArgumentsIteratorPrototype.cpp */; }; + 10D591021889C3DF00C05A0D /* ARM64Disassembler.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 652A3A201651C66100A80AFE /* ARM64Disassembler.cpp */; }; + 10D591031889C3DF00C05A0D /* ARMAssembler.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 86D3B2BF10156BDE002865E7 /* ARMAssembler.cpp */; }; + 10D591041889C3DF00C05A0D /* ARMv7Assembler.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A74DE1CB120B86D600D40D5B /* ARMv7Assembler.cpp */; }; + 10D591051889C3DF00C05A0D /* ARMv7Disassembler.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 65C0284F171795E200351E35 /* ARMv7Disassembler.cpp */; }; + 10D591061889C3DF00C05A0D /* ARMv7DOpcode.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 65C0285A1717966800351E35 /* ARMv7DOpcode.cpp */; }; + 10D591071889C3DF00C05A0D /* ArrayAllocationProfile.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 0F8335B41639C1E3001443B5 /* ArrayAllocationProfile.cpp */; }; + 10D591081889C3DF00C05A0D /* ArrayBuffer.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A7A8AF2517ADB5F2005AB174 /* ArrayBuffer.cpp */; }; + 10D591091889C3DF00C05A0D /* ArrayBufferView.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A7A8AF2717ADB5F3005AB174 /* ArrayBufferView.cpp */; }; + 10D5910A1889C3DF00C05A0D /* DFGArithMode.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 0F48531F187750560083B687 /* DFGArithMode.cpp */; }; + 10D5910B1889C3DF00C05A0D /* ArrayConstructor.cpp in Sources */ = {isa = PBXBuildFile; fileRef = BC7952060E15E8A800A898AB /* ArrayConstructor.cpp */; }; + 10D5910C1889C3DF00C05A0D /* ArrayIteratorConstructor.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A7BDAEC017F4EA1400F6140C /* ArrayIteratorConstructor.cpp */; }; + 10D5910D1889C3DF00C05A0D /* ArrayIteratorPrototype.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A7BDAEC217F4EA1400F6140C /* ArrayIteratorPrototype.cpp */; }; + 10D5910E1889C3DF00C05A0D /* JSSetIterator.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A790DD69182F499700588807 /* JSSetIterator.cpp */; }; + 10D5910F1889C3DF00C05A0D /* ArrayProfile.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 0F63945115D07051006A597C /* ArrayProfile.cpp */; }; + 10D591101889C3DF00C05A0D /* ArrayPrototype.cpp in Sources */ = {isa = PBXBuildFile; fileRef = F692A84D0255597D01FF60F7 /* ArrayPrototype.cpp */; }; + 10D591111889C3DF00C05A0D /* AssemblyHelpers.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 0F24E53B17EA9F5900ABB217 /* AssemblyHelpers.cpp */; }; + 10D591121889C3DF00C05A0D /* BlockAllocator.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 14816E19154CC56C00B8054C /* BlockAllocator.cpp */; }; + 10D591131889C3DF00C05A0D /* BooleanConstructor.cpp in Sources */ = {isa = PBXBuildFile; fileRef = BC7952320E15EB5600A898AB /* BooleanConstructor.cpp */; }; + 10D591141889C3DF00C05A0D /* BooleanObject.cpp in Sources */ = {isa = PBXBuildFile; fileRef = F692A8500255597D01FF60F7 /* BooleanObject.cpp */; }; + 10D591151889C3DF00C05A0D /* BooleanPrototype.cpp in Sources */ = {isa = PBXBuildFile; fileRef = BC7952340E15EB5600A898AB /* BooleanPrototype.cpp */; }; + 10D591161889C3DF00C05A0D /* BytecodeGenerator.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 969A07200ED1CE3300F1F681 /* BytecodeGenerator.cpp */; }; + 10D591171889C3DF00C05A0D /* CallData.cpp in Sources */ = {isa = PBXBuildFile; fileRef = BCA62DFE0E2826230004F30D /* CallData.cpp */; }; + 10D591181889C3DF00C05A0D /* CallFrame.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1429D8DB0ED2205B00B89619 /* CallFrame.cpp */; }; + 10D591191889C3DF00C05A0D /* CallLinkInfo.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 0F0B83AE14BCF71400885B4F /* CallLinkInfo.cpp */; }; + 10D5911A1889C3DF00C05A0D /* InjectedScript.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A513E5B5185B8BD3007E95AD /* InjectedScript.cpp */; }; + 10D5911B1889C3DF00C05A0D /* CallLinkStatus.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 0F93329314CA7DC10085F3C6 /* CallLinkStatus.cpp */; }; + 10D5911C1889C3DF00C05A0D /* ClosureCallStubRoutine.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 0F73D7AB165A142A00ACAB71 /* ClosureCallStubRoutine.cpp */; }; + 10D5911D1889C3DF00C05A0D /* CodeBlock.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 969A07900ED1D3AE00F1F681 /* CodeBlock.cpp */; settings = {COMPILER_FLAGS = "-fno-strict-aliasing"; }; }; + 10D5911E1889C3DF00C05A0D /* CodeBlockHash.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 0F8F943D1667632D00D61971 /* CodeBlockHash.cpp */; }; + 10D5911F1889C3DF00C05A0D /* CodeBlockJettisoningWatchpoint.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 0FC97F2F182020D7002C9B26 /* CodeBlockJettisoningWatchpoint.cpp */; }; + 10D591201889C3DF00C05A0D /* CodeBlockSet.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 0FD8A31117D4326C00CA2C40 /* CodeBlockSet.cpp */; }; + 10D591211889C3DF00C05A0D /* CodeCache.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A77F181F164088B200640A47 /* CodeCache.cpp */; }; + 10D591221889C3DF00C05A0D /* CodeOrigin.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 0F8F9445166764EE00D61971 /* CodeOrigin.cpp */; }; + 10D591231889C3DF00C05A0D /* CodeProfile.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 86B5822E14D2373B00A9C306 /* CodeProfile.cpp */; }; + 10D591241889C3DF00C05A0D /* CodeProfiling.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 8603CEF214C7546400AE59E3 /* CodeProfiling.cpp */; }; + 10D591251889C3DF00C05A0D /* CodeSpecializationKind.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 0F8F943A1667631100D61971 /* CodeSpecializationKind.cpp */; }; + 10D591261889C3DF00C05A0D /* CodeType.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 0F8F943F1667632D00D61971 /* CodeType.cpp */; }; + 10D591271889C3DF00C05A0D /* CommonIdentifiers.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 65EA73620BAE35D1001BB560 /* CommonIdentifiers.cpp */; }; + 10D591281889C3DF00C05A0D /* CommonSlowPaths.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A709F2F117A0AC2A00512E98 /* CommonSlowPaths.cpp */; }; + 10D591291889C3DF00C05A0D /* CommonSlowPathsExceptions.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 6553A32F17A1F1EE008CF6F3 /* CommonSlowPathsExceptions.cpp */; }; + 10D5912A1889C3DF00C05A0D /* CompilationResult.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A7E5A3A51797432D00E893C0 /* CompilationResult.cpp */; }; + 10D5912B1889C3DF00C05A0D /* Completion.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 969A09220ED1E09C00F1F681 /* Completion.cpp */; }; + 10D5912C1889C3DF00C05A0D /* ConservativeRoots.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 146B14DB12EB5B12001BEC1B /* ConservativeRoots.cpp */; }; + 10D5912D1889C3DF00C05A0D /* ConstructData.cpp in Sources */ = {isa = PBXBuildFile; fileRef = BCA62DFF0E2826310004F30D /* ConstructData.cpp */; }; + 10D5912E1889C3DF00C05A0D /* CopiedSpace.cpp in Sources */ = {isa = PBXBuildFile; fileRef = C240305314B404C90079EB64 /* CopiedSpace.cpp */; }; + 10D5912F1889C3DF00C05A0D /* CopyVisitor.cpp in Sources */ = {isa = PBXBuildFile; fileRef = C2239D1216262BDD005AC5FD /* CopyVisitor.cpp */; }; + 10D591301889C3DF00C05A0D /* DataView.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 0F2B66B017B6B5AB00A7AE3F /* DataView.cpp */; }; + 10D591311889C3DF00C05A0D /* DateConstructor.cpp in Sources */ = {isa = PBXBuildFile; fileRef = BCD203450E17135E002C7E82 /* DateConstructor.cpp */; }; + 10D591321889C3DF00C05A0D /* DateConversion.cpp in Sources */ = {isa = PBXBuildFile; fileRef = D21202280AD4310C00ED79B6 /* DateConversion.cpp */; }; + 10D591331889C3DF00C05A0D /* DateInstance.cpp in Sources */ = {isa = PBXBuildFile; fileRef = BC1166000E1997B1008066DD /* DateInstance.cpp */; }; + 10D591341889C3DF00C05A0D /* DatePrototype.cpp in Sources */ = {isa = PBXBuildFile; fileRef = BCD203470E17135E002C7E82 /* DatePrototype.cpp */; }; + 10D591351889C3DF00C05A0D /* BytecodeLivenessAnalysis.cpp in Sources */ = {isa = PBXBuildFile; fileRef = C2FCAE0E17A9C24E0034C735 /* BytecodeLivenessAnalysis.cpp */; }; + 10D591361889C3DF00C05A0D /* Debugger.cpp in Sources */ = {isa = PBXBuildFile; fileRef = F692A8580255597D01FF60F7 /* Debugger.cpp */; }; + 10D591371889C3DF00C05A0D /* DebuggerActivation.cpp in Sources */ = {isa = PBXBuildFile; fileRef = BC3135630F302FA3003DFD3A /* DebuggerActivation.cpp */; }; + 10D591381889C3DF00C05A0D /* DebuggerCallFrame.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 149559ED0DDCDDF700648087 /* DebuggerCallFrame.cpp */; }; + 10D591391889C3DF00C05A0D /* DeferGC.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 2A7A58EE1808A4C40020BDF7 /* DeferGC.cpp */; }; + 10D5913A1889C3DF00C05A0D /* DeferredCompilationCallback.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 0FC712DC17CD8778008CC93C /* DeferredCompilationCallback.cpp */; }; + 10D5913B1889C3DF00C05A0D /* DFGAbstractHeap.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A77A423617A0BBFD00A8DB81 /* DFGAbstractHeap.cpp */; }; + 10D5913C1889C3DF00C05A0D /* DFGAbstractValue.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 0F55C19317276E4600CEABFD /* DFGAbstractValue.cpp */; }; + 10D5913D1889C3DF00C05A0D /* DFGArgumentsSimplificationPhase.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 0F16015A156198BF00C2587C /* DFGArgumentsSimplificationPhase.cpp */; }; + 10D5913E1889C3DF00C05A0D /* DFGArrayMode.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 0F63948115E48114006A597C /* DFGArrayMode.cpp */; }; + 10D5913F1889C3DF00C05A0D /* DFGAtTailAbstractState.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A7D9A28F17A0BC7400EE2618 /* DFGAtTailAbstractState.cpp */; }; + 10D591401889C3DF00C05A0D /* DFGBackwardsPropagationPhase.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 0F714CA116EA92ED00F3EBEB /* DFGBackwardsPropagationPhase.cpp */; }; + 10D591411889C3DF00C05A0D /* DFGBasicBlock.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A7D89CE317A0B8CC00773AD8 /* DFGBasicBlock.cpp */; }; + 10D591421889C3DF00C05A0D /* DFGBinarySwitch.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A70B083017A0B79B00DAF14B /* DFGBinarySwitch.cpp */; }; + 10D591431889C3DF00C05A0D /* DFGBlockInsertionSet.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A7D89CE417A0B8CC00773AD8 /* DFGBlockInsertionSet.cpp */; }; + 10D591441889C3DF00C05A0D /* DFGByteCodeParser.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 86EC9DB41328DF82002B2AD7 /* DFGByteCodeParser.cpp */; }; + 10D591451889C3DF00C05A0D /* DFGCapabilities.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 0FD82E1E14172C2F00179C94 /* DFGCapabilities.cpp */; }; + 10D591461889C3DF00C05A0D /* DFGCFAPhase.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 0FFFC94B14EF909500C72532 /* DFGCFAPhase.cpp */; }; + 10D591471889C3DF00C05A0D /* DFGCFGSimplificationPhase.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 0F3B3A241544C991003ED0FF /* DFGCFGSimplificationPhase.cpp */; }; + 10D591481889C3DF00C05A0D /* DFGClobberize.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A77A423817A0BBFD00A8DB81 /* DFGClobberize.cpp */; }; + 10D591491889C3DF00C05A0D /* DFGClobberSet.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A77A423A17A0BBFD00A8DB81 /* DFGClobberSet.cpp */; }; + 10D5914A1889C3DF00C05A0D /* DFGCommon.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 0FB4B51A16B62772003F696B /* DFGCommon.cpp */; }; + 10D5914B1889C3DF00C05A0D /* DFGCommonData.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 0FEA0A2D170D40BF00BB722C /* DFGCommonData.cpp */; }; + 10D5914C1889C3DF00C05A0D /* DFGCompilationKey.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 0F38B01317CFE75500B144D3 /* DFGCompilationKey.cpp */; }; + 10D5914D1889C3DF00C05A0D /* DFGCompilationMode.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 0F38B01517CFE75500B144D3 /* DFGCompilationMode.cpp */; }; + 10D5914E1889C3DF00C05A0D /* DFGConstantFoldingPhase.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 0F3B3A17153E68EF003ED0FF /* DFGConstantFoldingPhase.cpp */; }; + 10D5914F1889C3DF00C05A0D /* DFGCPSRethreadingPhase.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 0FBE0F6B16C1DB010082C5E8 /* DFGCPSRethreadingPhase.cpp */; }; + 10D591501889C3DF00C05A0D /* DFGCriticalEdgeBreakingPhase.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A7D89CE617A0B8CC00773AD8 /* DFGCriticalEdgeBreakingPhase.cpp */; }; + 10D591511889C3DF00C05A0D /* DFGCSEPhase.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 0FFFC94D14EF909500C72532 /* DFGCSEPhase.cpp */; }; + 10D591521889C3DF00C05A0D /* DFGDCEPhase.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 0F2FC77016E12F6F0038D976 /* DFGDCEPhase.cpp */; }; + 10D591531889C3DF00C05A0D /* DFGDesiredIdentifiers.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 0F8F2B97172F04FD007DBDA5 /* DFGDesiredIdentifiers.cpp */; }; + 10D591541889C3DF00C05A0D /* DFGDesiredStructureChains.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A73E132C179624CD00E4DEA8 /* DFGDesiredStructureChains.cpp */; }; + 10D591551889C3DF00C05A0D /* DFGDesiredTransitions.cpp in Sources */ = {isa = PBXBuildFile; fileRef = C2C0F7CB17BBFC5B00464FE4 /* DFGDesiredTransitions.cpp */; }; + 10D591561889C3DF00C05A0D /* DFGDesiredWatchpoints.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 0FE853491723CDA500B618F5 /* DFGDesiredWatchpoints.cpp */; }; + 10D591571889C3DF00C05A0D /* DFGDesiredWeakReferences.cpp in Sources */ = {isa = PBXBuildFile; fileRef = C2981FD617BAEE4B00A3BC98 /* DFGDesiredWeakReferences.cpp */; }; + 10D591581889C3DF00C05A0D /* DFGDesiredWriteBarriers.cpp in Sources */ = {isa = PBXBuildFile; fileRef = C2981FDA17BAFF4400A3BC98 /* DFGDesiredWriteBarriers.cpp */; }; + 10D591591889C3DF00C05A0D /* DFGDisassembler.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 0FF427611591A1C9004CB9FF /* DFGDisassembler.cpp */; }; + 10D5915A1889C3DF00C05A0D /* DFGDominators.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 0FD81ACF154FB4EB00983E72 /* DFGDominators.cpp */; }; + 10D5915B1889C3DF00C05A0D /* DFGDriver.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 0FD3C82014115CF800FD81CB /* DFGDriver.cpp */; }; + 10D5915C1889C3DF00C05A0D /* InspectorValues.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A593CF801840377100BFCE27 /* InspectorValues.cpp */; }; + 10D5915D1889C3DF00C05A0D /* DFGEdge.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 0FB4B51B16B62772003F696B /* DFGEdge.cpp */; }; + 10D5915E1889C3DF00C05A0D /* MapIteratorPrototype.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A74DEF8D182D991400522C22 /* MapIteratorPrototype.cpp */; }; + 10D5915F1889C3DF00C05A0D /* DFGExitProfile.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 0FBC0AE41496C7C100D4FBDD /* DFGExitProfile.cpp */; }; + 10D591601889C3DF00C05A0D /* DFGFailedFinalizer.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A78A976C179738B8009DF744 /* DFGFailedFinalizer.cpp */; }; + 10D591611889C3DF00C05A0D /* DFGFinalizer.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A78A976E179738B8009DF744 /* DFGFinalizer.cpp */; }; + 10D591621889C3DF00C05A0D /* DFGFixupPhase.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 0F2BDC12151C5D4A00CD8910 /* DFGFixupPhase.cpp */; }; + 10D591631889C3DF00C05A0D /* DFGFlushedAt.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 0F9D339417FFC4E60073C2BC /* DFGFlushedAt.cpp */; }; + 10D591641889C3DF00C05A0D /* DFGFlushFormat.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A7D89CE817A0B8CC00773AD8 /* DFGFlushFormat.cpp */; }; + 10D591651889C3DF00C05A0D /* DFGFlushLivenessAnalysisPhase.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A7D89CEA17A0B8CC00773AD8 /* DFGFlushLivenessAnalysisPhase.cpp */; }; + 10D591661889C3DF00C05A0D /* DFGGraph.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 86EC9DB71328DF82002B2AD7 /* DFGGraph.cpp */; }; + 10D591671889C3DF00C05A0D /* DFGInPlaceAbstractState.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A704D90017A0BAA8006BA554 /* DFGInPlaceAbstractState.cpp */; }; + 10D591681889C3DF00C05A0D /* DFGInvalidationPointInjectionPhase.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 0FC97F3718202119002C9B26 /* DFGInvalidationPointInjectionPhase.cpp */; }; + 10D591691889C3DF00C05A0D /* DFGJITCode.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 0FEA0A2F170D40BF00BB722C /* DFGJITCode.cpp */; }; + 10D5916A1889C3DF00C05A0D /* DFGJITCompiler.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 86EC9DBB1328DF82002B2AD7 /* DFGJITCompiler.cpp */; }; + 10D5916B1889C3DF00C05A0D /* DFGJITFinalizer.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A78A9770179738B8009DF744 /* DFGJITFinalizer.cpp */; }; + 10D5916C1889C3DF00C05A0D /* DFGJumpReplacement.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 0FC97F3918202119002C9B26 /* DFGJumpReplacement.cpp */; }; + 10D5916D1889C3DF00C05A0D /* DFGLazyJSValue.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A73A53581799CD5D00170C19 /* DFGLazyJSValue.cpp */; }; + 10D5916E1889C3DF00C05A0D /* InjectedScriptHost.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A58E35901860DEC7001F24FE /* InjectedScriptHost.cpp */; }; + 10D5916F1889C3DF00C05A0D /* DFGLICMPhase.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A7D9A29217A0BC7400EE2618 /* DFGLICMPhase.cpp */; }; + 10D591701889C3DF00C05A0D /* DFGLivenessAnalysisPhase.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A7D89CEC17A0B8CC00773AD8 /* DFGLivenessAnalysisPhase.cpp */; }; + 10D591711889C3DF00C05A0D /* DFGLongLivedState.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 0FB4B51C16B62772003F696B /* DFGLongLivedState.cpp */; }; + 10D591721889C3DF00C05A0D /* DFGLoopPreHeaderCreationPhase.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A767B5B317A0B9650063D940 /* DFGLoopPreHeaderCreationPhase.cpp */; }; + 10D591731889C3DF00C05A0D /* DFGMinifiedNode.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 0F2BDC4C1522818300CD8910 /* DFGMinifiedNode.cpp */; }; + 10D591741889C3DF00C05A0D /* DFGNaturalLoops.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A737810A1799EA2E00817533 /* DFGNaturalLoops.cpp */; }; + 10D591751889C3DF00C05A0D /* DFGNode.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 0FB4B51E16B62772003F696B /* DFGNode.cpp */; }; + 10D591761889C3DF00C05A0D /* DFGNodeFlags.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 0FA581B7150E952A00B9A2D9 /* DFGNodeFlags.cpp */; }; + 10D591771889C3DF00C05A0D /* DFGOperations.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 86EC9DBF1328DF82002B2AD7 /* DFGOperations.cpp */; }; + 10D591781889C3DF00C05A0D /* InjectedScriptBase.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A514B2C0185A684400F3C7CB /* InjectedScriptBase.cpp */; }; + 10D591791889C3DF00C05A0D /* DFGOSRAvailabilityAnalysisPhase.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A7D89CEE17A0B8CC00773AD8 /* DFGOSRAvailabilityAnalysisPhase.cpp */; }; + 10D5917A1889C3DF00C05A0D /* DFGOSREntry.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 0FD82E52141DAEDE00179C94 /* DFGOSREntry.cpp */; }; + 10D5917B1889C3DF00C05A0D /* DFGOSREntrypointCreationPhase.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 0FD8A31D17D51F5700CA2C40 /* DFGOSREntrypointCreationPhase.cpp */; }; + 10D5917C1889C3DF00C05A0D /* DFGOSRExit.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 0FC0978E146A6F6300CF2442 /* DFGOSRExit.cpp */; }; + 10D5917D1889C3DF00C05A0D /* DFGOSRExitBase.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 0F235BE717178E7300690C7F /* DFGOSRExitBase.cpp */; }; + 10D5917E1889C3DF00C05A0D /* DFGOSRExitCompiler.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 0FC0978F146A6F6300CF2442 /* DFGOSRExitCompiler.cpp */; }; + 10D5917F1889C3DF00C05A0D /* DFGOSRExitCompiler32_64.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 0FC09775146943AD00CF2442 /* DFGOSRExitCompiler32_64.cpp */; }; + 10D591801889C3DF00C05A0D /* DFGStrengthReductionPhase.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 0FC20CB31852E2C600C9E954 /* DFGStrengthReductionPhase.cpp */; }; + 10D591811889C3DF00C05A0D /* DFGOSRExitCompiler64.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 0FC0977014693AEF00CF2442 /* DFGOSRExitCompiler64.cpp */; }; + 10D591821889C3DF00C05A0D /* DFGOSRExitCompilerCommon.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 0F7025A71714B0F800382C0E /* DFGOSRExitCompilerCommon.cpp */; }; + 10D591831889C3DF00C05A0D /* DFGOSRExitJumpPlaceholder.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 0FEFC9A71681A3B000567F53 /* DFGOSRExitJumpPlaceholder.cpp */; }; + 10D591841889C3DF00C05A0D /* DFGOSRExitPreparation.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 0F235BE917178E7300690C7F /* DFGOSRExitPreparation.cpp */; }; + 10D591851889C3DF00C05A0D /* DFGPhase.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 0FFFC94F14EF909500C72532 /* DFGPhase.cpp */; }; + 10D591861889C3DF00C05A0D /* DFGPlan.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A78A9772179738B8009DF744 /* DFGPlan.cpp */; }; + 10D591871889C3DF00C05A0D /* DFGPredictionInjectionPhase.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 0FBE0F6D16C1DB010082C5E8 /* DFGPredictionInjectionPhase.cpp */; }; + 10D591881889C3DF00C05A0D /* DFGPredictionPropagationPhase.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 0FFFC95114EF909500C72532 /* DFGPredictionPropagationPhase.cpp */; }; + 10D591891889C3DF00C05A0D /* DFGSpeculativeJIT.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 86EC9DC21328DF82002B2AD7 /* DFGSpeculativeJIT.cpp */; }; + 10D5918A1889C3DF00C05A0D /* DFGSpeculativeJIT32_64.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 86880F1B14328BB900B08D42 /* DFGSpeculativeJIT32_64.cpp */; }; + 10D5918B1889C3DF00C05A0D /* DFGSpeculativeJIT64.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 86880F4C14353B2100B08D42 /* DFGSpeculativeJIT64.cpp */; }; + 10D5918C1889C3DF00C05A0D /* DFGSSAConversionPhase.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A7D89CF017A0B8CC00773AD8 /* DFGSSAConversionPhase.cpp */; }; + 10D5918D1889C3DF00C05A0D /* DFGStackLayoutPhase.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 0F9FB4F217FCB91700CB67F8 /* DFGStackLayoutPhase.cpp */; }; + 10D5918E1889C3DF00C05A0D /* DFGThunks.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 0FC0979F146B28C700CF2442 /* DFGThunks.cpp */; }; + 10D5918F1889C3DF00C05A0D /* DFGTierUpCheckInjectionPhase.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 0FD8A31F17D51F5700CA2C40 /* DFGTierUpCheckInjectionPhase.cpp */; }; + 10D591901889C3DF00C05A0D /* DFGToFTLDeferredCompilationCallback.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 0FD8A32117D51F5700CA2C40 /* DFGToFTLDeferredCompilationCallback.cpp */; }; + 10D591911889C3DF00C05A0D /* DFGToFTLForOSREntryDeferredCompilationCallback.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 0FD8A32317D51F5700CA2C40 /* DFGToFTLForOSREntryDeferredCompilationCallback.cpp */; }; + 10D591921889C3DF00C05A0D /* DFGTypeCheckHoistingPhase.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 0F63943C15C75F14006A597C /* DFGTypeCheckHoistingPhase.cpp */; }; + 10D591931889C3DF00C05A0D /* DFGUnificationPhase.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 0FBE0F6F16C1DB010082C5E8 /* DFGUnificationPhase.cpp */; }; + 10D591941889C3DF00C05A0D /* DFGUseKind.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 0F34B14716D4200E001CDA5A /* DFGUseKind.cpp */; }; + 10D591951889C3DF00C05A0D /* DFGValidate.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 0F3B3A2915474FF4003ED0FF /* DFGValidate.cpp */; }; + 10D591961889C3DF00C05A0D /* ScriptFunctionCall.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A55D93A3185012A800400DED /* ScriptFunctionCall.cpp */; }; + 10D591971889C3DF00C05A0D /* DFGValueSource.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 0F2BDC4E15228BE700CD8910 /* DFGValueSource.cpp */; }; + 10D591981889C3DF00C05A0D /* DFGVariableAccessDataDump.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 0FDDBFB21666EED500C55FEF /* DFGVariableAccessDataDump.cpp */; }; + 10D591991889C3DF00C05A0D /* DFGVariableEvent.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 0F2BDC5015228FFA00CD8910 /* DFGVariableEvent.cpp */; }; + 10D5919A1889C3DF00C05A0D /* DFGVariableEventStream.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 0F2BDC421522801700CD8910 /* DFGVariableEventStream.cpp */; }; + 10D5919B1889C3DF00C05A0D /* DFGVirtualRegisterAllocationPhase.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 0FFFC95314EF909500C72532 /* DFGVirtualRegisterAllocationPhase.cpp */; }; + 10D5919C1889C3DF00C05A0D /* DFGWatchpointCollectionPhase.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 0FC97F3B18202119002C9B26 /* DFGWatchpointCollectionPhase.cpp */; }; + 10D5919D1889C3DF00C05A0D /* DFGWorklist.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 0FDB2CE5174830A2007B3C1B /* DFGWorklist.cpp */; }; + 10D5919E1889C3DF00C05A0D /* Disassembler.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 0F9D336E165DBB8D005AD387 /* Disassembler.cpp */; }; + 10D5919F1889C3DF00C05A0D /* DumpContext.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A70447EB17A0BD7000F5898E /* DumpContext.cpp */; }; + 10D591A01889C3DF00C05A0D /* Error.cpp in Sources */ = {isa = PBXBuildFile; fileRef = BC337BEA0E1B00CB0076918A /* Error.cpp */; }; + 10D591A11889C3DF00C05A0D /* ErrorConstructor.cpp in Sources */ = {isa = PBXBuildFile; fileRef = BC02E9040E1839DB000F9297 /* ErrorConstructor.cpp */; }; + 10D591A21889C3DF00C05A0D /* ErrorInstance.cpp in Sources */ = {isa = PBXBuildFile; fileRef = BC02E98A0E183E38000F9297 /* ErrorInstance.cpp */; }; + 10D591A31889C3DF00C05A0D /* ErrorPrototype.cpp in Sources */ = {isa = PBXBuildFile; fileRef = BC02E9060E1839DB000F9297 /* ErrorPrototype.cpp */; }; + 10D591A41889C3DF00C05A0D /* ExceptionHelpers.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1429D8770ED21ACD00B89619 /* ExceptionHelpers.cpp */; }; + 10D591A51889C3DF00C05A0D /* Executable.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 86CA032D1038E8440028A609 /* Executable.cpp */; }; + 10D591A61889C3DF00C05A0D /* ExecutableAllocator.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A7B48DB60EE74CFC00DCBDB6 /* ExecutableAllocator.cpp */; }; + 10D591A71889C3DF00C05A0D /* ExecutableAllocatorFixedVMPool.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 86DB64630F95C6FC00D7D921 /* ExecutableAllocatorFixedVMPool.cpp */; }; + 10D591A81889C3DF00C05A0D /* ExecutionCounter.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 0F56A1D415001CF2002992B1 /* ExecutionCounter.cpp */; }; + 10D591A91889C3DF00C05A0D /* JSGlobalObjectDebuggable.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A59455901824744700CC3843 /* JSGlobalObjectDebuggable.cpp */; }; + 10D591AA1889C3DF00C05A0D /* ExitKind.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 0FB105821675480C00F8AB6E /* ExitKind.cpp */; }; + 10D591AB1889C3DF00C05A0D /* ScriptValue.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A54CF2F2184EAB2400237F19 /* ScriptValue.cpp */; }; + 10D591AC1889C3DF00C05A0D /* FTLAbstractHeap.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 0FEA0A171708B00700BB722C /* FTLAbstractHeap.cpp */; }; + 10D591AD1889C3DF00C05A0D /* FTLAbstractHeapRepository.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 0FEA0A191708B00700BB722C /* FTLAbstractHeapRepository.cpp */; }; + 10D591AE1889C3DF00C05A0D /* FTLCapabilities.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 0FEA09FE170513DB00BB722C /* FTLCapabilities.cpp */; }; + 10D591AF1889C3DF00C05A0D /* FTLCommonValues.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 0FEA0A251709623B00BB722C /* FTLCommonValues.cpp */; }; + 10D591B01889C3DF00C05A0D /* JSPromiseDeferred.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 7C008CD8187124BB00955C24 /* JSPromiseDeferred.cpp */; }; + 10D591B11889C3DF00C05A0D /* InspectorJSFrontendDispatchers.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A532438318568317002ED692 /* InspectorJSFrontendDispatchers.cpp */; }; + 10D591B21889C3DF00C05A0D /* FTLCompile.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 0FEA0A00170513DB00BB722C /* FTLCompile.cpp */; }; + 10D591B31889C3DF00C05A0D /* FTLExitArgument.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 0F235BBD17178E1C00690C7F /* FTLExitArgument.cpp */; }; + 10D591B41889C3DF00C05A0D /* FTLExitArgumentForOperand.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 0F235BBF17178E1C00690C7F /* FTLExitArgumentForOperand.cpp */; }; + 10D591B51889C3DF00C05A0D /* FTLExitThunkGenerator.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 0F235BC217178E1C00690C7F /* FTLExitThunkGenerator.cpp */; }; + 10D591B61889C3DF00C05A0D /* FTLExitValue.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 0F235BC417178E1C00690C7F /* FTLExitValue.cpp */; }; + 10D591B71889C3DF00C05A0D /* FTLFail.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A7F2996917A0BB670010417A /* FTLFail.cpp */; }; + 10D591B81889C3DF00C05A0D /* FTLForOSREntryJITCode.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 0FD8A31517D51F2200CA2C40 /* FTLForOSREntryJITCode.cpp */; }; + 10D591B91889C3DF00C05A0D /* FTLInlineCacheSize.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 0F25F1A8181635F300522F39 /* FTLInlineCacheSize.cpp */; }; + 10D591BA1889C3DF00C05A0D /* FTLIntrinsicRepository.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 0FEA0A261709623B00BB722C /* FTLIntrinsicRepository.cpp */; }; + 10D591BB1889C3DF00C05A0D /* FTLJITCode.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 0FEA0A02170513DB00BB722C /* FTLJITCode.cpp */; }; + 10D591BC1889C3DF00C05A0D /* FTLJITFinalizer.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A78A977D179738D5009DF744 /* FTLJITFinalizer.cpp */; }; + 10D591BD1889C3DF00C05A0D /* FTLLink.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 0F8F2B93172E049E007DBDA5 /* FTLLink.cpp */; }; + 10D591BE1889C3DF00C05A0D /* JSMapIterator.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A74DEF8F182D991400522C22 /* JSMapIterator.cpp */; }; + 10D591BF1889C3DF00C05A0D /* FTLLocation.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 0FCEFADD180738C000472CE4 /* FTLLocation.cpp */; }; + 10D591C01889C3DF00C05A0D /* FTLLowerDFGToLLVM.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 0FEA0A04170513DB00BB722C /* FTLLowerDFGToLLVM.cpp */; }; + 10D591C11889C3DF00C05A0D /* FTLOSREntry.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 0FD8A31717D51F2200CA2C40 /* FTLOSREntry.cpp */; }; + 10D591C21889C3DF00C05A0D /* FTLOSRExit.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 0F235BC617178E1C00690C7F /* FTLOSRExit.cpp */; }; + 10D591C31889C3DF00C05A0D /* FTLOSRExitCompiler.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 0F235BC917178E1C00690C7F /* FTLOSRExitCompiler.cpp */; }; + 10D591C41889C3DF00C05A0D /* FTLOutput.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 0FEA0A291709629600BB722C /* FTLOutput.cpp */; }; + 10D591C51889C3DF00C05A0D /* FTLSaveRestore.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 0FCEFAA91804C13E00472CE4 /* FTLSaveRestore.cpp */; }; + 10D591C61889C3DF00C05A0D /* FTLSlowPathCall.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 0F25F1AA181635F300522F39 /* FTLSlowPathCall.cpp */; }; + 10D591C71889C3DF00C05A0D /* FTLSlowPathCallKey.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 0F25F1AC181635F300522F39 /* FTLSlowPathCallKey.cpp */; }; + 10D591C81889C3DF00C05A0D /* FTLStackMaps.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 0F9D33981803ADB70073C2BC /* FTLStackMaps.cpp */; }; + 10D591C91889C3DF00C05A0D /* FTLState.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 0FEA0A151706BB9000BB722C /* FTLState.cpp */; }; + 10D591CA1889C3DF00C05A0D /* JSPromiseFunctions.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 7C008CD0186F8A9300955C24 /* JSPromiseFunctions.cpp */; }; + 10D591CB1889C3DF00C05A0D /* FTLThunks.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 0F235BCB17178E1C00690C7F /* FTLThunks.cpp */; }; + 10D591CC1889C3DF00C05A0D /* InspectorBackendDispatcher.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A593CF7A1840360300BFCE27 /* InspectorBackendDispatcher.cpp */; }; + 10D591CD1889C3DF00C05A0D /* FTLValueFormat.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 0F235BCD17178E1C00690C7F /* FTLValueFormat.cpp */; }; + 10D591CE1889C3DF00C05A0D /* FunctionConstructor.cpp in Sources */ = {isa = PBXBuildFile; fileRef = BC2680C00E16D4E900A06E92 /* FunctionConstructor.cpp */; }; + 10D591CF1889C3DF00C05A0D /* FunctionExecutableDump.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 0FB4B52116B6278D003F696B /* FunctionExecutableDump.cpp */; }; + 10D591D01889C3DF00C05A0D /* FunctionPrototype.cpp in Sources */ = {isa = PBXBuildFile; fileRef = F692A85C0255597D01FF60F7 /* FunctionPrototype.cpp */; }; + 10D591D11889C3DF00C05A0D /* GCActivityCallback.cpp in Sources */ = {isa = PBXBuildFile; fileRef = C2D58C3315912FEE0021A844 /* GCActivityCallback.cpp */; }; + 10D591D21889C3DF00C05A0D /* GCAwareJITStubRoutine.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 0F766D2D15A8DCDD008F363E /* GCAwareJITStubRoutine.cpp */; }; + 10D591D31889C3DF00C05A0D /* GCThread.cpp in Sources */ = {isa = PBXBuildFile; fileRef = C2239D1516262BDD005AC5FD /* GCThread.cpp */; }; + 10D591D41889C3DF00C05A0D /* GCThreadSharedData.cpp in Sources */ = {isa = PBXBuildFile; fileRef = C21122DE15DD9AB300790E3A /* GCThreadSharedData.cpp */; }; + 10D591D51889C3DF00C05A0D /* GetByIdStatus.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 0F93329514CA7DC10085F3C6 /* GetByIdStatus.cpp */; }; + 10D591D61889C3DF00C05A0D /* JSPromiseReaction.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 7C008CDC1871258D00955C24 /* JSPromiseReaction.cpp */; }; + 10D591D71889C3DF00C05A0D /* GetterSetter.cpp in Sources */ = {isa = PBXBuildFile; fileRef = BC02E9B80E184545000F9297 /* GetterSetter.cpp */; }; + 10D591D81889C3DF00C05A0D /* HandleSet.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 142E312C134FF0A600AFADB5 /* HandleSet.cpp */; }; + 10D591D91889C3DF00C05A0D /* HandleStack.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 142E312E134FF0A600AFADB5 /* HandleStack.cpp */; }; + 10D591DA1889C3DF00C05A0D /* Heap.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 14BA7A9513AADFF8005B7C2C /* Heap.cpp */; }; + 10D591DB1889C3DF00C05A0D /* HeapStatistics.cpp in Sources */ = {isa = PBXBuildFile; fileRef = C24D31E0161CD695002AA4DB /* HeapStatistics.cpp */; }; + 10D591DC1889C3DF00C05A0D /* HeapTimer.cpp in Sources */ = {isa = PBXBuildFile; fileRef = C2E526BB1590EF000054E48D /* HeapTimer.cpp */; }; + 10D591DD1889C3DF00C05A0D /* HostCallReturnValue.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 0F4680D014BBC5F800BFE272 /* HostCallReturnValue.cpp */; }; + 10D591DE1889C3DF00C05A0D /* Identifier.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 933A349D038AE80F008635CE /* Identifier.cpp */; }; + 10D591DF1889C3DF00C05A0D /* IncrementalSweeper.cpp in Sources */ = {isa = PBXBuildFile; fileRef = C25F8BCB157544A900245B71 /* IncrementalSweeper.cpp */; }; + 10D591E01889C3DF00C05A0D /* IndexingType.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 0F13E04C16164A1B00DC8DE7 /* IndexingType.cpp */; }; + 10D591E11889C3DF00C05A0D /* InitializeLLVM.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 0FCEFAC41805E75500472CE4 /* InitializeLLVM.cpp */; }; + 10D591E21889C3DF00C05A0D /* InitializeLLVMMac.mm in Sources */ = {isa = PBXBuildFile; fileRef = 0FCEFAAF1805CA6D00472CE4 /* InitializeLLVMMac.mm */; }; + 10D591E31889C3DF00C05A0D /* InitializeLLVMPOSIX.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 0FCEFAC51805E75500472CE4 /* InitializeLLVMPOSIX.cpp */; }; + 10D591E41889C3DF00C05A0D /* InitializeThreading.cpp in Sources */ = {isa = PBXBuildFile; fileRef = E178636C0D9BEEC300D74E75 /* InitializeThreading.cpp */; }; + 10D591E51889C3DF00C05A0D /* InlineCallFrameSet.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 0F24E55317F0B71C00ABB217 /* InlineCallFrameSet.cpp */; }; + 10D591E61889C3DF00C05A0D /* IntendedStructureChain.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A78853F717972629001440E4 /* IntendedStructureChain.cpp */; }; + 10D591E71889C3DF00C05A0D /* InternalFunction.cpp in Sources */ = {isa = PBXBuildFile; fileRef = BC9BB95B0E19680600DF8855 /* InternalFunction.cpp */; }; + 10D591E81889C3DF00C05A0D /* DFGStoreBarrierElisionPhase.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 2ACCF3DC185FE26B0083E2AD /* DFGStoreBarrierElisionPhase.cpp */; }; + 10D591E91889C3DF00C05A0D /* Interpreter.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1429D7D30ED2128200B89619 /* Interpreter.cpp */; }; + 10D591EA1889C3DF00C05A0D /* JIT.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1429D92D0ED22D7000B89619 /* JIT.cpp */; }; + 10D591EB1889C3DF00C05A0D /* JITArithmetic.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 86A90ECF0EE7D51F00AB350D /* JITArithmetic.cpp */; }; + 10D591EC1889C3DF00C05A0D /* JITArithmetic32_64.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A75706DD118A2BCF0057F88F /* JITArithmetic32_64.cpp */; }; + 10D591ED1889C3DF00C05A0D /* JITCall.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 86CC85A20EE79B7400288682 /* JITCall.cpp */; }; + 10D591EE1889C3DF00C05A0D /* JITCall32_64.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 146FE51111A710430087AE66 /* JITCall32_64.cpp */; }; + 10D591EF1889C3DF00C05A0D /* JITCode.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 0F8F94431667635200D61971 /* JITCode.cpp */; }; + 10D591F01889C3DF00C05A0D /* JITDisassembler.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 0FAF7EFA165BA919000C8455 /* JITDisassembler.cpp */; }; + 10D591F11889C3DF00C05A0D /* JITExceptions.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 0F46807F14BA572700BFE272 /* JITExceptions.cpp */; }; + 10D591F21889C3DF00C05A0D /* JITInlineCacheGenerator.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 0FB14E1C18124ACE009B6B4D /* JITInlineCacheGenerator.cpp */; }; + 10D591F31889C3DF00C05A0D /* JITOpcodes.cpp in Sources */ = {isa = PBXBuildFile; fileRef = BCDD51E90FB8DF74004A8BDC /* JITOpcodes.cpp */; }; + 10D591F41889C3DF00C05A0D /* JITOpcodes32_64.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A71236E41195F33C00BD2174 /* JITOpcodes32_64.cpp */; }; + 10D591F51889C3DF00C05A0D /* WriteBarrierBuffer.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 2A4EC9091860D6C20094F782 /* WriteBarrierBuffer.cpp */; }; + 10D591F61889C3DF00C05A0D /* JITOperations.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 0F24E54517EE274900ABB217 /* JITOperations.cpp */; }; + 10D591F71889C3DF00C05A0D /* JITPropertyAccess.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 86CC85C30EE7A89400288682 /* JITPropertyAccess.cpp */; }; + 10D591F81889C3DF00C05A0D /* JITPropertyAccess32_64.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A7C1E8C8112E701C00A37F98 /* JITPropertyAccess32_64.cpp */; }; + 10D591F91889C3DF00C05A0D /* JITStubRoutine.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 0F766D2615A8CC1B008F363E /* JITStubRoutine.cpp */; }; + 10D591FA1889C3DF00C05A0D /* JITStubRoutineSet.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 0F766D2915A8CC34008F363E /* JITStubRoutineSet.cpp */; }; + 10D591FB1889C3DF00C05A0D /* JITStubs.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 14A23D6C0F4E19CE0023CDAD /* JITStubs.cpp */; }; + 10D591FC1889C3DF00C05A0D /* JITThunks.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 0F5EF91B16878F78003E5C25 /* JITThunks.cpp */; }; + 10D591FD1889C3DF00C05A0D /* JITToDFGDeferredCompilationCallback.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 0FC712E017CD878F008CC93C /* JITToDFGDeferredCompilationCallback.cpp */; }; + 10D591FE1889C3DF00C05A0D /* JSActivation.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 14DA818F0D99FD2000B0A4FB /* JSActivation.cpp */; }; + 10D591FF1889C3DF00C05A0D /* JSAPIValueWrapper.cpp in Sources */ = {isa = PBXBuildFile; fileRef = BC0894D50FAFBA2D00001865 /* JSAPIValueWrapper.cpp */; }; + 10D592001889C3DF00C05A0D /* JSAPIWrapperObject.mm in Sources */ = {isa = PBXBuildFile; fileRef = C2CF39BF16E15A8100DD69BE /* JSAPIWrapperObject.mm */; }; + 10D592011889C3DF00C05A0D /* JSArgumentsIterator.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A76140CB182982CB00750624 /* JSArgumentsIterator.cpp */; }; + 10D592021889C3DF00C05A0D /* JSArray.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 93ADFCE60CCBD7AC00D30B08 /* JSArray.cpp */; }; + 10D592031889C3DF00C05A0D /* JSArrayBuffer.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 0F2B66B417B6B5AB00A7AE3F /* JSArrayBuffer.cpp */; }; + 10D592041889C3DF00C05A0D /* JSArrayBufferConstructor.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 0F2B66B617B6B5AB00A7AE3F /* JSArrayBufferConstructor.cpp */; }; + 10D592051889C3DF00C05A0D /* JSArrayBufferPrototype.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 0F2B66B817B6B5AB00A7AE3F /* JSArrayBufferPrototype.cpp */; }; + 10D592061889C3DF00C05A0D /* JSArrayBufferView.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 0F2B66BA17B6B5AB00A7AE3F /* JSArrayBufferView.cpp */; }; + 10D592071889C3DF00C05A0D /* JSArrayIterator.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A7BDAEC417F4EA1400F6140C /* JSArrayIterator.cpp */; }; + 10D592081889C3DF00C05A0D /* JSBase.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1421359A0A677F4F00A8195E /* JSBase.cpp */; }; + 10D592091889C3DF00C05A0D /* JSBoundFunction.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 86FA9E8F142BBB2D001773B7 /* JSBoundFunction.cpp */; }; + 10D5920A1889C3DF00C05A0D /* JSCallbackConstructor.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1440F8AD0A508D200005F061 /* JSCallbackConstructor.cpp */; }; + 10D5920B1889C3DF00C05A0D /* JSCallbackFunction.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1440F8900A508B100005F061 /* JSCallbackFunction.cpp */; }; + 10D5920C1889C3DF00C05A0D /* JSCallbackObject.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 14ABDF5E0A437FEF00ECCA01 /* JSCallbackObject.cpp */; }; + 10D5920D1889C3DF00C05A0D /* JSCell.cpp in Sources */ = {isa = PBXBuildFile; fileRef = BC7F8FBA0E19D1EF008632C0 /* JSCell.cpp */; }; + 10D5920E1889C3DF00C05A0D /* JSCJSValue.cpp in Sources */ = {isa = PBXBuildFile; fileRef = F692A8870255597D01FF60F7 /* JSCJSValue.cpp */; }; + 10D5920F1889C3DF00C05A0D /* JSClassRef.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1440FCE20A51E46B0005F061 /* JSClassRef.cpp */; }; + 10D592101889C3DF00C05A0D /* JSContext.mm in Sources */ = {isa = PBXBuildFile; fileRef = 86E3C608167BAB87006D760A /* JSContext.mm */; }; + 10D592111889C3DF00C05A0D /* JSContextRef.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 14BD5A290A3E91F600BAF59C /* JSContextRef.cpp */; }; + 10D592121889C3DF00C05A0D /* JSCTestRunnerUtils.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A72028B41797601E0098028C /* JSCTestRunnerUtils.cpp */; }; + 10D592131889C3DF00C05A0D /* JSDataView.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 0F2B66BD17B6B5AB00A7AE3F /* JSDataView.cpp */; }; + 10D592141889C3DF00C05A0D /* JSDataViewPrototype.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 0F2B66BF17B6B5AB00A7AE3F /* JSDataViewPrototype.cpp */; }; + 10D592151889C3DF00C05A0D /* JSDateMath.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 9788FC221471AD0C0068CE2D /* JSDateMath.cpp */; }; + 10D592161889C3DF00C05A0D /* JSFunction.cpp in Sources */ = {isa = PBXBuildFile; fileRef = F692A85E0255597D01FF60F7 /* JSFunction.cpp */; }; + 10D592171889C3DF00C05A0D /* JSGlobalObject.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 14DE0D680D02431400AACCA2 /* JSGlobalObject.cpp */; }; + 10D592181889C3DF00C05A0D /* JSGlobalObjectFunctions.cpp in Sources */ = {isa = PBXBuildFile; fileRef = BC756FC60E2031B200DE7D12 /* JSGlobalObjectFunctions.cpp */; }; + 10D592191889C3DF00C05A0D /* JSLock.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 65EA4C99092AF9E20093D800 /* JSLock.cpp */; }; + 10D5921A1889C3DF00C05A0D /* JSManagedValue.mm in Sources */ = {isa = PBXBuildFile; fileRef = C25D709916DE99F400FCA6BC /* JSManagedValue.mm */; }; + 10D5921B1889C3DF00C05A0D /* JSMap.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A700873F17CBE8EB00C3E643 /* JSMap.cpp */; }; + 10D5921C1889C3DF00C05A0D /* JSNameScope.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 14874ADF15EBDE4A002E3587 /* JSNameScope.cpp */; }; + 10D5921D1889C3DF00C05A0D /* JSNotAnObject.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A72700780DAC605600E548D7 /* JSNotAnObject.cpp */; }; + 10D5921E1889C3DF00C05A0D /* JSObject.cpp in Sources */ = {isa = PBXBuildFile; fileRef = BC22A3980E16E14800AF21C8 /* JSObject.cpp */; }; + 10D5921F1889C3DF00C05A0D /* JSObjectRef.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1482B7E20A43076000517CFC /* JSObjectRef.cpp */; }; + 10D592201889C3DF00C05A0D /* JSONObject.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A7F9935E0FD7325100A0B2D0 /* JSONObject.cpp */; }; + 10D592211889C3DF00C05A0D /* JSProfilerPrivate.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 95988BA90E477BEC00D28D4D /* JSProfilerPrivate.cpp */; }; + 10D592221889C3DF00C05A0D /* JSPromise.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 7C184E1817BEDBD3007CB63A /* JSPromise.cpp */; }; + 10D592231889C3DF00C05A0D /* JSPromiseConstructor.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 7C184E2017BEE240007CB63A /* JSPromiseConstructor.cpp */; }; + 10D592241889C3DF00C05A0D /* JSPromisePrototype.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 7C184E1C17BEE22E007CB63A /* JSPromisePrototype.cpp */; }; + 10D592251889C3DF00C05A0D /* JSPropertyNameIterator.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A727FF660DA3053B00E548D7 /* JSPropertyNameIterator.cpp */; }; + 10D592261889C3DF00C05A0D /* JSProxy.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 862553CE16136AA5009F17D0 /* JSProxy.cpp */; }; + 10D592271889C3DF00C05A0D /* JSScope.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 14874AE115EBDE4A002E3587 /* JSScope.cpp */; }; + 10D592281889C3DF00C05A0D /* JSScriptRef.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A7C0C4AA167C08CD0017011D /* JSScriptRef.cpp */; }; + 10D592291889C3DF00C05A0D /* JSSegmentedVariableObject.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 0F919D0E157F3327004A4E7D /* JSSegmentedVariableObject.cpp */; }; + 10D5922A1889C3DF00C05A0D /* JSSet.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A7299D9B17D12837005F5FF9 /* JSSet.cpp */; }; + 10D5922B1889C3DF00C05A0D /* JSStack.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1429D85B0ED218E900B89619 /* JSStack.cpp */; }; + 10D5922C1889C3DF00C05A0D /* JSString.cpp in Sources */ = {isa = PBXBuildFile; fileRef = BC02E9B60E1842FA000F9297 /* JSString.cpp */; }; + 10D5922D1889C3DF00C05A0D /* JSStringJoiner.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 2600B5A4152BAAA70091EE5F /* JSStringJoiner.cpp */; }; + 10D5922E1889C3DF00C05A0D /* ArrayBufferNeuteringWatchpoint.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 0FFC99D2184EE318009C10AB /* ArrayBufferNeuteringWatchpoint.cpp */; }; + 10D5922F1889C3DF00C05A0D /* JSStringRef.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1482B74C0A43032800517CFC /* JSStringRef.cpp */; }; + 10D592301889C3DF00C05A0D /* JSStringRefCF.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 146AAB370B66A94400E55F16 /* JSStringRefCF.cpp */; }; + 10D592311889C3DF00C05A0D /* JSSymbolTableObject.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 0F919D09157EE09D004A4E7D /* JSSymbolTableObject.cpp */; }; + 10D592321889C3DF00C05A0D /* JSTypedArrayConstructors.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 0F2B66CC17B6B5AB00A7AE3F /* JSTypedArrayConstructors.cpp */; }; + 10D592331889C3DF00C05A0D /* InspectorJSTypeBuilders.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A532438518568317002ED692 /* InspectorJSTypeBuilders.cpp */; }; + 10D592341889C3DF00C05A0D /* JSTypedArrayPrototypes.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 0F2B66CE17B6B5AB00A7AE3F /* JSTypedArrayPrototypes.cpp */; }; + 10D592351889C3DF00C05A0D /* JSTypedArrays.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 0F2B66D017B6B5AB00A7AE3F /* JSTypedArrays.cpp */; }; + 10D592361889C3DF00C05A0D /* JSValue.mm in Sources */ = {isa = PBXBuildFile; fileRef = 86E3C60D167BAB87006D760A /* JSValue.mm */; }; + 10D592371889C3DF00C05A0D /* JSValueRef.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 14BD5A2B0A3E91F600BAF59C /* JSValueRef.cpp */; }; + 10D592381889C3DF00C05A0D /* JSVariableObject.cpp in Sources */ = {isa = PBXBuildFile; fileRef = BC22A39A0E16E14800AF21C8 /* JSVariableObject.cpp */; }; + 10D592391889C3DF00C05A0D /* JSVirtualMachine.mm in Sources */ = {isa = PBXBuildFile; fileRef = 86E3C610167BAB87006D760A /* JSVirtualMachine.mm */; }; + 10D5923A1889C3DF00C05A0D /* VMEntryScope.cpp in Sources */ = {isa = PBXBuildFile; fileRef = FE5932A5183C5A2600A1ECCC /* VMEntryScope.cpp */; }; + 10D5923B1889C3DF00C05A0D /* JSWeakMap.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A7CA3AE117DA41AE006538AF /* JSWeakMap.cpp */; }; + 10D5923C1889C3DF00C05A0D /* JSWeakObjectMapRefPrivate.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A7482B7A1166CDEA003B0712 /* JSWeakObjectMapRefPrivate.cpp */; }; + 10D5923D1889C3DF00C05A0D /* JSWithScope.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1442565F15EDE98D0066A49B /* JSWithScope.cpp */; }; + 10D5923E1889C3DF00C05A0D /* JSWrapperMap.mm in Sources */ = {isa = PBXBuildFile; fileRef = 86E3C60B167BAB87006D760A /* JSWrapperMap.mm */; }; + 10D5923F1889C3DF00C05A0D /* JSWrapperObject.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 65C7A1710A8EAACB00FA37EA /* JSWrapperObject.cpp */; }; + 10D592401889C3DF00C05A0D /* JumpTable.cpp in Sources */ = {isa = PBXBuildFile; fileRef = BCFD8C900EEB2EE700283848 /* JumpTable.cpp */; }; + 10D592411889C3DF00C05A0D /* LazyOperandValueProfile.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 0FB5467814F5C468002C2989 /* LazyOperandValueProfile.cpp */; }; + 10D592421889C3DF00C05A0D /* LegacyProfiler.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 95AB832E0DA42CAD00BC83F3 /* LegacyProfiler.cpp */; }; + 10D592431889C3DF00C05A0D /* Lexer.cpp in Sources */ = {isa = PBXBuildFile; fileRef = F692A8650255597D01FF60F7 /* Lexer.cpp */; }; + 10D592441889C3DF00C05A0D /* JSInjectedScriptHostPrototype.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A513E5BC185BFACC007E95AD /* JSInjectedScriptHostPrototype.cpp */; }; + 10D592451889C3DF00C05A0D /* LinkBuffer.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 0FF4275615914A20004CB9FF /* LinkBuffer.cpp */; }; + 10D592461889C3DF00C05A0D /* LiteralParser.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A7E2EA6A0FB460CF00601F06 /* LiteralParser.cpp */; }; + 10D592471889C3DF00C05A0D /* LLIntCLoop.cpp in Sources */ = {isa = PBXBuildFile; fileRef = FE20CE9B15F04A9500DF3430 /* LLIntCLoop.cpp */; }; + 10D592481889C3DF00C05A0D /* LLIntData.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 0F4680CE14BBB3D100BFE272 /* LLIntData.cpp */; }; + 10D592491889C3DF00C05A0D /* JSGlobalObjectInspectorController.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A51007BE187CC3C600B38879 /* JSGlobalObjectInspectorController.cpp */; }; + 10D5924A1889C3DF00C05A0D /* LLIntEntrypoint.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 0F38B00F17CF077F00B144D3 /* LLIntEntrypoint.cpp */; }; + 10D5924B1889C3DF00C05A0D /* LLIntExceptions.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 0F46809D14BA7F8200BFE272 /* LLIntExceptions.cpp */; }; + 10D5924C1889C3DF00C05A0D /* LLIntSlowPaths.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 0F46809F14BA7F8200BFE272 /* LLIntSlowPaths.cpp */; settings = {COMPILER_FLAGS = "-Wno-unused-parameter"; }; }; + 10D5924D1889C3DF00C05A0D /* LLIntThunks.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 0F0B839714BCF45A00885B4F /* LLIntThunks.cpp */; }; + 10D5924E1889C3DF00C05A0D /* LLVMAPI.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 0FCEFAC71805E75500472CE4 /* LLVMAPI.cpp */; }; + 10D5924F1889C3DF00C05A0D /* LLVMDisassembler.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A7E5AB331799E4B200D2833D /* LLVMDisassembler.cpp */; }; + 10D592501889C3DF00C05A0D /* Lookup.cpp in Sources */ = {isa = PBXBuildFile; fileRef = F692A8680255597D01FF60F7 /* Lookup.cpp */; }; + 10D592511889C3DF00C05A0D /* LowLevelInterpreter.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 0F4680C714BBB16900BFE272 /* LowLevelInterpreter.cpp */; }; + 10D592521889C3DF00C05A0D /* MachineStackMarker.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 14B7233F12D7D0DA003BD5ED /* MachineStackMarker.cpp */; }; + 10D592531889C3DF00C05A0D /* RemoteInspectorDebuggable.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A594558E18245EDE00CC3843 /* RemoteInspectorDebuggable.cpp */; }; + 10D592541889C3DF00C05A0D /* MacroAssembler.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 0FEB3ECE16237F6700AB67AD /* MacroAssembler.cpp */; }; + 10D592551889C3DF00C05A0D /* MacroAssemblerARM.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 86C568DD11A213EE0007F7F0 /* MacroAssemblerARM.cpp */; }; + 10D592561889C3DF00C05A0D /* MacroAssemblerARMv7.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A729009B17976C6000317298 /* MacroAssemblerARMv7.cpp */; }; + 10D592571889C3DF00C05A0D /* InspectorJSBackendDispatchers.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A532438118568317002ED692 /* InspectorJSBackendDispatchers.cpp */; }; + 10D592581889C3DF00C05A0D /* MacroAssemblerX86Common.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A7A4AE0717973B26005612B1 /* MacroAssemblerX86Common.cpp */; }; + 10D592591889C3DF00C05A0D /* MapConstructor.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A700873717CBE85300C3E643 /* MapConstructor.cpp */; }; + 10D5925A1889C3DF00C05A0D /* MapData.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A78507D417CBC6FD0011F6E7 /* MapData.cpp */; }; + 10D5925B1889C3DF00C05A0D /* MapPrototype.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A700873B17CBE8D300C3E643 /* MapPrototype.cpp */; }; + 10D5925C1889C3DF00C05A0D /* MarkedAllocator.cpp in Sources */ = {isa = PBXBuildFile; fileRef = C2B916C414DA040C00CBAC86 /* MarkedAllocator.cpp */; }; + 10D5925D1889C3DF00C05A0D /* MarkedBlock.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 142D6F0613539A2800B02E86 /* MarkedBlock.cpp */; }; + 10D5925E1889C3DF00C05A0D /* MarkedSpace.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 14D2F3D8139F4BE200491031 /* MarkedSpace.cpp */; }; + 10D5925F1889C3DF00C05A0D /* MarkStack.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 142D6F0E13539A4100B02E86 /* MarkStack.cpp */; }; + 10D592601889C3DF00C05A0D /* MathObject.cpp in Sources */ = {isa = PBXBuildFile; fileRef = F692A86A0255597D01FF60F7 /* MathObject.cpp */; }; + 10D592611889C3DF00C05A0D /* MemoryStatistics.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 90213E3B123A40C200D422F3 /* MemoryStatistics.cpp */; }; + 10D592621889C3DF00C05A0D /* MethodOfGettingAValueProfile.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 0FB5467C14F5CFD3002C2989 /* MethodOfGettingAValueProfile.cpp */; }; + 10D592631889C3DF00C05A0D /* NameConstructor.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 86EBF2F91560F036008E9222 /* NameConstructor.cpp */; }; + 10D592641889C3DF00C05A0D /* NameInstance.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 86EBF2FB1560F036008E9222 /* NameInstance.cpp */; }; + 10D592651889C3DF00C05A0D /* NamePrototype.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 86EBF2FD1560F036008E9222 /* NamePrototype.cpp */; }; + 10D592661889C3DF00C05A0D /* ScriptObject.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A54CF2F7184EAEDA00237F19 /* ScriptObject.cpp */; }; + 10D592671889C3DF00C05A0D /* NativeErrorConstructor.cpp in Sources */ = {isa = PBXBuildFile; fileRef = BC02E9080E1839DB000F9297 /* NativeErrorConstructor.cpp */; }; + 10D592681889C3DF00C05A0D /* NativeErrorPrototype.cpp in Sources */ = {isa = PBXBuildFile; fileRef = BC02E90A0E1839DB000F9297 /* NativeErrorPrototype.cpp */; }; + 10D592691889C3DF00C05A0D /* InjectedScriptManager.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A513E5C8185F9624007E95AD /* InjectedScriptManager.cpp */; }; + 10D5926A1889C3DF00C05A0D /* Nodes.cpp in Sources */ = {isa = PBXBuildFile; fileRef = F692A86D0255597D01FF60F7 /* Nodes.cpp */; }; + 10D5926B1889C3DF00C05A0D /* NodesCodegen.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 655EB29A10CE2581001A990E /* NodesCodegen.cpp */; }; + 10D5926C1889C3DF00C05A0D /* NumberConstructor.cpp in Sources */ = {isa = PBXBuildFile; fileRef = BC2680C20E16D4E900A06E92 /* NumberConstructor.cpp */; }; + 10D5926D1889C3DF00C05A0D /* NumberObject.cpp in Sources */ = {isa = PBXBuildFile; fileRef = F692A8700255597D01FF60F7 /* NumberObject.cpp */; }; + 10D5926E1889C3DF00C05A0D /* NumberPrototype.cpp in Sources */ = {isa = PBXBuildFile; fileRef = BC2680C40E16D4E900A06E92 /* NumberPrototype.cpp */; }; + 10D5926F1889C3DF00C05A0D /* ObjCCallbackFunction.mm in Sources */ = {isa = PBXBuildFile; fileRef = 86F3EEBA168CCF750077B92A /* ObjCCallbackFunction.mm */; }; + 10D592701889C3DF00C05A0D /* ObjectConstructor.cpp in Sources */ = {isa = PBXBuildFile; fileRef = BC2680C60E16D4E900A06E92 /* ObjectConstructor.cpp */; }; + 10D592711889C3DF00C05A0D /* ObjectPrototype.cpp in Sources */ = {isa = PBXBuildFile; fileRef = BC2680C80E16D4E900A06E92 /* ObjectPrototype.cpp */; }; + 10D592721889C3DF00C05A0D /* OpaqueJSString.cpp in Sources */ = {isa = PBXBuildFile; fileRef = E124A8F60E555775003091F1 /* OpaqueJSString.cpp */; }; + 10D592731889C3DF00C05A0D /* Opcode.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 969A07940ED1D3AE00F1F681 /* Opcode.cpp */; }; + 10D592741889C3DF00C05A0D /* Operations.cpp in Sources */ = {isa = PBXBuildFile; fileRef = F692A8770255597D01FF60F7 /* Operations.cpp */; }; + 10D592751889C3DF00C05A0D /* Options.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 0FE228EA1436AB2300196C48 /* Options.cpp */; }; + 10D592761889C3DF00C05A0D /* DFGSSALoweringPhase.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 0FC20CB718556A3500C9E954 /* DFGSSALoweringPhase.cpp */; }; + 10D592771889C3DF00C05A0D /* Parser.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 93F0B3A909BB4DC00068FCE3 /* Parser.cpp */; }; + 10D592781889C3DF00C05A0D /* ParserArena.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 93052C320FB792190048FDC3 /* ParserArena.cpp */; }; + 10D592791889C3DF00C05A0D /* PolymorphicPutByIdList.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 0F9FC8BF14E1B5FB00D52AE0 /* PolymorphicPutByIdList.cpp */; }; + 10D5927A1889C3DF00C05A0D /* PreciseJumpTargets.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 0F98205D16BFE37F00240D02 /* PreciseJumpTargets.cpp */; }; + 10D5927B1889C3DF00C05A0D /* Profile.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 95742F630DD11F5A000917FB /* Profile.cpp */; }; + 10D5927C1889C3DF00C05A0D /* ProfiledCodeBlockJettisoningWatchpoint.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 0FC97F31182020D7002C9B26 /* ProfiledCodeBlockJettisoningWatchpoint.cpp */; }; + 10D5927D1889C3DF00C05A0D /* ProfileGenerator.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 95CD45740E1C4FDD0085358E /* ProfileGenerator.cpp */; }; + 10D5927E1889C3DF00C05A0D /* ProfileNode.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 95AB83540DA43B4400BC83F3 /* ProfileNode.cpp */; }; + 10D5927F1889C3DF00C05A0D /* ProfilerBytecode.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 0FF72992166AD347000F5BA3 /* ProfilerBytecode.cpp */; }; + 10D592801889C3DF00C05A0D /* ProfilerBytecodes.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 0FF72994166AD347000F5BA3 /* ProfilerBytecodes.cpp */; }; + 10D592811889C3DF00C05A0D /* ProfilerBytecodeSequence.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 0F13912416771C30009CCB07 /* ProfilerBytecodeSequence.cpp */; }; + 10D592821889C3DF00C05A0D /* ProfilerCompilation.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 0FF72996166AD347000F5BA3 /* ProfilerCompilation.cpp */; }; + 10D592831889C3DF00C05A0D /* ProfilerCompilationKind.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 0FF72998166AD347000F5BA3 /* ProfilerCompilationKind.cpp */; }; + 10D592841889C3DF00C05A0D /* ProfilerCompiledBytecode.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 0FF7299A166AD347000F5BA3 /* ProfilerCompiledBytecode.cpp */; }; + 10D592851889C3DF00C05A0D /* ProfilerDatabase.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 0FF7299C166AD347000F5BA3 /* ProfilerDatabase.cpp */; }; + 10D592861889C3DF00C05A0D /* ProfilerOrigin.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 0FF7299F166AD347000F5BA3 /* ProfilerOrigin.cpp */; }; + 10D592871889C3DF00C05A0D /* ProfilerOriginStack.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 0FF729A1166AD347000F5BA3 /* ProfilerOriginStack.cpp */; }; + 10D592881889C3DF00C05A0D /* BytecodeBasicBlock.cpp in Sources */ = {isa = PBXBuildFile; fileRef = C2FCAE0C17A9C24E0034C735 /* BytecodeBasicBlock.cpp */; }; + 10D592891889C3DF00C05A0D /* DFGResurrectionForValidationPhase.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 0F666ECA1836B37E00D017F1 /* DFGResurrectionForValidationPhase.cpp */; }; + 10D5928A1889C3DF00C05A0D /* ProfilerOSRExit.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 0FB105871675482E00F8AB6E /* ProfilerOSRExit.cpp */; }; + 10D5928B1889C3DF00C05A0D /* ProfilerOSRExitSite.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 0FB105891675482E00F8AB6E /* ProfilerOSRExitSite.cpp */; }; + 10D5928C1889C3DF00C05A0D /* ProfilerProfiledBytecodes.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 0F13912616771C30009CCB07 /* ProfilerProfiledBytecodes.cpp */; }; + 10D5928D1889C3DF00C05A0D /* PropertyDescriptor.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A7FB60A3103F7DC20017A286 /* PropertyDescriptor.cpp */; }; + 10D5928E1889C3DF00C05A0D /* PropertyNameArray.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 65400C0F0A69BAF200509887 /* PropertyNameArray.cpp */; }; + 10D5928F1889C3DF00C05A0D /* PropertySlot.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 65621E6B089E859700760F35 /* PropertySlot.cpp */; }; + 10D592901889C3DF00C05A0D /* PropertyTable.cpp in Sources */ = {isa = PBXBuildFile; fileRef = AD1CF06816DCAB2D00B97123 /* PropertyTable.cpp */; }; + 10D592911889C3DF00C05A0D /* PrototypeMap.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 14D844A216AA2C7000A65AF0 /* PrototypeMap.cpp */; }; + 10D592921889C3DF00C05A0D /* PutByIdStatus.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 0F93329914CA7DC10085F3C6 /* PutByIdStatus.cpp */; }; + 10D592931889C3DF00C05A0D /* ReduceWhitespace.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 0FF60ABF16740F8100029779 /* ReduceWhitespace.cpp */; }; + 10D592941889C3DF00C05A0D /* InspectorAgent.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A5CEEE12187F3BAD00E55C99 /* InspectorAgent.cpp */; }; + 10D592951889C3DF00C05A0D /* RegExp.cpp in Sources */ = {isa = PBXBuildFile; fileRef = F692A87D0255597D01FF60F7 /* RegExp.cpp */; }; + 10D592961889C3DF00C05A0D /* RegExpCache.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A1712B3A11C7B212007A5315 /* RegExpCache.cpp */; }; + 10D592971889C3DF00C05A0D /* RegExpCachedResult.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 86F75EFB151C062F007C9BA3 /* RegExpCachedResult.cpp */; }; + 10D592981889C3DF00C05A0D /* RegExpConstructor.cpp in Sources */ = {isa = PBXBuildFile; fileRef = BCD202BD0E1706A7002C7E82 /* RegExpConstructor.cpp */; }; + 10D592991889C3DF00C05A0D /* RegExpMatchesArray.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 86F75EFD151C062F007C9BA3 /* RegExpMatchesArray.cpp */; }; + 10D5929A1889C3DF00C05A0D /* RegExpObject.cpp in Sources */ = {isa = PBXBuildFile; fileRef = F692A87B0255597D01FF60F7 /* RegExpObject.cpp */; }; + 10D5929B1889C3DF00C05A0D /* RegExpPrototype.cpp in Sources */ = {isa = PBXBuildFile; fileRef = BCD202BF0E1706A7002C7E82 /* RegExpPrototype.cpp */; }; + 10D5929C1889C3DF00C05A0D /* RegisterSet.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 0FC3141418146D7000033232 /* RegisterSet.cpp */; }; + 10D5929D1889C3DF00C05A0D /* Repatch.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 0F24E54917EE274900ABB217 /* Repatch.cpp */; }; + 10D5929E1889C3DF00C05A0D /* SamplingCounter.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 0F7700911402FF280078EB39 /* SamplingCounter.cpp */; }; + 10D5929F1889C3DF00C05A0D /* SamplingTool.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1429D8830ED21C3D00B89619 /* SamplingTool.cpp */; }; + 10D592A01889C3DF00C05A0D /* SetConstructor.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A7299DA317D12858005F5FF9 /* SetConstructor.cpp */; }; + 10D592A11889C3DF00C05A0D /* SetPrototype.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A7299D9F17D12848005F5FF9 /* SetPrototype.cpp */; }; + 10D592A21889C3DF00C05A0D /* SimpleTypedArrayController.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 0F2B66D617B6B5AB00A7AE3F /* SimpleTypedArrayController.cpp */; }; + 10D592A31889C3DF00C05A0D /* SetIteratorPrototype.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A790DD67182F499700588807 /* SetIteratorPrototype.cpp */; }; + 10D592A41889C3DF00C05A0D /* SlotVisitor.cpp in Sources */ = {isa = PBXBuildFile; fileRef = C225494215F7DBAA0065E898 /* SlotVisitor.cpp */; }; + 10D592A51889C3DF00C05A0D /* SmallStrings.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 93303FE80E6A72B500786E6A /* SmallStrings.cpp */; }; + 10D592A61889C3DF00C05A0D /* SourceCode.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 0F8F2B9D17306C8B007DBDA5 /* SourceCode.cpp */; }; + 10D592A71889C3DF00C05A0D /* SourceProvider.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 0F493AF816D0CAD10084508B /* SourceProvider.cpp */; }; + 10D592A81889C3DF00C05A0D /* SourceProviderCache.cpp in Sources */ = {isa = PBXBuildFile; fileRef = E49DC15512EF277200184A1F /* SourceProviderCache.cpp */; }; + 10D592A91889C3DF00C05A0D /* SparseArrayValueMap.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 0F0CD4C315F6B6B50032F1C0 /* SparseArrayValueMap.cpp */; }; + 10D592AA1889C3DF00C05A0D /* SpecialPointer.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 0F5541AF1613C1FB00CE3E25 /* SpecialPointer.cpp */; }; + 10D592AB1889C3DF00C05A0D /* SpeculatedType.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 0FD82E84141F3FDA00179C94 /* SpeculatedType.cpp */; }; + 10D592AC1889C3DF00C05A0D /* StackVisitor.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A7C1EAEC17987AB600299DB2 /* StackVisitor.cpp */; }; + 10D592AD1889C3DF00C05A0D /* StrictEvalActivation.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A730B6111250068F009D25B1 /* StrictEvalActivation.cpp */; }; + 10D592AE1889C3DF00C05A0D /* StringConstructor.cpp in Sources */ = {isa = PBXBuildFile; fileRef = BC18C3C00E16EE3300B34460 /* StringConstructor.cpp */; }; + 10D592AF1889C3DF00C05A0D /* StringObject.cpp in Sources */ = {isa = PBXBuildFile; fileRef = BC18C3C20E16EE3300B34460 /* StringObject.cpp */; }; + 10D592B01889C3DF00C05A0D /* StringPrototype.cpp in Sources */ = {isa = PBXBuildFile; fileRef = BC18C3C50E16EE3300B34460 /* StringPrototype.cpp */; }; + 10D592B11889C3DF00C05A0D /* StringRecursionChecker.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 93345A8712D838C400302BE3 /* StringRecursionChecker.cpp */; }; + 10D592B21889C3DF00C05A0D /* Structure.cpp in Sources */ = {isa = PBXBuildFile; fileRef = BCDE3AB00E6C82CF001453A7 /* Structure.cpp */; }; + 10D592B31889C3DF00C05A0D /* StructureChain.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 7E4EE70E0EBB7A5B005934AA /* StructureChain.cpp */; }; + 10D592B41889C3DF00C05A0D /* StructureRareData.cpp in Sources */ = {isa = PBXBuildFile; fileRef = C2F0F2D016BAEEE900187C19 /* StructureRareData.cpp */; }; + 10D592B51889C3DF00C05A0D /* StructureStubClearingWatchpoint.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 0F766D3615AE4A1A008F363E /* StructureStubClearingWatchpoint.cpp */; }; + 10D592B61889C3DF00C05A0D /* StructureStubInfo.cpp in Sources */ = {isa = PBXBuildFile; fileRef = BCCF0D0B0EF0B8A500413C8F /* StructureStubInfo.cpp */; }; + 10D592B71889C3DF00C05A0D /* MapIteratorConstructor.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A74DEF8B182D991400522C22 /* MapIteratorConstructor.cpp */; }; + 10D592B81889C3DF00C05A0D /* SuperRegion.cpp in Sources */ = {isa = PBXBuildFile; fileRef = C2DF442D1707AC0100A5CA96 /* SuperRegion.cpp */; }; + 10D592B91889C3DF00C05A0D /* SymbolTable.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 0F919D2715856770004A4E7D /* SymbolTable.cpp */; }; + 10D592BA1889C3DF00C05A0D /* TempRegisterSet.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 0FC314111814559100033232 /* TempRegisterSet.cpp */; }; + 10D592BB1889C3DF00C05A0D /* TestRunnerUtils.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 0FA2C17917D7CF84009D015F /* TestRunnerUtils.cpp */; }; + 10D592BC1889C3DF00C05A0D /* ThunkGenerators.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A7386552118697B400540279 /* ThunkGenerators.cpp */; }; + 10D592BD1889C3DF00C05A0D /* TypedArrayController.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 0F2B66D917B6B5AB00A7AE3F /* TypedArrayController.cpp */; }; + 10D592BE1889C3DF00C05A0D /* TypedArrayType.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 0F2B66DC17B6B5AB00A7AE3F /* TypedArrayType.cpp */; }; + 10D592BF1889C3DF00C05A0D /* udis86.c in Sources */ = {isa = PBXBuildFile; fileRef = 0FF4273E158EBD94004CB9FF /* udis86.c */; }; + 10D592C01889C3DF00C05A0D /* udis86_decode.c in Sources */ = {isa = PBXBuildFile; fileRef = 0FF42734158EBD94004CB9FF /* udis86_decode.c */; }; + 10D592C11889C3DF00C05A0D /* SetIteratorConstructor.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A790DD65182F499700588807 /* SetIteratorConstructor.cpp */; }; + 10D592C21889C3DF00C05A0D /* udis86_input.c in Sources */ = {isa = PBXBuildFile; fileRef = 0FF42737158EBD94004CB9FF /* udis86_input.c */; }; + 10D592C31889C3DF00C05A0D /* udis86_itab_holder.c in Sources */ = {isa = PBXBuildFile; fileRef = 0FF4274C158EBFE1004CB9FF /* udis86_itab_holder.c */; }; + 10D592C41889C3DF00C05A0D /* udis86_syn-att.c in Sources */ = {isa = PBXBuildFile; fileRef = 0FF42739158EBD94004CB9FF /* udis86_syn-att.c */; }; + 10D592C51889C3DF00C05A0D /* udis86_syn-intel.c in Sources */ = {isa = PBXBuildFile; fileRef = 0FF4273A158EBD94004CB9FF /* udis86_syn-intel.c */; }; + 10D592C61889C3DF00C05A0D /* udis86_syn.c in Sources */ = {isa = PBXBuildFile; fileRef = 0FF4273B158EBD94004CB9FF /* udis86_syn.c */; }; + 10D592C71889C3DF00C05A0D /* UDis86Disassembler.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 0FF42730158EBD44004CB9FF /* UDis86Disassembler.cpp */; }; + 10D592C81889C3DF00C05A0D /* UnlinkedCodeBlock.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A79E781E15EECBA80047C855 /* UnlinkedCodeBlock.cpp */; }; + 10D592C91889C3DF00C05A0D /* ValueRecovery.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 0F24E55717F74EDB00ABB217 /* ValueRecovery.cpp */; }; + 10D592CA1889C3DF00C05A0D /* VM.cpp in Sources */ = {isa = PBXBuildFile; fileRef = E18E3A570DF9278C00D90B34 /* VM.cpp */; }; + 10D592CB1889C3DF00C05A0D /* VMInspector.cpp in Sources */ = {isa = PBXBuildFile; fileRef = FE4A331D15BD2E07006F54F3 /* VMInspector.cpp */; }; + 10D592CC1889C3DF00C05A0D /* Watchdog.cpp in Sources */ = {isa = PBXBuildFile; fileRef = FED94F2B171E3E2300BE77A4 /* Watchdog.cpp */; }; + 10D592CD1889C3DF00C05A0D /* WatchdogMac.cpp in Sources */ = {isa = PBXBuildFile; fileRef = FED94F2D171E3E2300BE77A4 /* WatchdogMac.cpp */; }; + 10D592CE1889C3DF00C05A0D /* DFGAvailability.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 0F666EC21835672B00D017F1 /* DFGAvailability.cpp */; }; + 10D592CF1889C3DF00C05A0D /* Watchpoint.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 0F919D2215853CDE004A4E7D /* Watchpoint.cpp */; }; + 10D592D01889C3DF00C05A0D /* Weak.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1ACF7376171CA6FB00C9BB1E /* Weak.cpp */; }; + 10D592D11889C3DF00C05A0D /* WeakBlock.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 14E84F9914EE1ACC00D6D5D4 /* WeakBlock.cpp */; }; + 10D592D21889C3DF00C05A0D /* WeakHandleOwner.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 14F7256314EE265E00B1652B /* WeakHandleOwner.cpp */; }; + 10D592D31889C3DF00C05A0D /* WeakMapConstructor.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A7CA3ADD17DA41AE006538AF /* WeakMapConstructor.cpp */; }; + 10D592D41889C3DF00C05A0D /* JSInjectedScriptHost.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A513E5BA185BFACC007E95AD /* JSInjectedScriptHost.cpp */; }; + 10D592D51889C3DF00C05A0D /* WeakMapData.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A7CA3AE917DA5168006538AF /* WeakMapData.cpp */; }; + 10D592D61889C3DF00C05A0D /* InjectedScriptModule.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A5840E1E187B7B8600843B10 /* InjectedScriptModule.cpp */; }; + 10D592D71889C3DF00C05A0D /* WeakMapPrototype.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A7CA3ADF17DA41AE006538AF /* WeakMapPrototype.cpp */; }; + 10D592D81889C3DF00C05A0D /* WeakSet.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 14E84F9B14EE1ACC00D6D5D4 /* WeakSet.cpp */; }; + 10D592D91889C3DF00C05A0D /* WriteBarrierSupport.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 0FC8150814043BCA00CFA603 /* WriteBarrierSupport.cpp */; }; + 10D592DA1889C3DF00C05A0D /* RemoteInspector.mm in Sources */ = {isa = PBXBuildFile; fileRef = A5BA15E2182340B300A82E69 /* RemoteInspector.mm */; }; + 10D592DB1889C3DF00C05A0D /* RemoteInspectorDebuggableConnection.mm in Sources */ = {isa = PBXBuildFile; fileRef = A5BA15E5182340B300A82E69 /* RemoteInspectorDebuggableConnection.mm */; }; + 10D592DC1889C3DF00C05A0D /* RemoteInspectorXPCConnection.mm in Sources */ = {isa = PBXBuildFile; fileRef = A5BA15E7182340B300A82E69 /* RemoteInspectorXPCConnection.mm */; }; + 10D592DD1889C3DF00C05A0D /* X86Disassembler.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A7E5AB361799E4B200D2833D /* X86Disassembler.cpp */; }; + 10D592DE1889C3DF00C05A0D /* YarrCanonicalizeUCS2.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 863C6D981521111200585E4E /* YarrCanonicalizeUCS2.cpp */; }; + 10D592DF1889C3DF00C05A0D /* YarrInterpreter.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 86704B7D12DBA33700A9FE7B /* YarrInterpreter.cpp */; }; + 10D592E01889C3DF00C05A0D /* YarrJIT.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 86704B7F12DBA33700A9FE7B /* YarrJIT.cpp */; }; + 10D592E11889C3DF00C05A0D /* YarrPattern.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 86704B8212DBA33700A9FE7B /* YarrPattern.cpp */; }; + 10D592E21889C3DF00C05A0D /* InspectorAgentRegistry.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A593CF84184038CA00BFCE27 /* InspectorAgentRegistry.cpp */; }; + 10D592E31889C3DF00C05A0D /* YarrSyntaxChecker.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 86704B4012DB8A8100A9FE7B /* YarrSyntaxChecker.cpp */; }; + 10D592E51889C3DF00C05A0D /* CoreFoundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 6560A4CF04B3B3E7008AE952 /* CoreFoundation.framework */; }; + 10D592E61889C3DF00C05A0D /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 51F0EB6105C86C6B00E6DF1B /* Foundation.framework */; }; + 10D592E71889C3DF00C05A0D /* libicucore.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = 9322A00306C341D3009067BB /* libicucore.dylib */; }; + 10D592E81889C3DF00C05A0D /* libobjc.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = 51F0EC0705C86C9A00E6DF1B /* libobjc.dylib */; }; + 10D592E91889C3DF00C05A0D /* libWTF.a in Frameworks */ = {isa = PBXBuildFile; fileRef = A8A4748D151A8306004123FF /* libWTF.a */; }; + 10D592EA1889C3DF00C05A0D /* libz.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = 371D842C17C98B6E00ECF994 /* libz.dylib */; }; 140566C4107EC255005DBC8D /* JSAPIValueWrapper.cpp in Sources */ = {isa = PBXBuildFile; fileRef = BC0894D50FAFBA2D00001865 /* JSAPIValueWrapper.cpp */; }; 140566D6107EC271005DBC8D /* JSFunction.cpp in Sources */ = {isa = PBXBuildFile; fileRef = F692A85E0255597D01FF60F7 /* JSFunction.cpp */; }; 140B7D1D0DC69AF7009C42B8 /* JSActivation.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 14DA818F0D99FD2000B0A4FB /* JSActivation.cpp */; }; @@ -1351,6 +2601,27 @@ remoteGlobalIDString = 0FF922C314F46B130041A24E; remoteInfo = JSCLLIntOffsetsExtractor; }; + 10D58E031889C1A000C05A0D /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = 0867D690FE84028FC02AAC07 /* Project object */; + proxyType = 1; + remoteGlobalIDString = 0F4680A914BA7FD900BFE272; + remoteInfo = "LLInt Offsets"; + }; + 10D593011889C59100C05A0D /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = 0867D690FE84028FC02AAC07 /* Project object */; + proxyType = 1; + remoteGlobalIDString = 10D58E011889C1A000C05A0D; + remoteInfo = "JSCLLIntOffsetsExtractor iOS"; + }; + 10D593031889C5DE00C05A0D /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = 0867D690FE84028FC02AAC07 /* Project object */; + proxyType = 1; + remoteGlobalIDString = 10D592F61889C55E00C05A0D; + remoteInfo = "Derived Sources iOS"; + }; 5D69E911152BE5470028D720 /* PBXContainerItemProxy */ = { isa = PBXContainerItemProxy; containerPortal = 0867D690FE84028FC02AAC07 /* Project object */; @@ -1925,6 +3196,12 @@ 0FFFC95214EF909500C72532 /* DFGPredictionPropagationPhase.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = DFGPredictionPropagationPhase.h; path = dfg/DFGPredictionPropagationPhase.h; sourceTree = ""; }; 0FFFC95314EF909500C72532 /* DFGVirtualRegisterAllocationPhase.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = DFGVirtualRegisterAllocationPhase.cpp; path = dfg/DFGVirtualRegisterAllocationPhase.cpp; sourceTree = ""; }; 0FFFC95414EF909500C72532 /* DFGVirtualRegisterAllocationPhase.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = DFGVirtualRegisterAllocationPhase.h; path = dfg/DFGVirtualRegisterAllocationPhase.h; sourceTree = ""; }; + 10D58E0C1889C1A000C05A0D /* libJSCLLIntOffsetsExtractor.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = libJSCLLIntOffsetsExtractor.a; sourceTree = BUILT_PRODUCTS_DIR; }; + 10D592F41889C3DF00C05A0D /* libJavaScriptCore.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = libJavaScriptCore.a; sourceTree = BUILT_PRODUCTS_DIR; }; + 10EAA6FF1889E6B300DEB161 /* JavaScriptCore-iOS-Static.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; name = "JavaScriptCore-iOS-Static.xcconfig"; path = "../../JavaScriptCore-iOS-Static.xcconfig"; sourceTree = ""; }; + 10EAA7001889E6C600DEB161 /* ToolExecutable-iOS-Static.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; name = "ToolExecutable-iOS-Static.xcconfig"; path = "../../ToolExecutable-iOS-Static.xcconfig"; sourceTree = ""; }; + 10EB2F3C1889B56F00696C01 /* XCTest.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = XCTest.framework; path = Library/Frameworks/XCTest.framework; sourceTree = DEVELOPER_DIR; }; + 10EB2F3F1889B56F00696C01 /* UIKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = UIKit.framework; path = Library/Frameworks/UIKit.framework; sourceTree = DEVELOPER_DIR; }; 140D17D60E8AD4A9000CD17D /* JSBasePrivate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSBasePrivate.h; sourceTree = ""; }; 141211020A48780900480255 /* minidom.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = minidom.c; path = tests/minidom.c; sourceTree = ""; }; 1412110D0A48788700480255 /* minidom.js */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.javascript; name = minidom.js; path = tests/minidom.js; sourceTree = ""; }; @@ -2755,6 +4032,26 @@ ); runOnlyForDeploymentPostprocessing = 0; }; + 10D58E061889C1A000C05A0D /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + runOnlyForDeploymentPostprocessing = 0; + }; + 10D592E41889C3DF00C05A0D /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + 10D592E51889C3DF00C05A0D /* CoreFoundation.framework in Frameworks */, + 10D592E61889C3DF00C05A0D /* Foundation.framework in Frameworks */, + 10D592E71889C3DF00C05A0D /* libicucore.dylib in Frameworks */, + 10D592E81889C3DF00C05A0D /* libobjc.dylib in Frameworks */, + 10D592E91889C3DF00C05A0D /* libWTF.a in Frameworks */, + 10D592EA1889C3DF00C05A0D /* libz.dylib in Frameworks */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; 1412111E0A48793C00480255 /* Frameworks */ = { isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; @@ -2817,6 +4114,8 @@ 141211200A48793C00480255 /* minidom */, 14BD59BF0A3E8F9000BAF59C /* testapi */, 6511230514046A4C002B101D /* testRegExp */, + 10D58E0C1889C1A000C05A0D /* libJSCLLIntOffsetsExtractor.a */, + 10D592F41889C3DF00C05A0D /* libJavaScriptCore.a */, ); name = Products; sourceTree = ""; @@ -2874,6 +4173,8 @@ 51F0EC0705C86C9A00E6DF1B /* libobjc.dylib */, A8A4748D151A8306004123FF /* libWTF.a */, 371D842C17C98B6E00ECF994 /* libz.dylib */, + 10EB2F3C1889B56F00696C01 /* XCTest.framework */, + 10EB2F3F1889B56F00696C01 /* UIKit.framework */, ); name = Frameworks; sourceTree = ""; @@ -3378,6 +4679,8 @@ 1C90513E0BA9E8830081E9D0 /* Configurations */ = { isa = PBXGroup; children = ( + 10EAA7001889E6C600DEB161 /* ToolExecutable-iOS-Static.xcconfig */, + 10EAA6FF1889E6B300DEB161 /* JavaScriptCore-iOS-Static.xcconfig */, 1C9051450BA9E8A70081E9D0 /* Base.xcconfig */, 1C9051440BA9E8A70081E9D0 /* DebugRelease.xcconfig */, 449097EE0F8F81B50076A327 /* FeatureDefines.xcconfig */, @@ -4429,6 +5732,754 @@ ); runOnlyForDeploymentPostprocessing = 0; }; + 10D58E131889C3DF00C05A0D /* Headers */ = { + isa = PBXHeadersBuildPhase; + buildActionMask = 2147483647; + files = ( + 10D58E141889C3DF00C05A0D /* A64DOpcode.h in Headers */, + 10D58E151889C3DF00C05A0D /* AbstractMacroAssembler.h in Headers */, + 10D58E161889C3DF00C05A0D /* AbstractPC.h in Headers */, + 10D58E171889C3DF00C05A0D /* APICallbackFunction.h in Headers */, + 10D58E181889C3DF00C05A0D /* APICast.h in Headers */, + 10D58E191889C3DF00C05A0D /* InspectorJSTypeBuilders.h in Headers */, + 10D58E1A1889C3DF00C05A0D /* APIShims.h in Headers */, + 10D58E1B1889C3DF00C05A0D /* ArgList.h in Headers */, + 10D58E1C1889C3DF00C05A0D /* Arguments.h in Headers */, + 10D58E1D1889C3DF00C05A0D /* ArgumentsIteratorConstructor.h in Headers */, + 10D58E1E1889C3DF00C05A0D /* ArgumentsIteratorPrototype.h in Headers */, + 10D58E1F1889C3DF00C05A0D /* ARMAssembler.h in Headers */, + 10D58E201889C3DF00C05A0D /* ARMv7Assembler.h in Headers */, + 10D58E211889C3DF00C05A0D /* InspectorAgent.h in Headers */, + 10D58E221889C3DF00C05A0D /* ARMv7DOpcode.h in Headers */, + 10D58E231889C3DF00C05A0D /* CopyWriteBarrier.h in Headers */, + 10D58E241889C3DF00C05A0D /* WriteBarrierBuffer.h in Headers */, + 10D58E251889C3DF00C05A0D /* VMEntryScope.h in Headers */, + 10D58E261889C3DF00C05A0D /* CodeGeneratorInspectorStrings.py in Headers */, + 10D58E271889C3DF00C05A0D /* CodeGeneratorInspector.py in Headers */, + 10D58E281889C3DF00C05A0D /* TempRegisterSet.h in Headers */, + 10D58E291889C3DF00C05A0D /* DFGFiltrationResult.h in Headers */, + 10D58E2A1889C3DF00C05A0D /* cssmin.py in Headers */, + 10D58E2B1889C3DF00C05A0D /* BytecodeBasicBlock.h in Headers */, + 10D58E2C1889C3DF00C05A0D /* generate-combined-inspector-json.py in Headers */, + 10D58E2D1889C3DF00C05A0D /* BytecodeLivenessAnalysis.h in Headers */, + 10D58E2E1889C3DF00C05A0D /* ArrayAllocationProfile.h in Headers */, + 10D58E2F1889C3DF00C05A0D /* inline-and-minify-stylesheets-and-scripts.py in Headers */, + 10D58E301889C3DF00C05A0D /* jsmin.py in Headers */, + 10D58E311889C3DF00C05A0D /* InspectorJS.json in Headers */, + 10D58E321889C3DF00C05A0D /* xxd.pl in Headers */, + 10D58E331889C3DF00C05A0D /* Breakpoint.h in Headers */, + 10D58E341889C3DF00C05A0D /* ArrayBuffer.h in Headers */, + 10D58E351889C3DF00C05A0D /* DebuggerPrimitives.h in Headers */, + 10D58E361889C3DF00C05A0D /* ArrayBufferView.h in Headers */, + 10D58E371889C3DF00C05A0D /* ArrayConstructor.h in Headers */, + 10D58E381889C3DF00C05A0D /* ArrayConventions.h in Headers */, + 10D58E391889C3DF00C05A0D /* ArrayIteratorConstructor.h in Headers */, + 10D58E3A1889C3DF00C05A0D /* ArrayIteratorPrototype.h in Headers */, + 10D58E3B1889C3DF00C05A0D /* ArrayProfile.h in Headers */, + 10D58E3C1889C3DF00C05A0D /* ArrayPrototype.h in Headers */, + 10D58E3D1889C3DF00C05A0D /* ArrayPrototype.lut.h in Headers */, + 10D58E3E1889C3DF00C05A0D /* ArrayStorage.h in Headers */, + 10D58E3F1889C3DF00C05A0D /* AssemblerBuffer.h in Headers */, + 10D58E401889C3DF00C05A0D /* AssemblerBufferWithConstantPool.h in Headers */, + 10D58E411889C3DF00C05A0D /* AssemblyHelpers.h in Headers */, + 10D58E421889C3DF00C05A0D /* ASTBuilder.h in Headers */, + 10D58E431889C3DF00C05A0D /* BatchedTransitionOptimizer.h in Headers */, + 10D58E441889C3DF00C05A0D /* BigInteger.h in Headers */, + 10D58E451889C3DF00C05A0D /* BlockAllocator.h in Headers */, + 10D58E461889C3DF00C05A0D /* BooleanObject.h in Headers */, + 10D58E471889C3DF00C05A0D /* RemoteInspectorConstants.h in Headers */, + 10D58E481889C3DF00C05A0D /* Butterfly.h in Headers */, + 10D58E491889C3DF00C05A0D /* ButterflyInlines.h in Headers */, + 10D58E4A1889C3DF00C05A0D /* BytecodeConventions.h in Headers */, + 10D58E4B1889C3DF00C05A0D /* BytecodeGenerator.h in Headers */, + 10D58E4C1889C3DF00C05A0D /* ByValInfo.h in Headers */, + 10D58E4D1889C3DF00C05A0D /* CallData.h in Headers */, + 10D58E4E1889C3DF00C05A0D /* CallFrame.h in Headers */, + 10D58E4F1889C3DF00C05A0D /* CallFrameInlines.h in Headers */, + 10D58E501889C3DF00C05A0D /* CallIdentifier.h in Headers */, + 10D58E511889C3DF00C05A0D /* CallLinkInfo.h in Headers */, + 10D58E521889C3DF00C05A0D /* CallLinkStatus.h in Headers */, + 10D58E531889C3DF00C05A0D /* CallReturnOffsetToBytecodeOffset.h in Headers */, + 10D58E541889C3DF00C05A0D /* CCallHelpers.h in Headers */, + 10D58E551889C3DF00C05A0D /* ClassInfo.h in Headers */, + 10D58E561889C3DF00C05A0D /* ClosureCallStubRoutine.h in Headers */, + 10D58E571889C3DF00C05A0D /* CodeBlock.h in Headers */, + 10D58E581889C3DF00C05A0D /* CodeBlockHash.h in Headers */, + 10D58E591889C3DF00C05A0D /* CodeBlockJettisoningWatchpoint.h in Headers */, + 10D58E5A1889C3DF00C05A0D /* CodeBlockSet.h in Headers */, + 10D58E5B1889C3DF00C05A0D /* CodeBlockWithJITType.h in Headers */, + 10D58E5C1889C3DF00C05A0D /* CodeCache.h in Headers */, + 10D58E5D1889C3DF00C05A0D /* CodeLocation.h in Headers */, + 10D58E5E1889C3DF00C05A0D /* CodeOrigin.h in Headers */, + 10D58E5F1889C3DF00C05A0D /* CodeSpecializationKind.h in Headers */, + 10D58E601889C3DF00C05A0D /* CodeType.h in Headers */, + 10D58E611889C3DF00C05A0D /* CommonIdentifiers.h in Headers */, + 10D58E621889C3DF00C05A0D /* CommonSlowPaths.h in Headers */, + 10D58E631889C3DF00C05A0D /* CommonSlowPathsExceptions.h in Headers */, + 10D58E641889C3DF00C05A0D /* CompactJITCodeMap.h in Headers */, + 10D58E651889C3DF00C05A0D /* CompilationResult.h in Headers */, + 10D58E661889C3DF00C05A0D /* Completion.h in Headers */, + 10D58E671889C3DF00C05A0D /* ConcurrentJITLock.h in Headers */, + 10D58E681889C3DF00C05A0D /* JSInjectedScriptHostPrototype.h in Headers */, + 10D58E691889C3DF00C05A0D /* config.h in Headers */, + 10D58E6A1889C3DF00C05A0D /* ConservativeRoots.h in Headers */, + 10D58E6B1889C3DF00C05A0D /* ConstructData.h in Headers */, + 10D58E6C1889C3DF00C05A0D /* CopiedAllocator.h in Headers */, + 10D58E6D1889C3DF00C05A0D /* CopiedBlock.h in Headers */, + 10D58E6E1889C3DF00C05A0D /* CopiedBlockInlines.h in Headers */, + 10D58E6F1889C3DF00C05A0D /* CopiedSpace.h in Headers */, + 10D58E701889C3DF00C05A0D /* CopiedSpaceInlines.h in Headers */, + 10D58E711889C3DF00C05A0D /* CopyToken.h in Headers */, + 10D58E721889C3DF00C05A0D /* CopyVisitor.h in Headers */, + 10D58E731889C3DF00C05A0D /* CopyVisitorInlines.h in Headers */, + 10D58E741889C3DF00C05A0D /* CopyWorkList.h in Headers */, + 10D58E751889C3DF00C05A0D /* create_hash_table in Headers */, + 10D58E761889C3DF00C05A0D /* DataFormat.h in Headers */, + 10D58E771889C3DF00C05A0D /* DataView.h in Headers */, + 10D58E781889C3DF00C05A0D /* DateConstructor.h in Headers */, + 10D58E791889C3DF00C05A0D /* DateConversion.h in Headers */, + 10D58E7A1889C3DF00C05A0D /* InspectorAgentBase.h in Headers */, + 10D58E7B1889C3DF00C05A0D /* DateInstance.h in Headers */, + 10D58E7C1889C3DF00C05A0D /* DateInstanceCache.h in Headers */, + 10D58E7D1889C3DF00C05A0D /* DatePrototype.h in Headers */, + 10D58E7E1889C3DF00C05A0D /* DatePrototype.lut.h in Headers */, + 10D58E7F1889C3DF00C05A0D /* Debugger.h in Headers */, + 10D58E801889C3DF00C05A0D /* DebuggerActivation.h in Headers */, + 10D58E811889C3DF00C05A0D /* DebuggerCallFrame.h in Headers */, + 10D58E821889C3DF00C05A0D /* DeferGC.h in Headers */, + 10D58E831889C3DF00C05A0D /* BytecodeUseDef.h in Headers */, + 10D58E841889C3DF00C05A0D /* DeferredCompilationCallback.h in Headers */, + 10D58E851889C3DF00C05A0D /* DFGAbstractHeap.h in Headers */, + 10D58E861889C3DF00C05A0D /* DFGAbstractInterpreter.h in Headers */, + 10D58E871889C3DF00C05A0D /* DFGAbstractInterpreterInlines.h in Headers */, + 10D58E881889C3DF00C05A0D /* DFGAbstractValue.h in Headers */, + 10D58E891889C3DF00C05A0D /* DFGAdjacencyList.h in Headers */, + 10D58E8A1889C3DF00C05A0D /* DFGAllocator.h in Headers */, + 10D58E8B1889C3DF00C05A0D /* DFGAnalysis.h in Headers */, + 10D58E8C1889C3DF00C05A0D /* DFGArgumentPosition.h in Headers */, + 10D58E8D1889C3DF00C05A0D /* DFGArgumentsSimplificationPhase.h in Headers */, + 10D58E8E1889C3DF00C05A0D /* DFGArrayifySlowPathGenerator.h in Headers */, + 10D58E8F1889C3DF00C05A0D /* DFGArrayMode.h in Headers */, + 10D58E901889C3DF00C05A0D /* RemoteInspectorDebuggableConnection.h in Headers */, + 10D58E911889C3DF00C05A0D /* DFGAtTailAbstractState.h in Headers */, + 10D58E921889C3DF00C05A0D /* DFGBackwardsPropagationPhase.h in Headers */, + 10D58E931889C3DF00C05A0D /* DFGBasicBlock.h in Headers */, + 10D58E941889C3DF00C05A0D /* DFGBasicBlockInlines.h in Headers */, + 10D58E951889C3DF00C05A0D /* DFGBinarySwitch.h in Headers */, + 10D58E961889C3DF00C05A0D /* DFGBlockInsertionSet.h in Headers */, + 10D58E971889C3DF00C05A0D /* DFGBranchDirection.h in Headers */, + 10D58E981889C3DF00C05A0D /* MacroAssemblerARM64.h in Headers */, + 10D58E991889C3DF00C05A0D /* DFGByteCodeParser.h in Headers */, + 10D58E9A1889C3DF00C05A0D /* InspectorAgentRegistry.h in Headers */, + 10D58E9B1889C3DF00C05A0D /* DFGCallArrayAllocatorSlowPathGenerator.h in Headers */, + 10D58E9C1889C3DF00C05A0D /* DFGCapabilities.h in Headers */, + 10D58E9D1889C3DF00C05A0D /* DFGCFAPhase.h in Headers */, + 10D58E9E1889C3DF00C05A0D /* DFGCFGSimplificationPhase.h in Headers */, + 10D58E9F1889C3DF00C05A0D /* DFGClobberize.h in Headers */, + 10D58EA01889C3DF00C05A0D /* DFGClobberSet.h in Headers */, + 10D58EA11889C3DF00C05A0D /* DFGCommon.h in Headers */, + 10D58EA21889C3DF00C05A0D /* DFGCommonData.h in Headers */, + 10D58EA31889C3DF00C05A0D /* DFGCompilationKey.h in Headers */, + 10D58EA41889C3DF00C05A0D /* DFGCompilationMode.h in Headers */, + 10D58EA51889C3DF00C05A0D /* DFGConstantFoldingPhase.h in Headers */, + 10D58EA61889C3DF00C05A0D /* DFGCPSRethreadingPhase.h in Headers */, + 10D58EA71889C3DF00C05A0D /* DFGCriticalEdgeBreakingPhase.h in Headers */, + 10D58EA81889C3DF00C05A0D /* DFGCSEPhase.h in Headers */, + 10D58EA91889C3DF00C05A0D /* DFGDCEPhase.h in Headers */, + 10D58EAA1889C3DF00C05A0D /* DFGDesiredIdentifiers.h in Headers */, + 10D58EAB1889C3DF00C05A0D /* DFGDesiredStructureChains.h in Headers */, + 10D58EAC1889C3DF00C05A0D /* DFGDesiredTransitions.h in Headers */, + 10D58EAD1889C3DF00C05A0D /* DFGDesiredWatchpoints.h in Headers */, + 10D58EAE1889C3DF00C05A0D /* DFGSSALoweringPhase.h in Headers */, + 10D58EAF1889C3DF00C05A0D /* DFGDesiredWeakReferences.h in Headers */, + 10D58EB01889C3DF00C05A0D /* DFGDesiredWriteBarriers.h in Headers */, + 10D58EB11889C3DF00C05A0D /* DFGDisassembler.h in Headers */, + 10D58EB21889C3DF00C05A0D /* DFGDominators.h in Headers */, + 10D58EB31889C3DF00C05A0D /* DFGDoubleFormatState.h in Headers */, + 10D58EB41889C3DF00C05A0D /* DFGDriver.h in Headers */, + 10D58EB51889C3DF00C05A0D /* DFGEdge.h in Headers */, + 10D58EB61889C3DF00C05A0D /* DFGEdgeDominates.h in Headers */, + 10D58EB71889C3DF00C05A0D /* DFGEdgeUsesStructure.h in Headers */, + 10D58EB81889C3DF00C05A0D /* DFGExitProfile.h in Headers */, + 10D58EB91889C3DF00C05A0D /* DFGFailedFinalizer.h in Headers */, + 10D58EBA1889C3DF00C05A0D /* DFGFinalizer.h in Headers */, + 10D58EBB1889C3DF00C05A0D /* DFGFixupPhase.h in Headers */, + 10D58EBC1889C3DF00C05A0D /* DFGFlushedAt.h in Headers */, + 10D58EBD1889C3DF00C05A0D /* DFGFlushFormat.h in Headers */, + 10D58EBE1889C3DF00C05A0D /* DFGFlushLivenessAnalysisPhase.h in Headers */, + 10D58EBF1889C3DF00C05A0D /* DFGGenerationInfo.h in Headers */, + 10D58EC01889C3DF00C05A0D /* DFGGraph.h in Headers */, + 10D58EC11889C3DF00C05A0D /* DFGInlineCacheWrapper.h in Headers */, + 10D58EC21889C3DF00C05A0D /* DFGInlineCacheWrapperInlines.h in Headers */, + 10D58EC31889C3DF00C05A0D /* DFGInPlaceAbstractState.h in Headers */, + 10D58EC41889C3DF00C05A0D /* DFGInsertionSet.h in Headers */, + 10D58EC51889C3DF00C05A0D /* DFGInvalidationPointInjectionPhase.h in Headers */, + 10D58EC61889C3DF00C05A0D /* DFGJITCode.h in Headers */, + 10D58EC71889C3DF00C05A0D /* DFGJITCompiler.h in Headers */, + 10D58EC81889C3DF00C05A0D /* DFGJITFinalizer.h in Headers */, + 10D58EC91889C3DF00C05A0D /* DFGJumpReplacement.h in Headers */, + 10D58ECA1889C3DF00C05A0D /* DFGLazyJSValue.h in Headers */, + 10D58ECB1889C3DF00C05A0D /* DFGLICMPhase.h in Headers */, + 10D58ECC1889C3DF00C05A0D /* DFGLivenessAnalysisPhase.h in Headers */, + 10D58ECD1889C3DF00C05A0D /* DFGLongLivedState.h in Headers */, + 10D58ECE1889C3DF00C05A0D /* DFGLoopPreHeaderCreationPhase.h in Headers */, + 10D58ECF1889C3DF00C05A0D /* DFGMergeMode.h in Headers */, + 10D58ED01889C3DF00C05A0D /* DFGMinifiedGraph.h in Headers */, + 10D58ED11889C3DF00C05A0D /* DFGMinifiedID.h in Headers */, + 10D58ED21889C3DF00C05A0D /* DFGMinifiedNode.h in Headers */, + 10D58ED31889C3DF00C05A0D /* DFGNaturalLoops.h in Headers */, + 10D58ED41889C3DF00C05A0D /* DFGNode.h in Headers */, + 10D58ED51889C3DF00C05A0D /* DFGNodeAllocator.h in Headers */, + 10D58ED61889C3DF00C05A0D /* DFGNodeFlags.h in Headers */, + 10D58ED71889C3DF00C05A0D /* DFGNodeType.h in Headers */, + 10D58ED81889C3DF00C05A0D /* DFGOperations.h in Headers */, + 10D58ED91889C3DF00C05A0D /* DFGOSRAvailabilityAnalysisPhase.h in Headers */, + 10D58EDA1889C3DF00C05A0D /* DFGOSREntry.h in Headers */, + 10D58EDB1889C3DF00C05A0D /* DFGOSREntrypointCreationPhase.h in Headers */, + 10D58EDC1889C3DF00C05A0D /* DFGOSRExit.h in Headers */, + 10D58EDD1889C3DF00C05A0D /* ConstantMode.h in Headers */, + 10D58EDE1889C3DF00C05A0D /* DFGOSRExitBase.h in Headers */, + 10D58EDF1889C3DF00C05A0D /* RemoteInspectorXPCConnection.h in Headers */, + 10D58EE01889C3DF00C05A0D /* DFGOSRExitCompilationInfo.h in Headers */, + 10D58EE11889C3DF00C05A0D /* DFGOSRExitCompiler.h in Headers */, + 10D58EE21889C3DF00C05A0D /* DFGOSRExitCompilerCommon.h in Headers */, + 10D58EE31889C3DF00C05A0D /* DFGOSRExitJumpPlaceholder.h in Headers */, + 10D58EE41889C3DF00C05A0D /* DFGOSRExitPreparation.h in Headers */, + 10D58EE51889C3DF00C05A0D /* DFGPhase.h in Headers */, + 10D58EE61889C3DF00C05A0D /* DFGPlan.h in Headers */, + 10D58EE71889C3DF00C05A0D /* DFGPredictionInjectionPhase.h in Headers */, + 10D58EE81889C3DF00C05A0D /* DFGPredictionPropagationPhase.h in Headers */, + 10D58EE91889C3DF00C05A0D /* DFGRegisterBank.h in Headers */, + 10D58EEA1889C3DF00C05A0D /* DFGSafeToExecute.h in Headers */, + 10D58EEB1889C3DF00C05A0D /* DFGSaneStringGetByValSlowPathGenerator.h in Headers */, + 10D58EEC1889C3DF00C05A0D /* DFGScoreBoard.h in Headers */, + 10D58EED1889C3DF00C05A0D /* DFGSilentRegisterSavePlan.h in Headers */, + 10D58EEE1889C3DF00C05A0D /* DFGSlowPathGenerator.h in Headers */, + 10D58EEF1889C3DF00C05A0D /* DFGSpeculativeJIT.h in Headers */, + 10D58EF01889C3DF00C05A0D /* DFGSSAConversionPhase.h in Headers */, + 10D58EF11889C3DF00C05A0D /* DFGStackLayoutPhase.h in Headers */, + 10D58EF21889C3DF00C05A0D /* InspectorValues.h in Headers */, + 10D58EF31889C3DF00C05A0D /* DFGStructureAbstractValue.h in Headers */, + 10D58EF41889C3DF00C05A0D /* DFGThunks.h in Headers */, + 10D58EF51889C3DF00C05A0D /* DFGTierUpCheckInjectionPhase.h in Headers */, + 10D58EF61889C3DF00C05A0D /* DFGToFTLDeferredCompilationCallback.h in Headers */, + 10D58EF71889C3DF00C05A0D /* VariableWatchpointSet.h in Headers */, + 10D58EF81889C3DF00C05A0D /* DFGToFTLForOSREntryDeferredCompilationCallback.h in Headers */, + 10D58EF91889C3DF00C05A0D /* DFGTypeCheckHoistingPhase.h in Headers */, + 10D58EFA1889C3DF00C05A0D /* DFGUnificationPhase.h in Headers */, + 10D58EFB1889C3DF00C05A0D /* DFGUseKind.h in Headers */, + 10D58EFC1889C3DF00C05A0D /* DFGValidate.h in Headers */, + 10D58EFD1889C3DF00C05A0D /* DFGValueRecoveryOverride.h in Headers */, + 10D58EFE1889C3DF00C05A0D /* DFGValueSource.h in Headers */, + 10D58EFF1889C3DF00C05A0D /* DFGVariableAccessData.h in Headers */, + 10D58F001889C3DF00C05A0D /* DFGVariableAccessDataDump.h in Headers */, + 10D58F011889C3DF00C05A0D /* DFGVariableEvent.h in Headers */, + 10D58F021889C3DF00C05A0D /* DFGVariableEventStream.h in Headers */, + 10D58F031889C3DF00C05A0D /* InjectedScriptBase.h in Headers */, + 10D58F041889C3DF00C05A0D /* DFGVariadicFunction.h in Headers */, + 10D58F051889C3DF00C05A0D /* InspectorEnvironment.h in Headers */, + 10D58F061889C3DF00C05A0D /* DFGVirtualRegisterAllocationPhase.h in Headers */, + 10D58F071889C3DF00C05A0D /* DFGWatchpointCollectionPhase.h in Headers */, + 10D58F081889C3DF00C05A0D /* DFGWorklist.h in Headers */, + 10D58F091889C3DF00C05A0D /* Disassembler.h in Headers */, + 10D58F0A1889C3DF00C05A0D /* DumpContext.h in Headers */, + 10D58F0B1889C3DF00C05A0D /* Error.h in Headers */, + 10D58F0C1889C3DF00C05A0D /* ErrorConstructor.h in Headers */, + 10D58F0D1889C3DF00C05A0D /* ErrorInstance.h in Headers */, + 10D58F0E1889C3DF00C05A0D /* ErrorPrototype.h in Headers */, + 10D58F0F1889C3DF00C05A0D /* EvalCodeCache.h in Headers */, + 10D58F101889C3DF00C05A0D /* ExceptionHelpers.h in Headers */, + 10D58F111889C3DF00C05A0D /* Executable.h in Headers */, + 10D58F121889C3DF00C05A0D /* ExecutableAllocator.h in Headers */, + 10D58F131889C3DF00C05A0D /* ExecutionCounter.h in Headers */, + 10D58F141889C3DF00C05A0D /* ExitKind.h in Headers */, + 10D58F151889C3DF00C05A0D /* ExpressionRangeInfo.h in Headers */, + 10D58F161889C3DF00C05A0D /* Float32Array.h in Headers */, + 10D58F171889C3DF00C05A0D /* ScriptValue.h in Headers */, + 10D58F181889C3DF00C05A0D /* Float64Array.h in Headers */, + 10D58F191889C3DF00C05A0D /* FPRInfo.h in Headers */, + 10D58F1A1889C3DF00C05A0D /* ArrayBufferNeuteringWatchpoint.h in Headers */, + 10D58F1B1889C3DF00C05A0D /* FTLAbbreviatedTypes.h in Headers */, + 10D58F1C1889C3DF00C05A0D /* FTLAbbreviations.h in Headers */, + 10D58F1D1889C3DF00C05A0D /* FTLAbstractHeap.h in Headers */, + 10D58F1E1889C3DF00C05A0D /* FTLAbstractHeapRepository.h in Headers */, + 10D58F1F1889C3DF00C05A0D /* JSGlobalObjectDebuggable.h in Headers */, + 10D58F201889C3DF00C05A0D /* FTLCapabilities.h in Headers */, + 10D58F211889C3DF00C05A0D /* FTLCommonValues.h in Headers */, + 10D58F221889C3DF00C05A0D /* FTLCompile.h in Headers */, + 10D58F231889C3DF00C05A0D /* FTLExitArgument.h in Headers */, + 10D58F241889C3DF00C05A0D /* FTLExitArgumentForOperand.h in Headers */, + 10D58F251889C3DF00C05A0D /* FTLExitArgumentList.h in Headers */, + 10D58F261889C3DF00C05A0D /* FTLExitThunkGenerator.h in Headers */, + 10D58F271889C3DF00C05A0D /* FTLExitValue.h in Headers */, + 10D58F281889C3DF00C05A0D /* FTLFail.h in Headers */, + 10D58F291889C3DF00C05A0D /* FTLFormattedValue.h in Headers */, + 10D58F2A1889C3DF00C05A0D /* FTLForOSREntryJITCode.h in Headers */, + 10D58F2B1889C3DF00C05A0D /* FTLGeneratedFunction.h in Headers */, + 10D58F2C1889C3DF00C05A0D /* FTLInlineCacheDescriptor.h in Headers */, + 10D58F2D1889C3DF00C05A0D /* FTLInlineCacheSize.h in Headers */, + 10D58F2E1889C3DF00C05A0D /* FTLIntrinsicRepository.h in Headers */, + 10D58F2F1889C3DF00C05A0D /* FTLJITCode.h in Headers */, + 10D58F301889C3DF00C05A0D /* FTLJITFinalizer.h in Headers */, + 10D58F311889C3DF00C05A0D /* FTLLink.h in Headers */, + 10D58F321889C3DF00C05A0D /* FTLLocation.h in Headers */, + 10D58F331889C3DF00C05A0D /* FTLLowerDFGToLLVM.h in Headers */, + 10D58F341889C3DF00C05A0D /* FTLLoweredNodeValue.h in Headers */, + 10D58F351889C3DF00C05A0D /* FTLOSREntry.h in Headers */, + 10D58F361889C3DF00C05A0D /* FTLOSRExit.h in Headers */, + 10D58F371889C3DF00C05A0D /* FTLOSRExitCompilationInfo.h in Headers */, + 10D58F381889C3DF00C05A0D /* FTLOSRExitCompiler.h in Headers */, + 10D58F391889C3DF00C05A0D /* FTLOutput.h in Headers */, + 10D58F3A1889C3DF00C05A0D /* FTLSaveRestore.h in Headers */, + 10D58F3B1889C3DF00C05A0D /* FTLSlowPathCall.h in Headers */, + 10D58F3C1889C3DF00C05A0D /* FTLSlowPathCallKey.h in Headers */, + 10D58F3D1889C3DF00C05A0D /* FTLStackMaps.h in Headers */, + 10D58F3E1889C3DF00C05A0D /* FTLState.h in Headers */, + 10D58F3F1889C3DF00C05A0D /* FTLSwitchCase.h in Headers */, + 10D58F401889C3DF00C05A0D /* FTLThunks.h in Headers */, + 10D58F411889C3DF00C05A0D /* FTLTypedPointer.h in Headers */, + 10D58F421889C3DF00C05A0D /* FTLValueFormat.h in Headers */, + 10D58F431889C3DF00C05A0D /* FTLValueFromBlock.h in Headers */, + 10D58F441889C3DF00C05A0D /* FunctionConstructor.h in Headers */, + 10D58F451889C3DF00C05A0D /* FunctionExecutableDump.h in Headers */, + 10D58F461889C3DF00C05A0D /* FunctionPrototype.h in Headers */, + 10D58F471889C3DF00C05A0D /* GCActivityCallback.h in Headers */, + 10D58F481889C3DF00C05A0D /* GCAssertions.h in Headers */, + 10D58F491889C3DF00C05A0D /* GCAwareJITStubRoutine.h in Headers */, + 10D58F4A1889C3DF00C05A0D /* GCIncomingRefCounted.h in Headers */, + 10D58F4B1889C3DF00C05A0D /* GCIncomingRefCountedInlines.h in Headers */, + 10D58F4C1889C3DF00C05A0D /* GCIncomingRefCountedSet.h in Headers */, + 10D58F4D1889C3DF00C05A0D /* GCIncomingRefCountedSetInlines.h in Headers */, + 10D58F4E1889C3DF00C05A0D /* GCThread.h in Headers */, + 10D58F4F1889C3DF00C05A0D /* GCThreadSharedData.h in Headers */, + 10D58F501889C3DF00C05A0D /* GenericTypedArrayView.h in Headers */, + 10D58F511889C3DF00C05A0D /* GenericTypedArrayViewInlines.h in Headers */, + 10D58F521889C3DF00C05A0D /* GetByIdStatus.h in Headers */, + 10D58F531889C3DF00C05A0D /* GPRInfo.h in Headers */, + 10D58F541889C3DF00C05A0D /* Handle.h in Headers */, + 10D58F551889C3DF00C05A0D /* HandleBlock.h in Headers */, + 10D58F561889C3DF00C05A0D /* HandleBlockInlines.h in Headers */, + 10D58F571889C3DF00C05A0D /* HandlerInfo.h in Headers */, + 10D58F581889C3DF00C05A0D /* HandleSet.h in Headers */, + 10D58F591889C3DF00C05A0D /* HandleStack.h in Headers */, + 10D58F5A1889C3DF00C05A0D /* HandleTypes.h in Headers */, + 10D58F5B1889C3DF00C05A0D /* Heap.h in Headers */, + 10D58F5C1889C3DF00C05A0D /* HeapBlock.h in Headers */, + 10D58F5D1889C3DF00C05A0D /* HeapIterationScope.h in Headers */, + 10D58F5E1889C3DF00C05A0D /* HeapOperation.h in Headers */, + 10D58F5F1889C3DF00C05A0D /* HeapRootVisitor.h in Headers */, + 10D58F601889C3DF00C05A0D /* HeapStatistics.h in Headers */, + 10D58F611889C3DF00C05A0D /* FullBytecodeLiveness.h in Headers */, + 10D58F621889C3DF00C05A0D /* HeapTimer.h in Headers */, + 10D58F631889C3DF00C05A0D /* HostCallReturnValue.h in Headers */, + 10D58F641889C3DF00C05A0D /* Identifier.h in Headers */, + 10D58F651889C3DF00C05A0D /* IncrementalSweeper.h in Headers */, + 10D58F661889C3DF00C05A0D /* IndexingHeader.h in Headers */, + 10D58F671889C3DF00C05A0D /* IndexingHeaderInlines.h in Headers */, + 10D58F681889C3DF00C05A0D /* IndexingType.h in Headers */, + 10D58F691889C3DF00C05A0D /* InitializeLLVM.h in Headers */, + 10D58F6A1889C3DF00C05A0D /* InitializeLLVMPOSIX.h in Headers */, + 10D58F6B1889C3DF00C05A0D /* InitializeThreading.h in Headers */, + 10D58F6C1889C3DF00C05A0D /* InlineCallFrameSet.h in Headers */, + 10D58F6D1889C3DF00C05A0D /* Instruction.h in Headers */, + 10D58F6E1889C3DF00C05A0D /* Int16Array.h in Headers */, + 10D58F6F1889C3DF00C05A0D /* Int32Array.h in Headers */, + 10D58F701889C3DF00C05A0D /* Int8Array.h in Headers */, + 10D58F711889C3DF00C05A0D /* IntendedStructureChain.h in Headers */, + 10D58F721889C3DF00C05A0D /* InternalFunction.h in Headers */, + 10D58F731889C3DF00C05A0D /* Interpreter.h in Headers */, + 10D58F741889C3DF00C05A0D /* Intrinsic.h in Headers */, + 10D58F751889C3DF00C05A0D /* JavaScript.h in Headers */, + 10D58F761889C3DF00C05A0D /* JavaScriptCore.h in Headers */, + 10D58F771889C3DF00C05A0D /* JavaScriptCorePrefix.h in Headers */, + 10D58F781889C3DF00C05A0D /* JIT.h in Headers */, + 10D58F791889C3DF00C05A0D /* JITCode.h in Headers */, + 10D58F7A1889C3DF00C05A0D /* JITCompilationEffort.h in Headers */, + 10D58F7B1889C3DF00C05A0D /* JITDisassembler.h in Headers */, + 10D58F7C1889C3DF00C05A0D /* RemoteInspectorDebuggable.h in Headers */, + 10D58F7D1889C3DF00C05A0D /* JITExceptions.h in Headers */, + 10D58F7E1889C3DF00C05A0D /* DFGStrengthReductionPhase.h in Headers */, + 10D58F7F1889C3DF00C05A0D /* JITInlineCacheGenerator.h in Headers */, + 10D58F801889C3DF00C05A0D /* JITInlines.h in Headers */, + 10D58F811889C3DF00C05A0D /* JITOperations.h in Headers */, + 10D58F821889C3DF00C05A0D /* JSSetIterator.h in Headers */, + 10D58F831889C3DF00C05A0D /* JITOperationWrappers.h in Headers */, + 10D58F841889C3DF00C05A0D /* JITStubRoutine.h in Headers */, + 10D58F851889C3DF00C05A0D /* JITStubRoutineSet.h in Headers */, + 10D58F861889C3DF00C05A0D /* JITStubs.h in Headers */, + 10D58F871889C3DF00C05A0D /* JITStubsARM.h in Headers */, + 10D58F881889C3DF00C05A0D /* JITStubsARMv7.h in Headers */, + 10D58F891889C3DF00C05A0D /* JITStubsX86.h in Headers */, + 10D58F8A1889C3DF00C05A0D /* JITStubsX86_64.h in Headers */, + 10D58F8B1889C3DF00C05A0D /* JITStubsX86Common.h in Headers */, + 10D58F8C1889C3DF00C05A0D /* JITThunks.h in Headers */, + 10D58F8D1889C3DF00C05A0D /* JITToDFGDeferredCompilationCallback.h in Headers */, + 10D58F8E1889C3DF00C05A0D /* JITWriteBarrier.h in Headers */, + 10D58F8F1889C3DF00C05A0D /* JSActivation.h in Headers */, + 10D58F901889C3DF00C05A0D /* JSAPIValueWrapper.h in Headers */, + 10D58F911889C3DF00C05A0D /* JSAPIWrapperObject.h in Headers */, + 10D58F921889C3DF00C05A0D /* JSArgumentsIterator.h in Headers */, + 10D58F931889C3DF00C05A0D /* JSArray.h in Headers */, + 10D58F941889C3DF00C05A0D /* JSArrayBuffer.h in Headers */, + 10D58F951889C3DF00C05A0D /* JSArrayBufferConstructor.h in Headers */, + 10D58F961889C3DF00C05A0D /* JSArrayBufferPrototype.h in Headers */, + 10D58F971889C3DF00C05A0D /* JSArrayBufferView.h in Headers */, + 10D58F981889C3DF00C05A0D /* JSArrayBufferViewInlines.h in Headers */, + 10D58F991889C3DF00C05A0D /* JSArrayIterator.h in Headers */, + 10D58F9A1889C3DF00C05A0D /* JSBase.h in Headers */, + 10D58F9B1889C3DF00C05A0D /* RecursiveAllocationScope.h in Headers */, + 10D58F9C1889C3DF00C05A0D /* JSBasePrivate.h in Headers */, + 10D58F9D1889C3DF00C05A0D /* JSBoundFunction.h in Headers */, + 10D58F9E1889C3DF00C05A0D /* JSCallbackConstructor.h in Headers */, + 10D58F9F1889C3DF00C05A0D /* JSCallbackFunction.h in Headers */, + 10D58FA01889C3DF00C05A0D /* JSCallbackObject.h in Headers */, + 10D58FA11889C3DF00C05A0D /* JSCallbackObjectFunctions.h in Headers */, + 10D58FA21889C3DF00C05A0D /* JSCell.h in Headers */, + 10D58FA31889C3DF00C05A0D /* JSCellInlines.h in Headers */, + 10D58FA41889C3DF00C05A0D /* JSCJSValue.h in Headers */, + 10D58FA51889C3DF00C05A0D /* JSCJSValueInlines.h in Headers */, + 10D58FA61889C3DF00C05A0D /* JSClassRef.h in Headers */, + 10D58FA71889C3DF00C05A0D /* JSContext.h in Headers */, + 10D58FA81889C3DF00C05A0D /* JSContextInternal.h in Headers */, + 10D58FA91889C3DF00C05A0D /* JSContextRef.h in Headers */, + 10D58FAA1889C3DF00C05A0D /* JSContextRefPrivate.h in Headers */, + 10D58FAB1889C3DF00C05A0D /* JSCTestRunnerUtils.h in Headers */, + 10D58FAC1889C3DF00C05A0D /* JSDataView.h in Headers */, + 10D58FAD1889C3DF00C05A0D /* JSDataViewPrototype.h in Headers */, + 10D58FAE1889C3DF00C05A0D /* JSDateMath.h in Headers */, + 10D58FAF1889C3DF00C05A0D /* JSDestructibleObject.h in Headers */, + 10D58FB01889C3DF00C05A0D /* JSExport.h in Headers */, + 10D58FB11889C3DF00C05A0D /* JSExportMacros.h in Headers */, + 10D58FB21889C3DF00C05A0D /* JSFloat32Array.h in Headers */, + 10D58FB31889C3DF00C05A0D /* JSFloat64Array.h in Headers */, + 10D58FB41889C3DF00C05A0D /* JSFunction.h in Headers */, + 10D58FB51889C3DF00C05A0D /* JSFunctionInlines.h in Headers */, + 10D58FB61889C3DF00C05A0D /* JSGenericTypedArrayView.h in Headers */, + 10D58FB71889C3DF00C05A0D /* JSGenericTypedArrayViewConstructor.h in Headers */, + 10D58FB81889C3DF00C05A0D /* JSGenericTypedArrayViewConstructorInlines.h in Headers */, + 10D58FB91889C3DF00C05A0D /* JSGenericTypedArrayViewInlines.h in Headers */, + 10D58FBA1889C3DF00C05A0D /* JSGenericTypedArrayViewPrototype.h in Headers */, + 10D58FBB1889C3DF00C05A0D /* JSGenericTypedArrayViewPrototypeInlines.h in Headers */, + 10D58FBC1889C3DF00C05A0D /* JSGlobalObject.h in Headers */, + 10D58FBD1889C3DF00C05A0D /* JSGlobalObjectFunctions.h in Headers */, + 10D58FBE1889C3DF00C05A0D /* JSInt16Array.h in Headers */, + 10D58FBF1889C3DF00C05A0D /* JSInt32Array.h in Headers */, + 10D58FC01889C3DF00C05A0D /* JSInt8Array.h in Headers */, + 10D58FC11889C3DF00C05A0D /* JSInterfaceJIT.h in Headers */, + 10D58FC21889C3DF00C05A0D /* JSLock.h in Headers */, + 10D58FC31889C3DF00C05A0D /* JSManagedValue.h in Headers */, + 10D58FC41889C3DF00C05A0D /* JSMap.h in Headers */, + 10D58FC51889C3DF00C05A0D /* JSNameScope.h in Headers */, + 10D58FC61889C3DF00C05A0D /* JSObject.h in Headers */, + 10D58FC71889C3DF00C05A0D /* JSObjectRef.h in Headers */, + 10D58FC81889C3DF00C05A0D /* JSObjectRefPrivate.h in Headers */, + 10D58FC91889C3DF00C05A0D /* JSONObject.h in Headers */, + 10D58FCA1889C3DF00C05A0D /* JSONObject.lut.h in Headers */, + 10D58FCB1889C3DF00C05A0D /* JSProfilerPrivate.h in Headers */, + 10D58FCC1889C3DF00C05A0D /* JSPromise.h in Headers */, + 10D58FCD1889C3DF00C05A0D /* JSPromiseConstructor.h in Headers */, + 10D58FCE1889C3DF00C05A0D /* JSPromisePrototype.h in Headers */, + 10D58FCF1889C3DF00C05A0D /* JSMapIterator.h in Headers */, + 10D58FD01889C3DF00C05A0D /* JSProxy.h in Headers */, + 10D58FD11889C3DF00C05A0D /* JSRetainPtr.h in Headers */, + 10D58FD21889C3DF00C05A0D /* JSScope.h in Headers */, + 10D58FD31889C3DF00C05A0D /* JSScriptRefPrivate.h in Headers */, + 10D58FD41889C3DF00C05A0D /* JSSegmentedVariableObject.h in Headers */, + 10D58FD51889C3DF00C05A0D /* JSSet.h in Headers */, + 10D58FD61889C3DF00C05A0D /* DFGArithMode.h in Headers */, + 10D58FD71889C3DF00C05A0D /* JSStack.h in Headers */, + 10D58FD81889C3DF00C05A0D /* JSStackInlines.h in Headers */, + 10D58FD91889C3DF00C05A0D /* JSString.h in Headers */, + 10D58FDA1889C3DF00C05A0D /* JSStringBuilder.h in Headers */, + 10D58FDB1889C3DF00C05A0D /* JSStringJoiner.h in Headers */, + 10D58FDC1889C3DF00C05A0D /* JSStringRef.h in Headers */, + 10D58FDD1889C3DF00C05A0D /* JSStringRefCF.h in Headers */, + 10D58FDE1889C3DF00C05A0D /* JSStringRefPrivate.h in Headers */, + 10D58FDF1889C3DF00C05A0D /* JSSymbolTableObject.h in Headers */, + 10D58FE01889C3DF00C05A0D /* JSType.h in Headers */, + 10D58FE11889C3DF00C05A0D /* JSTypedArrayConstructors.h in Headers */, + 10D58FE21889C3DF00C05A0D /* JSTypedArrayPrototypes.h in Headers */, + 10D58FE31889C3DF00C05A0D /* JSTypedArrays.h in Headers */, + 10D58FE41889C3DF00C05A0D /* JSTypeInfo.h in Headers */, + 10D58FE51889C3DF00C05A0D /* JSUint16Array.h in Headers */, + 10D58FE61889C3DF00C05A0D /* JSUint32Array.h in Headers */, + 10D58FE71889C3DF00C05A0D /* JSUint8Array.h in Headers */, + 10D58FE81889C3DF00C05A0D /* JSUint8ClampedArray.h in Headers */, + 10D58FE91889C3DF00C05A0D /* JSValue.h in Headers */, + 10D58FEA1889C3DF00C05A0D /* JSValueInternal.h in Headers */, + 10D58FEB1889C3DF00C05A0D /* JSValueRef.h in Headers */, + 10D58FEC1889C3DF00C05A0D /* JSVariableObject.h in Headers */, + 10D58FED1889C3DF00C05A0D /* JSVirtualMachine.h in Headers */, + 10D58FEE1889C3DF00C05A0D /* JSVirtualMachineInternal.h in Headers */, + 10D58FEF1889C3DF00C05A0D /* JSWeakMap.h in Headers */, + 10D58FF01889C3DF00C05A0D /* JSWeakObjectMapRefInternal.h in Headers */, + 10D58FF11889C3DF00C05A0D /* JSWeakObjectMapRefPrivate.h in Headers */, + 10D58FF21889C3DF00C05A0D /* JSWithScope.h in Headers */, + 10D58FF31889C3DF00C05A0D /* JSWrapperMap.h in Headers */, + 10D58FF41889C3DF00C05A0D /* JSWrapperObject.h in Headers */, + 10D58FF51889C3DF00C05A0D /* JumpTable.h in Headers */, + 10D58FF61889C3DF00C05A0D /* MapIteratorPrototype.h in Headers */, + 10D58FF71889C3DF00C05A0D /* KeywordLookup.h in Headers */, + 10D58FF81889C3DF00C05A0D /* Label.h in Headers */, + 10D58FF91889C3DF00C05A0D /* LabelScope.h in Headers */, + 10D58FFA1889C3DF00C05A0D /* LazyOperandValueProfile.h in Headers */, + 10D58FFB1889C3DF00C05A0D /* LegacyProfiler.h in Headers */, + 10D58FFC1889C3DF00C05A0D /* Lexer.h in Headers */, + 10D58FFD1889C3DF00C05A0D /* Lexer.lut.h in Headers */, + 10D58FFE1889C3DF00C05A0D /* InjectedScriptManager.h in Headers */, + 10D58FFF1889C3DF00C05A0D /* LineInfo.h in Headers */, + 10D590001889C3DF00C05A0D /* LinkBuffer.h in Headers */, + 10D590011889C3DF00C05A0D /* ListableHandler.h in Headers */, + 10D590021889C3DF00C05A0D /* LiteralParser.h in Headers */, + 10D590031889C3DF00C05A0D /* LLIntCallLinkInfo.h in Headers */, + 10D590041889C3DF00C05A0D /* LLIntCLoop.h in Headers */, + 10D590051889C3DF00C05A0D /* LLIntCommon.h in Headers */, + 10D590061889C3DF00C05A0D /* LLIntData.h in Headers */, + 10D590071889C3DF00C05A0D /* LLIntEntrypoint.h in Headers */, + 10D590081889C3DF00C05A0D /* LLIntExceptions.h in Headers */, + 10D590091889C3DF00C05A0D /* LLIntOfflineAsmConfig.h in Headers */, + 10D5900A1889C3DF00C05A0D /* LLIntOpcode.h in Headers */, + 10D5900B1889C3DF00C05A0D /* JSPromiseDeferred.h in Headers */, + 10D5900C1889C3DF00C05A0D /* LLIntSlowPaths.h in Headers */, + 10D5900D1889C3DF00C05A0D /* LLIntThunks.h in Headers */, + 10D5900E1889C3DF00C05A0D /* LLVMAPI.h in Headers */, + 10D5900F1889C3DF00C05A0D /* LLVMAPIFunctions.h in Headers */, + 10D590101889C3DF00C05A0D /* LLVMDisassembler.h in Headers */, + 10D590111889C3DF00C05A0D /* LLVMHeaders.h in Headers */, + 10D590121889C3DF00C05A0D /* Local.h in Headers */, + 10D590131889C3DF00C05A0D /* LocalScope.h in Headers */, + 10D590141889C3DF00C05A0D /* Lookup.h in Headers */, + 10D590151889C3DF00C05A0D /* LowLevelInterpreter.h in Headers */, + 10D590161889C3DF00C05A0D /* MachineStackMarker.h in Headers */, + 10D590171889C3DF00C05A0D /* MacroAssembler.h in Headers */, + 10D590181889C3DF00C05A0D /* MacroAssemblerARM.h in Headers */, + 10D590191889C3DF00C05A0D /* MacroAssemblerARMv7.h in Headers */, + 10D5901A1889C3DF00C05A0D /* MacroAssemblerCodeRef.h in Headers */, + 10D5901B1889C3DF00C05A0D /* InspectorJSFrontendDispatchers.h in Headers */, + 10D5901C1889C3DF00C05A0D /* MacroAssemblerMIPS.h in Headers */, + 10D5901D1889C3DF00C05A0D /* MacroAssemblerSH4.h in Headers */, + 10D5901E1889C3DF00C05A0D /* MacroAssemblerX86.h in Headers */, + 10D5901F1889C3DF00C05A0D /* MacroAssemblerX86_64.h in Headers */, + 10D590201889C3DF00C05A0D /* MacroAssemblerX86Common.h in Headers */, + 10D590211889C3DF00C05A0D /* MapConstructor.h in Headers */, + 10D590221889C3DF00C05A0D /* MapData.h in Headers */, + 10D590231889C3DF00C05A0D /* MapPrototype.h in Headers */, + 10D590241889C3DF00C05A0D /* MarkedAllocator.h in Headers */, + 10D590251889C3DF00C05A0D /* JSGlobalObjectInspectorController.h in Headers */, + 10D590261889C3DF00C05A0D /* MarkedBlock.h in Headers */, + 10D590271889C3DF00C05A0D /* MarkedBlockSet.h in Headers */, + 10D590281889C3DF00C05A0D /* MarkedSpace.h in Headers */, + 10D590291889C3DF00C05A0D /* MarkStack.h in Headers */, + 10D5902A1889C3DF00C05A0D /* MarkStackInlines.h in Headers */, + 10D5902B1889C3DF00C05A0D /* InspectorFrontendChannel.h in Headers */, + 10D5902C1889C3DF00C05A0D /* MatchResult.h in Headers */, + 10D5902D1889C3DF00C05A0D /* InjectedScriptModule.h in Headers */, + 10D5902E1889C3DF00C05A0D /* MathObject.h in Headers */, + 10D5902F1889C3DF00C05A0D /* MemoryStatistics.h in Headers */, + 10D590301889C3DF00C05A0D /* MethodOfGettingAValueProfile.h in Headers */, + 10D590311889C3DF00C05A0D /* MIPSAssembler.h in Headers */, + 10D590321889C3DF00C05A0D /* NameConstructor.h in Headers */, + 10D590331889C3DF00C05A0D /* SetIteratorPrototype.h in Headers */, + 10D590341889C3DF00C05A0D /* NameInstance.h in Headers */, + 10D590351889C3DF00C05A0D /* NamePrototype.h in Headers */, + 10D590361889C3DF00C05A0D /* NativeErrorConstructor.h in Headers */, + 10D590371889C3DF00C05A0D /* NativeErrorPrototype.h in Headers */, + 10D590381889C3DF00C05A0D /* NodeConstructors.h in Headers */, + 10D590391889C3DF00C05A0D /* NodeInfo.h in Headers */, + 10D5903A1889C3DF00C05A0D /* Nodes.h in Headers */, + 10D5903B1889C3DF00C05A0D /* NumberConstructor.h in Headers */, + 10D5903C1889C3DF00C05A0D /* NumberConstructor.lut.h in Headers */, + 10D5903D1889C3DF00C05A0D /* NumberObject.h in Headers */, + 10D5903E1889C3DF00C05A0D /* NumberPrototype.h in Headers */, + 10D5903F1889C3DF00C05A0D /* NumericStrings.h in Headers */, + 10D590401889C3DF00C05A0D /* ObjCCallbackFunction.h in Headers */, + 10D590411889C3DF00C05A0D /* ObjcRuntimeExtras.h in Headers */, + 10D590421889C3DF00C05A0D /* ObjectAllocationProfile.h in Headers */, + 10D590431889C3DF00C05A0D /* ObjectConstructor.h in Headers */, + 10D590441889C3DF00C05A0D /* ObjectPrototype.h in Headers */, + 10D590451889C3DF00C05A0D /* OpaqueJSString.h in Headers */, + 10D590461889C3DF00C05A0D /* Opcode.h in Headers */, + 10D590471889C3DF00C05A0D /* Operands.h in Headers */, + 10D590481889C3DF00C05A0D /* ARM64Assembler.h in Headers */, + 10D590491889C3DF00C05A0D /* OperandsInlines.h in Headers */, + 10D5904A1889C3DF00C05A0D /* Operations.h in Headers */, + 10D5904B1889C3DF00C05A0D /* Options.h in Headers */, + 10D5904C1889C3DF00C05A0D /* Parser.h in Headers */, + 10D5904D1889C3DF00C05A0D /* ParserArena.h in Headers */, + 10D5904E1889C3DF00C05A0D /* ParserError.h in Headers */, + 10D5904F1889C3DF00C05A0D /* ParserModes.h in Headers */, + 10D590501889C3DF00C05A0D /* ParserTokens.h in Headers */, + 10D590511889C3DF00C05A0D /* PolymorphicAccessStructureList.h in Headers */, + 10D590521889C3DF00C05A0D /* PolymorphicPutByIdList.h in Headers */, + 10D590531889C3DF00C05A0D /* PreciseJumpTargets.h in Headers */, + 10D590541889C3DF00C05A0D /* PrivateName.h in Headers */, + 10D590551889C3DF00C05A0D /* Profile.h in Headers */, + 10D590561889C3DF00C05A0D /* ProfiledCodeBlockJettisoningWatchpoint.h in Headers */, + 10D590571889C3DF00C05A0D /* ProfileGenerator.h in Headers */, + 10D590581889C3DF00C05A0D /* ProfileNode.h in Headers */, + 10D590591889C3DF00C05A0D /* ProfilerBytecode.h in Headers */, + 10D5905A1889C3DF00C05A0D /* BytecodeLivenessAnalysisInlines.h in Headers */, + 10D5905B1889C3DF00C05A0D /* ProfilerBytecodes.h in Headers */, + 10D5905C1889C3DF00C05A0D /* ProfilerBytecodeSequence.h in Headers */, + 10D5905D1889C3DF00C05A0D /* ProfilerCompilation.h in Headers */, + 10D5905E1889C3DF00C05A0D /* ProfilerCompilationKind.h in Headers */, + 10D5905F1889C3DF00C05A0D /* ProfilerCompiledBytecode.h in Headers */, + 10D590601889C3DF00C05A0D /* ProfilerDatabase.h in Headers */, + 10D590611889C3DF00C05A0D /* ProfilerExecutionCounter.h in Headers */, + 10D590621889C3DF00C05A0D /* ProfilerOrigin.h in Headers */, + 10D590631889C3DF00C05A0D /* ProfilerOriginStack.h in Headers */, + 10D590641889C3DF00C05A0D /* ProfilerOSRExit.h in Headers */, + 10D590651889C3DF00C05A0D /* ProfilerOSRExitSite.h in Headers */, + 10D590661889C3DF00C05A0D /* ProfilerProfiledBytecodes.h in Headers */, + 10D590671889C3DF00C05A0D /* PropertyDescriptor.h in Headers */, + 10D590681889C3DF00C05A0D /* PropertyMapHashTable.h in Headers */, + 10D590691889C3DF00C05A0D /* PropertyName.h in Headers */, + 10D5906A1889C3DF00C05A0D /* PropertyNameArray.h in Headers */, + 10D5906B1889C3DF00C05A0D /* PropertyOffset.h in Headers */, + 10D5906C1889C3DF00C05A0D /* PropertySlot.h in Headers */, + 10D5906D1889C3DF00C05A0D /* PropertyStorage.h in Headers */, + 10D5906E1889C3DF00C05A0D /* InspectorJSBackendDispatchers.h in Headers */, + 10D5906F1889C3DF00C05A0D /* Protect.h in Headers */, + 10D590701889C3DF00C05A0D /* PrototypeMap.h in Headers */, + 10D590711889C3DF00C05A0D /* PutByIdStatus.h in Headers */, + 10D590721889C3DF00C05A0D /* PutDirectIndexMode.h in Headers */, + 10D590731889C3DF00C05A0D /* Microtask.h in Headers */, + 10D590741889C3DF00C05A0D /* PutKind.h in Headers */, + 10D590751889C3DF00C05A0D /* PutPropertySlot.h in Headers */, + 10D590761889C3DF00C05A0D /* InspectorBackendDispatcher.h in Headers */, + 10D590771889C3DF00C05A0D /* ReduceWhitespace.h in Headers */, + 10D590781889C3DF00C05A0D /* RegExp.h in Headers */, + 10D590791889C3DF00C05A0D /* RegExpCache.h in Headers */, + 10D5907A1889C3DF00C05A0D /* RegExpConstructor.h in Headers */, + 10D5907B1889C3DF00C05A0D /* JSPromiseReaction.h in Headers */, + 10D5907C1889C3DF00C05A0D /* RegExpConstructor.lut.h in Headers */, + 10D5907D1889C3DF00C05A0D /* RegExpKey.h in Headers */, + 10D5907E1889C3DF00C05A0D /* StackAlignment.h in Headers */, + 10D5907F1889C3DF00C05A0D /* RegExpObject.h in Headers */, + 10D590801889C3DF00C05A0D /* RegExpObject.lut.h in Headers */, + 10D590811889C3DF00C05A0D /* RegExpPrototype.h in Headers */, + 10D590821889C3DF00C05A0D /* Region.h in Headers */, + 10D590831889C3DF00C05A0D /* Register.h in Headers */, + 10D590841889C3DF00C05A0D /* RegisterID.h in Headers */, + 10D590851889C3DF00C05A0D /* RegisterSet.h in Headers */, + 10D590861889C3DF00C05A0D /* Reject.h in Headers */, + 10D590871889C3DF00C05A0D /* Repatch.h in Headers */, + 10D590881889C3DF00C05A0D /* RepatchBuffer.h in Headers */, + 10D590891889C3DF00C05A0D /* InjectedScript.h in Headers */, + 10D5908A1889C3DF00C05A0D /* ResultType.h in Headers */, + 10D5908B1889C3DF00C05A0D /* SamplingCounter.h in Headers */, + 10D5908C1889C3DF00C05A0D /* SamplingTool.h in Headers */, + 10D5908D1889C3DF00C05A0D /* ScratchRegisterAllocator.h in Headers */, + 10D5908E1889C3DF00C05A0D /* DelayedReleaseScope.h in Headers */, + 10D5908F1889C3DF00C05A0D /* SetConstructor.h in Headers */, + 10D590901889C3DF00C05A0D /* SetPrototype.h in Headers */, + 10D590911889C3DF00C05A0D /* SH4Assembler.h in Headers */, + 10D590921889C3DF00C05A0D /* SimpleTypedArrayController.h in Headers */, + 10D590931889C3DF00C05A0D /* JSPromiseFunctions.h in Headers */, + 10D590941889C3DF00C05A0D /* SetIteratorConstructor.h in Headers */, + 10D590951889C3DF00C05A0D /* SlotVisitor.h in Headers */, + 10D590961889C3DF00C05A0D /* SlotVisitorInlines.h in Headers */, + 10D590971889C3DF00C05A0D /* SlowPathCall.h in Headers */, + 10D590981889C3DF00C05A0D /* SmallStrings.h in Headers */, + 10D590991889C3DF00C05A0D /* SourceCode.h in Headers */, + 10D5909A1889C3DF00C05A0D /* SourceProvider.h in Headers */, + 10D5909B1889C3DF00C05A0D /* SourceProviderCache.h in Headers */, + 10D5909C1889C3DF00C05A0D /* SourceProviderCacheItem.h in Headers */, + 10D5909D1889C3DF00C05A0D /* SparseArrayValueMap.h in Headers */, + 10D5909E1889C3DF00C05A0D /* SpecializedThunkJIT.h in Headers */, + 10D5909F1889C3DF00C05A0D /* SpecialPointer.h in Headers */, + 10D590A01889C3DF00C05A0D /* SpeculatedType.h in Headers */, + 10D590A11889C3DF00C05A0D /* StackVisitor.h in Headers */, + 10D590A21889C3DF00C05A0D /* StaticPropertyAnalysis.h in Headers */, + 10D590A31889C3DF00C05A0D /* ScriptObject.h in Headers */, + 10D590A41889C3DF00C05A0D /* StaticPropertyAnalyzer.h in Headers */, + 10D590A51889C3DF00C05A0D /* StrictEvalActivation.h in Headers */, + 10D590A61889C3DF00C05A0D /* StringConstructor.h in Headers */, + 10D590A71889C3DF00C05A0D /* StringObject.h in Headers */, + 10D590A81889C3DF00C05A0D /* StringPrototype.h in Headers */, + 10D590A91889C3DF00C05A0D /* Strong.h in Headers */, + 10D590AA1889C3DF00C05A0D /* StrongInlines.h in Headers */, + 10D590AB1889C3DF00C05A0D /* Structure.h in Headers */, + 10D590AC1889C3DF00C05A0D /* StructureChain.h in Headers */, + 10D590AD1889C3DF00C05A0D /* StructureInlines.h in Headers */, + 10D590AE1889C3DF00C05A0D /* StructureRareData.h in Headers */, + 10D590AF1889C3DF00C05A0D /* StructureRareDataInlines.h in Headers */, + 10D590B01889C3DF00C05A0D /* StructureSet.h in Headers */, + 10D590B11889C3DF00C05A0D /* StructureStubClearingWatchpoint.h in Headers */, + 10D590B21889C3DF00C05A0D /* StructureStubInfo.h in Headers */, + 10D590B31889C3DF00C05A0D /* StructureTransitionTable.h in Headers */, + 10D590B41889C3DF00C05A0D /* SuperRegion.h in Headers */, + 10D590B51889C3DF00C05A0D /* SymbolTable.h in Headers */, + 10D590B61889C3DF00C05A0D /* SyntaxChecker.h in Headers */, + 10D590B71889C3DF00C05A0D /* TestRunnerUtils.h in Headers */, + 10D590B81889C3DF00C05A0D /* ThunkGenerator.h in Headers */, + 10D590B91889C3DF00C05A0D /* ThunkGenerators.h in Headers */, + 10D590BA1889C3DF00C05A0D /* TinyBloomFilter.h in Headers */, + 10D590BB1889C3DF00C05A0D /* ToNativeFromValue.h in Headers */, + 10D590BC1889C3DF00C05A0D /* Tracing.h in Headers */, + 10D590BD1889C3DF00C05A0D /* TypedArrayAdaptors.h in Headers */, + 10D590BE1889C3DF00C05A0D /* TypedArrayController.h in Headers */, + 10D590BF1889C3DF00C05A0D /* TypedArrayInlines.h in Headers */, + 10D590C01889C3DF00C05A0D /* TypedArrays.h in Headers */, + 10D590C11889C3DF00C05A0D /* TypedArrayType.h in Headers */, + 10D590C21889C3DF00C05A0D /* udis86.h in Headers */, + 10D590C31889C3DF00C05A0D /* udis86_decode.h in Headers */, + 10D590C41889C3DF00C05A0D /* udis86_extern.h in Headers */, + 10D590C51889C3DF00C05A0D /* udis86_input.h in Headers */, + 10D590C61889C3DF00C05A0D /* udis86_syn.h in Headers */, + 10D590C71889C3DF00C05A0D /* udis86_types.h in Headers */, + 10D590C81889C3DF00C05A0D /* UDis86Disassembler.h in Headers */, + 10D590C91889C3DF00C05A0D /* Uint16Array.h in Headers */, + 10D590CA1889C3DF00C05A0D /* Uint16WithFraction.h in Headers */, + 10D590CB1889C3DF00C05A0D /* Uint32Array.h in Headers */, + 10D590CC1889C3DF00C05A0D /* Uint8Array.h in Headers */, + 10D590CD1889C3DF00C05A0D /* Uint8ClampedArray.h in Headers */, + 10D590CE1889C3DF00C05A0D /* UnconditionalFinalizer.h in Headers */, + 10D590CF1889C3DF00C05A0D /* DFGAvailability.h in Headers */, + 10D590D01889C3DF00C05A0D /* UnlinkedCodeBlock.h in Headers */, + 10D590D11889C3DF00C05A0D /* UnusedPointer.h in Headers */, + 10D590D21889C3DF00C05A0D /* ValueProfile.h in Headers */, + 10D590D31889C3DF00C05A0D /* InjectedScriptHost.h in Headers */, + 10D590D41889C3DF00C05A0D /* ValueRecovery.h in Headers */, + 10D590D51889C3DF00C05A0D /* VirtualRegister.h in Headers */, + 10D590D61889C3DF00C05A0D /* VM.h in Headers */, + 10D590D71889C3DF00C05A0D /* VMInspector.h in Headers */, + 10D590D81889C3DF00C05A0D /* InjectedScriptSource.h in Headers */, + 10D590D91889C3DF00C05A0D /* Watchdog.h in Headers */, + 10D590DA1889C3DF00C05A0D /* Watchpoint.h in Headers */, + 10D590DB1889C3DF00C05A0D /* Weak.h in Headers */, + 10D590DC1889C3DF00C05A0D /* JSInjectedScriptHost.h in Headers */, + 10D590DD1889C3DF00C05A0D /* WeakBlock.h in Headers */, + 10D590DE1889C3DF00C05A0D /* WeakGCMap.h in Headers */, + 10D590DF1889C3DF00C05A0D /* RemoteInspector.h in Headers */, + 10D590E01889C3DF00C05A0D /* WeakHandleOwner.h in Headers */, + 10D590E11889C3DF00C05A0D /* WeakImpl.h in Headers */, + 10D590E21889C3DF00C05A0D /* WeakInlines.h in Headers */, + 10D590E31889C3DF00C05A0D /* WeakMapConstructor.h in Headers */, + 10D590E41889C3DF00C05A0D /* WeakMapData.h in Headers */, + 10D590E51889C3DF00C05A0D /* DFGStoreBarrierElisionPhase.h in Headers */, + 10D590E61889C3DF00C05A0D /* InspectorTypeBuilder.h in Headers */, + 10D590E71889C3DF00C05A0D /* WeakMapPrototype.h in Headers */, + 10D590E81889C3DF00C05A0D /* WeakRandom.h in Headers */, + 10D590E91889C3DF00C05A0D /* WeakReferenceHarvester.h in Headers */, + 10D590EA1889C3DF00C05A0D /* WeakSet.h in Headers */, + 10D590EB1889C3DF00C05A0D /* WeakSetInlines.h in Headers */, + 10D590EC1889C3DF00C05A0D /* WebKitAvailability.h in Headers */, + 10D590ED1889C3DF00C05A0D /* MapIteratorConstructor.h in Headers */, + 10D590EE1889C3DF00C05A0D /* WriteBarrier.h in Headers */, + 10D590EF1889C3DF00C05A0D /* WriteBarrierSupport.h in Headers */, + 10D590F01889C3DF00C05A0D /* X86Assembler.h in Headers */, + 10D590F11889C3DF00C05A0D /* Yarr.h in Headers */, + 10D590F21889C3DF00C05A0D /* DFGResurrectionForValidationPhase.h in Headers */, + 10D590F31889C3DF00C05A0D /* YarrInterpreter.h in Headers */, + 10D590F41889C3DF00C05A0D /* ScriptFunctionCall.h in Headers */, + 10D590F51889C3DF00C05A0D /* YarrJIT.h in Headers */, + 10D590F61889C3DF00C05A0D /* YarrParser.h in Headers */, + 10D590F71889C3DF00C05A0D /* YarrPattern.h in Headers */, + 10D590F81889C3DF00C05A0D /* YarrSyntaxChecker.h in Headers */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; 144005C70A5338C60005F061 /* Headers */ = { isa = PBXHeadersBuildPhase; buildActionMask = 2147483647; @@ -5227,6 +7278,49 @@ productReference = 0FF922CF14F46B130041A24E /* JSCLLIntOffsetsExtractor */; productType = "com.apple.product-type.tool"; }; + 10D58E011889C1A000C05A0D /* JSCLLIntOffsetsExtractor iOS */ = { + isa = PBXNativeTarget; + buildConfigurationList = 10D58E071889C1A000C05A0D /* Build configuration list for PBXNativeTarget "JSCLLIntOffsetsExtractor iOS" */; + buildPhases = ( + 10D58E041889C1A000C05A0D /* Sources */, + 10D58E061889C1A000C05A0D /* Frameworks */, + ); + buildRules = ( + ); + dependencies = ( + 10D58E021889C1A000C05A0D /* PBXTargetDependency */, + ); + name = "JSCLLIntOffsetsExtractor iOS"; + productInstallPath = /usr/local/bin; + productName = jsc; + productReference = 10D58E0C1889C1A000C05A0D /* libJSCLLIntOffsetsExtractor.a */; + productType = "com.apple.product-type.library.static"; + }; + 10D58E0D1889C3DF00C05A0D /* JavaScriptCore iOS */ = { + isa = PBXNativeTarget; + buildConfigurationList = 10D592EF1889C3DF00C05A0D /* Build configuration list for PBXNativeTarget "JavaScriptCore iOS" */; + buildPhases = ( + 10D58E121889C3DF00C05A0D /* Update Info.plist with version information */, + 10D58E131889C3DF00C05A0D /* Headers */, + 10D590F91889C3DF00C05A0D /* Postprocess Headers */, + 10D590FA1889C3DF00C05A0D /* Sources */, + 10D592E41889C3DF00C05A0D /* Frameworks */, + 10D592EB1889C3DF00C05A0D /* Copy LLVM Library Into Framework */, + 10D592EC1889C3DF00C05A0D /* Check For Weak VTables and Externals */, + 10D592ED1889C3DF00C05A0D /* Check For Inappropriate Objective-C Class Names */, + 10D592EE1889C3DF00C05A0D /* Check For Inappropriate Macros in External Headers */, + ); + buildRules = ( + ); + dependencies = ( + 10D593041889C5DE00C05A0D /* PBXTargetDependency */, + ); + name = "JavaScriptCore iOS"; + productInstallPath = "${SYSTEM_LIBRARY_DIR}/Frameworks/WebKit.framework/Versions/A/Frameworks"; + productName = JavaScriptCore; + productReference = 10D592F41889C3DF00C05A0D /* libJavaScriptCore.a */; + productType = "com.apple.product-type.library.static"; + }; 1412111F0A48793C00480255 /* minidom */ = { isa = PBXNativeTarget; buildConfigurationList = 141211390A48798400480255 /* Build configuration list for PBXNativeTarget "minidom" */; @@ -5342,6 +7436,7 @@ Japanese, French, German, + en, ); mainGroup = 0867D691FE84028FC02AAC07 /* JavaScriptCore */; productRefGroup = 034768DFFF38A50411DB9C8B /* Products */; @@ -5359,6 +7454,9 @@ 0FF922C314F46B130041A24E /* JSCLLIntOffsetsExtractor */, 5D6B2A47152B9E17005231DE /* Test Tools */, 0FCEFAB51805D61600472CE4 /* llvmForJSC */, + 10D58E011889C1A000C05A0D /* JSCLLIntOffsetsExtractor iOS */, + 10D58E0D1889C3DF00C05A0D /* JavaScriptCore iOS */, + 10D592F61889C55E00C05A0D /* Derived Sources iOS */, ); }; /* End PBXProject section */ @@ -5395,6 +7493,131 @@ shellPath = /bin/sh; shellScript = "if [[ $ENABLE_FTL_JIT != \"ENABLE_FTL_JIT\" ]]\nthen\n exit 0\nfi\n\n# Copy the llvmForJSC library into the framework.\nditto \"${BUILT_PRODUCTS_DIR}/libllvmForJSC.dylib\" \"${BUILT_PRODUCTS_DIR}/${CONTENTS_FOLDER_PATH}/Libraries/libllvmForJSC.dylib\"\nif [ ! -e \"${BUILT_PRODUCTS_DIR}/${WRAPPER_NAME}/Libraries\" ]\nthen\n ln -fs \"Versions/Current/Libraries\" \"${BUILT_PRODUCTS_DIR}/${WRAPPER_NAME}/Libraries\"\nfi"; }; + 10D58E121889C3DF00C05A0D /* Update Info.plist with version information */ = { + isa = PBXShellScriptBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + inputPaths = ( + "$(SRCROOT)/Configurations/Version.xcconfig", + ); + name = "Update Info.plist with version information"; + outputPaths = ( + "$(SRCROOT)/Info.plist", + ); + runOnlyForDeploymentPostprocessing = 0; + shellPath = /bin/sh; + shellScript = "# Touch Info.plist to let Xcode know it needs to copy it into the built product\nif [[ \"${CONFIGURATION}\" != \"Production\" ]]; then\n touch \"$SRCROOT/Info.plist\";\nfi;\n"; + }; + 10D590F91889C3DF00C05A0D /* Postprocess Headers */ = { + isa = PBXShellScriptBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + inputPaths = ( + "$(TARGET_BUILD_DIR)/$(PUBLIC_HEADERS_FOLDER_PATH)/JSBase.h", + "$(TARGET_BUILD_DIR)/$(PUBLIC_HEADERS_FOLDER_PATH)/JSContext.h", + "$(TARGET_BUILD_DIR)/$(PUBLIC_HEADERS_FOLDER_PATH)/JSManagedValue.h", + "$(TARGET_BUILD_DIR)/$(PUBLIC_HEADERS_FOLDER_PATH)/JSValue.h", + "$(TARGET_BUILD_DIR)/$(PUBLIC_HEADERS_FOLDER_PATH)/JSVirtualMachine.h", + ); + name = "Postprocess Headers"; + outputPaths = ( + ); + runOnlyForDeploymentPostprocessing = 0; + shellPath = /bin/sh; + shellScript = "cd \"${TARGET_BUILD_DIR}/${PUBLIC_HEADERS_FOLDER_PATH}\"\n\nif [[ ${TARGET_MAC_OS_X_VERSION_MAJOR} == \"1080\" ]]; then\n UNIFDEF_OPTION=\"-DJSC_OBJC_API_AVAILABLE_MAC_OS_X_1080\";\nelse\n UNIFDEF_OPTION=\"-UJSC_OBJC_API_AVAILABLE_MAC_OS_X_1080\";\nfi\n\nfor HEADER in JSBase.h JSContext.h JSManagedValue.h JSValue.h JSVirtualMachine.h; do\n unifdef -B ${UNIFDEF_OPTION} -o ${HEADER}.unifdef ${HEADER}\n case $? in\n 0)\n rm ${HEADER}.unifdef\n ;;\n 1)\n mv ${HEADER}{.unifdef,}\n ;;\n *)\n exit 1\n esac\ndone\n"; + }; + 10D592EB1889C3DF00C05A0D /* Copy LLVM Library Into Framework */ = { + isa = PBXShellScriptBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + inputPaths = ( + "$(BUILT_PRODUCTS_DIR)/libllvmForJSC.dylib", + ); + name = "Copy LLVM Library Into Framework"; + outputPaths = ( + ); + runOnlyForDeploymentPostprocessing = 0; + shellPath = /bin/sh; + shellScript = "if [[ $ENABLE_FTL_JIT != \"ENABLE_FTL_JIT\" ]]\nthen\n exit 0\nfi\n\n# Copy the llvmForJSC library into the framework.\nditto \"${BUILT_PRODUCTS_DIR}/libllvmForJSC.dylib\" \"${BUILT_PRODUCTS_DIR}/${CONTENTS_FOLDER_PATH}/Libraries/libllvmForJSC.dylib\"\nif [ ! -e \"${BUILT_PRODUCTS_DIR}/${WRAPPER_NAME}/Libraries\" ]\nthen\n ln -fs \"Versions/Current/Libraries\" \"${BUILT_PRODUCTS_DIR}/${WRAPPER_NAME}/Libraries\"\nfi"; + }; + 10D592EC1889C3DF00C05A0D /* Check For Weak VTables and Externals */ = { + isa = PBXShellScriptBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + inputPaths = ( + "$(TARGET_BUILD_DIR)/$(EXECUTABLE_PATH)", + ); + name = "Check For Weak VTables and Externals"; + outputPaths = ( + ); + runOnlyForDeploymentPostprocessing = 0; + shellPath = /bin/sh; + shellScript = "if [ -f ../../Tools/Scripts/check-for-weak-vtables-and-externals ]; then\n ../../Tools/Scripts/check-for-weak-vtables-and-externals || exit $?\nfi"; + }; + 10D592ED1889C3DF00C05A0D /* Check For Inappropriate Objective-C Class Names */ = { + isa = PBXShellScriptBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + inputPaths = ( + "$(TARGET_BUILD_DIR)/$(EXECUTABLE_PATH)", + ); + name = "Check For Inappropriate Objective-C Class Names"; + outputPaths = ( + ); + runOnlyForDeploymentPostprocessing = 0; + shellPath = /bin/sh; + shellScript = "if [ \"${ACTION}\" = \"installhdrs\" ]; then\n exit 0;\nfi\n\nif [ -f ../../Tools/Scripts/check-for-inappropriate-objc-class-names ]; then\n ../../Tools/Scripts/check-for-inappropriate-objc-class-names JS || exit $?\nfi"; + }; + 10D592EE1889C3DF00C05A0D /* Check For Inappropriate Macros in External Headers */ = { + isa = PBXShellScriptBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + inputPaths = ( + "$(TARGET_BUILD_DIR)/$(EXECUTABLE_PATH)", + ); + name = "Check For Inappropriate Macros in External Headers"; + outputPaths = ( + ); + runOnlyForDeploymentPostprocessing = 0; + shellPath = /bin/sh; + shellScript = "if [ \"${ACTION}\" = \"installhdrs\" ]; then\n exit 0;\nfi\n\nif [ -f ../../Tools/Scripts/check-for-inappropriate-macros-in-external-headers ]; then\n ../../Tools/Scripts/check-for-inappropriate-macros-in-external-headers Headers PrivateHeaders/JSBasePrivate.h || exit $?\nfi"; + }; + 10D592F91889C55E00C05A0D /* Generate Derived Sources */ = { + isa = PBXShellScriptBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + inputPaths = ( + ); + name = "Generate Derived Sources"; + outputPaths = ( + ); + runOnlyForDeploymentPostprocessing = 0; + shellPath = /bin/sh; + shellScript = "mkdir -p \"${BUILT_PRODUCTS_DIR}/DerivedSources/JavaScriptCore\"\ncd \"${BUILT_PRODUCTS_DIR}/DerivedSources/JavaScriptCore\"\n\n/bin/ln -sfh \"${SRCROOT}\" JavaScriptCore\nexport JavaScriptCore=\"JavaScriptCore\"\nexport BUILT_PRODUCTS_DIR=\"../..\"\n\nmake --no-builtin-rules -f \"JavaScriptCore/DerivedSources.make\" -j `/usr/sbin/sysctl -n hw.ncpu` || exit 1\n\nif [[ \"${ACTION}\" == \"installhdrs\" ]]; then\n exit 0\nfi\n\n/usr/bin/env ruby JavaScriptCore/offlineasm/asm.rb JavaScriptCore/llint/LowLevelInterpreter.asm ${BUILT_PRODUCTS_DIR}/libJSCLLIntOffsetsExtractor.a LLIntAssembly.h || exit 1\n"; + }; + 10D592FA1889C55E00C05A0D /* Generate DTrace header */ = { + isa = PBXShellScriptBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + inputPaths = ( + "$(SRCROOT)/runtime/Tracing.d", + ); + name = "Generate DTrace header"; + outputPaths = ( + "$(BUILT_PRODUCTS_DIR)/DerivedSources/JavaScriptCore/TracingDtrace.h", + ); + runOnlyForDeploymentPostprocessing = 0; + shellPath = /bin/sh; + shellScript = "TRACING_D=\"$SRCROOT/runtime/Tracing.d\";\nTRACING_H=\"$BUILT_PRODUCTS_DIR/DerivedSources/JavaScriptCore/TracingDtrace.h\";\n\nif [[ \"$HAVE_DTRACE\" = \"1\" && \"$TRACING_D\" -nt \"$TRACING_H\" ]];\nthen\n\tdtrace -h -o \"$TRACING_H\" -s \"$TRACING_D\";\nfi;\n"; + }; 3713F014142905240036387F /* Check For Inappropriate Objective-C Class Names */ = { isa = PBXShellScriptBuildPhase; buildActionMask = 2147483647; @@ -5558,6 +7781,510 @@ ); runOnlyForDeploymentPostprocessing = 0; }; + 10D58E041889C1A000C05A0D /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 10D58E051889C1A000C05A0D /* LLIntOffsetsExtractor.cpp in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + 10D590FA1889C3DF00C05A0D /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 10D590FB1889C3DF00C05A0D /* ProtoCallFrame.cpp in Sources */, + 10D590FC1889C3DF00C05A0D /* A64DOpcode.cpp in Sources */, + 10D590FD1889C3DF00C05A0D /* AbstractPC.cpp in Sources */, + 10D590FE1889C3DF00C05A0D /* ArgList.cpp in Sources */, + 10D590FF1889C3DF00C05A0D /* Arguments.cpp in Sources */, + 10D591001889C3DF00C05A0D /* ArgumentsIteratorConstructor.cpp in Sources */, + 10D591011889C3DF00C05A0D /* ArgumentsIteratorPrototype.cpp in Sources */, + 10D591021889C3DF00C05A0D /* ARM64Disassembler.cpp in Sources */, + 10D591031889C3DF00C05A0D /* ARMAssembler.cpp in Sources */, + 10D591041889C3DF00C05A0D /* ARMv7Assembler.cpp in Sources */, + 10D591051889C3DF00C05A0D /* ARMv7Disassembler.cpp in Sources */, + 10D591061889C3DF00C05A0D /* ARMv7DOpcode.cpp in Sources */, + 10D591071889C3DF00C05A0D /* ArrayAllocationProfile.cpp in Sources */, + 10D591081889C3DF00C05A0D /* ArrayBuffer.cpp in Sources */, + 10D591091889C3DF00C05A0D /* ArrayBufferView.cpp in Sources */, + 10D5910A1889C3DF00C05A0D /* DFGArithMode.cpp in Sources */, + 10D5910B1889C3DF00C05A0D /* ArrayConstructor.cpp in Sources */, + 10D5910C1889C3DF00C05A0D /* ArrayIteratorConstructor.cpp in Sources */, + 10D5910D1889C3DF00C05A0D /* ArrayIteratorPrototype.cpp in Sources */, + 10D5910E1889C3DF00C05A0D /* JSSetIterator.cpp in Sources */, + 10D5910F1889C3DF00C05A0D /* ArrayProfile.cpp in Sources */, + 10D591101889C3DF00C05A0D /* ArrayPrototype.cpp in Sources */, + 10D591111889C3DF00C05A0D /* AssemblyHelpers.cpp in Sources */, + 10D591121889C3DF00C05A0D /* BlockAllocator.cpp in Sources */, + 10D591131889C3DF00C05A0D /* BooleanConstructor.cpp in Sources */, + 10D591141889C3DF00C05A0D /* BooleanObject.cpp in Sources */, + 10D591151889C3DF00C05A0D /* BooleanPrototype.cpp in Sources */, + 10D591161889C3DF00C05A0D /* BytecodeGenerator.cpp in Sources */, + 10D591171889C3DF00C05A0D /* CallData.cpp in Sources */, + 10D591181889C3DF00C05A0D /* CallFrame.cpp in Sources */, + 10D591191889C3DF00C05A0D /* CallLinkInfo.cpp in Sources */, + 10D5911A1889C3DF00C05A0D /* InjectedScript.cpp in Sources */, + 10D5911B1889C3DF00C05A0D /* CallLinkStatus.cpp in Sources */, + 10D5911C1889C3DF00C05A0D /* ClosureCallStubRoutine.cpp in Sources */, + 10D5911D1889C3DF00C05A0D /* CodeBlock.cpp in Sources */, + 10D5911E1889C3DF00C05A0D /* CodeBlockHash.cpp in Sources */, + 10D5911F1889C3DF00C05A0D /* CodeBlockJettisoningWatchpoint.cpp in Sources */, + 10D591201889C3DF00C05A0D /* CodeBlockSet.cpp in Sources */, + 10D591211889C3DF00C05A0D /* CodeCache.cpp in Sources */, + 10D591221889C3DF00C05A0D /* CodeOrigin.cpp in Sources */, + 10D591231889C3DF00C05A0D /* CodeProfile.cpp in Sources */, + 10D591241889C3DF00C05A0D /* CodeProfiling.cpp in Sources */, + 10D591251889C3DF00C05A0D /* CodeSpecializationKind.cpp in Sources */, + 10D591261889C3DF00C05A0D /* CodeType.cpp in Sources */, + 10D591271889C3DF00C05A0D /* CommonIdentifiers.cpp in Sources */, + 10D591281889C3DF00C05A0D /* CommonSlowPaths.cpp in Sources */, + 10D591291889C3DF00C05A0D /* CommonSlowPathsExceptions.cpp in Sources */, + 10D5912A1889C3DF00C05A0D /* CompilationResult.cpp in Sources */, + 10D5912B1889C3DF00C05A0D /* Completion.cpp in Sources */, + 10D5912C1889C3DF00C05A0D /* ConservativeRoots.cpp in Sources */, + 10D5912D1889C3DF00C05A0D /* ConstructData.cpp in Sources */, + 10D5912E1889C3DF00C05A0D /* CopiedSpace.cpp in Sources */, + 10D5912F1889C3DF00C05A0D /* CopyVisitor.cpp in Sources */, + 10D591301889C3DF00C05A0D /* DataView.cpp in Sources */, + 10D591311889C3DF00C05A0D /* DateConstructor.cpp in Sources */, + 10D591321889C3DF00C05A0D /* DateConversion.cpp in Sources */, + 10D591331889C3DF00C05A0D /* DateInstance.cpp in Sources */, + 10D591341889C3DF00C05A0D /* DatePrototype.cpp in Sources */, + 10D591351889C3DF00C05A0D /* BytecodeLivenessAnalysis.cpp in Sources */, + 10D591361889C3DF00C05A0D /* Debugger.cpp in Sources */, + 10D591371889C3DF00C05A0D /* DebuggerActivation.cpp in Sources */, + 10D591381889C3DF00C05A0D /* DebuggerCallFrame.cpp in Sources */, + 10D591391889C3DF00C05A0D /* DeferGC.cpp in Sources */, + 10D5913A1889C3DF00C05A0D /* DeferredCompilationCallback.cpp in Sources */, + 10D5913B1889C3DF00C05A0D /* DFGAbstractHeap.cpp in Sources */, + 10D5913C1889C3DF00C05A0D /* DFGAbstractValue.cpp in Sources */, + 10D5913D1889C3DF00C05A0D /* DFGArgumentsSimplificationPhase.cpp in Sources */, + 10D5913E1889C3DF00C05A0D /* DFGArrayMode.cpp in Sources */, + 10D5913F1889C3DF00C05A0D /* DFGAtTailAbstractState.cpp in Sources */, + 10D591401889C3DF00C05A0D /* DFGBackwardsPropagationPhase.cpp in Sources */, + 10D591411889C3DF00C05A0D /* DFGBasicBlock.cpp in Sources */, + 10D591421889C3DF00C05A0D /* DFGBinarySwitch.cpp in Sources */, + 10D591431889C3DF00C05A0D /* DFGBlockInsertionSet.cpp in Sources */, + 10D591441889C3DF00C05A0D /* DFGByteCodeParser.cpp in Sources */, + 10D591451889C3DF00C05A0D /* DFGCapabilities.cpp in Sources */, + 10D591461889C3DF00C05A0D /* DFGCFAPhase.cpp in Sources */, + 10D591471889C3DF00C05A0D /* DFGCFGSimplificationPhase.cpp in Sources */, + 10D591481889C3DF00C05A0D /* DFGClobberize.cpp in Sources */, + 10D591491889C3DF00C05A0D /* DFGClobberSet.cpp in Sources */, + 10D5914A1889C3DF00C05A0D /* DFGCommon.cpp in Sources */, + 10D5914B1889C3DF00C05A0D /* DFGCommonData.cpp in Sources */, + 10D5914C1889C3DF00C05A0D /* DFGCompilationKey.cpp in Sources */, + 10D5914D1889C3DF00C05A0D /* DFGCompilationMode.cpp in Sources */, + 10D5914E1889C3DF00C05A0D /* DFGConstantFoldingPhase.cpp in Sources */, + 10D5914F1889C3DF00C05A0D /* DFGCPSRethreadingPhase.cpp in Sources */, + 10D591501889C3DF00C05A0D /* DFGCriticalEdgeBreakingPhase.cpp in Sources */, + 10D591511889C3DF00C05A0D /* DFGCSEPhase.cpp in Sources */, + 10D591521889C3DF00C05A0D /* DFGDCEPhase.cpp in Sources */, + 10D591531889C3DF00C05A0D /* DFGDesiredIdentifiers.cpp in Sources */, + 10D591541889C3DF00C05A0D /* DFGDesiredStructureChains.cpp in Sources */, + 10D591551889C3DF00C05A0D /* DFGDesiredTransitions.cpp in Sources */, + 10D591561889C3DF00C05A0D /* DFGDesiredWatchpoints.cpp in Sources */, + 10D591571889C3DF00C05A0D /* DFGDesiredWeakReferences.cpp in Sources */, + 10D591581889C3DF00C05A0D /* DFGDesiredWriteBarriers.cpp in Sources */, + 10D591591889C3DF00C05A0D /* DFGDisassembler.cpp in Sources */, + 10D5915A1889C3DF00C05A0D /* DFGDominators.cpp in Sources */, + 10D5915B1889C3DF00C05A0D /* DFGDriver.cpp in Sources */, + 10D5915C1889C3DF00C05A0D /* InspectorValues.cpp in Sources */, + 10D5915D1889C3DF00C05A0D /* DFGEdge.cpp in Sources */, + 10D5915E1889C3DF00C05A0D /* MapIteratorPrototype.cpp in Sources */, + 10D5915F1889C3DF00C05A0D /* DFGExitProfile.cpp in Sources */, + 10D591601889C3DF00C05A0D /* DFGFailedFinalizer.cpp in Sources */, + 10D591611889C3DF00C05A0D /* DFGFinalizer.cpp in Sources */, + 10D591621889C3DF00C05A0D /* DFGFixupPhase.cpp in Sources */, + 10D591631889C3DF00C05A0D /* DFGFlushedAt.cpp in Sources */, + 10D591641889C3DF00C05A0D /* DFGFlushFormat.cpp in Sources */, + 10D591651889C3DF00C05A0D /* DFGFlushLivenessAnalysisPhase.cpp in Sources */, + 10D591661889C3DF00C05A0D /* DFGGraph.cpp in Sources */, + 10D591671889C3DF00C05A0D /* DFGInPlaceAbstractState.cpp in Sources */, + 10D591681889C3DF00C05A0D /* DFGInvalidationPointInjectionPhase.cpp in Sources */, + 10D591691889C3DF00C05A0D /* DFGJITCode.cpp in Sources */, + 10D5916A1889C3DF00C05A0D /* DFGJITCompiler.cpp in Sources */, + 10D5916B1889C3DF00C05A0D /* DFGJITFinalizer.cpp in Sources */, + 10D5916C1889C3DF00C05A0D /* DFGJumpReplacement.cpp in Sources */, + 10D5916D1889C3DF00C05A0D /* DFGLazyJSValue.cpp in Sources */, + 10D5916E1889C3DF00C05A0D /* InjectedScriptHost.cpp in Sources */, + 10D5916F1889C3DF00C05A0D /* DFGLICMPhase.cpp in Sources */, + 10D591701889C3DF00C05A0D /* DFGLivenessAnalysisPhase.cpp in Sources */, + 10D591711889C3DF00C05A0D /* DFGLongLivedState.cpp in Sources */, + 10D591721889C3DF00C05A0D /* DFGLoopPreHeaderCreationPhase.cpp in Sources */, + 10D591731889C3DF00C05A0D /* DFGMinifiedNode.cpp in Sources */, + 10D591741889C3DF00C05A0D /* DFGNaturalLoops.cpp in Sources */, + 10D591751889C3DF00C05A0D /* DFGNode.cpp in Sources */, + 10D591761889C3DF00C05A0D /* DFGNodeFlags.cpp in Sources */, + 10D591771889C3DF00C05A0D /* DFGOperations.cpp in Sources */, + 10D591781889C3DF00C05A0D /* InjectedScriptBase.cpp in Sources */, + 10D591791889C3DF00C05A0D /* DFGOSRAvailabilityAnalysisPhase.cpp in Sources */, + 10D5917A1889C3DF00C05A0D /* DFGOSREntry.cpp in Sources */, + 10D5917B1889C3DF00C05A0D /* DFGOSREntrypointCreationPhase.cpp in Sources */, + 10D5917C1889C3DF00C05A0D /* DFGOSRExit.cpp in Sources */, + 10D5917D1889C3DF00C05A0D /* DFGOSRExitBase.cpp in Sources */, + 10D5917E1889C3DF00C05A0D /* DFGOSRExitCompiler.cpp in Sources */, + 10D5917F1889C3DF00C05A0D /* DFGOSRExitCompiler32_64.cpp in Sources */, + 10D591801889C3DF00C05A0D /* DFGStrengthReductionPhase.cpp in Sources */, + 10D591811889C3DF00C05A0D /* DFGOSRExitCompiler64.cpp in Sources */, + 10D591821889C3DF00C05A0D /* DFGOSRExitCompilerCommon.cpp in Sources */, + 10D591831889C3DF00C05A0D /* DFGOSRExitJumpPlaceholder.cpp in Sources */, + 10D591841889C3DF00C05A0D /* DFGOSRExitPreparation.cpp in Sources */, + 10D591851889C3DF00C05A0D /* DFGPhase.cpp in Sources */, + 10D591861889C3DF00C05A0D /* DFGPlan.cpp in Sources */, + 10D591871889C3DF00C05A0D /* DFGPredictionInjectionPhase.cpp in Sources */, + 10D591881889C3DF00C05A0D /* DFGPredictionPropagationPhase.cpp in Sources */, + 10D591891889C3DF00C05A0D /* DFGSpeculativeJIT.cpp in Sources */, + 10D5918A1889C3DF00C05A0D /* DFGSpeculativeJIT32_64.cpp in Sources */, + 10D5918B1889C3DF00C05A0D /* DFGSpeculativeJIT64.cpp in Sources */, + 10D5918C1889C3DF00C05A0D /* DFGSSAConversionPhase.cpp in Sources */, + 10D5918D1889C3DF00C05A0D /* DFGStackLayoutPhase.cpp in Sources */, + 10D5918E1889C3DF00C05A0D /* DFGThunks.cpp in Sources */, + 10D5918F1889C3DF00C05A0D /* DFGTierUpCheckInjectionPhase.cpp in Sources */, + 10D591901889C3DF00C05A0D /* DFGToFTLDeferredCompilationCallback.cpp in Sources */, + 10D591911889C3DF00C05A0D /* DFGToFTLForOSREntryDeferredCompilationCallback.cpp in Sources */, + 10D591921889C3DF00C05A0D /* DFGTypeCheckHoistingPhase.cpp in Sources */, + 10D591931889C3DF00C05A0D /* DFGUnificationPhase.cpp in Sources */, + 10D591941889C3DF00C05A0D /* DFGUseKind.cpp in Sources */, + 10D591951889C3DF00C05A0D /* DFGValidate.cpp in Sources */, + 10D591961889C3DF00C05A0D /* ScriptFunctionCall.cpp in Sources */, + 10D591971889C3DF00C05A0D /* DFGValueSource.cpp in Sources */, + 10D591981889C3DF00C05A0D /* DFGVariableAccessDataDump.cpp in Sources */, + 10D591991889C3DF00C05A0D /* DFGVariableEvent.cpp in Sources */, + 10D5919A1889C3DF00C05A0D /* DFGVariableEventStream.cpp in Sources */, + 10D5919B1889C3DF00C05A0D /* DFGVirtualRegisterAllocationPhase.cpp in Sources */, + 10D5919C1889C3DF00C05A0D /* DFGWatchpointCollectionPhase.cpp in Sources */, + 10D5919D1889C3DF00C05A0D /* DFGWorklist.cpp in Sources */, + 10D5919E1889C3DF00C05A0D /* Disassembler.cpp in Sources */, + 10D5919F1889C3DF00C05A0D /* DumpContext.cpp in Sources */, + 10D591A01889C3DF00C05A0D /* Error.cpp in Sources */, + 10D591A11889C3DF00C05A0D /* ErrorConstructor.cpp in Sources */, + 10D591A21889C3DF00C05A0D /* ErrorInstance.cpp in Sources */, + 10D591A31889C3DF00C05A0D /* ErrorPrototype.cpp in Sources */, + 10D591A41889C3DF00C05A0D /* ExceptionHelpers.cpp in Sources */, + 10D591A51889C3DF00C05A0D /* Executable.cpp in Sources */, + 10D591A61889C3DF00C05A0D /* ExecutableAllocator.cpp in Sources */, + 10D591A71889C3DF00C05A0D /* ExecutableAllocatorFixedVMPool.cpp in Sources */, + 10D591A81889C3DF00C05A0D /* ExecutionCounter.cpp in Sources */, + 10D591A91889C3DF00C05A0D /* JSGlobalObjectDebuggable.cpp in Sources */, + 10D591AA1889C3DF00C05A0D /* ExitKind.cpp in Sources */, + 10D591AB1889C3DF00C05A0D /* ScriptValue.cpp in Sources */, + 10D591AC1889C3DF00C05A0D /* FTLAbstractHeap.cpp in Sources */, + 10D591AD1889C3DF00C05A0D /* FTLAbstractHeapRepository.cpp in Sources */, + 10D591AE1889C3DF00C05A0D /* FTLCapabilities.cpp in Sources */, + 10D591AF1889C3DF00C05A0D /* FTLCommonValues.cpp in Sources */, + 10D591B01889C3DF00C05A0D /* JSPromiseDeferred.cpp in Sources */, + 10D591B11889C3DF00C05A0D /* InspectorJSFrontendDispatchers.cpp in Sources */, + 10D591B21889C3DF00C05A0D /* FTLCompile.cpp in Sources */, + 10D591B31889C3DF00C05A0D /* FTLExitArgument.cpp in Sources */, + 10D591B41889C3DF00C05A0D /* FTLExitArgumentForOperand.cpp in Sources */, + 10D591B51889C3DF00C05A0D /* FTLExitThunkGenerator.cpp in Sources */, + 10D591B61889C3DF00C05A0D /* FTLExitValue.cpp in Sources */, + 10D591B71889C3DF00C05A0D /* FTLFail.cpp in Sources */, + 10D591B81889C3DF00C05A0D /* FTLForOSREntryJITCode.cpp in Sources */, + 10D591B91889C3DF00C05A0D /* FTLInlineCacheSize.cpp in Sources */, + 10D591BA1889C3DF00C05A0D /* FTLIntrinsicRepository.cpp in Sources */, + 10D591BB1889C3DF00C05A0D /* FTLJITCode.cpp in Sources */, + 10D591BC1889C3DF00C05A0D /* FTLJITFinalizer.cpp in Sources */, + 10D591BD1889C3DF00C05A0D /* FTLLink.cpp in Sources */, + 10D591BE1889C3DF00C05A0D /* JSMapIterator.cpp in Sources */, + 10D591BF1889C3DF00C05A0D /* FTLLocation.cpp in Sources */, + 10D591C01889C3DF00C05A0D /* FTLLowerDFGToLLVM.cpp in Sources */, + 10D591C11889C3DF00C05A0D /* FTLOSREntry.cpp in Sources */, + 10D591C21889C3DF00C05A0D /* FTLOSRExit.cpp in Sources */, + 10D591C31889C3DF00C05A0D /* FTLOSRExitCompiler.cpp in Sources */, + 10D591C41889C3DF00C05A0D /* FTLOutput.cpp in Sources */, + 10D591C51889C3DF00C05A0D /* FTLSaveRestore.cpp in Sources */, + 10D591C61889C3DF00C05A0D /* FTLSlowPathCall.cpp in Sources */, + 10D591C71889C3DF00C05A0D /* FTLSlowPathCallKey.cpp in Sources */, + 10D591C81889C3DF00C05A0D /* FTLStackMaps.cpp in Sources */, + 10D591C91889C3DF00C05A0D /* FTLState.cpp in Sources */, + 10D591CA1889C3DF00C05A0D /* JSPromiseFunctions.cpp in Sources */, + 10D591CB1889C3DF00C05A0D /* FTLThunks.cpp in Sources */, + 10D591CC1889C3DF00C05A0D /* InspectorBackendDispatcher.cpp in Sources */, + 10D591CD1889C3DF00C05A0D /* FTLValueFormat.cpp in Sources */, + 10D591CE1889C3DF00C05A0D /* FunctionConstructor.cpp in Sources */, + 10D591CF1889C3DF00C05A0D /* FunctionExecutableDump.cpp in Sources */, + 10D591D01889C3DF00C05A0D /* FunctionPrototype.cpp in Sources */, + 10D591D11889C3DF00C05A0D /* GCActivityCallback.cpp in Sources */, + 10D591D21889C3DF00C05A0D /* GCAwareJITStubRoutine.cpp in Sources */, + 10D591D31889C3DF00C05A0D /* GCThread.cpp in Sources */, + 10D591D41889C3DF00C05A0D /* GCThreadSharedData.cpp in Sources */, + 10D591D51889C3DF00C05A0D /* GetByIdStatus.cpp in Sources */, + 10D591D61889C3DF00C05A0D /* JSPromiseReaction.cpp in Sources */, + 10D591D71889C3DF00C05A0D /* GetterSetter.cpp in Sources */, + 10D591D81889C3DF00C05A0D /* HandleSet.cpp in Sources */, + 10D591D91889C3DF00C05A0D /* HandleStack.cpp in Sources */, + 10D591DA1889C3DF00C05A0D /* Heap.cpp in Sources */, + 10D591DB1889C3DF00C05A0D /* HeapStatistics.cpp in Sources */, + 10D591DC1889C3DF00C05A0D /* HeapTimer.cpp in Sources */, + 10D591DD1889C3DF00C05A0D /* HostCallReturnValue.cpp in Sources */, + 10D591DE1889C3DF00C05A0D /* Identifier.cpp in Sources */, + 10D591DF1889C3DF00C05A0D /* IncrementalSweeper.cpp in Sources */, + 10D591E01889C3DF00C05A0D /* IndexingType.cpp in Sources */, + 10D591E11889C3DF00C05A0D /* InitializeLLVM.cpp in Sources */, + 10D591E21889C3DF00C05A0D /* InitializeLLVMMac.mm in Sources */, + 10D591E31889C3DF00C05A0D /* InitializeLLVMPOSIX.cpp in Sources */, + 10D591E41889C3DF00C05A0D /* InitializeThreading.cpp in Sources */, + 10D591E51889C3DF00C05A0D /* InlineCallFrameSet.cpp in Sources */, + 10D591E61889C3DF00C05A0D /* IntendedStructureChain.cpp in Sources */, + 10D591E71889C3DF00C05A0D /* InternalFunction.cpp in Sources */, + 10D591E81889C3DF00C05A0D /* DFGStoreBarrierElisionPhase.cpp in Sources */, + 10D591E91889C3DF00C05A0D /* Interpreter.cpp in Sources */, + 10D591EA1889C3DF00C05A0D /* JIT.cpp in Sources */, + 10D591EB1889C3DF00C05A0D /* JITArithmetic.cpp in Sources */, + 10D591EC1889C3DF00C05A0D /* JITArithmetic32_64.cpp in Sources */, + 10D591ED1889C3DF00C05A0D /* JITCall.cpp in Sources */, + 10D591EE1889C3DF00C05A0D /* JITCall32_64.cpp in Sources */, + 10D591EF1889C3DF00C05A0D /* JITCode.cpp in Sources */, + 10D591F01889C3DF00C05A0D /* JITDisassembler.cpp in Sources */, + 10D591F11889C3DF00C05A0D /* JITExceptions.cpp in Sources */, + 10D591F21889C3DF00C05A0D /* JITInlineCacheGenerator.cpp in Sources */, + 10D591F31889C3DF00C05A0D /* JITOpcodes.cpp in Sources */, + 10D591F41889C3DF00C05A0D /* JITOpcodes32_64.cpp in Sources */, + 10D591F51889C3DF00C05A0D /* WriteBarrierBuffer.cpp in Sources */, + 10D591F61889C3DF00C05A0D /* JITOperations.cpp in Sources */, + 10D591F71889C3DF00C05A0D /* JITPropertyAccess.cpp in Sources */, + 10D591F81889C3DF00C05A0D /* JITPropertyAccess32_64.cpp in Sources */, + 10D591F91889C3DF00C05A0D /* JITStubRoutine.cpp in Sources */, + 10D591FA1889C3DF00C05A0D /* JITStubRoutineSet.cpp in Sources */, + 10D591FB1889C3DF00C05A0D /* JITStubs.cpp in Sources */, + 10D591FC1889C3DF00C05A0D /* JITThunks.cpp in Sources */, + 10D591FD1889C3DF00C05A0D /* JITToDFGDeferredCompilationCallback.cpp in Sources */, + 10D591FE1889C3DF00C05A0D /* JSActivation.cpp in Sources */, + 10D591FF1889C3DF00C05A0D /* JSAPIValueWrapper.cpp in Sources */, + 10D592001889C3DF00C05A0D /* JSAPIWrapperObject.mm in Sources */, + 10D592011889C3DF00C05A0D /* JSArgumentsIterator.cpp in Sources */, + 10D592021889C3DF00C05A0D /* JSArray.cpp in Sources */, + 10D592031889C3DF00C05A0D /* JSArrayBuffer.cpp in Sources */, + 10D592041889C3DF00C05A0D /* JSArrayBufferConstructor.cpp in Sources */, + 10D592051889C3DF00C05A0D /* JSArrayBufferPrototype.cpp in Sources */, + 10D592061889C3DF00C05A0D /* JSArrayBufferView.cpp in Sources */, + 10D592071889C3DF00C05A0D /* JSArrayIterator.cpp in Sources */, + 10D592081889C3DF00C05A0D /* JSBase.cpp in Sources */, + 10D592091889C3DF00C05A0D /* JSBoundFunction.cpp in Sources */, + 10D5920A1889C3DF00C05A0D /* JSCallbackConstructor.cpp in Sources */, + 10D5920B1889C3DF00C05A0D /* JSCallbackFunction.cpp in Sources */, + 10D5920C1889C3DF00C05A0D /* JSCallbackObject.cpp in Sources */, + 10D5920D1889C3DF00C05A0D /* JSCell.cpp in Sources */, + 10D5920E1889C3DF00C05A0D /* JSCJSValue.cpp in Sources */, + 10D5920F1889C3DF00C05A0D /* JSClassRef.cpp in Sources */, + 10D592101889C3DF00C05A0D /* JSContext.mm in Sources */, + 10D592111889C3DF00C05A0D /* JSContextRef.cpp in Sources */, + 10D592121889C3DF00C05A0D /* JSCTestRunnerUtils.cpp in Sources */, + 10D592131889C3DF00C05A0D /* JSDataView.cpp in Sources */, + 10D592141889C3DF00C05A0D /* JSDataViewPrototype.cpp in Sources */, + 10D592151889C3DF00C05A0D /* JSDateMath.cpp in Sources */, + 10D592161889C3DF00C05A0D /* JSFunction.cpp in Sources */, + 10D592171889C3DF00C05A0D /* JSGlobalObject.cpp in Sources */, + 10D592181889C3DF00C05A0D /* JSGlobalObjectFunctions.cpp in Sources */, + 10D592191889C3DF00C05A0D /* JSLock.cpp in Sources */, + 10D5921A1889C3DF00C05A0D /* JSManagedValue.mm in Sources */, + 10D5921B1889C3DF00C05A0D /* JSMap.cpp in Sources */, + 10D5921C1889C3DF00C05A0D /* JSNameScope.cpp in Sources */, + 10D5921D1889C3DF00C05A0D /* JSNotAnObject.cpp in Sources */, + 10D5921E1889C3DF00C05A0D /* JSObject.cpp in Sources */, + 10D5921F1889C3DF00C05A0D /* JSObjectRef.cpp in Sources */, + 10D592201889C3DF00C05A0D /* JSONObject.cpp in Sources */, + 10D592211889C3DF00C05A0D /* JSProfilerPrivate.cpp in Sources */, + 10D592221889C3DF00C05A0D /* JSPromise.cpp in Sources */, + 10D592231889C3DF00C05A0D /* JSPromiseConstructor.cpp in Sources */, + 10D592241889C3DF00C05A0D /* JSPromisePrototype.cpp in Sources */, + 10D592251889C3DF00C05A0D /* JSPropertyNameIterator.cpp in Sources */, + 10D592261889C3DF00C05A0D /* JSProxy.cpp in Sources */, + 10D592271889C3DF00C05A0D /* JSScope.cpp in Sources */, + 10D592281889C3DF00C05A0D /* JSScriptRef.cpp in Sources */, + 10D592291889C3DF00C05A0D /* JSSegmentedVariableObject.cpp in Sources */, + 10D5922A1889C3DF00C05A0D /* JSSet.cpp in Sources */, + 10D5922B1889C3DF00C05A0D /* JSStack.cpp in Sources */, + 10D5922C1889C3DF00C05A0D /* JSString.cpp in Sources */, + 10D5922D1889C3DF00C05A0D /* JSStringJoiner.cpp in Sources */, + 10D5922E1889C3DF00C05A0D /* ArrayBufferNeuteringWatchpoint.cpp in Sources */, + 10D5922F1889C3DF00C05A0D /* JSStringRef.cpp in Sources */, + 10D592301889C3DF00C05A0D /* JSStringRefCF.cpp in Sources */, + 10D592311889C3DF00C05A0D /* JSSymbolTableObject.cpp in Sources */, + 10D592321889C3DF00C05A0D /* JSTypedArrayConstructors.cpp in Sources */, + 10D592331889C3DF00C05A0D /* InspectorJSTypeBuilders.cpp in Sources */, + 10D592341889C3DF00C05A0D /* JSTypedArrayPrototypes.cpp in Sources */, + 10D592351889C3DF00C05A0D /* JSTypedArrays.cpp in Sources */, + 10D592361889C3DF00C05A0D /* JSValue.mm in Sources */, + 10D592371889C3DF00C05A0D /* JSValueRef.cpp in Sources */, + 10D592381889C3DF00C05A0D /* JSVariableObject.cpp in Sources */, + 10D592391889C3DF00C05A0D /* JSVirtualMachine.mm in Sources */, + 10D5923A1889C3DF00C05A0D /* VMEntryScope.cpp in Sources */, + 10D5923B1889C3DF00C05A0D /* JSWeakMap.cpp in Sources */, + 10D5923C1889C3DF00C05A0D /* JSWeakObjectMapRefPrivate.cpp in Sources */, + 10D5923D1889C3DF00C05A0D /* JSWithScope.cpp in Sources */, + 10D5923E1889C3DF00C05A0D /* JSWrapperMap.mm in Sources */, + 10D5923F1889C3DF00C05A0D /* JSWrapperObject.cpp in Sources */, + 10D592401889C3DF00C05A0D /* JumpTable.cpp in Sources */, + 10D592411889C3DF00C05A0D /* LazyOperandValueProfile.cpp in Sources */, + 10D592421889C3DF00C05A0D /* LegacyProfiler.cpp in Sources */, + 10D592431889C3DF00C05A0D /* Lexer.cpp in Sources */, + 10D592441889C3DF00C05A0D /* JSInjectedScriptHostPrototype.cpp in Sources */, + 10D592451889C3DF00C05A0D /* LinkBuffer.cpp in Sources */, + 10D592461889C3DF00C05A0D /* LiteralParser.cpp in Sources */, + 10D592471889C3DF00C05A0D /* LLIntCLoop.cpp in Sources */, + 10D592481889C3DF00C05A0D /* LLIntData.cpp in Sources */, + 10D592491889C3DF00C05A0D /* JSGlobalObjectInspectorController.cpp in Sources */, + 10D5924A1889C3DF00C05A0D /* LLIntEntrypoint.cpp in Sources */, + 10D5924B1889C3DF00C05A0D /* LLIntExceptions.cpp in Sources */, + 10D5924C1889C3DF00C05A0D /* LLIntSlowPaths.cpp in Sources */, + 10D5924D1889C3DF00C05A0D /* LLIntThunks.cpp in Sources */, + 10D5924E1889C3DF00C05A0D /* LLVMAPI.cpp in Sources */, + 10D5924F1889C3DF00C05A0D /* LLVMDisassembler.cpp in Sources */, + 10D592501889C3DF00C05A0D /* Lookup.cpp in Sources */, + 10D592511889C3DF00C05A0D /* LowLevelInterpreter.cpp in Sources */, + 10D592521889C3DF00C05A0D /* MachineStackMarker.cpp in Sources */, + 10D592531889C3DF00C05A0D /* RemoteInspectorDebuggable.cpp in Sources */, + 10D592541889C3DF00C05A0D /* MacroAssembler.cpp in Sources */, + 10D592551889C3DF00C05A0D /* MacroAssemblerARM.cpp in Sources */, + 10D592561889C3DF00C05A0D /* MacroAssemblerARMv7.cpp in Sources */, + 10D592571889C3DF00C05A0D /* InspectorJSBackendDispatchers.cpp in Sources */, + 10D592581889C3DF00C05A0D /* MacroAssemblerX86Common.cpp in Sources */, + 10D592591889C3DF00C05A0D /* MapConstructor.cpp in Sources */, + 10D5925A1889C3DF00C05A0D /* MapData.cpp in Sources */, + 10D5925B1889C3DF00C05A0D /* MapPrototype.cpp in Sources */, + 10D5925C1889C3DF00C05A0D /* MarkedAllocator.cpp in Sources */, + 10D5925D1889C3DF00C05A0D /* MarkedBlock.cpp in Sources */, + 10D5925E1889C3DF00C05A0D /* MarkedSpace.cpp in Sources */, + 10D5925F1889C3DF00C05A0D /* MarkStack.cpp in Sources */, + 10D592601889C3DF00C05A0D /* MathObject.cpp in Sources */, + 10D592611889C3DF00C05A0D /* MemoryStatistics.cpp in Sources */, + 10D592621889C3DF00C05A0D /* MethodOfGettingAValueProfile.cpp in Sources */, + 10D592631889C3DF00C05A0D /* NameConstructor.cpp in Sources */, + 10D592641889C3DF00C05A0D /* NameInstance.cpp in Sources */, + 10D592651889C3DF00C05A0D /* NamePrototype.cpp in Sources */, + 10D592661889C3DF00C05A0D /* ScriptObject.cpp in Sources */, + 10D592671889C3DF00C05A0D /* NativeErrorConstructor.cpp in Sources */, + 10D592681889C3DF00C05A0D /* NativeErrorPrototype.cpp in Sources */, + 10D592691889C3DF00C05A0D /* InjectedScriptManager.cpp in Sources */, + 10D5926A1889C3DF00C05A0D /* Nodes.cpp in Sources */, + 10D5926B1889C3DF00C05A0D /* NodesCodegen.cpp in Sources */, + 10D5926C1889C3DF00C05A0D /* NumberConstructor.cpp in Sources */, + 10D5926D1889C3DF00C05A0D /* NumberObject.cpp in Sources */, + 10D5926E1889C3DF00C05A0D /* NumberPrototype.cpp in Sources */, + 10D5926F1889C3DF00C05A0D /* ObjCCallbackFunction.mm in Sources */, + 10D592701889C3DF00C05A0D /* ObjectConstructor.cpp in Sources */, + 10D592711889C3DF00C05A0D /* ObjectPrototype.cpp in Sources */, + 10D592721889C3DF00C05A0D /* OpaqueJSString.cpp in Sources */, + 10D592731889C3DF00C05A0D /* Opcode.cpp in Sources */, + 10D592741889C3DF00C05A0D /* Operations.cpp in Sources */, + 10D592751889C3DF00C05A0D /* Options.cpp in Sources */, + 10D592761889C3DF00C05A0D /* DFGSSALoweringPhase.cpp in Sources */, + 10D592771889C3DF00C05A0D /* Parser.cpp in Sources */, + 10D592781889C3DF00C05A0D /* ParserArena.cpp in Sources */, + 10D592791889C3DF00C05A0D /* PolymorphicPutByIdList.cpp in Sources */, + 10D5927A1889C3DF00C05A0D /* PreciseJumpTargets.cpp in Sources */, + 10D5927B1889C3DF00C05A0D /* Profile.cpp in Sources */, + 10D5927C1889C3DF00C05A0D /* ProfiledCodeBlockJettisoningWatchpoint.cpp in Sources */, + 10D5927D1889C3DF00C05A0D /* ProfileGenerator.cpp in Sources */, + 10D5927E1889C3DF00C05A0D /* ProfileNode.cpp in Sources */, + 10D5927F1889C3DF00C05A0D /* ProfilerBytecode.cpp in Sources */, + 10D592801889C3DF00C05A0D /* ProfilerBytecodes.cpp in Sources */, + 10D592811889C3DF00C05A0D /* ProfilerBytecodeSequence.cpp in Sources */, + 10D592821889C3DF00C05A0D /* ProfilerCompilation.cpp in Sources */, + 10D592831889C3DF00C05A0D /* ProfilerCompilationKind.cpp in Sources */, + 10D592841889C3DF00C05A0D /* ProfilerCompiledBytecode.cpp in Sources */, + 10D592851889C3DF00C05A0D /* ProfilerDatabase.cpp in Sources */, + 10D592861889C3DF00C05A0D /* ProfilerOrigin.cpp in Sources */, + 10D592871889C3DF00C05A0D /* ProfilerOriginStack.cpp in Sources */, + 10D592881889C3DF00C05A0D /* BytecodeBasicBlock.cpp in Sources */, + 10D592891889C3DF00C05A0D /* DFGResurrectionForValidationPhase.cpp in Sources */, + 10D5928A1889C3DF00C05A0D /* ProfilerOSRExit.cpp in Sources */, + 10D5928B1889C3DF00C05A0D /* ProfilerOSRExitSite.cpp in Sources */, + 10D5928C1889C3DF00C05A0D /* ProfilerProfiledBytecodes.cpp in Sources */, + 10D5928D1889C3DF00C05A0D /* PropertyDescriptor.cpp in Sources */, + 10D5928E1889C3DF00C05A0D /* PropertyNameArray.cpp in Sources */, + 10D5928F1889C3DF00C05A0D /* PropertySlot.cpp in Sources */, + 10D592901889C3DF00C05A0D /* PropertyTable.cpp in Sources */, + 10D592911889C3DF00C05A0D /* PrototypeMap.cpp in Sources */, + 10D592921889C3DF00C05A0D /* PutByIdStatus.cpp in Sources */, + 10D592931889C3DF00C05A0D /* ReduceWhitespace.cpp in Sources */, + 10D592941889C3DF00C05A0D /* InspectorAgent.cpp in Sources */, + 10D592951889C3DF00C05A0D /* RegExp.cpp in Sources */, + 10D592961889C3DF00C05A0D /* RegExpCache.cpp in Sources */, + 10D592971889C3DF00C05A0D /* RegExpCachedResult.cpp in Sources */, + 10D592981889C3DF00C05A0D /* RegExpConstructor.cpp in Sources */, + 10D592991889C3DF00C05A0D /* RegExpMatchesArray.cpp in Sources */, + 10D5929A1889C3DF00C05A0D /* RegExpObject.cpp in Sources */, + 10D5929B1889C3DF00C05A0D /* RegExpPrototype.cpp in Sources */, + 10D5929C1889C3DF00C05A0D /* RegisterSet.cpp in Sources */, + 10D5929D1889C3DF00C05A0D /* Repatch.cpp in Sources */, + 10D5929E1889C3DF00C05A0D /* SamplingCounter.cpp in Sources */, + 10D5929F1889C3DF00C05A0D /* SamplingTool.cpp in Sources */, + 10D592A01889C3DF00C05A0D /* SetConstructor.cpp in Sources */, + 10D592A11889C3DF00C05A0D /* SetPrototype.cpp in Sources */, + 10D592A21889C3DF00C05A0D /* SimpleTypedArrayController.cpp in Sources */, + 10D592A31889C3DF00C05A0D /* SetIteratorPrototype.cpp in Sources */, + 10D592A41889C3DF00C05A0D /* SlotVisitor.cpp in Sources */, + 10D592A51889C3DF00C05A0D /* SmallStrings.cpp in Sources */, + 10D592A61889C3DF00C05A0D /* SourceCode.cpp in Sources */, + 10D592A71889C3DF00C05A0D /* SourceProvider.cpp in Sources */, + 10D592A81889C3DF00C05A0D /* SourceProviderCache.cpp in Sources */, + 10D592A91889C3DF00C05A0D /* SparseArrayValueMap.cpp in Sources */, + 10D592AA1889C3DF00C05A0D /* SpecialPointer.cpp in Sources */, + 10D592AB1889C3DF00C05A0D /* SpeculatedType.cpp in Sources */, + 10D592AC1889C3DF00C05A0D /* StackVisitor.cpp in Sources */, + 10D592AD1889C3DF00C05A0D /* StrictEvalActivation.cpp in Sources */, + 10D592AE1889C3DF00C05A0D /* StringConstructor.cpp in Sources */, + 10D592AF1889C3DF00C05A0D /* StringObject.cpp in Sources */, + 10D592B01889C3DF00C05A0D /* StringPrototype.cpp in Sources */, + 10D592B11889C3DF00C05A0D /* StringRecursionChecker.cpp in Sources */, + 10D592B21889C3DF00C05A0D /* Structure.cpp in Sources */, + 10D592B31889C3DF00C05A0D /* StructureChain.cpp in Sources */, + 10D592B41889C3DF00C05A0D /* StructureRareData.cpp in Sources */, + 10D592B51889C3DF00C05A0D /* StructureStubClearingWatchpoint.cpp in Sources */, + 10D592B61889C3DF00C05A0D /* StructureStubInfo.cpp in Sources */, + 10D592B71889C3DF00C05A0D /* MapIteratorConstructor.cpp in Sources */, + 10D592B81889C3DF00C05A0D /* SuperRegion.cpp in Sources */, + 10D592B91889C3DF00C05A0D /* SymbolTable.cpp in Sources */, + 10D592BA1889C3DF00C05A0D /* TempRegisterSet.cpp in Sources */, + 10D592BB1889C3DF00C05A0D /* TestRunnerUtils.cpp in Sources */, + 10D592BC1889C3DF00C05A0D /* ThunkGenerators.cpp in Sources */, + 10D592BD1889C3DF00C05A0D /* TypedArrayController.cpp in Sources */, + 10D592BE1889C3DF00C05A0D /* TypedArrayType.cpp in Sources */, + 10D592BF1889C3DF00C05A0D /* udis86.c in Sources */, + 10D592C01889C3DF00C05A0D /* udis86_decode.c in Sources */, + 10D592C11889C3DF00C05A0D /* SetIteratorConstructor.cpp in Sources */, + 10D592C21889C3DF00C05A0D /* udis86_input.c in Sources */, + 10D592C31889C3DF00C05A0D /* udis86_itab_holder.c in Sources */, + 10D592C41889C3DF00C05A0D /* udis86_syn-att.c in Sources */, + 10D592C51889C3DF00C05A0D /* udis86_syn-intel.c in Sources */, + 10D592C61889C3DF00C05A0D /* udis86_syn.c in Sources */, + 10D592C71889C3DF00C05A0D /* UDis86Disassembler.cpp in Sources */, + 10D592C81889C3DF00C05A0D /* UnlinkedCodeBlock.cpp in Sources */, + 10D592C91889C3DF00C05A0D /* ValueRecovery.cpp in Sources */, + 10D592CA1889C3DF00C05A0D /* VM.cpp in Sources */, + 10D592CB1889C3DF00C05A0D /* VMInspector.cpp in Sources */, + 10D592CC1889C3DF00C05A0D /* Watchdog.cpp in Sources */, + 10D592CD1889C3DF00C05A0D /* WatchdogMac.cpp in Sources */, + 10D592CE1889C3DF00C05A0D /* DFGAvailability.cpp in Sources */, + 10D592CF1889C3DF00C05A0D /* Watchpoint.cpp in Sources */, + 10D592D01889C3DF00C05A0D /* Weak.cpp in Sources */, + 10D592D11889C3DF00C05A0D /* WeakBlock.cpp in Sources */, + 10D592D21889C3DF00C05A0D /* WeakHandleOwner.cpp in Sources */, + 10D592D31889C3DF00C05A0D /* WeakMapConstructor.cpp in Sources */, + 10D592D41889C3DF00C05A0D /* JSInjectedScriptHost.cpp in Sources */, + 10D592D51889C3DF00C05A0D /* WeakMapData.cpp in Sources */, + 10D592D61889C3DF00C05A0D /* InjectedScriptModule.cpp in Sources */, + 10D592D71889C3DF00C05A0D /* WeakMapPrototype.cpp in Sources */, + 10D592D81889C3DF00C05A0D /* WeakSet.cpp in Sources */, + 10D592D91889C3DF00C05A0D /* WriteBarrierSupport.cpp in Sources */, + 10D592DA1889C3DF00C05A0D /* RemoteInspector.mm in Sources */, + 10D592DB1889C3DF00C05A0D /* RemoteInspectorDebuggableConnection.mm in Sources */, + 10D592DC1889C3DF00C05A0D /* RemoteInspectorXPCConnection.mm in Sources */, + 10D592DD1889C3DF00C05A0D /* X86Disassembler.cpp in Sources */, + 10D592DE1889C3DF00C05A0D /* YarrCanonicalizeUCS2.cpp in Sources */, + 10D592DF1889C3DF00C05A0D /* YarrInterpreter.cpp in Sources */, + 10D592E01889C3DF00C05A0D /* YarrJIT.cpp in Sources */, + 10D592E11889C3DF00C05A0D /* YarrPattern.cpp in Sources */, + 10D592E21889C3DF00C05A0D /* InspectorAgentRegistry.cpp in Sources */, + 10D592E31889C3DF00C05A0D /* YarrSyntaxChecker.cpp in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; 1412111D0A48793C00480255 /* Sources */ = { isa = PBXSourcesBuildPhase; buildActionMask = 2147483647; @@ -6110,6 +8837,21 @@ target = 0FF922C314F46B130041A24E /* JSCLLIntOffsetsExtractor */; targetProxy = 0FF922D514F46B600041A24E /* PBXContainerItemProxy */; }; + 10D58E021889C1A000C05A0D /* PBXTargetDependency */ = { + isa = PBXTargetDependency; + target = 0F4680A914BA7FD900BFE272 /* LLInt Offsets */; + targetProxy = 10D58E031889C1A000C05A0D /* PBXContainerItemProxy */; + }; + 10D593021889C59100C05A0D /* PBXTargetDependency */ = { + isa = PBXTargetDependency; + target = 10D58E011889C1A000C05A0D /* JSCLLIntOffsetsExtractor iOS */; + targetProxy = 10D593011889C59100C05A0D /* PBXContainerItemProxy */; + }; + 10D593041889C5DE00C05A0D /* PBXTargetDependency */ = { + isa = PBXTargetDependency; + target = 10D592F61889C55E00C05A0D /* Derived Sources iOS */; + targetProxy = 10D593031889C5DE00C05A0D /* PBXContainerItemProxy */; + }; 5D69E912152BE5470028D720 /* PBXTargetDependency */ = { isa = PBXTargetDependency; target = 932F5BDA0822A1C700736975 /* jsc */; @@ -6232,6 +8974,99 @@ }; name = Production; }; + 10D58E081889C1A000C05A0D /* Debug */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = 10EAA7001889E6C600DEB161 /* ToolExecutable-iOS-Static.xcconfig */; + buildSettings = { + PRODUCT_NAME = JSCLLIntOffsetsExtractor; + }; + name = Debug; + }; + 10D58E091889C1A000C05A0D /* Release */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = 10EAA7001889E6C600DEB161 /* ToolExecutable-iOS-Static.xcconfig */; + buildSettings = { + PRODUCT_NAME = JSCLLIntOffsetsExtractor; + }; + name = Release; + }; + 10D58E0A1889C1A000C05A0D /* Profiling */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = 10EAA7001889E6C600DEB161 /* ToolExecutable-iOS-Static.xcconfig */; + buildSettings = { + PRODUCT_NAME = JSCLLIntOffsetsExtractor; + }; + name = Profiling; + }; + 10D58E0B1889C1A000C05A0D /* Production */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = 10EAA7001889E6C600DEB161 /* ToolExecutable-iOS-Static.xcconfig */; + buildSettings = { + PRODUCT_NAME = JSCLLIntOffsetsExtractor; + }; + name = Production; + }; + 10D592F01889C3DF00C05A0D /* Debug */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = 10EAA6FF1889E6B300DEB161 /* JavaScriptCore-iOS-Static.xcconfig */; + buildSettings = { + }; + name = Debug; + }; + 10D592F11889C3DF00C05A0D /* Release */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = 10EAA6FF1889E6B300DEB161 /* JavaScriptCore-iOS-Static.xcconfig */; + buildSettings = { + }; + name = Release; + }; + 10D592F21889C3DF00C05A0D /* Profiling */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = 10EAA6FF1889E6B300DEB161 /* JavaScriptCore-iOS-Static.xcconfig */; + buildSettings = { + }; + name = Profiling; + }; + 10D592F31889C3DF00C05A0D /* Production */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = 10EAA6FF1889E6B300DEB161 /* JavaScriptCore-iOS-Static.xcconfig */; + buildSettings = { + BUILD_VARIANTS = normal; + }; + name = Production; + }; + 10D592FC1889C55E00C05A0D /* Debug */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = 10EAA6FF1889E6B300DEB161 /* JavaScriptCore-iOS-Static.xcconfig */; + buildSettings = { + PRODUCT_NAME = "Derived Sources copy"; + }; + name = Debug; + }; + 10D592FD1889C55E00C05A0D /* Release */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = 10EAA6FF1889E6B300DEB161 /* JavaScriptCore-iOS-Static.xcconfig */; + buildSettings = { + PRODUCT_NAME = "Derived Sources copy"; + }; + name = Release; + }; + 10D592FE1889C55E00C05A0D /* Profiling */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = 10EAA6FF1889E6B300DEB161 /* JavaScriptCore-iOS-Static.xcconfig */; + buildSettings = { + PRODUCT_NAME = "Derived Sources copy"; + }; + name = Profiling; + }; + 10D592FF1889C55E00C05A0D /* Production */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = 10EAA6FF1889E6B300DEB161 /* JavaScriptCore-iOS-Static.xcconfig */; + buildSettings = { + PRODUCT_NAME = "Derived Sources copy"; + }; + name = Production; + }; 1412113A0A48798400480255 /* Debug */ = { isa = XCBuildConfiguration; baseConfigurationReference = BC021BF2136900C300FC5467 /* ToolExecutable.xcconfig */; @@ -6325,6 +9160,7 @@ buildSettings = { DEAD_CODE_STRIPPING = "$(DEAD_CODE_STRIPPING_debug)"; DEBUG_DEFINES = "$(DEBUG_DEFINES_debug)"; + FEATURE_DEFINES = ""; GCC_OPTIMIZATION_LEVEL = "$(GCC_OPTIMIZATION_LEVEL_debug)"; STRIP_INSTALLED_PRODUCT = "$(STRIP_INSTALLED_PRODUCT_debug)"; }; @@ -6334,6 +9170,7 @@ isa = XCBuildConfiguration; baseConfigurationReference = 1C9051440BA9E8A70081E9D0 /* DebugRelease.xcconfig */; buildSettings = { + FEATURE_DEFINES = ""; STRIP_INSTALLED_PRODUCT = NO; }; name = Release; @@ -6342,6 +9179,7 @@ isa = XCBuildConfiguration; baseConfigurationReference = 1C9051450BA9E8A70081E9D0 /* Base.xcconfig */; buildSettings = { + FEATURE_DEFINES = ""; }; name = Production; }; @@ -6450,6 +9288,7 @@ isa = XCBuildConfiguration; baseConfigurationReference = 1C9051440BA9E8A70081E9D0 /* DebugRelease.xcconfig */; buildSettings = { + FEATURE_DEFINES = ""; STRIP_INSTALLED_PRODUCT = NO; }; name = Profiling; @@ -6534,6 +9373,39 @@ defaultConfigurationIsVisible = 0; defaultConfigurationName = Production; }; + 10D58E071889C1A000C05A0D /* Build configuration list for PBXNativeTarget "JSCLLIntOffsetsExtractor iOS" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 10D58E081889C1A000C05A0D /* Debug */, + 10D58E091889C1A000C05A0D /* Release */, + 10D58E0A1889C1A000C05A0D /* Profiling */, + 10D58E0B1889C1A000C05A0D /* Production */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Production; + }; + 10D592EF1889C3DF00C05A0D /* Build configuration list for PBXNativeTarget "JavaScriptCore iOS" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 10D592F01889C3DF00C05A0D /* Debug */, + 10D592F11889C3DF00C05A0D /* Release */, + 10D592F21889C3DF00C05A0D /* Profiling */, + 10D592F31889C3DF00C05A0D /* Production */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Production; + }; + 10D592FB1889C55E00C05A0D /* Build configuration list for PBXAggregateTarget "Derived Sources iOS" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 10D592FC1889C55E00C05A0D /* Debug */, + 10D592FD1889C55E00C05A0D /* Release */, + 10D592FE1889C55E00C05A0D /* Profiling */, + 10D592FF1889C55E00C05A0D /* Production */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Production; + }; 141211390A48798400480255 /* Build configuration list for PBXNativeTarget "minidom" */ = { isa = XCConfigurationList; buildConfigurations = ( diff --git a/ToolExecutable-iOS-Static.xcconfig b/ToolExecutable-iOS-Static.xcconfig new file mode 100644 index 00000000..25611d38 --- /dev/null +++ b/ToolExecutable-iOS-Static.xcconfig @@ -0,0 +1,12 @@ +// +// ToolExecutable-iOS-Static.xcconfig +// JavaScriptCore +// +// Created by Martijn The on 1/17/14. +// +// + +#include "ToolExecutable.xcconfig" + +PRODUCT_NAME = JSCLLIntOffsetsExtractor; +HEADER_SEARCH_PATHS = . icu "${BUILT_PRODUCTS_DIR}/usr/local/include" "${SOURCE_ROOT}/../WTF/" $(HEADER_SEARCH_PATHS); From 857f07052d420320bc2f5084e8843d3de1f5ac7c Mon Sep 17 00:00:00 2001 From: Martijn The Date: Fri, 17 Jan 2014 14:40:39 -0800 Subject: [PATCH 25/69] Fixup. JSC Builds for arm64 now. --- JavaScriptCore/API/JSWrapperMap.h | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/JavaScriptCore/API/JSWrapperMap.h b/JavaScriptCore/API/JSWrapperMap.h index c6aa1af1..c20bfb83 100644 --- a/JavaScriptCore/API/JSWrapperMap.h +++ b/JavaScriptCore/API/JSWrapperMap.h @@ -25,7 +25,12 @@ #import #import + +#if TARGET_OS_IPHONE +#import +#else #import +#endif #if JSC_OBJC_API_ENABLED From 57cb54d4c153703729306dde76f53d756a371db2 Mon Sep 17 00:00:00 2001 From: Martijn The Date: Fri, 17 Jan 2014 14:52:00 -0800 Subject: [PATCH 26/69] =?UTF-8?q?-=20Added=20xcconfig=20with=20phoboslabs?= =?UTF-8?q?=E2=80=99=20build=20settings=20for=20WTF=20-=20Duped=20WTF=20pr?= =?UTF-8?q?oject=20with=20new=20xcconfig=20-=20Removed=20SizeLimits.cpp,?= =?UTF-8?q?=20this=20breaks=20the=20build=20(WTF!=3F!=20It=E2=80=99s=20rem?= =?UTF-8?q?oved=20in=20webkit.org=20@=20rev=20161999)=20-=20Applied=20Coll?= =?UTF-8?q?ator=20patch=20from=20phoboslabs.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- WTF-iOS-Static.xcconfig | 17 + WTF/WTF.xcodeproj/project.pbxproj | 591 ++++++++++++++++++++++++++++++ WTF/wtf/SizeLimits.cpp | 84 ----- WTF/wtf/unicode/Collator.h | 3 + 4 files changed, 611 insertions(+), 84 deletions(-) create mode 100644 WTF-iOS-Static.xcconfig delete mode 100644 WTF/wtf/SizeLimits.cpp diff --git a/WTF-iOS-Static.xcconfig b/WTF-iOS-Static.xcconfig new file mode 100644 index 00000000..d38ff2cf --- /dev/null +++ b/WTF-iOS-Static.xcconfig @@ -0,0 +1,17 @@ +// +// WTF-iOS-Static.xcconfig +// WTF +// +// Created by Martijn The on 1/17/14. +// +// + +#include "WTF.xcconfig" + +PRODUCT_NAME = WTF +ARCHS = arm64 armv7 +ONLY_ACTIVE_ARCH = NO +SDKROOT = iphoneos +SUPPORTED_PLATFORMS = iphoneos iphonesimulator +IPHONEOS_DEPLOYMENT_TARGET = 5.1 +GCC_PREPROCESSOR_DEFINITIONS = $(DEBUG_DEFINES) WEBKIT_VERSION_MIN_REQUIRED=WEBKIT_VERSION_LATEST HAVE_HEADER_DETECTION_H $(GCC_PREPROCESSOR_DEFINITIONS) TARGET_OS_IPHONE __MAC_OS_X_VERSION_MIN_REQUIRED=0 UCONFIG_NO_COLLATION=1 diff --git a/WTF/WTF.xcodeproj/project.pbxproj b/WTF/WTF.xcodeproj/project.pbxproj index 8063eba5..303f6640 100644 --- a/WTF/WTF.xcodeproj/project.pbxproj +++ b/WTF/WTF.xcodeproj/project.pbxproj @@ -40,6 +40,258 @@ 0FD81AC5154FB22E00983E72 /* FastBitVector.h in Headers */ = {isa = PBXBuildFile; fileRef = 0FD81AC4154FB22E00983E72 /* FastBitVector.h */; settings = {ATTRIBUTES = (); }; }; 0FDDBFA71666DFA300C55FEF /* StringPrintStream.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 0FDDBFA51666DFA300C55FEF /* StringPrintStream.cpp */; }; 0FDDBFA81666DFA300C55FEF /* StringPrintStream.h in Headers */ = {isa = PBXBuildFile; fileRef = 0FDDBFA61666DFA300C55FEF /* StringPrintStream.h */; }; + 10EAA7061889E93100DEB161 /* Assertions.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A8A4725B151A825A004123FF /* Assertions.cpp */; }; + 10EAA7071889E93100DEB161 /* AtomicString.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A8A4731D151A825B004123FF /* AtomicString.cpp */; }; + 10EAA7081889E93100DEB161 /* AtomicStringTable.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 9BC70F04176C379D00101DEC /* AtomicStringTable.cpp */; }; + 10EAA7091889E93100DEB161 /* StringCF.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A5BA15F8182435A600A82E69 /* StringCF.cpp */; }; + 10EAA70A1889E93100DEB161 /* AutodrainedPoolMac.mm in Sources */ = {isa = PBXBuildFile; fileRef = 1469419B16EAB10A0024E146 /* AutodrainedPoolMac.mm */; }; + 10EAA70B1889E93100DEB161 /* Base64.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 8134013615B092FD001FF0B8 /* Base64.cpp */; }; + 10EAA70C1889E93100DEB161 /* bignum-dtoa.cc in Sources */ = {isa = PBXBuildFile; fileRef = A8A47282151A825A004123FF /* bignum-dtoa.cc */; }; + 10EAA70D1889E93100DEB161 /* bignum.cc in Sources */ = {isa = PBXBuildFile; fileRef = A8A47284151A825A004123FF /* bignum.cc */; }; + 10EAA70E1889E93100DEB161 /* BinarySemaphore.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A8A4733A151A825B004123FF /* BinarySemaphore.cpp */; }; + 10EAA70F1889E93100DEB161 /* BitVector.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A8A47260151A825A004123FF /* BitVector.cpp */; }; + 10EAA7101889E93100DEB161 /* cached-powers.cc in Sources */ = {isa = PBXBuildFile; fileRef = A8A47286151A825A004123FF /* cached-powers.cc */; }; + 10EAA7111889E93100DEB161 /* CollatorDefault.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A8A4734B151A825B004123FF /* CollatorDefault.cpp */; }; + 10EAA7121889E93100DEB161 /* CollatorICU.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A8A47350151A825B004123FF /* CollatorICU.cpp */; }; + 10EAA7131889E93100DEB161 /* CompilationThread.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 0F8F2B8F172E00F0007DBDA5 /* CompilationThread.cpp */; }; + 10EAA7141889E93100DEB161 /* Compression.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A7E643C417C5423B003BB16B /* Compression.cpp */; }; + 10EAA7151889E93100DEB161 /* CryptographicallyRandomNumber.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A8A47273151A825A004123FF /* CryptographicallyRandomNumber.cpp */; }; + 10EAA7161889E93100DEB161 /* CString.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A8A47321151A825B004123FF /* CString.cpp */; }; + 10EAA7171889E93100DEB161 /* CurrentTime.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A8A47275151A825A004123FF /* CurrentTime.cpp */; }; + 10EAA7181889E93100DEB161 /* DataLog.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A8A47277151A825A004123FF /* DataLog.cpp */; }; + 10EAA7191889E93100DEB161 /* DateMath.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A8A47279151A825A004123FF /* DateMath.cpp */; }; + 10EAA71A1889E93100DEB161 /* DecimalNumber.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A8A4727B151A825A004123FF /* DecimalNumber.cpp */; }; + 10EAA71B1889E93100DEB161 /* diy-fp.cc in Sources */ = {isa = PBXBuildFile; fileRef = A8A47289151A825A004123FF /* diy-fp.cc */; }; + 10EAA71C1889E93100DEB161 /* double-conversion.cc in Sources */ = {isa = PBXBuildFile; fileRef = A8A4728B151A825A004123FF /* double-conversion.cc */; }; + 10EAA71D1889E93100DEB161 /* dtoa.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A8A47297151A825A004123FF /* dtoa.cpp */; }; + 10EAA71E1889E93100DEB161 /* FastBitVector.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 0F885E0E1845AE9F00F1E3FA /* FastBitVector.cpp */; }; + 10EAA71F1889E93100DEB161 /* DynamicAnnotations.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A8A47299151A825A004123FF /* DynamicAnnotations.cpp */; }; + 10EAA7201889E93100DEB161 /* fast-dtoa.cc in Sources */ = {isa = PBXBuildFile; fileRef = A8A4728E151A825A004123FF /* fast-dtoa.cc */; }; + 10EAA7211889E93100DEB161 /* FastMalloc.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A8A472A1151A825A004123FF /* FastMalloc.cpp */; }; + 10EAA7221889E93100DEB161 /* StringImplCF.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A5BA15F9182435A600A82E69 /* StringImplCF.cpp */; }; + 10EAA7231889E93100DEB161 /* AtomicStringCF.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A5BA15F7182435A600A82E69 /* AtomicStringCF.cpp */; }; + 10EAA7241889E93100DEB161 /* FilePrintStream.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 0F9D335B165DBA73005AD387 /* FilePrintStream.cpp */; }; + 10EAA7251889E93100DEB161 /* fixed-dtoa.cc in Sources */ = {isa = PBXBuildFile; fileRef = A8A47290151A825A004123FF /* fixed-dtoa.cc */; }; + 10EAA7261889E93100DEB161 /* FunctionDispatcher.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A1D8B9D1731879800141DA4 /* FunctionDispatcher.cpp */; }; + 10EAA7271889E93100DEB161 /* GregorianDateTime.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 2CCD892915C0390200285083 /* GregorianDateTime.cpp */; }; + 10EAA7281889E93100DEB161 /* HashTable.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A8A472B8151A825A004123FF /* HashTable.cpp */; }; + 10EAA7291889E93100DEB161 /* MainThread.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A8A472C6151A825A004123FF /* MainThread.cpp */; }; + 10EAA72A1889E93100DEB161 /* MainThreadMac.mm in Sources */ = {isa = PBXBuildFile; fileRef = A8A472C5151A825A004123FF /* MainThreadMac.mm */; }; + 10EAA72B1889E93100DEB161 /* MD5.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A8A472CA151A825B004123FF /* MD5.cpp */; }; + 10EAA72C1889E93100DEB161 /* MediaTime.cpp in Sources */ = {isa = PBXBuildFile; fileRef = CD5497AA15857D0300B5BC30 /* MediaTime.cpp */; }; + 10EAA72D1889E93100DEB161 /* MetaAllocator.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A8A472CD151A825B004123FF /* MetaAllocator.cpp */; }; + 10EAA72E1889E93100DEB161 /* NumberOfCores.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A8A472D5151A825B004123FF /* NumberOfCores.cpp */; }; + 10EAA72F1889E93100DEB161 /* OSAllocatorPosix.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A8A472D8151A825B004123FF /* OSAllocatorPosix.cpp */; }; + 10EAA7301889E93100DEB161 /* OSRandomSource.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A8A472DA151A825B004123FF /* OSRandomSource.cpp */; }; + 10EAA7311889E93100DEB161 /* PageAllocationAligned.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A8A472E1151A825B004123FF /* PageAllocationAligned.cpp */; }; + 10EAA7321889E93100DEB161 /* PageBlock.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A8A472E3151A825B004123FF /* PageBlock.cpp */; }; + 10EAA7331889E93100DEB161 /* PrintStream.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 0F9D335D165DBA73005AD387 /* PrintStream.cpp */; }; + 10EAA7341889E93100DEB161 /* StringImplMac.mm in Sources */ = {isa = PBXBuildFile; fileRef = A5BA15F41824348000A82E69 /* StringImplMac.mm */; }; + 10EAA7351889E93100DEB161 /* RAMSize.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 143F611D1565F0F900DB514A /* RAMSize.cpp */; }; + 10EAA7361889E93100DEB161 /* RandomNumber.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A8A472FB151A825B004123FF /* RandomNumber.cpp */; }; + 10EAA7371889E93100DEB161 /* RefCountedLeakCounter.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A8A47301151A825B004123FF /* RefCountedLeakCounter.cpp */; }; + 10EAA7381889E93100DEB161 /* RunLoop.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 2CDED0F118115C85004DBA70 /* RunLoop.cpp */; }; + 10EAA7391889E93100DEB161 /* RunLoopCF.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 2CDED0EE18115C38004DBA70 /* RunLoopCF.cpp */; }; + 10EAA73A1889E93100DEB161 /* RunLoopTimerCF.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1469419116EAAF6D0024E146 /* RunLoopTimerCF.cpp */; }; + 10EAA73B1889E93100DEB161 /* SchedulePairCF.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1469419816EAB0410024E146 /* SchedulePairCF.cpp */; }; + 10EAA73C1889E93100DEB161 /* StringMac.mm in Sources */ = {isa = PBXBuildFile; fileRef = A5BA15F2182433A900A82E69 /* StringMac.mm */; }; + 10EAA73D1889E93100DEB161 /* SchedulePairMac.mm in Sources */ = {isa = PBXBuildFile; fileRef = 1469419516EAAFF80024E146 /* SchedulePairMac.mm */; }; + 10EAA73E1889E93100DEB161 /* SHA1.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A8A47308151A825B004123FF /* SHA1.cpp */; }; + 10EAA73F1889E93100DEB161 /* SixCharacterHash.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A748744F17A0BDAE00FA04CB /* SixCharacterHash.cpp */; }; + 10EAA7411889E93100DEB161 /* StackBounds.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A8A4730E151A825B004123FF /* StackBounds.cpp */; }; + 10EAA7421889E93100DEB161 /* StackStats.cpp in Sources */ = {isa = PBXBuildFile; fileRef = FEDACD3B1630F83F00C69634 /* StackStats.cpp */; }; + 10EAA7431889E93100DEB161 /* StringBuilder.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A8A47324151A825B004123FF /* StringBuilder.cpp */; }; + 10EAA7441889E93100DEB161 /* StringImpl.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A8A47328151A825B004123FF /* StringImpl.cpp */; }; + 10EAA7451889E93100DEB161 /* StringPrintStream.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 0FDDBFA51666DFA300C55FEF /* StringPrintStream.cpp */; }; + 10EAA7461889E93100DEB161 /* StringStatics.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A8A4732B151A825B004123FF /* StringStatics.cpp */; }; + 10EAA7471889E93100DEB161 /* strtod.cc in Sources */ = {isa = PBXBuildFile; fileRef = A8A47294151A825A004123FF /* strtod.cc */; }; + 10EAA7481889E93100DEB161 /* TCSystemAlloc.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A8A47318151A825B004123FF /* TCSystemAlloc.cpp */; }; + 10EAA7491889E93100DEB161 /* ThreadIdentifierDataPthreads.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A8A47330151A825B004123FF /* ThreadIdentifierDataPthreads.cpp */; }; + 10EAA74A1889E93100DEB161 /* DeprecatedSymbolsUsedBySafari.mm in Sources */ = {isa = PBXBuildFile; fileRef = 1ACADD821884480100D8B71D /* DeprecatedSymbolsUsedBySafari.mm */; }; + 10EAA74B1889E93100DEB161 /* Threading.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A8A47332151A825B004123FF /* Threading.cpp */; }; + 10EAA74C1889E93100DEB161 /* ThreadingPthreads.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A8A47336151A825B004123FF /* ThreadingPthreads.cpp */; }; + 10EAA74D1889E93100DEB161 /* UTF8.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A8A47357151A825B004123FF /* UTF8.cpp */; }; + 10EAA74E1889E93100DEB161 /* WebCoreThread.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1FA47C88152502DA00568D1B /* WebCoreThread.cpp */; }; + 10EAA74F1889E93100DEB161 /* WTFString.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A8A4732D151A825B004123FF /* WTFString.cpp */; }; + 10EAA7501889E93100DEB161 /* WTFThreadData.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A8A4737A151A825B004123FF /* WTFThreadData.cpp */; }; + 10EAA7531889E93100DEB161 /* ASCIICType.h in Headers */ = {isa = PBXBuildFile; fileRef = A8A4725A151A825A004123FF /* ASCIICType.h */; }; + 10EAA7541889E93100DEB161 /* ASCIIFastPath.h in Headers */ = {isa = PBXBuildFile; fileRef = A8A4731C151A825B004123FF /* ASCIIFastPath.h */; }; + 10EAA7551889E93100DEB161 /* Assertions.h in Headers */ = {isa = PBXBuildFile; fileRef = A8A4725C151A825A004123FF /* Assertions.h */; }; + 10EAA7561889E93100DEB161 /* Atomics.h in Headers */ = {isa = PBXBuildFile; fileRef = A8A4725D151A825A004123FF /* Atomics.h */; }; + 10EAA7571889E93100DEB161 /* AtomicString.h in Headers */ = {isa = PBXBuildFile; fileRef = A8A4731E151A825B004123FF /* AtomicString.h */; }; + 10EAA7581889E93100DEB161 /* IteratorAdaptors.h in Headers */ = {isa = PBXBuildFile; fileRef = 7CDD7FF7186D291E007433CD /* IteratorAdaptors.h */; }; + 10EAA7591889E93100DEB161 /* AtomicStringHash.h in Headers */ = {isa = PBXBuildFile; fileRef = A8A4731F151A825B004123FF /* AtomicStringHash.h */; }; + 10EAA75A1889E93100DEB161 /* AtomicStringImpl.h in Headers */ = {isa = PBXBuildFile; fileRef = A8A47320151A825B004123FF /* AtomicStringImpl.h */; }; + 10EAA75B1889E93100DEB161 /* AtomicStringTable.h in Headers */ = {isa = PBXBuildFile; fileRef = 9BD8F40A176C2AD80002D865 /* AtomicStringTable.h */; }; + 10EAA75C1889E93100DEB161 /* AutodrainedPool.h in Headers */ = {isa = PBXBuildFile; fileRef = 1469419A16EAB10A0024E146 /* AutodrainedPool.h */; }; + 10EAA75D1889E93100DEB161 /* AVLTree.h in Headers */ = {isa = PBXBuildFile; fileRef = A8A4725E151A825A004123FF /* AVLTree.h */; }; + 10EAA75E1889E93100DEB161 /* Base64.h in Headers */ = {isa = PBXBuildFile; fileRef = 8134013715B092FD001FF0B8 /* Base64.h */; }; + 10EAA75F1889E93100DEB161 /* bignum-dtoa.h in Headers */ = {isa = PBXBuildFile; fileRef = A8A47283151A825A004123FF /* bignum-dtoa.h */; }; + 10EAA7601889E93100DEB161 /* bignum.h in Headers */ = {isa = PBXBuildFile; fileRef = A8A47285151A825A004123FF /* bignum.h */; }; + 10EAA7611889E93100DEB161 /* IteratorRange.h in Headers */ = {isa = PBXBuildFile; fileRef = 7CDD7FF9186D2A54007433CD /* IteratorRange.h */; }; + 10EAA7621889E93100DEB161 /* BinarySemaphore.h in Headers */ = {isa = PBXBuildFile; fileRef = A8A4733B151A825B004123FF /* BinarySemaphore.h */; }; + 10EAA7631889E93100DEB161 /* Bitmap.h in Headers */ = {isa = PBXBuildFile; fileRef = A8A4725F151A825A004123FF /* Bitmap.h */; }; + 10EAA7641889E93100DEB161 /* BitVector.h in Headers */ = {isa = PBXBuildFile; fileRef = A8A47261151A825A004123FF /* BitVector.h */; }; + 10EAA7651889E93100DEB161 /* BlockStack.h in Headers */ = {isa = PBXBuildFile; fileRef = A8A47264151A825A004123FF /* BlockStack.h */; }; + 10EAA7661889E93100DEB161 /* BloomFilter.h in Headers */ = {isa = PBXBuildFile; fileRef = A8A47265151A825A004123FF /* BloomFilter.h */; }; + 10EAA7671889E93100DEB161 /* BoundsCheckedPointer.h in Headers */ = {isa = PBXBuildFile; fileRef = A8A47266151A825A004123FF /* BoundsCheckedPointer.h */; }; + 10EAA7681889E93100DEB161 /* BumpPointerAllocator.h in Headers */ = {isa = PBXBuildFile; fileRef = A8A47267151A825A004123FF /* BumpPointerAllocator.h */; }; + 10EAA7691889E93100DEB161 /* ByteOrder.h in Headers */ = {isa = PBXBuildFile; fileRef = EB95E1EF161A72410089A2F5 /* ByteOrder.h */; }; + 10EAA76A1889E93100DEB161 /* cached-powers.h in Headers */ = {isa = PBXBuildFile; fileRef = A8A47287151A825A004123FF /* cached-powers.h */; }; + 10EAA76B1889E93100DEB161 /* CharacterNames.h in Headers */ = {isa = PBXBuildFile; fileRef = A8A47349151A825B004123FF /* CharacterNames.h */; }; + 10EAA76C1889E93100DEB161 /* CheckedArithmetic.h in Headers */ = {isa = PBXBuildFile; fileRef = A8A4726A151A825A004123FF /* CheckedArithmetic.h */; }; + 10EAA76D1889E93100DEB161 /* CheckedBoolean.h in Headers */ = {isa = PBXBuildFile; fileRef = A8A4726B151A825A004123FF /* CheckedBoolean.h */; }; + 10EAA76E1889E93100DEB161 /* Collator.h in Headers */ = {isa = PBXBuildFile; fileRef = A8A4734A151A825B004123FF /* Collator.h */; }; + 10EAA76F1889E93100DEB161 /* CommaPrinter.h in Headers */ = {isa = PBXBuildFile; fileRef = 0FC4EDE51696149600F65041 /* CommaPrinter.h */; }; + 10EAA7701889E93100DEB161 /* CompilationThread.h in Headers */ = {isa = PBXBuildFile; fileRef = 0F8F2B90172E00F0007DBDA5 /* CompilationThread.h */; }; + 10EAA7711889E93100DEB161 /* Compiler.h in Headers */ = {isa = PBXBuildFile; fileRef = A8A47270151A825A004123FF /* Compiler.h */; }; + 10EAA7721889E93100DEB161 /* Compression.h in Headers */ = {isa = PBXBuildFile; fileRef = A7E643C517C5423B003BB16B /* Compression.h */; }; + 10EAA7731889E93100DEB161 /* config.h in Headers */ = {isa = PBXBuildFile; fileRef = A8A4748B151A8264004123FF /* config.h */; }; + 10EAA7741889E93100DEB161 /* ConversionMode.h in Headers */ = {isa = PBXBuildFile; fileRef = 0F8F2B9B172F2594007DBDA5 /* ConversionMode.h */; }; + 10EAA7751889E93100DEB161 /* CryptographicallyRandomNumber.h in Headers */ = {isa = PBXBuildFile; fileRef = A8A47274151A825A004123FF /* CryptographicallyRandomNumber.h */; }; + 10EAA7761889E93100DEB161 /* CString.h in Headers */ = {isa = PBXBuildFile; fileRef = A8A47322151A825B004123FF /* CString.h */; }; + 10EAA7771889E93100DEB161 /* CurrentTime.h in Headers */ = {isa = PBXBuildFile; fileRef = A8A47276151A825A004123FF /* CurrentTime.h */; }; + 10EAA7781889E93100DEB161 /* DataLog.h in Headers */ = {isa = PBXBuildFile; fileRef = A8A47278151A825A004123FF /* DataLog.h */; }; + 10EAA7791889E93100DEB161 /* DateMath.h in Headers */ = {isa = PBXBuildFile; fileRef = A8A4727A151A825A004123FF /* DateMath.h */; }; + 10EAA77A1889E93100DEB161 /* DecimalNumber.h in Headers */ = {isa = PBXBuildFile; fileRef = A8A4727C151A825A004123FF /* DecimalNumber.h */; }; + 10EAA77B1889E93100DEB161 /* Decoder.h in Headers */ = {isa = PBXBuildFile; fileRef = A8A4727D151A825A004123FF /* Decoder.h */; }; + 10EAA77C1889E93100DEB161 /* DeferrableRefCounted.h in Headers */ = {isa = PBXBuildFile; fileRef = 0F2B66A417B6B4F700A7AE3F /* DeferrableRefCounted.h */; }; + 10EAA77D1889E93100DEB161 /* Deque.h in Headers */ = {isa = PBXBuildFile; fileRef = A8A4727E151A825A004123FF /* Deque.h */; }; + 10EAA77E1889E93100DEB161 /* DisallowCType.h in Headers */ = {isa = PBXBuildFile; fileRef = A8A4727F151A825A004123FF /* DisallowCType.h */; }; + 10EAA77F1889E93100DEB161 /* diy-fp.h in Headers */ = {isa = PBXBuildFile; fileRef = A8A4728A151A825A004123FF /* diy-fp.h */; }; + 10EAA7801889E93100DEB161 /* double-conversion.h in Headers */ = {isa = PBXBuildFile; fileRef = A8A4728C151A825A004123FF /* double-conversion.h */; }; + 10EAA7811889E93100DEB161 /* double.h in Headers */ = {isa = PBXBuildFile; fileRef = A8A4728D151A825A004123FF /* double.h */; }; + 10EAA7821889E93100DEB161 /* DoublyLinkedList.h in Headers */ = {isa = PBXBuildFile; fileRef = A8A47280151A825A004123FF /* DoublyLinkedList.h */; }; + 10EAA7831889E93100DEB161 /* dtoa.h in Headers */ = {isa = PBXBuildFile; fileRef = A8A47298151A825A004123FF /* dtoa.h */; }; + 10EAA7841889E93100DEB161 /* DynamicAnnotations.h in Headers */ = {isa = PBXBuildFile; fileRef = A8A4729A151A825A004123FF /* DynamicAnnotations.h */; }; + 10EAA7851889E93100DEB161 /* Encoder.h in Headers */ = {isa = PBXBuildFile; fileRef = A8A4729E151A825A004123FF /* Encoder.h */; }; + 10EAA7861889E93100DEB161 /* ExportMacros.h in Headers */ = {isa = PBXBuildFile; fileRef = A8A4729F151A825A004123FF /* ExportMacros.h */; }; + 10EAA7871889E93100DEB161 /* fast-dtoa.h in Headers */ = {isa = PBXBuildFile; fileRef = A8A4728F151A825A004123FF /* fast-dtoa.h */; }; + 10EAA7881889E93100DEB161 /* FastBitVector.h in Headers */ = {isa = PBXBuildFile; fileRef = 0FD81AC4154FB22E00983E72 /* FastBitVector.h */; settings = {ATTRIBUTES = (); }; }; + 10EAA7891889E93100DEB161 /* FastMalloc.h in Headers */ = {isa = PBXBuildFile; fileRef = A8A472A2151A825A004123FF /* FastMalloc.h */; }; + 10EAA78A1889E93100DEB161 /* FeatureDefines.h in Headers */ = {isa = PBXBuildFile; fileRef = B38FD7BC168953E80065C969 /* FeatureDefines.h */; }; + 10EAA78B1889E93100DEB161 /* FilePrintStream.h in Headers */ = {isa = PBXBuildFile; fileRef = 0F9D335C165DBA73005AD387 /* FilePrintStream.h */; }; + 10EAA78C1889E93100DEB161 /* fixed-dtoa.h in Headers */ = {isa = PBXBuildFile; fileRef = A8A47291151A825A004123FF /* fixed-dtoa.h */; }; + 10EAA78D1889E93100DEB161 /* FlipBytes.h in Headers */ = {isa = PBXBuildFile; fileRef = 0F2B66A517B6B4F700A7AE3F /* FlipBytes.h */; }; + 10EAA78E1889E93100DEB161 /* Forward.h in Headers */ = {isa = PBXBuildFile; fileRef = A8A472A6151A825A004123FF /* Forward.h */; }; + 10EAA78F1889E93100DEB161 /* Functional.h in Headers */ = {isa = PBXBuildFile; fileRef = A8A472A7151A825A004123FF /* Functional.h */; }; + 10EAA7901889E93100DEB161 /* FunctionDispatcher.h in Headers */ = {isa = PBXBuildFile; fileRef = 1A1D8B9B173186CE00141DA4 /* FunctionDispatcher.h */; }; + 10EAA7911889E93100DEB161 /* GetPtr.h in Headers */ = {isa = PBXBuildFile; fileRef = A8A472A8151A825A004123FF /* GetPtr.h */; }; + 10EAA7921889E93100DEB161 /* GregorianDateTime.h in Headers */ = {isa = PBXBuildFile; fileRef = 2C05385315BC819000F21B96 /* GregorianDateTime.h */; }; + 10EAA7931889E93100DEB161 /* HashCountedSet.h in Headers */ = {isa = PBXBuildFile; fileRef = A8A472B3151A825A004123FF /* HashCountedSet.h */; }; + 10EAA7941889E93100DEB161 /* HashFunctions.h in Headers */ = {isa = PBXBuildFile; fileRef = A8A472B4151A825A004123FF /* HashFunctions.h */; }; + 10EAA7951889E93100DEB161 /* HashIterators.h in Headers */ = {isa = PBXBuildFile; fileRef = A8A472B5151A825A004123FF /* HashIterators.h */; }; + 10EAA7961889E93100DEB161 /* HashMap.h in Headers */ = {isa = PBXBuildFile; fileRef = A8A472B6151A825A004123FF /* HashMap.h */; }; + 10EAA7971889E93100DEB161 /* MallocPtr.h in Headers */ = {isa = PBXBuildFile; fileRef = 1A233C7C17DAA6E300A93ACF /* MallocPtr.h */; }; + 10EAA7981889E93100DEB161 /* HashSet.h in Headers */ = {isa = PBXBuildFile; fileRef = A8A472B7151A825A004123FF /* HashSet.h */; }; + 10EAA7991889E93100DEB161 /* HashTable.h in Headers */ = {isa = PBXBuildFile; fileRef = A8A472B9151A825A004123FF /* HashTable.h */; }; + 10EAA79A1889E93100DEB161 /* HashTraits.h in Headers */ = {isa = PBXBuildFile; fileRef = A8A472BA151A825A004123FF /* HashTraits.h */; }; + 10EAA79B1889E93100DEB161 /* HexNumber.h in Headers */ = {isa = PBXBuildFile; fileRef = A8A472BB151A825A004123FF /* HexNumber.h */; }; + 10EAA79C1889E93100DEB161 /* InlineASM.h in Headers */ = {isa = PBXBuildFile; fileRef = A8A472BC151A825A004123FF /* InlineASM.h */; }; + 10EAA79D1889E93100DEB161 /* Ref.h in Headers */ = {isa = PBXBuildFile; fileRef = 26299B6D17A9E5B800ADEBE5 /* Ref.h */; }; + 10EAA79E1889E93100DEB161 /* Insertion.h in Headers */ = {isa = PBXBuildFile; fileRef = A70DA0821799F04D00529A9B /* Insertion.h */; }; + 10EAA79F1889E93100DEB161 /* IntegerToStringConversion.h in Headers */ = {isa = PBXBuildFile; fileRef = 26147B0815DDCCDC00DDB907 /* IntegerToStringConversion.h */; }; + 10EAA7A01889E93100DEB161 /* ListDump.h in Headers */ = {isa = PBXBuildFile; fileRef = A70DA0831799F04D00529A9B /* ListDump.h */; }; + 10EAA7A11889E93100DEB161 /* ListHashSet.h in Headers */ = {isa = PBXBuildFile; fileRef = A8A472C1151A825A004123FF /* ListHashSet.h */; }; + 10EAA7A21889E93100DEB161 /* Locker.h in Headers */ = {isa = PBXBuildFile; fileRef = A8A472C3151A825A004123FF /* Locker.h */; }; + 10EAA7A31889E93100DEB161 /* MainThread.h in Headers */ = {isa = PBXBuildFile; fileRef = A8A472C7151A825B004123FF /* MainThread.h */; }; + 10EAA7A41889E93100DEB161 /* MathExtras.h in Headers */ = {isa = PBXBuildFile; fileRef = A8A472C9151A825B004123FF /* MathExtras.h */; }; + 10EAA7A51889E93100DEB161 /* PassRef.h in Headers */ = {isa = PBXBuildFile; fileRef = 93B1AA7F180E5AF3004A2F05 /* PassRef.h */; }; + 10EAA7A61889E93100DEB161 /* MD5.h in Headers */ = {isa = PBXBuildFile; fileRef = A8A472CB151A825B004123FF /* MD5.h */; }; + 10EAA7A71889E93100DEB161 /* MediaTime.h in Headers */ = {isa = PBXBuildFile; fileRef = CD5497AB15857D0300B5BC30 /* MediaTime.h */; }; + 10EAA7A81889E93100DEB161 /* MessageQueue.h in Headers */ = {isa = PBXBuildFile; fileRef = A8A472CC151A825B004123FF /* MessageQueue.h */; }; + 10EAA7A91889E93100DEB161 /* MetaAllocator.h in Headers */ = {isa = PBXBuildFile; fileRef = A8A472CE151A825B004123FF /* MetaAllocator.h */; }; + 10EAA7AA1889E93100DEB161 /* MetaAllocatorHandle.h in Headers */ = {isa = PBXBuildFile; fileRef = A8A472CF151A825B004123FF /* MetaAllocatorHandle.h */; }; + 10EAA7AB1889E93100DEB161 /* NoLock.h in Headers */ = {isa = PBXBuildFile; fileRef = 0F0D85B317234CB100338210 /* NoLock.h */; }; + 10EAA7AC1889E93100DEB161 /* Noncopyable.h in Headers */ = {isa = PBXBuildFile; fileRef = A8A472D0151A825B004123FF /* Noncopyable.h */; }; + 10EAA7AD1889E93100DEB161 /* NumberOfCores.h in Headers */ = {isa = PBXBuildFile; fileRef = A8A472D6151A825B004123FF /* NumberOfCores.h */; }; + 10EAA7AE1889E93100DEB161 /* ObjcRuntimeExtras.h in Headers */ = {isa = PBXBuildFile; fileRef = 7E29C33D15FFD79B00516D61 /* ObjcRuntimeExtras.h */; }; + 10EAA7AF1889E93100DEB161 /* OSAllocator.h in Headers */ = {isa = PBXBuildFile; fileRef = A8A472D7151A825B004123FF /* OSAllocator.h */; }; + 10EAA7B01889E93100DEB161 /* OSRandomSource.h in Headers */ = {isa = PBXBuildFile; fileRef = A8A472DB151A825B004123FF /* OSRandomSource.h */; }; + 10EAA7B11889E93100DEB161 /* OwnPtr.h in Headers */ = {isa = PBXBuildFile; fileRef = A8A472DD151A825B004123FF /* OwnPtr.h */; }; + 10EAA7B21889E93100DEB161 /* OwnPtrCommon.h in Headers */ = {isa = PBXBuildFile; fileRef = A8A472DE151A825B004123FF /* OwnPtrCommon.h */; }; + 10EAA7B31889E93100DEB161 /* BagToHashMap.h in Headers */ = {isa = PBXBuildFile; fileRef = 0FB14E1A1810E1DA009B6B4D /* BagToHashMap.h */; }; + 10EAA7B41889E93100DEB161 /* PackedIntVector.h in Headers */ = {isa = PBXBuildFile; fileRef = A8A472DF151A825B004123FF /* PackedIntVector.h */; }; + 10EAA7B51889E93100DEB161 /* PageAllocation.h in Headers */ = {isa = PBXBuildFile; fileRef = A8A472E0151A825B004123FF /* PageAllocation.h */; }; + 10EAA7B61889E93100DEB161 /* PageAllocationAligned.h in Headers */ = {isa = PBXBuildFile; fileRef = A8A472E2151A825B004123FF /* PageAllocationAligned.h */; }; + 10EAA7B71889E93100DEB161 /* PageBlock.h in Headers */ = {isa = PBXBuildFile; fileRef = A8A472E4151A825B004123FF /* PageBlock.h */; }; + 10EAA7B81889E93100DEB161 /* PageReservation.h in Headers */ = {isa = PBXBuildFile; fileRef = A8A472E5151A825B004123FF /* PageReservation.h */; }; + 10EAA7B91889E93100DEB161 /* ParallelJobs.h in Headers */ = {isa = PBXBuildFile; fileRef = A8A472E6151A825B004123FF /* ParallelJobs.h */; }; + 10EAA7BA1889E93100DEB161 /* ParallelJobsLibdispatch.h in Headers */ = {isa = PBXBuildFile; fileRef = A8A472E9151A825B004123FF /* ParallelJobsLibdispatch.h */; }; + 10EAA7BB1889E93100DEB161 /* PassOwnPtr.h in Headers */ = {isa = PBXBuildFile; fileRef = A8A472EC151A825B004123FF /* PassOwnPtr.h */; }; + 10EAA7BC1889E93100DEB161 /* PassRefPtr.h in Headers */ = {isa = PBXBuildFile; fileRef = A8A472ED151A825B004123FF /* PassRefPtr.h */; }; + 10EAA7BD1889E93100DEB161 /* Platform.h in Headers */ = {isa = PBXBuildFile; fileRef = A876DBD7151816E500DADB95 /* Platform.h */; }; + 10EAA7BE1889E93100DEB161 /* PossiblyNull.h in Headers */ = {isa = PBXBuildFile; fileRef = A8A472F3151A825B004123FF /* PossiblyNull.h */; }; + 10EAA7BF1889E93100DEB161 /* Bag.h in Headers */ = {isa = PBXBuildFile; fileRef = 0FB14E18180FA218009B6B4D /* Bag.h */; }; + 10EAA7C01889E93100DEB161 /* PrintStream.h in Headers */ = {isa = PBXBuildFile; fileRef = 0F9D335E165DBA73005AD387 /* PrintStream.h */; }; + 10EAA7C11889E93100DEB161 /* ProcessID.h in Headers */ = {isa = PBXBuildFile; fileRef = 0FC4488216FE9FE100844BE9 /* ProcessID.h */; }; + 10EAA7C21889E93100DEB161 /* RAMSize.h in Headers */ = {isa = PBXBuildFile; fileRef = 143F611E1565F0F900DB514A /* RAMSize.h */; settings = {ATTRIBUTES = (); }; }; + 10EAA7C31889E93100DEB161 /* RandomNumber.h in Headers */ = {isa = PBXBuildFile; fileRef = A8A472FC151A825B004123FF /* RandomNumber.h */; }; + 10EAA7C41889E93100DEB161 /* RandomNumberSeed.h in Headers */ = {isa = PBXBuildFile; fileRef = A8A472FD151A825B004123FF /* RandomNumberSeed.h */; }; + 10EAA7C51889E93100DEB161 /* RawPointer.h in Headers */ = {isa = PBXBuildFile; fileRef = 0F87105916643F190090B0AD /* RawPointer.h */; }; + 10EAA7C61889E93100DEB161 /* RedBlackTree.h in Headers */ = {isa = PBXBuildFile; fileRef = A8A472FE151A825B004123FF /* RedBlackTree.h */; }; + 10EAA7C71889E93100DEB161 /* RefCounted.h in Headers */ = {isa = PBXBuildFile; fileRef = A8A472FF151A825B004123FF /* RefCounted.h */; }; + 10EAA7C81889E93100DEB161 /* RefCountedArray.h in Headers */ = {isa = PBXBuildFile; fileRef = A8A47300151A825B004123FF /* RefCountedArray.h */; }; + 10EAA7C91889E93100DEB161 /* RefCountedLeakCounter.h in Headers */ = {isa = PBXBuildFile; fileRef = A8A47302151A825B004123FF /* RefCountedLeakCounter.h */; }; + 10EAA7CA1889E93100DEB161 /* RefPtr.h in Headers */ = {isa = PBXBuildFile; fileRef = A8A47303151A825B004123FF /* RefPtr.h */; }; + 10EAA7CB1889E93100DEB161 /* RefPtrHashMap.h in Headers */ = {isa = PBXBuildFile; fileRef = A8A47304151A825B004123FF /* RefPtrHashMap.h */; }; + 10EAA7CC1889E93100DEB161 /* RetainPtr.h in Headers */ = {isa = PBXBuildFile; fileRef = A8A47305151A825B004123FF /* RetainPtr.h */; }; + 10EAA7CD1889E93100DEB161 /* RunLoop.h in Headers */ = {isa = PBXBuildFile; fileRef = 2CDED0F218115C85004DBA70 /* RunLoop.h */; }; + 10EAA7CE1889E93100DEB161 /* RunLoopTimer.h in Headers */ = {isa = PBXBuildFile; fileRef = 1469419016EAAF6D0024E146 /* RunLoopTimer.h */; settings = {ATTRIBUTES = (); }; }; + 10EAA7CF1889E93100DEB161 /* SaturatedArithmetic.h in Headers */ = {isa = PBXBuildFile; fileRef = 14F3B0F615E45E4600210069 /* SaturatedArithmetic.h */; settings = {ATTRIBUTES = (); }; }; + 10EAA7D01889E93100DEB161 /* SchedulePair.h in Headers */ = {isa = PBXBuildFile; fileRef = 1469419416EAAFF80024E146 /* SchedulePair.h */; }; + 10EAA7D11889E93100DEB161 /* ScriptCodesFromICU.h in Headers */ = {isa = PBXBuildFile; fileRef = A8A47354151A825B004123FF /* ScriptCodesFromICU.h */; }; + 10EAA7D21889E93100DEB161 /* SegmentedVector.h in Headers */ = {isa = PBXBuildFile; fileRef = A8A47306151A825B004123FF /* SegmentedVector.h */; }; + 10EAA7D31889E93100DEB161 /* SentinelLinkedList.h in Headers */ = {isa = PBXBuildFile; fileRef = A8A47307151A825B004123FF /* SentinelLinkedList.h */; }; + 10EAA7D41889E93100DEB161 /* SHA1.h in Headers */ = {isa = PBXBuildFile; fileRef = A8A47309151A825B004123FF /* SHA1.h */; }; + 10EAA7D51889E93100DEB161 /* SimpleStats.h in Headers */ = {isa = PBXBuildFile; fileRef = A8A4730A151A825B004123FF /* SimpleStats.h */; }; + 10EAA7D61889E93100DEB161 /* SinglyLinkedList.h in Headers */ = {isa = PBXBuildFile; fileRef = A8A4730B151A825B004123FF /* SinglyLinkedList.h */; }; + 10EAA7D71889E93100DEB161 /* SixCharacterHash.h in Headers */ = {isa = PBXBuildFile; fileRef = A748745017A0BDAE00FA04CB /* SixCharacterHash.h */; }; + 10EAA7D81889E93100DEB161 /* Spectrum.h in Headers */ = {isa = PBXBuildFile; fileRef = A8A4730D151A825B004123FF /* Spectrum.h */; }; + 10EAA7D91889E93100DEB161 /* StackBounds.h in Headers */ = {isa = PBXBuildFile; fileRef = A8A4730F151A825B004123FF /* StackBounds.h */; }; + 10EAA7DA1889E93100DEB161 /* StackStats.h in Headers */ = {isa = PBXBuildFile; fileRef = FEDACD3C1630F83F00C69634 /* StackStats.h */; }; + 10EAA7DB1889E93100DEB161 /* StaticConstructors.h in Headers */ = {isa = PBXBuildFile; fileRef = A8A47310151A825B004123FF /* StaticConstructors.h */; }; + 10EAA7DC1889E93100DEB161 /* StdLibExtras.h in Headers */ = {isa = PBXBuildFile; fileRef = A8A47311151A825B004123FF /* StdLibExtras.h */; }; + 10EAA7DD1889E93100DEB161 /* StreamBuffer.h in Headers */ = {isa = PBXBuildFile; fileRef = 1A6BB768162F300500DD16DB /* StreamBuffer.h */; }; + 10EAA7DE1889E93100DEB161 /* StringBuffer.h in Headers */ = {isa = PBXBuildFile; fileRef = A8A47323151A825B004123FF /* StringBuffer.h */; }; + 10EAA7DF1889E93100DEB161 /* StringBuilder.h in Headers */ = {isa = PBXBuildFile; fileRef = A8A47325151A825B004123FF /* StringBuilder.h */; }; + 10EAA7E01889E93100DEB161 /* StringConcatenate.h in Headers */ = {isa = PBXBuildFile; fileRef = A8A47326151A825B004123FF /* StringConcatenate.h */; }; + 10EAA7E11889E93100DEB161 /* StringExtras.h in Headers */ = {isa = PBXBuildFile; fileRef = A8A47313151A825B004123FF /* StringExtras.h */; }; + 10EAA7E21889E93100DEB161 /* StringHash.h in Headers */ = {isa = PBXBuildFile; fileRef = A8A47327151A825B004123FF /* StringHash.h */; }; + 10EAA7E31889E93100DEB161 /* StringHashDumpContext.h in Headers */ = {isa = PBXBuildFile; fileRef = A748745117A0BDAE00FA04CB /* StringHashDumpContext.h */; }; + 10EAA7E41889E93100DEB161 /* StringHasher.h in Headers */ = {isa = PBXBuildFile; fileRef = A8A47314151A825B004123FF /* StringHasher.h */; }; + 10EAA7E51889E93100DEB161 /* StringImpl.h in Headers */ = {isa = PBXBuildFile; fileRef = A8A47329151A825B004123FF /* StringImpl.h */; }; + 10EAA7E61889E93100DEB161 /* StringOperators.h in Headers */ = {isa = PBXBuildFile; fileRef = A8A4732A151A825B004123FF /* StringOperators.h */; }; + 10EAA7E71889E93100DEB161 /* StringPrintStream.h in Headers */ = {isa = PBXBuildFile; fileRef = 0FDDBFA61666DFA300C55FEF /* StringPrintStream.h */; }; + 10EAA7E81889E93100DEB161 /* strtod.h in Headers */ = {isa = PBXBuildFile; fileRef = A8A47295151A825A004123FF /* strtod.h */; }; + 10EAA7E91889E93100DEB161 /* TCPackedCache.h in Headers */ = {isa = PBXBuildFile; fileRef = A8A47315151A825B004123FF /* TCPackedCache.h */; }; + 10EAA7EA1889E93100DEB161 /* TCPageMap.h in Headers */ = {isa = PBXBuildFile; fileRef = A8A47316151A825B004123FF /* TCPageMap.h */; }; + 10EAA7EB1889E93100DEB161 /* TCSpinLock.h in Headers */ = {isa = PBXBuildFile; fileRef = A8A47317151A825B004123FF /* TCSpinLock.h */; }; + 10EAA7EC1889E93100DEB161 /* TCSystemAlloc.h in Headers */ = {isa = PBXBuildFile; fileRef = A8A47319151A825B004123FF /* TCSystemAlloc.h */; }; + 10EAA7ED1889E93100DEB161 /* StringView.h in Headers */ = {isa = PBXBuildFile; fileRef = 1A6EB1DF187D0BD30030126F /* StringView.h */; }; + 10EAA7EE1889E93100DEB161 /* TemporaryChange.h in Headers */ = {isa = PBXBuildFile; fileRef = A8A4731A151A825B004123FF /* TemporaryChange.h */; }; + 10EAA7EF1889E93100DEB161 /* TextPosition.h in Headers */ = {isa = PBXBuildFile; fileRef = A8A4732C151A825B004123FF /* TextPosition.h */; }; + 10EAA7F01889E93100DEB161 /* ThreadFunctionInvocation.h in Headers */ = {isa = PBXBuildFile; fileRef = A8A4732F151A825B004123FF /* ThreadFunctionInvocation.h */; }; + 10EAA7F11889E93100DEB161 /* ThreadIdentifierDataPthreads.h in Headers */ = {isa = PBXBuildFile; fileRef = A8A47331151A825B004123FF /* ThreadIdentifierDataPthreads.h */; }; + 10EAA7F21889E93100DEB161 /* Threading.h in Headers */ = {isa = PBXBuildFile; fileRef = A8A47333151A825B004123FF /* Threading.h */; }; + 10EAA7F31889E93100DEB161 /* ThreadingPrimitives.h in Headers */ = {isa = PBXBuildFile; fileRef = A8A47335151A825B004123FF /* ThreadingPrimitives.h */; }; + 10EAA7F41889E93100DEB161 /* ThreadSafeRefCounted.h in Headers */ = {isa = PBXBuildFile; fileRef = A8A4733E151A825B004123FF /* ThreadSafeRefCounted.h */; }; + 10EAA7F51889E93100DEB161 /* ThreadSpecific.h in Headers */ = {isa = PBXBuildFile; fileRef = A8A4733F151A825B004123FF /* ThreadSpecific.h */; }; + 10EAA7F61889E93100DEB161 /* TriState.h in Headers */ = {isa = PBXBuildFile; fileRef = 149EF16216BBFE0D000A4331 /* TriState.h */; settings = {ATTRIBUTES = (); }; }; + 10EAA7F71889E93100DEB161 /* Unicode.h in Headers */ = {isa = PBXBuildFile; fileRef = A8A47355151A825B004123FF /* Unicode.h */; }; + 10EAA7F81889E93100DEB161 /* UnicodeIcu.h in Headers */ = {isa = PBXBuildFile; fileRef = A8A47351151A825B004123FF /* UnicodeIcu.h */; }; + 10EAA7F91889E93100DEB161 /* UnicodeMacrosFromICU.h in Headers */ = {isa = PBXBuildFile; fileRef = A8A47356151A825B004123FF /* UnicodeMacrosFromICU.h */; }; + 10EAA7FA1889E93100DEB161 /* UnionFind.h in Headers */ = {isa = PBXBuildFile; fileRef = A8A4735C151A825B004123FF /* UnionFind.h */; }; + 10EAA7FB1889E93100DEB161 /* UTF8.h in Headers */ = {isa = PBXBuildFile; fileRef = A8A47358151A825B004123FF /* UTF8.h */; }; + 10EAA7FC1889E93100DEB161 /* utils.h in Headers */ = {isa = PBXBuildFile; fileRef = A8A47296151A825A004123FF /* utils.h */; }; + 10EAA7FD1889E93100DEB161 /* ValueCheck.h in Headers */ = {isa = PBXBuildFile; fileRef = A8A4736F151A825B004123FF /* ValueCheck.h */; }; + 10EAA7FE1889E93100DEB161 /* Vector.h in Headers */ = {isa = PBXBuildFile; fileRef = A8A47370151A825B004123FF /* Vector.h */; }; + 10EAA7FF1889E93100DEB161 /* VectorTraits.h in Headers */ = {isa = PBXBuildFile; fileRef = A8A47371151A825B004123FF /* VectorTraits.h */; }; + 10EAA8001889E93100DEB161 /* VMTags.h in Headers */ = {isa = PBXBuildFile; fileRef = A8A47372151A825B004123FF /* VMTags.h */; }; + 10EAA8011889E93100DEB161 /* WeakPtr.h in Headers */ = {isa = PBXBuildFile; fileRef = 974CFC8D16A4F327006D5404 /* WeakPtr.h */; }; + 10EAA8021889E93100DEB161 /* WebCoreThread.h in Headers */ = {isa = PBXBuildFile; fileRef = 1FA47C89152502DA00568D1B /* WebCoreThread.h */; }; + 10EAA8031889E93100DEB161 /* WTFString.h in Headers */ = {isa = PBXBuildFile; fileRef = A8A4732E151A825B004123FF /* WTFString.h */; }; + 10EAA8041889E93100DEB161 /* WTFThreadData.h in Headers */ = {isa = PBXBuildFile; fileRef = A8A4737B151A825B004123FF /* WTFThreadData.h */; }; 143F611F1565F0F900DB514A /* RAMSize.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 143F611D1565F0F900DB514A /* RAMSize.cpp */; }; 143F61201565F0F900DB514A /* RAMSize.h in Headers */ = {isa = PBXBuildFile; fileRef = 143F611E1565F0F900DB514A /* RAMSize.h */; settings = {ATTRIBUTES = (); }; }; 1469419216EAAF6D0024E146 /* RunLoopTimer.h in Headers */ = {isa = PBXBuildFile; fileRef = 1469419016EAAF6D0024E146 /* RunLoopTimer.h */; settings = {ATTRIBUTES = (); }; }; @@ -277,6 +529,13 @@ /* End PBXBuildFile section */ /* Begin PBXContainerItemProxy section */ + 10EAA7041889E93100DEB161 /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = 5D247B5914689B8600E78B76 /* Project object */; + proxyType = 1; + remoteGlobalIDString = 65AFA16F1630B977003D723C; + remoteInfo = "Copy Headers"; + }; 65AFA28D1630B99E003D723C /* PBXContainerItemProxy */ = { isa = PBXContainerItemProxy; containerPortal = 5D247B5914689B8600E78B76 /* Project object */; @@ -307,6 +566,8 @@ 0FDDBFA51666DFA300C55FEF /* StringPrintStream.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = StringPrintStream.cpp; sourceTree = ""; }; 0FDDBFA61666DFA300C55FEF /* StringPrintStream.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = StringPrintStream.h; sourceTree = ""; }; 0FEC3EE4171B834700FDAC8D /* ByteSpinLock.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = ByteSpinLock.h; sourceTree = ""; }; + 10EAA7011889E91800DEB161 /* WTF-iOS-Static.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; name = "WTF-iOS-Static.xcconfig"; path = "../../WTF-iOS-Static.xcconfig"; sourceTree = ""; }; + 10EAA8091889E93100DEB161 /* libWTF.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = libWTF.a; sourceTree = BUILT_PRODUCTS_DIR; }; 143F611D1565F0F900DB514A /* RAMSize.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = RAMSize.cpp; sourceTree = ""; }; 143F611E1565F0F900DB514A /* RAMSize.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RAMSize.h; sourceTree = ""; }; 1469419016EAAF6D0024E146 /* RunLoopTimer.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RunLoopTimer.h; sourceTree = ""; }; @@ -554,6 +815,13 @@ /* End PBXFileReference section */ /* Begin PBXFrameworksBuildPhase section */ + 10EAA7511889E93100DEB161 /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + runOnlyForDeploymentPostprocessing = 0; + }; 5D247B5F14689B8600E78B76 /* Frameworks */ = { isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; @@ -594,6 +862,7 @@ isa = PBXGroup; children = ( 5D247B6214689B8600E78B76 /* libWTF.a */, + 10EAA8091889E93100DEB161 /* libWTF.a */, ); name = Products; sourceTree = ""; @@ -601,6 +870,7 @@ 5D247B6D14689C4700E78B76 /* Configurations */ = { isa = PBXGroup; children = ( + 10EAA7011889E91800DEB161 /* WTF-iOS-Static.xcconfig */, 5D247B6E14689C4700E78B76 /* Base.xcconfig */, 6541CAF41630DB26006D0DEC /* CopyWTFHeaders.xcconfig */, 5D247B7014689C4700E78B76 /* DebugRelease.xcconfig */, @@ -949,6 +1219,191 @@ /* End PBXGroup section */ /* Begin PBXHeadersBuildPhase section */ + 10EAA7521889E93100DEB161 /* Headers */ = { + isa = PBXHeadersBuildPhase; + buildActionMask = 2147483647; + files = ( + 10EAA7531889E93100DEB161 /* ASCIICType.h in Headers */, + 10EAA7541889E93100DEB161 /* ASCIIFastPath.h in Headers */, + 10EAA7551889E93100DEB161 /* Assertions.h in Headers */, + 10EAA7561889E93100DEB161 /* Atomics.h in Headers */, + 10EAA7571889E93100DEB161 /* AtomicString.h in Headers */, + 10EAA7581889E93100DEB161 /* IteratorAdaptors.h in Headers */, + 10EAA7591889E93100DEB161 /* AtomicStringHash.h in Headers */, + 10EAA75A1889E93100DEB161 /* AtomicStringImpl.h in Headers */, + 10EAA75B1889E93100DEB161 /* AtomicStringTable.h in Headers */, + 10EAA75C1889E93100DEB161 /* AutodrainedPool.h in Headers */, + 10EAA75D1889E93100DEB161 /* AVLTree.h in Headers */, + 10EAA75E1889E93100DEB161 /* Base64.h in Headers */, + 10EAA75F1889E93100DEB161 /* bignum-dtoa.h in Headers */, + 10EAA7601889E93100DEB161 /* bignum.h in Headers */, + 10EAA7611889E93100DEB161 /* IteratorRange.h in Headers */, + 10EAA7621889E93100DEB161 /* BinarySemaphore.h in Headers */, + 10EAA7631889E93100DEB161 /* Bitmap.h in Headers */, + 10EAA7641889E93100DEB161 /* BitVector.h in Headers */, + 10EAA7651889E93100DEB161 /* BlockStack.h in Headers */, + 10EAA7661889E93100DEB161 /* BloomFilter.h in Headers */, + 10EAA7671889E93100DEB161 /* BoundsCheckedPointer.h in Headers */, + 10EAA7681889E93100DEB161 /* BumpPointerAllocator.h in Headers */, + 10EAA7691889E93100DEB161 /* ByteOrder.h in Headers */, + 10EAA76A1889E93100DEB161 /* cached-powers.h in Headers */, + 10EAA76B1889E93100DEB161 /* CharacterNames.h in Headers */, + 10EAA76C1889E93100DEB161 /* CheckedArithmetic.h in Headers */, + 10EAA76D1889E93100DEB161 /* CheckedBoolean.h in Headers */, + 10EAA76E1889E93100DEB161 /* Collator.h in Headers */, + 10EAA76F1889E93100DEB161 /* CommaPrinter.h in Headers */, + 10EAA7701889E93100DEB161 /* CompilationThread.h in Headers */, + 10EAA7711889E93100DEB161 /* Compiler.h in Headers */, + 10EAA7721889E93100DEB161 /* Compression.h in Headers */, + 10EAA7731889E93100DEB161 /* config.h in Headers */, + 10EAA7741889E93100DEB161 /* ConversionMode.h in Headers */, + 10EAA7751889E93100DEB161 /* CryptographicallyRandomNumber.h in Headers */, + 10EAA7761889E93100DEB161 /* CString.h in Headers */, + 10EAA7771889E93100DEB161 /* CurrentTime.h in Headers */, + 10EAA7781889E93100DEB161 /* DataLog.h in Headers */, + 10EAA7791889E93100DEB161 /* DateMath.h in Headers */, + 10EAA77A1889E93100DEB161 /* DecimalNumber.h in Headers */, + 10EAA77B1889E93100DEB161 /* Decoder.h in Headers */, + 10EAA77C1889E93100DEB161 /* DeferrableRefCounted.h in Headers */, + 10EAA77D1889E93100DEB161 /* Deque.h in Headers */, + 10EAA77E1889E93100DEB161 /* DisallowCType.h in Headers */, + 10EAA77F1889E93100DEB161 /* diy-fp.h in Headers */, + 10EAA7801889E93100DEB161 /* double-conversion.h in Headers */, + 10EAA7811889E93100DEB161 /* double.h in Headers */, + 10EAA7821889E93100DEB161 /* DoublyLinkedList.h in Headers */, + 10EAA7831889E93100DEB161 /* dtoa.h in Headers */, + 10EAA7841889E93100DEB161 /* DynamicAnnotations.h in Headers */, + 10EAA7851889E93100DEB161 /* Encoder.h in Headers */, + 10EAA7861889E93100DEB161 /* ExportMacros.h in Headers */, + 10EAA7871889E93100DEB161 /* fast-dtoa.h in Headers */, + 10EAA7881889E93100DEB161 /* FastBitVector.h in Headers */, + 10EAA7891889E93100DEB161 /* FastMalloc.h in Headers */, + 10EAA78A1889E93100DEB161 /* FeatureDefines.h in Headers */, + 10EAA78B1889E93100DEB161 /* FilePrintStream.h in Headers */, + 10EAA78C1889E93100DEB161 /* fixed-dtoa.h in Headers */, + 10EAA78D1889E93100DEB161 /* FlipBytes.h in Headers */, + 10EAA78E1889E93100DEB161 /* Forward.h in Headers */, + 10EAA78F1889E93100DEB161 /* Functional.h in Headers */, + 10EAA7901889E93100DEB161 /* FunctionDispatcher.h in Headers */, + 10EAA7911889E93100DEB161 /* GetPtr.h in Headers */, + 10EAA7921889E93100DEB161 /* GregorianDateTime.h in Headers */, + 10EAA7931889E93100DEB161 /* HashCountedSet.h in Headers */, + 10EAA7941889E93100DEB161 /* HashFunctions.h in Headers */, + 10EAA7951889E93100DEB161 /* HashIterators.h in Headers */, + 10EAA7961889E93100DEB161 /* HashMap.h in Headers */, + 10EAA7971889E93100DEB161 /* MallocPtr.h in Headers */, + 10EAA7981889E93100DEB161 /* HashSet.h in Headers */, + 10EAA7991889E93100DEB161 /* HashTable.h in Headers */, + 10EAA79A1889E93100DEB161 /* HashTraits.h in Headers */, + 10EAA79B1889E93100DEB161 /* HexNumber.h in Headers */, + 10EAA79C1889E93100DEB161 /* InlineASM.h in Headers */, + 10EAA79D1889E93100DEB161 /* Ref.h in Headers */, + 10EAA79E1889E93100DEB161 /* Insertion.h in Headers */, + 10EAA79F1889E93100DEB161 /* IntegerToStringConversion.h in Headers */, + 10EAA7A01889E93100DEB161 /* ListDump.h in Headers */, + 10EAA7A11889E93100DEB161 /* ListHashSet.h in Headers */, + 10EAA7A21889E93100DEB161 /* Locker.h in Headers */, + 10EAA7A31889E93100DEB161 /* MainThread.h in Headers */, + 10EAA7A41889E93100DEB161 /* MathExtras.h in Headers */, + 10EAA7A51889E93100DEB161 /* PassRef.h in Headers */, + 10EAA7A61889E93100DEB161 /* MD5.h in Headers */, + 10EAA7A71889E93100DEB161 /* MediaTime.h in Headers */, + 10EAA7A81889E93100DEB161 /* MessageQueue.h in Headers */, + 10EAA7A91889E93100DEB161 /* MetaAllocator.h in Headers */, + 10EAA7AA1889E93100DEB161 /* MetaAllocatorHandle.h in Headers */, + 10EAA7AB1889E93100DEB161 /* NoLock.h in Headers */, + 10EAA7AC1889E93100DEB161 /* Noncopyable.h in Headers */, + 10EAA7AD1889E93100DEB161 /* NumberOfCores.h in Headers */, + 10EAA7AE1889E93100DEB161 /* ObjcRuntimeExtras.h in Headers */, + 10EAA7AF1889E93100DEB161 /* OSAllocator.h in Headers */, + 10EAA7B01889E93100DEB161 /* OSRandomSource.h in Headers */, + 10EAA7B11889E93100DEB161 /* OwnPtr.h in Headers */, + 10EAA7B21889E93100DEB161 /* OwnPtrCommon.h in Headers */, + 10EAA7B31889E93100DEB161 /* BagToHashMap.h in Headers */, + 10EAA7B41889E93100DEB161 /* PackedIntVector.h in Headers */, + 10EAA7B51889E93100DEB161 /* PageAllocation.h in Headers */, + 10EAA7B61889E93100DEB161 /* PageAllocationAligned.h in Headers */, + 10EAA7B71889E93100DEB161 /* PageBlock.h in Headers */, + 10EAA7B81889E93100DEB161 /* PageReservation.h in Headers */, + 10EAA7B91889E93100DEB161 /* ParallelJobs.h in Headers */, + 10EAA7BA1889E93100DEB161 /* ParallelJobsLibdispatch.h in Headers */, + 10EAA7BB1889E93100DEB161 /* PassOwnPtr.h in Headers */, + 10EAA7BC1889E93100DEB161 /* PassRefPtr.h in Headers */, + 10EAA7BD1889E93100DEB161 /* Platform.h in Headers */, + 10EAA7BE1889E93100DEB161 /* PossiblyNull.h in Headers */, + 10EAA7BF1889E93100DEB161 /* Bag.h in Headers */, + 10EAA7C01889E93100DEB161 /* PrintStream.h in Headers */, + 10EAA7C11889E93100DEB161 /* ProcessID.h in Headers */, + 10EAA7C21889E93100DEB161 /* RAMSize.h in Headers */, + 10EAA7C31889E93100DEB161 /* RandomNumber.h in Headers */, + 10EAA7C41889E93100DEB161 /* RandomNumberSeed.h in Headers */, + 10EAA7C51889E93100DEB161 /* RawPointer.h in Headers */, + 10EAA7C61889E93100DEB161 /* RedBlackTree.h in Headers */, + 10EAA7C71889E93100DEB161 /* RefCounted.h in Headers */, + 10EAA7C81889E93100DEB161 /* RefCountedArray.h in Headers */, + 10EAA7C91889E93100DEB161 /* RefCountedLeakCounter.h in Headers */, + 10EAA7CA1889E93100DEB161 /* RefPtr.h in Headers */, + 10EAA7CB1889E93100DEB161 /* RefPtrHashMap.h in Headers */, + 10EAA7CC1889E93100DEB161 /* RetainPtr.h in Headers */, + 10EAA7CD1889E93100DEB161 /* RunLoop.h in Headers */, + 10EAA7CE1889E93100DEB161 /* RunLoopTimer.h in Headers */, + 10EAA7CF1889E93100DEB161 /* SaturatedArithmetic.h in Headers */, + 10EAA7D01889E93100DEB161 /* SchedulePair.h in Headers */, + 10EAA7D11889E93100DEB161 /* ScriptCodesFromICU.h in Headers */, + 10EAA7D21889E93100DEB161 /* SegmentedVector.h in Headers */, + 10EAA7D31889E93100DEB161 /* SentinelLinkedList.h in Headers */, + 10EAA7D41889E93100DEB161 /* SHA1.h in Headers */, + 10EAA7D51889E93100DEB161 /* SimpleStats.h in Headers */, + 10EAA7D61889E93100DEB161 /* SinglyLinkedList.h in Headers */, + 10EAA7D71889E93100DEB161 /* SixCharacterHash.h in Headers */, + 10EAA7D81889E93100DEB161 /* Spectrum.h in Headers */, + 10EAA7D91889E93100DEB161 /* StackBounds.h in Headers */, + 10EAA7DA1889E93100DEB161 /* StackStats.h in Headers */, + 10EAA7DB1889E93100DEB161 /* StaticConstructors.h in Headers */, + 10EAA7DC1889E93100DEB161 /* StdLibExtras.h in Headers */, + 10EAA7DD1889E93100DEB161 /* StreamBuffer.h in Headers */, + 10EAA7DE1889E93100DEB161 /* StringBuffer.h in Headers */, + 10EAA7DF1889E93100DEB161 /* StringBuilder.h in Headers */, + 10EAA7E01889E93100DEB161 /* StringConcatenate.h in Headers */, + 10EAA7E11889E93100DEB161 /* StringExtras.h in Headers */, + 10EAA7E21889E93100DEB161 /* StringHash.h in Headers */, + 10EAA7E31889E93100DEB161 /* StringHashDumpContext.h in Headers */, + 10EAA7E41889E93100DEB161 /* StringHasher.h in Headers */, + 10EAA7E51889E93100DEB161 /* StringImpl.h in Headers */, + 10EAA7E61889E93100DEB161 /* StringOperators.h in Headers */, + 10EAA7E71889E93100DEB161 /* StringPrintStream.h in Headers */, + 10EAA7E81889E93100DEB161 /* strtod.h in Headers */, + 10EAA7E91889E93100DEB161 /* TCPackedCache.h in Headers */, + 10EAA7EA1889E93100DEB161 /* TCPageMap.h in Headers */, + 10EAA7EB1889E93100DEB161 /* TCSpinLock.h in Headers */, + 10EAA7EC1889E93100DEB161 /* TCSystemAlloc.h in Headers */, + 10EAA7ED1889E93100DEB161 /* StringView.h in Headers */, + 10EAA7EE1889E93100DEB161 /* TemporaryChange.h in Headers */, + 10EAA7EF1889E93100DEB161 /* TextPosition.h in Headers */, + 10EAA7F01889E93100DEB161 /* ThreadFunctionInvocation.h in Headers */, + 10EAA7F11889E93100DEB161 /* ThreadIdentifierDataPthreads.h in Headers */, + 10EAA7F21889E93100DEB161 /* Threading.h in Headers */, + 10EAA7F31889E93100DEB161 /* ThreadingPrimitives.h in Headers */, + 10EAA7F41889E93100DEB161 /* ThreadSafeRefCounted.h in Headers */, + 10EAA7F51889E93100DEB161 /* ThreadSpecific.h in Headers */, + 10EAA7F61889E93100DEB161 /* TriState.h in Headers */, + 10EAA7F71889E93100DEB161 /* Unicode.h in Headers */, + 10EAA7F81889E93100DEB161 /* UnicodeIcu.h in Headers */, + 10EAA7F91889E93100DEB161 /* UnicodeMacrosFromICU.h in Headers */, + 10EAA7FA1889E93100DEB161 /* UnionFind.h in Headers */, + 10EAA7FB1889E93100DEB161 /* UTF8.h in Headers */, + 10EAA7FC1889E93100DEB161 /* utils.h in Headers */, + 10EAA7FD1889E93100DEB161 /* ValueCheck.h in Headers */, + 10EAA7FE1889E93100DEB161 /* Vector.h in Headers */, + 10EAA7FF1889E93100DEB161 /* VectorTraits.h in Headers */, + 10EAA8001889E93100DEB161 /* VMTags.h in Headers */, + 10EAA8011889E93100DEB161 /* WeakPtr.h in Headers */, + 10EAA8021889E93100DEB161 /* WebCoreThread.h in Headers */, + 10EAA8031889E93100DEB161 /* WTFString.h in Headers */, + 10EAA8041889E93100DEB161 /* WTFThreadData.h in Headers */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; 5D247B6014689B8600E78B76 /* Headers */ = { isa = PBXHeadersBuildPhase; buildActionMask = 2147483647; @@ -1137,6 +1592,24 @@ /* End PBXHeadersBuildPhase section */ /* Begin PBXNativeTarget section */ + 10EAA7021889E93100DEB161 /* WTF iOS */ = { + isa = PBXNativeTarget; + buildConfigurationList = 10EAA8051889E93100DEB161 /* Build configuration list for PBXNativeTarget "WTF iOS" */; + buildPhases = ( + 10EAA7051889E93100DEB161 /* Sources */, + 10EAA7511889E93100DEB161 /* Frameworks */, + 10EAA7521889E93100DEB161 /* Headers */, + ); + buildRules = ( + ); + dependencies = ( + 10EAA7031889E93100DEB161 /* PBXTargetDependency */, + ); + name = "WTF iOS"; + productName = WTF; + productReference = 10EAA8091889E93100DEB161 /* libWTF.a */; + productType = "com.apple.product-type.library.static"; + }; 5D247B6114689B8600E78B76 /* WTF */ = { isa = PBXNativeTarget; buildConfigurationList = 5D247B6614689B8600E78B76 /* Build configuration list for PBXNativeTarget "WTF" */; @@ -1177,6 +1650,7 @@ targets = ( 5D247B6114689B8600E78B76 /* WTF */, 65AFA16F1630B977003D723C /* Copy WTF Headers */, + 10EAA7021889E93100DEB161 /* WTF iOS */, ); }; /* End PBXProject section */ @@ -1199,6 +1673,87 @@ /* End PBXShellScriptBuildPhase section */ /* Begin PBXSourcesBuildPhase section */ + 10EAA7051889E93100DEB161 /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 10EAA7061889E93100DEB161 /* Assertions.cpp in Sources */, + 10EAA7071889E93100DEB161 /* AtomicString.cpp in Sources */, + 10EAA7081889E93100DEB161 /* AtomicStringTable.cpp in Sources */, + 10EAA7091889E93100DEB161 /* StringCF.cpp in Sources */, + 10EAA70A1889E93100DEB161 /* AutodrainedPoolMac.mm in Sources */, + 10EAA70B1889E93100DEB161 /* Base64.cpp in Sources */, + 10EAA70C1889E93100DEB161 /* bignum-dtoa.cc in Sources */, + 10EAA70D1889E93100DEB161 /* bignum.cc in Sources */, + 10EAA70E1889E93100DEB161 /* BinarySemaphore.cpp in Sources */, + 10EAA70F1889E93100DEB161 /* BitVector.cpp in Sources */, + 10EAA7101889E93100DEB161 /* cached-powers.cc in Sources */, + 10EAA7111889E93100DEB161 /* CollatorDefault.cpp in Sources */, + 10EAA7121889E93100DEB161 /* CollatorICU.cpp in Sources */, + 10EAA7131889E93100DEB161 /* CompilationThread.cpp in Sources */, + 10EAA7141889E93100DEB161 /* Compression.cpp in Sources */, + 10EAA7151889E93100DEB161 /* CryptographicallyRandomNumber.cpp in Sources */, + 10EAA7161889E93100DEB161 /* CString.cpp in Sources */, + 10EAA7171889E93100DEB161 /* CurrentTime.cpp in Sources */, + 10EAA7181889E93100DEB161 /* DataLog.cpp in Sources */, + 10EAA7191889E93100DEB161 /* DateMath.cpp in Sources */, + 10EAA71A1889E93100DEB161 /* DecimalNumber.cpp in Sources */, + 10EAA71B1889E93100DEB161 /* diy-fp.cc in Sources */, + 10EAA71C1889E93100DEB161 /* double-conversion.cc in Sources */, + 10EAA71D1889E93100DEB161 /* dtoa.cpp in Sources */, + 10EAA71E1889E93100DEB161 /* FastBitVector.cpp in Sources */, + 10EAA71F1889E93100DEB161 /* DynamicAnnotations.cpp in Sources */, + 10EAA7201889E93100DEB161 /* fast-dtoa.cc in Sources */, + 10EAA7211889E93100DEB161 /* FastMalloc.cpp in Sources */, + 10EAA7221889E93100DEB161 /* StringImplCF.cpp in Sources */, + 10EAA7231889E93100DEB161 /* AtomicStringCF.cpp in Sources */, + 10EAA7241889E93100DEB161 /* FilePrintStream.cpp in Sources */, + 10EAA7251889E93100DEB161 /* fixed-dtoa.cc in Sources */, + 10EAA7261889E93100DEB161 /* FunctionDispatcher.cpp in Sources */, + 10EAA7271889E93100DEB161 /* GregorianDateTime.cpp in Sources */, + 10EAA7281889E93100DEB161 /* HashTable.cpp in Sources */, + 10EAA7291889E93100DEB161 /* MainThread.cpp in Sources */, + 10EAA72A1889E93100DEB161 /* MainThreadMac.mm in Sources */, + 10EAA72B1889E93100DEB161 /* MD5.cpp in Sources */, + 10EAA72C1889E93100DEB161 /* MediaTime.cpp in Sources */, + 10EAA72D1889E93100DEB161 /* MetaAllocator.cpp in Sources */, + 10EAA72E1889E93100DEB161 /* NumberOfCores.cpp in Sources */, + 10EAA72F1889E93100DEB161 /* OSAllocatorPosix.cpp in Sources */, + 10EAA7301889E93100DEB161 /* OSRandomSource.cpp in Sources */, + 10EAA7311889E93100DEB161 /* PageAllocationAligned.cpp in Sources */, + 10EAA7321889E93100DEB161 /* PageBlock.cpp in Sources */, + 10EAA7331889E93100DEB161 /* PrintStream.cpp in Sources */, + 10EAA7341889E93100DEB161 /* StringImplMac.mm in Sources */, + 10EAA7351889E93100DEB161 /* RAMSize.cpp in Sources */, + 10EAA7361889E93100DEB161 /* RandomNumber.cpp in Sources */, + 10EAA7371889E93100DEB161 /* RefCountedLeakCounter.cpp in Sources */, + 10EAA7381889E93100DEB161 /* RunLoop.cpp in Sources */, + 10EAA7391889E93100DEB161 /* RunLoopCF.cpp in Sources */, + 10EAA73A1889E93100DEB161 /* RunLoopTimerCF.cpp in Sources */, + 10EAA73B1889E93100DEB161 /* SchedulePairCF.cpp in Sources */, + 10EAA73C1889E93100DEB161 /* StringMac.mm in Sources */, + 10EAA73D1889E93100DEB161 /* SchedulePairMac.mm in Sources */, + 10EAA73E1889E93100DEB161 /* SHA1.cpp in Sources */, + 10EAA73F1889E93100DEB161 /* SixCharacterHash.cpp in Sources */, + 10EAA7411889E93100DEB161 /* StackBounds.cpp in Sources */, + 10EAA7421889E93100DEB161 /* StackStats.cpp in Sources */, + 10EAA7431889E93100DEB161 /* StringBuilder.cpp in Sources */, + 10EAA7441889E93100DEB161 /* StringImpl.cpp in Sources */, + 10EAA7451889E93100DEB161 /* StringPrintStream.cpp in Sources */, + 10EAA7461889E93100DEB161 /* StringStatics.cpp in Sources */, + 10EAA7471889E93100DEB161 /* strtod.cc in Sources */, + 10EAA7481889E93100DEB161 /* TCSystemAlloc.cpp in Sources */, + 10EAA7491889E93100DEB161 /* ThreadIdentifierDataPthreads.cpp in Sources */, + 10EAA74A1889E93100DEB161 /* DeprecatedSymbolsUsedBySafari.mm in Sources */, + 10EAA74B1889E93100DEB161 /* Threading.cpp in Sources */, + 10EAA74C1889E93100DEB161 /* ThreadingPthreads.cpp in Sources */, + 10EAA74D1889E93100DEB161 /* UTF8.cpp in Sources */, + 10EAA74E1889E93100DEB161 /* WebCoreThread.cpp in Sources */, + 10EAA74F1889E93100DEB161 /* WTFString.cpp in Sources */, + 10EAA7501889E93100DEB161 /* WTFThreadData.cpp in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; 5D247B5E14689B8600E78B76 /* Sources */ = { isa = PBXSourcesBuildPhase; buildActionMask = 2147483647; @@ -1284,6 +1839,11 @@ /* End PBXSourcesBuildPhase section */ /* Begin PBXTargetDependency section */ + 10EAA7031889E93100DEB161 /* PBXTargetDependency */ = { + isa = PBXTargetDependency; + target = 65AFA16F1630B977003D723C /* Copy WTF Headers */; + targetProxy = 10EAA7041889E93100DEB161 /* PBXContainerItemProxy */; + }; 65AFA28E1630B99E003D723C /* PBXTargetDependency */ = { isa = PBXTargetDependency; target = 65AFA16F1630B977003D723C /* Copy WTF Headers */; @@ -1292,6 +1852,27 @@ /* End PBXTargetDependency section */ /* Begin XCBuildConfiguration section */ + 10EAA8061889E93100DEB161 /* Debug */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = 10EAA7011889E91800DEB161 /* WTF-iOS-Static.xcconfig */; + buildSettings = { + }; + name = Debug; + }; + 10EAA8071889E93100DEB161 /* Release */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = 10EAA7011889E91800DEB161 /* WTF-iOS-Static.xcconfig */; + buildSettings = { + }; + name = Release; + }; + 10EAA8081889E93100DEB161 /* Production */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = 10EAA7011889E91800DEB161 /* WTF-iOS-Static.xcconfig */; + buildSettings = { + }; + name = Production; + }; 5D247B6414689B8600E78B76 /* Debug */ = { isa = XCBuildConfiguration; baseConfigurationReference = 5D247B7014689C4700E78B76 /* DebugRelease.xcconfig */; @@ -1365,6 +1946,16 @@ /* End XCBuildConfiguration section */ /* Begin XCConfigurationList section */ + 10EAA8051889E93100DEB161 /* Build configuration list for PBXNativeTarget "WTF iOS" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 10EAA8061889E93100DEB161 /* Debug */, + 10EAA8071889E93100DEB161 /* Release */, + 10EAA8081889E93100DEB161 /* Production */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Production; + }; 5D247B5C14689B8600E78B76 /* Build configuration list for PBXProject "WTF" */ = { isa = XCConfigurationList; buildConfigurations = ( diff --git a/WTF/wtf/SizeLimits.cpp b/WTF/wtf/SizeLimits.cpp deleted file mode 100644 index d584e49c..00000000 --- a/WTF/wtf/SizeLimits.cpp +++ /dev/null @@ -1,84 +0,0 @@ -/* - * Copyright (C) 2010 Google 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: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * 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. - * * Neither the name of Google Inc. nor the names of its - * contributors may be used to endorse or promote products derived from - * this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND 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 THE COPYRIGHT - * OWNER 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 -#include -#include -#include -#include -#include -#include -#include -#include - -namespace WTF { - -#ifndef NDEBUG -struct SameSizeAsRefCounted { - int a; - bool b; - bool c; - ThreadRestrictionVerifier d; - // The debug version may get bigger. -}; -#else -struct SameSizeAsRefCounted { - int a; - // Don't add anything here because this should stay small. -}; -#endif -template -struct SameSizeAsVectorWithInlineCapacity; - -template -struct SameSizeAsVectorWithInlineCapacity { - void* bufferPointer; - unsigned capacity; - unsigned size; -}; - -template -struct SameSizeAsVectorWithInlineCapacity { - SameSizeAsVectorWithInlineCapacity baseCapacity; - typename std::aligned_storage::value>::type inlineBuffer[inlineCapacity]; -}; - -static_assert(sizeof(OwnPtr) == sizeof(int*), "OwnPtr should stay small!"); -static_assert(sizeof(PassRefPtr>) == sizeof(int*), "PassRefPtr should stay small!"); -static_assert(sizeof(RefCounted) == sizeof(SameSizeAsRefCounted), "RefCounted should stay small!"); -static_assert(sizeof(RefCountedCustomAllocated) == sizeof(SameSizeAsRefCounted), "RefCountedCustomAllocated should stay small!"); -static_assert(sizeof(RefPtr>) == sizeof(int*), "RefPtr should stay small!"); -static_assert(sizeof(Vector) == sizeof(SameSizeAsVectorWithInlineCapacity), "Vector should stay small!"); -static_assert(sizeof(Vector) == sizeof(SameSizeAsVectorWithInlineCapacity), "Vector should stay small!"); -static_assert(sizeof(Vector) == sizeof(SameSizeAsVectorWithInlineCapacity), "Vector should stay small!"); -static_assert(sizeof(Vector) == sizeof(SameSizeAsVectorWithInlineCapacity), "Vector should stay small!"); -} diff --git a/WTF/wtf/unicode/Collator.h b/WTF/wtf/unicode/Collator.h index 913b1378..0f2039ee 100644 --- a/WTF/wtf/unicode/Collator.h +++ b/WTF/wtf/unicode/Collator.h @@ -58,8 +58,11 @@ namespace WTF { void releaseCollator(); mutable UCollator* m_collator; #endif + +#if !UCONFIG_NO_COLLATION char* m_locale; bool m_lowerFirst; +#endif }; } From 47ba87a48a1d256070ac673df972be3f421d0cac Mon Sep 17 00:00:00 2001 From: Martijn The Date: Fri, 17 Jan 2014 15:24:31 -0800 Subject: [PATCH 27/69] Whoops, relative paths. --- JavaScriptCore-iOS-Static.xcconfig | 2 +- ToolExecutable-iOS-Static.xcconfig | 2 +- WTF-iOS-Static.xcconfig | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/JavaScriptCore-iOS-Static.xcconfig b/JavaScriptCore-iOS-Static.xcconfig index 52c3ee01..ae6ba328 100644 --- a/JavaScriptCore-iOS-Static.xcconfig +++ b/JavaScriptCore-iOS-Static.xcconfig @@ -6,7 +6,7 @@ // // -#include "JavaScriptCore.xcconfig" +#include "JavaScriptCore/Configurations/JavaScriptCore.xcconfig" ARCHS = arm64; ONLY_ACTIVE_ARCH = NO; diff --git a/ToolExecutable-iOS-Static.xcconfig b/ToolExecutable-iOS-Static.xcconfig index 25611d38..bcc09fbe 100644 --- a/ToolExecutable-iOS-Static.xcconfig +++ b/ToolExecutable-iOS-Static.xcconfig @@ -6,7 +6,7 @@ // // -#include "ToolExecutable.xcconfig" +#include "JavaScriptCore/Configurations/ToolExecutable.xcconfig" PRODUCT_NAME = JSCLLIntOffsetsExtractor; HEADER_SEARCH_PATHS = . icu "${BUILT_PRODUCTS_DIR}/usr/local/include" "${SOURCE_ROOT}/../WTF/" $(HEADER_SEARCH_PATHS); diff --git a/WTF-iOS-Static.xcconfig b/WTF-iOS-Static.xcconfig index d38ff2cf..f2743642 100644 --- a/WTF-iOS-Static.xcconfig +++ b/WTF-iOS-Static.xcconfig @@ -6,7 +6,7 @@ // // -#include "WTF.xcconfig" +#include "WTF/Configurations/WTF.xcconfig" PRODUCT_NAME = WTF ARCHS = arm64 armv7 From 32e1448947068e5daf4e5419bec1937dc2712b8e Mon Sep 17 00:00:00 2001 From: Martijn The Date: Fri, 17 Jan 2014 15:25:18 -0800 Subject: [PATCH 28/69] =?UTF-8?q?Removed=20WTF-iOS=20and=20re-used=20WTF?= =?UTF-8?q?=20target=20instead.=20Xcode=E2=80=99s=20=E2=80=9Cautomatic=20d?= =?UTF-8?q?ependency=20discovery=E2=80=9D=20gets=20confused=20and=20builds?= =?UTF-8?q?=20the=20wrong=20libWTF.a?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- WTF/WTF.xcodeproj/project.pbxproj | 591 ------------------------------ 1 file changed, 591 deletions(-) diff --git a/WTF/WTF.xcodeproj/project.pbxproj b/WTF/WTF.xcodeproj/project.pbxproj index 303f6640..4ee962d4 100644 --- a/WTF/WTF.xcodeproj/project.pbxproj +++ b/WTF/WTF.xcodeproj/project.pbxproj @@ -21,25 +21,6 @@ /* End PBXAggregateTarget section */ /* Begin PBXBuildFile section */ - 0F0D85B417234CC100338210 /* NoLock.h in Headers */ = {isa = PBXBuildFile; fileRef = 0F0D85B317234CB100338210 /* NoLock.h */; }; - 0F2B66A617B6B4FB00A7AE3F /* DeferrableRefCounted.h in Headers */ = {isa = PBXBuildFile; fileRef = 0F2B66A417B6B4F700A7AE3F /* DeferrableRefCounted.h */; }; - 0F2B66A717B6B4FD00A7AE3F /* FlipBytes.h in Headers */ = {isa = PBXBuildFile; fileRef = 0F2B66A517B6B4F700A7AE3F /* FlipBytes.h */; }; - 0F87105A16643F190090B0AD /* RawPointer.h in Headers */ = {isa = PBXBuildFile; fileRef = 0F87105916643F190090B0AD /* RawPointer.h */; }; - 0F885E0F1845AEA900F1E3FA /* FastBitVector.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 0F885E0E1845AE9F00F1E3FA /* FastBitVector.cpp */; }; - 0F8F2B91172E00FC007DBDA5 /* CompilationThread.h in Headers */ = {isa = PBXBuildFile; fileRef = 0F8F2B90172E00F0007DBDA5 /* CompilationThread.h */; }; - 0F8F2B92172E0103007DBDA5 /* CompilationThread.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 0F8F2B8F172E00F0007DBDA5 /* CompilationThread.cpp */; }; - 0F8F2B9C172F2596007DBDA5 /* ConversionMode.h in Headers */ = {isa = PBXBuildFile; fileRef = 0F8F2B9B172F2594007DBDA5 /* ConversionMode.h */; }; - 0F9D3360165DBA73005AD387 /* FilePrintStream.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 0F9D335B165DBA73005AD387 /* FilePrintStream.cpp */; }; - 0F9D3361165DBA73005AD387 /* FilePrintStream.h in Headers */ = {isa = PBXBuildFile; fileRef = 0F9D335C165DBA73005AD387 /* FilePrintStream.h */; }; - 0F9D3362165DBA73005AD387 /* PrintStream.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 0F9D335D165DBA73005AD387 /* PrintStream.cpp */; }; - 0F9D3363165DBA73005AD387 /* PrintStream.h in Headers */ = {isa = PBXBuildFile; fileRef = 0F9D335E165DBA73005AD387 /* PrintStream.h */; }; - 0FB14E19180FA218009B6B4D /* Bag.h in Headers */ = {isa = PBXBuildFile; fileRef = 0FB14E18180FA218009B6B4D /* Bag.h */; }; - 0FB14E1B1810E1DC009B6B4D /* BagToHashMap.h in Headers */ = {isa = PBXBuildFile; fileRef = 0FB14E1A1810E1DA009B6B4D /* BagToHashMap.h */; }; - 0FC4488316FE9FE100844BE9 /* ProcessID.h in Headers */ = {isa = PBXBuildFile; fileRef = 0FC4488216FE9FE100844BE9 /* ProcessID.h */; }; - 0FC4EDE61696149600F65041 /* CommaPrinter.h in Headers */ = {isa = PBXBuildFile; fileRef = 0FC4EDE51696149600F65041 /* CommaPrinter.h */; }; - 0FD81AC5154FB22E00983E72 /* FastBitVector.h in Headers */ = {isa = PBXBuildFile; fileRef = 0FD81AC4154FB22E00983E72 /* FastBitVector.h */; settings = {ATTRIBUTES = (); }; }; - 0FDDBFA71666DFA300C55FEF /* StringPrintStream.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 0FDDBFA51666DFA300C55FEF /* StringPrintStream.cpp */; }; - 0FDDBFA81666DFA300C55FEF /* StringPrintStream.h in Headers */ = {isa = PBXBuildFile; fileRef = 0FDDBFA61666DFA300C55FEF /* StringPrintStream.h */; }; 10EAA7061889E93100DEB161 /* Assertions.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A8A4725B151A825A004123FF /* Assertions.cpp */; }; 10EAA7071889E93100DEB161 /* AtomicString.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A8A4731D151A825B004123FF /* AtomicString.cpp */; }; 10EAA7081889E93100DEB161 /* AtomicStringTable.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 9BC70F04176C379D00101DEC /* AtomicStringTable.cpp */; }; @@ -292,240 +273,6 @@ 10EAA8021889E93100DEB161 /* WebCoreThread.h in Headers */ = {isa = PBXBuildFile; fileRef = 1FA47C89152502DA00568D1B /* WebCoreThread.h */; }; 10EAA8031889E93100DEB161 /* WTFString.h in Headers */ = {isa = PBXBuildFile; fileRef = A8A4732E151A825B004123FF /* WTFString.h */; }; 10EAA8041889E93100DEB161 /* WTFThreadData.h in Headers */ = {isa = PBXBuildFile; fileRef = A8A4737B151A825B004123FF /* WTFThreadData.h */; }; - 143F611F1565F0F900DB514A /* RAMSize.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 143F611D1565F0F900DB514A /* RAMSize.cpp */; }; - 143F61201565F0F900DB514A /* RAMSize.h in Headers */ = {isa = PBXBuildFile; fileRef = 143F611E1565F0F900DB514A /* RAMSize.h */; settings = {ATTRIBUTES = (); }; }; - 1469419216EAAF6D0024E146 /* RunLoopTimer.h in Headers */ = {isa = PBXBuildFile; fileRef = 1469419016EAAF6D0024E146 /* RunLoopTimer.h */; settings = {ATTRIBUTES = (); }; }; - 1469419316EAAF6D0024E146 /* RunLoopTimerCF.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1469419116EAAF6D0024E146 /* RunLoopTimerCF.cpp */; }; - 1469419616EAAFF80024E146 /* SchedulePair.h in Headers */ = {isa = PBXBuildFile; fileRef = 1469419416EAAFF80024E146 /* SchedulePair.h */; }; - 1469419716EAAFF80024E146 /* SchedulePairMac.mm in Sources */ = {isa = PBXBuildFile; fileRef = 1469419516EAAFF80024E146 /* SchedulePairMac.mm */; }; - 1469419916EAB0410024E146 /* SchedulePairCF.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1469419816EAB0410024E146 /* SchedulePairCF.cpp */; }; - 1469419C16EAB10A0024E146 /* AutodrainedPool.h in Headers */ = {isa = PBXBuildFile; fileRef = 1469419A16EAB10A0024E146 /* AutodrainedPool.h */; }; - 1469419D16EAB10A0024E146 /* AutodrainedPoolMac.mm in Sources */ = {isa = PBXBuildFile; fileRef = 1469419B16EAB10A0024E146 /* AutodrainedPoolMac.mm */; }; - 149EF16316BBFE0D000A4331 /* TriState.h in Headers */ = {isa = PBXBuildFile; fileRef = 149EF16216BBFE0D000A4331 /* TriState.h */; settings = {ATTRIBUTES = (); }; }; - 14F3B0F715E45E4600210069 /* SaturatedArithmetic.h in Headers */ = {isa = PBXBuildFile; fileRef = 14F3B0F615E45E4600210069 /* SaturatedArithmetic.h */; settings = {ATTRIBUTES = (); }; }; - 1A1D8B9C173186CE00141DA4 /* FunctionDispatcher.h in Headers */ = {isa = PBXBuildFile; fileRef = 1A1D8B9B173186CE00141DA4 /* FunctionDispatcher.h */; }; - 1A1D8B9E1731879800141DA4 /* FunctionDispatcher.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A1D8B9D1731879800141DA4 /* FunctionDispatcher.cpp */; }; - 1A233C7D17DAA6E300A93ACF /* MallocPtr.h in Headers */ = {isa = PBXBuildFile; fileRef = 1A233C7C17DAA6E300A93ACF /* MallocPtr.h */; }; - 1A6BB769162F300500DD16DB /* StreamBuffer.h in Headers */ = {isa = PBXBuildFile; fileRef = 1A6BB768162F300500DD16DB /* StreamBuffer.h */; }; - 1A6EB1E0187D0BD30030126F /* StringView.h in Headers */ = {isa = PBXBuildFile; fileRef = 1A6EB1DF187D0BD30030126F /* StringView.h */; }; - 1ACADD841884480100D8B71D /* DeprecatedSymbolsUsedBySafari.mm in Sources */ = {isa = PBXBuildFile; fileRef = 1ACADD821884480100D8B71D /* DeprecatedSymbolsUsedBySafari.mm */; }; - 1FA47C8A152502DA00568D1B /* WebCoreThread.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1FA47C88152502DA00568D1B /* WebCoreThread.cpp */; }; - 1FA47C8B152502DA00568D1B /* WebCoreThread.h in Headers */ = {isa = PBXBuildFile; fileRef = 1FA47C89152502DA00568D1B /* WebCoreThread.h */; }; - 26147B0A15DDCCDC00DDB907 /* IntegerToStringConversion.h in Headers */ = {isa = PBXBuildFile; fileRef = 26147B0815DDCCDC00DDB907 /* IntegerToStringConversion.h */; }; - 26299B6E17A9E5B800ADEBE5 /* Ref.h in Headers */ = {isa = PBXBuildFile; fileRef = 26299B6D17A9E5B800ADEBE5 /* Ref.h */; }; - 2C05385415BC819000F21B96 /* GregorianDateTime.h in Headers */ = {isa = PBXBuildFile; fileRef = 2C05385315BC819000F21B96 /* GregorianDateTime.h */; }; - 2CCD892A15C0390200285083 /* GregorianDateTime.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 2CCD892915C0390200285083 /* GregorianDateTime.cpp */; }; - 2CDED0EF18115C38004DBA70 /* RunLoopCF.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 2CDED0EE18115C38004DBA70 /* RunLoopCF.cpp */; }; - 2CDED0F318115C85004DBA70 /* RunLoop.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 2CDED0F118115C85004DBA70 /* RunLoop.cpp */; }; - 2CDED0F418115C85004DBA70 /* RunLoop.h in Headers */ = {isa = PBXBuildFile; fileRef = 2CDED0F218115C85004DBA70 /* RunLoop.h */; }; - 7CDD7FF8186D291E007433CD /* IteratorAdaptors.h in Headers */ = {isa = PBXBuildFile; fileRef = 7CDD7FF7186D291E007433CD /* IteratorAdaptors.h */; }; - 7CDD7FFA186D2A54007433CD /* IteratorRange.h in Headers */ = {isa = PBXBuildFile; fileRef = 7CDD7FF9186D2A54007433CD /* IteratorRange.h */; }; - 7E29C33E15FFD79B00516D61 /* ObjcRuntimeExtras.h in Headers */ = {isa = PBXBuildFile; fileRef = 7E29C33D15FFD79B00516D61 /* ObjcRuntimeExtras.h */; }; - 8134013815B092FD001FF0B8 /* Base64.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 8134013615B092FD001FF0B8 /* Base64.cpp */; }; - 8134013915B092FD001FF0B8 /* Base64.h in Headers */ = {isa = PBXBuildFile; fileRef = 8134013715B092FD001FF0B8 /* Base64.h */; }; - 93B1AA80180E5AF3004A2F05 /* PassRef.h in Headers */ = {isa = PBXBuildFile; fileRef = 93B1AA7F180E5AF3004A2F05 /* PassRef.h */; }; - 974CFC8E16A4F327006D5404 /* WeakPtr.h in Headers */ = {isa = PBXBuildFile; fileRef = 974CFC8D16A4F327006D5404 /* WeakPtr.h */; }; - 9BC70F05176C379D00101DEC /* AtomicStringTable.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 9BC70F04176C379D00101DEC /* AtomicStringTable.cpp */; }; - 9BD8F40B176C2B470002D865 /* AtomicStringTable.h in Headers */ = {isa = PBXBuildFile; fileRef = 9BD8F40A176C2AD80002D865 /* AtomicStringTable.h */; }; - A5BA15F3182433A900A82E69 /* StringMac.mm in Sources */ = {isa = PBXBuildFile; fileRef = A5BA15F2182433A900A82E69 /* StringMac.mm */; }; - A5BA15F51824348000A82E69 /* StringImplMac.mm in Sources */ = {isa = PBXBuildFile; fileRef = A5BA15F41824348000A82E69 /* StringImplMac.mm */; }; - A5BA15FA182435A600A82E69 /* AtomicStringCF.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A5BA15F7182435A600A82E69 /* AtomicStringCF.cpp */; }; - A5BA15FB182435A600A82E69 /* StringCF.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A5BA15F8182435A600A82E69 /* StringCF.cpp */; }; - A5BA15FC182435A600A82E69 /* StringImplCF.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A5BA15F9182435A600A82E69 /* StringImplCF.cpp */; }; - A70DA0841799F04D00529A9B /* Insertion.h in Headers */ = {isa = PBXBuildFile; fileRef = A70DA0821799F04D00529A9B /* Insertion.h */; }; - A70DA0851799F04D00529A9B /* ListDump.h in Headers */ = {isa = PBXBuildFile; fileRef = A70DA0831799F04D00529A9B /* ListDump.h */; }; - A748745217A0BDAE00FA04CB /* SixCharacterHash.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A748744F17A0BDAE00FA04CB /* SixCharacterHash.cpp */; }; - A748745317A0BDAE00FA04CB /* SixCharacterHash.h in Headers */ = {isa = PBXBuildFile; fileRef = A748745017A0BDAE00FA04CB /* SixCharacterHash.h */; }; - A748745417A0BDAE00FA04CB /* StringHashDumpContext.h in Headers */ = {isa = PBXBuildFile; fileRef = A748745117A0BDAE00FA04CB /* StringHashDumpContext.h */; }; - A7E643C617C5423B003BB16B /* Compression.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A7E643C417C5423B003BB16B /* Compression.cpp */; }; - A7E643C717C5423B003BB16B /* Compression.h in Headers */ = {isa = PBXBuildFile; fileRef = A7E643C517C5423B003BB16B /* Compression.h */; }; - A876DBD8151816E500DADB95 /* Platform.h in Headers */ = {isa = PBXBuildFile; fileRef = A876DBD7151816E500DADB95 /* Platform.h */; }; - A8A47385151A825B004123FF /* ASCIICType.h in Headers */ = {isa = PBXBuildFile; fileRef = A8A4725A151A825A004123FF /* ASCIICType.h */; }; - A8A47386151A825B004123FF /* Assertions.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A8A4725B151A825A004123FF /* Assertions.cpp */; }; - A8A47387151A825B004123FF /* Assertions.h in Headers */ = {isa = PBXBuildFile; fileRef = A8A4725C151A825A004123FF /* Assertions.h */; }; - A8A47388151A825B004123FF /* Atomics.h in Headers */ = {isa = PBXBuildFile; fileRef = A8A4725D151A825A004123FF /* Atomics.h */; }; - A8A47389151A825B004123FF /* AVLTree.h in Headers */ = {isa = PBXBuildFile; fileRef = A8A4725E151A825A004123FF /* AVLTree.h */; }; - A8A4738A151A825B004123FF /* Bitmap.h in Headers */ = {isa = PBXBuildFile; fileRef = A8A4725F151A825A004123FF /* Bitmap.h */; }; - A8A4738B151A825B004123FF /* BitVector.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A8A47260151A825A004123FF /* BitVector.cpp */; }; - A8A4738C151A825B004123FF /* BitVector.h in Headers */ = {isa = PBXBuildFile; fileRef = A8A47261151A825A004123FF /* BitVector.h */; }; - A8A4738E151A825B004123FF /* BlockStack.h in Headers */ = {isa = PBXBuildFile; fileRef = A8A47264151A825A004123FF /* BlockStack.h */; }; - A8A4738F151A825B004123FF /* BloomFilter.h in Headers */ = {isa = PBXBuildFile; fileRef = A8A47265151A825A004123FF /* BloomFilter.h */; }; - A8A47390151A825B004123FF /* BoundsCheckedPointer.h in Headers */ = {isa = PBXBuildFile; fileRef = A8A47266151A825A004123FF /* BoundsCheckedPointer.h */; }; - A8A47391151A825B004123FF /* BumpPointerAllocator.h in Headers */ = {isa = PBXBuildFile; fileRef = A8A47267151A825A004123FF /* BumpPointerAllocator.h */; }; - A8A47394151A825B004123FF /* CheckedArithmetic.h in Headers */ = {isa = PBXBuildFile; fileRef = A8A4726A151A825A004123FF /* CheckedArithmetic.h */; }; - A8A47395151A825B004123FF /* CheckedBoolean.h in Headers */ = {isa = PBXBuildFile; fileRef = A8A4726B151A825A004123FF /* CheckedBoolean.h */; }; - A8A47398151A825B004123FF /* Compiler.h in Headers */ = {isa = PBXBuildFile; fileRef = A8A47270151A825A004123FF /* Compiler.h */; }; - A8A4739A151A825B004123FF /* CryptographicallyRandomNumber.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A8A47273151A825A004123FF /* CryptographicallyRandomNumber.cpp */; }; - A8A4739B151A825B004123FF /* CryptographicallyRandomNumber.h in Headers */ = {isa = PBXBuildFile; fileRef = A8A47274151A825A004123FF /* CryptographicallyRandomNumber.h */; }; - A8A4739C151A825B004123FF /* CurrentTime.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A8A47275151A825A004123FF /* CurrentTime.cpp */; }; - A8A4739D151A825B004123FF /* CurrentTime.h in Headers */ = {isa = PBXBuildFile; fileRef = A8A47276151A825A004123FF /* CurrentTime.h */; }; - A8A4739E151A825B004123FF /* DataLog.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A8A47277151A825A004123FF /* DataLog.cpp */; }; - A8A4739F151A825B004123FF /* DataLog.h in Headers */ = {isa = PBXBuildFile; fileRef = A8A47278151A825A004123FF /* DataLog.h */; }; - A8A473A0151A825B004123FF /* DateMath.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A8A47279151A825A004123FF /* DateMath.cpp */; }; - A8A473A1151A825B004123FF /* DateMath.h in Headers */ = {isa = PBXBuildFile; fileRef = A8A4727A151A825A004123FF /* DateMath.h */; }; - A8A473A2151A825B004123FF /* DecimalNumber.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A8A4727B151A825A004123FF /* DecimalNumber.cpp */; }; - A8A473A3151A825B004123FF /* DecimalNumber.h in Headers */ = {isa = PBXBuildFile; fileRef = A8A4727C151A825A004123FF /* DecimalNumber.h */; }; - A8A473A4151A825B004123FF /* Decoder.h in Headers */ = {isa = PBXBuildFile; fileRef = A8A4727D151A825A004123FF /* Decoder.h */; }; - A8A473A5151A825B004123FF /* Deque.h in Headers */ = {isa = PBXBuildFile; fileRef = A8A4727E151A825A004123FF /* Deque.h */; }; - A8A473A6151A825B004123FF /* DisallowCType.h in Headers */ = {isa = PBXBuildFile; fileRef = A8A4727F151A825A004123FF /* DisallowCType.h */; }; - A8A473A7151A825B004123FF /* DoublyLinkedList.h in Headers */ = {isa = PBXBuildFile; fileRef = A8A47280151A825A004123FF /* DoublyLinkedList.h */; }; - A8A473A8151A825B004123FF /* bignum-dtoa.cc in Sources */ = {isa = PBXBuildFile; fileRef = A8A47282151A825A004123FF /* bignum-dtoa.cc */; }; - A8A473A9151A825B004123FF /* bignum-dtoa.h in Headers */ = {isa = PBXBuildFile; fileRef = A8A47283151A825A004123FF /* bignum-dtoa.h */; }; - A8A473AA151A825B004123FF /* bignum.cc in Sources */ = {isa = PBXBuildFile; fileRef = A8A47284151A825A004123FF /* bignum.cc */; }; - A8A473AB151A825B004123FF /* bignum.h in Headers */ = {isa = PBXBuildFile; fileRef = A8A47285151A825A004123FF /* bignum.h */; }; - A8A473AC151A825B004123FF /* cached-powers.cc in Sources */ = {isa = PBXBuildFile; fileRef = A8A47286151A825A004123FF /* cached-powers.cc */; }; - A8A473AD151A825B004123FF /* cached-powers.h in Headers */ = {isa = PBXBuildFile; fileRef = A8A47287151A825A004123FF /* cached-powers.h */; }; - A8A473AE151A825B004123FF /* diy-fp.cc in Sources */ = {isa = PBXBuildFile; fileRef = A8A47289151A825A004123FF /* diy-fp.cc */; }; - A8A473AF151A825B004123FF /* diy-fp.h in Headers */ = {isa = PBXBuildFile; fileRef = A8A4728A151A825A004123FF /* diy-fp.h */; }; - A8A473B0151A825B004123FF /* double-conversion.cc in Sources */ = {isa = PBXBuildFile; fileRef = A8A4728B151A825A004123FF /* double-conversion.cc */; }; - A8A473B1151A825B004123FF /* double-conversion.h in Headers */ = {isa = PBXBuildFile; fileRef = A8A4728C151A825A004123FF /* double-conversion.h */; }; - A8A473B2151A825B004123FF /* double.h in Headers */ = {isa = PBXBuildFile; fileRef = A8A4728D151A825A004123FF /* double.h */; }; - A8A473B3151A825B004123FF /* fast-dtoa.cc in Sources */ = {isa = PBXBuildFile; fileRef = A8A4728E151A825A004123FF /* fast-dtoa.cc */; }; - A8A473B4151A825B004123FF /* fast-dtoa.h in Headers */ = {isa = PBXBuildFile; fileRef = A8A4728F151A825A004123FF /* fast-dtoa.h */; }; - A8A473B5151A825B004123FF /* fixed-dtoa.cc in Sources */ = {isa = PBXBuildFile; fileRef = A8A47290151A825A004123FF /* fixed-dtoa.cc */; }; - A8A473B6151A825B004123FF /* fixed-dtoa.h in Headers */ = {isa = PBXBuildFile; fileRef = A8A47291151A825A004123FF /* fixed-dtoa.h */; }; - A8A473B7151A825B004123FF /* strtod.cc in Sources */ = {isa = PBXBuildFile; fileRef = A8A47294151A825A004123FF /* strtod.cc */; }; - A8A473B8151A825B004123FF /* strtod.h in Headers */ = {isa = PBXBuildFile; fileRef = A8A47295151A825A004123FF /* strtod.h */; }; - A8A473B9151A825B004123FF /* utils.h in Headers */ = {isa = PBXBuildFile; fileRef = A8A47296151A825A004123FF /* utils.h */; }; - A8A473BA151A825B004123FF /* dtoa.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A8A47297151A825A004123FF /* dtoa.cpp */; }; - A8A473BB151A825B004123FF /* dtoa.h in Headers */ = {isa = PBXBuildFile; fileRef = A8A47298151A825A004123FF /* dtoa.h */; }; - A8A473BC151A825B004123FF /* DynamicAnnotations.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A8A47299151A825A004123FF /* DynamicAnnotations.cpp */; }; - A8A473BD151A825B004123FF /* DynamicAnnotations.h in Headers */ = {isa = PBXBuildFile; fileRef = A8A4729A151A825A004123FF /* DynamicAnnotations.h */; }; - A8A473C0151A825B004123FF /* Encoder.h in Headers */ = {isa = PBXBuildFile; fileRef = A8A4729E151A825A004123FF /* Encoder.h */; }; - A8A473C1151A825B004123FF /* ExportMacros.h in Headers */ = {isa = PBXBuildFile; fileRef = A8A4729F151A825A004123FF /* ExportMacros.h */; }; - A8A473C3151A825B004123FF /* FastMalloc.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A8A472A1151A825A004123FF /* FastMalloc.cpp */; }; - A8A473C4151A825B004123FF /* FastMalloc.h in Headers */ = {isa = PBXBuildFile; fileRef = A8A472A2151A825A004123FF /* FastMalloc.h */; }; - A8A473C8151A825B004123FF /* Forward.h in Headers */ = {isa = PBXBuildFile; fileRef = A8A472A6151A825A004123FF /* Forward.h */; }; - A8A473C9151A825B004123FF /* Functional.h in Headers */ = {isa = PBXBuildFile; fileRef = A8A472A7151A825A004123FF /* Functional.h */; }; - A8A473CA151A825B004123FF /* GetPtr.h in Headers */ = {isa = PBXBuildFile; fileRef = A8A472A8151A825A004123FF /* GetPtr.h */; }; - A8A473D3151A825B004123FF /* HashCountedSet.h in Headers */ = {isa = PBXBuildFile; fileRef = A8A472B3151A825A004123FF /* HashCountedSet.h */; }; - A8A473D4151A825B004123FF /* HashFunctions.h in Headers */ = {isa = PBXBuildFile; fileRef = A8A472B4151A825A004123FF /* HashFunctions.h */; }; - A8A473D5151A825B004123FF /* HashIterators.h in Headers */ = {isa = PBXBuildFile; fileRef = A8A472B5151A825A004123FF /* HashIterators.h */; }; - A8A473D6151A825B004123FF /* HashMap.h in Headers */ = {isa = PBXBuildFile; fileRef = A8A472B6151A825A004123FF /* HashMap.h */; }; - A8A473D7151A825B004123FF /* HashSet.h in Headers */ = {isa = PBXBuildFile; fileRef = A8A472B7151A825A004123FF /* HashSet.h */; }; - A8A473D8151A825B004123FF /* HashTable.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A8A472B8151A825A004123FF /* HashTable.cpp */; }; - A8A473D9151A825B004123FF /* HashTable.h in Headers */ = {isa = PBXBuildFile; fileRef = A8A472B9151A825A004123FF /* HashTable.h */; }; - A8A473DA151A825B004123FF /* HashTraits.h in Headers */ = {isa = PBXBuildFile; fileRef = A8A472BA151A825A004123FF /* HashTraits.h */; }; - A8A473DB151A825B004123FF /* HexNumber.h in Headers */ = {isa = PBXBuildFile; fileRef = A8A472BB151A825A004123FF /* HexNumber.h */; }; - A8A473DC151A825B004123FF /* InlineASM.h in Headers */ = {isa = PBXBuildFile; fileRef = A8A472BC151A825A004123FF /* InlineASM.h */; }; - A8A473E1151A825B004123FF /* ListHashSet.h in Headers */ = {isa = PBXBuildFile; fileRef = A8A472C1151A825A004123FF /* ListHashSet.h */; }; - A8A473E3151A825B004123FF /* Locker.h in Headers */ = {isa = PBXBuildFile; fileRef = A8A472C3151A825A004123FF /* Locker.h */; }; - A8A473E4151A825B004123FF /* MainThreadMac.mm in Sources */ = {isa = PBXBuildFile; fileRef = A8A472C5151A825A004123FF /* MainThreadMac.mm */; }; - A8A473E5151A825B004123FF /* MainThread.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A8A472C6151A825A004123FF /* MainThread.cpp */; }; - A8A473E6151A825B004123FF /* MainThread.h in Headers */ = {isa = PBXBuildFile; fileRef = A8A472C7151A825B004123FF /* MainThread.h */; }; - A8A473E8151A825B004123FF /* MathExtras.h in Headers */ = {isa = PBXBuildFile; fileRef = A8A472C9151A825B004123FF /* MathExtras.h */; }; - A8A473E9151A825B004123FF /* MD5.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A8A472CA151A825B004123FF /* MD5.cpp */; }; - A8A473EA151A825B004123FF /* MD5.h in Headers */ = {isa = PBXBuildFile; fileRef = A8A472CB151A825B004123FF /* MD5.h */; }; - A8A473EB151A825B004123FF /* MessageQueue.h in Headers */ = {isa = PBXBuildFile; fileRef = A8A472CC151A825B004123FF /* MessageQueue.h */; }; - A8A473EC151A825B004123FF /* MetaAllocator.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A8A472CD151A825B004123FF /* MetaAllocator.cpp */; }; - A8A473ED151A825B004123FF /* MetaAllocator.h in Headers */ = {isa = PBXBuildFile; fileRef = A8A472CE151A825B004123FF /* MetaAllocator.h */; }; - A8A473EE151A825B004123FF /* MetaAllocatorHandle.h in Headers */ = {isa = PBXBuildFile; fileRef = A8A472CF151A825B004123FF /* MetaAllocatorHandle.h */; }; - A8A473EF151A825B004123FF /* Noncopyable.h in Headers */ = {isa = PBXBuildFile; fileRef = A8A472D0151A825B004123FF /* Noncopyable.h */; }; - A8A473F4151A825B004123FF /* NumberOfCores.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A8A472D5151A825B004123FF /* NumberOfCores.cpp */; }; - A8A473F5151A825B004123FF /* NumberOfCores.h in Headers */ = {isa = PBXBuildFile; fileRef = A8A472D6151A825B004123FF /* NumberOfCores.h */; }; - A8A473F6151A825B004123FF /* OSAllocator.h in Headers */ = {isa = PBXBuildFile; fileRef = A8A472D7151A825B004123FF /* OSAllocator.h */; }; - A8A473F7151A825B004123FF /* OSAllocatorPosix.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A8A472D8151A825B004123FF /* OSAllocatorPosix.cpp */; }; - A8A473F9151A825B004123FF /* OSRandomSource.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A8A472DA151A825B004123FF /* OSRandomSource.cpp */; }; - A8A473FA151A825B004123FF /* OSRandomSource.h in Headers */ = {isa = PBXBuildFile; fileRef = A8A472DB151A825B004123FF /* OSRandomSource.h */; }; - A8A473FC151A825B004123FF /* OwnPtr.h in Headers */ = {isa = PBXBuildFile; fileRef = A8A472DD151A825B004123FF /* OwnPtr.h */; }; - A8A473FD151A825B004123FF /* OwnPtrCommon.h in Headers */ = {isa = PBXBuildFile; fileRef = A8A472DE151A825B004123FF /* OwnPtrCommon.h */; }; - A8A473FE151A825B004123FF /* PackedIntVector.h in Headers */ = {isa = PBXBuildFile; fileRef = A8A472DF151A825B004123FF /* PackedIntVector.h */; }; - A8A473FF151A825B004123FF /* PageAllocation.h in Headers */ = {isa = PBXBuildFile; fileRef = A8A472E0151A825B004123FF /* PageAllocation.h */; }; - A8A47400151A825B004123FF /* PageAllocationAligned.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A8A472E1151A825B004123FF /* PageAllocationAligned.cpp */; }; - A8A47401151A825B004123FF /* PageAllocationAligned.h in Headers */ = {isa = PBXBuildFile; fileRef = A8A472E2151A825B004123FF /* PageAllocationAligned.h */; }; - A8A47402151A825B004123FF /* PageBlock.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A8A472E3151A825B004123FF /* PageBlock.cpp */; }; - A8A47403151A825B004123FF /* PageBlock.h in Headers */ = {isa = PBXBuildFile; fileRef = A8A472E4151A825B004123FF /* PageBlock.h */; }; - A8A47404151A825B004123FF /* PageReservation.h in Headers */ = {isa = PBXBuildFile; fileRef = A8A472E5151A825B004123FF /* PageReservation.h */; }; - A8A47405151A825B004123FF /* ParallelJobs.h in Headers */ = {isa = PBXBuildFile; fileRef = A8A472E6151A825B004123FF /* ParallelJobs.h */; }; - A8A47408151A825B004123FF /* ParallelJobsLibdispatch.h in Headers */ = {isa = PBXBuildFile; fileRef = A8A472E9151A825B004123FF /* ParallelJobsLibdispatch.h */; }; - A8A4740B151A825B004123FF /* PassOwnPtr.h in Headers */ = {isa = PBXBuildFile; fileRef = A8A472EC151A825B004123FF /* PassOwnPtr.h */; }; - A8A4740C151A825B004123FF /* PassRefPtr.h in Headers */ = {isa = PBXBuildFile; fileRef = A8A472ED151A825B004123FF /* PassRefPtr.h */; }; - A8A4740F151A825B004123FF /* PossiblyNull.h in Headers */ = {isa = PBXBuildFile; fileRef = A8A472F3151A825B004123FF /* PossiblyNull.h */; }; - A8A47414151A825B004123FF /* RandomNumber.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A8A472FB151A825B004123FF /* RandomNumber.cpp */; }; - A8A47415151A825B004123FF /* RandomNumber.h in Headers */ = {isa = PBXBuildFile; fileRef = A8A472FC151A825B004123FF /* RandomNumber.h */; }; - A8A47416151A825B004123FF /* RandomNumberSeed.h in Headers */ = {isa = PBXBuildFile; fileRef = A8A472FD151A825B004123FF /* RandomNumberSeed.h */; }; - A8A47417151A825B004123FF /* RedBlackTree.h in Headers */ = {isa = PBXBuildFile; fileRef = A8A472FE151A825B004123FF /* RedBlackTree.h */; }; - A8A47418151A825B004123FF /* RefCounted.h in Headers */ = {isa = PBXBuildFile; fileRef = A8A472FF151A825B004123FF /* RefCounted.h */; }; - A8A47419151A825B004123FF /* RefCountedArray.h in Headers */ = {isa = PBXBuildFile; fileRef = A8A47300151A825B004123FF /* RefCountedArray.h */; }; - A8A4741A151A825B004123FF /* RefCountedLeakCounter.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A8A47301151A825B004123FF /* RefCountedLeakCounter.cpp */; }; - A8A4741B151A825B004123FF /* RefCountedLeakCounter.h in Headers */ = {isa = PBXBuildFile; fileRef = A8A47302151A825B004123FF /* RefCountedLeakCounter.h */; }; - A8A4741C151A825B004123FF /* RefPtr.h in Headers */ = {isa = PBXBuildFile; fileRef = A8A47303151A825B004123FF /* RefPtr.h */; }; - A8A4741D151A825B004123FF /* RefPtrHashMap.h in Headers */ = {isa = PBXBuildFile; fileRef = A8A47304151A825B004123FF /* RefPtrHashMap.h */; }; - A8A4741E151A825B004123FF /* RetainPtr.h in Headers */ = {isa = PBXBuildFile; fileRef = A8A47305151A825B004123FF /* RetainPtr.h */; }; - A8A4741F151A825B004123FF /* SegmentedVector.h in Headers */ = {isa = PBXBuildFile; fileRef = A8A47306151A825B004123FF /* SegmentedVector.h */; }; - A8A47420151A825B004123FF /* SentinelLinkedList.h in Headers */ = {isa = PBXBuildFile; fileRef = A8A47307151A825B004123FF /* SentinelLinkedList.h */; }; - A8A47421151A825B004123FF /* SHA1.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A8A47308151A825B004123FF /* SHA1.cpp */; }; - A8A47422151A825B004123FF /* SHA1.h in Headers */ = {isa = PBXBuildFile; fileRef = A8A47309151A825B004123FF /* SHA1.h */; }; - A8A47423151A825B004123FF /* SimpleStats.h in Headers */ = {isa = PBXBuildFile; fileRef = A8A4730A151A825B004123FF /* SimpleStats.h */; }; - A8A47424151A825B004123FF /* SinglyLinkedList.h in Headers */ = {isa = PBXBuildFile; fileRef = A8A4730B151A825B004123FF /* SinglyLinkedList.h */; }; - A8A47425151A825B004123FF /* SizeLimits.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A8A4730C151A825B004123FF /* SizeLimits.cpp */; }; - A8A47426151A825B004123FF /* Spectrum.h in Headers */ = {isa = PBXBuildFile; fileRef = A8A4730D151A825B004123FF /* Spectrum.h */; }; - A8A47427151A825B004123FF /* StackBounds.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A8A4730E151A825B004123FF /* StackBounds.cpp */; }; - A8A47428151A825B004123FF /* StackBounds.h in Headers */ = {isa = PBXBuildFile; fileRef = A8A4730F151A825B004123FF /* StackBounds.h */; }; - A8A47429151A825B004123FF /* StaticConstructors.h in Headers */ = {isa = PBXBuildFile; fileRef = A8A47310151A825B004123FF /* StaticConstructors.h */; }; - A8A4742A151A825B004123FF /* StdLibExtras.h in Headers */ = {isa = PBXBuildFile; fileRef = A8A47311151A825B004123FF /* StdLibExtras.h */; }; - A8A4742C151A825B004123FF /* StringExtras.h in Headers */ = {isa = PBXBuildFile; fileRef = A8A47313151A825B004123FF /* StringExtras.h */; }; - A8A4742D151A825B004123FF /* StringHasher.h in Headers */ = {isa = PBXBuildFile; fileRef = A8A47314151A825B004123FF /* StringHasher.h */; }; - A8A4742E151A825B004123FF /* TCPackedCache.h in Headers */ = {isa = PBXBuildFile; fileRef = A8A47315151A825B004123FF /* TCPackedCache.h */; }; - A8A4742F151A825B004123FF /* TCPageMap.h in Headers */ = {isa = PBXBuildFile; fileRef = A8A47316151A825B004123FF /* TCPageMap.h */; }; - A8A47430151A825B004123FF /* TCSpinLock.h in Headers */ = {isa = PBXBuildFile; fileRef = A8A47317151A825B004123FF /* TCSpinLock.h */; }; - A8A47431151A825B004123FF /* TCSystemAlloc.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A8A47318151A825B004123FF /* TCSystemAlloc.cpp */; }; - A8A47432151A825B004123FF /* TCSystemAlloc.h in Headers */ = {isa = PBXBuildFile; fileRef = A8A47319151A825B004123FF /* TCSystemAlloc.h */; }; - A8A47433151A825B004123FF /* TemporaryChange.h in Headers */ = {isa = PBXBuildFile; fileRef = A8A4731A151A825B004123FF /* TemporaryChange.h */; }; - A8A47434151A825B004123FF /* ASCIIFastPath.h in Headers */ = {isa = PBXBuildFile; fileRef = A8A4731C151A825B004123FF /* ASCIIFastPath.h */; }; - A8A47435151A825B004123FF /* AtomicString.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A8A4731D151A825B004123FF /* AtomicString.cpp */; }; - A8A47436151A825B004123FF /* AtomicString.h in Headers */ = {isa = PBXBuildFile; fileRef = A8A4731E151A825B004123FF /* AtomicString.h */; }; - A8A47437151A825B004123FF /* AtomicStringHash.h in Headers */ = {isa = PBXBuildFile; fileRef = A8A4731F151A825B004123FF /* AtomicStringHash.h */; }; - A8A47438151A825B004123FF /* AtomicStringImpl.h in Headers */ = {isa = PBXBuildFile; fileRef = A8A47320151A825B004123FF /* AtomicStringImpl.h */; }; - A8A47439151A825B004123FF /* CString.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A8A47321151A825B004123FF /* CString.cpp */; }; - A8A4743A151A825B004123FF /* CString.h in Headers */ = {isa = PBXBuildFile; fileRef = A8A47322151A825B004123FF /* CString.h */; }; - A8A4743B151A825B004123FF /* StringBuffer.h in Headers */ = {isa = PBXBuildFile; fileRef = A8A47323151A825B004123FF /* StringBuffer.h */; }; - A8A4743C151A825B004123FF /* StringBuilder.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A8A47324151A825B004123FF /* StringBuilder.cpp */; }; - A8A4743D151A825B004123FF /* StringBuilder.h in Headers */ = {isa = PBXBuildFile; fileRef = A8A47325151A825B004123FF /* StringBuilder.h */; }; - A8A4743E151A825B004123FF /* StringConcatenate.h in Headers */ = {isa = PBXBuildFile; fileRef = A8A47326151A825B004123FF /* StringConcatenate.h */; }; - A8A4743F151A825B004123FF /* StringHash.h in Headers */ = {isa = PBXBuildFile; fileRef = A8A47327151A825B004123FF /* StringHash.h */; }; - A8A47440151A825B004123FF /* StringImpl.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A8A47328151A825B004123FF /* StringImpl.cpp */; }; - A8A47441151A825B004123FF /* StringImpl.h in Headers */ = {isa = PBXBuildFile; fileRef = A8A47329151A825B004123FF /* StringImpl.h */; }; - A8A47442151A825B004123FF /* StringOperators.h in Headers */ = {isa = PBXBuildFile; fileRef = A8A4732A151A825B004123FF /* StringOperators.h */; }; - A8A47443151A825B004123FF /* StringStatics.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A8A4732B151A825B004123FF /* StringStatics.cpp */; }; - A8A47444151A825B004123FF /* TextPosition.h in Headers */ = {isa = PBXBuildFile; fileRef = A8A4732C151A825B004123FF /* TextPosition.h */; }; - A8A47445151A825B004123FF /* WTFString.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A8A4732D151A825B004123FF /* WTFString.cpp */; }; - A8A47446151A825B004123FF /* WTFString.h in Headers */ = {isa = PBXBuildFile; fileRef = A8A4732E151A825B004123FF /* WTFString.h */; }; - A8A47447151A825B004123FF /* ThreadFunctionInvocation.h in Headers */ = {isa = PBXBuildFile; fileRef = A8A4732F151A825B004123FF /* ThreadFunctionInvocation.h */; }; - A8A47448151A825B004123FF /* ThreadIdentifierDataPthreads.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A8A47330151A825B004123FF /* ThreadIdentifierDataPthreads.cpp */; }; - A8A47449151A825B004123FF /* ThreadIdentifierDataPthreads.h in Headers */ = {isa = PBXBuildFile; fileRef = A8A47331151A825B004123FF /* ThreadIdentifierDataPthreads.h */; }; - A8A4744A151A825B004123FF /* Threading.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A8A47332151A825B004123FF /* Threading.cpp */; }; - A8A4744B151A825B004123FF /* Threading.h in Headers */ = {isa = PBXBuildFile; fileRef = A8A47333151A825B004123FF /* Threading.h */; }; - A8A4744D151A825B004123FF /* ThreadingPrimitives.h in Headers */ = {isa = PBXBuildFile; fileRef = A8A47335151A825B004123FF /* ThreadingPrimitives.h */; }; - A8A4744E151A825B004123FF /* ThreadingPthreads.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A8A47336151A825B004123FF /* ThreadingPthreads.cpp */; }; - A8A47451151A825B004123FF /* BinarySemaphore.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A8A4733A151A825B004123FF /* BinarySemaphore.cpp */; }; - A8A47452151A825B004123FF /* BinarySemaphore.h in Headers */ = {isa = PBXBuildFile; fileRef = A8A4733B151A825B004123FF /* BinarySemaphore.h */; }; - A8A47454151A825B004123FF /* ThreadSafeRefCounted.h in Headers */ = {isa = PBXBuildFile; fileRef = A8A4733E151A825B004123FF /* ThreadSafeRefCounted.h */; }; - A8A47455151A825B004123FF /* ThreadSpecific.h in Headers */ = {isa = PBXBuildFile; fileRef = A8A4733F151A825B004123FF /* ThreadSpecific.h */; }; - A8A4745E151A825B004123FF /* CharacterNames.h in Headers */ = {isa = PBXBuildFile; fileRef = A8A47349151A825B004123FF /* CharacterNames.h */; }; - A8A4745F151A825B004123FF /* Collator.h in Headers */ = {isa = PBXBuildFile; fileRef = A8A4734A151A825B004123FF /* Collator.h */; }; - A8A47460151A825B004123FF /* CollatorDefault.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A8A4734B151A825B004123FF /* CollatorDefault.cpp */; }; - A8A47463151A825B004123FF /* CollatorICU.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A8A47350151A825B004123FF /* CollatorICU.cpp */; }; - A8A47464151A825B004123FF /* UnicodeIcu.h in Headers */ = {isa = PBXBuildFile; fileRef = A8A47351151A825B004123FF /* UnicodeIcu.h */; }; - A8A47466151A825B004123FF /* ScriptCodesFromICU.h in Headers */ = {isa = PBXBuildFile; fileRef = A8A47354151A825B004123FF /* ScriptCodesFromICU.h */; }; - A8A47467151A825B004123FF /* Unicode.h in Headers */ = {isa = PBXBuildFile; fileRef = A8A47355151A825B004123FF /* Unicode.h */; }; - A8A47468151A825B004123FF /* UnicodeMacrosFromICU.h in Headers */ = {isa = PBXBuildFile; fileRef = A8A47356151A825B004123FF /* UnicodeMacrosFromICU.h */; }; - A8A47469151A825B004123FF /* UTF8.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A8A47357151A825B004123FF /* UTF8.cpp */; }; - A8A4746A151A825B004123FF /* UTF8.h in Headers */ = {isa = PBXBuildFile; fileRef = A8A47358151A825B004123FF /* UTF8.h */; }; - A8A4746D151A825B004123FF /* UnionFind.h in Headers */ = {isa = PBXBuildFile; fileRef = A8A4735C151A825B004123FF /* UnionFind.h */; }; - A8A4747D151A825B004123FF /* ValueCheck.h in Headers */ = {isa = PBXBuildFile; fileRef = A8A4736F151A825B004123FF /* ValueCheck.h */; }; - A8A4747E151A825B004123FF /* Vector.h in Headers */ = {isa = PBXBuildFile; fileRef = A8A47370151A825B004123FF /* Vector.h */; }; - A8A4747F151A825B004123FF /* VectorTraits.h in Headers */ = {isa = PBXBuildFile; fileRef = A8A47371151A825B004123FF /* VectorTraits.h */; }; - A8A47480151A825B004123FF /* VMTags.h in Headers */ = {isa = PBXBuildFile; fileRef = A8A47372151A825B004123FF /* VMTags.h */; }; - A8A47486151A825B004123FF /* WTFThreadData.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A8A4737A151A825B004123FF /* WTFThreadData.cpp */; }; - A8A47487151A825B004123FF /* WTFThreadData.h in Headers */ = {isa = PBXBuildFile; fileRef = A8A4737B151A825B004123FF /* WTFThreadData.h */; }; - A8A4748C151A8264004123FF /* config.h in Headers */ = {isa = PBXBuildFile; fileRef = A8A4748B151A8264004123FF /* config.h */; }; - B38FD7BD168953E80065C969 /* FeatureDefines.h in Headers */ = {isa = PBXBuildFile; fileRef = B38FD7BC168953E80065C969 /* FeatureDefines.h */; }; - CD5497AC15857D0300B5BC30 /* MediaTime.cpp in Sources */ = {isa = PBXBuildFile; fileRef = CD5497AA15857D0300B5BC30 /* MediaTime.cpp */; }; - CD5497AD15857D0300B5BC30 /* MediaTime.h in Headers */ = {isa = PBXBuildFile; fileRef = CD5497AB15857D0300B5BC30 /* MediaTime.h */; }; - EB95E1F0161A72410089A2F5 /* ByteOrder.h in Headers */ = {isa = PBXBuildFile; fileRef = EB95E1EF161A72410089A2F5 /* ByteOrder.h */; }; - FEDACD3D1630F83F00C69634 /* StackStats.cpp in Sources */ = {isa = PBXBuildFile; fileRef = FEDACD3B1630F83F00C69634 /* StackStats.cpp */; }; - FEDACD3E1630F83F00C69634 /* StackStats.h in Headers */ = {isa = PBXBuildFile; fileRef = FEDACD3C1630F83F00C69634 /* StackStats.h */; }; /* End PBXBuildFile section */ /* Begin PBXContainerItemProxy section */ @@ -536,13 +283,6 @@ remoteGlobalIDString = 65AFA16F1630B977003D723C; remoteInfo = "Copy Headers"; }; - 65AFA28D1630B99E003D723C /* PBXContainerItemProxy */ = { - isa = PBXContainerItemProxy; - containerPortal = 5D247B5914689B8600E78B76 /* Project object */; - proxyType = 1; - remoteGlobalIDString = 65AFA16F1630B977003D723C; - remoteInfo = "Copy Headers"; - }; /* End PBXContainerItemProxy section */ /* Begin PBXFileReference section */ @@ -596,7 +336,6 @@ 2CDED0F118115C85004DBA70 /* RunLoop.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = RunLoop.cpp; sourceTree = ""; }; 2CDED0F218115C85004DBA70 /* RunLoop.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RunLoop.h; sourceTree = ""; }; 44DEE74A152274BB00C6EC37 /* iOS.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; path = iOS.xcconfig; sourceTree = ""; }; - 5D247B6214689B8600E78B76 /* libWTF.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = libWTF.a; sourceTree = BUILT_PRODUCTS_DIR; }; 5D247B6E14689C4700E78B76 /* Base.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; path = Base.xcconfig; sourceTree = ""; }; 5D247B7014689C4700E78B76 /* DebugRelease.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; path = DebugRelease.xcconfig; sourceTree = ""; }; 5D247B7314689C4700E78B76 /* WTF.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; path = WTF.xcconfig; sourceTree = ""; }; @@ -822,13 +561,6 @@ ); runOnlyForDeploymentPostprocessing = 0; }; - 5D247B5F14689B8600E78B76 /* Frameworks */ = { - isa = PBXFrameworksBuildPhase; - buildActionMask = 2147483647; - files = ( - ); - runOnlyForDeploymentPostprocessing = 0; - }; /* End PBXFrameworksBuildPhase section */ /* Begin PBXGroup section */ @@ -861,7 +593,6 @@ 5D247B6314689B8600E78B76 /* Products */ = { isa = PBXGroup; children = ( - 5D247B6214689B8600E78B76 /* libWTF.a */, 10EAA8091889E93100DEB161 /* libWTF.a */, ); name = Products; @@ -1404,191 +1135,6 @@ ); runOnlyForDeploymentPostprocessing = 0; }; - 5D247B6014689B8600E78B76 /* Headers */ = { - isa = PBXHeadersBuildPhase; - buildActionMask = 2147483647; - files = ( - A8A47385151A825B004123FF /* ASCIICType.h in Headers */, - A8A47434151A825B004123FF /* ASCIIFastPath.h in Headers */, - A8A47387151A825B004123FF /* Assertions.h in Headers */, - A8A47388151A825B004123FF /* Atomics.h in Headers */, - A8A47436151A825B004123FF /* AtomicString.h in Headers */, - 7CDD7FF8186D291E007433CD /* IteratorAdaptors.h in Headers */, - A8A47437151A825B004123FF /* AtomicStringHash.h in Headers */, - A8A47438151A825B004123FF /* AtomicStringImpl.h in Headers */, - 9BD8F40B176C2B470002D865 /* AtomicStringTable.h in Headers */, - 1469419C16EAB10A0024E146 /* AutodrainedPool.h in Headers */, - A8A47389151A825B004123FF /* AVLTree.h in Headers */, - 8134013915B092FD001FF0B8 /* Base64.h in Headers */, - A8A473A9151A825B004123FF /* bignum-dtoa.h in Headers */, - A8A473AB151A825B004123FF /* bignum.h in Headers */, - 7CDD7FFA186D2A54007433CD /* IteratorRange.h in Headers */, - A8A47452151A825B004123FF /* BinarySemaphore.h in Headers */, - A8A4738A151A825B004123FF /* Bitmap.h in Headers */, - A8A4738C151A825B004123FF /* BitVector.h in Headers */, - A8A4738E151A825B004123FF /* BlockStack.h in Headers */, - A8A4738F151A825B004123FF /* BloomFilter.h in Headers */, - A8A47390151A825B004123FF /* BoundsCheckedPointer.h in Headers */, - A8A47391151A825B004123FF /* BumpPointerAllocator.h in Headers */, - EB95E1F0161A72410089A2F5 /* ByteOrder.h in Headers */, - A8A473AD151A825B004123FF /* cached-powers.h in Headers */, - A8A4745E151A825B004123FF /* CharacterNames.h in Headers */, - A8A47394151A825B004123FF /* CheckedArithmetic.h in Headers */, - A8A47395151A825B004123FF /* CheckedBoolean.h in Headers */, - A8A4745F151A825B004123FF /* Collator.h in Headers */, - 0FC4EDE61696149600F65041 /* CommaPrinter.h in Headers */, - 0F8F2B91172E00FC007DBDA5 /* CompilationThread.h in Headers */, - A8A47398151A825B004123FF /* Compiler.h in Headers */, - A7E643C717C5423B003BB16B /* Compression.h in Headers */, - A8A4748C151A8264004123FF /* config.h in Headers */, - 0F8F2B9C172F2596007DBDA5 /* ConversionMode.h in Headers */, - A8A4739B151A825B004123FF /* CryptographicallyRandomNumber.h in Headers */, - A8A4743A151A825B004123FF /* CString.h in Headers */, - A8A4739D151A825B004123FF /* CurrentTime.h in Headers */, - A8A4739F151A825B004123FF /* DataLog.h in Headers */, - A8A473A1151A825B004123FF /* DateMath.h in Headers */, - A8A473A3151A825B004123FF /* DecimalNumber.h in Headers */, - A8A473A4151A825B004123FF /* Decoder.h in Headers */, - 0F2B66A617B6B4FB00A7AE3F /* DeferrableRefCounted.h in Headers */, - A8A473A5151A825B004123FF /* Deque.h in Headers */, - A8A473A6151A825B004123FF /* DisallowCType.h in Headers */, - A8A473AF151A825B004123FF /* diy-fp.h in Headers */, - A8A473B1151A825B004123FF /* double-conversion.h in Headers */, - A8A473B2151A825B004123FF /* double.h in Headers */, - A8A473A7151A825B004123FF /* DoublyLinkedList.h in Headers */, - A8A473BB151A825B004123FF /* dtoa.h in Headers */, - A8A473BD151A825B004123FF /* DynamicAnnotations.h in Headers */, - A8A473C0151A825B004123FF /* Encoder.h in Headers */, - A8A473C1151A825B004123FF /* ExportMacros.h in Headers */, - A8A473B4151A825B004123FF /* fast-dtoa.h in Headers */, - 0FD81AC5154FB22E00983E72 /* FastBitVector.h in Headers */, - A8A473C4151A825B004123FF /* FastMalloc.h in Headers */, - B38FD7BD168953E80065C969 /* FeatureDefines.h in Headers */, - 0F9D3361165DBA73005AD387 /* FilePrintStream.h in Headers */, - A8A473B6151A825B004123FF /* fixed-dtoa.h in Headers */, - 0F2B66A717B6B4FD00A7AE3F /* FlipBytes.h in Headers */, - A8A473C8151A825B004123FF /* Forward.h in Headers */, - A8A473C9151A825B004123FF /* Functional.h in Headers */, - 1A1D8B9C173186CE00141DA4 /* FunctionDispatcher.h in Headers */, - A8A473CA151A825B004123FF /* GetPtr.h in Headers */, - 2C05385415BC819000F21B96 /* GregorianDateTime.h in Headers */, - A8A473D3151A825B004123FF /* HashCountedSet.h in Headers */, - A8A473D4151A825B004123FF /* HashFunctions.h in Headers */, - A8A473D5151A825B004123FF /* HashIterators.h in Headers */, - A8A473D6151A825B004123FF /* HashMap.h in Headers */, - 1A233C7D17DAA6E300A93ACF /* MallocPtr.h in Headers */, - A8A473D7151A825B004123FF /* HashSet.h in Headers */, - A8A473D9151A825B004123FF /* HashTable.h in Headers */, - A8A473DA151A825B004123FF /* HashTraits.h in Headers */, - A8A473DB151A825B004123FF /* HexNumber.h in Headers */, - A8A473DC151A825B004123FF /* InlineASM.h in Headers */, - 26299B6E17A9E5B800ADEBE5 /* Ref.h in Headers */, - A70DA0841799F04D00529A9B /* Insertion.h in Headers */, - 26147B0A15DDCCDC00DDB907 /* IntegerToStringConversion.h in Headers */, - A70DA0851799F04D00529A9B /* ListDump.h in Headers */, - A8A473E1151A825B004123FF /* ListHashSet.h in Headers */, - A8A473E3151A825B004123FF /* Locker.h in Headers */, - A8A473E6151A825B004123FF /* MainThread.h in Headers */, - A8A473E8151A825B004123FF /* MathExtras.h in Headers */, - 93B1AA80180E5AF3004A2F05 /* PassRef.h in Headers */, - A8A473EA151A825B004123FF /* MD5.h in Headers */, - CD5497AD15857D0300B5BC30 /* MediaTime.h in Headers */, - A8A473EB151A825B004123FF /* MessageQueue.h in Headers */, - A8A473ED151A825B004123FF /* MetaAllocator.h in Headers */, - A8A473EE151A825B004123FF /* MetaAllocatorHandle.h in Headers */, - 0F0D85B417234CC100338210 /* NoLock.h in Headers */, - A8A473EF151A825B004123FF /* Noncopyable.h in Headers */, - A8A473F5151A825B004123FF /* NumberOfCores.h in Headers */, - 7E29C33E15FFD79B00516D61 /* ObjcRuntimeExtras.h in Headers */, - A8A473F6151A825B004123FF /* OSAllocator.h in Headers */, - A8A473FA151A825B004123FF /* OSRandomSource.h in Headers */, - A8A473FC151A825B004123FF /* OwnPtr.h in Headers */, - A8A473FD151A825B004123FF /* OwnPtrCommon.h in Headers */, - 0FB14E1B1810E1DC009B6B4D /* BagToHashMap.h in Headers */, - A8A473FE151A825B004123FF /* PackedIntVector.h in Headers */, - A8A473FF151A825B004123FF /* PageAllocation.h in Headers */, - A8A47401151A825B004123FF /* PageAllocationAligned.h in Headers */, - A8A47403151A825B004123FF /* PageBlock.h in Headers */, - A8A47404151A825B004123FF /* PageReservation.h in Headers */, - A8A47405151A825B004123FF /* ParallelJobs.h in Headers */, - A8A47408151A825B004123FF /* ParallelJobsLibdispatch.h in Headers */, - A8A4740B151A825B004123FF /* PassOwnPtr.h in Headers */, - A8A4740C151A825B004123FF /* PassRefPtr.h in Headers */, - A876DBD8151816E500DADB95 /* Platform.h in Headers */, - A8A4740F151A825B004123FF /* PossiblyNull.h in Headers */, - 0FB14E19180FA218009B6B4D /* Bag.h in Headers */, - 0F9D3363165DBA73005AD387 /* PrintStream.h in Headers */, - 0FC4488316FE9FE100844BE9 /* ProcessID.h in Headers */, - 143F61201565F0F900DB514A /* RAMSize.h in Headers */, - A8A47415151A825B004123FF /* RandomNumber.h in Headers */, - A8A47416151A825B004123FF /* RandomNumberSeed.h in Headers */, - 0F87105A16643F190090B0AD /* RawPointer.h in Headers */, - A8A47417151A825B004123FF /* RedBlackTree.h in Headers */, - A8A47418151A825B004123FF /* RefCounted.h in Headers */, - A8A47419151A825B004123FF /* RefCountedArray.h in Headers */, - A8A4741B151A825B004123FF /* RefCountedLeakCounter.h in Headers */, - A8A4741C151A825B004123FF /* RefPtr.h in Headers */, - A8A4741D151A825B004123FF /* RefPtrHashMap.h in Headers */, - A8A4741E151A825B004123FF /* RetainPtr.h in Headers */, - 2CDED0F418115C85004DBA70 /* RunLoop.h in Headers */, - 1469419216EAAF6D0024E146 /* RunLoopTimer.h in Headers */, - 14F3B0F715E45E4600210069 /* SaturatedArithmetic.h in Headers */, - 1469419616EAAFF80024E146 /* SchedulePair.h in Headers */, - A8A47466151A825B004123FF /* ScriptCodesFromICU.h in Headers */, - A8A4741F151A825B004123FF /* SegmentedVector.h in Headers */, - A8A47420151A825B004123FF /* SentinelLinkedList.h in Headers */, - A8A47422151A825B004123FF /* SHA1.h in Headers */, - A8A47423151A825B004123FF /* SimpleStats.h in Headers */, - A8A47424151A825B004123FF /* SinglyLinkedList.h in Headers */, - A748745317A0BDAE00FA04CB /* SixCharacterHash.h in Headers */, - A8A47426151A825B004123FF /* Spectrum.h in Headers */, - A8A47428151A825B004123FF /* StackBounds.h in Headers */, - FEDACD3E1630F83F00C69634 /* StackStats.h in Headers */, - A8A47429151A825B004123FF /* StaticConstructors.h in Headers */, - A8A4742A151A825B004123FF /* StdLibExtras.h in Headers */, - 1A6BB769162F300500DD16DB /* StreamBuffer.h in Headers */, - A8A4743B151A825B004123FF /* StringBuffer.h in Headers */, - A8A4743D151A825B004123FF /* StringBuilder.h in Headers */, - A8A4743E151A825B004123FF /* StringConcatenate.h in Headers */, - A8A4742C151A825B004123FF /* StringExtras.h in Headers */, - A8A4743F151A825B004123FF /* StringHash.h in Headers */, - A748745417A0BDAE00FA04CB /* StringHashDumpContext.h in Headers */, - A8A4742D151A825B004123FF /* StringHasher.h in Headers */, - A8A47441151A825B004123FF /* StringImpl.h in Headers */, - A8A47442151A825B004123FF /* StringOperators.h in Headers */, - 0FDDBFA81666DFA300C55FEF /* StringPrintStream.h in Headers */, - A8A473B8151A825B004123FF /* strtod.h in Headers */, - A8A4742E151A825B004123FF /* TCPackedCache.h in Headers */, - A8A4742F151A825B004123FF /* TCPageMap.h in Headers */, - A8A47430151A825B004123FF /* TCSpinLock.h in Headers */, - A8A47432151A825B004123FF /* TCSystemAlloc.h in Headers */, - 1A6EB1E0187D0BD30030126F /* StringView.h in Headers */, - A8A47433151A825B004123FF /* TemporaryChange.h in Headers */, - A8A47444151A825B004123FF /* TextPosition.h in Headers */, - A8A47447151A825B004123FF /* ThreadFunctionInvocation.h in Headers */, - A8A47449151A825B004123FF /* ThreadIdentifierDataPthreads.h in Headers */, - A8A4744B151A825B004123FF /* Threading.h in Headers */, - A8A4744D151A825B004123FF /* ThreadingPrimitives.h in Headers */, - A8A47454151A825B004123FF /* ThreadSafeRefCounted.h in Headers */, - A8A47455151A825B004123FF /* ThreadSpecific.h in Headers */, - 149EF16316BBFE0D000A4331 /* TriState.h in Headers */, - A8A47467151A825B004123FF /* Unicode.h in Headers */, - A8A47464151A825B004123FF /* UnicodeIcu.h in Headers */, - A8A47468151A825B004123FF /* UnicodeMacrosFromICU.h in Headers */, - A8A4746D151A825B004123FF /* UnionFind.h in Headers */, - A8A4746A151A825B004123FF /* UTF8.h in Headers */, - A8A473B9151A825B004123FF /* utils.h in Headers */, - A8A4747D151A825B004123FF /* ValueCheck.h in Headers */, - A8A4747E151A825B004123FF /* Vector.h in Headers */, - A8A4747F151A825B004123FF /* VectorTraits.h in Headers */, - A8A47480151A825B004123FF /* VMTags.h in Headers */, - 974CFC8E16A4F327006D5404 /* WeakPtr.h in Headers */, - 1FA47C8B152502DA00568D1B /* WebCoreThread.h in Headers */, - A8A47446151A825B004123FF /* WTFString.h in Headers */, - A8A47487151A825B004123FF /* WTFThreadData.h in Headers */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; /* End PBXHeadersBuildPhase section */ /* Begin PBXNativeTarget section */ @@ -1610,24 +1156,6 @@ productReference = 10EAA8091889E93100DEB161 /* libWTF.a */; productType = "com.apple.product-type.library.static"; }; - 5D247B6114689B8600E78B76 /* WTF */ = { - isa = PBXNativeTarget; - buildConfigurationList = 5D247B6614689B8600E78B76 /* Build configuration list for PBXNativeTarget "WTF" */; - buildPhases = ( - 5D247B5E14689B8600E78B76 /* Sources */, - 5D247B5F14689B8600E78B76 /* Frameworks */, - 5D247B6014689B8600E78B76 /* Headers */, - ); - buildRules = ( - ); - dependencies = ( - 65AFA28E1630B99E003D723C /* PBXTargetDependency */, - ); - name = WTF; - productName = WTF; - productReference = 5D247B6214689B8600E78B76 /* libWTF.a */; - productType = "com.apple.product-type.library.static"; - }; /* End PBXNativeTarget section */ /* Begin PBXProject section */ @@ -1648,7 +1176,6 @@ projectDirPath = ""; projectRoot = ""; targets = ( - 5D247B6114689B8600E78B76 /* WTF */, 65AFA16F1630B977003D723C /* Copy WTF Headers */, 10EAA7021889E93100DEB161 /* WTF iOS */, ); @@ -1754,88 +1281,6 @@ ); runOnlyForDeploymentPostprocessing = 0; }; - 5D247B5E14689B8600E78B76 /* Sources */ = { - isa = PBXSourcesBuildPhase; - buildActionMask = 2147483647; - files = ( - A8A47386151A825B004123FF /* Assertions.cpp in Sources */, - A8A47435151A825B004123FF /* AtomicString.cpp in Sources */, - 9BC70F05176C379D00101DEC /* AtomicStringTable.cpp in Sources */, - A5BA15FB182435A600A82E69 /* StringCF.cpp in Sources */, - 1469419D16EAB10A0024E146 /* AutodrainedPoolMac.mm in Sources */, - 8134013815B092FD001FF0B8 /* Base64.cpp in Sources */, - A8A473A8151A825B004123FF /* bignum-dtoa.cc in Sources */, - A8A473AA151A825B004123FF /* bignum.cc in Sources */, - A8A47451151A825B004123FF /* BinarySemaphore.cpp in Sources */, - A8A4738B151A825B004123FF /* BitVector.cpp in Sources */, - A8A473AC151A825B004123FF /* cached-powers.cc in Sources */, - A8A47460151A825B004123FF /* CollatorDefault.cpp in Sources */, - A8A47463151A825B004123FF /* CollatorICU.cpp in Sources */, - 0F8F2B92172E0103007DBDA5 /* CompilationThread.cpp in Sources */, - A7E643C617C5423B003BB16B /* Compression.cpp in Sources */, - A8A4739A151A825B004123FF /* CryptographicallyRandomNumber.cpp in Sources */, - A8A47439151A825B004123FF /* CString.cpp in Sources */, - A8A4739C151A825B004123FF /* CurrentTime.cpp in Sources */, - A8A4739E151A825B004123FF /* DataLog.cpp in Sources */, - A8A473A0151A825B004123FF /* DateMath.cpp in Sources */, - A8A473A2151A825B004123FF /* DecimalNumber.cpp in Sources */, - A8A473AE151A825B004123FF /* diy-fp.cc in Sources */, - A8A473B0151A825B004123FF /* double-conversion.cc in Sources */, - A8A473BA151A825B004123FF /* dtoa.cpp in Sources */, - 0F885E0F1845AEA900F1E3FA /* FastBitVector.cpp in Sources */, - A8A473BC151A825B004123FF /* DynamicAnnotations.cpp in Sources */, - A8A473B3151A825B004123FF /* fast-dtoa.cc in Sources */, - A8A473C3151A825B004123FF /* FastMalloc.cpp in Sources */, - A5BA15FC182435A600A82E69 /* StringImplCF.cpp in Sources */, - A5BA15FA182435A600A82E69 /* AtomicStringCF.cpp in Sources */, - 0F9D3360165DBA73005AD387 /* FilePrintStream.cpp in Sources */, - A8A473B5151A825B004123FF /* fixed-dtoa.cc in Sources */, - 1A1D8B9E1731879800141DA4 /* FunctionDispatcher.cpp in Sources */, - 2CCD892A15C0390200285083 /* GregorianDateTime.cpp in Sources */, - A8A473D8151A825B004123FF /* HashTable.cpp in Sources */, - A8A473E5151A825B004123FF /* MainThread.cpp in Sources */, - A8A473E4151A825B004123FF /* MainThreadMac.mm in Sources */, - A8A473E9151A825B004123FF /* MD5.cpp in Sources */, - CD5497AC15857D0300B5BC30 /* MediaTime.cpp in Sources */, - A8A473EC151A825B004123FF /* MetaAllocator.cpp in Sources */, - A8A473F4151A825B004123FF /* NumberOfCores.cpp in Sources */, - A8A473F7151A825B004123FF /* OSAllocatorPosix.cpp in Sources */, - A8A473F9151A825B004123FF /* OSRandomSource.cpp in Sources */, - A8A47400151A825B004123FF /* PageAllocationAligned.cpp in Sources */, - A8A47402151A825B004123FF /* PageBlock.cpp in Sources */, - 0F9D3362165DBA73005AD387 /* PrintStream.cpp in Sources */, - A5BA15F51824348000A82E69 /* StringImplMac.mm in Sources */, - 143F611F1565F0F900DB514A /* RAMSize.cpp in Sources */, - A8A47414151A825B004123FF /* RandomNumber.cpp in Sources */, - A8A4741A151A825B004123FF /* RefCountedLeakCounter.cpp in Sources */, - 2CDED0F318115C85004DBA70 /* RunLoop.cpp in Sources */, - 2CDED0EF18115C38004DBA70 /* RunLoopCF.cpp in Sources */, - 1469419316EAAF6D0024E146 /* RunLoopTimerCF.cpp in Sources */, - 1469419916EAB0410024E146 /* SchedulePairCF.cpp in Sources */, - A5BA15F3182433A900A82E69 /* StringMac.mm in Sources */, - 1469419716EAAFF80024E146 /* SchedulePairMac.mm in Sources */, - A8A47421151A825B004123FF /* SHA1.cpp in Sources */, - A748745217A0BDAE00FA04CB /* SixCharacterHash.cpp in Sources */, - A8A47425151A825B004123FF /* SizeLimits.cpp in Sources */, - A8A47427151A825B004123FF /* StackBounds.cpp in Sources */, - FEDACD3D1630F83F00C69634 /* StackStats.cpp in Sources */, - A8A4743C151A825B004123FF /* StringBuilder.cpp in Sources */, - A8A47440151A825B004123FF /* StringImpl.cpp in Sources */, - 0FDDBFA71666DFA300C55FEF /* StringPrintStream.cpp in Sources */, - A8A47443151A825B004123FF /* StringStatics.cpp in Sources */, - A8A473B7151A825B004123FF /* strtod.cc in Sources */, - A8A47431151A825B004123FF /* TCSystemAlloc.cpp in Sources */, - A8A47448151A825B004123FF /* ThreadIdentifierDataPthreads.cpp in Sources */, - 1ACADD841884480100D8B71D /* DeprecatedSymbolsUsedBySafari.mm in Sources */, - A8A4744A151A825B004123FF /* Threading.cpp in Sources */, - A8A4744E151A825B004123FF /* ThreadingPthreads.cpp in Sources */, - A8A47469151A825B004123FF /* UTF8.cpp in Sources */, - 1FA47C8A152502DA00568D1B /* WebCoreThread.cpp in Sources */, - A8A47445151A825B004123FF /* WTFString.cpp in Sources */, - A8A47486151A825B004123FF /* WTFThreadData.cpp in Sources */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; /* End PBXSourcesBuildPhase section */ /* Begin PBXTargetDependency section */ @@ -1844,11 +1289,6 @@ target = 65AFA16F1630B977003D723C /* Copy WTF Headers */; targetProxy = 10EAA7041889E93100DEB161 /* PBXContainerItemProxy */; }; - 65AFA28E1630B99E003D723C /* PBXTargetDependency */ = { - isa = PBXTargetDependency; - target = 65AFA16F1630B977003D723C /* Copy WTF Headers */; - targetProxy = 65AFA28D1630B99E003D723C /* PBXContainerItemProxy */; - }; /* End PBXTargetDependency section */ /* Begin XCBuildConfiguration section */ @@ -1891,20 +1331,6 @@ }; name = Release; }; - 5D247B6714689B8600E78B76 /* Debug */ = { - isa = XCBuildConfiguration; - baseConfigurationReference = 5D247B7314689C4700E78B76 /* WTF.xcconfig */; - buildSettings = { - }; - name = Debug; - }; - 5D247B6814689B8600E78B76 /* Release */ = { - isa = XCBuildConfiguration; - baseConfigurationReference = 5D247B7314689C4700E78B76 /* WTF.xcconfig */; - buildSettings = { - }; - name = Release; - }; 5D247B7414689CC900E78B76 /* Production */ = { isa = XCBuildConfiguration; baseConfigurationReference = 5D247B6E14689C4700E78B76 /* Base.xcconfig */; @@ -1912,13 +1338,6 @@ }; name = Production; }; - 5D247B7514689CC900E78B76 /* Production */ = { - isa = XCBuildConfiguration; - baseConfigurationReference = 5D247B7314689C4700E78B76 /* WTF.xcconfig */; - buildSettings = { - }; - name = Production; - }; 65AFA2891630B977003D723C /* Debug */ = { isa = XCBuildConfiguration; baseConfigurationReference = 6541CAF41630DB26006D0DEC /* CopyWTFHeaders.xcconfig */; @@ -1966,16 +1385,6 @@ defaultConfigurationIsVisible = 0; defaultConfigurationName = Production; }; - 5D247B6614689B8600E78B76 /* Build configuration list for PBXNativeTarget "WTF" */ = { - isa = XCConfigurationList; - buildConfigurations = ( - 5D247B6714689B8600E78B76 /* Debug */, - 5D247B6814689B8600E78B76 /* Release */, - 5D247B7514689CC900E78B76 /* Production */, - ); - defaultConfigurationIsVisible = 0; - defaultConfigurationName = Production; - }; 65AFA2881630B977003D723C /* Build configuration list for PBXAggregateTarget "Copy WTF Headers" */ = { isa = XCConfigurationList; buildConfigurations = ( From 9fa12449f66ff956ce4c1b4f219a71ab67ba9890 Mon Sep 17 00:00:00 2001 From: Martijn The Date: Fri, 17 Jan 2014 15:58:49 -0800 Subject: [PATCH 29/69] SECTORDER_FLAGS breaks static iOS build --- JavaScriptCore-iOS-Static.xcconfig | 2 ++ 1 file changed, 2 insertions(+) diff --git a/JavaScriptCore-iOS-Static.xcconfig b/JavaScriptCore-iOS-Static.xcconfig index ae6ba328..41645534 100644 --- a/JavaScriptCore-iOS-Static.xcconfig +++ b/JavaScriptCore-iOS-Static.xcconfig @@ -20,6 +20,8 @@ PRODUCT_NAME = JavaScriptCore; HEADER_SEARCH_PATHS = "${BUILT_PRODUCTS_DIR}/DerivedSources/JavaScriptCore" "${SOURCE_ROOT}/../WTF/" $(HEADER_SEARCH_PATHS); LIBRARY_SEARCH_PATHS = "${SOURCE_ROOT}/../Build/"; +SECTORDER_FLAGS = ; + GCC_GENERATE_DEBUGGING_SYMBOLS = NO; GCC_OPTIMIZATION_LEVEL = 3; GCC_PREPROCESSOR_DEFINITIONS = $(DEBUG_DEFINES) HAVE_DTRACE=$(HAVE_DTRACE) WEBKIT_VERSION_MIN_REQUIRED=WEBKIT_VERSION_LATEST HAVE_HEADER_DETECTION_H JSC_OBJC_API_ENABLED=0 JSC_OBJC_API_AVAILABLE_MAC_OS_X_1080 $(FEATURE_DEFINES) $(GCC_PREPROCESSOR_DEFINITIONS) __MAC_OS_X_VERSION_MIN_REQUIRED=0; From d36612a9931b0ffe7acf316f969036517772f7a4 Mon Sep 17 00:00:00 2001 From: Martijn The Date: Fri, 17 Jan 2014 15:59:30 -0800 Subject: [PATCH 30/69] Build using the .xcworkspace to let xcodebuild find the WTF.a dependency automatically --- make.py | 11 ++++------- xcodebuild.py | 5 +++-- 2 files changed, 7 insertions(+), 9 deletions(-) diff --git a/make.py b/make.py index 9b12e8bc..85d1f3a1 100644 --- a/make.py +++ b/make.py @@ -21,14 +21,11 @@ class PebbleKitiOSException (Exception): def build(out, derived_data_path): outdir = out if out else tempfile.mkdtemp() - wtf = FrameworkBuild("WTF/WTF.xcodeproj", - "WTF iOS", "Production", outdir, name="wtf", - derived_data_path=derived_data_path) - wtf.build() - - jsc = FrameworkBuild("JavaScriptCore/JavaScriptCore.xcodeproj", - "JavaScriptCore iOS", "Production", outdir, + jsc = FrameworkBuild(workspace="JavaScriptCore-iOS.xcworkspace", + scheme="JavaScriptCore-iOS", name="JavaScriptCore", + conf="Production", + outdir=outdir, derived_data_path=derived_data_path) jsc.build() diff --git a/xcodebuild.py b/xcodebuild.py index 4a5c6aa0..d7e37ef8 100644 --- a/xcodebuild.py +++ b/xcodebuild.py @@ -118,8 +118,9 @@ def public_headers_path(self): class FrameworkBuild(object): - def __init__(self, project, scheme=None, conf="Release", outdir=None, - name=None, derived_data_path=None): + def __init__(self, project=None, workspace=None, scheme=None, + conf="Release", outdir=None, name=None, + derived_data_path=None): self.scheme = scheme self.name = name self.devicebuild = XcodeBuild(project, From 2a4c0ef827923f67161e2cf498cdacab613f3fb0 Mon Sep 17 00:00:00 2001 From: Martijn The Date: Fri, 17 Jan 2014 15:59:56 -0800 Subject: [PATCH 31/69] My notes on how to update this thing --- UPDATING.md | 65 +++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 65 insertions(+) create mode 100644 UPDATING.md diff --git a/UPDATING.md b/UPDATING.md new file mode 100644 index 00000000..89b28088 --- /dev/null +++ b/UPDATING.md @@ -0,0 +1,65 @@ +Steps taken to create JavaScriptCore static iOS library from webkit sources: +--- + +- Remove JavaScriptCore and WTF folders +$ rm -rf WTF +$ rm -rf JavaScriptCore + +- Check out JavaScriptCore / WTF from webkit.org +$ svn co https://svn.webkit.org/repository/webkit/tags/Safari-538.12.1/Source/WTF +$ svn co https://svn.webkit.org/repository/webkit/tags/Safari-538.12.1/Source/JavaScriptCore + +- Open WTF.xcodeproj +- Select "WTF" project, go to "Info" tab +- Under "Configurations": for each config of "WTF" (Debug, Release, ...) change the config file to "WTF-iOS-Static" + + + +- Add JavaScriptCore-iOS-Static.xcconfig and ToolExecutable-iOS-Static.xcconfig to JavaScriptCore + +- Duplicate target JSCLLIntOffsetsExtractor +- Rename to "JSCLLIntOffsetsExtractor iOS" +- Rename scheme to "JSCLLIntOffsetsExtractor iOS" +- Change the PRODUCT_NAME setting back to "JSCLLIntOffsetsExtractor" +- Select "JavaScriptCore" project, go to "Info" tab +- Under "Configurations": for each config (Debug, Release, ...) change the config file to "ToolExecutable-iOS-Static" +- Close Xcode +- Open project.pbxproj in an editor +- In the "JSCLLIntOffsetsExtractor iOS" target, replace "com.apple.product-type.tool" with "com.apple.product-type.library.static" + +- Duplicate target "Derived Sources" +- Rename to "Derived Sources iOS" +- Rename scheme to "Derived Sources iOS" +- Under "Build Phases" > "Target Dependencies": + - Remove "JSCLLIntOffsetsExtractor" + - Add "JSCLLIntOffsetsExtractor iOS" +- In the "Generate Derived Sources" script, change last line to: + /usr/bin/env ruby JavaScriptCore/offlineasm/asm.rb JavaScriptCore/llint/LowLevelInterpreter.asm ${BUILT_PRODUCTS_DIR}/libJSCLLIntOffsetsExtractor.a LLIntAssembly.h || exit 1 + + +- Duplicate target JavaScriptCore +- Rename to "JavaScriptCore iOS" +- Rename the scheme to "JavaScriptCore iOS" +- Remove "JavaScriptCore-copy-Info.plist" from project +- Remove build settings INFOPLIST_FILE, PRODUCT_NAME and INSTALL_PATH from the new target +- Under "Build Phases" > "Target Dependencies": + - Remove "llmvmForJSC" + - Remove "Derived Sources" + - Add "Derived Sources iOS" +- Select "JavaScriptCore" project, go to "Info" tab +- Under "Configurations": for each config (Debug, Release, ...) change the config file to "JavaScriptCore-iOS-Static" +- Close Xcode +- Open project.pbxproj in an editor +- In the "JavaScriptCore iOS" target, replace "com.apple.product-type.framework" with "com.apple.product-type.library.static" + +- Try building the projects from the JavaScriptCore.xcworkspace. There are probably some things that don't compile right away, because of small bugs, probably related to feature #defines. See phoboslabs' patches: https://github.com/phoboslab/JavaScriptCore-iOS/commits/master + +- Run `python make.py` + +- Grab a cup of coffee while the project builds.... :) + +Thoughts for improvement: +--- +- It's probably simpler and faster not to make duplicates, but just set the xcconfig files on the existing targets +- The step to mod the script for "Generate Derived Sources" can probably be avoided by mucking with the build settings EXECUTABLE_PREFIX (`lib`) and EXECUTABLE_EXTENSION (`a`) to make the output file name match what the script expects. +- Can the product type be set from an xcconfig file? Perhaps using the PRODUCT_TYPE and/or PACKAGE_TYPE build settings? \ No newline at end of file From a5a569baa4ebebc9cd4e29aea75de8999b0d5fae Mon Sep 17 00:00:00 2001 From: Martijn The Date: Fri, 17 Jan 2014 16:19:17 -0800 Subject: [PATCH 32/69] - SECTORDER_FLAGS breaks static iOS build, forgot other xcconfig files - Attempting to remove private/project headers from build product --- JavaScriptCore-iOS-Static.xcconfig | 5 +++++ ToolExecutable-iOS-Static.xcconfig | 3 +++ WTF-iOS-Static.xcconfig | 3 +++ 3 files changed, 11 insertions(+) diff --git a/JavaScriptCore-iOS-Static.xcconfig b/JavaScriptCore-iOS-Static.xcconfig index 41645534..cfd647a3 100644 --- a/JavaScriptCore-iOS-Static.xcconfig +++ b/JavaScriptCore-iOS-Static.xcconfig @@ -21,9 +21,14 @@ HEADER_SEARCH_PATHS = "${BUILT_PRODUCTS_DIR}/DerivedSources/JavaScriptCore" "${S LIBRARY_SEARCH_PATHS = "${SOURCE_ROOT}/../Build/"; SECTORDER_FLAGS = ; +SECTORDER_FLAGS_iphoneos = ; GCC_GENERATE_DEBUGGING_SYMBOLS = NO; GCC_OPTIMIZATION_LEVEL = 3; GCC_PREPROCESSOR_DEFINITIONS = $(DEBUG_DEFINES) HAVE_DTRACE=$(HAVE_DTRACE) WEBKIT_VERSION_MIN_REQUIRED=WEBKIT_VERSION_LATEST HAVE_HEADER_DETECTION_H JSC_OBJC_API_ENABLED=0 JSC_OBJC_API_AVAILABLE_MAC_OS_X_1080 $(FEATURE_DEFINES) $(GCC_PREPROCESSOR_DEFINITIONS) __MAC_OS_X_VERSION_MIN_REQUIRED=0; ENABLE_REMOTE_INSPECTOR = ENABLE_REMOTE_INSPECTOR=0; // Requires XPC + +PRIVATE_HEADERS_FOLDER_PATH = /dev/null; +PRECOMPS_INCLUDE_HEADERS_FROM_BUILT_PRODUCTS_DIR = NO; + diff --git a/ToolExecutable-iOS-Static.xcconfig b/ToolExecutable-iOS-Static.xcconfig index bcc09fbe..c2774cc1 100644 --- a/ToolExecutable-iOS-Static.xcconfig +++ b/ToolExecutable-iOS-Static.xcconfig @@ -10,3 +10,6 @@ PRODUCT_NAME = JSCLLIntOffsetsExtractor; HEADER_SEARCH_PATHS = . icu "${BUILT_PRODUCTS_DIR}/usr/local/include" "${SOURCE_ROOT}/../WTF/" $(HEADER_SEARCH_PATHS); + +SECTORDER_FLAGS = ; +SECTORDER_FLAGS_iphoneos = ; diff --git a/WTF-iOS-Static.xcconfig b/WTF-iOS-Static.xcconfig index f2743642..a13cd414 100644 --- a/WTF-iOS-Static.xcconfig +++ b/WTF-iOS-Static.xcconfig @@ -15,3 +15,6 @@ SDKROOT = iphoneos SUPPORTED_PLATFORMS = iphoneos iphonesimulator IPHONEOS_DEPLOYMENT_TARGET = 5.1 GCC_PREPROCESSOR_DEFINITIONS = $(DEBUG_DEFINES) WEBKIT_VERSION_MIN_REQUIRED=WEBKIT_VERSION_LATEST HAVE_HEADER_DETECTION_H $(GCC_PREPROCESSOR_DEFINITIONS) TARGET_OS_IPHONE __MAC_OS_X_VERSION_MIN_REQUIRED=0 UCONFIG_NO_COLLATION=1 +PRIVATE_HEADERS_FOLDER_PATH = /dev/null; +PUBLIC_HEADERS_FOLDER_PATH = /dev/null; +PRECOMPS_INCLUDE_HEADERS_FROM_BUILT_PRODUCTS_DIR = NO; From 469961d4df8565e7aef18adc72e6f52af32772ef Mon Sep 17 00:00:00 2001 From: Martijn The Date: Fri, 17 Jan 2014 16:19:38 -0800 Subject: [PATCH 33/69] Updated UPDATING.md --- UPDATING.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/UPDATING.md b/UPDATING.md index 89b28088..4c6a6ef1 100644 --- a/UPDATING.md +++ b/UPDATING.md @@ -62,4 +62,5 @@ Thoughts for improvement: --- - It's probably simpler and faster not to make duplicates, but just set the xcconfig files on the existing targets - The step to mod the script for "Generate Derived Sources" can probably be avoided by mucking with the build settings EXECUTABLE_PREFIX (`lib`) and EXECUTABLE_EXTENSION (`a`) to make the output file name match what the script expects. -- Can the product type be set from an xcconfig file? Perhaps using the PRODUCT_TYPE and/or PACKAGE_TYPE build settings? \ No newline at end of file +- Can the product type be set from an xcconfig file? Perhaps using the PRODUCT_TYPE and/or PACKAGE_TYPE build settings? +- For some reason the WTF headers get included in the JavaScriptCore.framework. Probably something I'm missing. From 60f863320cc81558a3d775235daea47ca5e07b76 Mon Sep 17 00:00:00 2001 From: Dominic Szablewski Date: Tue, 5 Nov 2013 18:26:39 +0100 Subject: [PATCH 34/69] - Adding JSTypedArray to xcode project + export header - The sources files were already there, just not included in the build! --- JavaScriptCore/JavaScriptCore.xcodeproj/project.pbxproj | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/JavaScriptCore/JavaScriptCore.xcodeproj/project.pbxproj b/JavaScriptCore/JavaScriptCore.xcodeproj/project.pbxproj index 90521810..b314d43c 100644 --- a/JavaScriptCore/JavaScriptCore.xcodeproj/project.pbxproj +++ b/JavaScriptCore/JavaScriptCore.xcodeproj/project.pbxproj @@ -572,6 +572,8 @@ 0FFFC95E14EF90B700C72532 /* DFGPredictionPropagationPhase.h in Headers */ = {isa = PBXBuildFile; fileRef = 0FFFC95214EF909500C72532 /* DFGPredictionPropagationPhase.h */; settings = {ATTRIBUTES = (Private, ); }; }; 0FFFC95F14EF90BB00C72532 /* DFGVirtualRegisterAllocationPhase.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 0FFFC95314EF909500C72532 /* DFGVirtualRegisterAllocationPhase.cpp */; }; 0FFFC96014EF90BD00C72532 /* DFGVirtualRegisterAllocationPhase.h in Headers */ = {isa = PBXBuildFile; fileRef = 0FFFC95414EF909500C72532 /* DFGVirtualRegisterAllocationPhase.h */; settings = {ATTRIBUTES = (Private, ); }; }; + 104A28CC188A011B002CCBE0 /* JSTypedArray.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 104A28CA188A011B002CCBE0 /* JSTypedArray.cpp */; }; + 104A28CD188A011B002CCBE0 /* JSTypedArray.h in Headers */ = {isa = PBXBuildFile; fileRef = 104A28CB188A011B002CCBE0 /* JSTypedArray.h */; settings = {ATTRIBUTES = (Public, ); }; }; 10D58E051889C1A000C05A0D /* LLIntOffsetsExtractor.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 0F4680A114BA7F8200BFE272 /* LLIntOffsetsExtractor.cpp */; }; 10D58E141889C3DF00C05A0D /* A64DOpcode.h in Headers */ = {isa = PBXBuildFile; fileRef = 652A3A231651C69700A80AFE /* A64DOpcode.h */; settings = {ATTRIBUTES = (Private, ); }; }; 10D58E151889C3DF00C05A0D /* AbstractMacroAssembler.h in Headers */ = {isa = PBXBuildFile; fileRef = 860161DF0F3A83C100F84710 /* AbstractMacroAssembler.h */; settings = {ATTRIBUTES = (Private, ); }; }; @@ -3196,6 +3198,8 @@ 0FFFC95214EF909500C72532 /* DFGPredictionPropagationPhase.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = DFGPredictionPropagationPhase.h; path = dfg/DFGPredictionPropagationPhase.h; sourceTree = ""; }; 0FFFC95314EF909500C72532 /* DFGVirtualRegisterAllocationPhase.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = DFGVirtualRegisterAllocationPhase.cpp; path = dfg/DFGVirtualRegisterAllocationPhase.cpp; sourceTree = ""; }; 0FFFC95414EF909500C72532 /* DFGVirtualRegisterAllocationPhase.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = DFGVirtualRegisterAllocationPhase.h; path = dfg/DFGVirtualRegisterAllocationPhase.h; sourceTree = ""; }; + 104A28CA188A011B002CCBE0 /* JSTypedArray.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSTypedArray.cpp; sourceTree = ""; }; + 104A28CB188A011B002CCBE0 /* JSTypedArray.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSTypedArray.h; sourceTree = ""; }; 10D58E0C1889C1A000C05A0D /* libJSCLLIntOffsetsExtractor.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = libJSCLLIntOffsetsExtractor.a; sourceTree = BUILT_PRODUCTS_DIR; }; 10D592F41889C3DF00C05A0D /* libJavaScriptCore.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = libJavaScriptCore.a; sourceTree = BUILT_PRODUCTS_DIR; }; 10EAA6FF1889E6B300DEB161 /* JavaScriptCore-iOS-Static.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; name = "JavaScriptCore-iOS-Static.xcconfig"; path = "../../JavaScriptCore-iOS-Static.xcconfig"; sourceTree = ""; }; @@ -4618,6 +4622,8 @@ 146AAB370B66A94400E55F16 /* JSStringRefCF.cpp */, 146AAB2A0B66A84900E55F16 /* JSStringRefCF.h */, 1A28D4A7177B71C80007FA3C /* JSStringRefPrivate.h */, + 104A28CA188A011B002CCBE0 /* JSTypedArray.cpp */, + 104A28CB188A011B002CCBE0 /* JSTypedArray.h */, 86E3C606167BAB87006D760A /* JSValue.h */, 86E3C60D167BAB87006D760A /* JSValue.mm */, 86E3C60E167BAB87006D760A /* JSValueInternal.h */, @@ -5738,6 +5744,7 @@ files = ( 10D58E141889C3DF00C05A0D /* A64DOpcode.h in Headers */, 10D58E151889C3DF00C05A0D /* AbstractMacroAssembler.h in Headers */, + 104A28CD188A011B002CCBE0 /* JSTypedArray.h in Headers */, 10D58E161889C3DF00C05A0D /* AbstractPC.h in Headers */, 10D58E171889C3DF00C05A0D /* APICallbackFunction.h in Headers */, 10D58E181889C3DF00C05A0D /* APICast.h in Headers */, @@ -7962,6 +7969,7 @@ 10D591A11889C3DF00C05A0D /* ErrorConstructor.cpp in Sources */, 10D591A21889C3DF00C05A0D /* ErrorInstance.cpp in Sources */, 10D591A31889C3DF00C05A0D /* ErrorPrototype.cpp in Sources */, + 104A28CC188A011B002CCBE0 /* JSTypedArray.cpp in Sources */, 10D591A41889C3DF00C05A0D /* ExceptionHelpers.cpp in Sources */, 10D591A51889C3DF00C05A0D /* Executable.cpp in Sources */, 10D591A61889C3DF00C05A0D /* ExecutableAllocator.cpp in Sources */, From 87a9830dca279c3ad7c8caa99f0a45898129d1b0 Mon Sep 17 00:00:00 2001 From: Dominic Szablewski Date: Tue, 19 Nov 2013 10:29:29 +0100 Subject: [PATCH 35/69] Comment out private function malloc_logger for AppStore compatability --- WTF/wtf/FastMalloc.cpp | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/WTF/wtf/FastMalloc.cpp b/WTF/wtf/FastMalloc.cpp index dcf0937b..f115c6d1 100644 --- a/WTF/wtf/FastMalloc.cpp +++ b/WTF/wtf/FastMalloc.cpp @@ -1506,7 +1506,7 @@ class FastMallocZone { }; // This method declaration, and the constants below, are taken from Libc/gen/malloc.c. -extern "C" void (*malloc_logger)(uint32_t typeFlags, uintptr_t zone, uintptr_t size, uintptr_t pointer, uintptr_t returnValue, uint32_t numberOfFramesToSkip); +//extern "C" void (*malloc_logger)(uint32_t typeFlags, uintptr_t zone, uintptr_t size, uintptr_t pointer, uintptr_t returnValue, uint32_t numberOfFramesToSkip); #endif @@ -1522,7 +1522,13 @@ class MallocHook { static void record(uint32_t typeFlags, uintptr_t zone, uintptr_t size, void* pointer, void* returnValue, uint32_t numberOfFramesToSkip) { - malloc_logger(typeFlags, zone, size, reinterpret_cast(pointer), reinterpret_cast(returnValue), numberOfFramesToSkip); + #pragma unused (typeFlags) + #pragma unused (zone) + #pragma unused (size) + #pragma unused (pointer) + #pragma unused (returnValue) + #pragma unused (numberOfFramesToSkip) +// malloc_logger(typeFlags, zone, size, reinterpret_cast(pointer), reinterpret_cast(returnValue), numberOfFramesToSkip); } static NEVER_INLINE void recordAllocation(void* pointer, size_t size) @@ -1545,7 +1551,7 @@ class MallocHook { { #if OS(DARWIN) // If the system allocator's malloc_logger has been set up then stack logging is enabled. - stackLoggingEnabled = malloc_logger; +// stackLoggingEnabled = malloc_logger; #endif } From a2d6a93bd0bfdb29cc137f849687a69f0a730dde Mon Sep 17 00:00:00 2001 From: Martijn The Date: Fri, 17 Jan 2014 16:36:41 -0800 Subject: [PATCH 36/69] Add JSTypedArray to Mac framework too --- JavaScriptCore/JavaScriptCore.xcodeproj/project.pbxproj | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/JavaScriptCore/JavaScriptCore.xcodeproj/project.pbxproj b/JavaScriptCore/JavaScriptCore.xcodeproj/project.pbxproj index b314d43c..6384f289 100644 --- a/JavaScriptCore/JavaScriptCore.xcodeproj/project.pbxproj +++ b/JavaScriptCore/JavaScriptCore.xcodeproj/project.pbxproj @@ -574,6 +574,8 @@ 0FFFC96014EF90BD00C72532 /* DFGVirtualRegisterAllocationPhase.h in Headers */ = {isa = PBXBuildFile; fileRef = 0FFFC95414EF909500C72532 /* DFGVirtualRegisterAllocationPhase.h */; settings = {ATTRIBUTES = (Private, ); }; }; 104A28CC188A011B002CCBE0 /* JSTypedArray.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 104A28CA188A011B002CCBE0 /* JSTypedArray.cpp */; }; 104A28CD188A011B002CCBE0 /* JSTypedArray.h in Headers */ = {isa = PBXBuildFile; fileRef = 104A28CB188A011B002CCBE0 /* JSTypedArray.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 104A28CE188A030B002CCBE0 /* JSTypedArray.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 104A28CA188A011B002CCBE0 /* JSTypedArray.cpp */; }; + 104A28CF188A030F002CCBE0 /* JSTypedArray.h in Headers */ = {isa = PBXBuildFile; fileRef = 104A28CB188A011B002CCBE0 /* JSTypedArray.h */; settings = {ATTRIBUTES = (Public, ); }; }; 10D58E051889C1A000C05A0D /* LLIntOffsetsExtractor.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 0F4680A114BA7F8200BFE272 /* LLIntOffsetsExtractor.cpp */; }; 10D58E141889C3DF00C05A0D /* A64DOpcode.h in Headers */ = {isa = PBXBuildFile; fileRef = 652A3A231651C69700A80AFE /* A64DOpcode.h */; settings = {ATTRIBUTES = (Private, ); }; }; 10D58E151889C3DF00C05A0D /* AbstractMacroAssembler.h in Headers */ = {isa = PBXBuildFile; fileRef = 860161DF0F3A83C100F84710 /* AbstractMacroAssembler.h */; settings = {ATTRIBUTES = (Private, ); }; }; @@ -6505,6 +6507,7 @@ files = ( 0FFA549816B8835300B3A982 /* A64DOpcode.h in Headers */, 860161E30F3A83C100F84710 /* AbstractMacroAssembler.h in Headers */, + 104A28CF188A030F002CCBE0 /* JSTypedArray.h in Headers */, 0F55F0F514D1063C00AC7649 /* AbstractPC.h in Headers */, 2A48D1911772365B00C65A5F /* APICallbackFunction.h in Headers */, BC18C3E50E16F5CD00B34460 /* APICast.h in Headers */, @@ -8496,6 +8499,7 @@ 147F39C8107EC37600427A48 /* ErrorConstructor.cpp in Sources */, 147F39C9107EC37600427A48 /* ErrorInstance.cpp in Sources */, 147F39CA107EC37600427A48 /* ErrorPrototype.cpp in Sources */, + 104A28CE188A030B002CCBE0 /* JSTypedArray.cpp in Sources */, 1429D8780ED21ACD00B89619 /* ExceptionHelpers.cpp in Sources */, 86CA032E1038E8440028A609 /* Executable.cpp in Sources */, A7B48F490EE8936F00DCBDB6 /* ExecutableAllocator.cpp in Sources */, From e507e7a8e0a5b8b59210e2e7f9b386bc31c72e53 Mon Sep 17 00:00:00 2001 From: Martijn The Date: Fri, 17 Jan 2014 16:37:02 -0800 Subject: [PATCH 37/69] Remove wtf headers from final JavaScriptCore.framework --- make.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/make.py b/make.py index 85d1f3a1..bb265fc0 100644 --- a/make.py +++ b/make.py @@ -29,6 +29,10 @@ def build(out, derived_data_path): derived_data_path=derived_data_path) jsc.build() + # FIXME: wtf headers are copied... remove them: + shutil.rmtree(os.path.join(outdir, 'JavaScriptCore.framework', + 'Headers', 'wtf')) + return outdir if __name__ == "__main__": From 252eb6279089dc8cca6e4237d0ff94d49959807e Mon Sep 17 00:00:00 2001 From: Martijn The Date: Fri, 17 Jan 2014 16:37:15 -0800 Subject: [PATCH 38/69] Update README.md --- README.md | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/README.md b/README.md index e93a2728..59829170 100644 --- a/README.md +++ b/README.md @@ -4,7 +4,7 @@ The JavaScriptCore library is part of the [WebKit project](http://www.webkit.org This repo aims to re-produce the missing iOS targets while staying on a somewhat up-to-date version. -Currently, the [Safari 538.4 tag](https://svn.webkit.org/repository/webkit/tags/Safari-538.4/) is used as the basis. With the current settings, the WTF and JavaScriptCore libraries can be compiled for armv7 and x86 (for the iOS simulator). It will be compiled without Unicode collation support, because Apple claims [ICU](http://site.icu-project.org/) is a private framework on iOS. It should be AppStore compatible this way. +Currently, the [Safari-538.12.1 tag](https://svn.webkit.org/repository/webkit/tags/Safari-538.12.1/) is used as the basis. With the current settings, the WTF and JavaScriptCore libraries can be compiled for armv7, arm64 and x86 (for the iOS simulator). It will be compiled without Unicode collation support, because Apple claims [ICU](http://site.icu-project.org/) is a private framework on iOS. It should be AppStore compatible this way. This version of JSC deprecates the `typed-arrays` branch of this repository. The updated 538.4 tag now supports Typed Arrays natively, without any hacks. @@ -19,10 +19,7 @@ A compiled version of the `libJavaScriptCore.a` for armv7 and the Simulator can ## How to Compile -1. Create a `Build/` directory in the top level of this repo. The combined `libWTF.a` and `JavaScriptCore.a` will be placed here +1. Run `python make.py`. +2. Get coffee! Building this takes a while ;P -2. Open the `WTF/WTF.xcodeproj` file and compile the "WTF iOS" target once for "iOS Device" and once for "iPhone Simulator". Compile the release version (Shift+Command+I). -3. Compile the "Combine iOS lib" target. This will execute a script that will combine the device and simulator libraries into one and place it in your `Build/` directory. - -4. Open the `JavaScriptCore/JavaScriptCore.xcodeproj` file and compile the "JavaScriptCore iOS" target once for "iOS Device" and once for "iPhone Simulator". Compile the release version (Shift+Command+I). -5. Compile the "Combine iOS lib" target. This will execute a script that will combine the device and simulator libraries into one and place it in your `Build/` directory. +You can do `python make.py --help` for more options. From 84b178ec77677fce43d505a0725289288149f18b Mon Sep 17 00:00:00 2001 From: Dominic Szablewski Date: Sat, 18 Jan 2014 13:47:10 +0100 Subject: [PATCH 39/69] Removed .xcworkspace from .gitignore --- .gitignore | 2 +- .../contents.xcworkspacedata | 10 ++++++++++ .../project.xcworkspace/contents.xcworkspacedata | 7 +++++++ .../project.xcworkspace/contents.xcworkspacedata | 7 +++++++ 4 files changed, 25 insertions(+), 1 deletion(-) create mode 100644 JavaScriptCore-iOS.xcworkspace/contents.xcworkspacedata create mode 100644 JavaScriptCore/JavaScriptCore.xcodeproj/project.xcworkspace/contents.xcworkspacedata create mode 100644 WTF/WTF.xcodeproj/project.xcworkspace/contents.xcworkspacedata diff --git a/.gitignore b/.gitignore index 09e95ddb..08aabe92 100755 --- a/.gitignore +++ b/.gitignore @@ -9,7 +9,7 @@ build/ !default.mode2v3 *.perspectivev3 !default.perspectivev3 -*.xcworkspace +*.xccheckout !default.xcworkspace xcuserdata profile diff --git a/JavaScriptCore-iOS.xcworkspace/contents.xcworkspacedata b/JavaScriptCore-iOS.xcworkspace/contents.xcworkspacedata new file mode 100644 index 00000000..7028adad --- /dev/null +++ b/JavaScriptCore-iOS.xcworkspace/contents.xcworkspacedata @@ -0,0 +1,10 @@ + + + + + + + diff --git a/JavaScriptCore/JavaScriptCore.xcodeproj/project.xcworkspace/contents.xcworkspacedata b/JavaScriptCore/JavaScriptCore.xcodeproj/project.xcworkspace/contents.xcworkspacedata new file mode 100644 index 00000000..342f1f99 --- /dev/null +++ b/JavaScriptCore/JavaScriptCore.xcodeproj/project.xcworkspace/contents.xcworkspacedata @@ -0,0 +1,7 @@ + + + + + diff --git a/WTF/WTF.xcodeproj/project.xcworkspace/contents.xcworkspacedata b/WTF/WTF.xcodeproj/project.xcworkspace/contents.xcworkspacedata new file mode 100644 index 00000000..915a981f --- /dev/null +++ b/WTF/WTF.xcodeproj/project.xcworkspace/contents.xcworkspacedata @@ -0,0 +1,7 @@ + + + + + From 4f71d85f1363b2721497aa4f55b3a4bb3fec8021 Mon Sep 17 00:00:00 2001 From: Dominic Szablewski Date: Sat, 18 Jan 2014 13:47:28 +0100 Subject: [PATCH 40/69] Fixed scheme name in make.py --- make.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/make.py b/make.py index bb265fc0..d3a6485b 100644 --- a/make.py +++ b/make.py @@ -22,7 +22,7 @@ def build(out, derived_data_path): outdir = out if out else tempfile.mkdtemp() jsc = FrameworkBuild(workspace="JavaScriptCore-iOS.xcworkspace", - scheme="JavaScriptCore-iOS", + scheme="JavaScriptCore iOS", name="JavaScriptCore", conf="Production", outdir=outdir, From d0d8f4dcd6f7f7cf91dd843deb0f44f5df275820 Mon Sep 17 00:00:00 2001 From: Dominic Szablewski Date: Sat, 18 Jan 2014 13:48:31 +0100 Subject: [PATCH 41/69] Added fix for Number.MIN_VALUE when denormal support is disabled --- JavaScriptCore/runtime/NumberConstructor.cpp | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/JavaScriptCore/runtime/NumberConstructor.cpp b/JavaScriptCore/runtime/NumberConstructor.cpp index 17963a15..ef8c3dd4 100644 --- a/JavaScriptCore/runtime/NumberConstructor.cpp +++ b/JavaScriptCore/runtime/NumberConstructor.cpp @@ -60,6 +60,8 @@ NumberConstructor::NumberConstructor(VM& vm, Structure* structure) { } +static double MinValueAccountingForDenormals = DBL_MIN; + void NumberConstructor::finishCreation(VM& vm, NumberPrototype* numberPrototype) { Base::finishCreation(vm, NumberPrototype::info()->className); @@ -70,6 +72,14 @@ void NumberConstructor::finishCreation(VM& vm, NumberPrototype* numberPrototype) // no. of arguments for constructor putDirectWithoutTransition(vm, vm.propertyNames->length, jsNumber(1), ReadOnly | DontEnum | DontDelete); + + // Test for denormal support. Use 5E-324 as MIN_VALUE if we have denormals + // Careful: this test gets easily optimized away by the compiler, hence + // the assignment to another var. + double denormalTest = MinValueAccountingForDenormals / 2; + if( denormalTest != 0 ) { + MinValueAccountingForDenormals = 5E-324; + } } bool NumberConstructor::getOwnPropertySlot(JSObject* object, ExecState* exec, PropertyName propertyName, PropertySlot& slot) @@ -104,7 +114,7 @@ static EncodedJSValue numberConstructorMaxValue(ExecState*, EncodedJSValue, Enco static EncodedJSValue numberConstructorMinValue(ExecState*, EncodedJSValue, EncodedJSValue, PropertyName) { - return JSValue::encode(jsNumber(5E-324)); + return JSValue::encode(jsNumber(MinValueAccountingForDenormals)); } // ECMA 15.7.1 From 29616065a4af21b411ada03b15f946300907d09c Mon Sep 17 00:00:00 2001 From: Dominic Szablewski Date: Sat, 18 Jan 2014 13:56:00 +0100 Subject: [PATCH 42/69] Share all xcscheme files so initial command line build doesn't fail --- .../xcshareddata/xcschemes/All.xcscheme | 59 +++++++++++++ .../xcschemes/Derived Sources iOS.xcscheme | 59 +++++++++++++ .../xcschemes/Derived Sources.xcscheme | 59 +++++++++++++ .../JSCLLIntOffsetsExtractor iOS.xcscheme | 59 +++++++++++++ .../JSCLLIntOffsetsExtractor.xcscheme | 86 +++++++++++++++++++ .../xcschemes/JavaScriptCore iOS.xcscheme | 59 +++++++++++++ .../xcschemes/JavaScriptCore.xcscheme | 59 +++++++++++++ .../xcschemes/LLInt Offsets.xcscheme | 59 +++++++++++++ .../xcschemes/Test Tools.xcscheme | 59 +++++++++++++ .../xcshareddata/xcschemes/jsc.xcscheme | 86 +++++++++++++++++++ .../xcschemes/llvmForJSC.xcscheme | 59 +++++++++++++ .../xcshareddata/xcschemes/minidom.xcscheme | 86 +++++++++++++++++++ .../xcschemes/testRegExp.xcscheme | 86 +++++++++++++++++++ .../xcshareddata/xcschemes/testapi.xcscheme | 86 +++++++++++++++++++ .../xcschemes/Copy WTF Headers.xcscheme | 59 +++++++++++++ .../xcshareddata/xcschemes/WTF iOS.xcscheme | 59 +++++++++++++ 16 files changed, 1079 insertions(+) create mode 100644 JavaScriptCore/JavaScriptCore.xcodeproj/xcshareddata/xcschemes/All.xcscheme create mode 100644 JavaScriptCore/JavaScriptCore.xcodeproj/xcshareddata/xcschemes/Derived Sources iOS.xcscheme create mode 100644 JavaScriptCore/JavaScriptCore.xcodeproj/xcshareddata/xcschemes/Derived Sources.xcscheme create mode 100644 JavaScriptCore/JavaScriptCore.xcodeproj/xcshareddata/xcschemes/JSCLLIntOffsetsExtractor iOS.xcscheme create mode 100644 JavaScriptCore/JavaScriptCore.xcodeproj/xcshareddata/xcschemes/JSCLLIntOffsetsExtractor.xcscheme create mode 100644 JavaScriptCore/JavaScriptCore.xcodeproj/xcshareddata/xcschemes/JavaScriptCore iOS.xcscheme create mode 100644 JavaScriptCore/JavaScriptCore.xcodeproj/xcshareddata/xcschemes/JavaScriptCore.xcscheme create mode 100644 JavaScriptCore/JavaScriptCore.xcodeproj/xcshareddata/xcschemes/LLInt Offsets.xcscheme create mode 100644 JavaScriptCore/JavaScriptCore.xcodeproj/xcshareddata/xcschemes/Test Tools.xcscheme create mode 100644 JavaScriptCore/JavaScriptCore.xcodeproj/xcshareddata/xcschemes/jsc.xcscheme create mode 100644 JavaScriptCore/JavaScriptCore.xcodeproj/xcshareddata/xcschemes/llvmForJSC.xcscheme create mode 100644 JavaScriptCore/JavaScriptCore.xcodeproj/xcshareddata/xcschemes/minidom.xcscheme create mode 100644 JavaScriptCore/JavaScriptCore.xcodeproj/xcshareddata/xcschemes/testRegExp.xcscheme create mode 100644 JavaScriptCore/JavaScriptCore.xcodeproj/xcshareddata/xcschemes/testapi.xcscheme create mode 100644 WTF/WTF.xcodeproj/xcshareddata/xcschemes/Copy WTF Headers.xcscheme create mode 100644 WTF/WTF.xcodeproj/xcshareddata/xcschemes/WTF iOS.xcscheme diff --git a/JavaScriptCore/JavaScriptCore.xcodeproj/xcshareddata/xcschemes/All.xcscheme b/JavaScriptCore/JavaScriptCore.xcodeproj/xcshareddata/xcschemes/All.xcscheme new file mode 100644 index 00000000..8598b7b7 --- /dev/null +++ b/JavaScriptCore/JavaScriptCore.xcodeproj/xcshareddata/xcschemes/All.xcscheme @@ -0,0 +1,59 @@ + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/JavaScriptCore/JavaScriptCore.xcodeproj/xcshareddata/xcschemes/Derived Sources iOS.xcscheme b/JavaScriptCore/JavaScriptCore.xcodeproj/xcshareddata/xcschemes/Derived Sources iOS.xcscheme new file mode 100644 index 00000000..ca67dcf4 --- /dev/null +++ b/JavaScriptCore/JavaScriptCore.xcodeproj/xcshareddata/xcschemes/Derived Sources iOS.xcscheme @@ -0,0 +1,59 @@ + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/JavaScriptCore/JavaScriptCore.xcodeproj/xcshareddata/xcschemes/Derived Sources.xcscheme b/JavaScriptCore/JavaScriptCore.xcodeproj/xcshareddata/xcschemes/Derived Sources.xcscheme new file mode 100644 index 00000000..c403016b --- /dev/null +++ b/JavaScriptCore/JavaScriptCore.xcodeproj/xcshareddata/xcschemes/Derived Sources.xcscheme @@ -0,0 +1,59 @@ + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/JavaScriptCore/JavaScriptCore.xcodeproj/xcshareddata/xcschemes/JSCLLIntOffsetsExtractor iOS.xcscheme b/JavaScriptCore/JavaScriptCore.xcodeproj/xcshareddata/xcschemes/JSCLLIntOffsetsExtractor iOS.xcscheme new file mode 100644 index 00000000..0178a682 --- /dev/null +++ b/JavaScriptCore/JavaScriptCore.xcodeproj/xcshareddata/xcschemes/JSCLLIntOffsetsExtractor iOS.xcscheme @@ -0,0 +1,59 @@ + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/JavaScriptCore/JavaScriptCore.xcodeproj/xcshareddata/xcschemes/JSCLLIntOffsetsExtractor.xcscheme b/JavaScriptCore/JavaScriptCore.xcodeproj/xcshareddata/xcschemes/JSCLLIntOffsetsExtractor.xcscheme new file mode 100644 index 00000000..49e28ffb --- /dev/null +++ b/JavaScriptCore/JavaScriptCore.xcodeproj/xcshareddata/xcschemes/JSCLLIntOffsetsExtractor.xcscheme @@ -0,0 +1,86 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/JavaScriptCore/JavaScriptCore.xcodeproj/xcshareddata/xcschemes/JavaScriptCore iOS.xcscheme b/JavaScriptCore/JavaScriptCore.xcodeproj/xcshareddata/xcschemes/JavaScriptCore iOS.xcscheme new file mode 100644 index 00000000..d276473a --- /dev/null +++ b/JavaScriptCore/JavaScriptCore.xcodeproj/xcshareddata/xcschemes/JavaScriptCore iOS.xcscheme @@ -0,0 +1,59 @@ + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/JavaScriptCore/JavaScriptCore.xcodeproj/xcshareddata/xcschemes/JavaScriptCore.xcscheme b/JavaScriptCore/JavaScriptCore.xcodeproj/xcshareddata/xcschemes/JavaScriptCore.xcscheme new file mode 100644 index 00000000..7675247b --- /dev/null +++ b/JavaScriptCore/JavaScriptCore.xcodeproj/xcshareddata/xcschemes/JavaScriptCore.xcscheme @@ -0,0 +1,59 @@ + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/JavaScriptCore/JavaScriptCore.xcodeproj/xcshareddata/xcschemes/LLInt Offsets.xcscheme b/JavaScriptCore/JavaScriptCore.xcodeproj/xcshareddata/xcschemes/LLInt Offsets.xcscheme new file mode 100644 index 00000000..9a81bb39 --- /dev/null +++ b/JavaScriptCore/JavaScriptCore.xcodeproj/xcshareddata/xcschemes/LLInt Offsets.xcscheme @@ -0,0 +1,59 @@ + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/JavaScriptCore/JavaScriptCore.xcodeproj/xcshareddata/xcschemes/Test Tools.xcscheme b/JavaScriptCore/JavaScriptCore.xcodeproj/xcshareddata/xcschemes/Test Tools.xcscheme new file mode 100644 index 00000000..f17dff78 --- /dev/null +++ b/JavaScriptCore/JavaScriptCore.xcodeproj/xcshareddata/xcschemes/Test Tools.xcscheme @@ -0,0 +1,59 @@ + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/JavaScriptCore/JavaScriptCore.xcodeproj/xcshareddata/xcschemes/jsc.xcscheme b/JavaScriptCore/JavaScriptCore.xcodeproj/xcshareddata/xcschemes/jsc.xcscheme new file mode 100644 index 00000000..1cf17af3 --- /dev/null +++ b/JavaScriptCore/JavaScriptCore.xcodeproj/xcshareddata/xcschemes/jsc.xcscheme @@ -0,0 +1,86 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/JavaScriptCore/JavaScriptCore.xcodeproj/xcshareddata/xcschemes/llvmForJSC.xcscheme b/JavaScriptCore/JavaScriptCore.xcodeproj/xcshareddata/xcschemes/llvmForJSC.xcscheme new file mode 100644 index 00000000..866b7657 --- /dev/null +++ b/JavaScriptCore/JavaScriptCore.xcodeproj/xcshareddata/xcschemes/llvmForJSC.xcscheme @@ -0,0 +1,59 @@ + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/JavaScriptCore/JavaScriptCore.xcodeproj/xcshareddata/xcschemes/minidom.xcscheme b/JavaScriptCore/JavaScriptCore.xcodeproj/xcshareddata/xcschemes/minidom.xcscheme new file mode 100644 index 00000000..78782809 --- /dev/null +++ b/JavaScriptCore/JavaScriptCore.xcodeproj/xcshareddata/xcschemes/minidom.xcscheme @@ -0,0 +1,86 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/JavaScriptCore/JavaScriptCore.xcodeproj/xcshareddata/xcschemes/testRegExp.xcscheme b/JavaScriptCore/JavaScriptCore.xcodeproj/xcshareddata/xcschemes/testRegExp.xcscheme new file mode 100644 index 00000000..a3e990b2 --- /dev/null +++ b/JavaScriptCore/JavaScriptCore.xcodeproj/xcshareddata/xcschemes/testRegExp.xcscheme @@ -0,0 +1,86 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/JavaScriptCore/JavaScriptCore.xcodeproj/xcshareddata/xcschemes/testapi.xcscheme b/JavaScriptCore/JavaScriptCore.xcodeproj/xcshareddata/xcschemes/testapi.xcscheme new file mode 100644 index 00000000..3e2ea9be --- /dev/null +++ b/JavaScriptCore/JavaScriptCore.xcodeproj/xcshareddata/xcschemes/testapi.xcscheme @@ -0,0 +1,86 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/WTF/WTF.xcodeproj/xcshareddata/xcschemes/Copy WTF Headers.xcscheme b/WTF/WTF.xcodeproj/xcshareddata/xcschemes/Copy WTF Headers.xcscheme new file mode 100644 index 00000000..b104d25e --- /dev/null +++ b/WTF/WTF.xcodeproj/xcshareddata/xcschemes/Copy WTF Headers.xcscheme @@ -0,0 +1,59 @@ + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/WTF/WTF.xcodeproj/xcshareddata/xcschemes/WTF iOS.xcscheme b/WTF/WTF.xcodeproj/xcshareddata/xcschemes/WTF iOS.xcscheme new file mode 100644 index 00000000..f6a0bc96 --- /dev/null +++ b/WTF/WTF.xcodeproj/xcshareddata/xcschemes/WTF iOS.xcscheme @@ -0,0 +1,59 @@ + + + + + + + + + + + + + + + + + + + + + + + + + From 675ef78c7cfcd006158554f1868452e2b7e4deba Mon Sep 17 00:00:00 2001 From: Dominic Szablewski Date: Sat, 18 Jan 2014 13:56:35 +0100 Subject: [PATCH 43/69] Clarified some things --- README.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 59829170..e523c827 100644 --- a/README.md +++ b/README.md @@ -1,14 +1,14 @@ # JavaScriptCore iOS -The JavaScriptCore library is part of the [WebKit project](http://www.webkit.org/) and thus Open Source. However, in the sources you get from the [WebKit SVN](https://svn.webkit.org/repository/webkit/trunk), the XCode project files are curiously missing an iOS compile target. You can't compile it for iOS. The sources you get from [opensource.apple.com](http://opensource.apple.com/release/ios-601/) are missing the project files altogether. You can't compile it all. That's quite the Open Source spirit, Apple! +The JavaScriptCore library is part of the [WebKit project](http://www.webkit.org/) and thus Open Source. However, in the sources you get from the [WebKit SVN](https://svn.webkit.org/repository/webkit/trunk), the XCode project files are curiously missing an iOS compile target. The sources you get from [opensource.apple.com](http://opensource.apple.com/release/ios-601/) are missing the project files altogether. You can't compile it at all. That's quite the Open Source spirit, Apple! This repo aims to re-produce the missing iOS targets while staying on a somewhat up-to-date version. Currently, the [Safari-538.12.1 tag](https://svn.webkit.org/repository/webkit/tags/Safari-538.12.1/) is used as the basis. With the current settings, the WTF and JavaScriptCore libraries can be compiled for armv7, arm64 and x86 (for the iOS simulator). It will be compiled without Unicode collation support, because Apple claims [ICU](http://site.icu-project.org/) is a private framework on iOS. It should be AppStore compatible this way. -This version of JSC deprecates the `typed-arrays` branch of this repository. The updated 538.4 tag now supports Typed Arrays natively, without any hacks. +This version of JSC deprecates the `typed-arrays` branch of this repository. JSC now supports Typed Arrays natively, without any hacks. -Note however, that the source code of JSC was still modified from the 538.4 tag: +Note however, that the source code of JSC was still modified: - It includes some API methods to work with Typed Arrays in native code. Have a look at the `API/JSTypedArray.h`, it declares three new API functions. The documentation for these functions can be found in this header file as well. - `Number.MIN_VALUE` was fixed to return `DBL_MIN` instead of `0` when the CPU has not enabled support denormal numbers. From bc7baf68d62520ddf9144fee6450eefc75ba1b13 Mon Sep 17 00:00:00 2001 From: Dominic Szablewski Date: Sun, 19 Jan 2014 00:57:14 +0100 Subject: [PATCH 44/69] Added armv7s slice for AppStore compatability when publishing arm64 Apps --- JavaScriptCore/JavaScriptCore.xcodeproj/project.pbxproj | 8 ++++++++ README.md | 2 +- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/JavaScriptCore/JavaScriptCore.xcodeproj/project.pbxproj b/JavaScriptCore/JavaScriptCore.xcodeproj/project.pbxproj index 6384f289..2cda0d5b 100644 --- a/JavaScriptCore/JavaScriptCore.xcodeproj/project.pbxproj +++ b/JavaScriptCore/JavaScriptCore.xcodeproj/project.pbxproj @@ -9022,6 +9022,8 @@ isa = XCBuildConfiguration; baseConfigurationReference = 10EAA6FF1889E6B300DEB161 /* JavaScriptCore-iOS-Static.xcconfig */; buildSettings = { + ARCHS = "$(ARCHS_STANDARD_INCLUDING_64_BIT)"; + VALID_ARCHS = "arm64 armv7 i386 armv7s"; }; name = Debug; }; @@ -9029,6 +9031,8 @@ isa = XCBuildConfiguration; baseConfigurationReference = 10EAA6FF1889E6B300DEB161 /* JavaScriptCore-iOS-Static.xcconfig */; buildSettings = { + ARCHS = "$(ARCHS_STANDARD_INCLUDING_64_BIT)"; + VALID_ARCHS = "arm64 armv7 i386 armv7s"; }; name = Release; }; @@ -9036,6 +9040,8 @@ isa = XCBuildConfiguration; baseConfigurationReference = 10EAA6FF1889E6B300DEB161 /* JavaScriptCore-iOS-Static.xcconfig */; buildSettings = { + ARCHS = "$(ARCHS_STANDARD_INCLUDING_64_BIT)"; + VALID_ARCHS = "arm64 armv7 i386 armv7s"; }; name = Profiling; }; @@ -9043,7 +9049,9 @@ isa = XCBuildConfiguration; baseConfigurationReference = 10EAA6FF1889E6B300DEB161 /* JavaScriptCore-iOS-Static.xcconfig */; buildSettings = { + ARCHS = "$(ARCHS_STANDARD_INCLUDING_64_BIT)"; BUILD_VARIANTS = normal; + VALID_ARCHS = "arm64 armv7 i386 armv7s"; }; name = Production; }; diff --git a/README.md b/README.md index e523c827..23dc87be 100644 --- a/README.md +++ b/README.md @@ -4,7 +4,7 @@ The JavaScriptCore library is part of the [WebKit project](http://www.webkit.org This repo aims to re-produce the missing iOS targets while staying on a somewhat up-to-date version. -Currently, the [Safari-538.12.1 tag](https://svn.webkit.org/repository/webkit/tags/Safari-538.12.1/) is used as the basis. With the current settings, the WTF and JavaScriptCore libraries can be compiled for armv7, arm64 and x86 (for the iOS simulator). It will be compiled without Unicode collation support, because Apple claims [ICU](http://site.icu-project.org/) is a private framework on iOS. It should be AppStore compatible this way. +Currently, the [Safari-538.12.1 tag](https://svn.webkit.org/repository/webkit/tags/Safari-538.12.1/) is used as the basis. With the current settings, the WTF and JavaScriptCore libraries can be compiled for armv7, armv7s, arm64 and x86 (for the iOS simulator). It will be compiled without Unicode collation support, because Apple claims [ICU](http://site.icu-project.org/) is a private framework on iOS. It should be AppStore compatible this way. This version of JSC deprecates the `typed-arrays` branch of this repository. JSC now supports Typed Arrays natively, without any hacks. From 176103b7d9121406ed5213e4135d6a10b20ee45e Mon Sep 17 00:00:00 2001 From: Dominic Szablewski Date: Sun, 19 Jan 2014 00:59:27 +0100 Subject: [PATCH 45/69] Added notice about armv7s, arm64 --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 23dc87be..88de5544 100644 --- a/README.md +++ b/README.md @@ -15,7 +15,7 @@ Note however, that the source code of JSC was still modified: ## Binaries -A compiled version of the `libJavaScriptCore.a` for armv7 and the Simulator can be found in the [source tree](https://github.com/phoboslab/Ejecta/tree/master/Source/lib) of the [Ejecta project](https://github.com/phoboslab/Ejecta). +A compiled version of the `libJavaScriptCore.a` for armv7, armv7s, arm64 and the Simulator can be found in the [source tree](https://github.com/phoboslab/Ejecta/tree/master/Source/lib) of the [Ejecta project](https://github.com/phoboslab/Ejecta). ## How to Compile From 05b40b01fcc729ec93dda6699cafe2997e0bd550 Mon Sep 17 00:00:00 2001 From: Dominic Szablewski Date: Wed, 22 Jan 2014 18:52:03 +0100 Subject: [PATCH 46/69] Downgrade to 538.11.1 due to stability issues --- JavaScriptCore/API/JSBase.h | 2 +- JavaScriptCore/API/JSStringRef.cpp | 6 +- JavaScriptCore/API/JSStringRefCF.cpp | 2 +- JavaScriptCore/API/JSWrapperMap.mm | 26 +- JavaScriptCore/API/OpaqueJSString.h | 9 +- JavaScriptCore/API/WebKitAvailability.h | 891 +++++++++- JavaScriptCore/API/tests/testapi.mm | 16 - JavaScriptCore/CMakeLists.txt | 134 +- JavaScriptCore/ChangeLog | 1434 +---------------- JavaScriptCore/DerivedSources.make | 6 - JavaScriptCore/GNUmakefile.am | 14 - JavaScriptCore/GNUmakefile.list.am | 20 - JavaScriptCore/JSTypedArray.cpp | 132 ++ JavaScriptCore/JSTypedArray.h | 73 + .../JavaScriptCore.vcxproj | 20 - .../JavaScriptCore.vcxproj.filters | 6 - .../JavaScriptCore.vcxproj/copy-files.cmd | 3 +- .../JavaScriptCore.xcodeproj/project.pbxproj | 184 +-- JavaScriptCore/PlatformBlackBerry.cmake | 9 + JavaScriptCore/assembler/ARMAssembler.h | 5 + JavaScriptCore/assembler/ARMv7Assembler.h | 13 +- .../assembler/MacroAssemblerARMv7.h | 2 +- JavaScriptCore/bytecode/CallLinkStatus.cpp | 2 +- JavaScriptCore/bytecode/CodeBlock.cpp | 40 +- JavaScriptCore/bytecode/CodeBlock.h | 33 +- JavaScriptCore/bytecode/GetByIdStatus.cpp | 4 +- .../bytecode/LazyOperandValueProfile.cpp | 4 + .../bytecode/LazyOperandValueProfile.h | 6 + JavaScriptCore/bytecode/PutByIdStatus.cpp | 2 +- JavaScriptCore/bytecode/ValueProfile.h | 6 + JavaScriptCore/bytecode/Watchpoint.h | 5 +- .../bytecompiler/BytecodeGenerator.cpp | 16 +- JavaScriptCore/debugger/Debugger.h | 4 +- .../dfg/DFGAbstractInterpreterInlines.h | 308 +--- JavaScriptCore/dfg/DFGArithMode.cpp | 60 - JavaScriptCore/dfg/DFGArithMode.h | 109 -- .../dfg/DFGBackwardsPropagationPhase.cpp | 10 +- JavaScriptCore/dfg/DFGByteCodeParser.cpp | 74 +- JavaScriptCore/dfg/DFGCSEPhase.cpp | 7 +- .../dfg/DFGConstantFoldingPhase.cpp | 15 - JavaScriptCore/dfg/DFGFixupPhase.cpp | 141 +- JavaScriptCore/dfg/DFGGraph.cpp | 2 - JavaScriptCore/dfg/DFGNode.h | 32 - JavaScriptCore/dfg/DFGOperations.cpp | 2 - .../dfg/DFGPredictionPropagationPhase.cpp | 8 +- JavaScriptCore/dfg/DFGSpeculativeJIT.cpp | 97 +- JavaScriptCore/dfg/DFGSpeculativeJIT.h | 1 + JavaScriptCore/dfg/DFGSpeculativeJIT32_64.cpp | 7 +- JavaScriptCore/dfg/DFGSpeculativeJIT64.cpp | 7 +- .../disassembler/udis86/udis86_decode.c | 2 - .../disassembler/udis86/udis86_syn-att.c | 14 +- .../disassembler/udis86/udis86_syn-intel.c | 10 +- .../disassembler/udis86/udis86_types.h | 6 +- JavaScriptCore/ftl/FTLLowerDFGToLLVM.cpp | 22 +- JavaScriptCore/ftl/FTLOSREntry.cpp | 1 - JavaScriptCore/ftl/FTLOSRExitCompiler.cpp | 1 - JavaScriptCore/heap/CodeBlockSet.cpp | 16 +- JavaScriptCore/heap/CodeBlockSet.h | 7 - JavaScriptCore/heap/CopiedAllocator.h | 9 - JavaScriptCore/heap/CopiedBlock.h | 26 +- JavaScriptCore/heap/CopiedBlockInlines.h | 38 +- JavaScriptCore/heap/CopiedSpace.cpp | 188 +-- JavaScriptCore/heap/CopiedSpace.h | 36 +- JavaScriptCore/heap/CopiedSpaceInlines.h | 93 +- JavaScriptCore/heap/CopyVisitor.cpp | 2 +- JavaScriptCore/heap/CopyVisitorInlines.h | 4 +- JavaScriptCore/heap/GCThreadSharedData.cpp | 10 +- JavaScriptCore/heap/Heap.cpp | 173 +- JavaScriptCore/heap/Heap.h | 55 +- JavaScriptCore/heap/HeapOperation.h | 2 +- JavaScriptCore/heap/HeapTimer.cpp | 24 + JavaScriptCore/heap/HeapTimer.h | 6 + JavaScriptCore/heap/IncrementalSweeper.cpp | 30 +- JavaScriptCore/heap/IncrementalSweeper.h | 4 +- JavaScriptCore/heap/MachineStackMarker.cpp | 30 +- JavaScriptCore/heap/MarkStack.cpp | 47 +- JavaScriptCore/heap/MarkStack.h | 4 - JavaScriptCore/heap/MarkedAllocator.cpp | 49 +- JavaScriptCore/heap/MarkedAllocator.h | 14 +- JavaScriptCore/heap/MarkedBlock.cpp | 45 - JavaScriptCore/heap/MarkedBlock.h | 64 +- JavaScriptCore/heap/MarkedSpace.cpp | 37 +- JavaScriptCore/heap/MarkedSpace.h | 28 +- JavaScriptCore/heap/SlotVisitor.cpp | 7 +- JavaScriptCore/heap/SlotVisitor.h | 10 +- JavaScriptCore/heap/SlotVisitorInlines.h | 35 +- JavaScriptCore/heap/TinyBloomFilter.h | 6 - JavaScriptCore/inspector/InjectedScript.cpp | 243 --- JavaScriptCore/inspector/InjectedScript.h | 85 - .../inspector/InjectedScriptBase.cpp | 155 -- JavaScriptCore/inspector/InjectedScriptBase.h | 83 - .../inspector/InjectedScriptHost.cpp | 83 - JavaScriptCore/inspector/InjectedScriptHost.h | 59 - .../inspector/InjectedScriptManager.cpp | 185 --- .../inspector/InjectedScriptManager.h | 85 - .../inspector/InjectedScriptModule.cpp | 91 -- .../inspector/InjectedScriptModule.h | 69 - .../inspector/InjectedScriptSource.js | 1033 ------------ .../inspector/InspectorAgentRegistry.cpp | 10 +- .../inspector/InspectorAgentRegistry.h | 14 +- .../inspector/InspectorEnvironment.h | 53 - JavaScriptCore/inspector/InspectorValues.cpp | 4 +- .../JSGlobalObjectInspectorController.cpp | 103 -- .../JSGlobalObjectInspectorController.h | 78 - .../inspector/JSInjectedScriptHost.cpp | 205 --- .../inspector/JSInjectedScriptHost.h | 90 -- .../JSInjectedScriptHostPrototype.cpp | 140 -- .../inspector/JSInjectedScriptHostPrototype.h | 68 - .../inspector/agents/InspectorAgent.cpp | 110 -- .../inspector/agents/InspectorAgent.h | 72 - .../inspector/protocol/Debugger.json | 60 + .../inspector/remote/RemoteInspector.mm | 8 +- .../remote/RemoteInspectorConstants.h | 1 - .../remote/RemoteInspectorDebuggable.cpp | 1 - .../remote/RemoteInspectorDebuggable.h | 5 - .../scripts/CodeGeneratorInspector.py | 107 +- .../scripts/CodeGeneratorInspectorStrings.py | 2 - JavaScriptCore/inspector/scripts/cssmin.py | 44 - ...line-and-minify-stylesheets-and-scripts.py | 81 - JavaScriptCore/inspector/scripts/jsmin.py | 218 --- JavaScriptCore/inspector/scripts/xxd.pl | 45 - JavaScriptCore/jit/ExecutableAllocator.h | 2 +- JavaScriptCore/jit/GPRInfo.h | 4 + JavaScriptCore/jit/JIT.cpp | 16 +- JavaScriptCore/jit/JIT.h | 13 +- JavaScriptCore/jit/JITArithmetic.cpp | 17 + JavaScriptCore/jit/JITArithmetic32_64.cpp | 18 + JavaScriptCore/jit/JITCall.cpp | 2 +- JavaScriptCore/jit/JITCall32_64.cpp | 2 +- JavaScriptCore/jit/JITInlines.h | 67 +- JavaScriptCore/jit/JITOpcodes.cpp | 2 +- JavaScriptCore/jit/JITOpcodes32_64.cpp | 2 +- JavaScriptCore/jit/JITPropertyAccess.cpp | 8 +- JavaScriptCore/jit/JITPropertyAccess32_64.cpp | 8 +- JavaScriptCore/jit/Repatch.cpp | 32 +- JavaScriptCore/jit/ScratchRegisterAllocator.h | 17 +- JavaScriptCore/jsc.cpp | 9 + JavaScriptCore/llint/LLIntCommon.h | 9 + JavaScriptCore/llint/LLIntOfflineAsmConfig.h | 18 +- JavaScriptCore/llint/LLIntSlowPaths.cpp | 38 +- JavaScriptCore/llint/LLIntSlowPaths.h | 1 - JavaScriptCore/llint/LowLevelInterpreter.asm | 112 +- JavaScriptCore/llint/LowLevelInterpreter.cpp | 18 - .../llint/LowLevelInterpreter32_64.asm | 118 +- .../llint/LowLevelInterpreter64.asm | 119 +- JavaScriptCore/llvm/InitializeLLVMLinux.cpp | 43 - JavaScriptCore/llvm/library/config_llvm.h | 5 - JavaScriptCore/offlineasm/arm.rb | 10 +- JavaScriptCore/offlineasm/arm64.rb | 21 +- JavaScriptCore/offlineasm/mips.rb | 14 +- JavaScriptCore/offlineasm/x86.rb | 12 +- JavaScriptCore/parser/Parser.cpp | 1 - .../profiler/ProfilerBytecodeSequence.cpp | 2 + JavaScriptCore/runtime/CommonIdentifiers.h | 6 +- JavaScriptCore/runtime/CommonSlowPaths.cpp | 8 + JavaScriptCore/runtime/GCActivityCallback.cpp | 2 +- .../runtime/GCActivityCallbackBlackBerry.cpp | 58 + ...SGenericTypedArrayViewConstructorInlines.h | 2 +- .../runtime/JSGenericTypedArrayViewInlines.h | 2 +- .../runtime/JSGlobalObjectDebuggable.cpp | 30 +- .../runtime/JSGlobalObjectDebuggable.h | 4 +- .../runtime/JSGlobalObjectFunctions.cpp | 2 +- .../runtime/JSPromiseConstructor.cpp | 232 +-- JavaScriptCore/runtime/JSPromiseDeferred.cpp | 69 +- JavaScriptCore/runtime/JSPromiseDeferred.h | 5 - JavaScriptCore/runtime/JSPromiseFunctions.cpp | 50 - JavaScriptCore/runtime/JSPromiseFunctions.h | 1 - JavaScriptCore/runtime/JSPromiseReaction.cpp | 38 +- .../runtime/JSPropertyNameIterator.h | 4 +- JavaScriptCore/runtime/JSString.cpp | 2 +- JavaScriptCore/runtime/MemoryStatistics.cpp | 2 +- JavaScriptCore/runtime/RegExpConstructor.cpp | 12 +- JavaScriptCore/runtime/StringPrototype.cpp | 8 +- .../runtime/StructureRareDataInlines.h | 8 +- JavaScriptCore/runtime/WeakMapData.cpp | 2 +- JavaScriptCore/shell/PlatformBlackBerry.cmake | 16 + .../bit-op-value-to-int32-input-liveness.js | 20 - ...ments-set-local-then-exit-in-same-block.js | 17 - WTF/WTF.xcodeproj/project.pbxproj | 15 +- WTF/wtf/Assertions.cpp | 8 + WTF/wtf/Atomics.h | 8 + WTF/wtf/Bitmap.h | 2 +- WTF/wtf/CMakeLists.txt | 6 +- WTF/wtf/Compiler.h | 6 + WTF/wtf/CurrentTime.cpp | 25 + WTF/wtf/DateMath.cpp | 5 + WTF/wtf/DisallowCType.h | 2 +- WTF/wtf/DoublyLinkedList.h | 26 - WTF/wtf/FeatureDefines.h | 17 +- .../{IteratorAdaptors.h => FilterIterator.h} | 60 +- WTF/wtf/Forward.h | 4 - WTF/wtf/HashMap.h | 10 +- WTF/wtf/HashSet.h | 11 - WTF/wtf/HashTable.cpp | 18 +- WTF/wtf/InlineASM.h | 3 +- WTF/wtf/{IteratorRange.h => IteratorPair.h} | 16 +- WTF/wtf/MainThread.cpp | 12 +- WTF/wtf/MainThread.h | 11 +- WTF/wtf/MathExtras.h | 17 + WTF/wtf/MediaTime.cpp | 14 +- WTF/wtf/NumberOfCores.cpp | 6 + WTF/wtf/OSAllocatorPosix.cpp | 29 +- WTF/wtf/Platform.h | 93 +- WTF/wtf/PlatformBlackBerry.cmake | 4 + WTF/wtf/RAMSize.cpp | 7 + WTF/wtf/RefCounted.h | 69 + WTF/wtf/RefPtrHashMap.h | 8 +- WTF/wtf/SizeLimits.cpp | 84 + WTF/wtf/StackBounds.cpp | 34 + WTF/wtf/ThreadRestrictionVerifier.h | 214 +++ WTF/wtf/Threading.h | 9 + WTF/wtf/ThreadingPthreads.cpp | 39 +- WTF/wtf/ThreadingWin.cpp | 20 +- WTF/wtf/blackberry/MainThreadBlackBerry.cpp | 36 + WTF/wtf/blackberry/RunLoopBlackBerry.cpp | 48 + WTF/wtf/mac/DeprecatedSymbolsUsedBySafari.mm | 68 - WTF/wtf/text/AtomicString.cpp | 6 +- WTF/wtf/text/AtomicString.h | 6 +- WTF/wtf/text/Base64.cpp | 4 +- WTF/wtf/text/StringBuilder.h | 9 +- WTF/wtf/text/StringConcatenate.h | 2 +- WTF/wtf/text/StringImpl.cpp | 68 +- WTF/wtf/text/StringImpl.h | 12 +- WTF/wtf/text/StringView.h | 157 -- WTF/wtf/text/WTFString.cpp | 43 +- WTF/wtf/text/WTFString.h | 24 +- WTF/wtf/unicode/Collator.h | 1 - WTF/wtf/unicode/icu/CollatorICU.cpp | 22 +- WTF/wtf/win/RunLoopWin.cpp | 2 + 229 files changed, 3387 insertions(+), 8247 deletions(-) create mode 100644 JavaScriptCore/JSTypedArray.cpp create mode 100644 JavaScriptCore/JSTypedArray.h create mode 100644 JavaScriptCore/PlatformBlackBerry.cmake delete mode 100644 JavaScriptCore/dfg/DFGArithMode.cpp delete mode 100644 JavaScriptCore/dfg/DFGArithMode.h delete mode 100644 JavaScriptCore/inspector/InjectedScript.cpp delete mode 100644 JavaScriptCore/inspector/InjectedScript.h delete mode 100644 JavaScriptCore/inspector/InjectedScriptBase.cpp delete mode 100644 JavaScriptCore/inspector/InjectedScriptBase.h delete mode 100644 JavaScriptCore/inspector/InjectedScriptHost.cpp delete mode 100644 JavaScriptCore/inspector/InjectedScriptHost.h delete mode 100644 JavaScriptCore/inspector/InjectedScriptManager.cpp delete mode 100644 JavaScriptCore/inspector/InjectedScriptManager.h delete mode 100644 JavaScriptCore/inspector/InjectedScriptModule.cpp delete mode 100644 JavaScriptCore/inspector/InjectedScriptModule.h delete mode 100644 JavaScriptCore/inspector/InjectedScriptSource.js delete mode 100644 JavaScriptCore/inspector/InspectorEnvironment.h delete mode 100644 JavaScriptCore/inspector/JSGlobalObjectInspectorController.cpp delete mode 100644 JavaScriptCore/inspector/JSGlobalObjectInspectorController.h delete mode 100644 JavaScriptCore/inspector/JSInjectedScriptHost.cpp delete mode 100644 JavaScriptCore/inspector/JSInjectedScriptHost.h delete mode 100644 JavaScriptCore/inspector/JSInjectedScriptHostPrototype.cpp delete mode 100644 JavaScriptCore/inspector/JSInjectedScriptHostPrototype.h delete mode 100644 JavaScriptCore/inspector/agents/InspectorAgent.cpp delete mode 100644 JavaScriptCore/inspector/agents/InspectorAgent.h delete mode 100644 JavaScriptCore/inspector/scripts/cssmin.py delete mode 100755 JavaScriptCore/inspector/scripts/inline-and-minify-stylesheets-and-scripts.py delete mode 100644 JavaScriptCore/inspector/scripts/jsmin.py delete mode 100644 JavaScriptCore/inspector/scripts/xxd.pl delete mode 100644 JavaScriptCore/llvm/InitializeLLVMLinux.cpp create mode 100644 JavaScriptCore/runtime/GCActivityCallbackBlackBerry.cpp create mode 100644 JavaScriptCore/shell/PlatformBlackBerry.cmake delete mode 100644 JavaScriptCore/tests/stress/bit-op-value-to-int32-input-liveness.js delete mode 100644 JavaScriptCore/tests/stress/phantom-arguments-set-local-then-exit-in-same-block.js rename WTF/wtf/{IteratorAdaptors.h => FilterIterator.h} (57%) rename WTF/wtf/{IteratorRange.h => IteratorPair.h} (82%) create mode 100644 WTF/wtf/PlatformBlackBerry.cmake create mode 100644 WTF/wtf/SizeLimits.cpp create mode 100644 WTF/wtf/ThreadRestrictionVerifier.h create mode 100644 WTF/wtf/blackberry/MainThreadBlackBerry.cpp create mode 100644 WTF/wtf/blackberry/RunLoopBlackBerry.cpp delete mode 100644 WTF/wtf/mac/DeprecatedSymbolsUsedBySafari.mm delete mode 100644 WTF/wtf/text/StringView.h diff --git a/JavaScriptCore/API/JSBase.h b/JavaScriptCore/API/JSBase.h index f7b91681..def4ea07 100644 --- a/JavaScriptCore/API/JSBase.h +++ b/JavaScriptCore/API/JSBase.h @@ -144,7 +144,7 @@ JS_EXPORT void JSGarbageCollect(JSContextRef ctx); #ifndef JSC_OBJC_API_AVAILABLE_MAC_OS_X_1080 #define JSC_OBJC_API_ENABLED (defined(__clang__) && defined(__APPLE__) && ((defined(__MAC_OS_X_VERSION_MIN_REQUIRED) && __MAC_OS_X_VERSION_MIN_REQUIRED >= 1090 && !defined(__i386__)) || (defined(TARGET_OS_IPHONE) && TARGET_OS_IPHONE))) #else -#define JSC_OBJC_API_ENABLED (defined(__clang__) && defined(__APPLE__) && ((defined(__MAC_OS_X_VERSION_MIN_REQUIRED) && __MAC_OS_X_VERSION_MIN_REQUIRED >= 1080 && !defined(__i386__)) || (defined(TARGET_OS_IPHONE) && TARGET_OS_IPHONE))) +#define JSC_OBJC_API_ENABLED (defined(__clang__) && defined(__APPLE__) && defined(__MAC_OS_X_VERSION_MIN_REQUIRED) && __MAC_OS_X_VERSION_MIN_REQUIRED >= 1080 && !defined(__i386__)) #endif #endif diff --git a/JavaScriptCore/API/JSStringRef.cpp b/JavaScriptCore/API/JSStringRef.cpp index 95edc673..a03afed5 100644 --- a/JavaScriptCore/API/JSStringRef.cpp +++ b/JavaScriptCore/API/JSStringRef.cpp @@ -83,7 +83,7 @@ size_t JSStringGetLength(JSStringRef string) const JSChar* JSStringGetCharactersPtr(JSStringRef string) { - return string->deprecatedCharacters(); + return string->characters(); } size_t JSStringGetMaximumUTF8CStringSize(JSStringRef string) @@ -98,7 +98,7 @@ size_t JSStringGetUTF8CString(JSStringRef string, char* buffer, size_t bufferSiz return 0; char* p = buffer; - const UChar* d = string->deprecatedCharacters(); + const UChar* d = string->characters(); ConversionResult result = convertUTF16ToUTF8(&d, d + string->length(), &p, p + bufferSize - 1, true); *p++ = '\0'; if (result != conversionOK && result != targetExhausted) @@ -110,7 +110,7 @@ size_t JSStringGetUTF8CString(JSStringRef string, char* buffer, size_t bufferSiz bool JSStringIsEqual(JSStringRef a, JSStringRef b) { unsigned len = a->length(); - return len == b->length() && 0 == memcmp(a->deprecatedCharacters(), b->deprecatedCharacters(), len * sizeof(UChar)); + return len == b->length() && 0 == memcmp(a->characters(), b->characters(), len * sizeof(UChar)); } bool JSStringIsEqualToUTF8CString(JSStringRef a, const char* b) diff --git a/JavaScriptCore/API/JSStringRefCF.cpp b/JavaScriptCore/API/JSStringRefCF.cpp index cd09564d..50593f19 100644 --- a/JavaScriptCore/API/JSStringRefCF.cpp +++ b/JavaScriptCore/API/JSStringRefCF.cpp @@ -61,5 +61,5 @@ CFStringRef JSStringCopyCFString(CFAllocatorRef alloc, JSStringRef string) if (!string->length()) return CFSTR(""); - return CFStringCreateWithCharacters(alloc, reinterpret_cast(string->deprecatedCharacters()), string->length()); + return CFStringCreateWithCharacters(alloc, reinterpret_cast(string->characters()), string->length()); } diff --git a/JavaScriptCore/API/JSWrapperMap.mm b/JavaScriptCore/API/JSWrapperMap.mm index ac0e0329..2f62fcca 100644 --- a/JavaScriptCore/API/JSWrapperMap.mm +++ b/JavaScriptCore/API/JSWrapperMap.mm @@ -98,16 +98,6 @@ - (JSObjCClassInfo*)classInfoForClass:(Class)cls; return result; } -static bool constructorHasInstance(JSContextRef ctx, JSObjectRef constructorRef, JSValueRef possibleInstance, JSValueRef*) -{ - JSC::ExecState* exec = toJS(ctx); - JSC::APIEntryShim entryShim(exec); - - JSC::JSObject* constructor = toJS(constructorRef); - JSC::JSValue instance = toJS(exec, possibleInstance); - return JSC::JSObject::defaultHasInstance(exec, instance, constructor->get(exec, exec->propertyNames().prototype)); -} - static JSObjectRef makeWrapper(JSContextRef ctx, JSClassRef jsClass, id wrappedObject) { JSC::ExecState* exec = toJS(ctx); @@ -136,18 +126,6 @@ static JSObjectRef makeWrapper(JSContextRef ctx, JSClassRef jsClass, id wrappedO return [JSValue valueWithJSValueRef:result inContext:context]; } -static JSValue *constructorWithCustomBrand(JSContext *context, NSString *brand, Class cls) -{ - JSClassDefinition definition; - definition = kJSClassDefinitionEmpty; - definition.className = [brand UTF8String]; - definition.hasInstance = constructorHasInstance; - JSClassRef classRef = JSClassCreate(&definition); - JSObjectRef result = makeWrapper([context JSGlobalContextRef], classRef, cls); - JSClassRelease(classRef); - return [JSValue valueWithJSValueRef:result inContext:context]; -} - // Look for @optional properties in the prototype containing a selector to property // name mapping, separated by a __JS_EXPORT_AS__ delimiter. static NSMutableDictionary *createRenameMap(Protocol *protocol, BOOL isInstanceMethod) @@ -401,7 +379,7 @@ - (void)dealloc static JSValue *allocateConstructorForCustomClass(JSContext *context, const char* className, Class cls) { if (!supportsInitMethodConstructors()) - return constructorWithCustomBrand(context, [NSString stringWithFormat:@"%sConstructor", className], cls); + return objectWithCustomBrand(context, [NSString stringWithFormat:@"%sConstructor", className], cls); // For each protocol that the class implements, gather all of the init family methods into a hash table. __block HashMap initTable; @@ -447,7 +425,7 @@ - (void)dealloc JSObjectRef method = objCCallbackFunctionForInit(context, cls, initProtocol, initMethod, types); return [JSValue valueWithJSValueRef:method inContext:context]; } - return constructorWithCustomBrand(context, [NSString stringWithFormat:@"%sConstructor", className], cls); + return objectWithCustomBrand(context, [NSString stringWithFormat:@"%sConstructor", className], cls); } - (void)allocateConstructorAndPrototypeWithSuperClassInfo:(JSObjCClassInfo*)superClassInfo diff --git a/JavaScriptCore/API/OpaqueJSString.h b/JavaScriptCore/API/OpaqueJSString.h index 61d80f3d..d617b35a 100644 --- a/JavaScriptCore/API/OpaqueJSString.h +++ b/JavaScriptCore/API/OpaqueJSString.h @@ -53,9 +53,8 @@ struct OpaqueJSString : public ThreadSafeRefCounted { JS_EXPORT_PRIVATE static PassRefPtr create(const String&); - const UChar* characters() { return deprecatedCharacters(); } // FIXME: Delete this. - const UChar* deprecatedCharacters() { return this ? m_string.deprecatedCharacters() : nullptr; } - unsigned length() { return this ? m_string.length() : 0; } + const UChar* characters() { return !!this ? m_string.characters() : 0; } + unsigned length() { return !!this ? m_string.length() : 0; } JS_EXPORT_PRIVATE String string() const; JSC::Identifier identifier(JSC::VM*) const; @@ -73,13 +72,13 @@ struct OpaqueJSString : public ThreadSafeRefCounted { } OpaqueJSString(const LChar* characters, unsigned length) - : m_string(characters, length) { + m_string = String(characters, length); } OpaqueJSString(const UChar* characters, unsigned length) - : m_string(characters, length) { + m_string = String(characters, length); } String m_string; diff --git a/JavaScriptCore/API/WebKitAvailability.h b/JavaScriptCore/API/WebKitAvailability.h index ee674b2c..ebb33bce 100644 --- a/JavaScriptCore/API/WebKitAvailability.h +++ b/JavaScriptCore/API/WebKitAvailability.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008, 2009, 2010, 2014 Apple Inc. All Rights Reserved. + * Copyright (C) 2008, 2009, 2010 Apple Inc. All Rights Reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -26,11 +26,900 @@ #ifndef __WebKitAvailability__ #define __WebKitAvailability__ +/* The structure of this header is based on AvailabilityMacros.h. The major difference is that the availability + macros are defined in terms of WebKit version numbers rather than Mac OS X system version numbers, as WebKit + releases span multiple versions of Mac OS X. +*/ + +#define WEBKIT_VERSION_1_0 0x0100 +#define WEBKIT_VERSION_1_1 0x0110 +#define WEBKIT_VERSION_1_2 0x0120 +#define WEBKIT_VERSION_1_3 0x0130 +#define WEBKIT_VERSION_2_0 0x0200 +#define WEBKIT_VERSION_3_0 0x0300 +#define WEBKIT_VERSION_3_1 0x0310 +#define WEBKIT_VERSION_4_0 0x0400 +#define WEBKIT_VERSION_LATEST 0x9999 + #ifdef __APPLE__ #include #include #else #define CF_AVAILABLE(_mac, _ios) +/* + * For non-Mac platforms, require the newest version. + */ +#define WEBKIT_VERSION_MIN_REQUIRED WEBKIT_VERSION_LATEST +/* + * only certain compilers support __attribute__((deprecated)) + */ +#if defined(__GNUC__) && ((__GNUC__ >= 4) || ((__GNUC__ == 3) && (__GNUC_MINOR__ >= 1))) + #define DEPRECATED_ATTRIBUTE __attribute__((deprecated)) +#else + #define DEPRECATED_ATTRIBUTE +#endif +#endif + +/* The versions of GCC that shipped with Xcode prior to 3.0 (GCC build number < 5400) did not support attributes on methods. + If we are building with one of these versions, we need to omit the attribute. We achieve this by wrapping the annotation + in WEBKIT_OBJC_METHOD_ANNOTATION, which will remove the annotation when an old version of GCC is in use and will otherwise + expand to the annotation. The same is needed for protocol methods. +*/ +#if defined(__APPLE_CC__) && __APPLE_CC__ < 5400 + #define WEBKIT_OBJC_METHOD_ANNOTATION(ANNOTATION) +#else + #define WEBKIT_OBJC_METHOD_ANNOTATION(ANNOTATION) ANNOTATION +#endif + + +/* If minimum WebKit version is not specified, assume the version that shipped with the target Mac OS X version */ +#ifndef WEBKIT_VERSION_MIN_REQUIRED + #if !defined(MAC_OS_X_VERSION_10_2) || MAC_OS_X_VERSION_MIN_REQUIRED < MAC_OS_X_VERSION_10_2 + #error WebKit was not available prior to Mac OS X 10.2 + #elif !defined(MAC_OS_X_VERSION_10_3) || MAC_OS_X_VERSION_MIN_REQUIRED < MAC_OS_X_VERSION_10_3 + /* WebKit 1.0 is the only version available on Mac OS X 10.2. */ + #define WEBKIT_VERSION_MIN_REQUIRED WEBKIT_VERSION_1_0 + #elif !defined(MAC_OS_X_VERSION_10_4) || MAC_OS_X_VERSION_MIN_REQUIRED < MAC_OS_X_VERSION_10_4 + /* WebKit 1.1 is the version that shipped on Mac OS X 10.3. */ + #define WEBKIT_VERSION_MIN_REQUIRED WEBKIT_VERSION_1_1 + #elif !defined(MAC_OS_X_VERSION_10_5) || MAC_OS_X_VERSION_MIN_REQUIRED < MAC_OS_X_VERSION_10_5 + /* WebKit 2.0 is the version that shipped on Mac OS X 10.4. */ + #define WEBKIT_VERSION_MIN_REQUIRED WEBKIT_VERSION_2_0 + #elif !defined(MAC_OS_X_VERSION_10_6) || MAC_OS_X_VERSION_MIN_REQUIRED < MAC_OS_X_VERSION_10_6 + /* WebKit 3.0 is the version that shipped on Mac OS X 10.5. */ + #define WEBKIT_VERSION_MIN_REQUIRED WEBKIT_VERSION_3_0 + #elif !defined(MAC_OS_X_VERSION_10_7) || MAC_OS_X_VERSION_MIN_REQUIRED < MAC_OS_X_VERSION_10_7 + /* WebKit 4.0 is the version that shipped on Mac OS X 10.6. */ + #define WEBKIT_VERSION_MIN_REQUIRED WEBKIT_VERSION_4_0 + #else + #define WEBKIT_VERSION_MIN_REQUIRED WEBKIT_VERSION_LATEST + #endif +#endif + + +/* If maximum WebKit version is not specified, assume largerof(latest, minimum) */ +#ifndef WEBKIT_VERSION_MAX_ALLOWED + #if WEBKIT_VERSION_MIN_REQUIRED > WEBKIT_VERSION_LATEST + #define WEBKIT_VERSION_MAX_ALLOWED WEBKIT_VERSION_MIN_REQUIRED + #else + #define WEBKIT_VERSION_MAX_ALLOWED WEBKIT_VERSION_LATEST + #endif +#endif + + +/* Sanity check the configured values */ +#if WEBKIT_VERSION_MAX_ALLOWED < WEBKIT_VERSION_MIN_REQUIRED + #error WEBKIT_VERSION_MAX_ALLOWED must be >= WEBKIT_VERSION_MIN_REQUIRED +#endif +#if WEBKIT_VERSION_MIN_REQUIRED < WEBKIT_VERSION_1_0 + #error WEBKIT_VERSION_MIN_REQUIRED must be >= WEBKIT_VERSION_1_0 +#endif + + + + + + +/* + * AVAILABLE_WEBKIT_VERSION_1_0_AND_LATER + * + * Used on functions introduced in WebKit 1.0 + */ +#define AVAILABLE_WEBKIT_VERSION_1_0_AND_LATER + +/* + * AVAILABLE_WEBKIT_VERSION_1_0_AND_LATER_BUT_DEPRECATED + * + * Used on functions introduced in WebKit 1.0, + * and deprecated in WebKit 1.0 + */ +#define AVAILABLE_WEBKIT_VERSION_1_0_AND_LATER_BUT_DEPRECATED DEPRECATED_ATTRIBUTE + +/* + * DEPRECATED_IN_WEBKIT_VERSION_1_0_AND_LATER + * + * Used on types deprecated in WebKit 1.0 + */ +#define DEPRECATED_IN_WEBKIT_VERSION_1_0_AND_LATER DEPRECATED_ATTRIBUTE + + + + + + +/* + * AVAILABLE_WEBKIT_VERSION_1_1_AND_LATER + * + * Used on declarations introduced in WebKit 1.1 + */ +#if WEBKIT_VERSION_MAX_ALLOWED < WEBKIT_VERSION_1_1 + #define AVAILABLE_WEBKIT_VERSION_1_1_AND_LATER UNAVAILABLE_ATTRIBUTE +#elif WEBKIT_VERSION_MIN_REQUIRED < WEBKIT_VERSION_1_1 + #define AVAILABLE_WEBKIT_VERSION_1_1_AND_LATER WEAK_IMPORT_ATTRIBUTE +#else + #define AVAILABLE_WEBKIT_VERSION_1_1_AND_LATER +#endif + +/* + * AVAILABLE_WEBKIT_VERSION_1_1_AND_LATER_BUT_DEPRECATED + * + * Used on declarations introduced in WebKit 1.1, + * and deprecated in WebKit 1.1 + */ +#if WEBKIT_VERSION_MIN_REQUIRED >= WEBKIT_VERSION_1_1 + #define AVAILABLE_WEBKIT_VERSION_1_1_AND_LATER_BUT_DEPRECATED DEPRECATED_ATTRIBUTE +#else + #define AVAILABLE_WEBKIT_VERSION_1_1_AND_LATER_BUT_DEPRECATED AVAILABLE_WEBKIT_VERSION_1_1_AND_LATER +#endif + +/* + * AVAILABLE_WEBKIT_VERSION_1_0_AND_LATER_BUT_DEPRECATED_IN_WEBKIT_VERSION_1_1 + * + * Used on declarations introduced in WebKit 1.0, + * but later deprecated in WebKit 1.1 + */ +#if WEBKIT_VERSION_MIN_REQUIRED >= WEBKIT_VERSION_1_1 + #define AVAILABLE_WEBKIT_VERSION_1_0_AND_LATER_BUT_DEPRECATED_IN_WEBKIT_VERSION_1_1 DEPRECATED_ATTRIBUTE +#else + #define AVAILABLE_WEBKIT_VERSION_1_0_AND_LATER_BUT_DEPRECATED_IN_WEBKIT_VERSION_1_1 AVAILABLE_WEBKIT_VERSION_1_0_AND_LATER +#endif + +/* + * DEPRECATED_IN_WEBKIT_VERSION_1_1_AND_LATER + * + * Used on types deprecated in WebKit 1.1 + */ +#if WEBKIT_VERSION_MIN_REQUIRED >= WEBKIT_VERSION_1_1 + #define DEPRECATED_IN_WEBKIT_VERSION_1_1_AND_LATER DEPRECATED_ATTRIBUTE +#else + #define DEPRECATED_IN_WEBKIT_VERSION_1_1_AND_LATER +#endif + + + + + + +/* + * AVAILABLE_WEBKIT_VERSION_1_2_AND_LATER + * + * Used on declarations introduced in WebKit 1.2 + */ +#if WEBKIT_VERSION_MAX_ALLOWED < WEBKIT_VERSION_1_2 + #define AVAILABLE_WEBKIT_VERSION_1_2_AND_LATER UNAVAILABLE_ATTRIBUTE +#elif WEBKIT_VERSION_MIN_REQUIRED < WEBKIT_VERSION_1_2 + #define AVAILABLE_WEBKIT_VERSION_1_2_AND_LATER WEAK_IMPORT_ATTRIBUTE +#else + #define AVAILABLE_WEBKIT_VERSION_1_2_AND_LATER +#endif + +/* + * AVAILABLE_WEBKIT_VERSION_1_2_AND_LATER_BUT_DEPRECATED + * + * Used on declarations introduced in WebKit 1.2, + * and deprecated in WebKit 1.2 + */ +#if WEBKIT_VERSION_MIN_REQUIRED >= WEBKIT_VERSION_1_2 + #define AVAILABLE_WEBKIT_VERSION_1_2_AND_LATER_BUT_DEPRECATED DEPRECATED_ATTRIBUTE +#else + #define AVAILABLE_WEBKIT_VERSION_1_2_AND_LATER_BUT_DEPRECATED AVAILABLE_WEBKIT_VERSION_1_2_AND_LATER +#endif + +/* + * AVAILABLE_WEBKIT_VERSION_1_0_AND_LATER_BUT_DEPRECATED_IN_WEBKIT_VERSION_1_2 + * + * Used on declarations introduced in WebKit 1.0, + * but later deprecated in WebKit 1.2 + */ +#if WEBKIT_VERSION_MIN_REQUIRED >= WEBKIT_VERSION_1_2 + #define AVAILABLE_WEBKIT_VERSION_1_0_AND_LATER_BUT_DEPRECATED_IN_WEBKIT_VERSION_1_2 DEPRECATED_ATTRIBUTE +#else + #define AVAILABLE_WEBKIT_VERSION_1_0_AND_LATER_BUT_DEPRECATED_IN_WEBKIT_VERSION_1_2 AVAILABLE_WEBKIT_VERSION_1_0_AND_LATER +#endif + +/* + * AVAILABLE_WEBKIT_VERSION_1_1_AND_LATER_BUT_DEPRECATED_IN_WEBKIT_VERSION_1_2 + * + * Used on declarations introduced in WebKit 1.1, + * but later deprecated in WebKit 1.2 + */ +#if WEBKIT_VERSION_MIN_REQUIRED >= WEBKIT_VERSION_1_2 + #define AVAILABLE_WEBKIT_VERSION_1_1_AND_LATER_BUT_DEPRECATED_IN_WEBKIT_VERSION_1_2 DEPRECATED_ATTRIBUTE +#else + #define AVAILABLE_WEBKIT_VERSION_1_1_AND_LATER_BUT_DEPRECATED_IN_WEBKIT_VERSION_1_2 AVAILABLE_WEBKIT_VERSION_1_1_AND_LATER +#endif + +/* + * DEPRECATED_IN_WEBKIT_VERSION_1_2_AND_LATER + * + * Used on types deprecated in WebKit 1.2 + */ +#if WEBKIT_VERSION_MIN_REQUIRED >= WEBKIT_VERSION_1_2 + #define DEPRECATED_IN_WEBKIT_VERSION_1_2_AND_LATER DEPRECATED_ATTRIBUTE +#else + #define DEPRECATED_IN_WEBKIT_VERSION_1_2_AND_LATER +#endif + + + + + + +/* + * AVAILABLE_WEBKIT_VERSION_1_3_AND_LATER + * + * Used on declarations introduced in WebKit 1.3 + */ +#if WEBKIT_VERSION_MAX_ALLOWED < WEBKIT_VERSION_1_3 + #define AVAILABLE_WEBKIT_VERSION_1_3_AND_LATER UNAVAILABLE_ATTRIBUTE +#elif WEBKIT_VERSION_MIN_REQUIRED < WEBKIT_VERSION_1_3 + #define AVAILABLE_WEBKIT_VERSION_1_3_AND_LATER WEAK_IMPORT_ATTRIBUTE +#else + #define AVAILABLE_WEBKIT_VERSION_1_3_AND_LATER +#endif + +/* + * AVAILABLE_WEBKIT_VERSION_1_3_AND_LATER_BUT_DEPRECATED + * + * Used on declarations introduced in WebKit 1.3, + * and deprecated in WebKit 1.3 + */ +#if WEBKIT_VERSION_MIN_REQUIRED >= WEBKIT_VERSION_1_3 + #define AVAILABLE_WEBKIT_VERSION_1_3_AND_LATER_BUT_DEPRECATED DEPRECATED_ATTRIBUTE +#else + #define AVAILABLE_WEBKIT_VERSION_1_3_AND_LATER_BUT_DEPRECATED AVAILABLE_WEBKIT_VERSION_1_3_AND_LATER +#endif + +/* + * AVAILABLE_WEBKIT_VERSION_1_0_AND_LATER_BUT_DEPRECATED_IN_WEBKIT_VERSION_1_3 + * + * Used on declarations introduced in WebKit 1.0, + * but later deprecated in WebKit 1.3 + */ +#if WEBKIT_VERSION_MIN_REQUIRED >= WEBKIT_VERSION_1_3 + #define AVAILABLE_WEBKIT_VERSION_1_0_AND_LATER_BUT_DEPRECATED_IN_WEBKIT_VERSION_1_3 DEPRECATED_ATTRIBUTE +#else + #define AVAILABLE_WEBKIT_VERSION_1_0_AND_LATER_BUT_DEPRECATED_IN_WEBKIT_VERSION_1_3 AVAILABLE_WEBKIT_VERSION_1_0_AND_LATER #endif +/* + * AVAILABLE_WEBKIT_VERSION_1_1_AND_LATER_BUT_DEPRECATED_IN_WEBKIT_VERSION_1_3 + * + * Used on declarations introduced in WebKit 1.1, + * but later deprecated in WebKit 1.3 + */ +#if WEBKIT_VERSION_MIN_REQUIRED >= WEBKIT_VERSION_1_3 + #define AVAILABLE_WEBKIT_VERSION_1_1_AND_LATER_BUT_DEPRECATED_IN_WEBKIT_VERSION_1_3 DEPRECATED_ATTRIBUTE +#else + #define AVAILABLE_WEBKIT_VERSION_1_1_AND_LATER_BUT_DEPRECATED_IN_WEBKIT_VERSION_1_3 AVAILABLE_WEBKIT_VERSION_1_1_AND_LATER +#endif + +/* + * AVAILABLE_WEBKIT_VERSION_1_2_AND_LATER_BUT_DEPRECATED_IN_WEBKIT_VERSION_1_3 + * + * Used on declarations introduced in WebKit 1.2, + * but later deprecated in WebKit 1.3 + */ +#if WEBKIT_VERSION_MIN_REQUIRED >= WEBKIT_VERSION_1_3 + #define AVAILABLE_WEBKIT_VERSION_1_2_AND_LATER_BUT_DEPRECATED_IN_WEBKIT_VERSION_1_3 DEPRECATED_ATTRIBUTE +#else + #define AVAILABLE_WEBKIT_VERSION_1_2_AND_LATER_BUT_DEPRECATED_IN_WEBKIT_VERSION_1_3 AVAILABLE_WEBKIT_VERSION_1_2_AND_LATER +#endif + +/* + * DEPRECATED_IN_WEBKIT_VERSION_1_3_AND_LATER + * + * Used on types deprecated in WebKit 1.3 + */ +#if WEBKIT_VERSION_MIN_REQUIRED >= WEBKIT_VERSION_1_3 + #define DEPRECATED_IN_WEBKIT_VERSION_1_3_AND_LATER DEPRECATED_ATTRIBUTE +#else + #define DEPRECATED_IN_WEBKIT_VERSION_1_3_AND_LATER +#endif + + + + + + +/* + * AVAILABLE_WEBKIT_VERSION_2_0_AND_LATER + * + * Used on declarations introduced in WebKit 2.0 + */ +#if WEBKIT_VERSION_MAX_ALLOWED < WEBKIT_VERSION_2_0 + #define AVAILABLE_WEBKIT_VERSION_2_0_AND_LATER UNAVAILABLE_ATTRIBUTE +#elif WEBKIT_VERSION_MIN_REQUIRED < WEBKIT_VERSION_2_0 + #define AVAILABLE_WEBKIT_VERSION_2_0_AND_LATER WEAK_IMPORT_ATTRIBUTE +#else + #define AVAILABLE_WEBKIT_VERSION_2_0_AND_LATER +#endif + +/* + * AVAILABLE_WEBKIT_VERSION_2_0_AND_LATER_BUT_DEPRECATED + * + * Used on declarations introduced in WebKit 2.0, + * and deprecated in WebKit 2.0 + */ +#if WEBKIT_VERSION_MIN_REQUIRED >= WEBKIT_VERSION_2_0 + #define AVAILABLE_WEBKIT_VERSION_2_0_AND_LATER_BUT_DEPRECATED DEPRECATED_ATTRIBUTE +#else + #define AVAILABLE_WEBKIT_VERSION_2_0_AND_LATER_BUT_DEPRECATED AVAILABLE_WEBKIT_VERSION_2_0_AND_LATER +#endif + +/* + * AVAILABLE_WEBKIT_VERSION_1_0_AND_LATER_BUT_DEPRECATED_IN_WEBKIT_VERSION_2_0 + * + * Used on declarations introduced in WebKit 1.0, + * but later deprecated in WebKit 2.0 + */ +#if WEBKIT_VERSION_MIN_REQUIRED >= WEBKIT_VERSION_2_0 + #define AVAILABLE_WEBKIT_VERSION_1_0_AND_LATER_BUT_DEPRECATED_IN_WEBKIT_VERSION_2_0 DEPRECATED_ATTRIBUTE +#else + #define AVAILABLE_WEBKIT_VERSION_1_0_AND_LATER_BUT_DEPRECATED_IN_WEBKIT_VERSION_2_0 AVAILABLE_WEBKIT_VERSION_1_0_AND_LATER +#endif + +/* + * AVAILABLE_WEBKIT_VERSION_1_1_AND_LATER_BUT_DEPRECATED_IN_WEBKIT_VERSION_2_0 + * + * Used on declarations introduced in WebKit 1.1, + * but later deprecated in WebKit 2.0 + */ +#if WEBKIT_VERSION_MIN_REQUIRED >= WEBKIT_VERSION_2_0 + #define AVAILABLE_WEBKIT_VERSION_1_1_AND_LATER_BUT_DEPRECATED_IN_WEBKIT_VERSION_2_0 DEPRECATED_ATTRIBUTE +#else + #define AVAILABLE_WEBKIT_VERSION_1_1_AND_LATER_BUT_DEPRECATED_IN_WEBKIT_VERSION_2_0 AVAILABLE_WEBKIT_VERSION_1_1_AND_LATER +#endif + +/* + * AVAILABLE_WEBKIT_VERSION_1_2_AND_LATER_BUT_DEPRECATED_IN_WEBKIT_VERSION_2_0 + * + * Used on declarations introduced in WebKit 1.2, + * but later deprecated in WebKit 2.0 + */ +#if WEBKIT_VERSION_MIN_REQUIRED >= WEBKIT_VERSION_2_0 + #define AVAILABLE_WEBKIT_VERSION_1_2_AND_LATER_BUT_DEPRECATED_IN_WEBKIT_VERSION_2_0 DEPRECATED_ATTRIBUTE +#else + #define AVAILABLE_WEBKIT_VERSION_1_2_AND_LATER_BUT_DEPRECATED_IN_WEBKIT_VERSION_2_0 AVAILABLE_WEBKIT_VERSION_1_2_AND_LATER +#endif + +/* + * AVAILABLE_WEBKIT_VERSION_1_3_AND_LATER_BUT_DEPRECATED_IN_WEBKIT_VERSION_2_0 + * + * Used on declarations introduced in WebKit 1.3, + * but later deprecated in WebKit 2.0 + */ +#if WEBKIT_VERSION_MIN_REQUIRED >= WEBKIT_VERSION_2_0 + #define AVAILABLE_WEBKIT_VERSION_1_3_AND_LATER_BUT_DEPRECATED_IN_WEBKIT_VERSION_2_0 DEPRECATED_ATTRIBUTE +#else + #define AVAILABLE_WEBKIT_VERSION_1_3_AND_LATER_BUT_DEPRECATED_IN_WEBKIT_VERSION_2_0 AVAILABLE_WEBKIT_VERSION_1_3_AND_LATER +#endif + +/* + * DEPRECATED_IN_WEBKIT_VERSION_2_0_AND_LATER + * + * Used on types deprecated in WebKit 2.0 + */ +#if WEBKIT_VERSION_MIN_REQUIRED >= WEBKIT_VERSION_2_0 + #define DEPRECATED_IN_WEBKIT_VERSION_2_0_AND_LATER DEPRECATED_ATTRIBUTE +#else + #define DEPRECATED_IN_WEBKIT_VERSION_2_0_AND_LATER +#endif + + + + + + +/* + * AVAILABLE_WEBKIT_VERSION_3_0_AND_LATER + * + * Used on declarations introduced in WebKit 3.0 + */ +#if WEBKIT_VERSION_MAX_ALLOWED < WEBKIT_VERSION_3_0 + #define AVAILABLE_WEBKIT_VERSION_3_0_AND_LATER UNAVAILABLE_ATTRIBUTE +#elif WEBKIT_VERSION_MIN_REQUIRED < WEBKIT_VERSION_3_0 + #define AVAILABLE_WEBKIT_VERSION_3_0_AND_LATER WEAK_IMPORT_ATTRIBUTE +#else + #define AVAILABLE_WEBKIT_VERSION_3_0_AND_LATER +#endif + +/* + * AVAILABLE_WEBKIT_VERSION_3_0_AND_LATER_BUT_DEPRECATED + * + * Used on declarations introduced in WebKit 3.0, + * and deprecated in WebKit 3.0 + */ +#if WEBKIT_VERSION_MIN_REQUIRED >= WEBKIT_VERSION_3_0 + #define AVAILABLE_WEBKIT_VERSION_3_0_AND_LATER_BUT_DEPRECATED DEPRECATED_ATTRIBUTE +#else + #define AVAILABLE_WEBKIT_VERSION_3_0_AND_LATER_BUT_DEPRECATED AVAILABLE_WEBKIT_VERSION_3_0_AND_LATER +#endif + +/* + * AVAILABLE_WEBKIT_VERSION_1_0_AND_LATER_BUT_DEPRECATED_IN_WEBKIT_VERSION_3_0 + * + * Used on declarations introduced in WebKit 1.0, + * but later deprecated in WebKit 3.0 + */ +#if WEBKIT_VERSION_MIN_REQUIRED >= WEBKIT_VERSION_3_0 + #define AVAILABLE_WEBKIT_VERSION_1_0_AND_LATER_BUT_DEPRECATED_IN_WEBKIT_VERSION_3_0 DEPRECATED_ATTRIBUTE +#else + #define AVAILABLE_WEBKIT_VERSION_1_0_AND_LATER_BUT_DEPRECATED_IN_WEBKIT_VERSION_3_0 AVAILABLE_WEBKIT_VERSION_1_0_AND_LATER +#endif + +/* + * AVAILABLE_WEBKIT_VERSION_1_1_AND_LATER_BUT_DEPRECATED_IN_WEBKIT_VERSION_3_0 + * + * Used on declarations introduced in WebKit 1.1, + * but later deprecated in WebKit 3.0 + */ +#if WEBKIT_VERSION_MIN_REQUIRED >= WEBKIT_VERSION_3_0 + #define AVAILABLE_WEBKIT_VERSION_1_1_AND_LATER_BUT_DEPRECATED_IN_WEBKIT_VERSION_3_0 DEPRECATED_ATTRIBUTE +#else + #define AVAILABLE_WEBKIT_VERSION_1_1_AND_LATER_BUT_DEPRECATED_IN_WEBKIT_VERSION_3_0 AVAILABLE_WEBKIT_VERSION_1_1_AND_LATER +#endif + +/* + * AVAILABLE_WEBKIT_VERSION_1_2_AND_LATER_BUT_DEPRECATED_IN_WEBKIT_VERSION_3_0 + * + * Used on declarations introduced in WebKit 1.2, + * but later deprecated in WebKit 3.0 + */ +#if WEBKIT_VERSION_MIN_REQUIRED >= WEBKIT_VERSION_3_0 + #define AVAILABLE_WEBKIT_VERSION_1_2_AND_LATER_BUT_DEPRECATED_IN_WEBKIT_VERSION_3_0 DEPRECATED_ATTRIBUTE +#else + #define AVAILABLE_WEBKIT_VERSION_1_2_AND_LATER_BUT_DEPRECATED_IN_WEBKIT_VERSION_3_0 AVAILABLE_WEBKIT_VERSION_1_2_AND_LATER +#endif + +/* + * AVAILABLE_WEBKIT_VERSION_1_3_AND_LATER_BUT_DEPRECATED_IN_WEBKIT_VERSION_3_0 + * + * Used on declarations introduced in WebKit 1.3, + * but later deprecated in WebKit 3.0 + */ +#if WEBKIT_VERSION_MIN_REQUIRED >= WEBKIT_VERSION_3_0 + #define AVAILABLE_WEBKIT_VERSION_1_3_AND_LATER_BUT_DEPRECATED_IN_WEBKIT_VERSION_3_0 DEPRECATED_ATTRIBUTE +#else + #define AVAILABLE_WEBKIT_VERSION_1_3_AND_LATER_BUT_DEPRECATED_IN_WEBKIT_VERSION_3_0 AVAILABLE_WEBKIT_VERSION_1_3_AND_LATER +#endif + +/* + * AVAILABLE_WEBKIT_VERSION_2_0_AND_LATER_BUT_DEPRECATED_IN_WEBKIT_VERSION_3_0 + * + * Used on declarations introduced in WebKit 2.0, + * but later deprecated in WebKit 3.0 + */ +#if WEBKIT_VERSION_MIN_REQUIRED >= WEBKIT_VERSION_3_0 + #define AVAILABLE_WEBKIT_VERSION_2_0_AND_LATER_BUT_DEPRECATED_IN_WEBKIT_VERSION_3_0 DEPRECATED_ATTRIBUTE +#else + #define AVAILABLE_WEBKIT_VERSION_2_0_AND_LATER_BUT_DEPRECATED_IN_WEBKIT_VERSION_3_0 AVAILABLE_WEBKIT_VERSION_2_0_AND_LATER +#endif + +/* + * DEPRECATED_IN_WEBKIT_VERSION_3_0_AND_LATER + * + * Used on types deprecated in WebKit 3.0 + */ +#if WEBKIT_VERSION_MIN_REQUIRED >= WEBKIT_VERSION_3_0 + #define DEPRECATED_IN_WEBKIT_VERSION_3_0_AND_LATER DEPRECATED_ATTRIBUTE +#else + #define DEPRECATED_IN_WEBKIT_VERSION_3_0_AND_LATER +#endif + + + + + + +/* + * AVAILABLE_WEBKIT_VERSION_3_1_AND_LATER + * + * Used on declarations introduced in WebKit 3.1 + */ +#if WEBKIT_VERSION_MAX_ALLOWED < WEBKIT_VERSION_3_1 + #define AVAILABLE_WEBKIT_VERSION_3_1_AND_LATER UNAVAILABLE_ATTRIBUTE +#elif WEBKIT_VERSION_MIN_REQUIRED < WEBKIT_VERSION_3_1 + #define AVAILABLE_WEBKIT_VERSION_3_1_AND_LATER WEAK_IMPORT_ATTRIBUTE +#else + #define AVAILABLE_WEBKIT_VERSION_3_1_AND_LATER +#endif + +/* + * AVAILABLE_WEBKIT_VERSION_3_1_AND_LATER_BUT_DEPRECATED + * + * Used on declarations introduced in WebKit 3.1, + * and deprecated in WebKit 3.1 + */ +#if WEBKIT_VERSION_MIN_REQUIRED >= WEBKIT_VERSION_3_1 + #define AVAILABLE_WEBKIT_VERSION_3_1_AND_LATER_BUT_DEPRECATED DEPRECATED_ATTRIBUTE +#else + #define AVAILABLE_WEBKIT_VERSION_3_1_AND_LATER_BUT_DEPRECATED AVAILABLE_WEBKIT_VERSION_3_1_AND_LATER +#endif + +/* + * AVAILABLE_WEBKIT_VERSION_1_0_AND_LATER_BUT_DEPRECATED_IN_WEBKIT_VERSION_3_1 + * + * Used on declarations introduced in WebKit 1.0, + * but later deprecated in WebKit 3.1 + */ +#if WEBKIT_VERSION_MIN_REQUIRED >= WEBKIT_VERSION_3_1 + #define AVAILABLE_WEBKIT_VERSION_1_0_AND_LATER_BUT_DEPRECATED_IN_WEBKIT_VERSION_3_1 DEPRECATED_ATTRIBUTE +#else + #define AVAILABLE_WEBKIT_VERSION_1_0_AND_LATER_BUT_DEPRECATED_IN_WEBKIT_VERSION_3_1 AVAILABLE_WEBKIT_VERSION_1_0_AND_LATER +#endif + +/* + * AVAILABLE_WEBKIT_VERSION_1_1_AND_LATER_BUT_DEPRECATED_IN_WEBKIT_VERSION_3_1 + * + * Used on declarations introduced in WebKit 1.1, + * but later deprecated in WebKit 3.1 + */ +#if WEBKIT_VERSION_MIN_REQUIRED >= WEBKIT_VERSION_3_1 + #define AVAILABLE_WEBKIT_VERSION_1_1_AND_LATER_BUT_DEPRECATED_IN_WEBKIT_VERSION_3_1 DEPRECATED_ATTRIBUTE +#else + #define AVAILABLE_WEBKIT_VERSION_1_1_AND_LATER_BUT_DEPRECATED_IN_WEBKIT_VERSION_3_1 AVAILABLE_WEBKIT_VERSION_1_1_AND_LATER +#endif + +/* + * AVAILABLE_WEBKIT_VERSION_1_2_AND_LATER_BUT_DEPRECATED_IN_WEBKIT_VERSION_3_1 + * + * Used on declarations introduced in WebKit 1.2, + * but later deprecated in WebKit 3.1 + */ +#if WEBKIT_VERSION_MIN_REQUIRED >= WEBKIT_VERSION_3_1 + #define AVAILABLE_WEBKIT_VERSION_1_2_AND_LATER_BUT_DEPRECATED_IN_WEBKIT_VERSION_3_1 DEPRECATED_ATTRIBUTE +#else + #define AVAILABLE_WEBKIT_VERSION_1_2_AND_LATER_BUT_DEPRECATED_IN_WEBKIT_VERSION_3_1 AVAILABLE_WEBKIT_VERSION_1_2_AND_LATER +#endif + +/* + * AVAILABLE_WEBKIT_VERSION_1_3_AND_LATER_BUT_DEPRECATED_IN_WEBKIT_VERSION_3_1 + * + * Used on declarations introduced in WebKit 1.3, + * but later deprecated in WebKit 3.1 + */ +#if WEBKIT_VERSION_MIN_REQUIRED >= WEBKIT_VERSION_3_1 + #define AVAILABLE_WEBKIT_VERSION_1_3_AND_LATER_BUT_DEPRECATED_IN_WEBKIT_VERSION_3_1 DEPRECATED_ATTRIBUTE +#else + #define AVAILABLE_WEBKIT_VERSION_1_3_AND_LATER_BUT_DEPRECATED_IN_WEBKIT_VERSION_3_1 AVAILABLE_WEBKIT_VERSION_1_3_AND_LATER +#endif + +/* + * AVAILABLE_WEBKIT_VERSION_2_0_AND_LATER_BUT_DEPRECATED_IN_WEBKIT_VERSION_3_1 + * + * Used on declarations introduced in WebKit 2.0, + * but later deprecated in WebKit 3.1 + */ +#if WEBKIT_VERSION_MIN_REQUIRED >= WEBKIT_VERSION_3_1 + #define AVAILABLE_WEBKIT_VERSION_2_0_AND_LATER_BUT_DEPRECATED_IN_WEBKIT_VERSION_3_1 DEPRECATED_ATTRIBUTE +#else + #define AVAILABLE_WEBKIT_VERSION_2_0_AND_LATER_BUT_DEPRECATED_IN_WEBKIT_VERSION_3_1 AVAILABLE_WEBKIT_VERSION_2_0_AND_LATER +#endif + +/* + * AVAILABLE_WEBKIT_VERSION_3_0_AND_LATER_BUT_DEPRECATED_IN_WEBKIT_VERSION_3_1 + * + * Used on declarations introduced in WebKit 3.0, + * but later deprecated in WebKit 3.1 + */ +#if WEBKIT_VERSION_MIN_REQUIRED >= WEBKIT_VERSION_3_1 + #define AVAILABLE_WEBKIT_VERSION_3_0_AND_LATER_BUT_DEPRECATED_IN_WEBKIT_VERSION_3_1 DEPRECATED_ATTRIBUTE +#else + #define AVAILABLE_WEBKIT_VERSION_3_0_AND_LATER_BUT_DEPRECATED_IN_WEBKIT_VERSION_3_1 AVAILABLE_WEBKIT_VERSION_3_0_AND_LATER +#endif + +/* + * DEPRECATED_IN_WEBKIT_VERSION_3_1_AND_LATER + * + * Used on types deprecated in WebKit 3.1 + */ +#if WEBKIT_VERSION_MIN_REQUIRED >= WEBKIT_VERSION_3_1 + #define DEPRECATED_IN_WEBKIT_VERSION_3_1_AND_LATER DEPRECATED_ATTRIBUTE +#else + #define DEPRECATED_IN_WEBKIT_VERSION_3_1_AND_LATER +#endif + + + + + + +/* + * AVAILABLE_IN_WEBKIT_VERSION_4_0 + * + * Used on declarations introduced in WebKit 4.0 + */ +#if WEBKIT_VERSION_MAX_ALLOWED < WEBKIT_VERSION_4_0 + #define AVAILABLE_IN_WEBKIT_VERSION_4_0 UNAVAILABLE_ATTRIBUTE +#elif WEBKIT_VERSION_MIN_REQUIRED < WEBKIT_VERSION_4_0 + #define AVAILABLE_IN_WEBKIT_VERSION_4_0 WEAK_IMPORT_ATTRIBUTE +#else + #define AVAILABLE_IN_WEBKIT_VERSION_4_0 +#endif + +/* + * AVAILABLE_IN_WEBKIT_VERSION_4_0_BUT_DEPRECATED + * + * Used on declarations introduced in WebKit 4.0, + * and deprecated in WebKit 4.0 + */ +#if WEBKIT_VERSION_MIN_REQUIRED >= WEBKIT_VERSION_4_0 + #define AVAILABLE_IN_WEBKIT_VERSION_4_0_BUT_DEPRECATED DEPRECATED_ATTRIBUTE +#else + #define AVAILABLE_IN_WEBKIT_VERSION_4_0_BUT_DEPRECATED AVAILABLE_IN_WEBKIT_VERSION_4_0 +#endif + +/* + * AVAILABLE_WEBKIT_VERSION_1_0_AND_LATER_BUT_DEPRECATED_IN_WEBKIT_VERSION_4_0 + * + * Used on declarations introduced in WebKit 1.0, + * but later deprecated in WebKit 4.0 + */ +#if WEBKIT_VERSION_MIN_REQUIRED >= WEBKIT_VERSION_4_0 + #define AVAILABLE_WEBKIT_VERSION_1_0_AND_LATER_BUT_DEPRECATED_IN_WEBKIT_VERSION_4_0 DEPRECATED_ATTRIBUTE +#else + #define AVAILABLE_WEBKIT_VERSION_1_0_AND_LATER_BUT_DEPRECATED_IN_WEBKIT_VERSION_4_0 AVAILABLE_WEBKIT_VERSION_1_0_AND_LATER +#endif + +/* + * AVAILABLE_WEBKIT_VERSION_1_1_AND_LATER_BUT_DEPRECATED_IN_WEBKIT_VERSION_4_0 + * + * Used on declarations introduced in WebKit 1.1, + * but later deprecated in WebKit 4.0 + */ +#if WEBKIT_VERSION_MIN_REQUIRED >= WEBKIT_VERSION_4_0 + #define AVAILABLE_WEBKIT_VERSION_1_1_AND_LATER_BUT_DEPRECATED_IN_WEBKIT_VERSION_4_0 DEPRECATED_ATTRIBUTE +#else + #define AVAILABLE_WEBKIT_VERSION_1_1_AND_LATER_BUT_DEPRECATED_IN_WEBKIT_VERSION_4_0 AVAILABLE_WEBKIT_VERSION_1_1_AND_LATER +#endif + +/* + * AVAILABLE_WEBKIT_VERSION_1_2_AND_LATER_BUT_DEPRECATED_IN_WEBKIT_VERSION_4_0 + * + * Used on declarations introduced in WebKit 1.2, + * but later deprecated in WebKit 4.0 + */ +#if WEBKIT_VERSION_MIN_REQUIRED >= WEBKIT_VERSION_4_0 + #define AVAILABLE_WEBKIT_VERSION_1_2_AND_LATER_BUT_DEPRECATED_IN_WEBKIT_VERSION_4_0 DEPRECATED_ATTRIBUTE +#else + #define AVAILABLE_WEBKIT_VERSION_1_2_AND_LATER_BUT_DEPRECATED_IN_WEBKIT_VERSION_4_0 AVAILABLE_WEBKIT_VERSION_1_2_AND_LATER +#endif + +/* + * AVAILABLE_WEBKIT_VERSION_1_3_AND_LATER_BUT_DEPRECATED_IN_WEBKIT_VERSION_4_0 + * + * Used on declarations introduced in WebKit 1.3, + * but later deprecated in WebKit 4.0 + */ +#if WEBKIT_VERSION_MIN_REQUIRED >= WEBKIT_VERSION_4_0 + #define AVAILABLE_WEBKIT_VERSION_1_3_AND_LATER_BUT_DEPRECATED_IN_WEBKIT_VERSION_4_0 DEPRECATED_ATTRIBUTE +#else + #define AVAILABLE_WEBKIT_VERSION_1_3_AND_LATER_BUT_DEPRECATED_IN_WEBKIT_VERSION_4_0 AVAILABLE_WEBKIT_VERSION_1_3_AND_LATER +#endif + +/* + * AVAILABLE_WEBKIT_VERSION_2_0_AND_LATER_BUT_DEPRECATED_IN_WEBKIT_VERSION_4_0 + * + * Used on declarations introduced in WebKit 2.0, + * but later deprecated in WebKit 4.0 + */ +#if WEBKIT_VERSION_MIN_REQUIRED >= WEBKIT_VERSION_4_0 + #define AVAILABLE_WEBKIT_VERSION_2_0_AND_LATER_BUT_DEPRECATED_IN_WEBKIT_VERSION_4_0 DEPRECATED_ATTRIBUTE +#else + #define AVAILABLE_WEBKIT_VERSION_2_0_AND_LATER_BUT_DEPRECATED_IN_WEBKIT_VERSION_4_0 AVAILABLE_WEBKIT_VERSION_2_0_AND_LATER +#endif + +/* + * AVAILABLE_WEBKIT_VERSION_3_0_AND_LATER_BUT_DEPRECATED_IN_WEBKIT_VERSION_4_0 + * + * Used on declarations introduced in WebKit 3.0, + * but later deprecated in WebKit 4.0 + */ +#if WEBKIT_VERSION_MIN_REQUIRED >= WEBKIT_VERSION_4_0 + #define AVAILABLE_WEBKIT_VERSION_3_0_AND_LATER_BUT_DEPRECATED_IN_WEBKIT_VERSION_4_0 DEPRECATED_ATTRIBUTE +#else + #define AVAILABLE_WEBKIT_VERSION_3_0_AND_LATER_BUT_DEPRECATED_IN_WEBKIT_VERSION_4_0 AVAILABLE_WEBKIT_VERSION_3_0_AND_LATER +#endif + +/* + * AVAILABLE_WEBKIT_VERSION_3_1_AND_LATER_BUT_DEPRECATED_IN_WEBKIT_VERSION_4_0 + * + * Used on declarations introduced in WebKit 3.1, + * but later deprecated in WebKit 4.0 + */ +#if WEBKIT_VERSION_MIN_REQUIRED >= WEBKIT_VERSION_4_0 + #define AVAILABLE_WEBKIT_VERSION_3_1_AND_LATER_BUT_DEPRECATED_IN_WEBKIT_VERSION_4_0 DEPRECATED_ATTRIBUTE +#else + #define AVAILABLE_WEBKIT_VERSION_3_1_AND_LATER_BUT_DEPRECATED_IN_WEBKIT_VERSION_4_0 AVAILABLE_WEBKIT_VERSION_3_1_AND_LATER +#endif + +/* + * DEPRECATED_IN_WEBKIT_VERSION_4_0 + * + * Used on types deprecated in WebKit 4.0 + */ +#if WEBKIT_VERSION_MIN_REQUIRED >= WEBKIT_VERSION_4_0 + #define DEPRECATED_IN_WEBKIT_VERSION_4_0 DEPRECATED_ATTRIBUTE +#else + #define DEPRECATED_IN_WEBKIT_VERSION_4_0 +#endif + + + + + + +/* + * AVAILABLE_AFTER_WEBKIT_VERSION_4_0 + * + * Used on declarations introduced after WebKit 4.0 + */ +#if WEBKIT_VERSION_MAX_ALLOWED < WEBKIT_VERSION_LATEST + #define AVAILABLE_AFTER_WEBKIT_VERSION_4_0 UNAVAILABLE_ATTRIBUTE +#elif WEBKIT_VERSION_MIN_REQUIRED < WEBKIT_VERSION_LATEST + #define AVAILABLE_AFTER_WEBKIT_VERSION_4_0 WEAK_IMPORT_ATTRIBUTE +#else + #define AVAILABLE_AFTER_WEBKIT_VERSION_4_0 +#endif + +/* + * AVAILABLE_AFTER_WEBKIT_VERSION_4_0_BUT_DEPRECATED + * + * Used on declarations introduced after WebKit 4.0, + * and deprecated after WebKit 4.0 + */ +#if WEBKIT_VERSION_MIN_REQUIRED >= WEBKIT_VERSION_LATEST + #define AVAILABLE_AFTER_WEBKIT_VERSION_4_0_BUT_DEPRECATED DEPRECATED_ATTRIBUTE +#else + #define AVAILABLE_AFTER_WEBKIT_VERSION_4_0_BUT_DEPRECATED AVAILABLE_AFTER_WEBKIT_VERSION_4_0 +#endif + +/* + * AVAILABLE_WEBKIT_VERSION_1_0_AND_LATER_BUT_DEPRECATED_AFTER_WEBKIT_VERSION_4_0 + * + * Used on declarations introduced in WebKit 1.0, + * but later deprecated after WebKit 4.0 + */ +#if WEBKIT_VERSION_MIN_REQUIRED >= WEBKIT_VERSION_LATEST + #define AVAILABLE_WEBKIT_VERSION_1_0_AND_LATER_BUT_DEPRECATED_AFTER_WEBKIT_VERSION_4_0 DEPRECATED_ATTRIBUTE +#else + #define AVAILABLE_WEBKIT_VERSION_1_0_AND_LATER_BUT_DEPRECATED_AFTER_WEBKIT_VERSION_4_0 AVAILABLE_WEBKIT_VERSION_1_0_AND_LATER +#endif + +/* + * AVAILABLE_WEBKIT_VERSION_1_1_AND_LATER_BUT_DEPRECATED_AFTER_WEBKIT_VERSION_4_0 + * + * Used on declarations introduced in WebKit 1.1, + * but later deprecated after WebKit 4.0 + */ +#if WEBKIT_VERSION_MIN_REQUIRED >= WEBKIT_VERSION_LATEST + #define AVAILABLE_WEBKIT_VERSION_1_1_AND_LATER_BUT_DEPRECATED_AFTER_WEBKIT_VERSION_4_0 DEPRECATED_ATTRIBUTE +#else + #define AVAILABLE_WEBKIT_VERSION_1_1_AND_LATER_BUT_DEPRECATED_AFTER_WEBKIT_VERSION_4_0 AVAILABLE_WEBKIT_VERSION_1_1_AND_LATER +#endif + +/* + * AVAILABLE_WEBKIT_VERSION_1_2_AND_LATER_BUT_DEPRECATED_AFTER_WEBKIT_VERSION_4_0 + * + * Used on declarations introduced in WebKit 1.2, + * but later deprecated after WebKit 4.0 + */ +#if WEBKIT_VERSION_MIN_REQUIRED >= WEBKIT_VERSION_LATEST + #define AVAILABLE_WEBKIT_VERSION_1_2_AND_LATER_BUT_DEPRECATED_AFTER_WEBKIT_VERSION_4_0 DEPRECATED_ATTRIBUTE +#else + #define AVAILABLE_WEBKIT_VERSION_1_2_AND_LATER_BUT_DEPRECATED_AFTER_WEBKIT_VERSION_4_0 AVAILABLE_WEBKIT_VERSION_1_2_AND_LATER +#endif + +/* + * AVAILABLE_WEBKIT_VERSION_1_3_AND_LATER_BUT_DEPRECATED_AFTER_WEBKIT_VERSION_4_0 + * + * Used on declarations introduced in WebKit 1.3, + * but later deprecated after WebKit 4.0 + */ +#if WEBKIT_VERSION_MIN_REQUIRED >= WEBKIT_VERSION_LATEST + #define AVAILABLE_WEBKIT_VERSION_1_3_AND_LATER_BUT_DEPRECATED_AFTER_WEBKIT_VERSION_4_0 DEPRECATED_ATTRIBUTE +#else + #define AVAILABLE_WEBKIT_VERSION_1_3_AND_LATER_BUT_DEPRECATED_AFTER_WEBKIT_VERSION_4_0 AVAILABLE_WEBKIT_VERSION_1_3_AND_LATER +#endif + +/* + * AVAILABLE_WEBKIT_VERSION_2_0_AND_LATER_BUT_DEPRECATED_AFTER_WEBKIT_VERSION_4_0 + * + * Used on declarations introduced in WebKit 2.0, + * but later deprecated after WebKit 4.0 + */ +#if WEBKIT_VERSION_MIN_REQUIRED >= WEBKIT_VERSION_LATEST + #define AVAILABLE_WEBKIT_VERSION_2_0_AND_LATER_BUT_DEPRECATED_AFTER_WEBKIT_VERSION_4_0 DEPRECATED_ATTRIBUTE +#else + #define AVAILABLE_WEBKIT_VERSION_2_0_AND_LATER_BUT_DEPRECATED_AFTER_WEBKIT_VERSION_4_0 AVAILABLE_WEBKIT_VERSION_2_0_AND_LATER +#endif + +/* + * AVAILABLE_WEBKIT_VERSION_3_0_AND_LATER_BUT_DEPRECATED_AFTER_WEBKIT_VERSION_4_0 + * + * Used on declarations introduced in WebKit 3.0, + * but later deprecated after WebKit 4.0 + */ +#if WEBKIT_VERSION_MIN_REQUIRED >= WEBKIT_VERSION_LATEST + #define AVAILABLE_WEBKIT_VERSION_3_0_AND_LATER_BUT_DEPRECATED_AFTER_WEBKIT_VERSION_4_0 DEPRECATED_ATTRIBUTE +#else + #define AVAILABLE_WEBKIT_VERSION_3_0_AND_LATER_BUT_DEPRECATED_AFTER_WEBKIT_VERSION_4_0 AVAILABLE_WEBKIT_VERSION_3_0_AND_LATER +#endif + +/* + * AVAILABLE_WEBKIT_VERSION_3_1_AND_LATER_BUT_DEPRECATED_AFTER_WEBKIT_VERSION_4_0 + * + * Used on declarations introduced in WebKit 3.1, + * but later deprecated after WebKit 4.0 + */ +#if WEBKIT_VERSION_MIN_REQUIRED >= WEBKIT_VERSION_LATEST + #define AVAILABLE_WEBKIT_VERSION_3_1_AND_LATER_BUT_DEPRECATED_AFTER_WEBKIT_VERSION_4_0 DEPRECATED_ATTRIBUTE +#else + #define AVAILABLE_WEBKIT_VERSION_3_1_AND_LATER_BUT_DEPRECATED_AFTER_WEBKIT_VERSION_4_0 AVAILABLE_WEBKIT_VERSION_3_1_AND_LATER +#endif + +/* + * AVAILABLE_WEBKIT_VERSION_4_0_AND_LATER_BUT_DEPRECATED_AFTER_WEBKIT_VERSION_4_0 + * + * Used on declarations introduced in WebKit 4.0 + * but later deprecated after WebKit 4.0 + */ +#if WEBKIT_VERSION_MIN_REQUIRED >= WEBKIT_VERSION_LATEST + #define AVAILABLE_WEBKIT_VERSION_4_0_AND_LATER_BUT_DEPRECATED_AFTER_WEBKIT_VERSION_4_0 DEPRECATED_ATTRIBUTE +#else + #define AVAILABLE_WEBKIT_VERSION_4_0_AND_LATER_BUT_DEPRECATED_AFTER_WEBKIT_VERSION_4_0 AVAILABLE_WEBKIT_VERSION_4_0_AND_LATER +#endif + +/* + * DEPRECATED_AFTER_WEBKIT_VERSION_4_0 + * + * Used on types deprecated after WebKit 4.0 + */ +#if WEBKIT_VERSION_MIN_REQUIRED >= WEBKIT_VERSION_LATEST + #define DEPRECATED_AFTER_WEBKIT_VERSION_4_0 DEPRECATED_ATTRIBUTE +#else + #define DEPRECATED_AFTER_WEBKIT_VERSION_4_0 +#endif + + + + + + +/* + * AVAILABLE_AFTER_WEBKIT_VERSION_5_1 + * + * Used on functions introduced after WebKit 5.1 + */ +#define AVAILABLE_AFTER_WEBKIT_VERSION_5_1 + +/* AVAILABLE_WEBKIT_VERSION_1_3_AND_LATER_BUT_DEPRECATED_AFTER_WEBKIT_VERSION_5_1 + * + * Used on declarations introduced in WebKit 1.3, + * but later deprecated after WebKit 5.1 + */ +#define AVAILABLE_WEBKIT_VERSION_1_3_AND_LATER_BUT_DEPRECATED_AFTER_WEBKIT_VERSION_5_1 + + #endif /* __WebKitAvailability__ */ diff --git a/JavaScriptCore/API/tests/testapi.mm b/JavaScriptCore/API/tests/testapi.mm index 5c844840..f22194c6 100644 --- a/JavaScriptCore/API/tests/testapi.mm +++ b/JavaScriptCore/API/tests/testapi.mm @@ -37,12 +37,6 @@ #if JSC_OBJC_API_ENABLED -@interface UnexportedObject : NSObject -@end - -@implementation UnexportedObject -@end - @protocol ParentObject @end @@ -1222,16 +1216,6 @@ void testObjectiveCAPI() checkResult(@"fetched context.name was expected", ![fetchedName1 isEqualToString:fetchedName2]); } - @autoreleasepool { - JSContext *context = [[JSContext alloc] init]; - context[@"UnexportedObject"] = [UnexportedObject class]; - context[@"makeObject"] = ^{ - return [[UnexportedObject alloc] init]; - }; - JSValue *result = [context evaluateScript:@"(makeObject() instanceof UnexportedObject)"]; - checkResult(@"makeObject() instanceof UnexportedObject", [result isBoolean] && [result toBool]); - } - currentThisInsideBlockGetterTest(); } diff --git a/JavaScriptCore/CMakeLists.txt b/JavaScriptCore/CMakeLists.txt index c56865b4..36b7118e 100644 --- a/JavaScriptCore/CMakeLists.txt +++ b/JavaScriptCore/CMakeLists.txt @@ -13,11 +13,9 @@ set(JavaScriptCore_INCLUDE_DIRECTORIES "${JAVASCRIPTCORE_DIR}/heap" "${JAVASCRIPTCORE_DIR}/debugger" "${JAVASCRIPTCORE_DIR}/inspector" - "${JAVASCRIPTCORE_DIR}/inspector/agents" "${JAVASCRIPTCORE_DIR}/interpreter" "${JAVASCRIPTCORE_DIR}/jit" "${JAVASCRIPTCORE_DIR}/llint" - "${JAVASCRIPTCORE_DIR}/llvm" "${JAVASCRIPTCORE_DIR}/parser" "${JAVASCRIPTCORE_DIR}/profiler" "${JAVASCRIPTCORE_DIR}/runtime" @@ -97,7 +95,6 @@ set(JavaScriptCore_SOURCES dfg/DFGAbstractHeap.cpp dfg/DFGAbstractValue.cpp dfg/DFGArgumentsSimplificationPhase.cpp - dfg/DFGArithMode.cpp dfg/DFGArrayMode.cpp dfg/DFGAtTailAbstractState.cpp dfg/DFGAvailability.cpp @@ -229,14 +226,6 @@ set(JavaScriptCore_SOURCES inspector/InspectorAgentRegistry.cpp inspector/InspectorBackendDispatcher.cpp inspector/InspectorValues.cpp - inspector/InjectedScript.cpp - inspector/InjectedScriptBase.cpp - inspector/InjectedScriptHost.cpp - inspector/InjectedScriptManager.cpp - inspector/InjectedScriptModule.cpp - inspector/JSInjectedScriptHost.cpp - inspector/JSInjectedScriptHostPrototype.cpp - inspector/agents/InspectorAgent.cpp interpreter/AbstractPC.cpp interpreter/CallFrame.cpp @@ -500,36 +489,6 @@ if (WTF_USE_ICU_UNICODE) ) endif () -if (WTF_USE_UDIS86) - set(UDIS_GEN_DEP - disassembler/udis86/ud_opcode.py - disassembler/udis86/ud_optable.py - ) - - add_custom_command( - OUTPUT ${DERIVED_SOURCES_JAVASCRIPTCORE_DIR}/udis86_itab.c ${DERIVED_SOURCES_JAVASCRIPTCORE_DIR}/udis86_itab.h - DEPENDS ${UDIS_GEN_DEP} - WORKING_DIRECTORY ${DERIVED_SOURCES_JAVASCRIPTCORE_DIR} - COMMAND ${PYTHON_EXECUTABLE} ${JAVASCRIPTCORE_DIR}/disassembler/udis86/itab.py ${JAVASCRIPTCORE_DIR}/disassembler/udis86/optable.xml - VERBATIM) - - list(APPEND JavaScriptCore_INCLUDE_DIRECTORIES - ${JAVASCRIPTCORE_DIR}/disassembler/udis86 - ) - list(APPEND JavaScriptCore_HEADERS - ${DERIVED_SOURCES_JAVASCRIPTCORE_DIR}/udis86_itab.h - ) - list(APPEND JavaScriptCore_SOURCES - disassembler/udis86/udis86.c - disassembler/udis86/udis86_decode.c - disassembler/udis86/udis86_input.c - disassembler/udis86/udis86_itab_holder.c - disassembler/udis86/udis86_syn-att.c - disassembler/udis86/udis86_syn-intel.c - disassembler/udis86/udis86_syn.c - ) -endif () - if (ENABLE_LLINT) # We cannot check for RUBY_FOUND because it is set only when the full package is installed and # the only thing we need is the interpreter. Unlike Python, cmake does not provide a macro @@ -616,81 +575,6 @@ if (ENABLE_LLINT) ) endif () -if (ENABLE_FTL_JIT) - if (NOT LLVM_STATIC_LIBRARIES) - message(FATAL_ERROR "No LLVM libs found, but FTL is enabled. Stopping build.") - endif () - - # Configure llvmForJSC.so - set(llvmForJSC_SOURCES - llvm/library/LLVMAnchor.cpp - llvm/library/LLVMExports.cpp - llvm/library/LLVMOverrides.cpp - ) - set(llvmForJSC_INCLUDE_DIRECTORIES - ${LLVM_INCLUDE_DIRS} - "${DERIVED_SOURCES_JAVASCRIPTCORE_DIR}" - ) - - add_custom_command( - OUTPUT ${DERIVED_SOURCES_JAVASCRIPTCORE_DIR}/WebKitLLVMLibraryToken.h - DEPENDS ${LLVM_STATIC_LIBRARIES} - COMMAND ${CMAKE_COMMAND} -E touch ${DERIVED_SOURCES_JAVASCRIPTCORE_DIR}/WebKitLLVMLibraryToken.h - VERBATIM) - - WEBKIT_WRAP_SOURCELIST(${llvmForJSC_SOURCES}) - add_library(llvmForJSC SHARED ${llvmForJSC_SOURCES} ${DERIVED_SOURCES_JAVASCRIPTCORE_DIR}/WebKitLLVMLibraryToken.h) - target_link_libraries(llvmForJSC ${LLVM_STATIC_LIBRARIES} "pthread" "dl") - - # Added extra items for JavaScriptCore - list(APPEND JavaScriptCore_INCLUDE_DIRECTORIES - ${LLVM_INCLUDE_DIRS} - ) - - list(APPEND JavaScriptCore_SOURCES - llvm/InitializeLLVM.cpp - llvm/InitializeLLVMPOSIX.cpp - llvm/InitializeLLVMLinux.cpp - llvm/LLVMAPI.cpp - - dfg/DFGToFTLDeferredCompilationCallback.cpp - dfg/DFGToFTLForOSREntryDeferredCompilationCallback.cpp - - disassembler/LLVMDisassembler.cpp - disassembler/X86Disassembler.cpp - - ftl/FTLAbstractHeap.cpp - ftl/FTLAbstractHeapRepository.cpp - ftl/FTLCapabilities.cpp - ftl/FTLCommonValues.cpp - ftl/FTLCompile.cpp - ftl/FTLExitArgument.cpp - ftl/FTLExitArgumentForOperand.cpp - ftl/FTLExitThunkGenerator.cpp - ftl/FTLExitValue.cpp - ftl/FTLFail.cpp - ftl/FTLForOSREntryJITCode.cpp - ftl/FTLInlineCacheSize.cpp - ftl/FTLIntrinsicRepository.cpp - ftl/FTLJITCode.cpp - ftl/FTLJITFinalizer.cpp - ftl/FTLLink.cpp - ftl/FTLLocation.cpp - ftl/FTLLowerDFGToLLVM.cpp - ftl/FTLOSREntry.cpp - ftl/FTLOSRExit.cpp - ftl/FTLOSRExitCompiler.cpp - ftl/FTLOutput.cpp - ftl/FTLSaveRestore.cpp - ftl/FTLSlowPathCall.cpp - ftl/FTLSlowPathCallKey.cpp - ftl/FTLStackMaps.cpp - ftl/FTLState.cpp - ftl/FTLThunks.cpp - ftl/FTLValueFormat.cpp - ) -endif () - set(HASH_LUT_GENERATOR ${CMAKE_CURRENT_SOURCE_DIR}/create_hash_table) macro(GENERATE_HASH_LUT _input _output) add_custom_command( @@ -711,10 +595,10 @@ set(JavaScriptCore_FORWARDING_HEADERS_DIRECTORIES assembler bindings bytecode + collector/handles debugger heap inspector - inspector/agents interpreter jit llint @@ -722,8 +606,6 @@ set(JavaScriptCore_FORWARDING_HEADERS_DIRECTORIES profiler runtime yarr - - collector/handles ) set(JavaScriptCore_FORWARDING_HEADERS_FILES @@ -815,16 +697,6 @@ list(APPEND JavaScriptCore_HEADERS ${DERIVED_SOURCES_JAVASCRIPTCORE_DIR}/InspectorJSTypeBuilders.h ) -add_custom_command( - OUTPUT ${DERIVED_SOURCES_JAVASCRIPTCORE_DIR}/InjectedScriptSource.h ${DERIVED_SOURCES_JAVASCRIPTCORE_DIR}/InjectedScriptSource.min.js - MAIN_DEPENDENCY ${JAVASCRIPTCORE_DIR}/inspector/InjectedScriptSource.js - DEPENDS ${JavaScriptCore_INSPECTOR_SCRIPTS_DIR}/xxd.pl ${JavaScriptCore_INSPECTOR_SCRIPTS_DIR}/jsmin.py - COMMAND ${PYTHON_EXECUTABLE} ${JavaScriptCore_INSPECTOR_SCRIPTS_DIR}/jsmin.py < ${JAVASCRIPTCORE_DIR}/inspector/InjectedScriptSource.js > ${DERIVED_SOURCES_JAVASCRIPTCORE_DIR}/InjectedScriptSource.min.js - COMMAND ${PERL_EXECUTABLE} ${JavaScriptCore_INSPECTOR_SCRIPTS_DIR}/xxd.pl InjectedScriptSource_js ${DERIVED_SOURCES_JAVASCRIPTCORE_DIR}/InjectedScriptSource.min.js ${DERIVED_SOURCES_JAVASCRIPTCORE_DIR}/InjectedScriptSource.h - VERBATIM) - -list(APPEND JavaScriptCore_HEADERS ${DERIVED_SOURCES_JAVASCRIPTCORE_DIR}/InjectedScriptSource.h) - if (WTF_CPU_ARM) list(APPEND JavaScriptCore_SOURCES @@ -898,7 +770,3 @@ if (${JavaScriptCore_LIBRARY_TYPE} STREQUAL "SHARED") set_target_properties(JavaScriptCore PROPERTIES VERSION ${JAVASCRIPTCORE_VERSION} SOVERSION ${JAVASCRIPTCORE_VERSION_MAJOR}) install(TARGETS JavaScriptCore DESTINATION "${LIB_INSTALL_DIR}") endif () - -if (ENABLE_FTL_JIT) - add_dependencies(JavaScriptCore llvmForJSC) -endif () diff --git a/JavaScriptCore/ChangeLog b/JavaScriptCore/ChangeLog index 3323cadd..625a49b4 100644 --- a/JavaScriptCore/ChangeLog +++ b/JavaScriptCore/ChangeLog @@ -1,1432 +1,18 @@ -2014-01-10 Mark Hahnenberg +2014-01-14 Lucas Forschler - Copying should be generational - https://bugs.webkit.org/show_bug.cgi?id=126555 + Merge r161574 - Reviewed by Geoffrey Garen. - - This patch adds support for copying to our generational collector. Eden collections - always trigger copying. Full collections use our normal fragmentation-based heuristics. - - The way this works is that the CopiedSpace now has the notion of an old generation set of CopiedBlocks - and a new generation of CopiedBlocks. During each mutator cycle new CopiedSpace allocations reside - in the new generation. When a collection occurs, those blocks are moved to the old generation. - - One key thing to remember is that both new and old generation objects in the MarkedSpace can - refer to old or new generation allocations in CopiedSpace. This is why we must fire write barriers - when assigning to an old (MarkedSpace) object's Butterfly. - - * heap/CopiedAllocator.h: - (JSC::CopiedAllocator::tryAllocateDuringCopying): - * heap/CopiedBlock.h: - (JSC::CopiedBlock::CopiedBlock): - (JSC::CopiedBlock::didEvacuateBytes): - (JSC::CopiedBlock::isOld): - (JSC::CopiedBlock::didPromote): - * heap/CopiedBlockInlines.h: - (JSC::CopiedBlock::reportLiveBytes): - (JSC::CopiedBlock::reportLiveBytesDuringCopying): - * heap/CopiedSpace.cpp: - (JSC::CopiedSpace::CopiedSpace): - (JSC::CopiedSpace::~CopiedSpace): - (JSC::CopiedSpace::init): - (JSC::CopiedSpace::tryAllocateOversize): - (JSC::CopiedSpace::tryReallocateOversize): - (JSC::CopiedSpace::doneFillingBlock): - (JSC::CopiedSpace::didStartFullCollection): - (JSC::CopiedSpace::doneCopying): - (JSC::CopiedSpace::size): - (JSC::CopiedSpace::capacity): - (JSC::CopiedSpace::isPagedOut): - * heap/CopiedSpace.h: - (JSC::CopiedSpace::CopiedGeneration::CopiedGeneration): - * heap/CopiedSpaceInlines.h: - (JSC::CopiedSpace::contains): - (JSC::CopiedSpace::recycleEvacuatedBlock): - (JSC::CopiedSpace::allocateBlock): - (JSC::CopiedSpace::startedCopying): - * heap/CopyVisitor.cpp: - (JSC::CopyVisitor::copyFromShared): - * heap/CopyVisitorInlines.h: - (JSC::CopyVisitor::allocateNewSpace): - (JSC::CopyVisitor::allocateNewSpaceSlow): - * heap/GCThreadSharedData.cpp: - (JSC::GCThreadSharedData::didStartCopying): - * heap/Heap.cpp: - (JSC::Heap::copyBackingStores): - * heap/SlotVisitorInlines.h: - (JSC::SlotVisitor::copyLater): - * heap/TinyBloomFilter.h: - (JSC::TinyBloomFilter::add): - -2014-01-14 Mark Lam - - ASSERTION FAILED: !hasError() in JSC::Parser::createSavePoint(). - https://bugs.webkit.org/show_bug.cgi?id=126990. - - Reviewed by Geoffrey Garen. - - * parser/Parser.cpp: - (JSC::Parser::parseConstDeclarationList): - - We were missing an error check after attempting to parse an initializer - expression. This is now fixed. - -2014-01-14 Joseph Pecoraro - - Web Inspector: For Remote Inspection link WebProcess's to their parent UIProcess - https://bugs.webkit.org/show_bug.cgi?id=126995 - - Reviewed by Timothy Hatcher. - - * inspector/remote/RemoteInspector.mm: - (Inspector::RemoteInspector::listingForDebuggable): - For each WebView, list the parent process. Listing the parent per WebView - is already supported back when we supported processes that could host WebViews - for multiple applications. - - * inspector/remote/RemoteInspectorConstants.h: - Add a separate key for the bundle identifier, separate from application identifier. - - * inspector/remote/RemoteInspectorDebuggable.cpp: - (Inspector::RemoteInspectorDebuggable::info): - * inspector/remote/RemoteInspectorDebuggable.h: - (Inspector::RemoteInspectorDebuggableInfo::RemoteInspectorDebuggableInfo): - (Inspector::RemoteInspectorDebuggableInfo::hasParentProcess): - If a RemoteInspectorDebuggable has a non-zero parent process identifier - it is a proxy for the parent process. - -2014-01-14 Brian J. Burg - - Add ENABLE(WEB_REPLAY) feature flag to the build system - https://bugs.webkit.org/show_bug.cgi?id=126949 - - Reviewed by Joseph Pecoraro. - - * Configurations/FeatureDefines.xcconfig: - -2014-01-14 Peter Molnar - - [EFL] FTL buildfix, add missing includes - https://bugs.webkit.org/show_bug.cgi?id=126641 - - Reviewed by Csaba Osztrogonác. - - * ftl/FTLOSREntry.cpp: - * ftl/FTLOSRExitCompiler.cpp: - -2014-01-14 Joseph Pecoraro - - Web Inspector: RemoteInspector::updateDebuggable may miss a push - https://bugs.webkit.org/show_bug.cgi?id=126965 - - Reviewed by Timothy Hatcher. - - * inspector/remote/RemoteInspector.mm: - (Inspector::RemoteInspector::updateDebuggable): - Always push an update. If a debuggable went from allowed to - not allowed, we would have missed pushing an update. - -2014-01-13 Mark Hahnenberg - - Performance regression on dromaeo due to generational marking - https://bugs.webkit.org/show_bug.cgi?id=126901 - - Reviewed by Oliver Hunt. - - We were seeing some performance regression with ENABLE_GGC == 0, so this patch - ifdefs out more things to get rid of the additional overhead. - - * heap/Heap.cpp: - (JSC::Heap::markRoots): - (JSC::Heap::writeBarrier): - * heap/MarkedBlock.cpp: - (JSC::MarkedBlock::clearMarks): - (JSC::MarkedBlock::clearMarksWithCollectionType): - * heap/MarkedSpace.cpp: - (JSC::MarkedSpace::resetAllocators): - * heap/MarkedSpace.h: - (JSC::MarkedSpace::didAllocateInBlock): - * heap/SlotVisitorInlines.h: - (JSC::SlotVisitor::internalAppend): - (JSC::SlotVisitor::reportExtraMemoryUsage): - -2014-01-13 Brian Burg - - Web Inspector: protocol generator should support integer-typed declarations - https://bugs.webkit.org/show_bug.cgi?id=126828 - - Reviewed by Joseph Pecoraro. - - Add new binding classes for parameter/ad-hoc and normal integer type declarations. - - * inspector/scripts/CodeGeneratorInspector.py: - (TypeBindings.create_type_declaration_): - (TypeBindings.create_type_declaration_.PlainInteger): - (TypeBindings.create_type_declaration_.PlainInteger.resolve_inner): - (TypeBindings.create_type_declaration_.PlainInteger.request_user_runtime_cast): - (TypeBindings.create_type_declaration_.PlainInteger.request_internal_runtime_cast): - (TypeBindings.create_type_declaration_.PlainInteger.get_code_generator): - (TypeBindings.create_type_declaration_.PlainInteger.get_validator_call_text): - (TypeBindings.create_type_declaration_.PlainInteger.reduce_to_raw_type): - (TypeBindings.create_type_declaration_.PlainInteger.get_type_model): - (TypeBindings.create_type_declaration_.PlainInteger.get_setter_value_expression_pattern): - (TypeBindings.create_type_declaration_.PlainInteger.get_array_item_c_type_text): - (TypeBindings.create_type_declaration_.TypedefInteger): - (TypeBindings.create_type_declaration_.TypedefInteger.resolve_inner): - (TypeBindings.create_type_declaration_.TypedefInteger.request_user_runtime_cast): - (TypeBindings.create_type_declaration_.TypedefInteger.request_internal_runtime_cast): - (TypeBindings.create_type_declaration_.TypedefInteger.get_code_generator): - (TypeBindings.create_type_declaration_.TypedefInteger.get_code_generator.CodeGenerator): - (TypeBindings.create_type_declaration_.TypedefInteger.get_code_generator.CodeGenerator.generate_type_builder): - (TypeBindings.create_type_declaration_.TypedefInteger.get_code_generator.CodeGenerator.generate_type_builder.int): - (TypeBindings.create_type_declaration_.TypedefInteger.get_code_generator.CodeGenerator.register_use): - (TypeBindings.create_type_declaration_.TypedefInteger.get_code_generator.CodeGenerator.get_generate_pass_id): - (TypeBindings.create_type_declaration_.TypedefInteger.get_validator_call_text): - (TypeBindings.create_type_declaration_.TypedefInteger.reduce_to_raw_type): - (TypeBindings.create_type_declaration_.TypedefInteger.get_type_model): - (TypeBindings.create_type_declaration_.TypedefInteger.get_setter_value_expression_pattern): - (TypeBindings.create_type_declaration_.TypedefInteger.get_array_item_c_type_text): - -2014-01-13 Zalan Bujtas - - Enable SUBPIXEL_LAYOUT on Mac - - - Reviewed by Simon Fraser. - - * Configurations/FeatureDefines.xcconfig: - -2014-01-13 Zan Dobersek - - Unreviewed. Changes in r161686 are exposing a bug in GCC where the global .cfi_startproc directive - is not inserted early enough into the generated assembler code when building in debug mode, causing - compilation failures on ports using the GCC compilers. To work around the problem, only utilize the - OFFLINE_ASM_* macros that use .cfi_ directives when compiling with Clang. - - * llint/LowLevelInterpreter.cpp: - -2014-01-12 Commit Queue - - Unreviewed, rolling out r161840. - http://trac.webkit.org/changeset/161840 - https://bugs.webkit.org/show_bug.cgi?id=126870 - - Caused jsscore and layout test failures (Requested by smfr on - #webkit). - - * API/JSValueRef.cpp: - (JSValueMakeFromJSONString): - * bindings/ScriptValue.cpp: - (Deprecated::jsToInspectorValue): - * inspector/InspectorValues.cpp: - * runtime/DatePrototype.cpp: - (JSC::formatLocaleDate): - * runtime/Identifier.h: - (JSC::Identifier::characters): - * runtime/JSStringBuilder.h: - (JSC::JSStringBuilder::append): - -2014-01-12 Darin Adler - - Add deprecatedCharacters as a synonym for characters and convert most call sites - https://bugs.webkit.org/show_bug.cgi?id=126858 - - Reviewed by Anders Carlsson. - - * API/JSStringRef.cpp: - (JSStringGetCharactersPtr): - (JSStringGetUTF8CString): - (JSStringIsEqual): - * API/JSStringRefCF.cpp: - (JSStringCopyCFString): - * API/OpaqueJSString.h: - (OpaqueJSString::characters): - (OpaqueJSString::deprecatedCharacters): - (OpaqueJSString::length): - (OpaqueJSString::OpaqueJSString): - * inspector/InspectorValues.cpp: - (Inspector::InspectorValue::parseJSON): - * runtime/JSGlobalObjectFunctions.cpp: - (JSC::parseInt): - * runtime/StringPrototype.cpp: - (JSC::localeCompare): - (JSC::stringProtoFuncFontsize): - (JSC::stringProtoFuncLink): - Use deprecatedCharacters instead of characters. - -2014-01-12 Darin Adler - - Reduce use of String::characters - https://bugs.webkit.org/show_bug.cgi?id=126854 - - Reviewed by Sam Weinig. - - * API/JSValueRef.cpp: - (JSValueMakeFromJSONString): Use characters16 instead of characters for 16-bit case. - Had to remove length check because an empty string could be either 8 bit or 16 bit. - Don't need a null string check before calling is8Bit because JSStringRef can't hold - a null string. - - * bindings/ScriptValue.cpp: - (Deprecated::jsToInspectorValue): Use the existing string here instead of creating - a new one by calling characters and length on the old string. I think this may be - left over from when string types were not the same in JavaScriptCore and WebCore. - Also rewrite the property names loop to use modern for syntax and fewer locals. - - * inspector/InspectorValues.cpp: - (Inspector::escapeChar): Changed to use appendLiteral instead of hard-coding string - lengths. Moved handling of "<" and ">" in here instead of at the call site. - (Inspector::doubleQuoteString): Simplify the code so there is no use of characters - and length. This is still an inefficient way of doing this job and could use a rethink. - - * runtime/DatePrototype.cpp: - (JSC::formatLocaleDate): Use RetainPtr, createCFString, and the conversion from - CFStringRef to WTF::String to remove a lot of unneeded code. - - * runtime/Identifier.h: Removed unneeded Identifier::characters function. - - * runtime/JSStringBuilder.h: - (JSC::JSStringBuilder::append): Use characters16 instead of characters function here, - since we have already checked is8Bit above. - -2014-01-12 Andy Estes - - [iOS] Enable the JSC Objective-C API - - Rubber-stamped by Simon Fraser. - - * API/JSBase.h: - -2014-01-12 Carlos Garcia Campos - - Unreviewed. Fix make distcheck. - - * GNUmakefile.am: Add inline-and-minify-stylesheets-and-scripts.py - to EXTRA_DIST and fix InjectedScriptSource.h generation rule. - * GNUmakefile.list.am: Move InjectedScriptSource.h to - built_nosources to make sure it's not disted. - -2014-01-11 Anders Carlsson - - Try again to fix the build. - - * inspector/InspectorAgentRegistry.cpp: - * inspector/InspectorAgentRegistry.h: - -2014-01-11 Anders Carlsson - - Try to prevent the Vector copy constructor from being instantiated. - - * inspector/InspectorAgentRegistry.cpp: - (Inspector::InspectorAgentRegistry::InspectorAgentRegistry): - * inspector/InspectorAgentRegistry.h: - -2014-01-11 Anders Carlsson - - Try something else. - - * inspector/InspectorAgentRegistry.cpp: - (Inspector::InspectorAgentRegistry::~InspectorAgentRegistry): - * inspector/InspectorAgentRegistry.h: - -2014-01-11 Dean Jackson - - [JSC] Revise typed array implementations to match ECMAScript and WebGL Specification - https://bugs.webkit.org/show_bug.cgi?id=126754 - - Reviewed by Filip Pizlo. - - The ECMAScript specification forbids calling the typed array - constructors without using "new". Change the call data to return - none so we throw and exception in these cases. - - * runtime/JSGenericTypedArrayViewConstructorInlines.h: - (JSC::JSGenericTypedArrayViewConstructor::getCallData): - -2014-01-11 Anders Carlsson - - Try to fix the build by introducing a constructor. - - * inspector/InspectorAgentRegistry.cpp: - (Inspector::InspectorAgentRegistry::InspectorAgentRegistry): - * inspector/InspectorAgentRegistry.h: - -2014-01-11 Anders Carlsson - - * inspector/InspectorAgentRegistry.h: - - Remove an unused function. - -2014-01-11 Anders Carlsson - - InspectorAgentRegistry should use std::unique_ptr - https://bugs.webkit.org/show_bug.cgi?id=126826 - - Reviewed by Sam Weinig. - - * inspector/InspectorAgentRegistry.cpp: - (Inspector::InspectorAgentRegistry::append): - * inspector/InspectorAgentRegistry.h: - * inspector/JSGlobalObjectInspectorController.cpp: - (Inspector::JSGlobalObjectInspectorController::JSGlobalObjectInspectorController): - * inspector/agents/InspectorAgent.h: - -2014-01-10 Joseph Pecoraro - - Web Inspector: Push InspectorAgent down into JSC, give JSC an InspectorController - https://bugs.webkit.org/show_bug.cgi?id=126763 - - Reviewed by Timothy Hatcher. - - Introduce JSGlobalObjectInspectorController. This is the InspectorController - for a JSContext. It is created by the JSGlobalObject Remote Inspector Debuggable - when a remote frontend connects, and is destroyed when the remote frontend - disconnects of the JSGlobalObject is destroyed. - - * inspector/JSGlobalObjectInspectorController.h: Added. - * inspector/JSGlobalObjectInspectorController.cpp: Added. - (Inspector::JSGlobalObjectInspectorController::JSGlobalObjectInspectorController): - (Inspector::JSGlobalObjectInspectorController::~JSGlobalObjectInspectorController): - (Inspector::JSGlobalObjectInspectorController::connectFrontend): - (Inspector::JSGlobalObjectInspectorController::disconnectFrontend): - (Inspector::JSGlobalObjectInspectorController::dispatchMessageFromFrontend): - (Inspector::JSGlobalObjectInspectorController::functionCallHandler): - (Inspector::JSGlobalObjectInspectorController::evaluateHandler): - Create/destory agents, create/destroy dispatches, implement InspectorEnvironment. - - * runtime/JSGlobalObjectDebuggable.h: - * runtime/JSGlobalObjectDebuggable.cpp: - (JSC::JSGlobalObjectDebuggable::~JSGlobalObjectDebuggable): - (JSC::JSGlobalObjectDebuggable::connect): - (JSC::JSGlobalObjectDebuggable::disconnect): - (JSC::JSGlobalObjectDebuggable::dispatchMessageFromRemoteFrontend): - Forward actions to the InspectorController object. - - * inspector/agents/InspectorAgent.h: Renamed from Source/WebCore/inspector/InspectorAgent.h. - * inspector/agents/InspectorAgent.cpp: Renamed from Source/WebCore/inspector/InspectorAgent.cpp. - (Inspector::InspectorAgent::InspectorAgent): - (Inspector::InspectorAgent::~InspectorAgent): - (Inspector::InspectorAgent::didCreateFrontendAndBackend): - (Inspector::InspectorAgent::inspect): - (Inspector::InspectorAgent::evaluateForTestInFrontend): - Implement InspectorAgent in JavaScriptCore in namespace Inspector. - - * JavaScriptCore.xcodeproj/project.pbxproj: - * CMakeLists.txt: - * ChangeLog: - * GNUmakefile.am: - * GNUmakefile.list.am: - * JavaScriptCore.vcxproj/JavaScriptCore.vcxproj: - * JavaScriptCore.vcxproj/JavaScriptCore.vcxproj.filters: - * JavaScriptCore.vcxproj/copy-files.cmd: - Add files and new inspector/agents subdirectory. - -2014-01-10 Commit Queue - - Unreviewed, rolling out r161702. - http://trac.webkit.org/changeset/161702 - https://bugs.webkit.org/show_bug.cgi?id=126803 - - Broke multiple tests (Requested by ap on #webkit). - - * runtime/JSGenericTypedArrayViewConstructorInlines.h: - (JSC::JSGenericTypedArrayViewConstructor::getCallData): - -2014-01-10 David Kilzer - - Clean up architectures in xcconfig files - - - Reviewed by Andy Estes. - - * Configurations/Base.xcconfig: - * Configurations/JavaScriptCore.xcconfig: Remove armv6, ppc. - * Configurations/ToolExecutable.xcconfig: Sort. - - Add new arch. - -2014-01-10 Dean Jackson - - [JSC] Revise typed array implementations to match ECMAScript and WebGL Specification - https://bugs.webkit.org/show_bug.cgi?id=126754 - - Reviewed by Filip Pizlo. - - The ECMAScript specification forbids calling the typed array - constructors without using "new". Change the call data to return - none so we throw and exception in these cases. - - * runtime/JSGenericTypedArrayViewConstructorInlines.h: - (JSC::JSGenericTypedArrayViewConstructor::getCallData): - -2014-01-10 Benjamin Poulain - - Remove the BlackBerry port from trunk - https://bugs.webkit.org/show_bug.cgi?id=126715 - - Reviewed by Anders Carlsson. - - * assembler/ARMAssembler.h: - (JSC::ARMAssembler::cacheFlush): - * assembler/ARMv7Assembler.h: - (JSC::ARMv7Assembler::replaceWithJump): - (JSC::ARMv7Assembler::maxJumpReplacementSize): - (JSC::ARMv7Assembler::cacheFlush): - * assembler/MacroAssemblerARMv7.h: - (JSC::MacroAssemblerARMv7::revertJumpReplacementToBranchPtrWithPatch): - * heap/MachineStackMarker.cpp: - (JSC::getPlatformThreadRegisters): - (JSC::otherThreadStackPointer): - (JSC::freePlatformThreadRegisters): - * jit/ExecutableAllocator.h: - -2014-01-10 Joseph Pecoraro - - Web Inspector: Remove unimplemented or static ScriptDebugServer features - https://bugs.webkit.org/show_bug.cgi?id=126784 - - Reviewed by Timothy Hatcher. - - * inspector/protocol/Debugger.json: - -2014-01-10 Michael Saboff - - REGRESSION(C stack work): stack traces no longer work in CrashTracer, lldb, and other tools - https://bugs.webkit.org/show_bug.cgi?id=126764 - - Reviewed by Geoffrey Garen. - - Updated callToJavaScript and cllToNativeFunction to properly replicate the caller's - return PC and frame pointer in the sentinel frame. For X86-64, added .cfi_ - directives to create eh_frame info for all LLInt symbols so that the various - unwinding code understands that we are using a separate JS stack referenced - by BP and at what offsets in that frame the prior PC (register 16) and prior - BP (register 6) can be found. These two changes are sufficient for stack tracing - to work for Mac OSX. - - * llint/LowLevelInterpreter.cpp: - * llint/LowLevelInterpreter64.asm: - -2014-01-10 Tamas Gergely - - [EFL][JSC] Enable udis86 disassembler on efl. - https://bugs.webkit.org/show_bug.cgi?id=125502 - - Reviewed by Michael Saboff. - - Enable udis86 disassembler on efl and fix build warnings. - - * CMakeLists.txt: - Add udis86 disassembler source files. - * disassembler/udis86/udis86_decode.c: - (decode_modrm_rm): - Build warning fixes. - * disassembler/udis86/udis86_syn-att.c: - (gen_operand): - Build warning fixes. - * disassembler/udis86/udis86_syn-intel.c: - (gen_operand): - Build warning fixes. - * disassembler/udis86/udis86_types.h: - Correct FMT64 for uint64_t. - -2014-01-09 Benjamin Poulain - - Remove the BlackBerry files outside WebCore - https://bugs.webkit.org/show_bug.cgi?id=126715 - - Reviewed by Anders Carlsson. - - * PlatformBlackBerry.cmake: Removed. - * runtime/GCActivityCallbackBlackBerry.cpp: Removed. - * shell/PlatformBlackBerry.cmake: Removed. - -2014-01-10 Geoffrey Garen - - Removed Blackberry #ifdefs and platform code from JavaScriptCore - https://bugs.webkit.org/show_bug.cgi?id=126757 - - Reviewed by Sam Weinig. - - * PlatformBlackBerry.cmake: Removed. - * heap/HeapTimer.cpp: - * heap/HeapTimer.h: - * heap/IncrementalSweeper.cpp: - * heap/IncrementalSweeper.h: - * jsc.cpp: - (main): - * runtime/GCActivityCallbackBlackBerry.cpp: Removed. - * runtime/MemoryStatistics.cpp: - (JSC::globalMemoryStatistics): - -2014-01-07 Mark Hahnenberg - - Marking should be generational - https://bugs.webkit.org/show_bug.cgi?id=126552 - - Reviewed by Geoffrey Garen. - - Re-marking the same objects over and over is a waste of effort. This patch implements - the sticky mark bit algorithm (along with our already-present write barriers) to reduce - overhead during garbage collection caused by rescanning objects. - - There are now two collection modes, EdenCollection and FullCollection. EdenCollections - only visit new objects or objects that were added to the remembered set by a write barrier. - FullCollections are normal collections that visit all objects regardless of their - generation. - - In this patch EdenCollections do not do anything in CopiedSpace. This will be fixed in - https://bugs.webkit.org/show_bug.cgi?id=126555. - - * bytecode/CodeBlock.cpp: - (JSC::CodeBlock::visitAggregate): - * bytecode/CodeBlock.h: - (JSC::CodeBlockSet::mark): - * dfg/DFGOperations.cpp: - * heap/CodeBlockSet.cpp: - (JSC::CodeBlockSet::add): - (JSC::CodeBlockSet::traceMarked): - (JSC::CodeBlockSet::rememberCurrentlyExecutingCodeBlocks): - * heap/CodeBlockSet.h: - * heap/CopiedBlockInlines.h: - (JSC::CopiedBlock::reportLiveBytes): - * heap/CopiedSpace.cpp: - (JSC::CopiedSpace::didStartFullCollection): - * heap/CopiedSpace.h: - (JSC::CopiedSpace::heap): - * heap/Heap.cpp: - (JSC::Heap::Heap): - (JSC::Heap::didAbandon): - (JSC::Heap::markRoots): - (JSC::Heap::copyBackingStores): - (JSC::Heap::addToRememberedSet): - (JSC::Heap::collectAllGarbage): - (JSC::Heap::collect): - (JSC::Heap::didAllocate): - (JSC::Heap::writeBarrier): - * heap/Heap.h: - (JSC::Heap::isInRememberedSet): - (JSC::Heap::operationInProgress): - (JSC::Heap::shouldCollect): - (JSC::Heap::isCollecting): - (JSC::Heap::isWriteBarrierEnabled): - (JSC::Heap::writeBarrier): - * heap/HeapOperation.h: - * heap/MarkStack.cpp: - (JSC::MarkStackArray::~MarkStackArray): - (JSC::MarkStackArray::clear): - (JSC::MarkStackArray::fillVector): - * heap/MarkStack.h: - * heap/MarkedAllocator.cpp: - (JSC::isListPagedOut): - (JSC::MarkedAllocator::isPagedOut): - (JSC::MarkedAllocator::tryAllocateHelper): - (JSC::MarkedAllocator::addBlock): - (JSC::MarkedAllocator::removeBlock): - (JSC::MarkedAllocator::reset): - * heap/MarkedAllocator.h: - (JSC::MarkedAllocator::MarkedAllocator): - * heap/MarkedBlock.cpp: - (JSC::MarkedBlock::clearMarks): - (JSC::MarkedBlock::clearRememberedSet): - (JSC::MarkedBlock::clearMarksWithCollectionType): - (JSC::MarkedBlock::lastChanceToFinalize): - * heap/MarkedBlock.h: Changed atomSize to 16 bytes because we have no objects smaller - than 16 bytes. This is also to pay for the additional Bitmap for the remembered set. - (JSC::MarkedBlock::didConsumeEmptyFreeList): - (JSC::MarkedBlock::setRemembered): - (JSC::MarkedBlock::clearRemembered): - (JSC::MarkedBlock::atomicClearRemembered): - (JSC::MarkedBlock::isRemembered): - * heap/MarkedSpace.cpp: - (JSC::MarkedSpace::~MarkedSpace): - (JSC::MarkedSpace::resetAllocators): - (JSC::MarkedSpace::visitWeakSets): - (JSC::MarkedSpace::reapWeakSets): - (JSC::VerifyMarked::operator()): - (JSC::MarkedSpace::clearMarks): - * heap/MarkedSpace.h: - (JSC::ClearMarks::operator()): - (JSC::ClearRememberedSet::operator()): - (JSC::MarkedSpace::didAllocateInBlock): - (JSC::MarkedSpace::clearRememberedSet): - * heap/SlotVisitor.cpp: - (JSC::SlotVisitor::~SlotVisitor): - (JSC::SlotVisitor::clearMarkStack): - * heap/SlotVisitor.h: - (JSC::SlotVisitor::markStack): - (JSC::SlotVisitor::sharedData): - * heap/SlotVisitorInlines.h: - (JSC::SlotVisitor::internalAppend): - (JSC::SlotVisitor::unconditionallyAppend): - (JSC::SlotVisitor::copyLater): - (JSC::SlotVisitor::reportExtraMemoryUsage): - (JSC::SlotVisitor::heap): - * jit/Repatch.cpp: - * runtime/JSGenericTypedArrayViewInlines.h: - (JSC::JSGenericTypedArrayView::visitChildren): - * runtime/JSPropertyNameIterator.h: - (JSC::StructureRareData::setEnumerationCache): - * runtime/JSString.cpp: - (JSC::JSString::visitChildren): - * runtime/StructureRareDataInlines.h: - (JSC::StructureRareData::setPreviousID): - (JSC::StructureRareData::setObjectToStringValue): - * runtime/WeakMapData.cpp: - (JSC::WeakMapData::visitChildren): - -2014-01-09 Joseph Pecoraro - - Unreviewed Windows build fix for r161563. - - Copy all scripts, some may not be .py. - - * JavaScriptCore.vcxproj/copy-files.cmd: - -2014-01-09 Filip Pizlo - - AI for CreateArguments should pass through non-SpecEmpty input values - https://bugs.webkit.org/show_bug.cgi?id=126709 - - Reviewed by Mark Hahnenberg. - - * dfg/DFGAbstractInterpreterInlines.h: - (JSC::DFG::AbstractInterpreter::executeEffects): - * tests/stress/use-arguments-as-object-pointer.js: Added. - (foo): - -2014-01-09 Mark Hahnenberg - - Constructors for Objective-C classes do not work properly with instanceof - https://bugs.webkit.org/show_bug.cgi?id=126670 - - Reviewed by Oliver Hunt. - - This bug is due to the fact that the JS constructors created for Objective-C classes via the JSC - API inherit from JSCallbackObject, which overrides hasInstance with its own customHasInstance. - JSCallbackObject::customHasInstance only checks the JSClassRefs for hasInstance callbacks. - If it doesn't find any callbacks, it returns false. - - This patch adds a hasInstance callback to constructors created for Objective-C wrapper classes. - - * API/JSWrapperMap.mm: - (constructorHasInstance): - (constructorWithCustomBrand): - (allocateConstructorForCustomClass): - * API/tests/testapi.mm: - -2014-01-09 Joseph Pecoraro - - Web Inspector: Move InjectedScript classes into JavaScriptCore - https://bugs.webkit.org/show_bug.cgi?id=126598 - - Reviewed by Timothy Hatcher. - - Part 5: Move InjectedScript classes into JavaScriptCore - - There are pieces of logic that WebCore wants to hook into in the InjectedScript - execution (e.g. for CommandLineAPIModule and InspectorInstrumentation). Create - hooks for those in a base class called InspectorEnvironment. For now, the - InspectorControllers (Page, JSGlobalObject, Worker) will be the InspectorEnvironments - and provide answers to its hooks. - - * inspector/InspectorEnvironment.h: Added. - New hooks needed by WebCore in various places. Mostly stubbed in JavaScriptCore. - - * inspector/InjectedScript.cpp: Renamed from Source/WebCore/inspector/InjectedScript.cpp. - * inspector/InjectedScript.h: Added. - * inspector/InjectedScriptBase.cpp: Renamed from Source/WebCore/inspector/InjectedScriptBase.cpp. - * inspector/InjectedScriptBase.h: Renamed from Source/WebCore/inspector/InjectedScriptBase.h. - * inspector/InjectedScriptModule.cpp: Renamed from Source/WebCore/inspector/InjectedScriptModule.cpp. - * inspector/InjectedScriptModule.h: Renamed from Source/WebCore/inspector/InjectedScriptModule.h. - Cleanup the style of these files (nullptr, formatting, whitespace, etc). - Use the InspectorEnvironments call/evaluate function for ScriptFunctionCalls and checking access - - * inspector/InjectedScriptManager.cpp: Renamed from Source/WebCore/inspector/InjectedScriptManager.cpp. - * inspector/InjectedScriptManager.h: Renamed from Source/WebCore/inspector/InjectedScriptManager.h. - Take an InspectorEnvironment with multiple hooks, instead of a single hook function. - - * inspector/InjectedScriptHost.cpp: Added. - * inspector/InjectedScriptHost.h: Added. - * inspector/JSInjectedScriptHost.cpp: Renamed from Source/WebCore/bindings/js/JSInjectedScriptHostCustom.cpp. - * inspector/JSInjectedScriptHost.h: Added. - * inspector/JSInjectedScriptHostPrototype.cpp: Added. - * inspector/JSInjectedScriptHostPrototype.h: Added. - Implementation of InjectedScriptHost which is passed into the script (InjectedScriptSource.js) - that we inject into the page. This is mostly copied from the original autogenerated code, - then simplified and cleaned up. InjectedScriptHost can be subclasses to provide specialized - implementations of isHTMLAllCollection and type for Web/DOM types unknown to a pure JS context. - - - Part 4: Move all inspector scripts into JavaScriptCore and update generators. - - For OS X be sure to export the scripts as if they are private headers. - - * GNUmakefile.am: - * JavaScriptCore.xcodeproj/project.pbxproj: - * inspector/scripts/cssmin.py: Renamed from Source/WebCore/inspector/Scripts/cssmin.py. - * inspector/scripts/inline-and-minify-stylesheets-and-scripts.py: Renamed from Source/WebCore/inspector/Scripts/inline-and-minify-stylesheets-and-scripts.py. - * inspector/scripts/jsmin.py: Renamed from Source/WebCore/inspector/Scripts/jsmin.py. - * inspector/scripts/xxd.pl: Renamed from Source/WebCore/inspector/xxd.pl. - - - Part 3: Update CodeGeneratorInspector to avoid inlining virtual destructors. - - This avoids build errors about duplicate exported virtual inlined methods - are included from multiple places. Just put empty destructors in the - implementation file instead of inlined. - - * inspector/scripts/CodeGeneratorInspector.py: - (Generator): - (Generator.go): - * inspector/scripts/CodeGeneratorInspectorStrings.py: - - - Part 2: Move InjectedScriptSource and generation into JavaScriptCore. - - Move InjectedScriptSource.js and derived sources generation. - - * CMakeLists.txt: - * DerivedSources.make: - * GNUmakefile.am: - * GNUmakefile.list.am: - * JavaScriptCore.vcxproj/JavaScriptCore.vcxproj: - * JavaScriptCore.xcodeproj/project.pbxproj: - * inspector/InjectedScriptSource.js: Renamed from Source/WebCore/inspector/InjectedScriptSource.js. - -2014-01-09 Balazs Kilvady - - Regression: failing RegExp tests on 32 bit architectures. - https://bugs.webkit.org/show_bug.cgi?id=126699 - - Reviewed by Michael Saboff. - - Fix setRegExpConstructor functions for 32 bit architectures. - - * runtime/RegExpConstructor.cpp: - (JSC::setRegExpConstructorInput): - (JSC::setRegExpConstructorMultiline): - -2014-01-09 Commit Queue - - Unreviewed, rolling out r161540. - http://trac.webkit.org/changeset/161540 - https://bugs.webkit.org/show_bug.cgi?id=126704 - - Caused assertion failures on multiple tests (Requested by ap - on #webkit). - - * bytecode/CodeBlock.cpp: - (JSC::CodeBlock::visitAggregate): - * bytecode/CodeBlock.h: - (JSC::CodeBlockSet::mark): - * dfg/DFGOperations.cpp: - * heap/CodeBlockSet.cpp: - (JSC::CodeBlockSet::add): - (JSC::CodeBlockSet::traceMarked): - * heap/CodeBlockSet.h: - * heap/CopiedBlockInlines.h: - (JSC::CopiedBlock::reportLiveBytes): - * heap/CopiedSpace.cpp: - * heap/CopiedSpace.h: - * heap/Heap.cpp: - (JSC::Heap::Heap): - (JSC::Heap::didAbandon): - (JSC::Heap::markRoots): - (JSC::Heap::copyBackingStores): - (JSC::Heap::collectAllGarbage): - (JSC::Heap::collect): - (JSC::Heap::didAllocate): - * heap/Heap.h: - (JSC::Heap::shouldCollect): - (JSC::Heap::isCollecting): - (JSC::Heap::isWriteBarrierEnabled): - (JSC::Heap::writeBarrier): - * heap/HeapOperation.h: - * heap/MarkStack.cpp: - (JSC::MarkStackArray::~MarkStackArray): - * heap/MarkStack.h: - * heap/MarkedAllocator.cpp: - (JSC::MarkedAllocator::isPagedOut): - (JSC::MarkedAllocator::tryAllocateHelper): - (JSC::MarkedAllocator::addBlock): - (JSC::MarkedAllocator::removeBlock): - * heap/MarkedAllocator.h: - (JSC::MarkedAllocator::MarkedAllocator): - (JSC::MarkedAllocator::reset): - * heap/MarkedBlock.cpp: - * heap/MarkedBlock.h: - (JSC::MarkedBlock::lastChanceToFinalize): - (JSC::MarkedBlock::didConsumeEmptyFreeList): - (JSC::MarkedBlock::clearMarks): - * heap/MarkedSpace.cpp: - (JSC::MarkedSpace::~MarkedSpace): - (JSC::MarkedSpace::resetAllocators): - (JSC::MarkedSpace::visitWeakSets): - (JSC::MarkedSpace::reapWeakSets): - * heap/MarkedSpace.h: - (JSC::ClearMarks::operator()): - (JSC::MarkedSpace::clearMarks): - * heap/SlotVisitor.cpp: - (JSC::SlotVisitor::~SlotVisitor): - * heap/SlotVisitor.h: - (JSC::SlotVisitor::sharedData): - * heap/SlotVisitorInlines.h: - (JSC::SlotVisitor::internalAppend): - (JSC::SlotVisitor::copyLater): - (JSC::SlotVisitor::reportExtraMemoryUsage): - * jit/Repatch.cpp: - * runtime/JSGenericTypedArrayViewInlines.h: - (JSC::JSGenericTypedArrayView::visitChildren): - * runtime/JSPropertyNameIterator.h: - (JSC::StructureRareData::setEnumerationCache): - * runtime/JSString.cpp: - (JSC::JSString::visitChildren): - * runtime/StructureRareDataInlines.h: - (JSC::StructureRareData::setPreviousID): - (JSC::StructureRareData::setObjectToStringValue): - * runtime/WeakMapData.cpp: - (JSC::WeakMapData::visitChildren): - -2014-01-09 Andreas Kling - - Shrink WatchpointSet. - - - Reorder the members of WatchpointSet, shrinking it by 8 bytes. - 767 kB progression on Membuster3. - - Reviewed by Antti Koivisto. - - * bytecode/Watchpoint.h: - -2014-01-08 Mark Hahnenberg - - Reverting accidental GC logging - - * heap/Heap.cpp: - -2014-01-07 Mark Hahnenberg - - Marking should be generational - https://bugs.webkit.org/show_bug.cgi?id=126552 - - Reviewed by Geoffrey Garen. + 2014-01-09 Filip Pizlo - Re-marking the same objects over and over is a waste of effort. This patch implements - the sticky mark bit algorithm (along with our already-present write barriers) to reduce - overhead during garbage collection caused by rescanning objects. + AI for CreateArguments should pass through non-SpecEmpty input values + https://bugs.webkit.org/show_bug.cgi?id=126709 - There are now two collection modes, EdenCollection and FullCollection. EdenCollections - only visit new objects or objects that were added to the remembered set by a write barrier. - FullCollections are normal collections that visit all objects regardless of their - generation. + Reviewed by Mark Hahnenberg. - In this patch EdenCollections do not do anything in CopiedSpace. This will be fixed in - https://bugs.webkit.org/show_bug.cgi?id=126555. - - * bytecode/CodeBlock.cpp: - (JSC::CodeBlock::visitAggregate): - * bytecode/CodeBlock.h: - (JSC::CodeBlockSet::mark): - * dfg/DFGOperations.cpp: - * heap/CodeBlockSet.cpp: - (JSC::CodeBlockSet::add): - (JSC::CodeBlockSet::traceMarked): - (JSC::CodeBlockSet::rememberCurrentlyExecutingCodeBlocks): - * heap/CodeBlockSet.h: - * heap/CopiedBlockInlines.h: - (JSC::CopiedBlock::reportLiveBytes): - * heap/CopiedSpace.cpp: - (JSC::CopiedSpace::didStartFullCollection): - * heap/CopiedSpace.h: - (JSC::CopiedSpace::heap): - * heap/Heap.cpp: - (JSC::Heap::Heap): - (JSC::Heap::didAbandon): - (JSC::Heap::markRoots): - (JSC::Heap::copyBackingStores): - (JSC::Heap::addToRememberedSet): - (JSC::Heap::collectAllGarbage): - (JSC::Heap::collect): - (JSC::Heap::didAllocate): - (JSC::Heap::writeBarrier): - * heap/Heap.h: - (JSC::Heap::isInRememberedSet): - (JSC::Heap::operationInProgress): - (JSC::Heap::shouldCollect): - (JSC::Heap::isCollecting): - (JSC::Heap::isWriteBarrierEnabled): - (JSC::Heap::writeBarrier): - * heap/HeapOperation.h: - * heap/MarkStack.cpp: - (JSC::MarkStackArray::~MarkStackArray): - (JSC::MarkStackArray::clear): - (JSC::MarkStackArray::fillVector): - * heap/MarkStack.h: - * heap/MarkedAllocator.cpp: - (JSC::isListPagedOut): - (JSC::MarkedAllocator::isPagedOut): - (JSC::MarkedAllocator::tryAllocateHelper): - (JSC::MarkedAllocator::addBlock): - (JSC::MarkedAllocator::removeBlock): - (JSC::MarkedAllocator::reset): - * heap/MarkedAllocator.h: - (JSC::MarkedAllocator::MarkedAllocator): - * heap/MarkedBlock.cpp: - (JSC::MarkedBlock::clearMarks): - (JSC::MarkedBlock::clearRememberedSet): - (JSC::MarkedBlock::clearMarksWithCollectionType): - (JSC::MarkedBlock::lastChanceToFinalize): - * heap/MarkedBlock.h: Changed atomSize to 16 bytes because we have no objects smaller - than 16 bytes. This is also to pay for the additional Bitmap for the remembered set. - (JSC::MarkedBlock::didConsumeEmptyFreeList): - (JSC::MarkedBlock::setRemembered): - (JSC::MarkedBlock::clearRemembered): - (JSC::MarkedBlock::atomicClearRemembered): - (JSC::MarkedBlock::isRemembered): - * heap/MarkedSpace.cpp: - (JSC::MarkedSpace::~MarkedSpace): - (JSC::MarkedSpace::resetAllocators): - (JSC::MarkedSpace::visitWeakSets): - (JSC::MarkedSpace::reapWeakSets): - (JSC::VerifyMarked::operator()): - (JSC::MarkedSpace::clearMarks): - * heap/MarkedSpace.h: - (JSC::ClearMarks::operator()): - (JSC::ClearRememberedSet::operator()): - (JSC::MarkedSpace::didAllocateInBlock): - (JSC::MarkedSpace::clearRememberedSet): - * heap/SlotVisitor.cpp: - (JSC::SlotVisitor::~SlotVisitor): - (JSC::SlotVisitor::clearMarkStack): - * heap/SlotVisitor.h: - (JSC::SlotVisitor::markStack): - (JSC::SlotVisitor::sharedData): - * heap/SlotVisitorInlines.h: - (JSC::SlotVisitor::internalAppend): - (JSC::SlotVisitor::unconditionallyAppend): - (JSC::SlotVisitor::copyLater): - (JSC::SlotVisitor::reportExtraMemoryUsage): - (JSC::SlotVisitor::heap): - * jit/Repatch.cpp: - * runtime/JSGenericTypedArrayViewInlines.h: - (JSC::JSGenericTypedArrayView::visitChildren): - * runtime/JSPropertyNameIterator.h: - (JSC::StructureRareData::setEnumerationCache): - * runtime/JSString.cpp: - (JSC::JSString::visitChildren): - * runtime/StructureRareDataInlines.h: - (JSC::StructureRareData::setPreviousID): - (JSC::StructureRareData::setObjectToStringValue): - * runtime/WeakMapData.cpp: - (JSC::WeakMapData::visitChildren): - -2014-01-08 Sam Weinig - - [JS] Should be able to create a promise by calling the Promise constructor as a function - https://bugs.webkit.org/show_bug.cgi?id=126561 - - Reviewed by Geoffrey Garen. - - * runtime/JSPromiseConstructor.cpp: - (JSC::JSPromiseConstructor::getCallData): - Add support for calling the Promise constructor as a function (e.g. var p = Promise(...), note - the missing "new"). - -2014-01-08 Dániel Bátyai - - [EFL] Make FTL buildable - https://bugs.webkit.org/show_bug.cgi?id=125777 - - Reviewed by Csaba Osztrogonác. - - * CMakeLists.txt: - * ftl/FTLOSREntry.cpp: - * ftl/FTLOSRExitCompiler.cpp: - * llvm/library/config_llvm.h: - -2014-01-08 Zan Dobersek - - [Automake] Scripts for generated build targets do not necessarily produce their output - https://bugs.webkit.org/show_bug.cgi?id=126378 - - Reviewed by Carlos Garcia Campos. - - * GNUmakefile.am: Touch the build targets that are generated through helper scripts that don't - assure the output is generated every time the script is invoked, most commonly due to unchanged - input. This assures the build targets are up-to-date and can't be older that their dependencies, - which would result in constant regeneration at every build. - -2014-01-07 Filip Pizlo - - DFG fixup phase should be responsible for inserting ValueToInt32's as needed and it should use Phantom to keep the original values alive in case of OSR exit - https://bugs.webkit.org/show_bug.cgi?id=126600 - - Reviewed by Michael Saboff. - - This fixes an embarrassing OSR exit liveness bug. It also simplifies the code. We were - already using FixupPhase as the place where conversion nodes get inserted. ValueToInt32 - was the only exception to that rule, and that was one of the reasons why we had this bug. - - Henceforth ValueToInt32 is only inserted by FixupPhase, and only when it is necessary: - we have a BitOp that will want a ToInt32 conversion and the operand is not predicted to - already be an int32. If FixupPhase inserts any ValueToInt32's then the BitOp will no - longer appear to use the original operand, which will make OSR exit think that the - original operand is dead. We work around this they way we always do: insert a Phantom on - the original operands right after the BitOp. This ensures that any OSR exit in any of the - ValueToInt32's or in the BitOp itself will have values for the original inputs. - - * dfg/DFGBackwardsPropagationPhase.cpp: - (JSC::DFG::BackwardsPropagationPhase::isWithinPowerOfTwo): - (JSC::DFG::BackwardsPropagationPhase::propagate): - * dfg/DFGByteCodeParser.cpp: - (JSC::DFG::ByteCodeParser::handleIntrinsic): - (JSC::DFG::ByteCodeParser::parseBlock): - * dfg/DFGFixupPhase.cpp: - (JSC::DFG::FixupPhase::fixupNode): - (JSC::DFG::FixupPhase::fixIntEdge): - (JSC::DFG::FixupPhase::fixBinaryIntEdges): - * dfg/DFGPredictionPropagationPhase.cpp: - (JSC::DFG::PredictionPropagationPhase::propagate): - * tests/stress/bit-op-value-to-int32-input-liveness.js: Added. - (foo): - -2014-01-07 Mark Hahnenberg - - Repatch write barrier slow path call doesn't align the stack in the presence of saved registers - https://bugs.webkit.org/show_bug.cgi?id=126093 - - Reviewed by Geoffrey Garen. - - * jit/Repatch.cpp: Reworked the stack alignment code for calling out to C code on the write barrier slow path. - We need to properly account for the number of reused registers that were saved to the stack, so we have to - pass the ScratchRegisterAllocator around. - (JSC::storeToWriteBarrierBuffer): - (JSC::writeBarrier): - (JSC::emitPutReplaceStub): - (JSC::emitPutTransitionStub): - * jit/ScratchRegisterAllocator.h: Previously the ScratchRegisterAllocator only knew whether or not it had - reused registers, but not how many. In order to correctly align the stack for calls to C slow paths for - the write barriers in inline caches we need to know how the stack is aligned. So now ScratchRegisterAllocator - tracks how many registers it has reused. - (JSC::ScratchRegisterAllocator::ScratchRegisterAllocator): - (JSC::ScratchRegisterAllocator::allocateScratch): - (JSC::ScratchRegisterAllocator::didReuseRegisters): - (JSC::ScratchRegisterAllocator::numberOfReusedRegisters): - (JSC::ScratchRegisterAllocator::preserveReusedRegistersByPushing): - (JSC::ScratchRegisterAllocator::restoreReusedRegistersByPopping): - * llint/LowLevelInterpreter64.asm: Random typo fix. - -2014-01-07 Mark Lam - - r161364 caused JSC tests regression on non-DFG builds (e.g. C Loop and Windows). - https://bugs.webkit.org/show_bug.cgi?id=126589. - - Reviewed by Filip Pizlo. - - After the removal of ENABLE(VALUE_PROFILER), the LLINT is now expecting the - relevant opcode operands to point to ValueProfiler data structures and will - write profiling data into them. Hence, we need to allocate these data - structures even though the profiling data won't be used in non-DFG builds. - - * bytecode/CodeBlock.cpp: - (JSC::CodeBlock::CodeBlock): - -2014-01-07 Filip Pizlo - - ASSERT in compileArithNegate on pdfjs - https://bugs.webkit.org/show_bug.cgi?id=126584 - - Reviewed by Mark Hahnenberg. - - Check negative zero when we should check it, not when we shouldn't check it. :-/ - - * dfg/DFGSpeculativeJIT.cpp: - (JSC::DFG::SpeculativeJIT::compileArithNegate): - -2014-01-07 Gabor Rapcsanyi - - pushFinallyContext saves wrong m_labelScopes size - https://bugs.webkit.org/show_bug.cgi?id=124529 - - Remove free label scopes before saving finally context. - - Reviewed by Geoffrey Garen. - - * bytecompiler/BytecodeGenerator.cpp: - (JSC::BytecodeGenerator::pushFinallyContext): - -2014-01-06 Mark Hahnenberg - - Heap::collect shouldn't be responsible for sweeping - https://bugs.webkit.org/show_bug.cgi?id=126556 - - Reviewed by Geoffrey Garen. - - Sweeping happens at an awkward time during collection due to the fact that destructors can - cause arbitrary reentry into the VM. This patch separates collecting and sweeping, and delays - sweeping until after collection has completely finished. - - * heap/Heap.cpp: - (JSC::Heap::collectAllGarbage): - (JSC::Heap::collect): - (JSC::Heap::collectIfNecessaryOrDefer): - * heap/Heap.h: - * heap/MarkedSpace.cpp: - (JSC::MarkedSpace::sweep): - * runtime/GCActivityCallback.cpp: - (JSC::DefaultGCActivityCallback::doWork): - -2014-01-07 Mark Rowe - - Remove the legacy WebKit availability macros - - They're no longer used. - - Reviewed by Ryosuke Niwa. - - * API/WebKitAvailability.h: - -2014-01-07 Filip Pizlo - - SetLocal for a FlushedArguments should not claim that the dataFormat is DataFormatJS - https://bugs.webkit.org/show_bug.cgi?id=126563 - - Reviewed by Gavin Barraclough. - - This was a rookie arguments simplification mistake: the SetLocal needs to record the fact - that although it set JSValue(), OSR should think it set Arguments. DataFormatArguments - conveys this, and dataFormatFor(FlushFormat) will do the right thing. - - * dfg/DFGSpeculativeJIT32_64.cpp: - (JSC::DFG::SpeculativeJIT::compile): - * dfg/DFGSpeculativeJIT64.cpp: - (JSC::DFG::SpeculativeJIT::compile): - * tests/stress/phantom-arguments-set-local-then-exit-in-same-block.js: Added. - (foo): - -2014-01-06 Filip Pizlo - - Make the different flavors of integer arithmetic more explicit, and don't rely on (possibly stale) results of the backwards propagator to decide integer arithmetic semantics - https://bugs.webkit.org/show_bug.cgi?id=125519 - - Reviewed by Geoffrey Garen. - - Adds the Arith::Mode enum to arithmetic nodes, which makes it explicit what sorts of - checks and overflows the node should do. Previously this would be deduced from - backwards analysis results. - - This also makes "unchecked" variants really mean that you want the int32 wrapped - result, so ArithIMul is now done in terms of ArithMul(Unchecked). That means that the - constant folder needs to compute exactly the result implied by ArithMode, instead of - just folding the double result. - - * CMakeLists.txt: - * GNUmakefile.list.am: - * JavaScriptCore.vcxproj/JavaScriptCore.vcxproj: - * JavaScriptCore.xcodeproj/project.pbxproj: - * dfg/DFGAbstractInterpreterInlines.h: - (JSC::DFG::AbstractInterpreter::executeEffects): - * dfg/DFGArithMode.cpp: Added. - (WTF::printInternal): - * dfg/DFGArithMode.h: Added. - (JSC::DFG::doesOverflow): - (JSC::DFG::shouldCheckOverflow): - (JSC::DFG::shouldCheckNegativeZero): - * dfg/DFGCSEPhase.cpp: - (JSC::DFG::CSEPhase::pureCSE): - (JSC::DFG::CSEPhase::performNodeCSE): - * dfg/DFGConstantFoldingPhase.cpp: - (JSC::DFG::ConstantFoldingPhase::foldConstants): - * dfg/DFGFixupPhase.cpp: - (JSC::DFG::FixupPhase::fixupNode): - (JSC::DFG::FixupPhase::attemptToMakeIntegerAdd): - * dfg/DFGGraph.cpp: - (JSC::DFG::Graph::dump): - * dfg/DFGNode.h: - (JSC::DFG::Node::Node): - (JSC::DFG::Node::hasArithMode): - (JSC::DFG::Node::arithMode): - (JSC::DFG::Node::setArithMode): - * dfg/DFGSpeculativeJIT.cpp: - (JSC::DFG::SpeculativeJIT::compileUInt32ToNumber): - (JSC::DFG::SpeculativeJIT::compileDoubleAsInt32): - (JSC::DFG::SpeculativeJIT::compileAdd): - (JSC::DFG::SpeculativeJIT::compileArithSub): - (JSC::DFG::SpeculativeJIT::compileArithNegate): - (JSC::DFG::SpeculativeJIT::compileArithMul): - (JSC::DFG::SpeculativeJIT::compileArithDiv): - (JSC::DFG::SpeculativeJIT::compileArithMod): - * dfg/DFGSpeculativeJIT.h: - * dfg/DFGSpeculativeJIT32_64.cpp: - (JSC::DFG::SpeculativeJIT::compile): - * dfg/DFGSpeculativeJIT64.cpp: - (JSC::DFG::SpeculativeJIT::compile): - * ftl/FTLLowerDFGToLLVM.cpp: - (JSC::FTL::LowerDFGToLLVM::compileAddSub): - (JSC::FTL::LowerDFGToLLVM::compileArithMul): - (JSC::FTL::LowerDFGToLLVM::compileArithDivMod): - (JSC::FTL::LowerDFGToLLVM::compileArithNegate): - (JSC::FTL::LowerDFGToLLVM::compileUInt32ToNumber): - -2014-01-06 Mark Hahnenberg - - Add write barriers to the LLInt - https://bugs.webkit.org/show_bug.cgi?id=126527 - - Reviewed by Filip Pizlo. - - This patch takes a similar approach to how write barriers work in the baseline JIT. - We execute the write barrier at the beginning of the opcode so we don't have to - worry about saving and restoring live registers across write barrier slow path calls - to C code. - - * llint/LLIntOfflineAsmConfig.h: - * llint/LLIntSlowPaths.cpp: - (JSC::LLInt::llint_write_barrier_slow): - * llint/LLIntSlowPaths.h: - * llint/LowLevelInterpreter.asm: - * llint/LowLevelInterpreter32_64.asm: - * llint/LowLevelInterpreter64.asm: - * offlineasm/arm64.rb: - * offlineasm/instructions.rb: - * offlineasm/x86.rb: - -2014-01-05 Sam Weinig - - [JS] Implement Promise.all() - https://bugs.webkit.org/show_bug.cgi?id=126510 - - Reviewed by Gavin Barraclough. - - Add Promise.all() implementation and factor out performing resolves and rejects - on deferreds to share a bit of code. Also moves the abruptRejection helper to - JSPromiseDeferred so it can be used in JSPromiseFunctions. - - * runtime/CommonIdentifiers.h: - * runtime/JSPromiseConstructor.cpp: - (JSC::JSPromiseConstructorFuncCast): - (JSC::JSPromiseConstructorFuncResolve): - (JSC::JSPromiseConstructorFuncReject): - (JSC::JSPromiseConstructorFuncAll): - * runtime/JSPromiseDeferred.cpp: - (JSC::updateDeferredFromPotentialThenable): - (JSC::performDeferredResolve): - (JSC::performDeferredReject): - (JSC::abruptRejection): - * runtime/JSPromiseDeferred.h: - * runtime/JSPromiseFunctions.cpp: - (JSC::promiseAllCountdownFunction): - (JSC::createPromiseAllCountdownFunction): - * runtime/JSPromiseFunctions.h: - * runtime/JSPromiseReaction.cpp: - (JSC::ExecutePromiseReactionMicrotask::run): - -2014-01-06 Filip Pizlo - - Get rid of ENABLE(VALUE_PROFILER). It's on all the time now. - - Rubber stamped by Mark Hahnenberg. - - * bytecode/CallLinkStatus.cpp: - (JSC::CallLinkStatus::computeFor): - * bytecode/CodeBlock.cpp: - (JSC::CodeBlock::dumpValueProfiling): - (JSC::CodeBlock::dumpArrayProfiling): - (JSC::CodeBlock::dumpRareCaseProfile): - (JSC::CodeBlock::dumpBytecode): - (JSC::CodeBlock::CodeBlock): - (JSC::CodeBlock::setNumParameters): - (JSC::CodeBlock::shrinkToFit): - (JSC::CodeBlock::shouldOptimizeNow): - * bytecode/CodeBlock.h: - (JSC::CodeBlock::valueProfileForBytecodeOffset): - * bytecode/GetByIdStatus.cpp: - (JSC::GetByIdStatus::computeForChain): - (JSC::GetByIdStatus::computeFor): - * bytecode/LazyOperandValueProfile.cpp: - * bytecode/LazyOperandValueProfile.h: - * bytecode/PutByIdStatus.cpp: - (JSC::PutByIdStatus::computeFor): - * bytecode/ValueProfile.h: - * bytecompiler/BytecodeGenerator.cpp: - (JSC::BytecodeGenerator::newArrayProfile): - (JSC::BytecodeGenerator::newArrayAllocationProfile): - (JSC::BytecodeGenerator::emitProfiledOpcode): - * jit/GPRInfo.h: - * jit/JIT.cpp: - (JSC::JIT::JIT): - (JSC::JIT::privateCompileSlowCases): - (JSC::JIT::privateCompile): - * jit/JIT.h: - * jit/JITArithmetic.cpp: - (JSC::JIT::compileBinaryArithOp): - (JSC::JIT::emit_op_mul): - (JSC::JIT::emit_op_div): - * jit/JITArithmetic32_64.cpp: - (JSC::JIT::emitBinaryDoubleOp): - (JSC::JIT::emit_op_mul): - (JSC::JIT::emitSlow_op_mul): - (JSC::JIT::emit_op_div): - * jit/JITCall.cpp: - (JSC::JIT::emitPutCallResult): - * jit/JITCall32_64.cpp: - (JSC::JIT::emitPutCallResult): - * jit/JITInlines.h: - (JSC::JIT::appendCallWithExceptionCheckSetJSValueResultWithProfile): - (JSC::JIT::emitValueProfilingSite): - (JSC::JIT::emitArrayProfilingSiteForBytecodeIndex): - (JSC::JIT::emitArrayProfileStoreToHoleSpecialCase): - (JSC::JIT::emitArrayProfileOutOfBoundsSpecialCase): - (JSC::arrayProfileSaw): - (JSC::JIT::chooseArrayMode): - * jit/JITOpcodes.cpp: - (JSC::JIT::emit_op_get_argument_by_val): - * jit/JITOpcodes32_64.cpp: - (JSC::JIT::emit_op_get_argument_by_val): - * jit/JITPropertyAccess.cpp: - (JSC::JIT::emit_op_get_by_val): - (JSC::JIT::emitSlow_op_get_by_val): - (JSC::JIT::emit_op_get_by_id): - (JSC::JIT::emit_op_get_from_scope): - * jit/JITPropertyAccess32_64.cpp: - (JSC::JIT::emit_op_get_by_val): - (JSC::JIT::emitSlow_op_get_by_val): - (JSC::JIT::emit_op_get_by_id): - (JSC::JIT::emit_op_get_from_scope): - * llint/LLIntOfflineAsmConfig.h: - * llint/LLIntSlowPaths.cpp: - (JSC::LLInt::LLINT_SLOW_PATH_DECL): - * llint/LowLevelInterpreter.asm: - * llint/LowLevelInterpreter32_64.asm: - * llint/LowLevelInterpreter64.asm: - * profiler/ProfilerBytecodeSequence.cpp: - (JSC::Profiler::BytecodeSequence::BytecodeSequence): - * runtime/CommonSlowPaths.cpp: - -2014-01-06 Filip Pizlo - - LLInt shouldn't check for ENABLE(JIT). - - Rubber stamped by Mark Hahnenberg. - - * llint/LLIntCommon.h: - * llint/LLIntOfflineAsmConfig.h: - * llint/LLIntSlowPaths.cpp: - (JSC::LLInt::entryOSR): - (JSC::LLInt::LLINT_SLOW_PATH_DECL): - * llint/LowLevelInterpreter.asm: - -2014-01-06 Filip Pizlo - - LLInt shouldnt check for ENABLE(JAVASCRIPT_DEBUGGER). - - Rubber stamped by Mark Hahnenberg. - - * debugger/Debugger.h: - (JSC::Debugger::Debugger): - * llint/LLIntOfflineAsmConfig.h: - * llint/LowLevelInterpreter.asm: + * dfg/DFGAbstractInterpreterInlines.h: + (JSC::DFG::AbstractInterpreter::executeEffects): + * tests/stress/use-arguments-as-object-pointer.js: Added. + (foo): 2014-01-05 Sam Weinig diff --git a/JavaScriptCore/DerivedSources.make b/JavaScriptCore/DerivedSources.make index 1156e97f..501b0f19 100644 --- a/JavaScriptCore/DerivedSources.make +++ b/JavaScriptCore/DerivedSources.make @@ -97,7 +97,6 @@ INSPECTOR_GENERATOR_SCRIPTS = \ all : \ InspectorJS.json \ InspectorJSFrontendDispatchers.h \ - InjectedScriptSource.h \ # InspectorJS.json : inspector/scripts/generate-combined-inspector-json.py $(INSPECTOR_DOMAINS) @@ -106,8 +105,3 @@ InspectorJS.json : inspector/scripts/generate-combined-inspector-json.py $(INSPE # Inspector Backend Dispatchers, Frontend Dispatchers, Type Builders InspectorJSFrontendDispatchers.h : InspectorJS.json $(INSPECTOR_GENERATOR_SCRIPTS) python $(JavaScriptCore)/inspector/scripts/CodeGeneratorInspector.py ./InspectorJS.json --output_h_dir . --output_cpp_dir . --output_js_dir . --output_type JavaScript - -InjectedScriptSource.h : inspector/InjectedScriptSource.js $(JavaScriptCore)/inspector/scripts/jsmin.py $(JavaScriptCore)/inspector/scripts/xxd.pl - python $(JavaScriptCore)/inspector/scripts/jsmin.py < $(JavaScriptCore)/inspector/InjectedScriptSource.js > ./InjectedScriptSource.min.js - perl $(JavaScriptCore)/inspector/scripts/xxd.pl InjectedScriptSource_js ./InjectedScriptSource.min.js InjectedScriptSource.h - rm -f ./InjectedScriptSource.min.js diff --git a/JavaScriptCore/GNUmakefile.am b/JavaScriptCore/GNUmakefile.am index 83d6373d..76d5e6be 100644 --- a/JavaScriptCore/GNUmakefile.am +++ b/JavaScriptCore/GNUmakefile.am @@ -59,7 +59,6 @@ javascriptcore_cppflags += \ -I$(srcdir)/Source/JavaScriptCore/ftl \ -I$(srcdir)/Source/JavaScriptCore/heap \ -I$(srcdir)/Source/JavaScriptCore/inspector \ - -I$(srcdir)/Source/JavaScriptCore/inspector/agents \ -I$(srcdir)/Source/JavaScriptCore/interpreter \ -I$(srcdir)/Source/JavaScriptCore/jit \ -I$(srcdir)/Source/JavaScriptCore/llint \ @@ -96,13 +95,11 @@ DerivedSources/JavaScriptCore/KeywordLookup.h: $(srcdir)/Source/JavaScriptCore/K DerivedSources/JavaScriptCore/LLIntDesiredOffsets.h: $(javascriptcore_sources) $(llint_nosources) $(offlineasm_nosources) $(AM_V_GEN)$(RUBY) $(srcdir)/Source/JavaScriptCore/offlineasm/generate_offset_extractor.rb $(srcdir)/Source/JavaScriptCore/llint/LowLevelInterpreter.asm $@ - $(AM_V_at)touch $@ $(Programs_LLIntOffsetsExtractor_OBJECTS): DerivedSources/JavaScriptCore/LLIntDesiredOffsets.h DerivedSources/JavaScriptCore/LLIntAssembly.h: Programs/LLIntOffsetsExtractor$(EXEEXT) $(AM_V_GEN)$(RUBY) $(srcdir)/Source/JavaScriptCore/offlineasm/asm.rb $(srcdir)/Source/JavaScriptCore/llint/LowLevelInterpreter.asm Programs/LLIntOffsetsExtractor$(EXEEXT) $@ - $(AM_V_at)touch $@ $(libjavascriptcoregtk_@WEBKITGTK_API_MAJOR_VERSION@_@WEBKITGTK_API_MINOR_VERSION@_la_OBJECTS): DerivedSources/JavaScriptCore/LLIntAssembly.h @@ -189,18 +186,13 @@ EXTRA_DIST += \ Source/JavaScriptCore/create_regex_tables \ Source/JavaScriptCore/icu/LICENSE \ Source/JavaScriptCore/icu/README \ - Source/JavaScriptCore/inspector/InjectedScriptSource.js \ Source/JavaScriptCore/inspector/protocol/Debugger.json \ Source/JavaScriptCore/inspector/protocol/GenericTypes.json \ Source/JavaScriptCore/inspector/protocol/InspectorDomain.json \ Source/JavaScriptCore/inspector/protocol/Runtime.json \ Source/JavaScriptCore/inspector/scripts/CodeGeneratorInspector.py \ Source/JavaScriptCore/inspector/scripts/CodeGeneratorInspectorStrings.py \ - Source/JavaScriptCore/inspector/scripts/cssmin.py \ Source/JavaScriptCore/inspector/scripts/generate-combined-inspector-json.py \ - Source/JavaScriptCore/inspector/scripts/inline-and-minify-stylesheets-and-scripts.py \ - Source/JavaScriptCore/inspector/scripts/jsmin.py \ - Source/JavaScriptCore/inspector/scripts/xxd.pl \ Source/JavaScriptCore/KeywordLookupGenerator.py \ Source/JavaScriptCore/parser/Keywords.table \ Source/JavaScriptCore/THANKS \ @@ -243,7 +235,6 @@ DerivedSources/JavaScriptCore/InspectorJS.json: $(INSPECTOR_SCRIPTS_DIR)/generat # Copy generated header files to DerivedSources/JavaScriptCore/inspector so that WebCore's ForwardingHeader style of #include will work. DerivedSources/JavaScriptCore/InspectorJSBackendDispatchers.cpp: DerivedSources/JavaScriptCore/InspectorJS.json $(INSPECTOR_SCRIPTS_DIR)/CodeGeneratorInspector.py $(INSPECTOR_SCRIPTS_DIR)/CodeGeneratorInspectorStrings.py $(AM_V_GEN)$(PYTHON) $(INSPECTOR_SCRIPTS_DIR)/CodeGeneratorInspector.py $< --output_h_dir $(GENSOURCES_JAVASCRIPTCORE) --output_cpp_dir $(GENSOURCES_JAVASCRIPTCORE) --output_js_dir $(GENSOURCES_JAVASCRIPTCORE) --output_type JavaScript - $(AM_V_at)touch $@ mkdir -p DerivedSources/JavaScriptCore/inspector cp DerivedSources/JavaScriptCore/InspectorJSTypeBuilders.h DerivedSources/JavaScriptCore/InspectorJSFrontendDispatchers.h DerivedSources/JavaScriptCore/InspectorJSBackendDispatchers.h DerivedSources/JavaScriptCore/inspector DerivedSources/JavaScriptCore/InspectorJSTypeBuilders.h: DerivedSources/JavaScriptCore/InspectorJSTypeBuilders.cpp @@ -252,8 +243,3 @@ DerivedSources/JavaScriptCore/InspectorJSFrontendDispatchers.h: DerivedSources/J DerivedSources/JavaScriptCore/InspectorJSFrontendDispatchers.cpp: DerivedSources/JavaScriptCore/InspectorJSBackendCommands.js DerivedSources/JavaScriptCore/InspectorJSBackendCommands.js: DerivedSources/JavaScriptCore/InspectorJSBackendDispatchers.h DerivedSources/JavaScriptCore/InspectorJSBackendDispatchers.h: DerivedSources/JavaScriptCore/InspectorJSBackendDispatchers.cpp - -DerivedSources/JavaScriptCore/InjectedScriptSource.h: $(JavaScriptCore)/inspector/InjectedScriptSource.js $(INSPECTOR_SCRIPTS_DIR)/xxd.pl $(INSPECTOR_SCRIPTS_DIR)/jsmin.py - $(AM_V_GEN)$(PYTHON) $(INSPECTOR_SCRIPTS_DIR)/jsmin.py < $< > $(GENSOURCES_JAVASCRIPTCORE)/InjectedScriptSource.min.js - $(AM_V_at)$(PERL) $(INSPECTOR_SCRIPTS_DIR)/xxd.pl InjectedScriptSource_js $(GENSOURCES_JAVASCRIPTCORE)/InjectedScriptSource.min.js $@ - $(AM_V_at)rm -rf $(GENSOURCES_JAVASCRIPTCORE)/InjectedScriptSource.min.js diff --git a/JavaScriptCore/GNUmakefile.list.am b/JavaScriptCore/GNUmakefile.list.am index 8544ead4..b27df099 100644 --- a/JavaScriptCore/GNUmakefile.list.am +++ b/JavaScriptCore/GNUmakefile.list.am @@ -8,7 +8,6 @@ javascriptcore_h_api += \ Source/JavaScriptCore/API/WebKitAvailability.h javascriptcore_built_nosources += \ - DerivedSources/JavaScriptCore/InjectedScriptSource.h \ DerivedSources/JavaScriptCore/KeywordLookup.h \ DerivedSources/JavaScriptCore/Lexer.lut.h \ DerivedSources/JavaScriptCore/RegExpJitTables.h \ @@ -212,8 +211,6 @@ javascriptcore_sources += \ Source/JavaScriptCore/dfg/DFGArgumentPosition.h \ Source/JavaScriptCore/dfg/DFGArgumentsSimplificationPhase.cpp \ Source/JavaScriptCore/dfg/DFGArgumentsSimplificationPhase.h \ - Source/JavaScriptCore/dfg/DFGArithMode.cpp \ - Source/JavaScriptCore/dfg/DFGArithMode.h \ Source/JavaScriptCore/dfg/DFGArrayMode.cpp \ Source/JavaScriptCore/dfg/DFGArrayMode.h \ Source/JavaScriptCore/dfg/DFGArrayifySlowPathGenerator.h \ @@ -628,32 +625,15 @@ javascriptcore_sources += \ Source/JavaScriptCore/icu/unicode/utf_old.h \ Source/JavaScriptCore/icu/unicode/utypes.h \ Source/JavaScriptCore/icu/unicode/uversion.h \ - Source/JavaScriptCore/inspector/InjectedScript.cpp \ - Source/JavaScriptCore/inspector/InjectedScript.h \ - Source/JavaScriptCore/inspector/InjectedScriptBase.cpp \ - Source/JavaScriptCore/inspector/InjectedScriptBase.h \ - Source/JavaScriptCore/inspector/InjectedScriptHost.cpp \ - Source/JavaScriptCore/inspector/InjectedScriptHost.h \ - Source/JavaScriptCore/inspector/InjectedScriptManager.cpp \ - Source/JavaScriptCore/inspector/InjectedScriptManager.h \ - Source/JavaScriptCore/inspector/InjectedScriptModule.cpp \ - Source/JavaScriptCore/inspector/InjectedScriptModule.h \ Source/JavaScriptCore/inspector/InspectorAgentBase.h \ Source/JavaScriptCore/inspector/InspectorAgentRegistry.cpp \ Source/JavaScriptCore/inspector/InspectorAgentRegistry.h \ Source/JavaScriptCore/inspector/InspectorBackendDispatcher.cpp \ Source/JavaScriptCore/inspector/InspectorBackendDispatcher.h \ - Source/JavaScriptCore/inspector/InspectorEnvironment.h \ Source/JavaScriptCore/inspector/InspectorFrontendChannel.h \ Source/JavaScriptCore/inspector/InspectorTypeBuilder.h \ Source/JavaScriptCore/inspector/InspectorValues.cpp \ Source/JavaScriptCore/inspector/InspectorValues.h \ - Source/JavaScriptCore/inspector/JSInjectedScriptHost.cpp \ - Source/JavaScriptCore/inspector/JSInjectedScriptHost.h \ - Source/JavaScriptCore/inspector/JSInjectedScriptHostPrototype.cpp \ - Source/JavaScriptCore/inspector/JSInjectedScriptHostPrototype.h \ - Source/JavaScriptCore/inspector/agents/InspectorAgent.h \ - Source/JavaScriptCore/inspector/agents/InspectorAgent.cpp \ Source/JavaScriptCore/interpreter/AbstractPC.cpp \ Source/JavaScriptCore/interpreter/AbstractPC.h \ Source/JavaScriptCore/interpreter/CachedCall.h \ diff --git a/JavaScriptCore/JSTypedArray.cpp b/JavaScriptCore/JSTypedArray.cpp new file mode 100644 index 00000000..e0fed0bb --- /dev/null +++ b/JavaScriptCore/JSTypedArray.cpp @@ -0,0 +1,132 @@ + +#include "config.h" + +#include "JSTypedArray.h" + +#include "JSObjectRef.h" +#include "APICast.h" +#include "InitializeThreading.h" +#include "JSCallbackObject.h" +#include "JSClassRef.h" +#include "JSGlobalObject.h" + +#include "JSArrayBuffer.h" +#include "JSFloat32Array.h" +#include "JSFloat64Array.h" +#include "JSInt8Array.h" +#include "JSInt16Array.h" +#include "JSInt32Array.h" +#include "JSUint8ClampedArray.h" +#include "JSUint8Array.h" +#include "JSUint16Array.h" +#include "JSUint32Array.h" + +#include "TypedArrayInlines.h" + +using namespace JSC; + +// Better be safe than sorry! +const JSTypedArrayType TypedArrayTypes[] = { + [NotTypedArray] = kJSTypedArrayTypeNone, + [TypeInt8] = kJSTypedArrayTypeInt8Array, + [TypeUint8] = kJSTypedArrayTypeUint8Array, + [TypeUint8Clamped] = kJSTypedArrayTypeUint8ClampedArray, + [TypeInt16] = kJSTypedArrayTypeInt16Array, + [TypeUint16] = kJSTypedArrayTypeUint16Array, + [TypeInt32] = kJSTypedArrayTypeInt32Array, + [TypeUint32] = kJSTypedArrayTypeUint32Array, + [TypeFloat32] = kJSTypedArrayTypeFloat32Array, + [TypeFloat64] = kJSTypedArrayTypeFloat64Array, + /* not a TypedArray */ kJSTypedArrayTypeArrayBuffer +}; + +const int kJSTypedArrayTypeLast = kJSTypedArrayTypeArrayBuffer; + + +template JSObject * CreateTypedArray(JSC::ExecState* exec, size_t length) { + return ArrayType::create(length)->wrap(exec, exec->lexicalGlobalObject()); +} + +template JSObject * CreateArrayBuffer(JSC::ExecState* exec, size_t length) { + RefPtr buffer = BufferType::create(length, 1); + if( !buffer ) { + return NULL; + } + + JSArrayBuffer* result = JSArrayBuffer::create( + exec->vm(), exec->lexicalGlobalObject()->arrayBufferStructure(), buffer); + return result; +} + +typedef JSObject*(*CreateTypedArrayFuncPtr)(JSC::ExecState*, size_t); +const CreateTypedArrayFuncPtr CreateTypedArrayFunc[] = { + [kJSTypedArrayTypeNone] = NULL, + [kJSTypedArrayTypeInt8Array] = CreateTypedArray, + [kJSTypedArrayTypeInt16Array] = CreateTypedArray, + [kJSTypedArrayTypeInt32Array] = CreateTypedArray, + [kJSTypedArrayTypeUint8Array] = CreateTypedArray, + [kJSTypedArrayTypeUint8ClampedArray] = CreateTypedArray, + [kJSTypedArrayTypeUint16Array] = CreateTypedArray, + [kJSTypedArrayTypeUint32Array] = CreateTypedArray, + [kJSTypedArrayTypeFloat32Array] = CreateTypedArray, + [kJSTypedArrayTypeFloat64Array] = CreateTypedArray, + [kJSTypedArrayTypeArrayBuffer] = CreateArrayBuffer, +}; + + + + +JSTypedArrayType JSTypedArrayGetType(JSContextRef ctx, JSValueRef value) { + ExecState* exec = toJS(ctx); + APIEntryShim entryShim(exec); + + JSValue jsValue = toJS(exec, value); + JSTypedArrayType type = kJSTypedArrayTypeNone; + if( jsValue.inherits(JSArrayBufferView::info()) ) { + JSObject* object = jsValue.getObject(); + type = TypedArrayTypes[object->classInfo()->typedArrayStorageType]; + } + else if( jsValue.inherits(JSArrayBuffer::info()) ) { + type = kJSTypedArrayTypeArrayBuffer; + } + return type; +} + +JSObjectRef JSTypedArrayMake(JSContextRef ctx, JSTypedArrayType arrayType, size_t numElements) { + ExecState* exec = toJS(ctx); + APIEntryShim entryShim(exec); + + JSObject* result = NULL; + if( arrayType > kJSTypedArrayTypeNone && arrayType <= kJSTypedArrayTypeLast ) { + result = CreateTypedArrayFunc[arrayType]( exec, numElements ); + } + + return toRef(result); +} + +void * JSTypedArrayGetDataPtr(JSContextRef ctx, JSValueRef value, size_t * byteLength) { + ExecState* exec = toJS(ctx); + APIEntryShim entryShim(exec); + + JSValue jsValue = toJS(exec, value); + if( JSArrayBufferView * view = jsDynamicCast(jsValue) ) { + if( byteLength ) { + *byteLength = view->impl()->byteLength(); + } + return view->impl()->baseAddress(); + } + else if( ArrayBuffer * buffer = toArrayBuffer(jsValue) ) { + if( byteLength ) { + *byteLength = buffer->byteLength(); + } + return buffer->data(); + } + + if( byteLength ) { + *byteLength = 0; + } + return NULL; +} + + + diff --git a/JavaScriptCore/JSTypedArray.h b/JavaScriptCore/JSTypedArray.h new file mode 100644 index 00000000..ea7f30a6 --- /dev/null +++ b/JavaScriptCore/JSTypedArray.h @@ -0,0 +1,73 @@ +#ifndef JSTypedArray_h +#define JSTypedArray_h + +#include + +#ifdef __cplusplus +extern "C" { +#endif + +/*! +@enum JSType +@abstract A constant identifying the Typed Array type of a JSValue. +@constant kJSTypedArrayTypeNone Not a Typed Array. +@constant kJSTypedArrayTypeInt8Array Int8Array +@constant kJSTypedArrayTypeInt16Array Int16Array +@constant kJSTypedArrayTypeInt32Array Int32Array +@constant kJSTypedArrayTypeUint8Array Int8Array +@constant kJSTypedArrayTypeUint8ClampedArray Int8ClampedArray +@constant kJSTypedArrayTypeUint16Array Uint16Array +@constant kJSTypedArrayTypeUint32Array Uint32Array +@constant kJSTypedArrayTypeFloat32Array Float32Array +@constant kJSTypedArrayTypeFloat64Array Float64Array +@constant kJSTypedArrayTypeArrayBuffer ArrayBuffer +*/ +typedef enum { + kJSTypedArrayTypeNone, + kJSTypedArrayTypeInt8Array, + kJSTypedArrayTypeInt16Array, + kJSTypedArrayTypeInt32Array, + kJSTypedArrayTypeUint8Array, + kJSTypedArrayTypeUint8ClampedArray, + kJSTypedArrayTypeUint16Array, + kJSTypedArrayTypeUint32Array, + kJSTypedArrayTypeFloat32Array, + kJSTypedArrayTypeFloat64Array, + kJSTypedArrayTypeArrayBuffer +} JSTypedArrayType; + +/*! +@function +@abstract Returns a JavaScript value's Typed Array type +@param ctx The execution context to use. +@param value The JSValue whose Typed Array type you want to obtain. +@result A value of type JSTypedArrayType that identifies value's Typed Array type. +*/ +JS_EXPORT JSTypedArrayType JSTypedArrayGetType(JSContextRef ctx, JSValueRef value); + +/*! +@function +@abstract Creates a JavaScript Typed Array with the given number of elements +@param ctx The execution context to use. +@param arrayType A value of type JSTypedArrayType identifying the type of array you want to create +@param numElements The number of elements for the array. +@result A JSObjectRef that is a Typed Array or NULL if there was an error +*/ +JS_EXPORT JSObjectRef JSTypedArrayMake(JSContextRef ctx, JSTypedArrayType arrayType, size_t numElements); + +/*! +@function +@abstract Returns a pointer to a Typed Array's data in memory +@param ctx The execution context to use. +@param value The JSValue whose Typed Array type data pointer you want to obtain. +@param byteLength A pointer to a size_t in which to store the byte length of the Typed Array +@result A pointer to the Typed Array's data or NULL if the JSValue is not a Typed Array +*/ +JS_EXPORT void * JSTypedArrayGetDataPtr(JSContextRef ctx, JSValueRef value, size_t * byteLength); + + +#ifdef __cplusplus +} +#endif + +#endif /* JSTypedArray_h */ diff --git a/JavaScriptCore/JavaScriptCore.vcxproj/JavaScriptCore.vcxproj b/JavaScriptCore/JavaScriptCore.vcxproj/JavaScriptCore.vcxproj index bc253da2..7c67ba7c 100644 --- a/JavaScriptCore/JavaScriptCore.vcxproj/JavaScriptCore.vcxproj +++ b/JavaScriptCore/JavaScriptCore.vcxproj/JavaScriptCore.vcxproj @@ -351,7 +351,6 @@ - @@ -475,17 +474,9 @@ - - - - - - - - @@ -720,7 +711,6 @@ - @@ -859,7 +849,6 @@ - @@ -1041,21 +1030,12 @@ - - - - - - - - - diff --git a/JavaScriptCore/JavaScriptCore.vcxproj/JavaScriptCore.vcxproj.filters b/JavaScriptCore/JavaScriptCore.vcxproj/JavaScriptCore.vcxproj.filters index 2f322da3..11e14a53 100644 --- a/JavaScriptCore/JavaScriptCore.vcxproj/JavaScriptCore.vcxproj.filters +++ b/JavaScriptCore/JavaScriptCore.vcxproj/JavaScriptCore.vcxproj.filters @@ -294,9 +294,6 @@ inspector - - inspector - interpreter @@ -1787,9 +1784,6 @@ inspector - - inspector - interpreter diff --git a/JavaScriptCore/JavaScriptCore.vcxproj/copy-files.cmd b/JavaScriptCore/JavaScriptCore.vcxproj/copy-files.cmd index 943343a5..2b83fa68 100755 --- a/JavaScriptCore/JavaScriptCore.vcxproj/copy-files.cmd +++ b/JavaScriptCore/JavaScriptCore.vcxproj/copy-files.cmd @@ -47,7 +47,6 @@ for %%d in ( heap debugger inspector - inspector\agents interpreter jit llint @@ -63,7 +62,7 @@ echo Copying Inspector scripts as if they were private headers... for %%d in ( inspector\scripts ) do ( - xcopy /y /d ..\%%d\* "%PrivateHeadersDirectory%" >NUL + xcopy /y /d ..\%%d\*.py "%PrivateHeadersDirectory%" >NUL ) echo Copying Inspector generated files as if they were private headers... diff --git a/JavaScriptCore/JavaScriptCore.xcodeproj/project.pbxproj b/JavaScriptCore/JavaScriptCore.xcodeproj/project.pbxproj index 2cda0d5b..9ae1befb 100644 --- a/JavaScriptCore/JavaScriptCore.xcodeproj/project.pbxproj +++ b/JavaScriptCore/JavaScriptCore.xcodeproj/project.pbxproj @@ -247,8 +247,6 @@ 0F4680D314BBD16700BFE272 /* LLIntData.h in Headers */ = {isa = PBXBuildFile; fileRef = 0F4680CF14BBB3D100BFE272 /* LLIntData.h */; settings = {ATTRIBUTES = (Private, ); }; }; 0F4680D414BBD24900BFE272 /* HostCallReturnValue.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 0F4680D014BBC5F800BFE272 /* HostCallReturnValue.cpp */; }; 0F4680D514BBD24B00BFE272 /* HostCallReturnValue.h in Headers */ = {isa = PBXBuildFile; fileRef = 0F4680D114BBC5F800BFE272 /* HostCallReturnValue.h */; settings = {ATTRIBUTES = (Private, ); }; }; - 0F485321187750560083B687 /* DFGArithMode.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 0F48531F187750560083B687 /* DFGArithMode.cpp */; }; - 0F485322187750560083B687 /* DFGArithMode.h in Headers */ = {isa = PBXBuildFile; fileRef = 0F485320187750560083B687 /* DFGArithMode.h */; settings = {ATTRIBUTES = (Private, ); }; }; 0F493AFA16D0CAD30084508B /* SourceProvider.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 0F493AF816D0CAD10084508B /* SourceProvider.cpp */; }; 0F4B94DC17B9F07500DD03A4 /* TypedArrayInlines.h in Headers */ = {isa = PBXBuildFile; fileRef = 0F4B94DB17B9F07500DD03A4 /* TypedArrayInlines.h */; settings = {ATTRIBUTES = (Private, ); }; }; 0F5541B11613C1FB00CE3E25 /* SpecialPointer.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 0F5541AF1613C1FB00CE3E25 /* SpecialPointer.cpp */; }; @@ -582,7 +580,6 @@ 10D58E161889C3DF00C05A0D /* AbstractPC.h in Headers */ = {isa = PBXBuildFile; fileRef = 0F55F0F214D1063600AC7649 /* AbstractPC.h */; settings = {ATTRIBUTES = (Private, ); }; }; 10D58E171889C3DF00C05A0D /* APICallbackFunction.h in Headers */ = {isa = PBXBuildFile; fileRef = C211B574176A224D000E2A23 /* APICallbackFunction.h */; }; 10D58E181889C3DF00C05A0D /* APICast.h in Headers */ = {isa = PBXBuildFile; fileRef = 1482B78A0A4305AB00517CFC /* APICast.h */; settings = {ATTRIBUTES = (Private, ); }; }; - 10D58E191889C3DF00C05A0D /* InspectorJSTypeBuilders.h in Headers */ = {isa = PBXBuildFile; fileRef = A532438618568317002ED692 /* InspectorJSTypeBuilders.h */; settings = {ATTRIBUTES = (Private, ); }; }; 10D58E1A1889C3DF00C05A0D /* APIShims.h in Headers */ = {isa = PBXBuildFile; fileRef = 865F408710E7D56300947361 /* APIShims.h */; settings = {ATTRIBUTES = (Private, ); }; }; 10D58E1B1889C3DF00C05A0D /* ArgList.h in Headers */ = {isa = PBXBuildFile; fileRef = BCF605120E203EF800B9A64D /* ArgList.h */; settings = {ATTRIBUTES = (Private, ); }; }; 10D58E1C1889C3DF00C05A0D /* Arguments.h in Headers */ = {isa = PBXBuildFile; fileRef = BC257DE60E1F51C50016B6C9 /* Arguments.h */; }; @@ -590,7 +587,6 @@ 10D58E1E1889C3DF00C05A0D /* ArgumentsIteratorPrototype.h in Headers */ = {isa = PBXBuildFile; fileRef = A76140CA182982CB00750624 /* ArgumentsIteratorPrototype.h */; }; 10D58E1F1889C3DF00C05A0D /* ARMAssembler.h in Headers */ = {isa = PBXBuildFile; fileRef = 86D3B2C010156BDE002865E7 /* ARMAssembler.h */; settings = {ATTRIBUTES = (Private, ); }; }; 10D58E201889C3DF00C05A0D /* ARMv7Assembler.h in Headers */ = {isa = PBXBuildFile; fileRef = 86ADD1430FDDEA980006EEC2 /* ARMv7Assembler.h */; settings = {ATTRIBUTES = (Private, ); }; }; - 10D58E211889C3DF00C05A0D /* InspectorAgent.h in Headers */ = {isa = PBXBuildFile; fileRef = A5CEEE13187F3BAD00E55C99 /* InspectorAgent.h */; settings = {ATTRIBUTES = (Private, ); }; }; 10D58E221889C3DF00C05A0D /* ARMv7DOpcode.h in Headers */ = {isa = PBXBuildFile; fileRef = 65C0285B1717966800351E35 /* ARMv7DOpcode.h */; }; 10D58E231889C3DF00C05A0D /* CopyWriteBarrier.h in Headers */ = {isa = PBXBuildFile; fileRef = 2A68295A1875F80500B6C3E2 /* CopyWriteBarrier.h */; settings = {ATTRIBUTES = (Private, ); }; }; 10D58E241889C3DF00C05A0D /* WriteBarrierBuffer.h in Headers */ = {isa = PBXBuildFile; fileRef = 2A4EC90A1860D6C20094F782 /* WriteBarrierBuffer.h */; settings = {ATTRIBUTES = (Private, ); }; }; @@ -599,15 +595,10 @@ 10D58E271889C3DF00C05A0D /* CodeGeneratorInspector.py in Headers */ = {isa = PBXBuildFile; fileRef = A532438F185696E6002ED692 /* CodeGeneratorInspector.py */; settings = {ATTRIBUTES = (Private, ); }; }; 10D58E281889C3DF00C05A0D /* TempRegisterSet.h in Headers */ = {isa = PBXBuildFile; fileRef = 0F24E54817EE274900ABB217 /* TempRegisterSet.h */; settings = {ATTRIBUTES = (Private, ); }; }; 10D58E291889C3DF00C05A0D /* DFGFiltrationResult.h in Headers */ = {isa = PBXBuildFile; fileRef = A7BFF3BF179868940002F462 /* DFGFiltrationResult.h */; settings = {ATTRIBUTES = (Private, ); }; }; - 10D58E2A1889C3DF00C05A0D /* cssmin.py in Headers */ = {isa = PBXBuildFile; fileRef = A5840E26187C980700843B10 /* cssmin.py */; settings = {ATTRIBUTES = (Private, ); }; }; 10D58E2B1889C3DF00C05A0D /* BytecodeBasicBlock.h in Headers */ = {isa = PBXBuildFile; fileRef = C2FCAE0D17A9C24E0034C735 /* BytecodeBasicBlock.h */; settings = {ATTRIBUTES = (Private, ); }; }; 10D58E2C1889C3DF00C05A0D /* generate-combined-inspector-json.py in Headers */ = {isa = PBXBuildFile; fileRef = A5324391185696E6002ED692 /* generate-combined-inspector-json.py */; settings = {ATTRIBUTES = (Private, ); }; }; 10D58E2D1889C3DF00C05A0D /* BytecodeLivenessAnalysis.h in Headers */ = {isa = PBXBuildFile; fileRef = C2FCAE0F17A9C24E0034C735 /* BytecodeLivenessAnalysis.h */; settings = {ATTRIBUTES = (Private, ); }; }; 10D58E2E1889C3DF00C05A0D /* ArrayAllocationProfile.h in Headers */ = {isa = PBXBuildFile; fileRef = 0F8335B51639C1E3001443B5 /* ArrayAllocationProfile.h */; settings = {ATTRIBUTES = (Private, ); }; }; - 10D58E2F1889C3DF00C05A0D /* inline-and-minify-stylesheets-and-scripts.py in Headers */ = {isa = PBXBuildFile; fileRef = A5840E28187CA5B800843B10 /* inline-and-minify-stylesheets-and-scripts.py */; settings = {ATTRIBUTES = (Private, ); }; }; - 10D58E301889C3DF00C05A0D /* jsmin.py in Headers */ = {isa = PBXBuildFile; fileRef = A513E5C4185F92DC007E95AD /* jsmin.py */; settings = {ATTRIBUTES = (Private, ); }; }; - 10D58E311889C3DF00C05A0D /* InspectorJS.json in Headers */ = {isa = PBXBuildFile; fileRef = A53243951856A475002ED692 /* InspectorJS.json */; settings = {ATTRIBUTES = (Private, ); }; }; - 10D58E321889C3DF00C05A0D /* xxd.pl in Headers */ = {isa = PBXBuildFile; fileRef = A513E5C5185F92F0007E95AD /* xxd.pl */; settings = {ATTRIBUTES = (Private, ); }; }; 10D58E331889C3DF00C05A0D /* Breakpoint.h in Headers */ = {isa = PBXBuildFile; fileRef = FEA0861E182B7A0400F6D851 /* Breakpoint.h */; settings = {ATTRIBUTES = (Private, ); }; }; 10D58E341889C3DF00C05A0D /* ArrayBuffer.h in Headers */ = {isa = PBXBuildFile; fileRef = A7A8AF2617ADB5F3005AB174 /* ArrayBuffer.h */; settings = {ATTRIBUTES = (Private, ); }; }; 10D58E351889C3DF00C05A0D /* DebuggerPrimitives.h in Headers */ = {isa = PBXBuildFile; fileRef = FEA0861F182B7A0400F6D851 /* DebuggerPrimitives.h */; settings = {ATTRIBUTES = (Private, ); }; }; @@ -661,7 +652,6 @@ 10D58E651889C3DF00C05A0D /* CompilationResult.h in Headers */ = {isa = PBXBuildFile; fileRef = A7E5A3A61797432D00E893C0 /* CompilationResult.h */; settings = {ATTRIBUTES = (Private, ); }; }; 10D58E661889C3DF00C05A0D /* Completion.h in Headers */ = {isa = PBXBuildFile; fileRef = F5BB2BC5030F772101FCFE1D /* Completion.h */; settings = {ATTRIBUTES = (Private, ); }; }; 10D58E671889C3DF00C05A0D /* ConcurrentJITLock.h in Headers */ = {isa = PBXBuildFile; fileRef = 0FDB2CE9174896C7007B3C1B /* ConcurrentJITLock.h */; settings = {ATTRIBUTES = (Private, ); }; }; - 10D58E681889C3DF00C05A0D /* JSInjectedScriptHostPrototype.h in Headers */ = {isa = PBXBuildFile; fileRef = A513E5BD185BFACC007E95AD /* JSInjectedScriptHostPrototype.h */; }; 10D58E691889C3DF00C05A0D /* config.h in Headers */ = {isa = PBXBuildFile; fileRef = F68EBB8C0255D4C601FF60F7 /* config.h */; settings = {ATTRIBUTES = (Private, ); }; }; 10D58E6A1889C3DF00C05A0D /* ConservativeRoots.h in Headers */ = {isa = PBXBuildFile; fileRef = 149DAAF212EB559D0083B12B /* ConservativeRoots.h */; settings = {ATTRIBUTES = (Private, ); }; }; 10D58E6B1889C3DF00C05A0D /* ConstructData.h in Headers */ = {isa = PBXBuildFile; fileRef = BC8F3CCF0DAF17BA00577A80 /* ConstructData.h */; settings = {ATTRIBUTES = (Private, ); }; }; @@ -816,9 +806,7 @@ 10D58F001889C3DF00C05A0D /* DFGVariableAccessDataDump.h in Headers */ = {isa = PBXBuildFile; fileRef = 0FDDBFB31666EED500C55FEF /* DFGVariableAccessDataDump.h */; settings = {ATTRIBUTES = (Private, ); }; }; 10D58F011889C3DF00C05A0D /* DFGVariableEvent.h in Headers */ = {isa = PBXBuildFile; fileRef = 0F2BDC411522801700CD8910 /* DFGVariableEvent.h */; settings = {ATTRIBUTES = (Private, ); }; }; 10D58F021889C3DF00C05A0D /* DFGVariableEventStream.h in Headers */ = {isa = PBXBuildFile; fileRef = 0F2BDC431522801700CD8910 /* DFGVariableEventStream.h */; settings = {ATTRIBUTES = (Private, ); }; }; - 10D58F031889C3DF00C05A0D /* InjectedScriptBase.h in Headers */ = {isa = PBXBuildFile; fileRef = A514B2C1185A684400F3C7CB /* InjectedScriptBase.h */; settings = {ATTRIBUTES = (Private, ); }; }; 10D58F041889C3DF00C05A0D /* DFGVariadicFunction.h in Headers */ = {isa = PBXBuildFile; fileRef = 0F85A31E16AB76AE0077571E /* DFGVariadicFunction.h */; settings = {ATTRIBUTES = (Private, ); }; }; - 10D58F051889C3DF00C05A0D /* InspectorEnvironment.h in Headers */ = {isa = PBXBuildFile; fileRef = A5D0A1BA1862301B00C7B496 /* InspectorEnvironment.h */; settings = {ATTRIBUTES = (Private, ); }; }; 10D58F061889C3DF00C05A0D /* DFGVirtualRegisterAllocationPhase.h in Headers */ = {isa = PBXBuildFile; fileRef = 0FFFC95414EF909500C72532 /* DFGVirtualRegisterAllocationPhase.h */; settings = {ATTRIBUTES = (Private, ); }; }; 10D58F071889C3DF00C05A0D /* DFGWatchpointCollectionPhase.h in Headers */ = {isa = PBXBuildFile; fileRef = 0FC97F3C18202119002C9B26 /* DFGWatchpointCollectionPhase.h */; settings = {ATTRIBUTES = (Private, ); }; }; 10D58F081889C3DF00C05A0D /* DFGWorklist.h in Headers */ = {isa = PBXBuildFile; fileRef = 0FDB2CE6174830A2007B3C1B /* DFGWorklist.h */; settings = {ATTRIBUTES = (Private, ); }; }; @@ -1027,7 +1015,6 @@ 10D58FD31889C3DF00C05A0D /* JSScriptRefPrivate.h in Headers */ = {isa = PBXBuildFile; fileRef = A7C0C4AB167C08CD0017011D /* JSScriptRefPrivate.h */; settings = {ATTRIBUTES = (Private, ); }; }; 10D58FD41889C3DF00C05A0D /* JSSegmentedVariableObject.h in Headers */ = {isa = PBXBuildFile; fileRef = 0F919D0F157F3327004A4E7D /* JSSegmentedVariableObject.h */; settings = {ATTRIBUTES = (Private, ); }; }; 10D58FD51889C3DF00C05A0D /* JSSet.h in Headers */ = {isa = PBXBuildFile; fileRef = A7299D9C17D12837005F5FF9 /* JSSet.h */; settings = {ATTRIBUTES = (Private, ); }; }; - 10D58FD61889C3DF00C05A0D /* DFGArithMode.h in Headers */ = {isa = PBXBuildFile; fileRef = 0F485320187750560083B687 /* DFGArithMode.h */; settings = {ATTRIBUTES = (Private, ); }; }; 10D58FD71889C3DF00C05A0D /* JSStack.h in Headers */ = {isa = PBXBuildFile; fileRef = 14D792640DAA03FB001A9F05 /* JSStack.h */; settings = {ATTRIBUTES = (Private, ); }; }; 10D58FD81889C3DF00C05A0D /* JSStackInlines.h in Headers */ = {isa = PBXBuildFile; fileRef = A7C1EAEB17987AB600299DB2 /* JSStackInlines.h */; }; 10D58FD91889C3DF00C05A0D /* JSString.h in Headers */ = {isa = PBXBuildFile; fileRef = F692A8620255597D01FF60F7 /* JSString.h */; settings = {ATTRIBUTES = (Private, ); }; }; @@ -1067,7 +1054,6 @@ 10D58FFB1889C3DF00C05A0D /* LegacyProfiler.h in Headers */ = {isa = PBXBuildFile; fileRef = 95AB832F0DA42CAD00BC83F3 /* LegacyProfiler.h */; settings = {ATTRIBUTES = (Private, ); }; }; 10D58FFC1889C3DF00C05A0D /* Lexer.h in Headers */ = {isa = PBXBuildFile; fileRef = F692A8660255597D01FF60F7 /* Lexer.h */; settings = {ATTRIBUTES = (Private, ); }; }; 10D58FFD1889C3DF00C05A0D /* Lexer.lut.h in Headers */ = {isa = PBXBuildFile; fileRef = BC18C52D0E16FCE100B34460 /* Lexer.lut.h */; }; - 10D58FFE1889C3DF00C05A0D /* InjectedScriptManager.h in Headers */ = {isa = PBXBuildFile; fileRef = A513E5C9185F9624007E95AD /* InjectedScriptManager.h */; settings = {ATTRIBUTES = (Private, ); }; }; 10D58FFF1889C3DF00C05A0D /* LineInfo.h in Headers */ = {isa = PBXBuildFile; fileRef = 0F0B83AC14BCF60200885B4F /* LineInfo.h */; settings = {ATTRIBUTES = (Private, ); }; }; 10D590001889C3DF00C05A0D /* LinkBuffer.h in Headers */ = {isa = PBXBuildFile; fileRef = 86D3B3C110159D7F002865E7 /* LinkBuffer.h */; settings = {ATTRIBUTES = (Private, ); }; }; 10D590011889C3DF00C05A0D /* ListableHandler.h in Headers */ = {isa = PBXBuildFile; fileRef = 0F431736146BAC65007E3890 /* ListableHandler.h */; settings = {ATTRIBUTES = (Private, ); }; }; @@ -1096,7 +1082,6 @@ 10D590181889C3DF00C05A0D /* MacroAssemblerARM.h in Headers */ = {isa = PBXBuildFile; fileRef = 86D3B2C210156BDE002865E7 /* MacroAssemblerARM.h */; settings = {ATTRIBUTES = (Private, ); }; }; 10D590191889C3DF00C05A0D /* MacroAssemblerARMv7.h in Headers */ = {isa = PBXBuildFile; fileRef = 86ADD1440FDDEA980006EEC2 /* MacroAssemblerARMv7.h */; settings = {ATTRIBUTES = (Private, ); }; }; 10D5901A1889C3DF00C05A0D /* MacroAssemblerCodeRef.h in Headers */ = {isa = PBXBuildFile; fileRef = 863B23DF0FC60E6200703AA4 /* MacroAssemblerCodeRef.h */; settings = {ATTRIBUTES = (Private, ); }; }; - 10D5901B1889C3DF00C05A0D /* InspectorJSFrontendDispatchers.h in Headers */ = {isa = PBXBuildFile; fileRef = A532438418568317002ED692 /* InspectorJSFrontendDispatchers.h */; settings = {ATTRIBUTES = (Private, ); }; }; 10D5901C1889C3DF00C05A0D /* MacroAssemblerMIPS.h in Headers */ = {isa = PBXBuildFile; fileRef = 86C568DE11A213EE0007F7F0 /* MacroAssemblerMIPS.h */; settings = {ATTRIBUTES = (Private, ); }; }; 10D5901D1889C3DF00C05A0D /* MacroAssemblerSH4.h in Headers */ = {isa = PBXBuildFile; fileRef = 86AE64A6135E5E1C00963012 /* MacroAssemblerSH4.h */; settings = {ATTRIBUTES = (Private, ); }; }; 10D5901E1889C3DF00C05A0D /* MacroAssemblerX86.h in Headers */ = {isa = PBXBuildFile; fileRef = 860161E00F3A83C100F84710 /* MacroAssemblerX86.h */; settings = {ATTRIBUTES = (Private, ); }; }; @@ -1106,7 +1091,6 @@ 10D590221889C3DF00C05A0D /* MapData.h in Headers */ = {isa = PBXBuildFile; fileRef = A78507D517CBC6FD0011F6E7 /* MapData.h */; settings = {ATTRIBUTES = (Private, ); }; }; 10D590231889C3DF00C05A0D /* MapPrototype.h in Headers */ = {isa = PBXBuildFile; fileRef = A700873C17CBE8D300C3E643 /* MapPrototype.h */; }; 10D590241889C3DF00C05A0D /* MarkedAllocator.h in Headers */ = {isa = PBXBuildFile; fileRef = C2B916C114DA014E00CBAC86 /* MarkedAllocator.h */; settings = {ATTRIBUTES = (Private, ); }; }; - 10D590251889C3DF00C05A0D /* JSGlobalObjectInspectorController.h in Headers */ = {isa = PBXBuildFile; fileRef = A51007BF187CC3C600B38879 /* JSGlobalObjectInspectorController.h */; }; 10D590261889C3DF00C05A0D /* MarkedBlock.h in Headers */ = {isa = PBXBuildFile; fileRef = 142D6F0713539A2800B02E86 /* MarkedBlock.h */; settings = {ATTRIBUTES = (Private, ); }; }; 10D590271889C3DF00C05A0D /* MarkedBlockSet.h in Headers */ = {isa = PBXBuildFile; fileRef = 141448CA13A176EC00F5BA1A /* MarkedBlockSet.h */; settings = {ATTRIBUTES = (Private, ); }; }; 10D590281889C3DF00C05A0D /* MarkedSpace.h in Headers */ = {isa = PBXBuildFile; fileRef = 14D2F3D9139F4BE200491031 /* MarkedSpace.h */; settings = {ATTRIBUTES = (Private, ); }; }; @@ -1114,7 +1098,6 @@ 10D5902A1889C3DF00C05A0D /* MarkStackInlines.h in Headers */ = {isa = PBXBuildFile; fileRef = C21122E015DD9AB300790E3A /* MarkStackInlines.h */; settings = {ATTRIBUTES = (Private, ); }; }; 10D5902B1889C3DF00C05A0D /* InspectorFrontendChannel.h in Headers */ = {isa = PBXBuildFile; fileRef = A5945594182479EB00CC3843 /* InspectorFrontendChannel.h */; settings = {ATTRIBUTES = (Private, ); }; }; 10D5902C1889C3DF00C05A0D /* MatchResult.h in Headers */ = {isa = PBXBuildFile; fileRef = 8612E4CB1522918400C836BE /* MatchResult.h */; settings = {ATTRIBUTES = (Private, ); }; }; - 10D5902D1889C3DF00C05A0D /* InjectedScriptModule.h in Headers */ = {isa = PBXBuildFile; fileRef = A5840E1F187B7B8600843B10 /* InjectedScriptModule.h */; settings = {ATTRIBUTES = (Private, ); }; }; 10D5902E1889C3DF00C05A0D /* MathObject.h in Headers */ = {isa = PBXBuildFile; fileRef = F692A86B0255597D01FF60F7 /* MathObject.h */; settings = {ATTRIBUTES = (Private, ); }; }; 10D5902F1889C3DF00C05A0D /* MemoryStatistics.h in Headers */ = {isa = PBXBuildFile; fileRef = 90213E3C123A40C200D422F3 /* MemoryStatistics.h */; settings = {ATTRIBUTES = (Private, ); }; }; 10D590301889C3DF00C05A0D /* MethodOfGettingAValueProfile.h in Headers */ = {isa = PBXBuildFile; fileRef = 0FB5467A14F5C7D4002C2989 /* MethodOfGettingAValueProfile.h */; settings = {ATTRIBUTES = (Private, ); }; }; @@ -1179,7 +1162,6 @@ 10D5906B1889C3DF00C05A0D /* PropertyOffset.h in Headers */ = {isa = PBXBuildFile; fileRef = 0FF7168A15A3B231008F5DAA /* PropertyOffset.h */; settings = {ATTRIBUTES = (Private, ); }; }; 10D5906C1889C3DF00C05A0D /* PropertySlot.h in Headers */ = {isa = PBXBuildFile; fileRef = 65621E6C089E859700760F35 /* PropertySlot.h */; settings = {ATTRIBUTES = (Private, ); }; }; 10D5906D1889C3DF00C05A0D /* PropertyStorage.h in Headers */ = {isa = PBXBuildFile; fileRef = 0FB7F39015ED8E3800F167B2 /* PropertyStorage.h */; settings = {ATTRIBUTES = (Private, ); }; }; - 10D5906E1889C3DF00C05A0D /* InspectorJSBackendDispatchers.h in Headers */ = {isa = PBXBuildFile; fileRef = A532438218568317002ED692 /* InspectorJSBackendDispatchers.h */; settings = {ATTRIBUTES = (Private, ); }; }; 10D5906F1889C3DF00C05A0D /* Protect.h in Headers */ = {isa = PBXBuildFile; fileRef = 65C02FBB0637462A003E7EE6 /* Protect.h */; settings = {ATTRIBUTES = (Private, ); }; }; 10D590701889C3DF00C05A0D /* PrototypeMap.h in Headers */ = {isa = PBXBuildFile; fileRef = 14D844A316AA2C7000A65AF0 /* PrototypeMap.h */; settings = {ATTRIBUTES = (Private, ); }; }; 10D590711889C3DF00C05A0D /* PutByIdStatus.h in Headers */ = {isa = PBXBuildFile; fileRef = 0F93329A14CA7DC10085F3C6 /* PutByIdStatus.h */; settings = {ATTRIBUTES = (Private, ); }; }; @@ -1206,7 +1188,6 @@ 10D590861889C3DF00C05A0D /* Reject.h in Headers */ = {isa = PBXBuildFile; fileRef = 0FB7F39115ED8E3800F167B2 /* Reject.h */; settings = {ATTRIBUTES = (Private, ); }; }; 10D590871889C3DF00C05A0D /* Repatch.h in Headers */ = {isa = PBXBuildFile; fileRef = 0F24E54A17EE274900ABB217 /* Repatch.h */; }; 10D590881889C3DF00C05A0D /* RepatchBuffer.h in Headers */ = {isa = PBXBuildFile; fileRef = 86D3B3C210159D7F002865E7 /* RepatchBuffer.h */; settings = {ATTRIBUTES = (Private, ); }; }; - 10D590891889C3DF00C05A0D /* InjectedScript.h in Headers */ = {isa = PBXBuildFile; fileRef = A513E5B6185B8BD3007E95AD /* InjectedScript.h */; settings = {ATTRIBUTES = (Private, ); }; }; 10D5908A1889C3DF00C05A0D /* ResultType.h in Headers */ = {isa = PBXBuildFile; fileRef = 869EBCB60E8C6D4A008722CC /* ResultType.h */; settings = {ATTRIBUTES = (Private, ); }; }; 10D5908B1889C3DF00C05A0D /* SamplingCounter.h in Headers */ = {isa = PBXBuildFile; fileRef = 0F77008E1402FDD60078EB39 /* SamplingCounter.h */; settings = {ATTRIBUTES = (Private, ); }; }; 10D5908C1889C3DF00C05A0D /* SamplingTool.h in Headers */ = {isa = PBXBuildFile; fileRef = 1429D8840ED21C3D00B89619 /* SamplingTool.h */; settings = {ATTRIBUTES = (Private, ); }; }; @@ -1280,7 +1261,6 @@ 10D590D01889C3DF00C05A0D /* UnlinkedCodeBlock.h in Headers */ = {isa = PBXBuildFile; fileRef = A79E781F15EECBA80047C855 /* UnlinkedCodeBlock.h */; settings = {ATTRIBUTES = (Private, ); }; }; 10D590D11889C3DF00C05A0D /* UnusedPointer.h in Headers */ = {isa = PBXBuildFile; fileRef = 65987F2F16828A7E003C2F8D /* UnusedPointer.h */; settings = {ATTRIBUTES = (Private, ); }; }; 10D590D21889C3DF00C05A0D /* ValueProfile.h in Headers */ = {isa = PBXBuildFile; fileRef = 0F963B3613FC6FDE0002D9B2 /* ValueProfile.h */; settings = {ATTRIBUTES = (Private, ); }; }; - 10D590D31889C3DF00C05A0D /* InjectedScriptHost.h in Headers */ = {isa = PBXBuildFile; fileRef = A513E5B9185BFACC007E95AD /* InjectedScriptHost.h */; settings = {ATTRIBUTES = (Private, ); }; }; 10D590D41889C3DF00C05A0D /* ValueRecovery.h in Headers */ = {isa = PBXBuildFile; fileRef = 0F426A451460CBAB00131F8F /* ValueRecovery.h */; settings = {ATTRIBUTES = (Private, ); }; }; 10D590D51889C3DF00C05A0D /* VirtualRegister.h in Headers */ = {isa = PBXBuildFile; fileRef = 0F426A461460CBAB00131F8F /* VirtualRegister.h */; settings = {ATTRIBUTES = (Private, ); }; }; 10D590D61889C3DF00C05A0D /* VM.h in Headers */ = {isa = PBXBuildFile; fileRef = E18E3A560DF9278C00D90B34 /* VM.h */; settings = {ATTRIBUTES = (Private, ); }; }; @@ -1289,7 +1269,6 @@ 10D590D91889C3DF00C05A0D /* Watchdog.h in Headers */ = {isa = PBXBuildFile; fileRef = FED94F2C171E3E2300BE77A4 /* Watchdog.h */; settings = {ATTRIBUTES = (Private, ); }; }; 10D590DA1889C3DF00C05A0D /* Watchpoint.h in Headers */ = {isa = PBXBuildFile; fileRef = 0F919D2315853CDE004A4E7D /* Watchpoint.h */; settings = {ATTRIBUTES = (Private, ); }; }; 10D590DB1889C3DF00C05A0D /* Weak.h in Headers */ = {isa = PBXBuildFile; fileRef = 142E3133134FF0A600AFADB5 /* Weak.h */; settings = {ATTRIBUTES = (Private, ); }; }; - 10D590DC1889C3DF00C05A0D /* JSInjectedScriptHost.h in Headers */ = {isa = PBXBuildFile; fileRef = A513E5BB185BFACC007E95AD /* JSInjectedScriptHost.h */; }; 10D590DD1889C3DF00C05A0D /* WeakBlock.h in Headers */ = {isa = PBXBuildFile; fileRef = 14E84F9A14EE1ACC00D6D5D4 /* WeakBlock.h */; settings = {ATTRIBUTES = (Private, ); }; }; 10D590DE1889C3DF00C05A0D /* WeakGCMap.h in Headers */ = {isa = PBXBuildFile; fileRef = 14BFCE6810CDB1FC00364CCE /* WeakGCMap.h */; settings = {ATTRIBUTES = (Private, ); }; }; 10D590DF1889C3DF00C05A0D /* RemoteInspector.h in Headers */ = {isa = PBXBuildFile; fileRef = A5BA15E1182340B300A82E69 /* RemoteInspector.h */; settings = {ATTRIBUTES = (Private, ); }; }; @@ -1333,7 +1312,6 @@ 10D591071889C3DF00C05A0D /* ArrayAllocationProfile.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 0F8335B41639C1E3001443B5 /* ArrayAllocationProfile.cpp */; }; 10D591081889C3DF00C05A0D /* ArrayBuffer.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A7A8AF2517ADB5F2005AB174 /* ArrayBuffer.cpp */; }; 10D591091889C3DF00C05A0D /* ArrayBufferView.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A7A8AF2717ADB5F3005AB174 /* ArrayBufferView.cpp */; }; - 10D5910A1889C3DF00C05A0D /* DFGArithMode.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 0F48531F187750560083B687 /* DFGArithMode.cpp */; }; 10D5910B1889C3DF00C05A0D /* ArrayConstructor.cpp in Sources */ = {isa = PBXBuildFile; fileRef = BC7952060E15E8A800A898AB /* ArrayConstructor.cpp */; }; 10D5910C1889C3DF00C05A0D /* ArrayIteratorConstructor.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A7BDAEC017F4EA1400F6140C /* ArrayIteratorConstructor.cpp */; }; 10D5910D1889C3DF00C05A0D /* ArrayIteratorPrototype.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A7BDAEC217F4EA1400F6140C /* ArrayIteratorPrototype.cpp */; }; @@ -1349,7 +1327,6 @@ 10D591171889C3DF00C05A0D /* CallData.cpp in Sources */ = {isa = PBXBuildFile; fileRef = BCA62DFE0E2826230004F30D /* CallData.cpp */; }; 10D591181889C3DF00C05A0D /* CallFrame.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1429D8DB0ED2205B00B89619 /* CallFrame.cpp */; }; 10D591191889C3DF00C05A0D /* CallLinkInfo.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 0F0B83AE14BCF71400885B4F /* CallLinkInfo.cpp */; }; - 10D5911A1889C3DF00C05A0D /* InjectedScript.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A513E5B5185B8BD3007E95AD /* InjectedScript.cpp */; }; 10D5911B1889C3DF00C05A0D /* CallLinkStatus.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 0F93329314CA7DC10085F3C6 /* CallLinkStatus.cpp */; }; 10D5911C1889C3DF00C05A0D /* ClosureCallStubRoutine.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 0F73D7AB165A142A00ACAB71 /* ClosureCallStubRoutine.cpp */; }; 10D5911D1889C3DF00C05A0D /* CodeBlock.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 969A07900ED1D3AE00F1F681 /* CodeBlock.cpp */; settings = {COMPILER_FLAGS = "-fno-strict-aliasing"; }; }; @@ -1433,7 +1410,6 @@ 10D5916B1889C3DF00C05A0D /* DFGJITFinalizer.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A78A9770179738B8009DF744 /* DFGJITFinalizer.cpp */; }; 10D5916C1889C3DF00C05A0D /* DFGJumpReplacement.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 0FC97F3918202119002C9B26 /* DFGJumpReplacement.cpp */; }; 10D5916D1889C3DF00C05A0D /* DFGLazyJSValue.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A73A53581799CD5D00170C19 /* DFGLazyJSValue.cpp */; }; - 10D5916E1889C3DF00C05A0D /* InjectedScriptHost.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A58E35901860DEC7001F24FE /* InjectedScriptHost.cpp */; }; 10D5916F1889C3DF00C05A0D /* DFGLICMPhase.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A7D9A29217A0BC7400EE2618 /* DFGLICMPhase.cpp */; }; 10D591701889C3DF00C05A0D /* DFGLivenessAnalysisPhase.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A7D89CEC17A0B8CC00773AD8 /* DFGLivenessAnalysisPhase.cpp */; }; 10D591711889C3DF00C05A0D /* DFGLongLivedState.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 0FB4B51C16B62772003F696B /* DFGLongLivedState.cpp */; }; @@ -1443,7 +1419,6 @@ 10D591751889C3DF00C05A0D /* DFGNode.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 0FB4B51E16B62772003F696B /* DFGNode.cpp */; }; 10D591761889C3DF00C05A0D /* DFGNodeFlags.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 0FA581B7150E952A00B9A2D9 /* DFGNodeFlags.cpp */; }; 10D591771889C3DF00C05A0D /* DFGOperations.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 86EC9DBF1328DF82002B2AD7 /* DFGOperations.cpp */; }; - 10D591781889C3DF00C05A0D /* InjectedScriptBase.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A514B2C0185A684400F3C7CB /* InjectedScriptBase.cpp */; }; 10D591791889C3DF00C05A0D /* DFGOSRAvailabilityAnalysisPhase.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A7D89CEE17A0B8CC00773AD8 /* DFGOSRAvailabilityAnalysisPhase.cpp */; }; 10D5917A1889C3DF00C05A0D /* DFGOSREntry.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 0FD82E52141DAEDE00179C94 /* DFGOSREntry.cpp */; }; 10D5917B1889C3DF00C05A0D /* DFGOSREntrypointCreationPhase.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 0FD8A31D17D51F5700CA2C40 /* DFGOSREntrypointCreationPhase.cpp */; }; @@ -1647,12 +1622,10 @@ 10D592411889C3DF00C05A0D /* LazyOperandValueProfile.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 0FB5467814F5C468002C2989 /* LazyOperandValueProfile.cpp */; }; 10D592421889C3DF00C05A0D /* LegacyProfiler.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 95AB832E0DA42CAD00BC83F3 /* LegacyProfiler.cpp */; }; 10D592431889C3DF00C05A0D /* Lexer.cpp in Sources */ = {isa = PBXBuildFile; fileRef = F692A8650255597D01FF60F7 /* Lexer.cpp */; }; - 10D592441889C3DF00C05A0D /* JSInjectedScriptHostPrototype.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A513E5BC185BFACC007E95AD /* JSInjectedScriptHostPrototype.cpp */; }; 10D592451889C3DF00C05A0D /* LinkBuffer.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 0FF4275615914A20004CB9FF /* LinkBuffer.cpp */; }; 10D592461889C3DF00C05A0D /* LiteralParser.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A7E2EA6A0FB460CF00601F06 /* LiteralParser.cpp */; }; 10D592471889C3DF00C05A0D /* LLIntCLoop.cpp in Sources */ = {isa = PBXBuildFile; fileRef = FE20CE9B15F04A9500DF3430 /* LLIntCLoop.cpp */; }; 10D592481889C3DF00C05A0D /* LLIntData.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 0F4680CE14BBB3D100BFE272 /* LLIntData.cpp */; }; - 10D592491889C3DF00C05A0D /* JSGlobalObjectInspectorController.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A51007BE187CC3C600B38879 /* JSGlobalObjectInspectorController.cpp */; }; 10D5924A1889C3DF00C05A0D /* LLIntEntrypoint.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 0F38B00F17CF077F00B144D3 /* LLIntEntrypoint.cpp */; }; 10D5924B1889C3DF00C05A0D /* LLIntExceptions.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 0F46809D14BA7F8200BFE272 /* LLIntExceptions.cpp */; }; 10D5924C1889C3DF00C05A0D /* LLIntSlowPaths.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 0F46809F14BA7F8200BFE272 /* LLIntSlowPaths.cpp */; settings = {COMPILER_FLAGS = "-Wno-unused-parameter"; }; }; @@ -1684,7 +1657,6 @@ 10D592661889C3DF00C05A0D /* ScriptObject.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A54CF2F7184EAEDA00237F19 /* ScriptObject.cpp */; }; 10D592671889C3DF00C05A0D /* NativeErrorConstructor.cpp in Sources */ = {isa = PBXBuildFile; fileRef = BC02E9080E1839DB000F9297 /* NativeErrorConstructor.cpp */; }; 10D592681889C3DF00C05A0D /* NativeErrorPrototype.cpp in Sources */ = {isa = PBXBuildFile; fileRef = BC02E90A0E1839DB000F9297 /* NativeErrorPrototype.cpp */; }; - 10D592691889C3DF00C05A0D /* InjectedScriptManager.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A513E5C8185F9624007E95AD /* InjectedScriptManager.cpp */; }; 10D5926A1889C3DF00C05A0D /* Nodes.cpp in Sources */ = {isa = PBXBuildFile; fileRef = F692A86D0255597D01FF60F7 /* Nodes.cpp */; }; 10D5926B1889C3DF00C05A0D /* NodesCodegen.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 655EB29A10CE2581001A990E /* NodesCodegen.cpp */; }; 10D5926C1889C3DF00C05A0D /* NumberConstructor.cpp in Sources */ = {isa = PBXBuildFile; fileRef = BC2680C20E16D4E900A06E92 /* NumberConstructor.cpp */; }; @@ -1727,7 +1699,6 @@ 10D592911889C3DF00C05A0D /* PrototypeMap.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 14D844A216AA2C7000A65AF0 /* PrototypeMap.cpp */; }; 10D592921889C3DF00C05A0D /* PutByIdStatus.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 0F93329914CA7DC10085F3C6 /* PutByIdStatus.cpp */; }; 10D592931889C3DF00C05A0D /* ReduceWhitespace.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 0FF60ABF16740F8100029779 /* ReduceWhitespace.cpp */; }; - 10D592941889C3DF00C05A0D /* InspectorAgent.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A5CEEE12187F3BAD00E55C99 /* InspectorAgent.cpp */; }; 10D592951889C3DF00C05A0D /* RegExp.cpp in Sources */ = {isa = PBXBuildFile; fileRef = F692A87D0255597D01FF60F7 /* RegExp.cpp */; }; 10D592961889C3DF00C05A0D /* RegExpCache.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A1712B3A11C7B212007A5315 /* RegExpCache.cpp */; }; 10D592971889C3DF00C05A0D /* RegExpCachedResult.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 86F75EFB151C062F007C9BA3 /* RegExpCachedResult.cpp */; }; @@ -1791,9 +1762,7 @@ 10D592D11889C3DF00C05A0D /* WeakBlock.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 14E84F9914EE1ACC00D6D5D4 /* WeakBlock.cpp */; }; 10D592D21889C3DF00C05A0D /* WeakHandleOwner.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 14F7256314EE265E00B1652B /* WeakHandleOwner.cpp */; }; 10D592D31889C3DF00C05A0D /* WeakMapConstructor.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A7CA3ADD17DA41AE006538AF /* WeakMapConstructor.cpp */; }; - 10D592D41889C3DF00C05A0D /* JSInjectedScriptHost.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A513E5BA185BFACC007E95AD /* JSInjectedScriptHost.cpp */; }; 10D592D51889C3DF00C05A0D /* WeakMapData.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A7CA3AE917DA5168006538AF /* WeakMapData.cpp */; }; - 10D592D61889C3DF00C05A0D /* InjectedScriptModule.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A5840E1E187B7B8600843B10 /* InjectedScriptModule.cpp */; }; 10D592D71889C3DF00C05A0D /* WeakMapPrototype.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A7CA3ADF17DA41AE006538AF /* WeakMapPrototype.cpp */; }; 10D592D81889C3DF00C05A0D /* WeakSet.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 14E84F9B14EE1ACC00D6D5D4 /* WeakSet.cpp */; }; 10D592D91889C3DF00C05A0D /* WriteBarrierSupport.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 0FC8150814043BCA00CFA603 /* WriteBarrierSupport.cpp */; }; @@ -2154,20 +2123,7 @@ A1712B4111C7B235007A5315 /* RegExpKey.h in Headers */ = {isa = PBXBuildFile; fileRef = A1712B4011C7B235007A5315 /* RegExpKey.h */; settings = {ATTRIBUTES = (Private, ); }; }; A1A009C01831A22D00CF8711 /* MacroAssemblerARM64.h in Headers */ = {isa = PBXBuildFile; fileRef = 8640923C156EED3B00566CB2 /* MacroAssemblerARM64.h */; settings = {ATTRIBUTES = (Private, ); }; }; A1A009C11831A26E00CF8711 /* ARM64Assembler.h in Headers */ = {isa = PBXBuildFile; fileRef = 8640923B156EED3B00566CB2 /* ARM64Assembler.h */; settings = {ATTRIBUTES = (Private, ); }; }; - A51007C0187CC3C600B38879 /* JSGlobalObjectInspectorController.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A51007BE187CC3C600B38879 /* JSGlobalObjectInspectorController.cpp */; }; - A51007C1187CC3C600B38879 /* JSGlobalObjectInspectorController.h in Headers */ = {isa = PBXBuildFile; fileRef = A51007BF187CC3C600B38879 /* JSGlobalObjectInspectorController.h */; }; - A513E5B7185B8BD3007E95AD /* InjectedScript.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A513E5B5185B8BD3007E95AD /* InjectedScript.cpp */; }; - A513E5B8185B8BD3007E95AD /* InjectedScript.h in Headers */ = {isa = PBXBuildFile; fileRef = A513E5B6185B8BD3007E95AD /* InjectedScript.h */; settings = {ATTRIBUTES = (Private, ); }; }; - A513E5BE185BFACC007E95AD /* InjectedScriptHost.h in Headers */ = {isa = PBXBuildFile; fileRef = A513E5B9185BFACC007E95AD /* InjectedScriptHost.h */; settings = {ATTRIBUTES = (Private, ); }; }; - A513E5BF185BFACC007E95AD /* JSInjectedScriptHost.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A513E5BA185BFACC007E95AD /* JSInjectedScriptHost.cpp */; }; - A513E5C0185BFACC007E95AD /* JSInjectedScriptHost.h in Headers */ = {isa = PBXBuildFile; fileRef = A513E5BB185BFACC007E95AD /* JSInjectedScriptHost.h */; }; - A513E5C1185BFACC007E95AD /* JSInjectedScriptHostPrototype.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A513E5BC185BFACC007E95AD /* JSInjectedScriptHostPrototype.cpp */; }; - A513E5C2185BFACC007E95AD /* JSInjectedScriptHostPrototype.h in Headers */ = {isa = PBXBuildFile; fileRef = A513E5BD185BFACC007E95AD /* JSInjectedScriptHostPrototype.h */; }; A513E5C7185F9446007E95AD /* InjectedScriptSource.h in Headers */ = {isa = PBXBuildFile; fileRef = A513E5C6185F9436007E95AD /* InjectedScriptSource.h */; }; - A513E5CA185F9624007E95AD /* InjectedScriptManager.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A513E5C8185F9624007E95AD /* InjectedScriptManager.cpp */; }; - A513E5CB185F9624007E95AD /* InjectedScriptManager.h in Headers */ = {isa = PBXBuildFile; fileRef = A513E5C9185F9624007E95AD /* InjectedScriptManager.h */; settings = {ATTRIBUTES = (Private, ); }; }; - A514B2C2185A684400F3C7CB /* InjectedScriptBase.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A514B2C0185A684400F3C7CB /* InjectedScriptBase.cpp */; }; - A514B2C3185A684400F3C7CB /* InjectedScriptBase.h in Headers */ = {isa = PBXBuildFile; fileRef = A514B2C1185A684400F3C7CB /* InjectedScriptBase.h */; settings = {ATTRIBUTES = (Private, ); }; }; A532438718568335002ED692 /* InspectorJSBackendDispatchers.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A532438118568317002ED692 /* InspectorJSBackendDispatchers.cpp */; }; A532438818568335002ED692 /* InspectorJSBackendDispatchers.h in Headers */ = {isa = PBXBuildFile; fileRef = A532438218568317002ED692 /* InspectorJSBackendDispatchers.h */; settings = {ATTRIBUTES = (Private, ); }; }; A532438918568335002ED692 /* InspectorJSFrontendDispatchers.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A532438318568317002ED692 /* InspectorJSFrontendDispatchers.cpp */; }; @@ -2185,13 +2141,6 @@ A55D93A5185012A800400DED /* ScriptFunctionCall.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A55D93A3185012A800400DED /* ScriptFunctionCall.cpp */; }; A55D93A6185012A800400DED /* ScriptFunctionCall.h in Headers */ = {isa = PBXBuildFile; fileRef = A55D93A4185012A800400DED /* ScriptFunctionCall.h */; settings = {ATTRIBUTES = (Private, ); }; }; A55D93AC18514F7900400DED /* InspectorTypeBuilder.h in Headers */ = {isa = PBXBuildFile; fileRef = A55D93AB18514F7900400DED /* InspectorTypeBuilder.h */; settings = {ATTRIBUTES = (Private, ); }; }; - A5840E20187B7B8600843B10 /* InjectedScriptModule.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A5840E1E187B7B8600843B10 /* InjectedScriptModule.cpp */; }; - A5840E21187B7B8600843B10 /* InjectedScriptModule.h in Headers */ = {isa = PBXBuildFile; fileRef = A5840E1F187B7B8600843B10 /* InjectedScriptModule.h */; settings = {ATTRIBUTES = (Private, ); }; }; - A5840E27187C981E00843B10 /* cssmin.py in Headers */ = {isa = PBXBuildFile; fileRef = A5840E26187C980700843B10 /* cssmin.py */; settings = {ATTRIBUTES = (Private, ); }; }; - A5840E29187CA5E600843B10 /* inline-and-minify-stylesheets-and-scripts.py in Headers */ = {isa = PBXBuildFile; fileRef = A5840E28187CA5B800843B10 /* inline-and-minify-stylesheets-and-scripts.py */; settings = {ATTRIBUTES = (Private, ); }; }; - A5840E2A187CA75900843B10 /* xxd.pl in Headers */ = {isa = PBXBuildFile; fileRef = A513E5C5185F92F0007E95AD /* xxd.pl */; settings = {ATTRIBUTES = (Private, ); }; }; - A5840E2B187CA75B00843B10 /* jsmin.py in Headers */ = {isa = PBXBuildFile; fileRef = A513E5C4185F92DC007E95AD /* jsmin.py */; settings = {ATTRIBUTES = (Private, ); }; }; - A58E35911860DECF001F24FE /* InjectedScriptHost.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A58E35901860DEC7001F24FE /* InjectedScriptHost.cpp */; }; A593CF7C1840360300BFCE27 /* InspectorBackendDispatcher.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A593CF7A1840360300BFCE27 /* InspectorBackendDispatcher.cpp */; }; A593CF7D1840360300BFCE27 /* InspectorBackendDispatcher.h in Headers */ = {isa = PBXBuildFile; fileRef = A593CF7B1840360300BFCE27 /* InspectorBackendDispatcher.h */; settings = {ATTRIBUTES = (Private, ); }; }; A593CF7F1840362C00BFCE27 /* InspectorAgentBase.h in Headers */ = {isa = PBXBuildFile; fileRef = A593CF7E1840362C00BFCE27 /* InspectorAgentBase.h */; settings = {ATTRIBUTES = (Private, ); }; }; @@ -2211,9 +2160,6 @@ A5BA15ED182340B400A82E69 /* RemoteInspectorXPCConnection.h in Headers */ = {isa = PBXBuildFile; fileRef = A5BA15E6182340B300A82E69 /* RemoteInspectorXPCConnection.h */; }; A5BA15EE182340B400A82E69 /* RemoteInspectorXPCConnection.mm in Sources */ = {isa = PBXBuildFile; fileRef = A5BA15E7182340B300A82E69 /* RemoteInspectorXPCConnection.mm */; }; A5BA15F0182345AF00A82E69 /* RemoteInspectorDebuggable.h in Headers */ = {isa = PBXBuildFile; fileRef = A5BA15EF182345AF00A82E69 /* RemoteInspectorDebuggable.h */; settings = {ATTRIBUTES = (Private, ); }; }; - A5CEEE14187F3BAD00E55C99 /* InspectorAgent.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A5CEEE12187F3BAD00E55C99 /* InspectorAgent.cpp */; }; - A5CEEE15187F3BAD00E55C99 /* InspectorAgent.h in Headers */ = {isa = PBXBuildFile; fileRef = A5CEEE13187F3BAD00E55C99 /* InspectorAgent.h */; settings = {ATTRIBUTES = (Private, ); }; }; - A5D0A1BB1862301B00C7B496 /* InspectorEnvironment.h in Headers */ = {isa = PBXBuildFile; fileRef = A5D0A1BA1862301B00C7B496 /* InspectorEnvironment.h */; settings = {ATTRIBUTES = (Private, ); }; }; A700873917CBE85300C3E643 /* MapConstructor.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A700873717CBE85300C3E643 /* MapConstructor.cpp */; }; A700873A17CBE85300C3E643 /* MapConstructor.h in Headers */ = {isa = PBXBuildFile; fileRef = A700873817CBE85300C3E643 /* MapConstructor.h */; }; A700873D17CBE8D300C3E643 /* MapPrototype.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A700873B17CBE8D300C3E643 /* MapPrototype.cpp */; }; @@ -2879,8 +2825,6 @@ 0F4680CF14BBB3D100BFE272 /* LLIntData.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = LLIntData.h; path = llint/LLIntData.h; sourceTree = ""; }; 0F4680D014BBC5F800BFE272 /* HostCallReturnValue.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = HostCallReturnValue.cpp; sourceTree = ""; }; 0F4680D114BBC5F800BFE272 /* HostCallReturnValue.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = HostCallReturnValue.h; sourceTree = ""; }; - 0F48531F187750560083B687 /* DFGArithMode.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = DFGArithMode.cpp; path = dfg/DFGArithMode.cpp; sourceTree = ""; }; - 0F485320187750560083B687 /* DFGArithMode.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = DFGArithMode.h; path = dfg/DFGArithMode.h; sourceTree = ""; }; 0F493AF816D0CAD10084508B /* SourceProvider.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = SourceProvider.cpp; sourceTree = ""; }; 0F4B94DB17B9F07500DD03A4 /* TypedArrayInlines.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = TypedArrayInlines.h; sourceTree = ""; }; 0F5541AF1613C1FB00CE3E25 /* SpecialPointer.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = SpecialPointer.cpp; sourceTree = ""; }; @@ -3568,23 +3512,7 @@ A1712B3A11C7B212007A5315 /* RegExpCache.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = RegExpCache.cpp; sourceTree = ""; }; A1712B3E11C7B228007A5315 /* RegExpCache.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RegExpCache.h; sourceTree = ""; }; A1712B4011C7B235007A5315 /* RegExpKey.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RegExpKey.h; sourceTree = ""; }; - A51007BE187CC3C600B38879 /* JSGlobalObjectInspectorController.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSGlobalObjectInspectorController.cpp; sourceTree = ""; }; - A51007BF187CC3C600B38879 /* JSGlobalObjectInspectorController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSGlobalObjectInspectorController.h; sourceTree = ""; }; - A513E5B5185B8BD3007E95AD /* InjectedScript.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = InjectedScript.cpp; sourceTree = ""; }; - A513E5B6185B8BD3007E95AD /* InjectedScript.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = InjectedScript.h; sourceTree = ""; }; - A513E5B9185BFACC007E95AD /* InjectedScriptHost.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = InjectedScriptHost.h; sourceTree = ""; }; - A513E5BA185BFACC007E95AD /* JSInjectedScriptHost.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSInjectedScriptHost.cpp; sourceTree = ""; }; - A513E5BB185BFACC007E95AD /* JSInjectedScriptHost.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSInjectedScriptHost.h; sourceTree = ""; }; - A513E5BC185BFACC007E95AD /* JSInjectedScriptHostPrototype.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSInjectedScriptHostPrototype.cpp; sourceTree = ""; }; - A513E5BD185BFACC007E95AD /* JSInjectedScriptHostPrototype.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSInjectedScriptHostPrototype.h; sourceTree = ""; }; - A513E5C3185F92C9007E95AD /* InjectedScriptSource.js */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.javascript; path = InjectedScriptSource.js; sourceTree = ""; }; - A513E5C4185F92DC007E95AD /* jsmin.py */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.script.python; path = jsmin.py; sourceTree = ""; }; - A513E5C5185F92F0007E95AD /* xxd.pl */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.script.perl; path = xxd.pl; sourceTree = ""; }; A513E5C6185F9436007E95AD /* InjectedScriptSource.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = InjectedScriptSource.h; sourceTree = ""; }; - A513E5C8185F9624007E95AD /* InjectedScriptManager.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = InjectedScriptManager.cpp; sourceTree = ""; }; - A513E5C9185F9624007E95AD /* InjectedScriptManager.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = InjectedScriptManager.h; sourceTree = ""; }; - A514B2C0185A684400F3C7CB /* InjectedScriptBase.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = InjectedScriptBase.cpp; sourceTree = ""; }; - A514B2C1185A684400F3C7CB /* InjectedScriptBase.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = InjectedScriptBase.h; sourceTree = ""; }; A532438118568317002ED692 /* InspectorJSBackendDispatchers.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = InspectorJSBackendDispatchers.cpp; sourceTree = ""; }; A532438218568317002ED692 /* InspectorJSBackendDispatchers.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = InspectorJSBackendDispatchers.h; sourceTree = ""; }; A532438318568317002ED692 /* InspectorJSFrontendDispatchers.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = InspectorJSFrontendDispatchers.cpp; sourceTree = ""; }; @@ -3604,11 +3532,6 @@ A55D93A3185012A800400DED /* ScriptFunctionCall.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = ScriptFunctionCall.cpp; sourceTree = ""; }; A55D93A4185012A800400DED /* ScriptFunctionCall.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ScriptFunctionCall.h; sourceTree = ""; }; A55D93AB18514F7900400DED /* InspectorTypeBuilder.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = InspectorTypeBuilder.h; sourceTree = ""; }; - A5840E1E187B7B8600843B10 /* InjectedScriptModule.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = InjectedScriptModule.cpp; sourceTree = ""; }; - A5840E1F187B7B8600843B10 /* InjectedScriptModule.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = InjectedScriptModule.h; sourceTree = ""; }; - A5840E26187C980700843B10 /* cssmin.py */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.script.python; path = cssmin.py; sourceTree = ""; }; - A5840E28187CA5B800843B10 /* inline-and-minify-stylesheets-and-scripts.py */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.script.python; path = "inline-and-minify-stylesheets-and-scripts.py"; sourceTree = ""; }; - A58E35901860DEC7001F24FE /* InjectedScriptHost.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = InjectedScriptHost.cpp; sourceTree = ""; }; A593CF7A1840360300BFCE27 /* InspectorBackendDispatcher.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = InspectorBackendDispatcher.cpp; sourceTree = ""; }; A593CF7B1840360300BFCE27 /* InspectorBackendDispatcher.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = InspectorBackendDispatcher.h; sourceTree = ""; }; A593CF7E1840362C00BFCE27 /* InspectorAgentBase.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = InspectorAgentBase.h; sourceTree = ""; }; @@ -3628,9 +3551,6 @@ A5BA15E6182340B300A82E69 /* RemoteInspectorXPCConnection.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RemoteInspectorXPCConnection.h; sourceTree = ""; }; A5BA15E7182340B300A82E69 /* RemoteInspectorXPCConnection.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = RemoteInspectorXPCConnection.mm; sourceTree = ""; }; A5BA15EF182345AF00A82E69 /* RemoteInspectorDebuggable.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RemoteInspectorDebuggable.h; sourceTree = ""; }; - A5CEEE12187F3BAD00E55C99 /* InspectorAgent.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = InspectorAgent.cpp; sourceTree = ""; }; - A5CEEE13187F3BAD00E55C99 /* InspectorAgent.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = InspectorAgent.h; sourceTree = ""; }; - A5D0A1BA1862301B00C7B496 /* InspectorEnvironment.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = InspectorEnvironment.h; sourceTree = ""; }; A700873717CBE85300C3E643 /* MapConstructor.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = MapConstructor.cpp; sourceTree = ""; }; A700873817CBE85300C3E643 /* MapConstructor.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MapConstructor.h; sourceTree = ""; }; A700873B17CBE8D300C3E643 /* MapPrototype.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = MapPrototype.cpp; sourceTree = ""; }; @@ -5232,8 +5152,6 @@ 0F1E3A431534CBAD000F9456 /* DFGArgumentPosition.h */, 0F16015A156198BF00C2587C /* DFGArgumentsSimplificationPhase.cpp */, 0F16015B156198BF00C2587C /* DFGArgumentsSimplificationPhase.h */, - 0F48531F187750560083B687 /* DFGArithMode.cpp */, - 0F485320187750560083B687 /* DFGArithMode.h */, 0F05C3B21683CF8F00BAF45B /* DFGArrayifySlowPathGenerator.h */, 0F63948115E48114006A597C /* DFGArrayMode.cpp */, 0F63948215E48114006A597C /* DFGArrayMode.h */, @@ -5636,25 +5554,12 @@ path = bytecode; sourceTree = ""; }; - A513E5CC185FB992007E95AD /* agents */ = { - isa = PBXGroup; - children = ( - A5CEEE12187F3BAD00E55C99 /* InspectorAgent.cpp */, - A5CEEE13187F3BAD00E55C99 /* InspectorAgent.h */, - ); - path = agents; - sourceTree = ""; - }; A532438E185696CE002ED692 /* scripts */ = { isa = PBXGroup; children = ( A532438F185696E6002ED692 /* CodeGeneratorInspector.py */, A5324390185696E6002ED692 /* CodeGeneratorInspectorStrings.py */, - A5840E26187C980700843B10 /* cssmin.py */, A5324391185696E6002ED692 /* generate-combined-inspector-json.py */, - A5840E28187CA5B800843B10 /* inline-and-minify-stylesheets-and-scripts.py */, - A513E5C4185F92DC007E95AD /* jsmin.py */, - A513E5C5185F92F0007E95AD /* xxd.pl */, ); path = scripts; sourceTree = ""; @@ -5676,36 +5581,17 @@ isa = PBXGroup; children = ( A532438D185696CA002ED692 /* protocol */, - A513E5CC185FB992007E95AD /* agents */, A5BA15E01823409D00A82E69 /* remote */, A532438E185696CE002ED692 /* scripts */, - A513E5B5185B8BD3007E95AD /* InjectedScript.cpp */, - A513E5B6185B8BD3007E95AD /* InjectedScript.h */, - A514B2C0185A684400F3C7CB /* InjectedScriptBase.cpp */, - A514B2C1185A684400F3C7CB /* InjectedScriptBase.h */, - A58E35901860DEC7001F24FE /* InjectedScriptHost.cpp */, - A513E5B9185BFACC007E95AD /* InjectedScriptHost.h */, - A513E5C8185F9624007E95AD /* InjectedScriptManager.cpp */, - A513E5C9185F9624007E95AD /* InjectedScriptManager.h */, - A5840E1E187B7B8600843B10 /* InjectedScriptModule.cpp */, - A5840E1F187B7B8600843B10 /* InjectedScriptModule.h */, - A513E5C3185F92C9007E95AD /* InjectedScriptSource.js */, A593CF7E1840362C00BFCE27 /* InspectorAgentBase.h */, A593CF84184038CA00BFCE27 /* InspectorAgentRegistry.cpp */, A593CF85184038CA00BFCE27 /* InspectorAgentRegistry.h */, A593CF7A1840360300BFCE27 /* InspectorBackendDispatcher.cpp */, A593CF7B1840360300BFCE27 /* InspectorBackendDispatcher.h */, - A5D0A1BA1862301B00C7B496 /* InspectorEnvironment.h */, A5945594182479EB00CC3843 /* InspectorFrontendChannel.h */, A55D93AB18514F7900400DED /* InspectorTypeBuilder.h */, A593CF801840377100BFCE27 /* InspectorValues.cpp */, A593CF811840377100BFCE27 /* InspectorValues.h */, - A51007BE187CC3C600B38879 /* JSGlobalObjectInspectorController.cpp */, - A51007BF187CC3C600B38879 /* JSGlobalObjectInspectorController.h */, - A513E5BA185BFACC007E95AD /* JSInjectedScriptHost.cpp */, - A513E5BB185BFACC007E95AD /* JSInjectedScriptHost.h */, - A513E5BC185BFACC007E95AD /* JSInjectedScriptHostPrototype.cpp */, - A513E5BD185BFACC007E95AD /* JSInjectedScriptHostPrototype.h */, ); path = inspector; sourceTree = ""; @@ -5750,7 +5636,6 @@ 10D58E161889C3DF00C05A0D /* AbstractPC.h in Headers */, 10D58E171889C3DF00C05A0D /* APICallbackFunction.h in Headers */, 10D58E181889C3DF00C05A0D /* APICast.h in Headers */, - 10D58E191889C3DF00C05A0D /* InspectorJSTypeBuilders.h in Headers */, 10D58E1A1889C3DF00C05A0D /* APIShims.h in Headers */, 10D58E1B1889C3DF00C05A0D /* ArgList.h in Headers */, 10D58E1C1889C3DF00C05A0D /* Arguments.h in Headers */, @@ -5758,7 +5643,6 @@ 10D58E1E1889C3DF00C05A0D /* ArgumentsIteratorPrototype.h in Headers */, 10D58E1F1889C3DF00C05A0D /* ARMAssembler.h in Headers */, 10D58E201889C3DF00C05A0D /* ARMv7Assembler.h in Headers */, - 10D58E211889C3DF00C05A0D /* InspectorAgent.h in Headers */, 10D58E221889C3DF00C05A0D /* ARMv7DOpcode.h in Headers */, 10D58E231889C3DF00C05A0D /* CopyWriteBarrier.h in Headers */, 10D58E241889C3DF00C05A0D /* WriteBarrierBuffer.h in Headers */, @@ -5767,15 +5651,10 @@ 10D58E271889C3DF00C05A0D /* CodeGeneratorInspector.py in Headers */, 10D58E281889C3DF00C05A0D /* TempRegisterSet.h in Headers */, 10D58E291889C3DF00C05A0D /* DFGFiltrationResult.h in Headers */, - 10D58E2A1889C3DF00C05A0D /* cssmin.py in Headers */, 10D58E2B1889C3DF00C05A0D /* BytecodeBasicBlock.h in Headers */, 10D58E2C1889C3DF00C05A0D /* generate-combined-inspector-json.py in Headers */, 10D58E2D1889C3DF00C05A0D /* BytecodeLivenessAnalysis.h in Headers */, 10D58E2E1889C3DF00C05A0D /* ArrayAllocationProfile.h in Headers */, - 10D58E2F1889C3DF00C05A0D /* inline-and-minify-stylesheets-and-scripts.py in Headers */, - 10D58E301889C3DF00C05A0D /* jsmin.py in Headers */, - 10D58E311889C3DF00C05A0D /* InspectorJS.json in Headers */, - 10D58E321889C3DF00C05A0D /* xxd.pl in Headers */, 10D58E331889C3DF00C05A0D /* Breakpoint.h in Headers */, 10D58E341889C3DF00C05A0D /* ArrayBuffer.h in Headers */, 10D58E351889C3DF00C05A0D /* DebuggerPrimitives.h in Headers */, @@ -5829,7 +5708,6 @@ 10D58E651889C3DF00C05A0D /* CompilationResult.h in Headers */, 10D58E661889C3DF00C05A0D /* Completion.h in Headers */, 10D58E671889C3DF00C05A0D /* ConcurrentJITLock.h in Headers */, - 10D58E681889C3DF00C05A0D /* JSInjectedScriptHostPrototype.h in Headers */, 10D58E691889C3DF00C05A0D /* config.h in Headers */, 10D58E6A1889C3DF00C05A0D /* ConservativeRoots.h in Headers */, 10D58E6B1889C3DF00C05A0D /* ConstructData.h in Headers */, @@ -5984,9 +5862,7 @@ 10D58F001889C3DF00C05A0D /* DFGVariableAccessDataDump.h in Headers */, 10D58F011889C3DF00C05A0D /* DFGVariableEvent.h in Headers */, 10D58F021889C3DF00C05A0D /* DFGVariableEventStream.h in Headers */, - 10D58F031889C3DF00C05A0D /* InjectedScriptBase.h in Headers */, 10D58F041889C3DF00C05A0D /* DFGVariadicFunction.h in Headers */, - 10D58F051889C3DF00C05A0D /* InspectorEnvironment.h in Headers */, 10D58F061889C3DF00C05A0D /* DFGVirtualRegisterAllocationPhase.h in Headers */, 10D58F071889C3DF00C05A0D /* DFGWatchpointCollectionPhase.h in Headers */, 10D58F081889C3DF00C05A0D /* DFGWorklist.h in Headers */, @@ -6195,7 +6071,6 @@ 10D58FD31889C3DF00C05A0D /* JSScriptRefPrivate.h in Headers */, 10D58FD41889C3DF00C05A0D /* JSSegmentedVariableObject.h in Headers */, 10D58FD51889C3DF00C05A0D /* JSSet.h in Headers */, - 10D58FD61889C3DF00C05A0D /* DFGArithMode.h in Headers */, 10D58FD71889C3DF00C05A0D /* JSStack.h in Headers */, 10D58FD81889C3DF00C05A0D /* JSStackInlines.h in Headers */, 10D58FD91889C3DF00C05A0D /* JSString.h in Headers */, @@ -6235,7 +6110,6 @@ 10D58FFB1889C3DF00C05A0D /* LegacyProfiler.h in Headers */, 10D58FFC1889C3DF00C05A0D /* Lexer.h in Headers */, 10D58FFD1889C3DF00C05A0D /* Lexer.lut.h in Headers */, - 10D58FFE1889C3DF00C05A0D /* InjectedScriptManager.h in Headers */, 10D58FFF1889C3DF00C05A0D /* LineInfo.h in Headers */, 10D590001889C3DF00C05A0D /* LinkBuffer.h in Headers */, 10D590011889C3DF00C05A0D /* ListableHandler.h in Headers */, @@ -6264,7 +6138,6 @@ 10D590181889C3DF00C05A0D /* MacroAssemblerARM.h in Headers */, 10D590191889C3DF00C05A0D /* MacroAssemblerARMv7.h in Headers */, 10D5901A1889C3DF00C05A0D /* MacroAssemblerCodeRef.h in Headers */, - 10D5901B1889C3DF00C05A0D /* InspectorJSFrontendDispatchers.h in Headers */, 10D5901C1889C3DF00C05A0D /* MacroAssemblerMIPS.h in Headers */, 10D5901D1889C3DF00C05A0D /* MacroAssemblerSH4.h in Headers */, 10D5901E1889C3DF00C05A0D /* MacroAssemblerX86.h in Headers */, @@ -6274,7 +6147,6 @@ 10D590221889C3DF00C05A0D /* MapData.h in Headers */, 10D590231889C3DF00C05A0D /* MapPrototype.h in Headers */, 10D590241889C3DF00C05A0D /* MarkedAllocator.h in Headers */, - 10D590251889C3DF00C05A0D /* JSGlobalObjectInspectorController.h in Headers */, 10D590261889C3DF00C05A0D /* MarkedBlock.h in Headers */, 10D590271889C3DF00C05A0D /* MarkedBlockSet.h in Headers */, 10D590281889C3DF00C05A0D /* MarkedSpace.h in Headers */, @@ -6282,7 +6154,6 @@ 10D5902A1889C3DF00C05A0D /* MarkStackInlines.h in Headers */, 10D5902B1889C3DF00C05A0D /* InspectorFrontendChannel.h in Headers */, 10D5902C1889C3DF00C05A0D /* MatchResult.h in Headers */, - 10D5902D1889C3DF00C05A0D /* InjectedScriptModule.h in Headers */, 10D5902E1889C3DF00C05A0D /* MathObject.h in Headers */, 10D5902F1889C3DF00C05A0D /* MemoryStatistics.h in Headers */, 10D590301889C3DF00C05A0D /* MethodOfGettingAValueProfile.h in Headers */, @@ -6347,7 +6218,6 @@ 10D5906B1889C3DF00C05A0D /* PropertyOffset.h in Headers */, 10D5906C1889C3DF00C05A0D /* PropertySlot.h in Headers */, 10D5906D1889C3DF00C05A0D /* PropertyStorage.h in Headers */, - 10D5906E1889C3DF00C05A0D /* InspectorJSBackendDispatchers.h in Headers */, 10D5906F1889C3DF00C05A0D /* Protect.h in Headers */, 10D590701889C3DF00C05A0D /* PrototypeMap.h in Headers */, 10D590711889C3DF00C05A0D /* PutByIdStatus.h in Headers */, @@ -6374,7 +6244,6 @@ 10D590861889C3DF00C05A0D /* Reject.h in Headers */, 10D590871889C3DF00C05A0D /* Repatch.h in Headers */, 10D590881889C3DF00C05A0D /* RepatchBuffer.h in Headers */, - 10D590891889C3DF00C05A0D /* InjectedScript.h in Headers */, 10D5908A1889C3DF00C05A0D /* ResultType.h in Headers */, 10D5908B1889C3DF00C05A0D /* SamplingCounter.h in Headers */, 10D5908C1889C3DF00C05A0D /* SamplingTool.h in Headers */, @@ -6448,7 +6317,6 @@ 10D590D01889C3DF00C05A0D /* UnlinkedCodeBlock.h in Headers */, 10D590D11889C3DF00C05A0D /* UnusedPointer.h in Headers */, 10D590D21889C3DF00C05A0D /* ValueProfile.h in Headers */, - 10D590D31889C3DF00C05A0D /* InjectedScriptHost.h in Headers */, 10D590D41889C3DF00C05A0D /* ValueRecovery.h in Headers */, 10D590D51889C3DF00C05A0D /* VirtualRegister.h in Headers */, 10D590D61889C3DF00C05A0D /* VM.h in Headers */, @@ -6457,7 +6325,6 @@ 10D590D91889C3DF00C05A0D /* Watchdog.h in Headers */, 10D590DA1889C3DF00C05A0D /* Watchpoint.h in Headers */, 10D590DB1889C3DF00C05A0D /* Weak.h in Headers */, - 10D590DC1889C3DF00C05A0D /* JSInjectedScriptHost.h in Headers */, 10D590DD1889C3DF00C05A0D /* WeakBlock.h in Headers */, 10D590DE1889C3DF00C05A0D /* WeakGCMap.h in Headers */, 10D590DF1889C3DF00C05A0D /* RemoteInspector.h in Headers */, @@ -6519,7 +6386,6 @@ A76140D0182982CB00750624 /* ArgumentsIteratorPrototype.h in Headers */, 86D3B2C410156BDE002865E7 /* ARMAssembler.h in Headers */, 86ADD1450FDDEA980006EEC2 /* ARMv7Assembler.h in Headers */, - A5CEEE15187F3BAD00E55C99 /* InspectorAgent.h in Headers */, 65C0285D1717966800351E35 /* ARMv7DOpcode.h in Headers */, 2A68295B1875F80500B6C3E2 /* CopyWriteBarrier.h in Headers */, 2A4EC90C1860D6C20094F782 /* WriteBarrierBuffer.h in Headers */, @@ -6528,15 +6394,11 @@ A532439218569709002ED692 /* CodeGeneratorInspector.py in Headers */, 0F24E54F17EE274900ABB217 /* TempRegisterSet.h in Headers */, A7BFF3C0179868940002F462 /* DFGFiltrationResult.h in Headers */, - A5840E27187C981E00843B10 /* cssmin.py in Headers */, C2FCAE1117A9C24E0034C735 /* BytecodeBasicBlock.h in Headers */, A532439418569709002ED692 /* generate-combined-inspector-json.py in Headers */, C2FCAE1317A9C24E0034C735 /* BytecodeLivenessAnalysis.h in Headers */, 0F8335B81639C1EA001443B5 /* ArrayAllocationProfile.h in Headers */, - A5840E29187CA5E600843B10 /* inline-and-minify-stylesheets-and-scripts.py in Headers */, - A5840E2B187CA75B00843B10 /* jsmin.py in Headers */, A53243981856A489002ED692 /* InspectorJS.json in Headers */, - A5840E2A187CA75900843B10 /* xxd.pl in Headers */, FEA08620182B7A0400F6D851 /* Breakpoint.h in Headers */, A7A8AF3517ADB5F3005AB174 /* ArrayBuffer.h in Headers */, FEA08621182B7A0400F6D851 /* DebuggerPrimitives.h in Headers */, @@ -6590,7 +6452,6 @@ A7E5A3A81797432D00E893C0 /* CompilationResult.h in Headers */, BC18C3F40E16F5CD00B34460 /* Completion.h in Headers */, 0FDB2CEA174896C7007B3C1B /* ConcurrentJITLock.h in Headers */, - A513E5C2185BFACC007E95AD /* JSInjectedScriptHostPrototype.h in Headers */, BC18C3F50E16F5CD00B34460 /* config.h in Headers */, 144836E7132DA7BE005BE785 /* ConservativeRoots.h in Headers */, BC18C3F60E16F5CD00B34460 /* ConstructData.h in Headers */, @@ -6745,9 +6606,7 @@ 0FDDBFB61666EEDA00C55FEF /* DFGVariableAccessDataDump.h in Headers */, 0F2BDC491522809600CD8910 /* DFGVariableEvent.h in Headers */, 0F2BDC4B1522809D00CD8910 /* DFGVariableEventStream.h in Headers */, - A514B2C3185A684400F3C7CB /* InjectedScriptBase.h in Headers */, 0FFB921E16D02F470055A5DB /* DFGVariadicFunction.h in Headers */, - A5D0A1BB1862301B00C7B496 /* InspectorEnvironment.h in Headers */, 0FFFC96014EF90BD00C72532 /* DFGVirtualRegisterAllocationPhase.h in Headers */, 0FC97F4218202119002C9B26 /* DFGWatchpointCollectionPhase.h in Headers */, 0FDB2CE8174830A2007B3C1B /* DFGWorklist.h in Headers */, @@ -6956,7 +6815,6 @@ A7C0C4AC168103020017011D /* JSScriptRefPrivate.h in Headers */, 0F919D11157F332C004A4E7D /* JSSegmentedVariableObject.h in Headers */, A7299D9E17D12837005F5FF9 /* JSSet.h in Headers */, - 0F485322187750560083B687 /* DFGArithMode.h in Headers */, BC18C45E0E16F5CD00B34460 /* JSStack.h in Headers */, A7C1EAF017987AB600299DB2 /* JSStackInlines.h in Headers */, BC18C4270E16F5CD00B34460 /* JSString.h in Headers */, @@ -6996,7 +6854,6 @@ BC18C4520E16F5CD00B34460 /* LegacyProfiler.h in Headers */, BC18C4310E16F5CD00B34460 /* Lexer.h in Headers */, BC18C52E0E16FCE100B34460 /* Lexer.lut.h in Headers */, - A513E5CB185F9624007E95AD /* InjectedScriptManager.h in Headers */, 0F0B83AD14BCF60400885B4F /* LineInfo.h in Headers */, 86D3B3C310159D7F002865E7 /* LinkBuffer.h in Headers */, 0F431738146BAC69007E3890 /* ListableHandler.h in Headers */, @@ -7035,7 +6892,6 @@ A78507D717CBC6FD0011F6E7 /* MapData.h in Headers */, A700873E17CBE8D300C3E643 /* MapPrototype.h in Headers */, C2B916C214DA014E00CBAC86 /* MarkedAllocator.h in Headers */, - A51007C1187CC3C600B38879 /* JSGlobalObjectInspectorController.h in Headers */, 142D6F0913539A2800B02E86 /* MarkedBlock.h in Headers */, 141448CB13A176EC00F5BA1A /* MarkedBlockSet.h in Headers */, 14D2F3DB139F4BE200491031 /* MarkedSpace.h in Headers */, @@ -7043,7 +6899,6 @@ C21122E315DD9AB300790E3A /* MarkStackInlines.h in Headers */, A5945595182479EB00CC3843 /* InspectorFrontendChannel.h in Headers */, 8612E4CD152389EC00C836BE /* MatchResult.h in Headers */, - A5840E21187B7B8600843B10 /* InjectedScriptModule.h in Headers */, BC18C43C0E16F5CD00B34460 /* MathObject.h in Headers */, 90213E3E123A40C200D422F3 /* MemoryStatistics.h in Headers */, 0FB5467B14F5C7E1002C2989 /* MethodOfGettingAValueProfile.h in Headers */, @@ -7135,7 +6990,6 @@ 0FB7F39D15ED8E4600F167B2 /* Reject.h in Headers */, 0F24E55117EE274900ABB217 /* Repatch.h in Headers */, 86D3B3C410159D7F002865E7 /* RepatchBuffer.h in Headers */, - A513E5B8185B8BD3007E95AD /* InjectedScript.h in Headers */, 869EBCB70E8C6D4A008722CC /* ResultType.h in Headers */, C22B31B9140577D700DB475A /* SamplingCounter.h in Headers */, 1429D8860ED21C3D00B89619 /* SamplingTool.h in Headers */, @@ -7209,7 +7063,6 @@ A7B601821639FD2A00372BA3 /* UnlinkedCodeBlock.h in Headers */, 0F2E892C16D028AD009E4FD2 /* UnusedPointer.h in Headers */, 0F963B3813FC6FE90002D9B2 /* ValueProfile.h in Headers */, - A513E5BE185BFACC007E95AD /* InjectedScriptHost.h in Headers */, 0F426A481460CBB300131F8F /* ValueRecovery.h in Headers */, 0F426A491460CBB700131F8F /* VirtualRegister.h in Headers */, BC18C4200E16F5CD00B34460 /* VM.h in Headers */, @@ -7218,7 +7071,6 @@ FED94F2F171E3E2300BE77A4 /* Watchdog.h in Headers */, 0F919D2615853CE3004A4E7D /* Watchpoint.h in Headers */, 142E313C134FF0A600AFADB5 /* Weak.h in Headers */, - A513E5C0185BFACC007E95AD /* JSInjectedScriptHost.h in Headers */, 14E84F9F14EE1ACC00D6D5D4 /* WeakBlock.h in Headers */, 14BFCE6910CDB1FC00364CCE /* WeakGCMap.h in Headers */, A5BA15E8182340B300A82E69 /* RemoteInspector.h in Headers */, @@ -7818,7 +7670,6 @@ 10D591071889C3DF00C05A0D /* ArrayAllocationProfile.cpp in Sources */, 10D591081889C3DF00C05A0D /* ArrayBuffer.cpp in Sources */, 10D591091889C3DF00C05A0D /* ArrayBufferView.cpp in Sources */, - 10D5910A1889C3DF00C05A0D /* DFGArithMode.cpp in Sources */, 10D5910B1889C3DF00C05A0D /* ArrayConstructor.cpp in Sources */, 10D5910C1889C3DF00C05A0D /* ArrayIteratorConstructor.cpp in Sources */, 10D5910D1889C3DF00C05A0D /* ArrayIteratorPrototype.cpp in Sources */, @@ -7834,7 +7685,6 @@ 10D591171889C3DF00C05A0D /* CallData.cpp in Sources */, 10D591181889C3DF00C05A0D /* CallFrame.cpp in Sources */, 10D591191889C3DF00C05A0D /* CallLinkInfo.cpp in Sources */, - 10D5911A1889C3DF00C05A0D /* InjectedScript.cpp in Sources */, 10D5911B1889C3DF00C05A0D /* CallLinkStatus.cpp in Sources */, 10D5911C1889C3DF00C05A0D /* ClosureCallStubRoutine.cpp in Sources */, 10D5911D1889C3DF00C05A0D /* CodeBlock.cpp in Sources */, @@ -7918,7 +7768,6 @@ 10D5916B1889C3DF00C05A0D /* DFGJITFinalizer.cpp in Sources */, 10D5916C1889C3DF00C05A0D /* DFGJumpReplacement.cpp in Sources */, 10D5916D1889C3DF00C05A0D /* DFGLazyJSValue.cpp in Sources */, - 10D5916E1889C3DF00C05A0D /* InjectedScriptHost.cpp in Sources */, 10D5916F1889C3DF00C05A0D /* DFGLICMPhase.cpp in Sources */, 10D591701889C3DF00C05A0D /* DFGLivenessAnalysisPhase.cpp in Sources */, 10D591711889C3DF00C05A0D /* DFGLongLivedState.cpp in Sources */, @@ -7928,7 +7777,6 @@ 10D591751889C3DF00C05A0D /* DFGNode.cpp in Sources */, 10D591761889C3DF00C05A0D /* DFGNodeFlags.cpp in Sources */, 10D591771889C3DF00C05A0D /* DFGOperations.cpp in Sources */, - 10D591781889C3DF00C05A0D /* InjectedScriptBase.cpp in Sources */, 10D591791889C3DF00C05A0D /* DFGOSRAvailabilityAnalysisPhase.cpp in Sources */, 10D5917A1889C3DF00C05A0D /* DFGOSREntry.cpp in Sources */, 10D5917B1889C3DF00C05A0D /* DFGOSREntrypointCreationPhase.cpp in Sources */, @@ -8133,12 +7981,10 @@ 10D592411889C3DF00C05A0D /* LazyOperandValueProfile.cpp in Sources */, 10D592421889C3DF00C05A0D /* LegacyProfiler.cpp in Sources */, 10D592431889C3DF00C05A0D /* Lexer.cpp in Sources */, - 10D592441889C3DF00C05A0D /* JSInjectedScriptHostPrototype.cpp in Sources */, 10D592451889C3DF00C05A0D /* LinkBuffer.cpp in Sources */, 10D592461889C3DF00C05A0D /* LiteralParser.cpp in Sources */, 10D592471889C3DF00C05A0D /* LLIntCLoop.cpp in Sources */, 10D592481889C3DF00C05A0D /* LLIntData.cpp in Sources */, - 10D592491889C3DF00C05A0D /* JSGlobalObjectInspectorController.cpp in Sources */, 10D5924A1889C3DF00C05A0D /* LLIntEntrypoint.cpp in Sources */, 10D5924B1889C3DF00C05A0D /* LLIntExceptions.cpp in Sources */, 10D5924C1889C3DF00C05A0D /* LLIntSlowPaths.cpp in Sources */, @@ -8170,7 +8016,6 @@ 10D592661889C3DF00C05A0D /* ScriptObject.cpp in Sources */, 10D592671889C3DF00C05A0D /* NativeErrorConstructor.cpp in Sources */, 10D592681889C3DF00C05A0D /* NativeErrorPrototype.cpp in Sources */, - 10D592691889C3DF00C05A0D /* InjectedScriptManager.cpp in Sources */, 10D5926A1889C3DF00C05A0D /* Nodes.cpp in Sources */, 10D5926B1889C3DF00C05A0D /* NodesCodegen.cpp in Sources */, 10D5926C1889C3DF00C05A0D /* NumberConstructor.cpp in Sources */, @@ -8213,7 +8058,6 @@ 10D592911889C3DF00C05A0D /* PrototypeMap.cpp in Sources */, 10D592921889C3DF00C05A0D /* PutByIdStatus.cpp in Sources */, 10D592931889C3DF00C05A0D /* ReduceWhitespace.cpp in Sources */, - 10D592941889C3DF00C05A0D /* InspectorAgent.cpp in Sources */, 10D592951889C3DF00C05A0D /* RegExp.cpp in Sources */, 10D592961889C3DF00C05A0D /* RegExpCache.cpp in Sources */, 10D592971889C3DF00C05A0D /* RegExpCachedResult.cpp in Sources */, @@ -8277,9 +8121,7 @@ 10D592D11889C3DF00C05A0D /* WeakBlock.cpp in Sources */, 10D592D21889C3DF00C05A0D /* WeakHandleOwner.cpp in Sources */, 10D592D31889C3DF00C05A0D /* WeakMapConstructor.cpp in Sources */, - 10D592D41889C3DF00C05A0D /* JSInjectedScriptHost.cpp in Sources */, 10D592D51889C3DF00C05A0D /* WeakMapData.cpp in Sources */, - 10D592D61889C3DF00C05A0D /* InjectedScriptModule.cpp in Sources */, 10D592D71889C3DF00C05A0D /* WeakMapPrototype.cpp in Sources */, 10D592D81889C3DF00C05A0D /* WeakSet.cpp in Sources */, 10D592D91889C3DF00C05A0D /* WriteBarrierSupport.cpp in Sources */, @@ -8345,7 +8187,6 @@ 0F8335B71639C1E6001443B5 /* ArrayAllocationProfile.cpp in Sources */, A7A8AF3417ADB5F3005AB174 /* ArrayBuffer.cpp in Sources */, A7A8AF3617ADB5F3005AB174 /* ArrayBufferView.cpp in Sources */, - 0F485321187750560083B687 /* DFGArithMode.cpp in Sources */, 147F39BF107EC37600427A48 /* ArrayConstructor.cpp in Sources */, A7BDAEC617F4EA1400F6140C /* ArrayIteratorConstructor.cpp in Sources */, A7BDAEC817F4EA1400F6140C /* ArrayIteratorPrototype.cpp in Sources */, @@ -8361,7 +8202,6 @@ 1428082D107EC0570013E7B2 /* CallData.cpp in Sources */, 1429D8DD0ED2205B00B89619 /* CallFrame.cpp in Sources */, 0F0B83B014BCF71600885B4F /* CallLinkInfo.cpp in Sources */, - A513E5B7185B8BD3007E95AD /* InjectedScript.cpp in Sources */, 0F93329D14CA7DC30085F3C6 /* CallLinkStatus.cpp in Sources */, 0F73D7AE165A142D00ACAB71 /* ClosureCallStubRoutine.cpp in Sources */, 969A07960ED1D3AE00F1F681 /* CodeBlock.cpp in Sources */, @@ -8445,7 +8285,6 @@ A78A9778179738B8009DF744 /* DFGJITFinalizer.cpp in Sources */, 0FC97F3F18202119002C9B26 /* DFGJumpReplacement.cpp in Sources */, A73A535A1799CD5D00170C19 /* DFGLazyJSValue.cpp in Sources */, - A58E35911860DECF001F24FE /* InjectedScriptHost.cpp in Sources */, A7D9A29717A0BC7400EE2618 /* DFGLICMPhase.cpp in Sources */, A7D89CFB17A0B8CC00773AD8 /* DFGLivenessAnalysisPhase.cpp in Sources */, 0FF0F19916B729F6005DF95B /* DFGLongLivedState.cpp in Sources */, @@ -8455,7 +8294,6 @@ 0FF0F19C16B72A03005DF95B /* DFGNode.cpp in Sources */, 0FA581BA150E952C00B9A2D9 /* DFGNodeFlags.cpp in Sources */, 86EC9DCF1328DF82002B2AD7 /* DFGOperations.cpp in Sources */, - A514B2C2185A684400F3C7CB /* InjectedScriptBase.cpp in Sources */, A7D89CFD17A0B8CC00773AD8 /* DFGOSRAvailabilityAnalysisPhase.cpp in Sources */, 0FD82E56141DAF0800179C94 /* DFGOSREntry.cpp in Sources */, 0FD8A32517D51F5700CA2C40 /* DFGOSREntrypointCreationPhase.cpp in Sources */, @@ -8660,12 +8498,10 @@ 0FB5467914F5C46B002C2989 /* LazyOperandValueProfile.cpp in Sources */, 95AB83420DA4322500BC83F3 /* LegacyProfiler.cpp in Sources */, 148F21B0107EC5410042EC2C /* Lexer.cpp in Sources */, - A513E5C1185BFACC007E95AD /* JSInjectedScriptHostPrototype.cpp in Sources */, 0FF4275715914A20004CB9FF /* LinkBuffer.cpp in Sources */, A7E2EA6C0FB460CF00601F06 /* LiteralParser.cpp in Sources */, FE20CE9D15F04A9500DF3430 /* LLIntCLoop.cpp in Sources */, 0F4680D214BBD16500BFE272 /* LLIntData.cpp in Sources */, - A51007C0187CC3C600B38879 /* JSGlobalObjectInspectorController.cpp in Sources */, 0F38B01117CF078000B144D3 /* LLIntEntrypoint.cpp in Sources */, 0F4680A814BA7FAB00BFE272 /* LLIntExceptions.cpp in Sources */, 0F4680A414BA7F8D00BFE272 /* LLIntSlowPaths.cpp in Sources */, @@ -8697,7 +8533,6 @@ A54CF2F9184EAEDA00237F19 /* ScriptObject.cpp in Sources */, 14469DE0107EC7E700650446 /* NativeErrorConstructor.cpp in Sources */, 14469DE1107EC7E700650446 /* NativeErrorPrototype.cpp in Sources */, - A513E5CA185F9624007E95AD /* InjectedScriptManager.cpp in Sources */, 148F21B7107EC5470042EC2C /* Nodes.cpp in Sources */, 655EB29B10CE2581001A990E /* NodesCodegen.cpp in Sources */, 14469DE2107EC7E700650446 /* NumberConstructor.cpp in Sources */, @@ -8740,7 +8575,6 @@ 1474C33C16AA2D9B0062F01D /* PrototypeMap.cpp in Sources */, 0F9332A314CA7DD70085F3C6 /* PutByIdStatus.cpp in Sources */, 0FF60AC316740F8800029779 /* ReduceWhitespace.cpp in Sources */, - A5CEEE14187F3BAD00E55C99 /* InspectorAgent.cpp in Sources */, 14280841107EC0930013E7B2 /* RegExp.cpp in Sources */, A1712B3B11C7B212007A5315 /* RegExpCache.cpp in Sources */, 8642C510151C06A90046D4EF /* RegExpCachedResult.cpp in Sources */, @@ -8804,9 +8638,7 @@ 14E84F9E14EE1ACC00D6D5D4 /* WeakBlock.cpp in Sources */, 14F7256514EE265E00B1652B /* WeakHandleOwner.cpp in Sources */, A7CA3AE317DA41AE006538AF /* WeakMapConstructor.cpp in Sources */, - A513E5BF185BFACC007E95AD /* JSInjectedScriptHost.cpp in Sources */, A7CA3AEB17DA5168006538AF /* WeakMapData.cpp in Sources */, - A5840E20187B7B8600843B10 /* InjectedScriptModule.cpp in Sources */, A7CA3AE517DA41AE006538AF /* WeakMapPrototype.cpp in Sources */, 14E84FA014EE1ACC00D6D5D4 /* WeakSet.cpp in Sources */, 0FC8150B14043C0E00CFA603 /* WriteBarrierSupport.cpp in Sources */, @@ -9023,7 +8855,8 @@ baseConfigurationReference = 10EAA6FF1889E6B300DEB161 /* JavaScriptCore-iOS-Static.xcconfig */; buildSettings = { ARCHS = "$(ARCHS_STANDARD_INCLUDING_64_BIT)"; - VALID_ARCHS = "arm64 armv7 i386 armv7s"; + ONLY_ACTIVE_ARCH = YES; + VALID_ARCHS = "armv7 armv7s arm64"; }; name = Debug; }; @@ -9032,7 +8865,8 @@ baseConfigurationReference = 10EAA6FF1889E6B300DEB161 /* JavaScriptCore-iOS-Static.xcconfig */; buildSettings = { ARCHS = "$(ARCHS_STANDARD_INCLUDING_64_BIT)"; - VALID_ARCHS = "arm64 armv7 i386 armv7s"; + ONLY_ACTIVE_ARCH = NO; + VALID_ARCHS = "armv7 armv7s arm64"; }; name = Release; }; @@ -9041,7 +8875,8 @@ baseConfigurationReference = 10EAA6FF1889E6B300DEB161 /* JavaScriptCore-iOS-Static.xcconfig */; buildSettings = { ARCHS = "$(ARCHS_STANDARD_INCLUDING_64_BIT)"; - VALID_ARCHS = "arm64 armv7 i386 armv7s"; + ONLY_ACTIVE_ARCH = NO; + VALID_ARCHS = "armv7 armv7s arm64"; }; name = Profiling; }; @@ -9051,7 +8886,8 @@ buildSettings = { ARCHS = "$(ARCHS_STANDARD_INCLUDING_64_BIT)"; BUILD_VARIANTS = normal; - VALID_ARCHS = "arm64 armv7 i386 armv7s"; + ONLY_ACTIVE_ARCH = NO; + VALID_ARCHS = "armv7 armv7s arm64"; }; name = Production; }; @@ -9060,6 +8896,7 @@ baseConfigurationReference = 10EAA6FF1889E6B300DEB161 /* JavaScriptCore-iOS-Static.xcconfig */; buildSettings = { PRODUCT_NAME = "Derived Sources copy"; + VALID_ARCHS = arm64; }; name = Debug; }; @@ -9068,6 +8905,7 @@ baseConfigurationReference = 10EAA6FF1889E6B300DEB161 /* JavaScriptCore-iOS-Static.xcconfig */; buildSettings = { PRODUCT_NAME = "Derived Sources copy"; + VALID_ARCHS = arm64; }; name = Release; }; @@ -9076,6 +8914,7 @@ baseConfigurationReference = 10EAA6FF1889E6B300DEB161 /* JavaScriptCore-iOS-Static.xcconfig */; buildSettings = { PRODUCT_NAME = "Derived Sources copy"; + VALID_ARCHS = arm64; }; name = Profiling; }; @@ -9084,6 +8923,7 @@ baseConfigurationReference = 10EAA6FF1889E6B300DEB161 /* JavaScriptCore-iOS-Static.xcconfig */; buildSettings = { PRODUCT_NAME = "Derived Sources copy"; + VALID_ARCHS = arm64; }; name = Production; }; diff --git a/JavaScriptCore/PlatformBlackBerry.cmake b/JavaScriptCore/PlatformBlackBerry.cmake new file mode 100644 index 00000000..15e45f28 --- /dev/null +++ b/JavaScriptCore/PlatformBlackBerry.cmake @@ -0,0 +1,9 @@ +list(REMOVE_ITEM JavaScriptCore_SOURCES + runtime/GCActivityCallback.cpp +) + +list(APPEND JavaScriptCore_SOURCES + runtime/GCActivityCallbackBlackBerry.cpp +) + +install(FILES "wtf/Forward.h" DESTINATION usr/include/browser/webkit/wtf) diff --git a/JavaScriptCore/assembler/ARMAssembler.h b/JavaScriptCore/assembler/ARMAssembler.h index 087d31c1..2a8c2e75 100644 --- a/JavaScriptCore/assembler/ARMAssembler.h +++ b/JavaScriptCore/assembler/ARMAssembler.h @@ -1121,6 +1121,11 @@ namespace JSC { linuxPageFlush(current, end); #elif OS(WINCE) CacheRangeFlush(code, size, CACHE_SYNC_ALL); +#elif OS(QNX) && ENABLE(ASSEMBLER_WX_EXCLUSIVE) + UNUSED_PARAM(code); + UNUSED_PARAM(size); +#elif OS(QNX) + msync(code, size, MS_INVALIDATE_ICACHE); #else #error "The cacheFlush support is missing on this platform." #endif diff --git a/JavaScriptCore/assembler/ARMv7Assembler.h b/JavaScriptCore/assembler/ARMv7Assembler.h index 5257f32a..1911109c 100644 --- a/JavaScriptCore/assembler/ARMv7Assembler.h +++ b/JavaScriptCore/assembler/ARMv7Assembler.h @@ -1347,7 +1347,7 @@ class ARMv7Assembler { m_formatter.twoWordOp5i6Imm4Reg4EncodedImm(OP_MOV_imm_T3, imm.m_value.imm4, rd, imm); } -#if OS(LINUX) +#if OS(LINUX) || OS(QNX) static void revertJumpTo_movT3movtcmpT2(void* instructionStart, RegisterID left, RegisterID right, uintptr_t imm) { uint16_t* address = static_cast(instructionStart); @@ -2268,7 +2268,7 @@ class ARMv7Assembler { ASSERT(!(bitwise_cast(instructionStart) & 1)); ASSERT(!(bitwise_cast(to) & 1)); -#if OS(LINUX) +#if OS(LINUX) || OS(QNX) if (canBeJumpT4(reinterpret_cast(instructionStart), to)) { uint16_t* ptr = reinterpret_cast(instructionStart) + 2; linkJumpT4(ptr, to); @@ -2287,7 +2287,7 @@ class ARMv7Assembler { static ptrdiff_t maxJumpReplacementSize() { -#if OS(LINUX) +#if OS(LINUX) || OS(QNX) return 10; #else return 4; @@ -2377,6 +2377,13 @@ class ARMv7Assembler { linuxPageFlush(current, end); #elif OS(WINCE) CacheRangeFlush(code, size, CACHE_SYNC_ALL); +#elif OS(QNX) +#if !ENABLE(ASSEMBLER_WX_EXCLUSIVE) + msync(code, size, MS_INVALIDATE_ICACHE); +#else + UNUSED_PARAM(code); + UNUSED_PARAM(size); +#endif #else #error "The cacheFlush support is missing on this platform." #endif diff --git a/JavaScriptCore/assembler/MacroAssemblerARMv7.h b/JavaScriptCore/assembler/MacroAssemblerARMv7.h index 1a9e22bc..2d78a68c 100644 --- a/JavaScriptCore/assembler/MacroAssemblerARMv7.h +++ b/JavaScriptCore/assembler/MacroAssemblerARMv7.h @@ -1784,7 +1784,7 @@ class MacroAssemblerARMv7 : public AbstractMacroAssembler { static void revertJumpReplacementToBranchPtrWithPatch(CodeLocationLabel instructionStart, RegisterID rd, void* initialValue) { -#if OS(LINUX) +#if OS(LINUX) || OS(QNX) ARMv7Assembler::revertJumpTo_movT3movtcmpT2(instructionStart.dataLocation(), rd, dataTempRegister, reinterpret_cast(initialValue)); #else UNUSED_PARAM(rd); diff --git a/JavaScriptCore/bytecode/CallLinkStatus.cpp b/JavaScriptCore/bytecode/CallLinkStatus.cpp index b64c967e..445310b8 100644 --- a/JavaScriptCore/bytecode/CallLinkStatus.cpp +++ b/JavaScriptCore/bytecode/CallLinkStatus.cpp @@ -101,7 +101,7 @@ CallLinkStatus CallLinkStatus::computeFor(CodeBlock* profiledBlock, unsigned byt UNUSED_PARAM(profiledBlock); UNUSED_PARAM(bytecodeIndex); -#if ENABLE(JIT) +#if ENABLE(JIT) && ENABLE(VALUE_PROFILER) if (!profiledBlock->hasBaselineJITProfiling()) return computeFromLLInt(profiledBlock, bytecodeIndex); diff --git a/JavaScriptCore/bytecode/CodeBlock.cpp b/JavaScriptCore/bytecode/CodeBlock.cpp index 462c0626..08f3838f 100644 --- a/JavaScriptCore/bytecode/CodeBlock.cpp +++ b/JavaScriptCore/bytecode/CodeBlock.cpp @@ -622,11 +622,16 @@ void CodeBlock::dumpValueProfiling(PrintStream& out, const Instruction*& it, boo ConcurrentJITLocker locker(m_lock); ++it; +#if ENABLE(VALUE_PROFILER) CString description = it->u.profile->briefDescription(locker); if (!description.length()) return; beginDumpProfiling(out, hasPrintedProfiling); out.print(description); +#else + UNUSED_PARAM(out); + UNUSED_PARAM(hasPrintedProfiling); +#endif } void CodeBlock::dumpArrayProfiling(PrintStream& out, const Instruction*& it, bool& hasPrintedProfiling) @@ -634,6 +639,7 @@ void CodeBlock::dumpArrayProfiling(PrintStream& out, const Instruction*& it, boo ConcurrentJITLocker locker(m_lock); ++it; +#if ENABLE(VALUE_PROFILER) if (!it->u.arrayProfile) return; CString description = it->u.arrayProfile->briefDescription(locker, this); @@ -641,8 +647,13 @@ void CodeBlock::dumpArrayProfiling(PrintStream& out, const Instruction*& it, boo return; beginDumpProfiling(out, hasPrintedProfiling); out.print(description); +#else + UNUSED_PARAM(out); + UNUSED_PARAM(hasPrintedProfiling); +#endif } +#if ENABLE(VALUE_PROFILER) void CodeBlock::dumpRareCaseProfile(PrintStream& out, const char* name, RareCaseProfile* profile, bool& hasPrintedProfiling) { if (!profile || !profile->m_counter) @@ -651,6 +662,7 @@ void CodeBlock::dumpRareCaseProfile(PrintStream& out, const char* name, RareCase beginDumpProfiling(out, hasPrintedProfiling); out.print(name, profile->m_counter); } +#endif void CodeBlock::dumpBytecode(PrintStream& out, ExecState* exec, const Instruction* begin, const Instruction*& it, const StubInfoMap& map) { @@ -1410,8 +1422,10 @@ void CodeBlock::dumpBytecode(PrintStream& out, ExecState* exec, const Instructio #endif } +#if ENABLE(VALUE_PROFILER) dumpRareCaseProfile(out, "rare case: ", rareCaseProfileForBytecodeOffset(location), hasPrintedProfiling); dumpRareCaseProfile(out, "special fast case: ", specialFastCaseProfileForBytecodeOffset(location), hasPrintedProfiling); +#endif #if ENABLE(DFG_JIT) Vector exitSites = exitProfile().exitSitesFor(location); @@ -1644,12 +1658,14 @@ CodeBlock::CodeBlock(ScriptExecutable* ownerExecutable, UnlinkedCodeBlock* unlin if (size_t size = unlinkedCodeBlock->numberOfLLintCallLinkInfos()) m_llintCallLinkInfos.resizeToFit(size); #endif +#if ENABLE(DFG_JIT) if (size_t size = unlinkedCodeBlock->numberOfArrayProfiles()) m_arrayProfiles.grow(size); if (size_t size = unlinkedCodeBlock->numberOfArrayAllocationProfiles()) m_arrayAllocationProfiles.resizeToFit(size); if (size_t size = unlinkedCodeBlock->numberOfValueProfiles()) m_valueProfiles.resizeToFit(size); +#endif if (size_t size = unlinkedCodeBlock->numberOfObjectAllocationProfiles()) m_objectAllocationProfiles.resizeToFit(size); @@ -1666,6 +1682,7 @@ CodeBlock::CodeBlock(ScriptExecutable* ownerExecutable, UnlinkedCodeBlock* unlin instructions[i + j].u.operand = pc[i + j].u.operand; } switch (pc[i].u.opcode) { +#if ENABLE(DFG_JIT) case op_get_by_val: case op_get_argument_by_val: { int arrayProfileIndex = pc[i + opLength - 2].u.operand; @@ -1702,6 +1719,7 @@ CodeBlock::CodeBlock(ScriptExecutable* ownerExecutable, UnlinkedCodeBlock* unlin instructions[i + opLength - 1] = &m_arrayAllocationProfiles[arrayAllocationProfileIndex]; break; } +#endif case op_new_object: { int objectAllocationProfileIndex = pc[i + opLength - 1].u.operand; ObjectAllocationProfile* objectAllocationProfile = &m_objectAllocationProfiles[objectAllocationProfileIndex]; @@ -1715,6 +1733,7 @@ CodeBlock::CodeBlock(ScriptExecutable* ownerExecutable, UnlinkedCodeBlock* unlin case op_call: case op_call_eval: { +#if ENABLE(DFG_JIT) ValueProfile* profile = &m_valueProfiles[pc[i + opLength - 1].u.operand]; ASSERT(profile->m_bytecodeOffset == -1); profile->m_bytecodeOffset = i; @@ -1722,6 +1741,7 @@ CodeBlock::CodeBlock(ScriptExecutable* ownerExecutable, UnlinkedCodeBlock* unlin int arrayProfileIndex = pc[i + opLength - 2].u.operand; m_arrayProfiles[arrayProfileIndex] = ArrayProfile(i); instructions[i + opLength - 2] = &m_arrayProfiles[arrayProfileIndex]; +#endif #if ENABLE(LLINT) instructions[i + 5] = &m_llintCallLinkInfos[pc[i + 5].u.operand]; #endif @@ -1731,10 +1751,12 @@ CodeBlock::CodeBlock(ScriptExecutable* ownerExecutable, UnlinkedCodeBlock* unlin #if ENABLE(LLINT) instructions[i + 5] = &m_llintCallLinkInfos[pc[i + 5].u.operand]; #endif +#if ENABLE(DFG_JIT) ValueProfile* profile = &m_valueProfiles[pc[i + opLength - 1].u.operand]; ASSERT(profile->m_bytecodeOffset == -1); profile->m_bytecodeOffset = i; instructions[i + opLength - 1] = profile; +#endif break; } case op_get_by_id_out_of_line: @@ -1777,10 +1799,12 @@ CodeBlock::CodeBlock(ScriptExecutable* ownerExecutable, UnlinkedCodeBlock* unlin } case op_get_from_scope: { +#if ENABLE(VALUE_PROFILER) ValueProfile* profile = &m_valueProfiles[pc[i + opLength - 1].u.operand]; ASSERT(profile->m_bytecodeOffset == -1); profile->m_bytecodeOffset = i; instructions[i + opLength - 1] = profile; +#endif // get_from_scope dst, scope, id, ResolveModeAndType, Structure, Operand const Identifier& ident = identifier(pc[i + 3].u.operand); @@ -1900,7 +1924,9 @@ void CodeBlock::setNumParameters(int newValue) { m_numParameters = newValue; +#if ENABLE(VALUE_PROFILER) m_argumentValueProfiles.resizeToFit(newValue); +#endif } void EvalCodeCache::visitAggregate(SlotVisitor& visitor) @@ -1954,15 +1980,15 @@ void CodeBlock::visitAggregate(SlotVisitor& visitor) if (CodeBlock* otherBlock = specialOSREntryBlockOrNull()) otherBlock->visitAggregate(visitor); - visitor.reportExtraMemoryUsage(ownerExecutable(), sizeof(CodeBlock)); + visitor.reportExtraMemoryUsage(sizeof(CodeBlock)); if (m_jitCode) - visitor.reportExtraMemoryUsage(ownerExecutable(), m_jitCode->size()); + visitor.reportExtraMemoryUsage(m_jitCode->size()); if (m_instructions.size()) { // Divide by refCount() because m_instructions points to something that is shared // by multiple CodeBlocks, and we only want to count it towards the heap size once. // Having each CodeBlock report only its proportional share of the size is one way // of accomplishing this. - visitor.reportExtraMemoryUsage(ownerExecutable(), m_instructions.size() * sizeof(Instruction) / m_instructions.refCount()); + visitor.reportExtraMemoryUsage(m_instructions.size() * sizeof(Instruction) / m_instructions.refCount()); } visitor.append(&m_unlinkedCode); @@ -2570,8 +2596,10 @@ void CodeBlock::shrinkToFit(ShrinkMode shrinkMode) #if ENABLE(JIT) m_callLinkInfos.shrinkToFit(); #endif +#if ENABLE(VALUE_PROFILER) m_rareCaseProfiles.shrinkToFit(); m_specialFastCaseProfiles.shrinkToFit(); +#endif if (shrinkMode == EarlyShrink) { m_additionalIdentifiers.shrinkToFit(); @@ -3153,6 +3181,7 @@ bool CodeBlock::shouldReoptimizeFromLoopNow() } #endif +#if ENABLE(VALUE_PROFILER) ArrayProfile* CodeBlock::getArrayProfile(unsigned bytecodeOffset) { for (unsigned i = 0; i < m_arrayProfiles.size(); ++i) { @@ -3225,6 +3254,10 @@ bool CodeBlock::shouldOptimizeNow() if (Options::verboseOSR()) dataLog("Considering optimizing ", *this, "...\n"); +#if ENABLE(VERBOSE_VALUE_PROFILE) + dumpValueProfiles(); +#endif + if (m_optimizationDelayCounter >= Options::maximumOptimizationDelay()) return true; @@ -3253,6 +3286,7 @@ bool CodeBlock::shouldOptimizeNow() optimizeAfterWarmUp(); return false; } +#endif #if ENABLE(DFG_JIT) void CodeBlock::tallyFrequentExitSites() diff --git a/JavaScriptCore/bytecode/CodeBlock.h b/JavaScriptCore/bytecode/CodeBlock.h index cf62f8e2..7ddf0405 100644 --- a/JavaScriptCore/bytecode/CodeBlock.h +++ b/JavaScriptCore/bytecode/CodeBlock.h @@ -277,12 +277,12 @@ class CodeBlock : public ThreadSafeRefCounted, public UnconditionalFi return result; } +#if ENABLE(JIT) bool hasBaselineJITProfiling() const { return jitType() == JITCode::BaselineJIT; } -#if ENABLE(JIT) virtual CodeBlock* replacement() = 0; virtual DFG::CapabilityLevel capabilityLevelInternal() = 0; @@ -410,6 +410,7 @@ class CodeBlock : public ThreadSafeRefCounted, public UnconditionalFi CallLinkInfo& callLinkInfo(int index) { return m_callLinkInfos[index]; } #endif +#if ENABLE(VALUE_PROFILER) unsigned numberOfArgumentValueProfiles() { ASSERT(m_numParameters >= 0); @@ -428,12 +429,13 @@ class CodeBlock : public ThreadSafeRefCounted, public UnconditionalFi ValueProfile* valueProfileForBytecodeOffset(int bytecodeOffset) { ValueProfile* result = binarySearch( - m_valueProfiles, m_valueProfiles.size(), bytecodeOffset, - getValueProfileBytecodeOffset); + m_valueProfiles, m_valueProfiles.size(), bytecodeOffset, + getValueProfileBytecodeOffset); ASSERT(result->m_bytecodeOffset != -1); ASSERT(instructions()[bytecodeOffset + opcodeLength( - m_vm->interpreter->getOpcodeID( - instructions()[bytecodeOffset].u.opcode)) - 1].u.profile == result); + m_vm->interpreter->getOpcodeID( + instructions()[ + bytecodeOffset].u.opcode)) - 1].u.profile == result); return result; } SpeculatedType valueProfilePredictionForBytecodeOffset(const ConcurrentJITLocker& locker, int bytecodeOffset) @@ -541,6 +543,7 @@ class CodeBlock : public ThreadSafeRefCounted, public UnconditionalFi } ArrayProfile* getArrayProfile(unsigned bytecodeOffset); ArrayProfile* getOrAddArrayProfile(unsigned bytecodeOffset); +#endif // Exception handling support @@ -881,11 +884,22 @@ class CodeBlock : public ThreadSafeRefCounted, public UnconditionalFi unsigned numberOfDFGCompiles() { return 0; } #endif +#if ENABLE(VALUE_PROFILER) bool shouldOptimizeNow(); void updateAllValueProfilePredictions(); void updateAllArrayPredictions(); void updateAllPredictions(); +#else + bool updateAllPredictionsAndCheckIfShouldOptimizeNow() { return false; } + void updateAllValueProfilePredictions() { } + void updateAllArrayPredictions() { } + void updateAllPredictions() { } +#endif +#if ENABLE(VERBOSE_VALUE_PROFILE) + void dumpValueProfiles(); +#endif + unsigned frameRegisterCount(); // FIXME: Make these remaining members private. @@ -945,7 +959,9 @@ class CodeBlock : public ThreadSafeRefCounted, public UnconditionalFi ClosureCallStubRoutine* findClosureCallForReturnPC(ReturnAddressPtr); #endif +#if ENABLE(VALUE_PROFILER) void updateAllPredictionsAndCountLiveness(unsigned& numberOfLiveNonArgumentValueProfiles, unsigned& numberOfSamplesInProfiles); +#endif void setConstantRegisters(const Vector>& constants) { @@ -980,7 +996,9 @@ class CodeBlock : public ThreadSafeRefCounted, public UnconditionalFi void beginDumpProfiling(PrintStream&, bool& hasPrintedProfiling); void dumpValueProfiling(PrintStream&, const Instruction*&, bool& hasPrintedProfiling); void dumpArrayProfiling(PrintStream&, const Instruction*&, bool& hasPrintedProfiling); +#if ENABLE(VALUE_PROFILER) void dumpRareCaseProfile(PrintStream&, const char* name, RareCaseProfile*, bool& hasPrintedProfiling); +#endif #if ENABLE(DFG_JIT) bool shouldImmediatelyAssumeLivenessDuringScan() @@ -1062,12 +1080,14 @@ class CodeBlock : public ThreadSafeRefCounted, public UnconditionalFi DFG::ExitProfile m_exitProfile; CompressedLazyOperandValueProfileHolder m_lazyOperandValueProfiles; #endif +#if ENABLE(VALUE_PROFILER) Vector m_argumentValueProfiles; Vector m_valueProfiles; SegmentedVector m_rareCaseProfiles; SegmentedVector m_specialFastCaseProfiles; Vector m_arrayAllocationProfiles; ArrayProfileVector m_arrayProfiles; +#endif Vector m_objectAllocationProfiles; // Constant Pool @@ -1269,9 +1289,6 @@ inline void CodeBlockSet::mark(void* candidateCodeBlock) return; (*iter)->m_mayBeExecuting = true; -#if ENABLE(GGC) - m_currentlyExecuting.append(static_cast(candidateCodeBlock)); -#endif } } // namespace JSC diff --git a/JavaScriptCore/bytecode/GetByIdStatus.cpp b/JavaScriptCore/bytecode/GetByIdStatus.cpp index fbb3da1a..ada7dda5 100644 --- a/JavaScriptCore/bytecode/GetByIdStatus.cpp +++ b/JavaScriptCore/bytecode/GetByIdStatus.cpp @@ -69,7 +69,7 @@ GetByIdStatus GetByIdStatus::computeFromLLInt(CodeBlock* profiledBlock, unsigned void GetByIdStatus::computeForChain(GetByIdStatus& result, CodeBlock* profiledBlock, StringImpl* uid) { -#if ENABLE(JIT) +#if ENABLE(JIT) && ENABLE(VALUE_PROFILER) // Validate the chain. If the chain is invalid, then currently the best thing // we can do is to assume that TakesSlow is true. In the future, it might be // worth exploring reifying the structure chain from the structure we've got @@ -123,7 +123,7 @@ GetByIdStatus GetByIdStatus::computeFor(CodeBlock* profiledBlock, StubInfoMap& m UNUSED_PARAM(profiledBlock); UNUSED_PARAM(bytecodeIndex); UNUSED_PARAM(uid); -#if ENABLE(JIT) +#if ENABLE(JIT) && ENABLE(VALUE_PROFILER) StructureStubInfo* stubInfo = map.get(CodeOrigin(bytecodeIndex)); if (!stubInfo || !stubInfo->seen) return computeFromLLInt(profiledBlock, bytecodeIndex, uid); diff --git a/JavaScriptCore/bytecode/LazyOperandValueProfile.cpp b/JavaScriptCore/bytecode/LazyOperandValueProfile.cpp index a8ad779a..4e906472 100644 --- a/JavaScriptCore/bytecode/LazyOperandValueProfile.cpp +++ b/JavaScriptCore/bytecode/LazyOperandValueProfile.cpp @@ -26,6 +26,8 @@ #include "config.h" #include "LazyOperandValueProfile.h" +#if ENABLE(VALUE_PROFILER) + #include "Operations.h" namespace JSC { @@ -98,3 +100,5 @@ SpeculatedType LazyOperandValueProfileParser::prediction( } // namespace JSC +#endif // ENABLE(VALUE_PROFILER) + diff --git a/JavaScriptCore/bytecode/LazyOperandValueProfile.h b/JavaScriptCore/bytecode/LazyOperandValueProfile.h index 95ef941c..483e5b5b 100644 --- a/JavaScriptCore/bytecode/LazyOperandValueProfile.h +++ b/JavaScriptCore/bytecode/LazyOperandValueProfile.h @@ -26,6 +26,10 @@ #ifndef LazyOperandValueProfile_h #define LazyOperandValueProfile_h +#include + +#if ENABLE(VALUE_PROFILER) + #include "ConcurrentJITLock.h" #include "ValueProfile.h" #include "VirtualRegister.h" @@ -184,6 +188,8 @@ class LazyOperandValueProfileParser { } // namespace JSC +#endif // ENABLE(VALUE_PROFILER) + #endif // LazyOperandValueProfile_h diff --git a/JavaScriptCore/bytecode/PutByIdStatus.cpp b/JavaScriptCore/bytecode/PutByIdStatus.cpp index 17cf7089..1b38fbbb 100644 --- a/JavaScriptCore/bytecode/PutByIdStatus.cpp +++ b/JavaScriptCore/bytecode/PutByIdStatus.cpp @@ -88,7 +88,7 @@ PutByIdStatus PutByIdStatus::computeFor(CodeBlock* profiledBlock, StubInfoMap& m UNUSED_PARAM(profiledBlock); UNUSED_PARAM(bytecodeIndex); UNUSED_PARAM(uid); -#if ENABLE(JIT) +#if ENABLE(JIT) && ENABLE(VALUE_PROFILER) if (profiledBlock->likelyToTakeSlowCase(bytecodeIndex)) return PutByIdStatus(TakesSlowPath, 0, 0, 0, invalidOffset); diff --git a/JavaScriptCore/bytecode/ValueProfile.h b/JavaScriptCore/bytecode/ValueProfile.h index 0790f79d..0db91669 100644 --- a/JavaScriptCore/bytecode/ValueProfile.h +++ b/JavaScriptCore/bytecode/ValueProfile.h @@ -29,6 +29,10 @@ #ifndef ValueProfile_h #define ValueProfile_h +#include + +#if ENABLE(VALUE_PROFILER) + #include "ConcurrentJITLock.h" #include "Heap.h" #include "JSArray.h" @@ -208,5 +212,7 @@ inline int getRareCaseProfileBytecodeOffset(RareCaseProfile* rareCaseProfile) } // namespace JSC +#endif // ENABLE(VALUE_PROFILER) + #endif // ValueProfile_h diff --git a/JavaScriptCore/bytecode/Watchpoint.h b/JavaScriptCore/bytecode/Watchpoint.h index 07b1b014..79e2d2fc 100644 --- a/JavaScriptCore/bytecode/Watchpoint.h +++ b/JavaScriptCore/bytecode/Watchpoint.h @@ -132,11 +132,10 @@ class WatchpointSet : public ThreadSafeRefCounted { void fireAllWatchpoints(); friend class InlineWatchpointSet; - + + SentinelLinkedList> m_set; int8_t m_state; int8_t m_setIsNotEmpty; - - SentinelLinkedList> m_set; }; // InlineWatchpointSet is a low-overhead, non-copyable watchpoint set in which diff --git a/JavaScriptCore/bytecompiler/BytecodeGenerator.cpp b/JavaScriptCore/bytecompiler/BytecodeGenerator.cpp index 6a6cab24..891b5dee 100644 --- a/JavaScriptCore/bytecompiler/BytecodeGenerator.cpp +++ b/JavaScriptCore/bytecompiler/BytecodeGenerator.cpp @@ -636,12 +636,20 @@ void BytecodeGenerator::emitOpcode(OpcodeID opcodeID) UnlinkedArrayProfile BytecodeGenerator::newArrayProfile() { +#if ENABLE(VALUE_PROFILER) return m_codeBlock->addArrayProfile(); +#else + return 0; +#endif } UnlinkedArrayAllocationProfile BytecodeGenerator::newArrayAllocationProfile() { +#if ENABLE(VALUE_PROFILER) return m_codeBlock->addArrayAllocationProfile(); +#else + return 0; +#endif } UnlinkedObjectAllocationProfile BytecodeGenerator::newObjectAllocationProfile() @@ -651,7 +659,11 @@ UnlinkedObjectAllocationProfile BytecodeGenerator::newObjectAllocationProfile() UnlinkedValueProfile BytecodeGenerator::emitProfiledOpcode(OpcodeID opcodeID) { +#if ENABLE(VALUE_PROFILER) UnlinkedValueProfile result = m_codeBlock->addValueProfile(); +#else + UnlinkedValueProfile result = 0; +#endif emitOpcode(opcodeID); return result; } @@ -1954,10 +1966,6 @@ void BytecodeGenerator::emitDebugHook(DebugHookID debugHookID, unsigned line, un void BytecodeGenerator::pushFinallyContext(StatementNode* finallyBlock) { - // Reclaim free label scopes. - while (m_labelScopes.size() && !m_labelScopes.last().refCount()) - m_labelScopes.removeLast(); - ControlFlowContext scope; scope.isFinallyBlock = true; FinallyContext context = { diff --git a/JavaScriptCore/debugger/Debugger.h b/JavaScriptCore/debugger/Debugger.h index d428de8d..886e9ec2 100644 --- a/JavaScriptCore/debugger/Debugger.h +++ b/JavaScriptCore/debugger/Debugger.h @@ -195,7 +195,7 @@ class JS_EXPORT_PRIVATE Debugger { class Debugger { public: - Debugger(bool = false) : m_needsOpDebugCallbacks(false) { } + Debugger(bool = false) { } bool needsOpDebugCallbacks() const { return false; } bool needsExceptionCallbacks() const { return false; } void detach(JSGlobalObject*) { } @@ -207,8 +207,6 @@ class Debugger { void willExecuteProgram(CallFrame*) { } void didExecuteProgram(CallFrame*) { } void didReachBreakpoint(CallFrame*) { } - - bool m_needsOpDebugCallbacks; }; #endif // ENABLE(JAVASCRIPT_DEBUGGER) diff --git a/JavaScriptCore/dfg/DFGAbstractInterpreterInlines.h b/JavaScriptCore/dfg/DFGAbstractInterpreterInlines.h index ddcb38a2..4ea1e09f 100644 --- a/JavaScriptCore/dfg/DFGAbstractInterpreterInlines.h +++ b/JavaScriptCore/dfg/DFGAbstractInterpreterInlines.h @@ -202,6 +202,11 @@ bool AbstractInterpreter::executeEffects(unsigned clobberLimi break; } + case ZombieHint: { + RELEASE_ASSERT_NOT_REACHED(); + break; + } + case SetArgument: // Assert that the state of arguments has been set. ASSERT(!m_state.block()->valuesAtHead.operand(node->local()).isClear()); @@ -249,24 +254,18 @@ bool AbstractInterpreter::executeEffects(unsigned clobberLimi case UInt32ToNumber: { JSValue child = forNode(node->child1()).value(); - if (doesOverflow(node->arithMode())) { - if (child && child.isInt32()) { - uint32_t value = child.asInt32(); - setConstant(node, jsNumber(value)); - break; - } - forNode(node).setType(SpecDouble); + if (child && child.isNumber()) { + ASSERT(child.isInt32()); + uint32_t value = child.asInt32(); + setConstant(node, jsNumber(value)); break; } - if (child && child.isInt32()) { - int32_t value = child.asInt32(); - if (value >= 0) { - setConstant(node, jsNumber(value)); - break; - } + if (!node->canSpeculateInt32()) + forNode(node).setType(SpecDouble); + else { + forNode(node).setType(SpecInt32); + node->setCanExit(true); } - forNode(node).setType(SpecInt32); - node->setCanExit(true); break; } @@ -342,6 +341,12 @@ bool AbstractInterpreter::executeEffects(unsigned clobberLimi } case ValueAdd: { + JSValue left = forNode(node->child1()).value(); + JSValue right = forNode(node->child2()).value(); + if (left && right && left.isNumber() && right.isNumber()) { + setConstant(node, JSValue(left.asNumber() + right.asNumber())); + break; + } ASSERT(node->binaryUseKind() == UntypedUse); clobberWorld(node->codeOrigin, clobberLimit); forNode(node).setType(SpecString | SpecBytecodeNumber); @@ -351,41 +356,23 @@ bool AbstractInterpreter::executeEffects(unsigned clobberLimi case ArithAdd: { JSValue left = forNode(node->child1()).value(); JSValue right = forNode(node->child2()).value(); + if (left && right && left.isNumber() && right.isNumber()) { + setConstant(node, JSValue(left.asNumber() + right.asNumber())); + break; + } switch (node->binaryUseKind()) { case Int32Use: - if (left && right && left.isInt32() && right.isInt32()) { - if (!shouldCheckOverflow(node->arithMode())) { - setConstant(node, jsNumber(left.asInt32() + right.asInt32())); - break; - } - JSValue result = jsNumber(left.asNumber() + right.asNumber()); - if (result.isInt32()) { - setConstant(node, result); - break; - } - } forNode(node).setType(SpecInt32); - if (shouldCheckOverflow(node->arithMode())) + if (!bytecodeCanTruncateInteger(node->arithNodeFlags())) node->setCanExit(true); break; case MachineIntUse: - if (left && right && left.isMachineInt() && right.isMachineInt()) { - JSValue result = jsNumber(left.asMachineInt() + right.asMachineInt()); - if (result.isMachineInt()) { - setConstant(node, result); - break; - } - } forNode(node).setType(SpecInt52); if (!forNode(node->child1()).isType(SpecInt32) || !forNode(node->child2()).isType(SpecInt32)) node->setCanExit(true); break; case NumberUse: - if (left && right && left.isNumber() && right.isNumber()) { - setConstant(node, jsNumber(left.asNumber() + right.asNumber())); - break; - } if (isFullRealNumberSpeculation(forNode(node->child1()).m_type) && isFullRealNumberSpeculation(forNode(node->child2()).m_type)) forNode(node).setType(SpecDoubleReal); @@ -407,41 +394,23 @@ bool AbstractInterpreter::executeEffects(unsigned clobberLimi case ArithSub: { JSValue left = forNode(node->child1()).value(); JSValue right = forNode(node->child2()).value(); + if (left && right && left.isNumber() && right.isNumber()) { + setConstant(node, JSValue(left.asNumber() - right.asNumber())); + break; + } switch (node->binaryUseKind()) { case Int32Use: - if (left && right && left.isInt32() && right.isInt32()) { - if (!shouldCheckOverflow(node->arithMode())) { - setConstant(node, jsNumber(left.asInt32() - right.asInt32())); - break; - } - JSValue result = jsNumber(left.asNumber() - right.asNumber()); - if (result.isInt32()) { - setConstant(node, result); - break; - } - } forNode(node).setType(SpecInt32); - if (shouldCheckOverflow(node->arithMode())) + if (!bytecodeCanTruncateInteger(node->arithNodeFlags())) node->setCanExit(true); break; case MachineIntUse: - if (left && right && left.isMachineInt() && right.isMachineInt()) { - JSValue result = jsNumber(left.asMachineInt() - right.asMachineInt()); - if (result.isMachineInt() || !shouldCheckOverflow(node->arithMode())) { - setConstant(node, result); - break; - } - } forNode(node).setType(SpecInt52); if (!forNode(node->child1()).isType(SpecInt32) || !forNode(node->child2()).isType(SpecInt32)) node->setCanExit(true); break; case NumberUse: - if (left && right && left.isNumber() && right.isNumber()) { - setConstant(node, jsNumber(left.asNumber() - right.asNumber())); - break; - } forNode(node).setType(SpecDouble); break; default: @@ -453,52 +422,24 @@ bool AbstractInterpreter::executeEffects(unsigned clobberLimi case ArithNegate: { JSValue child = forNode(node->child1()).value(); + if (child && child.isNumber()) { + setConstant(node, JSValue(-child.asNumber())); + break; + } switch (node->child1().useKind()) { case Int32Use: - if (child && child.isInt32()) { - if (!shouldCheckOverflow(node->arithMode())) { - setConstant(node, jsNumber(-child.asInt32())); - break; - } - double doubleResult; - if (shouldCheckNegativeZero(node->arithMode())) - doubleResult = -child.asNumber(); - else - doubleResult = 0 - child.asNumber(); - JSValue valueResult = jsNumber(doubleResult); - if (valueResult.isInt32()) { - setConstant(node, valueResult); - break; - } - } forNode(node).setType(SpecInt32); - if (shouldCheckOverflow(node->arithMode())) + if (!bytecodeCanTruncateInteger(node->arithNodeFlags())) node->setCanExit(true); break; case MachineIntUse: - if (child && child.isMachineInt()) { - double doubleResult; - if (shouldCheckNegativeZero(node->arithMode())) - doubleResult = -child.asNumber(); - else - doubleResult = 0 - child.asNumber(); - JSValue valueResult = jsNumber(doubleResult); - if (valueResult.isMachineInt()) { - setConstant(node, valueResult); - break; - } - } forNode(node).setType(SpecInt52); if (m_state.forNode(node->child1()).couldBeType(SpecInt52)) node->setCanExit(true); - if (shouldCheckNegativeZero(node->arithMode())) + if (!bytecodeCanIgnoreNegativeZero(node->arithNodeFlags())) node->setCanExit(true); break; case NumberUse: - if (child && child.isNumber()) { - setConstant(node, jsNumber(-child.asNumber())); - break; - } forNode(node).setType(SpecDouble); break; default: @@ -511,45 +452,22 @@ bool AbstractInterpreter::executeEffects(unsigned clobberLimi case ArithMul: { JSValue left = forNode(node->child1()).value(); JSValue right = forNode(node->child2()).value(); + if (left && right && left.isNumber() && right.isNumber()) { + setConstant(node, JSValue(left.asNumber() * right.asNumber())); + break; + } switch (node->binaryUseKind()) { case Int32Use: - if (left && right && left.isInt32() && right.isInt32()) { - if (!shouldCheckOverflow(node->arithMode())) { - setConstant(node, jsNumber(left.asInt32() * right.asInt32())); - break; - } - double doubleResult = left.asNumber() * right.asNumber(); - if (!shouldCheckNegativeZero(node->arithMode())) - doubleResult += 0; // Sanitizes zero. - JSValue valueResult = jsNumber(doubleResult); - if (valueResult.isInt32()) { - setConstant(node, valueResult); - break; - } - } forNode(node).setType(SpecInt32); - if (shouldCheckOverflow(node->arithMode())) + if (!bytecodeCanTruncateInteger(node->arithNodeFlags()) + || !bytecodeCanIgnoreNegativeZero(node->arithNodeFlags())) node->setCanExit(true); break; case MachineIntUse: - if (left && right && left.isMachineInt() && right.isMachineInt()) { - double doubleResult = left.asNumber() * right.asNumber(); - if (!shouldCheckNegativeZero(node->arithMode())) - doubleResult += 0; - JSValue valueResult = jsNumber(doubleResult); - if (valueResult.isMachineInt()) { - setConstant(node, valueResult); - break; - } - } forNode(node).setType(SpecInt52); node->setCanExit(true); break; case NumberUse: - if (left && right && left.isNumber() && right.isNumber()) { - setConstant(node, jsNumber(left.asNumber() * right.asNumber())); - break; - } if (isFullRealNumberSpeculation(forNode(node->child1()).m_type) || isFullRealNumberSpeculation(forNode(node->child2()).m_type)) forNode(node).setType(SpecDoubleReal); @@ -562,122 +480,46 @@ bool AbstractInterpreter::executeEffects(unsigned clobberLimi } break; } - - case ArithDiv: { - JSValue left = forNode(node->child1()).value(); - JSValue right = forNode(node->child2()).value(); - switch (node->binaryUseKind()) { - case Int32Use: - if (left && right && left.isInt32() && right.isInt32()) { - double doubleResult = left.asNumber() / right.asNumber(); - if (!shouldCheckOverflow(node->arithMode())) - doubleResult = toInt32(doubleResult); - else if (!shouldCheckNegativeZero(node->arithMode())) - doubleResult += 0; // Sanitizes zero. - JSValue valueResult = jsNumber(doubleResult); - if (valueResult.isInt32()) { - setConstant(node, valueResult); - break; - } - } - forNode(node).setType(SpecInt32); - node->setCanExit(true); - break; - case NumberUse: - if (left && right && left.isNumber() && right.isNumber()) { - setConstant(node, jsNumber(left.asNumber() / right.asNumber())); - break; - } - forNode(node).setType(SpecDouble); - break; - default: - RELEASE_ASSERT_NOT_REACHED(); - break; - } + + case ArithIMul: { + forNode(node).setType(SpecInt32); break; } - + + case ArithDiv: + case ArithMin: + case ArithMax: case ArithMod: { JSValue left = forNode(node->child1()).value(); JSValue right = forNode(node->child2()).value(); - switch (node->binaryUseKind()) { - case Int32Use: - if (left && right && left.isInt32() && right.isInt32()) { - double doubleResult = fmod(left.asNumber(), right.asNumber()); - if (!shouldCheckOverflow(node->arithMode())) - doubleResult = toInt32(doubleResult); - else if (!shouldCheckNegativeZero(node->arithMode())) - doubleResult += 0; // Sanitizes zero. - JSValue valueResult = jsNumber(doubleResult); - if (valueResult.isInt32()) { - setConstant(node, valueResult); - break; - } - } - forNode(node).setType(SpecInt32); - node->setCanExit(true); - break; - case NumberUse: - if (left && right && left.isNumber() && right.isNumber()) { - setConstant(node, jsNumber(fmod(left.asNumber(), right.asNumber()))); + if (left && right && left.isNumber() && right.isNumber()) { + double a = left.asNumber(); + double b = right.asNumber(); + switch (node->op()) { + case ArithDiv: + setConstant(node, JSValue(a / b)); break; - } - forNode(node).setType(SpecDouble); - break; - default: - RELEASE_ASSERT_NOT_REACHED(); - break; - } - break; - } - - case ArithMin: { - JSValue left = forNode(node->child1()).value(); - JSValue right = forNode(node->child2()).value(); - switch (node->binaryUseKind()) { - case Int32Use: - if (left && right && left.isInt32() && right.isInt32()) { - setConstant(node, jsNumber(std::min(left.asInt32(), right.asInt32()))); + case ArithMin: + setConstant(node, JSValue(a < b ? a : (b <= a ? b : a + b))); break; - } - forNode(node).setType(SpecInt32); - node->setCanExit(true); - break; - case NumberUse: - if (left && right && left.isNumber() && right.isNumber()) { - double a = left.asNumber(); - double b = right.asNumber(); - setConstant(node, jsNumber(a < b ? a : (b <= a ? b : a + b))); + case ArithMax: + setConstant(node, JSValue(a > b ? a : (b >= a ? b : a + b))); + break; + case ArithMod: + setConstant(node, JSValue(fmod(a, b))); + break; + default: + RELEASE_ASSERT_NOT_REACHED(); break; } - forNode(node).setType(SpecDouble); - break; - default: - RELEASE_ASSERT_NOT_REACHED(); break; } - break; - } - - case ArithMax: { - JSValue left = forNode(node->child1()).value(); - JSValue right = forNode(node->child2()).value(); switch (node->binaryUseKind()) { case Int32Use: - if (left && right && left.isInt32() && right.isInt32()) { - setConstant(node, jsNumber(std::max(left.asInt32(), right.asInt32()))); - break; - } forNode(node).setType(SpecInt32); node->setCanExit(true); break; case NumberUse: - if (left && right && left.isNumber() && right.isNumber()) { - double a = left.asNumber(); - double b = right.asNumber(); - setConstant(node, jsNumber(a > b ? a : (b >= a ? b : a + b))); - break; - } forNode(node).setType(SpecDouble); break; default: @@ -689,23 +531,16 @@ bool AbstractInterpreter::executeEffects(unsigned clobberLimi case ArithAbs: { JSValue child = forNode(node->child1()).value(); + if (child && child.isNumber()) { + setConstant(node, JSValue(fabs(child.asNumber()))); + break; + } switch (node->child1().useKind()) { case Int32Use: - if (child && child.isInt32()) { - JSValue result = jsNumber(fabs(child.asNumber())); - if (result.isInt32()) { - setConstant(node, result); - break; - } - } forNode(node).setType(SpecInt32); node->setCanExit(true); break; case NumberUse: - if (child && child.isNumber()) { - setConstant(node, jsNumber(child.asNumber())); - break; - } forNode(node).setType(SpecDouble); break; default: @@ -1788,10 +1623,11 @@ bool AbstractInterpreter::executeEffects(unsigned clobberLimi node->setCanExit(true); break; - case ZombieHint: case Unreachable: + RELEASE_ASSERT_NOT_REACHED(); + break; + case LastNodeType: - case ArithIMul: RELEASE_ASSERT_NOT_REACHED(); break; } diff --git a/JavaScriptCore/dfg/DFGArithMode.cpp b/JavaScriptCore/dfg/DFGArithMode.cpp deleted file mode 100644 index cc9699a0..00000000 --- a/JavaScriptCore/dfg/DFGArithMode.cpp +++ /dev/null @@ -1,60 +0,0 @@ -/* - * Copyright (C) 2014 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 "DFGArithMode.h" - -#if ENABLE(DFG_JIT) - -#include - -namespace WTF { - -void printInternal(PrintStream& out, JSC::DFG::Arith::Mode mode) -{ - switch (mode) { - case JSC::DFG::Arith::NotSet: - out.print("NotSet"); - return; - case JSC::DFG::Arith::Unchecked: - out.print("Unchecked"); - return; - case JSC::DFG::Arith::CheckOverflow: - out.print("CheckOverflow"); - return; - case JSC::DFG::Arith::CheckOverflowAndNegativeZero: - out.print("CheckOverflowAndNegativeZero"); - return; - case JSC::DFG::Arith::DoOverflow: - out.print("DoOverflow"); - return; - } - RELEASE_ASSERT_NOT_REACHED(); -} - -} // namespace WTF - -#endif // ENABLE(DFG_JIT) - diff --git a/JavaScriptCore/dfg/DFGArithMode.h b/JavaScriptCore/dfg/DFGArithMode.h deleted file mode 100644 index 05baf9eb..00000000 --- a/JavaScriptCore/dfg/DFGArithMode.h +++ /dev/null @@ -1,109 +0,0 @@ -/* - * Copyright (C) 2014 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. - */ - -#ifndef DFGArithMode_h -#define DFGArithMode_h - -#if ENABLE(DFG_JIT) - -namespace JSC { namespace DFG { - -// Arith::Mode describes the mode of an arithmetic operation that speculates integer. -// Note that not all modes are valid for all operations. -namespace Arith { -enum Mode { - NotSet, // Arithmetic mode is either not relevant because we're using doubles anyway or we are at a phase in compilation where we don't know what we're doing, yet. Should never see this after FixupPhase except for nodes that take doubles as inputs already. - Unchecked, // Don't check anything and just do the direct hardware operation. - CheckOverflow, // Check for overflow but don't bother with negative zero. - CheckOverflowAndNegativeZero, // Check for both overflow and negative zero. - DoOverflow // Up-convert to the smallest type that soundly represents all possible results after input type speculation. -}; -} // namespace Arith - -inline bool doesOverflow(Arith::Mode mode) -{ - switch (mode) { - case Arith::NotSet: - ASSERT_NOT_REACHED(); - case Arith::Unchecked: - case Arith::CheckOverflow: - case Arith::CheckOverflowAndNegativeZero: - return false; - case Arith::DoOverflow: - return true; - } - ASSERT_NOT_REACHED(); - return true; -} - -// It's only valid to call this once you've determined that you don't need to *do* -// overflow. For most nodes, that's implicit. -inline bool shouldCheckOverflow(Arith::Mode mode) -{ - switch (mode) { - case Arith::NotSet: - case Arith::DoOverflow: - ASSERT_NOT_REACHED(); - return true; - case Arith::Unchecked: - return false; - case Arith::CheckOverflow: - case Arith::CheckOverflowAndNegativeZero: - return true; - } - ASSERT_NOT_REACHED(); - return true; -} - -inline bool shouldCheckNegativeZero(Arith::Mode mode) -{ - switch (mode) { - case Arith::NotSet: - case Arith::DoOverflow: - ASSERT_NOT_REACHED(); - return true; - case Arith::Unchecked: - case Arith::CheckOverflow: - return false; - case Arith::CheckOverflowAndNegativeZero: - return true; - } - ASSERT_NOT_REACHED(); - return true; -} - -} } // namespace JSC::DFG - -namespace WTF { - -class PrintStream; -void printInternal(PrintStream&, JSC::DFG::Arith::Mode); - -} // namespace WTF - -#endif // ENABLE(DFG_JIT) - -#endif // DFGArithMode_h - diff --git a/JavaScriptCore/dfg/DFGBackwardsPropagationPhase.cpp b/JavaScriptCore/dfg/DFGBackwardsPropagationPhase.cpp index a7ef96d7..86693a19 100644 --- a/JavaScriptCore/dfg/DFGBackwardsPropagationPhase.cpp +++ b/JavaScriptCore/dfg/DFGBackwardsPropagationPhase.cpp @@ -114,7 +114,8 @@ class BackwardsPropagationPhase : public Phase { case BitOr: case BitXor: - case BitLShift: { + case BitLShift: + case ValueToInt32: { return power > 31; } @@ -204,6 +205,13 @@ class BackwardsPropagationPhase : public Phase { break; } + case ValueToInt32: { + flags |= NodeBytecodeUsesAsInt; + flags &= ~(NodeBytecodeUsesAsNumber | NodeBytecodeNeedsNegZero | NodeBytecodeUsesAsOther); + node->child1()->mergeFlags(flags); + break; + } + case StringCharCodeAt: { node->child1()->mergeFlags(NodeBytecodeUsesAsValue); node->child2()->mergeFlags(NodeBytecodeUsesAsValue | NodeBytecodeUsesAsInt); diff --git a/JavaScriptCore/dfg/DFGByteCodeParser.cpp b/JavaScriptCore/dfg/DFGByteCodeParser.cpp index 35d55e4c..a31851b7 100644 --- a/JavaScriptCore/dfg/DFGByteCodeParser.cpp +++ b/JavaScriptCore/dfg/DFGByteCodeParser.cpp @@ -505,6 +505,30 @@ class ByteCodeParser { flush(m_inlineStackTop); } + // Get an operand, and perform a ToInt32/ToNumber conversion on it. + Node* getToInt32(int operand) + { + return toInt32(get(VirtualRegister(operand))); + } + + // Perform an ES5 ToInt32 operation - returns a node of type NodeResultInt32. + Node* toInt32(Node* node) + { + if (node->hasInt32Result()) + return node; + + // Check for numeric constants boxed as JSValues. + if (canFold(node)) { + JSValue v = valueOfJSConstant(node); + if (v.isInt32()) + return getJSConstant(node->constantNumber()); + if (v.isNumber()) + return getJSConstantForValue(JSValue(JSC::toInt32(v.asNumber()))); + } + + return addToGraph(ValueToInt32, node); + } + // NOTE: Only use this to construct constants that arise from non-speculative // constant folding. I.e. creating constants using this if we had constant // field inference would be a bad idea, since the bytecode parser's folding @@ -1553,9 +1577,9 @@ bool ByteCodeParser::handleIntrinsic(int resultOperand, Intrinsic intrinsic, int if (argumentCountIncludingThis != 2) return false; - VirtualRegister thisOperand = virtualRegisterForArgument(0, registerOffset); - VirtualRegister indexOperand = virtualRegisterForArgument(1, registerOffset); - Node* charCode = addToGraph(StringCharCodeAt, OpInfo(ArrayMode(Array::String).asWord()), get(thisOperand), get(indexOperand)); + int thisOperand = virtualRegisterForArgument(0, registerOffset).offset(); + int indexOperand = virtualRegisterForArgument(1, registerOffset).offset(); + Node* charCode = addToGraph(StringCharCodeAt, OpInfo(ArrayMode(Array::String).asWord()), get(VirtualRegister(thisOperand)), getToInt32(indexOperand)); set(VirtualRegister(resultOperand), charCode); return true; @@ -1565,9 +1589,9 @@ bool ByteCodeParser::handleIntrinsic(int resultOperand, Intrinsic intrinsic, int if (argumentCountIncludingThis != 2) return false; - VirtualRegister thisOperand = virtualRegisterForArgument(0, registerOffset); - VirtualRegister indexOperand = virtualRegisterForArgument(1, registerOffset); - Node* charCode = addToGraph(StringCharAt, OpInfo(ArrayMode(Array::String).asWord()), get(thisOperand), get(indexOperand)); + int thisOperand = virtualRegisterForArgument(0, registerOffset).offset(); + int indexOperand = virtualRegisterForArgument(1, registerOffset).offset(); + Node* charCode = addToGraph(StringCharAt, OpInfo(ArrayMode(Array::String).asWord()), get(VirtualRegister(thisOperand)), getToInt32(indexOperand)); set(VirtualRegister(resultOperand), charCode); return true; @@ -1576,8 +1600,8 @@ bool ByteCodeParser::handleIntrinsic(int resultOperand, Intrinsic intrinsic, int if (argumentCountIncludingThis != 2) return false; - VirtualRegister indexOperand = virtualRegisterForArgument(1, registerOffset); - Node* charCode = addToGraph(StringFromCharCode, get(indexOperand)); + int indexOperand = virtualRegisterForArgument(1, registerOffset).offset(); + Node* charCode = addToGraph(StringFromCharCode, getToInt32(indexOperand)); set(VirtualRegister(resultOperand), charCode); @@ -1607,10 +1631,10 @@ bool ByteCodeParser::handleIntrinsic(int resultOperand, Intrinsic intrinsic, int case IMulIntrinsic: { if (argumentCountIncludingThis != 3) return false; - VirtualRegister leftOperand = virtualRegisterForArgument(1, registerOffset); - VirtualRegister rightOperand = virtualRegisterForArgument(2, registerOffset); - Node* left = get(leftOperand); - Node* right = get(rightOperand); + int leftOperand = virtualRegisterForArgument(1, registerOffset).offset(); + int rightOperand = virtualRegisterForArgument(2, registerOffset).offset(); + Node* left = getToInt32(leftOperand); + Node* right = getToInt32(rightOperand); set(VirtualRegister(resultOperand), addToGraph(ArithIMul, left, right)); return true; } @@ -2029,45 +2053,45 @@ bool ByteCodeParser::parseBlock(unsigned limit) // === Bitwise operations === case op_bitand: { - Node* op1 = get(VirtualRegister(currentInstruction[2].u.operand)); - Node* op2 = get(VirtualRegister(currentInstruction[3].u.operand)); + Node* op1 = getToInt32(currentInstruction[2].u.operand); + Node* op2 = getToInt32(currentInstruction[3].u.operand); set(VirtualRegister(currentInstruction[1].u.operand), addToGraph(BitAnd, op1, op2)); NEXT_OPCODE(op_bitand); } case op_bitor: { - Node* op1 = get(VirtualRegister(currentInstruction[2].u.operand)); - Node* op2 = get(VirtualRegister(currentInstruction[3].u.operand)); + Node* op1 = getToInt32(currentInstruction[2].u.operand); + Node* op2 = getToInt32(currentInstruction[3].u.operand); set(VirtualRegister(currentInstruction[1].u.operand), addToGraph(BitOr, op1, op2)); NEXT_OPCODE(op_bitor); } case op_bitxor: { - Node* op1 = get(VirtualRegister(currentInstruction[2].u.operand)); - Node* op2 = get(VirtualRegister(currentInstruction[3].u.operand)); + Node* op1 = getToInt32(currentInstruction[2].u.operand); + Node* op2 = getToInt32(currentInstruction[3].u.operand); set(VirtualRegister(currentInstruction[1].u.operand), addToGraph(BitXor, op1, op2)); NEXT_OPCODE(op_bitxor); } case op_rshift: { - Node* op1 = get(VirtualRegister(currentInstruction[2].u.operand)); - Node* op2 = get(VirtualRegister(currentInstruction[3].u.operand)); + Node* op1 = getToInt32(currentInstruction[2].u.operand); + Node* op2 = getToInt32(currentInstruction[3].u.operand); set(VirtualRegister(currentInstruction[1].u.operand), addToGraph(BitRShift, op1, op2)); NEXT_OPCODE(op_rshift); } case op_lshift: { - Node* op1 = get(VirtualRegister(currentInstruction[2].u.operand)); - Node* op2 = get(VirtualRegister(currentInstruction[3].u.operand)); + Node* op1 = getToInt32(currentInstruction[2].u.operand); + Node* op2 = getToInt32(currentInstruction[3].u.operand); set(VirtualRegister(currentInstruction[1].u.operand), addToGraph(BitLShift, op1, op2)); NEXT_OPCODE(op_lshift); } case op_urshift: { - Node* op1 = get(VirtualRegister(currentInstruction[2].u.operand)); - Node* op2 = get(VirtualRegister(currentInstruction[3].u.operand)); + Node* op1 = getToInt32(currentInstruction[2].u.operand); + Node* op2 = getToInt32(currentInstruction[3].u.operand); set(VirtualRegister(currentInstruction[1].u.operand), addToGraph(BitURShift, op1, op2)); NEXT_OPCODE(op_urshift); @@ -2075,7 +2099,7 @@ bool ByteCodeParser::parseBlock(unsigned limit) case op_unsigned: { set(VirtualRegister(currentInstruction[1].u.operand), - makeSafe(addToGraph(UInt32ToNumber, get(VirtualRegister(currentInstruction[2].u.operand))))); + makeSafe(addToGraph(UInt32ToNumber, getToInt32(currentInstruction[2].u.operand)))); NEXT_OPCODE(op_unsigned); } diff --git a/JavaScriptCore/dfg/DFGCSEPhase.cpp b/JavaScriptCore/dfg/DFGCSEPhase.cpp index a4e159e7..7cc49abc 100644 --- a/JavaScriptCore/dfg/DFGCSEPhase.cpp +++ b/JavaScriptCore/dfg/DFGCSEPhase.cpp @@ -136,10 +136,8 @@ class CSEPhase : public Phase { if (node->op() != otherNode->op()) continue; - if (node->hasArithMode()) { - if (node->arithMode() != otherNode->arithMode()) - continue; - } + if (node->arithNodeFlags() != otherNode->arithNodeFlags()) + continue; Edge otherChild = otherNode->child1(); if (!otherChild) @@ -1084,6 +1082,7 @@ class CSEPhase : public Phase { case ArithSub: case ArithNegate: case ArithMul: + case ArithIMul: case ArithMod: case ArithDiv: case ArithAbs: diff --git a/JavaScriptCore/dfg/DFGConstantFoldingPhase.cpp b/JavaScriptCore/dfg/DFGConstantFoldingPhase.cpp index f5876116..83540819 100644 --- a/JavaScriptCore/dfg/DFGConstantFoldingPhase.cpp +++ b/JavaScriptCore/dfg/DFGConstantFoldingPhase.cpp @@ -355,21 +355,6 @@ class ConstantFoldingPhase : public Phase { } m_interpreter.execute(indexInBlock); - if (!m_state.isValid()) { - // If we invalidated then we shouldn't attempt to constant-fold. Here's an - // example: - // - // c: JSConstant(4.2) - // x: ValueToInt32(Check:Int32:@const) - // - // It would be correct for an analysis to assume that execution cannot - // proceed past @x. Therefore, constant-folding @x could be rather bad. But, - // the CFA may report that it found a constant even though it also reported - // that everything has been invalidated. This will only happen in a couple of - // the constant folding cases; most of them are also separately defensive - // about such things. - break; - } if (!node->shouldGenerate() || m_state.didClobber() || node->hasConstant()) continue; JSValue value = m_state.forNode(node).value(); diff --git a/JavaScriptCore/dfg/DFGFixupPhase.cpp b/JavaScriptCore/dfg/DFGFixupPhase.cpp index b39b0760..25eb9b54 100644 --- a/JavaScriptCore/dfg/DFGFixupPhase.cpp +++ b/JavaScriptCore/dfg/DFGFixupPhase.cpp @@ -94,33 +94,62 @@ class FixupPhase : public Phase { return; } + case BitOr: { + fixIntEdge(node->child1()); + fixIntEdge(node->child2()); + break; + } case BitAnd: - case BitOr: case BitXor: case BitRShift: case BitLShift: - case BitURShift: { - fixBinaryIntEdges(); - break; - } - + case BitURShift: case ArithIMul: { - fixBinaryIntEdges(); - node->setOp(ArithMul); - node->setArithMode(Arith::Unchecked); - node->child1().setUseKind(Int32Use); - node->child2().setUseKind(Int32Use); + fixIntEdge(node->child1()); + fixIntEdge(node->child2()); break; } case UInt32ToNumber: { - fixIntEdge(node->child1()); + fixEdge(node->child1()); if (bytecodeCanTruncateInteger(node->arithNodeFlags())) node->convertToIdentity(); - else if (nodeCanSpeculateInt32(node->arithNodeFlags())) - node->setArithMode(Arith::CheckOverflow); - else - node->setArithMode(Arith::DoOverflow); + break; + } + + case DoubleAsInt32: { + RELEASE_ASSERT_NOT_REACHED(); + break; + } + + case ValueToInt32: { + if (node->child1()->shouldSpeculateInt32()) { + fixEdge(node->child1()); + node->setOpAndDefaultFlags(Identity); + break; + } + + if (node->child1()->shouldSpeculateMachineInt()) { + fixEdge(node->child1()); + break; + } + + if (node->child1()->shouldSpeculateNumber()) { + fixEdge(node->child1()); + break; + } + + if (node->child1()->shouldSpeculateBoolean()) { + fixEdge(node->child1()); + break; + } + + fixEdge(node->child1()); + break; + } + + case Int32ToDouble: { + RELEASE_ASSERT_NOT_REACHED(); break; } @@ -181,20 +210,10 @@ class FixupPhase : public Phase { case ArithNegate: { if (m_graph.negateShouldSpeculateInt32(node)) { fixEdge(node->child1()); - if (bytecodeCanTruncateInteger(node->arithNodeFlags())) - node->setArithMode(Arith::Unchecked); - else if (bytecodeCanIgnoreNegativeZero(node->arithNodeFlags())) - node->setArithMode(Arith::CheckOverflow); - else - node->setArithMode(Arith::CheckOverflowAndNegativeZero); break; } if (m_graph.negateShouldSpeculateMachineInt(node)) { fixEdge(node->child1()); - if (bytecodeCanIgnoreNegativeZero(node->arithNodeFlags())) - node->setArithMode(Arith::CheckOverflow); - else - node->setArithMode(Arith::CheckOverflowAndNegativeZero); break; } fixEdge(node->child1()); @@ -205,21 +224,11 @@ class FixupPhase : public Phase { if (m_graph.mulShouldSpeculateInt32(node)) { fixEdge(node->child1()); fixEdge(node->child2()); - if (bytecodeCanTruncateInteger(node->arithNodeFlags())) - node->setArithMode(Arith::Unchecked); - else if (bytecodeCanIgnoreNegativeZero(node->arithNodeFlags())) - node->setArithMode(Arith::CheckOverflow); - else - node->setArithMode(Arith::CheckOverflowAndNegativeZero); break; } if (m_graph.mulShouldSpeculateMachineInt(node)) { fixEdge(node->child1()); fixEdge(node->child2()); - if (bytecodeCanIgnoreNegativeZero(node->arithNodeFlags())) - node->setArithMode(Arith::CheckOverflow); - else - node->setArithMode(Arith::CheckOverflowAndNegativeZero); break; } fixEdge(node->child1()); @@ -234,12 +243,6 @@ class FixupPhase : public Phase { if (optimizeForX86() || optimizeForARM64() || optimizeForARMv7s()) { fixEdge(node->child1()); fixEdge(node->child2()); - if (bytecodeCanTruncateInteger(node->arithNodeFlags())) - node->setArithMode(Arith::Unchecked); - else if (bytecodeCanIgnoreNegativeZero(node->arithNodeFlags())) - node->setArithMode(Arith::CheckOverflow); - else - node->setArithMode(Arith::CheckOverflowAndNegativeZero); break; } Edge child1 = node->child1(); @@ -255,10 +258,6 @@ class FixupPhase : public Phase { node->setOp(DoubleAsInt32); node->children.initialize(Edge(newDivision, KnownNumberUse), Edge(), Edge()); - if (bytecodeCanIgnoreNegativeZero(node->arithNodeFlags())) - node->setArithMode(Arith::CheckOverflow); - else - node->setArithMode(Arith::CheckOverflowAndNegativeZero); m_insertionSet.insertNode(m_indexInBlock + 1, SpecNone, Phantom, node->codeOrigin, child1, child2); break; @@ -932,9 +931,6 @@ class FixupPhase : public Phase { case CheckArray: case CheckInBounds: case ConstantStoragePointer: - case DoubleAsInt32: - case Int32ToDouble: - case ValueToInt32: // These are just nodes that we don't currently expect to see during fixup. // If we ever wanted to insert them prior to fixup, then we just have to create // fixup rules for them. @@ -1585,43 +1581,23 @@ class FixupPhase : public Phase { m_insertionSet.insert(indexInBlock, barrierNode); } - bool fixIntEdge(Edge& edge) + void fixIntEdge(Edge& edge) { Node* node = edge.node(); - if (node->shouldSpeculateInt32()) { - fixEdge(edge); - return false; + if (node->op() != ValueToInt32) { + fixEdge(edge); + return; } - UseKind useKind; - if (node->shouldSpeculateMachineInt()) - useKind = MachineIntUse; - else if (node->shouldSpeculateNumber()) - useKind = NumberUse; - else if (node->shouldSpeculateBoolean()) - useKind = BooleanUse; - else - useKind = NotCellUse; - Node* newNode = m_insertionSet.insertNode( - m_indexInBlock, SpecInt32, ValueToInt32, m_currentNode->codeOrigin, - Edge(node, useKind)); - observeUseKindOnNode(node, useKind); + Edge newEdge = node->child1(); - edge = Edge(newNode, KnownInt32Use); - return true; - } - - void fixBinaryIntEdges() - { - AdjacencyList children = m_currentNode->children; - - // Call fixIntEdge() on both edges. - bool needPhantom = - fixIntEdge(m_currentNode->child1()) | fixIntEdge(m_currentNode->child2()); - - if (!needPhantom) + if (newEdge.useKind() != Int32Use) { + edge.setUseKind(KnownInt32Use); return; - m_insertionSet.insertNode(m_indexInBlock + 1, SpecNone, Phantom, m_currentNode->codeOrigin, children); + } + + ASSERT(newEdge->shouldSpeculateInt32()); + edge = newEdge; } void injectInt32ToDoubleNode(Edge& edge, UseKind useKind = NumberUse) @@ -1679,17 +1655,12 @@ class FixupPhase : public Phase { truncateConstantsIfNecessary(node, mode); fixEdge(node->child1()); fixEdge(node->child2()); - if (bytecodeCanTruncateInteger(node->arithNodeFlags())) - node->setArithMode(Arith::Unchecked); - else - node->setArithMode(Arith::CheckOverflow); return true; } if (m_graph.addShouldSpeculateMachineInt(node)) { fixEdge(node->child1()); fixEdge(node->child2()); - node->setArithMode(Arith::CheckOverflow); return true; } diff --git a/JavaScriptCore/dfg/DFGGraph.cpp b/JavaScriptCore/dfg/DFGGraph.cpp index 8256007e..c5e1b041 100644 --- a/JavaScriptCore/dfg/DFGGraph.cpp +++ b/JavaScriptCore/dfg/DFGGraph.cpp @@ -198,8 +198,6 @@ void Graph::dump(PrintStream& out, const char* prefix, Node* node, DumpContext* out.print(comma, SpeculationDump(node->prediction())); if (node->hasArrayMode()) out.print(comma, node->arrayMode()); - if (node->hasArithMode()) - out.print(comma, node->arithMode()); if (node->hasVarNumber()) out.print(comma, node->varNumber()); if (node->hasRegisterPointer()) diff --git a/JavaScriptCore/dfg/DFGNode.h b/JavaScriptCore/dfg/DFGNode.h index 55a9ede8..a8d7e690 100644 --- a/JavaScriptCore/dfg/DFGNode.h +++ b/JavaScriptCore/dfg/DFGNode.h @@ -34,7 +34,6 @@ #include "CodeOrigin.h" #include "DFGAbstractValue.h" #include "DFGAdjacencyList.h" -#include "DFGArithMode.h" #include "DFGArrayMode.h" #include "DFGCommon.h" #include "DFGLazyJSValue.h" @@ -181,8 +180,6 @@ struct Node { , m_virtualRegister(VirtualRegister()) , m_refCount(1) , m_prediction(SpecNone) - , m_opInfo(0) - , m_opInfo2(0) { misc.replacement = 0; setOpAndDefaultFlags(op); @@ -198,7 +195,6 @@ struct Node { , m_refCount(1) , m_prediction(SpecNone) , m_opInfo(imm.m_value) - , m_opInfo2(0) { misc.replacement = 0; setOpAndDefaultFlags(op); @@ -1122,34 +1118,6 @@ struct Node { return true; } - bool hasArithMode() - { - switch (op()) { - case ArithAdd: - case ArithSub: - case ArithNegate: - case ArithMul: - case ArithDiv: - case ArithMod: - case UInt32ToNumber: - case DoubleAsInt32: - return true; - default: - return false; - } - } - - Arith::Mode arithMode() - { - ASSERT(hasArithMode()); - return static_cast(m_opInfo); - } - - void setArithMode(Arith::Mode mode) - { - m_opInfo = mode; - } - bool hasVirtualRegister() { return m_virtualRegister.isValid(); diff --git a/JavaScriptCore/dfg/DFGOperations.cpp b/JavaScriptCore/dfg/DFGOperations.cpp index b31b6fcd..eb63aee3 100644 --- a/JavaScriptCore/dfg/DFGOperations.cpp +++ b/JavaScriptCore/dfg/DFGOperations.cpp @@ -850,7 +850,6 @@ char* JIT_OPERATION operationReallocateButterflyToHavePropertyStorageWithInitial NativeCallFrameTracer tracer(&vm, exec); ASSERT(!object->structure()->outOfLineCapacity()); - DeferGC deferGC(vm.heap); Butterfly* result = object->growOutOfLineStorage(vm, 0, initialOutOfLineCapacity); object->setButterflyWithoutChangingStructure(vm, result); return reinterpret_cast(result); @@ -861,7 +860,6 @@ char* JIT_OPERATION operationReallocateButterflyToGrowPropertyStorage(ExecState* VM& vm = exec->vm(); NativeCallFrameTracer tracer(&vm, exec); - DeferGC deferGC(vm.heap); Butterfly* result = object->growOutOfLineStorage(vm, object->structure()->outOfLineCapacity(), newSize); object->setButterflyWithoutChangingStructure(vm, result); return reinterpret_cast(result); diff --git a/JavaScriptCore/dfg/DFGPredictionPropagationPhase.cpp b/JavaScriptCore/dfg/DFGPredictionPropagationPhase.cpp index 632d770c..d1c55518 100644 --- a/JavaScriptCore/dfg/DFGPredictionPropagationPhase.cpp +++ b/JavaScriptCore/dfg/DFGPredictionPropagationPhase.cpp @@ -168,6 +168,11 @@ class PredictionPropagationPhase : public Phase { break; } + case ValueToInt32: { + changed |= setPrediction(SpecInt32); + break; + } + case ArrayPop: case ArrayPush: case RegExpExec: @@ -505,8 +510,7 @@ class PredictionPropagationPhase : public Phase { case InvalidationPoint: case Int52ToValue: case Int52ToDouble: - case CheckInBounds: - case ValueToInt32: { + case CheckInBounds: { // This node should never be visible at this stage of compilation. It is // inserted by fixup(), which follows this phase. RELEASE_ASSERT_NOT_REACHED(); diff --git a/JavaScriptCore/dfg/DFGSpeculativeJIT.cpp b/JavaScriptCore/dfg/DFGSpeculativeJIT.cpp index 7d22220b..7204f097 100644 --- a/JavaScriptCore/dfg/DFGSpeculativeJIT.cpp +++ b/JavaScriptCore/dfg/DFGSpeculativeJIT.cpp @@ -2017,7 +2017,7 @@ void SpeculativeJIT::compileValueToInt32(Node* node) void SpeculativeJIT::compileUInt32ToNumber(Node* node) { - if (doesOverflow(node->arithMode())) { + if (!nodeCanSpeculateInt32(node->arithNodeFlags())) { // We know that this sometimes produces doubles. So produce a double every // time. This at least allows subsequent code to not have weird conditionals. @@ -2037,7 +2037,7 @@ void SpeculativeJIT::compileUInt32ToNumber(Node* node) return; } - RELEASE_ASSERT(node->arithMode() == Arith::CheckOverflow); + RELEASE_ASSERT(!bytecodeCanTruncateInteger(node->arithNodeFlags())); SpeculateInt32Operand op1(this, node->child1()); GPRTemporary result(this); @@ -2060,10 +2060,8 @@ void SpeculativeJIT::compileDoubleAsInt32(Node* node) GPRReg resultGPR = result.gpr(); JITCompiler::JumpList failureCases; - RELEASE_ASSERT(shouldCheckOverflow(node->arithMode())); - m_jit.branchConvertDoubleToInt32( - valueFPR, resultGPR, failureCases, scratchFPR, - shouldCheckNegativeZero(node->arithMode())); + bool negZeroCheck = !bytecodeCanIgnoreNegativeZero(node->arithNodeFlags()); + m_jit.branchConvertDoubleToInt32(valueFPR, resultGPR, failureCases, scratchFPR, negZeroCheck); speculationCheck(Overflow, JSValueRegs(), 0, failureCases); int32Result(resultGPR, node); @@ -2587,14 +2585,12 @@ void SpeculativeJIT::compileAdd(Node* node) { switch (node->binaryUseKind()) { case Int32Use: { - ASSERT(!shouldCheckNegativeZero(node->arithMode())); - if (isNumberConstant(node->child1().node())) { int32_t imm1 = valueOfInt32Constant(node->child1().node()); SpeculateInt32Operand op2(this, node->child2()); GPRTemporary result(this); - if (!shouldCheckOverflow(node->arithMode())) { + if (bytecodeCanTruncateInteger(node->arithNodeFlags())) { m_jit.move(op2.gpr(), result.gpr()); m_jit.add32(Imm32(imm1), result.gpr()); } else @@ -2609,7 +2605,7 @@ void SpeculativeJIT::compileAdd(Node* node) int32_t imm2 = valueOfInt32Constant(node->child2().node()); GPRTemporary result(this); - if (!shouldCheckOverflow(node->arithMode())) { + if (bytecodeCanTruncateInteger(node->arithNodeFlags())) { m_jit.move(op1.gpr(), result.gpr()); m_jit.add32(Imm32(imm2), result.gpr()); } else @@ -2627,7 +2623,7 @@ void SpeculativeJIT::compileAdd(Node* node) GPRReg gpr2 = op2.gpr(); GPRReg gprResult = result.gpr(); - if (!shouldCheckOverflow(node->arithMode())) { + if (bytecodeCanTruncateInteger(node->arithNodeFlags())) { if (gpr1 == gprResult) m_jit.add32(gpr2, gprResult); else { @@ -2651,9 +2647,6 @@ void SpeculativeJIT::compileAdd(Node* node) #if USE(JSVALUE64) case MachineIntUse: { - ASSERT(shouldCheckOverflow(node->arithMode())); - ASSERT(!shouldCheckNegativeZero(node->arithMode())); - // Will we need an overflow check? If we can prove that neither input can be // Int52 then the overflow check will not be necessary. if (!m_state.forNode(node->child1()).couldBeType(SpecInt52) @@ -2767,14 +2760,12 @@ void SpeculativeJIT::compileArithSub(Node* node) { switch (node->binaryUseKind()) { case Int32Use: { - ASSERT(!shouldCheckNegativeZero(node->arithMode())); - if (isNumberConstant(node->child2().node())) { SpeculateInt32Operand op1(this, node->child1()); int32_t imm2 = valueOfInt32Constant(node->child2().node()); GPRTemporary result(this); - if (!shouldCheckOverflow(node->arithMode())) { + if (bytecodeCanTruncateInteger(node->arithNodeFlags())) { m_jit.move(op1.gpr(), result.gpr()); m_jit.sub32(Imm32(imm2), result.gpr()); } else { @@ -2792,7 +2783,7 @@ void SpeculativeJIT::compileArithSub(Node* node) GPRTemporary result(this); m_jit.move(Imm32(imm1), result.gpr()); - if (!shouldCheckOverflow(node->arithMode())) + if (bytecodeCanTruncateInteger(node->arithNodeFlags())) m_jit.sub32(op2.gpr(), result.gpr()); else speculationCheck(Overflow, JSValueRegs(), 0, m_jit.branchSub32(MacroAssembler::Overflow, op2.gpr(), result.gpr())); @@ -2805,7 +2796,7 @@ void SpeculativeJIT::compileArithSub(Node* node) SpeculateInt32Operand op2(this, node->child2()); GPRTemporary result(this); - if (!shouldCheckOverflow(node->arithMode())) { + if (bytecodeCanTruncateInteger(node->arithNodeFlags())) { m_jit.move(op1.gpr(), result.gpr()); m_jit.sub32(op2.gpr(), result.gpr()); } else @@ -2817,9 +2808,6 @@ void SpeculativeJIT::compileArithSub(Node* node) #if USE(JSVALUE64) case MachineIntUse: { - ASSERT(shouldCheckOverflow(node->arithMode())); - ASSERT(!shouldCheckNegativeZero(node->arithMode())); - // Will we need an overflow check? If we can prove that neither input can be // Int52 then the overflow check will not be necessary. if (!m_state.forNode(node->child1()).couldBeType(SpecInt52) @@ -2876,9 +2864,9 @@ void SpeculativeJIT::compileArithNegate(Node* node) // Note: there is no notion of being not used as a number, but someone // caring about negative zero. - if (!shouldCheckOverflow(node->arithMode())) + if (bytecodeCanTruncateInteger(node->arithNodeFlags())) m_jit.neg32(result.gpr()); - else if (!shouldCheckNegativeZero(node->arithMode())) + else if (bytecodeCanIgnoreNegativeZero(node->arithNodeFlags())) speculationCheck(Overflow, JSValueRegs(), 0, m_jit.branchNeg32(MacroAssembler::Overflow, result.gpr())); else { speculationCheck(Overflow, JSValueRegs(), 0, m_jit.branchTest32(MacroAssembler::Zero, result.gpr(), TrustedImm32(0x7fffffff))); @@ -2891,8 +2879,6 @@ void SpeculativeJIT::compileArithNegate(Node* node) #if USE(JSVALUE64) case MachineIntUse: { - ASSERT(shouldCheckOverflow(node->arithMode())); - if (!m_state.forNode(node->child1()).couldBeType(SpecInt52)) { SpeculateWhicheverInt52Operand op1(this, node->child1()); GPRTemporary result(this); @@ -2900,7 +2886,7 @@ void SpeculativeJIT::compileArithNegate(Node* node) GPRReg resultGPR = result.gpr(); m_jit.move(op1GPR, resultGPR); m_jit.neg64(resultGPR); - if (shouldCheckNegativeZero(node->arithMode())) { + if (!bytecodeCanIgnoreNegativeZero(node->arithNodeFlags())) { speculationCheck( NegativeZero, JSValueRegs(), 0, m_jit.branchTest64(MacroAssembler::Zero, resultGPR)); @@ -2917,7 +2903,7 @@ void SpeculativeJIT::compileArithNegate(Node* node) speculationCheck( Int52Overflow, JSValueRegs(), 0, m_jit.branchNeg64(MacroAssembler::Overflow, resultGPR)); - if (shouldCheckNegativeZero(node->arithMode())) { + if (!bytecodeCanIgnoreNegativeZero(node->arithNodeFlags())) { speculationCheck( NegativeZero, JSValueRegs(), 0, m_jit.branchTest64(MacroAssembler::Zero, resultGPR)); @@ -2942,6 +2928,21 @@ void SpeculativeJIT::compileArithNegate(Node* node) return; } } +void SpeculativeJIT::compileArithIMul(Node* node) +{ + SpeculateInt32Operand op1(this, node->child1()); + SpeculateInt32Operand op2(this, node->child2()); + GPRTemporary result(this); + + GPRReg reg1 = op1.gpr(); + GPRReg reg2 = op2.gpr(); + + m_jit.move(reg1, result.gpr()); + m_jit.mul32(reg2, result.gpr()); + int32Result(result.gpr(), node); + return; +} + void SpeculativeJIT::compileArithMul(Node* node) { switch (node->binaryUseKind()) { @@ -2956,7 +2957,7 @@ void SpeculativeJIT::compileArithMul(Node* node) // We can perform truncated multiplications if we get to this point, because if the // fixup phase could not prove that it would be safe, it would have turned us into // a double multiplication. - if (!shouldCheckOverflow(node->arithMode())) { + if (bytecodeCanTruncateInteger(node->arithNodeFlags())) { m_jit.move(reg1, result.gpr()); m_jit.mul32(reg2, result.gpr()); } else { @@ -2966,7 +2967,7 @@ void SpeculativeJIT::compileArithMul(Node* node) } // Check for negative zero, if the users of this node care about such things. - if (shouldCheckNegativeZero(node->arithMode())) { + if (!bytecodeCanIgnoreNegativeZero(node->arithNodeFlags())) { MacroAssembler::Jump resultNonZero = m_jit.branchTest32(MacroAssembler::NonZero, result.gpr()); speculationCheck(NegativeZero, JSValueRegs(), 0, m_jit.branch32(MacroAssembler::LessThan, reg1, TrustedImm32(0))); speculationCheck(NegativeZero, JSValueRegs(), 0, m_jit.branch32(MacroAssembler::LessThan, reg2, TrustedImm32(0))); @@ -2979,8 +2980,6 @@ void SpeculativeJIT::compileArithMul(Node* node) #if USE(JSVALUE64) case MachineIntUse: { - ASSERT(shouldCheckOverflow(node->arithMode())); - // This is super clever. We want to do an int52 multiplication and check the // int52 overflow bit. There is no direct hardware support for this, but we do // have the ability to do an int64 multiplication and check the int64 overflow @@ -3018,7 +3017,7 @@ void SpeculativeJIT::compileArithMul(Node* node) Int52Overflow, JSValueRegs(), 0, m_jit.branchMul64(MacroAssembler::Overflow, op2GPR, resultGPR)); - if (shouldCheckNegativeZero(node->arithMode())) { + if (!bytecodeCanIgnoreNegativeZero(node->arithNodeFlags())) { MacroAssembler::Jump resultNonZero = m_jit.branchTest64( MacroAssembler::NonZero, resultGPR); speculationCheck( @@ -3088,7 +3087,7 @@ void SpeculativeJIT::compileArithDiv(Node* node) JITCompiler::Jump safeDenominator = m_jit.branch32(JITCompiler::Above, temp, JITCompiler::TrustedImm32(1)); JITCompiler::JumpList done; - if (shouldCheckOverflow(node->arithMode())) { + if (bytecodeUsesAsNumber(node->arithNodeFlags())) { speculationCheck(Overflow, JSValueRegs(), 0, m_jit.branchTest32(JITCompiler::Zero, op2GPR)); speculationCheck(Overflow, JSValueRegs(), 0, m_jit.branch32(JITCompiler::Equal, op1GPR, TrustedImm32(-2147483647-1))); } else { @@ -3116,7 +3115,7 @@ void SpeculativeJIT::compileArithDiv(Node* node) // If the user cares about negative zero, then speculate that we're not about // to produce negative zero. - if (shouldCheckNegativeZero(node->arithMode())) { + if (!bytecodeCanIgnoreNegativeZero(node->arithNodeFlags())) { MacroAssembler::Jump numeratorNonZero = m_jit.branchTest32(MacroAssembler::NonZero, op1GPR); speculationCheck(NegativeZero, JSValueRegs(), 0, m_jit.branch32(MacroAssembler::LessThan, op2GPR, TrustedImm32(0))); numeratorNonZero.link(&m_jit); @@ -3136,7 +3135,7 @@ void SpeculativeJIT::compileArithDiv(Node* node) // Check that there was no remainder. If there had been, then we'd be obligated to // produce a double result instead. - if (shouldCheckOverflow(node->arithMode())) + if (bytecodeUsesAsNumber(node->arithNodeFlags())) speculationCheck(Overflow, JSValueRegs(), 0, m_jit.branchTest32(JITCompiler::NonZero, edx.gpr())); done.link(&m_jit); @@ -3151,7 +3150,7 @@ void SpeculativeJIT::compileArithDiv(Node* node) // If the user cares about negative zero, then speculate that we're not about // to produce negative zero. - if (shouldCheckNegativeZero(node->arithMode())) { + if (!bytecodeCanIgnoreNegativeZero(node->arithNodeFlags())) { MacroAssembler::Jump numeratorNonZero = m_jit.branchTest32(MacroAssembler::NonZero, op1GPR); speculationCheck(NegativeZero, JSValueRegs(), 0, m_jit.branch32(MacroAssembler::LessThan, op2GPR, TrustedImm32(0))); numeratorNonZero.link(&m_jit); @@ -3161,7 +3160,7 @@ void SpeculativeJIT::compileArithDiv(Node* node) // Check that there was no remainder. If there had been, then we'd be obligated to // produce a double result instead. - if (shouldCheckOverflow(node->arithMode())) { + if (bytecodeUsesAsNumber(node->arithNodeFlags())) { speculationCheck(Overflow, JSValueRegs(), 0, m_jit.branchMul32(JITCompiler::Overflow, quotient.gpr(), op2GPR, multiplyAnswer.gpr())); speculationCheck(Overflow, JSValueRegs(), 0, m_jit.branch32(JITCompiler::NotEqual, multiplyAnswer.gpr(), op1GPR)); } @@ -3177,7 +3176,7 @@ void SpeculativeJIT::compileArithDiv(Node* node) // If the user cares about negative zero, then speculate that we're not about // to produce negative zero. - if (shouldCheckNegativeZero(node->arithMode())) { + if (!bytecodeCanIgnoreNegativeZero(node->arithNodeFlags())) { MacroAssembler::Jump numeratorNonZero = m_jit.branchTest32(MacroAssembler::NonZero, op1GPR); speculationCheck(NegativeZero, JSValueRegs(), 0, m_jit.branch32(MacroAssembler::LessThan, op2GPR, TrustedImm32(0))); numeratorNonZero.link(&m_jit); @@ -3187,7 +3186,7 @@ void SpeculativeJIT::compileArithDiv(Node* node) // Check that there was no remainder. If there had been, then we'd be obligated to // produce a double result instead. - if (shouldCheckOverflow(node->arithMode())) { + if (bytecodeUsesAsNumber(node->arithNodeFlags())) { speculationCheck(Overflow, JSValueRegs(), 0, m_jit.branchMul32(JITCompiler::Overflow, quotient.gpr(), op2GPR, multiplyAnswer.gpr())); speculationCheck(Overflow, JSValueRegs(), 0, m_jit.branch32(JITCompiler::NotEqual, multiplyAnswer.gpr(), op1GPR)); } @@ -3275,7 +3274,7 @@ void SpeculativeJIT::compileArithMod(Node* node) m_jit.neg32(resultGPR); m_jit.add32(dividendGPR, resultGPR); - if (shouldCheckNegativeZero(node->arithMode())) { + if (!bytecodeCanIgnoreNegativeZero(node->arithNodeFlags())) { // Check that we're not about to create negative zero. JITCompiler::Jump numeratorPositive = m_jit.branch32(JITCompiler::GreaterThanOrEqual, dividendGPR, TrustedImm32(0)); speculationCheck(NegativeZero, JSValueRegs(), 0, m_jit.branchTest32(JITCompiler::Zero, resultGPR)); @@ -3312,7 +3311,7 @@ void SpeculativeJIT::compileArithMod(Node* node) m_jit.move(TrustedImm32(divisor), scratchGPR); m_jit.assembler().cdq(); m_jit.assembler().idivl_r(scratchGPR); - if (shouldCheckNegativeZero(node->arithMode())) { + if (!bytecodeCanIgnoreNegativeZero(node->arithNodeFlags())) { JITCompiler::Jump numeratorPositive = m_jit.branch32(JITCompiler::GreaterThanOrEqual, op1SaveGPR, TrustedImm32(0)); speculationCheck(Overflow, JSValueRegs(), 0, m_jit.branchTest32(JITCompiler::Zero, edx.gpr())); numeratorPositive.link(&m_jit); @@ -3369,7 +3368,7 @@ void SpeculativeJIT::compileArithMod(Node* node) // FIXME: -2^31 / -1 will actually yield negative zero, so we could have a // separate case for that. But it probably doesn't matter so much. - if (shouldCheckOverflow(node->arithMode())) { + if (bytecodeUsesAsNumber(node->arithNodeFlags())) { speculationCheck(Overflow, JSValueRegs(), 0, m_jit.branchTest32(JITCompiler::Zero, op2GPR)); speculationCheck(Overflow, JSValueRegs(), 0, m_jit.branch32(JITCompiler::Equal, op1GPR, TrustedImm32(-2147483647-1))); } else { @@ -3408,7 +3407,7 @@ void SpeculativeJIT::compileArithMod(Node* node) unlock(op2TempGPR); // Check that we're not about to create negative zero. - if (shouldCheckNegativeZero(node->arithMode())) { + if (!bytecodeCanIgnoreNegativeZero(node->arithNodeFlags())) { JITCompiler::Jump numeratorPositive = m_jit.branch32(JITCompiler::GreaterThanOrEqual, op1SaveGPR, TrustedImm32(0)); speculationCheck(Overflow, JSValueRegs(), 0, m_jit.branchTest32(JITCompiler::Zero, edx.gpr())); numeratorPositive.link(&m_jit); @@ -3430,15 +3429,12 @@ void SpeculativeJIT::compileArithMod(Node* node) GPRReg multiplyAnswerGPR = multiplyAnswer.gpr(); m_jit.assembler().sdiv(quotientThenRemainderGPR, dividendGPR, divisorGPR); - // FIXME: It seems like there are cases where we don't need this? What if we have - // arithMode() == Arith::Unchecked? - // https://bugs.webkit.org/show_bug.cgi?id=126444 speculationCheck(Overflow, JSValueRegs(), 0, m_jit.branchMul32(JITCompiler::Overflow, quotientThenRemainderGPR, divisorGPR, multiplyAnswerGPR)); m_jit.assembler().sub(quotientThenRemainderGPR, dividendGPR, multiplyAnswerGPR); // If the user cares about negative zero, then speculate that we're not about // to produce negative zero. - if (shouldCheckNegativeZero(node->arithMode())) { + if (!bytecodeCanIgnoreNegativeZero(node->arithNodeFlags())) { // Check that we're not about to create negative zero. JITCompiler::Jump numeratorPositive = m_jit.branch32(JITCompiler::GreaterThanOrEqual, dividendGPR, TrustedImm32(0)); speculationCheck(Overflow, JSValueRegs(), 0, m_jit.branchTest32(JITCompiler::Zero, quotientThenRemainderGPR)); @@ -3456,15 +3452,12 @@ void SpeculativeJIT::compileArithMod(Node* node) GPRReg multiplyAnswerGPR = multiplyAnswer.gpr(); m_jit.assembler().sdiv<32>(quotientThenRemainderGPR, dividendGPR, divisorGPR); - // FIXME: It seems like there are cases where we don't need this? What if we have - // arithMode() == Arith::Unchecked? - // https://bugs.webkit.org/show_bug.cgi?id=126444 speculationCheck(Overflow, JSValueRegs(), 0, m_jit.branchMul32(JITCompiler::Overflow, quotientThenRemainderGPR, divisorGPR, multiplyAnswerGPR)); m_jit.assembler().sub<32>(quotientThenRemainderGPR, dividendGPR, multiplyAnswerGPR); // If the user cares about negative zero, then speculate that we're not about // to produce negative zero. - if (shouldCheckNegativeZero(node->arithMode())) { + if (!bytecodeCanIgnoreNegativeZero(node->arithNodeFlags())) { // Check that we're not about to create negative zero. JITCompiler::Jump numeratorPositive = m_jit.branch32(JITCompiler::GreaterThanOrEqual, dividendGPR, TrustedImm32(0)); speculationCheck(Overflow, JSValueRegs(), 0, m_jit.branchTest32(JITCompiler::Zero, quotientThenRemainderGPR)); diff --git a/JavaScriptCore/dfg/DFGSpeculativeJIT.h b/JavaScriptCore/dfg/DFGSpeculativeJIT.h index 9970f46e..570f46fe 100644 --- a/JavaScriptCore/dfg/DFGSpeculativeJIT.h +++ b/JavaScriptCore/dfg/DFGSpeculativeJIT.h @@ -2052,6 +2052,7 @@ class SpeculativeJIT { void compileArithSub(Node*); void compileArithNegate(Node*); void compileArithMul(Node*); + void compileArithIMul(Node*); void compileArithDiv(Node*); void compileArithMod(Node*); void compileConstantStoragePointer(Node*); diff --git a/JavaScriptCore/dfg/DFGSpeculativeJIT32_64.cpp b/JavaScriptCore/dfg/DFGSpeculativeJIT32_64.cpp index 4a95265d..6c5588e8 100644 --- a/JavaScriptCore/dfg/DFGSpeculativeJIT32_64.cpp +++ b/JavaScriptCore/dfg/DFGSpeculativeJIT32_64.cpp @@ -1958,7 +1958,7 @@ void SpeculativeJIT::compile(Node* node) m_jit.store32(value.payloadGPR(), JITCompiler::payloadFor(node->machineLocal())); m_jit.store32(value.tagGPR(), JITCompiler::tagFor(node->machineLocal())); noResult(node); - recordSetLocal(dataFormatFor(node->variableAccessData()->flushFormat())); + recordSetLocal(DataFormatJS); break; } @@ -2092,6 +2092,10 @@ void SpeculativeJIT::compile(Node* node) compileArithMul(node); break; + case ArithIMul: + compileArithIMul(node); + break; + case ArithDiv: { compileArithDiv(node); break; @@ -4698,7 +4702,6 @@ void SpeculativeJIT::compile(Node* node) case Int52ToDouble: case Int52ToValue: case CheckInBounds: - case ArithIMul: RELEASE_ASSERT_NOT_REACHED(); break; } diff --git a/JavaScriptCore/dfg/DFGSpeculativeJIT64.cpp b/JavaScriptCore/dfg/DFGSpeculativeJIT64.cpp index 15b49632..f95ba007 100644 --- a/JavaScriptCore/dfg/DFGSpeculativeJIT64.cpp +++ b/JavaScriptCore/dfg/DFGSpeculativeJIT64.cpp @@ -2275,7 +2275,7 @@ void SpeculativeJIT::compile(Node* node) JSValueOperand value(this, node->child1()); m_jit.store64(value.gpr(), JITCompiler::addressFor(node->machineLocal())); noResult(node); - recordSetLocal(dataFormatFor(node->variableAccessData()->flushFormat())); + recordSetLocal(DataFormatJS); break; } @@ -2423,6 +2423,10 @@ void SpeculativeJIT::compile(Node* node) compileArithMul(node); break; + case ArithIMul: + compileArithIMul(node); + break; + case ArithDiv: { compileArithDiv(node); break; @@ -4998,7 +5002,6 @@ void SpeculativeJIT::compile(Node* node) case GetArgument: case ExtractOSREntryLocal: case CheckInBounds: - case ArithIMul: RELEASE_ASSERT_NOT_REACHED(); break; } diff --git a/JavaScriptCore/disassembler/udis86/udis86_decode.c b/JavaScriptCore/disassembler/udis86/udis86_decode.c index b7da0f0c..3d567b6d 100644 --- a/JavaScriptCore/disassembler/udis86/udis86_decode.c +++ b/JavaScriptCore/disassembler/udis86/udis86_decode.c @@ -459,8 +459,6 @@ decode_modrm_rm(struct ud *u, rm = (REX_B(u->pfx_rex) << 3) | MODRM_RM(modrm(u)); reg = (REX_R(u->pfx_rex) << 3) | MODRM_REG(modrm(u)); - UNUSED_PARAM(reg); - op->size = resolve_operand_size(u, size); /* diff --git a/JavaScriptCore/disassembler/udis86/udis86_syn-att.c b/JavaScriptCore/disassembler/udis86/udis86_syn-att.c index 7355763f..7831e769 100644 --- a/JavaScriptCore/disassembler/udis86/udis86_syn-att.c +++ b/JavaScriptCore/disassembler/udis86/udis86_syn-att.c @@ -81,9 +81,9 @@ gen_operand(struct ud* u, struct ud_operand* op) mkasm(u, "0x%x", op->lval.sdword); } else if (op->offset == 64) { if (op->lval.sdword < 0) - mkasm(u, "-0x" FMT64 "x", (uint64_t)-op->lval.sqword); + mkasm(u, "-0x" FMT64 "x", -op->lval.sqword); else - mkasm(u, "0x" FMT64 "x", (uint64_t)op->lval.sqword); + mkasm(u, "0x" FMT64 "x", op->lval.sqword); } if (op->base) @@ -119,7 +119,7 @@ gen_operand(struct ud* u, struct ud_operand* op) } if ( sext_size < 64 ) sext_mask = ( 1ull << sext_size ) - 1; - mkasm( u, "$0x" FMT64 "x", (uint64_t)(imm & sext_mask) ); + mkasm( u, "$0x" FMT64 "x", imm & sext_mask ); break; } @@ -127,16 +127,16 @@ gen_operand(struct ud* u, struct ud_operand* op) case UD_OP_JIMM: switch (op->size) { case 8: - mkasm(u, "0x" FMT64 "x", (uint64_t)(u->pc + op->lval.sbyte)); + mkasm(u, "0x" FMT64 "x", u->pc + op->lval.sbyte); break; case 16: - mkasm(u, "0x" FMT64 "x", (uint64_t)((u->pc + op->lval.sword) & 0xffff) ); + mkasm(u, "0x" FMT64 "x", (u->pc + op->lval.sword) & 0xffff ); break; case 32: if (u->dis_mode == 32) - mkasm(u, "0x" FMT64 "x", (uint64_t)((u->pc + op->lval.sdword) & 0xffffffff)); + mkasm(u, "0x" FMT64 "x", (u->pc + op->lval.sdword) & 0xffffffff); else - mkasm(u, "0x" FMT64 "x", (uint64_t)(u->pc + op->lval.sdword)); + mkasm(u, "0x" FMT64 "x", u->pc + op->lval.sdword); break; default:break; } diff --git a/JavaScriptCore/disassembler/udis86/udis86_syn-intel.c b/JavaScriptCore/disassembler/udis86/udis86_syn-intel.c index 4ad42eb6..38251db8 100644 --- a/JavaScriptCore/disassembler/udis86/udis86_syn-intel.c +++ b/JavaScriptCore/disassembler/udis86/udis86_syn-intel.c @@ -106,7 +106,7 @@ static void gen_operand(struct ud* u, struct ud_operand* op, int syn_cast) else mkasm(u, "%s0x%lx", (op_f) ? "+" : "", (unsigned long)op->lval.udword); } else if (op->offset == 64) - mkasm(u, "%s0x" FMT64 "x", (op_f) ? "+" : "", (uint64_t)op->lval.uqword); + mkasm(u, "%s0x" FMT64 "x", (op_f) ? "+" : "", op->lval.uqword); mkasm(u, "]"); break; @@ -133,7 +133,7 @@ static void gen_operand(struct ud* u, struct ud_operand* op, int syn_cast) } if ( sext_size < 64 ) sext_mask = ( 1ull << sext_size ) - 1; - mkasm( u, "0x" FMT64 "x", (uint64_t)(imm & sext_mask) ); + mkasm( u, "0x" FMT64 "x", imm & sext_mask ); break; } @@ -143,13 +143,13 @@ static void gen_operand(struct ud* u, struct ud_operand* op, int syn_cast) if (syn_cast) opr_cast(u, op); switch (op->size) { case 8: - mkasm(u, "0x" FMT64 "x", (uint64_t)(u->pc + op->lval.sbyte)); + mkasm(u, "0x" FMT64 "x", u->pc + op->lval.sbyte); break; case 16: - mkasm(u, "0x" FMT64 "x", (uint64_t)(( u->pc + op->lval.sword ) & 0xffff) ); + mkasm(u, "0x" FMT64 "x", ( u->pc + op->lval.sword ) & 0xffff ); break; case 32: - mkasm(u, "0x" FMT64 "x", (uint64_t)(( u->pc + op->lval.sdword ) & 0xfffffffful) ); + mkasm(u, "0x" FMT64 "x", ( u->pc + op->lval.sdword ) & 0xfffffffful ); break; default:break; } diff --git a/JavaScriptCore/disassembler/udis86/udis86_types.h b/JavaScriptCore/disassembler/udis86/udis86_types.h index 176bf6d7..320d1ca4 100644 --- a/JavaScriptCore/disassembler/udis86/udis86_types.h +++ b/JavaScriptCore/disassembler/udis86/udis86_types.h @@ -48,11 +48,7 @@ typedef __int32 int32_t; typedef __int64 int64_t; #else -# if defined(__GNU_LIBRARY__) && defined(__WORDSIZE) && (__WORDSIZE == 64) -# define FMT64 "%l" -# else -# define FMT64 "%ll" -# endif +# define FMT64 "%ll" # ifndef __UD_STANDALONE__ # include # endif /* __UD_STANDALONE__ */ diff --git a/JavaScriptCore/ftl/FTLLowerDFGToLLVM.cpp b/JavaScriptCore/ftl/FTLLowerDFGToLLVM.cpp index 09c7e64b..13ca00ed 100644 --- a/JavaScriptCore/ftl/FTLLowerDFGToLLVM.cpp +++ b/JavaScriptCore/ftl/FTLLowerDFGToLLVM.cpp @@ -824,7 +824,7 @@ class LowerDFGToLLVM { LValue right = lowInt32(m_node->child2()); LValue result = isSub ? m_out.sub(left, right) : m_out.add(left, right); - if (!shouldCheckOverflow(m_node->arithMode())) { + if (bytecodeCanTruncateInteger(m_node->arithNodeFlags())) { setInt32(result); break; } @@ -878,12 +878,12 @@ class LowerDFGToLLVM { LValue right = lowInt32(m_node->child2()); LValue result = m_out.mul(left, right); - if (shouldCheckOverflow(m_node->arithMode())) { + if (!bytecodeCanTruncateInteger(m_node->arithNodeFlags())) { LValue overflowResult = m_out.mulWithOverflow32(left, right); speculate(Overflow, noValue(), 0, m_out.extractValue(overflowResult, 1)); } - if (shouldCheckNegativeZero(m_node->arithMode())) { + if (!bytecodeCanIgnoreNegativeZero(m_node->arithNodeFlags())) { LBasicBlock slowCase = FTL_NEW_BLOCK(m_out, ("ArithMul slow case")); LBasicBlock continuation = FTL_NEW_BLOCK(m_out, ("ArithMul continuation")); @@ -910,7 +910,7 @@ class LowerDFGToLLVM { LValue overflowResult = m_out.mulWithOverflow64(left, right); speculate(Int52Overflow, noValue(), 0, m_out.extractValue(overflowResult, 1)); - if (shouldCheckNegativeZero(m_node->arithMode())) { + if (!bytecodeCanIgnoreNegativeZero(m_node->arithNodeFlags())) { LBasicBlock slowCase = FTL_NEW_BLOCK(m_out, ("ArithMul slow case")); LBasicBlock continuation = FTL_NEW_BLOCK(m_out, ("ArithMul continuation")); @@ -960,7 +960,7 @@ class LowerDFGToLLVM { LValue neg2ToThe31 = m_out.constInt32(-2147483647-1); - if (shouldCheckOverflow(m_node->arithMode())) { + if (bytecodeUsesAsNumber(m_node->arithNodeFlags())) { LValue cond = m_out.bitOr(m_out.isZero32(denominator), m_out.equal(numerator, neg2ToThe31)); speculate(Overflow, noValue(), 0, cond); m_out.jump(continuation); @@ -990,7 +990,7 @@ class LowerDFGToLLVM { m_out.appendTo(continuation, done); - if (shouldCheckNegativeZero(m_node->arithMode())) { + if (!bytecodeCanIgnoreNegativeZero(m_node->arithNodeFlags())) { LBasicBlock zeroNumerator = FTL_NEW_BLOCK(m_out, ("ArithDivMod zero numerator")); LBasicBlock numeratorContinuation = FTL_NEW_BLOCK(m_out, ("ArithDivMod numerator continuation")); @@ -1010,7 +1010,7 @@ class LowerDFGToLLVM { ? m_out.div(numerator, denominator) : m_out.rem(numerator, denominator); - if (shouldCheckOverflow(m_node->arithMode())) { + if (bytecodeUsesAsNumber(m_node->arithNodeFlags())) { speculate( Overflow, noValue(), 0, m_out.notEqual(m_out.mul(divModResult, denominator), numerator)); @@ -1122,8 +1122,8 @@ class LowerDFGToLLVM { LValue value = lowInt32(m_node->child1()); LValue result = m_out.neg(value); - if (shouldCheckOverflow(m_node->arithMode())) { - if (!shouldCheckNegativeZero(m_node->arithMode())) { + if (!bytecodeCanTruncateInteger(m_node->arithNodeFlags())) { + if (bytecodeCanIgnoreNegativeZero(m_node->arithNodeFlags())) { // We don't have a negate-with-overflow intrinsic. Hopefully this // does the trick, though. LValue overflowResult = m_out.subWithOverflow32(m_out.int32Zero, value); @@ -1142,7 +1142,7 @@ class LowerDFGToLLVM { Int52Kind kind; LValue value = lowWhicheverInt52(m_node->child1(), kind); LValue result = m_out.neg(value); - if (shouldCheckNegativeZero(m_node->arithMode())) + if (!bytecodeCanIgnoreNegativeZero(m_node->arithNodeFlags())) speculate(NegativeZero, noValue(), 0, m_out.isZero64(result)); setInt52(result, kind); break; @@ -1208,7 +1208,7 @@ class LowerDFGToLLVM { { LValue value = lowInt32(m_node->child1()); - if (doesOverflow(m_node->arithMode())) { + if (!nodeCanSpeculateInt32(m_node->arithNodeFlags())) { setDouble(m_out.unsignedToDouble(value)); return; } diff --git a/JavaScriptCore/ftl/FTLOSREntry.cpp b/JavaScriptCore/ftl/FTLOSREntry.cpp index 18504605..91df4f37 100644 --- a/JavaScriptCore/ftl/FTLOSREntry.cpp +++ b/JavaScriptCore/ftl/FTLOSREntry.cpp @@ -31,7 +31,6 @@ #include "DFGJITCode.h" #include "FTLForOSREntryJITCode.h" #include "JSStackInlines.h" -#include "OperandsInlines.h" #if ENABLE(FTL_JIT) diff --git a/JavaScriptCore/ftl/FTLOSRExitCompiler.cpp b/JavaScriptCore/ftl/FTLOSRExitCompiler.cpp index 076a495e..cb8f5f9f 100644 --- a/JavaScriptCore/ftl/FTLOSRExitCompiler.cpp +++ b/JavaScriptCore/ftl/FTLOSRExitCompiler.cpp @@ -34,7 +34,6 @@ #include "FTLJITCode.h" #include "FTLOSRExit.h" #include "FTLSaveRestore.h" -#include "OperandsInlines.h" #include "Operations.h" #include "RepatchBuffer.h" diff --git a/JavaScriptCore/heap/CodeBlockSet.cpp b/JavaScriptCore/heap/CodeBlockSet.cpp index 2fc999bc..ae274808 100644 --- a/JavaScriptCore/heap/CodeBlockSet.cpp +++ b/JavaScriptCore/heap/CodeBlockSet.cpp @@ -45,8 +45,7 @@ CodeBlockSet::~CodeBlockSet() void CodeBlockSet::add(PassRefPtr codeBlock) { - CodeBlock* block = codeBlock.leakRef(); - bool isNewEntry = m_set.add(block).isNewEntry; + bool isNewEntry = m_set.add(codeBlock.leakRef()).isNewEntry; ASSERT_UNUSED(isNewEntry, isNewEntry); } @@ -102,20 +101,9 @@ void CodeBlockSet::traceMarked(SlotVisitor& visitor) CodeBlock* codeBlock = *iter; if (!codeBlock->m_mayBeExecuting) continue; - codeBlock->ownerExecutable()->methodTable()->visitChildren(codeBlock->ownerExecutable(), visitor); + codeBlock->visitAggregate(visitor); } } -void CodeBlockSet::rememberCurrentlyExecutingCodeBlocks(Heap* heap) -{ -#if ENABLE(GGC) - for (size_t i = 0; i < m_currentlyExecuting.size(); ++i) - heap->addToRememberedSet(m_currentlyExecuting[i]->ownerExecutable()); - m_currentlyExecuting.clear(); -#else - UNUSED_PARAM(heap); -#endif // ENABLE(GGC) -} - } // namespace JSC diff --git a/JavaScriptCore/heap/CodeBlockSet.h b/JavaScriptCore/heap/CodeBlockSet.h index bb786f06..2e4e606f 100644 --- a/JavaScriptCore/heap/CodeBlockSet.h +++ b/JavaScriptCore/heap/CodeBlockSet.h @@ -30,12 +30,10 @@ #include #include #include -#include namespace JSC { class CodeBlock; -class Heap; class SlotVisitor; // CodeBlockSet tracks all CodeBlocks. Every CodeBlock starts out with one @@ -67,16 +65,11 @@ class CodeBlockSet { // mayBeExecuting. void traceMarked(SlotVisitor&); - // Add all currently executing CodeBlocks to the remembered set to be - // re-scanned during the next collection. - void rememberCurrentlyExecutingCodeBlocks(Heap*); - private: // This is not a set of RefPtr because we need to be able to find // arbitrary bogus pointers. I could have written a thingy that had peek types // and all, but that seemed like overkill. HashSet m_set; - Vector m_currentlyExecuting; }; } // namespace JSC diff --git a/JavaScriptCore/heap/CopiedAllocator.h b/JavaScriptCore/heap/CopiedAllocator.h index 3dfc9a7f..32b84f00 100644 --- a/JavaScriptCore/heap/CopiedAllocator.h +++ b/JavaScriptCore/heap/CopiedAllocator.h @@ -38,7 +38,6 @@ class CopiedAllocator { bool fastPathShouldSucceed(size_t bytes) const; CheckedBoolean tryAllocate(size_t bytes, void** outPtr); - CheckedBoolean tryAllocateDuringCopying(size_t bytes, void** outPtr); CheckedBoolean tryReallocate(void *oldPtr, size_t oldBytes, size_t newBytes); void* forceAllocate(size_t bytes); CopiedBlock* resetCurrentBlock(); @@ -94,14 +93,6 @@ inline CheckedBoolean CopiedAllocator::tryAllocate(size_t bytes, void** outPtr) return true; } -inline CheckedBoolean CopiedAllocator::tryAllocateDuringCopying(size_t bytes, void** outPtr) -{ - if (!tryAllocate(bytes, outPtr)) - return false; - m_currentBlock->reportLiveBytesDuringCopying(bytes); - return true; -} - inline CheckedBoolean CopiedAllocator::tryReallocate( void* oldPtr, size_t oldBytes, size_t newBytes) { diff --git a/JavaScriptCore/heap/CopiedBlock.h b/JavaScriptCore/heap/CopiedBlock.h index 6d59aa6b..04cb31e5 100644 --- a/JavaScriptCore/heap/CopiedBlock.h +++ b/JavaScriptCore/heap/CopiedBlock.h @@ -49,14 +49,10 @@ class CopiedBlock : public HeapBlock { void pin(); bool isPinned(); - bool isOld(); bool isOversize(); - void didPromote(); unsigned liveBytes(); - bool shouldReportLiveBytes(SpinLockHolder&, JSCell* owner); - void reportLiveBytes(SpinLockHolder&, JSCell*, CopyToken, unsigned); - void reportLiveBytesDuringCopying(unsigned); + void reportLiveBytes(JSCell*, CopyToken, unsigned); void didSurviveGC(); void didEvacuateBytes(unsigned); bool shouldEvacuate(); @@ -85,7 +81,6 @@ class CopiedBlock : public HeapBlock { bool hasWorkList(); CopyWorkList& workList(); - SpinLock& workListLock() { return m_workListLock; } private: CopiedBlock(Region*); @@ -93,12 +88,13 @@ class CopiedBlock : public HeapBlock { void checkConsistency(); +#if ENABLE(PARALLEL_GC) SpinLock m_workListLock; +#endif OwnPtr m_workList; size_t m_remaining; - bool m_isPinned : 1; - bool m_isOld : 1; + uintptr_t m_isPinned; unsigned m_liveBytes; #ifndef NDEBUG unsigned m_liveObjects; @@ -134,13 +130,14 @@ inline CopiedBlock::CopiedBlock(Region* region) : HeapBlock(region) , m_remaining(payloadCapacity()) , m_isPinned(false) - , m_isOld(false) , m_liveBytes(0) #ifndef NDEBUG , m_liveObjects(0) #endif { +#if ENABLE(PARALLEL_GC) m_workListLock.Init(); +#endif ASSERT(is8ByteAligned(reinterpret_cast(m_remaining))); } @@ -159,7 +156,6 @@ inline void CopiedBlock::didSurviveGC() inline void CopiedBlock::didEvacuateBytes(unsigned bytes) { ASSERT(m_liveBytes >= bytes); - ASSERT(m_liveObjects); checkConsistency(); m_liveBytes -= bytes; #ifndef NDEBUG @@ -192,16 +188,6 @@ inline bool CopiedBlock::isPinned() return m_isPinned; } -inline bool CopiedBlock::isOld() -{ - return m_isOld; -} - -inline void CopiedBlock::didPromote() -{ - m_isOld = true; -} - inline bool CopiedBlock::isOversize() { return region()->isCustomSize(); diff --git a/JavaScriptCore/heap/CopiedBlockInlines.h b/JavaScriptCore/heap/CopiedBlockInlines.h index 8bf831cf..61996ce3 100644 --- a/JavaScriptCore/heap/CopiedBlockInlines.h +++ b/JavaScriptCore/heap/CopiedBlockInlines.h @@ -26,36 +26,21 @@ #ifndef CopiedBlockInlines_h #define CopiedBlockInlines_h -#include "ClassInfo.h" #include "CopiedBlock.h" #include "Heap.h" -#include "MarkedBlock.h" namespace JSC { -inline bool CopiedBlock::shouldReportLiveBytes(SpinLockHolder&, JSCell* owner) +inline void CopiedBlock::reportLiveBytes(JSCell* owner, CopyToken token, unsigned bytes) { - // We want to add to live bytes if the owner isn't part of the remembered set or - // if this block was allocated during the last cycle. - // If we always added live bytes we would double count for elements in the remembered - // set across collections. - // If we didn't always add live bytes to new blocks, we'd get too few. - bool ownerIsRemembered = MarkedBlock::blockFor(owner)->isRemembered(owner); - return !ownerIsRemembered || !m_isOld; -} - -inline void CopiedBlock::reportLiveBytes(SpinLockHolder&, JSCell* owner, CopyToken token, unsigned bytes) -{ - checkConsistency(); +#if ENABLE(PARALLEL_GC) + SpinLockHolder locker(&m_workListLock); +#endif #ifndef NDEBUG + checkConsistency(); m_liveObjects++; #endif m_liveBytes += bytes; - checkConsistency(); - ASSERT(m_liveBytes <= CopiedBlock::blockSize); - - if (isPinned()) - return; if (!shouldEvacuate()) { pin(); @@ -68,19 +53,6 @@ inline void CopiedBlock::reportLiveBytes(SpinLockHolder&, JSCell* owner, CopyTok m_workList->append(CopyWorklistItem(owner, token)); } -inline void CopiedBlock::reportLiveBytesDuringCopying(unsigned bytes) -{ - checkConsistency(); - // This doesn't need to be locked because the thread that calls this function owns the current block. - m_isOld = true; -#ifndef NDEBUG - m_liveObjects++; -#endif - m_liveBytes += bytes; - checkConsistency(); - ASSERT(m_liveBytes <= CopiedBlock::blockSize); -} - } // namespace JSC #endif // CopiedBlockInlines_h diff --git a/JavaScriptCore/heap/CopiedSpace.cpp b/JavaScriptCore/heap/CopiedSpace.cpp index eb294214..f0e7722a 100644 --- a/JavaScriptCore/heap/CopiedSpace.cpp +++ b/JavaScriptCore/heap/CopiedSpace.cpp @@ -35,6 +35,8 @@ namespace JSC { CopiedSpace::CopiedSpace(Heap* heap) : m_heap(heap) + , m_toSpace(0) + , m_fromSpace(0) , m_inCopyingPhase(false) , m_shouldDoCopyPhase(false) , m_numberOfLoanedBlocks(0) @@ -44,40 +46,21 @@ CopiedSpace::CopiedSpace(Heap* heap) CopiedSpace::~CopiedSpace() { - while (!m_oldGen.toSpace->isEmpty()) - m_heap->blockAllocator().deallocate(CopiedBlock::destroy(m_oldGen.toSpace->removeHead())); + while (!m_toSpace->isEmpty()) + m_heap->blockAllocator().deallocate(CopiedBlock::destroy(m_toSpace->removeHead())); - while (!m_oldGen.fromSpace->isEmpty()) - m_heap->blockAllocator().deallocate(CopiedBlock::destroy(m_oldGen.fromSpace->removeHead())); + while (!m_fromSpace->isEmpty()) + m_heap->blockAllocator().deallocate(CopiedBlock::destroy(m_fromSpace->removeHead())); - while (!m_oldGen.oversizeBlocks.isEmpty()) - m_heap->blockAllocator().deallocateCustomSize(CopiedBlock::destroy(m_oldGen.oversizeBlocks.removeHead())); - - while (!m_newGen.toSpace->isEmpty()) - m_heap->blockAllocator().deallocate(CopiedBlock::destroy(m_newGen.toSpace->removeHead())); - - while (!m_newGen.fromSpace->isEmpty()) - m_heap->blockAllocator().deallocate(CopiedBlock::destroy(m_newGen.fromSpace->removeHead())); - - while (!m_newGen.oversizeBlocks.isEmpty()) - m_heap->blockAllocator().deallocateCustomSize(CopiedBlock::destroy(m_newGen.oversizeBlocks.removeHead())); - - ASSERT(m_oldGen.toSpace->isEmpty()); - ASSERT(m_oldGen.fromSpace->isEmpty()); - ASSERT(m_oldGen.oversizeBlocks.isEmpty()); - ASSERT(m_newGen.toSpace->isEmpty()); - ASSERT(m_newGen.fromSpace->isEmpty()); - ASSERT(m_newGen.oversizeBlocks.isEmpty()); + while (!m_oversizeBlocks.isEmpty()) + m_heap->blockAllocator().deallocateCustomSize(CopiedBlock::destroy(m_oversizeBlocks.removeHead())); } void CopiedSpace::init() { - m_oldGen.toSpace = &m_oldGen.blocks1; - m_oldGen.fromSpace = &m_oldGen.blocks2; + m_toSpace = &m_blocks1; + m_fromSpace = &m_blocks2; - m_newGen.toSpace = &m_newGen.blocks1; - m_newGen.fromSpace = &m_newGen.blocks2; - allocateBlock(); } @@ -100,10 +83,9 @@ CheckedBoolean CopiedSpace::tryAllocateOversize(size_t bytes, void** outPtr) ASSERT(isOversize(bytes)); CopiedBlock* block = CopiedBlock::create(m_heap->blockAllocator().allocateCustomSize(sizeof(CopiedBlock) + bytes, CopiedBlock::blockSize)); - m_newGen.oversizeBlocks.push(block); - m_newGen.blockFilter.add(reinterpret_cast(block)); + m_oversizeBlocks.push(block); + m_blockFilter.add(reinterpret_cast(block)); m_blockSet.add(block); - ASSERT(!block->isOld()); CopiedAllocator allocator; allocator.setCurrentBlock(block); @@ -156,10 +138,7 @@ CheckedBoolean CopiedSpace::tryReallocateOversize(void** ptr, size_t oldSize, si CopiedBlock* oldBlock = CopiedSpace::blockFor(oldPtr); if (oldBlock->isOversize()) { - if (oldBlock->isOld()) - m_oldGen.oversizeBlocks.remove(oldBlock); - else - m_newGen.oversizeBlocks.remove(oldBlock); + m_oversizeBlocks.remove(oldBlock); m_blockSet.remove(oldBlock); m_heap->blockAllocator().deallocateCustomSize(CopiedBlock::destroy(oldBlock)); } @@ -186,11 +165,10 @@ void CopiedSpace::doneFillingBlock(CopiedBlock* block, CopiedBlock** exchange) block->zeroFillWilderness(); { - // Always put the block into the old gen because it's being promoted! SpinLockHolder locker(&m_toSpaceLock); - m_oldGen.toSpace->push(block); + m_toSpace->push(block); m_blockSet.add(block); - m_oldGen.blockFilter.add(reinterpret_cast(block)); + m_blockFilter.add(reinterpret_cast(block)); } { @@ -203,25 +181,52 @@ void CopiedSpace::doneFillingBlock(CopiedBlock* block, CopiedBlock** exchange) } } -void CopiedSpace::didStartFullCollection() +void CopiedSpace::startedCopying() { - ASSERT(heap()->operationInProgress() == FullCollection); - ASSERT(m_oldGen.fromSpace->isEmpty()); - ASSERT(m_newGen.fromSpace->isEmpty()); - -#ifndef NDEBUG - for (CopiedBlock* block = m_newGen.toSpace->head(); block; block = block->next()) - ASSERT(!block->liveBytes()); + std::swap(m_fromSpace, m_toSpace); + + m_blockFilter.reset(); + m_allocator.resetCurrentBlock(); + + CopiedBlock* next = 0; + size_t totalLiveBytes = 0; + size_t totalUsableBytes = 0; + for (CopiedBlock* block = m_fromSpace->head(); block; block = next) { + next = block->next(); + if (!block->isPinned() && block->canBeRecycled()) { + recycleEvacuatedBlock(block); + continue; + } + totalLiveBytes += block->liveBytes(); + totalUsableBytes += block->payloadCapacity(); + } - for (CopiedBlock* block = m_newGen.oversizeBlocks.head(); block; block = block->next()) - ASSERT(!block->liveBytes()); -#endif + CopiedBlock* block = m_oversizeBlocks.head(); + while (block) { + CopiedBlock* next = block->next(); + if (block->isPinned()) { + m_blockFilter.add(reinterpret_cast(block)); + totalLiveBytes += block->payloadCapacity(); + totalUsableBytes += block->payloadCapacity(); + block->didSurviveGC(); + } else { + m_oversizeBlocks.remove(block); + m_blockSet.remove(block); + m_heap->blockAllocator().deallocateCustomSize(CopiedBlock::destroy(block)); + } + block = next; + } - for (CopiedBlock* block = m_oldGen.toSpace->head(); block; block = block->next()) - block->didSurviveGC(); + double markedSpaceBytes = m_heap->objectSpace().capacity(); + double totalFragmentation = ((double)totalLiveBytes + markedSpaceBytes) / ((double)totalUsableBytes + markedSpaceBytes); + m_shouldDoCopyPhase = totalFragmentation <= Options::minHeapUtilization(); + if (!m_shouldDoCopyPhase) + return; - for (CopiedBlock* block = m_oldGen.oversizeBlocks.head(); block; block = block->next()) - block->didSurviveGC(); + ASSERT(m_shouldDoCopyPhase); + ASSERT(!m_inCopyingPhase); + ASSERT(!m_numberOfLoanedBlocks); + m_inCopyingPhase = true; } void CopiedSpace::doneCopying() @@ -235,39 +240,21 @@ void CopiedSpace::doneCopying() ASSERT(m_inCopyingPhase == m_shouldDoCopyPhase); m_inCopyingPhase = false; - DoublyLinkedList* toSpace; - DoublyLinkedList* fromSpace; - TinyBloomFilter* blockFilter; - if (heap()->operationInProgress() == FullCollection) { - toSpace = m_oldGen.toSpace; - fromSpace = m_oldGen.fromSpace; - blockFilter = &m_oldGen.blockFilter; - } else { - toSpace = m_newGen.toSpace; - fromSpace = m_newGen.fromSpace; - blockFilter = &m_newGen.blockFilter; - } - - while (!fromSpace->isEmpty()) { - CopiedBlock* block = fromSpace->removeHead(); + while (!m_fromSpace->isEmpty()) { + CopiedBlock* block = m_fromSpace->removeHead(); + // All non-pinned blocks in from-space should have been reclaimed as they were evacuated. + ASSERT(block->isPinned() || !m_shouldDoCopyPhase); + block->didSurviveGC(); // We don't add the block to the blockSet because it was never removed. ASSERT(m_blockSet.contains(block)); - blockFilter->add(reinterpret_cast(block)); - toSpace->push(block); + m_blockFilter.add(reinterpret_cast(block)); + m_toSpace->push(block); } - if (heap()->operationInProgress() == EdenCollection) { - m_oldGen.toSpace->append(*m_newGen.toSpace); - m_oldGen.oversizeBlocks.append(m_newGen.oversizeBlocks); - m_oldGen.blockFilter.add(m_newGen.blockFilter); - m_newGen.blockFilter.reset(); - } - - ASSERT(m_newGen.toSpace->isEmpty()); - ASSERT(m_newGen.fromSpace->isEmpty()); - ASSERT(m_newGen.oversizeBlocks.isEmpty()); - - allocateBlock(); + if (!m_toSpace->head()) + allocateBlock(); + else + m_allocator.setCurrentBlock(m_toSpace->head()); m_shouldDoCopyPhase = false; } @@ -276,22 +263,13 @@ size_t CopiedSpace::size() { size_t calculatedSize = 0; - for (CopiedBlock* block = m_oldGen.toSpace->head(); block; block = block->next()) - calculatedSize += block->size(); - - for (CopiedBlock* block = m_oldGen.fromSpace->head(); block; block = block->next()) - calculatedSize += block->size(); - - for (CopiedBlock* block = m_oldGen.oversizeBlocks.head(); block; block = block->next()) + for (CopiedBlock* block = m_toSpace->head(); block; block = block->next()) calculatedSize += block->size(); - for (CopiedBlock* block = m_newGen.toSpace->head(); block; block = block->next()) + for (CopiedBlock* block = m_fromSpace->head(); block; block = block->next()) calculatedSize += block->size(); - for (CopiedBlock* block = m_newGen.fromSpace->head(); block; block = block->next()) - calculatedSize += block->size(); - - for (CopiedBlock* block = m_newGen.oversizeBlocks.head(); block; block = block->next()) + for (CopiedBlock* block = m_oversizeBlocks.head(); block; block = block->next()) calculatedSize += block->size(); return calculatedSize; @@ -301,22 +279,13 @@ size_t CopiedSpace::capacity() { size_t calculatedCapacity = 0; - for (CopiedBlock* block = m_oldGen.toSpace->head(); block; block = block->next()) - calculatedCapacity += block->capacity(); - - for (CopiedBlock* block = m_oldGen.fromSpace->head(); block; block = block->next()) - calculatedCapacity += block->capacity(); - - for (CopiedBlock* block = m_oldGen.oversizeBlocks.head(); block; block = block->next()) - calculatedCapacity += block->capacity(); - - for (CopiedBlock* block = m_newGen.toSpace->head(); block; block = block->next()) + for (CopiedBlock* block = m_toSpace->head(); block; block = block->next()) calculatedCapacity += block->capacity(); - for (CopiedBlock* block = m_newGen.fromSpace->head(); block; block = block->next()) + for (CopiedBlock* block = m_fromSpace->head(); block; block = block->next()) calculatedCapacity += block->capacity(); - for (CopiedBlock* block = m_newGen.oversizeBlocks.head(); block; block = block->next()) + for (CopiedBlock* block = m_oversizeBlocks.head(); block; block = block->next()) calculatedCapacity += block->capacity(); return calculatedCapacity; @@ -342,12 +311,9 @@ static bool isBlockListPagedOut(double deadline, DoublyLinkedList* bool CopiedSpace::isPagedOut(double deadline) { - return isBlockListPagedOut(deadline, m_oldGen.toSpace) - || isBlockListPagedOut(deadline, m_oldGen.fromSpace) - || isBlockListPagedOut(deadline, &m_oldGen.oversizeBlocks) - || isBlockListPagedOut(deadline, m_newGen.toSpace) - || isBlockListPagedOut(deadline, m_newGen.fromSpace) - || isBlockListPagedOut(deadline, &m_newGen.oversizeBlocks); + return isBlockListPagedOut(deadline, m_toSpace) + || isBlockListPagedOut(deadline, m_fromSpace) + || isBlockListPagedOut(deadline, &m_oversizeBlocks); } } // namespace JSC diff --git a/JavaScriptCore/heap/CopiedSpace.h b/JavaScriptCore/heap/CopiedSpace.h index c0a59a27..65ca04ef 100644 --- a/JavaScriptCore/heap/CopiedSpace.h +++ b/JavaScriptCore/heap/CopiedSpace.h @@ -28,7 +28,6 @@ #include "CopiedAllocator.h" #include "HeapBlock.h" -#include "HeapOperation.h" #include "TinyBloomFilter.h" #include #include @@ -61,12 +60,7 @@ class CopiedSpace { CopiedAllocator& allocator() { return m_allocator; } - void didStartFullCollection(); - - template void startedCopying(); - void startedEdenCopy(); - void startedFullCopy(); void doneCopying(); bool isInCopyPhase() { return m_inCopyingPhase; } @@ -86,8 +80,6 @@ class CopiedSpace { static CopiedBlock* blockFor(void*); - Heap* heap() const { return m_heap; } - private: static bool isOversize(size_t); @@ -99,36 +91,24 @@ class CopiedSpace { CopiedBlock* allocateBlockForCopyingPhase(); void doneFillingBlock(CopiedBlock*, CopiedBlock**); - void recycleEvacuatedBlock(CopiedBlock*, HeapOperation collectionType); + void recycleEvacuatedBlock(CopiedBlock*); void recycleBorrowedBlock(CopiedBlock*); Heap* m_heap; CopiedAllocator m_allocator; + TinyBloomFilter m_blockFilter; HashSet m_blockSet; SpinLock m_toSpaceLock; - struct CopiedGeneration { - CopiedGeneration() - : toSpace(0) - , fromSpace(0) - { - } - - DoublyLinkedList* toSpace; - DoublyLinkedList* fromSpace; - - DoublyLinkedList blocks1; - DoublyLinkedList blocks2; - DoublyLinkedList oversizeBlocks; - - TinyBloomFilter blockFilter; - }; - - CopiedGeneration m_oldGen; - CopiedGeneration m_newGen; + DoublyLinkedList* m_toSpace; + DoublyLinkedList* m_fromSpace; + + DoublyLinkedList m_blocks1; + DoublyLinkedList m_blocks2; + DoublyLinkedList m_oversizeBlocks; bool m_inCopyingPhase; bool m_shouldDoCopyPhase; diff --git a/JavaScriptCore/heap/CopiedSpaceInlines.h b/JavaScriptCore/heap/CopiedSpaceInlines.h index ec33f582..253a76b1 100644 --- a/JavaScriptCore/heap/CopiedSpaceInlines.h +++ b/JavaScriptCore/heap/CopiedSpaceInlines.h @@ -37,8 +37,7 @@ namespace JSC { inline bool CopiedSpace::contains(CopiedBlock* block) { - return (!m_newGen.blockFilter.ruleOut(reinterpret_cast(block)) || !m_oldGen.blockFilter.ruleOut(reinterpret_cast(block))) - && m_blockSet.contains(block); + return !m_blockFilter.ruleOut(reinterpret_cast(block)) && m_blockSet.contains(block); } inline bool CopiedSpace::contains(void* ptr, CopiedBlock*& result) @@ -93,7 +92,7 @@ inline void CopiedSpace::pinIfNecessary(void* opaquePointer) pin(block); } -inline void CopiedSpace::recycleEvacuatedBlock(CopiedBlock* block, HeapOperation collectionType) +inline void CopiedSpace::recycleEvacuatedBlock(CopiedBlock* block) { ASSERT(block); ASSERT(block->canBeRecycled()); @@ -101,10 +100,7 @@ inline void CopiedSpace::recycleEvacuatedBlock(CopiedBlock* block, HeapOperation { SpinLockHolder locker(&m_toSpaceLock); m_blockSet.remove(block); - if (collectionType == EdenCollection) - m_newGen.fromSpace->remove(block); - else - m_oldGen.fromSpace->remove(block); + m_fromSpace->remove(block); } m_heap->blockAllocator().deallocate(CopiedBlock::destroy(block)); } @@ -145,8 +141,8 @@ inline void CopiedSpace::allocateBlock() CopiedBlock* block = CopiedBlock::create(m_heap->blockAllocator().allocate()); - m_newGen.toSpace->push(block); - m_newGen.blockFilter.add(reinterpret_cast(block)); + m_toSpace->push(block); + m_blockFilter.add(reinterpret_cast(block)); m_blockSet.add(block); m_allocator.setCurrentBlock(block); } @@ -178,85 +174,6 @@ inline CopiedBlock* CopiedSpace::blockFor(void* ptr) return reinterpret_cast(reinterpret_cast(ptr) & s_blockMask); } -template -inline void CopiedSpace::startedCopying() -{ - DoublyLinkedList* fromSpace; - DoublyLinkedList* oversizeBlocks; - TinyBloomFilter* blockFilter; - if (collectionType == FullCollection) { - ASSERT(m_oldGen.fromSpace->isEmpty()); - ASSERT(m_newGen.fromSpace->isEmpty()); - - m_oldGen.toSpace->append(*m_newGen.toSpace); - m_oldGen.oversizeBlocks.append(m_newGen.oversizeBlocks); - - ASSERT(m_newGen.toSpace->isEmpty()); - ASSERT(m_newGen.fromSpace->isEmpty()); - ASSERT(m_newGen.oversizeBlocks.isEmpty()); - - std::swap(m_oldGen.fromSpace, m_oldGen.toSpace); - fromSpace = m_oldGen.fromSpace; - oversizeBlocks = &m_oldGen.oversizeBlocks; - blockFilter = &m_oldGen.blockFilter; - } else { - std::swap(m_newGen.fromSpace, m_newGen.toSpace); - fromSpace = m_newGen.fromSpace; - oversizeBlocks = &m_newGen.oversizeBlocks; - blockFilter = &m_newGen.blockFilter; - } - - blockFilter->reset(); - m_allocator.resetCurrentBlock(); - - CopiedBlock* next = 0; - size_t totalLiveBytes = 0; - size_t totalUsableBytes = 0; - for (CopiedBlock* block = fromSpace->head(); block; block = next) { - next = block->next(); - if (!block->isPinned() && block->canBeRecycled()) { - recycleEvacuatedBlock(block, collectionType); - continue; - } - ASSERT(block->liveBytes() <= CopiedBlock::blockSize); - totalLiveBytes += block->liveBytes(); - totalUsableBytes += block->payloadCapacity(); - block->didPromote(); - } - - CopiedBlock* block = oversizeBlocks->head(); - while (block) { - CopiedBlock* next = block->next(); - if (block->isPinned()) { - blockFilter->add(reinterpret_cast(block)); - totalLiveBytes += block->payloadCapacity(); - totalUsableBytes += block->payloadCapacity(); - block->didPromote(); - } else { - oversizeBlocks->remove(block); - m_blockSet.remove(block); - m_heap->blockAllocator().deallocateCustomSize(CopiedBlock::destroy(block)); - } - block = next; - } - - double markedSpaceBytes = m_heap->objectSpace().capacity(); - double totalFragmentation = static_cast(totalLiveBytes + markedSpaceBytes) / static_cast(totalUsableBytes + markedSpaceBytes); - m_shouldDoCopyPhase = m_heap->operationInProgress() == EdenCollection || totalFragmentation <= Options::minHeapUtilization(); - if (!m_shouldDoCopyPhase) { - if (Options::logGC()) - dataLog("Skipped copying, "); - return; - } - - if (Options::logGC()) - dataLogF("Did copy, "); - ASSERT(m_shouldDoCopyPhase); - ASSERT(!m_numberOfLoanedBlocks); - ASSERT(!m_inCopyingPhase); - m_inCopyingPhase = true; -} - } // namespace JSC #endif // CopiedSpaceInlines_h diff --git a/JavaScriptCore/heap/CopyVisitor.cpp b/JavaScriptCore/heap/CopyVisitor.cpp index 3d18936e..3be31c10 100644 --- a/JavaScriptCore/heap/CopyVisitor.cpp +++ b/JavaScriptCore/heap/CopyVisitor.cpp @@ -57,7 +57,7 @@ void CopyVisitor::copyFromShared() visitItem(*it); ASSERT(!block->liveBytes()); - m_shared.m_copiedSpace->recycleEvacuatedBlock(block, m_shared.m_vm->heap.operationInProgress()); + m_shared.m_copiedSpace->recycleEvacuatedBlock(block); } m_shared.getNextBlocksToCopy(next, end); } diff --git a/JavaScriptCore/heap/CopyVisitorInlines.h b/JavaScriptCore/heap/CopyVisitorInlines.h index 6e197fca..94a38cf8 100644 --- a/JavaScriptCore/heap/CopyVisitorInlines.h +++ b/JavaScriptCore/heap/CopyVisitorInlines.h @@ -55,7 +55,7 @@ inline bool CopyVisitor::checkIfShouldCopy(void* oldPtr) inline void* CopyVisitor::allocateNewSpace(size_t bytes) { void* result = 0; // Compilers don't realize that this will be assigned. - if (LIKELY(m_copiedAllocator.tryAllocateDuringCopying(bytes, &result))) + if (LIKELY(m_copiedAllocator.tryAllocate(bytes, &result))) return result; result = allocateNewSpaceSlow(bytes); @@ -70,7 +70,7 @@ inline void* CopyVisitor::allocateNewSpaceSlow(size_t bytes) m_copiedAllocator.setCurrentBlock(newBlock); void* result = 0; - CheckedBoolean didSucceed = m_copiedAllocator.tryAllocateDuringCopying(bytes, &result); + CheckedBoolean didSucceed = m_copiedAllocator.tryAllocate(bytes, &result); ASSERT(didSucceed); return result; } diff --git a/JavaScriptCore/heap/GCThreadSharedData.cpp b/JavaScriptCore/heap/GCThreadSharedData.cpp index 7d1d7b4c..b342b961 100644 --- a/JavaScriptCore/heap/GCThreadSharedData.cpp +++ b/JavaScriptCore/heap/GCThreadSharedData.cpp @@ -181,15 +181,7 @@ void GCThreadSharedData::didStartCopying() { { SpinLockHolder locker(&m_copyLock); - if (m_vm->heap.operationInProgress() == EdenCollection) { - // Reset the vector to be empty, but don't throw away the backing store. - m_blocksToCopy.shrink(0); - for (CopiedBlock* block = m_copiedSpace->m_newGen.fromSpace->head(); block; block = block->next()) - m_blocksToCopy.append(block); - } else { - ASSERT(m_vm->heap.operationInProgress() == FullCollection); - WTF::copyToVector(m_copiedSpace->m_blockSet, m_blocksToCopy); - } + WTF::copyToVector(m_copiedSpace->m_blockSet, m_blocksToCopy); m_copyIndex = 0; } diff --git a/JavaScriptCore/heap/Heap.cpp b/JavaScriptCore/heap/Heap.cpp index 2aba3aa9..77d7c226 100644 --- a/JavaScriptCore/heap/Heap.cpp +++ b/JavaScriptCore/heap/Heap.cpp @@ -253,11 +253,9 @@ Heap::Heap(VM* vm, HeapType heapType) , m_ramSize(ramSize()) , m_minBytesPerCycle(minHeapSize(m_heapType, m_ramSize)) , m_sizeAfterLastCollect(0) - , m_bytesAllocatedThisCycle(0) - , m_bytesAbandonedThisCycle(0) - , m_maxEdenSize(m_minBytesPerCycle) - , m_maxHeapSize(m_minBytesPerCycle) - , m_shouldDoFullCollection(false) + , m_bytesAllocatedLimit(m_minBytesPerCycle) + , m_bytesAllocated(0) + , m_bytesAbandoned(0) , m_totalBytesVisited(0) , m_totalBytesCopied(0) , m_operationInProgress(NoOperation) @@ -271,7 +269,7 @@ Heap::Heap(VM* vm, HeapType heapType) , m_copyVisitor(m_sharedData) , m_handleSet(vm) , m_isSafeToCollect(false) - , m_writeBarrierBuffer(256) + , m_writeBarrierBuffer(128) , m_vm(vm) , m_lastGCLength(0) , m_lastCodeDiscardTime(WTF::monotonicallyIncreasingTime()) @@ -334,8 +332,8 @@ void Heap::reportAbandonedObjectGraph() void Heap::didAbandon(size_t bytes) { if (m_activityCallback) - m_activityCallback->didAllocate(m_bytesAllocatedThisCycle + m_bytesAbandonedThisCycle); - m_bytesAbandonedThisCycle += bytes; + m_activityCallback->didAllocate(m_bytesAllocated + m_bytesAbandoned); + m_bytesAbandoned += bytes; } void Heap::protect(JSValue k) @@ -489,11 +487,6 @@ void Heap::markRoots() visitor.setup(); HeapRootVisitor heapRootVisitor(visitor); -#if ENABLE(GGC) - Vector rememberedSet(m_slotVisitor.markStack().size()); - m_slotVisitor.markStack().fillVector(rememberedSet); -#endif - { ParallelModeEnabler enabler(visitor); @@ -597,16 +590,6 @@ void Heap::markRoots() } } -#if ENABLE(GGC) - { - GCPHASE(ClearRememberedSet); - for (unsigned i = 0; i < rememberedSet.size(); ++i) { - const JSCell* cell = rememberedSet[i]; - MarkedBlock::blockFor(cell)->clearRemembered(cell); - } - } -#endif - GCCOUNTER(VisitedValueCount, visitor.visitCount()); m_sharedData.didFinishMarking(); @@ -618,14 +601,8 @@ void Heap::markRoots() MARK_LOG_MESSAGE2("\nNumber of live Objects after full GC %lu, took %.6f secs\n", visitCount, WTF::monotonicallyIncreasingTime() - gcStartTime); #endif - if (m_operationInProgress == EdenCollection) { - m_totalBytesVisited += visitor.bytesVisited(); - m_totalBytesCopied += visitor.bytesCopied(); - } else { - ASSERT(m_operationInProgress == FullCollection); - m_totalBytesVisited = visitor.bytesVisited(); - m_totalBytesCopied = visitor.bytesCopied(); - } + m_totalBytesVisited = visitor.bytesVisited(); + m_totalBytesCopied = visitor.bytesCopied(); #if ENABLE(PARALLEL_GC) m_totalBytesVisited += m_sharedData.childBytesVisited(); m_totalBytesCopied += m_sharedData.childBytesCopied(); @@ -638,10 +615,9 @@ void Heap::markRoots() m_sharedData.reset(); } -template void Heap::copyBackingStores() { - m_storageSpace.startedCopying(); + m_storageSpace.startedCopying(); if (m_storageSpace.shouldDoCopyPhase()) { m_sharedData.didStartCopying(); m_copyVisitor.startCopying(); @@ -651,7 +627,7 @@ void Heap::copyBackingStores() // before signaling that the phase is complete. m_storageSpace.doneCopying(); m_sharedData.didFinishCopying(); - } else + } else m_storageSpace.doneCopying(); } @@ -747,33 +723,18 @@ void Heap::deleteUnmarkedCompiledCode() m_jitStubRoutines.deleteUnmarkedJettisonedStubRoutines(); } -void Heap::addToRememberedSet(const JSCell* cell) -{ - ASSERT(cell); - ASSERT(!Options::enableConcurrentJIT() || !isCompilationThread()); - if (isInRememberedSet(cell)) - return; - MarkedBlock::blockFor(cell)->setRemembered(cell); - m_slotVisitor.unconditionallyAppend(const_cast(cell)); -} - void Heap::collectAllGarbage() { if (!m_isSafeToCollect) return; - - m_shouldDoFullCollection = true; - collect(); - - SamplingRegion samplingRegion("Garbage Collection: Sweeping"); + DelayedReleaseScope delayedReleaseScope(m_objectSpace); - m_objectSpace.sweep(); - m_objectSpace.shrink(); + collect(DoSweep); } static double minute = 60.0; -void Heap::collect() +void Heap::collect(SweepToggle sweepToggle) { #if ENABLE(ALLOCATION_LOGGING) dataLogF("JSC GC starting collection.\n"); @@ -781,7 +742,7 @@ void Heap::collect() double before = 0; if (Options::logGC()) { - dataLog("[GC: "); + dataLog("[GC", sweepToggle == DoSweep ? " (eager sweep)" : "", ": "); before = currentTimeMS(); } @@ -799,28 +760,9 @@ void Heap::collect() RecursiveAllocationScope scope(*this); m_vm->prepareToDiscardCode(); } - - bool isFullCollection = m_shouldDoFullCollection; - if (isFullCollection) { - m_operationInProgress = FullCollection; - m_slotVisitor.clearMarkStack(); - m_shouldDoFullCollection = false; - if (Options::logGC()) - dataLog("FullCollection, "); - } else { -#if ENABLE(GGC) - m_operationInProgress = EdenCollection; - if (Options::logGC()) - dataLog("EdenCollection, "); -#else - m_operationInProgress = FullCollection; - m_slotVisitor.clearMarkStack(); - if (Options::logGC()) - dataLog("FullCollection, "); -#endif - } - if (m_operationInProgress == FullCollection) - m_extraMemoryUsage = 0; + + m_operationInProgress = Collection; + m_extraMemoryUsage = 0; if (m_activityCallback) m_activityCallback->willCollect(); @@ -834,16 +776,6 @@ void Heap::collect() { GCPHASE(StopAllocation); m_objectSpace.stopAllocating(); - if (m_operationInProgress == FullCollection) - m_storageSpace.didStartFullCollection(); - } - - { - GCPHASE(FlushWriteBarrierBuffer); - if (m_operationInProgress == EdenCollection) - m_writeBarrierBuffer.flush(*this); - else - m_writeBarrierBuffer.reset(); } markRoots(); @@ -860,16 +792,13 @@ void Heap::collect() m_arrayBuffers.sweep(); } - if (m_operationInProgress == FullCollection) { + { m_blockSnapshot.resize(m_objectSpace.blocks().set().size()); MarkedBlockSnapshotFunctor functor(m_blockSnapshot); m_objectSpace.forEachBlock(functor); } - if (m_operationInProgress == FullCollection) - copyBackingStores(); - else - copyBackingStores(); + copyBackingStores(); { GCPHASE(FinalizeUnconditionalFinalizers); @@ -886,15 +815,15 @@ void Heap::collect() m_vm->clearSourceProviderCaches(); } - if (m_operationInProgress == FullCollection) - m_sweeper->startSweeping(m_blockSnapshot); - - { - GCPHASE(AddCurrentlyExecutingCodeBlocksToRememberedSet); - m_codeBlocks.rememberCurrentlyExecutingCodeBlocks(this); + if (sweepToggle == DoSweep) { + SamplingRegion samplingRegion("Garbage Collection: Sweeping"); + GCPHASE(Sweeping); + m_objectSpace.sweep(); + m_objectSpace.shrink(); } - m_bytesAbandonedThisCycle = 0; + m_sweeper->startSweeping(m_blockSnapshot); + m_bytesAbandoned = 0; { GCPHASE(ResetAllocators); @@ -905,32 +834,21 @@ void Heap::collect() if (Options::gcMaxHeapSize() && currentHeapSize > Options::gcMaxHeapSize()) HeapStatistics::exitWithFailure(); - if (m_operationInProgress == FullCollection) { - // To avoid pathological GC churn in very small and very large heaps, we set - // the new allocation limit based on the current size of the heap, with a - // fixed minimum. - m_maxHeapSize = max(minHeapSize(m_heapType, m_ramSize), proportionalHeapSize(currentHeapSize, m_ramSize)); - m_maxEdenSize = m_maxHeapSize - currentHeapSize; - } else { - ASSERT(currentHeapSize >= m_sizeAfterLastCollect); - m_maxEdenSize = m_maxHeapSize - currentHeapSize; - double edenToOldGenerationRatio = (double)m_maxEdenSize / (double)m_maxHeapSize; - double minEdenToOldGenerationRatio = 1.0 / 3.0; - if (edenToOldGenerationRatio < minEdenToOldGenerationRatio) - m_shouldDoFullCollection = true; - m_maxHeapSize += currentHeapSize - m_sizeAfterLastCollect; - m_maxEdenSize = m_maxHeapSize - currentHeapSize; - } - m_sizeAfterLastCollect = currentHeapSize; - m_bytesAllocatedThisCycle = 0; + // To avoid pathological GC churn in very small and very large heaps, we set + // the new allocation limit based on the current size of the heap, with a + // fixed minimum. + size_t maxHeapSize = max(minHeapSize(m_heapType, m_ramSize), proportionalHeapSize(currentHeapSize, m_ramSize)); + m_bytesAllocatedLimit = maxHeapSize - currentHeapSize; + + m_bytesAllocated = 0; double lastGCEndTime = WTF::monotonicallyIncreasingTime(); m_lastGCLength = lastGCEndTime - lastGCStartTime; if (Options::recordGCPauseTimes()) HeapStatistics::recordGCPauseTime(lastGCStartTime, lastGCEndTime); - RELEASE_ASSERT(m_operationInProgress == EdenCollection || m_operationInProgress == FullCollection); + RELEASE_ASSERT(m_operationInProgress == Collection); m_operationInProgress = NoOperation; JAVASCRIPTCORE_GC_END(); @@ -948,6 +866,10 @@ void Heap::collect() double after = currentTimeMS(); dataLog(after - before, " ms, ", currentHeapSize / 1024, " kb]\n"); } + +#if ENABLE(ALLOCATION_LOGGING) + dataLogF("JSC GC finishing collection.\n"); +#endif } bool Heap::collectIfNecessaryOrDefer() @@ -958,7 +880,7 @@ bool Heap::collectIfNecessaryOrDefer() if (!shouldCollect()) return false; - collect(); + collect(DoNotSweep); return true; } @@ -997,8 +919,8 @@ void Heap::setGarbageCollectionTimerEnabled(bool enable) void Heap::didAllocate(size_t bytes) { if (m_activityCallback) - m_activityCallback->didAllocate(m_bytesAllocatedThisCycle + m_bytesAbandonedThisCycle); - m_bytesAllocatedThisCycle += bytes; + m_activityCallback->didAllocate(m_bytesAllocated + m_bytesAbandoned); + m_bytesAllocated += bytes; } bool Heap::isValidAllocation(size_t) @@ -1075,19 +997,6 @@ void Heap::decrementDeferralDepthAndGCIfNeeded() collectIfNecessaryOrDefer(); } -void Heap::writeBarrier(const JSCell* from) -{ -#if ENABLE(GGC) - ASSERT_GC_OBJECT_LOOKS_VALID(const_cast(from)); - if (!from || !isMarked(from)) - return; - Heap* heap = Heap::heap(from); - heap->addToRememberedSet(from); -#else - UNUSED_PARAM(from); -#endif -} - void Heap::flushWriteBarrierBuffer(JSCell* cell) { #if ENABLE(GGC) diff --git a/JavaScriptCore/heap/Heap.h b/JavaScriptCore/heap/Heap.h index ab580aa1..a3c63637 100644 --- a/JavaScriptCore/heap/Heap.h +++ b/JavaScriptCore/heap/Heap.h @@ -94,17 +94,11 @@ namespace JSC { static bool testAndSetMarked(const void*); static void setMarked(const void*); - JS_EXPORT_PRIVATE void addToRememberedSet(const JSCell*); - bool isInRememberedSet(const JSCell* cell) const - { - ASSERT(cell); - ASSERT(!Options::enableConcurrentJIT() || !isCompilationThread()); - return MarkedBlock::blockFor(cell)->isRemembered(cell); - } static bool isWriteBarrierEnabled(); - JS_EXPORT_PRIVATE static void writeBarrier(const JSCell*); + static void writeBarrier(const JSCell*); static void writeBarrier(const JSCell*, JSValue); static void writeBarrier(const JSCell*, JSCell*); + static uint8_t* addressOfCardFor(JSCell*); WriteBarrierBuffer& writeBarrierBuffer() { return m_writeBarrierBuffer; } void flushWriteBarrierBuffer(JSCell*); @@ -126,7 +120,6 @@ namespace JSC { // true if collection is in progress inline bool isCollecting(); - inline HeapOperation operationInProgress() { return m_operationInProgress; } // true if an allocation or collection is in progress inline bool isBusy(); @@ -146,8 +139,9 @@ namespace JSC { bool isSafeToCollect() const { return m_isSafeToCollect; } JS_EXPORT_PRIVATE void collectAllGarbage(); + enum SweepToggle { DoNotSweep, DoSweep }; bool shouldCollect(); - void collect(); + void collect(SweepToggle); bool collectIfNecessaryOrDefer(); // Returns true if it did collect. void reportExtraMemoryCost(size_t cost); @@ -243,7 +237,6 @@ namespace JSC { void markRoots(); void markProtectedObjects(HeapRootVisitor&); void markTempSortVectors(HeapRootVisitor&); - template void copyBackingStores(); void harvestWeakReferences(); void finalizeUnconditionalFinalizers(); @@ -265,11 +258,10 @@ namespace JSC { const size_t m_minBytesPerCycle; size_t m_sizeAfterLastCollect; - size_t m_bytesAllocatedThisCycle; - size_t m_bytesAbandonedThisCycle; - size_t m_maxEdenSize; - size_t m_maxHeapSize; - bool m_shouldDoFullCollection; + size_t m_bytesAllocatedLimit; + size_t m_bytesAllocated; + size_t m_bytesAbandoned; + size_t m_totalBytesVisited; size_t m_totalBytesCopied; @@ -280,8 +272,6 @@ namespace JSC { GCIncomingRefCountedSet m_arrayBuffers; size_t m_extraMemoryUsage; - HashSet m_copyingRememberedSet; - ProtectCountSet m_protectedValues; Vector* > m_tempSortingVectors; OwnPtr> m_markListSet; @@ -333,8 +323,8 @@ namespace JSC { if (isDeferred()) return false; if (Options::gcMaxHeapSize()) - return m_bytesAllocatedThisCycle > Options::gcMaxHeapSize() && m_isSafeToCollect && m_operationInProgress == NoOperation; - return m_bytesAllocatedThisCycle > m_maxEdenSize && m_isSafeToCollect && m_operationInProgress == NoOperation; + return m_bytesAllocated > Options::gcMaxHeapSize() && m_isSafeToCollect && m_operationInProgress == NoOperation; + return m_bytesAllocated > m_bytesAllocatedLimit && m_isSafeToCollect && m_operationInProgress == NoOperation; } bool Heap::isBusy() @@ -344,7 +334,7 @@ namespace JSC { bool Heap::isCollecting() { - return m_operationInProgress == FullCollection || m_operationInProgress == EdenCollection; + return m_operationInProgress == Collection; } inline Heap* Heap::heap(const JSCell* cell) @@ -381,33 +371,26 @@ namespace JSC { inline bool Heap::isWriteBarrierEnabled() { -#if ENABLE(WRITE_BARRIER_PROFILING) || ENABLE(GGC) +#if ENABLE(WRITE_BARRIER_PROFILING) return true; #else return false; #endif } - inline void Heap::writeBarrier(const JSCell* from, JSCell* to) + inline void Heap::writeBarrier(const JSCell*) { -#if ENABLE(WRITE_BARRIER_PROFILING) WriteBarrierCounters::countWriteBarrier(); -#endif - if (!from || !isMarked(from)) - return; - if (!to || isMarked(to)) - return; - Heap::heap(from)->addToRememberedSet(from); } - inline void Heap::writeBarrier(const JSCell* from, JSValue to) + inline void Heap::writeBarrier(const JSCell*, JSCell*) + { + WriteBarrierCounters::countWriteBarrier(); + } + + inline void Heap::writeBarrier(const JSCell*, JSValue) { -#if ENABLE(WRITE_BARRIER_PROFILING) WriteBarrierCounters::countWriteBarrier(); -#endif - if (!to.isCell()) - return; - writeBarrier(from, to.asCell()); } inline void Heap::reportExtraMemoryCost(size_t cost) diff --git a/JavaScriptCore/heap/HeapOperation.h b/JavaScriptCore/heap/HeapOperation.h index 769127e8..8f0a0232 100644 --- a/JavaScriptCore/heap/HeapOperation.h +++ b/JavaScriptCore/heap/HeapOperation.h @@ -28,7 +28,7 @@ namespace JSC { -enum HeapOperation { NoOperation, Allocation, FullCollection, EdenCollection }; +enum HeapOperation { NoOperation, Allocation, Collection }; } // namespace JSC diff --git a/JavaScriptCore/heap/HeapTimer.cpp b/JavaScriptCore/heap/HeapTimer.cpp index 1331b0ac..14915716 100644 --- a/JavaScriptCore/heap/HeapTimer.cpp +++ b/JavaScriptCore/heap/HeapTimer.cpp @@ -100,6 +100,30 @@ void HeapTimer::timerDidFire(CFRunLoopTimerRef timer, void* context) apiLock->unlock(); } +#elif PLATFORM(BLACKBERRY) + +HeapTimer::HeapTimer(VM* vm) + : m_vm(vm) + , m_timer(this, &HeapTimer::timerDidFire) +{ + // FIXME: Implement HeapTimer for other threads. + if (WTF::isMainThread() && !m_timer.tryCreateClient()) + CRASH(); +} + +HeapTimer::~HeapTimer() +{ +} + +void HeapTimer::timerDidFire() +{ + doWork(); +} + +void HeapTimer::invalidate() +{ +} + #elif PLATFORM(EFL) HeapTimer::HeapTimer(VM* vm) diff --git a/JavaScriptCore/heap/HeapTimer.h b/JavaScriptCore/heap/HeapTimer.h index 760405c7..4d1ee667 100644 --- a/JavaScriptCore/heap/HeapTimer.h +++ b/JavaScriptCore/heap/HeapTimer.h @@ -31,6 +31,8 @@ #if USE(CF) #include +#elif PLATFORM(BLACKBERRY) +#include #elif PLATFORM(EFL) #if USE(EO) typedef struct _Eo_Opaque Ecore_Timer; @@ -66,6 +68,10 @@ class HeapTimer { CFRunLoopTimerContext m_context; Mutex m_shutdownMutex; +#elif PLATFORM(BLACKBERRY) + void timerDidFire(); + + BlackBerry::Platform::Timer m_timer; #elif PLATFORM(EFL) static bool timerEvent(void*); Ecore_Timer* add(double delay, void* agent); diff --git a/JavaScriptCore/heap/IncrementalSweeper.cpp b/JavaScriptCore/heap/IncrementalSweeper.cpp index 2852266a..6ade98c3 100644 --- a/JavaScriptCore/heap/IncrementalSweeper.cpp +++ b/JavaScriptCore/heap/IncrementalSweeper.cpp @@ -38,12 +38,14 @@ namespace JSC { -#if USE(CF) +#if USE(CF) || PLATFORM(BLACKBERRY) static const double sweepTimeSlice = .01; // seconds static const double sweepTimeTotal = .10; static const double sweepTimeMultiplier = 1.0 / sweepTimeTotal; +#if USE(CF) + IncrementalSweeper::IncrementalSweeper(Heap* heap, CFRunLoopRef runLoop) : HeapTimer(heap->vm(), runLoop) , m_currentBlockToSweepIndex(0) @@ -66,6 +68,32 @@ void IncrementalSweeper::cancelTimer() CFRunLoopTimerSetNextFireDate(m_timer.get(), CFAbsoluteTimeGetCurrent() + s_decade); } +#elif PLATFORM(BLACKBERRY) + +IncrementalSweeper::IncrementalSweeper(Heap* heap) + : HeapTimer(heap->vm()) + , m_currentBlockToSweepIndex(0) + , m_blocksToSweep(heap->m_blockSnapshot) +{ +} + +PassOwnPtr IncrementalSweeper::create(Heap* heap) +{ + return adoptPtr(new IncrementalSweeper(heap)); +} + +void IncrementalSweeper::scheduleTimer() +{ + m_timer.start(sweepTimeSlice * sweepTimeMultiplier); +} + +void IncrementalSweeper::cancelTimer() +{ + m_timer.stop(); +} + +#endif + void IncrementalSweeper::doWork() { doSweep(WTF::monotonicallyIncreasingTime()); diff --git a/JavaScriptCore/heap/IncrementalSweeper.h b/JavaScriptCore/heap/IncrementalSweeper.h index f5998254..25954239 100644 --- a/JavaScriptCore/heap/IncrementalSweeper.h +++ b/JavaScriptCore/heap/IncrementalSweeper.h @@ -46,11 +46,13 @@ class IncrementalSweeper : public HeapTimer { protected: #if USE(CF) JS_EXPORT_PRIVATE IncrementalSweeper(Heap*, CFRunLoopRef); +#elif PLATFORM(BLACKBERRY) + IncrementalSweeper(Heap*); #else IncrementalSweeper(VM*); #endif -#if USE(CF) +#if USE(CF) || PLATFORM(BLACKBERRY) private: void doSweep(double startTime); void scheduleTimer(); diff --git a/JavaScriptCore/heap/MachineStackMarker.cpp b/JavaScriptCore/heap/MachineStackMarker.cpp index f546cb38..63854482 100644 --- a/JavaScriptCore/heap/MachineStackMarker.cpp +++ b/JavaScriptCore/heap/MachineStackMarker.cpp @@ -58,6 +58,13 @@ #include #endif +#if OS(QNX) +#include +#include +#include +#include +#endif + #if USE(PTHREADS) && !OS(WINDOWS) && !OS(DARWIN) #include #endif @@ -304,6 +311,8 @@ typedef arm_thread_state64_t PlatformThreadRegisters; #elif OS(WINDOWS) typedef CONTEXT PlatformThreadRegisters; +#elif OS(QNX) +typedef struct _debug_thread_info PlatformThreadRegisters; #elif USE(PTHREADS) typedef pthread_attr_t PlatformThreadRegisters; #else @@ -349,6 +358,22 @@ static size_t getPlatformThreadRegisters(const PlatformThread& platformThread, P regs.ContextFlags = CONTEXT_INTEGER | CONTEXT_CONTROL; GetThreadContext(platformThread, ®s); return sizeof(CONTEXT); +#elif OS(QNX) + memset(®s, 0, sizeof(regs)); + regs.tid = platformThread; + // FIXME: If we find this hurts performance, we can consider caching the fd and keeping it open. + int fd = open("/proc/self/as", O_RDONLY); + if (fd == -1) { + LOG_ERROR("Unable to open /proc/self/as (errno: %d)", errno); + CRASH(); + } + int rc = devctl(fd, DCMD_PROC_TIDSTATUS, ®s, sizeof(regs), 0); + if (rc != EOK) { + LOG_ERROR("devctl(DCMD_PROC_TIDSTATUS) failed (error: %d)", rc); + CRASH(); + } + close(fd); + return sizeof(struct _debug_thread_info); #elif USE(PTHREADS) pthread_attr_init(®s); #if HAVE(PTHREAD_NP_H) || OS(NETBSD) @@ -413,6 +438,9 @@ static inline void* otherThreadStackPointer(const PlatformThreadRegisters& regs) #error Unknown Architecture #endif +#elif OS(QNX) + return reinterpret_cast((uintptr_t) regs.sp); + #elif USE(PTHREADS) void* stackBase = 0; size_t stackSize = 0; @@ -427,7 +455,7 @@ static inline void* otherThreadStackPointer(const PlatformThreadRegisters& regs) static void freePlatformThreadRegisters(PlatformThreadRegisters& regs) { -#if USE(PTHREADS) && !OS(WINDOWS) && !OS(DARWIN) +#if USE(PTHREADS) && !OS(WINDOWS) && !OS(DARWIN) && !OS(QNX) pthread_attr_destroy(®s); #else UNUSED_PARAM(regs); diff --git a/JavaScriptCore/heap/MarkStack.cpp b/JavaScriptCore/heap/MarkStack.cpp index 688de42e..39907c71 100644 --- a/JavaScriptCore/heap/MarkStack.cpp +++ b/JavaScriptCore/heap/MarkStack.cpp @@ -57,29 +57,8 @@ MarkStackArray::MarkStackArray(BlockAllocator& blockAllocator) MarkStackArray::~MarkStackArray() { - ASSERT(m_numberOfSegments == 1); - ASSERT(m_segments.size() == 1); + ASSERT(m_numberOfSegments == 1 && m_segments.size() == 1); m_blockAllocator.deallocate(MarkStackSegment::destroy(m_segments.removeHead())); - m_numberOfSegments--; - ASSERT(!m_numberOfSegments); - ASSERT(!m_segments.size()); -} - -void MarkStackArray::clear() -{ - if (!m_segments.head()) - return; - MarkStackSegment* next; - for (MarkStackSegment* current = m_segments.head(); current->next(); current = next) { - next = current->next(); - m_segments.remove(current); - m_blockAllocator.deallocate(MarkStackSegment::destroy(current)); - } - m_top = 0; - m_numberOfSegments = 1; -#if !ASSERT_DISABLED - m_segments.head()->m_top = 0; -#endif } void MarkStackArray::expand() @@ -188,28 +167,4 @@ void MarkStackArray::stealSomeCellsFrom(MarkStackArray& other, size_t idleThread append(other.removeLast()); } -void MarkStackArray::fillVector(Vector& vector) -{ - ASSERT(vector.size() == size()); - - MarkStackSegment* currentSegment = m_segments.head(); - if (!currentSegment) - return; - - unsigned count = 0; - for (unsigned i = 0; i < m_top; ++i) { - ASSERT(currentSegment->data()[i]); - vector[count++] = currentSegment->data()[i]; - } - - currentSegment = currentSegment->next(); - while (currentSegment) { - for (unsigned i = 0; i < s_segmentCapacity; ++i) { - ASSERT(currentSegment->data()[i]); - vector[count++] = currentSegment->data()[i]; - } - currentSegment = currentSegment->next(); - } -} - } // namespace JSC diff --git a/JavaScriptCore/heap/MarkStack.h b/JavaScriptCore/heap/MarkStack.h index 6729bad2..c97b6a73 100644 --- a/JavaScriptCore/heap/MarkStack.h +++ b/JavaScriptCore/heap/MarkStack.h @@ -52,7 +52,6 @@ #include "HeapBlock.h" #include -#include namespace JSC { @@ -101,9 +100,6 @@ class MarkStackArray { size_t size(); bool isEmpty(); - void fillVector(Vector&); - void clear(); - private: template struct CapacityFromSize { static const size_t value = (size - sizeof(MarkStackSegment)) / sizeof(const JSCell*); diff --git a/JavaScriptCore/heap/MarkedAllocator.cpp b/JavaScriptCore/heap/MarkedAllocator.cpp index c2b0f72d..74402087 100644 --- a/JavaScriptCore/heap/MarkedAllocator.cpp +++ b/JavaScriptCore/heap/MarkedAllocator.cpp @@ -10,10 +10,10 @@ namespace JSC { -static bool isListPagedOut(double deadline, DoublyLinkedList& list) +bool MarkedAllocator::isPagedOut(double deadline) { unsigned itersSinceLastTimeCheck = 0; - MarkedBlock* block = list.head(); + MarkedBlock* block = m_blockList.head(); while (block) { block = block->next(); ++itersSinceLastTimeCheck; @@ -24,13 +24,7 @@ static bool isListPagedOut(double deadline, DoublyLinkedList& list) itersSinceLastTimeCheck = 0; } } - return false; -} -bool MarkedAllocator::isPagedOut(double deadline) -{ - if (isListPagedOut(deadline, m_blockList)) - return true; return false; } @@ -42,23 +36,15 @@ inline void* MarkedAllocator::tryAllocateHelper(size_t bytes) while (!m_freeList.head) { DelayedReleaseScope delayedReleaseScope(*m_markedSpace); if (m_currentBlock) { - ASSERT(m_currentBlock == m_nextBlockToSweep); + ASSERT(m_currentBlock == m_blocksToSweep); m_currentBlock->didConsumeFreeList(); - m_nextBlockToSweep = m_currentBlock->next(); + m_blocksToSweep = m_currentBlock->next(); } - MarkedBlock* next; - for (MarkedBlock*& block = m_nextBlockToSweep; block; block = next) { - next = block->next(); - + for (MarkedBlock*& block = m_blocksToSweep; block; block = block->next()) { MarkedBlock::FreeList freeList = block->sweep(MarkedBlock::SweepToFreeList); - if (!freeList.head) { block->didConsumeEmptyFreeList(); - m_blockList.remove(block); - m_blockList.push(block); - if (!m_lastFullBlock) - m_lastFullBlock = block; continue; } @@ -82,7 +68,6 @@ inline void* MarkedAllocator::tryAllocateHelper(size_t bytes) MarkedBlock::FreeCell* head = m_freeList.head; m_freeList.head = head->next; ASSERT(head); - m_markedSpace->didAllocateInBlock(m_currentBlock); return head; } @@ -151,7 +136,7 @@ void MarkedAllocator::addBlock(MarkedBlock* block) ASSERT(!m_freeList.head); m_blockList.append(block); - m_nextBlockToSweep = m_currentBlock = block; + m_blocksToSweep = m_currentBlock = block; m_freeList = block->sweep(MarkedBlock::SweepToFreeList); m_markedSpace->didAddBlock(block); } @@ -162,27 +147,9 @@ void MarkedAllocator::removeBlock(MarkedBlock* block) m_currentBlock = m_currentBlock->next(); m_freeList = MarkedBlock::FreeList(); } - if (m_nextBlockToSweep == block) - m_nextBlockToSweep = m_nextBlockToSweep->next(); - - if (block == m_lastFullBlock) - m_lastFullBlock = m_lastFullBlock->prev(); - + if (m_blocksToSweep == block) + m_blocksToSweep = m_blocksToSweep->next(); m_blockList.remove(block); } -void MarkedAllocator::reset() -{ - m_lastActiveBlock = 0; - m_currentBlock = 0; - m_freeList = MarkedBlock::FreeList(); - if (m_heap->operationInProgress() == FullCollection) - m_lastFullBlock = 0; - - if (m_lastFullBlock) - m_nextBlockToSweep = m_lastFullBlock->next() ? m_lastFullBlock->next() : m_lastFullBlock; - else - m_nextBlockToSweep = m_blockList.head(); -} - } // namespace JSC diff --git a/JavaScriptCore/heap/MarkedAllocator.h b/JavaScriptCore/heap/MarkedAllocator.h index e0d3e890..3a629c3e 100644 --- a/JavaScriptCore/heap/MarkedAllocator.h +++ b/JavaScriptCore/heap/MarkedAllocator.h @@ -52,8 +52,7 @@ class MarkedAllocator { MarkedBlock::FreeList m_freeList; MarkedBlock* m_currentBlock; MarkedBlock* m_lastActiveBlock; - MarkedBlock* m_nextBlockToSweep; - MarkedBlock* m_lastFullBlock; + MarkedBlock* m_blocksToSweep; DoublyLinkedList m_blockList; size_t m_cellSize; MarkedBlock::DestructorType m_destructorType; @@ -69,8 +68,7 @@ inline ptrdiff_t MarkedAllocator::offsetOfFreeListHead() inline MarkedAllocator::MarkedAllocator() : m_currentBlock(0) , m_lastActiveBlock(0) - , m_nextBlockToSweep(0) - , m_lastFullBlock(0) + , m_blocksToSweep(0) , m_cellSize(0) , m_destructorType(MarkedBlock::None) , m_heap(0) @@ -104,6 +102,14 @@ inline void* MarkedAllocator::allocate(size_t bytes) return head; } +inline void MarkedAllocator::reset() +{ + m_lastActiveBlock = 0; + m_currentBlock = 0; + m_freeList = MarkedBlock::FreeList(); + m_blocksToSweep = m_blockList.head(); +} + inline void MarkedAllocator::stopAllocating() { ASSERT(!m_lastActiveBlock); diff --git a/JavaScriptCore/heap/MarkedBlock.cpp b/JavaScriptCore/heap/MarkedBlock.cpp index 674f4563..10858042 100644 --- a/JavaScriptCore/heap/MarkedBlock.cpp +++ b/JavaScriptCore/heap/MarkedBlock.cpp @@ -197,51 +197,6 @@ void MarkedBlock::stopAllocating(const FreeList& freeList) m_state = Marked; } -void MarkedBlock::clearMarks() -{ -#if ENABLE(GGC) - if (heap()->operationInProgress() == JSC::EdenCollection) - this->clearMarksWithCollectionType(); - else - this->clearMarksWithCollectionType(); -#else - this->clearMarksWithCollectionType(); -#endif -} - -void MarkedBlock::clearRememberedSet() -{ - m_rememberedSet.clearAll(); -} - -template -void MarkedBlock::clearMarksWithCollectionType() -{ - ASSERT(collectionType == FullCollection || collectionType == EdenCollection); - HEAP_LOG_BLOCK_STATE_TRANSITION(this); - - ASSERT(m_state != New && m_state != FreeListed); - if (collectionType == FullCollection) { - m_marks.clearAll(); -#if ENABLE(GGC) - m_rememberedSet.clearAll(); -#endif - } - - // This will become true at the end of the mark phase. We set it now to - // avoid an extra pass to do so later. - m_state = Marked; -} - -void MarkedBlock::lastChanceToFinalize() -{ - m_weakSet.lastChanceToFinalize(); - - clearNewlyAllocated(); - clearMarksWithCollectionType(); - sweep(); -} - MarkedBlock::FreeList MarkedBlock::resumeAllocating() { HEAP_LOG_BLOCK_STATE_TRANSITION(this); diff --git a/JavaScriptCore/heap/MarkedBlock.h b/JavaScriptCore/heap/MarkedBlock.h index 73f56cd7..2f1bfbd7 100644 --- a/JavaScriptCore/heap/MarkedBlock.h +++ b/JavaScriptCore/heap/MarkedBlock.h @@ -25,7 +25,6 @@ #include "BlockAllocator.h" #include "HeapBlock.h" -#include "HeapOperation.h" #include "WeakSet.h" #include #include @@ -73,7 +72,7 @@ namespace JSC { friend class LLIntOffsetsExtractor; public: - static const size_t atomSize = 16; // bytes + static const size_t atomSize = 8; // bytes static const size_t atomShiftAmount = 4; // log_2(atomSize) FIXME: Change atomSize to 16. static const size_t blockSize = 64 * KB; static const size_t blockMask = ~(blockSize - 1); // blockSize must be a power of two. @@ -141,16 +140,11 @@ namespace JSC { void stopAllocating(const FreeList&); FreeList resumeAllocating(); // Call this if you canonicalized a block for some non-collection related purpose. void didConsumeEmptyFreeList(); // Call this if you sweep a block, but the returned FreeList is empty. - void didSweepToNoAvail(); // Call this if you sweep a block and get an empty free list back. // Returns true if the "newly allocated" bitmap was non-null // and was successfully cleared and false otherwise. bool clearNewlyAllocated(); void clearMarks(); - void clearRememberedSet(); - template - void clearMarksWithCollectionType(); - size_t markCount(); bool isEmpty(); @@ -167,11 +161,6 @@ namespace JSC { void setMarked(const void*); void clearMarked(const void*); - void setRemembered(const void*); - void clearRemembered(const void*); - void atomicClearRemembered(const void*); - bool isRemembered(const void*); - bool isNewlyAllocated(const void*); void setNewlyAllocated(const void*); void clearNewlyAllocated(const void*); @@ -201,11 +190,9 @@ namespace JSC { size_t m_atomsPerCell; size_t m_endAtom; // This is a fuzzy end. Always test for < m_endAtom. #if ENABLE(PARALLEL_GC) - WTF::Bitmap m_marks; - WTF::Bitmap m_rememberedSet; + WTF::Bitmap m_marks; #else - WTF::Bitmap m_marks; - WTF::Bitmap m_rememberedSet; + WTF::Bitmap m_marks; #endif OwnPtr> m_newlyAllocated; @@ -247,6 +234,15 @@ namespace JSC { return reinterpret_cast(reinterpret_cast(p) & blockMask); } + inline void MarkedBlock::lastChanceToFinalize() + { + m_weakSet.lastChanceToFinalize(); + + clearNewlyAllocated(); + clearMarks(); + sweep(); + } + inline MarkedAllocator* MarkedBlock::allocator() const { return m_allocator; @@ -295,10 +291,26 @@ namespace JSC { HEAP_LOG_BLOCK_STATE_TRANSITION(this); ASSERT(!m_newlyAllocated); +#ifndef NDEBUG + for (size_t i = firstAtom(); i < m_endAtom; i += m_atomsPerCell) + ASSERT(m_marks.get(i)); +#endif ASSERT(m_state == FreeListed); m_state = Marked; } + inline void MarkedBlock::clearMarks() + { + HEAP_LOG_BLOCK_STATE_TRANSITION(this); + + ASSERT(m_state != New && m_state != FreeListed); + m_marks.clearAll(); + + // This will become true at the end of the mark phase. We set it now to + // avoid an extra pass to do so later. + m_state = Marked; + } + inline size_t MarkedBlock::markCount() { return m_marks.count(); @@ -334,26 +346,6 @@ namespace JSC { return (reinterpret_cast(p) - reinterpret_cast(this)) / atomSize; } - inline void MarkedBlock::setRemembered(const void* p) - { - m_rememberedSet.set(atomNumber(p)); - } - - inline void MarkedBlock::clearRemembered(const void* p) - { - m_rememberedSet.clear(atomNumber(p)); - } - - inline void MarkedBlock::atomicClearRemembered(const void* p) - { - m_rememberedSet.concurrentTestAndClear(atomNumber(p)); - } - - inline bool MarkedBlock::isRemembered(const void* p) - { - return m_rememberedSet.get(atomNumber(p)); - } - inline bool MarkedBlock::isMarked(const void* p) { return m_marks.get(atomNumber(p)); diff --git a/JavaScriptCore/heap/MarkedSpace.cpp b/JavaScriptCore/heap/MarkedSpace.cpp index e005337a..d0ad1412 100644 --- a/JavaScriptCore/heap/MarkedSpace.cpp +++ b/JavaScriptCore/heap/MarkedSpace.cpp @@ -105,7 +105,6 @@ MarkedSpace::~MarkedSpace() { Free free(Free::FreeAll, this); forEachBlock(free); - ASSERT(!m_blocks.set().size()); } struct LastChanceToFinalize : MarkedBlock::VoidFunctor { @@ -121,8 +120,6 @@ void MarkedSpace::lastChanceToFinalize() void MarkedSpace::sweep() { - if (Options::logGC()) - dataLog("Eagerly sweeping..."); m_heap->sweeper()->willFinishSweeping(); forEachBlock(); } @@ -144,29 +141,17 @@ void MarkedSpace::resetAllocators() m_normalSpace.largeAllocator.reset(); m_normalDestructorSpace.largeAllocator.reset(); m_immortalStructureDestructorSpace.largeAllocator.reset(); - -#if ENABLE(GGC) - m_blocksWithNewObjects.clear(); -#endif } void MarkedSpace::visitWeakSets(HeapRootVisitor& heapRootVisitor) { VisitWeakSet visitWeakSet(heapRootVisitor); - if (m_heap->operationInProgress() == EdenCollection) { - for (unsigned i = 0; i < m_blocksWithNewObjects.size(); ++i) - visitWeakSet(m_blocksWithNewObjects[i]); - } else - forEachBlock(visitWeakSet); + forEachBlock(visitWeakSet); } void MarkedSpace::reapWeakSets() { - if (m_heap->operationInProgress() == EdenCollection) { - for (unsigned i = 0; i < m_blocksWithNewObjects.size(); ++i) - m_blocksWithNewObjects[i]->reapWeakSet(); - } else - forEachBlock(); + forEachBlock(); } template @@ -318,24 +303,6 @@ void MarkedSpace::clearNewlyAllocated() #endif } -#ifndef NDEBUG -struct VerifyMarked : MarkedBlock::VoidFunctor { - void operator()(MarkedBlock* block) { ASSERT(block->needsSweeping()); } -}; -#endif - -void MarkedSpace::clearMarks() -{ - if (m_heap->operationInProgress() == EdenCollection) { - for (unsigned i = 0; i < m_blocksWithNewObjects.size(); ++i) - m_blocksWithNewObjects[i]->clearMarks(); - } else - forEachBlock(); -#ifndef NDEBUG - forEachBlock(); -#endif -} - void MarkedSpace::willStartIterating() { ASSERT(!isIterating()); diff --git a/JavaScriptCore/heap/MarkedSpace.h b/JavaScriptCore/heap/MarkedSpace.h index e853d667..96806703 100644 --- a/JavaScriptCore/heap/MarkedSpace.h +++ b/JavaScriptCore/heap/MarkedSpace.h @@ -46,17 +46,7 @@ class WeakGCHandle; class SlotVisitor; struct ClearMarks : MarkedBlock::VoidFunctor { - void operator()(MarkedBlock* block) - { - block->clearMarks(); - } -}; - -struct ClearRememberedSet : MarkedBlock::VoidFunctor { - void operator()(MarkedBlock* block) - { - block->clearRememberedSet(); - } + void operator()(MarkedBlock* block) { block->clearMarks(); } }; struct Sweep : MarkedBlock::VoidFunctor { @@ -115,10 +105,8 @@ class MarkedSpace { void didAddBlock(MarkedBlock*); void didConsumeFreeList(MarkedBlock*); - void didAllocateInBlock(MarkedBlock*); void clearMarks(); - void clearRememberedSet(); void clearNewlyAllocated(); void sweep(); size_t objectCount(); @@ -162,7 +150,6 @@ class MarkedSpace { size_t m_capacity; bool m_isIterating; MarkedBlockSet m_blocks; - Vector m_blocksWithNewObjects; DelayedReleaseScope* m_currentDelayedReleaseScope; }; @@ -275,18 +262,9 @@ inline void MarkedSpace::didAddBlock(MarkedBlock* block) m_blocks.add(block); } -inline void MarkedSpace::didAllocateInBlock(MarkedBlock* block) -{ -#if ENABLE(GGC) - m_blocksWithNewObjects.append(block); -#else - UNUSED_PARAM(block); -#endif -} - -inline void MarkedSpace::clearRememberedSet() +inline void MarkedSpace::clearMarks() { - forEachBlock(); + forEachBlock(); } inline size_t MarkedSpace::objectCount() diff --git a/JavaScriptCore/heap/SlotVisitor.cpp b/JavaScriptCore/heap/SlotVisitor.cpp index 05fb001a..cda2b79a 100644 --- a/JavaScriptCore/heap/SlotVisitor.cpp +++ b/JavaScriptCore/heap/SlotVisitor.cpp @@ -33,7 +33,7 @@ SlotVisitor::SlotVisitor(GCThreadSharedData& shared) SlotVisitor::~SlotVisitor() { - clearMarkStack(); + ASSERT(m_stack.isEmpty()); } void SlotVisitor::setup() @@ -63,11 +63,6 @@ void SlotVisitor::reset() } } -void SlotVisitor::clearMarkStack() -{ - m_stack.clear(); -} - void SlotVisitor::append(ConservativeRoots& conservativeRoots) { StackStats::probe(); diff --git a/JavaScriptCore/heap/SlotVisitor.h b/JavaScriptCore/heap/SlotVisitor.h index 4a8dc3e9..a4aacdc5 100644 --- a/JavaScriptCore/heap/SlotVisitor.h +++ b/JavaScriptCore/heap/SlotVisitor.h @@ -49,10 +49,6 @@ class SlotVisitor { SlotVisitor(GCThreadSharedData&); ~SlotVisitor(); - MarkStackArray& markStack() { return m_stack; } - - Heap* heap() const; - void append(ConservativeRoots&); template void append(JITWriteBarrier*); @@ -65,19 +61,17 @@ class SlotVisitor { void appendUnbarrieredValue(JSValue*); template void appendUnbarrieredWeak(Weak*); - void unconditionallyAppend(JSCell*); void addOpaqueRoot(void*); bool containsOpaqueRoot(void*); TriState containsOpaqueRootTriState(void*); int opaqueRootCount(); - GCThreadSharedData& sharedData() const { return m_shared; } + GCThreadSharedData& sharedData() { return m_shared; } bool isEmpty() { return m_stack.isEmpty(); } void setup(); void reset(); - void clearMarkStack(); size_t bytesVisited() const { return m_bytesVisited; } size_t bytesCopied() const { return m_bytesCopied; } @@ -95,7 +89,7 @@ class SlotVisitor { void copyLater(JSCell*, CopyToken, void*, size_t); - void reportExtraMemoryUsage(JSCell* owner, size_t); + void reportExtraMemoryUsage(size_t size); void addWeakReferenceHarvester(WeakReferenceHarvester*); void addUnconditionalFinalizer(UnconditionalFinalizer*); diff --git a/JavaScriptCore/heap/SlotVisitorInlines.h b/JavaScriptCore/heap/SlotVisitorInlines.h index ccd2e4ae..d503d1c7 100644 --- a/JavaScriptCore/heap/SlotVisitorInlines.h +++ b/JavaScriptCore/heap/SlotVisitorInlines.h @@ -101,17 +101,10 @@ ALWAYS_INLINE void SlotVisitor::internalAppend(void* from, JSCell* cell) return; m_bytesVisited += MarkedBlock::blockFor(cell)->cellSize(); + m_visitCount++; MARK_LOG_CHILD(*this, cell); - unconditionallyAppend(cell); -} - -ALWAYS_INLINE void SlotVisitor::unconditionallyAppend(JSCell* cell) -{ - ASSERT(Heap::isMarked(cell)); - m_visitCount++; - // Should never attempt to mark something that is zapped. ASSERT(!cell->isZapped()); @@ -225,29 +218,22 @@ inline void SlotVisitor::donateAndDrain() inline void SlotVisitor::copyLater(JSCell* owner, CopyToken token, void* ptr, size_t bytes) { ASSERT(bytes); + m_bytesCopied += bytes; + CopiedBlock* block = CopiedSpace::blockFor(ptr); if (block->isOversize()) { m_shared.m_copiedSpace->pin(block); return; } - SpinLockHolder locker(&block->workListLock()); - if (heap()->operationInProgress() == FullCollection || block->shouldReportLiveBytes(locker, owner)) { - m_bytesCopied += bytes; - block->reportLiveBytes(locker, owner, token, bytes); - } + if (block->isPinned()) + return; + + block->reportLiveBytes(owner, token, bytes); } -inline void SlotVisitor::reportExtraMemoryUsage(JSCell* owner, size_t size) +inline void SlotVisitor::reportExtraMemoryUsage(size_t size) { -#if ENABLE(GGC) - // We don't want to double-count the extra memory that was reported in previous collections. - if (heap()->operationInProgress() == EdenCollection && MarkedBlock::blockFor(owner)->isRemembered(owner)) - return; -#else - UNUSED_PARAM(owner); -#endif - size_t* counter = &m_shared.m_vm->heap.m_extraMemoryUsage; #if ENABLE(COMPARE_AND_SWAP) @@ -261,11 +247,6 @@ inline void SlotVisitor::reportExtraMemoryUsage(JSCell* owner, size_t size) #endif } -inline Heap* SlotVisitor::heap() const -{ - return &sharedData().m_vm->heap; -} - } // namespace JSC #endif // SlotVisitorInlines_h diff --git a/JavaScriptCore/heap/TinyBloomFilter.h b/JavaScriptCore/heap/TinyBloomFilter.h index 15a419de..a75ce8ce 100644 --- a/JavaScriptCore/heap/TinyBloomFilter.h +++ b/JavaScriptCore/heap/TinyBloomFilter.h @@ -35,7 +35,6 @@ class TinyBloomFilter { TinyBloomFilter(); void add(Bits); - void add(TinyBloomFilter&); bool ruleOut(Bits) const; // True for 0. void reset(); @@ -53,11 +52,6 @@ inline void TinyBloomFilter::add(Bits bits) m_bits |= bits; } -inline void TinyBloomFilter::add(TinyBloomFilter& other) -{ - m_bits |= other.m_bits; -} - inline bool TinyBloomFilter::ruleOut(Bits bits) const { if (!bits) diff --git a/JavaScriptCore/inspector/InjectedScript.cpp b/JavaScriptCore/inspector/InjectedScript.cpp deleted file mode 100644 index 38fac562..00000000 --- a/JavaScriptCore/inspector/InjectedScript.cpp +++ /dev/null @@ -1,243 +0,0 @@ -/* - * Copyright (C) 2013 Apple Inc. All rights reserved. - * Copyright (C) 2012 Google 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: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * 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. - * * Neither the name of Google Inc. nor the names of its - * contributors may be used to endorse or promote products derived from - * this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND 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 THE COPYRIGHT - * OWNER 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 "InjectedScript.h" - -#if ENABLE(INSPECTOR) - -#include "InspectorValues.h" -#include "ScriptFunctionCall.h" -#include "ScriptObject.h" -#include - -using Inspector::TypeBuilder::Array; - -namespace Inspector { - -InjectedScript::InjectedScript() - : InjectedScriptBase(ASCIILiteral("InjectedScript")) -{ -} - -InjectedScript::InjectedScript(Deprecated::ScriptObject injectedScriptObject, InspectorEnvironment* environment) - : InjectedScriptBase(ASCIILiteral("InjectedScript"), injectedScriptObject, environment) -{ -} - -InjectedScript::~InjectedScript() -{ -} - -void InjectedScript::evaluate(ErrorString* errorString, const String& expression, const String& objectGroup, bool includeCommandLineAPI, bool returnByValue, bool generatePreview, RefPtr* result, Inspector::TypeBuilder::OptOutput* wasThrown) -{ - Deprecated::ScriptFunctionCall function(injectedScriptObject(), ASCIILiteral("evaluate"), inspectorEnvironment()->functionCallHandler()); - function.appendArgument(expression); - function.appendArgument(objectGroup); - function.appendArgument(includeCommandLineAPI); - function.appendArgument(returnByValue); - function.appendArgument(generatePreview); - makeEvalCall(errorString, function, result, wasThrown); -} - -void InjectedScript::callFunctionOn(ErrorString* errorString, const String& objectId, const String& expression, const String& arguments, bool returnByValue, bool generatePreview, RefPtr* result, Inspector::TypeBuilder::OptOutput* wasThrown) -{ - Deprecated::ScriptFunctionCall function(injectedScriptObject(), ASCIILiteral("callFunctionOn"), inspectorEnvironment()->functionCallHandler()); - function.appendArgument(objectId); - function.appendArgument(expression); - function.appendArgument(arguments); - function.appendArgument(returnByValue); - function.appendArgument(generatePreview); - makeEvalCall(errorString, function, result, wasThrown); -} - -void InjectedScript::evaluateOnCallFrame(ErrorString* errorString, const Deprecated::ScriptValue& callFrames, const String& callFrameId, const String& expression, const String& objectGroup, bool includeCommandLineAPI, bool returnByValue, bool generatePreview, RefPtr* result, Inspector::TypeBuilder::OptOutput* wasThrown) -{ - Deprecated::ScriptFunctionCall function(injectedScriptObject(), ASCIILiteral("evaluateOnCallFrame"), inspectorEnvironment()->functionCallHandler()); - function.appendArgument(callFrames); - function.appendArgument(callFrameId); - function.appendArgument(expression); - function.appendArgument(objectGroup); - function.appendArgument(includeCommandLineAPI); - function.appendArgument(returnByValue); - function.appendArgument(generatePreview); - makeEvalCall(errorString, function, result, wasThrown); -} - -void InjectedScript::getFunctionDetails(ErrorString* errorString, const String& functionId, RefPtr* result) -{ - Deprecated::ScriptFunctionCall function(injectedScriptObject(), ASCIILiteral("getFunctionDetails"), inspectorEnvironment()->functionCallHandler()); - function.appendArgument(functionId); - - RefPtr resultValue; - makeCall(function, &resultValue); - if (!resultValue || resultValue->type() != InspectorValue::TypeObject) { - if (!resultValue->asString(errorString)) - *errorString = ASCIILiteral("Internal error"); - return; - } - - *result = Inspector::TypeBuilder::Debugger::FunctionDetails::runtimeCast(resultValue); -} - -void InjectedScript::getProperties(ErrorString* errorString, const String& objectId, bool ownProperties, RefPtr>* properties) -{ - Deprecated::ScriptFunctionCall function(injectedScriptObject(), ASCIILiteral("getProperties"), inspectorEnvironment()->functionCallHandler()); - function.appendArgument(objectId); - function.appendArgument(ownProperties); - - RefPtr result; - makeCall(function, &result); - if (!result || result->type() != InspectorValue::TypeArray) { - *errorString = ASCIILiteral("Internal error"); - return; - } - - *properties = Array::runtimeCast(result); -} - -void InjectedScript::getInternalProperties(ErrorString* errorString, const String& objectId, RefPtr>* properties) -{ - Deprecated::ScriptFunctionCall function(injectedScriptObject(), ASCIILiteral("getInternalProperties"), inspectorEnvironment()->functionCallHandler()); - function.appendArgument(objectId); - - RefPtr result; - makeCall(function, &result); - if (!result || result->type() != InspectorValue::TypeArray) { - *errorString = ASCIILiteral("Internal error"); - return; - } - - RefPtr> array = Array::runtimeCast(result); - if (array->length() > 0) - *properties = array; -} - -#if ENABLE(JAVASCRIPT_DEBUGGER) -PassRefPtr> InjectedScript::wrapCallFrames(const Deprecated::ScriptValue& callFrames) -{ - ASSERT(!hasNoValue()); - Deprecated::ScriptFunctionCall function(injectedScriptObject(), ASCIILiteral("wrapCallFrames"), inspectorEnvironment()->functionCallHandler()); - function.appendArgument(callFrames); - - bool hadException = false; - Deprecated::ScriptValue callFramesValue = callFunctionWithEvalEnabled(function, hadException); - ASSERT(!hadException); - RefPtr result = callFramesValue.toInspectorValue(scriptState()); - if (result->type() == InspectorValue::TypeArray) - return Array::runtimeCast(result); - - return Array::create(); -} -#endif - -PassRefPtr InjectedScript::wrapObject(const Deprecated::ScriptValue& value, const String& groupName, bool generatePreview) const -{ - ASSERT(!hasNoValue()); - Deprecated::ScriptFunctionCall wrapFunction(injectedScriptObject(), ASCIILiteral("wrapObject"), inspectorEnvironment()->functionCallHandler()); - wrapFunction.appendArgument(value); - wrapFunction.appendArgument(groupName); - wrapFunction.appendArgument(hasAccessToInspectedScriptState()); - wrapFunction.appendArgument(generatePreview); - - bool hadException = false; - Deprecated::ScriptValue r = callFunctionWithEvalEnabled(wrapFunction, hadException); - if (hadException) - return nullptr; - - RefPtr rawResult = r.toInspectorValue(scriptState())->asObject(); - return Inspector::TypeBuilder::Runtime::RemoteObject::runtimeCast(rawResult); -} - -PassRefPtr InjectedScript::wrapTable(const Deprecated::ScriptValue& table, const Deprecated::ScriptValue& columns) const -{ - ASSERT(!hasNoValue()); - Deprecated::ScriptFunctionCall wrapFunction(injectedScriptObject(), ASCIILiteral("wrapTable"), inspectorEnvironment()->functionCallHandler()); - wrapFunction.appendArgument(hasAccessToInspectedScriptState()); - wrapFunction.appendArgument(table); - if (columns.hasNoValue()) - wrapFunction.appendArgument(false); - else - wrapFunction.appendArgument(columns); - - bool hadException = false; - Deprecated::ScriptValue r = callFunctionWithEvalEnabled(wrapFunction, hadException); - if (hadException) - return nullptr; - - RefPtr rawResult = r.toInspectorValue(scriptState())->asObject(); - return Inspector::TypeBuilder::Runtime::RemoteObject::runtimeCast(rawResult); -} - -Deprecated::ScriptValue InjectedScript::findObjectById(const String& objectId) const -{ - ASSERT(!hasNoValue()); - Deprecated::ScriptFunctionCall function(injectedScriptObject(), ASCIILiteral("findObjectById"), inspectorEnvironment()->functionCallHandler()); - function.appendArgument(objectId); - - bool hadException = false; - Deprecated::ScriptValue resultValue = callFunctionWithEvalEnabled(function, hadException); - ASSERT(!hadException); - - return resultValue; -} - -void InjectedScript::inspectObject(Deprecated::ScriptValue value) -{ - ASSERT(!hasNoValue()); - Deprecated::ScriptFunctionCall function(injectedScriptObject(), ASCIILiteral("inspectObject"), inspectorEnvironment()->functionCallHandler()); - function.appendArgument(value); - RefPtr result; - makeCall(function, &result); -} - -void InjectedScript::releaseObject(const String& objectId) -{ - Deprecated::ScriptFunctionCall function(injectedScriptObject(), ASCIILiteral("releaseObject"), inspectorEnvironment()->functionCallHandler()); - function.appendArgument(objectId); - RefPtr result; - makeCall(function, &result); -} - -void InjectedScript::releaseObjectGroup(const String& objectGroup) -{ - ASSERT(!hasNoValue()); - Deprecated::ScriptFunctionCall releaseFunction(injectedScriptObject(), ASCIILiteral("releaseObjectGroup"), inspectorEnvironment()->functionCallHandler()); - releaseFunction.appendArgument(objectGroup); - - bool hadException = false; - callFunctionWithEvalEnabled(releaseFunction, hadException); - ASSERT(!hadException); -} - -} // namespace Inspector - -#endif // ENABLE(INSPECTOR) diff --git a/JavaScriptCore/inspector/InjectedScript.h b/JavaScriptCore/inspector/InjectedScript.h deleted file mode 100644 index ae671265..00000000 --- a/JavaScriptCore/inspector/InjectedScript.h +++ /dev/null @@ -1,85 +0,0 @@ -/* - * Copyright (C) 2013 Apple Inc. All rights reserved. - * Copyright (C) 2012 Google 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: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * 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. - * * Neither the name of Google Inc. nor the names of its - * contributors may be used to endorse or promote products derived from - * this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND 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 THE COPYRIGHT - * OWNER 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. - */ - -#ifndef InjectedScript_h -#define InjectedScript_h - -#if ENABLE(INSPECTOR) - -#include "InjectedScriptBase.h" -#include "InspectorJSTypeBuilders.h" -#include -#include -#include -#include - -namespace Deprecated { -class ScriptObject; -} - -namespace Inspector { - -class InjectedScriptModule; -class InspectorEnvironment; - -class JS_EXPORT_PRIVATE InjectedScript : public InjectedScriptBase { -public: - InjectedScript(); - InjectedScript(Deprecated::ScriptObject, InspectorEnvironment*); - virtual ~InjectedScript(); - - void evaluate(ErrorString*, const String& expression, const String& objectGroup, bool includeCommandLineAPI, bool returnByValue, bool generatePreview, RefPtr* result, TypeBuilder::OptOutput* wasThrown); - void callFunctionOn(ErrorString*, const String& objectId, const String& expression, const String& arguments, bool returnByValue, bool generatePreview, RefPtr* result, TypeBuilder::OptOutput* wasThrown); - void evaluateOnCallFrame(ErrorString*, const Deprecated::ScriptValue& callFrames, const String& callFrameId, const String& expression, const String& objectGroup, bool includeCommandLineAPI, bool returnByValue, bool generatePreview, RefPtr* result, TypeBuilder::OptOutput* wasThrown); - void getFunctionDetails(ErrorString*, const String& functionId, RefPtr* result); - void getProperties(ErrorString*, const String& objectId, bool ownProperties, RefPtr>* result); - void getInternalProperties(ErrorString*, const String& objectId, RefPtr>* result); - -#if ENABLE(JAVASCRIPT_DEBUGGER) - PassRefPtr> wrapCallFrames(const Deprecated::ScriptValue&); -#endif - PassRefPtr wrapObject(const Deprecated::ScriptValue&, const String& groupName, bool generatePreview = false) const; - PassRefPtr wrapTable(const Deprecated::ScriptValue& table, const Deprecated::ScriptValue& columns) const; - - Deprecated::ScriptValue findObjectById(const String& objectId) const; - void inspectObject(Deprecated::ScriptValue); - void releaseObject(const String& objectId); - void releaseObjectGroup(const String& objectGroup); - -private: - friend class InjectedScriptModule; -}; - -} // namespace Inspector - -#endif // ENABLE(INSPECTOR) - -#endif // InjectedScript_h diff --git a/JavaScriptCore/inspector/InjectedScriptBase.cpp b/JavaScriptCore/inspector/InjectedScriptBase.cpp deleted file mode 100644 index c2a49472..00000000 --- a/JavaScriptCore/inspector/InjectedScriptBase.cpp +++ /dev/null @@ -1,155 +0,0 @@ -/* - * Copyright (C) 2013 Apple Inc. All rights reserved. - * Copyright (C) 2012 Google 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: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * 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. - * * Neither the name of Google Inc. nor the names of its - * contributors may be used to endorse or promote products derived from - * this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND 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 THE COPYRIGHT - * OWNER 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 "InjectedScriptBase.h" - -#if ENABLE(INSPECTOR) - -#include "InspectorValues.h" -#include "JSGlobalObject.h" -#include "ScriptFunctionCall.h" -#include - -namespace Inspector { - -InjectedScriptBase::InjectedScriptBase(const String& name) - : m_name(name) - , m_environment(nullptr) -{ -} - -InjectedScriptBase::InjectedScriptBase(const String& name, Deprecated::ScriptObject injectedScriptObject, InspectorEnvironment* environment) - : m_name(name) - , m_injectedScriptObject(injectedScriptObject) - , m_environment(environment) -{ -} - -InjectedScriptBase::~InjectedScriptBase() -{ -} - -void InjectedScriptBase::initialize(Deprecated::ScriptObject injectedScriptObject, InspectorEnvironment* environment) -{ - m_injectedScriptObject = injectedScriptObject; - m_environment = environment; -} - -bool InjectedScriptBase::hasAccessToInspectedScriptState() const -{ - return m_environment && m_environment->canAccessInspectedScriptState(m_injectedScriptObject.scriptState()); -} - -const Deprecated::ScriptObject& InjectedScriptBase::injectedScriptObject() const -{ - return m_injectedScriptObject; -} - -Deprecated::ScriptValue InjectedScriptBase::callFunctionWithEvalEnabled(Deprecated::ScriptFunctionCall& function, bool& hadException) const -{ - if (m_environment) - m_environment->willCallInjectedScriptFunction(m_injectedScriptObject.scriptState(), name(), 1); - - JSC::ExecState* scriptState = m_injectedScriptObject.scriptState(); - bool evalIsDisabled = false; - if (scriptState) { - evalIsDisabled = !scriptState->lexicalGlobalObject()->evalEnabled(); - // Temporarily enable allow evals for inspector. - if (evalIsDisabled) - scriptState->lexicalGlobalObject()->setEvalEnabled(true); - } - - Deprecated::ScriptValue resultValue = function.call(hadException); - - if (evalIsDisabled) - scriptState->lexicalGlobalObject()->setEvalEnabled(false); - - if (m_environment) - m_environment->didCallInjectedScriptFunction(); - - return resultValue; -} - -void InjectedScriptBase::makeCall(Deprecated::ScriptFunctionCall& function, RefPtr* result) -{ - if (hasNoValue() || !hasAccessToInspectedScriptState()) { - *result = InspectorValue::null(); - return; - } - - bool hadException = false; - Deprecated::ScriptValue resultValue = callFunctionWithEvalEnabled(function, hadException); - - ASSERT(!hadException); - if (!hadException) { - *result = resultValue.toInspectorValue(m_injectedScriptObject.scriptState()); - if (!*result) - *result = InspectorString::create(String::format("Object has too long reference chain (must not be longer than %d)", InspectorValue::maxDepth)); - } else - *result = InspectorString::create("Exception while making a call."); -} - -void InjectedScriptBase::makeEvalCall(ErrorString* errorString, Deprecated::ScriptFunctionCall& function, RefPtr* objectResult, TypeBuilder::OptOutput* wasThrown) -{ - RefPtr result; - makeCall(function, &result); - if (!result) { - *errorString = ASCIILiteral("Internal error: result value is empty"); - return; - } - - if (result->type() == InspectorValue::TypeString) { - result->asString(errorString); - ASSERT(errorString->length()); - return; - } - - RefPtr resultPair = result->asObject(); - if (!resultPair) { - *errorString = ASCIILiteral("Internal error: result is not an Object"); - return; - } - - RefPtr resultObj = resultPair->getObject(ASCIILiteral("result")); - bool wasThrownVal = false; - if (!resultObj || !resultPair->getBoolean(ASCIILiteral("wasThrown"), &wasThrownVal)) { - *errorString = ASCIILiteral("Internal error: result is not a pair of value and wasThrown flag"); - return; - } - - *objectResult = TypeBuilder::Runtime::RemoteObject::runtimeCast(resultObj); - *wasThrown = wasThrownVal; -} - -} // namespace Inspector - -#endif // ENABLE(INSPECTOR) diff --git a/JavaScriptCore/inspector/InjectedScriptBase.h b/JavaScriptCore/inspector/InjectedScriptBase.h deleted file mode 100644 index 034e0c20..00000000 --- a/JavaScriptCore/inspector/InjectedScriptBase.h +++ /dev/null @@ -1,83 +0,0 @@ -/* - * Copyright (C) 2013 Apple Inc. All rights reserved. - * Copyright (C) 2012 Google 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: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * 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. - * * Neither the name of Google Inc. nor the names of its - * contributors may be used to endorse or promote products derived from - * this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND 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 THE COPYRIGHT - * OWNER 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. - */ - -#ifndef InjectedScriptBase_h -#define InjectedScriptBase_h - -#if ENABLE(INSPECTOR) - -#include "InspectorEnvironment.h" -#include "InspectorJSTypeBuilders.h" -#include "bindings/ScriptObject.h" -#include -#include - -namespace Deprecated { -class ScriptFunctionCall; -} - -namespace Inspector { - -typedef String ErrorString; - -class JS_EXPORT_PRIVATE InjectedScriptBase { -public: - virtual ~InjectedScriptBase(); - - const String& name() const { return m_name; } - bool hasNoValue() const { return m_injectedScriptObject.hasNoValue(); } - JSC::ExecState* scriptState() const { return m_injectedScriptObject.scriptState(); } - -protected: - InjectedScriptBase(const String& name); - InjectedScriptBase(const String& name, Deprecated::ScriptObject, InspectorEnvironment*); - - InspectorEnvironment* inspectorEnvironment() const { return m_environment; } - - void initialize(Deprecated::ScriptObject, InspectorEnvironment*); - bool hasAccessToInspectedScriptState() const; - - const Deprecated::ScriptObject& injectedScriptObject() const; - Deprecated::ScriptValue callFunctionWithEvalEnabled(Deprecated::ScriptFunctionCall&, bool& hadException) const; - void makeCall(Deprecated::ScriptFunctionCall&, RefPtr* result); - void makeEvalCall(ErrorString*, Deprecated::ScriptFunctionCall&, RefPtr* result, TypeBuilder::OptOutput* wasThrown); - -private: - String m_name; - Deprecated::ScriptObject m_injectedScriptObject; - InspectorEnvironment* m_environment; -}; - -} // namespace Inspector - -#endif // ENABLE(INSPECTOR) - -#endif // InjectedScriptBase_h diff --git a/JavaScriptCore/inspector/InjectedScriptHost.cpp b/JavaScriptCore/inspector/InjectedScriptHost.cpp deleted file mode 100644 index 46b3c4e3..00000000 --- a/JavaScriptCore/inspector/InjectedScriptHost.cpp +++ /dev/null @@ -1,83 +0,0 @@ -/* - * Copyright (C) 2013 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 "InjectedScriptHost.h" - -#if ENABLE(INSPECTOR) - -#include "JSInjectedScriptHost.h" - -using namespace JSC; - -namespace Inspector { - -InjectedScriptHost::~InjectedScriptHost() -{ -} - -JSValue InjectedScriptHost::jsWrapper(ExecState* exec, JSGlobalObject* globalObject) -{ - auto key = std::make_pair(exec, globalObject); - auto it = m_wrappers.find(key); - if (it != m_wrappers.end()) - return it->value.get(); - - JSValue jsValue = toJS(exec, globalObject, this); - if (!jsValue.isObject()) - return jsValue; - - JSObject* jsObject = jsValue.toObject(exec, globalObject); - Strong wrapper(exec->vm(), jsObject); - m_wrappers.add(key, wrapper); - - return jsValue; -} - -static void clearWrapperFromValue(JSValue value) -{ - JSInjectedScriptHost* jsInjectedScriptHost = toJSInjectedScriptHost(value); - ASSERT(jsInjectedScriptHost); - if (jsInjectedScriptHost) - jsInjectedScriptHost->releaseImpl(); -} - -void InjectedScriptHost::clearWrapper(ExecState* exec, JSGlobalObject* globalObject) -{ - auto key = std::make_pair(exec, globalObject); - clearWrapperFromValue(m_wrappers.take(key).get()); -} - -void InjectedScriptHost::clearAllWrappers() -{ - for (auto wrapper : m_wrappers) - clearWrapperFromValue(wrapper.value.get()); - - m_wrappers.clear(); -} - -} // namespace Inspector - -#endif // ENABLE(INSPECTOR) diff --git a/JavaScriptCore/inspector/InjectedScriptHost.h b/JavaScriptCore/inspector/InjectedScriptHost.h deleted file mode 100644 index db93f863..00000000 --- a/JavaScriptCore/inspector/InjectedScriptHost.h +++ /dev/null @@ -1,59 +0,0 @@ -/* - * Copyright (C) 2013 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. - */ - -#ifndef InjectedScriptHost_h -#define InjectedScriptHost_h - -#if ENABLE(INSPECTOR) - -#include "JSCJSValueInlines.h" -#include "Strong.h" -#include "StrongInlines.h" -#include -#include - -namespace Inspector { - -class JS_EXPORT_PRIVATE InjectedScriptHost : public RefCounted { -public: - static PassRefPtr create() { return adoptRef(new InjectedScriptHost); } - virtual ~InjectedScriptHost(); - - virtual JSC::JSValue type(JSC::ExecState*, JSC::JSValue) { return JSC::jsUndefined(); } - virtual bool isHTMLAllCollection(JSC::JSValue) { return false; } - - JSC::JSValue jsWrapper(JSC::ExecState*, JSC::JSGlobalObject*); - void clearWrapper(JSC::ExecState*, JSC::JSGlobalObject*); - void clearAllWrappers(); - -private: - HashMap, JSC::Strong> m_wrappers; -}; - -} // namespace Inspector - -#endif // ENABLE(INSPECTOR) - -#endif // !defined(InjectedScriptHost_h) diff --git a/JavaScriptCore/inspector/InjectedScriptManager.cpp b/JavaScriptCore/inspector/InjectedScriptManager.cpp deleted file mode 100644 index 72d20df3..00000000 --- a/JavaScriptCore/inspector/InjectedScriptManager.cpp +++ /dev/null @@ -1,185 +0,0 @@ -/* - * Copyright (C) 2007, 2008, 2013 Apple Inc. All rights reserved. - * Copyright (C) 2008 Matt Lilek - * Copyright (C) 2012 Google 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. - * 3. Neither the name of Apple Computer, Inc. ("Apple") nor the names of - * its contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY APPLE 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 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. - */ - -#include "config.h" -#include "InjectedScriptManager.h" - -#if ENABLE(INSPECTOR) - -#include "Completion.h" -#include "InjectedScriptHost.h" -#include "InjectedScriptSource.h" -#include "InspectorValues.h" -#include "JSInjectedScriptHost.h" -#include "JSLock.h" -#include "ScriptObject.h" -#include "SourceCode.h" - -using namespace JSC; - -namespace Inspector { - -InjectedScriptManager::InjectedScriptManager(InspectorEnvironment& environment, PassRefPtr injectedScriptHost) - : m_environment(environment) - , m_injectedScriptHost(injectedScriptHost) - , m_nextInjectedScriptId(1) -{ -} - -InjectedScriptManager::~InjectedScriptManager() -{ -} - -void InjectedScriptManager::disconnect() -{ - discardInjectedScripts(); - m_injectedScriptHost = nullptr; -} - -InjectedScriptHost* InjectedScriptManager::injectedScriptHost() -{ - return m_injectedScriptHost.get(); -} - -InjectedScript InjectedScriptManager::injectedScriptForId(int id) -{ - auto it = m_idToInjectedScript.find(id); - if (it != m_idToInjectedScript.end()) - return it->value; - - for (auto it = m_scriptStateToId.begin(); it != m_scriptStateToId.end(); ++it) { - if (it->value == id) - return injectedScriptFor(it->key); - } - - return InjectedScript(); -} - -int InjectedScriptManager::injectedScriptIdFor(ExecState* scriptState) -{ - auto it = m_scriptStateToId.find(scriptState); - if (it != m_scriptStateToId.end()) - return it->value; - - int id = m_nextInjectedScriptId++; - m_scriptStateToId.set(scriptState, id); - return id; -} - -InjectedScript InjectedScriptManager::injectedScriptForObjectId(const String& objectId) -{ - RefPtr parsedObjectId = InspectorValue::parseJSON(objectId); - if (parsedObjectId && parsedObjectId->type() == InspectorValue::TypeObject) { - long injectedScriptId = 0; - bool success = parsedObjectId->asObject()->getNumber(ASCIILiteral("injectedScriptId"), &injectedScriptId); - if (success) - return m_idToInjectedScript.get(injectedScriptId); - } - - return InjectedScript(); -} - -void InjectedScriptManager::discardInjectedScripts() -{ - m_injectedScriptHost->clearAllWrappers(); - m_idToInjectedScript.clear(); - m_scriptStateToId.clear(); -} - -void InjectedScriptManager::releaseObjectGroup(const String& objectGroup) -{ - for (auto it = m_idToInjectedScript.begin(); it != m_idToInjectedScript.end(); ++it) - it->value.releaseObjectGroup(objectGroup); -} - -String InjectedScriptManager::injectedScriptSource() -{ - return String(reinterpret_cast(InjectedScriptSource_js), sizeof(InjectedScriptSource_js)); -} - -Deprecated::ScriptObject InjectedScriptManager::createInjectedScript(const String& source, ExecState* scriptState, int id) -{ - JSLockHolder lock(scriptState); - - SourceCode sourceCode = makeSource(source); - JSGlobalObject* globalObject = scriptState->lexicalGlobalObject(); - JSValue globalThisValue = scriptState->globalThisValue(); - - JSValue evaluationException; - InspectorEvaluateHandler evaluateHandler = m_environment.evaluateHandler(); - JSValue functionValue = evaluateHandler(scriptState, sourceCode, globalThisValue, &evaluationException); - if (evaluationException) - return Deprecated::ScriptObject(); - - CallData callData; - CallType callType = getCallData(functionValue, callData); - if (callType == CallTypeNone) - return Deprecated::ScriptObject(); - - MarkedArgumentBuffer args; - args.append(m_injectedScriptHost->jsWrapper(scriptState, globalObject)); - args.append(globalThisValue); - args.append(jsNumber(id)); - - JSValue result = JSC::call(scriptState, functionValue, callType, callData, globalThisValue, args); - if (result.isObject()) - return Deprecated::ScriptObject(scriptState, result.getObject()); - - return Deprecated::ScriptObject(); -} - -InjectedScript InjectedScriptManager::injectedScriptFor(ExecState* inspectedExecState) -{ - auto it = m_scriptStateToId.find(inspectedExecState); - if (it != m_scriptStateToId.end()) { - auto it1 = m_idToInjectedScript.find(it->value); - if (it1 != m_idToInjectedScript.end()) - return it1->value; - } - - if (!m_environment.canAccessInspectedScriptState(inspectedExecState)) - return InjectedScript(); - - int id = injectedScriptIdFor(inspectedExecState); - Deprecated::ScriptObject injectedScriptObject = createInjectedScript(injectedScriptSource(), inspectedExecState, id); - InjectedScript result(injectedScriptObject, &m_environment); - m_idToInjectedScript.set(id, result); - didCreateInjectedScript(result); - return result; -} - -void InjectedScriptManager::didCreateInjectedScript(InjectedScript) -{ - // Intentionally empty. This allows for subclasses to inject additional scripts. -} - -} // namespace Inspector - -#endif // ENABLE(INSPECTOR) diff --git a/JavaScriptCore/inspector/InjectedScriptManager.h b/JavaScriptCore/inspector/InjectedScriptManager.h deleted file mode 100644 index bcc64e2a..00000000 --- a/JavaScriptCore/inspector/InjectedScriptManager.h +++ /dev/null @@ -1,85 +0,0 @@ -/* - * Copyright (C) 2007, 2013 Apple Inc. All rights reserved. - * Copyright (C) 2012 Google 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. - * 3. Neither the name of Apple Computer, Inc. ("Apple") nor the names of - * its contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY APPLE 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 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. - */ - -#ifndef InjectedScriptManager_h -#define InjectedScriptManager_h - -#include "InjectedScript.h" -#include "InjectedScriptHost.h" -#include "InspectorEnvironment.h" -#include -#include -#include - -namespace Deprecated { -class ScriptObject; -} - -namespace JSC { -class ExecState; -} - -namespace Inspector { - -class JS_EXPORT_PRIVATE InjectedScriptManager { - WTF_MAKE_NONCOPYABLE(InjectedScriptManager); WTF_MAKE_FAST_ALLOCATED; -public: - InjectedScriptManager(InspectorEnvironment&, PassRefPtr); - virtual ~InjectedScriptManager(); - - virtual void disconnect(); - - InjectedScriptHost* injectedScriptHost(); - InspectorEnvironment& inspectorEnvironment() const { return m_environment; } - - InjectedScript injectedScriptFor(JSC::ExecState*); - InjectedScript injectedScriptForId(int); - int injectedScriptIdFor(JSC::ExecState*); - InjectedScript injectedScriptForObjectId(const String& objectId); - void discardInjectedScripts(); - void releaseObjectGroup(const String& objectGroup); - -protected: - virtual void didCreateInjectedScript(InjectedScript); - - HashMap m_idToInjectedScript; - HashMap m_scriptStateToId; - -private: - String injectedScriptSource(); - Deprecated::ScriptObject createInjectedScript(const String& source, JSC::ExecState*, int id); - - InspectorEnvironment& m_environment; - RefPtr m_injectedScriptHost; - int m_nextInjectedScriptId; -}; - -} // namespace Inspector - -#endif // !defined(InjectedScriptManager_h) diff --git a/JavaScriptCore/inspector/InjectedScriptModule.cpp b/JavaScriptCore/inspector/InjectedScriptModule.cpp deleted file mode 100644 index f2b29d25..00000000 --- a/JavaScriptCore/inspector/InjectedScriptModule.cpp +++ /dev/null @@ -1,91 +0,0 @@ -/* - * Copyright (C) 2013 Apple Inc. All rights reserved. - * Copyright (C) 2012 Google 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: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * 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. - * * Neither the name of Google Inc. nor the names of its - * contributors may be used to endorse or promote products derived from - * this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND 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 THE COPYRIGHT - * OWNER 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 "InjectedScriptModule.h" - -#if ENABLE(INSPECTOR) - -#include "InjectedScript.h" -#include "InjectedScriptManager.h" -#include "ScriptFunctionCall.h" -#include "ScriptObject.h" - -namespace Inspector { - -InjectedScriptModule::InjectedScriptModule(const String& name) - : InjectedScriptBase(name) -{ -} - -InjectedScriptModule::~InjectedScriptModule() -{ -} - -void InjectedScriptModule::ensureInjected(InjectedScriptManager* injectedScriptManager, JSC::ExecState* scriptState) -{ - InjectedScript injectedScript = injectedScriptManager->injectedScriptFor(scriptState); - ensureInjected(injectedScriptManager, injectedScript); -} - -void InjectedScriptModule::ensureInjected(InjectedScriptManager* injectedScriptManager, InjectedScript injectedScript) -{ - ASSERT(!injectedScript.hasNoValue()); - if (injectedScript.hasNoValue()) - return; - - // FIXME: Make the InjectedScript a module itself. - Deprecated::ScriptFunctionCall function(injectedScript.injectedScriptObject(), ASCIILiteral("module"), injectedScriptManager->inspectorEnvironment().functionCallHandler()); - function.appendArgument(name()); - bool hadException = false; - Deprecated::ScriptValue resultValue = injectedScript.callFunctionWithEvalEnabled(function, hadException); - ASSERT(!hadException); - if (hadException || resultValue.hasNoValue() || !resultValue.isObject()) { - Deprecated::ScriptFunctionCall function(injectedScript.injectedScriptObject(), ASCIILiteral("injectModule"), injectedScriptManager->inspectorEnvironment().functionCallHandler()); - function.appendArgument(name()); - function.appendArgument(source()); - function.appendArgument(host(injectedScriptManager, injectedScript.scriptState())); - resultValue = injectedScript.callFunctionWithEvalEnabled(function, hadException); - if (hadException || (returnsObject() && (resultValue.hasNoValue() || !resultValue.isObject()))) { - ASSERT_NOT_REACHED(); - return; - } - } - - if (returnsObject()) { - Deprecated::ScriptObject moduleObject(injectedScript.scriptState(), resultValue); - initialize(moduleObject, &injectedScriptManager->inspectorEnvironment()); - } -} - -} // namespace Inspector - -#endif // ENABLE(INSPECTOR) diff --git a/JavaScriptCore/inspector/InjectedScriptModule.h b/JavaScriptCore/inspector/InjectedScriptModule.h deleted file mode 100644 index a170e798..00000000 --- a/JavaScriptCore/inspector/InjectedScriptModule.h +++ /dev/null @@ -1,69 +0,0 @@ -/* - * Copyright (C) 2013 Apple Inc. All rights reserved. - * Copyright (C) 2012 Google 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: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * 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. - * * Neither the name of Google Inc. nor the names of its - * contributors may be used to endorse or promote products derived from - * this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND 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 THE COPYRIGHT - * OWNER 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. - */ - -#ifndef InjectedScriptModule_h -#define InjectedScriptModule_h - -#include "InjectedScriptBase.h" -#include - -#if ENABLE(INSPECTOR) - -namespace JSC { -class JSValue; -} - -namespace Inspector { - -class InjectedScript; -class InjectedScriptManager; - -class JS_EXPORT_PRIVATE InjectedScriptModule : public InjectedScriptBase { -public: - virtual ~InjectedScriptModule(); - virtual String source() const = 0; - virtual JSC::JSValue host(InjectedScriptManager*, JSC::ExecState*) const = 0; - virtual bool returnsObject() const = 0; - -protected: - // Do not expose constructor in the child classes as well. Instead provide - // a static factory method that would create a new instance of the class - // and call its ensureInjected() method immediately. - InjectedScriptModule(const String& name); - void ensureInjected(InjectedScriptManager*, JSC::ExecState*); - void ensureInjected(InjectedScriptManager*, InjectedScript); -}; - -} // namespace Inspector - -#endif // ENABLE(INSPECTOR) - -#endif // InjectedScriptModule_h diff --git a/JavaScriptCore/inspector/InjectedScriptSource.js b/JavaScriptCore/inspector/InjectedScriptSource.js deleted file mode 100644 index 7bff7f6d..00000000 --- a/JavaScriptCore/inspector/InjectedScriptSource.js +++ /dev/null @@ -1,1033 +0,0 @@ -/* - * Copyright (C) 2007 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. - * 3. Neither the name of Apple Computer, Inc. ("Apple") nor the names of - * its contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY APPLE 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 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. - */ - -//# sourceURL=__WebInspectorInjectedScript__ - -/** - * @param {InjectedScriptHost} InjectedScriptHost - * @param {GlobalObject} inspectedGlobalObject - * @param {number} injectedScriptId - */ -(function (InjectedScriptHost, inspectedGlobalObject, injectedScriptId) { - -// Protect against Object overwritten by the user code. -var Object = {}.constructor; - -/** - * @constructor - */ -var InjectedScript = function() -{ - this._lastBoundObjectId = 1; - this._idToWrappedObject = {}; - this._idToObjectGroupName = {}; - this._objectGroups = {}; - this._modules = {}; -} - -/** - * @type {Object.} - * @const - */ -InjectedScript.primitiveTypes = { - undefined: true, - boolean: true, - number: true, - string: true -} - -InjectedScript.prototype = { - /** - * @param {*} object - * @return {boolean} - */ - isPrimitiveValue: function(object) - { - // FIXME(33716): typeof document.all is always 'undefined'. - return InjectedScript.primitiveTypes[typeof object] && !this._isHTMLAllCollection(object); - }, - - /** - * @param {*} object - * @param {string} groupName - * @param {boolean} canAccessInspectedGlobalObject - * @param {boolean} generatePreview - * @return {!RuntimeAgent.RemoteObject} - */ - wrapObject: function(object, groupName, canAccessInspectedGlobalObject, generatePreview) - { - if (canAccessInspectedGlobalObject) - return this._wrapObject(object, groupName, false, generatePreview); - return this._fallbackWrapper(object); - }, - - /** - * @param {*} object - * @return {!RuntimeAgent.RemoteObject} - */ - _fallbackWrapper: function(object) - { - var result = {}; - result.type = typeof object; - if (this.isPrimitiveValue(object)) - result.value = object; - else - result.description = this._toString(object); - return /** @type {!RuntimeAgent.RemoteObject} */ (result); - }, - - /** - * @param {boolean} canAccessInspectedGlobalObject - * @param {Object} table - * @param {Array.|string|boolean} columns - * @return {!RuntimeAgent.RemoteObject} - */ - wrapTable: function(canAccessInspectedGlobalObject, table, columns) - { - if (!canAccessInspectedGlobalObject) - return this._fallbackWrapper(table); - var columnNames = null; - if (typeof columns === "string") - columns = [columns]; - if (InjectedScriptHost.type(columns) == "array") { - columnNames = []; - for (var i = 0; i < columns.length; ++i) - columnNames.push(String(columns[i])); - } - return this._wrapObject(table, "console", false, true, columnNames); - }, - - /** - * @param {*} object - */ - inspectObject: function(object) - { - if (this._commandLineAPIImpl) - this._commandLineAPIImpl.inspect(object); - }, - - /** - * This method cannot throw. - * @param {*} object - * @param {string=} objectGroupName - * @param {boolean=} forceValueType - * @param {boolean=} generatePreview - * @param {?Array.=} columnNames - * @return {!RuntimeAgent.RemoteObject} - * @suppress {checkTypes} - */ - _wrapObject: function(object, objectGroupName, forceValueType, generatePreview, columnNames) - { - try { - return new InjectedScript.RemoteObject(object, objectGroupName, forceValueType, generatePreview, columnNames); - } catch (e) { - try { - var description = injectedScript._describe(e); - } catch (ex) { - var description = ""; - } - return new InjectedScript.RemoteObject(description); - } - }, - - /** - * @param {*} object - * @param {string=} objectGroupName - * @return {string} - */ - _bind: function(object, objectGroupName) - { - var id = this._lastBoundObjectId++; - this._idToWrappedObject[id] = object; - var objectId = "{\"injectedScriptId\":" + injectedScriptId + ",\"id\":" + id + "}"; - if (objectGroupName) { - var group = this._objectGroups[objectGroupName]; - if (!group) { - group = []; - this._objectGroups[objectGroupName] = group; - } - group.push(id); - this._idToObjectGroupName[id] = objectGroupName; - } - return objectId; - }, - - /** - * @param {string} objectId - * @return {Object} - */ - _parseObjectId: function(objectId) - { - return InjectedScriptHost.evaluate("(" + objectId + ")"); - }, - - /** - * @param {string} objectGroupName - */ - releaseObjectGroup: function(objectGroupName) - { - var group = this._objectGroups[objectGroupName]; - if (!group) - return; - for (var i = 0; i < group.length; i++) - this._releaseObject(group[i]); - delete this._objectGroups[objectGroupName]; - }, - - /** - * @param {string} methodName - * @param {string} args - * @return {*} - */ - dispatch: function(methodName, args) - { - var argsArray = InjectedScriptHost.evaluate("(" + args + ")"); - var result = this[methodName].apply(this, argsArray); - if (typeof result === "undefined") { - // FIXME: JS Context inspection currently does not have a global.console object. - if (inspectedGlobalObject.console) - inspectedGlobalObject.console.error("Web Inspector error: InjectedScript.%s returns undefined", methodName); - result = null; - } - return result; - }, - - /** - * @param {string} objectId - * @param {boolean} ownProperties - * @return {Array.|boolean} - */ - getProperties: function(objectId, ownProperties) - { - var parsedObjectId = this._parseObjectId(objectId); - var object = this._objectForId(parsedObjectId); - var objectGroupName = this._idToObjectGroupName[parsedObjectId.id]; - - if (!this._isDefined(object)) - return false; - var descriptors = this._propertyDescriptors(object, ownProperties); - - // Go over properties, wrap object values. - for (var i = 0; i < descriptors.length; ++i) { - var descriptor = descriptors[i]; - if ("get" in descriptor) - descriptor.get = this._wrapObject(descriptor.get, objectGroupName); - if ("set" in descriptor) - descriptor.set = this._wrapObject(descriptor.set, objectGroupName); - if ("value" in descriptor) - descriptor.value = this._wrapObject(descriptor.value, objectGroupName); - if (!("configurable" in descriptor)) - descriptor.configurable = false; - if (!("enumerable" in descriptor)) - descriptor.enumerable = false; - } - return descriptors; - }, - - /** - * @param {string} objectId - * @return {Array.|boolean} - */ - getInternalProperties: function(objectId, ownProperties) - { - var parsedObjectId = this._parseObjectId(objectId); - var object = this._objectForId(parsedObjectId); - var objectGroupName = this._idToObjectGroupName[parsedObjectId.id]; - if (!this._isDefined(object)) - return false; - var descriptors = []; - var internalProperties = InjectedScriptHost.getInternalProperties(object); - if (internalProperties) { - for (var i = 0; i < internalProperties.length; i++) { - var property = internalProperties[i]; - var descriptor = { - name: property.name, - value: this._wrapObject(property.value, objectGroupName) - }; - descriptors.push(descriptor); - } - } - return descriptors; - }, - - /** - * @param {string} functionId - * @return {!DebuggerAgent.FunctionDetails|string} - */ - getFunctionDetails: function(functionId) - { - var parsedFunctionId = this._parseObjectId(functionId); - var func = this._objectForId(parsedFunctionId); - if (typeof func !== "function") - return "Cannot resolve function by id."; - var details = InjectedScriptHost.functionDetails(func); - if (!details) - return "Cannot resolve function details."; - if ("rawScopes" in details) { - var objectGroupName = this._idToObjectGroupName[parsedFunctionId.id]; - var rawScopes = details.rawScopes; - var scopes = []; - delete details.rawScopes; - for (var i = 0; i < rawScopes.length; i++) - scopes.push(InjectedScript.CallFrameProxy._createScopeJson(rawScopes[i].type, rawScopes[i].object, objectGroupName)); - details.scopeChain = scopes; - } - return details; - }, - - /** - * @param {string} objectId - */ - releaseObject: function(objectId) - { - var parsedObjectId = this._parseObjectId(objectId); - this._releaseObject(parsedObjectId.id); - }, - - /** - * @param {string} id - */ - _releaseObject: function(id) - { - delete this._idToWrappedObject[id]; - delete this._idToObjectGroupName[id]; - }, - - /** - * @param {Object} object - * @param {boolean} ownProperties - * @return {Array.} - */ - _propertyDescriptors: function(object, ownProperties) - { - var descriptors = []; - var nameProcessed = {}; - nameProcessed["__proto__"] = null; - for (var o = object; this._isDefined(o); o = o.__proto__) { - var names = Object.getOwnPropertyNames(/** @type {!Object} */ (o)); - for (var i = 0; i < names.length; ++i) { - var name = names[i]; - if (nameProcessed[name]) - continue; - - try { - nameProcessed[name] = true; - var descriptor = Object.getOwnPropertyDescriptor(/** @type {!Object} */ (object), name); - if (!descriptor) { - // Not all bindings provide proper descriptors. Fall back to the writable, configurable property. - try { - descriptor = { name: name, value: object[name], writable: false, configurable: false, enumerable: false}; - if (o === object) - descriptor.isOwn = true; - descriptors.push(descriptor); - } catch (e) { - // Silent catch. - } - continue; - } - } catch (e) { - var descriptor = {}; - descriptor.value = e; - descriptor.wasThrown = true; - } - - descriptor.name = name; - if (o === object) - descriptor.isOwn = true; - descriptors.push(descriptor); - } - if (ownProperties) { - if (object.__proto__) - descriptors.push({ name: "__proto__", value: object.__proto__, writable: true, configurable: true, enumerable: false, isOwn: true}); - break; - } - } - return descriptors; - }, - - /** - * @param {string} expression - * @param {string} objectGroup - * @param {boolean} injectCommandLineAPI - * @param {boolean} returnByValue - * @param {boolean} generatePreview - * @return {*} - */ - evaluate: function(expression, objectGroup, injectCommandLineAPI, returnByValue, generatePreview) - { - return this._evaluateAndWrap(InjectedScriptHost.evaluate, InjectedScriptHost, expression, objectGroup, false, injectCommandLineAPI, returnByValue, generatePreview); - }, - - /** - * @param {string} objectId - * @param {string} expression - * @param {boolean} returnByValue - * @return {Object|string} - */ - callFunctionOn: function(objectId, expression, args, returnByValue) - { - var parsedObjectId = this._parseObjectId(objectId); - var object = this._objectForId(parsedObjectId); - if (!this._isDefined(object)) - return "Could not find object with given id"; - - if (args) { - var resolvedArgs = []; - args = InjectedScriptHost.evaluate(args); - for (var i = 0; i < args.length; ++i) { - var resolvedCallArgument; - try { - resolvedCallArgument = this._resolveCallArgument(args[i]); - } catch (e) { - return String(e); - } - resolvedArgs.push(resolvedCallArgument) - } - } - - try { - var objectGroup = this._idToObjectGroupName[parsedObjectId.id]; - var func = InjectedScriptHost.evaluate("(" + expression + ")"); - if (typeof func !== "function") - return "Given expression does not evaluate to a function"; - - return { wasThrown: false, - result: this._wrapObject(func.apply(object, resolvedArgs), objectGroup, returnByValue) }; - } catch (e) { - return this._createThrownValue(e, objectGroup); - } - }, - - /** - * Resolves a value from CallArgument description. - * @param {RuntimeAgent.CallArgument} callArgumentJson - * @return {*} resolved value - * @throws {string} error message - */ - _resolveCallArgument: function(callArgumentJson) { - var objectId = callArgumentJson.objectId; - if (objectId) { - var parsedArgId = this._parseObjectId(objectId); - if (!parsedArgId || parsedArgId["injectedScriptId"] !== injectedScriptId) - throw "Arguments should belong to the same JavaScript world as the target object."; - - var resolvedArg = this._objectForId(parsedArgId); - if (!this._isDefined(resolvedArg)) - throw "Could not find object with given id"; - - return resolvedArg; - } else if ("value" in callArgumentJson) - return callArgumentJson.value; - else - return undefined; - }, - - /** - * @param {Function} evalFunction - * @param {Object} object - * @param {string} objectGroup - * @param {boolean} isEvalOnCallFrame - * @param {boolean} injectCommandLineAPI - * @param {boolean} returnByValue - * @param {boolean} generatePreview - * @return {*} - */ - _evaluateAndWrap: function(evalFunction, object, expression, objectGroup, isEvalOnCallFrame, injectCommandLineAPI, returnByValue, generatePreview) - { - try { - return { wasThrown: false, - result: this._wrapObject(this._evaluateOn(evalFunction, object, objectGroup, expression, isEvalOnCallFrame, injectCommandLineAPI), objectGroup, returnByValue, generatePreview) }; - } catch (e) { - return this._createThrownValue(e, objectGroup); - } - }, - - /** - * @param {*} value - * @param {string} objectGroup - * @return {Object} - */ - _createThrownValue: function(value, objectGroup) - { - var remoteObject = this._wrapObject(value, objectGroup); - try { - remoteObject.description = this._toString(value); - } catch (e) {} - return { wasThrown: true, - result: remoteObject }; - }, - - /** - * @param {Function} evalFunction - * @param {Object} object - * @param {string} objectGroup - * @param {string} expression - * @param {boolean} isEvalOnCallFrame - * @param {boolean} injectCommandLineAPI - * @return {*} - */ - _evaluateOn: function(evalFunction, object, objectGroup, expression, isEvalOnCallFrame, injectCommandLineAPI) - { - var commandLineAPI = null; - if (injectCommandLineAPI) { - if (this.CommandLineAPI) - commandLineAPI = new this.CommandLineAPI(this._commandLineAPIImpl, isEvalOnCallFrame ? object : null); - else - commandLineAPI = new BasicCommandLineAPI; - } - - if (isEvalOnCallFrame) { - // We can only use this approach if the evaluate function is the true 'eval'. That allows us to use it with - // the 'eval' identifier when calling it. Using 'eval' grants access to the local scope of the closure we - // create that provides the command line APIs. - - var parameters = [InjectedScriptHost.evaluate, expression]; - var expressionFunctionBody = "" + - "var global = Function('return this')() || (1, eval)('this');" + - "var __originalEval = global.eval; global.eval = __eval;" + - "try { return eval(__currentExpression); }" + - "finally { global.eval = __originalEval; }"; - - if (commandLineAPI) { - // To avoid using a 'with' statement (which fails in strict mode and requires injecting the API object) - // we instead create a closure where we evaluate the expression. The command line APIs are passed as - // parameters to the closure so they are in scope but not injected. This allows the code evaluated in - // the console to stay in strict mode (if is was already set), or to get strict mode by prefixing - // expressions with 'use strict';. - - var parameterNames = Object.getOwnPropertyNames(commandLineAPI); - for (var i = 0; i < parameterNames.length; ++i) - parameters.push(commandLineAPI[parameterNames[i]]); - - var expressionFunctionString = "(function(__eval, __currentExpression, " + parameterNames.join(", ") + ") { " + expressionFunctionBody + " })"; - } else { - // Use a closure in this case too to keep the same behavior of 'var' being captured by the closure instead - // of leaking out into the calling scope. - var expressionFunctionString = "(function(__eval, __currentExpression) { " + expressionFunctionBody + " })"; - } - - // Bind 'this' to the function expression using another closure instead of Function.prototype.bind. This ensures things will work if the page replaces bind. - var boundExpressionFunctionString = "(function(__function, __thisObject) { return function() { return __function.apply(__thisObject, arguments) }; })(" + expressionFunctionString + ", this)"; - var expressionFunction = evalFunction.call(object, boundExpressionFunctionString); - var result = expressionFunction.apply(null, parameters); - - if (objectGroup === "console") - this._lastResult = result; - - return result; - } - - // When not evaluating on a call frame we use a 'with' statement to allow var and function statements to leak - // into the global scope. This allow them to stick around between evaluations. - - // FIXME: JS Context inspection currently does not have a global.console object. - try { - if (commandLineAPI) { - if (inspectedGlobalObject.console) - inspectedGlobalObject.console.__commandLineAPI = commandLineAPI; - else - inspectedGlobalObject.__commandLineAPI = commandLineAPI; - expression = "with ((this && (this.console ? this.console.__commandLineAPI : this.__commandLineAPI)) || {}) { " + expression + "\n}"; - } - - var result = evalFunction.call(inspectedGlobalObject, expression); - - if (objectGroup === "console") - this._lastResult = result; - - return result; - } finally { - if (commandLineAPI) { - if (inspectedGlobalObject.console) - delete inspectedGlobalObject.console.__commandLineAPI; - else - delete inspectedGlobalObject.__commandLineAPI; - } - } - }, - - /** - * @param {Object} callFrame - * @return {Array.|boolean} - */ - wrapCallFrames: function(callFrame) - { - if (!callFrame) - return false; - - var result = []; - var depth = 0; - do { - result.push(new InjectedScript.CallFrameProxy(depth++, callFrame)); - callFrame = callFrame.caller; - } while (callFrame); - return result; - }, - - /** - * @param {Object} topCallFrame - * @param {string} callFrameId - * @param {string} expression - * @param {string} objectGroup - * @param {boolean} injectCommandLineAPI - * @param {boolean} returnByValue - * @param {boolean} generatePreview - * @return {*} - */ - evaluateOnCallFrame: function(topCallFrame, callFrameId, expression, objectGroup, injectCommandLineAPI, returnByValue, generatePreview) - { - var callFrame = this._callFrameForId(topCallFrame, callFrameId); - if (!callFrame) - return "Could not find call frame with given id"; - return this._evaluateAndWrap(callFrame.evaluate, callFrame, expression, objectGroup, true, injectCommandLineAPI, returnByValue, generatePreview); - }, - - /** - * @param {Object} topCallFrame - * @param {string} callFrameId - * @return {Object} - */ - _callFrameForId: function(topCallFrame, callFrameId) - { - var parsedCallFrameId = InjectedScriptHost.evaluate("(" + callFrameId + ")"); - var ordinal = parsedCallFrameId["ordinal"]; - var callFrame = topCallFrame; - while (--ordinal >= 0 && callFrame) - callFrame = callFrame.caller; - return callFrame; - }, - - /** - * @param {Object} objectId - * @return {Object} - */ - _objectForId: function(objectId) - { - return this._idToWrappedObject[objectId.id]; - }, - - /** - * @param {string} objectId - * @return {Object} - */ - findObjectById: function(objectId) - { - var parsedObjectId = this._parseObjectId(objectId); - return this._objectForId(parsedObjectId); - }, - - /** - * @param {string} name - * @return {Object} - */ - module: function(name) - { - return this._modules[name]; - }, - - /** - * @param {string} name - * @param {string} source - * @return {Object} - */ - injectModule: function(name, source, host) - { - delete this._modules[name]; - var moduleFunction = InjectedScriptHost.evaluate("(" + source + ")"); - if (typeof moduleFunction !== "function") { - // FIXME: JS Context inspection currently does not have a global.console object. - if (inspectedGlobalObject.console) - inspectedGlobalObject.console.error("Web Inspector error: A function was expected for module %s evaluation", name); - return null; - } - var module = moduleFunction.call(inspectedGlobalObject, InjectedScriptHost, inspectedGlobalObject, injectedScriptId, this, host); - this._modules[name] = module; - return module; - }, - - /** - * @param {*} object - * @return {boolean} - */ - _isDefined: function(object) - { - return !!object || this._isHTMLAllCollection(object); - }, - - /** - * @param {*} object - * @return {boolean} - */ - _isHTMLAllCollection: function(object) - { - // document.all is reported as undefined, but we still want to process it. - return (typeof object === "undefined") && InjectedScriptHost.isHTMLAllCollection(object); - }, - - /** - * @param {Object=} obj - * @return {string?} - */ - _subtype: function(obj) - { - if (obj === null) - return "null"; - - if (this.isPrimitiveValue(obj)) - return null; - - if (this._isHTMLAllCollection(obj)) - return "array"; - - var preciseType = InjectedScriptHost.type(obj); - if (preciseType) - return preciseType; - - // FireBug's array detection. - try { - if (typeof obj.splice === "function" && isFinite(obj.length)) - return "array"; - if (Object.prototype.toString.call(obj) === "[object Arguments]" && isFinite(obj.length)) // arguments. - return "array"; - } catch (e) { - } - - // If owning frame has navigated to somewhere else window properties will be undefined. - return null; - }, - - /** - * @param {*} obj - * @return {string?} - */ - _describe: function(obj) - { - if (this.isPrimitiveValue(obj)) - return null; - - obj = /** @type {Object} */ (obj); - - // Type is object, get subtype. - var subtype = this._subtype(obj); - - if (subtype === "regexp") - return this._toString(obj); - - if (subtype === "date") - return this._toString(obj); - - if (subtype === "node") { - var description = obj.nodeName.toLowerCase(); - switch (obj.nodeType) { - case 1 /* Node.ELEMENT_NODE */: - description += obj.id ? "#" + obj.id : ""; - var className = obj.className; - description += className ? "." + className : ""; - break; - case 10 /*Node.DOCUMENT_TYPE_NODE */: - description = ""; - break; - } - return description; - } - - var className = InjectedScriptHost.internalConstructorName(obj); - if (subtype === "array") { - if (typeof obj.length === "number") - className += "[" + obj.length + "]"; - return className; - } - - // NodeList in JSC is a function, check for array prior to this. - if (typeof obj === "function") - return this._toString(obj); - - if (className === "Object") { - // In Chromium DOM wrapper prototypes will have Object as their constructor name, - // get the real DOM wrapper name from the constructor property. - var constructorName = obj.constructor && obj.constructor.name; - if (constructorName) - return constructorName; - } - return className; - }, - - /** - * @param {*} obj - * @return {string} - */ - _toString: function(obj) - { - // We don't use String(obj) because inspectedGlobalObject.String is undefined if owning frame navigated to another page. - return "" + obj; - } -} - -/** - * @type {InjectedScript} - * @const - */ -var injectedScript = new InjectedScript(); - -/** - * @constructor - * @param {*} object - * @param {string=} objectGroupName - * @param {boolean=} forceValueType - * @param {boolean=} generatePreview - * @param {?Array.=} columnNames - */ -InjectedScript.RemoteObject = function(object, objectGroupName, forceValueType, generatePreview, columnNames) -{ - this.type = typeof object; - if (injectedScript.isPrimitiveValue(object) || object === null || forceValueType) { - // We don't send undefined values over JSON. - if (typeof object !== "undefined") - this.value = object; - - // Null object is object with 'null' subtype' - if (object === null) - this.subtype = "null"; - - // Provide user-friendly number values. - if (typeof object === "number") - this.description = object + ""; - return; - } - - object = /** @type {Object} */ (object); - - this.objectId = injectedScript._bind(object, objectGroupName); - var subtype = injectedScript._subtype(object); - if (subtype) - this.subtype = subtype; - this.className = InjectedScriptHost.internalConstructorName(object); - this.description = injectedScript._describe(object); - - if (generatePreview && (this.type === "object" || injectedScript._isHTMLAllCollection(object))) - this.preview = this._generatePreview(object, undefined, columnNames); -} - -InjectedScript.RemoteObject.prototype = { - /** - * @param {Object} object - * @param {Array.=} firstLevelKeys - * @param {?Array.=} secondLevelKeys - * @return {Object} preview - */ - _generatePreview: function(object, firstLevelKeys, secondLevelKeys) - { - var preview = {}; - preview.lossless = true; - preview.overflow = false; - preview.properties = []; - - var isTableRowsRequest = secondLevelKeys === null || secondLevelKeys; - var firstLevelKeysCount = firstLevelKeys ? firstLevelKeys.length : 0; - - var propertiesThreshold = { - properties: isTableRowsRequest ? 1000 : Math.max(5, firstLevelKeysCount), - indexes: isTableRowsRequest ? 1000 : Math.max(100, firstLevelKeysCount) - }; - for (var o = object; injectedScript._isDefined(o); o = o.__proto__) - this._generateProtoPreview(o, preview, propertiesThreshold, firstLevelKeys, secondLevelKeys); - return preview; - }, - - /** - * @param {Object} object - * @param {Object} preview - * @param {Object} propertiesThreshold - * @param {Array.=} firstLevelKeys - * @param {Array.=} secondLevelKeys - */ - _generateProtoPreview: function(object, preview, propertiesThreshold, firstLevelKeys, secondLevelKeys) - { - var propertyNames = firstLevelKeys ? firstLevelKeys : Object.keys(/** @type {!Object} */(object)); - try { - for (var i = 0; i < propertyNames.length; ++i) { - if (!propertiesThreshold.properties || !propertiesThreshold.indexes) { - preview.overflow = true; - preview.lossless = false; - break; - } - var name = propertyNames[i]; - if (this.subtype === "array" && name === "length") - continue; - - var descriptor = Object.getOwnPropertyDescriptor(/** @type {!Object} */(object), name); - if (!("value" in descriptor) || !descriptor.enumerable) { - preview.lossless = false; - continue; - } - - var value = descriptor.value; - if (value === null) { - this._appendPropertyPreview(preview, { name: name, type: "object", value: "null" }, propertiesThreshold); - continue; - } - - const maxLength = 100; - var type = typeof value; - - if (InjectedScript.primitiveTypes[type]) { - if (type === "string") { - if (value.length > maxLength) { - value = this._abbreviateString(value, maxLength, true); - preview.lossless = false; - } - value = value.replace(/\n/g, "\u21B5"); - } - this._appendPropertyPreview(preview, { name: name, type: type, value: value + "" }, propertiesThreshold); - continue; - } - - if (secondLevelKeys === null || secondLevelKeys) { - var subPreview = this._generatePreview(value, secondLevelKeys || undefined); - var property = { name: name, type: type, valuePreview: subPreview }; - this._appendPropertyPreview(preview, property, propertiesThreshold); - if (!subPreview.lossless) - preview.lossless = false; - if (subPreview.overflow) - preview.overflow = true; - continue; - } - - preview.lossless = false; - - var subtype = injectedScript._subtype(value); - var description = ""; - if (type !== "function") - description = this._abbreviateString(/** @type {string} */ (injectedScript._describe(value)), maxLength, subtype === "regexp"); - - var property = { name: name, type: type, value: description }; - if (subtype) - property.subtype = subtype; - this._appendPropertyPreview(preview, property, propertiesThreshold); - } - } catch (e) { - } - }, - - /** - * @param {Object} preview - * @param {Object} property - * @param {Object} propertiesThreshold - */ - _appendPropertyPreview: function(preview, property, propertiesThreshold) - { - if (isNaN(property.name)) - propertiesThreshold.properties--; - else - propertiesThreshold.indexes--; - preview.properties.push(property); - }, - - /** - * @param {string} string - * @param {number} maxLength - * @param {boolean=} middle - * @returns - */ - _abbreviateString: function(string, maxLength, middle) - { - if (string.length <= maxLength) - return string; - if (middle) { - var leftHalf = maxLength >> 1; - var rightHalf = maxLength - leftHalf - 1; - return string.substr(0, leftHalf) + "\u2026" + string.substr(string.length - rightHalf, rightHalf); - } - return string.substr(0, maxLength) + "\u2026"; - } -} -/** - * @constructor - * @param {number} ordinal - * @param {Object} callFrame - */ -InjectedScript.CallFrameProxy = function(ordinal, callFrame) -{ - this.callFrameId = "{\"ordinal\":" + ordinal + ",\"injectedScriptId\":" + injectedScriptId + "}"; - this.functionName = (callFrame.type === "function" ? callFrame.functionName : ""); - this.location = { scriptId: String(callFrame.sourceID), lineNumber: callFrame.line, columnNumber: callFrame.column }; - this.scopeChain = this._wrapScopeChain(callFrame); - this.this = injectedScript._wrapObject(callFrame.thisObject, "backtrace"); -} - -InjectedScript.CallFrameProxy.prototype = { - /** - * @param {Object} callFrame - * @return {!Array.} - */ - _wrapScopeChain: function(callFrame) - { - var scopeChain = callFrame.scopeChain; - var scopeChainProxy = []; - for (var i = 0; i < scopeChain.length; i++) { - var scope = InjectedScript.CallFrameProxy._createScopeJson(callFrame.scopeType(i), scopeChain[i], "backtrace"); - scopeChainProxy.push(scope); - } - return scopeChainProxy; - } -} - -/** - * @param {number} scopeTypeCode - * @param {*} scopeObject - * @param {string} groupId - * @return {!DebuggerAgent.Scope} - */ -InjectedScript.CallFrameProxy._createScopeJson = function(scopeTypeCode, scopeObject, groupId) { - const GLOBAL_SCOPE = 0; - const LOCAL_SCOPE = 1; - const WITH_SCOPE = 2; - const CLOSURE_SCOPE = 3; - const CATCH_SCOPE = 4; - - /** @type {!Object.} */ - var scopeTypeNames = {}; - scopeTypeNames[GLOBAL_SCOPE] = "global"; - scopeTypeNames[LOCAL_SCOPE] = "local"; - scopeTypeNames[WITH_SCOPE] = "with"; - scopeTypeNames[CLOSURE_SCOPE] = "closure"; - scopeTypeNames[CATCH_SCOPE] = "catch"; - - return { - object: injectedScript._wrapObject(scopeObject, groupId), - type: /** @type {DebuggerAgent.ScopeType} */ (scopeTypeNames[scopeTypeCode]) - }; -} - -function BasicCommandLineAPI() -{ - this.$_ = injectedScript._lastResult; -} - -return injectedScript; -}) diff --git a/JavaScriptCore/inspector/InspectorAgentRegistry.cpp b/JavaScriptCore/inspector/InspectorAgentRegistry.cpp index 203c8f6e..46e92010 100644 --- a/JavaScriptCore/inspector/InspectorAgentRegistry.cpp +++ b/JavaScriptCore/inspector/InspectorAgentRegistry.cpp @@ -29,17 +29,11 @@ #if ENABLE(INSPECTOR) -#include "InspectorAgentBase.h" - namespace Inspector { -InspectorAgentRegistry::InspectorAgentRegistry() -{ -} - -void InspectorAgentRegistry::append(std::unique_ptr agent) +void InspectorAgentRegistry::append(PassOwnPtr agent) { - m_agents.append(std::move(agent)); + m_agents.append(agent); } void InspectorAgentRegistry::didCreateFrontendAndBackend(InspectorFrontendChannel* frontendChannel, InspectorBackendDispatcher* backendDispatcher) diff --git a/JavaScriptCore/inspector/InspectorAgentRegistry.h b/JavaScriptCore/inspector/InspectorAgentRegistry.h index 7c1095a4..cb65726d 100644 --- a/JavaScriptCore/inspector/InspectorAgentRegistry.h +++ b/JavaScriptCore/inspector/InspectorAgentRegistry.h @@ -27,31 +27,25 @@ #ifndef InspectorAgentRegistry_h #define InspectorAgentRegistry_h +#include "InspectorAgentBase.h" +#include #include namespace Inspector { -class InspectorAgentBase; class InspectorBackendDispatcher; class InspectorFrontendChannel; class JS_EXPORT_PRIVATE InspectorAgentRegistry { public: - InspectorAgentRegistry(); - - void append(std::unique_ptr); + void append(PassOwnPtr); void didCreateFrontendAndBackend(InspectorFrontendChannel*, InspectorBackendDispatcher*); void willDestroyFrontendAndBackend(); void discardAgents(); private: - // These are declared here to avoid MSVC from trying to create default iplementations which would - // involve generating a copy constructor and copy assignment operator for the Vector of std::unique_ptrs. - InspectorAgentRegistry(const InspectorAgentRegistry&) WTF_DELETED_FUNCTION; - InspectorAgentRegistry& operator=(const InspectorAgentRegistry&) WTF_DELETED_FUNCTION; - - Vector> m_agents; + Vector> m_agents; }; } // namespace Inspector diff --git a/JavaScriptCore/inspector/InspectorEnvironment.h b/JavaScriptCore/inspector/InspectorEnvironment.h deleted file mode 100644 index 327a9f89..00000000 --- a/JavaScriptCore/inspector/InspectorEnvironment.h +++ /dev/null @@ -1,53 +0,0 @@ -/* - * Copyright (C) 2013 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. - */ - -#ifndef InspectorEnvironment_h -#define InspectorEnvironment_h - -#include "CallData.h" - -namespace JSC { -class SourceCode; -} - -namespace Inspector { - -typedef JSC::JSValue (*InspectorFunctionCallHandler)(JSC::ExecState* exec, JSC::JSValue functionObject, JSC::CallType callType, const JSC::CallData& callData, JSC::JSValue thisValue, const JSC::ArgList& args); -typedef JSC::JSValue (*InspectorEvaluateHandler)(JSC::ExecState*, const JSC::SourceCode&, JSC::JSValue thisValue, JSC::JSValue* exception); - -class InspectorEnvironment { -public: - virtual ~InspectorEnvironment() { } - virtual bool developerExtrasEnabled() const = 0; - virtual bool canAccessInspectedScriptState(JSC::ExecState*) const = 0; - virtual InspectorFunctionCallHandler functionCallHandler() const = 0; - virtual InspectorEvaluateHandler evaluateHandler() const = 0; - virtual void willCallInjectedScriptFunction(JSC::ExecState*, const String& scriptName, int scriptLine) = 0; - virtual void didCallInjectedScriptFunction() = 0; -}; - -} // namespace Inspector - -#endif // !defined(InspectorEnvironment_h) diff --git a/JavaScriptCore/inspector/InspectorValues.cpp b/JavaScriptCore/inspector/InspectorValues.cpp index 211dacd9..2419deaf 100644 --- a/JavaScriptCore/inspector/InspectorValues.cpp +++ b/JavaScriptCore/inspector/InspectorValues.cpp @@ -545,8 +545,8 @@ PassRefPtr InspectorValue::asArray() PassRefPtr InspectorValue::parseJSON(const String& json) { - const UChar* start = json.deprecatedCharacters(); - const UChar* end = json.deprecatedCharacters() + json.length(); + const UChar* start = json.characters(); + const UChar* end = json.characters() + json.length(); const UChar *tokenEnd; RefPtr value = buildValue(start, end, &tokenEnd, 0); if (!value || tokenEnd != end) diff --git a/JavaScriptCore/inspector/JSGlobalObjectInspectorController.cpp b/JavaScriptCore/inspector/JSGlobalObjectInspectorController.cpp deleted file mode 100644 index 7462aad2..00000000 --- a/JavaScriptCore/inspector/JSGlobalObjectInspectorController.cpp +++ /dev/null @@ -1,103 +0,0 @@ -/* - * Copyright (C) 2014 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 "JSGlobalObjectInspectorController.h" - -#if ENABLE(INSPECTOR) - -#include "Completion.h" -#include "InjectedScriptHost.h" -#include "InjectedScriptManager.h" -#include "InspectorAgent.h" -#include "InspectorBackendDispatcher.h" -#include "InspectorFrontendChannel.h" -#include "JSGlobalObject.h" - -using namespace JSC; - -namespace Inspector { - -JSGlobalObjectInspectorController::JSGlobalObjectInspectorController(JSGlobalObject& globalObject) - : m_globalObject(globalObject) - , m_injectedScriptManager(std::make_unique(*this, InjectedScriptHost::create())) - , m_inspectorFrontendChannel(nullptr) -{ - m_agents.append(std::make_unique()); - - // FIXME: Create RuntimeAgent. - // FIXME: Create DebuggerAgent. - (void)m_globalObject; // Will be used by RuntimeAgent. -} - -JSGlobalObjectInspectorController::~JSGlobalObjectInspectorController() -{ - m_agents.discardAgents(); -} - -void JSGlobalObjectInspectorController::connectFrontend(InspectorFrontendChannel* frontendChannel) -{ - ASSERT(!m_inspectorFrontendChannel); - ASSERT(!m_inspectorBackendDispatcher); - - m_inspectorFrontendChannel = frontendChannel; - m_inspectorBackendDispatcher = InspectorBackendDispatcher::create(frontendChannel); - - m_agents.didCreateFrontendAndBackend(frontendChannel, m_inspectorBackendDispatcher.get()); -} - -void JSGlobalObjectInspectorController::disconnectFrontend() -{ - if (!m_inspectorFrontendChannel) - return; - - m_agents.willDestroyFrontendAndBackend(); - - m_inspectorBackendDispatcher->clearFrontend(); - m_inspectorBackendDispatcher.clear(); - m_inspectorFrontendChannel = nullptr; - - m_injectedScriptManager->disconnect(); -} - -void JSGlobalObjectInspectorController::dispatchMessageFromFrontend(const String& message) -{ - if (m_inspectorBackendDispatcher) - m_inspectorBackendDispatcher->dispatch(message); -} - -InspectorFunctionCallHandler JSGlobalObjectInspectorController::functionCallHandler() const -{ - return JSC::call; -} - -InspectorEvaluateHandler JSGlobalObjectInspectorController::evaluateHandler() const -{ - return JSC::evaluate; -} - -} // namespace Inspector - -#endif // ENABLE(INSPECTOR) diff --git a/JavaScriptCore/inspector/JSGlobalObjectInspectorController.h b/JavaScriptCore/inspector/JSGlobalObjectInspectorController.h deleted file mode 100644 index 23349431..00000000 --- a/JavaScriptCore/inspector/JSGlobalObjectInspectorController.h +++ /dev/null @@ -1,78 +0,0 @@ -/* - * Copyright (C) 2014 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. - */ - -#ifndef JSGlobalObjectInspectorController_h -#define JSGlobalObjectInspectorController_h - -#if ENABLE(INSPECTOR) - -#include "InspectorAgentRegistry.h" -#include "InspectorEnvironment.h" -#include -#include -#include - -namespace JSC { -class ExecState; -class JSGlobalObject; -} - -namespace Inspector { - -class InjectedScriptManager; -class InspectorBackendDispatcher; -class InspectorFrontendChannel; - -class JSGlobalObjectInspectorController FINAL : public InspectorEnvironment { - WTF_MAKE_NONCOPYABLE(JSGlobalObjectInspectorController); - WTF_MAKE_FAST_ALLOCATED; -public: - JSGlobalObjectInspectorController(JSC::JSGlobalObject&); - ~JSGlobalObjectInspectorController(); - - void connectFrontend(InspectorFrontendChannel*); - void disconnectFrontend(); - void dispatchMessageFromFrontend(const String&); - - virtual bool developerExtrasEnabled() const OVERRIDE { return true; } - virtual bool canAccessInspectedScriptState(JSC::ExecState*) const OVERRIDE { return true; } - virtual InspectorFunctionCallHandler functionCallHandler() const OVERRIDE; - virtual InspectorEvaluateHandler evaluateHandler() const OVERRIDE; - virtual void willCallInjectedScriptFunction(JSC::ExecState*, const String&, int) OVERRIDE { } - virtual void didCallInjectedScriptFunction() OVERRIDE { } - -private: - JSC::JSGlobalObject& m_globalObject; - std::unique_ptr m_injectedScriptManager; - InspectorAgentRegistry m_agents; - InspectorFrontendChannel* m_inspectorFrontendChannel; - RefPtr m_inspectorBackendDispatcher; -}; - -} // namespace Inspector - -#endif // ENABLE(INSPECTOR) - -#endif // !defined(JSGlobalObjectInspectorController_h) diff --git a/JavaScriptCore/inspector/JSInjectedScriptHost.cpp b/JavaScriptCore/inspector/JSInjectedScriptHost.cpp deleted file mode 100644 index 3f2f1ed4..00000000 --- a/JavaScriptCore/inspector/JSInjectedScriptHost.cpp +++ /dev/null @@ -1,205 +0,0 @@ -/* - * Copyright (C) 2013 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 "JSInjectedScriptHost.h" - -#if ENABLE(INSPECTOR) - -#include "DateInstance.h" -#include "Error.h" -#include "InjectedScriptHost.h" -#include "JSArray.h" -#include "JSFunction.h" -#include "JSInjectedScriptHostPrototype.h" -#include "JSTypedArrays.h" -#include "ObjectConstructor.h" -#include "Operations.h" -#include "RegExpObject.h" -#include "SourceCode.h" -#include "TypedArrayInlines.h" - -using namespace JSC; - -namespace Inspector { - -const ClassInfo JSInjectedScriptHost::s_info = { "InjectedScriptHost", &Base::s_info, 0, 0, CREATE_METHOD_TABLE(JSInjectedScriptHost) }; - -JSInjectedScriptHost::JSInjectedScriptHost(VM& vm, Structure* structure, PassRefPtr impl) - : JSDestructibleObject(vm, structure) - , m_impl(impl.leakRef()) -{ -} - -void JSInjectedScriptHost::finishCreation(VM& vm) -{ - Base::finishCreation(vm); - ASSERT(inherits(info())); -} - -JSObject* JSInjectedScriptHost::createPrototype(VM& vm, JSGlobalObject* globalObject) -{ - return JSInjectedScriptHostPrototype::create(vm, globalObject, JSInjectedScriptHostPrototype::createStructure(vm, globalObject, globalObject->objectPrototype())); -} - -void JSInjectedScriptHost::destroy(JSC::JSCell* cell) -{ - JSInjectedScriptHost* thisObject = static_cast(cell); - thisObject->JSInjectedScriptHost::~JSInjectedScriptHost(); -} - -void JSInjectedScriptHost::releaseImpl() -{ - if (m_impl) { - m_impl->deref(); - m_impl = nullptr; - } -} - -JSInjectedScriptHost::~JSInjectedScriptHost() -{ - releaseImpl(); -} - -JSValue JSInjectedScriptHost::evaluate(ExecState* exec) const -{ - JSGlobalObject* globalObject = exec->lexicalGlobalObject(); - return globalObject->evalFunction(); -} - -JSValue JSInjectedScriptHost::internalConstructorName(ExecState* exec) -{ - if (exec->argumentCount() < 1) - return jsUndefined(); - - JSObject* thisObject = jsCast(exec->uncheckedArgument(0).toThis(exec, NotStrictMode)); - String result = thisObject->methodTable()->className(thisObject); - return jsString(exec, result); -} - -JSValue JSInjectedScriptHost::isHTMLAllCollection(ExecState* exec) -{ - if (exec->argumentCount() < 1) - return jsUndefined(); - - JSValue value = exec->uncheckedArgument(0); - return jsBoolean(impl().isHTMLAllCollection(value)); -} - -JSValue JSInjectedScriptHost::type(ExecState* exec) -{ - if (exec->argumentCount() < 1) - return jsUndefined(); - - JSValue value = exec->uncheckedArgument(0); - if (value.isString()) - return exec->vm().smallStrings.stringString(); - if (value.isBoolean()) - return exec->vm().smallStrings.booleanString(); - if (value.isNumber()) - return exec->vm().smallStrings.numberString(); - - if (value.inherits(JSArray::info())) - return jsNontrivialString(exec, ASCIILiteral("array")); - if (value.inherits(DateInstance::info())) - return jsNontrivialString(exec, ASCIILiteral("date")); - if (value.inherits(RegExpObject::info())) - return jsNontrivialString(exec, ASCIILiteral("regexp")); - if (value.inherits(JSInt8Array::info()) || value.inherits(JSInt16Array::info()) || value.inherits(JSInt32Array::info())) - return jsNontrivialString(exec, ASCIILiteral("array")); - if (value.inherits(JSUint8Array::info()) || value.inherits(JSUint16Array::info()) || value.inherits(JSUint32Array::info())) - return jsNontrivialString(exec, ASCIILiteral("array")); - if (value.inherits(JSFloat32Array::info()) || value.inherits(JSFloat64Array::info())) - return jsNontrivialString(exec, ASCIILiteral("array")); - - return impl().type(exec, value); -} - -JSValue JSInjectedScriptHost::functionDetails(ExecState* exec) -{ - if (exec->argumentCount() < 1) - return jsUndefined(); - - JSValue value = exec->uncheckedArgument(0); - if (!value.asCell()->inherits(JSFunction::info())) - return jsUndefined(); - - JSFunction* function = jsCast(value); - const SourceCode* sourceCode = function->sourceCode(); - if (!sourceCode) - return jsUndefined(); - - int lineNumber = sourceCode->firstLine(); - if (lineNumber) - lineNumber -= 1; // In the inspector protocol all positions are 0-based while in SourceCode they are 1-based - - String scriptID = String::number(sourceCode->provider()->asID()); - JSObject* location = constructEmptyObject(exec); - location->putDirect(exec->vm(), Identifier(exec, "lineNumber"), jsNumber(lineNumber)); - location->putDirect(exec->vm(), Identifier(exec, "scriptId"), jsString(exec, scriptID)); - - JSObject* result = constructEmptyObject(exec); - result->putDirect(exec->vm(), Identifier(exec, "location"), location); - - String name = function->name(exec); - if (!name.isEmpty()) - result->putDirect(exec->vm(), Identifier(exec, "name"), jsString(exec, name)); - - String displayName = function->displayName(exec); - if (!displayName.isEmpty()) - result->putDirect(exec->vm(), Identifier(exec, "displayName"), jsString(exec, displayName)); - - // FIXME: provide function scope data in "scopesRaw" property when JSC supports it. - // [JSC] expose function (closure) inner context to debugger - - return result; -} - -JSValue JSInjectedScriptHost::getInternalProperties(ExecState*) -{ - // FIXME: [JSC] expose object inner properties to debugger - return jsUndefined(); -} - -JSValue toJS(ExecState* exec, JSGlobalObject* globalObject, InjectedScriptHost* impl) -{ - if (!impl) - return jsNull(); - - JSObject* prototype = JSInjectedScriptHost::createPrototype(exec->vm(), globalObject); - Structure* structure = JSInjectedScriptHost::createStructure(exec->vm(), globalObject, prototype); - JSInjectedScriptHost* injectedScriptHost = JSInjectedScriptHost::create(exec->vm(), structure, impl); - - return injectedScriptHost; -} - -JSInjectedScriptHost* toJSInjectedScriptHost(JSValue value) -{ - return value.inherits(JSInjectedScriptHost::info()) ? jsCast(value) : nullptr; -} - -} // namespace Inspector - -#endif // ENABLE(INSPECTOR) diff --git a/JavaScriptCore/inspector/JSInjectedScriptHost.h b/JavaScriptCore/inspector/JSInjectedScriptHost.h deleted file mode 100644 index 199dfca4..00000000 --- a/JavaScriptCore/inspector/JSInjectedScriptHost.h +++ /dev/null @@ -1,90 +0,0 @@ -/* - * Copyright (C) 2013 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. - */ - -#ifndef JSInjectedScriptHost_h -#define JSInjectedScriptHost_h - -#if ENABLE(INSPECTOR) - -#include "JSDestructibleObject.h" - -namespace Inspector { - -class InjectedScriptHost; - -class JSInjectedScriptHost : public JSC::JSDestructibleObject { -public: - typedef JSC::JSDestructibleObject Base; - - DECLARE_INFO; - - static JSC::Structure* createStructure(JSC::VM& vm, JSC::JSGlobalObject* globalObject, JSC::JSValue prototype) - { - return JSC::Structure::create(vm, globalObject, prototype, JSC::TypeInfo(JSC::ObjectType, StructureFlags), info()); - } - - static JSInjectedScriptHost* create(JSC::VM& vm, JSC::Structure* structure, PassRefPtr impl) - { - JSInjectedScriptHost* instance = new (NotNull, JSC::allocateCell(vm.heap)) JSInjectedScriptHost(vm, structure, impl); - instance->finishCreation(vm); - return instance; - } - - static JSC::JSObject* createPrototype(JSC::VM&, JSC::JSGlobalObject*); - static void destroy(JSC::JSCell*); - - InjectedScriptHost& impl() const { return *m_impl; } - void releaseImpl(); - - // Attributes. - JSC::JSValue evaluate(JSC::ExecState*) const; - - // Functions. - JSC::JSValue internalConstructorName(JSC::ExecState*); - JSC::JSValue isHTMLAllCollection(JSC::ExecState*); - JSC::JSValue type(JSC::ExecState*); - JSC::JSValue functionDetails(JSC::ExecState*); - JSC::JSValue getInternalProperties(JSC::ExecState*); - -protected: - static const unsigned StructureFlags = JSC::OverridesGetOwnPropertySlot | JSC::InterceptsGetOwnPropertySlotByIndexEvenWhenLengthIsNotZero | Base::StructureFlags; - - void finishCreation(JSC::VM&); - -private: - JSInjectedScriptHost(JSC::VM&, JSC::Structure*, PassRefPtr); - ~JSInjectedScriptHost(); - - InjectedScriptHost* m_impl; -}; - -JSC::JSValue toJS(JSC::ExecState*, JSC::JSGlobalObject*, InjectedScriptHost*); -JSInjectedScriptHost* toJSInjectedScriptHost(JSC::JSValue); - -} // namespace Inspector - -#endif // ENABLE(INSPECTOR) - -#endif // !defined(JSInjectedScriptHost_h) diff --git a/JavaScriptCore/inspector/JSInjectedScriptHostPrototype.cpp b/JavaScriptCore/inspector/JSInjectedScriptHostPrototype.cpp deleted file mode 100644 index 12c7a502..00000000 --- a/JavaScriptCore/inspector/JSInjectedScriptHostPrototype.cpp +++ /dev/null @@ -1,140 +0,0 @@ -/* - * Copyright (C) 2013 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 "JSInjectedScriptHostPrototype.h" - -#if ENABLE(INSPECTOR) - -#include "Error.h" -#include "GetterSetter.h" -#include "Identifier.h" -#include "InjectedScriptHost.h" -#include "JSCJSValueInlines.h" -#include "JSFunction.h" -#include "JSInjectedScriptHost.h" - -using namespace JSC; - -namespace Inspector { - -static EncodedJSValue JSC_HOST_CALL jsInjectedScriptHostPrototypeFunctionType(ExecState*); -static EncodedJSValue JSC_HOST_CALL jsInjectedScriptHostPrototypeFunctionFunctionDetails(ExecState*); -static EncodedJSValue JSC_HOST_CALL jsInjectedScriptHostPrototypeFunctionGetInternalProperties(ExecState*); -static EncodedJSValue JSC_HOST_CALL jsInjectedScriptHostPrototypeFunctionInternalConstructorName(ExecState*); -static EncodedJSValue JSC_HOST_CALL jsInjectedScriptHostPrototypeFunctionIsHTMLAllCollection(ExecState*); - -static EncodedJSValue JSC_HOST_CALL jsInjectedScriptHostPrototypeAttributeEvaluate(ExecState*); - -const ClassInfo JSInjectedScriptHostPrototype::s_info = { "InjectedScriptHost", &Base::s_info, 0, 0, CREATE_METHOD_TABLE(JSInjectedScriptHostPrototype) }; - -void JSInjectedScriptHostPrototype::finishCreation(VM& vm, JSGlobalObject* globalObject) -{ - Base::finishCreation(vm); - ASSERT(inherits(info())); - vm.prototypeMap.addPrototype(this); - - JSC_NATIVE_FUNCTION("type", jsInjectedScriptHostPrototypeFunctionType, DontEnum, 1); - JSC_NATIVE_FUNCTION("functionDetails", jsInjectedScriptHostPrototypeFunctionFunctionDetails, DontEnum, 1); - JSC_NATIVE_FUNCTION("getInternalProperties", jsInjectedScriptHostPrototypeFunctionGetInternalProperties, DontEnum, 1); - JSC_NATIVE_FUNCTION("internalConstructorName", jsInjectedScriptHostPrototypeFunctionInternalConstructorName, DontEnum, 1); - JSC_NATIVE_FUNCTION("isHTMLAllCollection", jsInjectedScriptHostPrototypeFunctionIsHTMLAllCollection, DontEnum, 1); - - Identifier evaluateIdentifier(&vm, "evaluate"); - GetterSetter* accessor = GetterSetter::create(vm); - JSFunction* function = JSFunction::create(vm, globalObject, 0, evaluateIdentifier.string(), jsInjectedScriptHostPrototypeAttributeEvaluate); - accessor->setGetter(vm, function); - putDirectNonIndexAccessor(vm, evaluateIdentifier, accessor, DontEnum | Accessor); -} - -EncodedJSValue JSC_HOST_CALL jsInjectedScriptHostPrototypeAttributeEvaluate(ExecState* exec) -{ - JSValue thisValue = exec->hostThisValue(); - JSInjectedScriptHost* castedThis = jsDynamicCast(thisValue); - if (!castedThis) - return throwVMTypeError(exec); - - ASSERT_GC_OBJECT_INHERITS(castedThis, JSInjectedScriptHost::info()); - return JSValue::encode(castedThis->evaluate(exec)); -} - -EncodedJSValue JSC_HOST_CALL jsInjectedScriptHostPrototypeFunctionInternalConstructorName(ExecState* exec) -{ - JSValue thisValue = exec->hostThisValue(); - JSInjectedScriptHost* castedThis = jsDynamicCast(thisValue); - if (!castedThis) - return throwVMTypeError(exec); - - ASSERT_GC_OBJECT_INHERITS(castedThis, JSInjectedScriptHost::info()); - return JSValue::encode(castedThis->internalConstructorName(exec)); -} - -EncodedJSValue JSC_HOST_CALL jsInjectedScriptHostPrototypeFunctionIsHTMLAllCollection(ExecState* exec) -{ - JSValue thisValue = exec->hostThisValue(); - JSInjectedScriptHost* castedThis = jsDynamicCast(thisValue); - if (!castedThis) - return throwVMTypeError(exec); - - ASSERT_GC_OBJECT_INHERITS(castedThis, JSInjectedScriptHost::info()); - return JSValue::encode(castedThis->isHTMLAllCollection(exec)); -} - -EncodedJSValue JSC_HOST_CALL jsInjectedScriptHostPrototypeFunctionType(ExecState* exec) -{ - JSValue thisValue = exec->hostThisValue(); - JSInjectedScriptHost* castedThis = jsDynamicCast(thisValue); - if (!castedThis) - return throwVMTypeError(exec); - - ASSERT_GC_OBJECT_INHERITS(castedThis, JSInjectedScriptHost::info()); - return JSValue::encode(castedThis->type(exec)); -} - -EncodedJSValue JSC_HOST_CALL jsInjectedScriptHostPrototypeFunctionFunctionDetails(ExecState* exec) -{ - JSValue thisValue = exec->hostThisValue(); - JSInjectedScriptHost* castedThis = jsDynamicCast(thisValue); - if (!castedThis) - return throwVMTypeError(exec); - - ASSERT_GC_OBJECT_INHERITS(castedThis, JSInjectedScriptHost::info()); - return JSValue::encode(castedThis->functionDetails(exec)); -} - -EncodedJSValue JSC_HOST_CALL jsInjectedScriptHostPrototypeFunctionGetInternalProperties(ExecState* exec) -{ - JSValue thisValue = exec->hostThisValue(); - JSInjectedScriptHost* castedThis = jsDynamicCast(thisValue); - if (!castedThis) - return throwVMTypeError(exec); - - ASSERT_GC_OBJECT_INHERITS(castedThis, JSInjectedScriptHost::info()); - return JSValue::encode(castedThis->getInternalProperties(exec)); -} - -} // namespace Inspector - -#endif // ENABLE(INSPECTOR) diff --git a/JavaScriptCore/inspector/JSInjectedScriptHostPrototype.h b/JavaScriptCore/inspector/JSInjectedScriptHostPrototype.h deleted file mode 100644 index 9d0b7b66..00000000 --- a/JavaScriptCore/inspector/JSInjectedScriptHostPrototype.h +++ /dev/null @@ -1,68 +0,0 @@ -/* - * Copyright (C) 2013 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. - */ - -#ifndef JSInjectedScriptHostPrototype_h -#define JSInjectedScriptHostPrototype_h - -#if ENABLE(INSPECTOR) - -#include "JSObject.h" - -namespace Inspector { - -class JSInjectedScriptHostPrototype : public JSC::JSNonFinalObject { -public: - typedef JSC::JSNonFinalObject Base; - - DECLARE_INFO; - - static JSInjectedScriptHostPrototype* create(JSC::VM& vm, JSC::JSGlobalObject* globalObject, JSC::Structure* structure) - { - JSInjectedScriptHostPrototype* ptr = new (NotNull, JSC::allocateCell(vm.heap)) JSInjectedScriptHostPrototype(vm, globalObject, structure); - ptr->finishCreation(vm, globalObject); - return ptr; - } - - static JSC::Structure* createStructure(JSC::VM& vm, JSC::JSGlobalObject* globalObject, JSC::JSValue prototype) - { - return JSC::Structure::create(vm, globalObject, prototype, JSC::TypeInfo(JSC::ObjectType, StructureFlags), info()); - } - -protected: - static const unsigned StructureFlags = JSC::OverridesGetOwnPropertySlot | Base::StructureFlags; - -private: - JSInjectedScriptHostPrototype(JSC::VM& vm, JSC::JSGlobalObject*, JSC::Structure* structure) - : JSC::JSNonFinalObject(vm, structure) - { - } - void finishCreation(JSC::VM&, JSC::JSGlobalObject*); -}; - -} // namespace Inspector - -#endif // ENABLE(INSPECTOR) - -#endif // !defined(JSInjectedScriptHostPrototype_h) diff --git a/JavaScriptCore/inspector/agents/InspectorAgent.cpp b/JavaScriptCore/inspector/agents/InspectorAgent.cpp deleted file mode 100644 index 69ba5eb3..00000000 --- a/JavaScriptCore/inspector/agents/InspectorAgent.cpp +++ /dev/null @@ -1,110 +0,0 @@ -/* - * Copyright (C) 2007, 2008, 2009, 2010 Apple Inc. All rights reserved. - * Copyright (C) 2008 Matt Lilek - * Copyright (C) 2011 Google 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. - * 3. Neither the name of Apple Computer, Inc. ("Apple") nor the names of - * its contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY APPLE 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 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. - */ - -#include "config.h" -#include "InspectorAgent.h" - -#if ENABLE(INSPECTOR) - -#include "InspectorValues.h" -#include "ScriptValue.h" -#include -#include - -namespace Inspector { - -InspectorAgent::InspectorAgent() - : InspectorAgentBase(ASCIILiteral("Inspector")) - , m_enabled(false) -{ -} - -InspectorAgent::~InspectorAgent() -{ -} - -void InspectorAgent::didCreateFrontendAndBackend(InspectorFrontendChannel* frontendChannel, InspectorBackendDispatcher* backendDispatcher) -{ - m_frontendDispatcher = std::make_unique(frontendChannel); - m_backendDispatcher = InspectorInspectorBackendDispatcher::create(backendDispatcher, this); -} - -void InspectorAgent::willDestroyFrontendAndBackend() -{ - m_frontendDispatcher = nullptr; - m_backendDispatcher.clear(); - - m_pendingEvaluateTestCommands.clear(); - - ErrorString error; - disable(&error); -} - -void InspectorAgent::enable(ErrorString*) -{ - m_enabled = true; - - if (m_pendingInspectData.first) - inspect(m_pendingInspectData.first, m_pendingInspectData.second); - - for (Vector>::iterator it = m_pendingEvaluateTestCommands.begin(); m_frontendDispatcher && it != m_pendingEvaluateTestCommands.end(); ++it) - m_frontendDispatcher->evaluateForTestInFrontend(static_cast((*it).first), (*it).second); - m_pendingEvaluateTestCommands.clear(); -} - -void InspectorAgent::disable(ErrorString*) -{ - m_enabled = false; -} - -void InspectorAgent::inspect(PassRefPtr objectToInspect, PassRefPtr hints) -{ - if (m_enabled && m_frontendDispatcher) { - m_frontendDispatcher->inspect(objectToInspect, hints); - m_pendingInspectData.first = nullptr; - m_pendingInspectData.second = nullptr; - return; - } - - m_pendingInspectData.first = objectToInspect; - m_pendingInspectData.second = hints; -} - -void InspectorAgent::evaluateForTestInFrontend(long callId, const String& script) -{ - if (m_enabled && m_frontendDispatcher) - m_frontendDispatcher->evaluateForTestInFrontend(static_cast(callId), script); - else - m_pendingEvaluateTestCommands.append(std::pair(callId, script)); -} - -} // namespace Inspector - -#endif // ENABLE(INSPECTOR) diff --git a/JavaScriptCore/inspector/agents/InspectorAgent.h b/JavaScriptCore/inspector/agents/InspectorAgent.h deleted file mode 100644 index fa859cfc..00000000 --- a/JavaScriptCore/inspector/agents/InspectorAgent.h +++ /dev/null @@ -1,72 +0,0 @@ -/* - * Copyright (C) 2007, 2008, 2009, 2010 Apple Inc. All rights reserved. - * Copyright (C) 2011 Google 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. - * 3. Neither the name of Apple Computer, Inc. ("Apple") nor the names of - * its contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY APPLE 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 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. - */ - -#ifndef InspectorAgent_h -#define InspectorAgent_h - -#include "InspectorJSBackendDispatchers.h" -#include "InspectorJSFrontendDispatchers.h" -#include "inspector/InspectorAgentBase.h" -#include -#include -#include - -namespace Inspector { - -class InspectorObject; -class InstrumentingAgents; - -typedef String ErrorString; - -class JS_EXPORT_PRIVATE InspectorAgent FINAL : public InspectorAgentBase, public InspectorInspectorBackendDispatcherHandler { - WTF_MAKE_NONCOPYABLE(InspectorAgent); -public: - InspectorAgent(); - virtual ~InspectorAgent(); - - virtual void didCreateFrontendAndBackend(InspectorFrontendChannel*, InspectorBackendDispatcher*) OVERRIDE; - virtual void willDestroyFrontendAndBackend() OVERRIDE; - - virtual void enable(ErrorString*) OVERRIDE; - virtual void disable(ErrorString*) OVERRIDE; - - void inspect(PassRefPtr objectToInspect, PassRefPtr hints); - void evaluateForTestInFrontend(long testCallId, const String& script); - -private: - std::unique_ptr m_frontendDispatcher; - RefPtr m_backendDispatcher; - Vector> m_pendingEvaluateTestCommands; - std::pair, RefPtr> m_pendingInspectData; - bool m_enabled; -}; - -} // namespace Inspector - -#endif // !defined(InspectorAgent_h) diff --git a/JavaScriptCore/inspector/protocol/Debugger.json b/JavaScriptCore/inspector/protocol/Debugger.json index f1d957b7..5005cdf9 100644 --- a/JavaScriptCore/inspector/protocol/Debugger.json +++ b/JavaScriptCore/inspector/protocol/Debugger.json @@ -81,6 +81,20 @@ } ], "commands": [ + { + "name": "causesRecompilation", + "returns": [ + { "name": "result", "type": "boolean", "description": "True if enabling debugger causes scripts recompilation." } + ], + "description": "Tells whether enabling debugger causes scripts recompilation." + }, + { + "name": "supportsSeparateScriptCompilationAndExecution", + "returns": [ + { "name": "result", "type": "boolean", "description": "True if debugger supports separate script compilation and execution." } + ], + "description": "Tells whether debugger supports separate script compilation and execution." + }, { "name": "enable", "description": "Enables debugger for the given page. Clients should not assume that the debugging has been enabled until the result for this command is received." @@ -170,6 +184,26 @@ ], "description": "Searches for given string in script content." }, + { + "name": "canSetScriptSource", + "returns": [ + { "name": "result", "type": "boolean", "description": "True if setScriptSource is supported." } + ], + "description": "Tells whether setScriptSource is supported." + }, + { + "name": "setScriptSource", + "parameters": [ + { "name": "scriptId", "$ref": "ScriptId", "description": "Id of the script to edit." }, + { "name": "scriptSource", "type": "string", "description": "New content of the script." }, + { "name": "preview", "type": "boolean", "optional": true, "description": " If true the change will not actually be applied. Preview mode may be used to get result description without actually modifying the code." } + ], + "returns": [ + { "name": "callFrames", "type": "array", "optional": true, "items": { "$ref": "CallFrame"}, "description": "New stack trace in case editing has happened while VM was stopped." }, + { "name": "result", "type": "object", "optional": true, "description": "VM-specific description of the changes applied." } + ], + "description": "Edits JavaScript source live." + }, { "name": "getScriptSource", "parameters": [ @@ -214,6 +248,32 @@ ], "description": "Evaluates expression on a given call frame." }, + { + "name": "compileScript", + "parameters": [ + { "name": "expression", "type": "string", "description": "Expression to compile." }, + { "name": "sourceURL", "type": "string", "description": "Source url to be set for the script." } + ], + "returns": [ + { "name": "scriptId", "$ref": "ScriptId", "optional": true, "description": "Id of the script." }, + { "name": "syntaxErrorMessage", "type": "string", "optional": true, "description": "Syntax error message if compilation failed." } + ], + "description": "Compiles expression." + }, + { + "name": "runScript", + "parameters": [ + { "name": "scriptId", "$ref": "ScriptId", "description": "Id of the script to run." }, + { "name": "contextId", "$ref": "Runtime.ExecutionContextId", "optional": true, "description": "Specifies in which isolated context to perform script run. Each content script lives in an isolated context and this parameter may be used to specify one of those contexts. If the parameter is omitted or 0 the evaluation will be performed in the context of the inspected page." }, + { "name": "objectGroup", "type": "string", "optional": true, "description": "Symbolic group name that can be used to release multiple objects." }, + { "name": "doNotPauseOnExceptionsAndMuteConsole", "type": "boolean", "optional": true, "description": "Specifies whether script run should stop on exceptions and mute console. Overrides setPauseOnException state." } + ], + "returns": [ + { "name": "result", "$ref": "Runtime.RemoteObject", "description": "Run result." }, + { "name": "wasThrown", "type": "boolean", "optional": true, "description": "True if the result was thrown during the script run." } + ], + "description": "Runs script with given id in a given context." + }, { "name": "setOverlayMessage", "parameters": [ diff --git a/JavaScriptCore/inspector/remote/RemoteInspector.mm b/JavaScriptCore/inspector/remote/RemoteInspector.mm index d6f0ae30..499bc954 100644 --- a/JavaScriptCore/inspector/remote/RemoteInspector.mm +++ b/JavaScriptCore/inspector/remote/RemoteInspector.mm @@ -131,7 +131,8 @@ static void dispatchAsyncOnQueueSafeForAnyDebuggable(void (^block)()) auto result = m_debuggableMap.set(identifier, std::make_pair(debuggable, debuggable->info())); ASSERT_UNUSED(result, !result.isNewEntry); - pushListingSoon(); + if (debuggable->remoteDebuggingAllowed()) + pushListingSoon(); } void RemoteInspector::sendMessageToRemoteFrontend(unsigned identifier, const String& message) @@ -297,11 +298,6 @@ static void dispatchAsyncOnQueueSafeForAnyDebuggable(void (^block)()) if (debuggableInfo.hasLocalDebugger) [debuggableDetails setObject:@YES forKey:WIRHasLocalDebuggerKey]; - if (debuggableInfo.hasParentProcess()) { - NSString *parentApplicationIdentifier = [NSString stringWithFormat:@"PID:%lu", (unsigned long)debuggableInfo.parentProcessIdentifier]; - [debuggableDetails setObject:parentApplicationIdentifier forKey:WIRHostApplicationIdentifierKey]; - } - return debuggableDetails; } diff --git a/JavaScriptCore/inspector/remote/RemoteInspectorConstants.h b/JavaScriptCore/inspector/remote/RemoteInspectorConstants.h index 4f4bc32d..c8e0d902 100644 --- a/JavaScriptCore/inspector/remote/RemoteInspectorConstants.h +++ b/JavaScriptCore/inspector/remote/RemoteInspectorConstants.h @@ -40,7 +40,6 @@ #define WIRApplicationIdentifierKey @"WIRApplicationIdentifierKey" -#define WIRApplicationBundleIdentifierKey @"WIRApplicationBundleIdentifierKey" #define WIRApplicationNameKey @"WIRApplicationNameKey" #define WIRIsApplicationProxyKey @"WIRIsApplicationProxyKey" #define WIRHostApplicationIdentifierKey @"WIRHostApplicationIdentifierKey" diff --git a/JavaScriptCore/inspector/remote/RemoteInspectorDebuggable.cpp b/JavaScriptCore/inspector/remote/RemoteInspectorDebuggable.cpp index 1530b849..fdf1d96e 100644 --- a/JavaScriptCore/inspector/remote/RemoteInspectorDebuggable.cpp +++ b/JavaScriptCore/inspector/remote/RemoteInspectorDebuggable.cpp @@ -73,7 +73,6 @@ RemoteInspectorDebuggableInfo RemoteInspectorDebuggable::info() const info.url = url(); info.hasLocalDebugger = hasLocalDebugger(); info.remoteDebuggingAllowed = remoteDebuggingAllowed(); - info.parentProcessIdentifier = parentProcessIdentifier(); return info; } diff --git a/JavaScriptCore/inspector/remote/RemoteInspectorDebuggable.h b/JavaScriptCore/inspector/remote/RemoteInspectorDebuggable.h index ec4de51f..90274adc 100644 --- a/JavaScriptCore/inspector/remote/RemoteInspectorDebuggable.h +++ b/JavaScriptCore/inspector/remote/RemoteInspectorDebuggable.h @@ -56,7 +56,6 @@ class JS_EXPORT_PRIVATE RemoteInspectorDebuggable { virtual String name() const { return String(); } // JavaScript and Web virtual String url() const { return String(); } // Web virtual bool hasLocalDebugger() const = 0; - virtual pid_t parentProcessIdentifier() const { return 0; } virtual void connect(InspectorFrontendChannel*) = 0; virtual void disconnect() = 0; @@ -74,19 +73,15 @@ struct RemoteInspectorDebuggableInfo { , type(RemoteInspectorDebuggable::JavaScript) , hasLocalDebugger(false) , remoteDebuggingAllowed(false) - , parentProcessIdentifier(0) { } - bool hasParentProcess() const { return !!parentProcessIdentifier; } - unsigned identifier; RemoteInspectorDebuggable::DebuggableType type; String name; String url; bool hasLocalDebugger; bool remoteDebuggingAllowed; - pid_t parentProcessIdentifier; }; } // namespace Inspector diff --git a/JavaScriptCore/inspector/scripts/CodeGeneratorInspector.py b/JavaScriptCore/inspector/scripts/CodeGeneratorInspector.py index 07e67423..fbbfff2b 100755 --- a/JavaScriptCore/inspector/scripts/CodeGeneratorInspector.py +++ b/JavaScriptCore/inspector/scripts/CodeGeneratorInspector.py @@ -1112,106 +1112,6 @@ def get_array_item_c_type_text(cls): return TypedefString - elif json_typable["type"] == "integer": - if helper.is_ad_hoc: - - class PlainInteger: - @classmethod - def resolve_inner(cls, resolve_context): - pass - - @staticmethod - def request_user_runtime_cast(request): - raise Exception("Unsupported") - - @staticmethod - def request_internal_runtime_cast(): - pass - - @staticmethod - def get_code_generator(): - return None - - @classmethod - def get_validator_call_text(cls): - return RawTypes.Int.get_raw_validator_call_text() - - @staticmethod - def reduce_to_raw_type(): - return RawTypes.Int - - @staticmethod - def get_type_model(): - return TypeModel.Int - - @staticmethod - def get_setter_value_expression_pattern(): - return None - - @classmethod - def get_array_item_c_type_text(cls): - return cls.reduce_to_raw_type().get_array_item_raw_c_type_text() - - return PlainInteger - - else: - - class TypedefInteger: - @classmethod - def resolve_inner(cls, resolve_context): - pass - - @staticmethod - def request_user_runtime_cast(request): - raise Exception("Unsupported") - - @staticmethod - def request_internal_runtime_cast(): - RawTypes.Int.request_raw_internal_runtime_cast() - - @staticmethod - def get_code_generator(): - class CodeGenerator: - @staticmethod - def generate_type_builder(writer, generate_context): - helper.write_doc(writer) - fixed_type_name.output_comment(writer) - writer.newline("typedef int ") - writer.append(fixed_type_name.class_name) - writer.append(";\n\n") - - @staticmethod - def register_use(forward_listener): - pass - - @staticmethod - def get_generate_pass_id(): - return TypeBuilderPass.TYPEDEF - - return CodeGenerator - - @classmethod - def get_validator_call_text(cls): - return RawTypes.Int.get_raw_validator_call_text() - - @staticmethod - def reduce_to_raw_type(): - return RawTypes.Int - - @staticmethod - def get_type_model(): - return TypeModel.Int - - @staticmethod - def get_setter_value_expression_pattern(): - return None - - @classmethod - def get_array_item_c_type_text(cls): - return helper.full_name_prefix_for_use + fixed_type_name.class_name - - return TypedefInteger - elif json_typable["type"] == "object": if "properties" in json_typable: @@ -1976,7 +1876,6 @@ class Generator: backend_js_domain_initializer_list = [] backend_handler_interface_list = [] - backend_handler_implementation_list = [] backend_dispatcher_interface_list = [] type_builder_fragments = [] type_builder_forwards = [] @@ -1991,7 +1890,6 @@ def go(): first_cycle_guardable_list_list = [ Generator.backend_method_implementation_list, Generator.backend_handler_interface_list, - Generator.backend_handler_implementation_list, Generator.backend_dispatcher_interface_list] for json_domain in json_api["domains"]: @@ -2063,11 +1961,9 @@ def go(): Generator.process_command(json_command, domain_name, agent_interface_name, dispatcher_name, dispatcher_if_chain, dispatcher_commands_list) Generator.backend_handler_interface_list.append("protected:\n") - Generator.backend_handler_interface_list.append(" virtual ~%s();\n" % agent_interface_name) + Generator.backend_handler_interface_list.append(" virtual ~%s() { }\n" % agent_interface_name) Generator.backend_handler_interface_list.append("};\n\n") - Generator.backend_handler_implementation_list.append("%s::~%s() { }\n" % (agent_interface_name, agent_interface_name)) - Generator.backend_dispatcher_interface_list.append("private:\n") Generator.backend_dispatcher_interface_list.append(" %s(Inspector::InspectorBackendDispatcher*, %s*);\n" % (dispatcher_name, agent_interface_name)) Generator.backend_dispatcher_interface_list.append(" %s* m_agent;\n" % agent_interface_name) @@ -2575,7 +2471,6 @@ def close(self): backend_cpp_file.write(Templates.backend_cpp.substitute(None, outputFileNamePrefix=output_file_name_prefix, - handlerImplementations="".join(flatten_list(Generator.backend_handler_implementation_list)), methods="\n".join(Generator.backend_method_implementation_list))) frontend_h_file.write(Templates.frontend_h.substitute(None, diff --git a/JavaScriptCore/inspector/scripts/CodeGeneratorInspectorStrings.py b/JavaScriptCore/inspector/scripts/CodeGeneratorInspectorStrings.py index 8de2cb0f..b351eba3 100644 --- a/JavaScriptCore/inspector/scripts/CodeGeneratorInspectorStrings.py +++ b/JavaScriptCore/inspector/scripts/CodeGeneratorInspectorStrings.py @@ -179,8 +179,6 @@ namespace Inspector { -${handlerImplementations} - ${methods} } // namespace Inspector diff --git a/JavaScriptCore/inspector/scripts/cssmin.py b/JavaScriptCore/inspector/scripts/cssmin.py deleted file mode 100644 index a0640eb2..00000000 --- a/JavaScriptCore/inspector/scripts/cssmin.py +++ /dev/null @@ -1,44 +0,0 @@ -#!/usr/bin/python - -# Copyright (C) 2013 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. - -import re - -def cssminify(css): - rules = ( - (r"\/\*.*?\*\/", ""), # delete comments - (r"\n", ""), # delete new lines - (r"\s+", " "), # change multiple spaces to one space - (r"\s?([;:{},+>])\s?", r"\1"), # delete space where it is not needed - (r";}", "}") # change ';}' to '}' because the semicolon is not needed - ) - - css = css.replace("\r\n", "\n") - for rule in rules: - css = re.compile(rule[0], re.MULTILINE | re.UNICODE | re.DOTALL).sub(rule[1], css) - return css - -if __name__ == "__main__": - import sys - sys.stdout.write(cssminify(sys.stdin.read())) diff --git a/JavaScriptCore/inspector/scripts/inline-and-minify-stylesheets-and-scripts.py b/JavaScriptCore/inspector/scripts/inline-and-minify-stylesheets-and-scripts.py deleted file mode 100755 index 89200c84..00000000 --- a/JavaScriptCore/inspector/scripts/inline-and-minify-stylesheets-and-scripts.py +++ /dev/null @@ -1,81 +0,0 @@ -#!/usr/bin/env python -# -# Copyright (C) 2013 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. - -# This script inlines and minifies external stylesheets and scripts. -# - => -# - - -import cssmin -import jsmin -import os.path -import re -import sys - - -def main(argv): - - if len(argv) < 2: - print('usage: %s inputFile outputFile' % argv[0]) - return 1 - - inputFileName = argv[1] - outputFileName = argv[2] - importsDir = os.path.dirname(inputFileName) - - inputFile = open(inputFileName, 'r') - inputContent = inputFile.read() - inputFile.close() - - def inline(match, minifier, prefix, postfix): - importFileName = match.group(1) - fullPath = os.path.join(importsDir, importFileName) - if not os.access(fullPath, os.F_OK): - raise Exception('File %s referenced in %s not found' % (importFileName, inputFileName)) - importFile = open(fullPath, 'r') - importContent = minifier(importFile.read()) - importFile.close() - return '%s%s%s' % (prefix, importContent, postfix) - - def inlineStylesheet(match): - return inline(match, cssmin.cssminify, "") - - def inlineScript(match): - return inline(match, jsmin.jsmin, "") - - outputContent = re.sub(r'', inlineStylesheet, inputContent) - outputContent = re.sub(r'', inlineScript, outputContent) - - outputFile = open(outputFileName, 'w') - outputFile.write(outputContent) - outputFile.close() - - # Touch output file directory to make sure that Xcode will copy - # modified resource files. - if sys.platform == 'darwin': - outputDirName = os.path.dirname(outputFileName) - os.utime(outputDirName, None) - -if __name__ == '__main__': - sys.exit(main(sys.argv)) diff --git a/JavaScriptCore/inspector/scripts/jsmin.py b/JavaScriptCore/inspector/scripts/jsmin.py deleted file mode 100644 index 2339f7d8..00000000 --- a/JavaScriptCore/inspector/scripts/jsmin.py +++ /dev/null @@ -1,218 +0,0 @@ -#!/usr/bin/python - -# This code is original from jsmin by Douglas Crockford, it was translated to -# Python by Baruch Even. The original code had the following copyright and -# license. -# -# /* jsmin.c -# 2007-05-22 -# -# Copyright (c) 2002 Douglas Crockford (www.crockford.com) -# -# Permission is hereby granted, free of charge, to any person obtaining a copy of -# this software and associated documentation files (the "Software"), to deal in -# the Software without restriction, including without limitation the rights to -# use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies -# of the Software, and to permit persons to whom the Software is furnished to do -# so, subject to the following conditions: -# -# The above copyright notice and this permission notice shall be included in all -# copies or substantial portions of the Software. -# -# The Software shall be used for Good, not Evil. -# -# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -# SOFTWARE. -# */ - -from StringIO import StringIO - -def jsmin(js): - ins = StringIO(js) - outs = StringIO() - JavascriptMinify().minify(ins, outs) - str = outs.getvalue() - if len(str) > 0 and str[0] == '\n': - str = str[1:] - return str - -def isAlphanum(c): - """return true if the character is a letter, digit, underscore, - dollar sign, or non-ASCII character. - """ - return ((c >= 'a' and c <= 'z') or (c >= '0' and c <= '9') or - (c >= 'A' and c <= 'Z') or c == '_' or c == '$' or c == '\\' or (c is not None and ord(c) > 126)); - -class UnterminatedComment(Exception): - pass - -class UnterminatedStringLiteral(Exception): - pass - -class UnterminatedRegularExpression(Exception): - pass - -class JavascriptMinify(object): - - def _outA(self): - self.outstream.write(self.theA) - def _outB(self): - self.outstream.write(self.theB) - - def _get(self): - """return the next character from stdin. Watch out for lookahead. If - the character is a control character, translate it to a space or - linefeed. - """ - c = self.theLookahead - self.theLookahead = None - if c == None: - c = self.instream.read(1) - if c >= ' ' or c == '\n': - return c - if c == '': # EOF - return '\000' - if c == '\r': - return '\n' - return ' ' - - def _peek(self): - self.theLookahead = self._get() - return self.theLookahead - - def _next(self): - """get the next character, excluding comments. peek() is used to see - if an unescaped '/' is followed by a '/' or '*'. - """ - c = self._get() - if c == '/' and self.theA != '\\': - p = self._peek() - if p == '/': - c = self._get() - while c > '\n': - c = self._get() - return c - if p == '*': - c = self._get() - while 1: - c = self._get() - if c == '*': - if self._peek() == '/': - self._get() - return ' ' - if c == '\000': - raise UnterminatedComment() - - return c - - def _action(self, action): - """do something! What you do is determined by the argument: - 1 Output A. Copy B to A. Get the next B. - 2 Copy B to A. Get the next B. (Delete A). - 3 Get the next B. (Delete B). - action treats a string as a single character. Wow! - action recognizes a regular expression if it is preceded by ( or , or =. - """ - if action <= 1: - self._outA() - - if action <= 2: - self.theA = self.theB - if self.theA == "'" or self.theA == '"': - while 1: - self._outA() - self.theA = self._get() - if self.theA == self.theB: - break - if self.theA <= '\n': - raise UnterminatedStringLiteral() - if self.theA == '\\': - self._outA() - self.theA = self._get() - - - if action <= 3: - self.theB = self._next() - if self.theB == '/' and (self.theA == '(' or self.theA == ',' or - self.theA == '=' or self.theA == ':' or - self.theA == '[' or self.theA == '?' or - self.theA == '!' or self.theA == '&' or - self.theA == '|' or self.theA == ';' or - self.theA == '{' or self.theA == '}' or - self.theA == '\n'): - self._outA() - self._outB() - while 1: - self.theA = self._get() - if self.theA == '/': - break - elif self.theA == '\\': - self._outA() - self.theA = self._get() - elif self.theA <= '\n': - raise UnterminatedRegularExpression() - self._outA() - self.theB = self._next() - - - def _jsmin(self): - """Copy the input to the output, deleting the characters which are - insignificant to JavaScript. Comments will be removed. Tabs will be - replaced with spaces. Carriage returns will be replaced with linefeeds. - Most spaces and linefeeds will be removed. - """ - self.theA = '\n' - self._action(3) - - while self.theA != '\000': - if self.theA == ' ': - if isAlphanum(self.theB): - self._action(1) - else: - self._action(2) - elif self.theA == '\n': - if self.theB in ['{', '[', '(', '+', '-']: - self._action(1) - elif self.theB == ' ': - self._action(3) - else: - if isAlphanum(self.theB): - self._action(1) - else: - self._action(2) - else: - if self.theB == ' ': - if isAlphanum(self.theA): - self._action(1) - else: - self._action(3) - elif self.theB == '\n': - if self.theA in ['}', ']', ')', '+', '-', '"', '\'']: - self._action(1) - else: - if isAlphanum(self.theA): - self._action(1) - else: - self._action(3) - else: - self._action(1) - - def minify(self, instream, outstream): - self.instream = instream - self.outstream = outstream - self.theA = '\n' - self.theB = None - self.theLookahead = None - - self._jsmin() - self.instream.close() - -if __name__ == '__main__': - import sys - jsm = JavascriptMinify() - jsm.minify(sys.stdin, sys.stdout) diff --git a/JavaScriptCore/inspector/scripts/xxd.pl b/JavaScriptCore/inspector/scripts/xxd.pl deleted file mode 100644 index 5ee08a52..00000000 --- a/JavaScriptCore/inspector/scripts/xxd.pl +++ /dev/null @@ -1,45 +0,0 @@ -#! /usr/bin/perl - -# Copyright (C) 2010-2011 Google 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: -# -# # Redistributions of source code must retain the above copyright -# notice, this list of conditions and the following disclaimer. -# # 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. -# # Neither the name of Google Inc. nor the names of its -# contributors may be used to endorse or promote products derived from -# this software without specific prior written permission. -# -# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND 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 THE COPYRIGHT -# OWNER 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. -# - -$varname = shift; -$fname = shift; -$output = shift; - -open($input, '<', $fname) or die "Can't open file for read: $fname $!"; -$/ = undef; -$text = <$input>; -close($input); - -$text = join(', ', map('0x' . unpack("H*", $_), split(undef, $text))); - -open($output, '>', $output) or die "Can't open file for write: $output $!"; -print $output "const unsigned char $varname\[\] = {\n$text\n};\n"; -close($output); diff --git a/JavaScriptCore/jit/ExecutableAllocator.h b/JavaScriptCore/jit/ExecutableAllocator.h index 01be7c1a..1f3ad03a 100644 --- a/JavaScriptCore/jit/ExecutableAllocator.h +++ b/JavaScriptCore/jit/ExecutableAllocator.h @@ -40,7 +40,7 @@ #include #endif -#if OS(IOS) +#if OS(IOS) || OS(QNX) #include #endif diff --git a/JavaScriptCore/jit/GPRInfo.h b/JavaScriptCore/jit/GPRInfo.h index 393a56b5..a952c46c 100644 --- a/JavaScriptCore/jit/GPRInfo.h +++ b/JavaScriptCore/jit/GPRInfo.h @@ -574,6 +574,10 @@ class GPRInfo { static const GPRReg returnValueGPR2 = ARM64Registers::x1; // regT1 static const GPRReg nonPreservedNonReturnGPR = ARM64Registers::x2; +#if ENABLE(VALUE_PROFILER) + static const GPRReg bucketCounterRegister = ARM64Registers::x7; +#endif + // GPRReg mapping is direct, the machine regsiter numbers can // be used directly as indices into the GPR RegisterBank. COMPILE_ASSERT(ARM64Registers::q0 == 0, q0_is_0); diff --git a/JavaScriptCore/jit/JIT.cpp b/JavaScriptCore/jit/JIT.cpp index c3508b01..e01e26b6 100644 --- a/JavaScriptCore/jit/JIT.cpp +++ b/JavaScriptCore/jit/JIT.cpp @@ -81,8 +81,10 @@ JIT::JIT(VM* vm, CodeBlock* codeBlock) , m_byValInstructionIndex(UINT_MAX) , m_callLinkInfoIndex(UINT_MAX) , m_randomGenerator(cryptographicallyRandomNumber()) +#if ENABLE(VALUE_PROFILER) , m_canBeOptimized(false) , m_shouldEmitProfiling(false) +#endif { } @@ -327,6 +329,7 @@ void JIT::privateCompileSlowCases() m_byValInstructionIndex = 0; m_callLinkInfoIndex = 0; +#if ENABLE(VALUE_PROFILER) // Use this to assert that slow-path code associates new profiling sites with existing // ValueProfiles rather than creating new ones. This ensures that for a given instruction // (say, get_by_id) we get combined statistics for both the fast-path executions of that @@ -334,6 +337,7 @@ void JIT::privateCompileSlowCases() // new ValueProfiles then the ValueProfiles would no longer be sorted by bytecode offset, // which would break the invariant necessary to use CodeBlock::valueProfileForBytecodeOffset(). unsigned numberOfValueProfiles = m_codeBlock->numberOfValueProfiles(); +#endif for (Vector::iterator iter = m_slowCases.begin(); iter != m_slowCases.end();) { m_bytecodeOffset = iter->to; @@ -342,9 +346,11 @@ void JIT::privateCompileSlowCases() Instruction* currentInstruction = instructionsBegin + m_bytecodeOffset; +#if ENABLE(VALUE_PROFILER) RareCaseProfile* rareCaseProfile = 0; if (shouldEmitProfiling()) rareCaseProfile = m_codeBlock->addRareCaseProfile(m_bytecodeOffset); +#endif #if ENABLE(JIT_VERBOSE) dataLogF("Old JIT emitting slow code for bc#%u at offset 0x%lx.\n", m_bytecodeOffset, (long)debugOffset()); @@ -425,8 +431,10 @@ void JIT::privateCompileSlowCases() RELEASE_ASSERT_WITH_MESSAGE(iter == m_slowCases.end() || firstTo != iter->to, "Not enough jumps linked in slow case codegen."); RELEASE_ASSERT_WITH_MESSAGE(firstTo == (iter - 1)->to, "Too many jumps linked in slow case codegen."); +#if ENABLE(VALUE_PROFILER) if (shouldEmitProfiling()) add32(TrustedImm32(1), AbsoluteAddress(&rareCaseProfile->m_counter)); +#endif emitJumpSlowToHot(jump(), 0); } @@ -434,7 +442,9 @@ void JIT::privateCompileSlowCases() RELEASE_ASSERT(m_getByIdIndex == m_getByIds.size()); RELEASE_ASSERT(m_putByIdIndex == m_putByIds.size()); RELEASE_ASSERT(m_callLinkInfoIndex == m_callStructureStubCompilationInfo.size()); +#if ENABLE(VALUE_PROFILER) RELEASE_ASSERT(numberOfValueProfiles == m_codeBlock->numberOfValueProfiles()); +#endif #ifndef NDEBUG // Reset this, in order to guard its use with ASSERTs. @@ -444,6 +454,7 @@ void JIT::privateCompileSlowCases() CompilationResult JIT::privateCompile(JITCompilationEffort effort) { +#if ENABLE(VALUE_PROFILER) DFG::CapabilityLevel level = m_codeBlock->capabilityLevel(); switch (level) { case DFG::CannotCompile: @@ -478,6 +489,7 @@ CompilationResult JIT::privateCompile(JITCompilationEffort effort) m_codeBlock->m_shouldAlwaysBeInlined &= canInline(level) && DFG::mightInlineFunction(m_codeBlock); break; } +#endif if (Options::showDisassembly() || m_vm->m_perBytecodeProfiler) m_disassembler = adoptPtr(new JITDisassembler(m_codeBlock)); @@ -509,6 +521,7 @@ CompilationResult JIT::privateCompile(JITCompilationEffort effort) Jump stackCheck; if (m_codeBlock->codeType() == FunctionCode) { +#if ENABLE(VALUE_PROFILER) ASSERT(m_bytecodeOffset == (unsigned)-1); if (shouldEmitProfiling()) { for (int argument = 0; argument < m_codeBlock->numParameters(); ++argument) { @@ -523,9 +536,10 @@ CompilationResult JIT::privateCompile(JITCompilationEffort effort) load32(Address(callFrameRegister, offset + OBJECT_OFFSETOF(JSValue, u.asBits.payload)), regT0); load32(Address(callFrameRegister, offset + OBJECT_OFFSETOF(JSValue, u.asBits.tag)), regT1); #endif - emitValueProfilingSite(m_codeBlock->valueProfileForArgument(argument)); + emitValueProfilingSite(m_codeBlock->valueProfileForArgument(argument), regT4); } } +#endif addPtr(TrustedImm32(virtualRegisterForLocal(frameRegisterCountFor(m_codeBlock)).offset() * sizeof(Register)), callFrameRegister, regT1); stackCheck = branchPtr(Above, AbsoluteAddress(m_vm->addressOfJSStackLimit()), regT1); diff --git a/JavaScriptCore/jit/JIT.h b/JavaScriptCore/jit/JIT.h index 29807570..3cd79bb8 100644 --- a/JavaScriptCore/jit/JIT.h +++ b/JavaScriptCore/jit/JIT.h @@ -331,11 +331,16 @@ namespace JSC { template // StructureType can be RegisterID or ImmPtr. void emitAllocateJSObject(RegisterID allocator, StructureType, RegisterID result, RegisterID scratch); +#if ENABLE(VALUE_PROFILER) // This assumes that the value to profile is in regT0 and that regT3 is available for // scratch. - void emitValueProfilingSite(ValueProfile*); - void emitValueProfilingSite(unsigned bytecodeOffset); - void emitValueProfilingSite(); + void emitValueProfilingSite(ValueProfile*, RegisterID); + void emitValueProfilingSite(unsigned bytecodeOffset, RegisterID); + void emitValueProfilingSite(RegisterID); +#else + void emitValueProfilingSite(unsigned, RegisterID) { } + void emitValueProfilingSite(RegisterID) { } +#endif void emitArrayProfilingSite(RegisterID structureAndIndexingType, RegisterID scratch, ArrayProfile*); void emitArrayProfilingSiteForBytecodeIndex(RegisterID structureAndIndexingType, RegisterID scratch, unsigned bytecodeIndex); void emitArrayProfileStoreToHoleSpecialCase(ArrayProfile*); @@ -822,9 +827,11 @@ namespace JSC { WeakRandom m_randomGenerator; static CodeRef stringGetByValStubGenerator(VM*); +#if ENABLE(VALUE_PROFILER) bool m_canBeOptimized; bool m_canBeOptimizedOrInlined; bool m_shouldEmitProfiling; +#endif } JIT_CLASS_ALIGNMENT; } // namespace JSC diff --git a/JavaScriptCore/jit/JITArithmetic.cpp b/JavaScriptCore/jit/JITArithmetic.cpp index b9c70570..438ee4f9 100644 --- a/JavaScriptCore/jit/JITArithmetic.cpp +++ b/JavaScriptCore/jit/JITArithmetic.cpp @@ -668,13 +668,16 @@ void JIT::compileBinaryArithOp(OpcodeID opcodeID, int, int op1, int op2, Operand emitGetVirtualRegisters(op1, regT0, op2, regT1); emitJumpSlowCaseIfNotImmediateInteger(regT0); emitJumpSlowCaseIfNotImmediateInteger(regT1); +#if ENABLE(VALUE_PROFILER) RareCaseProfile* profile = m_codeBlock->addSpecialFastCaseProfile(m_bytecodeOffset); +#endif if (opcodeID == op_add) addSlowCase(branchAdd32(Overflow, regT1, regT0)); else if (opcodeID == op_sub) addSlowCase(branchSub32(Overflow, regT1, regT0)); else { ASSERT(opcodeID == op_mul); +#if ENABLE(VALUE_PROFILER) if (shouldEmitProfiling()) { // We want to be able to measure if this is taking the slow case just // because of negative zero. If this produces positive zero, then we @@ -698,6 +701,10 @@ void JIT::compileBinaryArithOp(OpcodeID opcodeID, int, int op1, int op2, Operand addSlowCase(branchMul32(Overflow, regT1, regT0)); addSlowCase(branchTest32(Zero, regT0)); } +#else + addSlowCase(branchMul32(Overflow, regT1, regT0)); + addSlowCase(branchTest32(Zero, regT0)); +#endif } emitFastArithIntToImmNoCheck(regT0, regT0); } @@ -842,15 +849,19 @@ void JIT::emit_op_mul(Instruction* currentInstruction) // For now, only plant a fast int case if the constant operand is greater than zero. int32_t value; if (isOperandConstantImmediateInt(op1) && ((value = getConstantOperandImmediateInt(op1)) > 0)) { +#if ENABLE(VALUE_PROFILER) // Add a special fast case profile because the DFG JIT will expect one. m_codeBlock->addSpecialFastCaseProfile(m_bytecodeOffset); +#endif emitGetVirtualRegister(op2, regT0); emitJumpSlowCaseIfNotImmediateInteger(regT0); addSlowCase(branchMul32(Overflow, Imm32(value), regT0, regT1)); emitFastArithReTagImmediate(regT1, regT0); } else if (isOperandConstantImmediateInt(op2) && ((value = getConstantOperandImmediateInt(op2)) > 0)) { +#if ENABLE(VALUE_PROFILER) // Add a special fast case profile because the DFG JIT will expect one. m_codeBlock->addSpecialFastCaseProfile(m_bytecodeOffset); +#endif emitGetVirtualRegister(op1, regT0); emitJumpSlowCaseIfNotImmediateInteger(regT0); addSlowCase(branchMul32(Overflow, Imm32(value), regT0, regT1)); @@ -919,6 +930,7 @@ void JIT::emit_op_div(Instruction* currentInstruction) } divDouble(fpRegT1, fpRegT0); +#if ENABLE(VALUE_PROFILER) // Is the result actually an integer? The DFG JIT would really like to know. If it's // not an integer, we increment a count. If this together with the slow case counter // are below threshold then the DFG JIT will compile this division with a specualtion @@ -945,6 +957,11 @@ void JIT::emit_op_div(Instruction* currentInstruction) move(tagTypeNumberRegister, regT0); trueDouble.link(this); isInteger.link(this); +#else + // Double result. + moveDoubleTo64(fpRegT0, regT0); + sub64(tagTypeNumberRegister, regT0); +#endif emitPutVirtualRegister(dst, regT0); } diff --git a/JavaScriptCore/jit/JITArithmetic32_64.cpp b/JavaScriptCore/jit/JITArithmetic32_64.cpp index 53ac7389..6c62976d 100644 --- a/JavaScriptCore/jit/JITArithmetic32_64.cpp +++ b/JavaScriptCore/jit/JITArithmetic32_64.cpp @@ -742,6 +742,7 @@ void JIT::emitBinaryDoubleOp(OpcodeID opcodeID, int dst, int op1, int op2, Opera emitLoadDouble(op1, fpRegT1); divDouble(fpRegT0, fpRegT1); +#if ENABLE(VALUE_PROFILER) // Is the result actually an integer? The DFG JIT would really like to know. If it's // not an integer, we increment a count. If this together with the slow case counter // are below threshold then the DFG JIT will compile this division with a specualtion @@ -765,6 +766,9 @@ void JIT::emitBinaryDoubleOp(OpcodeID opcodeID, int dst, int op1, int op2, Opera add32(TrustedImm32(1), AbsoluteAddress(&m_codeBlock->specialFastCaseProfileForBytecodeOffset(m_bytecodeOffset)->m_counter)); emitStoreDouble(dst, fpRegT1); isInteger.link(this); +#else + emitStoreDouble(dst, fpRegT1); +#endif break; } case op_jless: @@ -842,6 +846,7 @@ void JIT::emitBinaryDoubleOp(OpcodeID opcodeID, int dst, int op1, int op2, Opera case op_div: { emitLoadDouble(op2, fpRegT2); divDouble(fpRegT2, fpRegT0); +#if ENABLE(VALUE_PROFILER) // Is the result actually an integer? The DFG JIT would really like to know. If it's // not an integer, we increment a count. If this together with the slow case counter // are below threshold then the DFG JIT will compile this division with a specualtion @@ -865,6 +870,9 @@ void JIT::emitBinaryDoubleOp(OpcodeID opcodeID, int dst, int op1, int op2, Opera add32(TrustedImm32(1), AbsoluteAddress(&m_codeBlock->specialFastCaseProfileForBytecodeOffset(m_bytecodeOffset)->m_counter)); emitStoreDouble(dst, fpRegT0); isInteger.link(this); +#else + emitStoreDouble(dst, fpRegT0); +#endif break; } case op_jless: @@ -916,7 +924,9 @@ void JIT::emit_op_mul(Instruction* currentInstruction) int op2 = currentInstruction[3].u.operand; OperandTypes types = OperandTypes::fromInt(currentInstruction[4].u.operand); +#if ENABLE(VALUE_PROFILER) m_codeBlock->addSpecialFastCaseProfile(m_bytecodeOffset); +#endif JumpList notInt32Op1; JumpList notInt32Op2; @@ -959,10 +969,12 @@ void JIT::emitSlow_op_mul(Instruction* currentInstruction, Vector emitJumpSlowToHot(jump(), OPCODE_LENGTH(op_mul)); negZero.link(this); +#if ENABLE(VALUE_PROFILER) // We only get here if we have a genuine negative zero. Record this, // so that the speculative JIT knows that we failed speculation // because of a negative zero. add32(TrustedImm32(1), AbsoluteAddress(&m_codeBlock->specialFastCaseProfileForBytecodeOffset(m_bytecodeOffset)->m_counter)); +#endif overflow.link(this); if (!supportsFloatingPoint()) { @@ -993,7 +1005,9 @@ void JIT::emit_op_div(Instruction* currentInstruction) int op2 = currentInstruction[3].u.operand; OperandTypes types = OperandTypes::fromInt(currentInstruction[4].u.operand); +#if ENABLE(VALUE_PROFILER) m_codeBlock->addSpecialFastCaseProfile(m_bytecodeOffset); +#endif if (!supportsFloatingPoint()) { addSlowCase(jump()); @@ -1014,6 +1028,7 @@ void JIT::emit_op_div(Instruction* currentInstruction) convertInt32ToDouble(regT0, fpRegT0); convertInt32ToDouble(regT2, fpRegT1); divDouble(fpRegT1, fpRegT0); +#if ENABLE(VALUE_PROFILER) // Is the result actually an integer? The DFG JIT would really like to know. If it's // not an integer, we increment a count. If this together with the slow case counter // are below threshold then the DFG JIT will compile this division with a specualtion @@ -1036,6 +1051,9 @@ void JIT::emit_op_div(Instruction* currentInstruction) notInteger.link(this); add32(TrustedImm32(1), AbsoluteAddress(&m_codeBlock->specialFastCaseProfileForBytecodeOffset(m_bytecodeOffset)->m_counter)); emitStoreDouble(dst, fpRegT0); +#else + emitStoreDouble(dst, fpRegT0); +#endif end.append(jump()); // Double divide. diff --git a/JavaScriptCore/jit/JITCall.cpp b/JavaScriptCore/jit/JITCall.cpp index 90c2e4fb..deb23e73 100644 --- a/JavaScriptCore/jit/JITCall.cpp +++ b/JavaScriptCore/jit/JITCall.cpp @@ -48,7 +48,7 @@ namespace JSC { void JIT::emitPutCallResult(Instruction* instruction) { int dst = instruction[1].u.operand; - emitValueProfilingSite(); + emitValueProfilingSite(regT4); emitPutVirtualRegister(dst); } diff --git a/JavaScriptCore/jit/JITCall32_64.cpp b/JavaScriptCore/jit/JITCall32_64.cpp index 6086038a..194cf815 100644 --- a/JavaScriptCore/jit/JITCall32_64.cpp +++ b/JavaScriptCore/jit/JITCall32_64.cpp @@ -47,7 +47,7 @@ namespace JSC { void JIT::emitPutCallResult(Instruction* instruction) { int dst = instruction[1].u.operand; - emitValueProfilingSite(); + emitValueProfilingSite(regT4); emitStore(dst, regT1, regT0); } diff --git a/JavaScriptCore/jit/JITInlines.h b/JavaScriptCore/jit/JITInlines.h index 9330e773..f6a32813 100644 --- a/JavaScriptCore/jit/JITInlines.h +++ b/JavaScriptCore/jit/JITInlines.h @@ -142,7 +142,7 @@ ALWAYS_INLINE MacroAssembler::Call JIT::appendCallWithExceptionCheckSetJSValueRe ALWAYS_INLINE MacroAssembler::Call JIT::appendCallWithExceptionCheckSetJSValueResultWithProfile(const FunctionPtr& function, int dst) { MacroAssembler::Call call = appendCallWithExceptionCheck(function); - emitValueProfilingSite(); + emitValueProfilingSite(regT4); #if USE(JSVALUE64) emitPutVirtualRegister(dst, returnValueGPR); #else @@ -680,7 +680,8 @@ inline void JIT::emitAllocateJSObject(RegisterID allocator, StructureType struct storePtr(TrustedImmPtr(0), Address(result, JSObject::butterflyOffset())); } -inline void JIT::emitValueProfilingSite(ValueProfile* valueProfile) +#if ENABLE(VALUE_PROFILER) +inline void JIT::emitValueProfilingSite(ValueProfile* valueProfile, RegisterID bucketCounterRegister) { ASSERT(shouldEmitProfiling()); ASSERT(valueProfile); @@ -689,29 +690,47 @@ inline void JIT::emitValueProfilingSite(ValueProfile* valueProfile) #if USE(JSVALUE32_64) const RegisterID valueTag = regT1; #endif + const RegisterID scratch = regT3; - // We're in a simple configuration: only one bucket, so we can just do a direct - // store. + if (ValueProfile::numberOfBuckets == 1) { + // We're in a simple configuration: only one bucket, so we can just do a direct + // store. #if USE(JSVALUE64) - store64(value, valueProfile->m_buckets); + store64(value, valueProfile->m_buckets); #else - EncodedValueDescriptor* descriptor = bitwise_cast(valueProfile->m_buckets); - store32(value, &descriptor->asBits.payload); - store32(valueTag, &descriptor->asBits.tag); + EncodedValueDescriptor* descriptor = bitwise_cast(valueProfile->m_buckets); + store32(value, &descriptor->asBits.payload); + store32(valueTag, &descriptor->asBits.tag); +#endif + return; + } + + if (m_randomGenerator.getUint32() & 1) + add32(TrustedImm32(1), bucketCounterRegister); + else + add32(TrustedImm32(3), bucketCounterRegister); + and32(TrustedImm32(ValueProfile::bucketIndexMask), bucketCounterRegister); + move(TrustedImmPtr(valueProfile->m_buckets), scratch); +#if USE(JSVALUE64) + store64(value, BaseIndex(scratch, bucketCounterRegister, TimesEight)); +#elif USE(JSVALUE32_64) + store32(value, BaseIndex(scratch, bucketCounterRegister, TimesEight, OBJECT_OFFSETOF(JSValue, u.asBits.payload))); + store32(valueTag, BaseIndex(scratch, bucketCounterRegister, TimesEight, OBJECT_OFFSETOF(JSValue, u.asBits.tag))); #endif } -inline void JIT::emitValueProfilingSite(unsigned bytecodeOffset) +inline void JIT::emitValueProfilingSite(unsigned bytecodeOffset, RegisterID bucketCounterRegister) { if (!shouldEmitProfiling()) return; - emitValueProfilingSite(m_codeBlock->valueProfileForBytecodeOffset(bytecodeOffset)); + emitValueProfilingSite(m_codeBlock->valueProfileForBytecodeOffset(bytecodeOffset), bucketCounterRegister); } -inline void JIT::emitValueProfilingSite() +inline void JIT::emitValueProfilingSite(RegisterID bucketCounterRegister) { - emitValueProfilingSite(m_bytecodeOffset); + emitValueProfilingSite(m_bytecodeOffset, bucketCounterRegister); } +#endif // ENABLE(VALUE_PROFILER) inline void JIT::emitArrayProfilingSite(RegisterID structureAndIndexingType, RegisterID scratch, ArrayProfile* arrayProfile) { @@ -728,26 +747,46 @@ inline void JIT::emitArrayProfilingSite(RegisterID structureAndIndexingType, Reg inline void JIT::emitArrayProfilingSiteForBytecodeIndex(RegisterID structureAndIndexingType, RegisterID scratch, unsigned bytecodeIndex) { +#if ENABLE(VALUE_PROFILER) emitArrayProfilingSite(structureAndIndexingType, scratch, m_codeBlock->getOrAddArrayProfile(bytecodeIndex)); +#else + UNUSED_PARAM(bytecodeIndex); + emitArrayProfilingSite(structureAndIndexingType, scratch, 0); +#endif } inline void JIT::emitArrayProfileStoreToHoleSpecialCase(ArrayProfile* arrayProfile) { +#if ENABLE(VALUE_PROFILER) store8(TrustedImm32(1), arrayProfile->addressOfMayStoreToHole()); +#else + UNUSED_PARAM(arrayProfile); +#endif } inline void JIT::emitArrayProfileOutOfBoundsSpecialCase(ArrayProfile* arrayProfile) { +#if ENABLE(VALUE_PROFILER) store8(TrustedImm32(1), arrayProfile->addressOfOutOfBounds()); +#else + UNUSED_PARAM(arrayProfile); +#endif } static inline bool arrayProfileSaw(ArrayModes arrayModes, IndexingType capability) { +#if ENABLE(VALUE_PROFILER) return arrayModesInclude(arrayModes, capability); +#else + UNUSED_PARAM(arrayModes); + UNUSED_PARAM(capability); + return false; +#endif } inline JITArrayMode JIT::chooseArrayMode(ArrayProfile* profile) { +#if ENABLE(VALUE_PROFILER) ConcurrentJITLocker locker(m_codeBlock->m_lock); profile->computeUpdatedPrediction(locker, m_codeBlock); ArrayModes arrayModes = profile->observedArrayModes(locker); @@ -758,6 +797,10 @@ inline JITArrayMode JIT::chooseArrayMode(ArrayProfile* profile) if (arrayProfileSaw(arrayModes, ArrayStorageShape)) return JITArrayStorage; return JITContiguous; +#else + UNUSED_PARAM(profile); + return JITContiguous; +#endif } #if USE(JSVALUE32_64) diff --git a/JavaScriptCore/jit/JITOpcodes.cpp b/JavaScriptCore/jit/JITOpcodes.cpp index 394d81ac..be6cba8c 100644 --- a/JavaScriptCore/jit/JITOpcodes.cpp +++ b/JavaScriptCore/jit/JITOpcodes.cpp @@ -1071,7 +1071,7 @@ void JIT::emit_op_get_argument_by_val(Instruction* currentInstruction) signExtend32ToPtr(regT1, regT1); load64(BaseIndex(callFrameRegister, regT1, TimesEight, CallFrame::thisArgumentOffset() * static_cast(sizeof(Register))), regT0); - emitValueProfilingSite(); + emitValueProfilingSite(regT4); emitPutVirtualRegister(dst, regT0); } diff --git a/JavaScriptCore/jit/JITOpcodes32_64.cpp b/JavaScriptCore/jit/JITOpcodes32_64.cpp index fd0c883c..4d2a46a5 100644 --- a/JavaScriptCore/jit/JITOpcodes32_64.cpp +++ b/JavaScriptCore/jit/JITOpcodes32_64.cpp @@ -1170,7 +1170,7 @@ void JIT::emit_op_get_argument_by_val(Instruction* currentInstruction) loadPtr(BaseIndex(callFrameRegister, regT2, TimesEight, OBJECT_OFFSETOF(JSValue, u.asBits.payload) + CallFrame::thisArgumentOffset() * static_cast(sizeof(Register))), regT0); loadPtr(BaseIndex(callFrameRegister, regT2, TimesEight, OBJECT_OFFSETOF(JSValue, u.asBits.tag) + CallFrame::thisArgumentOffset() * static_cast(sizeof(Register))), regT1); - emitValueProfilingSite(); + emitValueProfilingSite(regT4); emitStore(dst, regT1, regT0); } diff --git a/JavaScriptCore/jit/JITPropertyAccess.cpp b/JavaScriptCore/jit/JITPropertyAccess.cpp index 4241baf3..7231174a 100644 --- a/JavaScriptCore/jit/JITPropertyAccess.cpp +++ b/JavaScriptCore/jit/JITPropertyAccess.cpp @@ -143,7 +143,7 @@ void JIT::emit_op_get_by_val(Instruction* currentInstruction) resultOK.link(this); #endif - emitValueProfilingSite(); + emitValueProfilingSite(regT4); emitPutVirtualRegister(dst); m_byValCompilationInfo.append(ByValCompilationInfo(m_bytecodeOffset, badType, mode, done)); @@ -232,7 +232,7 @@ void JIT::emitSlow_op_get_by_val(Instruction* currentInstruction, Vector::iterator& iter) diff --git a/JavaScriptCore/jit/JITPropertyAccess32_64.cpp b/JavaScriptCore/jit/JITPropertyAccess32_64.cpp index 5bc8d1ab..c724cde5 100644 --- a/JavaScriptCore/jit/JITPropertyAccess32_64.cpp +++ b/JavaScriptCore/jit/JITPropertyAccess32_64.cpp @@ -168,7 +168,7 @@ void JIT::emit_op_get_by_val(Instruction* currentInstruction) resultOK.link(this); #endif - emitValueProfilingSite(); + emitValueProfilingSite(regT4); emitStore(dst, regT1, regT0); m_byValCompilationInfo.append(ByValCompilationInfo(m_bytecodeOffset, badType, mode, done)); @@ -263,7 +263,7 @@ void JIT::emitSlow_op_get_by_val(Instruction* currentInstruction, Vectorheap.writeBarrierBuffer(); @@ -796,23 +795,17 @@ static MacroAssembler::Call storeToWriteBarrierBuffer(CCallHelpers& jit, GPRReg ScratchBuffer* scratchBuffer = jit.vm()->scratchBufferForSize(allocator.desiredScratchBufferSize()); allocator.preserveUsedRegistersToScratchBuffer(jit, scratchBuffer, scratch1); - unsigned bytesFromBase = allocator.numberOfReusedRegisters() * sizeof(void*); - unsigned bytesToSubtract = 0; + // We need these extra slots because setupArgumentsWithExecState will use poke on x86. #if CPU(X86) - bytesToSubtract += 2 * sizeof(void*); - bytesFromBase += bytesToSubtract; + jit.subPtr(MacroAssembler::TrustedImm32(sizeof(void*) * 3), MacroAssembler::stackPointerRegister); #endif - unsigned currentAlignment = bytesFromBase % stackAlignmentBytes(); - bytesToSubtract += currentAlignment; - if (bytesToSubtract) - jit.subPtr(MacroAssembler::TrustedImm32(bytesToSubtract), MacroAssembler::stackPointerRegister); - - jit.setupArguments(callFrameRegister, cell); + jit.setupArgumentsWithExecState(cell); MacroAssembler::Call call = jit.call(); - if (bytesToSubtract) - jit.addPtr(MacroAssembler::TrustedImm32(bytesToSubtract), MacroAssembler::stackPointerRegister); +#if CPU(X86) + jit.addPtr(MacroAssembler::TrustedImm32(sizeof(void*) * 3), MacroAssembler::stackPointerRegister); +#endif allocator.restoreUsedRegistersFromScratchBuffer(jit, scratchBuffer, scratch1); done.link(&jit); @@ -820,13 +813,13 @@ static MacroAssembler::Call storeToWriteBarrierBuffer(CCallHelpers& jit, GPRReg return call; } -static MacroAssembler::Call writeBarrier(CCallHelpers& jit, GPRReg owner, GPRReg scratch1, GPRReg scratch2, GPRReg callFrameRegister, ScratchRegisterAllocator& allocator) +static MacroAssembler::Call writeBarrier(CCallHelpers& jit, GPRReg owner, GPRReg scratch1, GPRReg scratch2, ScratchRegisterAllocator& allocator) { ASSERT(owner != scratch1); ASSERT(owner != scratch2); MacroAssembler::Jump definitelyNotMarked = DFG::SpeculativeJIT::genericWriteBarrier(jit, owner, scratch1, scratch2); - MacroAssembler::Call call = storeToWriteBarrierBuffer(jit, owner, scratch1, scratch2, callFrameRegister, allocator); + MacroAssembler::Call call = storeToWriteBarrierBuffer(jit, owner, scratch1, scratch2, allocator); definitelyNotMarked.link(&jit); return call; } @@ -844,9 +837,6 @@ static void emitPutReplaceStub( RefPtr& stubRoutine) { VM* vm = &exec->vm(); -#if ENABLE(GGC) - GPRReg callFrameRegister = static_cast(stubInfo.patch.callFrameRegister); -#endif GPRReg baseGPR = static_cast(stubInfo.patch.baseGPR); #if USE(JSVALUE32_64) GPRReg valueTagGPR = static_cast(stubInfo.patch.valueTagGPR); @@ -893,7 +883,7 @@ static void emitPutReplaceStub( #endif #if ENABLE(GGC) - MacroAssembler::Call writeBarrierOperation = writeBarrier(stubJit, baseGPR, scratchGPR1, scratchGPR2, callFrameRegister, allocator); + MacroAssembler::Call writeBarrierOperation = writeBarrier(stubJit, baseGPR, scratchGPR1, scratchGPR2, allocator); #endif MacroAssembler::Jump success; @@ -1060,7 +1050,7 @@ static void emitPutTransitionStub( #endif #if ENABLE(GGC) - MacroAssembler::Call writeBarrierOperation = writeBarrier(stubJit, baseGPR, scratchGPR1, scratchGPR2, callFrameRegister, allocator); + MacroAssembler::Call writeBarrierOperation = writeBarrier(stubJit, baseGPR, scratchGPR1, scratchGPR2, allocator); #endif MacroAssembler::Jump success; diff --git a/JavaScriptCore/jit/ScratchRegisterAllocator.h b/JavaScriptCore/jit/ScratchRegisterAllocator.h index 1967226c..de81f469 100644 --- a/JavaScriptCore/jit/ScratchRegisterAllocator.h +++ b/JavaScriptCore/jit/ScratchRegisterAllocator.h @@ -41,7 +41,7 @@ class ScratchRegisterAllocator { public: ScratchRegisterAllocator(const TempRegisterSet& usedRegisters) : m_usedRegisters(usedRegisters) - , m_numberOfReusedRegisters(0) + , m_didReuseRegisters(false) { } @@ -80,7 +80,7 @@ class ScratchRegisterAllocator { typename BankInfo::RegisterType reg = BankInfo::toRegister(i); if (!m_lockedRegisters.get(reg) && !m_scratchRegisters.get(reg)) { m_scratchRegisters.set(reg); - m_numberOfReusedRegisters++; + m_didReuseRegisters = true; return reg; } } @@ -96,17 +96,12 @@ class ScratchRegisterAllocator { bool didReuseRegisters() const { - return !!m_numberOfReusedRegisters; - } - - unsigned numberOfReusedRegisters() const - { - return m_numberOfReusedRegisters; + return m_didReuseRegisters; } void preserveReusedRegistersByPushing(MacroAssembler& jit) { - if (!didReuseRegisters()) + if (!m_didReuseRegisters) return; for (unsigned i = 0; i < FPRInfo::numberOfRegisters; ++i) { @@ -121,7 +116,7 @@ class ScratchRegisterAllocator { void restoreReusedRegistersByPopping(MacroAssembler& jit) { - if (!didReuseRegisters()) + if (!m_didReuseRegisters) return; for (unsigned i = GPRInfo::numberOfRegisters; i--;) { @@ -204,7 +199,7 @@ class ScratchRegisterAllocator { TempRegisterSet m_usedRegisters; TempRegisterSet m_lockedRegisters; TempRegisterSet m_scratchRegisters; - unsigned m_numberOfReusedRegisters; + bool m_didReuseRegisters; }; } // namespace JSC diff --git a/JavaScriptCore/jsc.cpp b/JavaScriptCore/jsc.cpp index 40784b49..121a2066 100644 --- a/JavaScriptCore/jsc.cpp +++ b/JavaScriptCore/jsc.cpp @@ -85,6 +85,10 @@ #include #endif +#if PLATFORM(BLACKBERRY) +#include +#endif + #if PLATFORM(EFL) #include #endif @@ -586,6 +590,11 @@ int main(int argc, char** argv) timeBeginPeriod(1); #endif +#if PLATFORM(BLACKBERRY) + // Write all WTF logs to the system log + BlackBerry::Platform::setupApplicationLogging("jsc"); +#endif + #if PLATFORM(EFL) ecore_init(); #endif diff --git a/JavaScriptCore/llint/LLIntCommon.h b/JavaScriptCore/llint/LLIntCommon.h index d32a264e..61ffe183 100644 --- a/JavaScriptCore/llint/LLIntCommon.h +++ b/JavaScriptCore/llint/LLIntCommon.h @@ -43,5 +43,14 @@ // Disable inline caching of get_by_id and put_by_id. #define LLINT_ALWAYS_ACCESS_SLOW 0 +// Enable OSR into the JIT. Disabling this while the LLInt is enabled effectively +// turns off all JIT'ing, since in LLInt's parlance, OSR subsumes any form of JIT +// invocation. +#if ENABLE(JIT) && !ENABLE(ALLOCATION_LOGGING) +#define LLINT_OSR_TO_JIT 1 +#else +#define LLINT_OSR_TO_JIT 0 +#endif + #endif // LLIntCommon_h diff --git a/JavaScriptCore/llint/LLIntOfflineAsmConfig.h b/JavaScriptCore/llint/LLIntOfflineAsmConfig.h index 07a91bb7..78aead26 100644 --- a/JavaScriptCore/llint/LLIntOfflineAsmConfig.h +++ b/JavaScriptCore/llint/LLIntOfflineAsmConfig.h @@ -136,6 +136,12 @@ #define OFFLINE_ASM_BIG_ENDIAN 0 #endif +#if LLINT_OSR_TO_JIT +#define OFFLINE_ASM_JIT_ENABLED 1 +#else +#define OFFLINE_ASM_JIT_ENABLED 0 +#endif + #if LLINT_EXECUTION_TRACING #define OFFLINE_ASM_EXECUTION_TRACING 1 #else @@ -148,10 +154,16 @@ #define OFFLINE_ASM_ALWAYS_ALLOCATE_SLOW 0 #endif -#if ENABLE(GGC) -#define OFFLINE_ASM_GGC 1 +#if ENABLE(JAVASCRIPT_DEBUGGER) +#define OFFLINE_ASM_JAVASCRIPT_DEBUGGER 1 +#else +#define OFFLINE_ASM_JAVASCRIPT_DEBUGGER 0 +#endif + +#if ENABLE(VALUE_PROFILER) +#define OFFLINE_ASM_VALUE_PROFILER 1 #else -#define OFFLINE_ASM_GGC 0 +#define OFFLINE_ASM_VALUE_PROFILER 0 #endif #endif // LLIntOfflineAsmConfig_h diff --git a/JavaScriptCore/llint/LLIntSlowPaths.cpp b/JavaScriptCore/llint/LLIntSlowPaths.cpp index 26264171..ad360311 100644 --- a/JavaScriptCore/llint/LLIntSlowPaths.cpp +++ b/JavaScriptCore/llint/LLIntSlowPaths.cpp @@ -119,6 +119,7 @@ namespace JSC { namespace LLInt { LLINT_END_IMPL(); \ } while (false) +#if ENABLE(VALUE_PROFILER) #define LLINT_RETURN_PROFILED(opcode, value) do { \ JSValue __rp_returnValue = (value); \ LLINT_CHECK_EXCEPTION(); \ @@ -132,6 +133,13 @@ namespace JSC { namespace LLInt { JSValue::encode(value); \ } while (false) +#else // ENABLE(VALUE_PROFILER) +#define LLINT_RETURN_PROFILED(opcode, value) LLINT_RETURN(value) + +#define LLINT_PROFILE_VALUE(opcode, value) do { } while (false) + +#endif // ENABLE(VALUE_PROFILER) + #define LLINT_CALL_END_IMPL(exec, callTarget) LLINT_RETURN_TWO((callTarget), (exec)) #define LLINT_CALL_THROW(exec, exceptionToThrow) do { \ @@ -260,8 +268,6 @@ LLINT_SLOW_PATH_DECL(special_trace) LLINT_END_IMPL(); } -enum EntryKind { Prologue, ArityCheck }; - #if ENABLE(JIT) inline bool shouldJIT(ExecState* exec) { @@ -315,6 +321,7 @@ inline bool jitCompileAndSetHeuristics(CodeBlock* codeBlock, ExecState* exec) } } +enum EntryKind { Prologue, ArityCheck }; static SlowPathReturnType entryOSR(ExecState* exec, Instruction*, CodeBlock* codeBlock, const char *name, EntryKind kind) { if (Options::verboseOSR()) { @@ -335,13 +342,6 @@ static SlowPathReturnType entryOSR(ExecState* exec, Instruction*, CodeBlock* cod ASSERT(kind == ArityCheck); LLINT_RETURN_TWO(codeBlock->jitCodeWithArityCheck().executableAddress(), exec); } -#else // ENABLE(JIT) -static SlowPathReturnType entryOSR(ExecState* exec, Instruction*, CodeBlock* codeBlock, const char*, EntryKind) -{ - codeBlock->dontJITAnytimeSoon(); - LLINT_RETURN_TWO(0, exec); -} -#endif // ENABLE(JIT) LLINT_SLOW_PATH_DECL(entry_osr) { @@ -372,7 +372,6 @@ LLINT_SLOW_PATH_DECL(loop_osr) { CodeBlock* codeBlock = exec->codeBlock(); -#if ENABLE(JIT) if (Options::verboseOSR()) { dataLog( *codeBlock, ": Entered loop_osr with executeCounter = ", @@ -399,17 +398,12 @@ LLINT_SLOW_PATH_DECL(loop_osr) ASSERT(jumpTarget); LLINT_RETURN_TWO(jumpTarget, exec); -#else // ENABLE(JIT) - codeBlock->dontJITAnytimeSoon(); - LLINT_RETURN_TWO(0, exec); -#endif // ENABLE(JIT) } LLINT_SLOW_PATH_DECL(replace) { CodeBlock* codeBlock = exec->codeBlock(); -#if ENABLE(JIT) if (Options::verboseOSR()) { dataLog( *codeBlock, ": Entered replace with executeCounter = ", @@ -421,11 +415,8 @@ LLINT_SLOW_PATH_DECL(replace) else codeBlock->dontJITAnytimeSoon(); LLINT_END_IMPL(); -#else // ENABLE(JIT) - codeBlock->dontJITAnytimeSoon(); - LLINT_END_IMPL(); -#endif // ENABLE(JIT) } +#endif // ENABLE(JIT) LLINT_SLOW_PATH_DECL(stack_check) { @@ -557,12 +548,16 @@ LLINT_SLOW_PATH_DECL(slow_path_get_by_id) && isJSArray(baseValue) && ident == exec->propertyNames().length) { pc[0].u.opcode = LLInt::getOpcode(llint_op_get_array_length); +#if ENABLE(VALUE_PROFILER) ArrayProfile* arrayProfile = codeBlock->getOrAddArrayProfile(pc - codeBlock->instructions().begin()); arrayProfile->observeStructure(baseValue.asCell()->structure()); pc[4].u.arrayProfile = arrayProfile; +#endif } +#if ENABLE(VALUE_PROFILER) pc[OPCODE_LENGTH(op_get_by_id) - 1].u.profile->m_buckets[0] = JSValue::encode(result); +#endif LLINT_END(); } @@ -1388,11 +1383,6 @@ LLINT_SLOW_PATH_DECL(slow_path_put_to_scope) LLINT_END(); } -extern "C" void llint_write_barrier_slow(ExecState*, JSCell* cell) -{ - Heap::writeBarrier(cell); -} - } } // namespace JSC::LLInt #endif // ENABLE(LLINT) diff --git a/JavaScriptCore/llint/LLIntSlowPaths.h b/JavaScriptCore/llint/LLIntSlowPaths.h index 8d60afa2..789dc593 100644 --- a/JavaScriptCore/llint/LLIntSlowPaths.h +++ b/JavaScriptCore/llint/LLIntSlowPaths.h @@ -41,7 +41,6 @@ namespace LLInt { extern "C" SlowPathReturnType llint_trace_operand(ExecState*, Instruction*, int fromWhere, int operand); extern "C" SlowPathReturnType llint_trace_value(ExecState*, Instruction*, int fromWhere, int operand); -extern "C" void llint_write_barrier_slow(ExecState*, JSCell*); #define LLINT_SLOW_PATH_DECL(name) \ extern "C" SlowPathReturnType llint_##name(ExecState* exec, Instruction* pc) diff --git a/JavaScriptCore/llint/LowLevelInterpreter.asm b/JavaScriptCore/llint/LowLevelInterpreter.asm index 396551b9..836b33bc 100644 --- a/JavaScriptCore/llint/LowLevelInterpreter.asm +++ b/JavaScriptCore/llint/LowLevelInterpreter.asm @@ -170,11 +170,7 @@ const Dynamic = 6 const ResolveModeMask = 0xffff -const MarkedBlockSize = 64 * 1024 -const MarkedBlockMask = ~(MarkedBlockSize - 1) -# Constants for checking mark bits. -const AtomNumberShift = 3 -const BitMapWordShift = 4 +const MarkedBlockMask = ~0xffff # Allocation constants if JSVALUE64 @@ -263,27 +259,19 @@ end macro arrayProfile(structureAndIndexingType, profile, scratch) const structure = structureAndIndexingType const indexingType = structureAndIndexingType - storep structure, ArrayProfile::m_lastSeenStructure[profile] + if VALUE_PROFILER + storep structure, ArrayProfile::m_lastSeenStructure[profile] + end loadb Structure::m_indexingType[structure], indexingType end -macro checkMarkByte(cell, scratch1, scratch2, continuation) - move cell, scratch1 - move cell, scratch2 - - andp MarkedBlockMask, scratch1 - andp ~MarkedBlockMask, scratch2 - - rshiftp AtomNumberShift + BitMapWordShift, scratch2 - loadb MarkedBlock::m_marks[scratch1, scratch2, 1], scratch1 - continuation(scratch1) -end - macro checkSwitchToJIT(increment, action) - loadp CodeBlock[cfr], t0 - baddis increment, CodeBlock::m_llintExecuteCounter + ExecutionCounter::m_counter[t0], .continue - action() + if JIT_ENABLED + loadp CodeBlock[cfr], t0 + baddis increment, CodeBlock::m_llintExecuteCounter + ExecutionCounter::m_counter[t0], .continue + action() .continue: + end end macro checkSwitchToJITForEpilogue() @@ -333,16 +321,18 @@ macro prologue(codeBlockGetter, codeBlockSetter, osrSlowPath, traceSlowPath) callSlowPath(traceSlowPath) end codeBlockGetter(t1) - baddis 5, CodeBlock::m_llintExecuteCounter + ExecutionCounter::m_counter[t1], .continue - cCall2(osrSlowPath, cfr, PC) - move t1, cfr - btpz t0, .recover - loadp ReturnPC[cfr], t2 - restoreReturnAddressBeforeReturn(t2) - jmp t0 -.recover: - codeBlockGetter(t1) -.continue: + if JIT_ENABLED + baddis 5, CodeBlock::m_llintExecuteCounter + ExecutionCounter::m_counter[t1], .continue + cCall2(osrSlowPath, cfr, PC) + move t1, cfr + btpz t0, .recover + loadp ReturnPC[cfr], t2 + restoreReturnAddressBeforeReturn(t2) + jmp t0 + .recover: + codeBlockGetter(t1) + .continue: + end codeBlockSetter(t1) # Set up the PC. @@ -357,35 +347,37 @@ end # Expects that CodeBlock is in t1, which is what prologue() leaves behind. # Must call dispatch(0) after calling this. macro functionInitialization(profileArgSkip) - # Profile the arguments. Unfortunately, we have no choice but to do this. This - # code is pretty horrendous because of the difference in ordering between - # arguments and value profiles, the desire to have a simple loop-down-to-zero - # loop, and the desire to use only three registers so as to preserve the PC and - # the code block. It is likely that this code should be rewritten in a more - # optimal way for architectures that have more than five registers available - # for arbitrary use in the interpreter. - loadi CodeBlock::m_numParameters[t1], t0 - addp -profileArgSkip, t0 # Use addi because that's what has the peephole - assert(macro (ok) bpgteq t0, 0, ok end) - btpz t0, .argumentProfileDone - loadp CodeBlock::m_argumentValueProfiles + VectorBufferOffset[t1], t3 - mulp sizeof ValueProfile, t0, t2 # Aaaaahhhh! Need strength reduction! - lshiftp 3, t0 - addp t2, t3 -.argumentProfileLoop: - if JSVALUE64 - loadq ThisArgumentOffset - 8 + profileArgSkip * 8[cfr, t0], t2 - subp sizeof ValueProfile, t3 - storeq t2, profileArgSkip * sizeof ValueProfile + ValueProfile::m_buckets[t3] - else - loadi ThisArgumentOffset + TagOffset - 8 + profileArgSkip * 8[cfr, t0], t2 - subp sizeof ValueProfile, t3 - storei t2, profileArgSkip * sizeof ValueProfile + ValueProfile::m_buckets + TagOffset[t3] - loadi ThisArgumentOffset + PayloadOffset - 8 + profileArgSkip * 8[cfr, t0], t2 - storei t2, profileArgSkip * sizeof ValueProfile + ValueProfile::m_buckets + PayloadOffset[t3] + if VALUE_PROFILER + # Profile the arguments. Unfortunately, we have no choice but to do this. This + # code is pretty horrendous because of the difference in ordering between + # arguments and value profiles, the desire to have a simple loop-down-to-zero + # loop, and the desire to use only three registers so as to preserve the PC and + # the code block. It is likely that this code should be rewritten in a more + # optimal way for architectures that have more than five registers available + # for arbitrary use in the interpreter. + loadi CodeBlock::m_numParameters[t1], t0 + addp -profileArgSkip, t0 # Use addi because that's what has the peephole + assert(macro (ok) bpgteq t0, 0, ok end) + btpz t0, .argumentProfileDone + loadp CodeBlock::m_argumentValueProfiles + VectorBufferOffset[t1], t3 + mulp sizeof ValueProfile, t0, t2 # Aaaaahhhh! Need strength reduction! + lshiftp 3, t0 + addp t2, t3 + .argumentProfileLoop: + if JSVALUE64 + loadq ThisArgumentOffset - 8 + profileArgSkip * 8[cfr, t0], t2 + subp sizeof ValueProfile, t3 + storeq t2, profileArgSkip * sizeof ValueProfile + ValueProfile::m_buckets[t3] + else + loadi ThisArgumentOffset + TagOffset - 8 + profileArgSkip * 8[cfr, t0], t2 + subp sizeof ValueProfile, t3 + storei t2, profileArgSkip * sizeof ValueProfile + ValueProfile::m_buckets + TagOffset[t3] + loadi ThisArgumentOffset + PayloadOffset - 8 + profileArgSkip * 8[cfr, t0], t2 + storei t2, profileArgSkip * sizeof ValueProfile + ValueProfile::m_buckets + PayloadOffset[t3] + end + baddpnz -8, t0, .argumentProfileLoop + .argumentProfileDone: end - baddpnz -8, t0, .argumentProfileLoop -.argumentProfileDone: # Check stack height. loadi CodeBlock::m_numCalleeRegisters[t1], t0 @@ -834,6 +826,7 @@ _llint_op_profile_did_call: _llint_op_debug: +if JAVASCRIPT_DEBUGGER traceExecution() loadp CodeBlock[cfr], t0 loadp CodeBlock::m_globalObject[t0], t0 @@ -844,6 +837,7 @@ _llint_op_debug: callSlowPath(_llint_slow_path_debug) .opDebugDone: +end dispatch(2) diff --git a/JavaScriptCore/llint/LowLevelInterpreter.cpp b/JavaScriptCore/llint/LowLevelInterpreter.cpp index 48148c6f..c45dcaa2 100644 --- a/JavaScriptCore/llint/LowLevelInterpreter.cpp +++ b/JavaScriptCore/llint/LowLevelInterpreter.cpp @@ -522,17 +522,8 @@ JSValue CLoop::execute(CallFrame* callFrame, Opcode entryOpcode, bool isInitiali // // These are for building an interpreter from generated assembly code: -#if CPU(X86_64) && COMPILER(CLANG) -#define OFFLINE_ASM_BEGIN asm ( \ - ".cfi_startproc\n" - -#define OFFLINE_ASM_END \ - ".cfi_endproc\n" \ -); -#else #define OFFLINE_ASM_BEGIN asm ( #define OFFLINE_ASM_END ); -#endif #define OFFLINE_ASM_OPCODE_LABEL(__opcode) OFFLINE_ASM_GLOBAL_LABEL(llint_##__opcode) #define OFFLINE_ASM_GLUE_LABEL(__opcode) OFFLINE_ASM_GLOBAL_LABEL(__opcode) @@ -545,15 +536,6 @@ JSValue CLoop::execute(CallFrame* callFrame, Opcode entryOpcode, bool isInitiali ".thumb\n" \ ".thumb_func " THUMB_FUNC_PARAM(label) "\n" \ SYMBOL_STRING(label) ":\n" -#elif CPU(X86_64) && COMPILER(CLANG) -#define OFFLINE_ASM_GLOBAL_LABEL(label) \ - ".text\n" \ - ".globl " SYMBOL_STRING(label) "\n" \ - HIDE_SYMBOL(label) "\n" \ - SYMBOL_STRING(label) ":\n" \ - ".cfi_def_cfa rbp, 0\n" \ - ".cfi_offset 16, 8\n" \ - ".cfi_offset 6, 0\n" #else #define OFFLINE_ASM_GLOBAL_LABEL(label) \ ".text\n" \ diff --git a/JavaScriptCore/llint/LowLevelInterpreter32_64.asm b/JavaScriptCore/llint/LowLevelInterpreter32_64.asm index ae1f3d2e..92ff430d 100644 --- a/JavaScriptCore/llint/LowLevelInterpreter32_64.asm +++ b/JavaScriptCore/llint/LowLevelInterpreter32_64.asm @@ -491,62 +491,16 @@ macro loadConstantOrVariablePayloadUnchecked(index, payload) payload) end -macro writeBarrierOnOperand(cellOperand) - if GGC - loadisFromInstruction(cellOperand, t1) - loadConstantOrVariablePayload(t1, CellTag, t0, .writeBarrierDone) - checkMarkByte(t0, t1, t2, - macro(marked) - btbz marked, .writeBarrierDone - push cfr, PC - # We make two extra slots because cCall2 will poke. - subp 8, sp - cCall2(_llint_write_barrier_slow, cfr, t0) - addp 8, sp - pop PC, cfr - end - ) - .writeBarrierDone: - end -end - -macro writeBarrierOnOperands(cellOperand, valueOperand) - if GGC - loadisFromInstruction(valueOperand, t1) - loadConstantOrVariableTag(t1, t0) - bineq t0, CellTag, .writeBarrierDone - - writeBarrierOnOperand(cellOperand) - .writeBarrierDone: - end -end - -macro writeBarrierOnGlobalObject(valueOperand) - if GGC - loadisFromInstruction(valueOperand, t1) - bineq t0, CellTag, .writeBarrierDone - - loadp CodeBlock[cfr], t0 - loadp CodeBlock::m_globalObject[t0], t0 - checkMarkByte(t0, t1, t2, - macro(marked) - btbz marked, .writeBarrierDone - push cfr, PC - # We make two extra slots because cCall2 will poke. - subp 8, sp - cCall2(_llint_write_barrier_slow, cfr, t0) - addp 8, sp - pop PC, cfr - end - ) - .writeBarrierDone: - end +macro writeBarrier(tag, payload) + # Nothing to do, since we don't have a generational or incremental collector. end macro valueProfile(tag, payload, operand, scratch) - loadp operand[PC], scratch - storei tag, ValueProfile::m_buckets + TagOffset[scratch] - storei payload, ValueProfile::m_buckets + PayloadOffset[scratch] + if VALUE_PROFILER + loadp operand[PC], scratch + storei tag, ValueProfile::m_buckets + TagOffset[scratch] + storei payload, ValueProfile::m_buckets + PayloadOffset[scratch] + end end @@ -623,7 +577,6 @@ _llint_op_enter: addi 1, t2 btinz t2, .opEnterLoop .opEnterDone: - callSlowPath(_slow_path_enter) dispatch(1) @@ -1304,10 +1257,10 @@ end _llint_op_init_global_const: traceExecution() - writeBarrierOnGlobalObject(2) loadi 8[PC], t1 loadi 4[PC], t0 loadConstantOrVariable(t1, t2, t3) + writeBarrier(t2, t3) storei t2, TagOffset[t0] storei t3, PayloadOffset[t0] dispatch(5) @@ -1393,7 +1346,6 @@ _llint_op_get_arguments_length: macro putById(getPropertyStorage) traceExecution() - writeBarrierOnOperands(1, 3) loadi 4[PC], t3 loadi 16[PC], t1 loadConstantOrVariablePayload(t3, CellTag, t0, .opPutByIdSlow) @@ -1405,6 +1357,7 @@ macro putById(getPropertyStorage) bpneq JSCell::m_structure[t0], t1, .opPutByIdSlow loadi 20[PC], t1 loadConstantOrVariable2Reg(t2, scratch, t2) + writeBarrier(scratch, t2) storei scratch, TagOffset[propertyStorage, t1] storei t2, PayloadOffset[propertyStorage, t1] dispatch(9) @@ -1425,7 +1378,6 @@ _llint_op_put_by_id_out_of_line: macro putByIdTransition(additionalChecks, getPropertyStorage) traceExecution() - writeBarrierOnOperand(1) loadi 4[PC], t3 loadi 16[PC], t1 loadConstantOrVariablePayload(t3, CellTag, t0, .opPutByIdSlow) @@ -1439,6 +1391,7 @@ macro putByIdTransition(additionalChecks, getPropertyStorage) macro (propertyStorage, scratch) addp t1, propertyStorage, t3 loadConstantOrVariable2Reg(t2, t1, t2) + writeBarrier(t1, t2) storei t1, TagOffset[t3] loadi 24[PC], t1 storei t2, PayloadOffset[t3] @@ -1530,8 +1483,10 @@ _llint_op_get_by_val: dispatch(6) .opGetByValOutOfBounds: - loadpFromInstruction(4, t0) - storeb 1, ArrayProfile::m_outOfBounds[t0] + if VALUE_PROFILER + loadpFromInstruction(4, t0) + storeb 1, ArrayProfile::m_outOfBounds[t0] + end .opGetByValSlow: callSlowPath(_llint_slow_path_get_by_val) dispatch(6) @@ -1601,8 +1556,10 @@ macro contiguousPutByVal(storeCallback) .outOfBounds: biaeq t3, -sizeof IndexingHeader + IndexingHeader::u.lengths.vectorLength[t0], .opPutByValOutOfBounds - loadp 16[PC], t2 - storeb 1, ArrayProfile::m_mayStoreToHole[t2] + if VALUE_PROFILER + loadp 16[PC], t2 + storeb 1, ArrayProfile::m_mayStoreToHole[t2] + end addi 1, t3, t2 storei t2, -sizeof IndexingHeader + IndexingHeader::u.lengths.publicLength[t0] jmp .storeResult @@ -1610,7 +1567,6 @@ end macro putByVal(holeCheck, slowPath) traceExecution() - writeBarrierOnOperands(1, 3) loadi 4[PC], t0 loadConstantOrVariablePayload(t0, CellTag, t1, .opPutByValSlow) loadp JSCell::m_structure[t1], t2 @@ -1652,6 +1608,7 @@ macro putByVal(holeCheck, slowPath) const tag = scratch const payload = operand loadConstantOrVariable2Reg(operand, tag, payload) + writeBarrier(tag, payload) storei tag, TagOffset[base, index, 8] storei payload, PayloadOffset[base, index, 8] end) @@ -1663,13 +1620,16 @@ macro putByVal(holeCheck, slowPath) .opPutByValArrayStorageStoreResult: loadi 12[PC], t2 loadConstantOrVariable2Reg(t2, t1, t2) + writeBarrier(t1, t2) storei t1, ArrayStorage::m_vector + TagOffset[t0, t3, 8] storei t2, ArrayStorage::m_vector + PayloadOffset[t0, t3, 8] dispatch(5) .opPutByValArrayStorageEmpty: - loadp 16[PC], t1 - storeb 1, ArrayProfile::m_mayStoreToHole[t1] + if VALUE_PROFILER + loadp 16[PC], t1 + storeb 1, ArrayProfile::m_mayStoreToHole[t1] + end addi 1, ArrayStorage::m_numValuesInVector[t0] bib t3, -sizeof IndexingHeader + IndexingHeader::u.lengths.publicLength[t0], .opPutByValArrayStorageStoreResult addi 1, t3, t1 @@ -1677,8 +1637,10 @@ macro putByVal(holeCheck, slowPath) jmp .opPutByValArrayStorageStoreResult .opPutByValOutOfBounds: - loadpFromInstruction(4, t0) - storeb 1, ArrayProfile::m_outOfBounds[t0] + if VALUE_PROFILER + loadpFromInstruction(4, t0) + storeb 1, ArrayProfile::m_outOfBounds[t0] + end .opPutByValSlow: callSlowPath(slowPath) dispatch(5) @@ -1895,14 +1857,16 @@ _llint_op_new_captured_func: macro arrayProfileForCall() - loadi 16[PC], t3 - negi t3 - bineq ThisArgumentOffset + TagOffset[cfr, t3, 8], CellTag, .done - loadi ThisArgumentOffset + PayloadOffset[cfr, t3, 8], t0 - loadp JSCell::m_structure[t0], t0 - loadp 24[PC], t1 - storep t0, ArrayProfile::m_lastSeenStructure[t1] -.done: + if VALUE_PROFILER + loadi 16[PC], t3 + negi t3 + bineq ThisArgumentOffset + TagOffset[cfr, t3, 8], CellTag, .done + loadi ThisArgumentOffset + PayloadOffset[cfr, t3, 8], t0 + loadp JSCell::m_structure[t0], t0 + loadp 24[PC], t1 + storep t0, ArrayProfile::m_lastSeenStructure[t1] + .done: + end end macro doCall(slowPath) @@ -2387,41 +2351,35 @@ _llint_op_put_to_scope: #pGlobalProperty: bineq t0, GlobalProperty, .pGlobalVar - writeBarrierOnOperands(1, 3) loadWithStructureCheck(1, .pDynamic) putProperty() dispatch(7) .pGlobalVar: bineq t0, GlobalVar, .pClosureVar - writeBarrierOnGlobalObject(3) putGlobalVar() dispatch(7) .pClosureVar: bineq t0, ClosureVar, .pGlobalPropertyWithVarInjectionChecks - writeBarrierOnOperands(1, 3) loadVariable(1, t2, t1, t0) putClosureVar() dispatch(7) .pGlobalPropertyWithVarInjectionChecks: bineq t0, GlobalPropertyWithVarInjectionChecks, .pGlobalVarWithVarInjectionChecks - writeBarrierOnOperands(1, 3) loadWithStructureCheck(1, .pDynamic) putProperty() dispatch(7) .pGlobalVarWithVarInjectionChecks: bineq t0, GlobalVarWithVarInjectionChecks, .pClosureVarWithVarInjectionChecks - writeBarrierOnGlobalObject(3) varInjectionCheck(.pDynamic) putGlobalVar() dispatch(7) .pClosureVarWithVarInjectionChecks: bineq t0, ClosureVarWithVarInjectionChecks, .pDynamic - writeBarrierOnOperands(1, 3) varInjectionCheck(.pDynamic) loadVariable(1, t2, t1, t0) putClosureVar() diff --git a/JavaScriptCore/llint/LowLevelInterpreter64.asm b/JavaScriptCore/llint/LowLevelInterpreter64.asm index e5d73250..e5236f11 100644 --- a/JavaScriptCore/llint/LowLevelInterpreter64.asm +++ b/JavaScriptCore/llint/LowLevelInterpreter64.asm @@ -140,6 +140,10 @@ macro doCallToJavaScript(makeCall, doReturn) const temp3 = t6 end + if X86_64 + loadp [sp], previousPC + end + move cfr, previousCFR functionPrologue(extraStackSpace) move topOfStack, cfr @@ -149,10 +153,6 @@ macro doCallToJavaScript(makeCall, doReturn) loadp [vmTopCallFrame], temp1 storep temp1, ScopeChain[cfr] storep 1, CodeBlock[cfr] - if X86_64 - loadp 7*8[sp], previousPC - loadp 6*8[sp], previousCFR - end storep previousPC, ReturnPC[cfr] storep previousCFR, CallerFrame[cfr] move cfr, temp1 @@ -331,56 +331,15 @@ macro loadConstantOrVariableCell(index, value, slow) btqnz value, tagMask, slow end -macro writeBarrierOnOperand(cellOperand) - if GGC - loadisFromInstruction(cellOperand, t1) - loadConstantOrVariableCell(t1, t0, .writeBarrierDone) - checkMarkByte(t0, t1, t2, - macro(marked) - btbz marked, .writeBarrierDone - push PB, PC - cCall2(_llint_write_barrier_slow, cfr, t0) - pop PC, PB - end - ) - .writeBarrierDone: - end -end - -macro writeBarrierOnOperands(cellOperand, valueOperand) - if GGC - loadisFromInstruction(valueOperand, t1) - loadConstantOrVariable(t1, t0) - btpz t0, .writeBarrierDone - - writeBarrierOnOperand(cellOperand) - .writeBarrierDone: - end -end - -macro writeBarrierOnGlobalObject(valueOperand) - if GGC - loadisFromInstruction(valueOperand, t1) - loadConstantOrVariable(t1, t0) - btpz t0, .writeBarrierDone - - loadp CodeBlock[cfr], t0 - loadp CodeBlock::m_globalObject[t0], t0 - checkMarkByte(t0, t1, t2, - macro(marked) - btbz marked, .writeBarrierDone - push PB, PC - cCall2(_llint_write_barrier_slow, cfr, t0) - pop PC, PB - end - ) - .writeBarrierDone: - end +macro writeBarrier(value) + # Nothing to do, since we don't have a generational or incremental collector. end macro valueProfile(value, operand, scratch) - loadpFromInstruction(operand, scratch) - storeq value, ValueProfile::m_buckets[scratch] + if VALUE_PROFILER + loadpFromInstruction(operand, scratch) + storeq value, ValueProfile::m_buckets[scratch] + end end @@ -455,7 +414,6 @@ _llint_op_enter: addq 1, t2 btqnz t2, .opEnterLoop .opEnterDone: - callSlowPath(_slow_path_enter) dispatch(1) @@ -1108,10 +1066,10 @@ end _llint_op_init_global_const: traceExecution() - writeBarrierOnGlobalObject(2) loadisFromInstruction(2, t1) loadpFromInstruction(1, t0) loadConstantOrVariable(t1, t2) + writeBarrier(t2) storeq t2, [t0] dispatch(5) @@ -1193,7 +1151,6 @@ _llint_op_get_arguments_length: macro putById(getPropertyStorage) traceExecution() - writeBarrierOnOperands(1, 3) loadisFromInstruction(1, t3) loadpFromInstruction(4, t1) loadConstantOrVariableCell(t3, t0, .opPutByIdSlow) @@ -1205,6 +1162,7 @@ macro putById(getPropertyStorage) bpneq JSCell::m_structure[t0], t1, .opPutByIdSlow loadisFromInstruction(5, t1) loadConstantOrVariable(t2, scratch) + writeBarrier(t0) storeq scratch, [propertyStorage, t1] dispatch(9) end) @@ -1224,7 +1182,6 @@ _llint_op_put_by_id_out_of_line: macro putByIdTransition(additionalChecks, getPropertyStorage) traceExecution() - writeBarrierOnOperand(1) loadisFromInstruction(1, t3) loadpFromInstruction(4, t1) loadConstantOrVariableCell(t3, t0, .opPutByIdSlow) @@ -1238,6 +1195,7 @@ macro putByIdTransition(additionalChecks, getPropertyStorage) macro (propertyStorage, scratch) addp t1, propertyStorage, t3 loadConstantOrVariable(t2, t1) + writeBarrier(t1) storeq t1, [t3] loadpFromInstruction(6, t1) storep t1, JSCell::m_structure[t0] @@ -1326,8 +1284,10 @@ _llint_op_get_by_val: dispatch(6) .opGetByValOutOfBounds: - loadpFromInstruction(4, t0) - storeb 1, ArrayProfile::m_outOfBounds[t0] + if VALUE_PROFILER + loadpFromInstruction(4, t0) + storeb 1, ArrayProfile::m_outOfBounds[t0] + end .opGetByValSlow: callSlowPath(_llint_slow_path_get_by_val) dispatch(6) @@ -1397,8 +1357,10 @@ macro contiguousPutByVal(storeCallback) .outOfBounds: biaeq t3, -sizeof IndexingHeader + IndexingHeader::u.lengths.vectorLength[t0], .opPutByValOutOfBounds - loadp 32[PB, PC, 8], t2 - storeb 1, ArrayProfile::m_mayStoreToHole[t2] + if VALUE_PROFILER + loadp 32[PB, PC, 8], t2 + storeb 1, ArrayProfile::m_mayStoreToHole[t2] + end addi 1, t3, t2 storei t2, -sizeof IndexingHeader + IndexingHeader::u.lengths.publicLength[t0] jmp .storeResult @@ -1406,7 +1368,6 @@ end macro putByVal(holeCheck, slowPath) traceExecution() - writeBarrierOnOperands(1, 3) loadisFromInstruction(1, t0) loadConstantOrVariableCell(t0, t1, .opPutByValSlow) loadp JSCell::m_structure[t1], t2 @@ -1446,6 +1407,7 @@ macro putByVal(holeCheck, slowPath) contiguousPutByVal( macro (operand, scratch, address) loadConstantOrVariable(operand, scratch) + writeBarrier(scratch) storep scratch, address end) @@ -1456,12 +1418,15 @@ macro putByVal(holeCheck, slowPath) .opPutByValArrayStorageStoreResult: loadisFromInstruction(3, t2) loadConstantOrVariable(t2, t1) + writeBarrier(t1) storeq t1, ArrayStorage::m_vector[t0, t3, 8] dispatch(5) .opPutByValArrayStorageEmpty: - loadpFromInstruction(4, t1) - storeb 1, ArrayProfile::m_mayStoreToHole[t1] + if VALUE_PROFILER + loadpFromInstruction(4, t1) + storeb 1, ArrayProfile::m_mayStoreToHole[t1] + end addi 1, ArrayStorage::m_numValuesInVector[t0] bib t3, -sizeof IndexingHeader + IndexingHeader::u.lengths.publicLength[t0], .opPutByValArrayStorageStoreResult addi 1, t3, t1 @@ -1469,8 +1434,10 @@ macro putByVal(holeCheck, slowPath) jmp .opPutByValArrayStorageStoreResult .opPutByValOutOfBounds: - loadpFromInstruction(4, t0) - storeb 1, ArrayProfile::m_outOfBounds[t0] + if VALUE_PROFILER + loadpFromInstruction(4, t0) + storeb 1, ArrayProfile::m_outOfBounds[t0] + end .opPutByValSlow: callSlowPath(slowPath) dispatch(5) @@ -1692,14 +1659,16 @@ _llint_op_new_captured_func: macro arrayProfileForCall() - loadisFromInstruction(4, t3) - negp t3 - loadq ThisArgumentOffset[cfr, t3, 8], t0 - btqnz t0, tagMask, .done - loadp JSCell::m_structure[t0], t0 - loadpFromInstruction(6, t1) - storep t0, ArrayProfile::m_lastSeenStructure[t1] -.done: + if VALUE_PROFILER + loadisFromInstruction(4, t3) + negp t3 + loadq ThisArgumentOffset[cfr, t3, 8], t0 + btqnz t0, tagMask, .done + loadp JSCell::m_structure[t0], t0 + loadpFromInstruction(6, t1) + storep t0, ArrayProfile::m_lastSeenStructure[t1] + .done: + end end macro doCall(slowPath) @@ -2150,41 +2119,35 @@ _llint_op_put_to_scope: #pGlobalProperty: bineq t0, GlobalProperty, .pGlobalVar - writeBarrierOnOperands(1, 3) loadWithStructureCheck(1, .pDynamic) putProperty() dispatch(7) .pGlobalVar: bineq t0, GlobalVar, .pClosureVar - writeBarrierOnGlobalObject(3) putGlobalVar() dispatch(7) .pClosureVar: bineq t0, ClosureVar, .pGlobalPropertyWithVarInjectionChecks - writeBarrierOnOperands(1, 3) loadVariable(1, t0) putClosureVar() dispatch(7) .pGlobalPropertyWithVarInjectionChecks: bineq t0, GlobalPropertyWithVarInjectionChecks, .pGlobalVarWithVarInjectionChecks - writeBarrierOnOperands(1, 3) loadWithStructureCheck(1, .pDynamic) putProperty() dispatch(7) .pGlobalVarWithVarInjectionChecks: bineq t0, GlobalVarWithVarInjectionChecks, .pClosureVarWithVarInjectionChecks - writeBarrierOnGlobalObject(3) varInjectionCheck(.pDynamic) putGlobalVar() dispatch(7) .pClosureVarWithVarInjectionChecks: bineq t0, ClosureVarWithVarInjectionChecks, .pDynamic - writeBarrierOnOperands(1, 3) varInjectionCheck(.pDynamic) loadVariable(1, t0) putClosureVar() diff --git a/JavaScriptCore/llvm/InitializeLLVMLinux.cpp b/JavaScriptCore/llvm/InitializeLLVMLinux.cpp deleted file mode 100644 index cbbd28f9..00000000 --- a/JavaScriptCore/llvm/InitializeLLVMLinux.cpp +++ /dev/null @@ -1,43 +0,0 @@ -/* - * Copyright (C) 2013 University of Szeged. All rights reserved. - * Copyright (C) 2013 Samsung Electronics. 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 UNIVERSITY OF SZEGED. ``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 "InitializeLLVM.h" - -#if HAVE(LLVM) - -#include "InitializeLLVMPOSIX.h" - -namespace JSC { - -void initializeLLVMImpl() -{ - initializeLLVMPOSIX("libllvmForJSC.so"); -} - -} // namespace JSC - -#endif // HAVE(LLVM) diff --git a/JavaScriptCore/llvm/library/config_llvm.h b/JavaScriptCore/llvm/library/config_llvm.h index 8e3018b4..0c98f718 100644 --- a/JavaScriptCore/llvm/library/config_llvm.h +++ b/JavaScriptCore/llvm/library/config_llvm.h @@ -23,11 +23,6 @@ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -#if defined(HAVE_CONFIG_H) && HAVE_CONFIG_H -#ifdef BUILDING_WITH_CMAKE -#include "cmakeconfig.h" -#endif -#endif #include #include diff --git a/JavaScriptCore/offlineasm/arm.rb b/JavaScriptCore/offlineasm/arm.rb index 7de75ead..a36676ad 100644 --- a/JavaScriptCore/offlineasm/arm.rb +++ b/JavaScriptCore/offlineasm/arm.rb @@ -457,15 +457,9 @@ def lowerARMCommon # FIXME: either support this or remove it. raise "ARM does not support this opcode yet, #{codeOrigin}" when "pop" - operands.each { - | op | - $asm.puts "pop { #{op.armOperand} }" - } + $asm.puts "pop { #{operands[0].armOperand} }" when "push" - operands.each { - | op | - $asm.puts "push { #{op.armOperand} }" - } + $asm.puts "push { #{operands[0].armOperand} }" when "popCalleeSaves" if isARMv7 $asm.puts "pop {r4-r6, r8-r11}" diff --git a/JavaScriptCore/offlineasm/arm64.rb b/JavaScriptCore/offlineasm/arm64.rb index e0a23ff3..1cc3666f 100644 --- a/JavaScriptCore/offlineasm/arm64.rb +++ b/JavaScriptCore/offlineasm/arm64.rb @@ -566,24 +566,11 @@ def lowerARM64 # FIXME: Remove it or support it. raise "ARM64 does not support this opcode yet, #{codeOriginString}" when "pop" - operands.each_slice(2) { - | ops | - # Note that the operands are in the reverse order of the case for push. - # This is due to the fact that order matters for pushing and popping, and - # on platforms that only push/pop one slot at a time they pop their - # arguments in the reverse order that they were pushed. In order to remain - # compatible with those platforms we assume here that that's what has been done. - - # So for example, if we did push(A, B, C, D), we would then pop(D, C, B, A). - # But since the ordering of arguments doesn't change on arm64 between the stp and ldp - # instructions we need to flip flop the argument positions that were passed to us. - $asm.puts "ldp #{ops[1].arm64Operand(:ptr)}, #{ops[0].arm64Operand(:ptr)}, [sp], #16" - } + # FIXME: Remove it or support it. + raise "ARM64 does not support this opcode yet, #{codeOriginString}" when "push" - operands.each_slice(2) { - | ops | - $asm.puts "stp #{ops[0].arm64Operand(:ptr)}, #{ops[1].arm64Operand(:ptr)}, [sp, #-16]!" - } + # FIXME: Remove it or support it. + raise "ARM64 does not support this opcode yet, #{codeOriginString}" when "popLRAndFP" $asm.puts "ldp fp, lr, [sp], #16" when "pushLRAndFP" diff --git a/JavaScriptCore/offlineasm/mips.rb b/JavaScriptCore/offlineasm/mips.rb index 686f58f1..8fc96be7 100644 --- a/JavaScriptCore/offlineasm/mips.rb +++ b/JavaScriptCore/offlineasm/mips.rb @@ -839,17 +839,11 @@ def lowerMIPS # FIXME: either support this or remove it. raise "MIPS does not support this opcode yet, #{codeOrigin}" when "pop" - operands.each { - | op | - $asm.puts "lw #{op.mipsOperand}, 0($sp)" - $asm.puts "addiu $sp, $sp, 4" - } + $asm.puts "lw #{operands[0].mipsOperand}, 0($sp)" + $asm.puts "addiu $sp, $sp, 4" when "push" - operands.each { - | op | - $asm.puts "addiu $sp, $sp, -4" - $asm.puts "sw #{op.mipsOperand}, 0($sp)" - } + $asm.puts "addiu $sp, $sp, -4" + $asm.puts "sw #{operands[0].mipsOperand}, 0($sp)" when "popCalleeSaves" $asm.puts "lw $16, 0($sp)" $asm.puts "lw $17, 4($sp)" diff --git a/JavaScriptCore/offlineasm/x86.rb b/JavaScriptCore/offlineasm/x86.rb index e47f2956..a5ab63bb 100644 --- a/JavaScriptCore/offlineasm/x86.rb +++ b/JavaScriptCore/offlineasm/x86.rb @@ -100,7 +100,7 @@ def x86Operand(kind) when :quad isX64 ? "%rax" : raise else - raise "Invalid kind #{kind} for name #{name}" + raise end when "t1", "a1", "r1" case kind @@ -978,15 +978,9 @@ def lowerX86Common $asm.puts "xorpd #{operands[0].x86Operand(:double)}, #{operands[0].x86Operand(:double)}" end when "pop" - operands.each { - | op | - $asm.puts "pop #{op.x86Operand(:ptr)}" - } + $asm.puts "pop #{operands[0].x86Operand(:ptr)}" when "push" - operands.each { - | op | - $asm.puts "push #{op.x86Operand(:ptr)}" - } + $asm.puts "push #{operands[0].x86Operand(:ptr)}" when "popCalleeSaves" if isX64 $asm.puts "pop %rbx" diff --git a/JavaScriptCore/parser/Parser.cpp b/JavaScriptCore/parser/Parser.cpp index f856baf5..e2fa93de 100644 --- a/JavaScriptCore/parser/Parser.cpp +++ b/JavaScriptCore/parser/Parser.cpp @@ -660,7 +660,6 @@ template TreeConstDeclList Parser::parseConstDecl if (hasInitializer) { next(TreeBuilder::DontBuildStrings); // consume '=' initializer = parseAssignmentExpression(context); - failIfFalse(!!initializer, "Unable to parse initializer"); } tail = context.appendConstDecl(location, tail, name, initializer); if (!constDecls) diff --git a/JavaScriptCore/profiler/ProfilerBytecodeSequence.cpp b/JavaScriptCore/profiler/ProfilerBytecodeSequence.cpp index 838153be..d00e371a 100644 --- a/JavaScriptCore/profiler/ProfilerBytecodeSequence.cpp +++ b/JavaScriptCore/profiler/ProfilerBytecodeSequence.cpp @@ -38,6 +38,7 @@ BytecodeSequence::BytecodeSequence(CodeBlock* codeBlock) { StringPrintStream out; +#if ENABLE(VALUE_PROFILER) for (unsigned i = 0; i < codeBlock->numberOfArgumentValueProfiles(); ++i) { ConcurrentJITLocker locker(codeBlock->m_lock); CString description = codeBlock->valueProfileForArgument(i)->briefDescription(locker); @@ -47,6 +48,7 @@ BytecodeSequence::BytecodeSequence(CodeBlock* codeBlock) out.print("arg", i, " (r", virtualRegisterForArgument(i).offset(), "): ", description); m_header.append(out.toCString()); } +#endif // ENABLE(VALUE_PROFILER) for (unsigned bytecodeIndex = 0; bytecodeIndex < codeBlock->instructions().size();) { out.reset(); diff --git a/JavaScriptCore/runtime/CommonIdentifiers.h b/JavaScriptCore/runtime/CommonIdentifiers.h index e8f9ed82..bf75c218 100644 --- a/JavaScriptCore/runtime/CommonIdentifiers.h +++ b/JavaScriptCore/runtime/CommonIdentifiers.h @@ -212,11 +212,7 @@ macro(reject) \ macro(promise) \ macro(fulfillmentHandler) \ - macro(rejectionHandler) \ - macro(index) \ - macro(values) \ - macro(deferred) \ - macro(countdownHolder) + macro(rejectionHandler) namespace JSC { diff --git a/JavaScriptCore/runtime/CommonSlowPaths.cpp b/JavaScriptCore/runtime/CommonSlowPaths.cpp index f6a142e6..a6504921 100644 --- a/JavaScriptCore/runtime/CommonSlowPaths.cpp +++ b/JavaScriptCore/runtime/CommonSlowPaths.cpp @@ -124,6 +124,7 @@ namespace JSC { END_IMPL(); \ } while (false) +#if ENABLE(VALUE_PROFILER) #define RETURN_PROFILED(opcode, value) do { \ JSValue rpPeturnValue = (value); \ CHECK_EXCEPTION(); \ @@ -137,6 +138,13 @@ namespace JSC { JSValue::encode(value); \ } while (false) +#else // ENABLE(VALUE_PROFILER) +#define RETURN_PROFILED(opcode, value) RETURN(value) + +#define PROFILE_VALUE(opcode, value) do { } while (false) + +#endif // ENABLE(VALUE_PROFILER) + #define CALL_END_IMPL(exec, callTarget) RETURN_TWO((callTarget), (exec)) #define CALL_THROW(exec, pc, exceptionToThrow) do { \ diff --git a/JavaScriptCore/runtime/GCActivityCallback.cpp b/JavaScriptCore/runtime/GCActivityCallback.cpp index e1cc9886..c4bf7390 100644 --- a/JavaScriptCore/runtime/GCActivityCallback.cpp +++ b/JavaScriptCore/runtime/GCActivityCallback.cpp @@ -95,7 +95,7 @@ void DefaultGCActivityCallback::doWork() return; } #endif - heap->collect(); + heap->collect(Heap::DoNotSweep); } #if USE(CF) diff --git a/JavaScriptCore/runtime/GCActivityCallbackBlackBerry.cpp b/JavaScriptCore/runtime/GCActivityCallbackBlackBerry.cpp new file mode 100644 index 00000000..d7c9d53c --- /dev/null +++ b/JavaScriptCore/runtime/GCActivityCallbackBlackBerry.cpp @@ -0,0 +1,58 @@ +/* + * Copyright (C) 2012 Research In Motion Limited. All rights reserved. + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + */ + +#include "config.h" +#include "GCActivityCallback.h" + +#include "Heap.h" +#include "VM.h" +#include + +namespace JSC { + +DefaultGCActivityCallback::DefaultGCActivityCallback(Heap* heap) + : GCActivityCallback(heap->vm()) +{ +} + +void DefaultGCActivityCallback::doWork() +{ + JSLockHolder lock(m_vm); + m_vm->heap.collect(Heap::DoNotSweep); +} + +void DefaultGCActivityCallback::didAllocate(size_t) +{ + if (m_timer.started()) + return; + + // Try using ~5% CPU time. + m_timer.start(m_vm->heap.lastGCLength() * 20); +} + +void DefaultGCActivityCallback::willCollect() +{ + cancel(); +} + +void DefaultGCActivityCallback::cancel() +{ + m_timer.stop(); +} + +} diff --git a/JavaScriptCore/runtime/JSGenericTypedArrayViewConstructorInlines.h b/JavaScriptCore/runtime/JSGenericTypedArrayViewConstructorInlines.h index 2ddc29f7..870395a6 100644 --- a/JavaScriptCore/runtime/JSGenericTypedArrayViewConstructorInlines.h +++ b/JavaScriptCore/runtime/JSGenericTypedArrayViewConstructorInlines.h @@ -157,7 +157,7 @@ template CallType JSGenericTypedArrayViewConstructor::getCallData(JSCell*, CallData& callData) { callData.native.function = constructGenericTypedArrayView; - return CallTypeNone; + return CallTypeHost; } } // namespace JSC diff --git a/JavaScriptCore/runtime/JSGenericTypedArrayViewInlines.h b/JavaScriptCore/runtime/JSGenericTypedArrayViewInlines.h index 6db86274..e920abef 100644 --- a/JavaScriptCore/runtime/JSGenericTypedArrayViewInlines.h +++ b/JavaScriptCore/runtime/JSGenericTypedArrayViewInlines.h @@ -447,7 +447,7 @@ void JSGenericTypedArrayView::visitChildren(JSCell* cell, SlotVisitor& } case OversizeTypedArray: { - visitor.reportExtraMemoryUsage(thisObject, thisObject->byteSize()); + visitor.reportExtraMemoryUsage(thisObject->byteSize()); break; } diff --git a/JavaScriptCore/runtime/JSGlobalObjectDebuggable.cpp b/JavaScriptCore/runtime/JSGlobalObjectDebuggable.cpp index c933aa6a..b28f312e 100644 --- a/JavaScriptCore/runtime/JSGlobalObjectDebuggable.cpp +++ b/JavaScriptCore/runtime/JSGlobalObjectDebuggable.cpp @@ -28,7 +28,6 @@ #if ENABLE(REMOTE_INSPECTOR) -#include "APIShims.h" #include "InspectorFrontendChannel.h" #include "JSGlobalObject.h" #include "RemoteInspector.h" @@ -42,40 +41,29 @@ JSGlobalObjectDebuggable::JSGlobalObjectDebuggable(JSGlobalObject& globalObject) { } -JSGlobalObjectDebuggable::~JSGlobalObjectDebuggable() -{ - if (m_inspectorController) - disconnect(); -} - String JSGlobalObjectDebuggable::name() const { String name = m_globalObject.name(); return name.isEmpty() ? ASCIILiteral("JSContext") : name; } -void JSGlobalObjectDebuggable::connect(InspectorFrontendChannel* frontendChannel) +void JSGlobalObjectDebuggable::connect(InspectorFrontendChannel*) { - APIEntryShim entryShim(&m_globalObject.vm()); - - ASSERT(!m_inspectorController); - m_inspectorController = std::make_unique(m_globalObject); - m_inspectorController->connectFrontend(frontendChannel); + // FIXME: Implement. + // Create an InspectorController, InspectorFrontend, InspectorBackend, and Agents. + // "InspectorController::connectFrontend". } void JSGlobalObjectDebuggable::disconnect() { - APIEntryShim entryShim(&m_globalObject.vm()); - - m_inspectorController->disconnectFrontend(); - m_inspectorController = nullptr; + // FIXME: Implement. + // "InspectorController::disconnectFrontend". } -void JSGlobalObjectDebuggable::dispatchMessageFromRemoteFrontend(const String& message) +void JSGlobalObjectDebuggable::dispatchMessageFromRemoteFrontend(const String&) { - APIEntryShim entryShim(&m_globalObject.vm()); - - m_inspectorController->dispatchMessageFromFrontend(message); + // FIXME: Implement. + // "InspectorController::dispatchMessageFromFrontend" } } // namespace JSC diff --git a/JavaScriptCore/runtime/JSGlobalObjectDebuggable.h b/JavaScriptCore/runtime/JSGlobalObjectDebuggable.h index 9371cce9..6f2d9ee7 100644 --- a/JavaScriptCore/runtime/JSGlobalObjectDebuggable.h +++ b/JavaScriptCore/runtime/JSGlobalObjectDebuggable.h @@ -28,7 +28,6 @@ #if ENABLE(REMOTE_INSPECTOR) -#include "JSGlobalObjectInspectorController.h" #include "RemoteInspectorDebuggable.h" #include @@ -40,7 +39,7 @@ class JSGlobalObjectDebuggable FINAL : public Inspector::RemoteInspectorDebuggab WTF_MAKE_NONCOPYABLE(JSGlobalObjectDebuggable); public: JSGlobalObjectDebuggable(JSGlobalObject&); - ~JSGlobalObjectDebuggable(); + ~JSGlobalObjectDebuggable() { } virtual Inspector::RemoteInspectorDebuggable::DebuggableType type() const OVERRIDE { return Inspector::RemoteInspectorDebuggable::JavaScript; } @@ -53,7 +52,6 @@ class JSGlobalObjectDebuggable FINAL : public Inspector::RemoteInspectorDebuggab private: JSGlobalObject& m_globalObject; - std::unique_ptr m_inspectorController; }; } // namespace JSC diff --git a/JavaScriptCore/runtime/JSGlobalObjectFunctions.cpp b/JavaScriptCore/runtime/JSGlobalObjectFunctions.cpp index 9132d327..9200567e 100644 --- a/JavaScriptCore/runtime/JSGlobalObjectFunctions.cpp +++ b/JavaScriptCore/runtime/JSGlobalObjectFunctions.cpp @@ -308,7 +308,7 @@ static double parseInt(const String& s, const CharType* data, int radix) if (number >= mantissaOverflowLowerBound) { if (radix == 10) { size_t parsedLength; - number = parseDouble(s.deprecatedCharacters() + firstDigitPosition, p - firstDigitPosition, parsedLength); + number = parseDouble(s.characters() + firstDigitPosition, p - firstDigitPosition, parsedLength); } else if (radix == 2 || radix == 4 || radix == 8 || radix == 16 || radix == 32) number = parseIntOverflow(s.substringSharingImpl(firstDigitPosition, p - firstDigitPosition).utf8().data(), p - firstDigitPosition, radix); } diff --git a/JavaScriptCore/runtime/JSPromiseConstructor.cpp b/JavaScriptCore/runtime/JSPromiseConstructor.cpp index e30ef326..3157ebee 100644 --- a/JavaScriptCore/runtime/JSPromiseConstructor.cpp +++ b/JavaScriptCore/runtime/JSPromiseConstructor.cpp @@ -36,7 +36,6 @@ #include "JSPromiseFunctions.h" #include "JSPromisePrototype.h" #include "Lookup.h" -#include "NumberObject.h" #include "StructureInlines.h" namespace JSC { @@ -47,7 +46,6 @@ static EncodedJSValue JSC_HOST_CALL JSPromiseConstructorFuncCast(ExecState*); static EncodedJSValue JSC_HOST_CALL JSPromiseConstructorFuncResolve(ExecState*); static EncodedJSValue JSC_HOST_CALL JSPromiseConstructorFuncReject(ExecState*); static EncodedJSValue JSC_HOST_CALL JSPromiseConstructorFuncRace(ExecState*); -static EncodedJSValue JSC_HOST_CALL JSPromiseConstructorFuncAll(ExecState*); } #include "JSPromiseConstructor.lut.h" @@ -62,7 +60,6 @@ const ClassInfo JSPromiseConstructor::s_info = { "Function", &InternalFunction:: resolve JSPromiseConstructorFuncResolve DontEnum|Function 1 reject JSPromiseConstructorFuncReject DontEnum|Function 1 race JSPromiseConstructorFuncRace DontEnum|Function 1 - all JSPromiseConstructorFuncAll DontEnum|Function 1 @end */ @@ -153,10 +150,10 @@ ConstructType JSPromiseConstructor::getConstructData(JSCell*, ConstructData& con return ConstructTypeHost; } -CallType JSPromiseConstructor::getCallData(JSCell*, CallData& callData) +CallType JSPromiseConstructor::getCallData(JSCell*, CallData&) { - callData.native.function = constructPromise; - return CallTypeHost; + // FIXME: Implement + return CallTypeNone; } bool JSPromiseConstructor::getOwnPropertySlot(JSObject* object, ExecState* exec, PropertyName propertyName, PropertySlot& slot) @@ -194,7 +191,17 @@ EncodedJSValue JSC_HOST_CALL JSPromiseConstructorFuncCast(ExecState* exec) // 5. Let 'resolveResult' be the result of calling the [[Call]] internal method // of deferred.[[Resolve]] with undefined as thisArgument and a List containing x // as argumentsList. - performDeferredResolve(exec, deferred, x); + + JSValue deferredResolve = deferred->resolve(); + + CallData resolveCallData; + CallType resolveCallType = getCallData(deferredResolve, resolveCallData); + ASSERT(resolveCallType != CallTypeNone); + + MarkedArgumentBuffer arguments; + arguments.append(x); + + call(exec, deferredResolve, resolveCallType, resolveCallData, jsUndefined(), arguments); // 6. ReturnIfAbrupt(resolveResult). if (exec->hadException()) @@ -224,7 +231,17 @@ EncodedJSValue JSC_HOST_CALL JSPromiseConstructorFuncResolve(ExecState* exec) // 4. Let 'resolveResult' be the result of calling the [[Call]] internal method // of deferred.[[Resolve]] with undefined as thisArgument and a List containing x // as argumentsList. - performDeferredResolve(exec, deferred, x); + + JSValue deferredResolve = deferred->resolve(); + + CallData resolveCallData; + CallType resolveCallType = getCallData(deferredResolve, resolveCallData); + ASSERT(resolveCallType != CallTypeNone); + + MarkedArgumentBuffer arguments; + arguments.append(x); + + call(exec, deferredResolve, resolveCallType, resolveCallData, jsUndefined(), arguments); // 5. ReturnIfAbrupt(resolveResult). if (exec->hadException()) @@ -254,7 +271,17 @@ EncodedJSValue JSC_HOST_CALL JSPromiseConstructorFuncReject(ExecState* exec) // 4. Let 'rejectResult' be the result of calling the [[Call]] internal method // of deferred.[[Reject]] with undefined as thisArgument and a List containing r // as argumentsList. - performDeferredReject(exec, deferred, r); + + JSValue deferredReject = deferred->reject(); + + CallData rejectCallData; + CallType rejectCallType = getCallData(deferredReject, rejectCallData); + ASSERT(rejectCallType != CallTypeNone); + + MarkedArgumentBuffer arguments; + arguments.append(r); + + call(exec, deferredReject, rejectCallType, rejectCallData, jsUndefined(), arguments); // 5. ReturnIfAbrupt(resolveResult). if (exec->hadException()) @@ -264,122 +291,37 @@ EncodedJSValue JSC_HOST_CALL JSPromiseConstructorFuncReject(ExecState* exec) return JSValue::encode(deferred->promise()); } -EncodedJSValue JSC_HOST_CALL JSPromiseConstructorFuncRace(ExecState* exec) +static JSValue abruptRejection(ExecState* exec, JSPromiseDeferred* deferred) { - // -- Promise.race(iterable) -- - JSValue iterable = exec->argument(0); - VM& vm = exec->vm(); + ASSERT(exec->hadException()); + JSValue argument = exec->exception(); + exec->clearException(); - // 1. Let 'C' be the this value. - JSValue C = exec->thisValue(); + // i. Let 'rejectResult' be the result of calling the [[Call]] internal method + // of deferred.[[Reject]] with undefined as thisArgument and a List containing + // argument.[[value]] as argumentsList. + JSValue deferredReject = deferred->reject(); - // 2. Let 'deferred' be the result of calling GetDeferred(C). - JSValue deferredValue = createJSPromiseDeferredFromConstructor(exec, C); - - // 3. ReturnIfAbrupt(deferred). - if (exec->hadException()) - return JSValue::encode(jsUndefined()); + CallData rejectCallData; + CallType rejectCallType = getCallData(deferredReject, rejectCallData); + ASSERT(rejectCallType != CallTypeNone); - JSPromiseDeferred* deferred = jsCast(deferredValue); - - // 4. Let 'iterator' be the result of calling GetIterator(iterable). - JSValue iteratorFunction = iterable.get(exec, vm.propertyNames->iteratorPrivateName); - if (exec->hadException()) - return JSValue::encode(abruptRejection(exec, deferred)); - - CallData iteratorFunctionCallData; - CallType iteratorFunctionCallType = getCallData(iteratorFunction, iteratorFunctionCallData); - if (iteratorFunctionCallType == CallTypeNone) { - throwTypeError(exec); - return JSValue::encode(abruptRejection(exec, deferred)); - } + MarkedArgumentBuffer arguments; + arguments.append(argument); - ArgList iteratorFunctionArguments; - JSValue iterator = call(exec, iteratorFunction, iteratorFunctionCallType, iteratorFunctionCallData, iterable, iteratorFunctionArguments); + call(exec, deferredReject, rejectCallType, rejectCallData, jsUndefined(), arguments); - // 5. RejectIfAbrupt(iterator, deferred). + // ii. ReturnIfAbrupt(rejectResult). if (exec->hadException()) - return JSValue::encode(abruptRejection(exec, deferred)); - - // 6. Repeat - do { - // i. Let 'next' be the result of calling IteratorStep(iterator). - JSValue nextFunction = iterator.get(exec, exec->vm().propertyNames->iteratorNextPrivateName); - if (exec->hadException()) - return JSValue::encode(abruptRejection(exec, deferred)); - - CallData nextFunctionCallData; - CallType nextFunctionCallType = getCallData(nextFunction, nextFunctionCallData); - if (nextFunctionCallType == CallTypeNone) { - throwTypeError(exec); - return JSValue::encode(abruptRejection(exec, deferred)); - } - - MarkedArgumentBuffer nextFunctionArguments; - nextFunctionArguments.append(jsUndefined()); - JSValue next = call(exec, nextFunction, nextFunctionCallType, nextFunctionCallData, iterator, nextFunctionArguments); - - // ii. RejectIfAbrupt(next, deferred). - if (exec->hadException()) - return JSValue::encode(abruptRejection(exec, deferred)); - - // iii. If 'next' is false, return deferred.[[Promise]]. - // Note: We implement this as an iterationTerminator - if (next == vm.iterationTerminator.get()) - return JSValue::encode(deferred->promise()); - - // iv. Let 'nextValue' be the result of calling IteratorValue(next). - // v. RejectIfAbrupt(nextValue, deferred). - // Note: 'next' is already the value, so there is nothing to do here. - - // vi. Let 'nextPromise' be the result of calling Invoke(C, "cast", (nextValue)). - JSValue castFunction = C.get(exec, vm.propertyNames->cast); - if (exec->hadException()) - return JSValue::encode(abruptRejection(exec, deferred)); - - CallData castFunctionCallData; - CallType castFunctionCallType = getCallData(castFunction, castFunctionCallData); - if (castFunctionCallType == CallTypeNone) { - throwTypeError(exec); - return JSValue::encode(abruptRejection(exec, deferred)); - } - - MarkedArgumentBuffer castFunctionArguments; - castFunctionArguments.append(next); - JSValue nextPromise = call(exec, castFunction, castFunctionCallType, castFunctionCallData, C, castFunctionArguments); - - // vii. RejectIfAbrupt(nextPromise, deferred). - if (exec->hadException()) - return JSValue::encode(abruptRejection(exec, deferred)); - - // viii. Let 'result' be the result of calling Invoke(nextPromise, "then", (deferred.[[Resolve]], deferred.[[Reject]])). - JSValue thenFunction = nextPromise.get(exec, vm.propertyNames->then); - if (exec->hadException()) - return JSValue::encode(abruptRejection(exec, deferred)); - - CallData thenFunctionCallData; - CallType thenFunctionCallType = getCallData(thenFunction, thenFunctionCallData); - if (thenFunctionCallType == CallTypeNone) { - throwTypeError(exec); - return JSValue::encode(abruptRejection(exec, deferred)); - } - - MarkedArgumentBuffer thenFunctionArguments; - thenFunctionArguments.append(deferred->resolve()); - thenFunctionArguments.append(deferred->reject()); - - call(exec, thenFunction, thenFunctionCallType, thenFunctionCallData, nextPromise, thenFunctionArguments); + return jsUndefined(); - // ix. RejectIfAbrupt(result, deferred). - if (exec->hadException()) - return JSValue::encode(abruptRejection(exec, deferred)); - } while (true); + // iii. Return deferred.[[Promise]]. + return deferred->promise(); } -EncodedJSValue JSC_HOST_CALL JSPromiseConstructorFuncAll(ExecState* exec) +EncodedJSValue JSC_HOST_CALL JSPromiseConstructorFuncRace(ExecState* exec) { - // -- Promise.all(iterable) -- - + // -- Promise.race(iterable) -- JSValue iterable = exec->argument(0); VM& vm = exec->vm(); @@ -393,9 +335,6 @@ EncodedJSValue JSC_HOST_CALL JSPromiseConstructorFuncAll(ExecState* exec) if (exec->hadException()) return JSValue::encode(jsUndefined()); - // NOTE: A non-abrupt completion of createJSPromiseDeferredFromConstructor implies that - // C and deferredValue are objects. - JSObject* thisObject = asObject(C); JSPromiseDeferred* deferred = jsCast(deferredValue); // 4. Let 'iterator' be the result of calling GetIterator(iterable). @@ -417,16 +356,7 @@ EncodedJSValue JSC_HOST_CALL JSPromiseConstructorFuncAll(ExecState* exec) if (exec->hadException()) return JSValue::encode(abruptRejection(exec, deferred)); - // 6. Let 'values' be the result of calling ArrayCreate(0). - JSArray* values = constructEmptyArray(exec, nullptr, thisObject->globalObject()); - - // 7. Let 'countdownHolder' be Record { [[Countdown]]: 0 }. - NumberObject* countdownHolder = constructNumber(exec, thisObject->globalObject(), JSValue(0)); - - // 8. Let 'index' be 0. - unsigned index = 0; - - // 9. Repeat. + // 6. Repeat do { // i. Let 'next' be the result of calling IteratorStep(iterator). JSValue nextFunction = iterator.get(exec, exec->vm().propertyNames->iteratorNextPrivateName); @@ -447,25 +377,11 @@ EncodedJSValue JSC_HOST_CALL JSPromiseConstructorFuncAll(ExecState* exec) // ii. RejectIfAbrupt(next, deferred). if (exec->hadException()) return JSValue::encode(abruptRejection(exec, deferred)); - - // iii. If 'next' is false, + + // iii. If 'next' is false, return deferred.[[Promise]]. // Note: We implement this as an iterationTerminator - if (next == vm.iterationTerminator.get()) { - // a. If 'index' is 0, - if (!index) { - // a. Let 'resolveResult' be the result of calling the [[Call]] internal method - // of deferred.[[Resolve]] with undefined as thisArgument and a List containing - // values as argumentsList. - performDeferredResolve(exec, deferred, values); - - // b. ReturnIfAbrupt(resolveResult). - if (exec->hadException()) - return JSValue::encode(jsUndefined()); - } - - // b. Return deferred.[[Promise]]. + if (next == vm.iterationTerminator.get()) return JSValue::encode(deferred->promise()); - } // iv. Let 'nextValue' be the result of calling IteratorValue(next). // v. RejectIfAbrupt(nextValue, deferred). @@ -491,22 +407,7 @@ EncodedJSValue JSC_HOST_CALL JSPromiseConstructorFuncAll(ExecState* exec) if (exec->hadException()) return JSValue::encode(abruptRejection(exec, deferred)); - // viii. Let 'countdownFunction' be a new built-in function object as defined in Promise.all Countdown Functions. - JSFunction* countdownFunction = createPromiseAllCountdownFunction(vm, thisObject->globalObject()); - - // ix. Set the [[Index]] internal slot of 'countdownFunction' to 'index'. - countdownFunction->putDirect(vm, vm.propertyNames->indexPrivateName, JSValue(index)); - - // x. Set the [[Values]] internal slot of 'countdownFunction' to 'values'. - countdownFunction->putDirect(vm, vm.propertyNames->valuesPrivateName, values); - - // xi. Set the [[Deferred]] internal slot of 'countdownFunction' to 'deferred'. - countdownFunction->putDirect(vm, vm.propertyNames->deferredPrivateName, deferred); - - // xii. Set the [[CountdownHolder]] internal slot of 'countdownFunction' to 'countdownHolder'. - countdownFunction->putDirect(vm, vm.propertyNames->countdownHolderPrivateName, countdownHolder); - - // xiii. Let 'result' be the result of calling Invoke(nextPromise, "then", (countdownFunction, deferred.[[Reject]])). + // viii. Let 'result' be the result of calling Invoke(nextPromise, "then", (deferred.[[Resolve]], deferred.[[Reject]])). JSValue thenFunction = nextPromise.get(exec, vm.propertyNames->then); if (exec->hadException()) return JSValue::encode(abruptRejection(exec, deferred)); @@ -519,21 +420,14 @@ EncodedJSValue JSC_HOST_CALL JSPromiseConstructorFuncAll(ExecState* exec) } MarkedArgumentBuffer thenFunctionArguments; - thenFunctionArguments.append(countdownFunction); + thenFunctionArguments.append(deferred->resolve()); thenFunctionArguments.append(deferred->reject()); call(exec, thenFunction, thenFunctionCallType, thenFunctionCallData, nextPromise, thenFunctionArguments); - // xiv. RejectIfAbrupt(result, deferred). + // ix. RejectIfAbrupt(result, deferred). if (exec->hadException()) return JSValue::encode(abruptRejection(exec, deferred)); - - // xv. Set index to index + 1. - index++; - - // xvi. Set countdownHolder.[[Countdown]] to countdownHolder.[[Countdown]] + 1. - uint32_t newCountdownValue = countdownHolder->internalValue().asUInt32() + 1; - countdownHolder->setInternalValue(vm, JSValue(newCountdownValue)); } while (true); } diff --git a/JavaScriptCore/runtime/JSPromiseDeferred.cpp b/JavaScriptCore/runtime/JSPromiseDeferred.cpp index cbc42eb9..e4ccc1f6 100644 --- a/JavaScriptCore/runtime/JSPromiseDeferred.cpp +++ b/JavaScriptCore/runtime/JSPromiseDeferred.cpp @@ -152,7 +152,16 @@ ThenableStatus updateDeferredFromPotentialThenable(ExecState* exec, JSValue x, J JSValue exception = exec->exception(); exec->clearException(); - performDeferredReject(exec, deferred, exception); + JSValue deferredReject = deferred->reject(); + + CallData rejectCallData; + CallType rejectCallType = getCallData(deferredReject, rejectCallData); + ASSERT(rejectCallType != CallTypeNone); + + MarkedArgumentBuffer rejectArguments; + rejectArguments.append(exception); + + call(exec, deferredReject, rejectCallType, rejectCallData, jsUndefined(), rejectArguments); // ii. ReturnIfAbrupt(rejectResult). // NOTE: Nothing to do. @@ -187,7 +196,16 @@ ThenableStatus updateDeferredFromPotentialThenable(ExecState* exec, JSValue x, J JSValue exception = exec->exception(); exec->clearException(); - performDeferredReject(exec, deferred, exception); + JSValue deferredReject = deferred->reject(); + + CallData rejectCallData; + CallType rejectCallType = getCallData(deferredReject, rejectCallData); + ASSERT(rejectCallType != CallTypeNone); + + MarkedArgumentBuffer rejectArguments; + rejectArguments.append(exception); + + call(exec, deferredReject, rejectCallType, rejectCallData, jsUndefined(), rejectArguments); // ii. ReturnIfAbrupt(rejectResult). // NOTE: Nothing to do. @@ -196,51 +214,4 @@ ThenableStatus updateDeferredFromPotentialThenable(ExecState* exec, JSValue x, J return WasAThenable; } -void performDeferredResolve(ExecState* exec, JSPromiseDeferred* deferred, JSValue argument) -{ - JSValue deferredResolve = deferred->resolve(); - - CallData resolveCallData; - CallType resolveCallType = getCallData(deferredResolve, resolveCallData); - ASSERT(resolveCallType != CallTypeNone); - - MarkedArgumentBuffer arguments; - arguments.append(argument); - - call(exec, deferredResolve, resolveCallType, resolveCallData, jsUndefined(), arguments); -} - -void performDeferredReject(ExecState* exec, JSPromiseDeferred* deferred, JSValue argument) -{ - JSValue deferredReject = deferred->reject(); - - CallData rejectCallData; - CallType rejectCallType = getCallData(deferredReject, rejectCallData); - ASSERT(rejectCallType != CallTypeNone); - - MarkedArgumentBuffer arguments; - arguments.append(argument); - - call(exec, deferredReject, rejectCallType, rejectCallData, jsUndefined(), arguments); -} - -JSValue abruptRejection(ExecState* exec, JSPromiseDeferred* deferred) -{ - ASSERT(exec->hadException()); - JSValue argument = exec->exception(); - exec->clearException(); - - // i. Let 'rejectResult' be the result of calling the [[Call]] internal method - // of deferred.[[Reject]] with undefined as thisArgument and a List containing - // argument.[[value]] as argumentsList. - performDeferredReject(exec, deferred, argument); - - // ii. ReturnIfAbrupt(rejectResult). - if (exec->hadException()) - return jsUndefined(); - - // iii. Return deferred.[[Promise]]. - return deferred->promise(); -} - } // namespace JSC diff --git a/JavaScriptCore/runtime/JSPromiseDeferred.h b/JavaScriptCore/runtime/JSPromiseDeferred.h index ff509d77..77024cff 100644 --- a/JavaScriptCore/runtime/JSPromiseDeferred.h +++ b/JavaScriptCore/runtime/JSPromiseDeferred.h @@ -70,11 +70,6 @@ enum ThenableStatus { JSValue createJSPromiseDeferredFromConstructor(ExecState*, JSValue constructor); ThenableStatus updateDeferredFromPotentialThenable(ExecState*, JSValue, JSPromiseDeferred*); -void performDeferredResolve(ExecState*, JSPromiseDeferred*, JSValue argument); -void performDeferredReject(ExecState*, JSPromiseDeferred*, JSValue argument); - -JSValue abruptRejection(ExecState*, JSPromiseDeferred*); - } // namespace JSC #endif // JSPromiseDeferred_h diff --git a/JavaScriptCore/runtime/JSPromiseFunctions.cpp b/JavaScriptCore/runtime/JSPromiseFunctions.cpp index 139d280e..95490b97 100644 --- a/JavaScriptCore/runtime/JSPromiseFunctions.cpp +++ b/JavaScriptCore/runtime/JSPromiseFunctions.cpp @@ -34,7 +34,6 @@ #include "JSPromise.h" #include "JSPromiseConstructor.h" #include "JSPromiseDeferred.h" -#include "NumberObject.h" namespace JSC { @@ -72,55 +71,6 @@ JSFunction* createIdentifyFunction(VM& vm, JSGlobalObject* globalObject) return JSFunction::create(vm, globalObject, 1, ASCIILiteral("IdentityFunction"), identifyFunction); } -// Promise.All Countdown Functions - -static EncodedJSValue JSC_HOST_CALL promiseAllCountdownFunction(ExecState* exec) -{ - JSValue x = exec->argument(0); - VM& vm = exec->vm(); - JSObject* F = exec->callee(); - - // 1. Let 'index' be the value of F's [[Index]] internal slot. - uint32_t index = F->get(exec, vm.propertyNames->indexPrivateName).asUInt32(); - - // 2. Let 'values' be the value of F's [[Values]] internal slot.. - JSArray* values = jsCast(F->get(exec, vm.propertyNames->valuesPrivateName)); - - // 3. Let 'deferred' be the value of F's [[Deferred]] internal slot. - JSPromiseDeferred* deferred = jsCast(F->get(exec, vm.propertyNames->deferredPrivateName)); - - // 4. Let 'countdownHolder' be the value of F's [[CountdownHolder]] internal slot. - NumberObject* countdownHolder = jsCast(F->get(exec, vm.propertyNames->countdownHolderPrivateName)); - - // 5. Let 'result' be the result of calling the [[DefineOwnProperty]] internal method - // of 'values' with arguments 'index' and Property Descriptor { [[Value]]: x, - // [[Writable]]: true, [[Enumerable]]: true, [[Configurable]]: true }. - values->putDirectIndex(exec, index, x); - - // 6. RejectIfAbrupt(result, deferred). - if (exec->hadException()) - abruptRejection(exec, deferred); - - // 7. Set countdownHolder.[[Countdown]] to countdownHolder.[[Countdown]] - 1. - uint32_t newCountdownValue = countdownHolder->internalValue().asUInt32() - 1; - countdownHolder->setInternalValue(vm, JSValue(newCountdownValue)); - - // 8. If countdownHolder.[[Countdown]] is 0, - if (!newCountdownValue) { - // i. Return the result of calling the [[Call]] internal method of deferred.[[Resolve]] - // with undefined as thisArgument and a List containing 'values' as argumentsList. - performDeferredResolve(exec, deferred, values); - } - - // 9. Return. - return JSValue::encode(jsUndefined()); -} - -JSFunction* createPromiseAllCountdownFunction(VM& vm, JSGlobalObject* globalObject) -{ - return JSFunction::create(vm, globalObject, 1, ASCIILiteral("PromiseAllCountdownFunction"), promiseAllCountdownFunction); -} - // Promise Resolution Handler Functions static EncodedJSValue JSC_HOST_CALL promiseResolutionHandlerFunction(ExecState* exec) diff --git a/JavaScriptCore/runtime/JSPromiseFunctions.h b/JavaScriptCore/runtime/JSPromiseFunctions.h index 80212190..e41fd65e 100644 --- a/JavaScriptCore/runtime/JSPromiseFunctions.h +++ b/JavaScriptCore/runtime/JSPromiseFunctions.h @@ -34,7 +34,6 @@ namespace JSC { JSFunction* createDeferredConstructionFunction(VM&, JSGlobalObject*); JSFunction* createIdentifyFunction(VM&, JSGlobalObject*); -JSFunction* createPromiseAllCountdownFunction(VM&, JSGlobalObject*); JSFunction* createPromiseResolutionHandlerFunction(VM&, JSGlobalObject*); JSFunction* createRejectPromiseFunction(VM&, JSGlobalObject*); JSFunction* createResolvePromiseFunction(VM&, JSGlobalObject*); diff --git a/JavaScriptCore/runtime/JSPromiseReaction.cpp b/JavaScriptCore/runtime/JSPromiseReaction.cpp index c0e75dfb..89caff50 100644 --- a/JavaScriptCore/runtime/JSPromiseReaction.cpp +++ b/JavaScriptCore/runtime/JSPromiseReaction.cpp @@ -89,7 +89,17 @@ void ExecutePromiseReactionMicrotask::run(ExecState* exec) JSValue exception = exec->exception(); exec->clearException(); - performDeferredReject(exec, deferred, exception); + JSValue deferredReject = deferred->reject(); + + CallData rejectCallData; + CallType rejectCallType = getCallData(deferredReject, rejectCallData); + ASSERT(rejectCallType != CallTypeNone); + + MarkedArgumentBuffer rejectArguments; + rejectArguments.append(exception); + + call(exec, deferredReject, rejectCallType, rejectCallData, jsUndefined(), rejectArguments); + // FIXME: Should we return the result somewhere? } // 5. Let 'handlerResult' be handlerResult.[[value]]. @@ -99,10 +109,19 @@ void ExecutePromiseReactionMicrotask::run(ExecState* exec) if (sameValue(exec, handlerResult, deferred->promise())) { // i. Let 'selfResolutionError' be a newly-created TypeError object. JSObject* selfResolutionError = createTypeError(exec, ASCIILiteral("Resolve a promise with itself")); - // ii. Return the result of calling the [[Call]] internal method of deferred.[[Reject]] passing // undefined as thisArgument and a List containing selfResolutionError as argumentsList. - performDeferredReject(exec, deferred, selfResolutionError); + JSValue deferredReject = deferred->reject(); + + CallData rejectCallData; + CallType rejectCallType = getCallData(deferredReject, rejectCallData); + ASSERT(rejectCallType != CallTypeNone); + + MarkedArgumentBuffer rejectArguments; + rejectArguments.append(selfResolutionError); + + call(exec, deferredReject, rejectCallType, rejectCallData, jsUndefined(), rejectArguments); + // FIXME: Should we return the result somewhere? } // 7. Let 'updateResult' be the result of calling UpdateDeferredFromPotentialThenable(handlerResult, deferred). @@ -116,7 +135,18 @@ void ExecutePromiseReactionMicrotask::run(ExecState* exec) if (updateResult == NotAThenable) { // i. Return the result of calling the [[Call]] internal method of deferred.[[Resolve]] // passing undefined as thisArgument and a List containing handlerResult as argumentsList. - performDeferredResolve(exec, deferred, handlerResult); + + JSValue deferredResolve = deferred->resolve(); + + CallData resolveCallData; + CallType resolveCallType = getCallData(deferredResolve, resolveCallData); + ASSERT(resolveCallType != CallTypeNone); + + MarkedArgumentBuffer arguments; + arguments.append(handlerResult); + + call(exec, deferredResolve, resolveCallType, resolveCallData, jsUndefined(), arguments); + // FIXME: Should we return the result somewhere? } } diff --git a/JavaScriptCore/runtime/JSPropertyNameIterator.h b/JavaScriptCore/runtime/JSPropertyNameIterator.h index f4362ff3..59140304 100644 --- a/JavaScriptCore/runtime/JSPropertyNameIterator.h +++ b/JavaScriptCore/runtime/JSPropertyNameIterator.h @@ -109,9 +109,9 @@ namespace JSC { return m_enumerationCache.get(); } - inline void StructureRareData::setEnumerationCache(VM& vm, const Structure*, JSPropertyNameIterator* value) + inline void StructureRareData::setEnumerationCache(VM& vm, const Structure* owner, JSPropertyNameIterator* value) { - m_enumerationCache.set(vm, this, value); + m_enumerationCache.set(vm, owner, value); } } // namespace JSC diff --git a/JavaScriptCore/runtime/JSString.cpp b/JavaScriptCore/runtime/JSString.cpp index 099b6234..a5bfe266 100644 --- a/JavaScriptCore/runtime/JSString.cpp +++ b/JavaScriptCore/runtime/JSString.cpp @@ -72,7 +72,7 @@ void JSString::visitChildren(JSCell* cell, SlotVisitor& visitor) else { StringImpl* impl = thisObject->m_value.impl(); ASSERT(impl); - visitor.reportExtraMemoryUsage(thisObject, impl->costDuringGC()); + visitor.reportExtraMemoryUsage(impl->costDuringGC()); } } diff --git a/JavaScriptCore/runtime/MemoryStatistics.cpp b/JavaScriptCore/runtime/MemoryStatistics.cpp index a2eaf349..5459ff3d 100644 --- a/JavaScriptCore/runtime/MemoryStatistics.cpp +++ b/JavaScriptCore/runtime/MemoryStatistics.cpp @@ -37,7 +37,7 @@ GlobalMemoryStatistics globalMemoryStatistics() GlobalMemoryStatistics stats; stats.stackBytes = JSStack::committedByteCount(); -#if ENABLE(EXECUTABLE_ALLOCATOR_FIXED) || (PLATFORM(EFL) && ENABLE(JIT)) +#if ENABLE(EXECUTABLE_ALLOCATOR_FIXED) || ((PLATFORM(BLACKBERRY) || PLATFORM(EFL)) && ENABLE(JIT)) stats.JITBytes = ExecutableAllocator::committedByteCount(); #else stats.JITBytes = 0; diff --git a/JavaScriptCore/runtime/RegExpConstructor.cpp b/JavaScriptCore/runtime/RegExpConstructor.cpp index 189b1751..d4f5602f 100644 --- a/JavaScriptCore/runtime/RegExpConstructor.cpp +++ b/JavaScriptCore/runtime/RegExpConstructor.cpp @@ -45,8 +45,8 @@ static EncodedJSValue regExpConstructorDollar7(ExecState*, EncodedJSValue, Encod static EncodedJSValue regExpConstructorDollar8(ExecState*, EncodedJSValue, EncodedJSValue, PropertyName); static EncodedJSValue regExpConstructorDollar9(ExecState*, EncodedJSValue, EncodedJSValue, PropertyName); -static void setRegExpConstructorInput(ExecState*, EncodedJSValue, EncodedJSValue); -static void setRegExpConstructorMultiline(ExecState*, EncodedJSValue, EncodedJSValue); +static void setRegExpConstructorInput(ExecState*, JSObject*, JSValue); +static void setRegExpConstructorMultiline(ExecState*, JSObject*, JSValue); } // namespace JSC @@ -243,14 +243,14 @@ void RegExpConstructor::put(JSCell* cell, ExecState* exec, PropertyName property lookupPut(exec, propertyName, value, ExecState::regExpConstructorTable(exec), jsCast(cell), slot); } -void setRegExpConstructorInput(ExecState* exec, EncodedJSValue baseObject, EncodedJSValue value) +void setRegExpConstructorInput(ExecState* exec, JSObject* baseObject, JSValue value) { - asRegExpConstructor(asObject(JSValue::decode(baseObject)))->setInput(exec, JSValue::decode(value).toString(exec)); + asRegExpConstructor(baseObject)->setInput(exec, value.toString(exec)); } -void setRegExpConstructorMultiline(ExecState* exec, EncodedJSValue baseObject, EncodedJSValue value) +void setRegExpConstructorMultiline(ExecState* exec, JSObject* baseObject, JSValue value) { - asRegExpConstructor(asObject(JSValue::decode(baseObject)))->setMultiline(JSValue::decode(value).toBoolean(exec)); + asRegExpConstructor(baseObject)->setMultiline(value.toBoolean(exec)); } // ECMA 15.10.4 diff --git a/JavaScriptCore/runtime/StringPrototype.cpp b/JavaScriptCore/runtime/StringPrototype.cpp index d6a78bcd..285c1735 100644 --- a/JavaScriptCore/runtime/StringPrototype.cpp +++ b/JavaScriptCore/runtime/StringPrototype.cpp @@ -237,7 +237,7 @@ static inline String substituteBackreferences(const String& replacement, const S static inline int localeCompare(const String& a, const String& b) { - return Collator::userDefault()->collate(reinterpret_cast(a.deprecatedCharacters()), a.length(), reinterpret_cast(b.deprecatedCharacters()), b.length()); + return Collator::userDefault()->collate(reinterpret_cast(a.characters()), a.length(), reinterpret_cast(b.characters()), b.length()); } struct StringRange { @@ -1427,7 +1427,7 @@ EncodedJSValue JSC_HOST_CALL stringProtoFuncFontsize(ExecState* exec) buffer[12] = '0' + smallInteger; buffer[13] = '"'; buffer[14] = '>'; - memcpy(&buffer[15], s.deprecatedCharacters(), stringSize * sizeof(UChar)); + memcpy(&buffer[15], s.characters(), stringSize * sizeof(UChar)); buffer[15 + stringSize] = '<'; buffer[16 + stringSize] = '/'; buffer[17 + stringSize] = 'f'; @@ -1483,10 +1483,10 @@ EncodedJSValue JSC_HOST_CALL stringProtoFuncLink(ExecState* exec) buffer[6] = 'f'; buffer[7] = '='; buffer[8] = '"'; - memcpy(&buffer[9], linkText.deprecatedCharacters(), linkTextSize * sizeof(UChar)); + memcpy(&buffer[9], linkText.characters(), linkTextSize * sizeof(UChar)); buffer[9 + linkTextSize] = '"'; buffer[10 + linkTextSize] = '>'; - memcpy(&buffer[11 + linkTextSize], s.deprecatedCharacters(), stringSize * sizeof(UChar)); + memcpy(&buffer[11 + linkTextSize], s.characters(), stringSize * sizeof(UChar)); buffer[11 + linkTextSize + stringSize] = '<'; buffer[12 + linkTextSize + stringSize] = '/'; buffer[13 + linkTextSize + stringSize] = 'a'; diff --git a/JavaScriptCore/runtime/StructureRareDataInlines.h b/JavaScriptCore/runtime/StructureRareDataInlines.h index 5b39bad1..20b7f8b1 100644 --- a/JavaScriptCore/runtime/StructureRareDataInlines.h +++ b/JavaScriptCore/runtime/StructureRareDataInlines.h @@ -35,9 +35,9 @@ inline Structure* StructureRareData::previousID() const return m_previous.get(); } -inline void StructureRareData::setPreviousID(VM& vm, Structure*, Structure* structure) +inline void StructureRareData::setPreviousID(VM& vm, Structure* transition, Structure* structure) { - m_previous.set(vm, this, structure); + m_previous.set(vm, transition, structure); } inline void StructureRareData::clearPreviousID() @@ -50,9 +50,9 @@ inline JSString* StructureRareData::objectToStringValue() const return m_objectToStringValue.get(); } -inline void StructureRareData::setObjectToStringValue(VM& vm, const JSCell*, JSString* value) +inline void StructureRareData::setObjectToStringValue(VM& vm, const JSCell* owner, JSString* value) { - m_objectToStringValue.set(vm, this, value); + m_objectToStringValue.set(vm, owner, value); } } // namespace JSC diff --git a/JavaScriptCore/runtime/WeakMapData.cpp b/JavaScriptCore/runtime/WeakMapData.cpp index 224be8a4..ce60c8c2 100644 --- a/JavaScriptCore/runtime/WeakMapData.cpp +++ b/JavaScriptCore/runtime/WeakMapData.cpp @@ -64,7 +64,7 @@ void WeakMapData::visitChildren(JSCell* cell, SlotVisitor& visitor) // Rough approximation of the external storage needed for the hashtable. // This isn't exact, but it is close enough, and proportional to the actual // external mermory usage. - visitor.reportExtraMemoryUsage(thisObj, thisObj->m_map.capacity() * (sizeof(JSObject*) + sizeof(WriteBarrier))); + visitor.reportExtraMemoryUsage(thisObj->m_map.capacity() * (sizeof(JSObject*) + sizeof(WriteBarrier))); } void WeakMapData::set(VM& vm, JSObject* key, JSValue value) diff --git a/JavaScriptCore/shell/PlatformBlackBerry.cmake b/JavaScriptCore/shell/PlatformBlackBerry.cmake new file mode 100644 index 00000000..8f81ed44 --- /dev/null +++ b/JavaScriptCore/shell/PlatformBlackBerry.cmake @@ -0,0 +1,16 @@ +FIND_STAGING_LIBRARY(SLOG2_LIBRARY slog2) +list(APPEND JSC_LIBRARIES + ${ICUI18N_LIBRARY} + ${ICUUC_LIBRARY} + ${INTL_LIBRARY} # Required for x86 builds + ${M_LIBRARY} + ${SLOG2_LIBRARY} + ${Screen_LIBRARY} + ${WebKitPlatform_LIBRARY} +) + +if (PROFILING) + list(APPEND JSC_LIBRARIES + ${PROFILING_LIBRARY} + ) +endif () diff --git a/JavaScriptCore/tests/stress/bit-op-value-to-int32-input-liveness.js b/JavaScriptCore/tests/stress/bit-op-value-to-int32-input-liveness.js deleted file mode 100644 index d614db2c..00000000 --- a/JavaScriptCore/tests/stress/bit-op-value-to-int32-input-liveness.js +++ /dev/null @@ -1,20 +0,0 @@ -function foo(a, b) { - return a.f ^ b.f; -} - -noInline(foo); - -for (var i = 0; i < 100000; ++i) { - var result = foo({f:5.5}, {f:6.5}); - if (result != 3) - throw "Error: bad result: " + result; -} - -var result = foo({f:"5.5"}, {f:6.5}); -if (result != 3) - throw "Error: bad result: " + result; - -var result = foo({f:5.5}, {f:"6.5"}); -if (result != 3) - throw "Error: bad result: " + result; - diff --git a/JavaScriptCore/tests/stress/phantom-arguments-set-local-then-exit-in-same-block.js b/JavaScriptCore/tests/stress/phantom-arguments-set-local-then-exit-in-same-block.js deleted file mode 100644 index fe64414b..00000000 --- a/JavaScriptCore/tests/stress/phantom-arguments-set-local-then-exit-in-same-block.js +++ /dev/null @@ -1,17 +0,0 @@ -function foo(o) { - var a = arguments; - var result = o.f; - for (var i = 1; i < a.length; ++i) - result += a[i]; - return result; -} - -noInline(foo); - -for (var i = 0; i < 100; ++i) - foo({f:42}, 1, 2, 3); - -var result = foo({g:40, f:41}, 1, 2.5, 3); -if (result != 47.5) - throw "Bad result: " + result; - diff --git a/WTF/WTF.xcodeproj/project.pbxproj b/WTF/WTF.xcodeproj/project.pbxproj index 4ee962d4..a465c2fa 100644 --- a/WTF/WTF.xcodeproj/project.pbxproj +++ b/WTF/WTF.xcodeproj/project.pbxproj @@ -88,7 +88,6 @@ 10EAA7471889E93100DEB161 /* strtod.cc in Sources */ = {isa = PBXBuildFile; fileRef = A8A47294151A825A004123FF /* strtod.cc */; }; 10EAA7481889E93100DEB161 /* TCSystemAlloc.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A8A47318151A825B004123FF /* TCSystemAlloc.cpp */; }; 10EAA7491889E93100DEB161 /* ThreadIdentifierDataPthreads.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A8A47330151A825B004123FF /* ThreadIdentifierDataPthreads.cpp */; }; - 10EAA74A1889E93100DEB161 /* DeprecatedSymbolsUsedBySafari.mm in Sources */ = {isa = PBXBuildFile; fileRef = 1ACADD821884480100D8B71D /* DeprecatedSymbolsUsedBySafari.mm */; }; 10EAA74B1889E93100DEB161 /* Threading.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A8A47332151A825B004123FF /* Threading.cpp */; }; 10EAA74C1889E93100DEB161 /* ThreadingPthreads.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A8A47336151A825B004123FF /* ThreadingPthreads.cpp */; }; 10EAA74D1889E93100DEB161 /* UTF8.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A8A47357151A825B004123FF /* UTF8.cpp */; }; @@ -100,7 +99,6 @@ 10EAA7551889E93100DEB161 /* Assertions.h in Headers */ = {isa = PBXBuildFile; fileRef = A8A4725C151A825A004123FF /* Assertions.h */; }; 10EAA7561889E93100DEB161 /* Atomics.h in Headers */ = {isa = PBXBuildFile; fileRef = A8A4725D151A825A004123FF /* Atomics.h */; }; 10EAA7571889E93100DEB161 /* AtomicString.h in Headers */ = {isa = PBXBuildFile; fileRef = A8A4731E151A825B004123FF /* AtomicString.h */; }; - 10EAA7581889E93100DEB161 /* IteratorAdaptors.h in Headers */ = {isa = PBXBuildFile; fileRef = 7CDD7FF7186D291E007433CD /* IteratorAdaptors.h */; }; 10EAA7591889E93100DEB161 /* AtomicStringHash.h in Headers */ = {isa = PBXBuildFile; fileRef = A8A4731F151A825B004123FF /* AtomicStringHash.h */; }; 10EAA75A1889E93100DEB161 /* AtomicStringImpl.h in Headers */ = {isa = PBXBuildFile; fileRef = A8A47320151A825B004123FF /* AtomicStringImpl.h */; }; 10EAA75B1889E93100DEB161 /* AtomicStringTable.h in Headers */ = {isa = PBXBuildFile; fileRef = 9BD8F40A176C2AD80002D865 /* AtomicStringTable.h */; }; @@ -109,7 +107,6 @@ 10EAA75E1889E93100DEB161 /* Base64.h in Headers */ = {isa = PBXBuildFile; fileRef = 8134013715B092FD001FF0B8 /* Base64.h */; }; 10EAA75F1889E93100DEB161 /* bignum-dtoa.h in Headers */ = {isa = PBXBuildFile; fileRef = A8A47283151A825A004123FF /* bignum-dtoa.h */; }; 10EAA7601889E93100DEB161 /* bignum.h in Headers */ = {isa = PBXBuildFile; fileRef = A8A47285151A825A004123FF /* bignum.h */; }; - 10EAA7611889E93100DEB161 /* IteratorRange.h in Headers */ = {isa = PBXBuildFile; fileRef = 7CDD7FF9186D2A54007433CD /* IteratorRange.h */; }; 10EAA7621889E93100DEB161 /* BinarySemaphore.h in Headers */ = {isa = PBXBuildFile; fileRef = A8A4733B151A825B004123FF /* BinarySemaphore.h */; }; 10EAA7631889E93100DEB161 /* Bitmap.h in Headers */ = {isa = PBXBuildFile; fileRef = A8A4725F151A825A004123FF /* Bitmap.h */; }; 10EAA7641889E93100DEB161 /* BitVector.h in Headers */ = {isa = PBXBuildFile; fileRef = A8A47261151A825A004123FF /* BitVector.h */; }; @@ -325,7 +322,6 @@ 1A3F6BE6174ADA2100B2EEA7 /* NeverDestroyed.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = NeverDestroyed.h; sourceTree = ""; }; 1A6BB768162F300500DD16DB /* StreamBuffer.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = StreamBuffer.h; sourceTree = ""; }; 1A6EB1DF187D0BD30030126F /* StringView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = StringView.h; sourceTree = ""; }; - 1ACADD821884480100D8B71D /* DeprecatedSymbolsUsedBySafari.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = DeprecatedSymbolsUsedBySafari.mm; sourceTree = ""; }; 1FA47C88152502DA00568D1B /* WebCoreThread.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = WebCoreThread.cpp; sourceTree = ""; }; 1FA47C89152502DA00568D1B /* WebCoreThread.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WebCoreThread.h; sourceTree = ""; }; 26147B0815DDCCDC00DDB907 /* IntegerToStringConversion.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = IntegerToStringConversion.h; sourceTree = ""; }; @@ -340,8 +336,6 @@ 5D247B7014689C4700E78B76 /* DebugRelease.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; path = DebugRelease.xcconfig; sourceTree = ""; }; 5D247B7314689C4700E78B76 /* WTF.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; path = WTF.xcconfig; sourceTree = ""; }; 6541CAF41630DB26006D0DEC /* CopyWTFHeaders.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; path = CopyWTFHeaders.xcconfig; sourceTree = ""; }; - 7CDD7FF7186D291E007433CD /* IteratorAdaptors.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = IteratorAdaptors.h; sourceTree = ""; }; - 7CDD7FF9186D2A54007433CD /* IteratorRange.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = IteratorRange.h; sourceTree = ""; }; 7E29C33D15FFD79B00516D61 /* ObjcRuntimeExtras.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ObjcRuntimeExtras.h; sourceTree = ""; }; 8134013615B092FD001FF0B8 /* Base64.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = Base64.cpp; sourceTree = ""; }; 8134013715B092FD001FF0B8 /* Base64.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Base64.h; sourceTree = ""; }; @@ -722,8 +716,6 @@ A8A472BB151A825A004123FF /* HexNumber.h */, A8A472BC151A825A004123FF /* InlineASM.h */, A70DA0821799F04D00529A9B /* Insertion.h */, - 7CDD7FF7186D291E007433CD /* IteratorAdaptors.h */, - 7CDD7FF9186D2A54007433CD /* IteratorRange.h */, A70DA0831799F04D00529A9B /* ListDump.h */, A8A472C1151A825A004123FF /* ListHashSet.h */, A8A472C3151A825A004123FF /* Locker.h */, @@ -873,7 +865,6 @@ isa = PBXGroup; children = ( A8A472C5151A825A004123FF /* MainThreadMac.mm */, - 1ACADD821884480100D8B71D /* DeprecatedSymbolsUsedBySafari.mm */, ); path = mac; sourceTree = ""; @@ -959,7 +950,6 @@ 10EAA7551889E93100DEB161 /* Assertions.h in Headers */, 10EAA7561889E93100DEB161 /* Atomics.h in Headers */, 10EAA7571889E93100DEB161 /* AtomicString.h in Headers */, - 10EAA7581889E93100DEB161 /* IteratorAdaptors.h in Headers */, 10EAA7591889E93100DEB161 /* AtomicStringHash.h in Headers */, 10EAA75A1889E93100DEB161 /* AtomicStringImpl.h in Headers */, 10EAA75B1889E93100DEB161 /* AtomicStringTable.h in Headers */, @@ -968,7 +958,6 @@ 10EAA75E1889E93100DEB161 /* Base64.h in Headers */, 10EAA75F1889E93100DEB161 /* bignum-dtoa.h in Headers */, 10EAA7601889E93100DEB161 /* bignum.h in Headers */, - 10EAA7611889E93100DEB161 /* IteratorRange.h in Headers */, 10EAA7621889E93100DEB161 /* BinarySemaphore.h in Headers */, 10EAA7631889E93100DEB161 /* Bitmap.h in Headers */, 10EAA7641889E93100DEB161 /* BitVector.h in Headers */, @@ -1271,7 +1260,6 @@ 10EAA7471889E93100DEB161 /* strtod.cc in Sources */, 10EAA7481889E93100DEB161 /* TCSystemAlloc.cpp in Sources */, 10EAA7491889E93100DEB161 /* ThreadIdentifierDataPthreads.cpp in Sources */, - 10EAA74A1889E93100DEB161 /* DeprecatedSymbolsUsedBySafari.mm in Sources */, 10EAA74B1889E93100DEB161 /* Threading.cpp in Sources */, 10EAA74C1889E93100DEB161 /* ThreadingPthreads.cpp in Sources */, 10EAA74D1889E93100DEB161 /* UTF8.cpp in Sources */, @@ -1296,6 +1284,7 @@ isa = XCBuildConfiguration; baseConfigurationReference = 10EAA7011889E91800DEB161 /* WTF-iOS-Static.xcconfig */; buildSettings = { + ARCHS = "$(ARCHS_STANDARD_INCLUDING_64_BIT)"; }; name = Debug; }; @@ -1303,6 +1292,7 @@ isa = XCBuildConfiguration; baseConfigurationReference = 10EAA7011889E91800DEB161 /* WTF-iOS-Static.xcconfig */; buildSettings = { + ARCHS = "$(ARCHS_STANDARD_INCLUDING_64_BIT)"; }; name = Release; }; @@ -1310,6 +1300,7 @@ isa = XCBuildConfiguration; baseConfigurationReference = 10EAA7011889E91800DEB161 /* WTF-iOS-Static.xcconfig */; buildSettings = { + ARCHS = "$(ARCHS_STANDARD_INCLUDING_64_BIT)"; }; name = Production; }; diff --git a/WTF/wtf/Assertions.cpp b/WTF/wtf/Assertions.cpp index a3703024..de5d2700 100644 --- a/WTF/wtf/Assertions.cpp +++ b/WTF/wtf/Assertions.cpp @@ -69,6 +69,10 @@ #include #endif +#if PLATFORM(BLACKBERRY) +#include +#endif + extern "C" { WTF_ATTRIBUTE_PRINTF(1, 0) @@ -111,6 +115,8 @@ static void vprintf_stderr_common(const char* format, va_list args) // Fall through to write to stderr in the same manner as other platforms. +#elif PLATFORM(BLACKBERRY) + BBLOGV(BlackBerry::Platform::LogLevelCritical, format, args); #elif HAVE(ISDEBUGGERPRESENT) if (IsDebuggerPresent()) { size_t size = 1024; @@ -145,7 +151,9 @@ static void vprintf_stderr_common(const char* format, va_list args) } while (size > 1024); } #endif +#if !PLATFORM(BLACKBERRY) vfprintf(stderr, format, args); +#endif } #if COMPILER(CLANG) || (COMPILER(GCC) && GCC_VERSION_AT_LEAST(4, 6, 0)) diff --git a/WTF/wtf/Atomics.h b/WTF/wtf/Atomics.h index e4011abf..60bb0b20 100644 --- a/WTF/wtf/Atomics.h +++ b/WTF/wtf/Atomics.h @@ -68,6 +68,8 @@ extern "C" void _ReadWriteBarrier(void); #pragma intrinsic(_ReadWriteBarrier) #endif #include +#elif OS(QNX) +#include #endif namespace WTF { @@ -91,6 +93,12 @@ inline int64_t atomicIncrement(int64_t volatile* addend) { return InterlockedInc inline int64_t atomicDecrement(int64_t volatile* addend) { return InterlockedDecrement64(reinterpret_cast(addend)); } #endif +#elif OS(QNX) + +// Note, atomic_{add, sub}_value() return the previous value of addend's content. +inline int atomicIncrement(int volatile* addend) { return static_cast(atomic_add_value(reinterpret_cast(addend), 1)) + 1; } +inline int atomicDecrement(int volatile* addend) { return static_cast(atomic_sub_value(reinterpret_cast(addend), 1)) - 1; } + #elif COMPILER(GCC) inline int atomicIncrement(int volatile* addend) { return __sync_add_and_fetch(addend, 1); } diff --git a/WTF/wtf/Bitmap.h b/WTF/wtf/Bitmap.h index 7b288f9e..936ccc24 100644 --- a/WTF/wtf/Bitmap.h +++ b/WTF/wtf/Bitmap.h @@ -196,7 +196,7 @@ inline size_t Bitmap::count(size_t start) const ++result; } for (size_t i = start / wordSize; i < words; ++i) - result += WTF::bitCount(static_cast(bits[i])); + result += WTF::bitCount(bits[i]); return result; } diff --git a/WTF/wtf/CMakeLists.txt b/WTF/wtf/CMakeLists.txt index 56aa1145..3723c75e 100644 --- a/WTF/wtf/CMakeLists.txt +++ b/WTF/wtf/CMakeLists.txt @@ -28,6 +28,7 @@ set(WTF_HEADERS FastMalloc.h FeatureDefines.h FilePrintStream.h + FilterIterator.h FlipBytes.h Forward.h FunctionDispatcher.h @@ -42,8 +43,7 @@ set(WTF_HEADERS HashTable.h HashTraits.h HexNumber.h - IteratorAdaptors.h - IteratorRange.h + IteratorPair.h ListHashSet.h Locker.h MD5.h @@ -101,6 +101,7 @@ set(WTF_HEADERS TCSpinLock.h TCSystemAlloc.h ThreadIdentifierDataPthreads.h + ThreadRestrictionVerifier.h ThreadSafeRefCounted.h ThreadSpecific.h Threading.h @@ -133,7 +134,6 @@ set(WTF_HEADERS text/StringBuffer.h text/StringHash.h text/StringImpl.h - text/StringView.h text/WTFString.h threads/BinarySemaphore.h diff --git a/WTF/wtf/Compiler.h b/WTF/wtf/Compiler.h index d7b958a5..a28498bf 100644 --- a/WTF/wtf/Compiler.h +++ b/WTF/wtf/Compiler.h @@ -56,6 +56,12 @@ #define WTF_COMPILER_SUPPORTS_CXX_AUTO_TYPE __has_feature(cxx_auto_type) #define WTF_COMPILER_SUPPORTS_CXX_GENERALIZED_INITIALIZERS __has_feature(cxx_generalized_initializers) +/* Disable final on versions of Apple clang earlier than 4.2 to avoid bugs like http://webkit.org/b/119165 */ +#if defined(__APPLE__) && (__clang_major__ < 4 || (__clang_major__ == 4 && __clang_minor__ < 2)) +#define WTF_COMPILER_QUIRK_FINAL_IS_BUGGY 1 +// #error "Please use a newer version of Xcode, this version has code generation bugs when using 'final' in C++ code" +#endif + #endif /* COMPILER(MSVC) - Microsoft Visual C++ */ diff --git a/WTF/wtf/CurrentTime.cpp b/WTF/wtf/CurrentTime.cpp index a50da415..55e2ab35 100644 --- a/WTF/wtf/CurrentTime.cpp +++ b/WTF/wtf/CurrentTime.cpp @@ -238,6 +238,16 @@ double currentTime() return ecore_time_unix_get(); } +#elif OS(QNX) + +double currentTime() +{ + struct timespec time; + if (clock_gettime(CLOCK_REALTIME, &time)) + CRASH(); + return time.tv_sec + time.tv_nsec / 1.0e9; +} + #else double currentTime() @@ -276,6 +286,16 @@ double monotonicallyIncreasingTime() return static_cast(g_get_monotonic_time() / 1000000.0); } +#elif OS(QNX) + +double monotonicallyIncreasingTime() +{ + struct timespec time; + if (clock_gettime(CLOCK_MONOTONIC, &time)) + CRASH(); + return time.tv_sec + time.tv_nsec / 1.0e9; +} + #else double monotonicallyIncreasingTime() @@ -318,6 +338,11 @@ double currentCPUTime() GetThreadTimes(GetCurrentThread(), &creationTime, &exitTime, &kernelTime.fileTime, &userTime.fileTime); return userTime.fileTimeAsLong / 10000000. + kernelTime.fileTimeAsLong / 10000000.; +#elif OS(QNX) + struct timespec time; + if (clock_gettime(CLOCK_THREAD_CPUTIME_ID, &time)) + CRASH(); + return time.tv_sec + time.tv_nsec / 1.0e9; #else // FIXME: We should return the time the current thread has spent executing. diff --git a/WTF/wtf/DateMath.cpp b/WTF/wtf/DateMath.cpp index 9792023c..0ed38ecf 100644 --- a/WTF/wtf/DateMath.cpp +++ b/WTF/wtf/DateMath.cpp @@ -102,6 +102,11 @@ #include #endif +#if OS(QNX) +// qnx6 defines timegm in nbutil.h +#include +#endif + using namespace WTF; namespace WTF { diff --git a/WTF/wtf/DisallowCType.h b/WTF/wtf/DisallowCType.h index 072e9ca4..6ed255a2 100644 --- a/WTF/wtf/DisallowCType.h +++ b/WTF/wtf/DisallowCType.h @@ -41,7 +41,7 @@ // or , which in turn include which uses // isacii(). #include -#if !(OS(DARWIN) && PLATFORM(GTK)) && !PLATFORM(EFL) && !defined(_LIBCPP_VERSION) && !PLATFORM(NIX) +#if !(OS(DARWIN) && PLATFORM(GTK)) && !OS(QNX) && !PLATFORM(EFL) && !defined(_LIBCPP_VERSION) && !PLATFORM(NIX) #include diff --git a/WTF/wtf/DoublyLinkedList.h b/WTF/wtf/DoublyLinkedList.h index 64d6d478..cd067ef0 100644 --- a/WTF/wtf/DoublyLinkedList.h +++ b/WTF/wtf/DoublyLinkedList.h @@ -82,7 +82,6 @@ template class DoublyLinkedList { void push(T*); void append(T*); void remove(T*); - void append(DoublyLinkedList&); private: T* m_head; @@ -187,31 +186,6 @@ template inline T* DoublyLinkedList::removeHead() return node; } -template inline void DoublyLinkedList::append(DoublyLinkedList& other) -{ - if (!other.head()) - return; - - if (!head()) { - m_head = other.head(); - m_tail = other.tail(); - other.clear(); - return; - } - - ASSERT(tail()); - ASSERT(other.head()); - T* otherHead = other.head(); - T* otherTail = other.tail(); - other.clear(); - - ASSERT(!m_tail->next()); - m_tail->setNext(otherHead); - ASSERT(!otherHead->prev()); - otherHead->setPrev(m_tail); - m_tail = otherTail; -} - } // namespace WTF using WTF::DoublyLinkedListNode; diff --git a/WTF/wtf/FeatureDefines.h b/WTF/wtf/FeatureDefines.h index 1d041633..f8532aa2 100644 --- a/WTF/wtf/FeatureDefines.h +++ b/WTF/wtf/FeatureDefines.h @@ -56,10 +56,6 @@ /* PLATFORM(MAC) is always enabled when PLATFORM(IOS) is enabled. */ #if PLATFORM(IOS) -#if !defined(ENABLE_ASYNC_SCROLLING) -#define ENABLE_ASYNC_SCROLLING 1 -#endif - #if !defined(ENABLE_8BIT_TEXTRUN) #define ENABLE_8BIT_TEXTRUN 1 #endif @@ -338,6 +334,15 @@ #endif /* PLATFORM(GTK) */ +/* --------- Blackberry port (QNX) --------- */ +#if PLATFORM(BLACKBERRY) + +#if !defined(ENABLE_BLACKBERRY_CREDENTIAL_PERSIST) +#define ENABLE_BLACKBERRY_CREDENTIAL_PERSIST 1 +#endif + +#endif /* PLATFORM(BLACKBERRY) */ + /* ENABLE macro defaults for WebCore */ /* Do not use PLATFORM() tests in this section ! */ @@ -863,10 +868,6 @@ #define ENABLE_WEB_AUDIO 0 #endif -#if !defined(ENABLE_WEB_REPLAY) -#define ENABLE_WEB_REPLAY 0 -#endif - #if !defined(ENABLE_WEB_SOCKETS) #define ENABLE_WEB_SOCKETS 1 #endif diff --git a/WTF/wtf/IteratorAdaptors.h b/WTF/wtf/FilterIterator.h similarity index 57% rename from WTF/wtf/IteratorAdaptors.h rename to WTF/wtf/FilterIterator.h index 9115d4da..bbed41f4 100644 --- a/WTF/wtf/IteratorAdaptors.h +++ b/WTF/wtf/FilterIterator.h @@ -23,16 +23,21 @@ * THE POSSIBILITY OF SUCH DAMAGE. */ -#ifndef WTF_IteratorAdaptors_h -#define WTF_IteratorAdaptors_h +#ifndef WTF_FilterIterator_h +#define WTF_FilterIterator_h + +#include +#include +#include namespace WTF { -template +template class FilterIterator { public: - FilterIterator(Predicate pred, Iterator begin, Iterator end) + FilterIterator(Predicate pred, Cast cast, Iterator begin, Iterator end) : m_pred(std::move(pred)) + , m_cast(std::move(cast)) , m_iter(std::move(begin)) , m_end(std::move(end)) { @@ -50,11 +55,11 @@ class FilterIterator { return *this; } - decltype(*std::declval()) operator*() const + const decltype(std::declval()(*std::declval())) operator*() const { ASSERT(m_iter != m_end); ASSERT(m_pred(*m_iter)); - return *m_iter; + return m_cast(*m_iter); } inline bool operator==(FilterIterator& other) const { return m_iter == other.m_iter; } @@ -62,50 +67,11 @@ class FilterIterator { private: const Predicate m_pred; + const Cast m_cast; Iterator m_iter; Iterator m_end; }; -template -inline FilterIterator makeFilterIterator(Predicate&& pred, Iterator&& begin, Iterator&& end) -{ - return FilterIterator(std::forward(pred), std::forward(begin), std::forward(end)); -} - -template -class TransformIterator { -public: - TransformIterator(const Transform& transform, const Iterator& iter) - : m_transform(std::move(transform)) - , m_iter(std::move(iter)) - { - } - - TransformIterator& operator++() - { - ++m_iter; - return *this; - } - - decltype(std::declval()(*std::declval())) operator*() const - { - return m_transform(*m_iter); - } - - inline bool operator==(TransformIterator& other) const { return m_iter == other.m_iter; } - inline bool operator!=(TransformIterator& other) const { return m_iter != other.m_iter; } - -private: - const Transform m_transform; - Iterator m_iter; -}; - -template -inline TransformIterator makeTransformIterator(Transform&& transform, Iterator&& iter) -{ - return TransformIterator(std::forward(transform), std::forward(iter)); -} - } // namespace WTF -#endif // WTF_IteratorAdaptors_h +#endif // WTF_FilterIterator_h diff --git a/WTF/wtf/Forward.h b/WTF/wtf/Forward.h index 215247fa..f1c223ff 100644 --- a/WTF/wtf/Forward.h +++ b/WTF/wtf/Forward.h @@ -26,7 +26,6 @@ namespace WTF { template class Function; -template class NeverDestroyed; template class OwnPtr; template class PassOwnPtr; template class PassRef; @@ -48,7 +47,6 @@ class PrintStream; class String; class StringBuilder; class StringImpl; -class StringView; } @@ -60,7 +58,6 @@ using WTF::Decoder; using WTF::Encoder; using WTF::Function; using WTF::FunctionDispatcher; -using WTF::NeverDestroyed; using WTF::OwnPtr; using WTF::PassOwnPtr; using WTF::PassRef; @@ -72,7 +69,6 @@ using WTF::String; using WTF::StringBuffer; using WTF::StringBuilder; using WTF::StringImpl; -using WTF::StringView; using WTF::Vector; #endif // WTF_Forward_h diff --git a/WTF/wtf/HashMap.h b/WTF/wtf/HashMap.h index dbd17b42..4a20dc22 100644 --- a/WTF/wtf/HashMap.h +++ b/WTF/wtf/HashMap.h @@ -22,7 +22,7 @@ #define WTF_HashMap_h #include -#include +#include namespace WTF { @@ -92,11 +92,11 @@ class HashMap { const_iterator begin() const; const_iterator end() const; - IteratorRange keys() { return makeIteratorRange(begin().keys(), end().keys()); } - const IteratorRange keys() const { return makeIteratorRange(begin().keys(), end().keys()); } + IteratorPair keys() { return IteratorPair(begin().keys(), end().keys()); } + const IteratorPair keys() const { return IteratorPair(begin().keys(), end().keys()); } - IteratorRange values() { return makeIteratorRange(begin().values(), end().values()); } - const IteratorRange values() const { return makeIteratorRange(begin().values(), end().values()); } + IteratorPair values() { return IteratorPair(begin().values(), end().values()); } + const IteratorPair values() const { return IteratorPair(begin().values(), end().values()); } iterator find(const KeyType&); const_iterator find(const KeyType&) const; diff --git a/WTF/wtf/HashSet.h b/WTF/wtf/HashSet.h index 46c3fe5d..7408f4e7 100644 --- a/WTF/wtf/HashSet.h +++ b/WTF/wtf/HashSet.h @@ -21,7 +21,6 @@ #ifndef WTF_HashSet_h #define WTF_HashSet_h -#include #include #include @@ -50,16 +49,6 @@ namespace WTF { typedef HashTableConstIteratorAdapter const_iterator; typedef typename HashTableType::AddResult AddResult; - HashSet() - { - } - - HashSet(std::initializer_list initializerList) - { - for (const auto& value : initializerList) - add(value); - } - void swap(HashSet&); int size() const; diff --git a/WTF/wtf/HashTable.cpp b/WTF/wtf/HashTable.cpp index a578f52f..518a4c8c 100644 --- a/WTF/wtf/HashTable.cpp +++ b/WTF/wtf/HashTable.cpp @@ -19,9 +19,7 @@ #include "config.h" #include "HashTable.h" - #include "DataLog.h" -#include namespace WTF { @@ -35,21 +33,15 @@ int HashTableStats::numRehashes; int HashTableStats::numRemoves; int HashTableStats::numReinserts; -static std::mutex& hashTableStatsMutex() +static Mutex& hashTableStatsMutex() { - static std::once_flag onceFlag; - static std::mutex* mutex; - std::call_once(onceFlag, []{ - mutex = std::make_unique().release(); - }); - - return *mutex; + AtomicallyInitializedStatic(Mutex&, mutex = *new Mutex); + return mutex; } void HashTableStats::recordCollisionAtCount(int count) { - std::lock_guard lock(hashTableStatsMutex()); - + MutexLocker lock(hashTableStatsMutex()); if (count > maxCollisions) maxCollisions = count; numCollisions++; @@ -58,7 +50,7 @@ void HashTableStats::recordCollisionAtCount(int count) void HashTableStats::dumpStats() { - std::lock_guard lock(hashTableStatsMutex()); + MutexLocker lock(hashTableStatsMutex()); dataLogF("\nWTF::HashTable statistics\n\n"); dataLogF("%d accesses\n", numAccesses); diff --git a/WTF/wtf/InlineASM.h b/WTF/wtf/InlineASM.h index ffda698e..0a2fe78b 100644 --- a/WTF/wtf/InlineASM.h +++ b/WTF/wtf/InlineASM.h @@ -82,7 +82,8 @@ #elif OS(LINUX) \ || OS(FREEBSD) \ || OS(OPENBSD) \ - || OS(NETBSD) + || OS(NETBSD) \ + || OS(QNX) // GNU as-compatible syntax. #define LOCAL_LABEL_STRING(name) ".L" #name #endif diff --git a/WTF/wtf/IteratorRange.h b/WTF/wtf/IteratorPair.h similarity index 82% rename from WTF/wtf/IteratorRange.h rename to WTF/wtf/IteratorPair.h index 295c2142..0cf301bf 100644 --- a/WTF/wtf/IteratorRange.h +++ b/WTF/wtf/IteratorPair.h @@ -23,15 +23,15 @@ * THE POSSIBILITY OF SUCH DAMAGE. */ -#ifndef WTF_IteratorRange_h -#define WTF_IteratorRange_h +#ifndef WTF_IteratorPair_h +#define WTF_IteratorPair_h namespace WTF { template -class IteratorRange { +class IteratorPair { public: - IteratorRange(Iterator begin, Iterator end) + IteratorPair(Iterator begin, Iterator end) : m_begin(std::move(begin)) , m_end(std::move(end)) { @@ -45,12 +45,6 @@ class IteratorRange { Iterator m_end; }; -template -IteratorRange makeIteratorRange(Iterator&& begin, Iterator&& end) -{ - return IteratorRange(std::forward(begin), std::forward(end)); -} - } // namespace WTF -#endif // WTF_IteratorRange_h +#endif // WTF_IteratorPair diff --git a/WTF/wtf/MainThread.cpp b/WTF/wtf/MainThread.cpp index 94cf0b8b..044a6472 100644 --- a/WTF/wtf/MainThread.cpp +++ b/WTF/wtf/MainThread.cpp @@ -241,6 +241,11 @@ void callOnMainThread(std::function function) callOnMainThread(callFunctionObject, std::make_unique>(std::move(function)).release()); } +void callOnMainThread(const Function& function) +{ + callOnMainThread(std::function(function)); +} + void setMainThreadCallbacksPaused(bool paused) { ASSERT(isMainThread()); @@ -261,13 +266,6 @@ bool isMainThread() } #endif -#if !USE(WEB_THREAD) -bool canAccessThreadLocalDataForThread(ThreadIdentifier threadId) -{ - return threadId == currentThread(); -} -#endif - #if ENABLE(PARALLEL_GC) static ThreadSpecific* isGCThread; #endif diff --git a/WTF/wtf/MainThread.h b/WTF/wtf/MainThread.h index 1ad2d852..50deb9a9 100644 --- a/WTF/wtf/MainThread.h +++ b/WTF/wtf/MainThread.h @@ -47,18 +47,21 @@ WTF_EXPORT_PRIVATE void cancelCallOnMainThread(MainThreadFunction*, void* contex WTF_EXPORT_PRIVATE void callOnMainThread(std::function); +// FIXME: This symbol is used by Safari and should be removed once Safari is no longer using it. +template class Function; +WTF_EXPORT_PRIVATE void callOnMainThread(const Function&); + WTF_EXPORT_PRIVATE void setMainThreadCallbacksPaused(bool paused); WTF_EXPORT_PRIVATE bool isMainThread(); -WTF_EXPORT_PRIVATE bool canAccessThreadLocalDataForThread(ThreadIdentifier); - #if USE(WEB_THREAD) WTF_EXPORT_PRIVATE bool isWebThread(); WTF_EXPORT_PRIVATE bool isUIThread(); WTF_EXPORT_PRIVATE void initializeWebThread(); WTF_EXPORT_PRIVATE void initializeApplicationUIThreadIdentifier(); WTF_EXPORT_PRIVATE void initializeWebThreadIdentifier(); +WTF_EXPORT_PRIVATE bool canAccessThreadLocalDataForThread(ThreadIdentifier); void initializeWebThreadPlatform(); #else inline bool isWebThread() { return isMainThread(); } @@ -99,13 +102,11 @@ using WTF::cancelCallOnMainThread; using WTF::setMainThreadCallbacksPaused; using WTF::isMainThread; using WTF::isMainThreadOrGCThread; -using WTF::canAccessThreadLocalDataForThread; -using WTF::isUIThread; -using WTF::isWebThread; #if USE(WEB_THREAD) using WTF::initializeWebThread; using WTF::initializeApplicationUIThreadIdentifier; using WTF::initializeWebThreadIdentifier; +using WTF::canAccessThreadLocalDataForThread; #endif #endif // MainThread_h diff --git a/WTF/wtf/MathExtras.h b/WTF/wtf/MathExtras.h index b6f41d06..f3477492 100644 --- a/WTF/wtf/MathExtras.h +++ b/WTF/wtf/MathExtras.h @@ -43,6 +43,18 @@ #include #endif +#if OS(QNX) +// FIXME: Look into a way to have cmath import its functions into both the standard and global +// namespace. For now, we include math.h since the QNX cmath header only imports its functions +// into the standard namespace. +#include +// These macros from math.h conflict with the real functions in the std namespace. +#undef signbit +#undef isnan +#undef isinf +#undef isfinite +#endif + #ifndef M_PI const double piDouble = 3.14159265358979323846; const float piFloat = 3.14159265358979323846f; @@ -109,6 +121,11 @@ inline bool signbit(double x) { struct ieee_double *p = (struct ieee_double *)&x #endif +#if COMPILER(GCC) && OS(QNX) +// The stdlib on QNX doesn't contain long abs(long). See PR #104666. +inline long long abs(long num) { return labs(num); } +#endif + #if COMPILER(MSVC) // Work around a bug in Win, where atan2(+-infinity, +-infinity) yields NaN instead of specific values. diff --git a/WTF/wtf/MediaTime.cpp b/WTF/wtf/MediaTime.cpp index f856714d..f30f3c10 100644 --- a/WTF/wtf/MediaTime.cpp +++ b/WTF/wtf/MediaTime.cpp @@ -33,6 +33,8 @@ #include #include +using namespace std; + namespace WTF { static int32_t greatestCommonDivisor(int32_t a, int32_t b) @@ -88,12 +90,12 @@ MediaTime MediaTime::createWithFloat(float floatTime, int32_t timeScale) return invalidTime(); if (std::isinf(floatTime)) return std::signbit(floatTime) ? negativeInfiniteTime() : positiveInfiniteTime(); - if (floatTime > std::numeric_limits::max()) + if (floatTime > numeric_limits::max()) return positiveInfiniteTime(); - if (floatTime < std::numeric_limits::min()) + if (floatTime < numeric_limits::min()) return negativeInfiniteTime(); - while (floatTime * timeScale > std::numeric_limits::max()) + while (floatTime * timeScale > numeric_limits::max()) timeScale /= 2; return MediaTime(static_cast(floatTime * timeScale), timeScale, Valid); } @@ -104,12 +106,12 @@ MediaTime MediaTime::createWithDouble(double doubleTime, int32_t timeScale) return invalidTime(); if (std::isinf(doubleTime)) return std::signbit(doubleTime) ? negativeInfiniteTime() : positiveInfiniteTime(); - if (doubleTime > std::numeric_limits::max()) + if (doubleTime > numeric_limits::max()) return positiveInfiniteTime(); - if (doubleTime < std::numeric_limits::min()) + if (doubleTime < numeric_limits::min()) return negativeInfiniteTime(); - while (doubleTime * timeScale > std::numeric_limits::max()) + while (doubleTime * timeScale > numeric_limits::max()) timeScale /= 2; return MediaTime(static_cast(doubleTime * timeScale), timeScale, Valid); } diff --git a/WTF/wtf/NumberOfCores.cpp b/WTF/wtf/NumberOfCores.cpp index 75d8af70..191731ac 100644 --- a/WTF/wtf/NumberOfCores.cpp +++ b/WTF/wtf/NumberOfCores.cpp @@ -36,6 +36,8 @@ #include #elif OS(WINDOWS) #include +#elif OS(QNX) +#include #endif namespace WTF { @@ -68,6 +70,10 @@ int numberOfProcessorCores() GetSystemInfo(&sysInfo); s_numberOfCores = sysInfo.dwNumberOfProcessors; +#elif OS(QNX) + UNUSED_PARAM(defaultIfUnavailable); + + s_numberOfCores = _syspage_ptr->num_cpu; #else s_numberOfCores = defaultIfUnavailable; #endif diff --git a/WTF/wtf/OSAllocatorPosix.cpp b/WTF/wtf/OSAllocatorPosix.cpp index 61661eec..a71f3913 100644 --- a/WTF/wtf/OSAllocatorPosix.cpp +++ b/WTF/wtf/OSAllocatorPosix.cpp @@ -37,7 +37,17 @@ namespace WTF { void* OSAllocator::reserveUncommitted(size_t bytes, Usage usage, bool writable, bool executable, bool includesGuardPages) { -#if OS(LINUX) +#if OS(QNX) + UNUSED_PARAM(usage); + UNUSED_PARAM(writable); + UNUSED_PARAM(executable); + UNUSED_PARAM(includesGuardPages); + + // Reserve memory with PROT_NONE and MAP_LAZY so it isn't committed now. + void* result = mmap(0, bytes, PROT_NONE, MAP_LAZY | MAP_PRIVATE | MAP_ANON, -1, 0); + if (result == MAP_FAILED) + CRASH(); +#elif OS(LINUX) UNUSED_PARAM(usage); UNUSED_PARAM(writable); UNUSED_PARAM(executable); @@ -54,7 +64,7 @@ void* OSAllocator::reserveUncommitted(size_t bytes, Usage usage, bool writable, while (madvise(result, bytes, MADV_FREE_REUSABLE) == -1 && errno == EAGAIN) { } #endif -#endif +#endif // OS(QNX) return result; } @@ -124,7 +134,15 @@ void* OSAllocator::reserveAndCommit(size_t bytes, Usage usage, bool writable, bo void OSAllocator::commit(void* address, size_t bytes, bool writable, bool executable) { -#if OS(LINUX) +#if OS(QNX) + int protection = PROT_READ; + if (writable) + protection |= PROT_WRITE; + if (executable) + protection |= PROT_EXEC; + if (MAP_FAILED == mmap(address, bytes, protection, MAP_FIXED | MAP_PRIVATE | MAP_ANON, -1, 0)) + CRASH(); +#elif OS(LINUX) int protection = PROT_READ; if (writable) protection |= PROT_WRITE; @@ -148,7 +166,10 @@ void OSAllocator::commit(void* address, size_t bytes, bool writable, bool execut void OSAllocator::decommit(void* address, size_t bytes) { -#if OS(LINUX) +#if OS(QNX) + // Use PROT_NONE and MAP_LAZY to decommit the pages. + mmap(address, bytes, PROT_NONE, MAP_FIXED | MAP_LAZY | MAP_PRIVATE | MAP_ANON, -1, 0); +#elif OS(LINUX) madvise(address, bytes, MADV_DONTNEED); if (mprotect(address, bytes, PROT_NONE)) CRASH(); diff --git a/WTF/wtf/Platform.h b/WTF/wtf/Platform.h index 6cc115e3..f1bebc5b 100644 --- a/WTF/wtf/Platform.h +++ b/WTF/wtf/Platform.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2006, 2007, 2008, 2009, 2013, 2014 Apple Inc. All rights reserved. + * Copyright (C) 2006, 2007, 2008, 2009, 2013 Apple Inc. All rights reserved. * Copyright (C) 2007-2009 Torch Mobile, Inc. * Copyright (C) 2010, 2011 Research In Motion Limited. All rights reserved. * @@ -382,6 +382,11 @@ #define WTF_OS_OPENBSD 1 #endif +/* OS(QNX) - QNX */ +#if defined(__QNXNTO__) +#define WTF_OS_QNX 1 +#endif + /* OS(SOLARIS) - Solaris */ #if defined(sun) || defined(__sun) #define WTF_OS_SOLARIS 1 @@ -408,6 +413,7 @@ || OS(LINUX) \ || OS(NETBSD) \ || OS(OPENBSD) \ + || OS(QNX) \ || OS(SOLARIS) \ || defined(unix) \ || defined(__unix) \ @@ -420,16 +426,18 @@ /* FIXME: these are all mixes of OS, operating environment and policy choices. */ /* PLATFORM(EFL) */ /* PLATFORM(GTK) */ +/* PLATFORM(BLACKBERRY) */ /* PLATFORM(MAC) */ /* PLATFORM(WIN) */ #if defined(BUILDING_EFL__) #define WTF_PLATFORM_EFL 1 #elif defined(BUILDING_GTK__) #define WTF_PLATFORM_GTK 1 +#elif defined(BUILDING_BLACKBERRY__) +#define WTF_PLATFORM_BLACKBERRY 1 #elif defined(BUILDING_NIX__) #include "nix/PlatformNix.h" #elif OS(DARWIN) -#define WTF_PLATFORM_COCOA 1 #define WTF_PLATFORM_MAC 1 #elif OS(WINDOWS) #define WTF_PLATFORM_WIN 1 @@ -457,6 +465,12 @@ #define WTF_USE_CA 1 #endif +#if PLATFORM(BLACKBERRY) +#define WTF_USE_LOW_QUALITY_IMAGE_INTERPOLATION 1 +#define WTF_USE_LOW_QUALITY_IMAGE_NO_JPEG_DITHERING 1 +#define WTF_USE_LOW_QUALITY_IMAGE_NO_JPEG_FANCY_UPSAMPLING 1 +#endif + #if PLATFORM(GTK) #define WTF_USE_CAIRO 1 #define WTF_USE_GLIB 1 @@ -476,54 +490,46 @@ #define WTF_USE_ICU_UNICODE 1 #endif -#if PLATFORM(COCOA) - -#define WTF_USE_CF 1 -#define WTF_USE_FOUNDATION 1 - -#endif - #if PLATFORM(MAC) && !PLATFORM(IOS) - -#define WTF_USE_APPKIT 1 -#define HAVE_RUNLOOP_TIMER 1 -#define HAVE_SEC_IDENTITY 1 -#define HAVE_SEC_KEYCHAIN 1 - #if CPU(X86_64) #define WTF_USE_PLUGIN_HOST_PROCESS 1 #endif - +#define WTF_USE_CF 1 +#define HAVE_READLINE 1 +#define HAVE_RUNLOOP_TIMER 1 +#define HAVE_SEC_IDENTITY 1 +#define HAVE_SEC_KEYCHAIN 1 #if __MAC_OS_X_VERSION_MIN_REQUIRED >= 1080 #define HAVE_LAYER_HOSTING_IN_WINDOW_SERVER 1 #endif +#define WTF_USE_APPKIT 1 /* OS X defines a series of platform macros for debugging. */ /* Some of them are really annoying because they use common names (e.g. check()). */ /* Disable those macros so that we are not limited in how we name methods and functions. */ #undef __ASSERT_MACROS_DEFINE_VERSIONS_WITHOUT_UNDERSCORES #define __ASSERT_MACROS_DEFINE_VERSIONS_WITHOUT_UNDERSCORES 0 - #endif /* PLATFORM(MAC) && !PLATFORM(IOS) */ +#if PLATFORM(IOS) +#define DONT_FINALIZE_ON_MAIN_THREAD 1 +#endif + #if OS(DARWIN) && !PLATFORM(GTK) #define ENABLE_PURGEABLE_MEMORY 1 #endif #if PLATFORM(IOS) - -#define DONT_FINALIZE_ON_MAIN_THREAD 1 #define HAVE_READLINE 1 +#define WTF_USE_APPKIT 0 +#define WTF_USE_CF 1 #define WTF_USE_CFNETWORK 1 #define WTF_USE_NETWORK_CFDATA_ARRAY_CALLBACK 1 -#define WTF_USE_UIKIT_EDITING 1 #define WTF_USE_WEB_THREAD 1 -#define WTF_USE_QUICK_LOOK 1 #if CPU(ARM64) #define ENABLE_JIT_CONSTANT_BLINDING 0 #endif - #endif /* PLATFORM(IOS) */ #if PLATFORM(WIN) && !USE(WINGDI) @@ -546,8 +552,7 @@ #if OS(UNIX) #define HAVE_ERRNO_H 1 -#define HAVE_LANGINFO_H 1 -#define HAVE_MMAP 1 +#define HAVE_MMAP 1 #define HAVE_SIGNAL_H 1 #define HAVE_STRINGS_H 1 #define HAVE_SYS_PARAM_H 1 @@ -555,12 +560,16 @@ #define WTF_USE_PTHREADS 1 #endif /* OS(UNIX) */ +#if OS(UNIX) && !OS(QNX) +#define HAVE_LANGINFO_H 1 +#endif + #if (OS(FREEBSD) || OS(OPENBSD)) && !defined(__GLIBC__) #define HAVE_PTHREAD_NP_H 1 #endif #if !defined(HAVE_VASPRINTF) -#if !COMPILER(MSVC) && !COMPILER(MINGW) +#if !COMPILER(MSVC) && !COMPILER(MINGW) && !(COMPILER(GCC) && OS(QNX)) #define HAVE_VASPRINTF 1 #endif #endif @@ -584,18 +593,16 @@ #define HAVE_MADV_FREE_REUSE 1 #define HAVE_MERGESORT 1 #define HAVE_PTHREAD_SETNAME_NP 1 -#define HAVE_READLINE 1 #define HAVE_SYS_TIMEB_H 1 #define WTF_USE_ACCELERATE 1 #if !PLATFORM(IOS) #define HAVE_HOSTED_CORE_ANIMATION 1 -#endif +#endif /* !PLATFORM(IOS) */ #endif /* OS(DARWIN) */ #if OS(WINDOWS) && !OS(WINCE) - #define HAVE_SYS_TIMEB_H 1 #define HAVE_ALIGNED_MALLOC 1 #define HAVE_ISDEBUGGERPRESENT 1 @@ -608,6 +615,11 @@ #define HAVE_VIRTUALALLOC 1 #endif +#if OS(QNX) +#define HAVE_MADV_FREE_REUSE 1 +#define HAVE_MADV_FREE 1 +#endif + /* ENABLE macro defaults */ /* FIXME: move out all ENABLE() defines from here to FeatureDefines.h */ @@ -671,6 +683,7 @@ && (CPU(X86) || CPU(X86_64) || CPU(ARM) || CPU(ARM64) || CPU(MIPS)) \ && (OS(DARWIN) || !COMPILER(GCC) || GCC_VERSION_AT_LEAST(4, 1, 0)) \ && !OS(WINCE) \ + && !OS(QNX) \ && !(OS(WINDOWS) && CPU(X86_64)) #define ENABLE_JIT 1 #endif @@ -693,7 +706,7 @@ /* If possible, try to enable a disassembler. This is optional. We proceed in two steps: first we try to find some disassembler that we can use, and then we decide if the high-level disassembler API can be enabled. */ -#if !defined(WTF_USE_UDIS86) && ENABLE(JIT) && (PLATFORM(MAC) || (PLATFORM(EFL) && OS(LINUX))) \ +#if !defined(WTF_USE_UDIS86) && ENABLE(JIT) && PLATFORM(MAC) \ && (CPU(X86) || CPU(X86_64)) #define WTF_USE_UDIS86 1 #endif @@ -726,7 +739,7 @@ #define ENABLE_DFG_JIT 1 #endif /* Enable the DFG JIT on ARMv7. Only tested on iOS and Qt/GTK+ Linux. */ -#if (CPU(ARM_THUMB2) || CPU(ARM64)) && (PLATFORM(IOS) || PLATFORM(GTK) || PLATFORM(EFL)) +#if (CPU(ARM_THUMB2) || CPU(ARM64)) && (PLATFORM(IOS) || PLATFORM(BLACKBERRY) || PLATFORM(GTK)) #define ENABLE_DFG_JIT 1 #endif /* Enable the DFG JIT on ARM, MIPS and SH4. */ @@ -759,6 +772,18 @@ #error You have to have at least one execution model enabled to build JSC #endif +/* Profiling of types and values used by JIT code. DFG_JIT depends on it, but you + can enable it manually with DFG turned off if you want to use it as a standalone + profiler. In that case, you probably want to also enable VERBOSE_VALUE_PROFILE + below. */ +#if !defined(ENABLE_VALUE_PROFILER) && ENABLE(DFG_JIT) +#define ENABLE_VALUE_PROFILER 1 +#endif + +#if !defined(ENABLE_VERBOSE_VALUE_PROFILE) && ENABLE(VALUE_PROFILER) +#define ENABLE_VERBOSE_VALUE_PROFILE 0 +#endif + /* Generational collector for JSC */ #if !defined(ENABLE_GGC) #define ENABLE_GGC 0 @@ -861,12 +886,8 @@ /* CSS Selector JIT Compiler */ #if !defined(ENABLE_CSS_SELECTOR_JIT) -#if CPU(X86_64) && ENABLE(JIT) && PLATFORM(MAC) -#define ENABLE_CSS_SELECTOR_JIT 1 -#else #define ENABLE_CSS_SELECTOR_JIT 0 #endif -#endif /* Accelerated compositing */ #if PLATFORM(MAC) || PLATFORM(IOS) || (PLATFORM(WIN) && !USE(WINGDI) && !PLATFORM(WIN_CAIRO)) @@ -951,7 +972,7 @@ #define ENABLE_OBJECT_MARK_LOGGING 0 -#if !defined(ENABLE_PARALLEL_GC) && !ENABLE(OBJECT_MARK_LOGGING) && (PLATFORM(MAC) || PLATFORM(IOS) || PLATFORM(GTK)) && ENABLE(COMPARE_AND_SWAP) +#if !defined(ENABLE_PARALLEL_GC) && !ENABLE(OBJECT_MARK_LOGGING) && (PLATFORM(MAC) || PLATFORM(IOS) || PLATFORM(BLACKBERRY) || PLATFORM(GTK)) && ENABLE(COMPARE_AND_SWAP) #define ENABLE_PARALLEL_GC 1 #endif @@ -1012,7 +1033,7 @@ #define WTF_USE_GRAMMAR_CHECKING 1 -#if PLATFORM(IOS) || PLATFORM(MAC) || PLATFORM(EFL) +#if PLATFORM(IOS) || PLATFORM(MAC) || PLATFORM(BLACKBERRY) || PLATFORM(EFL) #define WTF_USE_UNIFIED_TEXT_CHECKING 1 #endif #if !PLATFORM(IOS) && PLATFORM(MAC) diff --git a/WTF/wtf/PlatformBlackBerry.cmake b/WTF/wtf/PlatformBlackBerry.cmake new file mode 100644 index 00000000..085766c4 --- /dev/null +++ b/WTF/wtf/PlatformBlackBerry.cmake @@ -0,0 +1,4 @@ +list(APPEND WTF_SOURCES + blackberry/MainThreadBlackBerry.cpp + blackberry/RunLoopBlackBerry.cpp +) diff --git a/WTF/wtf/RAMSize.cpp b/WTF/wtf/RAMSize.cpp index 50b5222e..5b2cc67b 100644 --- a/WTF/wtf/RAMSize.cpp +++ b/WTF/wtf/RAMSize.cpp @@ -35,6 +35,8 @@ #include #elif OS(WINDOWS) #include +#elif OS(QNX) +#include #endif namespace WTF { @@ -75,6 +77,11 @@ static size_t computeRAMSize() if (!result) return ramSizeGuess; return status.ullTotalPhys; +#elif OS(QNX) + struct stat mst; + if (stat("/proc", &mst)) + return ramSizeGuess; + return mst.st_size; #endif } diff --git a/WTF/wtf/RefCounted.h b/WTF/wtf/RefCounted.h index 47ec758f..74a185dd 100644 --- a/WTF/wtf/RefCounted.h +++ b/WTF/wtf/RefCounted.h @@ -25,6 +25,7 @@ #include #include #include +#include namespace WTF { @@ -42,6 +43,18 @@ class RefCountedBase { void ref() { #if CHECK_REF_COUNTED_LIFECYCLE + // Start thread verification as soon as the ref count gets to 2. This + // heuristic reflects the fact that items are often created on one thread + // and then given to another thread to be used. + // FIXME: Make this restriction tigher. Especially as we move to more + // common methods for sharing items across threads like CrossThreadCopier.h + // We should be able to add a "detachFromThread" method to make this explicit. + if (m_refCount == 1) + m_verifier.setShared(true); + // If this assert fires, it either indicates a thread safety issue or + // that the verification needs to change. See ThreadRestrictionVerifier for + // the different modes. + ASSERT(m_verifier.isSafeToUse()); ASSERT(!m_deletionHasBegun); ASSERT(!m_adoptionIsRequired); #endif @@ -51,6 +64,7 @@ class RefCountedBase { bool hasOneRef() const { #if CHECK_REF_COUNTED_LIFECYCLE + ASSERT(m_verifier.isSafeToUse()); ASSERT(!m_deletionHasBegun); #endif return m_refCount == 1; @@ -58,9 +72,35 @@ class RefCountedBase { unsigned refCount() const { +#if CHECK_REF_COUNTED_LIFECYCLE + ASSERT(m_verifier.isSafeToUse()); +#endif return m_refCount; } + void setMutexForVerifier(Mutex&); + +#if HAVE(DISPATCH_H) + void setDispatchQueueForVerifier(dispatch_queue_t); +#endif + + // Turns off verification. Use of this method is discouraged (instead extend + // ThreadRestrictionVerifier to verify your case). + // NB. It is necessary to call this in the constructor of many objects in + // JavaScriptCore, because JavaScriptCore objects may be used from multiple + // threads even if the reference counting is done in a racy manner. This is + // because a JSC instance may be used from multiple threads so long as all + // accesses into that instance are protected by a per-instance lock. It would + // be absolutely wrong to prohibit this pattern, and it would be a disastrous + // regression to require that the objects within that instance use a thread- + // safe version of reference counting. + void turnOffVerifier() + { +#if CHECK_REF_COUNTED_LIFECYCLE + m_verifier.turnOffVerification(); +#endif + } + void relaxAdoptionRequirement() { #if CHECK_REF_COUNTED_LIFECYCLE @@ -92,6 +132,7 @@ class RefCountedBase { bool derefBase() { #if CHECK_REF_COUNTED_LIFECYCLE + ASSERT(m_verifier.isSafeToUse()); ASSERT(!m_deletionHasBegun); ASSERT(!m_adoptionIsRequired); #endif @@ -105,6 +146,13 @@ class RefCountedBase { return true; } m_refCount = tempRefCount; + +#if CHECK_REF_COUNTED_LIFECYCLE + // Stop thread verification when the ref goes to 1 because it + // is safe to be passed to another thread at this point. + if (m_refCount == 1) + m_verifier.setShared(false); +#endif return false; } @@ -125,6 +173,7 @@ class RefCountedBase { #if CHECK_REF_COUNTED_LIFECYCLE bool m_deletionHasBegun; bool m_adoptionIsRequired; + ThreadRestrictionVerifier m_verifier; #endif }; @@ -170,6 +219,26 @@ template class RefCountedCustomAllocated : public RefCountedBase { } }; +#if CHECK_REF_COUNTED_LIFECYCLE +inline void RefCountedBase::setMutexForVerifier(Mutex& mutex) +{ + m_verifier.setMutexMode(mutex); +} +#else +inline void RefCountedBase::setMutexForVerifier(Mutex&) { } +#endif + +#if HAVE(DISPATCH_H) +#if CHECK_REF_COUNTED_LIFECYCLE +inline void RefCountedBase::setDispatchQueueForVerifier(dispatch_queue_t queue) +{ + m_verifier.setDispatchQueueMode(queue); +} +#else +inline void RefCountedBase::setDispatchQueueForVerifier(dispatch_queue_t) { } +#endif +#endif // HAVE(DISPATCH_H) + } // namespace WTF using WTF::RefCounted; diff --git a/WTF/wtf/RefPtrHashMap.h b/WTF/wtf/RefPtrHashMap.h index 152bdeec..96dbb330 100644 --- a/WTF/wtf/RefPtrHashMap.h +++ b/WTF/wtf/RefPtrHashMap.h @@ -70,11 +70,11 @@ namespace WTF { const_iterator begin() const; const_iterator end() const; - IteratorRange keys() { return makeIteratorRange(begin().keys(), end().keys()); } - const IteratorRange keys() const { return makeIteratorRange(begin().keys(), end().keys()); } + IteratorPair keys() { return IteratorPair(begin().keys(), end().keys()); } + const IteratorPair keys() const { return IteratorPair(begin().keys(), end().keys()); } - IteratorRange values() { return makeIteratorRange(begin().values(), end().values()); } - const IteratorRange values() const { return makeIteratorRange(begin().values(), end().values()); } + IteratorPair values() { return IteratorPair(begin().values(), end().values()); } + const IteratorPair values() const { return IteratorPair(begin().values(), end().values()); } iterator find(const KeyType&); iterator find(RawKeyType); diff --git a/WTF/wtf/SizeLimits.cpp b/WTF/wtf/SizeLimits.cpp new file mode 100644 index 00000000..d584e49c --- /dev/null +++ b/WTF/wtf/SizeLimits.cpp @@ -0,0 +1,84 @@ +/* + * Copyright (C) 2010 Google 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: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * 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. + * * Neither the name of Google Inc. nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND 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 THE COPYRIGHT + * OWNER 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 +#include +#include +#include +#include +#include +#include +#include +#include + +namespace WTF { + +#ifndef NDEBUG +struct SameSizeAsRefCounted { + int a; + bool b; + bool c; + ThreadRestrictionVerifier d; + // The debug version may get bigger. +}; +#else +struct SameSizeAsRefCounted { + int a; + // Don't add anything here because this should stay small. +}; +#endif +template +struct SameSizeAsVectorWithInlineCapacity; + +template +struct SameSizeAsVectorWithInlineCapacity { + void* bufferPointer; + unsigned capacity; + unsigned size; +}; + +template +struct SameSizeAsVectorWithInlineCapacity { + SameSizeAsVectorWithInlineCapacity baseCapacity; + typename std::aligned_storage::value>::type inlineBuffer[inlineCapacity]; +}; + +static_assert(sizeof(OwnPtr) == sizeof(int*), "OwnPtr should stay small!"); +static_assert(sizeof(PassRefPtr>) == sizeof(int*), "PassRefPtr should stay small!"); +static_assert(sizeof(RefCounted) == sizeof(SameSizeAsRefCounted), "RefCounted should stay small!"); +static_assert(sizeof(RefCountedCustomAllocated) == sizeof(SameSizeAsRefCounted), "RefCountedCustomAllocated should stay small!"); +static_assert(sizeof(RefPtr>) == sizeof(int*), "RefPtr should stay small!"); +static_assert(sizeof(Vector) == sizeof(SameSizeAsVectorWithInlineCapacity), "Vector should stay small!"); +static_assert(sizeof(Vector) == sizeof(SameSizeAsVectorWithInlineCapacity), "Vector should stay small!"); +static_assert(sizeof(Vector) == sizeof(SameSizeAsVectorWithInlineCapacity), "Vector should stay small!"); +static_assert(sizeof(Vector) == sizeof(SameSizeAsVectorWithInlineCapacity), "Vector should stay small!"); +} diff --git a/WTF/wtf/StackBounds.cpp b/WTF/wtf/StackBounds.cpp index 4cb031cb..62e2665a 100644 --- a/WTF/wtf/StackBounds.cpp +++ b/WTF/wtf/StackBounds.cpp @@ -35,6 +35,15 @@ #include +#elif OS(QNX) + +#include +#include +#include +#include +#include +#include + #elif OS(UNIX) #include @@ -65,6 +74,31 @@ void StackBounds::initialize() m_bound = static_cast(m_origin) - size; } +#elif OS(QNX) + +void StackBounds::initialize() +{ + void* stackBase = 0; + size_t stackSize = 0; + + struct _debug_thread_info threadInfo; + memset(&threadInfo, 0, sizeof(threadInfo)); + threadInfo.tid = pthread_self(); + int fd = open("/proc/self", O_RDONLY); + if (fd == -1) { + LOG_ERROR("Unable to open /proc/self (errno: %d)", errno); + CRASH(); + } + devctl(fd, DCMD_PROC_TIDSTATUS, &threadInfo, sizeof(threadInfo), 0); + close(fd); + stackBase = reinterpret_cast(threadInfo.stkbase); + stackSize = threadInfo.stksize; + ASSERT(stackBase); + + m_bound = static_cast(stackBase) + 0x1000; // 4kb guard page + m_origin = static_cast(stackBase) + stackSize; +} + #elif OS(SOLARIS) void StackBounds::initialize() diff --git a/WTF/wtf/ThreadRestrictionVerifier.h b/WTF/wtf/ThreadRestrictionVerifier.h new file mode 100644 index 00000000..f7ada509 --- /dev/null +++ b/WTF/wtf/ThreadRestrictionVerifier.h @@ -0,0 +1,214 @@ +/* + * Copyright (C) 2011 Google 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: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * 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. + * * Neither the name of Google Inc. nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND 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 THE COPYRIGHT + * OWNER 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. + */ + +#ifndef ThreadRestrictionVerifier_h +#define ThreadRestrictionVerifier_h + +#include +#include +#include + +#if HAVE(DISPATCH_H) +#include +#endif + +#ifndef NDEBUG + +namespace WTF { + +// Verifies that a class is used in a way that respects its lack of thread-safety. +// The default mode is to verify that the object will only be used on a single thread. The +// thread gets captured when setShared(true) is called. +// The mode may be changed by calling useMutexMode (or turnOffVerification). + +// FIXME: This verifier is switched off because it fires false positives for +// objects that are used on multiple threads. Instead of an opt-out verifier, +// we probably need an opt-in verifier that marks select objects as being +// tied to select threads. +#if 0 +class ThreadRestrictionVerifier { +public: + ThreadRestrictionVerifier() + : m_mode(SingleThreadVerificationMode) + , m_shared(false) + , m_owningThread(0) + , m_mutex(0) +#if HAVE(DISPATCH_H) + , m_owningQueue(0) +#endif + { + } + +#if HAVE(DISPATCH_H) + ~ThreadRestrictionVerifier() + { + if (m_owningQueue) + dispatch_release(m_owningQueue); + } +#endif + + void setMutexMode(Mutex& mutex) + { + m_mode = MutexVerificationMode; + m_mutex = &mutex; + } + +#if HAVE(DISPATCH_H) + void setDispatchQueueMode(dispatch_queue_t queue) + { + m_mode = SingleDispatchQueueVerificationMode; + m_owningQueue = queue; + dispatch_retain(m_owningQueue); + } +#endif + + void turnOffVerification() + { + m_mode = NoVerificationMode; + } + + // Indicates that the object may (or may not) be owned by more than one place. + void setShared(bool shared) + { +#if !ASSERT_DISABLED + bool previouslyShared = m_shared; +#endif + m_shared = shared; + + if (!m_shared) + return; + + switch (m_mode) { + case SingleThreadVerificationMode: + ASSERT(shared != previouslyShared); + // Capture the current thread to verify that subsequent ref/deref happen on this thread. + m_owningThread = currentThread(); + return; + +#if HAVE(DISPATCH_H) + case SingleDispatchQueueVerificationMode: +#endif + case MutexVerificationMode: + case NoVerificationMode: + return; + } + ASSERT_NOT_REACHED(); + } + + // Is it OK to use the object at this moment on the current thread? + bool isSafeToUse() const + { + if (!m_shared) + return true; + + switch (m_mode) { + case SingleThreadVerificationMode: + return m_owningThread == currentThread(); + + case MutexVerificationMode: + if (!m_mutex->tryLock()) + return true; + m_mutex->unlock(); + return false; + +#if HAVE(DISPATCH_H) + case SingleDispatchQueueVerificationMode: + return m_owningQueue == dispatch_get_current_queue(); +#endif + + case NoVerificationMode: + return true; + } + ASSERT_NOT_REACHED(); + return true; + } + +private: + enum VerificationMode { + SingleThreadVerificationMode, + MutexVerificationMode, + NoVerificationMode, +#if HAVE(DISPATCH_H) + SingleDispatchQueueVerificationMode, +#endif + }; + + VerificationMode m_mode; + bool m_shared; + + // Used by SingleThreadVerificationMode + ThreadIdentifier m_owningThread; + + // Used by MutexVerificationMode. + Mutex* m_mutex; + +#if HAVE(DISPATCH_H) + // Used by SingleDispatchQueueVerificationMode. + dispatch_queue_t m_owningQueue; +#endif +}; +#else +class ThreadRestrictionVerifier { +public: + ThreadRestrictionVerifier() + { + } + + void setMutexMode(Mutex&) + { + } + +#if HAVE(DISPATCH_H) + void setDispatchQueueMode(dispatch_queue_t) + { + } +#endif + + void turnOffVerification() + { + } + + // Indicates that the object may (or may not) be owned by more than one place. + void setShared(bool) + { + } + + // Is it OK to use the object at this moment on the current thread? + bool isSafeToUse() const + { + return true; + } +}; +#endif + +} + +#endif +#endif diff --git a/WTF/wtf/Threading.h b/WTF/wtf/Threading.h index 31f9d2f3..26cb6882 100644 --- a/WTF/wtf/Threading.h +++ b/WTF/wtf/Threading.h @@ -69,6 +69,12 @@ #include #include +// For portability, we do not use thread-safe statics natively supported by some compilers (e.g. gcc). +#define AtomicallyInitializedStatic(T, name) \ + WTF::lockAtomicallyInitializedStaticMutex(); \ + static T name; \ + WTF::unlockAtomicallyInitializedStaticMutex(); + namespace WTF { typedef uint32_t ThreadIdentifier; @@ -94,6 +100,9 @@ WTF_EXPORT_PRIVATE ThreadIdentifier currentThread(); WTF_EXPORT_PRIVATE int waitForThreadCompletion(ThreadIdentifier); WTF_EXPORT_PRIVATE void detachThread(ThreadIdentifier); +WTF_EXPORT_PRIVATE void lockAtomicallyInitializedStaticMutex(); +WTF_EXPORT_PRIVATE void unlockAtomicallyInitializedStaticMutex(); + } // namespace WTF using WTF::ThreadIdentifier; diff --git a/WTF/wtf/ThreadingPthreads.cpp b/WTF/wtf/ThreadingPthreads.cpp index dab2d447..3e8149c5 100644 --- a/WTF/wtf/ThreadingPthreads.cpp +++ b/WTF/wtf/ThreadingPthreads.cpp @@ -98,6 +98,8 @@ class PthreadState { typedef HashMap> ThreadMap; +static Mutex* atomicallyInitializedStaticMutex; + void unsafeThreadWasDetached(ThreadIdentifier); void threadDidExit(ThreadIdentifier); void threadWasJoined(ThreadIdentifier); @@ -108,19 +110,31 @@ static Mutex& threadMapMutex() return mutex; } -void initializeThreading() +#if OS(QNX) && CPU(ARM_THUMB2) +static void enableIEEE754Denormal() { - static bool isInitialized; + // Clear the ARM_VFP_FPSCR_FZ flag in FPSCR. + unsigned fpscr; + asm volatile("vmrs %0, fpscr" : "=r"(fpscr)); + fpscr &= ~0x01000000u; + asm volatile("vmsr fpscr, %0" : : "r"(fpscr)); +} +#endif - if (isInitialized) +void initializeThreading() +{ + if (atomicallyInitializedStaticMutex) return; - isInitialized = true; +#if OS(QNX) && CPU(ARM_THUMB2) + enableIEEE754Denormal(); +#endif WTF::double_conversion::initialize(); // StringImpl::empty() does not construct its static string in a threadsafe fashion, // so ensure it has been initialized from here. StringImpl::empty(); + atomicallyInitializedStaticMutex = new Mutex; threadMapMutex(); initializeRandomNumberGenerator(); ThreadIdentifierData::initializeOnce(); @@ -130,6 +144,17 @@ void initializeThreading() initializeDates(); } +void lockAtomicallyInitializedStaticMutex() +{ + ASSERT(atomicallyInitializedStaticMutex); + atomicallyInitializedStaticMutex->lock(); +} + +void unlockAtomicallyInitializedStaticMutex() +{ + atomicallyInitializedStaticMutex->unlock(); +} + static ThreadMap& threadMap() { DEFINE_STATIC_LOCAL(ThreadMap, map, ()); @@ -191,6 +216,8 @@ void initializeCurrentThreadInternal(const char* threadName) { #if HAVE(PTHREAD_SETNAME_NP) pthread_setname_np(threadName); +#elif OS(QNX) + pthread_setname_np(pthread_self(), threadName); #else UNUSED_PARAM(threadName); #endif @@ -201,6 +228,10 @@ void initializeCurrentThreadInternal(const char* threadName) objc_registerThreadWithCollector(); #endif +#if OS(QNX) && CPU(ARM_THUMB2) + enableIEEE754Denormal(); +#endif + ThreadIdentifier id = identifierByPthreadHandle(pthread_self()); ASSERT(id); ThreadIdentifierData::initialize(id); diff --git a/WTF/wtf/ThreadingWin.cpp b/WTF/wtf/ThreadingWin.cpp index e37c77e0..d25bc01c 100644 --- a/WTF/wtf/ThreadingWin.cpp +++ b/WTF/wtf/ThreadingWin.cpp @@ -148,6 +148,19 @@ void initializeCurrentThreadInternal(const char* szThreadName) #endif } +static Mutex* atomicallyInitializedStaticMutex; + +void lockAtomicallyInitializedStaticMutex() +{ + ASSERT(atomicallyInitializedStaticMutex); + atomicallyInitializedStaticMutex->lock(); +} + +void unlockAtomicallyInitializedStaticMutex() +{ + atomicallyInitializedStaticMutex->unlock(); +} + static Mutex& threadMapMutex() { static Mutex mutex; @@ -156,17 +169,14 @@ static Mutex& threadMapMutex() void initializeThreading() { - static bool isInitialized; - - if (isInitialized) + if (atomicallyInitializedStaticMutex) return; - isInitialized = true; - WTF::double_conversion::initialize(); // StringImpl::empty() does not construct its static string in a threadsafe fashion, // so ensure it has been initialized from here. StringImpl::empty(); + atomicallyInitializedStaticMutex = new Mutex; threadMapMutex(); initializeRandomNumberGenerator(); wtfThreadData(); diff --git a/WTF/wtf/blackberry/MainThreadBlackBerry.cpp b/WTF/wtf/blackberry/MainThreadBlackBerry.cpp new file mode 100644 index 00000000..ec7a364d --- /dev/null +++ b/WTF/wtf/blackberry/MainThreadBlackBerry.cpp @@ -0,0 +1,36 @@ +/* + * Copyright (C) 2009, 2010, 2011 Research In Motion Limited. All rights reserved. + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + */ + +#include "config.h" +#include "MainThread.h" + +#include +#include + +namespace WTF { + +void initializeMainThreadPlatform() +{ +} + +void scheduleDispatchFunctionsOnMainThread() +{ + BlackBerry::Platform::webKitThreadMessageClient()->dispatchMessage(BlackBerry::Platform::createFunctionCallMessage(dispatchFunctionsFromMainThread)); +} + +} // namespace WTF diff --git a/WTF/wtf/blackberry/RunLoopBlackBerry.cpp b/WTF/wtf/blackberry/RunLoopBlackBerry.cpp new file mode 100644 index 00000000..92b86b5b --- /dev/null +++ b/WTF/wtf/blackberry/RunLoopBlackBerry.cpp @@ -0,0 +1,48 @@ +/* + * Copyright (C) 2012 ProFUSION embedded systems. 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 THE COPYRIGHT HOLDERS AND 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 THE COPYRIGHT + * OWNER 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 "RunLoop.h" + +#include "NotImplemented.h" + +namespace WTF { + +RunLoop::RunLoop() +{ + notImplemented(); +} + +RunLoop::~RunLoop() +{ + notImplemented(); +} + +void RunLoop::wakeUp() +{ + notImplemented(); +} + +} // namespace WTF diff --git a/WTF/wtf/mac/DeprecatedSymbolsUsedBySafari.mm b/WTF/wtf/mac/DeprecatedSymbolsUsedBySafari.mm deleted file mode 100644 index 0f897d10..00000000 --- a/WTF/wtf/mac/DeprecatedSymbolsUsedBySafari.mm +++ /dev/null @@ -1,68 +0,0 @@ -/* - * Copyright (C) 2014 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. - */ - -#include "config.h" - -#include "Functional.h" -#include "MainThread.h" -#include "StdLibExtras.h" -#include - -// This file contains deprecated symbols that the last released version of Safari uses. -// Once Safari stops using them, we should remove them. - -namespace WTF { - -WTF_EXPORT_PRIVATE void callOnMainThread(const Function&); -WTF_EXPORT_PRIVATE void lockAtomicallyInitializedStaticMutex(); -WTF_EXPORT_PRIVATE void unlockAtomicallyInitializedStaticMutex(); - -void callOnMainThread(const Function& function) -{ - callOnMainThread(std::function(function)); -} - -static std::mutex& atomicallyInitializedStaticMutex() -{ - static std::once_flag onceFlag; - static std::mutex* mutex; - std::call_once(onceFlag, []{ - mutex = std::make_unique().release(); - }); - - return *mutex; -} - -void lockAtomicallyInitializedStaticMutex() -{ - atomicallyInitializedStaticMutex().lock(); -} - -void unlockAtomicallyInitializedStaticMutex() -{ - atomicallyInitializedStaticMutex().unlock(); -} - -} // namespace WTF diff --git a/WTF/wtf/text/AtomicString.cpp b/WTF/wtf/text/AtomicString.cpp index 5803dd01..33ff3e74 100644 --- a/WTF/wtf/text/AtomicString.cpp +++ b/WTF/wtf/text/AtomicString.cpp @@ -187,7 +187,7 @@ struct HashAndUTF8CharactersTranslator { // If buffer contains only ASCII characters UTF-8 and UTF16 length are the same. if (buffer.utf16Length != buffer.length) { - const UChar* stringCharacters = string->deprecatedCharacters(); + const UChar* stringCharacters = string->characters(); return equalUTF16WithUTF8(stringCharacters, stringCharacters + string->length(), buffer.characters, buffer.characters + buffer.length); } @@ -283,12 +283,12 @@ struct SubstringLocation { struct SubstringTranslator { static unsigned hash(const SubstringLocation& buffer) { - return StringHasher::computeHashAndMaskTop8Bits(buffer.baseString->deprecatedCharacters() + buffer.start, buffer.length); + return StringHasher::computeHashAndMaskTop8Bits(buffer.baseString->characters() + buffer.start, buffer.length); } static bool equal(StringImpl* const& string, const SubstringLocation& buffer) { - return WTF::equal(string, buffer.baseString->deprecatedCharacters() + buffer.start, buffer.length); + return WTF::equal(string, buffer.baseString->characters() + buffer.start, buffer.length); } static void translate(StringImpl*& location, const SubstringLocation& buffer, unsigned hash) diff --git a/WTF/wtf/text/AtomicString.h b/WTF/wtf/text/AtomicString.h index 4142de14..943b2c3b 100644 --- a/WTF/wtf/text/AtomicString.h +++ b/WTF/wtf/text/AtomicString.h @@ -93,7 +93,7 @@ class AtomicString { AtomicStringImpl* impl() const { return static_cast(m_string.impl()); } bool is8Bit() const { return m_string.is8Bit(); } - const UChar* characters() const { return m_string.deprecatedCharacters(); } // FIXME: Delete this. + const UChar* characters() const { return m_string.characters(); } const LChar* characters8() const { return m_string.characters8(); } const UChar* characters16() const { return m_string.characters16(); } unsigned length() const { return m_string.length(); } @@ -153,6 +153,10 @@ class AtomicString { AtomicString(NSString* s) : m_string(add((CFStringRef)s)) { } operator NSString*() const { return m_string; } #endif +#if PLATFORM(BLACKBERRY) + AtomicString(const BlackBerry::Platform::String& s) : m_string(add(String(s).impl())) { } + operator BlackBerry::Platform::String() const { return m_string; } +#endif // AtomicString::fromUTF8 will return a null string if // the input data contains invalid UTF-8 sequences. diff --git a/WTF/wtf/text/Base64.cpp b/WTF/wtf/text/Base64.cpp index 2323f3fa..b37ff3ad 100644 --- a/WTF/wtf/text/Base64.cpp +++ b/WTF/wtf/text/Base64.cpp @@ -250,7 +250,7 @@ static inline bool base64DecodeInternal(const T* data, unsigned length, Vector(in.deprecatedCharacters(), in.length(), out, policy, base64DecMap); + return base64DecodeInternal(in.characters(), in.length(), out, policy, base64DecMap); } bool base64Decode(const Vector& in, SignedOrUnsignedCharVectorAdapter out, Base64DecodePolicy policy) @@ -271,7 +271,7 @@ bool base64Decode(const char* data, unsigned len, SignedOrUnsignedCharVectorAdap bool base64URLDecode(const String& in, SignedOrUnsignedCharVectorAdapter out) { - return base64DecodeInternal(in.deprecatedCharacters(), in.length(), out, Base64FailOnInvalidCharacter, base64URLDecMap); + return base64DecodeInternal(in.characters(), in.length(), out, Base64FailOnInvalidCharacter, base64URLDecMap); } bool base64URLDecode(const Vector& in, SignedOrUnsignedCharVectorAdapter out) diff --git a/WTF/wtf/text/StringBuilder.h b/WTF/wtf/text/StringBuilder.h index 26be9063..f5344cb9 100644 --- a/WTF/wtf/text/StringBuilder.h +++ b/WTF/wtf/text/StringBuilder.h @@ -248,22 +248,21 @@ class StringBuilder { return m_buffer->characters16(); } - const UChar* characters() const { return deprecatedCharacters(); } // FIXME: Delete this. - const UChar* deprecatedCharacters() const + const UChar* characters() const { if (!m_length) return 0; if (!m_string.isNull()) - return m_string.deprecatedCharacters(); + return m_string.characters(); ASSERT(m_buffer); if (m_buffer->has16BitShadow() && m_valid16BitShadowLength < m_length) m_buffer->upconvertCharacters(m_valid16BitShadowLength, m_length); m_valid16BitShadowLength = m_length; - return m_buffer->deprecatedCharacters(); + return m_buffer->characters(); } - + bool is8Bit() const { return m_is8Bit; } void clear() diff --git a/WTF/wtf/text/StringConcatenate.h b/WTF/wtf/text/StringConcatenate.h index baeccc1d..d8e45a12 100644 --- a/WTF/wtf/text/StringConcatenate.h +++ b/WTF/wtf/text/StringConcatenate.h @@ -701,7 +701,7 @@ PassRefPtr tryMakeString(StringType1 string1, StringType2 string2, S if (overflow) return 0; - if (adapter1.is8Bit() && adapter2.is8Bit() && adapter3.is8Bit() && adapter4.is8Bit() && adapter5.is8Bit() && adapter6.is8Bit() && adapter7.is8Bit()) { + if (adapter1.is8Bit() && adapter2.is8Bit() && adapter3.is8Bit() && adapter4.is8Bit() && adapter5.is8Bit() && adapter6.is8Bit()) { LChar* buffer; RefPtr resultImpl = StringImpl::tryCreateUninitialized(length, buffer); if (!resultImpl) diff --git a/WTF/wtf/text/StringImpl.cpp b/WTF/wtf/text/StringImpl.cpp index fe8213cf..fcf78ca0 100644 --- a/WTF/wtf/text/StringImpl.cpp +++ b/WTF/wtf/text/StringImpl.cpp @@ -40,6 +40,8 @@ #include #endif +using namespace std; + namespace WTF { using namespace Unicode; @@ -295,7 +297,7 @@ PassRef StringImpl::create(const LChar* string) if (!string) return *empty(); size_t length = strlen(reinterpret_cast(string)); - if (length > std::numeric_limits::max()) + if (length > numeric_limits::max()) CRASH(); return create(string, length); } @@ -309,7 +311,7 @@ const UChar* StringImpl::getData16SlowCase() const // If this is a substring, return a pointer into the parent string. // TODO: Consider severing this string from the parent string unsigned offset = m_data8 - m_substringBuffer->characters8(); - return m_substringBuffer->deprecatedCharacters() + offset; + return m_substringBuffer->characters() + offset; } STRING_STATS_ADD_UPCONVERTED_STRING(m_length); @@ -445,7 +447,7 @@ PassRef StringImpl::lower() return newImpl; } - if (m_length > static_cast(std::numeric_limits::max())) + if (m_length > static_cast(numeric_limits::max())) CRASH(); int32_t length = m_length; @@ -472,7 +474,7 @@ PassRef StringImpl::upper() // but in empirical testing, few actual calls to upper() are no-ops, so // it wouldn't be worth the extra time for pre-scanning. - if (m_length > static_cast(std::numeric_limits::max())) + if (m_length > static_cast(numeric_limits::max())) CRASH(); int32_t length = m_length; @@ -539,7 +541,7 @@ PassRef StringImpl::upper() } upconvert: - const UChar* source16 = deprecatedCharacters(); + const UChar* source16 = characters(); UChar* data16; RefPtr newImpl = createUninitialized(m_length, data16); @@ -590,14 +592,14 @@ PassRef StringImpl::lower(const AtomicString& localeIdentifier) // this last part into a shared function that takes a locale string, since this is // just like the end of that function. - if (m_length > static_cast(std::numeric_limits::max())) + if (m_length > static_cast(numeric_limits::max())) CRASH(); int length = m_length; // Below, we pass in the hardcoded locale "tr". Passing that is more efficient than // allocating memory just to turn localeIdentifier into a C string, and we assume // there is no difference between the uppercasing for "tr" and "az" locales. - const UChar* source16 = deprecatedCharacters(); + const UChar* source16 = characters(); UChar* data16; RefPtr newString = createUninitialized(length, data16); UErrorCode status = U_ZERO_ERROR; @@ -620,14 +622,14 @@ PassRef StringImpl::upper(const AtomicString& localeIdentifier) if (!needsTurkishCasingRules(localeIdentifier) || find('i') == notFound) return upper(); - if (m_length > static_cast(std::numeric_limits::max())) + if (m_length > static_cast(numeric_limits::max())) CRASH(); int length = m_length; // Below, we pass in the hardcoded locale "tr". Passing that is more efficient than // allocating memory just to turn localeIdentifier into a C string, and we assume // there is no difference between the uppercasing for "tr" and "az" locales. - const UChar* source16 = deprecatedCharacters(); + const UChar* source16 = characters(); UChar* data16; RefPtr newString = createUninitialized(length, data16); UErrorCode status = U_ZERO_ERROR; @@ -660,7 +662,7 @@ PassRef StringImpl::fill(UChar character) PassRef StringImpl::foldCase() { - if (m_length > static_cast(std::numeric_limits::max())) + if (m_length > static_cast(numeric_limits::max())) CRASH(); int32_t length = m_length; @@ -979,11 +981,11 @@ size_t StringImpl::find(const LChar* matchString, unsigned index) if (!matchString) return notFound; size_t matchStringLength = strlen(reinterpret_cast(matchString)); - if (matchStringLength > std::numeric_limits::max()) + if (matchStringLength > numeric_limits::max()) CRASH(); unsigned matchLength = matchStringLength; if (!matchLength) - return std::min(index, length()); + return min(index, length()); // Optimization 1: fast case for strings of length 1. if (matchLength == 1) @@ -998,7 +1000,7 @@ size_t StringImpl::find(const LChar* matchString, unsigned index) // delta is the number of additional times to test; delta == 0 means test only once. unsigned delta = searchLength - matchLength; - const UChar* searchCharacters = deprecatedCharacters() + index; + const UChar* searchCharacters = characters() + index; // Optimization 2: keep a running hash of the strings, // only call equal if the hashes match. @@ -1027,11 +1029,11 @@ size_t StringImpl::findIgnoringCase(const LChar* matchString, unsigned index) if (!matchString) return notFound; size_t matchStringLength = strlen(reinterpret_cast(matchString)); - if (matchStringLength > std::numeric_limits::max()) + if (matchStringLength > numeric_limits::max()) CRASH(); unsigned matchLength = matchStringLength; if (!matchLength) - return std::min(index, length()); + return min(index, length()); // Check index & matchLength are in range. if (index > length()) @@ -1042,7 +1044,7 @@ size_t StringImpl::findIgnoringCase(const LChar* matchString, unsigned index) // delta is the number of additional times to test; delta == 0 means test only once. unsigned delta = searchLength - matchLength; - const UChar* searchCharacters = deprecatedCharacters() + index; + const UChar* searchCharacters = characters() + index; unsigned i = 0; // keep looping until we match @@ -1138,7 +1140,7 @@ size_t StringImpl::find(StringImpl* matchString, unsigned index) } if (UNLIKELY(!matchLength)) - return std::min(index, length()); + return min(index, length()); // Check index & matchLength are in range. if (index > length()) @@ -1182,7 +1184,7 @@ size_t StringImpl::findIgnoringCase(StringImpl* matchString, unsigned index) return notFound; unsigned matchLength = matchString->length(); if (!matchLength) - return std::min(index, length()); + return min(index, length()); // Check index & matchLength are in range. if (index > length()) @@ -1224,7 +1226,7 @@ ALWAYS_INLINE static size_t reverseFindInner(const SearchCharacterType* searchCh // only call equal if the hashes match. // delta is the number of additional times to test; delta == 0 means test only once. - unsigned delta = std::min(index, length - matchLength); + unsigned delta = min(index, length - matchLength); unsigned searchHash = 0; unsigned matchHash = 0; @@ -1252,7 +1254,7 @@ size_t StringImpl::reverseFind(StringImpl* matchString, unsigned index) unsigned matchLength = matchString->length(); unsigned ourLength = length(); if (!matchLength) - return std::min(index, ourLength); + return min(index, ourLength); // Optimization 1: fast case for strings of length 1. if (matchLength == 1) { @@ -1281,7 +1283,7 @@ template ALWAYS_INLINE static size_t reverseFindIgnoringCaseInner(const SearchCharacterType* searchCharacters, const MatchCharacterType* matchCharacters, unsigned index, unsigned length, unsigned matchLength) { // delta is the number of additional times to test; delta == 0 means test only once. - unsigned delta = std::min(index, length - matchLength); + unsigned delta = min(index, length - matchLength); // keep looping until we match while (!equalIgnoringCase(searchCharacters + delta, matchCharacters, matchLength)) { @@ -1300,7 +1302,7 @@ size_t StringImpl::reverseFindIgnoringCase(StringImpl* matchString, unsigned ind unsigned matchLength = matchString->length(); unsigned ourLength = length(); if (!matchLength) - return std::min(index, ourLength); + return min(index, ourLength); // Check index & matchLength are in range. if (matchLength > ourLength) @@ -1452,13 +1454,13 @@ PassRef StringImpl::replace(UChar oldC, UChar newC) PassRef StringImpl::replace(unsigned position, unsigned lengthToReplace, StringImpl* str) { - position = std::min(position, length()); - lengthToReplace = std::min(lengthToReplace, length() - position); + position = min(position, length()); + lengthToReplace = min(lengthToReplace, length() - position); unsigned lengthToInsert = str ? str->length() : 0; if (!lengthToReplace && !lengthToInsert) return *this; - if ((length() - lengthToReplace) >= (std::numeric_limits::max() - lengthToInsert)) + if ((length() - lengthToReplace) >= (numeric_limits::max() - lengthToInsert)) CRASH(); if (is8Bit() && (!str || str->is8Bit())) { @@ -1523,12 +1525,12 @@ PassRef StringImpl::replace(UChar pattern, const LChar* replacement, if (!matchCount) return *this; - if (repStrLength && matchCount > std::numeric_limits::max() / repStrLength) + if (repStrLength && matchCount > numeric_limits::max() / repStrLength) CRASH(); unsigned replaceSize = matchCount * repStrLength; unsigned newSize = m_length - matchCount; - if (newSize >= (std::numeric_limits::max() - replaceSize)) + if (newSize >= (numeric_limits::max() - replaceSize)) CRASH(); newSize += replaceSize; @@ -1600,12 +1602,12 @@ PassRef StringImpl::replace(UChar pattern, const UChar* replacement, if (!matchCount) return *this; - if (repStrLength && matchCount > std::numeric_limits::max() / repStrLength) + if (repStrLength && matchCount > numeric_limits::max() / repStrLength) CRASH(); unsigned replaceSize = matchCount * repStrLength; unsigned newSize = m_length - matchCount; - if (newSize >= (std::numeric_limits::max() - replaceSize)) + if (newSize >= (numeric_limits::max() - replaceSize)) CRASH(); newSize += replaceSize; @@ -1687,10 +1689,10 @@ PassRef StringImpl::replace(StringImpl* pattern, StringImpl* replace return *this; unsigned newSize = m_length - matchCount * patternLength; - if (repStrLength && matchCount > std::numeric_limits::max() / repStrLength) + if (repStrLength && matchCount > numeric_limits::max() / repStrLength) CRASH(); - if (newSize > (std::numeric_limits::max() - matchCount * repStrLength)) + if (newSize > (numeric_limits::max() - matchCount * repStrLength)) CRASH(); newSize += matchCount * repStrLength; @@ -2080,7 +2082,7 @@ CString StringImpl::utf8ForCharacters( { if (!length) return CString("", 0); - if (length > std::numeric_limits::max() / 3) + if (length > numeric_limits::max() / 3) return CString(); Vector bufferVector(length * 3); char* buffer = bufferVector.data(); @@ -2107,7 +2109,7 @@ CString StringImpl::utf8ForRange(unsigned offset, unsigned length, ConversionMod // * We could allocate a CStringBuffer with an appropriate size to // have a good chance of being able to write the string into the // buffer without reallocing (say, 1.5 x length). - if (length > std::numeric_limits::max() / 3) + if (length > numeric_limits::max() / 3) return CString(); Vector bufferVector(length * 3); diff --git a/WTF/wtf/text/StringImpl.h b/WTF/wtf/text/StringImpl.h index 770acf00..e0846ff5 100644 --- a/WTF/wtf/text/StringImpl.h +++ b/WTF/wtf/text/StringImpl.h @@ -43,6 +43,10 @@ typedef const struct __CFString * CFStringRef; @class NSString; #endif +#if PLATFORM(BLACKBERRY) +#include +#endif + // FIXME: This is a temporary layering violation while we move string code to WTF. // Landing the file moves in one patch, will follow on with patches to change the namespaces. namespace JSC { @@ -450,10 +454,10 @@ class StringImpl { unsigned length() const { return m_length; } bool is8Bit() const { return m_hashAndFlags & s_hashFlag8BitBuffer; } + // FIXME: Remove all unnecessary usages of characters() ALWAYS_INLINE const LChar* characters8() const { ASSERT(is8Bit()); return m_data8; } ALWAYS_INLINE const UChar* characters16() const { ASSERT(!is8Bit()); return m_data16; } - const UChar* characters() const { return deprecatedCharacters(); } // FIXME: Delete this. - ALWAYS_INLINE const UChar* deprecatedCharacters() const + ALWAYS_INLINE const UChar* characters() const { if (!is8Bit()) return m_data16; @@ -865,7 +869,7 @@ template <> ALWAYS_INLINE const LChar* StringImpl::getCharacters() const { return characters8(); } template <> -ALWAYS_INLINE const UChar* StringImpl::getCharacters() const { return deprecatedCharacters(); } +ALWAYS_INLINE const UChar* StringImpl::getCharacters() const { return characters(); } WTF_EXPORT_STRING_API bool equal(const StringImpl*, const StringImpl*); WTF_EXPORT_STRING_API bool equal(const StringImpl*, const LChar*); @@ -1255,7 +1259,7 @@ bool equalIgnoringNullity(const Vector& a, StringImpl* b) return !a.size(); if (a.size() != b->length()) return false; - return !memcmp(a.data(), b->deprecatedCharacters(), b->length() * sizeof(UChar)); + return !memcmp(a.data(), b->characters(), b->length() * sizeof(UChar)); } template diff --git a/WTF/wtf/text/StringView.h b/WTF/wtf/text/StringView.h deleted file mode 100644 index 70f4eb0c..00000000 --- a/WTF/wtf/text/StringView.h +++ /dev/null @@ -1,157 +0,0 @@ -/* - * Copyright (C) 2014 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. - */ - -#ifndef StringView_h -#define StringView_h - -#include - -namespace WTF { - -// StringView is a non-owning reference to a string, similar to the proposed std::string_view. -// Whether the string is 8-bit or 16-bit is encoded in the upper bit of the length member. -// This means that strings longer than 2 Gigabytes can not be represented. If that turns out to be -// a problem we can investigate alternative solutions. - -class StringView { -public: - StringView() - : m_characters(nullptr) - , m_length(0) - { - } - - StringView(const LChar* characters, unsigned length) - { - initialize(characters, length); - } - - StringView(const UChar* characters, unsigned length) - { - initialize(characters, length); - } - - StringView(const String& string) - : m_characters(nullptr) - , m_length(0) - { - if (!string.impl()) - return; - - if (string.is8Bit()) - initialize(string.characters8(), string.length()); - else - initialize(string.characters16(), string.length()); - } - - static StringView empty() - { - return StringView(reinterpret_cast(""), 0); - } - - const LChar* characters8() const - { - ASSERT(is8Bit()); - - return static_cast(m_characters); - } - - const UChar* characters16() const - { - ASSERT(!is8Bit()); - - return static_cast(m_characters); - } - - bool isNull() const { return !m_characters; } - bool isEmpty() const { return !length(); } - unsigned length() const { return m_length & ~is16BitStringFlag; } - - explicit operator bool() const { return !isNull(); } - - bool is8Bit() const { return !(m_length & is16BitStringFlag); } - - StringView substring(unsigned start, unsigned length = std::numeric_limits::max()) const - { - if (start >= this->length()) - return empty(); - unsigned maxLength = this->length() - start; - - if (length >= maxLength) { - if (!start) - return *this; - length = maxLength; - } - - if (is8Bit()) - return StringView(characters8() + start, length); - - return StringView(characters16() + start, length); - } - - String toString() const - { - if (is8Bit()) - return String(characters8(), length()); - - return String(characters16(), length()); - } - - String toStringWithoutCopying() const - { - if (is8Bit()) - return StringImpl::createWithoutCopying(characters8(), length()); - - return StringImpl::createWithoutCopying(characters16(), length()); - } - -private: - void initialize(const LChar* characters, unsigned length) - { - ASSERT(!(length & is16BitStringFlag)); - - m_characters = characters; - m_length = length; - } - - void initialize(const UChar* characters, unsigned length) - { - ASSERT(!(length & is16BitStringFlag)); - - m_characters = characters; - m_length = is16BitStringFlag | length; - } - - static const unsigned is16BitStringFlag = 1u << 31; - - const void* m_characters; - unsigned m_length; -}; - -} // namespace WTF - -using WTF::StringView; - -#endif // StringView_h diff --git a/WTF/wtf/text/WTFString.cpp b/WTF/wtf/text/WTFString.cpp index 45ba8af5..bc773da9 100644 --- a/WTF/wtf/text/WTFString.cpp +++ b/WTF/wtf/text/WTFString.cpp @@ -37,9 +37,12 @@ #include #include +using namespace std; + namespace WTF { using namespace Unicode; +using namespace std; // Construct a string with UTF-16 data. String::String(const UChar* characters, unsigned length) @@ -101,7 +104,7 @@ void String::append(const String& str) if (m_impl) { if (m_impl->is8Bit() && str.m_impl->is8Bit()) { LChar* data; - if (str.length() > std::numeric_limits::max() - m_impl->length()) + if (str.length() > numeric_limits::max() - m_impl->length()) CRASH(); RefPtr newImpl = StringImpl::createUninitialized(m_impl->length() + str.length(), data); memcpy(data, m_impl->characters8(), m_impl->length() * sizeof(LChar)); @@ -110,11 +113,11 @@ void String::append(const String& str) return; } UChar* data; - if (str.length() > std::numeric_limits::max() - m_impl->length()) + if (str.length() > numeric_limits::max() - m_impl->length()) CRASH(); RefPtr newImpl = StringImpl::createUninitialized(m_impl->length() + str.length(), data); - memcpy(data, m_impl->deprecatedCharacters(), m_impl->length() * sizeof(UChar)); - memcpy(data + m_impl->length(), str.deprecatedCharacters(), str.length() * sizeof(UChar)); + memcpy(data, m_impl->characters(), m_impl->length() * sizeof(UChar)); + memcpy(data + m_impl->length(), str.characters(), str.length() * sizeof(UChar)); m_impl = newImpl.release(); } else m_impl = str.m_impl; @@ -130,10 +133,10 @@ inline void String::appendInternal(CharacterType c) // call to fastMalloc every single time. if (m_impl) { UChar* data; - if (m_impl->length() >= std::numeric_limits::max()) + if (m_impl->length() >= numeric_limits::max()) CRASH(); RefPtr newImpl = StringImpl::createUninitialized(m_impl->length() + 1, data); - memcpy(data, m_impl->deprecatedCharacters(), m_impl->length() * sizeof(UChar)); + memcpy(data, m_impl->characters(), m_impl->length() * sizeof(UChar)); data[m_impl->length()] = c; m_impl = newImpl.release(); } else @@ -164,7 +167,7 @@ void String::insert(const String& str, unsigned pos) m_impl = str.impl(); return; } - insert(str.deprecatedCharacters(), str.length(), pos); + insert(str.characters(), str.length(), pos); } void String::append(const LChar* charactersToAppend, unsigned lengthToAppend) @@ -184,7 +187,7 @@ void String::append(const LChar* charactersToAppend, unsigned lengthToAppend) unsigned strLength = m_impl->length(); if (m_impl->is8Bit()) { - if (lengthToAppend > std::numeric_limits::max() - strLength) + if (lengthToAppend > numeric_limits::max() - strLength) CRASH(); LChar* data; RefPtr newImpl = StringImpl::createUninitialized(strLength + lengthToAppend, data); @@ -194,7 +197,7 @@ void String::append(const LChar* charactersToAppend, unsigned lengthToAppend) return; } - if (lengthToAppend > std::numeric_limits::max() - strLength) + if (lengthToAppend > numeric_limits::max() - strLength) CRASH(); UChar* data; RefPtr newImpl = StringImpl::createUninitialized(length() + lengthToAppend, data); @@ -218,7 +221,7 @@ void String::append(const UChar* charactersToAppend, unsigned lengthToAppend) unsigned strLength = m_impl->length(); ASSERT(charactersToAppend); - if (lengthToAppend > std::numeric_limits::max() - strLength) + if (lengthToAppend > numeric_limits::max() - strLength) CRASH(); UChar* data; RefPtr newImpl = StringImpl::createUninitialized(strLength + lengthToAppend, data); @@ -245,12 +248,12 @@ void String::insert(const UChar* charactersToInsert, unsigned lengthToInsert, un ASSERT(charactersToInsert); UChar* data; - if (lengthToInsert > std::numeric_limits::max() - length()) + if (lengthToInsert > numeric_limits::max() - length()) CRASH(); RefPtr newImpl = StringImpl::createUninitialized(length() + lengthToInsert, data); - memcpy(data, deprecatedCharacters(), position * sizeof(UChar)); + memcpy(data, characters(), position * sizeof(UChar)); memcpy(data + position, charactersToInsert, lengthToInsert * sizeof(UChar)); - memcpy(data + position + lengthToInsert, deprecatedCharacters() + position, (length() - position) * sizeof(UChar)); + memcpy(data + position + lengthToInsert, characters() + position, (length() - position) * sizeof(UChar)); m_impl = newImpl.release(); } @@ -267,7 +270,7 @@ void String::truncate(unsigned position) return; UChar* data; RefPtr newImpl = StringImpl::createUninitialized(position, data); - memcpy(data, deprecatedCharacters(), position * sizeof(UChar)); + memcpy(data, characters(), position * sizeof(UChar)); m_impl = newImpl.release(); } @@ -313,8 +316,8 @@ String String::substringSharingImpl(unsigned offset, unsigned length) const // FIXME: We used to check against a limit of Heap::minExtraCost / sizeof(UChar). unsigned stringLength = this->length(); - offset = std::min(offset, stringLength); - length = std::min(length, stringLength - offset); + offset = min(offset, stringLength); + length = min(length, stringLength - offset); if (!offset && length == stringLength) return *this; @@ -399,7 +402,7 @@ bool String::percentage(int& result) const if ((*m_impl)[m_impl->length() - 1] != '%') return false; - result = charactersToIntStrict(m_impl->deprecatedCharacters(), m_impl->length() - 1); + result = charactersToIntStrict(m_impl->characters(), m_impl->length() - 1); return true; } @@ -830,7 +833,7 @@ String String::make16BitFrom8BitSource(const LChar* source, size_t length) String String::fromUTF8(const LChar* stringStart, size_t length) { - if (length > std::numeric_limits::max()) + if (length > numeric_limits::max()) CRASH(); if (!stringStart) @@ -895,8 +898,8 @@ static bool isCharacterAllowedInBase(UChar c, int base) template static inline IntegralType toIntegralType(const CharType* data, size_t length, bool* ok, int base) { - static const IntegralType integralMax = std::numeric_limits::max(); - static const bool isSigned = std::numeric_limits::is_signed; + static const IntegralType integralMax = numeric_limits::max(); + static const bool isSigned = numeric_limits::is_signed; const IntegralType maxMultiplier = integralMax / base; IntegralType value = 0; diff --git a/WTF/wtf/text/WTFString.h b/WTF/wtf/text/WTFString.h index c4011bc8..b3d8406c 100644 --- a/WTF/wtf/text/WTFString.h +++ b/WTF/wtf/text/WTFString.h @@ -32,6 +32,14 @@ #include #endif +#if PLATFORM(BLACKBERRY) +namespace BlackBerry { +namespace Platform { +class String; +} +} +#endif + namespace WTF { class CString; @@ -156,14 +164,13 @@ class String { return m_impl->length(); } - const UChar* characters() const { return deprecatedCharacters(); } // FIXME: Delete this. - const UChar* deprecatedCharacters() const + const UChar* characters() const { if (!m_impl) return 0; - return m_impl->deprecatedCharacters(); + return m_impl->characters(); } - + const LChar* characters8() const { if (!m_impl) @@ -407,6 +414,11 @@ class String { operator NSString*() const { if (!m_impl) return @""; return *m_impl; } #endif +#if PLATFORM(BLACKBERRY) + String(const BlackBerry::Platform::String&); + operator BlackBerry::Platform::String() const; +#endif + WTF_EXPORT_STRING_API static String make8BitFrom16BitSource(const UChar*, size_t); template static String make8BitFrom16BitSource(const Vector& buffer) @@ -541,7 +553,7 @@ inline const LChar* String::getCharactersWithUpconvert() const template<> inline const UChar* String::getCharactersWithUpconvert() const { - return deprecatedCharacters(); + return characters(); } inline bool String::containsOnlyLatin1() const @@ -588,7 +600,7 @@ inline bool codePointCompareLessThan(const String& a, const String& b) template inline void append(Vector& vector, const String& string) { - vector.append(string.deprecatedCharacters(), string.length()); + vector.append(string.characters(), string.length()); } template diff --git a/WTF/wtf/unicode/Collator.h b/WTF/wtf/unicode/Collator.h index 0f2039ee..e23549ac 100644 --- a/WTF/wtf/unicode/Collator.h +++ b/WTF/wtf/unicode/Collator.h @@ -58,7 +58,6 @@ namespace WTF { void releaseCollator(); mutable UCollator* m_collator; #endif - #if !UCONFIG_NO_COLLATION char* m_locale; bool m_lowerFirst; diff --git a/WTF/wtf/unicode/icu/CollatorICU.cpp b/WTF/wtf/unicode/icu/CollatorICU.cpp index 209c0230..6de6404c 100644 --- a/WTF/wtf/unicode/icu/CollatorICU.cpp +++ b/WTF/wtf/unicode/icu/CollatorICU.cpp @@ -31,9 +31,9 @@ #if USE(ICU_UNICODE) && !UCONFIG_NO_COLLATION -#include #include #include +#include #include #include @@ -45,16 +45,10 @@ namespace WTF { static UCollator* cachedCollator; - -static std::mutex& cachedCollatorMutex() +static Mutex& cachedCollatorMutex() { - static std::once_flag onceFlag; - static std::mutex* mutex; - std::call_once(onceFlag, []{ - mutex = std::make_unique().release(); - }); - - return *mutex; + AtomicallyInitializedStatic(Mutex&, mutex = *new Mutex); + return mutex; } Collator::Collator(const char* locale) @@ -110,7 +104,7 @@ void Collator::createCollator() const UErrorCode status = U_ZERO_ERROR; { - std::lock_guard lock(cachedCollatorMutex()); + Locker lock(cachedCollatorMutex()); if (cachedCollator) { const char* cachedCollatorLocale = ucol_getLocaleByType(cachedCollator, ULOC_REQUESTED_LOCALE, &status); ASSERT(U_SUCCESS(status)); @@ -123,7 +117,7 @@ void Collator::createCollator() const if (m_locale && 0 == strcmp(cachedCollatorLocale, m_locale) && ((UCOL_LOWER_FIRST == cachedCollatorLowerFirst && m_lowerFirst) || (UCOL_UPPER_FIRST == cachedCollatorLowerFirst && !m_lowerFirst))) { m_collator = cachedCollator; - cachedCollator = nullptr; + cachedCollator = 0; return; } } @@ -146,11 +140,11 @@ void Collator::createCollator() const void Collator::releaseCollator() { { - std::lock_guard lock(cachedCollatorMutex()); + Locker lock(cachedCollatorMutex()); if (cachedCollator) ucol_close(cachedCollator); cachedCollator = m_collator; - m_collator = nullptr; + m_collator = 0; } } diff --git a/WTF/wtf/win/RunLoopWin.cpp b/WTF/wtf/win/RunLoopWin.cpp index 17bee6f7..33531b63 100644 --- a/WTF/wtf/win/RunLoopWin.cpp +++ b/WTF/wtf/win/RunLoopWin.cpp @@ -29,6 +29,8 @@ #include #include +using namespace std; + namespace WTF { static const UINT PerformWorkMessage = WM_USER + 1; From b43a796671c2451833014d41bd353801c6fdd85f Mon Sep 17 00:00:00 2001 From: Dominic Szablewski Date: Thu, 23 Jan 2014 12:38:21 +0100 Subject: [PATCH 47/69] Disable DFG and YARR JIT to save some space --- JavaScriptCore-iOS-Static.xcconfig | 2 +- WTF-iOS-Static.xcconfig | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/JavaScriptCore-iOS-Static.xcconfig b/JavaScriptCore-iOS-Static.xcconfig index cfd647a3..d1e7ae3f 100644 --- a/JavaScriptCore-iOS-Static.xcconfig +++ b/JavaScriptCore-iOS-Static.xcconfig @@ -25,7 +25,7 @@ SECTORDER_FLAGS_iphoneos = ; GCC_GENERATE_DEBUGGING_SYMBOLS = NO; GCC_OPTIMIZATION_LEVEL = 3; -GCC_PREPROCESSOR_DEFINITIONS = $(DEBUG_DEFINES) HAVE_DTRACE=$(HAVE_DTRACE) WEBKIT_VERSION_MIN_REQUIRED=WEBKIT_VERSION_LATEST HAVE_HEADER_DETECTION_H JSC_OBJC_API_ENABLED=0 JSC_OBJC_API_AVAILABLE_MAC_OS_X_1080 $(FEATURE_DEFINES) $(GCC_PREPROCESSOR_DEFINITIONS) __MAC_OS_X_VERSION_MIN_REQUIRED=0; +GCC_PREPROCESSOR_DEFINITIONS = $(DEBUG_DEFINES) HAVE_DTRACE=$(HAVE_DTRACE) WEBKIT_VERSION_MIN_REQUIRED=WEBKIT_VERSION_LATEST HAVE_HEADER_DETECTION_H JSC_OBJC_API_ENABLED=0 JSC_OBJC_API_AVAILABLE_MAC_OS_X_1080 $(FEATURE_DEFINES) $(GCC_PREPROCESSOR_DEFINITIONS) __MAC_OS_X_VERSION_MIN_REQUIRED=0 ENABLE_DFG_JIT=0 ENABLE_YARR_JIT=0; ENABLE_REMOTE_INSPECTOR = ENABLE_REMOTE_INSPECTOR=0; // Requires XPC diff --git a/WTF-iOS-Static.xcconfig b/WTF-iOS-Static.xcconfig index a13cd414..e1d6fac3 100644 --- a/WTF-iOS-Static.xcconfig +++ b/WTF-iOS-Static.xcconfig @@ -14,7 +14,7 @@ ONLY_ACTIVE_ARCH = NO SDKROOT = iphoneos SUPPORTED_PLATFORMS = iphoneos iphonesimulator IPHONEOS_DEPLOYMENT_TARGET = 5.1 -GCC_PREPROCESSOR_DEFINITIONS = $(DEBUG_DEFINES) WEBKIT_VERSION_MIN_REQUIRED=WEBKIT_VERSION_LATEST HAVE_HEADER_DETECTION_H $(GCC_PREPROCESSOR_DEFINITIONS) TARGET_OS_IPHONE __MAC_OS_X_VERSION_MIN_REQUIRED=0 UCONFIG_NO_COLLATION=1 +GCC_PREPROCESSOR_DEFINITIONS = $(DEBUG_DEFINES) WEBKIT_VERSION_MIN_REQUIRED=WEBKIT_VERSION_LATEST HAVE_HEADER_DETECTION_H $(GCC_PREPROCESSOR_DEFINITIONS) TARGET_OS_IPHONE __MAC_OS_X_VERSION_MIN_REQUIRED=0 UCONFIG_NO_COLLATION=1 ENABLE_DFG_JIT=0 ENABLE_YARR_JIT=0; PRIVATE_HEADERS_FOLDER_PATH = /dev/null; PUBLIC_HEADERS_FOLDER_PATH = /dev/null; PRECOMPS_INCLUDE_HEADERS_FROM_BUILT_PRODUCTS_DIR = NO; From bda05b4960afe44cfc7433ec86460af1fcf90304 Mon Sep 17 00:00:00 2001 From: Dominic Szablewski Date: Thu, 23 Jan 2014 12:39:43 +0100 Subject: [PATCH 48/69] Reflected current version in README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 88de5544..a4318902 100644 --- a/README.md +++ b/README.md @@ -4,7 +4,7 @@ The JavaScriptCore library is part of the [WebKit project](http://www.webkit.org This repo aims to re-produce the missing iOS targets while staying on a somewhat up-to-date version. -Currently, the [Safari-538.12.1 tag](https://svn.webkit.org/repository/webkit/tags/Safari-538.12.1/) is used as the basis. With the current settings, the WTF and JavaScriptCore libraries can be compiled for armv7, armv7s, arm64 and x86 (for the iOS simulator). It will be compiled without Unicode collation support, because Apple claims [ICU](http://site.icu-project.org/) is a private framework on iOS. It should be AppStore compatible this way. +Currently, the [Safari-538.11.1 tag](https://svn.webkit.org/repository/webkit/tags/Safari-538.11.1/) is used as the basis. With the current settings, the WTF and JavaScriptCore libraries can be compiled for armv7, armv7s, arm64 and x86 (for the iOS simulator). It will be compiled without Unicode collation support, because Apple claims [ICU](http://site.icu-project.org/) is a private framework on iOS. It should be AppStore compatible this way. This version of JSC deprecates the `typed-arrays` branch of this repository. JSC now supports Typed Arrays natively, without any hacks. From 5ccc9e024e33b4f6c04f6effc280e4dfabfd31ce Mon Sep 17 00:00:00 2001 From: Dominic Szablewski Date: Thu, 23 Jan 2014 13:49:30 +0100 Subject: [PATCH 49/69] Enable DFG_JIT again, otherwise some llint symbols are not exported. No idea why. --- JavaScriptCore-iOS-Static.xcconfig | 2 +- WTF-iOS-Static.xcconfig | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/JavaScriptCore-iOS-Static.xcconfig b/JavaScriptCore-iOS-Static.xcconfig index d1e7ae3f..553e9977 100644 --- a/JavaScriptCore-iOS-Static.xcconfig +++ b/JavaScriptCore-iOS-Static.xcconfig @@ -25,7 +25,7 @@ SECTORDER_FLAGS_iphoneos = ; GCC_GENERATE_DEBUGGING_SYMBOLS = NO; GCC_OPTIMIZATION_LEVEL = 3; -GCC_PREPROCESSOR_DEFINITIONS = $(DEBUG_DEFINES) HAVE_DTRACE=$(HAVE_DTRACE) WEBKIT_VERSION_MIN_REQUIRED=WEBKIT_VERSION_LATEST HAVE_HEADER_DETECTION_H JSC_OBJC_API_ENABLED=0 JSC_OBJC_API_AVAILABLE_MAC_OS_X_1080 $(FEATURE_DEFINES) $(GCC_PREPROCESSOR_DEFINITIONS) __MAC_OS_X_VERSION_MIN_REQUIRED=0 ENABLE_DFG_JIT=0 ENABLE_YARR_JIT=0; +GCC_PREPROCESSOR_DEFINITIONS = $(DEBUG_DEFINES) HAVE_DTRACE=$(HAVE_DTRACE) WEBKIT_VERSION_MIN_REQUIRED=WEBKIT_VERSION_LATEST HAVE_HEADER_DETECTION_H JSC_OBJC_API_ENABLED=0 JSC_OBJC_API_AVAILABLE_MAC_OS_X_1080 $(FEATURE_DEFINES) $(GCC_PREPROCESSOR_DEFINITIONS) __MAC_OS_X_VERSION_MIN_REQUIRED=0 ENABLE_YARR_JIT=0; ENABLE_REMOTE_INSPECTOR = ENABLE_REMOTE_INSPECTOR=0; // Requires XPC diff --git a/WTF-iOS-Static.xcconfig b/WTF-iOS-Static.xcconfig index e1d6fac3..69ec7635 100644 --- a/WTF-iOS-Static.xcconfig +++ b/WTF-iOS-Static.xcconfig @@ -14,7 +14,7 @@ ONLY_ACTIVE_ARCH = NO SDKROOT = iphoneos SUPPORTED_PLATFORMS = iphoneos iphonesimulator IPHONEOS_DEPLOYMENT_TARGET = 5.1 -GCC_PREPROCESSOR_DEFINITIONS = $(DEBUG_DEFINES) WEBKIT_VERSION_MIN_REQUIRED=WEBKIT_VERSION_LATEST HAVE_HEADER_DETECTION_H $(GCC_PREPROCESSOR_DEFINITIONS) TARGET_OS_IPHONE __MAC_OS_X_VERSION_MIN_REQUIRED=0 UCONFIG_NO_COLLATION=1 ENABLE_DFG_JIT=0 ENABLE_YARR_JIT=0; +GCC_PREPROCESSOR_DEFINITIONS = $(DEBUG_DEFINES) WEBKIT_VERSION_MIN_REQUIRED=WEBKIT_VERSION_LATEST HAVE_HEADER_DETECTION_H $(GCC_PREPROCESSOR_DEFINITIONS) TARGET_OS_IPHONE __MAC_OS_X_VERSION_MIN_REQUIRED=0 UCONFIG_NO_COLLATION=1 ENABLE_YARR_JIT=0; PRIVATE_HEADERS_FOLDER_PATH = /dev/null; PUBLIC_HEADERS_FOLDER_PATH = /dev/null; PRECOMPS_INCLUDE_HEADERS_FROM_BUILT_PRODUCTS_DIR = NO; From b8c11b64edc0ae4f0224bca05f1dcaf4528db99f Mon Sep 17 00:00:00 2001 From: Dominic Szablewski Date: Thu, 23 Jan 2014 13:54:03 +0100 Subject: [PATCH 50/69] Cleaned up ARCHS --- JavaScriptCore-iOS-Static.xcconfig | 2 +- .../JavaScriptCore.xcodeproj/project.pbxproj | 12 ++++++++++++ WTF-iOS-Static.xcconfig | 2 +- 3 files changed, 14 insertions(+), 2 deletions(-) diff --git a/JavaScriptCore-iOS-Static.xcconfig b/JavaScriptCore-iOS-Static.xcconfig index 553e9977..2b0ef2de 100644 --- a/JavaScriptCore-iOS-Static.xcconfig +++ b/JavaScriptCore-iOS-Static.xcconfig @@ -8,7 +8,7 @@ #include "JavaScriptCore/Configurations/JavaScriptCore.xcconfig" -ARCHS = arm64; +ARCHS = armv7 armv7s arm64; ONLY_ACTIVE_ARCH = NO; SDKROOT = iphoneos; VALID_ARCHS = arm64 armv7 i386; diff --git a/JavaScriptCore/JavaScriptCore.xcodeproj/project.pbxproj b/JavaScriptCore/JavaScriptCore.xcodeproj/project.pbxproj index 9ae1befb..3a6db3c7 100644 --- a/JavaScriptCore/JavaScriptCore.xcodeproj/project.pbxproj +++ b/JavaScriptCore/JavaScriptCore.xcodeproj/project.pbxproj @@ -8822,7 +8822,10 @@ isa = XCBuildConfiguration; baseConfigurationReference = 10EAA7001889E6C600DEB161 /* ToolExecutable-iOS-Static.xcconfig */; buildSettings = { + ARCHS = "$(ARCHS_STANDARD_INCLUDING_64_BIT)"; PRODUCT_NAME = JSCLLIntOffsetsExtractor; + SDKROOT = iphoneos7.0; + VALID_ARCHS = "armv7 armv7s arm64"; }; name = Debug; }; @@ -8830,7 +8833,10 @@ isa = XCBuildConfiguration; baseConfigurationReference = 10EAA7001889E6C600DEB161 /* ToolExecutable-iOS-Static.xcconfig */; buildSettings = { + ARCHS = "$(ARCHS_STANDARD_INCLUDING_64_BIT)"; PRODUCT_NAME = JSCLLIntOffsetsExtractor; + SDKROOT = iphoneos7.0; + VALID_ARCHS = "armv7 armv7s arm64"; }; name = Release; }; @@ -8838,7 +8844,10 @@ isa = XCBuildConfiguration; baseConfigurationReference = 10EAA7001889E6C600DEB161 /* ToolExecutable-iOS-Static.xcconfig */; buildSettings = { + ARCHS = "$(ARCHS_STANDARD_INCLUDING_64_BIT)"; PRODUCT_NAME = JSCLLIntOffsetsExtractor; + SDKROOT = iphoneos7.0; + VALID_ARCHS = "armv7 armv7s arm64"; }; name = Profiling; }; @@ -8846,7 +8855,10 @@ isa = XCBuildConfiguration; baseConfigurationReference = 10EAA7001889E6C600DEB161 /* ToolExecutable-iOS-Static.xcconfig */; buildSettings = { + ARCHS = "$(ARCHS_STANDARD_INCLUDING_64_BIT)"; PRODUCT_NAME = JSCLLIntOffsetsExtractor; + SDKROOT = iphoneos7.0; + VALID_ARCHS = "armv7 armv7s arm64"; }; name = Production; }; diff --git a/WTF-iOS-Static.xcconfig b/WTF-iOS-Static.xcconfig index 69ec7635..b931081d 100644 --- a/WTF-iOS-Static.xcconfig +++ b/WTF-iOS-Static.xcconfig @@ -9,7 +9,7 @@ #include "WTF/Configurations/WTF.xcconfig" PRODUCT_NAME = WTF -ARCHS = arm64 armv7 +ARCHS = arm64 armv7 armv7s ONLY_ACTIVE_ARCH = NO SDKROOT = iphoneos SUPPORTED_PLATFORMS = iphoneos iphonesimulator From a20de6819803307db95af87d5376bb865a09e8b6 Mon Sep 17 00:00:00 2001 From: Dominic Szablewski Date: Tue, 28 Jan 2014 12:01:38 +0100 Subject: [PATCH 51/69] Cleaned up archs... again --- .../JavaScriptCore.xcodeproj/project.pbxproj | 22 ++++++++++++------- 1 file changed, 14 insertions(+), 8 deletions(-) diff --git a/JavaScriptCore/JavaScriptCore.xcodeproj/project.pbxproj b/JavaScriptCore/JavaScriptCore.xcodeproj/project.pbxproj index 3a6db3c7..4e24771d 100644 --- a/JavaScriptCore/JavaScriptCore.xcodeproj/project.pbxproj +++ b/JavaScriptCore/JavaScriptCore.xcodeproj/project.pbxproj @@ -7312,9 +7312,9 @@ 14BD59BE0A3E8F9000BAF59C /* testapi */, 932F5BDA0822A1C700736975 /* jsc */, 651122F714046A4C002B101D /* testRegExp */, - 0F4680A914BA7FD900BFE272 /* LLInt Offsets */, - 0FF922C314F46B130041A24E /* JSCLLIntOffsetsExtractor */, 5D6B2A47152B9E17005231DE /* Test Tools */, + 0FF922C314F46B130041A24E /* JSCLLIntOffsetsExtractor */, + 0F4680A914BA7FD900BFE272 /* LLInt Offsets */, 0FCEFAB51805D61600472CE4 /* llvmForJSC */, 10D58E011889C1A000C05A0D /* JSCLLIntOffsetsExtractor iOS */, 10D58E0D1889C3DF00C05A0D /* JavaScriptCore iOS */, @@ -8737,28 +8737,36 @@ 0F4680AD14BA7FD900BFE272 /* Debug */ = { isa = XCBuildConfiguration; buildSettings = { + ARCHS = "$(ARCHS_STANDARD_INCLUDING_64_BIT)"; PRODUCT_NAME = "Derived Sources copy"; + SDKROOT = iphoneos; }; name = Debug; }; 0F4680AE14BA7FD900BFE272 /* Release */ = { isa = XCBuildConfiguration; buildSettings = { + ARCHS = "$(ARCHS_STANDARD_INCLUDING_64_BIT)"; PRODUCT_NAME = "Derived Sources copy"; + SDKROOT = iphoneos; }; name = Release; }; 0F4680AF14BA7FD900BFE272 /* Profiling */ = { isa = XCBuildConfiguration; buildSettings = { + ARCHS = "$(ARCHS_STANDARD_INCLUDING_64_BIT)"; PRODUCT_NAME = "Derived Sources copy"; + SDKROOT = iphoneos; }; name = Profiling; }; 0F4680B014BA7FD900BFE272 /* Production */ = { isa = XCBuildConfiguration; buildSettings = { + ARCHS = "$(ARCHS_STANDARD_INCLUDING_64_BIT)"; PRODUCT_NAME = "Derived Sources copy"; + SDKROOT = iphoneos; }; name = Production; }; @@ -8877,7 +8885,6 @@ baseConfigurationReference = 10EAA6FF1889E6B300DEB161 /* JavaScriptCore-iOS-Static.xcconfig */; buildSettings = { ARCHS = "$(ARCHS_STANDARD_INCLUDING_64_BIT)"; - ONLY_ACTIVE_ARCH = NO; VALID_ARCHS = "armv7 armv7s arm64"; }; name = Release; @@ -8887,7 +8894,6 @@ baseConfigurationReference = 10EAA6FF1889E6B300DEB161 /* JavaScriptCore-iOS-Static.xcconfig */; buildSettings = { ARCHS = "$(ARCHS_STANDARD_INCLUDING_64_BIT)"; - ONLY_ACTIVE_ARCH = NO; VALID_ARCHS = "armv7 armv7s arm64"; }; name = Profiling; @@ -8908,7 +8914,7 @@ baseConfigurationReference = 10EAA6FF1889E6B300DEB161 /* JavaScriptCore-iOS-Static.xcconfig */; buildSettings = { PRODUCT_NAME = "Derived Sources copy"; - VALID_ARCHS = arm64; + VALID_ARCHS = "arm64 armv7 armv7s"; }; name = Debug; }; @@ -8917,7 +8923,7 @@ baseConfigurationReference = 10EAA6FF1889E6B300DEB161 /* JavaScriptCore-iOS-Static.xcconfig */; buildSettings = { PRODUCT_NAME = "Derived Sources copy"; - VALID_ARCHS = arm64; + VALID_ARCHS = "arm64 armv7 armv7s"; }; name = Release; }; @@ -8926,7 +8932,7 @@ baseConfigurationReference = 10EAA6FF1889E6B300DEB161 /* JavaScriptCore-iOS-Static.xcconfig */; buildSettings = { PRODUCT_NAME = "Derived Sources copy"; - VALID_ARCHS = arm64; + VALID_ARCHS = "arm64 armv7 armv7s"; }; name = Profiling; }; @@ -8935,7 +8941,7 @@ baseConfigurationReference = 10EAA6FF1889E6B300DEB161 /* JavaScriptCore-iOS-Static.xcconfig */; buildSettings = { PRODUCT_NAME = "Derived Sources copy"; - VALID_ARCHS = arm64; + VALID_ARCHS = "arm64 armv7 armv7s"; }; name = Production; }; From 62e6116eaf2a1a7d4707e6cfeefe6fcf372a9d13 Mon Sep 17 00:00:00 2001 From: Dominic Szablewski Date: Tue, 28 Jan 2014 12:01:58 +0100 Subject: [PATCH 52/69] Modified build script to build all archs separately --- xcodebuild.py | 22 ++++++++++++++-------- 1 file changed, 14 insertions(+), 8 deletions(-) diff --git a/xcodebuild.py b/xcodebuild.py index d7e37ef8..34f662c4 100644 --- a/xcodebuild.py +++ b/xcodebuild.py @@ -123,12 +123,14 @@ def __init__(self, project=None, workspace=None, scheme=None, derived_data_path=None): self.scheme = scheme self.name = name - self.devicebuild = XcodeBuild(project, - derived_data_path=derived_data_path) - self.simulatorbuild = XcodeBuild(project, - derived_data_path=derived_data_path) + self.devicebuildarm64 = XcodeBuild(project, derived_data_path=derived_data_path) + self.devicebuildarmv7 = XcodeBuild(project, derived_data_path=derived_data_path) + self.devicebuildarmv7s = XcodeBuild(project, derived_data_path=derived_data_path) + self.simulatorbuild = XcodeBuild(project, derived_data_path=derived_data_path) self.outdir = outdir - for (bld, archs) in [self.devicebuild, ["arm64", "armv7", "armv7s"]], \ + for (bld, archs) in [self.devicebuildarm64, ["arm64"]], \ + [self.devicebuildarmv7, ["armv7"]], \ + [self.devicebuildarmv7s, ["armv7s"]], \ [self.simulatorbuild, ["i386"]]: bld.archs = archs bld.scheme = scheme @@ -140,7 +142,9 @@ def build(self): name = name.replace(" ", "-") # Run the builds of the libraries: - self.devicebuild.build() + self.devicebuildarm64.build() + self.devicebuildarmv7.build() + self.devicebuildarmv7s.build() self.simulatorbuild.build() # Create the framework directory structure: @@ -159,11 +163,13 @@ def build(self): os.path.join(framework_dir, name)) # Move public headers: - os.renames(self.devicebuild.public_headers_path(), headers_dir) + os.renames(self.devicebuildarm64.public_headers_path(), headers_dir) # Use lipo to create one fat static library: lipo_cmd = ["lipo", "-create", - self.devicebuild.built_product_path(), + self.devicebuildarm64.built_product_path(), + self.devicebuildarmv7.built_product_path(), + self.devicebuildarmv7s.built_product_path(), self.simulatorbuild.built_product_path(), "-output", lib_path] logging.debug("Executing: %s" % " ".join(lipo_cmd)) From f94c785fd32b4987a522afba69a6473cbe9bf418 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Rodri=CC=81guez=20Troitin=CC=83o?= Date: Tue, 17 Jun 2014 16:28:49 +0200 Subject: [PATCH 53/69] Align ARM64 assembly to 4-bytes multiple addresses. --- JavaScriptCore/llint/LowLevelInterpreter.cpp | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/JavaScriptCore/llint/LowLevelInterpreter.cpp b/JavaScriptCore/llint/LowLevelInterpreter.cpp index c45dcaa2..02b0cf87 100644 --- a/JavaScriptCore/llint/LowLevelInterpreter.cpp +++ b/JavaScriptCore/llint/LowLevelInterpreter.cpp @@ -536,6 +536,13 @@ JSValue CLoop::execute(CallFrame* callFrame, Opcode entryOpcode, bool isInitiali ".thumb\n" \ ".thumb_func " THUMB_FUNC_PARAM(label) "\n" \ SYMBOL_STRING(label) ":\n" +#elif CPU(ARM64) +#define OFFLINE_ASM_GLOBAL_LABEL(label) \ + ".text\n" \ + ".align 4\n" \ + ".globl " SYMBOL_STRING(label) "\n" \ + HIDE_SYMBOL(label) "\n" \ + SYMBOL_STRING(label) ":\n" #else #define OFFLINE_ASM_GLOBAL_LABEL(label) \ ".text\n" \ From d4af5847bdd3f6eb3e1ceb6cc412b20e278369bc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Rodri=CC=81guez=20Troitin=CC=83o?= Date: Tue, 17 Jun 2014 16:29:29 +0200 Subject: [PATCH 54/69] Use latest SDK version, instead of an fixed one. --- xcodebuild.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/xcodebuild.py b/xcodebuild.py index 34f662c4..fb73942f 100644 --- a/xcodebuild.py +++ b/xcodebuild.py @@ -20,7 +20,7 @@ class PebbleXcodeBuildException (Exception): class XcodeBuild(object): - sdk_version = "7.0" + sdk_version = "" conf = None archs = None project = None From d7e64458aa0f1d19c6b64929cb893abd993d86b6 Mon Sep 17 00:00:00 2001 From: Dario Segura Date: Tue, 30 Sep 2014 15:35:03 -0400 Subject: [PATCH 55/69] -[IOS8] Project now compiles with iOS 8 and Xcode 6. Fix based in newer JSC versions. --- .../runtime/ArgumentsIteratorConstructor.cpp | 1 + JavaScriptCore/runtime/JSPromiseFunctions.cpp | 1 + JavaScriptCore/runtime/MapConstructor.cpp | 1 + .../runtime/MapIteratorConstructor.cpp | 1 + JavaScriptCore/runtime/SetConstructor.cpp | 1 + .../runtime/SetIteratorConstructor.cpp | 1 + JavaScriptCore/runtime/WeakMapConstructor.cpp | 1 + WTF/wtf/FastMalloc.cpp | 121 +++++++++++------- 8 files changed, 84 insertions(+), 44 deletions(-) diff --git a/JavaScriptCore/runtime/ArgumentsIteratorConstructor.cpp b/JavaScriptCore/runtime/ArgumentsIteratorConstructor.cpp index afb59790..4993cec9 100644 --- a/JavaScriptCore/runtime/ArgumentsIteratorConstructor.cpp +++ b/JavaScriptCore/runtime/ArgumentsIteratorConstructor.cpp @@ -31,6 +31,7 @@ #include "JSCJSValueInlines.h" #include "JSCellInlines.h" #include "JSGlobalObject.h" +#include "StructureInlines.h" namespace JSC { diff --git a/JavaScriptCore/runtime/JSPromiseFunctions.cpp b/JavaScriptCore/runtime/JSPromiseFunctions.cpp index 95490b97..ef5c6a11 100644 --- a/JavaScriptCore/runtime/JSPromiseFunctions.cpp +++ b/JavaScriptCore/runtime/JSPromiseFunctions.cpp @@ -34,6 +34,7 @@ #include "JSPromise.h" #include "JSPromiseConstructor.h" #include "JSPromiseDeferred.h" +#include "StructureInlines.h" namespace JSC { diff --git a/JavaScriptCore/runtime/MapConstructor.cpp b/JavaScriptCore/runtime/MapConstructor.cpp index 9e3a4bf3..04f17d98 100644 --- a/JavaScriptCore/runtime/MapConstructor.cpp +++ b/JavaScriptCore/runtime/MapConstructor.cpp @@ -32,6 +32,7 @@ #include "JSGlobalObject.h" #include "JSMap.h" #include "MapPrototype.h" +#include "StructureInlines.h" namespace JSC { diff --git a/JavaScriptCore/runtime/MapIteratorConstructor.cpp b/JavaScriptCore/runtime/MapIteratorConstructor.cpp index fbc6c8b7..40cc2399 100644 --- a/JavaScriptCore/runtime/MapIteratorConstructor.cpp +++ b/JavaScriptCore/runtime/MapIteratorConstructor.cpp @@ -31,6 +31,7 @@ #include "JSGlobalObject.h" #include "JSMapIterator.h" #include "MapIteratorPrototype.h" +#include "StructureInlines.h" namespace JSC { diff --git a/JavaScriptCore/runtime/SetConstructor.cpp b/JavaScriptCore/runtime/SetConstructor.cpp index b203888d..8ad7e54a 100644 --- a/JavaScriptCore/runtime/SetConstructor.cpp +++ b/JavaScriptCore/runtime/SetConstructor.cpp @@ -33,6 +33,7 @@ #include "JSSet.h" #include "MapData.h" #include "SetPrototype.h" +#include "StructureInlines.h" namespace JSC { diff --git a/JavaScriptCore/runtime/SetIteratorConstructor.cpp b/JavaScriptCore/runtime/SetIteratorConstructor.cpp index c16ff9be..19d716e5 100644 --- a/JavaScriptCore/runtime/SetIteratorConstructor.cpp +++ b/JavaScriptCore/runtime/SetIteratorConstructor.cpp @@ -31,6 +31,7 @@ #include "JSGlobalObject.h" #include "JSSetIterator.h" #include "SetIteratorPrototype.h" +#include "StructureInlines.h" namespace JSC { diff --git a/JavaScriptCore/runtime/WeakMapConstructor.cpp b/JavaScriptCore/runtime/WeakMapConstructor.cpp index f3540faa..ad587ed2 100644 --- a/JavaScriptCore/runtime/WeakMapConstructor.cpp +++ b/JavaScriptCore/runtime/WeakMapConstructor.cpp @@ -31,6 +31,7 @@ #include "JSGlobalObject.h" #include "JSWeakMap.h" #include "WeakMapPrototype.h" +#include "StructureInlines.h" namespace JSC { diff --git a/WTF/wtf/FastMalloc.cpp b/WTF/wtf/FastMalloc.cpp index f115c6d1..e5c78520 100644 --- a/WTF/wtf/FastMalloc.cpp +++ b/WTF/wtf/FastMalloc.cpp @@ -91,6 +91,7 @@ #include #if OS(DARWIN) +#include #include #endif @@ -629,28 +630,45 @@ static ALWAYS_INLINE uint32_t freedObjectEndPoison() // Configuration //------------------------------------------------------------------- -// Not all possible combinations of the following parameters make -// sense. In particular, if kMaxSize increases, you may have to -// increase kNumClasses as well. -#if OS(DARWIN) -# define K_PAGE_SHIFT PAGE_SHIFT -# if (K_PAGE_SHIFT == 12) -# define K_NUM_CLASSES 68 -# elif (K_PAGE_SHIFT == 14) -# define K_NUM_CLASSES 77 -# else -# error "Unsupported PAGE_SHIFT amount" -# endif -#else -# define K_PAGE_SHIFT 12 -# define K_NUM_CLASSES 68 -#endif -static const size_t kPageShift = K_PAGE_SHIFT; -static const size_t kPageSize = 1 << kPageShift; -static const size_t kMaxSize = 32u * 1024; -static const size_t kAlignShift = 3; -static const size_t kAlignment = 1 << kAlignShift; -static const size_t kNumClasses = K_NUM_CLASSES; +//// Not all possible combinations of the following parameters make +//// sense. In particular, if kMaxSize increases, you may have to +//// increase kNumClasses as well. +//#if OS(DARWIN) +//# define K_PAGE_SHIFT PAGE_SHIFT +//# if (K_PAGE_SHIFT == 12) +//# define K_NUM_CLASSES 68 +//# elif (K_PAGE_SHIFT == 14) +//# define K_NUM_CLASSES 77 +//# else +//# error "Unsupported PAGE_SHIFT amount" +//# endif +//#else +//# define K_PAGE_SHIFT 12 +//# define K_NUM_CLASSES 68 +//#endif +//static const size_t kPageShift = K_PAGE_SHIFT; +//static const size_t kPageSize = 1 << kPageShift; +//static const size_t kMaxSize = 32u * 1024; +//static const size_t kAlignShift = 3; +//static const size_t kAlignment = 1 << kAlignShift; +//static const size_t kNumClasses = K_NUM_CLASSES; + + // Type that can hold the length of a run of pages + typedef uintptr_t Length; + + // Not all possible combinations of the following parameters make + // sense. In particular, if kMaxSize increases, you may have to + // increase kNumClasses as well. +#define K_PAGE_SHIFT_MIN 12 +#define K_PAGE_SHIFT_MAX 14 +#define K_NUM_CLASSES_MAX 77 + static size_t kPageShift = 0; + static size_t kNumClasses = 0; + static size_t kPageSize = 0; + static Length kMaxValidPages = 0; + static const size_t kMaxSize = 32u * 1024; + static const size_t kAlignShift = 3; + static const size_t kAlignment = 1 << kAlignShift; // Allocates a big block of memory for the pagemap once we reach more than // 128MB @@ -662,14 +680,14 @@ static const size_t kPageMapBigAllocationThreshold = 128 << 20; // should keep this value big because various incarnations of Linux // have small limits on the number of mmap() regions per // address-space. -static const size_t kMinSystemAlloc = 1 << (20 - kPageShift); +static const size_t kMinSystemAlloc = 1 << (20 - K_PAGE_SHIFT_MAX); // Number of objects to move between a per-thread list and a central // list in one shot. We want this to be not too small so we can // amortize the lock overhead for accessing the central list. Making // it too big may temporarily cause unnecessary memory wastage in the // per-thread free list until the scavenger cleans up the list. -static int num_objects_to_move[kNumClasses]; +static int num_objects_to_move[K_NUM_CLASSES_MAX]; // Maximum length we allow a per-thread free-list to have before we // move objects from it into the corresponding central free-list. We @@ -765,10 +783,10 @@ static inline int ClassIndex(size_t s) { } // Mapping from size class to max size storable in that class -static size_t class_to_size[kNumClasses]; +static size_t class_to_size[K_NUM_CLASSES_MAX]; // Mapping from size class to number of pages to allocate at a time -static size_t class_to_pages[kNumClasses]; +static size_t class_to_pages[K_NUM_CLASSES_MAX]; // Hardened singly linked list. We make this a class to allow compiler to // statically prevent mismatching hardened and non-hardened list @@ -808,12 +826,13 @@ struct TCEntry { HardenedSLL head; // Head of chain of objects. HardenedSLL tail; // Tail of chain of objects. }; -// A central cache freelist can have anywhere from 0 to kNumTransferEntries -// slots to put link list chains into. To keep memory usage bounded the total -// number of TCEntries across size classes is fixed. Currently each size -// class is initially given one TCEntry which also means that the maximum any -// one class can have is kNumClasses. -static const int kNumTransferEntries = kNumClasses; + // A central cache freelist can have anywhere from 0 to kNumTransferEntries + // slots to put link list chains into. To keep memory usage bounded the total + // number of TCEntries across size classes is fixed. Currently each size + // class is initially given one TCEntry which also means that the maximum any + // one class can have is kNumClasses. +#define K_NUM_TRANSFER_ENTRIES_MAX static_cast(K_NUM_CLASSES_MAX) +#define kNumTransferEntries static_cast(kNumClasses) // Note: the following only works for "n"s that fit in 32-bits, but // that is fine since we only use it for small sizes. @@ -917,6 +936,25 @@ static int NumMoveSize(size_t size) { // Initialize the mapping arrays static void InitSizeClasses() { +#if OS(DARWIN) + kPageShift = vm_page_shift; + switch (kPageShift) { + case 12: + kNumClasses = 68; + break; + case 14: + kNumClasses = 77; + break; + default: + CRASH(); + }; +#else + kPageShift = 12; + kNumClasses = 68; +#endif + kPageSize = 1 << kPageShift; + kMaxValidPages = (~static_cast(0)) >> kPageShift; + // Do some sanity checking on add_amount[]/shift_amount[]/class_array[] if (ClassIndex(0) < 0) { MESSAGE("Invalid class index %d for size 0\n", ClassIndex(0)); @@ -1144,11 +1182,6 @@ class PageHeapAllocator { // Type that can hold a page number typedef uintptr_t PageID; -// Type that can hold the length of a run of pages -typedef uintptr_t Length; - -static const Length kMaxValidPages = (~static_cast(0)) >> kPageShift; - // Convert byte size into pages. This won't overflow, but may return // an unreasonably large value if bytes is huge enough. static inline Length pages(size_t bytes) { @@ -1431,7 +1464,7 @@ class TCMalloc_Central_FreeList { // Here we reserve space for TCEntry cache slots. Since one size class can // end up getting all the TCEntries quota in the system we just preallocate // sufficient number of entries here. - TCEntry tc_slots_[kNumTransferEntries]; + TCEntry tc_slots_[K_NUM_TRANSFER_ENTRIES_MAX]; // Number of currently used cached entries in tc_slots_. This variable is // updated under a lock but can be read without one. @@ -1677,7 +1710,7 @@ static const size_t kBitsUnusedOn64Bit = 0; // A three-level map for 64-bit machines template <> class MapSelector<64> { public: - typedef TCMalloc_PageMap3<64 - kPageShift - kBitsUnusedOn64Bit> Type; + typedef TCMalloc_PageMap3<64 - K_PAGE_SHIFT_MIN - kBitsUnusedOn64Bit> Type; typedef PackedCache<64, uint64_t> CacheType; }; #endif @@ -1685,8 +1718,8 @@ template <> class MapSelector<64> { // A two-level map for 32-bit machines template <> class MapSelector<32> { public: - typedef TCMalloc_PageMap2<32 - kPageShift> Type; - typedef PackedCache<32 - kPageShift, uint16_t> CacheType; + typedef TCMalloc_PageMap2<32 - K_PAGE_SHIFT_MIN> Type; + typedef PackedCache<32 - K_PAGE_SHIFT_MIN, uint16_t> CacheType; }; // ------------------------------------------------------------------------- @@ -1932,7 +1965,7 @@ void TCMalloc_PageHeap::init() scavenge_counter_ = 0; // Start scavenging at kMaxPages list scavenge_index_ = kMaxPages-1; - COMPILE_ASSERT(kNumClasses <= (1 << PageMapCache::kValuebits), valuebits); + ASSERT(kNumClasses <= (1 << PageMapCache::kValuebits)); DLL_Init(&large_.normal, entropy_); DLL_Init(&large_.returned, entropy_); for (size_t i = 0; i < kMaxPages; i++) { @@ -2744,7 +2777,7 @@ class TCMalloc_ThreadCache { size_t size_; // Combined size of data ThreadIdentifier tid_; // Which thread owns it bool in_setspecific_; // Called pthread_setspecific? - FreeList list_[kNumClasses]; // Array indexed by size-class + FreeList list_[K_NUM_CLASSES_MAX]; // Array indexed by size-class // We sample allocations, biased by the size of the allocation uint32_t rnd_; // Cheap random number generator @@ -2812,7 +2845,7 @@ class TCMalloc_ThreadCache { // Central cache -- a collection of free-lists, one per size-class. // We have a separate lock per free-list to reduce contention. -static TCMalloc_Central_FreeListPadded central_cache[kNumClasses]; +static TCMalloc_Central_FreeListPadded central_cache[K_NUM_CLASSES_MAX]; // Page-level allocator static AllocAlignmentInteger pageheap_memory[(sizeof(TCMalloc_PageHeap) + sizeof(AllocAlignmentInteger) - 1) / sizeof(AllocAlignmentInteger)]; From 8d6d8d81e999c6e08f274d1d1521eb91ce233b4c Mon Sep 17 00:00:00 2001 From: Dario Segura Date: Tue, 30 Sep 2014 15:35:59 -0400 Subject: [PATCH 56/69] -[IOS8] Added x86_64 slice to make.py to be able to build and test in 64 bit simulators. --- xcodebuild.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) mode change 100644 => 100755 xcodebuild.py diff --git a/xcodebuild.py b/xcodebuild.py old mode 100644 new mode 100755 index fb73942f..20874563 --- a/xcodebuild.py +++ b/xcodebuild.py @@ -44,7 +44,7 @@ def _get_sdk_string(self): if arch.startswith("arm")]) > 0 is_simulator = len([arch for arch in self.archs if arch.startswith("i386") or - arch.startswith("x64")]) > 0 + arch.startswith("x86_64")]) > 0 if is_device and is_simulator: raise PebbleXcodeBuildException("Can't build for Device and" "Simulator in one go! (archs=%s)" % @@ -127,11 +127,13 @@ def __init__(self, project=None, workspace=None, scheme=None, self.devicebuildarmv7 = XcodeBuild(project, derived_data_path=derived_data_path) self.devicebuildarmv7s = XcodeBuild(project, derived_data_path=derived_data_path) self.simulatorbuild = XcodeBuild(project, derived_data_path=derived_data_path) + self.simulatorbuild64 = XcodeBuild(project, derived_data_path=derived_data_path) self.outdir = outdir for (bld, archs) in [self.devicebuildarm64, ["arm64"]], \ [self.devicebuildarmv7, ["armv7"]], \ [self.devicebuildarmv7s, ["armv7s"]], \ - [self.simulatorbuild, ["i386"]]: + [self.simulatorbuild, ["i386"]], \ + [self.simulatorbuild64, ["x86_64"]]: bld.archs = archs bld.scheme = scheme bld.conf = conf @@ -146,6 +148,7 @@ def build(self): self.devicebuildarmv7.build() self.devicebuildarmv7s.build() self.simulatorbuild.build() + self.simulatorbuild64.build() # Create the framework directory structure: temp_dir = tempfile.mkdtemp() @@ -171,6 +174,7 @@ def build(self): self.devicebuildarmv7.built_product_path(), self.devicebuildarmv7s.built_product_path(), self.simulatorbuild.built_product_path(), + self.simulatorbuild64.built_product_path(), "-output", lib_path] logging.debug("Executing: %s" % " ".join(lipo_cmd)) if subprocess.call(lipo_cmd): From ec40151a24ce94aa1369f5296bf31452ecb1cc1b Mon Sep 17 00:00:00 2001 From: Dario Segura Date: Tue, 30 Sep 2014 15:42:57 -0400 Subject: [PATCH 57/69] -[HOUSEKEEPING] Cleaned up commented code. --- WTF/wtf/FastMalloc.cpp | 23 ----------------------- 1 file changed, 23 deletions(-) diff --git a/WTF/wtf/FastMalloc.cpp b/WTF/wtf/FastMalloc.cpp index e5c78520..455f5a13 100644 --- a/WTF/wtf/FastMalloc.cpp +++ b/WTF/wtf/FastMalloc.cpp @@ -629,29 +629,6 @@ static ALWAYS_INLINE uint32_t freedObjectEndPoison() //------------------------------------------------------------------- // Configuration //------------------------------------------------------------------- - -//// Not all possible combinations of the following parameters make -//// sense. In particular, if kMaxSize increases, you may have to -//// increase kNumClasses as well. -//#if OS(DARWIN) -//# define K_PAGE_SHIFT PAGE_SHIFT -//# if (K_PAGE_SHIFT == 12) -//# define K_NUM_CLASSES 68 -//# elif (K_PAGE_SHIFT == 14) -//# define K_NUM_CLASSES 77 -//# else -//# error "Unsupported PAGE_SHIFT amount" -//# endif -//#else -//# define K_PAGE_SHIFT 12 -//# define K_NUM_CLASSES 68 -//#endif -//static const size_t kPageShift = K_PAGE_SHIFT; -//static const size_t kPageSize = 1 << kPageShift; -//static const size_t kMaxSize = 32u * 1024; -//static const size_t kAlignShift = 3; -//static const size_t kAlignment = 1 << kAlignShift; -//static const size_t kNumClasses = K_NUM_CLASSES; // Type that can hold the length of a run of pages typedef uintptr_t Length; From 57b85e77a69a28bf37eafeb5e9b57b740e1d45e3 Mon Sep 17 00:00:00 2001 From: Dario Segura Date: Fri, 21 Nov 2014 16:29:49 -0500 Subject: [PATCH 58/69] -[BUILD] If the derived data path is passed through the command line, subfolders are added for each target to avoid collisions. --- xcodebuild.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/xcodebuild.py b/xcodebuild.py index 20874563..fd0f257f 100755 --- a/xcodebuild.py +++ b/xcodebuild.py @@ -123,11 +123,11 @@ def __init__(self, project=None, workspace=None, scheme=None, derived_data_path=None): self.scheme = scheme self.name = name - self.devicebuildarm64 = XcodeBuild(project, derived_data_path=derived_data_path) - self.devicebuildarmv7 = XcodeBuild(project, derived_data_path=derived_data_path) - self.devicebuildarmv7s = XcodeBuild(project, derived_data_path=derived_data_path) - self.simulatorbuild = XcodeBuild(project, derived_data_path=derived_data_path) - self.simulatorbuild64 = XcodeBuild(project, derived_data_path=derived_data_path) + self.devicebuildarm64 = XcodeBuild(project, derived_data_path=None if derived_data_path is None else os.path.join(derived_data_path, "arm64")) + self.devicebuildarmv7 = XcodeBuild(project, derived_data_path=None if derived_data_path is None else os.path.join(derived_data_path, "armv7")) + self.devicebuildarmv7s = XcodeBuild(project, derived_data_path=None if derived_data_path is None else os.path.join(derived_data_path, "armv7s")) + self.simulatorbuild = XcodeBuild(project, derived_data_path=None if derived_data_path is None else os.path.join(derived_data_path, "i386")) + self.simulatorbuild64 = XcodeBuild(project, derived_data_path=None if derived_data_path is None else os.path.join(derived_data_path, "x86_64")) self.outdir = outdir for (bld, archs) in [self.devicebuildarm64, ["arm64"]], \ [self.devicebuildarmv7, ["armv7"]], \ From a7af8baeafe7c5ee96cebb492a9963219ceb24c8 Mon Sep 17 00:00:00 2001 From: Dario Segura Date: Fri, 21 Nov 2014 16:30:07 -0500 Subject: [PATCH 59/69] -[BUILD] Fixes build issues when the target path points to a different file system (like external hard drives) --- xcodebuild.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/xcodebuild.py b/xcodebuild.py index fd0f257f..23fe83d6 100755 --- a/xcodebuild.py +++ b/xcodebuild.py @@ -166,7 +166,9 @@ def build(self): os.path.join(framework_dir, name)) # Move public headers: - os.renames(self.devicebuildarm64.public_headers_path(), headers_dir) + for filename in os.listdir(self.devicebuildarm64.public_headers_path()): + shutil.move(os.path.join(self.devicebuildarm64.public_headers_path(), filename), headers_dir) + #shutil.move(self.devicebuildarm64.public_headers_path(), headers_dir) # Use lipo to create one fat static library: lipo_cmd = ["lipo", "-create", @@ -192,7 +194,7 @@ def build(self): "A", "Headers") if os.path.exists(self._built_product_path): shutil.rmtree(self._built_product_path) - os.rename(framework_dir, self._built_product_path) + shutil.move(framework_dir, self._built_product_path) else: self._built_product_path = framework_dir self._public_headers_path = headers_dir From 4c63e7ef3b1a49b16f24b0f3cc0deec5af856b06 Mon Sep 17 00:00:00 2001 From: Dario Segura Date: Mon, 25 May 2015 16:19:21 -0400 Subject: [PATCH 60/69] -[BUILD] Fixes compilation issues in latest clang version. NOTE: The library should be updated to latest JSC version. --- JavaScriptCore/API/OpaqueJSString.cpp | 6 ++++++ JavaScriptCore/API/OpaqueJSString.h | 3 +++ JavaScriptCore/assembler/MacroAssembler.h | 2 +- JavaScriptCore/interpreter/CallFrame.h | 3 +++ JavaScriptCore/parser/SourceProvider.h | 3 +++ 5 files changed, 16 insertions(+), 1 deletion(-) diff --git a/JavaScriptCore/API/OpaqueJSString.cpp b/JavaScriptCore/API/OpaqueJSString.cpp index c9802506..4a476200 100644 --- a/JavaScriptCore/API/OpaqueJSString.cpp +++ b/JavaScriptCore/API/OpaqueJSString.cpp @@ -41,7 +41,10 @@ PassRefPtr OpaqueJSString::create(const String& string) String OpaqueJSString::string() const { +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wundefined-bool-conversion" if (!this) +#pragma clang diagnostic pop return String(); // Return a copy of the wrapped string, because the caller may make it an Identifier. @@ -50,7 +53,10 @@ String OpaqueJSString::string() const Identifier OpaqueJSString::identifier(VM* vm) const { +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wundefined-bool-conversion" if (!this || m_string.isNull()) +#pragma clang diagnostic pop return Identifier(); if (m_string.isEmpty()) diff --git a/JavaScriptCore/API/OpaqueJSString.h b/JavaScriptCore/API/OpaqueJSString.h index d617b35a..cb6c1276 100644 --- a/JavaScriptCore/API/OpaqueJSString.h +++ b/JavaScriptCore/API/OpaqueJSString.h @@ -53,8 +53,11 @@ struct OpaqueJSString : public ThreadSafeRefCounted { JS_EXPORT_PRIVATE static PassRefPtr create(const String&); +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wundefined-bool-conversion" const UChar* characters() { return !!this ? m_string.characters() : 0; } unsigned length() { return !!this ? m_string.length() : 0; } +#pragma clang diagnostic pop JS_EXPORT_PRIVATE String string() const; JSC::Identifier identifier(JSC::VM*) const; diff --git a/JavaScriptCore/assembler/MacroAssembler.h b/JavaScriptCore/assembler/MacroAssembler.h index 4a43eb62..b6a8d315 100644 --- a/JavaScriptCore/assembler/MacroAssembler.h +++ b/JavaScriptCore/assembler/MacroAssembler.h @@ -986,7 +986,7 @@ class MacroAssembler : public MacroAssemblerBase { if (bitwise_cast(value * 1.0) != bitwise_cast(value)) return shouldConsiderBlinding(); - value = abs(value); + value = fabs(value); // Only allow a limited set of fractional components double scaledValue = value * 8; if (scaledValue / 8 != value) diff --git a/JavaScriptCore/interpreter/CallFrame.h b/JavaScriptCore/interpreter/CallFrame.h index 21b0a6df..bb7e21e9 100644 --- a/JavaScriptCore/interpreter/CallFrame.h +++ b/JavaScriptCore/interpreter/CallFrame.h @@ -269,7 +269,10 @@ namespace JSC { bool isVMEntrySentinel() const { +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wundefined-bool-conversion" return !!this && codeBlock() == vmEntrySentinelCodeBlock(); +#pragma clang diagnostic pop } CallFrame* vmEntrySentinelCallerFrame() const diff --git a/JavaScriptCore/parser/SourceProvider.h b/JavaScriptCore/parser/SourceProvider.h index 4ced9d9c..68515ad0 100644 --- a/JavaScriptCore/parser/SourceProvider.h +++ b/JavaScriptCore/parser/SourceProvider.h @@ -55,7 +55,10 @@ namespace JSC { intptr_t asID() { ASSERT(this); +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wundefined-bool-conversion" if (!this) // Be defensive in release mode. +#pragma clang diagnostic pop return nullID; if (!m_id) getID(); From 75217709c744e7d1b9bc060e4e30cc99e7805bc7 Mon Sep 17 00:00:00 2001 From: Dario Segura Date: Mon, 21 Sep 2015 00:36:41 -0400 Subject: [PATCH 61/69] [IOS] Library is now compatible with iOS 9 and Bitcode --- .../JavaScriptCore.xcodeproj/project.pbxproj | 92 +++++++++++++------ WTF/WTF.xcodeproj/project.pbxproj | 3 + WTF/wtf/dtoa/utils.h | 2 +- 3 files changed, 68 insertions(+), 29 deletions(-) diff --git a/JavaScriptCore/JavaScriptCore.xcodeproj/project.pbxproj b/JavaScriptCore/JavaScriptCore.xcodeproj/project.pbxproj index 4e24771d..66830aa2 100644 --- a/JavaScriptCore/JavaScriptCore.xcodeproj/project.pbxproj +++ b/JavaScriptCore/JavaScriptCore.xcodeproj/project.pbxproj @@ -1778,10 +1778,7 @@ 10D592E31889C3DF00C05A0D /* YarrSyntaxChecker.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 86704B4012DB8A8100A9FE7B /* YarrSyntaxChecker.cpp */; }; 10D592E51889C3DF00C05A0D /* CoreFoundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 6560A4CF04B3B3E7008AE952 /* CoreFoundation.framework */; }; 10D592E61889C3DF00C05A0D /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 51F0EB6105C86C6B00E6DF1B /* Foundation.framework */; }; - 10D592E71889C3DF00C05A0D /* libicucore.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = 9322A00306C341D3009067BB /* libicucore.dylib */; }; - 10D592E81889C3DF00C05A0D /* libobjc.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = 51F0EC0705C86C9A00E6DF1B /* libobjc.dylib */; }; 10D592E91889C3DF00C05A0D /* libWTF.a in Frameworks */ = {isa = PBXBuildFile; fileRef = A8A4748D151A8306004123FF /* libWTF.a */; }; - 10D592EA1889C3DF00C05A0D /* libz.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = 371D842C17C98B6E00ECF994 /* libz.dylib */; }; 140566C4107EC255005DBC8D /* JSAPIValueWrapper.cpp in Sources */ = {isa = PBXBuildFile; fileRef = BC0894D50FAFBA2D00001865 /* JSAPIValueWrapper.cpp */; }; 140566D6107EC271005DBC8D /* JSFunction.cpp in Sources */ = {isa = PBXBuildFile; fileRef = F692A85E0255597D01FF60F7 /* JSFunction.cpp */; }; 140B7D1D0DC69AF7009C42B8 /* JSActivation.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 14DA818F0D99FD2000B0A4FB /* JSActivation.cpp */; }; @@ -1952,18 +1949,15 @@ 2ACCF3DE185FE26B0083E2AD /* DFGStoreBarrierElisionPhase.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 2ACCF3DC185FE26B0083E2AD /* DFGStoreBarrierElisionPhase.cpp */; }; 2ACCF3DF185FE26B0083E2AD /* DFGStoreBarrierElisionPhase.h in Headers */ = {isa = PBXBuildFile; fileRef = 2ACCF3DD185FE26B0083E2AD /* DFGStoreBarrierElisionPhase.h */; }; 2AD8932B17E3868F00668276 /* HeapIterationScope.h in Headers */ = {isa = PBXBuildFile; fileRef = 2AD8932917E3868F00668276 /* HeapIterationScope.h */; }; - 371D842D17C98B6E00ECF994 /* libz.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = 371D842C17C98B6E00ECF994 /* libz.dylib */; }; 41359CF30FDD89AD00206180 /* DateConversion.h in Headers */ = {isa = PBXBuildFile; fileRef = D21202290AD4310C00ED79B6 /* DateConversion.h */; }; 4443AE3316E188D90076F110 /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 51F0EB6105C86C6B00E6DF1B /* Foundation.framework */; }; 451539B912DC994500EF7AC4 /* Yarr.h in Headers */ = {isa = PBXBuildFile; fileRef = 451539B812DC994500EF7AC4 /* Yarr.h */; settings = {ATTRIBUTES = (Private, ); }; }; 5D53726F0E1C54880021E549 /* Tracing.h in Headers */ = {isa = PBXBuildFile; fileRef = 5D53726E0E1C54880021E549 /* Tracing.h */; }; - 5D5D8AD10E0D0EBE00F9C692 /* libedit.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = 5D5D8AD00E0D0EBE00F9C692 /* libedit.dylib */; }; 5DBB151B131D0B310056AD36 /* testapi.js in Copy Support Script */ = {isa = PBXBuildFile; fileRef = 14D857740A4696C80032146C /* testapi.js */; }; 5DBB1525131D0BD70056AD36 /* minidom.js in Copy Support Script */ = {isa = PBXBuildFile; fileRef = 1412110D0A48788700480255 /* minidom.js */; }; 5DE6E5B30E1728EC00180407 /* create_hash_table in Headers */ = {isa = PBXBuildFile; fileRef = F692A8540255597D01FF60F7 /* create_hash_table */; settings = {ATTRIBUTES = (); }; }; 6507D29E0E871E5E00D7D896 /* JSTypeInfo.h in Headers */ = {isa = PBXBuildFile; fileRef = 6507D2970E871E4A00D7D896 /* JSTypeInfo.h */; settings = {ATTRIBUTES = (Private, ); }; }; 651122FD14046A4C002B101D /* JavaScriptCore.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 932F5BD90822A1C700736975 /* JavaScriptCore.framework */; }; - 651122FE14046A4C002B101D /* libedit.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = 5D5D8AD00E0D0EBE00F9C692 /* libedit.dylib */; }; 6511230714046B0A002B101D /* testRegExp.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 651122E5140469BA002B101D /* testRegExp.cpp */; }; 65303D641447B9E100D3F904 /* ParserTokens.h in Headers */ = {isa = PBXBuildFile; fileRef = 65303D631447B9E100D3F904 /* ParserTokens.h */; settings = {ATTRIBUTES = (Private, ); }; }; 6553A33117A1F1EE008CF6F3 /* CommonSlowPathsExceptions.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 6553A32F17A1F1EE008CF6F3 /* CommonSlowPathsExceptions.cpp */; }; @@ -2089,8 +2083,6 @@ 93052C340FB792190048FDC3 /* ParserArena.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 93052C320FB792190048FDC3 /* ParserArena.cpp */; }; 93052C350FB792190048FDC3 /* ParserArena.h in Headers */ = {isa = PBXBuildFile; fileRef = 93052C330FB792190048FDC3 /* ParserArena.h */; settings = {ATTRIBUTES = (Private, ); }; }; 932F5BD30822A1C700736975 /* CoreFoundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 6560A4CF04B3B3E7008AE952 /* CoreFoundation.framework */; }; - 932F5BD60822A1C700736975 /* libobjc.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = 51F0EC0705C86C9A00E6DF1B /* libobjc.dylib */; }; - 932F5BD70822A1C700736975 /* libicucore.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = 9322A00306C341D3009067BB /* libicucore.dylib */; }; 932F5BDD0822A1C700736975 /* jsc.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 45E12D8806A49B0F00E9DF84 /* jsc.cpp */; }; 932F5BEA0822A1C700736975 /* JavaScriptCore.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 932F5BD90822A1C700736975 /* JavaScriptCore.framework */; }; 933040040E6A749400786E6A /* SmallStrings.h in Headers */ = {isa = PBXBuildFile; fileRef = 93303FEA0E6A72C000786E6A /* SmallStrings.h */; settings = {ATTRIBUTES = (Private, ); }; }; @@ -3150,8 +3142,6 @@ 10D592F41889C3DF00C05A0D /* libJavaScriptCore.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = libJavaScriptCore.a; sourceTree = BUILT_PRODUCTS_DIR; }; 10EAA6FF1889E6B300DEB161 /* JavaScriptCore-iOS-Static.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; name = "JavaScriptCore-iOS-Static.xcconfig"; path = "../../JavaScriptCore-iOS-Static.xcconfig"; sourceTree = ""; }; 10EAA7001889E6C600DEB161 /* ToolExecutable-iOS-Static.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; name = "ToolExecutable-iOS-Static.xcconfig"; path = "../../ToolExecutable-iOS-Static.xcconfig"; sourceTree = ""; }; - 10EB2F3C1889B56F00696C01 /* XCTest.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = XCTest.framework; path = Library/Frameworks/XCTest.framework; sourceTree = DEVELOPER_DIR; }; - 10EB2F3F1889B56F00696C01 /* UIKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = UIKit.framework; path = Library/Frameworks/UIKit.framework; sourceTree = DEVELOPER_DIR; }; 140D17D60E8AD4A9000CD17D /* JSBasePrivate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSBasePrivate.h; sourceTree = ""; }; 141211020A48780900480255 /* minidom.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = minidom.c; path = tests/minidom.c; sourceTree = ""; }; 1412110D0A48788700480255 /* minidom.js */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.javascript; name = minidom.js; path = tests/minidom.js; sourceTree = ""; }; @@ -3289,16 +3279,13 @@ 2ACCF3DC185FE26B0083E2AD /* DFGStoreBarrierElisionPhase.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = DFGStoreBarrierElisionPhase.cpp; path = dfg/DFGStoreBarrierElisionPhase.cpp; sourceTree = ""; }; 2ACCF3DD185FE26B0083E2AD /* DFGStoreBarrierElisionPhase.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = DFGStoreBarrierElisionPhase.h; path = dfg/DFGStoreBarrierElisionPhase.h; sourceTree = ""; }; 2AD8932917E3868F00668276 /* HeapIterationScope.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = HeapIterationScope.h; sourceTree = ""; }; - 371D842C17C98B6E00ECF994 /* libz.dylib */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.dylib"; name = libz.dylib; path = usr/lib/libz.dylib; sourceTree = SDKROOT; }; 449097EE0F8F81B50076A327 /* FeatureDefines.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; path = FeatureDefines.xcconfig; sourceTree = ""; }; 451539B812DC994500EF7AC4 /* Yarr.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = Yarr.h; path = yarr/Yarr.h; sourceTree = ""; }; 45E12D8806A49B0F00E9DF84 /* jsc.cpp */ = {isa = PBXFileReference; fileEncoding = 30; indentWidth = 4; lastKnownFileType = sourcecode.cpp.cpp; path = jsc.cpp; sourceTree = ""; tabWidth = 4; }; 51F0EB6105C86C6B00E6DF1B /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = /System/Library/Frameworks/Foundation.framework; sourceTree = ""; }; - 51F0EC0705C86C9A00E6DF1B /* libobjc.dylib */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.dylib"; name = libobjc.dylib; path = /usr/lib/libobjc.dylib; sourceTree = ""; }; 5D53726D0E1C546B0021E549 /* Tracing.d */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = Tracing.d; sourceTree = ""; }; 5D53726E0E1C54880021E549 /* Tracing.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Tracing.h; sourceTree = ""; }; 5D53727D0E1C55EC0021E549 /* TracingDtrace.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = TracingDtrace.h; sourceTree = ""; }; - 5D5D8AD00E0D0EBE00F9C692 /* libedit.dylib */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.dylib"; name = libedit.dylib; path = /usr/lib/libedit.dylib; sourceTree = ""; }; 5DAFD6CB146B686300FBEFB4 /* JSC.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; path = JSC.xcconfig; sourceTree = ""; }; 5DDDF44614FEE72200B4FB4D /* LLIntDesiredOffsets.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = LLIntDesiredOffsets.h; path = LLIntOffsets/LLIntDesiredOffsets.h; sourceTree = BUILT_PRODUCTS_DIR; }; 5DE3D0F40DD8DDFB00468714 /* WebKitAvailability.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WebKitAvailability.h; sourceTree = ""; }; @@ -3464,7 +3451,6 @@ 93052C320FB792190048FDC3 /* ParserArena.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = ParserArena.cpp; sourceTree = ""; }; 93052C330FB792190048FDC3 /* ParserArena.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ParserArena.h; sourceTree = ""; }; 930DAD030FB1EB1A0082D205 /* NodeConstructors.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = NodeConstructors.h; sourceTree = ""; }; - 9322A00306C341D3009067BB /* libicucore.dylib */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.dylib"; name = libicucore.dylib; path = /usr/lib/libicucore.dylib; sourceTree = ""; }; 932F5BD80822A1C700736975 /* Info.plist */ = {isa = PBXFileReference; indentWidth = 4; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; tabWidth = 8; usesTabs = 1; }; 932F5BD90822A1C700736975 /* JavaScriptCore.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = JavaScriptCore.framework; sourceTree = BUILT_PRODUCTS_DIR; }; 932F5BE10822A1C700736975 /* jsc */ = {isa = PBXFileReference; explicitFileType = "compiled.mach-o.executable"; includeInIndex = 0; path = jsc; sourceTree = BUILT_PRODUCTS_DIR; }; @@ -3971,10 +3957,7 @@ files = ( 10D592E51889C3DF00C05A0D /* CoreFoundation.framework in Frameworks */, 10D592E61889C3DF00C05A0D /* Foundation.framework in Frameworks */, - 10D592E71889C3DF00C05A0D /* libicucore.dylib in Frameworks */, - 10D592E81889C3DF00C05A0D /* libobjc.dylib in Frameworks */, 10D592E91889C3DF00C05A0D /* libWTF.a in Frameworks */, - 10D592EA1889C3DF00C05A0D /* libz.dylib in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -4001,7 +3984,6 @@ buildActionMask = 2147483647; files = ( 651122FD14046A4C002B101D /* JavaScriptCore.framework in Frameworks */, - 651122FE14046A4C002B101D /* libedit.dylib in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -4011,10 +3993,7 @@ files = ( 932F5BD30822A1C700736975 /* CoreFoundation.framework in Frameworks */, A731B25A130093880040A7FA /* Foundation.framework in Frameworks */, - 932F5BD70822A1C700736975 /* libicucore.dylib in Frameworks */, - 932F5BD60822A1C700736975 /* libobjc.dylib in Frameworks */, A8A4748E151A8306004123FF /* libWTF.a in Frameworks */, - 371D842D17C98B6E00ECF994 /* libz.dylib in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -4023,7 +4002,6 @@ buildActionMask = 2147483647; files = ( 932F5BEA0822A1C700736975 /* JavaScriptCore.framework in Frameworks */, - 5D5D8AD10E0D0EBE00F9C692 /* libedit.dylib in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -4094,13 +4072,7 @@ children = ( 6560A4CF04B3B3E7008AE952 /* CoreFoundation.framework */, 51F0EB6105C86C6B00E6DF1B /* Foundation.framework */, - 5D5D8AD00E0D0EBE00F9C692 /* libedit.dylib */, - 9322A00306C341D3009067BB /* libicucore.dylib */, - 51F0EC0705C86C9A00E6DF1B /* libobjc.dylib */, A8A4748D151A8306004123FF /* libWTF.a */, - 371D842C17C98B6E00ECF994 /* libz.dylib */, - 10EB2F3C1889B56F00696C01 /* XCTest.framework */, - 10EB2F3F1889B56F00696C01 /* UIKit.framework */, ); name = Frameworks; sourceTree = ""; @@ -8774,6 +8746,7 @@ isa = XCBuildConfiguration; baseConfigurationReference = 0FCEFABE1805D86900472CE4 /* LLVMForJSC.xcconfig */; buildSettings = { + ENABLE_BITCODE = YES; }; name = Debug; }; @@ -8781,6 +8754,7 @@ isa = XCBuildConfiguration; baseConfigurationReference = 0FCEFABE1805D86900472CE4 /* LLVMForJSC.xcconfig */; buildSettings = { + ENABLE_BITCODE = YES; }; name = Release; }; @@ -8788,6 +8762,7 @@ isa = XCBuildConfiguration; baseConfigurationReference = 0FCEFABE1805D86900472CE4 /* LLVMForJSC.xcconfig */; buildSettings = { + ENABLE_BITCODE = YES; }; name = Profiling; }; @@ -8795,6 +8770,7 @@ isa = XCBuildConfiguration; baseConfigurationReference = 0FCEFABE1805D86900472CE4 /* LLVMForJSC.xcconfig */; buildSettings = { + ENABLE_BITCODE = YES; }; name = Production; }; @@ -8802,6 +8778,7 @@ isa = XCBuildConfiguration; baseConfigurationReference = BC021BF2136900C300FC5467 /* ToolExecutable.xcconfig */; buildSettings = { + ENABLE_BITCODE = YES; }; name = Debug; }; @@ -8809,6 +8786,7 @@ isa = XCBuildConfiguration; baseConfigurationReference = BC021BF2136900C300FC5467 /* ToolExecutable.xcconfig */; buildSettings = { + ENABLE_BITCODE = YES; }; name = Release; }; @@ -8816,6 +8794,7 @@ isa = XCBuildConfiguration; baseConfigurationReference = BC021BF2136900C300FC5467 /* ToolExecutable.xcconfig */; buildSettings = { + ENABLE_BITCODE = YES; }; name = Profiling; }; @@ -8823,6 +8802,7 @@ isa = XCBuildConfiguration; baseConfigurationReference = BC021BF2136900C300FC5467 /* ToolExecutable.xcconfig */; buildSettings = { + ENABLE_BITCODE = YES; }; name = Production; }; @@ -8876,6 +8856,12 @@ buildSettings = { ARCHS = "$(ARCHS_STANDARD_INCLUDING_64_BIT)"; ONLY_ACTIVE_ARCH = YES; + OTHER_LDFLAGS = ( + "-lz", + "-ledit", + "-licucore", + "-lobjc", + ); VALID_ARCHS = "armv7 armv7s arm64"; }; name = Debug; @@ -8885,6 +8871,12 @@ baseConfigurationReference = 10EAA6FF1889E6B300DEB161 /* JavaScriptCore-iOS-Static.xcconfig */; buildSettings = { ARCHS = "$(ARCHS_STANDARD_INCLUDING_64_BIT)"; + OTHER_LDFLAGS = ( + "-lz", + "-ledit", + "-licucore", + "-lobjc", + ); VALID_ARCHS = "armv7 armv7s arm64"; }; name = Release; @@ -8894,6 +8886,12 @@ baseConfigurationReference = 10EAA6FF1889E6B300DEB161 /* JavaScriptCore-iOS-Static.xcconfig */; buildSettings = { ARCHS = "$(ARCHS_STANDARD_INCLUDING_64_BIT)"; + OTHER_LDFLAGS = ( + "-lz", + "-ledit", + "-licucore", + "-lobjc", + ); VALID_ARCHS = "armv7 armv7s arm64"; }; name = Profiling; @@ -8905,6 +8903,12 @@ ARCHS = "$(ARCHS_STANDARD_INCLUDING_64_BIT)"; BUILD_VARIANTS = normal; ONLY_ACTIVE_ARCH = NO; + OTHER_LDFLAGS = ( + "-lz", + "-ledit", + "-licucore", + "-lobjc", + ); VALID_ARCHS = "armv7 armv7s arm64"; }; name = Production; @@ -8949,6 +8953,7 @@ isa = XCBuildConfiguration; baseConfigurationReference = BC021BF2136900C300FC5467 /* ToolExecutable.xcconfig */; buildSettings = { + ENABLE_BITCODE = YES; }; name = Debug; }; @@ -8956,6 +8961,7 @@ isa = XCBuildConfiguration; baseConfigurationReference = BC021BF2136900C300FC5467 /* ToolExecutable.xcconfig */; buildSettings = { + ENABLE_BITCODE = YES; }; name = Release; }; @@ -8963,6 +8969,7 @@ isa = XCBuildConfiguration; baseConfigurationReference = BC021BF2136900C300FC5467 /* ToolExecutable.xcconfig */; buildSettings = { + ENABLE_BITCODE = YES; }; name = Production; }; @@ -8970,6 +8977,7 @@ isa = XCBuildConfiguration; baseConfigurationReference = 1C9051430BA9E8A70081E9D0 /* JavaScriptCore.xcconfig */; buildSettings = { + ENABLE_BITCODE = YES; INSTALL_PATH = "$(BUILT_PRODUCTS_DIR)"; }; name = Debug; @@ -8978,6 +8986,7 @@ isa = XCBuildConfiguration; baseConfigurationReference = 1C9051430BA9E8A70081E9D0 /* JavaScriptCore.xcconfig */; buildSettings = { + ENABLE_BITCODE = YES; INSTALL_PATH = "$(BUILT_PRODUCTS_DIR)"; }; name = Release; @@ -8987,6 +8996,7 @@ baseConfigurationReference = 1C9051430BA9E8A70081E9D0 /* JavaScriptCore.xcconfig */; buildSettings = { BUILD_VARIANTS = normal; + ENABLE_BITCODE = YES; }; name = Production; }; @@ -8994,6 +9004,7 @@ isa = XCBuildConfiguration; baseConfigurationReference = 5DAFD6CB146B686300FBEFB4 /* JSC.xcconfig */; buildSettings = { + ENABLE_BITCODE = YES; }; name = Debug; }; @@ -9001,6 +9012,7 @@ isa = XCBuildConfiguration; baseConfigurationReference = 5DAFD6CB146B686300FBEFB4 /* JSC.xcconfig */; buildSettings = { + ENABLE_BITCODE = YES; }; name = Release; }; @@ -9008,12 +9020,14 @@ isa = XCBuildConfiguration; baseConfigurationReference = 5DAFD6CB146B686300FBEFB4 /* JSC.xcconfig */; buildSettings = { + ENABLE_BITCODE = YES; }; name = Production; }; 149C276D08902AFE008A9EFC /* Debug */ = { isa = XCBuildConfiguration; buildSettings = { + ENABLE_BITCODE = YES; PRODUCT_NAME = All; }; name = Debug; @@ -9021,6 +9035,7 @@ 149C276E08902AFE008A9EFC /* Release */ = { isa = XCBuildConfiguration; buildSettings = { + ENABLE_BITCODE = YES; PRODUCT_NAME = All; }; name = Release; @@ -9028,6 +9043,7 @@ 149C277008902AFE008A9EFC /* Production */ = { isa = XCBuildConfiguration; buildSettings = { + ENABLE_BITCODE = YES; PRODUCT_NAME = All; }; name = Production; @@ -9065,6 +9081,7 @@ isa = XCBuildConfiguration; baseConfigurationReference = BC021BF2136900C300FC5467 /* ToolExecutable.xcconfig */; buildSettings = { + ENABLE_BITCODE = YES; }; name = Debug; }; @@ -9072,6 +9089,7 @@ isa = XCBuildConfiguration; baseConfigurationReference = BC021BF2136900C300FC5467 /* ToolExecutable.xcconfig */; buildSettings = { + ENABLE_BITCODE = YES; }; name = Release; }; @@ -9079,12 +9097,14 @@ isa = XCBuildConfiguration; baseConfigurationReference = BC021BF2136900C300FC5467 /* ToolExecutable.xcconfig */; buildSettings = { + ENABLE_BITCODE = YES; }; name = Production; }; 5D6B2A48152B9E17005231DE /* Debug */ = { isa = XCBuildConfiguration; buildSettings = { + ENABLE_BITCODE = YES; PRODUCT_NAME = "$(TARGET_NAME)"; }; name = Debug; @@ -9092,6 +9112,7 @@ 5D6B2A49152B9E17005231DE /* Release */ = { isa = XCBuildConfiguration; buildSettings = { + ENABLE_BITCODE = YES; PRODUCT_NAME = "$(TARGET_NAME)"; }; name = Release; @@ -9099,6 +9120,7 @@ 5D6B2A4A152B9E17005231DE /* Profiling */ = { isa = XCBuildConfiguration; buildSettings = { + ENABLE_BITCODE = YES; PRODUCT_NAME = "$(TARGET_NAME)"; }; name = Profiling; @@ -9106,6 +9128,7 @@ 5D6B2A4B152B9E17005231DE /* Production */ = { isa = XCBuildConfiguration; buildSettings = { + ENABLE_BITCODE = YES; PRODUCT_NAME = "$(TARGET_NAME)"; }; name = Production; @@ -9114,6 +9137,7 @@ isa = XCBuildConfiguration; baseConfigurationReference = BC021BF2136900C300FC5467 /* ToolExecutable.xcconfig */; buildSettings = { + ENABLE_BITCODE = YES; }; name = Debug; }; @@ -9121,6 +9145,7 @@ isa = XCBuildConfiguration; baseConfigurationReference = BC021BF2136900C300FC5467 /* ToolExecutable.xcconfig */; buildSettings = { + ENABLE_BITCODE = YES; }; name = Release; }; @@ -9128,6 +9153,7 @@ isa = XCBuildConfiguration; baseConfigurationReference = BC021BF2136900C300FC5467 /* ToolExecutable.xcconfig */; buildSettings = { + ENABLE_BITCODE = YES; }; name = Profiling; }; @@ -9135,6 +9161,7 @@ isa = XCBuildConfiguration; baseConfigurationReference = BC021BF2136900C300FC5467 /* ToolExecutable.xcconfig */; buildSettings = { + ENABLE_BITCODE = YES; }; name = Production; }; @@ -9142,6 +9169,7 @@ isa = XCBuildConfiguration; baseConfigurationReference = 1C9051430BA9E8A70081E9D0 /* JavaScriptCore.xcconfig */; buildSettings = { + ENABLE_BITCODE = YES; PRODUCT_NAME = "Generate Derived Sources"; }; name = Debug; @@ -9150,6 +9178,7 @@ isa = XCBuildConfiguration; baseConfigurationReference = 1C9051430BA9E8A70081E9D0 /* JavaScriptCore.xcconfig */; buildSettings = { + ENABLE_BITCODE = YES; PRODUCT_NAME = "Generate Derived Sources"; }; name = Release; @@ -9158,6 +9187,7 @@ isa = XCBuildConfiguration; baseConfigurationReference = 1C9051430BA9E8A70081E9D0 /* JavaScriptCore.xcconfig */; buildSettings = { + ENABLE_BITCODE = YES; PRODUCT_NAME = "Generate Derived Sources"; }; name = Production; @@ -9174,6 +9204,7 @@ A761483E0E6402F700E357FA /* Profiling */ = { isa = XCBuildConfiguration; buildSettings = { + ENABLE_BITCODE = YES; PRODUCT_NAME = All; }; name = Profiling; @@ -9182,6 +9213,7 @@ isa = XCBuildConfiguration; baseConfigurationReference = 1C9051430BA9E8A70081E9D0 /* JavaScriptCore.xcconfig */; buildSettings = { + ENABLE_BITCODE = YES; INSTALL_PATH = "$(BUILT_PRODUCTS_DIR)"; }; name = Profiling; @@ -9190,6 +9222,7 @@ isa = XCBuildConfiguration; baseConfigurationReference = 1C9051430BA9E8A70081E9D0 /* JavaScriptCore.xcconfig */; buildSettings = { + ENABLE_BITCODE = YES; PRODUCT_NAME = "Generate Derived Sources"; }; name = Profiling; @@ -9198,6 +9231,7 @@ isa = XCBuildConfiguration; baseConfigurationReference = BC021BF2136900C300FC5467 /* ToolExecutable.xcconfig */; buildSettings = { + ENABLE_BITCODE = YES; }; name = Profiling; }; @@ -9205,6 +9239,7 @@ isa = XCBuildConfiguration; baseConfigurationReference = BC021BF2136900C300FC5467 /* ToolExecutable.xcconfig */; buildSettings = { + ENABLE_BITCODE = YES; }; name = Profiling; }; @@ -9212,6 +9247,7 @@ isa = XCBuildConfiguration; baseConfigurationReference = 5DAFD6CB146B686300FBEFB4 /* JSC.xcconfig */; buildSettings = { + ENABLE_BITCODE = YES; }; name = Profiling; }; diff --git a/WTF/WTF.xcodeproj/project.pbxproj b/WTF/WTF.xcodeproj/project.pbxproj index a465c2fa..9b5d95ac 100644 --- a/WTF/WTF.xcodeproj/project.pbxproj +++ b/WTF/WTF.xcodeproj/project.pbxproj @@ -1333,6 +1333,7 @@ isa = XCBuildConfiguration; baseConfigurationReference = 6541CAF41630DB26006D0DEC /* CopyWTFHeaders.xcconfig */; buildSettings = { + ENABLE_BITCODE = YES; PRODUCT_NAME = "$(TARGET_NAME)"; }; name = Debug; @@ -1341,6 +1342,7 @@ isa = XCBuildConfiguration; baseConfigurationReference = 6541CAF41630DB26006D0DEC /* CopyWTFHeaders.xcconfig */; buildSettings = { + ENABLE_BITCODE = YES; PRODUCT_NAME = "$(TARGET_NAME)"; }; name = Release; @@ -1349,6 +1351,7 @@ isa = XCBuildConfiguration; baseConfigurationReference = 6541CAF41630DB26006D0DEC /* CopyWTFHeaders.xcconfig */; buildSettings = { + ENABLE_BITCODE = YES; PRODUCT_NAME = "$(TARGET_NAME)"; }; name = Production; diff --git a/WTF/wtf/dtoa/utils.h b/WTF/wtf/dtoa/utils.h index 0a970c54..a44a9b10 100644 --- a/WTF/wtf/dtoa/utils.h +++ b/WTF/wtf/dtoa/utils.h @@ -294,7 +294,7 @@ namespace double_conversion { inline Dest BitCast(const Source& source) { // Compile time assertion: sizeof(Dest) == sizeof(Source) // A compile error here means your Dest and Source have different sizes. - typedef char VerifySizesAreEqual[sizeof(Dest) == sizeof(Source) ? 1 : -1]; + //typedef char VerifySizesAreEqual[sizeof(Dest) == sizeof(Source) ? 1 : -1]; Dest dest; memcpy(&dest, &source, sizeof(dest)); From ac4a76470f5adfa592846466f2f8a84d868c053f Mon Sep 17 00:00:00 2001 From: Dominic Szablewski Date: Tue, 13 Oct 2015 18:02:37 +0200 Subject: [PATCH 62/69] Renamed Typed Array functions as suggested in https://bugs.webkit.org/show_bug.cgi?id=120112 --- JavaScriptCore/API/JSTypedArray.cpp | 26 ++++++++++++-------------- JavaScriptCore/API/JSTypedArray.h | 8 ++++---- 2 files changed, 16 insertions(+), 18 deletions(-) diff --git a/JavaScriptCore/API/JSTypedArray.cpp b/JavaScriptCore/API/JSTypedArray.cpp index e0fed0bb..1ec2a0dc 100644 --- a/JavaScriptCore/API/JSTypedArray.cpp +++ b/JavaScriptCore/API/JSTypedArray.cpp @@ -3,6 +3,8 @@ #include "JSTypedArray.h" +#include + #include "JSObjectRef.h" #include "APICast.h" #include "InitializeThreading.h" @@ -76,23 +78,22 @@ const CreateTypedArrayFuncPtr CreateTypedArrayFunc[] = { -JSTypedArrayType JSTypedArrayGetType(JSContextRef ctx, JSValueRef value) { +JSTypedArrayType JSObjectGetTypedArrayType(JSContextRef ctx, JSObjectRef object) { ExecState* exec = toJS(ctx); APIEntryShim entryShim(exec); - JSValue jsValue = toJS(exec, value); + JSObject* jsObject = toJS(object); JSTypedArrayType type = kJSTypedArrayTypeNone; - if( jsValue.inherits(JSArrayBufferView::info()) ) { - JSObject* object = jsValue.getObject(); - type = TypedArrayTypes[object->classInfo()->typedArrayStorageType]; + if( jsObject->inherits(JSArrayBufferView::info()) ) { + type = TypedArrayTypes[jsObject->classInfo()->typedArrayStorageType]; } - else if( jsValue.inherits(JSArrayBuffer::info()) ) { + else if( jsObject->inherits(JSArrayBuffer::info()) ) { type = kJSTypedArrayTypeArrayBuffer; } return type; } -JSObjectRef JSTypedArrayMake(JSContextRef ctx, JSTypedArrayType arrayType, size_t numElements) { +JSObjectRef JSObjectMakeTypedArray(JSContextRef ctx, JSTypedArrayType arrayType, size_t numElements) { ExecState* exec = toJS(ctx); APIEntryShim entryShim(exec); @@ -104,18 +105,18 @@ JSObjectRef JSTypedArrayMake(JSContextRef ctx, JSTypedArrayType arrayType, size_ return toRef(result); } -void * JSTypedArrayGetDataPtr(JSContextRef ctx, JSValueRef value, size_t * byteLength) { +void* JSObjectGetTypedArrayDataPtr(JSContextRef ctx, JSObjectRef object, size_t* byteLength) { ExecState* exec = toJS(ctx); APIEntryShim entryShim(exec); - JSValue jsValue = toJS(exec, value); - if( JSArrayBufferView * view = jsDynamicCast(jsValue) ) { + JSObject* jsObject = toJS(object); + if( JSArrayBufferView * view = jsDynamicCast(jsObject) ) { if( byteLength ) { *byteLength = view->impl()->byteLength(); } return view->impl()->baseAddress(); } - else if( ArrayBuffer * buffer = toArrayBuffer(jsValue) ) { + else if( ArrayBuffer* buffer = toArrayBuffer(jsObject) ) { if( byteLength ) { *byteLength = buffer->byteLength(); } @@ -127,6 +128,3 @@ void * JSTypedArrayGetDataPtr(JSContextRef ctx, JSValueRef value, size_t * byteL } return NULL; } - - - diff --git a/JavaScriptCore/API/JSTypedArray.h b/JavaScriptCore/API/JSTypedArray.h index ea7f30a6..b7c827b6 100644 --- a/JavaScriptCore/API/JSTypedArray.h +++ b/JavaScriptCore/API/JSTypedArray.h @@ -43,7 +43,7 @@ typedef enum { @param value The JSValue whose Typed Array type you want to obtain. @result A value of type JSTypedArrayType that identifies value's Typed Array type. */ -JS_EXPORT JSTypedArrayType JSTypedArrayGetType(JSContextRef ctx, JSValueRef value); +JS_EXPORT JSTypedArrayType JSObjectGetTypedArrayType(JSContextRef ctx, JSObjectRef object); /*! @function @@ -53,7 +53,7 @@ JS_EXPORT JSTypedArrayType JSTypedArrayGetType(JSContextRef ctx, JSValueRef valu @param numElements The number of elements for the array. @result A JSObjectRef that is a Typed Array or NULL if there was an error */ -JS_EXPORT JSObjectRef JSTypedArrayMake(JSContextRef ctx, JSTypedArrayType arrayType, size_t numElements); +JS_EXPORT JSObjectRef JSObjectMakeTypedArray(JSContextRef ctx, JSTypedArrayType arrayType, size_t numElements); /*! @function @@ -61,9 +61,9 @@ JS_EXPORT JSObjectRef JSTypedArrayMake(JSContextRef ctx, JSTypedArrayType arrayT @param ctx The execution context to use. @param value The JSValue whose Typed Array type data pointer you want to obtain. @param byteLength A pointer to a size_t in which to store the byte length of the Typed Array -@result A pointer to the Typed Array's data or NULL if the JSValue is not a Typed Array +@result A pointer to the Typed Array's data or NULL if the JSValue is not a Typed Array. */ -JS_EXPORT void * JSTypedArrayGetDataPtr(JSContextRef ctx, JSValueRef value, size_t * byteLength); +JS_EXPORT void * JSObjectGetTypedArrayDataPtr(JSContextRef ctx, JSObjectRef object, size_t* byteLength); #ifdef __cplusplus From c27a0e84876b6793a18b4ea9e7b1f2ddcc9bf865 Mon Sep 17 00:00:00 2001 From: Dario Segura Date: Tue, 13 Oct 2015 19:37:45 -0400 Subject: [PATCH 63/69] [TVOS] Adds tvOS compatibility through the addition of the maketvos.py script (and project file changes) --- .../JavaScriptCore.xcodeproj/project.pbxproj | 2668 ++++++++++++++++- .../xcshareddata/xcschemes/All.xcscheme | 20 +- .../xcschemes/JavaScriptCore iOS.xcscheme | 20 +- .../xcschemes/JavaScriptCore.xcscheme | 20 +- .../xcshareddata/xcschemes/jsc.xcscheme | 17 +- WTF/WTF.xcodeproj/project.pbxproj | 595 ++++ maketvos.py | 63 + xcodebuildtvos.py | 194 ++ 8 files changed, 3575 insertions(+), 22 deletions(-) create mode 100755 maketvos.py create mode 100755 xcodebuildtvos.py diff --git a/JavaScriptCore/JavaScriptCore.xcodeproj/project.pbxproj b/JavaScriptCore/JavaScriptCore.xcodeproj/project.pbxproj index 66830aa2..fb395e89 100644 --- a/JavaScriptCore/JavaScriptCore.xcodeproj/project.pbxproj +++ b/JavaScriptCore/JavaScriptCore.xcodeproj/project.pbxproj @@ -2115,6 +2115,1212 @@ A1712B4111C7B235007A5315 /* RegExpKey.h in Headers */ = {isa = PBXBuildFile; fileRef = A1712B4011C7B235007A5315 /* RegExpKey.h */; settings = {ATTRIBUTES = (Private, ); }; }; A1A009C01831A22D00CF8711 /* MacroAssemblerARM64.h in Headers */ = {isa = PBXBuildFile; fileRef = 8640923C156EED3B00566CB2 /* MacroAssemblerARM64.h */; settings = {ATTRIBUTES = (Private, ); }; }; A1A009C11831A26E00CF8711 /* ARM64Assembler.h in Headers */ = {isa = PBXBuildFile; fileRef = 8640923B156EED3B00566CB2 /* ARM64Assembler.h */; settings = {ATTRIBUTES = (Private, ); }; }; + A3B645F61BCDBA50001827C5 /* libWTF-tvOS.a in Frameworks */ = {isa = PBXBuildFile; fileRef = A3B645F51BCDBA50001827C5 /* libWTF-tvOS.a */; }; + A3CA46B61BCD9DC9004C5B45 /* A64DOpcode.h in Headers */ = {isa = PBXBuildFile; fileRef = 652A3A231651C69700A80AFE /* A64DOpcode.h */; settings = {ATTRIBUTES = (Private, ); }; }; + A3CA46B71BCD9DC9004C5B45 /* AbstractMacroAssembler.h in Headers */ = {isa = PBXBuildFile; fileRef = 860161DF0F3A83C100F84710 /* AbstractMacroAssembler.h */; settings = {ATTRIBUTES = (Private, ); }; }; + A3CA46B81BCD9DC9004C5B45 /* JSTypedArray.h in Headers */ = {isa = PBXBuildFile; fileRef = 104A28CB188A011B002CCBE0 /* JSTypedArray.h */; settings = {ATTRIBUTES = (Public, ); }; }; + A3CA46B91BCD9DC9004C5B45 /* AbstractPC.h in Headers */ = {isa = PBXBuildFile; fileRef = 0F55F0F214D1063600AC7649 /* AbstractPC.h */; settings = {ATTRIBUTES = (Private, ); }; }; + A3CA46BA1BCD9DC9004C5B45 /* APICallbackFunction.h in Headers */ = {isa = PBXBuildFile; fileRef = C211B574176A224D000E2A23 /* APICallbackFunction.h */; }; + A3CA46BB1BCD9DC9004C5B45 /* APICast.h in Headers */ = {isa = PBXBuildFile; fileRef = 1482B78A0A4305AB00517CFC /* APICast.h */; settings = {ATTRIBUTES = (Private, ); }; }; + A3CA46BC1BCD9DC9004C5B45 /* APIShims.h in Headers */ = {isa = PBXBuildFile; fileRef = 865F408710E7D56300947361 /* APIShims.h */; settings = {ATTRIBUTES = (Private, ); }; }; + A3CA46BD1BCD9DC9004C5B45 /* ArgList.h in Headers */ = {isa = PBXBuildFile; fileRef = BCF605120E203EF800B9A64D /* ArgList.h */; settings = {ATTRIBUTES = (Private, ); }; }; + A3CA46BE1BCD9DC9004C5B45 /* Arguments.h in Headers */ = {isa = PBXBuildFile; fileRef = BC257DE60E1F51C50016B6C9 /* Arguments.h */; }; + A3CA46BF1BCD9DC9004C5B45 /* ArgumentsIteratorConstructor.h in Headers */ = {isa = PBXBuildFile; fileRef = A76140C8182982CB00750624 /* ArgumentsIteratorConstructor.h */; }; + A3CA46C01BCD9DC9004C5B45 /* ArgumentsIteratorPrototype.h in Headers */ = {isa = PBXBuildFile; fileRef = A76140CA182982CB00750624 /* ArgumentsIteratorPrototype.h */; }; + A3CA46C11BCD9DC9004C5B45 /* ARMAssembler.h in Headers */ = {isa = PBXBuildFile; fileRef = 86D3B2C010156BDE002865E7 /* ARMAssembler.h */; settings = {ATTRIBUTES = (Private, ); }; }; + A3CA46C21BCD9DC9004C5B45 /* ARMv7Assembler.h in Headers */ = {isa = PBXBuildFile; fileRef = 86ADD1430FDDEA980006EEC2 /* ARMv7Assembler.h */; settings = {ATTRIBUTES = (Private, ); }; }; + A3CA46C31BCD9DC9004C5B45 /* ARMv7DOpcode.h in Headers */ = {isa = PBXBuildFile; fileRef = 65C0285B1717966800351E35 /* ARMv7DOpcode.h */; }; + A3CA46C41BCD9DC9004C5B45 /* CopyWriteBarrier.h in Headers */ = {isa = PBXBuildFile; fileRef = 2A68295A1875F80500B6C3E2 /* CopyWriteBarrier.h */; settings = {ATTRIBUTES = (Private, ); }; }; + A3CA46C51BCD9DC9004C5B45 /* WriteBarrierBuffer.h in Headers */ = {isa = PBXBuildFile; fileRef = 2A4EC90A1860D6C20094F782 /* WriteBarrierBuffer.h */; settings = {ATTRIBUTES = (Private, ); }; }; + A3CA46C61BCD9DC9004C5B45 /* VMEntryScope.h in Headers */ = {isa = PBXBuildFile; fileRef = FE5932A6183C5A2600A1ECCC /* VMEntryScope.h */; settings = {ATTRIBUTES = (Private, ); }; }; + A3CA46C71BCD9DC9004C5B45 /* CodeGeneratorInspectorStrings.py in Headers */ = {isa = PBXBuildFile; fileRef = A5324390185696E6002ED692 /* CodeGeneratorInspectorStrings.py */; settings = {ATTRIBUTES = (Private, ); }; }; + A3CA46C81BCD9DC9004C5B45 /* CodeGeneratorInspector.py in Headers */ = {isa = PBXBuildFile; fileRef = A532438F185696E6002ED692 /* CodeGeneratorInspector.py */; settings = {ATTRIBUTES = (Private, ); }; }; + A3CA46C91BCD9DC9004C5B45 /* TempRegisterSet.h in Headers */ = {isa = PBXBuildFile; fileRef = 0F24E54817EE274900ABB217 /* TempRegisterSet.h */; settings = {ATTRIBUTES = (Private, ); }; }; + A3CA46CA1BCD9DC9004C5B45 /* DFGFiltrationResult.h in Headers */ = {isa = PBXBuildFile; fileRef = A7BFF3BF179868940002F462 /* DFGFiltrationResult.h */; settings = {ATTRIBUTES = (Private, ); }; }; + A3CA46CB1BCD9DC9004C5B45 /* BytecodeBasicBlock.h in Headers */ = {isa = PBXBuildFile; fileRef = C2FCAE0D17A9C24E0034C735 /* BytecodeBasicBlock.h */; settings = {ATTRIBUTES = (Private, ); }; }; + A3CA46CC1BCD9DC9004C5B45 /* generate-combined-inspector-json.py in Headers */ = {isa = PBXBuildFile; fileRef = A5324391185696E6002ED692 /* generate-combined-inspector-json.py */; settings = {ATTRIBUTES = (Private, ); }; }; + A3CA46CD1BCD9DC9004C5B45 /* BytecodeLivenessAnalysis.h in Headers */ = {isa = PBXBuildFile; fileRef = C2FCAE0F17A9C24E0034C735 /* BytecodeLivenessAnalysis.h */; settings = {ATTRIBUTES = (Private, ); }; }; + A3CA46CE1BCD9DC9004C5B45 /* ArrayAllocationProfile.h in Headers */ = {isa = PBXBuildFile; fileRef = 0F8335B51639C1E3001443B5 /* ArrayAllocationProfile.h */; settings = {ATTRIBUTES = (Private, ); }; }; + A3CA46CF1BCD9DC9004C5B45 /* Breakpoint.h in Headers */ = {isa = PBXBuildFile; fileRef = FEA0861E182B7A0400F6D851 /* Breakpoint.h */; settings = {ATTRIBUTES = (Private, ); }; }; + A3CA46D01BCD9DC9004C5B45 /* ArrayBuffer.h in Headers */ = {isa = PBXBuildFile; fileRef = A7A8AF2617ADB5F3005AB174 /* ArrayBuffer.h */; settings = {ATTRIBUTES = (Private, ); }; }; + A3CA46D11BCD9DC9004C5B45 /* DebuggerPrimitives.h in Headers */ = {isa = PBXBuildFile; fileRef = FEA0861F182B7A0400F6D851 /* DebuggerPrimitives.h */; settings = {ATTRIBUTES = (Private, ); }; }; + A3CA46D21BCD9DC9004C5B45 /* ArrayBufferView.h in Headers */ = {isa = PBXBuildFile; fileRef = A7A8AF2817ADB5F3005AB174 /* ArrayBufferView.h */; settings = {ATTRIBUTES = (Private, ); }; }; + A3CA46D31BCD9DC9004C5B45 /* ArrayConstructor.h in Headers */ = {isa = PBXBuildFile; fileRef = BC7952070E15E8A800A898AB /* ArrayConstructor.h */; }; + A3CA46D41BCD9DC9004C5B45 /* ArrayConventions.h in Headers */ = {isa = PBXBuildFile; fileRef = 0FB7F38915ED8E3800F167B2 /* ArrayConventions.h */; settings = {ATTRIBUTES = (Private, ); }; }; + A3CA46D51BCD9DC9004C5B45 /* ArrayIteratorConstructor.h in Headers */ = {isa = PBXBuildFile; fileRef = A7BDAEC117F4EA1400F6140C /* ArrayIteratorConstructor.h */; }; + A3CA46D61BCD9DC9004C5B45 /* ArrayIteratorPrototype.h in Headers */ = {isa = PBXBuildFile; fileRef = A7BDAEC317F4EA1400F6140C /* ArrayIteratorPrototype.h */; }; + A3CA46D71BCD9DC9004C5B45 /* ArrayProfile.h in Headers */ = {isa = PBXBuildFile; fileRef = 0F63945215D07051006A597C /* ArrayProfile.h */; settings = {ATTRIBUTES = (Private, ); }; }; + A3CA46D81BCD9DC9004C5B45 /* ArrayPrototype.h in Headers */ = {isa = PBXBuildFile; fileRef = F692A84E0255597D01FF60F7 /* ArrayPrototype.h */; settings = {ATTRIBUTES = (Private, ); }; }; + A3CA46D91BCD9DC9004C5B45 /* ArrayPrototype.lut.h in Headers */ = {isa = PBXBuildFile; fileRef = BC18C5230E16FC8A00B34460 /* ArrayPrototype.lut.h */; }; + A3CA46DA1BCD9DC9004C5B45 /* ArrayStorage.h in Headers */ = {isa = PBXBuildFile; fileRef = 0FB7F38A15ED8E3800F167B2 /* ArrayStorage.h */; settings = {ATTRIBUTES = (Private, ); }; }; + A3CA46DB1BCD9DC9004C5B45 /* AssemblerBuffer.h in Headers */ = {isa = PBXBuildFile; fileRef = 9688CB130ED12B4E001D649F /* AssemblerBuffer.h */; settings = {ATTRIBUTES = (Private, ); }; }; + A3CA46DC1BCD9DC9004C5B45 /* AssemblerBufferWithConstantPool.h in Headers */ = {isa = PBXBuildFile; fileRef = 86D3B2C110156BDE002865E7 /* AssemblerBufferWithConstantPool.h */; settings = {ATTRIBUTES = (Private, ); }; }; + A3CA46DD1BCD9DC9004C5B45 /* AssemblyHelpers.h in Headers */ = {isa = PBXBuildFile; fileRef = 0F24E53C17EA9F5900ABB217 /* AssemblyHelpers.h */; settings = {ATTRIBUTES = (Private, ); }; }; + A3CA46DE1BCD9DC9004C5B45 /* ASTBuilder.h in Headers */ = {isa = PBXBuildFile; fileRef = A7A7EE7411B98B8D0065A14F /* ASTBuilder.h */; settings = {ATTRIBUTES = (Private, ); }; }; + A3CA46DF1BCD9DC9004C5B45 /* BatchedTransitionOptimizer.h in Headers */ = {isa = PBXBuildFile; fileRef = 147B83AA0E6DB8C9004775A4 /* BatchedTransitionOptimizer.h */; }; + A3CA46E01BCD9DC9004C5B45 /* BigInteger.h in Headers */ = {isa = PBXBuildFile; fileRef = 866739D013BFDE710023D87C /* BigInteger.h */; }; + A3CA46E11BCD9DC9004C5B45 /* BlockAllocator.h in Headers */ = {isa = PBXBuildFile; fileRef = 14816E1A154CC56C00B8054C /* BlockAllocator.h */; settings = {ATTRIBUTES = (Private, ); }; }; + A3CA46E21BCD9DC9004C5B45 /* BooleanObject.h in Headers */ = {isa = PBXBuildFile; fileRef = 704FD35305697E6D003DBED9 /* BooleanObject.h */; settings = {ATTRIBUTES = (Private, ); }; }; + A3CA46E31BCD9DC9004C5B45 /* RemoteInspectorConstants.h in Headers */ = {isa = PBXBuildFile; fileRef = A5BA15E3182340B300A82E69 /* RemoteInspectorConstants.h */; settings = {ATTRIBUTES = (Private, ); }; }; + A3CA46E41BCD9DC9004C5B45 /* Butterfly.h in Headers */ = {isa = PBXBuildFile; fileRef = 0FB7F38B15ED8E3800F167B2 /* Butterfly.h */; settings = {ATTRIBUTES = (Private, ); }; }; + A3CA46E51BCD9DC9004C5B45 /* ButterflyInlines.h in Headers */ = {isa = PBXBuildFile; fileRef = 0FB7F38C15ED8E3800F167B2 /* ButterflyInlines.h */; settings = {ATTRIBUTES = (Private, ); }; }; + A3CA46E61BCD9DC9004C5B45 /* BytecodeConventions.h in Headers */ = {isa = PBXBuildFile; fileRef = 0F21C27E14BEAA8000ADC64B /* BytecodeConventions.h */; settings = {ATTRIBUTES = (Private, ); }; }; + A3CA46E71BCD9DC9004C5B45 /* BytecodeGenerator.h in Headers */ = {isa = PBXBuildFile; fileRef = 969A07210ED1CE3300F1F681 /* BytecodeGenerator.h */; }; + A3CA46E81BCD9DC9004C5B45 /* ByValInfo.h in Headers */ = {isa = PBXBuildFile; fileRef = 0F8023E91613832300A0BA45 /* ByValInfo.h */; settings = {ATTRIBUTES = (Private, ); }; }; + A3CA46E91BCD9DC9004C5B45 /* CallData.h in Headers */ = {isa = PBXBuildFile; fileRef = 145C507F0D9DF63B0088F6B9 /* CallData.h */; settings = {ATTRIBUTES = (Private, ); }; }; + A3CA46EA1BCD9DC9004C5B45 /* CallFrame.h in Headers */ = {isa = PBXBuildFile; fileRef = 1429D8DC0ED2205B00B89619 /* CallFrame.h */; settings = {ATTRIBUTES = (Private, ); }; }; + A3CA46EB1BCD9DC9004C5B45 /* CallFrameInlines.h in Headers */ = {isa = PBXBuildFile; fileRef = A7C1EAEA17987AB600299DB2 /* CallFrameInlines.h */; settings = {ATTRIBUTES = (Private, ); }; }; + A3CA46EC1BCD9DC9004C5B45 /* CallIdentifier.h in Headers */ = {isa = PBXBuildFile; fileRef = 95E3BC040E1AE68200B2D1C1 /* CallIdentifier.h */; settings = {ATTRIBUTES = (Private, ); }; }; + A3CA46ED1BCD9DC9004C5B45 /* CallLinkInfo.h in Headers */ = {isa = PBXBuildFile; fileRef = 0F0B83AF14BCF71400885B4F /* CallLinkInfo.h */; settings = {ATTRIBUTES = (Private, ); }; }; + A3CA46EE1BCD9DC9004C5B45 /* CallLinkStatus.h in Headers */ = {isa = PBXBuildFile; fileRef = 0F93329414CA7DC10085F3C6 /* CallLinkStatus.h */; settings = {ATTRIBUTES = (Private, ); }; }; + A3CA46EF1BCD9DC9004C5B45 /* CallReturnOffsetToBytecodeOffset.h in Headers */ = {isa = PBXBuildFile; fileRef = 0F0B83B814BCF95B00885B4F /* CallReturnOffsetToBytecodeOffset.h */; settings = {ATTRIBUTES = (Private, ); }; }; + A3CA46F01BCD9DC9004C5B45 /* CCallHelpers.h in Headers */ = {isa = PBXBuildFile; fileRef = 0F24E53D17EA9F5900ABB217 /* CCallHelpers.h */; settings = {ATTRIBUTES = (Private, ); }; }; + A3CA46F11BCD9DC9004C5B45 /* ClassInfo.h in Headers */ = {isa = PBXBuildFile; fileRef = BC6AAAE40E1F426500AD87D8 /* ClassInfo.h */; settings = {ATTRIBUTES = (Private, ); }; }; + A3CA46F21BCD9DC9004C5B45 /* ClosureCallStubRoutine.h in Headers */ = {isa = PBXBuildFile; fileRef = 0F73D7AC165A142A00ACAB71 /* ClosureCallStubRoutine.h */; settings = {ATTRIBUTES = (Private, ); }; }; + A3CA46F31BCD9DC9004C5B45 /* CodeBlock.h in Headers */ = {isa = PBXBuildFile; fileRef = 969A07910ED1D3AE00F1F681 /* CodeBlock.h */; settings = {ATTRIBUTES = (Private, ); }; }; + A3CA46F41BCD9DC9004C5B45 /* CodeBlockHash.h in Headers */ = {isa = PBXBuildFile; fileRef = 0F8F943E1667632D00D61971 /* CodeBlockHash.h */; settings = {ATTRIBUTES = (Private, ); }; }; + A3CA46F51BCD9DC9004C5B45 /* CodeBlockJettisoningWatchpoint.h in Headers */ = {isa = PBXBuildFile; fileRef = 0FC97F30182020D7002C9B26 /* CodeBlockJettisoningWatchpoint.h */; settings = {ATTRIBUTES = (Private, ); }; }; + A3CA46F61BCD9DC9004C5B45 /* CodeBlockSet.h in Headers */ = {isa = PBXBuildFile; fileRef = 0FD8A31217D4326C00CA2C40 /* CodeBlockSet.h */; settings = {ATTRIBUTES = (Private, ); }; }; + A3CA46F71BCD9DC9004C5B45 /* CodeBlockWithJITType.h in Headers */ = {isa = PBXBuildFile; fileRef = 0F96EBB116676EF4008BADE3 /* CodeBlockWithJITType.h */; settings = {ATTRIBUTES = (Private, ); }; }; + A3CA46F81BCD9DC9004C5B45 /* CodeCache.h in Headers */ = {isa = PBXBuildFile; fileRef = A77F1820164088B200640A47 /* CodeCache.h */; settings = {ATTRIBUTES = (Private, ); }; }; + A3CA46F91BCD9DC9004C5B45 /* CodeLocation.h in Headers */ = {isa = PBXBuildFile; fileRef = 86E116B00FE75AC800B512BC /* CodeLocation.h */; settings = {ATTRIBUTES = (Private, ); }; }; + A3CA46FA1BCD9DC9004C5B45 /* CodeOrigin.h in Headers */ = {isa = PBXBuildFile; fileRef = 0FBD7E671447998F00481315 /* CodeOrigin.h */; settings = {ATTRIBUTES = (Private, ); }; }; + A3CA46FB1BCD9DC9004C5B45 /* CodeSpecializationKind.h in Headers */ = {isa = PBXBuildFile; fileRef = 0F21C27914BE727300ADC64B /* CodeSpecializationKind.h */; settings = {ATTRIBUTES = (Private, ); }; }; + A3CA46FC1BCD9DC9004C5B45 /* CodeType.h in Headers */ = {isa = PBXBuildFile; fileRef = 0F0B83A514BCF50400885B4F /* CodeType.h */; settings = {ATTRIBUTES = (Private, ); }; }; + A3CA46FD1BCD9DC9004C5B45 /* CommonIdentifiers.h in Headers */ = {isa = PBXBuildFile; fileRef = 65EA73630BAE35D1001BB560 /* CommonIdentifiers.h */; settings = {ATTRIBUTES = (Private, ); }; }; + A3CA46FE1BCD9DC9004C5B45 /* CommonSlowPaths.h in Headers */ = {isa = PBXBuildFile; fileRef = 0F15F15D14B7A73A005DE37D /* CommonSlowPaths.h */; settings = {ATTRIBUTES = (Private, ); }; }; + A3CA46FF1BCD9DC9004C5B45 /* CommonSlowPathsExceptions.h in Headers */ = {isa = PBXBuildFile; fileRef = 6553A33017A1F1EE008CF6F3 /* CommonSlowPathsExceptions.h */; }; + A3CA47001BCD9DC9004C5B45 /* CompactJITCodeMap.h in Headers */ = {isa = PBXBuildFile; fileRef = 0FD82E37141AB14200179C94 /* CompactJITCodeMap.h */; settings = {ATTRIBUTES = (Private, ); }; }; + A3CA47011BCD9DC9004C5B45 /* CompilationResult.h in Headers */ = {isa = PBXBuildFile; fileRef = A7E5A3A61797432D00E893C0 /* CompilationResult.h */; settings = {ATTRIBUTES = (Private, ); }; }; + A3CA47021BCD9DC9004C5B45 /* Completion.h in Headers */ = {isa = PBXBuildFile; fileRef = F5BB2BC5030F772101FCFE1D /* Completion.h */; settings = {ATTRIBUTES = (Private, ); }; }; + A3CA47031BCD9DC9004C5B45 /* ConcurrentJITLock.h in Headers */ = {isa = PBXBuildFile; fileRef = 0FDB2CE9174896C7007B3C1B /* ConcurrentJITLock.h */; settings = {ATTRIBUTES = (Private, ); }; }; + A3CA47041BCD9DC9004C5B45 /* config.h in Headers */ = {isa = PBXBuildFile; fileRef = F68EBB8C0255D4C601FF60F7 /* config.h */; settings = {ATTRIBUTES = (Private, ); }; }; + A3CA47051BCD9DC9004C5B45 /* ConservativeRoots.h in Headers */ = {isa = PBXBuildFile; fileRef = 149DAAF212EB559D0083B12B /* ConservativeRoots.h */; settings = {ATTRIBUTES = (Private, ); }; }; + A3CA47061BCD9DC9004C5B45 /* ConstructData.h in Headers */ = {isa = PBXBuildFile; fileRef = BC8F3CCF0DAF17BA00577A80 /* ConstructData.h */; settings = {ATTRIBUTES = (Private, ); }; }; + A3CA47071BCD9DC9004C5B45 /* CopiedAllocator.h in Headers */ = {isa = PBXBuildFile; fileRef = C2EAD2FB14F0249800A4B159 /* CopiedAllocator.h */; settings = {ATTRIBUTES = (Private, ); }; }; + A3CA47081BCD9DC9004C5B45 /* CopiedBlock.h in Headers */ = {isa = PBXBuildFile; fileRef = C2C8D02E14A3CEFC00578E65 /* CopiedBlock.h */; settings = {ATTRIBUTES = (Private, ); }; }; + A3CA47091BCD9DC9004C5B45 /* CopiedBlockInlines.h in Headers */ = {isa = PBXBuildFile; fileRef = C2FC9BD216644DFB00810D33 /* CopiedBlockInlines.h */; settings = {ATTRIBUTES = (Private, ); }; }; + A3CA470A1BCD9DC9004C5B45 /* CopiedSpace.h in Headers */ = {isa = PBXBuildFile; fileRef = C2EAA3F8149A830800FCE112 /* CopiedSpace.h */; settings = {ATTRIBUTES = (Private, ); }; }; + A3CA470B1BCD9DC9004C5B45 /* CopiedSpaceInlines.h in Headers */ = {isa = PBXBuildFile; fileRef = C2C8D02B14A3C6B200578E65 /* CopiedSpaceInlines.h */; settings = {ATTRIBUTES = (Private, ); }; }; + A3CA470C1BCD9DC9004C5B45 /* CopyToken.h in Headers */ = {isa = PBXBuildFile; fileRef = 0F5A52CF17ADD717008ECB2D /* CopyToken.h */; settings = {ATTRIBUTES = (Private, ); }; }; + A3CA470D1BCD9DC9004C5B45 /* CopyVisitor.h in Headers */ = {isa = PBXBuildFile; fileRef = C2239D1316262BDD005AC5FD /* CopyVisitor.h */; settings = {ATTRIBUTES = (Private, ); }; }; + A3CA470E1BCD9DC9004C5B45 /* CopyVisitorInlines.h in Headers */ = {isa = PBXBuildFile; fileRef = C2239D1416262BDD005AC5FD /* CopyVisitorInlines.h */; settings = {ATTRIBUTES = (Private, ); }; }; + A3CA470F1BCD9DC9004C5B45 /* CopyWorkList.h in Headers */ = {isa = PBXBuildFile; fileRef = C218D13F1655CFD50062BB81 /* CopyWorkList.h */; settings = {ATTRIBUTES = (Private, ); }; }; + A3CA47101BCD9DC9004C5B45 /* create_hash_table in Headers */ = {isa = PBXBuildFile; fileRef = F692A8540255597D01FF60F7 /* create_hash_table */; settings = {ATTRIBUTES = (); }; }; + A3CA47111BCD9DC9004C5B45 /* DataFormat.h in Headers */ = {isa = PBXBuildFile; fileRef = 0F426A4A1460CD6B00131F8F /* DataFormat.h */; settings = {ATTRIBUTES = (Private, ); }; }; + A3CA47121BCD9DC9004C5B45 /* DataView.h in Headers */ = {isa = PBXBuildFile; fileRef = 0F2B66B117B6B5AB00A7AE3F /* DataView.h */; settings = {ATTRIBUTES = (Private, ); }; }; + A3CA47131BCD9DC9004C5B45 /* DateConstructor.h in Headers */ = {isa = PBXBuildFile; fileRef = BCD203460E17135E002C7E82 /* DateConstructor.h */; }; + A3CA47141BCD9DC9004C5B45 /* DateConversion.h in Headers */ = {isa = PBXBuildFile; fileRef = D21202290AD4310C00ED79B6 /* DateConversion.h */; }; + A3CA47151BCD9DC9004C5B45 /* InspectorAgentBase.h in Headers */ = {isa = PBXBuildFile; fileRef = A593CF7E1840362C00BFCE27 /* InspectorAgentBase.h */; settings = {ATTRIBUTES = (Private, ); }; }; + A3CA47161BCD9DC9004C5B45 /* DateInstance.h in Headers */ = {isa = PBXBuildFile; fileRef = BC1166010E1997B1008066DD /* DateInstance.h */; settings = {ATTRIBUTES = (Private, ); }; }; + A3CA47171BCD9DC9004C5B45 /* DateInstanceCache.h in Headers */ = {isa = PBXBuildFile; fileRef = 14A1563010966365006FA260 /* DateInstanceCache.h */; settings = {ATTRIBUTES = (Private, ); }; }; + A3CA47181BCD9DC9004C5B45 /* DatePrototype.h in Headers */ = {isa = PBXBuildFile; fileRef = BCD203480E17135E002C7E82 /* DatePrototype.h */; }; + A3CA47191BCD9DC9004C5B45 /* DatePrototype.lut.h in Headers */ = {isa = PBXBuildFile; fileRef = BCD203E70E1718F4002C7E82 /* DatePrototype.lut.h */; }; + A3CA471A1BCD9DC9004C5B45 /* Debugger.h in Headers */ = {isa = PBXBuildFile; fileRef = F692A8590255597D01FF60F7 /* Debugger.h */; settings = {ATTRIBUTES = (Private, ); }; }; + A3CA471B1BCD9DC9004C5B45 /* DebuggerActivation.h in Headers */ = {isa = PBXBuildFile; fileRef = BC3135620F302FA3003DFD3A /* DebuggerActivation.h */; settings = {ATTRIBUTES = (Private, ); }; }; + A3CA471C1BCD9DC9004C5B45 /* DebuggerCallFrame.h in Headers */ = {isa = PBXBuildFile; fileRef = 1480DB9B0DDC227F003CFDF2 /* DebuggerCallFrame.h */; settings = {ATTRIBUTES = (Private, ); }; }; + A3CA471D1BCD9DC9004C5B45 /* DeferGC.h in Headers */ = {isa = PBXBuildFile; fileRef = 0F136D4B174AD69B0075B354 /* DeferGC.h */; settings = {ATTRIBUTES = (Private, ); }; }; + A3CA471E1BCD9DC9004C5B45 /* BytecodeUseDef.h in Headers */ = {isa = PBXBuildFile; fileRef = 0F885E101849A3BE00F1E3FA /* BytecodeUseDef.h */; settings = {ATTRIBUTES = (Private, ); }; }; + A3CA471F1BCD9DC9004C5B45 /* DeferredCompilationCallback.h in Headers */ = {isa = PBXBuildFile; fileRef = 0FC712DD17CD8778008CC93C /* DeferredCompilationCallback.h */; settings = {ATTRIBUTES = (Private, ); }; }; + A3CA47201BCD9DC9004C5B45 /* DFGAbstractHeap.h in Headers */ = {isa = PBXBuildFile; fileRef = A77A423717A0BBFD00A8DB81 /* DFGAbstractHeap.h */; settings = {ATTRIBUTES = (Private, ); }; }; + A3CA47211BCD9DC9004C5B45 /* DFGAbstractInterpreter.h in Headers */ = {isa = PBXBuildFile; fileRef = A704D8FE17A0BAA8006BA554 /* DFGAbstractInterpreter.h */; settings = {ATTRIBUTES = (Private, ); }; }; + A3CA47221BCD9DC9004C5B45 /* DFGAbstractInterpreterInlines.h in Headers */ = {isa = PBXBuildFile; fileRef = A704D8FF17A0BAA8006BA554 /* DFGAbstractInterpreterInlines.h */; settings = {ATTRIBUTES = (Private, ); }; }; + A3CA47231BCD9DC9004C5B45 /* DFGAbstractValue.h in Headers */ = {isa = PBXBuildFile; fileRef = 0F62016F143FCD2F0068B77C /* DFGAbstractValue.h */; settings = {ATTRIBUTES = (Private, ); }; }; + A3CA47241BCD9DC9004C5B45 /* DFGAdjacencyList.h in Headers */ = {isa = PBXBuildFile; fileRef = 0F66E16814DF3F1300B7B2E4 /* DFGAdjacencyList.h */; settings = {ATTRIBUTES = (Private, ); }; }; + A3CA47251BCD9DC9004C5B45 /* DFGAllocator.h in Headers */ = {isa = PBXBuildFile; fileRef = 0FB4B51916B62772003F696B /* DFGAllocator.h */; settings = {ATTRIBUTES = (Private, ); }; }; + A3CA47261BCD9DC9004C5B45 /* DFGAnalysis.h in Headers */ = {isa = PBXBuildFile; fileRef = A73781091799EA2E00817533 /* DFGAnalysis.h */; settings = {ATTRIBUTES = (Private, ); }; }; + A3CA47271BCD9DC9004C5B45 /* DFGArgumentPosition.h in Headers */ = {isa = PBXBuildFile; fileRef = 0F1E3A431534CBAD000F9456 /* DFGArgumentPosition.h */; settings = {ATTRIBUTES = (Private, ); }; }; + A3CA47281BCD9DC9004C5B45 /* DFGArgumentsSimplificationPhase.h in Headers */ = {isa = PBXBuildFile; fileRef = 0F16015B156198BF00C2587C /* DFGArgumentsSimplificationPhase.h */; settings = {ATTRIBUTES = (Private, ); }; }; + A3CA47291BCD9DC9004C5B45 /* DFGArrayifySlowPathGenerator.h in Headers */ = {isa = PBXBuildFile; fileRef = 0F05C3B21683CF8F00BAF45B /* DFGArrayifySlowPathGenerator.h */; settings = {ATTRIBUTES = (Private, ); }; }; + A3CA472A1BCD9DC9004C5B45 /* DFGArrayMode.h in Headers */ = {isa = PBXBuildFile; fileRef = 0F63948215E48114006A597C /* DFGArrayMode.h */; settings = {ATTRIBUTES = (Private, ); }; }; + A3CA472B1BCD9DC9004C5B45 /* RemoteInspectorDebuggableConnection.h in Headers */ = {isa = PBXBuildFile; fileRef = A5BA15E4182340B300A82E69 /* RemoteInspectorDebuggableConnection.h */; }; + A3CA472C1BCD9DC9004C5B45 /* DFGAtTailAbstractState.h in Headers */ = {isa = PBXBuildFile; fileRef = A7D9A29017A0BC7400EE2618 /* DFGAtTailAbstractState.h */; settings = {ATTRIBUTES = (Private, ); }; }; + A3CA472D1BCD9DC9004C5B45 /* DFGBackwardsPropagationPhase.h in Headers */ = {isa = PBXBuildFile; fileRef = 0F714CA216EA92ED00F3EBEB /* DFGBackwardsPropagationPhase.h */; settings = {ATTRIBUTES = (Private, ); }; }; + A3CA472E1BCD9DC9004C5B45 /* DFGBasicBlock.h in Headers */ = {isa = PBXBuildFile; fileRef = 0F620170143FCD2F0068B77C /* DFGBasicBlock.h */; settings = {ATTRIBUTES = (Private, ); }; }; + A3CA472F1BCD9DC9004C5B45 /* DFGBasicBlockInlines.h in Headers */ = {isa = PBXBuildFile; fileRef = 0FD5652216AB780A00197653 /* DFGBasicBlockInlines.h */; settings = {ATTRIBUTES = (Private, ); }; }; + A3CA47301BCD9DC9004C5B45 /* DFGBinarySwitch.h in Headers */ = {isa = PBXBuildFile; fileRef = A70B083117A0B79B00DAF14B /* DFGBinarySwitch.h */; }; + A3CA47311BCD9DC9004C5B45 /* DFGBlockInsertionSet.h in Headers */ = {isa = PBXBuildFile; fileRef = A7D89CE517A0B8CC00773AD8 /* DFGBlockInsertionSet.h */; settings = {ATTRIBUTES = (Private, ); }; }; + A3CA47321BCD9DC9004C5B45 /* DFGBranchDirection.h in Headers */ = {isa = PBXBuildFile; fileRef = 0F8364B5164B0C0E0053329A /* DFGBranchDirection.h */; settings = {ATTRIBUTES = (Private, ); }; }; + A3CA47331BCD9DC9004C5B45 /* MacroAssemblerARM64.h in Headers */ = {isa = PBXBuildFile; fileRef = 8640923C156EED3B00566CB2 /* MacroAssemblerARM64.h */; settings = {ATTRIBUTES = (Private, ); }; }; + A3CA47341BCD9DC9004C5B45 /* DFGByteCodeParser.h in Headers */ = {isa = PBXBuildFile; fileRef = 86EC9DB51328DF82002B2AD7 /* DFGByteCodeParser.h */; settings = {ATTRIBUTES = (Private, ); }; }; + A3CA47351BCD9DC9004C5B45 /* InspectorAgentRegistry.h in Headers */ = {isa = PBXBuildFile; fileRef = A593CF85184038CA00BFCE27 /* InspectorAgentRegistry.h */; settings = {ATTRIBUTES = (Private, ); }; }; + A3CA47361BCD9DC9004C5B45 /* DFGCallArrayAllocatorSlowPathGenerator.h in Headers */ = {isa = PBXBuildFile; fileRef = 0F256C341627B0AA007F2783 /* DFGCallArrayAllocatorSlowPathGenerator.h */; settings = {ATTRIBUTES = (Private, ); }; }; + A3CA47371BCD9DC9004C5B45 /* DFGCapabilities.h in Headers */ = {isa = PBXBuildFile; fileRef = 0FD82E1F14172C2F00179C94 /* DFGCapabilities.h */; settings = {ATTRIBUTES = (Private, ); }; }; + A3CA47381BCD9DC9004C5B45 /* DFGCFAPhase.h in Headers */ = {isa = PBXBuildFile; fileRef = 0FFFC94C14EF909500C72532 /* DFGCFAPhase.h */; settings = {ATTRIBUTES = (Private, ); }; }; + A3CA47391BCD9DC9004C5B45 /* DFGCFGSimplificationPhase.h in Headers */ = {isa = PBXBuildFile; fileRef = 0F3B3A251544C991003ED0FF /* DFGCFGSimplificationPhase.h */; settings = {ATTRIBUTES = (Private, ); }; }; + A3CA473A1BCD9DC9004C5B45 /* DFGClobberize.h in Headers */ = {isa = PBXBuildFile; fileRef = A77A423917A0BBFD00A8DB81 /* DFGClobberize.h */; settings = {ATTRIBUTES = (Private, ); }; }; + A3CA473B1BCD9DC9004C5B45 /* DFGClobberSet.h in Headers */ = {isa = PBXBuildFile; fileRef = A77A423B17A0BBFD00A8DB81 /* DFGClobberSet.h */; settings = {ATTRIBUTES = (Private, ); }; }; + A3CA473C1BCD9DC9004C5B45 /* DFGCommon.h in Headers */ = {isa = PBXBuildFile; fileRef = 0FC0977E1469EBC400CF2442 /* DFGCommon.h */; settings = {ATTRIBUTES = (Private, ); }; }; + A3CA473D1BCD9DC9004C5B45 /* DFGCommonData.h in Headers */ = {isa = PBXBuildFile; fileRef = 0FEA0A2E170D40BF00BB722C /* DFGCommonData.h */; settings = {ATTRIBUTES = (Private, ); }; }; + A3CA473E1BCD9DC9004C5B45 /* DFGCompilationKey.h in Headers */ = {isa = PBXBuildFile; fileRef = 0F38B01417CFE75500B144D3 /* DFGCompilationKey.h */; settings = {ATTRIBUTES = (Private, ); }; }; + A3CA473F1BCD9DC9004C5B45 /* DFGCompilationMode.h in Headers */ = {isa = PBXBuildFile; fileRef = 0F38B01617CFE75500B144D3 /* DFGCompilationMode.h */; settings = {ATTRIBUTES = (Private, ); }; }; + A3CA47401BCD9DC9004C5B45 /* DFGConstantFoldingPhase.h in Headers */ = {isa = PBXBuildFile; fileRef = 0F3B3A18153E68EF003ED0FF /* DFGConstantFoldingPhase.h */; settings = {ATTRIBUTES = (Private, ); }; }; + A3CA47411BCD9DC9004C5B45 /* DFGCPSRethreadingPhase.h in Headers */ = {isa = PBXBuildFile; fileRef = 0FBE0F6C16C1DB010082C5E8 /* DFGCPSRethreadingPhase.h */; settings = {ATTRIBUTES = (Private, ); }; }; + A3CA47421BCD9DC9004C5B45 /* DFGCriticalEdgeBreakingPhase.h in Headers */ = {isa = PBXBuildFile; fileRef = A7D89CE717A0B8CC00773AD8 /* DFGCriticalEdgeBreakingPhase.h */; settings = {ATTRIBUTES = (Private, ); }; }; + A3CA47431BCD9DC9004C5B45 /* DFGCSEPhase.h in Headers */ = {isa = PBXBuildFile; fileRef = 0FFFC94E14EF909500C72532 /* DFGCSEPhase.h */; settings = {ATTRIBUTES = (Private, ); }; }; + A3CA47441BCD9DC9004C5B45 /* DFGDCEPhase.h in Headers */ = {isa = PBXBuildFile; fileRef = 0F2FC77116E12F6F0038D976 /* DFGDCEPhase.h */; settings = {ATTRIBUTES = (Private, ); }; }; + A3CA47451BCD9DC9004C5B45 /* DFGDesiredIdentifiers.h in Headers */ = {isa = PBXBuildFile; fileRef = 0F8F2B98172F04FD007DBDA5 /* DFGDesiredIdentifiers.h */; settings = {ATTRIBUTES = (Private, ); }; }; + A3CA47461BCD9DC9004C5B45 /* DFGDesiredStructureChains.h in Headers */ = {isa = PBXBuildFile; fileRef = A73E132D179624CD00E4DEA8 /* DFGDesiredStructureChains.h */; settings = {ATTRIBUTES = (Private, ); }; }; + A3CA47471BCD9DC9004C5B45 /* DFGDesiredTransitions.h in Headers */ = {isa = PBXBuildFile; fileRef = C2C0F7CC17BBFC5B00464FE4 /* DFGDesiredTransitions.h */; settings = {ATTRIBUTES = (Private, ); }; }; + A3CA47481BCD9DC9004C5B45 /* DFGDesiredWatchpoints.h in Headers */ = {isa = PBXBuildFile; fileRef = 0FE8534A1723CDA500B618F5 /* DFGDesiredWatchpoints.h */; settings = {ATTRIBUTES = (Private, ); }; }; + A3CA47491BCD9DC9004C5B45 /* DFGSSALoweringPhase.h in Headers */ = {isa = PBXBuildFile; fileRef = 0FC20CB818556A3500C9E954 /* DFGSSALoweringPhase.h */; settings = {ATTRIBUTES = (Private, ); }; }; + A3CA474A1BCD9DC9004C5B45 /* DFGDesiredWeakReferences.h in Headers */ = {isa = PBXBuildFile; fileRef = C2981FD717BAEE4B00A3BC98 /* DFGDesiredWeakReferences.h */; settings = {ATTRIBUTES = (Private, ); }; }; + A3CA474B1BCD9DC9004C5B45 /* DFGDesiredWriteBarriers.h in Headers */ = {isa = PBXBuildFile; fileRef = C2981FDB17BAFF4400A3BC98 /* DFGDesiredWriteBarriers.h */; settings = {ATTRIBUTES = (Private, ); }; }; + A3CA474C1BCD9DC9004C5B45 /* DFGDisassembler.h in Headers */ = {isa = PBXBuildFile; fileRef = 0FF427621591A1C9004CB9FF /* DFGDisassembler.h */; settings = {ATTRIBUTES = (Private, ); }; }; + A3CA474D1BCD9DC9004C5B45 /* DFGDominators.h in Headers */ = {isa = PBXBuildFile; fileRef = 0FD81AD0154FB4EB00983E72 /* DFGDominators.h */; settings = {ATTRIBUTES = (Private, ); }; }; + A3CA474E1BCD9DC9004C5B45 /* DFGDoubleFormatState.h in Headers */ = {isa = PBXBuildFile; fileRef = 0F1E3A441534CBAD000F9456 /* DFGDoubleFormatState.h */; settings = {ATTRIBUTES = (Private, ); }; }; + A3CA474F1BCD9DC9004C5B45 /* DFGDriver.h in Headers */ = {isa = PBXBuildFile; fileRef = 0FD3C82214115D0E00FD81CB /* DFGDriver.h */; }; + A3CA47501BCD9DC9004C5B45 /* DFGEdge.h in Headers */ = {isa = PBXBuildFile; fileRef = 0F66E16914DF3F1300B7B2E4 /* DFGEdge.h */; settings = {ATTRIBUTES = (Private, ); }; }; + A3CA47511BCD9DC9004C5B45 /* DFGEdgeDominates.h in Headers */ = {isa = PBXBuildFile; fileRef = A7D9A29117A0BC7400EE2618 /* DFGEdgeDominates.h */; settings = {ATTRIBUTES = (Private, ); }; }; + A3CA47521BCD9DC9004C5B45 /* DFGEdgeUsesStructure.h in Headers */ = {isa = PBXBuildFile; fileRef = A7986D5617A0BB1E00A95DD0 /* DFGEdgeUsesStructure.h */; settings = {ATTRIBUTES = (Private, ); }; }; + A3CA47531BCD9DC9004C5B45 /* DFGExitProfile.h in Headers */ = {isa = PBXBuildFile; fileRef = 0FBC0AE51496C7C100D4FBDD /* DFGExitProfile.h */; settings = {ATTRIBUTES = (Private, ); }; }; + A3CA47541BCD9DC9004C5B45 /* DFGFailedFinalizer.h in Headers */ = {isa = PBXBuildFile; fileRef = A78A976D179738B8009DF744 /* DFGFailedFinalizer.h */; }; + A3CA47551BCD9DC9004C5B45 /* DFGFinalizer.h in Headers */ = {isa = PBXBuildFile; fileRef = A78A976F179738B8009DF744 /* DFGFinalizer.h */; settings = {ATTRIBUTES = (Private, ); }; }; + A3CA47561BCD9DC9004C5B45 /* DFGFixupPhase.h in Headers */ = {isa = PBXBuildFile; fileRef = 0F2BDC13151C5D4A00CD8910 /* DFGFixupPhase.h */; settings = {ATTRIBUTES = (Private, ); }; }; + A3CA47571BCD9DC9004C5B45 /* DFGFlushedAt.h in Headers */ = {isa = PBXBuildFile; fileRef = 0F9D339517FFC4E60073C2BC /* DFGFlushedAt.h */; settings = {ATTRIBUTES = (Private, ); }; }; + A3CA47581BCD9DC9004C5B45 /* DFGFlushFormat.h in Headers */ = {isa = PBXBuildFile; fileRef = A7D89CE917A0B8CC00773AD8 /* DFGFlushFormat.h */; settings = {ATTRIBUTES = (Private, ); }; }; + A3CA47591BCD9DC9004C5B45 /* DFGFlushLivenessAnalysisPhase.h in Headers */ = {isa = PBXBuildFile; fileRef = A7D89CEB17A0B8CC00773AD8 /* DFGFlushLivenessAnalysisPhase.h */; settings = {ATTRIBUTES = (Private, ); }; }; + A3CA475A1BCD9DC9004C5B45 /* DFGGenerationInfo.h in Headers */ = {isa = PBXBuildFile; fileRef = 86EC9DB61328DF82002B2AD7 /* DFGGenerationInfo.h */; settings = {ATTRIBUTES = (Private, ); }; }; + A3CA475B1BCD9DC9004C5B45 /* DFGGraph.h in Headers */ = {isa = PBXBuildFile; fileRef = 86EC9DB81328DF82002B2AD7 /* DFGGraph.h */; settings = {ATTRIBUTES = (Private, ); }; }; + A3CA475C1BCD9DC9004C5B45 /* DFGInlineCacheWrapper.h in Headers */ = {isa = PBXBuildFile; fileRef = 0FB14E201812570B009B6B4D /* DFGInlineCacheWrapper.h */; settings = {ATTRIBUTES = (Private, ); }; }; + A3CA475D1BCD9DC9004C5B45 /* DFGInlineCacheWrapperInlines.h in Headers */ = {isa = PBXBuildFile; fileRef = 0FB14E2218130955009B6B4D /* DFGInlineCacheWrapperInlines.h */; settings = {ATTRIBUTES = (Private, ); }; }; + A3CA475E1BCD9DC9004C5B45 /* DFGInPlaceAbstractState.h in Headers */ = {isa = PBXBuildFile; fileRef = A704D90117A0BAA8006BA554 /* DFGInPlaceAbstractState.h */; settings = {ATTRIBUTES = (Private, ); }; }; + A3CA475F1BCD9DC9004C5B45 /* DFGInsertionSet.h in Headers */ = {isa = PBXBuildFile; fileRef = 0F2BDC1F151E803800CD8910 /* DFGInsertionSet.h */; settings = {ATTRIBUTES = (Private, ); }; }; + A3CA47601BCD9DC9004C5B45 /* DFGInvalidationPointInjectionPhase.h in Headers */ = {isa = PBXBuildFile; fileRef = 0FC97F3818202119002C9B26 /* DFGInvalidationPointInjectionPhase.h */; settings = {ATTRIBUTES = (Private, ); }; }; + A3CA47611BCD9DC9004C5B45 /* DFGJITCode.h in Headers */ = {isa = PBXBuildFile; fileRef = 0FEA0A30170D40BF00BB722C /* DFGJITCode.h */; settings = {ATTRIBUTES = (Private, ); }; }; + A3CA47621BCD9DC9004C5B45 /* DFGJITCompiler.h in Headers */ = {isa = PBXBuildFile; fileRef = 86EC9DBC1328DF82002B2AD7 /* DFGJITCompiler.h */; settings = {ATTRIBUTES = (Private, ); }; }; + A3CA47631BCD9DC9004C5B45 /* DFGJITFinalizer.h in Headers */ = {isa = PBXBuildFile; fileRef = A78A9771179738B8009DF744 /* DFGJITFinalizer.h */; }; + A3CA47641BCD9DC9004C5B45 /* DFGJumpReplacement.h in Headers */ = {isa = PBXBuildFile; fileRef = 0FC97F3A18202119002C9B26 /* DFGJumpReplacement.h */; settings = {ATTRIBUTES = (Private, ); }; }; + A3CA47651BCD9DC9004C5B45 /* DFGLazyJSValue.h in Headers */ = {isa = PBXBuildFile; fileRef = A73A53591799CD5D00170C19 /* DFGLazyJSValue.h */; settings = {ATTRIBUTES = (Private, ); }; }; + A3CA47661BCD9DC9004C5B45 /* DFGLICMPhase.h in Headers */ = {isa = PBXBuildFile; fileRef = A7D9A29317A0BC7400EE2618 /* DFGLICMPhase.h */; settings = {ATTRIBUTES = (Private, ); }; }; + A3CA47671BCD9DC9004C5B45 /* DFGLivenessAnalysisPhase.h in Headers */ = {isa = PBXBuildFile; fileRef = A7D89CED17A0B8CC00773AD8 /* DFGLivenessAnalysisPhase.h */; settings = {ATTRIBUTES = (Private, ); }; }; + A3CA47681BCD9DC9004C5B45 /* DFGLongLivedState.h in Headers */ = {isa = PBXBuildFile; fileRef = 0FB4B51D16B62772003F696B /* DFGLongLivedState.h */; settings = {ATTRIBUTES = (Private, ); }; }; + A3CA47691BCD9DC9004C5B45 /* DFGLoopPreHeaderCreationPhase.h in Headers */ = {isa = PBXBuildFile; fileRef = A767B5B417A0B9650063D940 /* DFGLoopPreHeaderCreationPhase.h */; settings = {ATTRIBUTES = (Private, ); }; }; + A3CA476A1BCD9DC9004C5B45 /* DFGMergeMode.h in Headers */ = {isa = PBXBuildFile; fileRef = A704D90217A0BAA8006BA554 /* DFGMergeMode.h */; settings = {ATTRIBUTES = (Private, ); }; }; + A3CA476B1BCD9DC9004C5B45 /* DFGMinifiedGraph.h in Headers */ = {isa = PBXBuildFile; fileRef = 0F2BDC3D1522801700CD8910 /* DFGMinifiedGraph.h */; settings = {ATTRIBUTES = (Private, ); }; }; + A3CA476C1BCD9DC9004C5B45 /* DFGMinifiedID.h in Headers */ = {isa = PBXBuildFile; fileRef = 0FB4B51016B3A964003F696B /* DFGMinifiedID.h */; settings = {ATTRIBUTES = (Private, ); }; }; + A3CA476D1BCD9DC9004C5B45 /* DFGMinifiedNode.h in Headers */ = {isa = PBXBuildFile; fileRef = 0F2BDC3E1522801700CD8910 /* DFGMinifiedNode.h */; settings = {ATTRIBUTES = (Private, ); }; }; + A3CA476E1BCD9DC9004C5B45 /* DFGNaturalLoops.h in Headers */ = {isa = PBXBuildFile; fileRef = A737810B1799EA2E00817533 /* DFGNaturalLoops.h */; settings = {ATTRIBUTES = (Private, ); }; }; + A3CA476F1BCD9DC9004C5B45 /* DFGNode.h in Headers */ = {isa = PBXBuildFile; fileRef = 86ECA3E9132DEF1C002B2AD7 /* DFGNode.h */; settings = {ATTRIBUTES = (Private, ); }; }; + A3CA47701BCD9DC9004C5B45 /* DFGNodeAllocator.h in Headers */ = {isa = PBXBuildFile; fileRef = 0FB4B51F16B62772003F696B /* DFGNodeAllocator.h */; settings = {ATTRIBUTES = (Private, ); }; }; + A3CA47711BCD9DC9004C5B45 /* DFGNodeFlags.h in Headers */ = {isa = PBXBuildFile; fileRef = 0FA581B8150E952A00B9A2D9 /* DFGNodeFlags.h */; settings = {ATTRIBUTES = (Private, ); }; }; + A3CA47721BCD9DC9004C5B45 /* DFGNodeType.h in Headers */ = {isa = PBXBuildFile; fileRef = 0FA581B9150E952A00B9A2D9 /* DFGNodeType.h */; settings = {ATTRIBUTES = (Private, ); }; }; + A3CA47731BCD9DC9004C5B45 /* DFGOperations.h in Headers */ = {isa = PBXBuildFile; fileRef = 86EC9DC01328DF82002B2AD7 /* DFGOperations.h */; settings = {ATTRIBUTES = (Private, ); }; }; + A3CA47741BCD9DC9004C5B45 /* DFGOSRAvailabilityAnalysisPhase.h in Headers */ = {isa = PBXBuildFile; fileRef = A7D89CEF17A0B8CC00773AD8 /* DFGOSRAvailabilityAnalysisPhase.h */; settings = {ATTRIBUTES = (Private, ); }; }; + A3CA47751BCD9DC9004C5B45 /* DFGOSREntry.h in Headers */ = {isa = PBXBuildFile; fileRef = 0FD82E53141DAEDE00179C94 /* DFGOSREntry.h */; settings = {ATTRIBUTES = (Private, ); }; }; + A3CA47761BCD9DC9004C5B45 /* DFGOSREntrypointCreationPhase.h in Headers */ = {isa = PBXBuildFile; fileRef = 0FD8A31E17D51F5700CA2C40 /* DFGOSREntrypointCreationPhase.h */; settings = {ATTRIBUTES = (Private, ); }; }; + A3CA47771BCD9DC9004C5B45 /* DFGOSRExit.h in Headers */ = {isa = PBXBuildFile; fileRef = 0FC097681468A6EF00CF2442 /* DFGOSRExit.h */; settings = {ATTRIBUTES = (Private, ); }; }; + A3CA47781BCD9DC9004C5B45 /* ConstantMode.h in Headers */ = {isa = PBXBuildFile; fileRef = 0FFC99D0184EC8AD009C10AB /* ConstantMode.h */; settings = {ATTRIBUTES = (Private, ); }; }; + A3CA47791BCD9DC9004C5B45 /* DFGOSRExitBase.h in Headers */ = {isa = PBXBuildFile; fileRef = 0F235BE817178E7300690C7F /* DFGOSRExitBase.h */; settings = {ATTRIBUTES = (Private, ); }; }; + A3CA477A1BCD9DC9004C5B45 /* RemoteInspectorXPCConnection.h in Headers */ = {isa = PBXBuildFile; fileRef = A5BA15E6182340B300A82E69 /* RemoteInspectorXPCConnection.h */; }; + A3CA477B1BCD9DC9004C5B45 /* DFGOSRExitCompilationInfo.h in Headers */ = {isa = PBXBuildFile; fileRef = 65987F2C167FE84B003C2F8D /* DFGOSRExitCompilationInfo.h */; settings = {ATTRIBUTES = (Private, ); }; }; + A3CA477C1BCD9DC9004C5B45 /* DFGOSRExitCompiler.h in Headers */ = {isa = PBXBuildFile; fileRef = 0FC0976F14693AEF00CF2442 /* DFGOSRExitCompiler.h */; settings = {ATTRIBUTES = (Private, ); }; }; + A3CA477D1BCD9DC9004C5B45 /* DFGOSRExitCompilerCommon.h in Headers */ = {isa = PBXBuildFile; fileRef = 0F7025A81714B0F800382C0E /* DFGOSRExitCompilerCommon.h */; settings = {ATTRIBUTES = (Private, ); }; }; + A3CA477E1BCD9DC9004C5B45 /* DFGOSRExitJumpPlaceholder.h in Headers */ = {isa = PBXBuildFile; fileRef = 0FEFC9A81681A3B000567F53 /* DFGOSRExitJumpPlaceholder.h */; settings = {ATTRIBUTES = (Private, ); }; }; + A3CA477F1BCD9DC9004C5B45 /* DFGOSRExitPreparation.h in Headers */ = {isa = PBXBuildFile; fileRef = 0F235BEA17178E7300690C7F /* DFGOSRExitPreparation.h */; settings = {ATTRIBUTES = (Private, ); }; }; + A3CA47801BCD9DC9004C5B45 /* DFGPhase.h in Headers */ = {isa = PBXBuildFile; fileRef = 0FFFC95014EF909500C72532 /* DFGPhase.h */; settings = {ATTRIBUTES = (Private, ); }; }; + A3CA47811BCD9DC9004C5B45 /* DFGPlan.h in Headers */ = {isa = PBXBuildFile; fileRef = A78A9773179738B8009DF744 /* DFGPlan.h */; settings = {ATTRIBUTES = (Private, ); }; }; + A3CA47821BCD9DC9004C5B45 /* DFGPredictionInjectionPhase.h in Headers */ = {isa = PBXBuildFile; fileRef = 0FBE0F6E16C1DB010082C5E8 /* DFGPredictionInjectionPhase.h */; settings = {ATTRIBUTES = (Private, ); }; }; + A3CA47831BCD9DC9004C5B45 /* DFGPredictionPropagationPhase.h in Headers */ = {isa = PBXBuildFile; fileRef = 0FFFC95214EF909500C72532 /* DFGPredictionPropagationPhase.h */; settings = {ATTRIBUTES = (Private, ); }; }; + A3CA47841BCD9DC9004C5B45 /* DFGRegisterBank.h in Headers */ = {isa = PBXBuildFile; fileRef = 86EC9DC11328DF82002B2AD7 /* DFGRegisterBank.h */; settings = {ATTRIBUTES = (Private, ); }; }; + A3CA47851BCD9DC9004C5B45 /* DFGSafeToExecute.h in Headers */ = {isa = PBXBuildFile; fileRef = A77A423C17A0BBFD00A8DB81 /* DFGSafeToExecute.h */; settings = {ATTRIBUTES = (Private, ); }; }; + A3CA47861BCD9DC9004C5B45 /* DFGSaneStringGetByValSlowPathGenerator.h in Headers */ = {isa = PBXBuildFile; fileRef = A741017E179DAF80002EB8BA /* DFGSaneStringGetByValSlowPathGenerator.h */; settings = {ATTRIBUTES = (Private, ); }; }; + A3CA47871BCD9DC9004C5B45 /* DFGScoreBoard.h in Headers */ = {isa = PBXBuildFile; fileRef = 86ECA3F9132DF25A002B2AD7 /* DFGScoreBoard.h */; settings = {ATTRIBUTES = (Private, ); }; }; + A3CA47881BCD9DC9004C5B45 /* DFGSilentRegisterSavePlan.h in Headers */ = {isa = PBXBuildFile; fileRef = 0F1E3A65153A21DF000F9456 /* DFGSilentRegisterSavePlan.h */; settings = {ATTRIBUTES = (Private, ); }; }; + A3CA47891BCD9DC9004C5B45 /* DFGSlowPathGenerator.h in Headers */ = {isa = PBXBuildFile; fileRef = 0F1E3A501537C2CB000F9456 /* DFGSlowPathGenerator.h */; settings = {ATTRIBUTES = (Private, ); }; }; + A3CA478A1BCD9DC9004C5B45 /* DFGSpeculativeJIT.h in Headers */ = {isa = PBXBuildFile; fileRef = 86EC9DC31328DF82002B2AD7 /* DFGSpeculativeJIT.h */; settings = {ATTRIBUTES = (Private, ); }; }; + A3CA478B1BCD9DC9004C5B45 /* DFGSSAConversionPhase.h in Headers */ = {isa = PBXBuildFile; fileRef = A7D89CF117A0B8CC00773AD8 /* DFGSSAConversionPhase.h */; settings = {ATTRIBUTES = (Private, ); }; }; + A3CA478C1BCD9DC9004C5B45 /* DFGStackLayoutPhase.h in Headers */ = {isa = PBXBuildFile; fileRef = 0F9FB4F317FCB91700CB67F8 /* DFGStackLayoutPhase.h */; settings = {ATTRIBUTES = (Private, ); }; }; + A3CA478D1BCD9DC9004C5B45 /* InspectorValues.h in Headers */ = {isa = PBXBuildFile; fileRef = A593CF811840377100BFCE27 /* InspectorValues.h */; settings = {ATTRIBUTES = (Private, ); }; }; + A3CA478E1BCD9DC9004C5B45 /* DFGStructureAbstractValue.h in Headers */ = {isa = PBXBuildFile; fileRef = 0F63947615DCE347006A597C /* DFGStructureAbstractValue.h */; settings = {ATTRIBUTES = (Private, ); }; }; + A3CA478F1BCD9DC9004C5B45 /* DFGThunks.h in Headers */ = {isa = PBXBuildFile; fileRef = 0FC097A0146B28C700CF2442 /* DFGThunks.h */; settings = {ATTRIBUTES = (Private, ); }; }; + A3CA47901BCD9DC9004C5B45 /* DFGTierUpCheckInjectionPhase.h in Headers */ = {isa = PBXBuildFile; fileRef = 0FD8A32017D51F5700CA2C40 /* DFGTierUpCheckInjectionPhase.h */; settings = {ATTRIBUTES = (Private, ); }; }; + A3CA47911BCD9DC9004C5B45 /* DFGToFTLDeferredCompilationCallback.h in Headers */ = {isa = PBXBuildFile; fileRef = 0FD8A32217D51F5700CA2C40 /* DFGToFTLDeferredCompilationCallback.h */; settings = {ATTRIBUTES = (Private, ); }; }; + A3CA47921BCD9DC9004C5B45 /* VariableWatchpointSet.h in Headers */ = {isa = PBXBuildFile; fileRef = 0F9181C618415CA50057B669 /* VariableWatchpointSet.h */; settings = {ATTRIBUTES = (Private, ); }; }; + A3CA47931BCD9DC9004C5B45 /* DFGToFTLForOSREntryDeferredCompilationCallback.h in Headers */ = {isa = PBXBuildFile; fileRef = 0FD8A32417D51F5700CA2C40 /* DFGToFTLForOSREntryDeferredCompilationCallback.h */; settings = {ATTRIBUTES = (Private, ); }; }; + A3CA47941BCD9DC9004C5B45 /* DFGTypeCheckHoistingPhase.h in Headers */ = {isa = PBXBuildFile; fileRef = 0F63943D15C75F14006A597C /* DFGTypeCheckHoistingPhase.h */; settings = {ATTRIBUTES = (Private, ); }; }; + A3CA47951BCD9DC9004C5B45 /* DFGUnificationPhase.h in Headers */ = {isa = PBXBuildFile; fileRef = 0FBE0F7016C1DB010082C5E8 /* DFGUnificationPhase.h */; settings = {ATTRIBUTES = (Private, ); }; }; + A3CA47961BCD9DC9004C5B45 /* DFGUseKind.h in Headers */ = {isa = PBXBuildFile; fileRef = 0F34B14816D4200E001CDA5A /* DFGUseKind.h */; settings = {ATTRIBUTES = (Private, ); }; }; + A3CA47971BCD9DC9004C5B45 /* DFGValidate.h in Headers */ = {isa = PBXBuildFile; fileRef = 0F3B3A2A15474FF4003ED0FF /* DFGValidate.h */; settings = {ATTRIBUTES = (Private, ); }; }; + A3CA47981BCD9DC9004C5B45 /* DFGValueRecoveryOverride.h in Headers */ = {isa = PBXBuildFile; fileRef = 0F2BDC3F1522801700CD8910 /* DFGValueRecoveryOverride.h */; settings = {ATTRIBUTES = (Private, ); }; }; + A3CA47991BCD9DC9004C5B45 /* DFGValueSource.h in Headers */ = {isa = PBXBuildFile; fileRef = 0F2BDC401522801700CD8910 /* DFGValueSource.h */; settings = {ATTRIBUTES = (Private, ); }; }; + A3CA479A1BCD9DC9004C5B45 /* DFGVariableAccessData.h in Headers */ = {isa = PBXBuildFile; fileRef = 0F620172143FCD2F0068B77C /* DFGVariableAccessData.h */; settings = {ATTRIBUTES = (Private, ); }; }; + A3CA479B1BCD9DC9004C5B45 /* DFGVariableAccessDataDump.h in Headers */ = {isa = PBXBuildFile; fileRef = 0FDDBFB31666EED500C55FEF /* DFGVariableAccessDataDump.h */; settings = {ATTRIBUTES = (Private, ); }; }; + A3CA479C1BCD9DC9004C5B45 /* DFGVariableEvent.h in Headers */ = {isa = PBXBuildFile; fileRef = 0F2BDC411522801700CD8910 /* DFGVariableEvent.h */; settings = {ATTRIBUTES = (Private, ); }; }; + A3CA479D1BCD9DC9004C5B45 /* DFGVariableEventStream.h in Headers */ = {isa = PBXBuildFile; fileRef = 0F2BDC431522801700CD8910 /* DFGVariableEventStream.h */; settings = {ATTRIBUTES = (Private, ); }; }; + A3CA479E1BCD9DC9004C5B45 /* DFGVariadicFunction.h in Headers */ = {isa = PBXBuildFile; fileRef = 0F85A31E16AB76AE0077571E /* DFGVariadicFunction.h */; settings = {ATTRIBUTES = (Private, ); }; }; + A3CA479F1BCD9DC9004C5B45 /* DFGVirtualRegisterAllocationPhase.h in Headers */ = {isa = PBXBuildFile; fileRef = 0FFFC95414EF909500C72532 /* DFGVirtualRegisterAllocationPhase.h */; settings = {ATTRIBUTES = (Private, ); }; }; + A3CA47A01BCD9DC9004C5B45 /* DFGWatchpointCollectionPhase.h in Headers */ = {isa = PBXBuildFile; fileRef = 0FC97F3C18202119002C9B26 /* DFGWatchpointCollectionPhase.h */; settings = {ATTRIBUTES = (Private, ); }; }; + A3CA47A11BCD9DC9004C5B45 /* DFGWorklist.h in Headers */ = {isa = PBXBuildFile; fileRef = 0FDB2CE6174830A2007B3C1B /* DFGWorklist.h */; settings = {ATTRIBUTES = (Private, ); }; }; + A3CA47A21BCD9DC9004C5B45 /* Disassembler.h in Headers */ = {isa = PBXBuildFile; fileRef = 0FF4272F158EBD44004CB9FF /* Disassembler.h */; settings = {ATTRIBUTES = (Private, ); }; }; + A3CA47A31BCD9DC9004C5B45 /* DumpContext.h in Headers */ = {isa = PBXBuildFile; fileRef = A70447EC17A0BD7000F5898E /* DumpContext.h */; settings = {ATTRIBUTES = (Private, ); }; }; + A3CA47A41BCD9DC9004C5B45 /* Error.h in Headers */ = {isa = PBXBuildFile; fileRef = BC3046060E1F497F003232CF /* Error.h */; settings = {ATTRIBUTES = (Private, ); }; }; + A3CA47A51BCD9DC9004C5B45 /* ErrorConstructor.h in Headers */ = {isa = PBXBuildFile; fileRef = BC02E9050E1839DB000F9297 /* ErrorConstructor.h */; }; + A3CA47A61BCD9DC9004C5B45 /* ErrorInstance.h in Headers */ = {isa = PBXBuildFile; fileRef = BC02E98B0E183E38000F9297 /* ErrorInstance.h */; settings = {ATTRIBUTES = (Private, ); }; }; + A3CA47A71BCD9DC9004C5B45 /* ErrorPrototype.h in Headers */ = {isa = PBXBuildFile; fileRef = BC02E9070E1839DB000F9297 /* ErrorPrototype.h */; settings = {ATTRIBUTES = (Private, ); }; }; + A3CA47A81BCD9DC9004C5B45 /* EvalCodeCache.h in Headers */ = {isa = PBXBuildFile; fileRef = 969A07920ED1D3AE00F1F681 /* EvalCodeCache.h */; settings = {ATTRIBUTES = (Private, ); }; }; + A3CA47A91BCD9DC9004C5B45 /* ExceptionHelpers.h in Headers */ = {isa = PBXBuildFile; fileRef = A72701B30DADE94900E548D7 /* ExceptionHelpers.h */; settings = {ATTRIBUTES = (Private, ); }; }; + A3CA47AA1BCD9DC9004C5B45 /* Executable.h in Headers */ = {isa = PBXBuildFile; fileRef = 86CAFEE21035DDE60028A609 /* Executable.h */; settings = {ATTRIBUTES = (Private, ); }; }; + A3CA47AB1BCD9DC9004C5B45 /* ExecutableAllocator.h in Headers */ = {isa = PBXBuildFile; fileRef = A7B48DB50EE74CFC00DCBDB6 /* ExecutableAllocator.h */; settings = {ATTRIBUTES = (Private, ); }; }; + A3CA47AC1BCD9DC9004C5B45 /* ExecutionCounter.h in Headers */ = {isa = PBXBuildFile; fileRef = 0F56A1D115000F31002992B1 /* ExecutionCounter.h */; settings = {ATTRIBUTES = (Private, ); }; }; + A3CA47AD1BCD9DC9004C5B45 /* ExitKind.h in Headers */ = {isa = PBXBuildFile; fileRef = 0FB105831675480C00F8AB6E /* ExitKind.h */; settings = {ATTRIBUTES = (Private, ); }; }; + A3CA47AE1BCD9DC9004C5B45 /* ExpressionRangeInfo.h in Headers */ = {isa = PBXBuildFile; fileRef = 0F0B83AA14BCF5B900885B4F /* ExpressionRangeInfo.h */; settings = {ATTRIBUTES = (Private, ); }; }; + A3CA47AF1BCD9DC9004C5B45 /* Float32Array.h in Headers */ = {isa = PBXBuildFile; fileRef = A7A8AF2917ADB5F3005AB174 /* Float32Array.h */; settings = {ATTRIBUTES = (Private, ); }; }; + A3CA47B01BCD9DC9004C5B45 /* ScriptValue.h in Headers */ = {isa = PBXBuildFile; fileRef = A54CF2F3184EAB2400237F19 /* ScriptValue.h */; settings = {ATTRIBUTES = (Private, ); }; }; + A3CA47B11BCD9DC9004C5B45 /* Float64Array.h in Headers */ = {isa = PBXBuildFile; fileRef = A7A8AF2A17ADB5F3005AB174 /* Float64Array.h */; settings = {ATTRIBUTES = (Private, ); }; }; + A3CA47B21BCD9DC9004C5B45 /* FPRInfo.h in Headers */ = {isa = PBXBuildFile; fileRef = 0F24E53E17EA9F5900ABB217 /* FPRInfo.h */; settings = {ATTRIBUTES = (Private, ); }; }; + A3CA47B31BCD9DC9004C5B45 /* ArrayBufferNeuteringWatchpoint.h in Headers */ = {isa = PBXBuildFile; fileRef = 0FFC99D3184EE318009C10AB /* ArrayBufferNeuteringWatchpoint.h */; settings = {ATTRIBUTES = (Private, ); }; }; + A3CA47B41BCD9DC9004C5B45 /* FTLAbbreviatedTypes.h in Headers */ = {isa = PBXBuildFile; fileRef = 0FDB2CC7173DA51E007B3C1B /* FTLAbbreviatedTypes.h */; settings = {ATTRIBUTES = (Private, ); }; }; + A3CA47B51BCD9DC9004C5B45 /* FTLAbbreviations.h in Headers */ = {isa = PBXBuildFile; fileRef = 0FEA09FD170513DB00BB722C /* FTLAbbreviations.h */; settings = {ATTRIBUTES = (Private, ); }; }; + A3CA47B61BCD9DC9004C5B45 /* FTLAbstractHeap.h in Headers */ = {isa = PBXBuildFile; fileRef = 0FEA0A181708B00700BB722C /* FTLAbstractHeap.h */; settings = {ATTRIBUTES = (Private, ); }; }; + A3CA47B71BCD9DC9004C5B45 /* FTLAbstractHeapRepository.h in Headers */ = {isa = PBXBuildFile; fileRef = 0FEA0A1A1708B00700BB722C /* FTLAbstractHeapRepository.h */; settings = {ATTRIBUTES = (Private, ); }; }; + A3CA47B81BCD9DC9004C5B45 /* JSGlobalObjectDebuggable.h in Headers */ = {isa = PBXBuildFile; fileRef = A59455911824744700CC3843 /* JSGlobalObjectDebuggable.h */; }; + A3CA47B91BCD9DC9004C5B45 /* FTLCapabilities.h in Headers */ = {isa = PBXBuildFile; fileRef = 0FEA09FF170513DB00BB722C /* FTLCapabilities.h */; settings = {ATTRIBUTES = (Private, ); }; }; + A3CA47BA1BCD9DC9004C5B45 /* FTLCommonValues.h in Headers */ = {isa = PBXBuildFile; fileRef = 0FEA0A211709606900BB722C /* FTLCommonValues.h */; settings = {ATTRIBUTES = (Private, ); }; }; + A3CA47BB1BCD9DC9004C5B45 /* FTLCompile.h in Headers */ = {isa = PBXBuildFile; fileRef = 0FEA0A01170513DB00BB722C /* FTLCompile.h */; settings = {ATTRIBUTES = (Private, ); }; }; + A3CA47BC1BCD9DC9004C5B45 /* FTLExitArgument.h in Headers */ = {isa = PBXBuildFile; fileRef = 0F235BBE17178E1C00690C7F /* FTLExitArgument.h */; settings = {ATTRIBUTES = (Private, ); }; }; + A3CA47BD1BCD9DC9004C5B45 /* FTLExitArgumentForOperand.h in Headers */ = {isa = PBXBuildFile; fileRef = 0F235BC017178E1C00690C7F /* FTLExitArgumentForOperand.h */; settings = {ATTRIBUTES = (Private, ); }; }; + A3CA47BE1BCD9DC9004C5B45 /* FTLExitArgumentList.h in Headers */ = {isa = PBXBuildFile; fileRef = 0F235BC117178E1C00690C7F /* FTLExitArgumentList.h */; settings = {ATTRIBUTES = (Private, ); }; }; + A3CA47BF1BCD9DC9004C5B45 /* FTLExitThunkGenerator.h in Headers */ = {isa = PBXBuildFile; fileRef = 0F235BC317178E1C00690C7F /* FTLExitThunkGenerator.h */; settings = {ATTRIBUTES = (Private, ); }; }; + A3CA47C01BCD9DC9004C5B45 /* FTLExitValue.h in Headers */ = {isa = PBXBuildFile; fileRef = 0F235BC517178E1C00690C7F /* FTLExitValue.h */; settings = {ATTRIBUTES = (Private, ); }; }; + A3CA47C11BCD9DC9004C5B45 /* FTLFail.h in Headers */ = {isa = PBXBuildFile; fileRef = A7F2996A17A0BB670010417A /* FTLFail.h */; settings = {ATTRIBUTES = (Private, ); }; }; + A3CA47C21BCD9DC9004C5B45 /* FTLFormattedValue.h in Headers */ = {isa = PBXBuildFile; fileRef = 0FEA0A2B170B661900BB722C /* FTLFormattedValue.h */; settings = {ATTRIBUTES = (Private, ); }; }; + A3CA47C31BCD9DC9004C5B45 /* FTLForOSREntryJITCode.h in Headers */ = {isa = PBXBuildFile; fileRef = 0FD8A31617D51F2200CA2C40 /* FTLForOSREntryJITCode.h */; settings = {ATTRIBUTES = (Private, ); }; }; + A3CA47C41BCD9DC9004C5B45 /* FTLGeneratedFunction.h in Headers */ = {isa = PBXBuildFile; fileRef = A78A977C179738D5009DF744 /* FTLGeneratedFunction.h */; }; + A3CA47C51BCD9DC9004C5B45 /* FTLInlineCacheDescriptor.h in Headers */ = {isa = PBXBuildFile; fileRef = 0F25F1A7181635F300522F39 /* FTLInlineCacheDescriptor.h */; settings = {ATTRIBUTES = (Private, ); }; }; + A3CA47C61BCD9DC9004C5B45 /* FTLInlineCacheSize.h in Headers */ = {isa = PBXBuildFile; fileRef = 0F25F1A9181635F300522F39 /* FTLInlineCacheSize.h */; settings = {ATTRIBUTES = (Private, ); }; }; + A3CA47C71BCD9DC9004C5B45 /* FTLIntrinsicRepository.h in Headers */ = {isa = PBXBuildFile; fileRef = 0FEA0A221709606900BB722C /* FTLIntrinsicRepository.h */; settings = {ATTRIBUTES = (Private, ); }; }; + A3CA47C81BCD9DC9004C5B45 /* FTLJITCode.h in Headers */ = {isa = PBXBuildFile; fileRef = 0FEA0A03170513DB00BB722C /* FTLJITCode.h */; settings = {ATTRIBUTES = (Private, ); }; }; + A3CA47C91BCD9DC9004C5B45 /* FTLJITFinalizer.h in Headers */ = {isa = PBXBuildFile; fileRef = A78A977E179738D5009DF744 /* FTLJITFinalizer.h */; }; + A3CA47CA1BCD9DC9004C5B45 /* FTLLink.h in Headers */ = {isa = PBXBuildFile; fileRef = 0F8F2B94172E049E007DBDA5 /* FTLLink.h */; settings = {ATTRIBUTES = (Private, ); }; }; + A3CA47CB1BCD9DC9004C5B45 /* FTLLocation.h in Headers */ = {isa = PBXBuildFile; fileRef = 0FCEFADE180738C000472CE4 /* FTLLocation.h */; settings = {ATTRIBUTES = (Private, ); }; }; + A3CA47CC1BCD9DC9004C5B45 /* FTLLowerDFGToLLVM.h in Headers */ = {isa = PBXBuildFile; fileRef = 0FEA0A05170513DB00BB722C /* FTLLowerDFGToLLVM.h */; settings = {ATTRIBUTES = (Private, ); }; }; + A3CA47CD1BCD9DC9004C5B45 /* FTLLoweredNodeValue.h in Headers */ = {isa = PBXBuildFile; fileRef = A7D89D0117A0B90400773AD8 /* FTLLoweredNodeValue.h */; settings = {ATTRIBUTES = (Private, ); }; }; + A3CA47CE1BCD9DC9004C5B45 /* FTLOSREntry.h in Headers */ = {isa = PBXBuildFile; fileRef = 0FD8A31817D51F2200CA2C40 /* FTLOSREntry.h */; settings = {ATTRIBUTES = (Private, ); }; }; + A3CA47CF1BCD9DC9004C5B45 /* FTLOSRExit.h in Headers */ = {isa = PBXBuildFile; fileRef = 0F235BC717178E1C00690C7F /* FTLOSRExit.h */; settings = {ATTRIBUTES = (Private, ); }; }; + A3CA47D01BCD9DC9004C5B45 /* FTLOSRExitCompilationInfo.h in Headers */ = {isa = PBXBuildFile; fileRef = 0F235BC817178E1C00690C7F /* FTLOSRExitCompilationInfo.h */; settings = {ATTRIBUTES = (Private, ); }; }; + A3CA47D11BCD9DC9004C5B45 /* FTLOSRExitCompiler.h in Headers */ = {isa = PBXBuildFile; fileRef = 0F235BCA17178E1C00690C7F /* FTLOSRExitCompiler.h */; settings = {ATTRIBUTES = (Private, ); }; }; + A3CA47D21BCD9DC9004C5B45 /* FTLOutput.h in Headers */ = {isa = PBXBuildFile; fileRef = 0FEA0A06170513DB00BB722C /* FTLOutput.h */; settings = {ATTRIBUTES = (Private, ); }; }; + A3CA47D31BCD9DC9004C5B45 /* FTLSaveRestore.h in Headers */ = {isa = PBXBuildFile; fileRef = 0FCEFAAA1804C13E00472CE4 /* FTLSaveRestore.h */; settings = {ATTRIBUTES = (Private, ); }; }; + A3CA47D41BCD9DC9004C5B45 /* FTLSlowPathCall.h in Headers */ = {isa = PBXBuildFile; fileRef = 0F25F1AB181635F300522F39 /* FTLSlowPathCall.h */; settings = {ATTRIBUTES = (Private, ); }; }; + A3CA47D51BCD9DC9004C5B45 /* FTLSlowPathCallKey.h in Headers */ = {isa = PBXBuildFile; fileRef = 0F25F1AD181635F300522F39 /* FTLSlowPathCallKey.h */; settings = {ATTRIBUTES = (Private, ); }; }; + A3CA47D61BCD9DC9004C5B45 /* FTLStackMaps.h in Headers */ = {isa = PBXBuildFile; fileRef = 0F9D33991803ADB70073C2BC /* FTLStackMaps.h */; settings = {ATTRIBUTES = (Private, ); }; }; + A3CA47D71BCD9DC9004C5B45 /* FTLState.h in Headers */ = {isa = PBXBuildFile; fileRef = 0FEA0A07170513DB00BB722C /* FTLState.h */; settings = {ATTRIBUTES = (Private, ); }; }; + A3CA47D81BCD9DC9004C5B45 /* FTLSwitchCase.h in Headers */ = {isa = PBXBuildFile; fileRef = A7FCC26C17A0B6AA00786D1A /* FTLSwitchCase.h */; settings = {ATTRIBUTES = (Private, ); }; }; + A3CA47D91BCD9DC9004C5B45 /* FTLThunks.h in Headers */ = {isa = PBXBuildFile; fileRef = 0F235BCC17178E1C00690C7F /* FTLThunks.h */; settings = {ATTRIBUTES = (Private, ); }; }; + A3CA47DA1BCD9DC9004C5B45 /* FTLTypedPointer.h in Headers */ = {isa = PBXBuildFile; fileRef = 0FEA0A1B1708B00700BB722C /* FTLTypedPointer.h */; }; + A3CA47DB1BCD9DC9004C5B45 /* FTLValueFormat.h in Headers */ = {isa = PBXBuildFile; fileRef = 0F235BCE17178E1C00690C7F /* FTLValueFormat.h */; settings = {ATTRIBUTES = (Private, ); }; }; + A3CA47DC1BCD9DC9004C5B45 /* FTLValueFromBlock.h in Headers */ = {isa = PBXBuildFile; fileRef = 0FDB2CC8173DA51E007B3C1B /* FTLValueFromBlock.h */; settings = {ATTRIBUTES = (Private, ); }; }; + A3CA47DD1BCD9DC9004C5B45 /* FunctionConstructor.h in Headers */ = {isa = PBXBuildFile; fileRef = BC2680C10E16D4E900A06E92 /* FunctionConstructor.h */; settings = {ATTRIBUTES = (Private, ); }; }; + A3CA47DE1BCD9DC9004C5B45 /* FunctionExecutableDump.h in Headers */ = {isa = PBXBuildFile; fileRef = 0FB4B52216B6278D003F696B /* FunctionExecutableDump.h */; settings = {ATTRIBUTES = (Private, ); }; }; + A3CA47DF1BCD9DC9004C5B45 /* FunctionPrototype.h in Headers */ = {isa = PBXBuildFile; fileRef = F692A85D0255597D01FF60F7 /* FunctionPrototype.h */; settings = {ATTRIBUTES = (Private, ); }; }; + A3CA47E01BCD9DC9004C5B45 /* GCActivityCallback.h in Headers */ = {isa = PBXBuildFile; fileRef = DDF7ABD211F60ED200108E36 /* GCActivityCallback.h */; settings = {ATTRIBUTES = (Private, ); }; }; + A3CA47E11BCD9DC9004C5B45 /* GCAssertions.h in Headers */ = {isa = PBXBuildFile; fileRef = BCBE2CAD14E985AA000593AD /* GCAssertions.h */; settings = {ATTRIBUTES = (Private, ); }; }; + A3CA47E21BCD9DC9004C5B45 /* GCAwareJITStubRoutine.h in Headers */ = {isa = PBXBuildFile; fileRef = 0F766D2E15A8DCDD008F363E /* GCAwareJITStubRoutine.h */; settings = {ATTRIBUTES = (Private, ); }; }; + A3CA47E31BCD9DC9004C5B45 /* GCIncomingRefCounted.h in Headers */ = {isa = PBXBuildFile; fileRef = 0F2B66A817B6B53D00A7AE3F /* GCIncomingRefCounted.h */; settings = {ATTRIBUTES = (Private, ); }; }; + A3CA47E41BCD9DC9004C5B45 /* GCIncomingRefCountedInlines.h in Headers */ = {isa = PBXBuildFile; fileRef = 0F2B66A917B6B53D00A7AE3F /* GCIncomingRefCountedInlines.h */; settings = {ATTRIBUTES = (Private, ); }; }; + A3CA47E51BCD9DC9004C5B45 /* GCIncomingRefCountedSet.h in Headers */ = {isa = PBXBuildFile; fileRef = 0F2B66AA17B6B53D00A7AE3F /* GCIncomingRefCountedSet.h */; settings = {ATTRIBUTES = (Private, ); }; }; + A3CA47E61BCD9DC9004C5B45 /* GCIncomingRefCountedSetInlines.h in Headers */ = {isa = PBXBuildFile; fileRef = 0F2B66AB17B6B53D00A7AE3F /* GCIncomingRefCountedSetInlines.h */; settings = {ATTRIBUTES = (Private, ); }; }; + A3CA47E71BCD9DC9004C5B45 /* GCThread.h in Headers */ = {isa = PBXBuildFile; fileRef = C2239D1616262BDD005AC5FD /* GCThread.h */; }; + A3CA47E81BCD9DC9004C5B45 /* GCThreadSharedData.h in Headers */ = {isa = PBXBuildFile; fileRef = C21122DF15DD9AB300790E3A /* GCThreadSharedData.h */; settings = {ATTRIBUTES = (Private, ); }; }; + A3CA47E91BCD9DC9004C5B45 /* GenericTypedArrayView.h in Headers */ = {isa = PBXBuildFile; fileRef = 0F2B66B217B6B5AB00A7AE3F /* GenericTypedArrayView.h */; settings = {ATTRIBUTES = (Private, ); }; }; + A3CA47EA1BCD9DC9004C5B45 /* GenericTypedArrayViewInlines.h in Headers */ = {isa = PBXBuildFile; fileRef = 0F2B66B317B6B5AB00A7AE3F /* GenericTypedArrayViewInlines.h */; settings = {ATTRIBUTES = (Private, ); }; }; + A3CA47EB1BCD9DC9004C5B45 /* GetByIdStatus.h in Headers */ = {isa = PBXBuildFile; fileRef = 0F93329614CA7DC10085F3C6 /* GetByIdStatus.h */; settings = {ATTRIBUTES = (Private, ); }; }; + A3CA47EC1BCD9DC9004C5B45 /* GPRInfo.h in Headers */ = {isa = PBXBuildFile; fileRef = 0F24E53F17EA9F5900ABB217 /* GPRInfo.h */; settings = {ATTRIBUTES = (Private, ); }; }; + A3CA47ED1BCD9DC9004C5B45 /* Handle.h in Headers */ = {isa = PBXBuildFile; fileRef = 142E312B134FF0A600AFADB5 /* Handle.h */; settings = {ATTRIBUTES = (Private, ); }; }; + A3CA47EE1BCD9DC9004C5B45 /* HandleBlock.h in Headers */ = {isa = PBXBuildFile; fileRef = C28318FF16FE4B7D00157BFD /* HandleBlock.h */; settings = {ATTRIBUTES = (Private, ); }; }; + A3CA47EF1BCD9DC9004C5B45 /* HandleBlockInlines.h in Headers */ = {isa = PBXBuildFile; fileRef = C283190116FE533E00157BFD /* HandleBlockInlines.h */; }; + A3CA47F01BCD9DC9004C5B45 /* HandlerInfo.h in Headers */ = {isa = PBXBuildFile; fileRef = 0F0B83A814BCF55E00885B4F /* HandlerInfo.h */; settings = {ATTRIBUTES = (Private, ); }; }; + A3CA47F11BCD9DC9004C5B45 /* HandleSet.h in Headers */ = {isa = PBXBuildFile; fileRef = 142E312D134FF0A600AFADB5 /* HandleSet.h */; settings = {ATTRIBUTES = (Private, ); }; }; + A3CA47F21BCD9DC9004C5B45 /* HandleStack.h in Headers */ = {isa = PBXBuildFile; fileRef = 142E312F134FF0A600AFADB5 /* HandleStack.h */; settings = {ATTRIBUTES = (Private, ); }; }; + A3CA47F31BCD9DC9004C5B45 /* HandleTypes.h in Headers */ = {isa = PBXBuildFile; fileRef = 146FA5A81378F6B0003627A3 /* HandleTypes.h */; settings = {ATTRIBUTES = (Private, ); }; }; + A3CA47F41BCD9DC9004C5B45 /* Heap.h in Headers */ = {isa = PBXBuildFile; fileRef = 14BA7A9613AADFF8005B7C2C /* Heap.h */; settings = {ATTRIBUTES = (Private, ); }; }; + A3CA47F51BCD9DC9004C5B45 /* HeapBlock.h in Headers */ = {isa = PBXBuildFile; fileRef = C2C8D02F14A3CEFC00578E65 /* HeapBlock.h */; settings = {ATTRIBUTES = (Private, ); }; }; + A3CA47F61BCD9DC9004C5B45 /* HeapIterationScope.h in Headers */ = {isa = PBXBuildFile; fileRef = 2AD8932917E3868F00668276 /* HeapIterationScope.h */; }; + A3CA47F71BCD9DC9004C5B45 /* HeapOperation.h in Headers */ = {isa = PBXBuildFile; fileRef = 2A6F462517E959CE00C45C98 /* HeapOperation.h */; settings = {ATTRIBUTES = (Private, ); }; }; + A3CA47F81BCD9DC9004C5B45 /* HeapRootVisitor.h in Headers */ = {isa = PBXBuildFile; fileRef = 14F97446138C853E00DA1C67 /* HeapRootVisitor.h */; settings = {ATTRIBUTES = (Private, ); }; }; + A3CA47F91BCD9DC9004C5B45 /* HeapStatistics.h in Headers */ = {isa = PBXBuildFile; fileRef = C24D31E1161CD695002AA4DB /* HeapStatistics.h */; settings = {ATTRIBUTES = (Private, ); }; }; + A3CA47FA1BCD9DC9004C5B45 /* FullBytecodeLiveness.h in Headers */ = {isa = PBXBuildFile; fileRef = 0F666EBF183566F900D017F1 /* FullBytecodeLiveness.h */; settings = {ATTRIBUTES = (Private, ); }; }; + A3CA47FB1BCD9DC9004C5B45 /* HeapTimer.h in Headers */ = {isa = PBXBuildFile; fileRef = C2E526BC1590EF000054E48D /* HeapTimer.h */; settings = {ATTRIBUTES = (Private, ); }; }; + A3CA47FC1BCD9DC9004C5B45 /* HostCallReturnValue.h in Headers */ = {isa = PBXBuildFile; fileRef = 0F4680D114BBC5F800BFE272 /* HostCallReturnValue.h */; settings = {ATTRIBUTES = (Private, ); }; }; + A3CA47FD1BCD9DC9004C5B45 /* Identifier.h in Headers */ = {isa = PBXBuildFile; fileRef = 933A349A038AE7C6008635CE /* Identifier.h */; settings = {ATTRIBUTES = (Private, ); }; }; + A3CA47FE1BCD9DC9004C5B45 /* IncrementalSweeper.h in Headers */ = {isa = PBXBuildFile; fileRef = C25F8BCC157544A900245B71 /* IncrementalSweeper.h */; settings = {ATTRIBUTES = (Private, ); }; }; + A3CA47FF1BCD9DC9004C5B45 /* IndexingHeader.h in Headers */ = {isa = PBXBuildFile; fileRef = 0FB7F38D15ED8E3800F167B2 /* IndexingHeader.h */; settings = {ATTRIBUTES = (Private, ); }; }; + A3CA48001BCD9DC9004C5B45 /* IndexingHeaderInlines.h in Headers */ = {isa = PBXBuildFile; fileRef = 0FB7F38E15ED8E3800F167B2 /* IndexingHeaderInlines.h */; settings = {ATTRIBUTES = (Private, ); }; }; + A3CA48011BCD9DC9004C5B45 /* IndexingType.h in Headers */ = {isa = PBXBuildFile; fileRef = 0FB7F38F15ED8E3800F167B2 /* IndexingType.h */; settings = {ATTRIBUTES = (Private, ); }; }; + A3CA48021BCD9DC9004C5B45 /* InitializeLLVM.h in Headers */ = {isa = PBXBuildFile; fileRef = 0FCEFAAE1805CA6D00472CE4 /* InitializeLLVM.h */; settings = {ATTRIBUTES = (Private, ); }; }; + A3CA48031BCD9DC9004C5B45 /* InitializeLLVMPOSIX.h in Headers */ = {isa = PBXBuildFile; fileRef = 0FCEFAC61805E75500472CE4 /* InitializeLLVMPOSIX.h */; settings = {ATTRIBUTES = (Private, ); }; }; + A3CA48041BCD9DC9004C5B45 /* InitializeThreading.h in Headers */ = {isa = PBXBuildFile; fileRef = E178633F0D9BEC0000D74E75 /* InitializeThreading.h */; settings = {ATTRIBUTES = (Private, ); }; }; + A3CA48051BCD9DC9004C5B45 /* InlineCallFrameSet.h in Headers */ = {isa = PBXBuildFile; fileRef = 0F24E55417F0B71C00ABB217 /* InlineCallFrameSet.h */; settings = {ATTRIBUTES = (Private, ); }; }; + A3CA48061BCD9DC9004C5B45 /* Instruction.h in Headers */ = {isa = PBXBuildFile; fileRef = 969A07930ED1D3AE00F1F681 /* Instruction.h */; settings = {ATTRIBUTES = (Private, ); }; }; + A3CA48071BCD9DC9004C5B45 /* Int16Array.h in Headers */ = {isa = PBXBuildFile; fileRef = A7A8AF2C17ADB5F3005AB174 /* Int16Array.h */; settings = {ATTRIBUTES = (Private, ); }; }; + A3CA48081BCD9DC9004C5B45 /* Int32Array.h in Headers */ = {isa = PBXBuildFile; fileRef = A7A8AF2D17ADB5F3005AB174 /* Int32Array.h */; settings = {ATTRIBUTES = (Private, ); }; }; + A3CA48091BCD9DC9004C5B45 /* Int8Array.h in Headers */ = {isa = PBXBuildFile; fileRef = A7A8AF2B17ADB5F3005AB174 /* Int8Array.h */; settings = {ATTRIBUTES = (Private, ); }; }; + A3CA480A1BCD9DC9004C5B45 /* IntendedStructureChain.h in Headers */ = {isa = PBXBuildFile; fileRef = A78853F817972629001440E4 /* IntendedStructureChain.h */; settings = {ATTRIBUTES = (Private, ); }; }; + A3CA480B1BCD9DC9004C5B45 /* InternalFunction.h in Headers */ = {isa = PBXBuildFile; fileRef = BC11667A0E199C05008066DD /* InternalFunction.h */; settings = {ATTRIBUTES = (Private, ); }; }; + A3CA480C1BCD9DC9004C5B45 /* Interpreter.h in Headers */ = {isa = PBXBuildFile; fileRef = 1429D77B0ED20D7300B89619 /* Interpreter.h */; settings = {ATTRIBUTES = (Private, ); }; }; + A3CA480D1BCD9DC9004C5B45 /* Intrinsic.h in Headers */ = {isa = PBXBuildFile; fileRef = 86BF642A148DB2B5004DE36A /* Intrinsic.h */; settings = {ATTRIBUTES = (Private, ); }; }; + A3CA480E1BCD9DC9004C5B45 /* JavaScript.h in Headers */ = {isa = PBXBuildFile; fileRef = 1CAA8B4A0D32C39A0041BCFF /* JavaScript.h */; settings = {ATTRIBUTES = (Public, ); }; }; + A3CA480F1BCD9DC9004C5B45 /* JavaScriptCore.h in Headers */ = {isa = PBXBuildFile; fileRef = 1CAA8B4B0D32C39A0041BCFF /* JavaScriptCore.h */; settings = {ATTRIBUTES = (Public, ); }; }; + A3CA48101BCD9DC9004C5B45 /* JavaScriptCorePrefix.h in Headers */ = {isa = PBXBuildFile; fileRef = F5C290E60284F98E018635CA /* JavaScriptCorePrefix.h */; }; + A3CA48111BCD9DC9004C5B45 /* JIT.h in Headers */ = {isa = PBXBuildFile; fileRef = 1429D92E0ED22D7000B89619 /* JIT.h */; }; + A3CA48121BCD9DC9004C5B45 /* JITCode.h in Headers */ = {isa = PBXBuildFile; fileRef = 86CCEFDD0F413F8900FD7F9E /* JITCode.h */; settings = {ATTRIBUTES = (Private, ); }; }; + A3CA48131BCD9DC9004C5B45 /* JITCompilationEffort.h in Headers */ = {isa = PBXBuildFile; fileRef = 0F0776BD14FF002800102332 /* JITCompilationEffort.h */; settings = {ATTRIBUTES = (Private, ); }; }; + A3CA48141BCD9DC9004C5B45 /* JITDisassembler.h in Headers */ = {isa = PBXBuildFile; fileRef = 0FAF7EFB165BA919000C8455 /* JITDisassembler.h */; settings = {ATTRIBUTES = (Private, ); }; }; + A3CA48151BCD9DC9004C5B45 /* RemoteInspectorDebuggable.h in Headers */ = {isa = PBXBuildFile; fileRef = A5BA15EF182345AF00A82E69 /* RemoteInspectorDebuggable.h */; settings = {ATTRIBUTES = (Private, ); }; }; + A3CA48161BCD9DC9004C5B45 /* JITExceptions.h in Headers */ = {isa = PBXBuildFile; fileRef = 0F46808014BA572700BFE272 /* JITExceptions.h */; settings = {ATTRIBUTES = (Private, ); }; }; + A3CA48171BCD9DC9004C5B45 /* DFGStrengthReductionPhase.h in Headers */ = {isa = PBXBuildFile; fileRef = 0FC20CB41852E2C600C9E954 /* DFGStrengthReductionPhase.h */; settings = {ATTRIBUTES = (Private, ); }; }; + A3CA48181BCD9DC9004C5B45 /* JITInlineCacheGenerator.h in Headers */ = {isa = PBXBuildFile; fileRef = 0FB14E1D18124ACE009B6B4D /* JITInlineCacheGenerator.h */; settings = {ATTRIBUTES = (Private, ); }; }; + A3CA48191BCD9DC9004C5B45 /* JITInlines.h in Headers */ = {isa = PBXBuildFile; fileRef = 86CC85A00EE79A4700288682 /* JITInlines.h */; }; + A3CA481A1BCD9DC9004C5B45 /* JITOperations.h in Headers */ = {isa = PBXBuildFile; fileRef = 0F24E54617EE274900ABB217 /* JITOperations.h */; }; + A3CA481B1BCD9DC9004C5B45 /* JSSetIterator.h in Headers */ = {isa = PBXBuildFile; fileRef = A790DD6A182F499700588807 /* JSSetIterator.h */; }; + A3CA481C1BCD9DC9004C5B45 /* JITOperationWrappers.h in Headers */ = {isa = PBXBuildFile; fileRef = 0F24E54717EE274900ABB217 /* JITOperationWrappers.h */; }; + A3CA481D1BCD9DC9004C5B45 /* JITStubRoutine.h in Headers */ = {isa = PBXBuildFile; fileRef = 0F766D1C15A5028D008F363E /* JITStubRoutine.h */; settings = {ATTRIBUTES = (Private, ); }; }; + A3CA481E1BCD9DC9004C5B45 /* JITStubRoutineSet.h in Headers */ = {isa = PBXBuildFile; fileRef = 0F766D2A15A8CC34008F363E /* JITStubRoutineSet.h */; settings = {ATTRIBUTES = (Private, ); }; }; + A3CA481F1BCD9DC9004C5B45 /* JITStubs.h in Headers */ = {isa = PBXBuildFile; fileRef = 14A6581A0F4E36F4000150FD /* JITStubs.h */; settings = {ATTRIBUTES = (Private, ); }; }; + A3CA48201BCD9DC9004C5B45 /* JITStubsARM.h in Headers */ = {isa = PBXBuildFile; fileRef = FEF6835A174343CC00A32E25 /* JITStubsARM.h */; settings = {ATTRIBUTES = (Private, ); }; }; + A3CA48211BCD9DC9004C5B45 /* JITStubsARMv7.h in Headers */ = {isa = PBXBuildFile; fileRef = FEF6835B174343CC00A32E25 /* JITStubsARMv7.h */; settings = {ATTRIBUTES = (Private, ); }; }; + A3CA48221BCD9DC9004C5B45 /* JITStubsX86.h in Headers */ = {isa = PBXBuildFile; fileRef = FEF6835D174343CC00A32E25 /* JITStubsX86.h */; settings = {ATTRIBUTES = (Private, ); }; }; + A3CA48231BCD9DC9004C5B45 /* JITStubsX86_64.h in Headers */ = {isa = PBXBuildFile; fileRef = FEF6835C174343CC00A32E25 /* JITStubsX86_64.h */; settings = {ATTRIBUTES = (Private, ); }; }; + A3CA48241BCD9DC9004C5B45 /* JITStubsX86Common.h in Headers */ = {isa = PBXBuildFile; fileRef = A7A4AE0C17973B4D005612B1 /* JITStubsX86Common.h */; }; + A3CA48251BCD9DC9004C5B45 /* JITThunks.h in Headers */ = {isa = PBXBuildFile; fileRef = 0F5EF91C16878F78003E5C25 /* JITThunks.h */; settings = {ATTRIBUTES = (Private, ); }; }; + A3CA48261BCD9DC9004C5B45 /* JITToDFGDeferredCompilationCallback.h in Headers */ = {isa = PBXBuildFile; fileRef = 0FC712E117CD878F008CC93C /* JITToDFGDeferredCompilationCallback.h */; settings = {ATTRIBUTES = (Private, ); }; }; + A3CA48271BCD9DC9004C5B45 /* JITWriteBarrier.h in Headers */ = {isa = PBXBuildFile; fileRef = A76F54A213B28AAB00EF2BCE /* JITWriteBarrier.h */; settings = {ATTRIBUTES = (Private, ); }; }; + A3CA48281BCD9DC9004C5B45 /* JSActivation.h in Headers */ = {isa = PBXBuildFile; fileRef = 14DA818E0D99FD2000B0A4FB /* JSActivation.h */; settings = {ATTRIBUTES = (); }; }; + A3CA48291BCD9DC9004C5B45 /* JSAPIValueWrapper.h in Headers */ = {isa = PBXBuildFile; fileRef = BC0894D60FAFBA2D00001865 /* JSAPIValueWrapper.h */; settings = {ATTRIBUTES = (Private, ); }; }; + A3CA482A1BCD9DC9004C5B45 /* JSAPIWrapperObject.h in Headers */ = {isa = PBXBuildFile; fileRef = C2CF39C016E15A8100DD69BE /* JSAPIWrapperObject.h */; }; + A3CA482B1BCD9DC9004C5B45 /* JSArgumentsIterator.h in Headers */ = {isa = PBXBuildFile; fileRef = A76140CC182982CB00750624 /* JSArgumentsIterator.h */; }; + A3CA482C1BCD9DC9004C5B45 /* JSArray.h in Headers */ = {isa = PBXBuildFile; fileRef = 938772E5038BFE19008635CE /* JSArray.h */; settings = {ATTRIBUTES = (Private, ); }; }; + A3CA482D1BCD9DC9004C5B45 /* JSArrayBuffer.h in Headers */ = {isa = PBXBuildFile; fileRef = 0F2B66B517B6B5AB00A7AE3F /* JSArrayBuffer.h */; settings = {ATTRIBUTES = (Private, ); }; }; + A3CA482E1BCD9DC9004C5B45 /* JSArrayBufferConstructor.h in Headers */ = {isa = PBXBuildFile; fileRef = 0F2B66B717B6B5AB00A7AE3F /* JSArrayBufferConstructor.h */; settings = {ATTRIBUTES = (Private, ); }; }; + A3CA482F1BCD9DC9004C5B45 /* JSArrayBufferPrototype.h in Headers */ = {isa = PBXBuildFile; fileRef = 0F2B66B917B6B5AB00A7AE3F /* JSArrayBufferPrototype.h */; settings = {ATTRIBUTES = (Private, ); }; }; + A3CA48301BCD9DC9004C5B45 /* JSArrayBufferView.h in Headers */ = {isa = PBXBuildFile; fileRef = 0F2B66BB17B6B5AB00A7AE3F /* JSArrayBufferView.h */; settings = {ATTRIBUTES = (Private, ); }; }; + A3CA48311BCD9DC9004C5B45 /* JSArrayBufferViewInlines.h in Headers */ = {isa = PBXBuildFile; fileRef = 0F2B66BC17B6B5AB00A7AE3F /* JSArrayBufferViewInlines.h */; settings = {ATTRIBUTES = (Private, ); }; }; + A3CA48321BCD9DC9004C5B45 /* JSArrayIterator.h in Headers */ = {isa = PBXBuildFile; fileRef = A7BDAEC517F4EA1400F6140C /* JSArrayIterator.h */; }; + A3CA48331BCD9DC9004C5B45 /* JSBase.h in Headers */ = {isa = PBXBuildFile; fileRef = 142711380A460BBB0080EEEA /* JSBase.h */; settings = {ATTRIBUTES = (Public, ); }; }; + A3CA48341BCD9DC9004C5B45 /* RecursiveAllocationScope.h in Headers */ = {isa = PBXBuildFile; fileRef = 2AAD964918569417001F93BE /* RecursiveAllocationScope.h */; }; + A3CA48351BCD9DC9004C5B45 /* JSBasePrivate.h in Headers */ = {isa = PBXBuildFile; fileRef = 140D17D60E8AD4A9000CD17D /* JSBasePrivate.h */; settings = {ATTRIBUTES = (Private, ); }; }; + A3CA48361BCD9DC9004C5B45 /* JSBoundFunction.h in Headers */ = {isa = PBXBuildFile; fileRef = 86FA9E90142BBB2E001773B7 /* JSBoundFunction.h */; }; + A3CA48371BCD9DC9004C5B45 /* JSCallbackConstructor.h in Headers */ = {isa = PBXBuildFile; fileRef = 1440F8AC0A508D200005F061 /* JSCallbackConstructor.h */; }; + A3CA48381BCD9DC9004C5B45 /* JSCallbackFunction.h in Headers */ = {isa = PBXBuildFile; fileRef = 1440F88F0A508B100005F061 /* JSCallbackFunction.h */; }; + A3CA48391BCD9DC9004C5B45 /* JSCallbackObject.h in Headers */ = {isa = PBXBuildFile; fileRef = 14ABDF5D0A437FEF00ECCA01 /* JSCallbackObject.h */; }; + A3CA483A1BCD9DC9004C5B45 /* JSCallbackObjectFunctions.h in Headers */ = {isa = PBXBuildFile; fileRef = A8E894310CD0602400367179 /* JSCallbackObjectFunctions.h */; }; + A3CA483B1BCD9DC9004C5B45 /* JSCell.h in Headers */ = {isa = PBXBuildFile; fileRef = BC1167D80E19BCC9008066DD /* JSCell.h */; settings = {ATTRIBUTES = (Private, ); }; }; + A3CA483C1BCD9DC9004C5B45 /* JSCellInlines.h in Headers */ = {isa = PBXBuildFile; fileRef = 0F97496F1687ADE200A4FF6A /* JSCellInlines.h */; settings = {ATTRIBUTES = (Private, ); }; }; + A3CA483D1BCD9DC9004C5B45 /* JSCJSValue.h in Headers */ = {isa = PBXBuildFile; fileRef = 14ABB36E099C076400E2A24F /* JSCJSValue.h */; settings = {ATTRIBUTES = (Private, ); }; }; + A3CA483E1BCD9DC9004C5B45 /* JSCJSValueInlines.h in Headers */ = {isa = PBXBuildFile; fileRef = 865A30F0135007E100CDB49E /* JSCJSValueInlines.h */; settings = {ATTRIBUTES = (Private, ); }; }; + A3CA483F1BCD9DC9004C5B45 /* JSClassRef.h in Headers */ = {isa = PBXBuildFile; fileRef = 1440FCE10A51E46B0005F061 /* JSClassRef.h */; settings = {ATTRIBUTES = (Private, ); }; }; + A3CA48401BCD9DC9004C5B45 /* JSContext.h in Headers */ = {isa = PBXBuildFile; fileRef = 86E3C607167BAB87006D760A /* JSContext.h */; settings = {ATTRIBUTES = (Public, ); }; }; + A3CA48411BCD9DC9004C5B45 /* JSContextInternal.h in Headers */ = {isa = PBXBuildFile; fileRef = 86E3C609167BAB87006D760A /* JSContextInternal.h */; settings = {ATTRIBUTES = (Private, ); }; }; + A3CA48421BCD9DC9004C5B45 /* JSContextRef.h in Headers */ = {isa = PBXBuildFile; fileRef = 14BD5A2A0A3E91F600BAF59C /* JSContextRef.h */; settings = {ATTRIBUTES = (Public, ); }; }; + A3CA48431BCD9DC9004C5B45 /* JSContextRefPrivate.h in Headers */ = {isa = PBXBuildFile; fileRef = 148CD1D7108CF902008163C6 /* JSContextRefPrivate.h */; settings = {ATTRIBUTES = (Private, ); }; }; + A3CA48441BCD9DC9004C5B45 /* JSCTestRunnerUtils.h in Headers */ = {isa = PBXBuildFile; fileRef = A72028B51797601E0098028C /* JSCTestRunnerUtils.h */; settings = {ATTRIBUTES = (Private, ); }; }; + A3CA48451BCD9DC9004C5B45 /* JSDataView.h in Headers */ = {isa = PBXBuildFile; fileRef = 0F2B66BE17B6B5AB00A7AE3F /* JSDataView.h */; settings = {ATTRIBUTES = (Private, ); }; }; + A3CA48461BCD9DC9004C5B45 /* JSDataViewPrototype.h in Headers */ = {isa = PBXBuildFile; fileRef = 0F2B66C017B6B5AB00A7AE3F /* JSDataViewPrototype.h */; settings = {ATTRIBUTES = (Private, ); }; }; + A3CA48471BCD9DC9004C5B45 /* JSDateMath.h in Headers */ = {isa = PBXBuildFile; fileRef = 9788FC231471AD0C0068CE2D /* JSDateMath.h */; settings = {ATTRIBUTES = (Private, ); }; }; + A3CA48481BCD9DC9004C5B45 /* JSDestructibleObject.h in Headers */ = {isa = PBXBuildFile; fileRef = C2A7F687160432D400F76B98 /* JSDestructibleObject.h */; settings = {ATTRIBUTES = (Private, ); }; }; + A3CA48491BCD9DC9004C5B45 /* JSExport.h in Headers */ = {isa = PBXBuildFile; fileRef = 86E3C60A167BAB87006D760A /* JSExport.h */; settings = {ATTRIBUTES = (Public, ); }; }; + A3CA484A1BCD9DC9004C5B45 /* JSExportMacros.h in Headers */ = {isa = PBXBuildFile; fileRef = A7B4ACAE1484C9CE00B38A36 /* JSExportMacros.h */; settings = {ATTRIBUTES = (Private, ); }; }; + A3CA484B1BCD9DC9004C5B45 /* JSFloat32Array.h in Headers */ = {isa = PBXBuildFile; fileRef = 0F2B66C117B6B5AB00A7AE3F /* JSFloat32Array.h */; settings = {ATTRIBUTES = (Private, ); }; }; + A3CA484C1BCD9DC9004C5B45 /* JSFloat64Array.h in Headers */ = {isa = PBXBuildFile; fileRef = 0F2B66C217B6B5AB00A7AE3F /* JSFloat64Array.h */; settings = {ATTRIBUTES = (Private, ); }; }; + A3CA484D1BCD9DC9004C5B45 /* JSFunction.h in Headers */ = {isa = PBXBuildFile; fileRef = F692A85F0255597D01FF60F7 /* JSFunction.h */; settings = {ATTRIBUTES = (Private, ); }; }; + A3CA484E1BCD9DC9004C5B45 /* JSFunctionInlines.h in Headers */ = {isa = PBXBuildFile; fileRef = A72028B91797603D0098028C /* JSFunctionInlines.h */; settings = {ATTRIBUTES = (Private, ); }; }; + A3CA484F1BCD9DC9004C5B45 /* JSGenericTypedArrayView.h in Headers */ = {isa = PBXBuildFile; fileRef = 0F2B66C317B6B5AB00A7AE3F /* JSGenericTypedArrayView.h */; settings = {ATTRIBUTES = (Private, ); }; }; + A3CA48501BCD9DC9004C5B45 /* JSGenericTypedArrayViewConstructor.h in Headers */ = {isa = PBXBuildFile; fileRef = 0F2B66C417B6B5AB00A7AE3F /* JSGenericTypedArrayViewConstructor.h */; settings = {ATTRIBUTES = (Private, ); }; }; + A3CA48511BCD9DC9004C5B45 /* JSGenericTypedArrayViewConstructorInlines.h in Headers */ = {isa = PBXBuildFile; fileRef = 0F2B66C517B6B5AB00A7AE3F /* JSGenericTypedArrayViewConstructorInlines.h */; settings = {ATTRIBUTES = (Private, ); }; }; + A3CA48521BCD9DC9004C5B45 /* JSGenericTypedArrayViewInlines.h in Headers */ = {isa = PBXBuildFile; fileRef = 0F2B66C617B6B5AB00A7AE3F /* JSGenericTypedArrayViewInlines.h */; settings = {ATTRIBUTES = (Private, ); }; }; + A3CA48531BCD9DC9004C5B45 /* JSGenericTypedArrayViewPrototype.h in Headers */ = {isa = PBXBuildFile; fileRef = 0F2B66C717B6B5AB00A7AE3F /* JSGenericTypedArrayViewPrototype.h */; settings = {ATTRIBUTES = (Private, ); }; }; + A3CA48541BCD9DC9004C5B45 /* JSGenericTypedArrayViewPrototypeInlines.h in Headers */ = {isa = PBXBuildFile; fileRef = 0F2B66C817B6B5AB00A7AE3F /* JSGenericTypedArrayViewPrototypeInlines.h */; settings = {ATTRIBUTES = (Private, ); }; }; + A3CA48551BCD9DC9004C5B45 /* JSGlobalObject.h in Headers */ = {isa = PBXBuildFile; fileRef = A8E894330CD0603F00367179 /* JSGlobalObject.h */; settings = {ATTRIBUTES = (Private, ); }; }; + A3CA48561BCD9DC9004C5B45 /* JSGlobalObjectFunctions.h in Headers */ = {isa = PBXBuildFile; fileRef = BC756FC70E2031B200DE7D12 /* JSGlobalObjectFunctions.h */; }; + A3CA48571BCD9DC9004C5B45 /* JSInt16Array.h in Headers */ = {isa = PBXBuildFile; fileRef = 0F2B66CA17B6B5AB00A7AE3F /* JSInt16Array.h */; settings = {ATTRIBUTES = (Private, ); }; }; + A3CA48581BCD9DC9004C5B45 /* JSInt32Array.h in Headers */ = {isa = PBXBuildFile; fileRef = 0F2B66CB17B6B5AB00A7AE3F /* JSInt32Array.h */; settings = {ATTRIBUTES = (Private, ); }; }; + A3CA48591BCD9DC9004C5B45 /* JSInt8Array.h in Headers */ = {isa = PBXBuildFile; fileRef = 0F2B66C917B6B5AB00A7AE3F /* JSInt8Array.h */; settings = {ATTRIBUTES = (Private, ); }; }; + A3CA485A1BCD9DC9004C5B45 /* JSInterfaceJIT.h in Headers */ = {isa = PBXBuildFile; fileRef = A76C51741182748D00715B05 /* JSInterfaceJIT.h */; settings = {ATTRIBUTES = (Private, ); }; }; + A3CA485B1BCD9DC9004C5B45 /* JSLock.h in Headers */ = {isa = PBXBuildFile; fileRef = 65EA4C9A092AF9E20093D800 /* JSLock.h */; settings = {ATTRIBUTES = (Private, ); }; }; + A3CA485C1BCD9DC9004C5B45 /* JSManagedValue.h in Headers */ = {isa = PBXBuildFile; fileRef = C25D709A16DE99F400FCA6BC /* JSManagedValue.h */; settings = {ATTRIBUTES = (Public, ); }; }; + A3CA485D1BCD9DC9004C5B45 /* JSMap.h in Headers */ = {isa = PBXBuildFile; fileRef = A700874017CBE8EB00C3E643 /* JSMap.h */; settings = {ATTRIBUTES = (Private, ); }; }; + A3CA485E1BCD9DC9004C5B45 /* JSNameScope.h in Headers */ = {isa = PBXBuildFile; fileRef = 14874AE015EBDE4A002E3587 /* JSNameScope.h */; settings = {ATTRIBUTES = (Private, ); }; }; + A3CA485F1BCD9DC9004C5B45 /* JSObject.h in Headers */ = {isa = PBXBuildFile; fileRef = BC22A3990E16E14800AF21C8 /* JSObject.h */; settings = {ATTRIBUTES = (Private, ); }; }; + A3CA48601BCD9DC9004C5B45 /* JSObjectRef.h in Headers */ = {isa = PBXBuildFile; fileRef = 1482B7E10A43076000517CFC /* JSObjectRef.h */; settings = {ATTRIBUTES = (Public, ); }; }; + A3CA48611BCD9DC9004C5B45 /* JSObjectRefPrivate.h in Headers */ = {isa = PBXBuildFile; fileRef = A79EDB0811531CD60019E912 /* JSObjectRefPrivate.h */; settings = {ATTRIBUTES = (Private, ); }; }; + A3CA48621BCD9DC9004C5B45 /* JSONObject.h in Headers */ = {isa = PBXBuildFile; fileRef = A7F9935D0FD7325100A0B2D0 /* JSONObject.h */; settings = {ATTRIBUTES = (Private, ); }; }; + A3CA48631BCD9DC9004C5B45 /* JSONObject.lut.h in Headers */ = {isa = PBXBuildFile; fileRef = BC87CDB810712ACA000614CF /* JSONObject.lut.h */; }; + A3CA48641BCD9DC9004C5B45 /* JSProfilerPrivate.h in Headers */ = {isa = PBXBuildFile; fileRef = 952C63AC0E4777D600C13936 /* JSProfilerPrivate.h */; settings = {ATTRIBUTES = (Private, ); }; }; + A3CA48651BCD9DC9004C5B45 /* JSPromise.h in Headers */ = {isa = PBXBuildFile; fileRef = 7C184E1917BEDBD3007CB63A /* JSPromise.h */; settings = {ATTRIBUTES = (Private, ); }; }; + A3CA48661BCD9DC9004C5B45 /* JSPromiseConstructor.h in Headers */ = {isa = PBXBuildFile; fileRef = 7C184E2117BEE240007CB63A /* JSPromiseConstructor.h */; }; + A3CA48671BCD9DC9004C5B45 /* JSPromisePrototype.h in Headers */ = {isa = PBXBuildFile; fileRef = 7C184E1D17BEE22E007CB63A /* JSPromisePrototype.h */; }; + A3CA48681BCD9DC9004C5B45 /* JSMapIterator.h in Headers */ = {isa = PBXBuildFile; fileRef = A74DEF90182D991400522C22 /* JSMapIterator.h */; }; + A3CA48691BCD9DC9004C5B45 /* JSProxy.h in Headers */ = {isa = PBXBuildFile; fileRef = 862553CF16136AA5009F17D0 /* JSProxy.h */; settings = {ATTRIBUTES = (Private, ); }; }; + A3CA486A1BCD9DC9004C5B45 /* JSRetainPtr.h in Headers */ = {isa = PBXBuildFile; fileRef = 95C18D3E0C90E7EF00E72F73 /* JSRetainPtr.h */; settings = {ATTRIBUTES = (Private, ); }; }; + A3CA486B1BCD9DC9004C5B45 /* JSScope.h in Headers */ = {isa = PBXBuildFile; fileRef = 14874AE215EBDE4A002E3587 /* JSScope.h */; settings = {ATTRIBUTES = (Private, ); }; }; + A3CA486C1BCD9DC9004C5B45 /* JSScriptRefPrivate.h in Headers */ = {isa = PBXBuildFile; fileRef = A7C0C4AB167C08CD0017011D /* JSScriptRefPrivate.h */; settings = {ATTRIBUTES = (Private, ); }; }; + A3CA486D1BCD9DC9004C5B45 /* JSSegmentedVariableObject.h in Headers */ = {isa = PBXBuildFile; fileRef = 0F919D0F157F3327004A4E7D /* JSSegmentedVariableObject.h */; settings = {ATTRIBUTES = (Private, ); }; }; + A3CA486E1BCD9DC9004C5B45 /* JSSet.h in Headers */ = {isa = PBXBuildFile; fileRef = A7299D9C17D12837005F5FF9 /* JSSet.h */; settings = {ATTRIBUTES = (Private, ); }; }; + A3CA486F1BCD9DC9004C5B45 /* JSStack.h in Headers */ = {isa = PBXBuildFile; fileRef = 14D792640DAA03FB001A9F05 /* JSStack.h */; settings = {ATTRIBUTES = (Private, ); }; }; + A3CA48701BCD9DC9004C5B45 /* JSStackInlines.h in Headers */ = {isa = PBXBuildFile; fileRef = A7C1EAEB17987AB600299DB2 /* JSStackInlines.h */; }; + A3CA48711BCD9DC9004C5B45 /* JSString.h in Headers */ = {isa = PBXBuildFile; fileRef = F692A8620255597D01FF60F7 /* JSString.h */; settings = {ATTRIBUTES = (Private, ); }; }; + A3CA48721BCD9DC9004C5B45 /* JSStringBuilder.h in Headers */ = {isa = PBXBuildFile; fileRef = 86E85538111B9968001AF51E /* JSStringBuilder.h */; }; + A3CA48731BCD9DC9004C5B45 /* JSStringJoiner.h in Headers */ = {isa = PBXBuildFile; fileRef = 2600B5A5152BAAA70091EE5F /* JSStringJoiner.h */; }; + A3CA48741BCD9DC9004C5B45 /* JSStringRef.h in Headers */ = {isa = PBXBuildFile; fileRef = 1482B74B0A43032800517CFC /* JSStringRef.h */; settings = {ATTRIBUTES = (Public, ); }; }; + A3CA48751BCD9DC9004C5B45 /* JSStringRefCF.h in Headers */ = {isa = PBXBuildFile; fileRef = 146AAB2A0B66A84900E55F16 /* JSStringRefCF.h */; settings = {ATTRIBUTES = (Public, ); }; }; + A3CA48761BCD9DC9004C5B45 /* JSStringRefPrivate.h in Headers */ = {isa = PBXBuildFile; fileRef = 1A28D4A7177B71C80007FA3C /* JSStringRefPrivate.h */; settings = {ATTRIBUTES = (Private, ); }; }; + A3CA48771BCD9DC9004C5B45 /* JSSymbolTableObject.h in Headers */ = {isa = PBXBuildFile; fileRef = 0F919D0A157EE09D004A4E7D /* JSSymbolTableObject.h */; settings = {ATTRIBUTES = (Private, ); }; }; + A3CA48781BCD9DC9004C5B45 /* JSType.h in Headers */ = {isa = PBXBuildFile; fileRef = 14ABB454099C2A0F00E2A24F /* JSType.h */; settings = {ATTRIBUTES = (Private, ); }; }; + A3CA48791BCD9DC9004C5B45 /* JSTypedArrayConstructors.h in Headers */ = {isa = PBXBuildFile; fileRef = 0F2B66CD17B6B5AB00A7AE3F /* JSTypedArrayConstructors.h */; settings = {ATTRIBUTES = (Private, ); }; }; + A3CA487A1BCD9DC9004C5B45 /* JSTypedArrayPrototypes.h in Headers */ = {isa = PBXBuildFile; fileRef = 0F2B66CF17B6B5AB00A7AE3F /* JSTypedArrayPrototypes.h */; settings = {ATTRIBUTES = (Private, ); }; }; + A3CA487B1BCD9DC9004C5B45 /* JSTypedArrays.h in Headers */ = {isa = PBXBuildFile; fileRef = 0F2B66D117B6B5AB00A7AE3F /* JSTypedArrays.h */; settings = {ATTRIBUTES = (Private, ); }; }; + A3CA487C1BCD9DC9004C5B45 /* JSTypeInfo.h in Headers */ = {isa = PBXBuildFile; fileRef = 6507D2970E871E4A00D7D896 /* JSTypeInfo.h */; settings = {ATTRIBUTES = (Private, ); }; }; + A3CA487D1BCD9DC9004C5B45 /* JSUint16Array.h in Headers */ = {isa = PBXBuildFile; fileRef = 0F2B66D417B6B5AB00A7AE3F /* JSUint16Array.h */; settings = {ATTRIBUTES = (Private, ); }; }; + A3CA487E1BCD9DC9004C5B45 /* JSUint32Array.h in Headers */ = {isa = PBXBuildFile; fileRef = 0F2B66D517B6B5AB00A7AE3F /* JSUint32Array.h */; settings = {ATTRIBUTES = (Private, ); }; }; + A3CA487F1BCD9DC9004C5B45 /* JSUint8Array.h in Headers */ = {isa = PBXBuildFile; fileRef = 0F2B66D217B6B5AB00A7AE3F /* JSUint8Array.h */; settings = {ATTRIBUTES = (Private, ); }; }; + A3CA48801BCD9DC9004C5B45 /* JSUint8ClampedArray.h in Headers */ = {isa = PBXBuildFile; fileRef = 0F2B66D317B6B5AB00A7AE3F /* JSUint8ClampedArray.h */; settings = {ATTRIBUTES = (Private, ); }; }; + A3CA48811BCD9DC9004C5B45 /* JSValue.h in Headers */ = {isa = PBXBuildFile; fileRef = 86E3C606167BAB87006D760A /* JSValue.h */; settings = {ATTRIBUTES = (Public, ); }; }; + A3CA48821BCD9DC9004C5B45 /* JSValueInternal.h in Headers */ = {isa = PBXBuildFile; fileRef = 86E3C60E167BAB87006D760A /* JSValueInternal.h */; settings = {ATTRIBUTES = (Private, ); }; }; + A3CA48831BCD9DC9004C5B45 /* JSValueRef.h in Headers */ = {isa = PBXBuildFile; fileRef = 1482B6EA0A4300B300517CFC /* JSValueRef.h */; settings = {ATTRIBUTES = (Public, ); }; }; + A3CA48841BCD9DC9004C5B45 /* JSVariableObject.h in Headers */ = {isa = PBXBuildFile; fileRef = 14F252560D08DD8D004ECFFF /* JSVariableObject.h */; settings = {ATTRIBUTES = (Private, ); }; }; + A3CA48851BCD9DC9004C5B45 /* JSVirtualMachine.h in Headers */ = {isa = PBXBuildFile; fileRef = 86E3C60F167BAB87006D760A /* JSVirtualMachine.h */; settings = {ATTRIBUTES = (Public, ); }; }; + A3CA48861BCD9DC9004C5B45 /* JSVirtualMachineInternal.h in Headers */ = {isa = PBXBuildFile; fileRef = 86E3C611167BAB87006D760A /* JSVirtualMachineInternal.h */; settings = {ATTRIBUTES = (Private, ); }; }; + A3CA48871BCD9DC9004C5B45 /* JSWeakMap.h in Headers */ = {isa = PBXBuildFile; fileRef = A7CA3AE217DA41AE006538AF /* JSWeakMap.h */; }; + A3CA48881BCD9DC9004C5B45 /* JSWeakObjectMapRefInternal.h in Headers */ = {isa = PBXBuildFile; fileRef = A7482E37116A697B003B0712 /* JSWeakObjectMapRefInternal.h */; settings = {ATTRIBUTES = (Private, ); }; }; + A3CA48891BCD9DC9004C5B45 /* JSWeakObjectMapRefPrivate.h in Headers */ = {isa = PBXBuildFile; fileRef = A7482B791166CDEA003B0712 /* JSWeakObjectMapRefPrivate.h */; settings = {ATTRIBUTES = (Private, ); }; }; + A3CA488A1BCD9DC9004C5B45 /* JSWithScope.h in Headers */ = {isa = PBXBuildFile; fileRef = 1442566015EDE98D0066A49B /* JSWithScope.h */; settings = {ATTRIBUTES = (Private, ); }; }; + A3CA488B1BCD9DC9004C5B45 /* JSWrapperMap.h in Headers */ = {isa = PBXBuildFile; fileRef = 86E3C60C167BAB87006D760A /* JSWrapperMap.h */; }; + A3CA488C1BCD9DC9004C5B45 /* JSWrapperObject.h in Headers */ = {isa = PBXBuildFile; fileRef = 65C7A1720A8EAACB00FA37EA /* JSWrapperObject.h */; settings = {ATTRIBUTES = (Private, ); }; }; + A3CA488D1BCD9DC9004C5B45 /* JumpTable.h in Headers */ = {isa = PBXBuildFile; fileRef = BCFD8C910EEB2EE700283848 /* JumpTable.h */; settings = {ATTRIBUTES = (Private, ); }; }; + A3CA488E1BCD9DC9004C5B45 /* MapIteratorPrototype.h in Headers */ = {isa = PBXBuildFile; fileRef = A74DEF8E182D991400522C22 /* MapIteratorPrototype.h */; }; + A3CA488F1BCD9DC9004C5B45 /* KeywordLookup.h in Headers */ = {isa = PBXBuildFile; fileRef = A7C225CD1399849C00FF1662 /* KeywordLookup.h */; }; + A3CA48901BCD9DC9004C5B45 /* Label.h in Headers */ = {isa = PBXBuildFile; fileRef = 969A07270ED1CE6900F1F681 /* Label.h */; }; + A3CA48911BCD9DC9004C5B45 /* LabelScope.h in Headers */ = {isa = PBXBuildFile; fileRef = 960097A50EBABB58007A7297 /* LabelScope.h */; }; + A3CA48921BCD9DC9004C5B45 /* LazyOperandValueProfile.h in Headers */ = {isa = PBXBuildFile; fileRef = 0FB5467614F59AD1002C2989 /* LazyOperandValueProfile.h */; settings = {ATTRIBUTES = (Private, ); }; }; + A3CA48931BCD9DC9004C5B45 /* LegacyProfiler.h in Headers */ = {isa = PBXBuildFile; fileRef = 95AB832F0DA42CAD00BC83F3 /* LegacyProfiler.h */; settings = {ATTRIBUTES = (Private, ); }; }; + A3CA48941BCD9DC9004C5B45 /* Lexer.h in Headers */ = {isa = PBXBuildFile; fileRef = F692A8660255597D01FF60F7 /* Lexer.h */; settings = {ATTRIBUTES = (Private, ); }; }; + A3CA48951BCD9DC9004C5B45 /* Lexer.lut.h in Headers */ = {isa = PBXBuildFile; fileRef = BC18C52D0E16FCE100B34460 /* Lexer.lut.h */; }; + A3CA48961BCD9DC9004C5B45 /* LineInfo.h in Headers */ = {isa = PBXBuildFile; fileRef = 0F0B83AC14BCF60200885B4F /* LineInfo.h */; settings = {ATTRIBUTES = (Private, ); }; }; + A3CA48971BCD9DC9004C5B45 /* LinkBuffer.h in Headers */ = {isa = PBXBuildFile; fileRef = 86D3B3C110159D7F002865E7 /* LinkBuffer.h */; settings = {ATTRIBUTES = (Private, ); }; }; + A3CA48981BCD9DC9004C5B45 /* ListableHandler.h in Headers */ = {isa = PBXBuildFile; fileRef = 0F431736146BAC65007E3890 /* ListableHandler.h */; settings = {ATTRIBUTES = (Private, ); }; }; + A3CA48991BCD9DC9004C5B45 /* LiteralParser.h in Headers */ = {isa = PBXBuildFile; fileRef = A7E2EA690FB460CF00601F06 /* LiteralParser.h */; }; + A3CA489A1BCD9DC9004C5B45 /* LLIntCallLinkInfo.h in Headers */ = {isa = PBXBuildFile; fileRef = 0F0FC45814BD15F100B81154 /* LLIntCallLinkInfo.h */; settings = {ATTRIBUTES = (Private, ); }; }; + A3CA489B1BCD9DC9004C5B45 /* LLIntCLoop.h in Headers */ = {isa = PBXBuildFile; fileRef = FE20CE9C15F04A9500DF3430 /* LLIntCLoop.h */; settings = {ATTRIBUTES = (Private, ); }; }; + A3CA489C1BCD9DC9004C5B45 /* LLIntCommon.h in Headers */ = {isa = PBXBuildFile; fileRef = 0F4680C514BBB16900BFE272 /* LLIntCommon.h */; settings = {ATTRIBUTES = (Private, ); }; }; + A3CA489D1BCD9DC9004C5B45 /* LLIntData.h in Headers */ = {isa = PBXBuildFile; fileRef = 0F4680CF14BBB3D100BFE272 /* LLIntData.h */; settings = {ATTRIBUTES = (Private, ); }; }; + A3CA489E1BCD9DC9004C5B45 /* LLIntEntrypoint.h in Headers */ = {isa = PBXBuildFile; fileRef = 0F38B01017CF077F00B144D3 /* LLIntEntrypoint.h */; settings = {ATTRIBUTES = (Private, ); }; }; + A3CA489F1BCD9DC9004C5B45 /* LLIntExceptions.h in Headers */ = {isa = PBXBuildFile; fileRef = 0F46809E14BA7F8200BFE272 /* LLIntExceptions.h */; settings = {ATTRIBUTES = (Private, ); }; }; + A3CA48A01BCD9DC9004C5B45 /* LLIntOfflineAsmConfig.h in Headers */ = {isa = PBXBuildFile; fileRef = 0F4680C614BBB16900BFE272 /* LLIntOfflineAsmConfig.h */; settings = {ATTRIBUTES = (Private, ); }; }; + A3CA48A11BCD9DC9004C5B45 /* LLIntOpcode.h in Headers */ = {isa = PBXBuildFile; fileRef = FED287B115EC9A5700DA8161 /* LLIntOpcode.h */; settings = {ATTRIBUTES = (Private, ); }; }; + A3CA48A21BCD9DC9004C5B45 /* JSPromiseDeferred.h in Headers */ = {isa = PBXBuildFile; fileRef = 7C008CD9187124BB00955C24 /* JSPromiseDeferred.h */; settings = {ATTRIBUTES = (Private, ); }; }; + A3CA48A31BCD9DC9004C5B45 /* LLIntSlowPaths.h in Headers */ = {isa = PBXBuildFile; fileRef = 0F4680A014BA7F8200BFE272 /* LLIntSlowPaths.h */; settings = {ATTRIBUTES = (Private, ); }; }; + A3CA48A41BCD9DC9004C5B45 /* LLIntThunks.h in Headers */ = {isa = PBXBuildFile; fileRef = 0F0B839814BCF45A00885B4F /* LLIntThunks.h */; settings = {ATTRIBUTES = (Private, ); }; }; + A3CA48A51BCD9DC9004C5B45 /* LLVMAPI.h in Headers */ = {isa = PBXBuildFile; fileRef = 0FCEFAC81805E75500472CE4 /* LLVMAPI.h */; settings = {ATTRIBUTES = (Private, ); }; }; + A3CA48A61BCD9DC9004C5B45 /* LLVMAPIFunctions.h in Headers */ = {isa = PBXBuildFile; fileRef = 0FCEFAC91805E75500472CE4 /* LLVMAPIFunctions.h */; settings = {ATTRIBUTES = (Private, ); }; }; + A3CA48A71BCD9DC9004C5B45 /* LLVMDisassembler.h in Headers */ = {isa = PBXBuildFile; fileRef = A7E5AB341799E4B200D2833D /* LLVMDisassembler.h */; settings = {ATTRIBUTES = (Private, ); }; }; + A3CA48A81BCD9DC9004C5B45 /* LLVMHeaders.h in Headers */ = {isa = PBXBuildFile; fileRef = 0FCEFAD21805EDCC00472CE4 /* LLVMHeaders.h */; settings = {ATTRIBUTES = (Private, ); }; }; + A3CA48A91BCD9DC9004C5B45 /* Local.h in Headers */ = {isa = PBXBuildFile; fileRef = 142E3130134FF0A600AFADB5 /* Local.h */; }; + A3CA48AA1BCD9DC9004C5B45 /* LocalScope.h in Headers */ = {isa = PBXBuildFile; fileRef = 142E3131134FF0A600AFADB5 /* LocalScope.h */; }; + A3CA48AB1BCD9DC9004C5B45 /* Lookup.h in Headers */ = {isa = PBXBuildFile; fileRef = F692A8690255597D01FF60F7 /* Lookup.h */; settings = {ATTRIBUTES = (Private, ); }; }; + A3CA48AC1BCD9DC9004C5B45 /* LowLevelInterpreter.h in Headers */ = {isa = PBXBuildFile; fileRef = 0F4680C814BBB16900BFE272 /* LowLevelInterpreter.h */; settings = {ATTRIBUTES = (Private, ); }; }; + A3CA48AD1BCD9DC9004C5B45 /* MachineStackMarker.h in Headers */ = {isa = PBXBuildFile; fileRef = 14B7234012D7D0DA003BD5ED /* MachineStackMarker.h */; settings = {ATTRIBUTES = (Private, ); }; }; + A3CA48AE1BCD9DC9004C5B45 /* MacroAssembler.h in Headers */ = {isa = PBXBuildFile; fileRef = 86C36EE90EE1289D00B3DF59 /* MacroAssembler.h */; settings = {ATTRIBUTES = (Private, ); }; }; + A3CA48AF1BCD9DC9004C5B45 /* MacroAssemblerARM.h in Headers */ = {isa = PBXBuildFile; fileRef = 86D3B2C210156BDE002865E7 /* MacroAssemblerARM.h */; settings = {ATTRIBUTES = (Private, ); }; }; + A3CA48B01BCD9DC9004C5B45 /* MacroAssemblerARMv7.h in Headers */ = {isa = PBXBuildFile; fileRef = 86ADD1440FDDEA980006EEC2 /* MacroAssemblerARMv7.h */; settings = {ATTRIBUTES = (Private, ); }; }; + A3CA48B11BCD9DC9004C5B45 /* MacroAssemblerCodeRef.h in Headers */ = {isa = PBXBuildFile; fileRef = 863B23DF0FC60E6200703AA4 /* MacroAssemblerCodeRef.h */; settings = {ATTRIBUTES = (Private, ); }; }; + A3CA48B21BCD9DC9004C5B45 /* MacroAssemblerMIPS.h in Headers */ = {isa = PBXBuildFile; fileRef = 86C568DE11A213EE0007F7F0 /* MacroAssemblerMIPS.h */; settings = {ATTRIBUTES = (Private, ); }; }; + A3CA48B31BCD9DC9004C5B45 /* MacroAssemblerSH4.h in Headers */ = {isa = PBXBuildFile; fileRef = 86AE64A6135E5E1C00963012 /* MacroAssemblerSH4.h */; settings = {ATTRIBUTES = (Private, ); }; }; + A3CA48B41BCD9DC9004C5B45 /* MacroAssemblerX86.h in Headers */ = {isa = PBXBuildFile; fileRef = 860161E00F3A83C100F84710 /* MacroAssemblerX86.h */; settings = {ATTRIBUTES = (Private, ); }; }; + A3CA48B51BCD9DC9004C5B45 /* MacroAssemblerX86_64.h in Headers */ = {isa = PBXBuildFile; fileRef = 860161E10F3A83C100F84710 /* MacroAssemblerX86_64.h */; settings = {ATTRIBUTES = (Private, ); }; }; + A3CA48B61BCD9DC9004C5B45 /* MacroAssemblerX86Common.h in Headers */ = {isa = PBXBuildFile; fileRef = 860161E20F3A83C100F84710 /* MacroAssemblerX86Common.h */; settings = {ATTRIBUTES = (Private, ); }; }; + A3CA48B71BCD9DC9004C5B45 /* MapConstructor.h in Headers */ = {isa = PBXBuildFile; fileRef = A700873817CBE85300C3E643 /* MapConstructor.h */; }; + A3CA48B81BCD9DC9004C5B45 /* MapData.h in Headers */ = {isa = PBXBuildFile; fileRef = A78507D517CBC6FD0011F6E7 /* MapData.h */; settings = {ATTRIBUTES = (Private, ); }; }; + A3CA48B91BCD9DC9004C5B45 /* MapPrototype.h in Headers */ = {isa = PBXBuildFile; fileRef = A700873C17CBE8D300C3E643 /* MapPrototype.h */; }; + A3CA48BA1BCD9DC9004C5B45 /* MarkedAllocator.h in Headers */ = {isa = PBXBuildFile; fileRef = C2B916C114DA014E00CBAC86 /* MarkedAllocator.h */; settings = {ATTRIBUTES = (Private, ); }; }; + A3CA48BB1BCD9DC9004C5B45 /* MarkedBlock.h in Headers */ = {isa = PBXBuildFile; fileRef = 142D6F0713539A2800B02E86 /* MarkedBlock.h */; settings = {ATTRIBUTES = (Private, ); }; }; + A3CA48BC1BCD9DC9004C5B45 /* MarkedBlockSet.h in Headers */ = {isa = PBXBuildFile; fileRef = 141448CA13A176EC00F5BA1A /* MarkedBlockSet.h */; settings = {ATTRIBUTES = (Private, ); }; }; + A3CA48BD1BCD9DC9004C5B45 /* MarkedSpace.h in Headers */ = {isa = PBXBuildFile; fileRef = 14D2F3D9139F4BE200491031 /* MarkedSpace.h */; settings = {ATTRIBUTES = (Private, ); }; }; + A3CA48BE1BCD9DC9004C5B45 /* MarkStack.h in Headers */ = {isa = PBXBuildFile; fileRef = 142D6F0F13539A4100B02E86 /* MarkStack.h */; settings = {ATTRIBUTES = (Private, ); }; }; + A3CA48BF1BCD9DC9004C5B45 /* MarkStackInlines.h in Headers */ = {isa = PBXBuildFile; fileRef = C21122E015DD9AB300790E3A /* MarkStackInlines.h */; settings = {ATTRIBUTES = (Private, ); }; }; + A3CA48C01BCD9DC9004C5B45 /* InspectorFrontendChannel.h in Headers */ = {isa = PBXBuildFile; fileRef = A5945594182479EB00CC3843 /* InspectorFrontendChannel.h */; settings = {ATTRIBUTES = (Private, ); }; }; + A3CA48C11BCD9DC9004C5B45 /* MatchResult.h in Headers */ = {isa = PBXBuildFile; fileRef = 8612E4CB1522918400C836BE /* MatchResult.h */; settings = {ATTRIBUTES = (Private, ); }; }; + A3CA48C21BCD9DC9004C5B45 /* MathObject.h in Headers */ = {isa = PBXBuildFile; fileRef = F692A86B0255597D01FF60F7 /* MathObject.h */; settings = {ATTRIBUTES = (Private, ); }; }; + A3CA48C31BCD9DC9004C5B45 /* MemoryStatistics.h in Headers */ = {isa = PBXBuildFile; fileRef = 90213E3C123A40C200D422F3 /* MemoryStatistics.h */; settings = {ATTRIBUTES = (Private, ); }; }; + A3CA48C41BCD9DC9004C5B45 /* MethodOfGettingAValueProfile.h in Headers */ = {isa = PBXBuildFile; fileRef = 0FB5467A14F5C7D4002C2989 /* MethodOfGettingAValueProfile.h */; settings = {ATTRIBUTES = (Private, ); }; }; + A3CA48C51BCD9DC9004C5B45 /* MIPSAssembler.h in Headers */ = {isa = PBXBuildFile; fileRef = 86C568DF11A213EE0007F7F0 /* MIPSAssembler.h */; settings = {ATTRIBUTES = (Private, ); }; }; + A3CA48C61BCD9DC9004C5B45 /* NameConstructor.h in Headers */ = {isa = PBXBuildFile; fileRef = 86EBF2FA1560F036008E9222 /* NameConstructor.h */; }; + A3CA48C71BCD9DC9004C5B45 /* SetIteratorPrototype.h in Headers */ = {isa = PBXBuildFile; fileRef = A790DD68182F499700588807 /* SetIteratorPrototype.h */; }; + A3CA48C81BCD9DC9004C5B45 /* NameInstance.h in Headers */ = {isa = PBXBuildFile; fileRef = 86EBF2FC1560F036008E9222 /* NameInstance.h */; }; + A3CA48C91BCD9DC9004C5B45 /* NamePrototype.h in Headers */ = {isa = PBXBuildFile; fileRef = 86EBF2FE1560F036008E9222 /* NamePrototype.h */; }; + A3CA48CA1BCD9DC9004C5B45 /* NativeErrorConstructor.h in Headers */ = {isa = PBXBuildFile; fileRef = BC02E9090E1839DB000F9297 /* NativeErrorConstructor.h */; }; + A3CA48CB1BCD9DC9004C5B45 /* NativeErrorPrototype.h in Headers */ = {isa = PBXBuildFile; fileRef = BC02E90B0E1839DB000F9297 /* NativeErrorPrototype.h */; }; + A3CA48CC1BCD9DC9004C5B45 /* NodeConstructors.h in Headers */ = {isa = PBXBuildFile; fileRef = 930DAD030FB1EB1A0082D205 /* NodeConstructors.h */; settings = {ATTRIBUTES = (Private, ); }; }; + A3CA48CD1BCD9DC9004C5B45 /* NodeInfo.h in Headers */ = {isa = PBXBuildFile; fileRef = 7EFF00630EC05A9A00AA7C93 /* NodeInfo.h */; settings = {ATTRIBUTES = (Private, ); }; }; + A3CA48CE1BCD9DC9004C5B45 /* Nodes.h in Headers */ = {isa = PBXBuildFile; fileRef = F692A86E0255597D01FF60F7 /* Nodes.h */; settings = {ATTRIBUTES = (Private, ); }; }; + A3CA48CF1BCD9DC9004C5B45 /* NumberConstructor.h in Headers */ = {isa = PBXBuildFile; fileRef = BC2680C30E16D4E900A06E92 /* NumberConstructor.h */; }; + A3CA48D01BCD9DC9004C5B45 /* NumberConstructor.lut.h in Headers */ = {isa = PBXBuildFile; fileRef = BC2680E60E16D52300A06E92 /* NumberConstructor.lut.h */; }; + A3CA48D11BCD9DC9004C5B45 /* NumberObject.h in Headers */ = {isa = PBXBuildFile; fileRef = F692A8710255597D01FF60F7 /* NumberObject.h */; settings = {ATTRIBUTES = (Private, ); }; }; + A3CA48D21BCD9DC9004C5B45 /* NumberPrototype.h in Headers */ = {isa = PBXBuildFile; fileRef = BC2680C50E16D4E900A06E92 /* NumberPrototype.h */; settings = {ATTRIBUTES = (Private, ); }; }; + A3CA48D31BCD9DC9004C5B45 /* NumericStrings.h in Headers */ = {isa = PBXBuildFile; fileRef = 142D3938103E4560007DCB52 /* NumericStrings.h */; settings = {ATTRIBUTES = (Private, ); }; }; + A3CA48D41BCD9DC9004C5B45 /* ObjCCallbackFunction.h in Headers */ = {isa = PBXBuildFile; fileRef = 86F3EEB9168CCF750077B92A /* ObjCCallbackFunction.h */; }; + A3CA48D51BCD9DC9004C5B45 /* ObjcRuntimeExtras.h in Headers */ = {isa = PBXBuildFile; fileRef = 86F3EEB616855A5B0077B92A /* ObjcRuntimeExtras.h */; }; + A3CA48D61BCD9DC9004C5B45 /* ObjectAllocationProfile.h in Headers */ = {isa = PBXBuildFile; fileRef = 14CA958C16AB50FA00938A06 /* ObjectAllocationProfile.h */; settings = {ATTRIBUTES = (Private, ); }; }; + A3CA48D71BCD9DC9004C5B45 /* ObjectConstructor.h in Headers */ = {isa = PBXBuildFile; fileRef = BC2680C70E16D4E900A06E92 /* ObjectConstructor.h */; settings = {ATTRIBUTES = (Private, ); }; }; + A3CA48D81BCD9DC9004C5B45 /* ObjectPrototype.h in Headers */ = {isa = PBXBuildFile; fileRef = BC2680C90E16D4E900A06E92 /* ObjectPrototype.h */; settings = {ATTRIBUTES = (Private, ); }; }; + A3CA48D91BCD9DC9004C5B45 /* OpaqueJSString.h in Headers */ = {isa = PBXBuildFile; fileRef = E124A8F50E555775003091F1 /* OpaqueJSString.h */; settings = {ATTRIBUTES = (Private, ); }; }; + A3CA48DA1BCD9DC9004C5B45 /* Opcode.h in Headers */ = {isa = PBXBuildFile; fileRef = 969A07950ED1D3AE00F1F681 /* Opcode.h */; settings = {ATTRIBUTES = (Private, ); }; }; + A3CA48DB1BCD9DC9004C5B45 /* Operands.h in Headers */ = {isa = PBXBuildFile; fileRef = 0F2BDC2B151FDE8B00CD8910 /* Operands.h */; settings = {ATTRIBUTES = (Private, ); }; }; + A3CA48DC1BCD9DC9004C5B45 /* ARM64Assembler.h in Headers */ = {isa = PBXBuildFile; fileRef = 8640923B156EED3B00566CB2 /* ARM64Assembler.h */; settings = {ATTRIBUTES = (Private, ); }; }; + A3CA48DD1BCD9DC9004C5B45 /* OperandsInlines.h in Headers */ = {isa = PBXBuildFile; fileRef = A70447E917A0BD4600F5898E /* OperandsInlines.h */; settings = {ATTRIBUTES = (Private, ); }; }; + A3CA48DE1BCD9DC9004C5B45 /* Operations.h in Headers */ = {isa = PBXBuildFile; fileRef = F692A8780255597D01FF60F7 /* Operations.h */; settings = {ATTRIBUTES = (Private, ); }; }; + A3CA48DF1BCD9DC9004C5B45 /* Options.h in Headers */ = {isa = PBXBuildFile; fileRef = 0FE228EB1436AB2300196C48 /* Options.h */; settings = {ATTRIBUTES = (Private, ); }; }; + A3CA48E01BCD9DC9004C5B45 /* Parser.h in Headers */ = {isa = PBXBuildFile; fileRef = 93F0B3AA09BB4DC00068FCE3 /* Parser.h */; settings = {ATTRIBUTES = (Private, ); }; }; + A3CA48E11BCD9DC9004C5B45 /* ParserArena.h in Headers */ = {isa = PBXBuildFile; fileRef = 93052C330FB792190048FDC3 /* ParserArena.h */; settings = {ATTRIBUTES = (Private, ); }; }; + A3CA48E21BCD9DC9004C5B45 /* ParserError.h in Headers */ = {isa = PBXBuildFile; fileRef = 0FCCAE4316D0CF6E00D0C65B /* ParserError.h */; settings = {ATTRIBUTES = (Private, ); }; }; + A3CA48E31BCD9DC9004C5B45 /* ParserModes.h in Headers */ = {isa = PBXBuildFile; fileRef = A77F18241641925400640A47 /* ParserModes.h */; settings = {ATTRIBUTES = (Private, ); }; }; + A3CA48E41BCD9DC9004C5B45 /* ParserTokens.h in Headers */ = {isa = PBXBuildFile; fileRef = 65303D631447B9E100D3F904 /* ParserTokens.h */; settings = {ATTRIBUTES = (Private, ); }; }; + A3CA48E51BCD9DC9004C5B45 /* PolymorphicAccessStructureList.h in Headers */ = {isa = PBXBuildFile; fileRef = 0F34B14B16D43E0C001CDA5A /* PolymorphicAccessStructureList.h */; settings = {ATTRIBUTES = (Private, ); }; }; + A3CA48E61BCD9DC9004C5B45 /* PolymorphicPutByIdList.h in Headers */ = {isa = PBXBuildFile; fileRef = 0F9FC8C014E1B5FB00D52AE0 /* PolymorphicPutByIdList.h */; settings = {ATTRIBUTES = (Private, ); }; }; + A3CA48E71BCD9DC9004C5B45 /* PreciseJumpTargets.h in Headers */ = {isa = PBXBuildFile; fileRef = 0F98205E16BFE37F00240D02 /* PreciseJumpTargets.h */; settings = {ATTRIBUTES = (Private, ); }; }; + A3CA48E81BCD9DC9004C5B45 /* PrivateName.h in Headers */ = {isa = PBXBuildFile; fileRef = 868916A9155F285400CB2B9A /* PrivateName.h */; settings = {ATTRIBUTES = (Private, ); }; }; + A3CA48E91BCD9DC9004C5B45 /* Profile.h in Headers */ = {isa = PBXBuildFile; fileRef = 95742F640DD11F5A000917FB /* Profile.h */; settings = {ATTRIBUTES = (Private, ); }; }; + A3CA48EA1BCD9DC9004C5B45 /* ProfiledCodeBlockJettisoningWatchpoint.h in Headers */ = {isa = PBXBuildFile; fileRef = 0FC97F32182020D7002C9B26 /* ProfiledCodeBlockJettisoningWatchpoint.h */; settings = {ATTRIBUTES = (Private, ); }; }; + A3CA48EB1BCD9DC9004C5B45 /* ProfileGenerator.h in Headers */ = {isa = PBXBuildFile; fileRef = 95CD45750E1C4FDD0085358E /* ProfileGenerator.h */; settings = {ATTRIBUTES = (); }; }; + A3CA48EC1BCD9DC9004C5B45 /* ProfileNode.h in Headers */ = {isa = PBXBuildFile; fileRef = 95AB83550DA43B4400BC83F3 /* ProfileNode.h */; settings = {ATTRIBUTES = (Private, ); }; }; + A3CA48ED1BCD9DC9004C5B45 /* ProfilerBytecode.h in Headers */ = {isa = PBXBuildFile; fileRef = 0FF72993166AD347000F5BA3 /* ProfilerBytecode.h */; settings = {ATTRIBUTES = (Private, ); }; }; + A3CA48EE1BCD9DC9004C5B45 /* BytecodeLivenessAnalysisInlines.h in Headers */ = {isa = PBXBuildFile; fileRef = 0F666EBE183566F900D017F1 /* BytecodeLivenessAnalysisInlines.h */; settings = {ATTRIBUTES = (Private, ); }; }; + A3CA48EF1BCD9DC9004C5B45 /* ProfilerBytecodes.h in Headers */ = {isa = PBXBuildFile; fileRef = 0FF72995166AD347000F5BA3 /* ProfilerBytecodes.h */; settings = {ATTRIBUTES = (Private, ); }; }; + A3CA48F01BCD9DC9004C5B45 /* ProfilerBytecodeSequence.h in Headers */ = {isa = PBXBuildFile; fileRef = 0F13912516771C30009CCB07 /* ProfilerBytecodeSequence.h */; settings = {ATTRIBUTES = (Private, ); }; }; + A3CA48F11BCD9DC9004C5B45 /* ProfilerCompilation.h in Headers */ = {isa = PBXBuildFile; fileRef = 0FF72997166AD347000F5BA3 /* ProfilerCompilation.h */; settings = {ATTRIBUTES = (Private, ); }; }; + A3CA48F21BCD9DC9004C5B45 /* ProfilerCompilationKind.h in Headers */ = {isa = PBXBuildFile; fileRef = 0FF72999166AD347000F5BA3 /* ProfilerCompilationKind.h */; settings = {ATTRIBUTES = (Private, ); }; }; + A3CA48F31BCD9DC9004C5B45 /* ProfilerCompiledBytecode.h in Headers */ = {isa = PBXBuildFile; fileRef = 0FF7299B166AD347000F5BA3 /* ProfilerCompiledBytecode.h */; settings = {ATTRIBUTES = (Private, ); }; }; + A3CA48F41BCD9DC9004C5B45 /* ProfilerDatabase.h in Headers */ = {isa = PBXBuildFile; fileRef = 0FF7299D166AD347000F5BA3 /* ProfilerDatabase.h */; settings = {ATTRIBUTES = (Private, ); }; }; + A3CA48F51BCD9DC9004C5B45 /* ProfilerExecutionCounter.h in Headers */ = {isa = PBXBuildFile; fileRef = 0FF7299E166AD347000F5BA3 /* ProfilerExecutionCounter.h */; settings = {ATTRIBUTES = (Private, ); }; }; + A3CA48F61BCD9DC9004C5B45 /* ProfilerOrigin.h in Headers */ = {isa = PBXBuildFile; fileRef = 0FF729A0166AD347000F5BA3 /* ProfilerOrigin.h */; settings = {ATTRIBUTES = (Private, ); }; }; + A3CA48F71BCD9DC9004C5B45 /* ProfilerOriginStack.h in Headers */ = {isa = PBXBuildFile; fileRef = 0FF729A2166AD347000F5BA3 /* ProfilerOriginStack.h */; settings = {ATTRIBUTES = (Private, ); }; }; + A3CA48F81BCD9DC9004C5B45 /* ProfilerOSRExit.h in Headers */ = {isa = PBXBuildFile; fileRef = 0FB105881675482E00F8AB6E /* ProfilerOSRExit.h */; settings = {ATTRIBUTES = (Private, ); }; }; + A3CA48F91BCD9DC9004C5B45 /* ProfilerOSRExitSite.h in Headers */ = {isa = PBXBuildFile; fileRef = 0FB1058A1675482E00F8AB6E /* ProfilerOSRExitSite.h */; settings = {ATTRIBUTES = (Private, ); }; }; + A3CA48FA1BCD9DC9004C5B45 /* ProfilerProfiledBytecodes.h in Headers */ = {isa = PBXBuildFile; fileRef = 0F13912716771C30009CCB07 /* ProfilerProfiledBytecodes.h */; settings = {ATTRIBUTES = (Private, ); }; }; + A3CA48FB1BCD9DC9004C5B45 /* PropertyDescriptor.h in Headers */ = {isa = PBXBuildFile; fileRef = A7FB604B103F5EAB0017A286 /* PropertyDescriptor.h */; settings = {ATTRIBUTES = (Private, ); }; }; + A3CA48FC1BCD9DC9004C5B45 /* PropertyMapHashTable.h in Headers */ = {isa = PBXBuildFile; fileRef = BC95437C0EBA70FD0072B6D3 /* PropertyMapHashTable.h */; settings = {ATTRIBUTES = (Private, ); }; }; + A3CA48FD1BCD9DC9004C5B45 /* PropertyName.h in Headers */ = {isa = PBXBuildFile; fileRef = 86158AB2155C8B3F00B45C9C /* PropertyName.h */; settings = {ATTRIBUTES = (Private, ); }; }; + A3CA48FE1BCD9DC9004C5B45 /* PropertyNameArray.h in Headers */ = {isa = PBXBuildFile; fileRef = 65400C100A69BAF200509887 /* PropertyNameArray.h */; settings = {ATTRIBUTES = (Private, ); }; }; + A3CA48FF1BCD9DC9004C5B45 /* PropertyOffset.h in Headers */ = {isa = PBXBuildFile; fileRef = 0FF7168A15A3B231008F5DAA /* PropertyOffset.h */; settings = {ATTRIBUTES = (Private, ); }; }; + A3CA49001BCD9DC9004C5B45 /* PropertySlot.h in Headers */ = {isa = PBXBuildFile; fileRef = 65621E6C089E859700760F35 /* PropertySlot.h */; settings = {ATTRIBUTES = (Private, ); }; }; + A3CA49011BCD9DC9004C5B45 /* PropertyStorage.h in Headers */ = {isa = PBXBuildFile; fileRef = 0FB7F39015ED8E3800F167B2 /* PropertyStorage.h */; settings = {ATTRIBUTES = (Private, ); }; }; + A3CA49021BCD9DC9004C5B45 /* Protect.h in Headers */ = {isa = PBXBuildFile; fileRef = 65C02FBB0637462A003E7EE6 /* Protect.h */; settings = {ATTRIBUTES = (Private, ); }; }; + A3CA49031BCD9DC9004C5B45 /* PrototypeMap.h in Headers */ = {isa = PBXBuildFile; fileRef = 14D844A316AA2C7000A65AF0 /* PrototypeMap.h */; settings = {ATTRIBUTES = (Private, ); }; }; + A3CA49041BCD9DC9004C5B45 /* PutByIdStatus.h in Headers */ = {isa = PBXBuildFile; fileRef = 0F93329A14CA7DC10085F3C6 /* PutByIdStatus.h */; settings = {ATTRIBUTES = (Private, ); }; }; + A3CA49051BCD9DC9004C5B45 /* PutDirectIndexMode.h in Headers */ = {isa = PBXBuildFile; fileRef = 0F0CD4C015F1A6040032F1C0 /* PutDirectIndexMode.h */; settings = {ATTRIBUTES = (Private, ); }; }; + A3CA49061BCD9DC9004C5B45 /* Microtask.h in Headers */ = {isa = PBXBuildFile; fileRef = 7C008CE5187631B600955C24 /* Microtask.h */; settings = {ATTRIBUTES = (Private, ); }; }; + A3CA49071BCD9DC9004C5B45 /* PutKind.h in Headers */ = {isa = PBXBuildFile; fileRef = 0F9FC8C114E1B5FB00D52AE0 /* PutKind.h */; settings = {ATTRIBUTES = (Private, ); }; }; + A3CA49081BCD9DC9004C5B45 /* PutPropertySlot.h in Headers */ = {isa = PBXBuildFile; fileRef = 147B84620E6DE6B1004775A4 /* PutPropertySlot.h */; settings = {ATTRIBUTES = (Private, ); }; }; + A3CA49091BCD9DC9004C5B45 /* InspectorBackendDispatcher.h in Headers */ = {isa = PBXBuildFile; fileRef = A593CF7B1840360300BFCE27 /* InspectorBackendDispatcher.h */; settings = {ATTRIBUTES = (Private, ); }; }; + A3CA490A1BCD9DC9004C5B45 /* ReduceWhitespace.h in Headers */ = {isa = PBXBuildFile; fileRef = 0FF60AC016740F8100029779 /* ReduceWhitespace.h */; settings = {ATTRIBUTES = (Private, ); }; }; + A3CA490B1BCD9DC9004C5B45 /* RegExp.h in Headers */ = {isa = PBXBuildFile; fileRef = F692A87E0255597D01FF60F7 /* RegExp.h */; settings = {ATTRIBUTES = (Private, ); }; }; + A3CA490C1BCD9DC9004C5B45 /* RegExpCache.h in Headers */ = {isa = PBXBuildFile; fileRef = A1712B3E11C7B228007A5315 /* RegExpCache.h */; settings = {ATTRIBUTES = (Private, ); }; }; + A3CA490D1BCD9DC9004C5B45 /* RegExpConstructor.h in Headers */ = {isa = PBXBuildFile; fileRef = BCD202BE0E1706A7002C7E82 /* RegExpConstructor.h */; }; + A3CA490E1BCD9DC9004C5B45 /* JSPromiseReaction.h in Headers */ = {isa = PBXBuildFile; fileRef = 7C008CDD1871258D00955C24 /* JSPromiseReaction.h */; }; + A3CA490F1BCD9DC9004C5B45 /* RegExpConstructor.lut.h in Headers */ = {isa = PBXBuildFile; fileRef = BCD202D50E170708002C7E82 /* RegExpConstructor.lut.h */; }; + A3CA49101BCD9DC9004C5B45 /* RegExpKey.h in Headers */ = {isa = PBXBuildFile; fileRef = A1712B4011C7B235007A5315 /* RegExpKey.h */; settings = {ATTRIBUTES = (Private, ); }; }; + A3CA49111BCD9DC9004C5B45 /* StackAlignment.h in Headers */ = {isa = PBXBuildFile; fileRef = 0F3AC751183EA1040032029F /* StackAlignment.h */; settings = {ATTRIBUTES = (Private, ); }; }; + A3CA49121BCD9DC9004C5B45 /* RegExpObject.h in Headers */ = {isa = PBXBuildFile; fileRef = F692A87C0255597D01FF60F7 /* RegExpObject.h */; settings = {ATTRIBUTES = (Private, ); }; }; + A3CA49131BCD9DC9004C5B45 /* RegExpObject.lut.h in Headers */ = {isa = PBXBuildFile; fileRef = BC18C52B0E16FCD200B34460 /* RegExpObject.lut.h */; }; + A3CA49141BCD9DC9004C5B45 /* RegExpPrototype.h in Headers */ = {isa = PBXBuildFile; fileRef = BCD202C00E1706A7002C7E82 /* RegExpPrototype.h */; }; + A3CA49151BCD9DC9004C5B45 /* Region.h in Headers */ = {isa = PBXBuildFile; fileRef = C20B25981706536200C21F4E /* Region.h */; settings = {ATTRIBUTES = (Private, ); }; }; + A3CA49161BCD9DC9004C5B45 /* Register.h in Headers */ = {isa = PBXBuildFile; fileRef = 149B24FF0D8AF6D1009CB8C7 /* Register.h */; settings = {ATTRIBUTES = (Private, ); }; }; + A3CA49171BCD9DC9004C5B45 /* RegisterID.h in Headers */ = {isa = PBXBuildFile; fileRef = 969A07280ED1CE6900F1F681 /* RegisterID.h */; }; + A3CA49181BCD9DC9004C5B45 /* RegisterSet.h in Headers */ = {isa = PBXBuildFile; fileRef = 0FC314101814559100033232 /* RegisterSet.h */; settings = {ATTRIBUTES = (Private, ); }; }; + A3CA49191BCD9DC9004C5B45 /* Reject.h in Headers */ = {isa = PBXBuildFile; fileRef = 0FB7F39115ED8E3800F167B2 /* Reject.h */; settings = {ATTRIBUTES = (Private, ); }; }; + A3CA491A1BCD9DC9004C5B45 /* Repatch.h in Headers */ = {isa = PBXBuildFile; fileRef = 0F24E54A17EE274900ABB217 /* Repatch.h */; }; + A3CA491B1BCD9DC9004C5B45 /* RepatchBuffer.h in Headers */ = {isa = PBXBuildFile; fileRef = 86D3B3C210159D7F002865E7 /* RepatchBuffer.h */; settings = {ATTRIBUTES = (Private, ); }; }; + A3CA491C1BCD9DC9004C5B45 /* ResultType.h in Headers */ = {isa = PBXBuildFile; fileRef = 869EBCB60E8C6D4A008722CC /* ResultType.h */; settings = {ATTRIBUTES = (Private, ); }; }; + A3CA491D1BCD9DC9004C5B45 /* SamplingCounter.h in Headers */ = {isa = PBXBuildFile; fileRef = 0F77008E1402FDD60078EB39 /* SamplingCounter.h */; settings = {ATTRIBUTES = (Private, ); }; }; + A3CA491E1BCD9DC9004C5B45 /* SamplingTool.h in Headers */ = {isa = PBXBuildFile; fileRef = 1429D8840ED21C3D00B89619 /* SamplingTool.h */; settings = {ATTRIBUTES = (Private, ); }; }; + A3CA491F1BCD9DC9004C5B45 /* ScratchRegisterAllocator.h in Headers */ = {isa = PBXBuildFile; fileRef = 0F24E54B17EE274900ABB217 /* ScratchRegisterAllocator.h */; }; + A3CA49201BCD9DC9004C5B45 /* DelayedReleaseScope.h in Headers */ = {isa = PBXBuildFile; fileRef = 2A2825CF18341F2D0087FBA9 /* DelayedReleaseScope.h */; }; + A3CA49211BCD9DC9004C5B45 /* SetConstructor.h in Headers */ = {isa = PBXBuildFile; fileRef = A7299DA417D12858005F5FF9 /* SetConstructor.h */; }; + A3CA49221BCD9DC9004C5B45 /* SetPrototype.h in Headers */ = {isa = PBXBuildFile; fileRef = A7299DA017D12848005F5FF9 /* SetPrototype.h */; }; + A3CA49231BCD9DC9004C5B45 /* SH4Assembler.h in Headers */ = {isa = PBXBuildFile; fileRef = 86AE64A7135E5E1C00963012 /* SH4Assembler.h */; settings = {ATTRIBUTES = (Private, ); }; }; + A3CA49241BCD9DC9004C5B45 /* SimpleTypedArrayController.h in Headers */ = {isa = PBXBuildFile; fileRef = 0F2B66D717B6B5AB00A7AE3F /* SimpleTypedArrayController.h */; settings = {ATTRIBUTES = (Private, ); }; }; + A3CA49251BCD9DC9004C5B45 /* JSPromiseFunctions.h in Headers */ = {isa = PBXBuildFile; fileRef = 7C008CD1186F8A9300955C24 /* JSPromiseFunctions.h */; settings = {ATTRIBUTES = (Private, ); }; }; + A3CA49261BCD9DC9004C5B45 /* SetIteratorConstructor.h in Headers */ = {isa = PBXBuildFile; fileRef = A790DD66182F499700588807 /* SetIteratorConstructor.h */; }; + A3CA49271BCD9DC9004C5B45 /* SlotVisitor.h in Headers */ = {isa = PBXBuildFile; fileRef = 14BA78F013AAB88F005B7C2C /* SlotVisitor.h */; settings = {ATTRIBUTES = (Private, ); }; }; + A3CA49281BCD9DC9004C5B45 /* SlotVisitorInlines.h in Headers */ = {isa = PBXBuildFile; fileRef = 0FCB408515C0A3C30048932B /* SlotVisitorInlines.h */; settings = {ATTRIBUTES = (Private, ); }; }; + A3CA49291BCD9DC9004C5B45 /* SlowPathCall.h in Headers */ = {isa = PBXBuildFile; fileRef = A709F2EF17A0AC0400512E98 /* SlowPathCall.h */; settings = {ATTRIBUTES = (Private, ); }; }; + A3CA492A1BCD9DC9004C5B45 /* SmallStrings.h in Headers */ = {isa = PBXBuildFile; fileRef = 93303FEA0E6A72C000786E6A /* SmallStrings.h */; settings = {ATTRIBUTES = (Private, ); }; }; + A3CA492B1BCD9DC9004C5B45 /* SourceCode.h in Headers */ = {isa = PBXBuildFile; fileRef = 65E866EE0DD59AFA00A2B2A1 /* SourceCode.h */; settings = {ATTRIBUTES = (Private, ); }; }; + A3CA492C1BCD9DC9004C5B45 /* SourceProvider.h in Headers */ = {isa = PBXBuildFile; fileRef = 65E866ED0DD59AFA00A2B2A1 /* SourceProvider.h */; settings = {ATTRIBUTES = (Private, ); }; }; + A3CA492D1BCD9DC9004C5B45 /* SourceProviderCache.h in Headers */ = {isa = PBXBuildFile; fileRef = E49DC15112EF272200184A1F /* SourceProviderCache.h */; settings = {ATTRIBUTES = (Private, ); }; }; + A3CA492E1BCD9DC9004C5B45 /* SourceProviderCacheItem.h in Headers */ = {isa = PBXBuildFile; fileRef = E49DC14912EF261A00184A1F /* SourceProviderCacheItem.h */; settings = {ATTRIBUTES = (Private, ); }; }; + A3CA492F1BCD9DC9004C5B45 /* SparseArrayValueMap.h in Headers */ = {isa = PBXBuildFile; fileRef = 0FB7F39215ED8E3800F167B2 /* SparseArrayValueMap.h */; settings = {ATTRIBUTES = (Private, ); }; }; + A3CA49301BCD9DC9004C5B45 /* SpecializedThunkJIT.h in Headers */ = {isa = PBXBuildFile; fileRef = A7386551118697B400540279 /* SpecializedThunkJIT.h */; }; + A3CA49311BCD9DC9004C5B45 /* SpecialPointer.h in Headers */ = {isa = PBXBuildFile; fileRef = 0F5541B01613C1FB00CE3E25 /* SpecialPointer.h */; settings = {ATTRIBUTES = (Private, ); }; }; + A3CA49321BCD9DC9004C5B45 /* SpeculatedType.h in Headers */ = {isa = PBXBuildFile; fileRef = 0FD82E4F141DAEA100179C94 /* SpeculatedType.h */; settings = {ATTRIBUTES = (Private, ); }; }; + A3CA49331BCD9DC9004C5B45 /* StackVisitor.h in Headers */ = {isa = PBXBuildFile; fileRef = A7C1EAED17987AB600299DB2 /* StackVisitor.h */; settings = {ATTRIBUTES = (Private, ); }; }; + A3CA49341BCD9DC9004C5B45 /* StaticPropertyAnalysis.h in Headers */ = {isa = PBXBuildFile; fileRef = 14DF04D916B3996D0016A513 /* StaticPropertyAnalysis.h */; settings = {ATTRIBUTES = (Private, ); }; }; + A3CA49351BCD9DC9004C5B45 /* ScriptObject.h in Headers */ = {isa = PBXBuildFile; fileRef = A54CF2F8184EAEDA00237F19 /* ScriptObject.h */; settings = {ATTRIBUTES = (Private, ); }; }; + A3CA49361BCD9DC9004C5B45 /* StaticPropertyAnalyzer.h in Headers */ = {isa = PBXBuildFile; fileRef = 14CA958A16AB50DE00938A06 /* StaticPropertyAnalyzer.h */; settings = {ATTRIBUTES = (Private, ); }; }; + A3CA49371BCD9DC9004C5B45 /* StrictEvalActivation.h in Headers */ = {isa = PBXBuildFile; fileRef = A730B6101250068F009D25B1 /* StrictEvalActivation.h */; }; + A3CA49381BCD9DC9004C5B45 /* StringConstructor.h in Headers */ = {isa = PBXBuildFile; fileRef = BC18C3C10E16EE3300B34460 /* StringConstructor.h */; }; + A3CA49391BCD9DC9004C5B45 /* StringObject.h in Headers */ = {isa = PBXBuildFile; fileRef = BC18C3C30E16EE3300B34460 /* StringObject.h */; settings = {ATTRIBUTES = (Private, ); }; }; + A3CA493A1BCD9DC9004C5B45 /* StringPrototype.h in Headers */ = {isa = PBXBuildFile; fileRef = BC18C3C60E16EE3300B34460 /* StringPrototype.h */; settings = {ATTRIBUTES = (Private, ); }; }; + A3CA493B1BCD9DC9004C5B45 /* Strong.h in Headers */ = {isa = PBXBuildFile; fileRef = 142E3132134FF0A600AFADB5 /* Strong.h */; settings = {ATTRIBUTES = (Private, ); }; }; + A3CA493C1BCD9DC9004C5B45 /* StrongInlines.h in Headers */ = {isa = PBXBuildFile; fileRef = 145722851437E140005FDE26 /* StrongInlines.h */; settings = {ATTRIBUTES = (Private, ); }; }; + A3CA493D1BCD9DC9004C5B45 /* Structure.h in Headers */ = {isa = PBXBuildFile; fileRef = BCDE3AB10E6C82CF001453A7 /* Structure.h */; settings = {ATTRIBUTES = (Private, ); }; }; + A3CA493E1BCD9DC9004C5B45 /* StructureChain.h in Headers */ = {isa = PBXBuildFile; fileRef = 7E4EE7080EBB7963005934AA /* StructureChain.h */; settings = {ATTRIBUTES = (Private, ); }; }; + A3CA493F1BCD9DC9004C5B45 /* StructureInlines.h in Headers */ = {isa = PBXBuildFile; fileRef = 0FD2C92316D01EE900C7803F /* StructureInlines.h */; settings = {ATTRIBUTES = (Private, ); }; }; + A3CA49401BCD9DC9004C5B45 /* StructureRareData.h in Headers */ = {isa = PBXBuildFile; fileRef = C2FE18A316BAEC4000AF3061 /* StructureRareData.h */; settings = {ATTRIBUTES = (Private, ); }; }; + A3CA49411BCD9DC9004C5B45 /* StructureRareDataInlines.h in Headers */ = {isa = PBXBuildFile; fileRef = C20BA92C16BB1C1500B3AEA2 /* StructureRareDataInlines.h */; settings = {ATTRIBUTES = (Private, ); }; }; + A3CA49421BCD9DC9004C5B45 /* StructureSet.h in Headers */ = {isa = PBXBuildFile; fileRef = 0F93329B14CA7DC10085F3C6 /* StructureSet.h */; settings = {ATTRIBUTES = (Private, ); }; }; + A3CA49431BCD9DC9004C5B45 /* StructureStubClearingWatchpoint.h in Headers */ = {isa = PBXBuildFile; fileRef = 0F766D3715AE4A1A008F363E /* StructureStubClearingWatchpoint.h */; settings = {ATTRIBUTES = (Private, ); }; }; + A3CA49441BCD9DC9004C5B45 /* StructureStubInfo.h in Headers */ = {isa = PBXBuildFile; fileRef = BCCF0D070EF0AAB900413C8F /* StructureStubInfo.h */; settings = {ATTRIBUTES = (Private, ); }; }; + A3CA49451BCD9DC9004C5B45 /* StructureTransitionTable.h in Headers */ = {isa = PBXBuildFile; fileRef = BC9041470EB9250900FE26FA /* StructureTransitionTable.h */; settings = {ATTRIBUTES = (Private, ); }; }; + A3CA49461BCD9DC9004C5B45 /* SuperRegion.h in Headers */ = {isa = PBXBuildFile; fileRef = C2DF442E1707AC0100A5CA96 /* SuperRegion.h */; settings = {ATTRIBUTES = (Private, ); }; }; + A3CA49471BCD9DC9004C5B45 /* SymbolTable.h in Headers */ = {isa = PBXBuildFile; fileRef = 14A396A60CD2933100B5B4FF /* SymbolTable.h */; settings = {ATTRIBUTES = (Private, ); }; }; + A3CA49481BCD9DC9004C5B45 /* SyntaxChecker.h in Headers */ = {isa = PBXBuildFile; fileRef = A7A7EE7711B98B8D0065A14F /* SyntaxChecker.h */; settings = {ATTRIBUTES = (Private, ); }; }; + A3CA49491BCD9DC9004C5B45 /* TestRunnerUtils.h in Headers */ = {isa = PBXBuildFile; fileRef = 0FA2C17A17D7CF84009D015F /* TestRunnerUtils.h */; settings = {ATTRIBUTES = (Private, ); }; }; + A3CA494A1BCD9DC9004C5B45 /* ThunkGenerator.h in Headers */ = {isa = PBXBuildFile; fileRef = 0F572D4D16879FDB00E57FBD /* ThunkGenerator.h */; settings = {ATTRIBUTES = (Private, ); }; }; + A3CA494B1BCD9DC9004C5B45 /* ThunkGenerators.h in Headers */ = {isa = PBXBuildFile; fileRef = A7386553118697B400540279 /* ThunkGenerators.h */; settings = {ATTRIBUTES = (Private, ); }; }; + A3CA494C1BCD9DC9004C5B45 /* TinyBloomFilter.h in Headers */ = {isa = PBXBuildFile; fileRef = 141448CC13A1783700F5BA1A /* TinyBloomFilter.h */; settings = {ATTRIBUTES = (Private, ); }; }; + A3CA494D1BCD9DC9004C5B45 /* ToNativeFromValue.h in Headers */ = {isa = PBXBuildFile; fileRef = 0F55989717C86C5600A1E543 /* ToNativeFromValue.h */; settings = {ATTRIBUTES = (Private, ); }; }; + A3CA494E1BCD9DC9004C5B45 /* Tracing.h in Headers */ = {isa = PBXBuildFile; fileRef = 5D53726E0E1C54880021E549 /* Tracing.h */; }; + A3CA494F1BCD9DC9004C5B45 /* TypedArrayAdaptors.h in Headers */ = {isa = PBXBuildFile; fileRef = 0F2B66D817B6B5AB00A7AE3F /* TypedArrayAdaptors.h */; settings = {ATTRIBUTES = (Private, ); }; }; + A3CA49501BCD9DC9004C5B45 /* TypedArrayController.h in Headers */ = {isa = PBXBuildFile; fileRef = 0F2B66DA17B6B5AB00A7AE3F /* TypedArrayController.h */; settings = {ATTRIBUTES = (Private, ); }; }; + A3CA49511BCD9DC9004C5B45 /* TypedArrayInlines.h in Headers */ = {isa = PBXBuildFile; fileRef = 0F4B94DB17B9F07500DD03A4 /* TypedArrayInlines.h */; settings = {ATTRIBUTES = (Private, ); }; }; + A3CA49521BCD9DC9004C5B45 /* TypedArrays.h in Headers */ = {isa = PBXBuildFile; fileRef = 0F2B66DB17B6B5AB00A7AE3F /* TypedArrays.h */; settings = {ATTRIBUTES = (Private, ); }; }; + A3CA49531BCD9DC9004C5B45 /* TypedArrayType.h in Headers */ = {isa = PBXBuildFile; fileRef = 0F2B66DD17B6B5AB00A7AE3F /* TypedArrayType.h */; settings = {ATTRIBUTES = (Private, ); }; }; + A3CA49541BCD9DC9004C5B45 /* udis86.h in Headers */ = {isa = PBXBuildFile; fileRef = 0FF4273F158EBD94004CB9FF /* udis86.h */; }; + A3CA49551BCD9DC9004C5B45 /* udis86_decode.h in Headers */ = {isa = PBXBuildFile; fileRef = 0FF42735158EBD94004CB9FF /* udis86_decode.h */; }; + A3CA49561BCD9DC9004C5B45 /* udis86_extern.h in Headers */ = {isa = PBXBuildFile; fileRef = 0FF42736158EBD94004CB9FF /* udis86_extern.h */; }; + A3CA49571BCD9DC9004C5B45 /* udis86_input.h in Headers */ = {isa = PBXBuildFile; fileRef = 0FF42738158EBD94004CB9FF /* udis86_input.h */; }; + A3CA49581BCD9DC9004C5B45 /* udis86_syn.h in Headers */ = {isa = PBXBuildFile; fileRef = 0FF4273C158EBD94004CB9FF /* udis86_syn.h */; }; + A3CA49591BCD9DC9004C5B45 /* udis86_types.h in Headers */ = {isa = PBXBuildFile; fileRef = 0FF4273D158EBD94004CB9FF /* udis86_types.h */; }; + A3CA495A1BCD9DC9004C5B45 /* UDis86Disassembler.h in Headers */ = {isa = PBXBuildFile; fileRef = A7E5AB351799E4B200D2833D /* UDis86Disassembler.h */; settings = {ATTRIBUTES = (Private, ); }; }; + A3CA495B1BCD9DC9004C5B45 /* Uint16Array.h in Headers */ = {isa = PBXBuildFile; fileRef = A7A8AF3217ADB5F3005AB174 /* Uint16Array.h */; settings = {ATTRIBUTES = (Private, ); }; }; + A3CA495C1BCD9DC9004C5B45 /* Uint16WithFraction.h in Headers */ = {isa = PBXBuildFile; fileRef = 866739D113BFDE710023D87C /* Uint16WithFraction.h */; }; + A3CA495D1BCD9DC9004C5B45 /* Uint32Array.h in Headers */ = {isa = PBXBuildFile; fileRef = A7A8AF3317ADB5F3005AB174 /* Uint32Array.h */; settings = {ATTRIBUTES = (Private, ); }; }; + A3CA495E1BCD9DC9004C5B45 /* Uint8Array.h in Headers */ = {isa = PBXBuildFile; fileRef = A7A8AF3017ADB5F3005AB174 /* Uint8Array.h */; settings = {ATTRIBUTES = (Private, ); }; }; + A3CA495F1BCD9DC9004C5B45 /* Uint8ClampedArray.h in Headers */ = {isa = PBXBuildFile; fileRef = A7A8AF3117ADB5F3005AB174 /* Uint8ClampedArray.h */; settings = {ATTRIBUTES = (Private, ); }; }; + A3CA49601BCD9DC9004C5B45 /* UnconditionalFinalizer.h in Headers */ = {isa = PBXBuildFile; fileRef = 0F5F08CE146C762F000472A9 /* UnconditionalFinalizer.h */; settings = {ATTRIBUTES = (Private, ); }; }; + A3CA49611BCD9DC9004C5B45 /* DFGAvailability.h in Headers */ = {isa = PBXBuildFile; fileRef = 0F666EC31835672B00D017F1 /* DFGAvailability.h */; settings = {ATTRIBUTES = (Private, ); }; }; + A3CA49621BCD9DC9004C5B45 /* UnlinkedCodeBlock.h in Headers */ = {isa = PBXBuildFile; fileRef = A79E781F15EECBA80047C855 /* UnlinkedCodeBlock.h */; settings = {ATTRIBUTES = (Private, ); }; }; + A3CA49631BCD9DC9004C5B45 /* UnusedPointer.h in Headers */ = {isa = PBXBuildFile; fileRef = 65987F2F16828A7E003C2F8D /* UnusedPointer.h */; settings = {ATTRIBUTES = (Private, ); }; }; + A3CA49641BCD9DC9004C5B45 /* ValueProfile.h in Headers */ = {isa = PBXBuildFile; fileRef = 0F963B3613FC6FDE0002D9B2 /* ValueProfile.h */; settings = {ATTRIBUTES = (Private, ); }; }; + A3CA49651BCD9DC9004C5B45 /* ValueRecovery.h in Headers */ = {isa = PBXBuildFile; fileRef = 0F426A451460CBAB00131F8F /* ValueRecovery.h */; settings = {ATTRIBUTES = (Private, ); }; }; + A3CA49661BCD9DC9004C5B45 /* VirtualRegister.h in Headers */ = {isa = PBXBuildFile; fileRef = 0F426A461460CBAB00131F8F /* VirtualRegister.h */; settings = {ATTRIBUTES = (Private, ); }; }; + A3CA49671BCD9DC9004C5B45 /* VM.h in Headers */ = {isa = PBXBuildFile; fileRef = E18E3A560DF9278C00D90B34 /* VM.h */; settings = {ATTRIBUTES = (Private, ); }; }; + A3CA49681BCD9DC9004C5B45 /* VMInspector.h in Headers */ = {isa = PBXBuildFile; fileRef = FE4A331E15BD2E07006F54F3 /* VMInspector.h */; settings = {ATTRIBUTES = (Private, ); }; }; + A3CA49691BCD9DC9004C5B45 /* InjectedScriptSource.h in Headers */ = {isa = PBXBuildFile; fileRef = A513E5C6185F9436007E95AD /* InjectedScriptSource.h */; }; + A3CA496A1BCD9DC9004C5B45 /* Watchdog.h in Headers */ = {isa = PBXBuildFile; fileRef = FED94F2C171E3E2300BE77A4 /* Watchdog.h */; settings = {ATTRIBUTES = (Private, ); }; }; + A3CA496B1BCD9DC9004C5B45 /* Watchpoint.h in Headers */ = {isa = PBXBuildFile; fileRef = 0F919D2315853CDE004A4E7D /* Watchpoint.h */; settings = {ATTRIBUTES = (Private, ); }; }; + A3CA496C1BCD9DC9004C5B45 /* Weak.h in Headers */ = {isa = PBXBuildFile; fileRef = 142E3133134FF0A600AFADB5 /* Weak.h */; settings = {ATTRIBUTES = (Private, ); }; }; + A3CA496D1BCD9DC9004C5B45 /* WeakBlock.h in Headers */ = {isa = PBXBuildFile; fileRef = 14E84F9A14EE1ACC00D6D5D4 /* WeakBlock.h */; settings = {ATTRIBUTES = (Private, ); }; }; + A3CA496E1BCD9DC9004C5B45 /* WeakGCMap.h in Headers */ = {isa = PBXBuildFile; fileRef = 14BFCE6810CDB1FC00364CCE /* WeakGCMap.h */; settings = {ATTRIBUTES = (Private, ); }; }; + A3CA496F1BCD9DC9004C5B45 /* RemoteInspector.h in Headers */ = {isa = PBXBuildFile; fileRef = A5BA15E1182340B300A82E69 /* RemoteInspector.h */; settings = {ATTRIBUTES = (Private, ); }; }; + A3CA49701BCD9DC9004C5B45 /* WeakHandleOwner.h in Headers */ = {isa = PBXBuildFile; fileRef = 14F7256414EE265E00B1652B /* WeakHandleOwner.h */; settings = {ATTRIBUTES = (Private, ); }; }; + A3CA49711BCD9DC9004C5B45 /* WeakImpl.h in Headers */ = {isa = PBXBuildFile; fileRef = 14E84F9D14EE1ACC00D6D5D4 /* WeakImpl.h */; settings = {ATTRIBUTES = (Private, ); }; }; + A3CA49721BCD9DC9004C5B45 /* WeakInlines.h in Headers */ = {isa = PBXBuildFile; fileRef = 14BE7D3217135CF400D1807A /* WeakInlines.h */; settings = {ATTRIBUTES = (Private, ); }; }; + A3CA49731BCD9DC9004C5B45 /* WeakMapConstructor.h in Headers */ = {isa = PBXBuildFile; fileRef = A7CA3ADE17DA41AE006538AF /* WeakMapConstructor.h */; }; + A3CA49741BCD9DC9004C5B45 /* WeakMapData.h in Headers */ = {isa = PBXBuildFile; fileRef = A7CA3AEA17DA5168006538AF /* WeakMapData.h */; }; + A3CA49751BCD9DC9004C5B45 /* DFGStoreBarrierElisionPhase.h in Headers */ = {isa = PBXBuildFile; fileRef = 2ACCF3DD185FE26B0083E2AD /* DFGStoreBarrierElisionPhase.h */; }; + A3CA49761BCD9DC9004C5B45 /* InspectorTypeBuilder.h in Headers */ = {isa = PBXBuildFile; fileRef = A55D93AB18514F7900400DED /* InspectorTypeBuilder.h */; settings = {ATTRIBUTES = (Private, ); }; }; + A3CA49771BCD9DC9004C5B45 /* WeakMapPrototype.h in Headers */ = {isa = PBXBuildFile; fileRef = A7CA3AE017DA41AE006538AF /* WeakMapPrototype.h */; }; + A3CA49781BCD9DC9004C5B45 /* WeakRandom.h in Headers */ = {isa = PBXBuildFile; fileRef = 1420BE7A10AA6DDB00F455D2 /* WeakRandom.h */; settings = {ATTRIBUTES = (Private, ); }; }; + A3CA49791BCD9DC9004C5B45 /* WeakReferenceHarvester.h in Headers */ = {isa = PBXBuildFile; fileRef = 0F242DA513F3B1BB007ADD4C /* WeakReferenceHarvester.h */; settings = {ATTRIBUTES = (Private, ); }; }; + A3CA497A1BCD9DC9004C5B45 /* WeakSet.h in Headers */ = {isa = PBXBuildFile; fileRef = 14E84F9C14EE1ACC00D6D5D4 /* WeakSet.h */; settings = {ATTRIBUTES = (Private, ); }; }; + A3CA497B1BCD9DC9004C5B45 /* WeakSetInlines.h in Headers */ = {isa = PBXBuildFile; fileRef = 14150132154BB13F005D8C98 /* WeakSetInlines.h */; settings = {ATTRIBUTES = (Private, ); }; }; + A3CA497C1BCD9DC9004C5B45 /* WebKitAvailability.h in Headers */ = {isa = PBXBuildFile; fileRef = 5DE3D0F40DD8DDFB00468714 /* WebKitAvailability.h */; settings = {ATTRIBUTES = (Public, ); }; }; + A3CA497D1BCD9DC9004C5B45 /* MapIteratorConstructor.h in Headers */ = {isa = PBXBuildFile; fileRef = A74DEF8C182D991400522C22 /* MapIteratorConstructor.h */; }; + A3CA497E1BCD9DC9004C5B45 /* WriteBarrier.h in Headers */ = {isa = PBXBuildFile; fileRef = A7DCB77912E3D90500911940 /* WriteBarrier.h */; settings = {ATTRIBUTES = (Private, ); }; }; + A3CA497F1BCD9DC9004C5B45 /* WriteBarrierSupport.h in Headers */ = {isa = PBXBuildFile; fileRef = 0FC8150914043BD200CFA603 /* WriteBarrierSupport.h */; settings = {ATTRIBUTES = (Private, ); }; }; + A3CA49801BCD9DC9004C5B45 /* X86Assembler.h in Headers */ = {isa = PBXBuildFile; fileRef = 9688CB140ED12B4E001D649F /* X86Assembler.h */; settings = {ATTRIBUTES = (Private, ); }; }; + A3CA49811BCD9DC9004C5B45 /* Yarr.h in Headers */ = {isa = PBXBuildFile; fileRef = 451539B812DC994500EF7AC4 /* Yarr.h */; settings = {ATTRIBUTES = (Private, ); }; }; + A3CA49821BCD9DC9004C5B45 /* DFGResurrectionForValidationPhase.h in Headers */ = {isa = PBXBuildFile; fileRef = 0F666ECB1836B37E00D017F1 /* DFGResurrectionForValidationPhase.h */; settings = {ATTRIBUTES = (Private, ); }; }; + A3CA49831BCD9DC9004C5B45 /* YarrInterpreter.h in Headers */ = {isa = PBXBuildFile; fileRef = 86704B7E12DBA33700A9FE7B /* YarrInterpreter.h */; settings = {ATTRIBUTES = (Private, ); }; }; + A3CA49841BCD9DC9004C5B45 /* ScriptFunctionCall.h in Headers */ = {isa = PBXBuildFile; fileRef = A55D93A4185012A800400DED /* ScriptFunctionCall.h */; settings = {ATTRIBUTES = (Private, ); }; }; + A3CA49851BCD9DC9004C5B45 /* YarrJIT.h in Headers */ = {isa = PBXBuildFile; fileRef = 86704B8012DBA33700A9FE7B /* YarrJIT.h */; settings = {ATTRIBUTES = (Private, ); }; }; + A3CA49861BCD9DC9004C5B45 /* YarrParser.h in Headers */ = {isa = PBXBuildFile; fileRef = 86704B8112DBA33700A9FE7B /* YarrParser.h */; settings = {ATTRIBUTES = (); }; }; + A3CA49871BCD9DC9004C5B45 /* YarrPattern.h in Headers */ = {isa = PBXBuildFile; fileRef = 86704B8312DBA33700A9FE7B /* YarrPattern.h */; settings = {ATTRIBUTES = (Private, ); }; }; + A3CA49881BCD9DC9004C5B45 /* YarrSyntaxChecker.h in Headers */ = {isa = PBXBuildFile; fileRef = 86704B4112DB8A8100A9FE7B /* YarrSyntaxChecker.h */; }; + A3CA498B1BCD9DC9004C5B45 /* ProtoCallFrame.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 65FB5116184EE9BC00C12B70 /* ProtoCallFrame.cpp */; }; + A3CA498C1BCD9DC9004C5B45 /* A64DOpcode.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 652A3A221651C69700A80AFE /* A64DOpcode.cpp */; }; + A3CA498D1BCD9DC9004C5B45 /* AbstractPC.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 0F55F0F114D1063600AC7649 /* AbstractPC.cpp */; }; + A3CA498E1BCD9DC9004C5B45 /* ArgList.cpp in Sources */ = {isa = PBXBuildFile; fileRef = BCF605110E203EF800B9A64D /* ArgList.cpp */; }; + A3CA498F1BCD9DC9004C5B45 /* Arguments.cpp in Sources */ = {isa = PBXBuildFile; fileRef = BC257DE50E1F51C50016B6C9 /* Arguments.cpp */; }; + A3CA49901BCD9DC9004C5B45 /* ArgumentsIteratorConstructor.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A76140C7182982CB00750624 /* ArgumentsIteratorConstructor.cpp */; }; + A3CA49911BCD9DC9004C5B45 /* ArgumentsIteratorPrototype.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A76140C9182982CB00750624 /* ArgumentsIteratorPrototype.cpp */; }; + A3CA49921BCD9DC9004C5B45 /* ARM64Disassembler.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 652A3A201651C66100A80AFE /* ARM64Disassembler.cpp */; }; + A3CA49931BCD9DC9004C5B45 /* ARMAssembler.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 86D3B2BF10156BDE002865E7 /* ARMAssembler.cpp */; }; + A3CA49941BCD9DC9004C5B45 /* ARMv7Assembler.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A74DE1CB120B86D600D40D5B /* ARMv7Assembler.cpp */; }; + A3CA49951BCD9DC9004C5B45 /* ARMv7Disassembler.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 65C0284F171795E200351E35 /* ARMv7Disassembler.cpp */; }; + A3CA49961BCD9DC9004C5B45 /* ARMv7DOpcode.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 65C0285A1717966800351E35 /* ARMv7DOpcode.cpp */; }; + A3CA49971BCD9DC9004C5B45 /* ArrayAllocationProfile.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 0F8335B41639C1E3001443B5 /* ArrayAllocationProfile.cpp */; }; + A3CA49981BCD9DC9004C5B45 /* ArrayBuffer.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A7A8AF2517ADB5F2005AB174 /* ArrayBuffer.cpp */; }; + A3CA49991BCD9DC9004C5B45 /* ArrayBufferView.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A7A8AF2717ADB5F3005AB174 /* ArrayBufferView.cpp */; }; + A3CA499A1BCD9DC9004C5B45 /* ArrayConstructor.cpp in Sources */ = {isa = PBXBuildFile; fileRef = BC7952060E15E8A800A898AB /* ArrayConstructor.cpp */; }; + A3CA499B1BCD9DC9004C5B45 /* ArrayIteratorConstructor.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A7BDAEC017F4EA1400F6140C /* ArrayIteratorConstructor.cpp */; }; + A3CA499C1BCD9DC9004C5B45 /* ArrayIteratorPrototype.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A7BDAEC217F4EA1400F6140C /* ArrayIteratorPrototype.cpp */; }; + A3CA499D1BCD9DC9004C5B45 /* JSSetIterator.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A790DD69182F499700588807 /* JSSetIterator.cpp */; }; + A3CA499E1BCD9DC9004C5B45 /* ArrayProfile.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 0F63945115D07051006A597C /* ArrayProfile.cpp */; }; + A3CA499F1BCD9DC9004C5B45 /* ArrayPrototype.cpp in Sources */ = {isa = PBXBuildFile; fileRef = F692A84D0255597D01FF60F7 /* ArrayPrototype.cpp */; }; + A3CA49A01BCD9DC9004C5B45 /* AssemblyHelpers.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 0F24E53B17EA9F5900ABB217 /* AssemblyHelpers.cpp */; }; + A3CA49A11BCD9DC9004C5B45 /* BlockAllocator.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 14816E19154CC56C00B8054C /* BlockAllocator.cpp */; }; + A3CA49A21BCD9DC9004C5B45 /* BooleanConstructor.cpp in Sources */ = {isa = PBXBuildFile; fileRef = BC7952320E15EB5600A898AB /* BooleanConstructor.cpp */; }; + A3CA49A31BCD9DC9004C5B45 /* BooleanObject.cpp in Sources */ = {isa = PBXBuildFile; fileRef = F692A8500255597D01FF60F7 /* BooleanObject.cpp */; }; + A3CA49A41BCD9DC9004C5B45 /* BooleanPrototype.cpp in Sources */ = {isa = PBXBuildFile; fileRef = BC7952340E15EB5600A898AB /* BooleanPrototype.cpp */; }; + A3CA49A51BCD9DC9004C5B45 /* BytecodeGenerator.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 969A07200ED1CE3300F1F681 /* BytecodeGenerator.cpp */; }; + A3CA49A61BCD9DC9004C5B45 /* CallData.cpp in Sources */ = {isa = PBXBuildFile; fileRef = BCA62DFE0E2826230004F30D /* CallData.cpp */; }; + A3CA49A71BCD9DC9004C5B45 /* CallFrame.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1429D8DB0ED2205B00B89619 /* CallFrame.cpp */; }; + A3CA49A81BCD9DC9004C5B45 /* CallLinkInfo.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 0F0B83AE14BCF71400885B4F /* CallLinkInfo.cpp */; }; + A3CA49A91BCD9DC9004C5B45 /* CallLinkStatus.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 0F93329314CA7DC10085F3C6 /* CallLinkStatus.cpp */; }; + A3CA49AA1BCD9DC9004C5B45 /* ClosureCallStubRoutine.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 0F73D7AB165A142A00ACAB71 /* ClosureCallStubRoutine.cpp */; }; + A3CA49AB1BCD9DC9004C5B45 /* CodeBlock.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 969A07900ED1D3AE00F1F681 /* CodeBlock.cpp */; settings = {COMPILER_FLAGS = "-fno-strict-aliasing"; }; }; + A3CA49AC1BCD9DC9004C5B45 /* CodeBlockHash.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 0F8F943D1667632D00D61971 /* CodeBlockHash.cpp */; }; + A3CA49AD1BCD9DC9004C5B45 /* CodeBlockJettisoningWatchpoint.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 0FC97F2F182020D7002C9B26 /* CodeBlockJettisoningWatchpoint.cpp */; }; + A3CA49AE1BCD9DC9004C5B45 /* CodeBlockSet.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 0FD8A31117D4326C00CA2C40 /* CodeBlockSet.cpp */; }; + A3CA49AF1BCD9DC9004C5B45 /* CodeCache.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A77F181F164088B200640A47 /* CodeCache.cpp */; }; + A3CA49B01BCD9DC9004C5B45 /* CodeOrigin.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 0F8F9445166764EE00D61971 /* CodeOrigin.cpp */; }; + A3CA49B11BCD9DC9004C5B45 /* CodeProfile.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 86B5822E14D2373B00A9C306 /* CodeProfile.cpp */; }; + A3CA49B21BCD9DC9004C5B45 /* CodeProfiling.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 8603CEF214C7546400AE59E3 /* CodeProfiling.cpp */; }; + A3CA49B31BCD9DC9004C5B45 /* CodeSpecializationKind.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 0F8F943A1667631100D61971 /* CodeSpecializationKind.cpp */; }; + A3CA49B41BCD9DC9004C5B45 /* CodeType.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 0F8F943F1667632D00D61971 /* CodeType.cpp */; }; + A3CA49B51BCD9DC9004C5B45 /* CommonIdentifiers.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 65EA73620BAE35D1001BB560 /* CommonIdentifiers.cpp */; }; + A3CA49B61BCD9DC9004C5B45 /* CommonSlowPaths.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A709F2F117A0AC2A00512E98 /* CommonSlowPaths.cpp */; }; + A3CA49B71BCD9DC9004C5B45 /* CommonSlowPathsExceptions.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 6553A32F17A1F1EE008CF6F3 /* CommonSlowPathsExceptions.cpp */; }; + A3CA49B81BCD9DC9004C5B45 /* CompilationResult.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A7E5A3A51797432D00E893C0 /* CompilationResult.cpp */; }; + A3CA49B91BCD9DC9004C5B45 /* Completion.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 969A09220ED1E09C00F1F681 /* Completion.cpp */; }; + A3CA49BA1BCD9DC9004C5B45 /* ConservativeRoots.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 146B14DB12EB5B12001BEC1B /* ConservativeRoots.cpp */; }; + A3CA49BB1BCD9DC9004C5B45 /* ConstructData.cpp in Sources */ = {isa = PBXBuildFile; fileRef = BCA62DFF0E2826310004F30D /* ConstructData.cpp */; }; + A3CA49BC1BCD9DC9004C5B45 /* CopiedSpace.cpp in Sources */ = {isa = PBXBuildFile; fileRef = C240305314B404C90079EB64 /* CopiedSpace.cpp */; }; + A3CA49BD1BCD9DC9004C5B45 /* CopyVisitor.cpp in Sources */ = {isa = PBXBuildFile; fileRef = C2239D1216262BDD005AC5FD /* CopyVisitor.cpp */; }; + A3CA49BE1BCD9DC9004C5B45 /* DataView.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 0F2B66B017B6B5AB00A7AE3F /* DataView.cpp */; }; + A3CA49BF1BCD9DC9004C5B45 /* DateConstructor.cpp in Sources */ = {isa = PBXBuildFile; fileRef = BCD203450E17135E002C7E82 /* DateConstructor.cpp */; }; + A3CA49C01BCD9DC9004C5B45 /* DateConversion.cpp in Sources */ = {isa = PBXBuildFile; fileRef = D21202280AD4310C00ED79B6 /* DateConversion.cpp */; }; + A3CA49C11BCD9DC9004C5B45 /* DateInstance.cpp in Sources */ = {isa = PBXBuildFile; fileRef = BC1166000E1997B1008066DD /* DateInstance.cpp */; }; + A3CA49C21BCD9DC9004C5B45 /* DatePrototype.cpp in Sources */ = {isa = PBXBuildFile; fileRef = BCD203470E17135E002C7E82 /* DatePrototype.cpp */; }; + A3CA49C31BCD9DC9004C5B45 /* BytecodeLivenessAnalysis.cpp in Sources */ = {isa = PBXBuildFile; fileRef = C2FCAE0E17A9C24E0034C735 /* BytecodeLivenessAnalysis.cpp */; }; + A3CA49C41BCD9DC9004C5B45 /* Debugger.cpp in Sources */ = {isa = PBXBuildFile; fileRef = F692A8580255597D01FF60F7 /* Debugger.cpp */; }; + A3CA49C51BCD9DC9004C5B45 /* DebuggerActivation.cpp in Sources */ = {isa = PBXBuildFile; fileRef = BC3135630F302FA3003DFD3A /* DebuggerActivation.cpp */; }; + A3CA49C61BCD9DC9004C5B45 /* DebuggerCallFrame.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 149559ED0DDCDDF700648087 /* DebuggerCallFrame.cpp */; }; + A3CA49C71BCD9DC9004C5B45 /* DeferGC.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 2A7A58EE1808A4C40020BDF7 /* DeferGC.cpp */; }; + A3CA49C81BCD9DC9004C5B45 /* DeferredCompilationCallback.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 0FC712DC17CD8778008CC93C /* DeferredCompilationCallback.cpp */; }; + A3CA49C91BCD9DC9004C5B45 /* DFGAbstractHeap.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A77A423617A0BBFD00A8DB81 /* DFGAbstractHeap.cpp */; }; + A3CA49CA1BCD9DC9004C5B45 /* DFGAbstractValue.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 0F55C19317276E4600CEABFD /* DFGAbstractValue.cpp */; }; + A3CA49CB1BCD9DC9004C5B45 /* DFGArgumentsSimplificationPhase.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 0F16015A156198BF00C2587C /* DFGArgumentsSimplificationPhase.cpp */; }; + A3CA49CC1BCD9DC9004C5B45 /* DFGArrayMode.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 0F63948115E48114006A597C /* DFGArrayMode.cpp */; }; + A3CA49CD1BCD9DC9004C5B45 /* DFGAtTailAbstractState.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A7D9A28F17A0BC7400EE2618 /* DFGAtTailAbstractState.cpp */; }; + A3CA49CE1BCD9DC9004C5B45 /* DFGBackwardsPropagationPhase.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 0F714CA116EA92ED00F3EBEB /* DFGBackwardsPropagationPhase.cpp */; }; + A3CA49CF1BCD9DC9004C5B45 /* DFGBasicBlock.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A7D89CE317A0B8CC00773AD8 /* DFGBasicBlock.cpp */; }; + A3CA49D01BCD9DC9004C5B45 /* DFGBinarySwitch.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A70B083017A0B79B00DAF14B /* DFGBinarySwitch.cpp */; }; + A3CA49D11BCD9DC9004C5B45 /* DFGBlockInsertionSet.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A7D89CE417A0B8CC00773AD8 /* DFGBlockInsertionSet.cpp */; }; + A3CA49D21BCD9DC9004C5B45 /* DFGByteCodeParser.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 86EC9DB41328DF82002B2AD7 /* DFGByteCodeParser.cpp */; }; + A3CA49D31BCD9DC9004C5B45 /* DFGCapabilities.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 0FD82E1E14172C2F00179C94 /* DFGCapabilities.cpp */; }; + A3CA49D41BCD9DC9004C5B45 /* DFGCFAPhase.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 0FFFC94B14EF909500C72532 /* DFGCFAPhase.cpp */; }; + A3CA49D51BCD9DC9004C5B45 /* DFGCFGSimplificationPhase.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 0F3B3A241544C991003ED0FF /* DFGCFGSimplificationPhase.cpp */; }; + A3CA49D61BCD9DC9004C5B45 /* DFGClobberize.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A77A423817A0BBFD00A8DB81 /* DFGClobberize.cpp */; }; + A3CA49D71BCD9DC9004C5B45 /* DFGClobberSet.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A77A423A17A0BBFD00A8DB81 /* DFGClobberSet.cpp */; }; + A3CA49D81BCD9DC9004C5B45 /* DFGCommon.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 0FB4B51A16B62772003F696B /* DFGCommon.cpp */; }; + A3CA49D91BCD9DC9004C5B45 /* DFGCommonData.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 0FEA0A2D170D40BF00BB722C /* DFGCommonData.cpp */; }; + A3CA49DA1BCD9DC9004C5B45 /* DFGCompilationKey.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 0F38B01317CFE75500B144D3 /* DFGCompilationKey.cpp */; }; + A3CA49DB1BCD9DC9004C5B45 /* DFGCompilationMode.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 0F38B01517CFE75500B144D3 /* DFGCompilationMode.cpp */; }; + A3CA49DC1BCD9DC9004C5B45 /* DFGConstantFoldingPhase.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 0F3B3A17153E68EF003ED0FF /* DFGConstantFoldingPhase.cpp */; }; + A3CA49DD1BCD9DC9004C5B45 /* DFGCPSRethreadingPhase.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 0FBE0F6B16C1DB010082C5E8 /* DFGCPSRethreadingPhase.cpp */; }; + A3CA49DE1BCD9DC9004C5B45 /* DFGCriticalEdgeBreakingPhase.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A7D89CE617A0B8CC00773AD8 /* DFGCriticalEdgeBreakingPhase.cpp */; }; + A3CA49DF1BCD9DC9004C5B45 /* DFGCSEPhase.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 0FFFC94D14EF909500C72532 /* DFGCSEPhase.cpp */; }; + A3CA49E01BCD9DC9004C5B45 /* DFGDCEPhase.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 0F2FC77016E12F6F0038D976 /* DFGDCEPhase.cpp */; }; + A3CA49E11BCD9DC9004C5B45 /* DFGDesiredIdentifiers.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 0F8F2B97172F04FD007DBDA5 /* DFGDesiredIdentifiers.cpp */; }; + A3CA49E21BCD9DC9004C5B45 /* DFGDesiredStructureChains.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A73E132C179624CD00E4DEA8 /* DFGDesiredStructureChains.cpp */; }; + A3CA49E31BCD9DC9004C5B45 /* DFGDesiredTransitions.cpp in Sources */ = {isa = PBXBuildFile; fileRef = C2C0F7CB17BBFC5B00464FE4 /* DFGDesiredTransitions.cpp */; }; + A3CA49E41BCD9DC9004C5B45 /* DFGDesiredWatchpoints.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 0FE853491723CDA500B618F5 /* DFGDesiredWatchpoints.cpp */; }; + A3CA49E51BCD9DC9004C5B45 /* DFGDesiredWeakReferences.cpp in Sources */ = {isa = PBXBuildFile; fileRef = C2981FD617BAEE4B00A3BC98 /* DFGDesiredWeakReferences.cpp */; }; + A3CA49E61BCD9DC9004C5B45 /* DFGDesiredWriteBarriers.cpp in Sources */ = {isa = PBXBuildFile; fileRef = C2981FDA17BAFF4400A3BC98 /* DFGDesiredWriteBarriers.cpp */; }; + A3CA49E71BCD9DC9004C5B45 /* DFGDisassembler.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 0FF427611591A1C9004CB9FF /* DFGDisassembler.cpp */; }; + A3CA49E81BCD9DC9004C5B45 /* DFGDominators.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 0FD81ACF154FB4EB00983E72 /* DFGDominators.cpp */; }; + A3CA49E91BCD9DC9004C5B45 /* DFGDriver.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 0FD3C82014115CF800FD81CB /* DFGDriver.cpp */; }; + A3CA49EA1BCD9DC9004C5B45 /* InspectorValues.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A593CF801840377100BFCE27 /* InspectorValues.cpp */; }; + A3CA49EB1BCD9DC9004C5B45 /* DFGEdge.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 0FB4B51B16B62772003F696B /* DFGEdge.cpp */; }; + A3CA49EC1BCD9DC9004C5B45 /* MapIteratorPrototype.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A74DEF8D182D991400522C22 /* MapIteratorPrototype.cpp */; }; + A3CA49ED1BCD9DC9004C5B45 /* DFGExitProfile.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 0FBC0AE41496C7C100D4FBDD /* DFGExitProfile.cpp */; }; + A3CA49EE1BCD9DC9004C5B45 /* DFGFailedFinalizer.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A78A976C179738B8009DF744 /* DFGFailedFinalizer.cpp */; }; + A3CA49EF1BCD9DC9004C5B45 /* DFGFinalizer.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A78A976E179738B8009DF744 /* DFGFinalizer.cpp */; }; + A3CA49F01BCD9DC9004C5B45 /* DFGFixupPhase.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 0F2BDC12151C5D4A00CD8910 /* DFGFixupPhase.cpp */; }; + A3CA49F11BCD9DC9004C5B45 /* DFGFlushedAt.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 0F9D339417FFC4E60073C2BC /* DFGFlushedAt.cpp */; }; + A3CA49F21BCD9DC9004C5B45 /* DFGFlushFormat.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A7D89CE817A0B8CC00773AD8 /* DFGFlushFormat.cpp */; }; + A3CA49F31BCD9DC9004C5B45 /* DFGFlushLivenessAnalysisPhase.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A7D89CEA17A0B8CC00773AD8 /* DFGFlushLivenessAnalysisPhase.cpp */; }; + A3CA49F41BCD9DC9004C5B45 /* DFGGraph.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 86EC9DB71328DF82002B2AD7 /* DFGGraph.cpp */; }; + A3CA49F51BCD9DC9004C5B45 /* DFGInPlaceAbstractState.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A704D90017A0BAA8006BA554 /* DFGInPlaceAbstractState.cpp */; }; + A3CA49F61BCD9DC9004C5B45 /* DFGInvalidationPointInjectionPhase.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 0FC97F3718202119002C9B26 /* DFGInvalidationPointInjectionPhase.cpp */; }; + A3CA49F71BCD9DC9004C5B45 /* DFGJITCode.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 0FEA0A2F170D40BF00BB722C /* DFGJITCode.cpp */; }; + A3CA49F81BCD9DC9004C5B45 /* DFGJITCompiler.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 86EC9DBB1328DF82002B2AD7 /* DFGJITCompiler.cpp */; }; + A3CA49F91BCD9DC9004C5B45 /* DFGJITFinalizer.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A78A9770179738B8009DF744 /* DFGJITFinalizer.cpp */; }; + A3CA49FA1BCD9DC9004C5B45 /* DFGJumpReplacement.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 0FC97F3918202119002C9B26 /* DFGJumpReplacement.cpp */; }; + A3CA49FB1BCD9DC9004C5B45 /* DFGLazyJSValue.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A73A53581799CD5D00170C19 /* DFGLazyJSValue.cpp */; }; + A3CA49FC1BCD9DC9004C5B45 /* DFGLICMPhase.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A7D9A29217A0BC7400EE2618 /* DFGLICMPhase.cpp */; }; + A3CA49FD1BCD9DC9004C5B45 /* DFGLivenessAnalysisPhase.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A7D89CEC17A0B8CC00773AD8 /* DFGLivenessAnalysisPhase.cpp */; }; + A3CA49FE1BCD9DC9004C5B45 /* DFGLongLivedState.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 0FB4B51C16B62772003F696B /* DFGLongLivedState.cpp */; }; + A3CA49FF1BCD9DC9004C5B45 /* DFGLoopPreHeaderCreationPhase.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A767B5B317A0B9650063D940 /* DFGLoopPreHeaderCreationPhase.cpp */; }; + A3CA4A001BCD9DC9004C5B45 /* DFGMinifiedNode.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 0F2BDC4C1522818300CD8910 /* DFGMinifiedNode.cpp */; }; + A3CA4A011BCD9DC9004C5B45 /* DFGNaturalLoops.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A737810A1799EA2E00817533 /* DFGNaturalLoops.cpp */; }; + A3CA4A021BCD9DC9004C5B45 /* DFGNode.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 0FB4B51E16B62772003F696B /* DFGNode.cpp */; }; + A3CA4A031BCD9DC9004C5B45 /* DFGNodeFlags.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 0FA581B7150E952A00B9A2D9 /* DFGNodeFlags.cpp */; }; + A3CA4A041BCD9DC9004C5B45 /* DFGOperations.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 86EC9DBF1328DF82002B2AD7 /* DFGOperations.cpp */; }; + A3CA4A051BCD9DC9004C5B45 /* DFGOSRAvailabilityAnalysisPhase.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A7D89CEE17A0B8CC00773AD8 /* DFGOSRAvailabilityAnalysisPhase.cpp */; }; + A3CA4A061BCD9DC9004C5B45 /* DFGOSREntry.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 0FD82E52141DAEDE00179C94 /* DFGOSREntry.cpp */; }; + A3CA4A071BCD9DC9004C5B45 /* DFGOSREntrypointCreationPhase.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 0FD8A31D17D51F5700CA2C40 /* DFGOSREntrypointCreationPhase.cpp */; }; + A3CA4A081BCD9DC9004C5B45 /* DFGOSRExit.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 0FC0978E146A6F6300CF2442 /* DFGOSRExit.cpp */; }; + A3CA4A091BCD9DC9004C5B45 /* DFGOSRExitBase.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 0F235BE717178E7300690C7F /* DFGOSRExitBase.cpp */; }; + A3CA4A0A1BCD9DC9004C5B45 /* DFGOSRExitCompiler.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 0FC0978F146A6F6300CF2442 /* DFGOSRExitCompiler.cpp */; }; + A3CA4A0B1BCD9DC9004C5B45 /* DFGOSRExitCompiler32_64.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 0FC09775146943AD00CF2442 /* DFGOSRExitCompiler32_64.cpp */; }; + A3CA4A0C1BCD9DC9004C5B45 /* DFGStrengthReductionPhase.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 0FC20CB31852E2C600C9E954 /* DFGStrengthReductionPhase.cpp */; }; + A3CA4A0D1BCD9DC9004C5B45 /* DFGOSRExitCompiler64.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 0FC0977014693AEF00CF2442 /* DFGOSRExitCompiler64.cpp */; }; + A3CA4A0E1BCD9DC9004C5B45 /* DFGOSRExitCompilerCommon.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 0F7025A71714B0F800382C0E /* DFGOSRExitCompilerCommon.cpp */; }; + A3CA4A0F1BCD9DC9004C5B45 /* DFGOSRExitJumpPlaceholder.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 0FEFC9A71681A3B000567F53 /* DFGOSRExitJumpPlaceholder.cpp */; }; + A3CA4A101BCD9DC9004C5B45 /* DFGOSRExitPreparation.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 0F235BE917178E7300690C7F /* DFGOSRExitPreparation.cpp */; }; + A3CA4A111BCD9DC9004C5B45 /* DFGPhase.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 0FFFC94F14EF909500C72532 /* DFGPhase.cpp */; }; + A3CA4A121BCD9DC9004C5B45 /* DFGPlan.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A78A9772179738B8009DF744 /* DFGPlan.cpp */; }; + A3CA4A131BCD9DC9004C5B45 /* DFGPredictionInjectionPhase.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 0FBE0F6D16C1DB010082C5E8 /* DFGPredictionInjectionPhase.cpp */; }; + A3CA4A141BCD9DC9004C5B45 /* DFGPredictionPropagationPhase.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 0FFFC95114EF909500C72532 /* DFGPredictionPropagationPhase.cpp */; }; + A3CA4A151BCD9DC9004C5B45 /* DFGSpeculativeJIT.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 86EC9DC21328DF82002B2AD7 /* DFGSpeculativeJIT.cpp */; }; + A3CA4A161BCD9DC9004C5B45 /* DFGSpeculativeJIT32_64.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 86880F1B14328BB900B08D42 /* DFGSpeculativeJIT32_64.cpp */; }; + A3CA4A171BCD9DC9004C5B45 /* DFGSpeculativeJIT64.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 86880F4C14353B2100B08D42 /* DFGSpeculativeJIT64.cpp */; }; + A3CA4A181BCD9DC9004C5B45 /* DFGSSAConversionPhase.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A7D89CF017A0B8CC00773AD8 /* DFGSSAConversionPhase.cpp */; }; + A3CA4A191BCD9DC9004C5B45 /* DFGStackLayoutPhase.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 0F9FB4F217FCB91700CB67F8 /* DFGStackLayoutPhase.cpp */; }; + A3CA4A1A1BCD9DC9004C5B45 /* DFGThunks.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 0FC0979F146B28C700CF2442 /* DFGThunks.cpp */; }; + A3CA4A1B1BCD9DC9004C5B45 /* DFGTierUpCheckInjectionPhase.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 0FD8A31F17D51F5700CA2C40 /* DFGTierUpCheckInjectionPhase.cpp */; }; + A3CA4A1C1BCD9DC9004C5B45 /* DFGToFTLDeferredCompilationCallback.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 0FD8A32117D51F5700CA2C40 /* DFGToFTLDeferredCompilationCallback.cpp */; }; + A3CA4A1D1BCD9DC9004C5B45 /* DFGToFTLForOSREntryDeferredCompilationCallback.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 0FD8A32317D51F5700CA2C40 /* DFGToFTLForOSREntryDeferredCompilationCallback.cpp */; }; + A3CA4A1E1BCD9DC9004C5B45 /* DFGTypeCheckHoistingPhase.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 0F63943C15C75F14006A597C /* DFGTypeCheckHoistingPhase.cpp */; }; + A3CA4A1F1BCD9DC9004C5B45 /* DFGUnificationPhase.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 0FBE0F6F16C1DB010082C5E8 /* DFGUnificationPhase.cpp */; }; + A3CA4A201BCD9DC9004C5B45 /* DFGUseKind.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 0F34B14716D4200E001CDA5A /* DFGUseKind.cpp */; }; + A3CA4A211BCD9DC9004C5B45 /* DFGValidate.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 0F3B3A2915474FF4003ED0FF /* DFGValidate.cpp */; }; + A3CA4A221BCD9DC9004C5B45 /* ScriptFunctionCall.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A55D93A3185012A800400DED /* ScriptFunctionCall.cpp */; }; + A3CA4A231BCD9DC9004C5B45 /* DFGValueSource.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 0F2BDC4E15228BE700CD8910 /* DFGValueSource.cpp */; }; + A3CA4A241BCD9DC9004C5B45 /* DFGVariableAccessDataDump.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 0FDDBFB21666EED500C55FEF /* DFGVariableAccessDataDump.cpp */; }; + A3CA4A251BCD9DC9004C5B45 /* DFGVariableEvent.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 0F2BDC5015228FFA00CD8910 /* DFGVariableEvent.cpp */; }; + A3CA4A261BCD9DC9004C5B45 /* DFGVariableEventStream.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 0F2BDC421522801700CD8910 /* DFGVariableEventStream.cpp */; }; + A3CA4A271BCD9DC9004C5B45 /* DFGVirtualRegisterAllocationPhase.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 0FFFC95314EF909500C72532 /* DFGVirtualRegisterAllocationPhase.cpp */; }; + A3CA4A281BCD9DC9004C5B45 /* DFGWatchpointCollectionPhase.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 0FC97F3B18202119002C9B26 /* DFGWatchpointCollectionPhase.cpp */; }; + A3CA4A291BCD9DC9004C5B45 /* DFGWorklist.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 0FDB2CE5174830A2007B3C1B /* DFGWorklist.cpp */; }; + A3CA4A2A1BCD9DC9004C5B45 /* Disassembler.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 0F9D336E165DBB8D005AD387 /* Disassembler.cpp */; }; + A3CA4A2B1BCD9DC9004C5B45 /* DumpContext.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A70447EB17A0BD7000F5898E /* DumpContext.cpp */; }; + A3CA4A2C1BCD9DC9004C5B45 /* Error.cpp in Sources */ = {isa = PBXBuildFile; fileRef = BC337BEA0E1B00CB0076918A /* Error.cpp */; }; + A3CA4A2D1BCD9DC9004C5B45 /* ErrorConstructor.cpp in Sources */ = {isa = PBXBuildFile; fileRef = BC02E9040E1839DB000F9297 /* ErrorConstructor.cpp */; }; + A3CA4A2E1BCD9DC9004C5B45 /* ErrorInstance.cpp in Sources */ = {isa = PBXBuildFile; fileRef = BC02E98A0E183E38000F9297 /* ErrorInstance.cpp */; }; + A3CA4A2F1BCD9DC9004C5B45 /* ErrorPrototype.cpp in Sources */ = {isa = PBXBuildFile; fileRef = BC02E9060E1839DB000F9297 /* ErrorPrototype.cpp */; }; + A3CA4A301BCD9DC9004C5B45 /* JSTypedArray.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 104A28CA188A011B002CCBE0 /* JSTypedArray.cpp */; }; + A3CA4A311BCD9DC9004C5B45 /* ExceptionHelpers.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1429D8770ED21ACD00B89619 /* ExceptionHelpers.cpp */; }; + A3CA4A321BCD9DC9004C5B45 /* Executable.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 86CA032D1038E8440028A609 /* Executable.cpp */; }; + A3CA4A331BCD9DC9004C5B45 /* ExecutableAllocator.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A7B48DB60EE74CFC00DCBDB6 /* ExecutableAllocator.cpp */; }; + A3CA4A341BCD9DC9004C5B45 /* ExecutableAllocatorFixedVMPool.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 86DB64630F95C6FC00D7D921 /* ExecutableAllocatorFixedVMPool.cpp */; }; + A3CA4A351BCD9DC9004C5B45 /* ExecutionCounter.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 0F56A1D415001CF2002992B1 /* ExecutionCounter.cpp */; }; + A3CA4A361BCD9DC9004C5B45 /* JSGlobalObjectDebuggable.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A59455901824744700CC3843 /* JSGlobalObjectDebuggable.cpp */; }; + A3CA4A371BCD9DC9004C5B45 /* ExitKind.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 0FB105821675480C00F8AB6E /* ExitKind.cpp */; }; + A3CA4A381BCD9DC9004C5B45 /* ScriptValue.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A54CF2F2184EAB2400237F19 /* ScriptValue.cpp */; }; + A3CA4A391BCD9DC9004C5B45 /* FTLAbstractHeap.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 0FEA0A171708B00700BB722C /* FTLAbstractHeap.cpp */; }; + A3CA4A3A1BCD9DC9004C5B45 /* FTLAbstractHeapRepository.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 0FEA0A191708B00700BB722C /* FTLAbstractHeapRepository.cpp */; }; + A3CA4A3B1BCD9DC9004C5B45 /* FTLCapabilities.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 0FEA09FE170513DB00BB722C /* FTLCapabilities.cpp */; }; + A3CA4A3C1BCD9DC9004C5B45 /* FTLCommonValues.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 0FEA0A251709623B00BB722C /* FTLCommonValues.cpp */; }; + A3CA4A3D1BCD9DC9004C5B45 /* JSPromiseDeferred.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 7C008CD8187124BB00955C24 /* JSPromiseDeferred.cpp */; }; + A3CA4A3E1BCD9DC9004C5B45 /* InspectorJSFrontendDispatchers.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A532438318568317002ED692 /* InspectorJSFrontendDispatchers.cpp */; }; + A3CA4A3F1BCD9DC9004C5B45 /* FTLCompile.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 0FEA0A00170513DB00BB722C /* FTLCompile.cpp */; }; + A3CA4A401BCD9DC9004C5B45 /* FTLExitArgument.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 0F235BBD17178E1C00690C7F /* FTLExitArgument.cpp */; }; + A3CA4A411BCD9DC9004C5B45 /* FTLExitArgumentForOperand.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 0F235BBF17178E1C00690C7F /* FTLExitArgumentForOperand.cpp */; }; + A3CA4A421BCD9DC9004C5B45 /* FTLExitThunkGenerator.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 0F235BC217178E1C00690C7F /* FTLExitThunkGenerator.cpp */; }; + A3CA4A431BCD9DC9004C5B45 /* FTLExitValue.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 0F235BC417178E1C00690C7F /* FTLExitValue.cpp */; }; + A3CA4A441BCD9DC9004C5B45 /* FTLFail.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A7F2996917A0BB670010417A /* FTLFail.cpp */; }; + A3CA4A451BCD9DC9004C5B45 /* FTLForOSREntryJITCode.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 0FD8A31517D51F2200CA2C40 /* FTLForOSREntryJITCode.cpp */; }; + A3CA4A461BCD9DC9004C5B45 /* FTLInlineCacheSize.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 0F25F1A8181635F300522F39 /* FTLInlineCacheSize.cpp */; }; + A3CA4A471BCD9DC9004C5B45 /* FTLIntrinsicRepository.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 0FEA0A261709623B00BB722C /* FTLIntrinsicRepository.cpp */; }; + A3CA4A481BCD9DC9004C5B45 /* FTLJITCode.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 0FEA0A02170513DB00BB722C /* FTLJITCode.cpp */; }; + A3CA4A491BCD9DC9004C5B45 /* FTLJITFinalizer.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A78A977D179738D5009DF744 /* FTLJITFinalizer.cpp */; }; + A3CA4A4A1BCD9DC9004C5B45 /* FTLLink.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 0F8F2B93172E049E007DBDA5 /* FTLLink.cpp */; }; + A3CA4A4B1BCD9DC9004C5B45 /* JSMapIterator.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A74DEF8F182D991400522C22 /* JSMapIterator.cpp */; }; + A3CA4A4C1BCD9DC9004C5B45 /* FTLLocation.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 0FCEFADD180738C000472CE4 /* FTLLocation.cpp */; }; + A3CA4A4D1BCD9DC9004C5B45 /* FTLLowerDFGToLLVM.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 0FEA0A04170513DB00BB722C /* FTLLowerDFGToLLVM.cpp */; }; + A3CA4A4E1BCD9DC9004C5B45 /* FTLOSREntry.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 0FD8A31717D51F2200CA2C40 /* FTLOSREntry.cpp */; }; + A3CA4A4F1BCD9DC9004C5B45 /* FTLOSRExit.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 0F235BC617178E1C00690C7F /* FTLOSRExit.cpp */; }; + A3CA4A501BCD9DC9004C5B45 /* FTLOSRExitCompiler.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 0F235BC917178E1C00690C7F /* FTLOSRExitCompiler.cpp */; }; + A3CA4A511BCD9DC9004C5B45 /* FTLOutput.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 0FEA0A291709629600BB722C /* FTLOutput.cpp */; }; + A3CA4A521BCD9DC9004C5B45 /* FTLSaveRestore.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 0FCEFAA91804C13E00472CE4 /* FTLSaveRestore.cpp */; }; + A3CA4A531BCD9DC9004C5B45 /* FTLSlowPathCall.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 0F25F1AA181635F300522F39 /* FTLSlowPathCall.cpp */; }; + A3CA4A541BCD9DC9004C5B45 /* FTLSlowPathCallKey.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 0F25F1AC181635F300522F39 /* FTLSlowPathCallKey.cpp */; }; + A3CA4A551BCD9DC9004C5B45 /* FTLStackMaps.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 0F9D33981803ADB70073C2BC /* FTLStackMaps.cpp */; }; + A3CA4A561BCD9DC9004C5B45 /* FTLState.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 0FEA0A151706BB9000BB722C /* FTLState.cpp */; }; + A3CA4A571BCD9DC9004C5B45 /* JSPromiseFunctions.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 7C008CD0186F8A9300955C24 /* JSPromiseFunctions.cpp */; }; + A3CA4A581BCD9DC9004C5B45 /* FTLThunks.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 0F235BCB17178E1C00690C7F /* FTLThunks.cpp */; }; + A3CA4A591BCD9DC9004C5B45 /* InspectorBackendDispatcher.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A593CF7A1840360300BFCE27 /* InspectorBackendDispatcher.cpp */; }; + A3CA4A5A1BCD9DC9004C5B45 /* FTLValueFormat.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 0F235BCD17178E1C00690C7F /* FTLValueFormat.cpp */; }; + A3CA4A5B1BCD9DC9004C5B45 /* FunctionConstructor.cpp in Sources */ = {isa = PBXBuildFile; fileRef = BC2680C00E16D4E900A06E92 /* FunctionConstructor.cpp */; }; + A3CA4A5C1BCD9DC9004C5B45 /* FunctionExecutableDump.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 0FB4B52116B6278D003F696B /* FunctionExecutableDump.cpp */; }; + A3CA4A5D1BCD9DC9004C5B45 /* FunctionPrototype.cpp in Sources */ = {isa = PBXBuildFile; fileRef = F692A85C0255597D01FF60F7 /* FunctionPrototype.cpp */; }; + A3CA4A5E1BCD9DC9004C5B45 /* GCActivityCallback.cpp in Sources */ = {isa = PBXBuildFile; fileRef = C2D58C3315912FEE0021A844 /* GCActivityCallback.cpp */; }; + A3CA4A5F1BCD9DC9004C5B45 /* GCAwareJITStubRoutine.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 0F766D2D15A8DCDD008F363E /* GCAwareJITStubRoutine.cpp */; }; + A3CA4A601BCD9DC9004C5B45 /* GCThread.cpp in Sources */ = {isa = PBXBuildFile; fileRef = C2239D1516262BDD005AC5FD /* GCThread.cpp */; }; + A3CA4A611BCD9DC9004C5B45 /* GCThreadSharedData.cpp in Sources */ = {isa = PBXBuildFile; fileRef = C21122DE15DD9AB300790E3A /* GCThreadSharedData.cpp */; }; + A3CA4A621BCD9DC9004C5B45 /* GetByIdStatus.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 0F93329514CA7DC10085F3C6 /* GetByIdStatus.cpp */; }; + A3CA4A631BCD9DC9004C5B45 /* JSPromiseReaction.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 7C008CDC1871258D00955C24 /* JSPromiseReaction.cpp */; }; + A3CA4A641BCD9DC9004C5B45 /* GetterSetter.cpp in Sources */ = {isa = PBXBuildFile; fileRef = BC02E9B80E184545000F9297 /* GetterSetter.cpp */; }; + A3CA4A651BCD9DC9004C5B45 /* HandleSet.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 142E312C134FF0A600AFADB5 /* HandleSet.cpp */; }; + A3CA4A661BCD9DC9004C5B45 /* HandleStack.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 142E312E134FF0A600AFADB5 /* HandleStack.cpp */; }; + A3CA4A671BCD9DC9004C5B45 /* Heap.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 14BA7A9513AADFF8005B7C2C /* Heap.cpp */; }; + A3CA4A681BCD9DC9004C5B45 /* HeapStatistics.cpp in Sources */ = {isa = PBXBuildFile; fileRef = C24D31E0161CD695002AA4DB /* HeapStatistics.cpp */; }; + A3CA4A691BCD9DC9004C5B45 /* HeapTimer.cpp in Sources */ = {isa = PBXBuildFile; fileRef = C2E526BB1590EF000054E48D /* HeapTimer.cpp */; }; + A3CA4A6A1BCD9DC9004C5B45 /* HostCallReturnValue.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 0F4680D014BBC5F800BFE272 /* HostCallReturnValue.cpp */; }; + A3CA4A6B1BCD9DC9004C5B45 /* Identifier.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 933A349D038AE80F008635CE /* Identifier.cpp */; }; + A3CA4A6C1BCD9DC9004C5B45 /* IncrementalSweeper.cpp in Sources */ = {isa = PBXBuildFile; fileRef = C25F8BCB157544A900245B71 /* IncrementalSweeper.cpp */; }; + A3CA4A6D1BCD9DC9004C5B45 /* IndexingType.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 0F13E04C16164A1B00DC8DE7 /* IndexingType.cpp */; }; + A3CA4A6E1BCD9DC9004C5B45 /* InitializeLLVM.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 0FCEFAC41805E75500472CE4 /* InitializeLLVM.cpp */; }; + A3CA4A6F1BCD9DC9004C5B45 /* InitializeLLVMMac.mm in Sources */ = {isa = PBXBuildFile; fileRef = 0FCEFAAF1805CA6D00472CE4 /* InitializeLLVMMac.mm */; }; + A3CA4A701BCD9DC9004C5B45 /* InitializeLLVMPOSIX.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 0FCEFAC51805E75500472CE4 /* InitializeLLVMPOSIX.cpp */; }; + A3CA4A711BCD9DC9004C5B45 /* InitializeThreading.cpp in Sources */ = {isa = PBXBuildFile; fileRef = E178636C0D9BEEC300D74E75 /* InitializeThreading.cpp */; }; + A3CA4A721BCD9DC9004C5B45 /* InlineCallFrameSet.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 0F24E55317F0B71C00ABB217 /* InlineCallFrameSet.cpp */; }; + A3CA4A731BCD9DC9004C5B45 /* IntendedStructureChain.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A78853F717972629001440E4 /* IntendedStructureChain.cpp */; }; + A3CA4A741BCD9DC9004C5B45 /* InternalFunction.cpp in Sources */ = {isa = PBXBuildFile; fileRef = BC9BB95B0E19680600DF8855 /* InternalFunction.cpp */; }; + A3CA4A751BCD9DC9004C5B45 /* DFGStoreBarrierElisionPhase.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 2ACCF3DC185FE26B0083E2AD /* DFGStoreBarrierElisionPhase.cpp */; }; + A3CA4A761BCD9DC9004C5B45 /* Interpreter.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1429D7D30ED2128200B89619 /* Interpreter.cpp */; }; + A3CA4A771BCD9DC9004C5B45 /* JIT.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1429D92D0ED22D7000B89619 /* JIT.cpp */; }; + A3CA4A781BCD9DC9004C5B45 /* JITArithmetic.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 86A90ECF0EE7D51F00AB350D /* JITArithmetic.cpp */; }; + A3CA4A791BCD9DC9004C5B45 /* JITArithmetic32_64.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A75706DD118A2BCF0057F88F /* JITArithmetic32_64.cpp */; }; + A3CA4A7A1BCD9DC9004C5B45 /* JITCall.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 86CC85A20EE79B7400288682 /* JITCall.cpp */; }; + A3CA4A7B1BCD9DC9004C5B45 /* JITCall32_64.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 146FE51111A710430087AE66 /* JITCall32_64.cpp */; }; + A3CA4A7C1BCD9DC9004C5B45 /* JITCode.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 0F8F94431667635200D61971 /* JITCode.cpp */; }; + A3CA4A7D1BCD9DC9004C5B45 /* JITDisassembler.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 0FAF7EFA165BA919000C8455 /* JITDisassembler.cpp */; }; + A3CA4A7E1BCD9DC9004C5B45 /* JITExceptions.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 0F46807F14BA572700BFE272 /* JITExceptions.cpp */; }; + A3CA4A7F1BCD9DC9004C5B45 /* JITInlineCacheGenerator.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 0FB14E1C18124ACE009B6B4D /* JITInlineCacheGenerator.cpp */; }; + A3CA4A801BCD9DC9004C5B45 /* JITOpcodes.cpp in Sources */ = {isa = PBXBuildFile; fileRef = BCDD51E90FB8DF74004A8BDC /* JITOpcodes.cpp */; }; + A3CA4A811BCD9DC9004C5B45 /* JITOpcodes32_64.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A71236E41195F33C00BD2174 /* JITOpcodes32_64.cpp */; }; + A3CA4A821BCD9DC9004C5B45 /* WriteBarrierBuffer.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 2A4EC9091860D6C20094F782 /* WriteBarrierBuffer.cpp */; }; + A3CA4A831BCD9DC9004C5B45 /* JITOperations.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 0F24E54517EE274900ABB217 /* JITOperations.cpp */; }; + A3CA4A841BCD9DC9004C5B45 /* JITPropertyAccess.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 86CC85C30EE7A89400288682 /* JITPropertyAccess.cpp */; }; + A3CA4A851BCD9DC9004C5B45 /* JITPropertyAccess32_64.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A7C1E8C8112E701C00A37F98 /* JITPropertyAccess32_64.cpp */; }; + A3CA4A861BCD9DC9004C5B45 /* JITStubRoutine.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 0F766D2615A8CC1B008F363E /* JITStubRoutine.cpp */; }; + A3CA4A871BCD9DC9004C5B45 /* JITStubRoutineSet.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 0F766D2915A8CC34008F363E /* JITStubRoutineSet.cpp */; }; + A3CA4A881BCD9DC9004C5B45 /* JITStubs.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 14A23D6C0F4E19CE0023CDAD /* JITStubs.cpp */; }; + A3CA4A891BCD9DC9004C5B45 /* JITThunks.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 0F5EF91B16878F78003E5C25 /* JITThunks.cpp */; }; + A3CA4A8A1BCD9DC9004C5B45 /* JITToDFGDeferredCompilationCallback.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 0FC712E017CD878F008CC93C /* JITToDFGDeferredCompilationCallback.cpp */; }; + A3CA4A8B1BCD9DC9004C5B45 /* JSActivation.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 14DA818F0D99FD2000B0A4FB /* JSActivation.cpp */; }; + A3CA4A8C1BCD9DC9004C5B45 /* JSAPIValueWrapper.cpp in Sources */ = {isa = PBXBuildFile; fileRef = BC0894D50FAFBA2D00001865 /* JSAPIValueWrapper.cpp */; }; + A3CA4A8D1BCD9DC9004C5B45 /* JSAPIWrapperObject.mm in Sources */ = {isa = PBXBuildFile; fileRef = C2CF39BF16E15A8100DD69BE /* JSAPIWrapperObject.mm */; }; + A3CA4A8E1BCD9DC9004C5B45 /* JSArgumentsIterator.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A76140CB182982CB00750624 /* JSArgumentsIterator.cpp */; }; + A3CA4A8F1BCD9DC9004C5B45 /* JSArray.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 93ADFCE60CCBD7AC00D30B08 /* JSArray.cpp */; }; + A3CA4A901BCD9DC9004C5B45 /* JSArrayBuffer.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 0F2B66B417B6B5AB00A7AE3F /* JSArrayBuffer.cpp */; }; + A3CA4A911BCD9DC9004C5B45 /* JSArrayBufferConstructor.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 0F2B66B617B6B5AB00A7AE3F /* JSArrayBufferConstructor.cpp */; }; + A3CA4A921BCD9DC9004C5B45 /* JSArrayBufferPrototype.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 0F2B66B817B6B5AB00A7AE3F /* JSArrayBufferPrototype.cpp */; }; + A3CA4A931BCD9DC9004C5B45 /* JSArrayBufferView.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 0F2B66BA17B6B5AB00A7AE3F /* JSArrayBufferView.cpp */; }; + A3CA4A941BCD9DC9004C5B45 /* JSArrayIterator.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A7BDAEC417F4EA1400F6140C /* JSArrayIterator.cpp */; }; + A3CA4A951BCD9DC9004C5B45 /* JSBase.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1421359A0A677F4F00A8195E /* JSBase.cpp */; }; + A3CA4A961BCD9DC9004C5B45 /* JSBoundFunction.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 86FA9E8F142BBB2D001773B7 /* JSBoundFunction.cpp */; }; + A3CA4A971BCD9DC9004C5B45 /* JSCallbackConstructor.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1440F8AD0A508D200005F061 /* JSCallbackConstructor.cpp */; }; + A3CA4A981BCD9DC9004C5B45 /* JSCallbackFunction.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1440F8900A508B100005F061 /* JSCallbackFunction.cpp */; }; + A3CA4A991BCD9DC9004C5B45 /* JSCallbackObject.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 14ABDF5E0A437FEF00ECCA01 /* JSCallbackObject.cpp */; }; + A3CA4A9A1BCD9DC9004C5B45 /* JSCell.cpp in Sources */ = {isa = PBXBuildFile; fileRef = BC7F8FBA0E19D1EF008632C0 /* JSCell.cpp */; }; + A3CA4A9B1BCD9DC9004C5B45 /* JSCJSValue.cpp in Sources */ = {isa = PBXBuildFile; fileRef = F692A8870255597D01FF60F7 /* JSCJSValue.cpp */; }; + A3CA4A9C1BCD9DC9004C5B45 /* JSClassRef.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1440FCE20A51E46B0005F061 /* JSClassRef.cpp */; }; + A3CA4A9D1BCD9DC9004C5B45 /* JSContext.mm in Sources */ = {isa = PBXBuildFile; fileRef = 86E3C608167BAB87006D760A /* JSContext.mm */; }; + A3CA4A9E1BCD9DC9004C5B45 /* JSContextRef.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 14BD5A290A3E91F600BAF59C /* JSContextRef.cpp */; }; + A3CA4A9F1BCD9DC9004C5B45 /* JSCTestRunnerUtils.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A72028B41797601E0098028C /* JSCTestRunnerUtils.cpp */; }; + A3CA4AA01BCD9DC9004C5B45 /* JSDataView.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 0F2B66BD17B6B5AB00A7AE3F /* JSDataView.cpp */; }; + A3CA4AA11BCD9DC9004C5B45 /* JSDataViewPrototype.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 0F2B66BF17B6B5AB00A7AE3F /* JSDataViewPrototype.cpp */; }; + A3CA4AA21BCD9DC9004C5B45 /* JSDateMath.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 9788FC221471AD0C0068CE2D /* JSDateMath.cpp */; }; + A3CA4AA31BCD9DC9004C5B45 /* JSFunction.cpp in Sources */ = {isa = PBXBuildFile; fileRef = F692A85E0255597D01FF60F7 /* JSFunction.cpp */; }; + A3CA4AA41BCD9DC9004C5B45 /* JSGlobalObject.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 14DE0D680D02431400AACCA2 /* JSGlobalObject.cpp */; }; + A3CA4AA51BCD9DC9004C5B45 /* JSGlobalObjectFunctions.cpp in Sources */ = {isa = PBXBuildFile; fileRef = BC756FC60E2031B200DE7D12 /* JSGlobalObjectFunctions.cpp */; }; + A3CA4AA61BCD9DC9004C5B45 /* JSLock.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 65EA4C99092AF9E20093D800 /* JSLock.cpp */; }; + A3CA4AA71BCD9DC9004C5B45 /* JSManagedValue.mm in Sources */ = {isa = PBXBuildFile; fileRef = C25D709916DE99F400FCA6BC /* JSManagedValue.mm */; }; + A3CA4AA81BCD9DC9004C5B45 /* JSMap.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A700873F17CBE8EB00C3E643 /* JSMap.cpp */; }; + A3CA4AA91BCD9DC9004C5B45 /* JSNameScope.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 14874ADF15EBDE4A002E3587 /* JSNameScope.cpp */; }; + A3CA4AAA1BCD9DC9004C5B45 /* JSNotAnObject.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A72700780DAC605600E548D7 /* JSNotAnObject.cpp */; }; + A3CA4AAB1BCD9DC9004C5B45 /* JSObject.cpp in Sources */ = {isa = PBXBuildFile; fileRef = BC22A3980E16E14800AF21C8 /* JSObject.cpp */; }; + A3CA4AAC1BCD9DC9004C5B45 /* JSObjectRef.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1482B7E20A43076000517CFC /* JSObjectRef.cpp */; }; + A3CA4AAD1BCD9DC9004C5B45 /* JSONObject.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A7F9935E0FD7325100A0B2D0 /* JSONObject.cpp */; }; + A3CA4AAE1BCD9DC9004C5B45 /* JSProfilerPrivate.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 95988BA90E477BEC00D28D4D /* JSProfilerPrivate.cpp */; }; + A3CA4AAF1BCD9DC9004C5B45 /* JSPromise.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 7C184E1817BEDBD3007CB63A /* JSPromise.cpp */; }; + A3CA4AB01BCD9DC9004C5B45 /* JSPromiseConstructor.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 7C184E2017BEE240007CB63A /* JSPromiseConstructor.cpp */; }; + A3CA4AB11BCD9DC9004C5B45 /* JSPromisePrototype.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 7C184E1C17BEE22E007CB63A /* JSPromisePrototype.cpp */; }; + A3CA4AB21BCD9DC9004C5B45 /* JSPropertyNameIterator.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A727FF660DA3053B00E548D7 /* JSPropertyNameIterator.cpp */; }; + A3CA4AB31BCD9DC9004C5B45 /* JSProxy.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 862553CE16136AA5009F17D0 /* JSProxy.cpp */; }; + A3CA4AB41BCD9DC9004C5B45 /* JSScope.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 14874AE115EBDE4A002E3587 /* JSScope.cpp */; }; + A3CA4AB51BCD9DC9004C5B45 /* JSScriptRef.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A7C0C4AA167C08CD0017011D /* JSScriptRef.cpp */; }; + A3CA4AB61BCD9DC9004C5B45 /* JSSegmentedVariableObject.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 0F919D0E157F3327004A4E7D /* JSSegmentedVariableObject.cpp */; }; + A3CA4AB71BCD9DC9004C5B45 /* JSSet.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A7299D9B17D12837005F5FF9 /* JSSet.cpp */; }; + A3CA4AB81BCD9DC9004C5B45 /* JSStack.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1429D85B0ED218E900B89619 /* JSStack.cpp */; }; + A3CA4AB91BCD9DC9004C5B45 /* JSString.cpp in Sources */ = {isa = PBXBuildFile; fileRef = BC02E9B60E1842FA000F9297 /* JSString.cpp */; }; + A3CA4ABA1BCD9DC9004C5B45 /* JSStringJoiner.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 2600B5A4152BAAA70091EE5F /* JSStringJoiner.cpp */; }; + A3CA4ABB1BCD9DC9004C5B45 /* ArrayBufferNeuteringWatchpoint.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 0FFC99D2184EE318009C10AB /* ArrayBufferNeuteringWatchpoint.cpp */; }; + A3CA4ABC1BCD9DC9004C5B45 /* JSStringRef.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1482B74C0A43032800517CFC /* JSStringRef.cpp */; }; + A3CA4ABD1BCD9DC9004C5B45 /* JSStringRefCF.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 146AAB370B66A94400E55F16 /* JSStringRefCF.cpp */; }; + A3CA4ABE1BCD9DC9004C5B45 /* JSSymbolTableObject.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 0F919D09157EE09D004A4E7D /* JSSymbolTableObject.cpp */; }; + A3CA4ABF1BCD9DC9004C5B45 /* JSTypedArrayConstructors.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 0F2B66CC17B6B5AB00A7AE3F /* JSTypedArrayConstructors.cpp */; }; + A3CA4AC01BCD9DC9004C5B45 /* InspectorJSTypeBuilders.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A532438518568317002ED692 /* InspectorJSTypeBuilders.cpp */; }; + A3CA4AC11BCD9DC9004C5B45 /* JSTypedArrayPrototypes.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 0F2B66CE17B6B5AB00A7AE3F /* JSTypedArrayPrototypes.cpp */; }; + A3CA4AC21BCD9DC9004C5B45 /* JSTypedArrays.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 0F2B66D017B6B5AB00A7AE3F /* JSTypedArrays.cpp */; }; + A3CA4AC31BCD9DC9004C5B45 /* JSValue.mm in Sources */ = {isa = PBXBuildFile; fileRef = 86E3C60D167BAB87006D760A /* JSValue.mm */; }; + A3CA4AC41BCD9DC9004C5B45 /* JSValueRef.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 14BD5A2B0A3E91F600BAF59C /* JSValueRef.cpp */; }; + A3CA4AC51BCD9DC9004C5B45 /* JSVariableObject.cpp in Sources */ = {isa = PBXBuildFile; fileRef = BC22A39A0E16E14800AF21C8 /* JSVariableObject.cpp */; }; + A3CA4AC61BCD9DC9004C5B45 /* JSVirtualMachine.mm in Sources */ = {isa = PBXBuildFile; fileRef = 86E3C610167BAB87006D760A /* JSVirtualMachine.mm */; }; + A3CA4AC71BCD9DC9004C5B45 /* VMEntryScope.cpp in Sources */ = {isa = PBXBuildFile; fileRef = FE5932A5183C5A2600A1ECCC /* VMEntryScope.cpp */; }; + A3CA4AC81BCD9DC9004C5B45 /* JSWeakMap.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A7CA3AE117DA41AE006538AF /* JSWeakMap.cpp */; }; + A3CA4AC91BCD9DC9004C5B45 /* JSWeakObjectMapRefPrivate.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A7482B7A1166CDEA003B0712 /* JSWeakObjectMapRefPrivate.cpp */; }; + A3CA4ACA1BCD9DC9004C5B45 /* JSWithScope.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1442565F15EDE98D0066A49B /* JSWithScope.cpp */; }; + A3CA4ACB1BCD9DC9004C5B45 /* JSWrapperMap.mm in Sources */ = {isa = PBXBuildFile; fileRef = 86E3C60B167BAB87006D760A /* JSWrapperMap.mm */; }; + A3CA4ACC1BCD9DC9004C5B45 /* JSWrapperObject.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 65C7A1710A8EAACB00FA37EA /* JSWrapperObject.cpp */; }; + A3CA4ACD1BCD9DC9004C5B45 /* JumpTable.cpp in Sources */ = {isa = PBXBuildFile; fileRef = BCFD8C900EEB2EE700283848 /* JumpTable.cpp */; }; + A3CA4ACE1BCD9DC9004C5B45 /* LazyOperandValueProfile.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 0FB5467814F5C468002C2989 /* LazyOperandValueProfile.cpp */; }; + A3CA4ACF1BCD9DC9004C5B45 /* LegacyProfiler.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 95AB832E0DA42CAD00BC83F3 /* LegacyProfiler.cpp */; }; + A3CA4AD01BCD9DC9004C5B45 /* Lexer.cpp in Sources */ = {isa = PBXBuildFile; fileRef = F692A8650255597D01FF60F7 /* Lexer.cpp */; }; + A3CA4AD11BCD9DC9004C5B45 /* LinkBuffer.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 0FF4275615914A20004CB9FF /* LinkBuffer.cpp */; }; + A3CA4AD21BCD9DC9004C5B45 /* LiteralParser.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A7E2EA6A0FB460CF00601F06 /* LiteralParser.cpp */; }; + A3CA4AD31BCD9DC9004C5B45 /* LLIntCLoop.cpp in Sources */ = {isa = PBXBuildFile; fileRef = FE20CE9B15F04A9500DF3430 /* LLIntCLoop.cpp */; }; + A3CA4AD41BCD9DC9004C5B45 /* LLIntData.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 0F4680CE14BBB3D100BFE272 /* LLIntData.cpp */; }; + A3CA4AD51BCD9DC9004C5B45 /* LLIntEntrypoint.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 0F38B00F17CF077F00B144D3 /* LLIntEntrypoint.cpp */; }; + A3CA4AD61BCD9DC9004C5B45 /* LLIntExceptions.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 0F46809D14BA7F8200BFE272 /* LLIntExceptions.cpp */; }; + A3CA4AD71BCD9DC9004C5B45 /* LLIntSlowPaths.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 0F46809F14BA7F8200BFE272 /* LLIntSlowPaths.cpp */; settings = {COMPILER_FLAGS = "-Wno-unused-parameter"; }; }; + A3CA4AD81BCD9DC9004C5B45 /* LLIntThunks.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 0F0B839714BCF45A00885B4F /* LLIntThunks.cpp */; }; + A3CA4AD91BCD9DC9004C5B45 /* LLVMAPI.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 0FCEFAC71805E75500472CE4 /* LLVMAPI.cpp */; }; + A3CA4ADA1BCD9DC9004C5B45 /* LLVMDisassembler.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A7E5AB331799E4B200D2833D /* LLVMDisassembler.cpp */; }; + A3CA4ADB1BCD9DC9004C5B45 /* Lookup.cpp in Sources */ = {isa = PBXBuildFile; fileRef = F692A8680255597D01FF60F7 /* Lookup.cpp */; }; + A3CA4ADC1BCD9DC9004C5B45 /* LowLevelInterpreter.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 0F4680C714BBB16900BFE272 /* LowLevelInterpreter.cpp */; }; + A3CA4ADD1BCD9DC9004C5B45 /* MachineStackMarker.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 14B7233F12D7D0DA003BD5ED /* MachineStackMarker.cpp */; }; + A3CA4ADE1BCD9DC9004C5B45 /* RemoteInspectorDebuggable.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A594558E18245EDE00CC3843 /* RemoteInspectorDebuggable.cpp */; }; + A3CA4ADF1BCD9DC9004C5B45 /* MacroAssembler.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 0FEB3ECE16237F6700AB67AD /* MacroAssembler.cpp */; }; + A3CA4AE01BCD9DC9004C5B45 /* MacroAssemblerARM.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 86C568DD11A213EE0007F7F0 /* MacroAssemblerARM.cpp */; }; + A3CA4AE11BCD9DC9004C5B45 /* MacroAssemblerARMv7.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A729009B17976C6000317298 /* MacroAssemblerARMv7.cpp */; }; + A3CA4AE21BCD9DC9004C5B45 /* InspectorJSBackendDispatchers.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A532438118568317002ED692 /* InspectorJSBackendDispatchers.cpp */; }; + A3CA4AE31BCD9DC9004C5B45 /* MacroAssemblerX86Common.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A7A4AE0717973B26005612B1 /* MacroAssemblerX86Common.cpp */; }; + A3CA4AE41BCD9DC9004C5B45 /* MapConstructor.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A700873717CBE85300C3E643 /* MapConstructor.cpp */; }; + A3CA4AE51BCD9DC9004C5B45 /* MapData.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A78507D417CBC6FD0011F6E7 /* MapData.cpp */; }; + A3CA4AE61BCD9DC9004C5B45 /* MapPrototype.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A700873B17CBE8D300C3E643 /* MapPrototype.cpp */; }; + A3CA4AE71BCD9DC9004C5B45 /* MarkedAllocator.cpp in Sources */ = {isa = PBXBuildFile; fileRef = C2B916C414DA040C00CBAC86 /* MarkedAllocator.cpp */; }; + A3CA4AE81BCD9DC9004C5B45 /* MarkedBlock.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 142D6F0613539A2800B02E86 /* MarkedBlock.cpp */; }; + A3CA4AE91BCD9DC9004C5B45 /* MarkedSpace.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 14D2F3D8139F4BE200491031 /* MarkedSpace.cpp */; }; + A3CA4AEA1BCD9DC9004C5B45 /* MarkStack.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 142D6F0E13539A4100B02E86 /* MarkStack.cpp */; }; + A3CA4AEB1BCD9DC9004C5B45 /* MathObject.cpp in Sources */ = {isa = PBXBuildFile; fileRef = F692A86A0255597D01FF60F7 /* MathObject.cpp */; }; + A3CA4AEC1BCD9DC9004C5B45 /* MemoryStatistics.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 90213E3B123A40C200D422F3 /* MemoryStatistics.cpp */; }; + A3CA4AED1BCD9DC9004C5B45 /* MethodOfGettingAValueProfile.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 0FB5467C14F5CFD3002C2989 /* MethodOfGettingAValueProfile.cpp */; }; + A3CA4AEE1BCD9DC9004C5B45 /* NameConstructor.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 86EBF2F91560F036008E9222 /* NameConstructor.cpp */; }; + A3CA4AEF1BCD9DC9004C5B45 /* NameInstance.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 86EBF2FB1560F036008E9222 /* NameInstance.cpp */; }; + A3CA4AF01BCD9DC9004C5B45 /* NamePrototype.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 86EBF2FD1560F036008E9222 /* NamePrototype.cpp */; }; + A3CA4AF11BCD9DC9004C5B45 /* ScriptObject.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A54CF2F7184EAEDA00237F19 /* ScriptObject.cpp */; }; + A3CA4AF21BCD9DC9004C5B45 /* NativeErrorConstructor.cpp in Sources */ = {isa = PBXBuildFile; fileRef = BC02E9080E1839DB000F9297 /* NativeErrorConstructor.cpp */; }; + A3CA4AF31BCD9DC9004C5B45 /* NativeErrorPrototype.cpp in Sources */ = {isa = PBXBuildFile; fileRef = BC02E90A0E1839DB000F9297 /* NativeErrorPrototype.cpp */; }; + A3CA4AF41BCD9DC9004C5B45 /* Nodes.cpp in Sources */ = {isa = PBXBuildFile; fileRef = F692A86D0255597D01FF60F7 /* Nodes.cpp */; }; + A3CA4AF51BCD9DC9004C5B45 /* NodesCodegen.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 655EB29A10CE2581001A990E /* NodesCodegen.cpp */; }; + A3CA4AF61BCD9DC9004C5B45 /* NumberConstructor.cpp in Sources */ = {isa = PBXBuildFile; fileRef = BC2680C20E16D4E900A06E92 /* NumberConstructor.cpp */; }; + A3CA4AF71BCD9DC9004C5B45 /* NumberObject.cpp in Sources */ = {isa = PBXBuildFile; fileRef = F692A8700255597D01FF60F7 /* NumberObject.cpp */; }; + A3CA4AF81BCD9DC9004C5B45 /* NumberPrototype.cpp in Sources */ = {isa = PBXBuildFile; fileRef = BC2680C40E16D4E900A06E92 /* NumberPrototype.cpp */; }; + A3CA4AF91BCD9DC9004C5B45 /* ObjCCallbackFunction.mm in Sources */ = {isa = PBXBuildFile; fileRef = 86F3EEBA168CCF750077B92A /* ObjCCallbackFunction.mm */; }; + A3CA4AFA1BCD9DC9004C5B45 /* ObjectConstructor.cpp in Sources */ = {isa = PBXBuildFile; fileRef = BC2680C60E16D4E900A06E92 /* ObjectConstructor.cpp */; }; + A3CA4AFB1BCD9DC9004C5B45 /* ObjectPrototype.cpp in Sources */ = {isa = PBXBuildFile; fileRef = BC2680C80E16D4E900A06E92 /* ObjectPrototype.cpp */; }; + A3CA4AFC1BCD9DC9004C5B45 /* OpaqueJSString.cpp in Sources */ = {isa = PBXBuildFile; fileRef = E124A8F60E555775003091F1 /* OpaqueJSString.cpp */; }; + A3CA4AFD1BCD9DC9004C5B45 /* Opcode.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 969A07940ED1D3AE00F1F681 /* Opcode.cpp */; }; + A3CA4AFE1BCD9DC9004C5B45 /* Operations.cpp in Sources */ = {isa = PBXBuildFile; fileRef = F692A8770255597D01FF60F7 /* Operations.cpp */; }; + A3CA4AFF1BCD9DC9004C5B45 /* Options.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 0FE228EA1436AB2300196C48 /* Options.cpp */; }; + A3CA4B001BCD9DC9004C5B45 /* DFGSSALoweringPhase.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 0FC20CB718556A3500C9E954 /* DFGSSALoweringPhase.cpp */; }; + A3CA4B011BCD9DC9004C5B45 /* Parser.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 93F0B3A909BB4DC00068FCE3 /* Parser.cpp */; }; + A3CA4B021BCD9DC9004C5B45 /* ParserArena.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 93052C320FB792190048FDC3 /* ParserArena.cpp */; }; + A3CA4B031BCD9DC9004C5B45 /* PolymorphicPutByIdList.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 0F9FC8BF14E1B5FB00D52AE0 /* PolymorphicPutByIdList.cpp */; }; + A3CA4B041BCD9DC9004C5B45 /* PreciseJumpTargets.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 0F98205D16BFE37F00240D02 /* PreciseJumpTargets.cpp */; }; + A3CA4B051BCD9DC9004C5B45 /* Profile.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 95742F630DD11F5A000917FB /* Profile.cpp */; }; + A3CA4B061BCD9DC9004C5B45 /* ProfiledCodeBlockJettisoningWatchpoint.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 0FC97F31182020D7002C9B26 /* ProfiledCodeBlockJettisoningWatchpoint.cpp */; }; + A3CA4B071BCD9DC9004C5B45 /* ProfileGenerator.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 95CD45740E1C4FDD0085358E /* ProfileGenerator.cpp */; }; + A3CA4B081BCD9DC9004C5B45 /* ProfileNode.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 95AB83540DA43B4400BC83F3 /* ProfileNode.cpp */; }; + A3CA4B091BCD9DC9004C5B45 /* ProfilerBytecode.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 0FF72992166AD347000F5BA3 /* ProfilerBytecode.cpp */; }; + A3CA4B0A1BCD9DC9004C5B45 /* ProfilerBytecodes.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 0FF72994166AD347000F5BA3 /* ProfilerBytecodes.cpp */; }; + A3CA4B0B1BCD9DC9004C5B45 /* ProfilerBytecodeSequence.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 0F13912416771C30009CCB07 /* ProfilerBytecodeSequence.cpp */; }; + A3CA4B0C1BCD9DC9004C5B45 /* ProfilerCompilation.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 0FF72996166AD347000F5BA3 /* ProfilerCompilation.cpp */; }; + A3CA4B0D1BCD9DC9004C5B45 /* ProfilerCompilationKind.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 0FF72998166AD347000F5BA3 /* ProfilerCompilationKind.cpp */; }; + A3CA4B0E1BCD9DC9004C5B45 /* ProfilerCompiledBytecode.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 0FF7299A166AD347000F5BA3 /* ProfilerCompiledBytecode.cpp */; }; + A3CA4B0F1BCD9DC9004C5B45 /* ProfilerDatabase.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 0FF7299C166AD347000F5BA3 /* ProfilerDatabase.cpp */; }; + A3CA4B101BCD9DC9004C5B45 /* ProfilerOrigin.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 0FF7299F166AD347000F5BA3 /* ProfilerOrigin.cpp */; }; + A3CA4B111BCD9DC9004C5B45 /* ProfilerOriginStack.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 0FF729A1166AD347000F5BA3 /* ProfilerOriginStack.cpp */; }; + A3CA4B121BCD9DC9004C5B45 /* BytecodeBasicBlock.cpp in Sources */ = {isa = PBXBuildFile; fileRef = C2FCAE0C17A9C24E0034C735 /* BytecodeBasicBlock.cpp */; }; + A3CA4B131BCD9DC9004C5B45 /* DFGResurrectionForValidationPhase.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 0F666ECA1836B37E00D017F1 /* DFGResurrectionForValidationPhase.cpp */; }; + A3CA4B141BCD9DC9004C5B45 /* ProfilerOSRExit.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 0FB105871675482E00F8AB6E /* ProfilerOSRExit.cpp */; }; + A3CA4B151BCD9DC9004C5B45 /* ProfilerOSRExitSite.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 0FB105891675482E00F8AB6E /* ProfilerOSRExitSite.cpp */; }; + A3CA4B161BCD9DC9004C5B45 /* ProfilerProfiledBytecodes.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 0F13912616771C30009CCB07 /* ProfilerProfiledBytecodes.cpp */; }; + A3CA4B171BCD9DC9004C5B45 /* PropertyDescriptor.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A7FB60A3103F7DC20017A286 /* PropertyDescriptor.cpp */; }; + A3CA4B181BCD9DC9004C5B45 /* PropertyNameArray.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 65400C0F0A69BAF200509887 /* PropertyNameArray.cpp */; }; + A3CA4B191BCD9DC9004C5B45 /* PropertySlot.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 65621E6B089E859700760F35 /* PropertySlot.cpp */; }; + A3CA4B1A1BCD9DC9004C5B45 /* PropertyTable.cpp in Sources */ = {isa = PBXBuildFile; fileRef = AD1CF06816DCAB2D00B97123 /* PropertyTable.cpp */; }; + A3CA4B1B1BCD9DC9004C5B45 /* PrototypeMap.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 14D844A216AA2C7000A65AF0 /* PrototypeMap.cpp */; }; + A3CA4B1C1BCD9DC9004C5B45 /* PutByIdStatus.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 0F93329914CA7DC10085F3C6 /* PutByIdStatus.cpp */; }; + A3CA4B1D1BCD9DC9004C5B45 /* ReduceWhitespace.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 0FF60ABF16740F8100029779 /* ReduceWhitespace.cpp */; }; + A3CA4B1E1BCD9DC9004C5B45 /* RegExp.cpp in Sources */ = {isa = PBXBuildFile; fileRef = F692A87D0255597D01FF60F7 /* RegExp.cpp */; }; + A3CA4B1F1BCD9DC9004C5B45 /* RegExpCache.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A1712B3A11C7B212007A5315 /* RegExpCache.cpp */; }; + A3CA4B201BCD9DC9004C5B45 /* RegExpCachedResult.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 86F75EFB151C062F007C9BA3 /* RegExpCachedResult.cpp */; }; + A3CA4B211BCD9DC9004C5B45 /* RegExpConstructor.cpp in Sources */ = {isa = PBXBuildFile; fileRef = BCD202BD0E1706A7002C7E82 /* RegExpConstructor.cpp */; }; + A3CA4B221BCD9DC9004C5B45 /* RegExpMatchesArray.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 86F75EFD151C062F007C9BA3 /* RegExpMatchesArray.cpp */; }; + A3CA4B231BCD9DC9004C5B45 /* RegExpObject.cpp in Sources */ = {isa = PBXBuildFile; fileRef = F692A87B0255597D01FF60F7 /* RegExpObject.cpp */; }; + A3CA4B241BCD9DC9004C5B45 /* RegExpPrototype.cpp in Sources */ = {isa = PBXBuildFile; fileRef = BCD202BF0E1706A7002C7E82 /* RegExpPrototype.cpp */; }; + A3CA4B251BCD9DC9004C5B45 /* RegisterSet.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 0FC3141418146D7000033232 /* RegisterSet.cpp */; }; + A3CA4B261BCD9DC9004C5B45 /* Repatch.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 0F24E54917EE274900ABB217 /* Repatch.cpp */; }; + A3CA4B271BCD9DC9004C5B45 /* SamplingCounter.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 0F7700911402FF280078EB39 /* SamplingCounter.cpp */; }; + A3CA4B281BCD9DC9004C5B45 /* SamplingTool.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1429D8830ED21C3D00B89619 /* SamplingTool.cpp */; }; + A3CA4B291BCD9DC9004C5B45 /* SetConstructor.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A7299DA317D12858005F5FF9 /* SetConstructor.cpp */; }; + A3CA4B2A1BCD9DC9004C5B45 /* SetPrototype.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A7299D9F17D12848005F5FF9 /* SetPrototype.cpp */; }; + A3CA4B2B1BCD9DC9004C5B45 /* SimpleTypedArrayController.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 0F2B66D617B6B5AB00A7AE3F /* SimpleTypedArrayController.cpp */; }; + A3CA4B2C1BCD9DC9004C5B45 /* SetIteratorPrototype.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A790DD67182F499700588807 /* SetIteratorPrototype.cpp */; }; + A3CA4B2D1BCD9DC9004C5B45 /* SlotVisitor.cpp in Sources */ = {isa = PBXBuildFile; fileRef = C225494215F7DBAA0065E898 /* SlotVisitor.cpp */; }; + A3CA4B2E1BCD9DC9004C5B45 /* SmallStrings.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 93303FE80E6A72B500786E6A /* SmallStrings.cpp */; }; + A3CA4B2F1BCD9DC9004C5B45 /* SourceCode.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 0F8F2B9D17306C8B007DBDA5 /* SourceCode.cpp */; }; + A3CA4B301BCD9DC9004C5B45 /* SourceProvider.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 0F493AF816D0CAD10084508B /* SourceProvider.cpp */; }; + A3CA4B311BCD9DC9004C5B45 /* SourceProviderCache.cpp in Sources */ = {isa = PBXBuildFile; fileRef = E49DC15512EF277200184A1F /* SourceProviderCache.cpp */; }; + A3CA4B321BCD9DC9004C5B45 /* SparseArrayValueMap.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 0F0CD4C315F6B6B50032F1C0 /* SparseArrayValueMap.cpp */; }; + A3CA4B331BCD9DC9004C5B45 /* SpecialPointer.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 0F5541AF1613C1FB00CE3E25 /* SpecialPointer.cpp */; }; + A3CA4B341BCD9DC9004C5B45 /* SpeculatedType.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 0FD82E84141F3FDA00179C94 /* SpeculatedType.cpp */; }; + A3CA4B351BCD9DC9004C5B45 /* StackVisitor.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A7C1EAEC17987AB600299DB2 /* StackVisitor.cpp */; }; + A3CA4B361BCD9DC9004C5B45 /* StrictEvalActivation.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A730B6111250068F009D25B1 /* StrictEvalActivation.cpp */; }; + A3CA4B371BCD9DC9004C5B45 /* StringConstructor.cpp in Sources */ = {isa = PBXBuildFile; fileRef = BC18C3C00E16EE3300B34460 /* StringConstructor.cpp */; }; + A3CA4B381BCD9DC9004C5B45 /* StringObject.cpp in Sources */ = {isa = PBXBuildFile; fileRef = BC18C3C20E16EE3300B34460 /* StringObject.cpp */; }; + A3CA4B391BCD9DC9004C5B45 /* StringPrototype.cpp in Sources */ = {isa = PBXBuildFile; fileRef = BC18C3C50E16EE3300B34460 /* StringPrototype.cpp */; }; + A3CA4B3A1BCD9DC9004C5B45 /* StringRecursionChecker.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 93345A8712D838C400302BE3 /* StringRecursionChecker.cpp */; }; + A3CA4B3B1BCD9DC9004C5B45 /* Structure.cpp in Sources */ = {isa = PBXBuildFile; fileRef = BCDE3AB00E6C82CF001453A7 /* Structure.cpp */; }; + A3CA4B3C1BCD9DC9004C5B45 /* StructureChain.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 7E4EE70E0EBB7A5B005934AA /* StructureChain.cpp */; }; + A3CA4B3D1BCD9DC9004C5B45 /* StructureRareData.cpp in Sources */ = {isa = PBXBuildFile; fileRef = C2F0F2D016BAEEE900187C19 /* StructureRareData.cpp */; }; + A3CA4B3E1BCD9DC9004C5B45 /* StructureStubClearingWatchpoint.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 0F766D3615AE4A1A008F363E /* StructureStubClearingWatchpoint.cpp */; }; + A3CA4B3F1BCD9DC9004C5B45 /* StructureStubInfo.cpp in Sources */ = {isa = PBXBuildFile; fileRef = BCCF0D0B0EF0B8A500413C8F /* StructureStubInfo.cpp */; }; + A3CA4B401BCD9DC9004C5B45 /* MapIteratorConstructor.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A74DEF8B182D991400522C22 /* MapIteratorConstructor.cpp */; }; + A3CA4B411BCD9DC9004C5B45 /* SuperRegion.cpp in Sources */ = {isa = PBXBuildFile; fileRef = C2DF442D1707AC0100A5CA96 /* SuperRegion.cpp */; }; + A3CA4B421BCD9DC9004C5B45 /* SymbolTable.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 0F919D2715856770004A4E7D /* SymbolTable.cpp */; }; + A3CA4B431BCD9DC9004C5B45 /* TempRegisterSet.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 0FC314111814559100033232 /* TempRegisterSet.cpp */; }; + A3CA4B441BCD9DC9004C5B45 /* TestRunnerUtils.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 0FA2C17917D7CF84009D015F /* TestRunnerUtils.cpp */; }; + A3CA4B451BCD9DC9004C5B45 /* ThunkGenerators.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A7386552118697B400540279 /* ThunkGenerators.cpp */; }; + A3CA4B461BCD9DC9004C5B45 /* TypedArrayController.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 0F2B66D917B6B5AB00A7AE3F /* TypedArrayController.cpp */; }; + A3CA4B471BCD9DC9004C5B45 /* TypedArrayType.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 0F2B66DC17B6B5AB00A7AE3F /* TypedArrayType.cpp */; }; + A3CA4B481BCD9DC9004C5B45 /* udis86.c in Sources */ = {isa = PBXBuildFile; fileRef = 0FF4273E158EBD94004CB9FF /* udis86.c */; }; + A3CA4B491BCD9DC9004C5B45 /* udis86_decode.c in Sources */ = {isa = PBXBuildFile; fileRef = 0FF42734158EBD94004CB9FF /* udis86_decode.c */; }; + A3CA4B4A1BCD9DC9004C5B45 /* SetIteratorConstructor.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A790DD65182F499700588807 /* SetIteratorConstructor.cpp */; }; + A3CA4B4B1BCD9DC9004C5B45 /* udis86_input.c in Sources */ = {isa = PBXBuildFile; fileRef = 0FF42737158EBD94004CB9FF /* udis86_input.c */; }; + A3CA4B4C1BCD9DC9004C5B45 /* udis86_itab_holder.c in Sources */ = {isa = PBXBuildFile; fileRef = 0FF4274C158EBFE1004CB9FF /* udis86_itab_holder.c */; }; + A3CA4B4D1BCD9DC9004C5B45 /* udis86_syn-att.c in Sources */ = {isa = PBXBuildFile; fileRef = 0FF42739158EBD94004CB9FF /* udis86_syn-att.c */; }; + A3CA4B4E1BCD9DC9004C5B45 /* udis86_syn-intel.c in Sources */ = {isa = PBXBuildFile; fileRef = 0FF4273A158EBD94004CB9FF /* udis86_syn-intel.c */; }; + A3CA4B4F1BCD9DC9004C5B45 /* udis86_syn.c in Sources */ = {isa = PBXBuildFile; fileRef = 0FF4273B158EBD94004CB9FF /* udis86_syn.c */; }; + A3CA4B501BCD9DC9004C5B45 /* UDis86Disassembler.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 0FF42730158EBD44004CB9FF /* UDis86Disassembler.cpp */; }; + A3CA4B511BCD9DC9004C5B45 /* UnlinkedCodeBlock.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A79E781E15EECBA80047C855 /* UnlinkedCodeBlock.cpp */; }; + A3CA4B521BCD9DC9004C5B45 /* ValueRecovery.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 0F24E55717F74EDB00ABB217 /* ValueRecovery.cpp */; }; + A3CA4B531BCD9DC9004C5B45 /* VM.cpp in Sources */ = {isa = PBXBuildFile; fileRef = E18E3A570DF9278C00D90B34 /* VM.cpp */; }; + A3CA4B541BCD9DC9004C5B45 /* VMInspector.cpp in Sources */ = {isa = PBXBuildFile; fileRef = FE4A331D15BD2E07006F54F3 /* VMInspector.cpp */; }; + A3CA4B551BCD9DC9004C5B45 /* Watchdog.cpp in Sources */ = {isa = PBXBuildFile; fileRef = FED94F2B171E3E2300BE77A4 /* Watchdog.cpp */; }; + A3CA4B561BCD9DC9004C5B45 /* WatchdogMac.cpp in Sources */ = {isa = PBXBuildFile; fileRef = FED94F2D171E3E2300BE77A4 /* WatchdogMac.cpp */; }; + A3CA4B571BCD9DC9004C5B45 /* DFGAvailability.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 0F666EC21835672B00D017F1 /* DFGAvailability.cpp */; }; + A3CA4B581BCD9DC9004C5B45 /* Watchpoint.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 0F919D2215853CDE004A4E7D /* Watchpoint.cpp */; }; + A3CA4B591BCD9DC9004C5B45 /* Weak.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1ACF7376171CA6FB00C9BB1E /* Weak.cpp */; }; + A3CA4B5A1BCD9DC9004C5B45 /* WeakBlock.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 14E84F9914EE1ACC00D6D5D4 /* WeakBlock.cpp */; }; + A3CA4B5B1BCD9DC9004C5B45 /* WeakHandleOwner.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 14F7256314EE265E00B1652B /* WeakHandleOwner.cpp */; }; + A3CA4B5C1BCD9DC9004C5B45 /* WeakMapConstructor.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A7CA3ADD17DA41AE006538AF /* WeakMapConstructor.cpp */; }; + A3CA4B5D1BCD9DC9004C5B45 /* WeakMapData.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A7CA3AE917DA5168006538AF /* WeakMapData.cpp */; }; + A3CA4B5E1BCD9DC9004C5B45 /* WeakMapPrototype.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A7CA3ADF17DA41AE006538AF /* WeakMapPrototype.cpp */; }; + A3CA4B5F1BCD9DC9004C5B45 /* WeakSet.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 14E84F9B14EE1ACC00D6D5D4 /* WeakSet.cpp */; }; + A3CA4B601BCD9DC9004C5B45 /* WriteBarrierSupport.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 0FC8150814043BCA00CFA603 /* WriteBarrierSupport.cpp */; }; + A3CA4B611BCD9DC9004C5B45 /* RemoteInspector.mm in Sources */ = {isa = PBXBuildFile; fileRef = A5BA15E2182340B300A82E69 /* RemoteInspector.mm */; }; + A3CA4B621BCD9DC9004C5B45 /* RemoteInspectorDebuggableConnection.mm in Sources */ = {isa = PBXBuildFile; fileRef = A5BA15E5182340B300A82E69 /* RemoteInspectorDebuggableConnection.mm */; }; + A3CA4B631BCD9DC9004C5B45 /* RemoteInspectorXPCConnection.mm in Sources */ = {isa = PBXBuildFile; fileRef = A5BA15E7182340B300A82E69 /* RemoteInspectorXPCConnection.mm */; }; + A3CA4B641BCD9DC9004C5B45 /* X86Disassembler.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A7E5AB361799E4B200D2833D /* X86Disassembler.cpp */; }; + A3CA4B651BCD9DC9004C5B45 /* YarrCanonicalizeUCS2.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 863C6D981521111200585E4E /* YarrCanonicalizeUCS2.cpp */; }; + A3CA4B661BCD9DC9004C5B45 /* YarrInterpreter.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 86704B7D12DBA33700A9FE7B /* YarrInterpreter.cpp */; }; + A3CA4B671BCD9DC9004C5B45 /* YarrJIT.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 86704B7F12DBA33700A9FE7B /* YarrJIT.cpp */; }; + A3CA4B681BCD9DC9004C5B45 /* YarrPattern.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 86704B8212DBA33700A9FE7B /* YarrPattern.cpp */; }; + A3CA4B691BCD9DC9004C5B45 /* InspectorAgentRegistry.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A593CF84184038CA00BFCE27 /* InspectorAgentRegistry.cpp */; }; + A3CA4B6A1BCD9DC9004C5B45 /* YarrSyntaxChecker.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 86704B4012DB8A8100A9FE7B /* YarrSyntaxChecker.cpp */; }; + A3CA4B6C1BCD9DC9004C5B45 /* CoreFoundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 6560A4CF04B3B3E7008AE952 /* CoreFoundation.framework */; }; + A3CA4B6D1BCD9DC9004C5B45 /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 51F0EB6105C86C6B00E6DF1B /* Foundation.framework */; }; A513E5C7185F9446007E95AD /* InjectedScriptSource.h in Headers */ = {isa = PBXBuildFile; fileRef = A513E5C6185F9436007E95AD /* InjectedScriptSource.h */; }; A532438718568335002ED692 /* InspectorJSBackendDispatchers.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A532438118568317002ED692 /* InspectorJSBackendDispatchers.cpp */; }; A532438818568335002ED692 /* InspectorJSBackendDispatchers.h in Headers */ = {isa = PBXBuildFile; fileRef = A532438218568317002ED692 /* InspectorJSBackendDispatchers.h */; settings = {ATTRIBUTES = (Private, ); }; }; @@ -2613,6 +3819,13 @@ remoteGlobalIDString = 932F5B3E0822A1C700736975; remoteInfo = "JavaScriptCore (Upgraded)"; }; + A3CA46B31BCD9DC9004C5B45 /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = 0867D690FE84028FC02AAC07 /* Project object */; + proxyType = 1; + remoteGlobalIDString = 10D592F61889C55E00C05A0D; + remoteInfo = "Derived Sources iOS"; + }; /* End PBXContainerItemProxy section */ /* Begin PBXCopyFilesBuildPhase section */ @@ -3498,6 +4711,8 @@ A1712B3A11C7B212007A5315 /* RegExpCache.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = RegExpCache.cpp; sourceTree = ""; }; A1712B3E11C7B228007A5315 /* RegExpCache.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RegExpCache.h; sourceTree = ""; }; A1712B4011C7B235007A5315 /* RegExpKey.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RegExpKey.h; sourceTree = ""; }; + A3B645F51BCDBA50001827C5 /* libWTF-tvOS.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; name = "libWTF-tvOS.a"; path = "../WTF/build/Debug-appletvos/libWTF-tvOS.a"; sourceTree = ""; }; + A3CA4B781BCD9DC9004C5B45 /* libJavaScriptCore-tvOS.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = "libJavaScriptCore-tvOS.a"; sourceTree = BUILT_PRODUCTS_DIR; }; A513E5C6185F9436007E95AD /* InjectedScriptSource.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = InjectedScriptSource.h; sourceTree = ""; }; A532438118568317002ED692 /* InspectorJSBackendDispatchers.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = InspectorJSBackendDispatchers.cpp; sourceTree = ""; }; A532438218568317002ED692 /* InspectorJSBackendDispatchers.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = InspectorJSBackendDispatchers.h; sourceTree = ""; }; @@ -4005,6 +5220,16 @@ ); runOnlyForDeploymentPostprocessing = 0; }; + A3CA4B6B1BCD9DC9004C5B45 /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + A3B645F61BCDBA50001827C5 /* libWTF-tvOS.a in Frameworks */, + A3CA4B6C1BCD9DC9004C5B45 /* CoreFoundation.framework in Frameworks */, + A3CA4B6D1BCD9DC9004C5B45 /* Foundation.framework in Frameworks */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; /* End PBXFrameworksBuildPhase section */ /* Begin PBXGroup section */ @@ -4020,6 +5245,7 @@ 6511230514046A4C002B101D /* testRegExp */, 10D58E0C1889C1A000C05A0D /* libJSCLLIntOffsetsExtractor.a */, 10D592F41889C3DF00C05A0D /* libJavaScriptCore.a */, + A3CA4B781BCD9DC9004C5B45 /* libJavaScriptCore-tvOS.a */, ); name = Products; sourceTree = ""; @@ -4070,6 +5296,7 @@ 0867D69AFE84028FC02AAC07 /* Frameworks */ = { isa = PBXGroup; children = ( + A3B645F51BCDBA50001827C5 /* libWTF-tvOS.a */, 6560A4CF04B3B3E7008AE952 /* CoreFoundation.framework */, 51F0EB6105C86C6B00E6DF1B /* Foundation.framework */, A8A4748D151A8306004123FF /* libWTF.a */, @@ -7074,6 +8301,736 @@ ); runOnlyForDeploymentPostprocessing = 0; }; + A3CA46B51BCD9DC9004C5B45 /* Headers */ = { + isa = PBXHeadersBuildPhase; + buildActionMask = 2147483647; + files = ( + A3CA46B61BCD9DC9004C5B45 /* A64DOpcode.h in Headers */, + A3CA46B71BCD9DC9004C5B45 /* AbstractMacroAssembler.h in Headers */, + A3CA46B81BCD9DC9004C5B45 /* JSTypedArray.h in Headers */, + A3CA46B91BCD9DC9004C5B45 /* AbstractPC.h in Headers */, + A3CA46BA1BCD9DC9004C5B45 /* APICallbackFunction.h in Headers */, + A3CA46BB1BCD9DC9004C5B45 /* APICast.h in Headers */, + A3CA46BC1BCD9DC9004C5B45 /* APIShims.h in Headers */, + A3CA46BD1BCD9DC9004C5B45 /* ArgList.h in Headers */, + A3CA46BE1BCD9DC9004C5B45 /* Arguments.h in Headers */, + A3CA46BF1BCD9DC9004C5B45 /* ArgumentsIteratorConstructor.h in Headers */, + A3CA46C01BCD9DC9004C5B45 /* ArgumentsIteratorPrototype.h in Headers */, + A3CA46C11BCD9DC9004C5B45 /* ARMAssembler.h in Headers */, + A3CA46C21BCD9DC9004C5B45 /* ARMv7Assembler.h in Headers */, + A3CA46C31BCD9DC9004C5B45 /* ARMv7DOpcode.h in Headers */, + A3CA46C41BCD9DC9004C5B45 /* CopyWriteBarrier.h in Headers */, + A3CA46C51BCD9DC9004C5B45 /* WriteBarrierBuffer.h in Headers */, + A3CA46C61BCD9DC9004C5B45 /* VMEntryScope.h in Headers */, + A3CA46C71BCD9DC9004C5B45 /* CodeGeneratorInspectorStrings.py in Headers */, + A3CA46C81BCD9DC9004C5B45 /* CodeGeneratorInspector.py in Headers */, + A3CA46C91BCD9DC9004C5B45 /* TempRegisterSet.h in Headers */, + A3CA46CA1BCD9DC9004C5B45 /* DFGFiltrationResult.h in Headers */, + A3CA46CB1BCD9DC9004C5B45 /* BytecodeBasicBlock.h in Headers */, + A3CA46CC1BCD9DC9004C5B45 /* generate-combined-inspector-json.py in Headers */, + A3CA46CD1BCD9DC9004C5B45 /* BytecodeLivenessAnalysis.h in Headers */, + A3CA46CE1BCD9DC9004C5B45 /* ArrayAllocationProfile.h in Headers */, + A3CA46CF1BCD9DC9004C5B45 /* Breakpoint.h in Headers */, + A3CA46D01BCD9DC9004C5B45 /* ArrayBuffer.h in Headers */, + A3CA46D11BCD9DC9004C5B45 /* DebuggerPrimitives.h in Headers */, + A3CA46D21BCD9DC9004C5B45 /* ArrayBufferView.h in Headers */, + A3CA46D31BCD9DC9004C5B45 /* ArrayConstructor.h in Headers */, + A3CA46D41BCD9DC9004C5B45 /* ArrayConventions.h in Headers */, + A3CA46D51BCD9DC9004C5B45 /* ArrayIteratorConstructor.h in Headers */, + A3CA46D61BCD9DC9004C5B45 /* ArrayIteratorPrototype.h in Headers */, + A3CA46D71BCD9DC9004C5B45 /* ArrayProfile.h in Headers */, + A3CA46D81BCD9DC9004C5B45 /* ArrayPrototype.h in Headers */, + A3CA46D91BCD9DC9004C5B45 /* ArrayPrototype.lut.h in Headers */, + A3CA46DA1BCD9DC9004C5B45 /* ArrayStorage.h in Headers */, + A3CA46DB1BCD9DC9004C5B45 /* AssemblerBuffer.h in Headers */, + A3CA46DC1BCD9DC9004C5B45 /* AssemblerBufferWithConstantPool.h in Headers */, + A3CA46DD1BCD9DC9004C5B45 /* AssemblyHelpers.h in Headers */, + A3CA46DE1BCD9DC9004C5B45 /* ASTBuilder.h in Headers */, + A3CA46DF1BCD9DC9004C5B45 /* BatchedTransitionOptimizer.h in Headers */, + A3CA46E01BCD9DC9004C5B45 /* BigInteger.h in Headers */, + A3CA46E11BCD9DC9004C5B45 /* BlockAllocator.h in Headers */, + A3CA46E21BCD9DC9004C5B45 /* BooleanObject.h in Headers */, + A3CA46E31BCD9DC9004C5B45 /* RemoteInspectorConstants.h in Headers */, + A3CA46E41BCD9DC9004C5B45 /* Butterfly.h in Headers */, + A3CA46E51BCD9DC9004C5B45 /* ButterflyInlines.h in Headers */, + A3CA46E61BCD9DC9004C5B45 /* BytecodeConventions.h in Headers */, + A3CA46E71BCD9DC9004C5B45 /* BytecodeGenerator.h in Headers */, + A3CA46E81BCD9DC9004C5B45 /* ByValInfo.h in Headers */, + A3CA46E91BCD9DC9004C5B45 /* CallData.h in Headers */, + A3CA46EA1BCD9DC9004C5B45 /* CallFrame.h in Headers */, + A3CA46EB1BCD9DC9004C5B45 /* CallFrameInlines.h in Headers */, + A3CA46EC1BCD9DC9004C5B45 /* CallIdentifier.h in Headers */, + A3CA46ED1BCD9DC9004C5B45 /* CallLinkInfo.h in Headers */, + A3CA46EE1BCD9DC9004C5B45 /* CallLinkStatus.h in Headers */, + A3CA46EF1BCD9DC9004C5B45 /* CallReturnOffsetToBytecodeOffset.h in Headers */, + A3CA46F01BCD9DC9004C5B45 /* CCallHelpers.h in Headers */, + A3CA46F11BCD9DC9004C5B45 /* ClassInfo.h in Headers */, + A3CA46F21BCD9DC9004C5B45 /* ClosureCallStubRoutine.h in Headers */, + A3CA46F31BCD9DC9004C5B45 /* CodeBlock.h in Headers */, + A3CA46F41BCD9DC9004C5B45 /* CodeBlockHash.h in Headers */, + A3CA46F51BCD9DC9004C5B45 /* CodeBlockJettisoningWatchpoint.h in Headers */, + A3CA46F61BCD9DC9004C5B45 /* CodeBlockSet.h in Headers */, + A3CA46F71BCD9DC9004C5B45 /* CodeBlockWithJITType.h in Headers */, + A3CA46F81BCD9DC9004C5B45 /* CodeCache.h in Headers */, + A3CA46F91BCD9DC9004C5B45 /* CodeLocation.h in Headers */, + A3CA46FA1BCD9DC9004C5B45 /* CodeOrigin.h in Headers */, + A3CA46FB1BCD9DC9004C5B45 /* CodeSpecializationKind.h in Headers */, + A3CA46FC1BCD9DC9004C5B45 /* CodeType.h in Headers */, + A3CA46FD1BCD9DC9004C5B45 /* CommonIdentifiers.h in Headers */, + A3CA46FE1BCD9DC9004C5B45 /* CommonSlowPaths.h in Headers */, + A3CA46FF1BCD9DC9004C5B45 /* CommonSlowPathsExceptions.h in Headers */, + A3CA47001BCD9DC9004C5B45 /* CompactJITCodeMap.h in Headers */, + A3CA47011BCD9DC9004C5B45 /* CompilationResult.h in Headers */, + A3CA47021BCD9DC9004C5B45 /* Completion.h in Headers */, + A3CA47031BCD9DC9004C5B45 /* ConcurrentJITLock.h in Headers */, + A3CA47041BCD9DC9004C5B45 /* config.h in Headers */, + A3CA47051BCD9DC9004C5B45 /* ConservativeRoots.h in Headers */, + A3CA47061BCD9DC9004C5B45 /* ConstructData.h in Headers */, + A3CA47071BCD9DC9004C5B45 /* CopiedAllocator.h in Headers */, + A3CA47081BCD9DC9004C5B45 /* CopiedBlock.h in Headers */, + A3CA47091BCD9DC9004C5B45 /* CopiedBlockInlines.h in Headers */, + A3CA470A1BCD9DC9004C5B45 /* CopiedSpace.h in Headers */, + A3CA470B1BCD9DC9004C5B45 /* CopiedSpaceInlines.h in Headers */, + A3CA470C1BCD9DC9004C5B45 /* CopyToken.h in Headers */, + A3CA470D1BCD9DC9004C5B45 /* CopyVisitor.h in Headers */, + A3CA470E1BCD9DC9004C5B45 /* CopyVisitorInlines.h in Headers */, + A3CA470F1BCD9DC9004C5B45 /* CopyWorkList.h in Headers */, + A3CA47101BCD9DC9004C5B45 /* create_hash_table in Headers */, + A3CA47111BCD9DC9004C5B45 /* DataFormat.h in Headers */, + A3CA47121BCD9DC9004C5B45 /* DataView.h in Headers */, + A3CA47131BCD9DC9004C5B45 /* DateConstructor.h in Headers */, + A3CA47141BCD9DC9004C5B45 /* DateConversion.h in Headers */, + A3CA47151BCD9DC9004C5B45 /* InspectorAgentBase.h in Headers */, + A3CA47161BCD9DC9004C5B45 /* DateInstance.h in Headers */, + A3CA47171BCD9DC9004C5B45 /* DateInstanceCache.h in Headers */, + A3CA47181BCD9DC9004C5B45 /* DatePrototype.h in Headers */, + A3CA47191BCD9DC9004C5B45 /* DatePrototype.lut.h in Headers */, + A3CA471A1BCD9DC9004C5B45 /* Debugger.h in Headers */, + A3CA471B1BCD9DC9004C5B45 /* DebuggerActivation.h in Headers */, + A3CA471C1BCD9DC9004C5B45 /* DebuggerCallFrame.h in Headers */, + A3CA471D1BCD9DC9004C5B45 /* DeferGC.h in Headers */, + A3CA471E1BCD9DC9004C5B45 /* BytecodeUseDef.h in Headers */, + A3CA471F1BCD9DC9004C5B45 /* DeferredCompilationCallback.h in Headers */, + A3CA47201BCD9DC9004C5B45 /* DFGAbstractHeap.h in Headers */, + A3CA47211BCD9DC9004C5B45 /* DFGAbstractInterpreter.h in Headers */, + A3CA47221BCD9DC9004C5B45 /* DFGAbstractInterpreterInlines.h in Headers */, + A3CA47231BCD9DC9004C5B45 /* DFGAbstractValue.h in Headers */, + A3CA47241BCD9DC9004C5B45 /* DFGAdjacencyList.h in Headers */, + A3CA47251BCD9DC9004C5B45 /* DFGAllocator.h in Headers */, + A3CA47261BCD9DC9004C5B45 /* DFGAnalysis.h in Headers */, + A3CA47271BCD9DC9004C5B45 /* DFGArgumentPosition.h in Headers */, + A3CA47281BCD9DC9004C5B45 /* DFGArgumentsSimplificationPhase.h in Headers */, + A3CA47291BCD9DC9004C5B45 /* DFGArrayifySlowPathGenerator.h in Headers */, + A3CA472A1BCD9DC9004C5B45 /* DFGArrayMode.h in Headers */, + A3CA472B1BCD9DC9004C5B45 /* RemoteInspectorDebuggableConnection.h in Headers */, + A3CA472C1BCD9DC9004C5B45 /* DFGAtTailAbstractState.h in Headers */, + A3CA472D1BCD9DC9004C5B45 /* DFGBackwardsPropagationPhase.h in Headers */, + A3CA472E1BCD9DC9004C5B45 /* DFGBasicBlock.h in Headers */, + A3CA472F1BCD9DC9004C5B45 /* DFGBasicBlockInlines.h in Headers */, + A3CA47301BCD9DC9004C5B45 /* DFGBinarySwitch.h in Headers */, + A3CA47311BCD9DC9004C5B45 /* DFGBlockInsertionSet.h in Headers */, + A3CA47321BCD9DC9004C5B45 /* DFGBranchDirection.h in Headers */, + A3CA47331BCD9DC9004C5B45 /* MacroAssemblerARM64.h in Headers */, + A3CA47341BCD9DC9004C5B45 /* DFGByteCodeParser.h in Headers */, + A3CA47351BCD9DC9004C5B45 /* InspectorAgentRegistry.h in Headers */, + A3CA47361BCD9DC9004C5B45 /* DFGCallArrayAllocatorSlowPathGenerator.h in Headers */, + A3CA47371BCD9DC9004C5B45 /* DFGCapabilities.h in Headers */, + A3CA47381BCD9DC9004C5B45 /* DFGCFAPhase.h in Headers */, + A3CA47391BCD9DC9004C5B45 /* DFGCFGSimplificationPhase.h in Headers */, + A3CA473A1BCD9DC9004C5B45 /* DFGClobberize.h in Headers */, + A3CA473B1BCD9DC9004C5B45 /* DFGClobberSet.h in Headers */, + A3CA473C1BCD9DC9004C5B45 /* DFGCommon.h in Headers */, + A3CA473D1BCD9DC9004C5B45 /* DFGCommonData.h in Headers */, + A3CA473E1BCD9DC9004C5B45 /* DFGCompilationKey.h in Headers */, + A3CA473F1BCD9DC9004C5B45 /* DFGCompilationMode.h in Headers */, + A3CA47401BCD9DC9004C5B45 /* DFGConstantFoldingPhase.h in Headers */, + A3CA47411BCD9DC9004C5B45 /* DFGCPSRethreadingPhase.h in Headers */, + A3CA47421BCD9DC9004C5B45 /* DFGCriticalEdgeBreakingPhase.h in Headers */, + A3CA47431BCD9DC9004C5B45 /* DFGCSEPhase.h in Headers */, + A3CA47441BCD9DC9004C5B45 /* DFGDCEPhase.h in Headers */, + A3CA47451BCD9DC9004C5B45 /* DFGDesiredIdentifiers.h in Headers */, + A3CA47461BCD9DC9004C5B45 /* DFGDesiredStructureChains.h in Headers */, + A3CA47471BCD9DC9004C5B45 /* DFGDesiredTransitions.h in Headers */, + A3CA47481BCD9DC9004C5B45 /* DFGDesiredWatchpoints.h in Headers */, + A3CA47491BCD9DC9004C5B45 /* DFGSSALoweringPhase.h in Headers */, + A3CA474A1BCD9DC9004C5B45 /* DFGDesiredWeakReferences.h in Headers */, + A3CA474B1BCD9DC9004C5B45 /* DFGDesiredWriteBarriers.h in Headers */, + A3CA474C1BCD9DC9004C5B45 /* DFGDisassembler.h in Headers */, + A3CA474D1BCD9DC9004C5B45 /* DFGDominators.h in Headers */, + A3CA474E1BCD9DC9004C5B45 /* DFGDoubleFormatState.h in Headers */, + A3CA474F1BCD9DC9004C5B45 /* DFGDriver.h in Headers */, + A3CA47501BCD9DC9004C5B45 /* DFGEdge.h in Headers */, + A3CA47511BCD9DC9004C5B45 /* DFGEdgeDominates.h in Headers */, + A3CA47521BCD9DC9004C5B45 /* DFGEdgeUsesStructure.h in Headers */, + A3CA47531BCD9DC9004C5B45 /* DFGExitProfile.h in Headers */, + A3CA47541BCD9DC9004C5B45 /* DFGFailedFinalizer.h in Headers */, + A3CA47551BCD9DC9004C5B45 /* DFGFinalizer.h in Headers */, + A3CA47561BCD9DC9004C5B45 /* DFGFixupPhase.h in Headers */, + A3CA47571BCD9DC9004C5B45 /* DFGFlushedAt.h in Headers */, + A3CA47581BCD9DC9004C5B45 /* DFGFlushFormat.h in Headers */, + A3CA47591BCD9DC9004C5B45 /* DFGFlushLivenessAnalysisPhase.h in Headers */, + A3CA475A1BCD9DC9004C5B45 /* DFGGenerationInfo.h in Headers */, + A3CA475B1BCD9DC9004C5B45 /* DFGGraph.h in Headers */, + A3CA475C1BCD9DC9004C5B45 /* DFGInlineCacheWrapper.h in Headers */, + A3CA475D1BCD9DC9004C5B45 /* DFGInlineCacheWrapperInlines.h in Headers */, + A3CA475E1BCD9DC9004C5B45 /* DFGInPlaceAbstractState.h in Headers */, + A3CA475F1BCD9DC9004C5B45 /* DFGInsertionSet.h in Headers */, + A3CA47601BCD9DC9004C5B45 /* DFGInvalidationPointInjectionPhase.h in Headers */, + A3CA47611BCD9DC9004C5B45 /* DFGJITCode.h in Headers */, + A3CA47621BCD9DC9004C5B45 /* DFGJITCompiler.h in Headers */, + A3CA47631BCD9DC9004C5B45 /* DFGJITFinalizer.h in Headers */, + A3CA47641BCD9DC9004C5B45 /* DFGJumpReplacement.h in Headers */, + A3CA47651BCD9DC9004C5B45 /* DFGLazyJSValue.h in Headers */, + A3CA47661BCD9DC9004C5B45 /* DFGLICMPhase.h in Headers */, + A3CA47671BCD9DC9004C5B45 /* DFGLivenessAnalysisPhase.h in Headers */, + A3CA47681BCD9DC9004C5B45 /* DFGLongLivedState.h in Headers */, + A3CA47691BCD9DC9004C5B45 /* DFGLoopPreHeaderCreationPhase.h in Headers */, + A3CA476A1BCD9DC9004C5B45 /* DFGMergeMode.h in Headers */, + A3CA476B1BCD9DC9004C5B45 /* DFGMinifiedGraph.h in Headers */, + A3CA476C1BCD9DC9004C5B45 /* DFGMinifiedID.h in Headers */, + A3CA476D1BCD9DC9004C5B45 /* DFGMinifiedNode.h in Headers */, + A3CA476E1BCD9DC9004C5B45 /* DFGNaturalLoops.h in Headers */, + A3CA476F1BCD9DC9004C5B45 /* DFGNode.h in Headers */, + A3CA47701BCD9DC9004C5B45 /* DFGNodeAllocator.h in Headers */, + A3CA47711BCD9DC9004C5B45 /* DFGNodeFlags.h in Headers */, + A3CA47721BCD9DC9004C5B45 /* DFGNodeType.h in Headers */, + A3CA47731BCD9DC9004C5B45 /* DFGOperations.h in Headers */, + A3CA47741BCD9DC9004C5B45 /* DFGOSRAvailabilityAnalysisPhase.h in Headers */, + A3CA47751BCD9DC9004C5B45 /* DFGOSREntry.h in Headers */, + A3CA47761BCD9DC9004C5B45 /* DFGOSREntrypointCreationPhase.h in Headers */, + A3CA47771BCD9DC9004C5B45 /* DFGOSRExit.h in Headers */, + A3CA47781BCD9DC9004C5B45 /* ConstantMode.h in Headers */, + A3CA47791BCD9DC9004C5B45 /* DFGOSRExitBase.h in Headers */, + A3CA477A1BCD9DC9004C5B45 /* RemoteInspectorXPCConnection.h in Headers */, + A3CA477B1BCD9DC9004C5B45 /* DFGOSRExitCompilationInfo.h in Headers */, + A3CA477C1BCD9DC9004C5B45 /* DFGOSRExitCompiler.h in Headers */, + A3CA477D1BCD9DC9004C5B45 /* DFGOSRExitCompilerCommon.h in Headers */, + A3CA477E1BCD9DC9004C5B45 /* DFGOSRExitJumpPlaceholder.h in Headers */, + A3CA477F1BCD9DC9004C5B45 /* DFGOSRExitPreparation.h in Headers */, + A3CA47801BCD9DC9004C5B45 /* DFGPhase.h in Headers */, + A3CA47811BCD9DC9004C5B45 /* DFGPlan.h in Headers */, + A3CA47821BCD9DC9004C5B45 /* DFGPredictionInjectionPhase.h in Headers */, + A3CA47831BCD9DC9004C5B45 /* DFGPredictionPropagationPhase.h in Headers */, + A3CA47841BCD9DC9004C5B45 /* DFGRegisterBank.h in Headers */, + A3CA47851BCD9DC9004C5B45 /* DFGSafeToExecute.h in Headers */, + A3CA47861BCD9DC9004C5B45 /* DFGSaneStringGetByValSlowPathGenerator.h in Headers */, + A3CA47871BCD9DC9004C5B45 /* DFGScoreBoard.h in Headers */, + A3CA47881BCD9DC9004C5B45 /* DFGSilentRegisterSavePlan.h in Headers */, + A3CA47891BCD9DC9004C5B45 /* DFGSlowPathGenerator.h in Headers */, + A3CA478A1BCD9DC9004C5B45 /* DFGSpeculativeJIT.h in Headers */, + A3CA478B1BCD9DC9004C5B45 /* DFGSSAConversionPhase.h in Headers */, + A3CA478C1BCD9DC9004C5B45 /* DFGStackLayoutPhase.h in Headers */, + A3CA478D1BCD9DC9004C5B45 /* InspectorValues.h in Headers */, + A3CA478E1BCD9DC9004C5B45 /* DFGStructureAbstractValue.h in Headers */, + A3CA478F1BCD9DC9004C5B45 /* DFGThunks.h in Headers */, + A3CA47901BCD9DC9004C5B45 /* DFGTierUpCheckInjectionPhase.h in Headers */, + A3CA47911BCD9DC9004C5B45 /* DFGToFTLDeferredCompilationCallback.h in Headers */, + A3CA47921BCD9DC9004C5B45 /* VariableWatchpointSet.h in Headers */, + A3CA47931BCD9DC9004C5B45 /* DFGToFTLForOSREntryDeferredCompilationCallback.h in Headers */, + A3CA47941BCD9DC9004C5B45 /* DFGTypeCheckHoistingPhase.h in Headers */, + A3CA47951BCD9DC9004C5B45 /* DFGUnificationPhase.h in Headers */, + A3CA47961BCD9DC9004C5B45 /* DFGUseKind.h in Headers */, + A3CA47971BCD9DC9004C5B45 /* DFGValidate.h in Headers */, + A3CA47981BCD9DC9004C5B45 /* DFGValueRecoveryOverride.h in Headers */, + A3CA47991BCD9DC9004C5B45 /* DFGValueSource.h in Headers */, + A3CA479A1BCD9DC9004C5B45 /* DFGVariableAccessData.h in Headers */, + A3CA479B1BCD9DC9004C5B45 /* DFGVariableAccessDataDump.h in Headers */, + A3CA479C1BCD9DC9004C5B45 /* DFGVariableEvent.h in Headers */, + A3CA479D1BCD9DC9004C5B45 /* DFGVariableEventStream.h in Headers */, + A3CA479E1BCD9DC9004C5B45 /* DFGVariadicFunction.h in Headers */, + A3CA479F1BCD9DC9004C5B45 /* DFGVirtualRegisterAllocationPhase.h in Headers */, + A3CA47A01BCD9DC9004C5B45 /* DFGWatchpointCollectionPhase.h in Headers */, + A3CA47A11BCD9DC9004C5B45 /* DFGWorklist.h in Headers */, + A3CA47A21BCD9DC9004C5B45 /* Disassembler.h in Headers */, + A3CA47A31BCD9DC9004C5B45 /* DumpContext.h in Headers */, + A3CA47A41BCD9DC9004C5B45 /* Error.h in Headers */, + A3CA47A51BCD9DC9004C5B45 /* ErrorConstructor.h in Headers */, + A3CA47A61BCD9DC9004C5B45 /* ErrorInstance.h in Headers */, + A3CA47A71BCD9DC9004C5B45 /* ErrorPrototype.h in Headers */, + A3CA47A81BCD9DC9004C5B45 /* EvalCodeCache.h in Headers */, + A3CA47A91BCD9DC9004C5B45 /* ExceptionHelpers.h in Headers */, + A3CA47AA1BCD9DC9004C5B45 /* Executable.h in Headers */, + A3CA47AB1BCD9DC9004C5B45 /* ExecutableAllocator.h in Headers */, + A3CA47AC1BCD9DC9004C5B45 /* ExecutionCounter.h in Headers */, + A3CA47AD1BCD9DC9004C5B45 /* ExitKind.h in Headers */, + A3CA47AE1BCD9DC9004C5B45 /* ExpressionRangeInfo.h in Headers */, + A3CA47AF1BCD9DC9004C5B45 /* Float32Array.h in Headers */, + A3CA47B01BCD9DC9004C5B45 /* ScriptValue.h in Headers */, + A3CA47B11BCD9DC9004C5B45 /* Float64Array.h in Headers */, + A3CA47B21BCD9DC9004C5B45 /* FPRInfo.h in Headers */, + A3CA47B31BCD9DC9004C5B45 /* ArrayBufferNeuteringWatchpoint.h in Headers */, + A3CA47B41BCD9DC9004C5B45 /* FTLAbbreviatedTypes.h in Headers */, + A3CA47B51BCD9DC9004C5B45 /* FTLAbbreviations.h in Headers */, + A3CA47B61BCD9DC9004C5B45 /* FTLAbstractHeap.h in Headers */, + A3CA47B71BCD9DC9004C5B45 /* FTLAbstractHeapRepository.h in Headers */, + A3CA47B81BCD9DC9004C5B45 /* JSGlobalObjectDebuggable.h in Headers */, + A3CA47B91BCD9DC9004C5B45 /* FTLCapabilities.h in Headers */, + A3CA47BA1BCD9DC9004C5B45 /* FTLCommonValues.h in Headers */, + A3CA47BB1BCD9DC9004C5B45 /* FTLCompile.h in Headers */, + A3CA47BC1BCD9DC9004C5B45 /* FTLExitArgument.h in Headers */, + A3CA47BD1BCD9DC9004C5B45 /* FTLExitArgumentForOperand.h in Headers */, + A3CA47BE1BCD9DC9004C5B45 /* FTLExitArgumentList.h in Headers */, + A3CA47BF1BCD9DC9004C5B45 /* FTLExitThunkGenerator.h in Headers */, + A3CA47C01BCD9DC9004C5B45 /* FTLExitValue.h in Headers */, + A3CA47C11BCD9DC9004C5B45 /* FTLFail.h in Headers */, + A3CA47C21BCD9DC9004C5B45 /* FTLFormattedValue.h in Headers */, + A3CA47C31BCD9DC9004C5B45 /* FTLForOSREntryJITCode.h in Headers */, + A3CA47C41BCD9DC9004C5B45 /* FTLGeneratedFunction.h in Headers */, + A3CA47C51BCD9DC9004C5B45 /* FTLInlineCacheDescriptor.h in Headers */, + A3CA47C61BCD9DC9004C5B45 /* FTLInlineCacheSize.h in Headers */, + A3CA47C71BCD9DC9004C5B45 /* FTLIntrinsicRepository.h in Headers */, + A3CA47C81BCD9DC9004C5B45 /* FTLJITCode.h in Headers */, + A3CA47C91BCD9DC9004C5B45 /* FTLJITFinalizer.h in Headers */, + A3CA47CA1BCD9DC9004C5B45 /* FTLLink.h in Headers */, + A3CA47CB1BCD9DC9004C5B45 /* FTLLocation.h in Headers */, + A3CA47CC1BCD9DC9004C5B45 /* FTLLowerDFGToLLVM.h in Headers */, + A3CA47CD1BCD9DC9004C5B45 /* FTLLoweredNodeValue.h in Headers */, + A3CA47CE1BCD9DC9004C5B45 /* FTLOSREntry.h in Headers */, + A3CA47CF1BCD9DC9004C5B45 /* FTLOSRExit.h in Headers */, + A3CA47D01BCD9DC9004C5B45 /* FTLOSRExitCompilationInfo.h in Headers */, + A3CA47D11BCD9DC9004C5B45 /* FTLOSRExitCompiler.h in Headers */, + A3CA47D21BCD9DC9004C5B45 /* FTLOutput.h in Headers */, + A3CA47D31BCD9DC9004C5B45 /* FTLSaveRestore.h in Headers */, + A3CA47D41BCD9DC9004C5B45 /* FTLSlowPathCall.h in Headers */, + A3CA47D51BCD9DC9004C5B45 /* FTLSlowPathCallKey.h in Headers */, + A3CA47D61BCD9DC9004C5B45 /* FTLStackMaps.h in Headers */, + A3CA47D71BCD9DC9004C5B45 /* FTLState.h in Headers */, + A3CA47D81BCD9DC9004C5B45 /* FTLSwitchCase.h in Headers */, + A3CA47D91BCD9DC9004C5B45 /* FTLThunks.h in Headers */, + A3CA47DA1BCD9DC9004C5B45 /* FTLTypedPointer.h in Headers */, + A3CA47DB1BCD9DC9004C5B45 /* FTLValueFormat.h in Headers */, + A3CA47DC1BCD9DC9004C5B45 /* FTLValueFromBlock.h in Headers */, + A3CA47DD1BCD9DC9004C5B45 /* FunctionConstructor.h in Headers */, + A3CA47DE1BCD9DC9004C5B45 /* FunctionExecutableDump.h in Headers */, + A3CA47DF1BCD9DC9004C5B45 /* FunctionPrototype.h in Headers */, + A3CA47E01BCD9DC9004C5B45 /* GCActivityCallback.h in Headers */, + A3CA47E11BCD9DC9004C5B45 /* GCAssertions.h in Headers */, + A3CA47E21BCD9DC9004C5B45 /* GCAwareJITStubRoutine.h in Headers */, + A3CA47E31BCD9DC9004C5B45 /* GCIncomingRefCounted.h in Headers */, + A3CA47E41BCD9DC9004C5B45 /* GCIncomingRefCountedInlines.h in Headers */, + A3CA47E51BCD9DC9004C5B45 /* GCIncomingRefCountedSet.h in Headers */, + A3CA47E61BCD9DC9004C5B45 /* GCIncomingRefCountedSetInlines.h in Headers */, + A3CA47E71BCD9DC9004C5B45 /* GCThread.h in Headers */, + A3CA47E81BCD9DC9004C5B45 /* GCThreadSharedData.h in Headers */, + A3CA47E91BCD9DC9004C5B45 /* GenericTypedArrayView.h in Headers */, + A3CA47EA1BCD9DC9004C5B45 /* GenericTypedArrayViewInlines.h in Headers */, + A3CA47EB1BCD9DC9004C5B45 /* GetByIdStatus.h in Headers */, + A3CA47EC1BCD9DC9004C5B45 /* GPRInfo.h in Headers */, + A3CA47ED1BCD9DC9004C5B45 /* Handle.h in Headers */, + A3CA47EE1BCD9DC9004C5B45 /* HandleBlock.h in Headers */, + A3CA47EF1BCD9DC9004C5B45 /* HandleBlockInlines.h in Headers */, + A3CA47F01BCD9DC9004C5B45 /* HandlerInfo.h in Headers */, + A3CA47F11BCD9DC9004C5B45 /* HandleSet.h in Headers */, + A3CA47F21BCD9DC9004C5B45 /* HandleStack.h in Headers */, + A3CA47F31BCD9DC9004C5B45 /* HandleTypes.h in Headers */, + A3CA47F41BCD9DC9004C5B45 /* Heap.h in Headers */, + A3CA47F51BCD9DC9004C5B45 /* HeapBlock.h in Headers */, + A3CA47F61BCD9DC9004C5B45 /* HeapIterationScope.h in Headers */, + A3CA47F71BCD9DC9004C5B45 /* HeapOperation.h in Headers */, + A3CA47F81BCD9DC9004C5B45 /* HeapRootVisitor.h in Headers */, + A3CA47F91BCD9DC9004C5B45 /* HeapStatistics.h in Headers */, + A3CA47FA1BCD9DC9004C5B45 /* FullBytecodeLiveness.h in Headers */, + A3CA47FB1BCD9DC9004C5B45 /* HeapTimer.h in Headers */, + A3CA47FC1BCD9DC9004C5B45 /* HostCallReturnValue.h in Headers */, + A3CA47FD1BCD9DC9004C5B45 /* Identifier.h in Headers */, + A3CA47FE1BCD9DC9004C5B45 /* IncrementalSweeper.h in Headers */, + A3CA47FF1BCD9DC9004C5B45 /* IndexingHeader.h in Headers */, + A3CA48001BCD9DC9004C5B45 /* IndexingHeaderInlines.h in Headers */, + A3CA48011BCD9DC9004C5B45 /* IndexingType.h in Headers */, + A3CA48021BCD9DC9004C5B45 /* InitializeLLVM.h in Headers */, + A3CA48031BCD9DC9004C5B45 /* InitializeLLVMPOSIX.h in Headers */, + A3CA48041BCD9DC9004C5B45 /* InitializeThreading.h in Headers */, + A3CA48051BCD9DC9004C5B45 /* InlineCallFrameSet.h in Headers */, + A3CA48061BCD9DC9004C5B45 /* Instruction.h in Headers */, + A3CA48071BCD9DC9004C5B45 /* Int16Array.h in Headers */, + A3CA48081BCD9DC9004C5B45 /* Int32Array.h in Headers */, + A3CA48091BCD9DC9004C5B45 /* Int8Array.h in Headers */, + A3CA480A1BCD9DC9004C5B45 /* IntendedStructureChain.h in Headers */, + A3CA480B1BCD9DC9004C5B45 /* InternalFunction.h in Headers */, + A3CA480C1BCD9DC9004C5B45 /* Interpreter.h in Headers */, + A3CA480D1BCD9DC9004C5B45 /* Intrinsic.h in Headers */, + A3CA480E1BCD9DC9004C5B45 /* JavaScript.h in Headers */, + A3CA480F1BCD9DC9004C5B45 /* JavaScriptCore.h in Headers */, + A3CA48101BCD9DC9004C5B45 /* JavaScriptCorePrefix.h in Headers */, + A3CA48111BCD9DC9004C5B45 /* JIT.h in Headers */, + A3CA48121BCD9DC9004C5B45 /* JITCode.h in Headers */, + A3CA48131BCD9DC9004C5B45 /* JITCompilationEffort.h in Headers */, + A3CA48141BCD9DC9004C5B45 /* JITDisassembler.h in Headers */, + A3CA48151BCD9DC9004C5B45 /* RemoteInspectorDebuggable.h in Headers */, + A3CA48161BCD9DC9004C5B45 /* JITExceptions.h in Headers */, + A3CA48171BCD9DC9004C5B45 /* DFGStrengthReductionPhase.h in Headers */, + A3CA48181BCD9DC9004C5B45 /* JITInlineCacheGenerator.h in Headers */, + A3CA48191BCD9DC9004C5B45 /* JITInlines.h in Headers */, + A3CA481A1BCD9DC9004C5B45 /* JITOperations.h in Headers */, + A3CA481B1BCD9DC9004C5B45 /* JSSetIterator.h in Headers */, + A3CA481C1BCD9DC9004C5B45 /* JITOperationWrappers.h in Headers */, + A3CA481D1BCD9DC9004C5B45 /* JITStubRoutine.h in Headers */, + A3CA481E1BCD9DC9004C5B45 /* JITStubRoutineSet.h in Headers */, + A3CA481F1BCD9DC9004C5B45 /* JITStubs.h in Headers */, + A3CA48201BCD9DC9004C5B45 /* JITStubsARM.h in Headers */, + A3CA48211BCD9DC9004C5B45 /* JITStubsARMv7.h in Headers */, + A3CA48221BCD9DC9004C5B45 /* JITStubsX86.h in Headers */, + A3CA48231BCD9DC9004C5B45 /* JITStubsX86_64.h in Headers */, + A3CA48241BCD9DC9004C5B45 /* JITStubsX86Common.h in Headers */, + A3CA48251BCD9DC9004C5B45 /* JITThunks.h in Headers */, + A3CA48261BCD9DC9004C5B45 /* JITToDFGDeferredCompilationCallback.h in Headers */, + A3CA48271BCD9DC9004C5B45 /* JITWriteBarrier.h in Headers */, + A3CA48281BCD9DC9004C5B45 /* JSActivation.h in Headers */, + A3CA48291BCD9DC9004C5B45 /* JSAPIValueWrapper.h in Headers */, + A3CA482A1BCD9DC9004C5B45 /* JSAPIWrapperObject.h in Headers */, + A3CA482B1BCD9DC9004C5B45 /* JSArgumentsIterator.h in Headers */, + A3CA482C1BCD9DC9004C5B45 /* JSArray.h in Headers */, + A3CA482D1BCD9DC9004C5B45 /* JSArrayBuffer.h in Headers */, + A3CA482E1BCD9DC9004C5B45 /* JSArrayBufferConstructor.h in Headers */, + A3CA482F1BCD9DC9004C5B45 /* JSArrayBufferPrototype.h in Headers */, + A3CA48301BCD9DC9004C5B45 /* JSArrayBufferView.h in Headers */, + A3CA48311BCD9DC9004C5B45 /* JSArrayBufferViewInlines.h in Headers */, + A3CA48321BCD9DC9004C5B45 /* JSArrayIterator.h in Headers */, + A3CA48331BCD9DC9004C5B45 /* JSBase.h in Headers */, + A3CA48341BCD9DC9004C5B45 /* RecursiveAllocationScope.h in Headers */, + A3CA48351BCD9DC9004C5B45 /* JSBasePrivate.h in Headers */, + A3CA48361BCD9DC9004C5B45 /* JSBoundFunction.h in Headers */, + A3CA48371BCD9DC9004C5B45 /* JSCallbackConstructor.h in Headers */, + A3CA48381BCD9DC9004C5B45 /* JSCallbackFunction.h in Headers */, + A3CA48391BCD9DC9004C5B45 /* JSCallbackObject.h in Headers */, + A3CA483A1BCD9DC9004C5B45 /* JSCallbackObjectFunctions.h in Headers */, + A3CA483B1BCD9DC9004C5B45 /* JSCell.h in Headers */, + A3CA483C1BCD9DC9004C5B45 /* JSCellInlines.h in Headers */, + A3CA483D1BCD9DC9004C5B45 /* JSCJSValue.h in Headers */, + A3CA483E1BCD9DC9004C5B45 /* JSCJSValueInlines.h in Headers */, + A3CA483F1BCD9DC9004C5B45 /* JSClassRef.h in Headers */, + A3CA48401BCD9DC9004C5B45 /* JSContext.h in Headers */, + A3CA48411BCD9DC9004C5B45 /* JSContextInternal.h in Headers */, + A3CA48421BCD9DC9004C5B45 /* JSContextRef.h in Headers */, + A3CA48431BCD9DC9004C5B45 /* JSContextRefPrivate.h in Headers */, + A3CA48441BCD9DC9004C5B45 /* JSCTestRunnerUtils.h in Headers */, + A3CA48451BCD9DC9004C5B45 /* JSDataView.h in Headers */, + A3CA48461BCD9DC9004C5B45 /* JSDataViewPrototype.h in Headers */, + A3CA48471BCD9DC9004C5B45 /* JSDateMath.h in Headers */, + A3CA48481BCD9DC9004C5B45 /* JSDestructibleObject.h in Headers */, + A3CA48491BCD9DC9004C5B45 /* JSExport.h in Headers */, + A3CA484A1BCD9DC9004C5B45 /* JSExportMacros.h in Headers */, + A3CA484B1BCD9DC9004C5B45 /* JSFloat32Array.h in Headers */, + A3CA484C1BCD9DC9004C5B45 /* JSFloat64Array.h in Headers */, + A3CA484D1BCD9DC9004C5B45 /* JSFunction.h in Headers */, + A3CA484E1BCD9DC9004C5B45 /* JSFunctionInlines.h in Headers */, + A3CA484F1BCD9DC9004C5B45 /* JSGenericTypedArrayView.h in Headers */, + A3CA48501BCD9DC9004C5B45 /* JSGenericTypedArrayViewConstructor.h in Headers */, + A3CA48511BCD9DC9004C5B45 /* JSGenericTypedArrayViewConstructorInlines.h in Headers */, + A3CA48521BCD9DC9004C5B45 /* JSGenericTypedArrayViewInlines.h in Headers */, + A3CA48531BCD9DC9004C5B45 /* JSGenericTypedArrayViewPrototype.h in Headers */, + A3CA48541BCD9DC9004C5B45 /* JSGenericTypedArrayViewPrototypeInlines.h in Headers */, + A3CA48551BCD9DC9004C5B45 /* JSGlobalObject.h in Headers */, + A3CA48561BCD9DC9004C5B45 /* JSGlobalObjectFunctions.h in Headers */, + A3CA48571BCD9DC9004C5B45 /* JSInt16Array.h in Headers */, + A3CA48581BCD9DC9004C5B45 /* JSInt32Array.h in Headers */, + A3CA48591BCD9DC9004C5B45 /* JSInt8Array.h in Headers */, + A3CA485A1BCD9DC9004C5B45 /* JSInterfaceJIT.h in Headers */, + A3CA485B1BCD9DC9004C5B45 /* JSLock.h in Headers */, + A3CA485C1BCD9DC9004C5B45 /* JSManagedValue.h in Headers */, + A3CA485D1BCD9DC9004C5B45 /* JSMap.h in Headers */, + A3CA485E1BCD9DC9004C5B45 /* JSNameScope.h in Headers */, + A3CA485F1BCD9DC9004C5B45 /* JSObject.h in Headers */, + A3CA48601BCD9DC9004C5B45 /* JSObjectRef.h in Headers */, + A3CA48611BCD9DC9004C5B45 /* JSObjectRefPrivate.h in Headers */, + A3CA48621BCD9DC9004C5B45 /* JSONObject.h in Headers */, + A3CA48631BCD9DC9004C5B45 /* JSONObject.lut.h in Headers */, + A3CA48641BCD9DC9004C5B45 /* JSProfilerPrivate.h in Headers */, + A3CA48651BCD9DC9004C5B45 /* JSPromise.h in Headers */, + A3CA48661BCD9DC9004C5B45 /* JSPromiseConstructor.h in Headers */, + A3CA48671BCD9DC9004C5B45 /* JSPromisePrototype.h in Headers */, + A3CA48681BCD9DC9004C5B45 /* JSMapIterator.h in Headers */, + A3CA48691BCD9DC9004C5B45 /* JSProxy.h in Headers */, + A3CA486A1BCD9DC9004C5B45 /* JSRetainPtr.h in Headers */, + A3CA486B1BCD9DC9004C5B45 /* JSScope.h in Headers */, + A3CA486C1BCD9DC9004C5B45 /* JSScriptRefPrivate.h in Headers */, + A3CA486D1BCD9DC9004C5B45 /* JSSegmentedVariableObject.h in Headers */, + A3CA486E1BCD9DC9004C5B45 /* JSSet.h in Headers */, + A3CA486F1BCD9DC9004C5B45 /* JSStack.h in Headers */, + A3CA48701BCD9DC9004C5B45 /* JSStackInlines.h in Headers */, + A3CA48711BCD9DC9004C5B45 /* JSString.h in Headers */, + A3CA48721BCD9DC9004C5B45 /* JSStringBuilder.h in Headers */, + A3CA48731BCD9DC9004C5B45 /* JSStringJoiner.h in Headers */, + A3CA48741BCD9DC9004C5B45 /* JSStringRef.h in Headers */, + A3CA48751BCD9DC9004C5B45 /* JSStringRefCF.h in Headers */, + A3CA48761BCD9DC9004C5B45 /* JSStringRefPrivate.h in Headers */, + A3CA48771BCD9DC9004C5B45 /* JSSymbolTableObject.h in Headers */, + A3CA48781BCD9DC9004C5B45 /* JSType.h in Headers */, + A3CA48791BCD9DC9004C5B45 /* JSTypedArrayConstructors.h in Headers */, + A3CA487A1BCD9DC9004C5B45 /* JSTypedArrayPrototypes.h in Headers */, + A3CA487B1BCD9DC9004C5B45 /* JSTypedArrays.h in Headers */, + A3CA487C1BCD9DC9004C5B45 /* JSTypeInfo.h in Headers */, + A3CA487D1BCD9DC9004C5B45 /* JSUint16Array.h in Headers */, + A3CA487E1BCD9DC9004C5B45 /* JSUint32Array.h in Headers */, + A3CA487F1BCD9DC9004C5B45 /* JSUint8Array.h in Headers */, + A3CA48801BCD9DC9004C5B45 /* JSUint8ClampedArray.h in Headers */, + A3CA48811BCD9DC9004C5B45 /* JSValue.h in Headers */, + A3CA48821BCD9DC9004C5B45 /* JSValueInternal.h in Headers */, + A3CA48831BCD9DC9004C5B45 /* JSValueRef.h in Headers */, + A3CA48841BCD9DC9004C5B45 /* JSVariableObject.h in Headers */, + A3CA48851BCD9DC9004C5B45 /* JSVirtualMachine.h in Headers */, + A3CA48861BCD9DC9004C5B45 /* JSVirtualMachineInternal.h in Headers */, + A3CA48871BCD9DC9004C5B45 /* JSWeakMap.h in Headers */, + A3CA48881BCD9DC9004C5B45 /* JSWeakObjectMapRefInternal.h in Headers */, + A3CA48891BCD9DC9004C5B45 /* JSWeakObjectMapRefPrivate.h in Headers */, + A3CA488A1BCD9DC9004C5B45 /* JSWithScope.h in Headers */, + A3CA488B1BCD9DC9004C5B45 /* JSWrapperMap.h in Headers */, + A3CA488C1BCD9DC9004C5B45 /* JSWrapperObject.h in Headers */, + A3CA488D1BCD9DC9004C5B45 /* JumpTable.h in Headers */, + A3CA488E1BCD9DC9004C5B45 /* MapIteratorPrototype.h in Headers */, + A3CA488F1BCD9DC9004C5B45 /* KeywordLookup.h in Headers */, + A3CA48901BCD9DC9004C5B45 /* Label.h in Headers */, + A3CA48911BCD9DC9004C5B45 /* LabelScope.h in Headers */, + A3CA48921BCD9DC9004C5B45 /* LazyOperandValueProfile.h in Headers */, + A3CA48931BCD9DC9004C5B45 /* LegacyProfiler.h in Headers */, + A3CA48941BCD9DC9004C5B45 /* Lexer.h in Headers */, + A3CA48951BCD9DC9004C5B45 /* Lexer.lut.h in Headers */, + A3CA48961BCD9DC9004C5B45 /* LineInfo.h in Headers */, + A3CA48971BCD9DC9004C5B45 /* LinkBuffer.h in Headers */, + A3CA48981BCD9DC9004C5B45 /* ListableHandler.h in Headers */, + A3CA48991BCD9DC9004C5B45 /* LiteralParser.h in Headers */, + A3CA489A1BCD9DC9004C5B45 /* LLIntCallLinkInfo.h in Headers */, + A3CA489B1BCD9DC9004C5B45 /* LLIntCLoop.h in Headers */, + A3CA489C1BCD9DC9004C5B45 /* LLIntCommon.h in Headers */, + A3CA489D1BCD9DC9004C5B45 /* LLIntData.h in Headers */, + A3CA489E1BCD9DC9004C5B45 /* LLIntEntrypoint.h in Headers */, + A3CA489F1BCD9DC9004C5B45 /* LLIntExceptions.h in Headers */, + A3CA48A01BCD9DC9004C5B45 /* LLIntOfflineAsmConfig.h in Headers */, + A3CA48A11BCD9DC9004C5B45 /* LLIntOpcode.h in Headers */, + A3CA48A21BCD9DC9004C5B45 /* JSPromiseDeferred.h in Headers */, + A3CA48A31BCD9DC9004C5B45 /* LLIntSlowPaths.h in Headers */, + A3CA48A41BCD9DC9004C5B45 /* LLIntThunks.h in Headers */, + A3CA48A51BCD9DC9004C5B45 /* LLVMAPI.h in Headers */, + A3CA48A61BCD9DC9004C5B45 /* LLVMAPIFunctions.h in Headers */, + A3CA48A71BCD9DC9004C5B45 /* LLVMDisassembler.h in Headers */, + A3CA48A81BCD9DC9004C5B45 /* LLVMHeaders.h in Headers */, + A3CA48A91BCD9DC9004C5B45 /* Local.h in Headers */, + A3CA48AA1BCD9DC9004C5B45 /* LocalScope.h in Headers */, + A3CA48AB1BCD9DC9004C5B45 /* Lookup.h in Headers */, + A3CA48AC1BCD9DC9004C5B45 /* LowLevelInterpreter.h in Headers */, + A3CA48AD1BCD9DC9004C5B45 /* MachineStackMarker.h in Headers */, + A3CA48AE1BCD9DC9004C5B45 /* MacroAssembler.h in Headers */, + A3CA48AF1BCD9DC9004C5B45 /* MacroAssemblerARM.h in Headers */, + A3CA48B01BCD9DC9004C5B45 /* MacroAssemblerARMv7.h in Headers */, + A3CA48B11BCD9DC9004C5B45 /* MacroAssemblerCodeRef.h in Headers */, + A3CA48B21BCD9DC9004C5B45 /* MacroAssemblerMIPS.h in Headers */, + A3CA48B31BCD9DC9004C5B45 /* MacroAssemblerSH4.h in Headers */, + A3CA48B41BCD9DC9004C5B45 /* MacroAssemblerX86.h in Headers */, + A3CA48B51BCD9DC9004C5B45 /* MacroAssemblerX86_64.h in Headers */, + A3CA48B61BCD9DC9004C5B45 /* MacroAssemblerX86Common.h in Headers */, + A3CA48B71BCD9DC9004C5B45 /* MapConstructor.h in Headers */, + A3CA48B81BCD9DC9004C5B45 /* MapData.h in Headers */, + A3CA48B91BCD9DC9004C5B45 /* MapPrototype.h in Headers */, + A3CA48BA1BCD9DC9004C5B45 /* MarkedAllocator.h in Headers */, + A3CA48BB1BCD9DC9004C5B45 /* MarkedBlock.h in Headers */, + A3CA48BC1BCD9DC9004C5B45 /* MarkedBlockSet.h in Headers */, + A3CA48BD1BCD9DC9004C5B45 /* MarkedSpace.h in Headers */, + A3CA48BE1BCD9DC9004C5B45 /* MarkStack.h in Headers */, + A3CA48BF1BCD9DC9004C5B45 /* MarkStackInlines.h in Headers */, + A3CA48C01BCD9DC9004C5B45 /* InspectorFrontendChannel.h in Headers */, + A3CA48C11BCD9DC9004C5B45 /* MatchResult.h in Headers */, + A3CA48C21BCD9DC9004C5B45 /* MathObject.h in Headers */, + A3CA48C31BCD9DC9004C5B45 /* MemoryStatistics.h in Headers */, + A3CA48C41BCD9DC9004C5B45 /* MethodOfGettingAValueProfile.h in Headers */, + A3CA48C51BCD9DC9004C5B45 /* MIPSAssembler.h in Headers */, + A3CA48C61BCD9DC9004C5B45 /* NameConstructor.h in Headers */, + A3CA48C71BCD9DC9004C5B45 /* SetIteratorPrototype.h in Headers */, + A3CA48C81BCD9DC9004C5B45 /* NameInstance.h in Headers */, + A3CA48C91BCD9DC9004C5B45 /* NamePrototype.h in Headers */, + A3CA48CA1BCD9DC9004C5B45 /* NativeErrorConstructor.h in Headers */, + A3CA48CB1BCD9DC9004C5B45 /* NativeErrorPrototype.h in Headers */, + A3CA48CC1BCD9DC9004C5B45 /* NodeConstructors.h in Headers */, + A3CA48CD1BCD9DC9004C5B45 /* NodeInfo.h in Headers */, + A3CA48CE1BCD9DC9004C5B45 /* Nodes.h in Headers */, + A3CA48CF1BCD9DC9004C5B45 /* NumberConstructor.h in Headers */, + A3CA48D01BCD9DC9004C5B45 /* NumberConstructor.lut.h in Headers */, + A3CA48D11BCD9DC9004C5B45 /* NumberObject.h in Headers */, + A3CA48D21BCD9DC9004C5B45 /* NumberPrototype.h in Headers */, + A3CA48D31BCD9DC9004C5B45 /* NumericStrings.h in Headers */, + A3CA48D41BCD9DC9004C5B45 /* ObjCCallbackFunction.h in Headers */, + A3CA48D51BCD9DC9004C5B45 /* ObjcRuntimeExtras.h in Headers */, + A3CA48D61BCD9DC9004C5B45 /* ObjectAllocationProfile.h in Headers */, + A3CA48D71BCD9DC9004C5B45 /* ObjectConstructor.h in Headers */, + A3CA48D81BCD9DC9004C5B45 /* ObjectPrototype.h in Headers */, + A3CA48D91BCD9DC9004C5B45 /* OpaqueJSString.h in Headers */, + A3CA48DA1BCD9DC9004C5B45 /* Opcode.h in Headers */, + A3CA48DB1BCD9DC9004C5B45 /* Operands.h in Headers */, + A3CA48DC1BCD9DC9004C5B45 /* ARM64Assembler.h in Headers */, + A3CA48DD1BCD9DC9004C5B45 /* OperandsInlines.h in Headers */, + A3CA48DE1BCD9DC9004C5B45 /* Operations.h in Headers */, + A3CA48DF1BCD9DC9004C5B45 /* Options.h in Headers */, + A3CA48E01BCD9DC9004C5B45 /* Parser.h in Headers */, + A3CA48E11BCD9DC9004C5B45 /* ParserArena.h in Headers */, + A3CA48E21BCD9DC9004C5B45 /* ParserError.h in Headers */, + A3CA48E31BCD9DC9004C5B45 /* ParserModes.h in Headers */, + A3CA48E41BCD9DC9004C5B45 /* ParserTokens.h in Headers */, + A3CA48E51BCD9DC9004C5B45 /* PolymorphicAccessStructureList.h in Headers */, + A3CA48E61BCD9DC9004C5B45 /* PolymorphicPutByIdList.h in Headers */, + A3CA48E71BCD9DC9004C5B45 /* PreciseJumpTargets.h in Headers */, + A3CA48E81BCD9DC9004C5B45 /* PrivateName.h in Headers */, + A3CA48E91BCD9DC9004C5B45 /* Profile.h in Headers */, + A3CA48EA1BCD9DC9004C5B45 /* ProfiledCodeBlockJettisoningWatchpoint.h in Headers */, + A3CA48EB1BCD9DC9004C5B45 /* ProfileGenerator.h in Headers */, + A3CA48EC1BCD9DC9004C5B45 /* ProfileNode.h in Headers */, + A3CA48ED1BCD9DC9004C5B45 /* ProfilerBytecode.h in Headers */, + A3CA48EE1BCD9DC9004C5B45 /* BytecodeLivenessAnalysisInlines.h in Headers */, + A3CA48EF1BCD9DC9004C5B45 /* ProfilerBytecodes.h in Headers */, + A3CA48F01BCD9DC9004C5B45 /* ProfilerBytecodeSequence.h in Headers */, + A3CA48F11BCD9DC9004C5B45 /* ProfilerCompilation.h in Headers */, + A3CA48F21BCD9DC9004C5B45 /* ProfilerCompilationKind.h in Headers */, + A3CA48F31BCD9DC9004C5B45 /* ProfilerCompiledBytecode.h in Headers */, + A3CA48F41BCD9DC9004C5B45 /* ProfilerDatabase.h in Headers */, + A3CA48F51BCD9DC9004C5B45 /* ProfilerExecutionCounter.h in Headers */, + A3CA48F61BCD9DC9004C5B45 /* ProfilerOrigin.h in Headers */, + A3CA48F71BCD9DC9004C5B45 /* ProfilerOriginStack.h in Headers */, + A3CA48F81BCD9DC9004C5B45 /* ProfilerOSRExit.h in Headers */, + A3CA48F91BCD9DC9004C5B45 /* ProfilerOSRExitSite.h in Headers */, + A3CA48FA1BCD9DC9004C5B45 /* ProfilerProfiledBytecodes.h in Headers */, + A3CA48FB1BCD9DC9004C5B45 /* PropertyDescriptor.h in Headers */, + A3CA48FC1BCD9DC9004C5B45 /* PropertyMapHashTable.h in Headers */, + A3CA48FD1BCD9DC9004C5B45 /* PropertyName.h in Headers */, + A3CA48FE1BCD9DC9004C5B45 /* PropertyNameArray.h in Headers */, + A3CA48FF1BCD9DC9004C5B45 /* PropertyOffset.h in Headers */, + A3CA49001BCD9DC9004C5B45 /* PropertySlot.h in Headers */, + A3CA49011BCD9DC9004C5B45 /* PropertyStorage.h in Headers */, + A3CA49021BCD9DC9004C5B45 /* Protect.h in Headers */, + A3CA49031BCD9DC9004C5B45 /* PrototypeMap.h in Headers */, + A3CA49041BCD9DC9004C5B45 /* PutByIdStatus.h in Headers */, + A3CA49051BCD9DC9004C5B45 /* PutDirectIndexMode.h in Headers */, + A3CA49061BCD9DC9004C5B45 /* Microtask.h in Headers */, + A3CA49071BCD9DC9004C5B45 /* PutKind.h in Headers */, + A3CA49081BCD9DC9004C5B45 /* PutPropertySlot.h in Headers */, + A3CA49091BCD9DC9004C5B45 /* InspectorBackendDispatcher.h in Headers */, + A3CA490A1BCD9DC9004C5B45 /* ReduceWhitespace.h in Headers */, + A3CA490B1BCD9DC9004C5B45 /* RegExp.h in Headers */, + A3CA490C1BCD9DC9004C5B45 /* RegExpCache.h in Headers */, + A3CA490D1BCD9DC9004C5B45 /* RegExpConstructor.h in Headers */, + A3CA490E1BCD9DC9004C5B45 /* JSPromiseReaction.h in Headers */, + A3CA490F1BCD9DC9004C5B45 /* RegExpConstructor.lut.h in Headers */, + A3CA49101BCD9DC9004C5B45 /* RegExpKey.h in Headers */, + A3CA49111BCD9DC9004C5B45 /* StackAlignment.h in Headers */, + A3CA49121BCD9DC9004C5B45 /* RegExpObject.h in Headers */, + A3CA49131BCD9DC9004C5B45 /* RegExpObject.lut.h in Headers */, + A3CA49141BCD9DC9004C5B45 /* RegExpPrototype.h in Headers */, + A3CA49151BCD9DC9004C5B45 /* Region.h in Headers */, + A3CA49161BCD9DC9004C5B45 /* Register.h in Headers */, + A3CA49171BCD9DC9004C5B45 /* RegisterID.h in Headers */, + A3CA49181BCD9DC9004C5B45 /* RegisterSet.h in Headers */, + A3CA49191BCD9DC9004C5B45 /* Reject.h in Headers */, + A3CA491A1BCD9DC9004C5B45 /* Repatch.h in Headers */, + A3CA491B1BCD9DC9004C5B45 /* RepatchBuffer.h in Headers */, + A3CA491C1BCD9DC9004C5B45 /* ResultType.h in Headers */, + A3CA491D1BCD9DC9004C5B45 /* SamplingCounter.h in Headers */, + A3CA491E1BCD9DC9004C5B45 /* SamplingTool.h in Headers */, + A3CA491F1BCD9DC9004C5B45 /* ScratchRegisterAllocator.h in Headers */, + A3CA49201BCD9DC9004C5B45 /* DelayedReleaseScope.h in Headers */, + A3CA49211BCD9DC9004C5B45 /* SetConstructor.h in Headers */, + A3CA49221BCD9DC9004C5B45 /* SetPrototype.h in Headers */, + A3CA49231BCD9DC9004C5B45 /* SH4Assembler.h in Headers */, + A3CA49241BCD9DC9004C5B45 /* SimpleTypedArrayController.h in Headers */, + A3CA49251BCD9DC9004C5B45 /* JSPromiseFunctions.h in Headers */, + A3CA49261BCD9DC9004C5B45 /* SetIteratorConstructor.h in Headers */, + A3CA49271BCD9DC9004C5B45 /* SlotVisitor.h in Headers */, + A3CA49281BCD9DC9004C5B45 /* SlotVisitorInlines.h in Headers */, + A3CA49291BCD9DC9004C5B45 /* SlowPathCall.h in Headers */, + A3CA492A1BCD9DC9004C5B45 /* SmallStrings.h in Headers */, + A3CA492B1BCD9DC9004C5B45 /* SourceCode.h in Headers */, + A3CA492C1BCD9DC9004C5B45 /* SourceProvider.h in Headers */, + A3CA492D1BCD9DC9004C5B45 /* SourceProviderCache.h in Headers */, + A3CA492E1BCD9DC9004C5B45 /* SourceProviderCacheItem.h in Headers */, + A3CA492F1BCD9DC9004C5B45 /* SparseArrayValueMap.h in Headers */, + A3CA49301BCD9DC9004C5B45 /* SpecializedThunkJIT.h in Headers */, + A3CA49311BCD9DC9004C5B45 /* SpecialPointer.h in Headers */, + A3CA49321BCD9DC9004C5B45 /* SpeculatedType.h in Headers */, + A3CA49331BCD9DC9004C5B45 /* StackVisitor.h in Headers */, + A3CA49341BCD9DC9004C5B45 /* StaticPropertyAnalysis.h in Headers */, + A3CA49351BCD9DC9004C5B45 /* ScriptObject.h in Headers */, + A3CA49361BCD9DC9004C5B45 /* StaticPropertyAnalyzer.h in Headers */, + A3CA49371BCD9DC9004C5B45 /* StrictEvalActivation.h in Headers */, + A3CA49381BCD9DC9004C5B45 /* StringConstructor.h in Headers */, + A3CA49391BCD9DC9004C5B45 /* StringObject.h in Headers */, + A3CA493A1BCD9DC9004C5B45 /* StringPrototype.h in Headers */, + A3CA493B1BCD9DC9004C5B45 /* Strong.h in Headers */, + A3CA493C1BCD9DC9004C5B45 /* StrongInlines.h in Headers */, + A3CA493D1BCD9DC9004C5B45 /* Structure.h in Headers */, + A3CA493E1BCD9DC9004C5B45 /* StructureChain.h in Headers */, + A3CA493F1BCD9DC9004C5B45 /* StructureInlines.h in Headers */, + A3CA49401BCD9DC9004C5B45 /* StructureRareData.h in Headers */, + A3CA49411BCD9DC9004C5B45 /* StructureRareDataInlines.h in Headers */, + A3CA49421BCD9DC9004C5B45 /* StructureSet.h in Headers */, + A3CA49431BCD9DC9004C5B45 /* StructureStubClearingWatchpoint.h in Headers */, + A3CA49441BCD9DC9004C5B45 /* StructureStubInfo.h in Headers */, + A3CA49451BCD9DC9004C5B45 /* StructureTransitionTable.h in Headers */, + A3CA49461BCD9DC9004C5B45 /* SuperRegion.h in Headers */, + A3CA49471BCD9DC9004C5B45 /* SymbolTable.h in Headers */, + A3CA49481BCD9DC9004C5B45 /* SyntaxChecker.h in Headers */, + A3CA49491BCD9DC9004C5B45 /* TestRunnerUtils.h in Headers */, + A3CA494A1BCD9DC9004C5B45 /* ThunkGenerator.h in Headers */, + A3CA494B1BCD9DC9004C5B45 /* ThunkGenerators.h in Headers */, + A3CA494C1BCD9DC9004C5B45 /* TinyBloomFilter.h in Headers */, + A3CA494D1BCD9DC9004C5B45 /* ToNativeFromValue.h in Headers */, + A3CA494E1BCD9DC9004C5B45 /* Tracing.h in Headers */, + A3CA494F1BCD9DC9004C5B45 /* TypedArrayAdaptors.h in Headers */, + A3CA49501BCD9DC9004C5B45 /* TypedArrayController.h in Headers */, + A3CA49511BCD9DC9004C5B45 /* TypedArrayInlines.h in Headers */, + A3CA49521BCD9DC9004C5B45 /* TypedArrays.h in Headers */, + A3CA49531BCD9DC9004C5B45 /* TypedArrayType.h in Headers */, + A3CA49541BCD9DC9004C5B45 /* udis86.h in Headers */, + A3CA49551BCD9DC9004C5B45 /* udis86_decode.h in Headers */, + A3CA49561BCD9DC9004C5B45 /* udis86_extern.h in Headers */, + A3CA49571BCD9DC9004C5B45 /* udis86_input.h in Headers */, + A3CA49581BCD9DC9004C5B45 /* udis86_syn.h in Headers */, + A3CA49591BCD9DC9004C5B45 /* udis86_types.h in Headers */, + A3CA495A1BCD9DC9004C5B45 /* UDis86Disassembler.h in Headers */, + A3CA495B1BCD9DC9004C5B45 /* Uint16Array.h in Headers */, + A3CA495C1BCD9DC9004C5B45 /* Uint16WithFraction.h in Headers */, + A3CA495D1BCD9DC9004C5B45 /* Uint32Array.h in Headers */, + A3CA495E1BCD9DC9004C5B45 /* Uint8Array.h in Headers */, + A3CA495F1BCD9DC9004C5B45 /* Uint8ClampedArray.h in Headers */, + A3CA49601BCD9DC9004C5B45 /* UnconditionalFinalizer.h in Headers */, + A3CA49611BCD9DC9004C5B45 /* DFGAvailability.h in Headers */, + A3CA49621BCD9DC9004C5B45 /* UnlinkedCodeBlock.h in Headers */, + A3CA49631BCD9DC9004C5B45 /* UnusedPointer.h in Headers */, + A3CA49641BCD9DC9004C5B45 /* ValueProfile.h in Headers */, + A3CA49651BCD9DC9004C5B45 /* ValueRecovery.h in Headers */, + A3CA49661BCD9DC9004C5B45 /* VirtualRegister.h in Headers */, + A3CA49671BCD9DC9004C5B45 /* VM.h in Headers */, + A3CA49681BCD9DC9004C5B45 /* VMInspector.h in Headers */, + A3CA49691BCD9DC9004C5B45 /* InjectedScriptSource.h in Headers */, + A3CA496A1BCD9DC9004C5B45 /* Watchdog.h in Headers */, + A3CA496B1BCD9DC9004C5B45 /* Watchpoint.h in Headers */, + A3CA496C1BCD9DC9004C5B45 /* Weak.h in Headers */, + A3CA496D1BCD9DC9004C5B45 /* WeakBlock.h in Headers */, + A3CA496E1BCD9DC9004C5B45 /* WeakGCMap.h in Headers */, + A3CA496F1BCD9DC9004C5B45 /* RemoteInspector.h in Headers */, + A3CA49701BCD9DC9004C5B45 /* WeakHandleOwner.h in Headers */, + A3CA49711BCD9DC9004C5B45 /* WeakImpl.h in Headers */, + A3CA49721BCD9DC9004C5B45 /* WeakInlines.h in Headers */, + A3CA49731BCD9DC9004C5B45 /* WeakMapConstructor.h in Headers */, + A3CA49741BCD9DC9004C5B45 /* WeakMapData.h in Headers */, + A3CA49751BCD9DC9004C5B45 /* DFGStoreBarrierElisionPhase.h in Headers */, + A3CA49761BCD9DC9004C5B45 /* InspectorTypeBuilder.h in Headers */, + A3CA49771BCD9DC9004C5B45 /* WeakMapPrototype.h in Headers */, + A3CA49781BCD9DC9004C5B45 /* WeakRandom.h in Headers */, + A3CA49791BCD9DC9004C5B45 /* WeakReferenceHarvester.h in Headers */, + A3CA497A1BCD9DC9004C5B45 /* WeakSet.h in Headers */, + A3CA497B1BCD9DC9004C5B45 /* WeakSetInlines.h in Headers */, + A3CA497C1BCD9DC9004C5B45 /* WebKitAvailability.h in Headers */, + A3CA497D1BCD9DC9004C5B45 /* MapIteratorConstructor.h in Headers */, + A3CA497E1BCD9DC9004C5B45 /* WriteBarrier.h in Headers */, + A3CA497F1BCD9DC9004C5B45 /* WriteBarrierSupport.h in Headers */, + A3CA49801BCD9DC9004C5B45 /* X86Assembler.h in Headers */, + A3CA49811BCD9DC9004C5B45 /* Yarr.h in Headers */, + A3CA49821BCD9DC9004C5B45 /* DFGResurrectionForValidationPhase.h in Headers */, + A3CA49831BCD9DC9004C5B45 /* YarrInterpreter.h in Headers */, + A3CA49841BCD9DC9004C5B45 /* ScriptFunctionCall.h in Headers */, + A3CA49851BCD9DC9004C5B45 /* YarrJIT.h in Headers */, + A3CA49861BCD9DC9004C5B45 /* YarrParser.h in Headers */, + A3CA49871BCD9DC9004C5B45 /* YarrPattern.h in Headers */, + A3CA49881BCD9DC9004C5B45 /* YarrSyntaxChecker.h in Headers */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; /* End PBXHeadersBuildPhase section */ /* Begin PBXNativeTarget section */ @@ -7252,6 +9209,31 @@ productReference = 932F5BE10822A1C700736975 /* jsc */; productType = "com.apple.product-type.tool"; }; + A3CA46B11BCD9DC9004C5B45 /* JavaScriptCore tvOS */ = { + isa = PBXNativeTarget; + buildConfigurationList = A3CA4B731BCD9DC9004C5B45 /* Build configuration list for PBXNativeTarget "JavaScriptCore tvOS" */; + buildPhases = ( + A3CA46B41BCD9DC9004C5B45 /* Update Info.plist with version information */, + A3CA46B51BCD9DC9004C5B45 /* Headers */, + A3CA49891BCD9DC9004C5B45 /* Postprocess Headers */, + A3CA498A1BCD9DC9004C5B45 /* Sources */, + A3CA4B6B1BCD9DC9004C5B45 /* Frameworks */, + A3CA4B6F1BCD9DC9004C5B45 /* Copy LLVM Library Into Framework */, + A3CA4B701BCD9DC9004C5B45 /* Check For Weak VTables and Externals */, + A3CA4B711BCD9DC9004C5B45 /* Check For Inappropriate Objective-C Class Names */, + A3CA4B721BCD9DC9004C5B45 /* Check For Inappropriate Macros in External Headers */, + ); + buildRules = ( + ); + dependencies = ( + A3CA46B21BCD9DC9004C5B45 /* PBXTargetDependency */, + ); + name = "JavaScriptCore tvOS"; + productInstallPath = "${SYSTEM_LIBRARY_DIR}/Frameworks/WebKit.framework/Versions/A/Frameworks"; + productName = JavaScriptCore; + productReference = A3CA4B781BCD9DC9004C5B45 /* libJavaScriptCore-tvOS.a */; + productType = "com.apple.product-type.library.static"; + }; /* End PBXNativeTarget section */ /* Begin PBXProject section */ @@ -7291,6 +9273,7 @@ 10D58E011889C1A000C05A0D /* JSCLLIntOffsetsExtractor iOS */, 10D58E0D1889C3DF00C05A0D /* JavaScriptCore iOS */, 10D592F61889C55E00C05A0D /* Derived Sources iOS */, + A3CA46B11BCD9DC9004C5B45 /* JavaScriptCore tvOS */, ); }; /* End PBXProject section */ @@ -7579,6 +9562,101 @@ shellPath = /bin/sh; shellScript = "mkdir -p \"${BUILT_PRODUCTS_DIR}/DerivedSources/JavaScriptCore\"\ncd \"${BUILT_PRODUCTS_DIR}/DerivedSources/JavaScriptCore\"\n\n/bin/ln -sfh \"${SRCROOT}\" JavaScriptCore\nexport JavaScriptCore=\"JavaScriptCore\"\nexport BUILT_PRODUCTS_DIR=\"../..\"\n\nmake --no-builtin-rules -f \"JavaScriptCore/DerivedSources.make\" -j `/usr/sbin/sysctl -n hw.ncpu` || exit 1\n\nif [[ \"${ACTION}\" == \"installhdrs\" ]]; then\n exit 0\nfi\n\n/usr/bin/env ruby JavaScriptCore/offlineasm/asm.rb JavaScriptCore/llint/LowLevelInterpreter.asm ${BUILT_PRODUCTS_DIR}/JSCLLIntOffsetsExtractor LLIntAssembly.h || exit 1\n"; }; + A3CA46B41BCD9DC9004C5B45 /* Update Info.plist with version information */ = { + isa = PBXShellScriptBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + inputPaths = ( + "$(SRCROOT)/Configurations/Version.xcconfig", + ); + name = "Update Info.plist with version information"; + outputPaths = ( + "$(SRCROOT)/Info.plist", + ); + runOnlyForDeploymentPostprocessing = 0; + shellPath = /bin/sh; + shellScript = "# Touch Info.plist to let Xcode know it needs to copy it into the built product\nif [[ \"${CONFIGURATION}\" != \"Production\" ]]; then\n touch \"$SRCROOT/Info.plist\";\nfi;\n"; + }; + A3CA49891BCD9DC9004C5B45 /* Postprocess Headers */ = { + isa = PBXShellScriptBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + inputPaths = ( + "$(TARGET_BUILD_DIR)/$(PUBLIC_HEADERS_FOLDER_PATH)/JSBase.h", + "$(TARGET_BUILD_DIR)/$(PUBLIC_HEADERS_FOLDER_PATH)/JSContext.h", + "$(TARGET_BUILD_DIR)/$(PUBLIC_HEADERS_FOLDER_PATH)/JSManagedValue.h", + "$(TARGET_BUILD_DIR)/$(PUBLIC_HEADERS_FOLDER_PATH)/JSValue.h", + "$(TARGET_BUILD_DIR)/$(PUBLIC_HEADERS_FOLDER_PATH)/JSVirtualMachine.h", + ); + name = "Postprocess Headers"; + outputPaths = ( + ); + runOnlyForDeploymentPostprocessing = 0; + shellPath = /bin/sh; + shellScript = "cd \"${TARGET_BUILD_DIR}/${PUBLIC_HEADERS_FOLDER_PATH}\"\n\nif [[ ${TARGET_MAC_OS_X_VERSION_MAJOR} == \"1080\" ]]; then\n UNIFDEF_OPTION=\"-DJSC_OBJC_API_AVAILABLE_MAC_OS_X_1080\";\nelse\n UNIFDEF_OPTION=\"-UJSC_OBJC_API_AVAILABLE_MAC_OS_X_1080\";\nfi\n\nfor HEADER in JSBase.h JSContext.h JSManagedValue.h JSValue.h JSVirtualMachine.h; do\n unifdef -B ${UNIFDEF_OPTION} -o ${HEADER}.unifdef ${HEADER}\n case $? in\n 0)\n rm ${HEADER}.unifdef\n ;;\n 1)\n mv ${HEADER}{.unifdef,}\n ;;\n *)\n exit 1\n esac\ndone\n"; + }; + A3CA4B6F1BCD9DC9004C5B45 /* Copy LLVM Library Into Framework */ = { + isa = PBXShellScriptBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + inputPaths = ( + "$(BUILT_PRODUCTS_DIR)/libllvmForJSC.dylib", + ); + name = "Copy LLVM Library Into Framework"; + outputPaths = ( + ); + runOnlyForDeploymentPostprocessing = 0; + shellPath = /bin/sh; + shellScript = "if [[ $ENABLE_FTL_JIT != \"ENABLE_FTL_JIT\" ]]\nthen\n exit 0\nfi\n\n# Copy the llvmForJSC library into the framework.\nditto \"${BUILT_PRODUCTS_DIR}/libllvmForJSC.dylib\" \"${BUILT_PRODUCTS_DIR}/${CONTENTS_FOLDER_PATH}/Libraries/libllvmForJSC.dylib\"\nif [ ! -e \"${BUILT_PRODUCTS_DIR}/${WRAPPER_NAME}/Libraries\" ]\nthen\n ln -fs \"Versions/Current/Libraries\" \"${BUILT_PRODUCTS_DIR}/${WRAPPER_NAME}/Libraries\"\nfi"; + }; + A3CA4B701BCD9DC9004C5B45 /* Check For Weak VTables and Externals */ = { + isa = PBXShellScriptBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + inputPaths = ( + "$(TARGET_BUILD_DIR)/$(EXECUTABLE_PATH)", + ); + name = "Check For Weak VTables and Externals"; + outputPaths = ( + ); + runOnlyForDeploymentPostprocessing = 0; + shellPath = /bin/sh; + shellScript = "if [ -f ../../Tools/Scripts/check-for-weak-vtables-and-externals ]; then\n ../../Tools/Scripts/check-for-weak-vtables-and-externals || exit $?\nfi"; + }; + A3CA4B711BCD9DC9004C5B45 /* Check For Inappropriate Objective-C Class Names */ = { + isa = PBXShellScriptBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + inputPaths = ( + "$(TARGET_BUILD_DIR)/$(EXECUTABLE_PATH)", + ); + name = "Check For Inappropriate Objective-C Class Names"; + outputPaths = ( + ); + runOnlyForDeploymentPostprocessing = 0; + shellPath = /bin/sh; + shellScript = "if [ \"${ACTION}\" = \"installhdrs\" ]; then\n exit 0;\nfi\n\nif [ -f ../../Tools/Scripts/check-for-inappropriate-objc-class-names ]; then\n ../../Tools/Scripts/check-for-inappropriate-objc-class-names JS || exit $?\nfi"; + }; + A3CA4B721BCD9DC9004C5B45 /* Check For Inappropriate Macros in External Headers */ = { + isa = PBXShellScriptBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + inputPaths = ( + "$(TARGET_BUILD_DIR)/$(EXECUTABLE_PATH)", + ); + name = "Check For Inappropriate Macros in External Headers"; + outputPaths = ( + ); + runOnlyForDeploymentPostprocessing = 0; + shellPath = /bin/sh; + shellScript = "if [ \"${ACTION}\" = \"installhdrs\" ]; then\n exit 0;\nfi\n\nif [ -f ../../Tools/Scripts/check-for-inappropriate-macros-in-external-headers ]; then\n ../../Tools/Scripts/check-for-inappropriate-macros-in-external-headers Headers PrivateHeaders/JSBasePrivate.h || exit $?\nfi"; + }; A55DEAA416703DF7003DB841 /* Check For Inappropriate Macros in External Headers */ = { isa = PBXShellScriptBuildPhase; buildActionMask = 2147483647; @@ -8635,6 +10713,493 @@ ); runOnlyForDeploymentPostprocessing = 0; }; + A3CA498A1BCD9DC9004C5B45 /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + A3CA498B1BCD9DC9004C5B45 /* ProtoCallFrame.cpp in Sources */, + A3CA498C1BCD9DC9004C5B45 /* A64DOpcode.cpp in Sources */, + A3CA498D1BCD9DC9004C5B45 /* AbstractPC.cpp in Sources */, + A3CA498E1BCD9DC9004C5B45 /* ArgList.cpp in Sources */, + A3CA498F1BCD9DC9004C5B45 /* Arguments.cpp in Sources */, + A3CA49901BCD9DC9004C5B45 /* ArgumentsIteratorConstructor.cpp in Sources */, + A3CA49911BCD9DC9004C5B45 /* ArgumentsIteratorPrototype.cpp in Sources */, + A3CA49921BCD9DC9004C5B45 /* ARM64Disassembler.cpp in Sources */, + A3CA49931BCD9DC9004C5B45 /* ARMAssembler.cpp in Sources */, + A3CA49941BCD9DC9004C5B45 /* ARMv7Assembler.cpp in Sources */, + A3CA49951BCD9DC9004C5B45 /* ARMv7Disassembler.cpp in Sources */, + A3CA49961BCD9DC9004C5B45 /* ARMv7DOpcode.cpp in Sources */, + A3CA49971BCD9DC9004C5B45 /* ArrayAllocationProfile.cpp in Sources */, + A3CA49981BCD9DC9004C5B45 /* ArrayBuffer.cpp in Sources */, + A3CA49991BCD9DC9004C5B45 /* ArrayBufferView.cpp in Sources */, + A3CA499A1BCD9DC9004C5B45 /* ArrayConstructor.cpp in Sources */, + A3CA499B1BCD9DC9004C5B45 /* ArrayIteratorConstructor.cpp in Sources */, + A3CA499C1BCD9DC9004C5B45 /* ArrayIteratorPrototype.cpp in Sources */, + A3CA499D1BCD9DC9004C5B45 /* JSSetIterator.cpp in Sources */, + A3CA499E1BCD9DC9004C5B45 /* ArrayProfile.cpp in Sources */, + A3CA499F1BCD9DC9004C5B45 /* ArrayPrototype.cpp in Sources */, + A3CA49A01BCD9DC9004C5B45 /* AssemblyHelpers.cpp in Sources */, + A3CA49A11BCD9DC9004C5B45 /* BlockAllocator.cpp in Sources */, + A3CA49A21BCD9DC9004C5B45 /* BooleanConstructor.cpp in Sources */, + A3CA49A31BCD9DC9004C5B45 /* BooleanObject.cpp in Sources */, + A3CA49A41BCD9DC9004C5B45 /* BooleanPrototype.cpp in Sources */, + A3CA49A51BCD9DC9004C5B45 /* BytecodeGenerator.cpp in Sources */, + A3CA49A61BCD9DC9004C5B45 /* CallData.cpp in Sources */, + A3CA49A71BCD9DC9004C5B45 /* CallFrame.cpp in Sources */, + A3CA49A81BCD9DC9004C5B45 /* CallLinkInfo.cpp in Sources */, + A3CA49A91BCD9DC9004C5B45 /* CallLinkStatus.cpp in Sources */, + A3CA49AA1BCD9DC9004C5B45 /* ClosureCallStubRoutine.cpp in Sources */, + A3CA49AB1BCD9DC9004C5B45 /* CodeBlock.cpp in Sources */, + A3CA49AC1BCD9DC9004C5B45 /* CodeBlockHash.cpp in Sources */, + A3CA49AD1BCD9DC9004C5B45 /* CodeBlockJettisoningWatchpoint.cpp in Sources */, + A3CA49AE1BCD9DC9004C5B45 /* CodeBlockSet.cpp in Sources */, + A3CA49AF1BCD9DC9004C5B45 /* CodeCache.cpp in Sources */, + A3CA49B01BCD9DC9004C5B45 /* CodeOrigin.cpp in Sources */, + A3CA49B11BCD9DC9004C5B45 /* CodeProfile.cpp in Sources */, + A3CA49B21BCD9DC9004C5B45 /* CodeProfiling.cpp in Sources */, + A3CA49B31BCD9DC9004C5B45 /* CodeSpecializationKind.cpp in Sources */, + A3CA49B41BCD9DC9004C5B45 /* CodeType.cpp in Sources */, + A3CA49B51BCD9DC9004C5B45 /* CommonIdentifiers.cpp in Sources */, + A3CA49B61BCD9DC9004C5B45 /* CommonSlowPaths.cpp in Sources */, + A3CA49B71BCD9DC9004C5B45 /* CommonSlowPathsExceptions.cpp in Sources */, + A3CA49B81BCD9DC9004C5B45 /* CompilationResult.cpp in Sources */, + A3CA49B91BCD9DC9004C5B45 /* Completion.cpp in Sources */, + A3CA49BA1BCD9DC9004C5B45 /* ConservativeRoots.cpp in Sources */, + A3CA49BB1BCD9DC9004C5B45 /* ConstructData.cpp in Sources */, + A3CA49BC1BCD9DC9004C5B45 /* CopiedSpace.cpp in Sources */, + A3CA49BD1BCD9DC9004C5B45 /* CopyVisitor.cpp in Sources */, + A3CA49BE1BCD9DC9004C5B45 /* DataView.cpp in Sources */, + A3CA49BF1BCD9DC9004C5B45 /* DateConstructor.cpp in Sources */, + A3CA49C01BCD9DC9004C5B45 /* DateConversion.cpp in Sources */, + A3CA49C11BCD9DC9004C5B45 /* DateInstance.cpp in Sources */, + A3CA49C21BCD9DC9004C5B45 /* DatePrototype.cpp in Sources */, + A3CA49C31BCD9DC9004C5B45 /* BytecodeLivenessAnalysis.cpp in Sources */, + A3CA49C41BCD9DC9004C5B45 /* Debugger.cpp in Sources */, + A3CA49C51BCD9DC9004C5B45 /* DebuggerActivation.cpp in Sources */, + A3CA49C61BCD9DC9004C5B45 /* DebuggerCallFrame.cpp in Sources */, + A3CA49C71BCD9DC9004C5B45 /* DeferGC.cpp in Sources */, + A3CA49C81BCD9DC9004C5B45 /* DeferredCompilationCallback.cpp in Sources */, + A3CA49C91BCD9DC9004C5B45 /* DFGAbstractHeap.cpp in Sources */, + A3CA49CA1BCD9DC9004C5B45 /* DFGAbstractValue.cpp in Sources */, + A3CA49CB1BCD9DC9004C5B45 /* DFGArgumentsSimplificationPhase.cpp in Sources */, + A3CA49CC1BCD9DC9004C5B45 /* DFGArrayMode.cpp in Sources */, + A3CA49CD1BCD9DC9004C5B45 /* DFGAtTailAbstractState.cpp in Sources */, + A3CA49CE1BCD9DC9004C5B45 /* DFGBackwardsPropagationPhase.cpp in Sources */, + A3CA49CF1BCD9DC9004C5B45 /* DFGBasicBlock.cpp in Sources */, + A3CA49D01BCD9DC9004C5B45 /* DFGBinarySwitch.cpp in Sources */, + A3CA49D11BCD9DC9004C5B45 /* DFGBlockInsertionSet.cpp in Sources */, + A3CA49D21BCD9DC9004C5B45 /* DFGByteCodeParser.cpp in Sources */, + A3CA49D31BCD9DC9004C5B45 /* DFGCapabilities.cpp in Sources */, + A3CA49D41BCD9DC9004C5B45 /* DFGCFAPhase.cpp in Sources */, + A3CA49D51BCD9DC9004C5B45 /* DFGCFGSimplificationPhase.cpp in Sources */, + A3CA49D61BCD9DC9004C5B45 /* DFGClobberize.cpp in Sources */, + A3CA49D71BCD9DC9004C5B45 /* DFGClobberSet.cpp in Sources */, + A3CA49D81BCD9DC9004C5B45 /* DFGCommon.cpp in Sources */, + A3CA49D91BCD9DC9004C5B45 /* DFGCommonData.cpp in Sources */, + A3CA49DA1BCD9DC9004C5B45 /* DFGCompilationKey.cpp in Sources */, + A3CA49DB1BCD9DC9004C5B45 /* DFGCompilationMode.cpp in Sources */, + A3CA49DC1BCD9DC9004C5B45 /* DFGConstantFoldingPhase.cpp in Sources */, + A3CA49DD1BCD9DC9004C5B45 /* DFGCPSRethreadingPhase.cpp in Sources */, + A3CA49DE1BCD9DC9004C5B45 /* DFGCriticalEdgeBreakingPhase.cpp in Sources */, + A3CA49DF1BCD9DC9004C5B45 /* DFGCSEPhase.cpp in Sources */, + A3CA49E01BCD9DC9004C5B45 /* DFGDCEPhase.cpp in Sources */, + A3CA49E11BCD9DC9004C5B45 /* DFGDesiredIdentifiers.cpp in Sources */, + A3CA49E21BCD9DC9004C5B45 /* DFGDesiredStructureChains.cpp in Sources */, + A3CA49E31BCD9DC9004C5B45 /* DFGDesiredTransitions.cpp in Sources */, + A3CA49E41BCD9DC9004C5B45 /* DFGDesiredWatchpoints.cpp in Sources */, + A3CA49E51BCD9DC9004C5B45 /* DFGDesiredWeakReferences.cpp in Sources */, + A3CA49E61BCD9DC9004C5B45 /* DFGDesiredWriteBarriers.cpp in Sources */, + A3CA49E71BCD9DC9004C5B45 /* DFGDisassembler.cpp in Sources */, + A3CA49E81BCD9DC9004C5B45 /* DFGDominators.cpp in Sources */, + A3CA49E91BCD9DC9004C5B45 /* DFGDriver.cpp in Sources */, + A3CA49EA1BCD9DC9004C5B45 /* InspectorValues.cpp in Sources */, + A3CA49EB1BCD9DC9004C5B45 /* DFGEdge.cpp in Sources */, + A3CA49EC1BCD9DC9004C5B45 /* MapIteratorPrototype.cpp in Sources */, + A3CA49ED1BCD9DC9004C5B45 /* DFGExitProfile.cpp in Sources */, + A3CA49EE1BCD9DC9004C5B45 /* DFGFailedFinalizer.cpp in Sources */, + A3CA49EF1BCD9DC9004C5B45 /* DFGFinalizer.cpp in Sources */, + A3CA49F01BCD9DC9004C5B45 /* DFGFixupPhase.cpp in Sources */, + A3CA49F11BCD9DC9004C5B45 /* DFGFlushedAt.cpp in Sources */, + A3CA49F21BCD9DC9004C5B45 /* DFGFlushFormat.cpp in Sources */, + A3CA49F31BCD9DC9004C5B45 /* DFGFlushLivenessAnalysisPhase.cpp in Sources */, + A3CA49F41BCD9DC9004C5B45 /* DFGGraph.cpp in Sources */, + A3CA49F51BCD9DC9004C5B45 /* DFGInPlaceAbstractState.cpp in Sources */, + A3CA49F61BCD9DC9004C5B45 /* DFGInvalidationPointInjectionPhase.cpp in Sources */, + A3CA49F71BCD9DC9004C5B45 /* DFGJITCode.cpp in Sources */, + A3CA49F81BCD9DC9004C5B45 /* DFGJITCompiler.cpp in Sources */, + A3CA49F91BCD9DC9004C5B45 /* DFGJITFinalizer.cpp in Sources */, + A3CA49FA1BCD9DC9004C5B45 /* DFGJumpReplacement.cpp in Sources */, + A3CA49FB1BCD9DC9004C5B45 /* DFGLazyJSValue.cpp in Sources */, + A3CA49FC1BCD9DC9004C5B45 /* DFGLICMPhase.cpp in Sources */, + A3CA49FD1BCD9DC9004C5B45 /* DFGLivenessAnalysisPhase.cpp in Sources */, + A3CA49FE1BCD9DC9004C5B45 /* DFGLongLivedState.cpp in Sources */, + A3CA49FF1BCD9DC9004C5B45 /* DFGLoopPreHeaderCreationPhase.cpp in Sources */, + A3CA4A001BCD9DC9004C5B45 /* DFGMinifiedNode.cpp in Sources */, + A3CA4A011BCD9DC9004C5B45 /* DFGNaturalLoops.cpp in Sources */, + A3CA4A021BCD9DC9004C5B45 /* DFGNode.cpp in Sources */, + A3CA4A031BCD9DC9004C5B45 /* DFGNodeFlags.cpp in Sources */, + A3CA4A041BCD9DC9004C5B45 /* DFGOperations.cpp in Sources */, + A3CA4A051BCD9DC9004C5B45 /* DFGOSRAvailabilityAnalysisPhase.cpp in Sources */, + A3CA4A061BCD9DC9004C5B45 /* DFGOSREntry.cpp in Sources */, + A3CA4A071BCD9DC9004C5B45 /* DFGOSREntrypointCreationPhase.cpp in Sources */, + A3CA4A081BCD9DC9004C5B45 /* DFGOSRExit.cpp in Sources */, + A3CA4A091BCD9DC9004C5B45 /* DFGOSRExitBase.cpp in Sources */, + A3CA4A0A1BCD9DC9004C5B45 /* DFGOSRExitCompiler.cpp in Sources */, + A3CA4A0B1BCD9DC9004C5B45 /* DFGOSRExitCompiler32_64.cpp in Sources */, + A3CA4A0C1BCD9DC9004C5B45 /* DFGStrengthReductionPhase.cpp in Sources */, + A3CA4A0D1BCD9DC9004C5B45 /* DFGOSRExitCompiler64.cpp in Sources */, + A3CA4A0E1BCD9DC9004C5B45 /* DFGOSRExitCompilerCommon.cpp in Sources */, + A3CA4A0F1BCD9DC9004C5B45 /* DFGOSRExitJumpPlaceholder.cpp in Sources */, + A3CA4A101BCD9DC9004C5B45 /* DFGOSRExitPreparation.cpp in Sources */, + A3CA4A111BCD9DC9004C5B45 /* DFGPhase.cpp in Sources */, + A3CA4A121BCD9DC9004C5B45 /* DFGPlan.cpp in Sources */, + A3CA4A131BCD9DC9004C5B45 /* DFGPredictionInjectionPhase.cpp in Sources */, + A3CA4A141BCD9DC9004C5B45 /* DFGPredictionPropagationPhase.cpp in Sources */, + A3CA4A151BCD9DC9004C5B45 /* DFGSpeculativeJIT.cpp in Sources */, + A3CA4A161BCD9DC9004C5B45 /* DFGSpeculativeJIT32_64.cpp in Sources */, + A3CA4A171BCD9DC9004C5B45 /* DFGSpeculativeJIT64.cpp in Sources */, + A3CA4A181BCD9DC9004C5B45 /* DFGSSAConversionPhase.cpp in Sources */, + A3CA4A191BCD9DC9004C5B45 /* DFGStackLayoutPhase.cpp in Sources */, + A3CA4A1A1BCD9DC9004C5B45 /* DFGThunks.cpp in Sources */, + A3CA4A1B1BCD9DC9004C5B45 /* DFGTierUpCheckInjectionPhase.cpp in Sources */, + A3CA4A1C1BCD9DC9004C5B45 /* DFGToFTLDeferredCompilationCallback.cpp in Sources */, + A3CA4A1D1BCD9DC9004C5B45 /* DFGToFTLForOSREntryDeferredCompilationCallback.cpp in Sources */, + A3CA4A1E1BCD9DC9004C5B45 /* DFGTypeCheckHoistingPhase.cpp in Sources */, + A3CA4A1F1BCD9DC9004C5B45 /* DFGUnificationPhase.cpp in Sources */, + A3CA4A201BCD9DC9004C5B45 /* DFGUseKind.cpp in Sources */, + A3CA4A211BCD9DC9004C5B45 /* DFGValidate.cpp in Sources */, + A3CA4A221BCD9DC9004C5B45 /* ScriptFunctionCall.cpp in Sources */, + A3CA4A231BCD9DC9004C5B45 /* DFGValueSource.cpp in Sources */, + A3CA4A241BCD9DC9004C5B45 /* DFGVariableAccessDataDump.cpp in Sources */, + A3CA4A251BCD9DC9004C5B45 /* DFGVariableEvent.cpp in Sources */, + A3CA4A261BCD9DC9004C5B45 /* DFGVariableEventStream.cpp in Sources */, + A3CA4A271BCD9DC9004C5B45 /* DFGVirtualRegisterAllocationPhase.cpp in Sources */, + A3CA4A281BCD9DC9004C5B45 /* DFGWatchpointCollectionPhase.cpp in Sources */, + A3CA4A291BCD9DC9004C5B45 /* DFGWorklist.cpp in Sources */, + A3CA4A2A1BCD9DC9004C5B45 /* Disassembler.cpp in Sources */, + A3CA4A2B1BCD9DC9004C5B45 /* DumpContext.cpp in Sources */, + A3CA4A2C1BCD9DC9004C5B45 /* Error.cpp in Sources */, + A3CA4A2D1BCD9DC9004C5B45 /* ErrorConstructor.cpp in Sources */, + A3CA4A2E1BCD9DC9004C5B45 /* ErrorInstance.cpp in Sources */, + A3CA4A2F1BCD9DC9004C5B45 /* ErrorPrototype.cpp in Sources */, + A3CA4A301BCD9DC9004C5B45 /* JSTypedArray.cpp in Sources */, + A3CA4A311BCD9DC9004C5B45 /* ExceptionHelpers.cpp in Sources */, + A3CA4A321BCD9DC9004C5B45 /* Executable.cpp in Sources */, + A3CA4A331BCD9DC9004C5B45 /* ExecutableAllocator.cpp in Sources */, + A3CA4A341BCD9DC9004C5B45 /* ExecutableAllocatorFixedVMPool.cpp in Sources */, + A3CA4A351BCD9DC9004C5B45 /* ExecutionCounter.cpp in Sources */, + A3CA4A361BCD9DC9004C5B45 /* JSGlobalObjectDebuggable.cpp in Sources */, + A3CA4A371BCD9DC9004C5B45 /* ExitKind.cpp in Sources */, + A3CA4A381BCD9DC9004C5B45 /* ScriptValue.cpp in Sources */, + A3CA4A391BCD9DC9004C5B45 /* FTLAbstractHeap.cpp in Sources */, + A3CA4A3A1BCD9DC9004C5B45 /* FTLAbstractHeapRepository.cpp in Sources */, + A3CA4A3B1BCD9DC9004C5B45 /* FTLCapabilities.cpp in Sources */, + A3CA4A3C1BCD9DC9004C5B45 /* FTLCommonValues.cpp in Sources */, + A3CA4A3D1BCD9DC9004C5B45 /* JSPromiseDeferred.cpp in Sources */, + A3CA4A3E1BCD9DC9004C5B45 /* InspectorJSFrontendDispatchers.cpp in Sources */, + A3CA4A3F1BCD9DC9004C5B45 /* FTLCompile.cpp in Sources */, + A3CA4A401BCD9DC9004C5B45 /* FTLExitArgument.cpp in Sources */, + A3CA4A411BCD9DC9004C5B45 /* FTLExitArgumentForOperand.cpp in Sources */, + A3CA4A421BCD9DC9004C5B45 /* FTLExitThunkGenerator.cpp in Sources */, + A3CA4A431BCD9DC9004C5B45 /* FTLExitValue.cpp in Sources */, + A3CA4A441BCD9DC9004C5B45 /* FTLFail.cpp in Sources */, + A3CA4A451BCD9DC9004C5B45 /* FTLForOSREntryJITCode.cpp in Sources */, + A3CA4A461BCD9DC9004C5B45 /* FTLInlineCacheSize.cpp in Sources */, + A3CA4A471BCD9DC9004C5B45 /* FTLIntrinsicRepository.cpp in Sources */, + A3CA4A481BCD9DC9004C5B45 /* FTLJITCode.cpp in Sources */, + A3CA4A491BCD9DC9004C5B45 /* FTLJITFinalizer.cpp in Sources */, + A3CA4A4A1BCD9DC9004C5B45 /* FTLLink.cpp in Sources */, + A3CA4A4B1BCD9DC9004C5B45 /* JSMapIterator.cpp in Sources */, + A3CA4A4C1BCD9DC9004C5B45 /* FTLLocation.cpp in Sources */, + A3CA4A4D1BCD9DC9004C5B45 /* FTLLowerDFGToLLVM.cpp in Sources */, + A3CA4A4E1BCD9DC9004C5B45 /* FTLOSREntry.cpp in Sources */, + A3CA4A4F1BCD9DC9004C5B45 /* FTLOSRExit.cpp in Sources */, + A3CA4A501BCD9DC9004C5B45 /* FTLOSRExitCompiler.cpp in Sources */, + A3CA4A511BCD9DC9004C5B45 /* FTLOutput.cpp in Sources */, + A3CA4A521BCD9DC9004C5B45 /* FTLSaveRestore.cpp in Sources */, + A3CA4A531BCD9DC9004C5B45 /* FTLSlowPathCall.cpp in Sources */, + A3CA4A541BCD9DC9004C5B45 /* FTLSlowPathCallKey.cpp in Sources */, + A3CA4A551BCD9DC9004C5B45 /* FTLStackMaps.cpp in Sources */, + A3CA4A561BCD9DC9004C5B45 /* FTLState.cpp in Sources */, + A3CA4A571BCD9DC9004C5B45 /* JSPromiseFunctions.cpp in Sources */, + A3CA4A581BCD9DC9004C5B45 /* FTLThunks.cpp in Sources */, + A3CA4A591BCD9DC9004C5B45 /* InspectorBackendDispatcher.cpp in Sources */, + A3CA4A5A1BCD9DC9004C5B45 /* FTLValueFormat.cpp in Sources */, + A3CA4A5B1BCD9DC9004C5B45 /* FunctionConstructor.cpp in Sources */, + A3CA4A5C1BCD9DC9004C5B45 /* FunctionExecutableDump.cpp in Sources */, + A3CA4A5D1BCD9DC9004C5B45 /* FunctionPrototype.cpp in Sources */, + A3CA4A5E1BCD9DC9004C5B45 /* GCActivityCallback.cpp in Sources */, + A3CA4A5F1BCD9DC9004C5B45 /* GCAwareJITStubRoutine.cpp in Sources */, + A3CA4A601BCD9DC9004C5B45 /* GCThread.cpp in Sources */, + A3CA4A611BCD9DC9004C5B45 /* GCThreadSharedData.cpp in Sources */, + A3CA4A621BCD9DC9004C5B45 /* GetByIdStatus.cpp in Sources */, + A3CA4A631BCD9DC9004C5B45 /* JSPromiseReaction.cpp in Sources */, + A3CA4A641BCD9DC9004C5B45 /* GetterSetter.cpp in Sources */, + A3CA4A651BCD9DC9004C5B45 /* HandleSet.cpp in Sources */, + A3CA4A661BCD9DC9004C5B45 /* HandleStack.cpp in Sources */, + A3CA4A671BCD9DC9004C5B45 /* Heap.cpp in Sources */, + A3CA4A681BCD9DC9004C5B45 /* HeapStatistics.cpp in Sources */, + A3CA4A691BCD9DC9004C5B45 /* HeapTimer.cpp in Sources */, + A3CA4A6A1BCD9DC9004C5B45 /* HostCallReturnValue.cpp in Sources */, + A3CA4A6B1BCD9DC9004C5B45 /* Identifier.cpp in Sources */, + A3CA4A6C1BCD9DC9004C5B45 /* IncrementalSweeper.cpp in Sources */, + A3CA4A6D1BCD9DC9004C5B45 /* IndexingType.cpp in Sources */, + A3CA4A6E1BCD9DC9004C5B45 /* InitializeLLVM.cpp in Sources */, + A3CA4A6F1BCD9DC9004C5B45 /* InitializeLLVMMac.mm in Sources */, + A3CA4A701BCD9DC9004C5B45 /* InitializeLLVMPOSIX.cpp in Sources */, + A3CA4A711BCD9DC9004C5B45 /* InitializeThreading.cpp in Sources */, + A3CA4A721BCD9DC9004C5B45 /* InlineCallFrameSet.cpp in Sources */, + A3CA4A731BCD9DC9004C5B45 /* IntendedStructureChain.cpp in Sources */, + A3CA4A741BCD9DC9004C5B45 /* InternalFunction.cpp in Sources */, + A3CA4A751BCD9DC9004C5B45 /* DFGStoreBarrierElisionPhase.cpp in Sources */, + A3CA4A761BCD9DC9004C5B45 /* Interpreter.cpp in Sources */, + A3CA4A771BCD9DC9004C5B45 /* JIT.cpp in Sources */, + A3CA4A781BCD9DC9004C5B45 /* JITArithmetic.cpp in Sources */, + A3CA4A791BCD9DC9004C5B45 /* JITArithmetic32_64.cpp in Sources */, + A3CA4A7A1BCD9DC9004C5B45 /* JITCall.cpp in Sources */, + A3CA4A7B1BCD9DC9004C5B45 /* JITCall32_64.cpp in Sources */, + A3CA4A7C1BCD9DC9004C5B45 /* JITCode.cpp in Sources */, + A3CA4A7D1BCD9DC9004C5B45 /* JITDisassembler.cpp in Sources */, + A3CA4A7E1BCD9DC9004C5B45 /* JITExceptions.cpp in Sources */, + A3CA4A7F1BCD9DC9004C5B45 /* JITInlineCacheGenerator.cpp in Sources */, + A3CA4A801BCD9DC9004C5B45 /* JITOpcodes.cpp in Sources */, + A3CA4A811BCD9DC9004C5B45 /* JITOpcodes32_64.cpp in Sources */, + A3CA4A821BCD9DC9004C5B45 /* WriteBarrierBuffer.cpp in Sources */, + A3CA4A831BCD9DC9004C5B45 /* JITOperations.cpp in Sources */, + A3CA4A841BCD9DC9004C5B45 /* JITPropertyAccess.cpp in Sources */, + A3CA4A851BCD9DC9004C5B45 /* JITPropertyAccess32_64.cpp in Sources */, + A3CA4A861BCD9DC9004C5B45 /* JITStubRoutine.cpp in Sources */, + A3CA4A871BCD9DC9004C5B45 /* JITStubRoutineSet.cpp in Sources */, + A3CA4A881BCD9DC9004C5B45 /* JITStubs.cpp in Sources */, + A3CA4A891BCD9DC9004C5B45 /* JITThunks.cpp in Sources */, + A3CA4A8A1BCD9DC9004C5B45 /* JITToDFGDeferredCompilationCallback.cpp in Sources */, + A3CA4A8B1BCD9DC9004C5B45 /* JSActivation.cpp in Sources */, + A3CA4A8C1BCD9DC9004C5B45 /* JSAPIValueWrapper.cpp in Sources */, + A3CA4A8D1BCD9DC9004C5B45 /* JSAPIWrapperObject.mm in Sources */, + A3CA4A8E1BCD9DC9004C5B45 /* JSArgumentsIterator.cpp in Sources */, + A3CA4A8F1BCD9DC9004C5B45 /* JSArray.cpp in Sources */, + A3CA4A901BCD9DC9004C5B45 /* JSArrayBuffer.cpp in Sources */, + A3CA4A911BCD9DC9004C5B45 /* JSArrayBufferConstructor.cpp in Sources */, + A3CA4A921BCD9DC9004C5B45 /* JSArrayBufferPrototype.cpp in Sources */, + A3CA4A931BCD9DC9004C5B45 /* JSArrayBufferView.cpp in Sources */, + A3CA4A941BCD9DC9004C5B45 /* JSArrayIterator.cpp in Sources */, + A3CA4A951BCD9DC9004C5B45 /* JSBase.cpp in Sources */, + A3CA4A961BCD9DC9004C5B45 /* JSBoundFunction.cpp in Sources */, + A3CA4A971BCD9DC9004C5B45 /* JSCallbackConstructor.cpp in Sources */, + A3CA4A981BCD9DC9004C5B45 /* JSCallbackFunction.cpp in Sources */, + A3CA4A991BCD9DC9004C5B45 /* JSCallbackObject.cpp in Sources */, + A3CA4A9A1BCD9DC9004C5B45 /* JSCell.cpp in Sources */, + A3CA4A9B1BCD9DC9004C5B45 /* JSCJSValue.cpp in Sources */, + A3CA4A9C1BCD9DC9004C5B45 /* JSClassRef.cpp in Sources */, + A3CA4A9D1BCD9DC9004C5B45 /* JSContext.mm in Sources */, + A3CA4A9E1BCD9DC9004C5B45 /* JSContextRef.cpp in Sources */, + A3CA4A9F1BCD9DC9004C5B45 /* JSCTestRunnerUtils.cpp in Sources */, + A3CA4AA01BCD9DC9004C5B45 /* JSDataView.cpp in Sources */, + A3CA4AA11BCD9DC9004C5B45 /* JSDataViewPrototype.cpp in Sources */, + A3CA4AA21BCD9DC9004C5B45 /* JSDateMath.cpp in Sources */, + A3CA4AA31BCD9DC9004C5B45 /* JSFunction.cpp in Sources */, + A3CA4AA41BCD9DC9004C5B45 /* JSGlobalObject.cpp in Sources */, + A3CA4AA51BCD9DC9004C5B45 /* JSGlobalObjectFunctions.cpp in Sources */, + A3CA4AA61BCD9DC9004C5B45 /* JSLock.cpp in Sources */, + A3CA4AA71BCD9DC9004C5B45 /* JSManagedValue.mm in Sources */, + A3CA4AA81BCD9DC9004C5B45 /* JSMap.cpp in Sources */, + A3CA4AA91BCD9DC9004C5B45 /* JSNameScope.cpp in Sources */, + A3CA4AAA1BCD9DC9004C5B45 /* JSNotAnObject.cpp in Sources */, + A3CA4AAB1BCD9DC9004C5B45 /* JSObject.cpp in Sources */, + A3CA4AAC1BCD9DC9004C5B45 /* JSObjectRef.cpp in Sources */, + A3CA4AAD1BCD9DC9004C5B45 /* JSONObject.cpp in Sources */, + A3CA4AAE1BCD9DC9004C5B45 /* JSProfilerPrivate.cpp in Sources */, + A3CA4AAF1BCD9DC9004C5B45 /* JSPromise.cpp in Sources */, + A3CA4AB01BCD9DC9004C5B45 /* JSPromiseConstructor.cpp in Sources */, + A3CA4AB11BCD9DC9004C5B45 /* JSPromisePrototype.cpp in Sources */, + A3CA4AB21BCD9DC9004C5B45 /* JSPropertyNameIterator.cpp in Sources */, + A3CA4AB31BCD9DC9004C5B45 /* JSProxy.cpp in Sources */, + A3CA4AB41BCD9DC9004C5B45 /* JSScope.cpp in Sources */, + A3CA4AB51BCD9DC9004C5B45 /* JSScriptRef.cpp in Sources */, + A3CA4AB61BCD9DC9004C5B45 /* JSSegmentedVariableObject.cpp in Sources */, + A3CA4AB71BCD9DC9004C5B45 /* JSSet.cpp in Sources */, + A3CA4AB81BCD9DC9004C5B45 /* JSStack.cpp in Sources */, + A3CA4AB91BCD9DC9004C5B45 /* JSString.cpp in Sources */, + A3CA4ABA1BCD9DC9004C5B45 /* JSStringJoiner.cpp in Sources */, + A3CA4ABB1BCD9DC9004C5B45 /* ArrayBufferNeuteringWatchpoint.cpp in Sources */, + A3CA4ABC1BCD9DC9004C5B45 /* JSStringRef.cpp in Sources */, + A3CA4ABD1BCD9DC9004C5B45 /* JSStringRefCF.cpp in Sources */, + A3CA4ABE1BCD9DC9004C5B45 /* JSSymbolTableObject.cpp in Sources */, + A3CA4ABF1BCD9DC9004C5B45 /* JSTypedArrayConstructors.cpp in Sources */, + A3CA4AC01BCD9DC9004C5B45 /* InspectorJSTypeBuilders.cpp in Sources */, + A3CA4AC11BCD9DC9004C5B45 /* JSTypedArrayPrototypes.cpp in Sources */, + A3CA4AC21BCD9DC9004C5B45 /* JSTypedArrays.cpp in Sources */, + A3CA4AC31BCD9DC9004C5B45 /* JSValue.mm in Sources */, + A3CA4AC41BCD9DC9004C5B45 /* JSValueRef.cpp in Sources */, + A3CA4AC51BCD9DC9004C5B45 /* JSVariableObject.cpp in Sources */, + A3CA4AC61BCD9DC9004C5B45 /* JSVirtualMachine.mm in Sources */, + A3CA4AC71BCD9DC9004C5B45 /* VMEntryScope.cpp in Sources */, + A3CA4AC81BCD9DC9004C5B45 /* JSWeakMap.cpp in Sources */, + A3CA4AC91BCD9DC9004C5B45 /* JSWeakObjectMapRefPrivate.cpp in Sources */, + A3CA4ACA1BCD9DC9004C5B45 /* JSWithScope.cpp in Sources */, + A3CA4ACB1BCD9DC9004C5B45 /* JSWrapperMap.mm in Sources */, + A3CA4ACC1BCD9DC9004C5B45 /* JSWrapperObject.cpp in Sources */, + A3CA4ACD1BCD9DC9004C5B45 /* JumpTable.cpp in Sources */, + A3CA4ACE1BCD9DC9004C5B45 /* LazyOperandValueProfile.cpp in Sources */, + A3CA4ACF1BCD9DC9004C5B45 /* LegacyProfiler.cpp in Sources */, + A3CA4AD01BCD9DC9004C5B45 /* Lexer.cpp in Sources */, + A3CA4AD11BCD9DC9004C5B45 /* LinkBuffer.cpp in Sources */, + A3CA4AD21BCD9DC9004C5B45 /* LiteralParser.cpp in Sources */, + A3CA4AD31BCD9DC9004C5B45 /* LLIntCLoop.cpp in Sources */, + A3CA4AD41BCD9DC9004C5B45 /* LLIntData.cpp in Sources */, + A3CA4AD51BCD9DC9004C5B45 /* LLIntEntrypoint.cpp in Sources */, + A3CA4AD61BCD9DC9004C5B45 /* LLIntExceptions.cpp in Sources */, + A3CA4AD71BCD9DC9004C5B45 /* LLIntSlowPaths.cpp in Sources */, + A3CA4AD81BCD9DC9004C5B45 /* LLIntThunks.cpp in Sources */, + A3CA4AD91BCD9DC9004C5B45 /* LLVMAPI.cpp in Sources */, + A3CA4ADA1BCD9DC9004C5B45 /* LLVMDisassembler.cpp in Sources */, + A3CA4ADB1BCD9DC9004C5B45 /* Lookup.cpp in Sources */, + A3CA4ADC1BCD9DC9004C5B45 /* LowLevelInterpreter.cpp in Sources */, + A3CA4ADD1BCD9DC9004C5B45 /* MachineStackMarker.cpp in Sources */, + A3CA4ADE1BCD9DC9004C5B45 /* RemoteInspectorDebuggable.cpp in Sources */, + A3CA4ADF1BCD9DC9004C5B45 /* MacroAssembler.cpp in Sources */, + A3CA4AE01BCD9DC9004C5B45 /* MacroAssemblerARM.cpp in Sources */, + A3CA4AE11BCD9DC9004C5B45 /* MacroAssemblerARMv7.cpp in Sources */, + A3CA4AE21BCD9DC9004C5B45 /* InspectorJSBackendDispatchers.cpp in Sources */, + A3CA4AE31BCD9DC9004C5B45 /* MacroAssemblerX86Common.cpp in Sources */, + A3CA4AE41BCD9DC9004C5B45 /* MapConstructor.cpp in Sources */, + A3CA4AE51BCD9DC9004C5B45 /* MapData.cpp in Sources */, + A3CA4AE61BCD9DC9004C5B45 /* MapPrototype.cpp in Sources */, + A3CA4AE71BCD9DC9004C5B45 /* MarkedAllocator.cpp in Sources */, + A3CA4AE81BCD9DC9004C5B45 /* MarkedBlock.cpp in Sources */, + A3CA4AE91BCD9DC9004C5B45 /* MarkedSpace.cpp in Sources */, + A3CA4AEA1BCD9DC9004C5B45 /* MarkStack.cpp in Sources */, + A3CA4AEB1BCD9DC9004C5B45 /* MathObject.cpp in Sources */, + A3CA4AEC1BCD9DC9004C5B45 /* MemoryStatistics.cpp in Sources */, + A3CA4AED1BCD9DC9004C5B45 /* MethodOfGettingAValueProfile.cpp in Sources */, + A3CA4AEE1BCD9DC9004C5B45 /* NameConstructor.cpp in Sources */, + A3CA4AEF1BCD9DC9004C5B45 /* NameInstance.cpp in Sources */, + A3CA4AF01BCD9DC9004C5B45 /* NamePrototype.cpp in Sources */, + A3CA4AF11BCD9DC9004C5B45 /* ScriptObject.cpp in Sources */, + A3CA4AF21BCD9DC9004C5B45 /* NativeErrorConstructor.cpp in Sources */, + A3CA4AF31BCD9DC9004C5B45 /* NativeErrorPrototype.cpp in Sources */, + A3CA4AF41BCD9DC9004C5B45 /* Nodes.cpp in Sources */, + A3CA4AF51BCD9DC9004C5B45 /* NodesCodegen.cpp in Sources */, + A3CA4AF61BCD9DC9004C5B45 /* NumberConstructor.cpp in Sources */, + A3CA4AF71BCD9DC9004C5B45 /* NumberObject.cpp in Sources */, + A3CA4AF81BCD9DC9004C5B45 /* NumberPrototype.cpp in Sources */, + A3CA4AF91BCD9DC9004C5B45 /* ObjCCallbackFunction.mm in Sources */, + A3CA4AFA1BCD9DC9004C5B45 /* ObjectConstructor.cpp in Sources */, + A3CA4AFB1BCD9DC9004C5B45 /* ObjectPrototype.cpp in Sources */, + A3CA4AFC1BCD9DC9004C5B45 /* OpaqueJSString.cpp in Sources */, + A3CA4AFD1BCD9DC9004C5B45 /* Opcode.cpp in Sources */, + A3CA4AFE1BCD9DC9004C5B45 /* Operations.cpp in Sources */, + A3CA4AFF1BCD9DC9004C5B45 /* Options.cpp in Sources */, + A3CA4B001BCD9DC9004C5B45 /* DFGSSALoweringPhase.cpp in Sources */, + A3CA4B011BCD9DC9004C5B45 /* Parser.cpp in Sources */, + A3CA4B021BCD9DC9004C5B45 /* ParserArena.cpp in Sources */, + A3CA4B031BCD9DC9004C5B45 /* PolymorphicPutByIdList.cpp in Sources */, + A3CA4B041BCD9DC9004C5B45 /* PreciseJumpTargets.cpp in Sources */, + A3CA4B051BCD9DC9004C5B45 /* Profile.cpp in Sources */, + A3CA4B061BCD9DC9004C5B45 /* ProfiledCodeBlockJettisoningWatchpoint.cpp in Sources */, + A3CA4B071BCD9DC9004C5B45 /* ProfileGenerator.cpp in Sources */, + A3CA4B081BCD9DC9004C5B45 /* ProfileNode.cpp in Sources */, + A3CA4B091BCD9DC9004C5B45 /* ProfilerBytecode.cpp in Sources */, + A3CA4B0A1BCD9DC9004C5B45 /* ProfilerBytecodes.cpp in Sources */, + A3CA4B0B1BCD9DC9004C5B45 /* ProfilerBytecodeSequence.cpp in Sources */, + A3CA4B0C1BCD9DC9004C5B45 /* ProfilerCompilation.cpp in Sources */, + A3CA4B0D1BCD9DC9004C5B45 /* ProfilerCompilationKind.cpp in Sources */, + A3CA4B0E1BCD9DC9004C5B45 /* ProfilerCompiledBytecode.cpp in Sources */, + A3CA4B0F1BCD9DC9004C5B45 /* ProfilerDatabase.cpp in Sources */, + A3CA4B101BCD9DC9004C5B45 /* ProfilerOrigin.cpp in Sources */, + A3CA4B111BCD9DC9004C5B45 /* ProfilerOriginStack.cpp in Sources */, + A3CA4B121BCD9DC9004C5B45 /* BytecodeBasicBlock.cpp in Sources */, + A3CA4B131BCD9DC9004C5B45 /* DFGResurrectionForValidationPhase.cpp in Sources */, + A3CA4B141BCD9DC9004C5B45 /* ProfilerOSRExit.cpp in Sources */, + A3CA4B151BCD9DC9004C5B45 /* ProfilerOSRExitSite.cpp in Sources */, + A3CA4B161BCD9DC9004C5B45 /* ProfilerProfiledBytecodes.cpp in Sources */, + A3CA4B171BCD9DC9004C5B45 /* PropertyDescriptor.cpp in Sources */, + A3CA4B181BCD9DC9004C5B45 /* PropertyNameArray.cpp in Sources */, + A3CA4B191BCD9DC9004C5B45 /* PropertySlot.cpp in Sources */, + A3CA4B1A1BCD9DC9004C5B45 /* PropertyTable.cpp in Sources */, + A3CA4B1B1BCD9DC9004C5B45 /* PrototypeMap.cpp in Sources */, + A3CA4B1C1BCD9DC9004C5B45 /* PutByIdStatus.cpp in Sources */, + A3CA4B1D1BCD9DC9004C5B45 /* ReduceWhitespace.cpp in Sources */, + A3CA4B1E1BCD9DC9004C5B45 /* RegExp.cpp in Sources */, + A3CA4B1F1BCD9DC9004C5B45 /* RegExpCache.cpp in Sources */, + A3CA4B201BCD9DC9004C5B45 /* RegExpCachedResult.cpp in Sources */, + A3CA4B211BCD9DC9004C5B45 /* RegExpConstructor.cpp in Sources */, + A3CA4B221BCD9DC9004C5B45 /* RegExpMatchesArray.cpp in Sources */, + A3CA4B231BCD9DC9004C5B45 /* RegExpObject.cpp in Sources */, + A3CA4B241BCD9DC9004C5B45 /* RegExpPrototype.cpp in Sources */, + A3CA4B251BCD9DC9004C5B45 /* RegisterSet.cpp in Sources */, + A3CA4B261BCD9DC9004C5B45 /* Repatch.cpp in Sources */, + A3CA4B271BCD9DC9004C5B45 /* SamplingCounter.cpp in Sources */, + A3CA4B281BCD9DC9004C5B45 /* SamplingTool.cpp in Sources */, + A3CA4B291BCD9DC9004C5B45 /* SetConstructor.cpp in Sources */, + A3CA4B2A1BCD9DC9004C5B45 /* SetPrototype.cpp in Sources */, + A3CA4B2B1BCD9DC9004C5B45 /* SimpleTypedArrayController.cpp in Sources */, + A3CA4B2C1BCD9DC9004C5B45 /* SetIteratorPrototype.cpp in Sources */, + A3CA4B2D1BCD9DC9004C5B45 /* SlotVisitor.cpp in Sources */, + A3CA4B2E1BCD9DC9004C5B45 /* SmallStrings.cpp in Sources */, + A3CA4B2F1BCD9DC9004C5B45 /* SourceCode.cpp in Sources */, + A3CA4B301BCD9DC9004C5B45 /* SourceProvider.cpp in Sources */, + A3CA4B311BCD9DC9004C5B45 /* SourceProviderCache.cpp in Sources */, + A3CA4B321BCD9DC9004C5B45 /* SparseArrayValueMap.cpp in Sources */, + A3CA4B331BCD9DC9004C5B45 /* SpecialPointer.cpp in Sources */, + A3CA4B341BCD9DC9004C5B45 /* SpeculatedType.cpp in Sources */, + A3CA4B351BCD9DC9004C5B45 /* StackVisitor.cpp in Sources */, + A3CA4B361BCD9DC9004C5B45 /* StrictEvalActivation.cpp in Sources */, + A3CA4B371BCD9DC9004C5B45 /* StringConstructor.cpp in Sources */, + A3CA4B381BCD9DC9004C5B45 /* StringObject.cpp in Sources */, + A3CA4B391BCD9DC9004C5B45 /* StringPrototype.cpp in Sources */, + A3CA4B3A1BCD9DC9004C5B45 /* StringRecursionChecker.cpp in Sources */, + A3CA4B3B1BCD9DC9004C5B45 /* Structure.cpp in Sources */, + A3CA4B3C1BCD9DC9004C5B45 /* StructureChain.cpp in Sources */, + A3CA4B3D1BCD9DC9004C5B45 /* StructureRareData.cpp in Sources */, + A3CA4B3E1BCD9DC9004C5B45 /* StructureStubClearingWatchpoint.cpp in Sources */, + A3CA4B3F1BCD9DC9004C5B45 /* StructureStubInfo.cpp in Sources */, + A3CA4B401BCD9DC9004C5B45 /* MapIteratorConstructor.cpp in Sources */, + A3CA4B411BCD9DC9004C5B45 /* SuperRegion.cpp in Sources */, + A3CA4B421BCD9DC9004C5B45 /* SymbolTable.cpp in Sources */, + A3CA4B431BCD9DC9004C5B45 /* TempRegisterSet.cpp in Sources */, + A3CA4B441BCD9DC9004C5B45 /* TestRunnerUtils.cpp in Sources */, + A3CA4B451BCD9DC9004C5B45 /* ThunkGenerators.cpp in Sources */, + A3CA4B461BCD9DC9004C5B45 /* TypedArrayController.cpp in Sources */, + A3CA4B471BCD9DC9004C5B45 /* TypedArrayType.cpp in Sources */, + A3CA4B481BCD9DC9004C5B45 /* udis86.c in Sources */, + A3CA4B491BCD9DC9004C5B45 /* udis86_decode.c in Sources */, + A3CA4B4A1BCD9DC9004C5B45 /* SetIteratorConstructor.cpp in Sources */, + A3CA4B4B1BCD9DC9004C5B45 /* udis86_input.c in Sources */, + A3CA4B4C1BCD9DC9004C5B45 /* udis86_itab_holder.c in Sources */, + A3CA4B4D1BCD9DC9004C5B45 /* udis86_syn-att.c in Sources */, + A3CA4B4E1BCD9DC9004C5B45 /* udis86_syn-intel.c in Sources */, + A3CA4B4F1BCD9DC9004C5B45 /* udis86_syn.c in Sources */, + A3CA4B501BCD9DC9004C5B45 /* UDis86Disassembler.cpp in Sources */, + A3CA4B511BCD9DC9004C5B45 /* UnlinkedCodeBlock.cpp in Sources */, + A3CA4B521BCD9DC9004C5B45 /* ValueRecovery.cpp in Sources */, + A3CA4B531BCD9DC9004C5B45 /* VM.cpp in Sources */, + A3CA4B541BCD9DC9004C5B45 /* VMInspector.cpp in Sources */, + A3CA4B551BCD9DC9004C5B45 /* Watchdog.cpp in Sources */, + A3CA4B561BCD9DC9004C5B45 /* WatchdogMac.cpp in Sources */, + A3CA4B571BCD9DC9004C5B45 /* DFGAvailability.cpp in Sources */, + A3CA4B581BCD9DC9004C5B45 /* Watchpoint.cpp in Sources */, + A3CA4B591BCD9DC9004C5B45 /* Weak.cpp in Sources */, + A3CA4B5A1BCD9DC9004C5B45 /* WeakBlock.cpp in Sources */, + A3CA4B5B1BCD9DC9004C5B45 /* WeakHandleOwner.cpp in Sources */, + A3CA4B5C1BCD9DC9004C5B45 /* WeakMapConstructor.cpp in Sources */, + A3CA4B5D1BCD9DC9004C5B45 /* WeakMapData.cpp in Sources */, + A3CA4B5E1BCD9DC9004C5B45 /* WeakMapPrototype.cpp in Sources */, + A3CA4B5F1BCD9DC9004C5B45 /* WeakSet.cpp in Sources */, + A3CA4B601BCD9DC9004C5B45 /* WriteBarrierSupport.cpp in Sources */, + A3CA4B611BCD9DC9004C5B45 /* RemoteInspector.mm in Sources */, + A3CA4B621BCD9DC9004C5B45 /* RemoteInspectorDebuggableConnection.mm in Sources */, + A3CA4B631BCD9DC9004C5B45 /* RemoteInspectorXPCConnection.mm in Sources */, + A3CA4B641BCD9DC9004C5B45 /* X86Disassembler.cpp in Sources */, + A3CA4B651BCD9DC9004C5B45 /* YarrCanonicalizeUCS2.cpp in Sources */, + A3CA4B661BCD9DC9004C5B45 /* YarrInterpreter.cpp in Sources */, + A3CA4B671BCD9DC9004C5B45 /* YarrJIT.cpp in Sources */, + A3CA4B681BCD9DC9004C5B45 /* YarrPattern.cpp in Sources */, + A3CA4B691BCD9DC9004C5B45 /* InspectorAgentRegistry.cpp in Sources */, + A3CA4B6A1BCD9DC9004C5B45 /* YarrSyntaxChecker.cpp in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; /* End PBXSourcesBuildPhase section */ /* Begin PBXTargetDependency section */ @@ -8703,6 +11268,11 @@ target = 932F5B3E0822A1C700736975 /* JavaScriptCore */; targetProxy = 932F5BE60822A1C700736975 /* PBXContainerItemProxy */; }; + A3CA46B21BCD9DC9004C5B45 /* PBXTargetDependency */ = { + isa = PBXTargetDependency; + target = 10D592F61889C55E00C05A0D /* Derived Sources iOS */; + targetProxy = A3CA46B31BCD9DC9004C5B45 /* PBXContainerItemProxy */; + }; /* End PBXTargetDependency section */ /* Begin XCBuildConfiguration section */ @@ -8813,7 +11383,7 @@ ARCHS = "$(ARCHS_STANDARD_INCLUDING_64_BIT)"; PRODUCT_NAME = JSCLLIntOffsetsExtractor; SDKROOT = iphoneos7.0; - VALID_ARCHS = "armv7 armv7s arm64"; + VALID_ARCHS = "armv7 armv7s arm64 x86_64"; }; name = Debug; }; @@ -8824,7 +11394,7 @@ ARCHS = "$(ARCHS_STANDARD_INCLUDING_64_BIT)"; PRODUCT_NAME = JSCLLIntOffsetsExtractor; SDKROOT = iphoneos7.0; - VALID_ARCHS = "armv7 armv7s arm64"; + VALID_ARCHS = "armv7 armv7s arm64 x86_64"; }; name = Release; }; @@ -8835,7 +11405,7 @@ ARCHS = "$(ARCHS_STANDARD_INCLUDING_64_BIT)"; PRODUCT_NAME = JSCLLIntOffsetsExtractor; SDKROOT = iphoneos7.0; - VALID_ARCHS = "armv7 armv7s arm64"; + VALID_ARCHS = "armv7 armv7s arm64 x86_64"; }; name = Profiling; }; @@ -8846,7 +11416,7 @@ ARCHS = "$(ARCHS_STANDARD_INCLUDING_64_BIT)"; PRODUCT_NAME = JSCLLIntOffsetsExtractor; SDKROOT = iphoneos7.0; - VALID_ARCHS = "armv7 armv7s arm64"; + VALID_ARCHS = "armv7 armv7s arm64 x86_64"; }; name = Production; }; @@ -9192,6 +11762,85 @@ }; name = Production; }; + A3CA4B741BCD9DC9004C5B45 /* Debug */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = 10EAA6FF1889E6B300DEB161 /* JavaScriptCore-iOS-Static.xcconfig */; + buildSettings = { + ARCHS = "$(ARCHS_STANDARD)"; + INFOPLIST_FILE = Info.plist; + ONLY_ACTIVE_ARCH = YES; + OTHER_LDFLAGS = ( + "-lz", + "-ledit", + "-licucore", + "-lobjc", + ); + PRODUCT_NAME = "$(TARGET_NAME:rfc1034identifier)"; + SDKROOT = appletvos; + SUPPORTED_PLATFORMS = "appletvsimulator appletvos"; + VALID_ARCHS = arm64; + }; + name = Debug; + }; + A3CA4B751BCD9DC9004C5B45 /* Release */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = 10EAA6FF1889E6B300DEB161 /* JavaScriptCore-iOS-Static.xcconfig */; + buildSettings = { + ARCHS = "$(ARCHS_STANDARD)"; + INFOPLIST_FILE = Info.plist; + OTHER_LDFLAGS = ( + "-lz", + "-ledit", + "-licucore", + "-lobjc", + ); + PRODUCT_NAME = "$(TARGET_NAME:rfc1034identifier)"; + SDKROOT = appletvos; + SUPPORTED_PLATFORMS = "appletvsimulator appletvos"; + VALID_ARCHS = arm64; + }; + name = Release; + }; + A3CA4B761BCD9DC9004C5B45 /* Profiling */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = 10EAA6FF1889E6B300DEB161 /* JavaScriptCore-iOS-Static.xcconfig */; + buildSettings = { + ARCHS = "$(ARCHS_STANDARD)"; + INFOPLIST_FILE = Info.plist; + OTHER_LDFLAGS = ( + "-lz", + "-ledit", + "-licucore", + "-lobjc", + ); + PRODUCT_NAME = "$(TARGET_NAME:rfc1034identifier)"; + SDKROOT = appletvos; + SUPPORTED_PLATFORMS = "appletvsimulator appletvos"; + VALID_ARCHS = arm64; + }; + name = Profiling; + }; + A3CA4B771BCD9DC9004C5B45 /* Production */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = 10EAA6FF1889E6B300DEB161 /* JavaScriptCore-iOS-Static.xcconfig */; + buildSettings = { + ARCHS = "$(ARCHS_STANDARD)"; + BUILD_VARIANTS = normal; + INFOPLIST_FILE = Info.plist; + ONLY_ACTIVE_ARCH = NO; + OTHER_LDFLAGS = ( + "-lz", + "-ledit", + "-licucore", + "-lobjc", + ); + PRODUCT_NAME = "$(TARGET_NAME:rfc1034identifier)"; + SDKROOT = appletvos; + SUPPORTED_PLATFORMS = "appletvsimulator appletvos"; + VALID_ARCHS = arm64; + }; + name = Production; + }; A761483D0E6402F700E357FA /* Profiling */ = { isa = XCBuildConfiguration; baseConfigurationReference = 1C9051440BA9E8A70081E9D0 /* DebugRelease.xcconfig */; @@ -9419,6 +12068,17 @@ defaultConfigurationIsVisible = 0; defaultConfigurationName = Production; }; + A3CA4B731BCD9DC9004C5B45 /* Build configuration list for PBXNativeTarget "JavaScriptCore tvOS" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + A3CA4B741BCD9DC9004C5B45 /* Debug */, + A3CA4B751BCD9DC9004C5B45 /* Release */, + A3CA4B761BCD9DC9004C5B45 /* Profiling */, + A3CA4B771BCD9DC9004C5B45 /* Production */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Production; + }; /* End XCConfigurationList section */ }; rootObject = 0867D690FE84028FC02AAC07 /* Project object */; diff --git a/JavaScriptCore/JavaScriptCore.xcodeproj/xcshareddata/xcschemes/All.xcscheme b/JavaScriptCore/JavaScriptCore.xcodeproj/xcshareddata/xcschemes/All.xcscheme index 8598b7b7..8719ba29 100644 --- a/JavaScriptCore/JavaScriptCore.xcodeproj/xcshareddata/xcschemes/All.xcscheme +++ b/JavaScriptCore/JavaScriptCore.xcodeproj/xcshareddata/xcschemes/All.xcscheme @@ -23,30 +23,42 @@ + shouldUseLaunchSchemeArgsEnv = "YES"> + + + + + + + shouldUseLaunchSchemeArgsEnv = "YES"> + + + + + + + shouldUseLaunchSchemeArgsEnv = "YES"> + + + + + + + shouldUseLaunchSchemeArgsEnv = "YES"> @@ -38,17 +38,21 @@ ReferencedContainer = "container:JavaScriptCore.xcodeproj"> + + - + - + 0 + is_simulator = len([arch for arch in self.archs + if arch.startswith("i386") or + arch.startswith("x86_64")]) > 0 + if is_device and is_simulator: + raise PebbleXcodeBuildException("Can't build for Device and" + "Simulator in one go! (archs=%s)" % + self.archs) + platform = ("appletvos" if is_device else "appletvsimulator") + return platform + self.sdk_version + + def _get_params(self): + params = [] + if self.project: + params.extend(("-project", self.project)) + if self.scheme: + params.extend(("-scheme", self.scheme)) + params.extend(("-derivedDataPath", self.derived_data_path)) + if self.conf: + params.extend(("-configuration", self.conf)) + if self.archs: + concat_archs = " ".join(self.archs) + params.append("ARCHS=%s" % concat_archs) + # Auto-select SDK if archs is set: + sdk = self._get_sdk_string() + params.extend(("-sdk", sdk)) + return params + + def _xcodebuild(self, *actions): + self._pre_build_sanity_check() + params = self._get_params() + base_cmd = ["xcodebuild"] + params + actions_cmd = base_cmd + list(actions) + logging.debug("Executing: %s" % " ".join(actions_cmd)) + if subprocess.call(actions_cmd): + raise PebbleXcodeBuildException("Build failed. xcodebuild exited" + "with non-zero return code (%s)" % + self.project) + # Collect the build settings that were used: + process = subprocess.Popen(base_cmd + ["-showBuildSettings"], + stdout=subprocess.PIPE) + if process.returncode: + raise PebbleXcodeBuildException("Gettings settings failed." + " xcodebuild exited with non-zero" + " return code (%s)" % self.project) + out = process.stdout.read() + settings_list = re.findall('\s*([A-Z_]+)\s*=\s*(.*)', + out, re.MULTILINE) + self.build_settings = {pair[0]: pair[1] for pair in settings_list} + + self.is_built = True + + def build(self): + self._xcodebuild("build") + + def _check_is_built(self): + if not self.is_built: + raise PebbleXcodeBuildException("Cannot be accessed before build()" + "has been finished.") + + def _path_from_build_settings_components(self, *setting_names): + self._check_is_built() + components = [self.build_settings[n] for n in setting_names] + # We want to treat absolute components as relative paths + concat_path = os.sep.join(components) + return os.path.normpath(concat_path) + + def built_product_path(self): + return self._path_from_build_settings_components("BUILT_PRODUCTS_DIR", + "FULL_PRODUCT_NAME") + + def public_headers_path(self): + args = ("BUILT_PRODUCTS_DIR", "PUBLIC_HEADERS_FOLDER_PATH") + return self._path_from_build_settings_components(*args) + + +class FrameworkBuild(object): + def __init__(self, project=None, workspace=None, scheme=None, + conf="Release", outdir=None, name=None, + derived_data_path=None): + self.scheme = scheme + self.name = name + self.devicebuildarm64 = XcodeBuild(project, derived_data_path=None if derived_data_path is None else os.path.join(derived_data_path, "arm64")) + self.simulatorbuild64 = XcodeBuild(project, derived_data_path=None if derived_data_path is None else os.path.join(derived_data_path, "x86_64")) + self.outdir = outdir + for (bld, archs) in [self.devicebuildarm64, ["arm64"]], \ + [self.simulatorbuild64, ["x86_64"]]: + bld.archs = archs + bld.scheme = scheme + bld.conf = conf + + def build(self): + name = self.name or self.scheme + if " " in name: + name = name.replace(" ", "-") + + # Run the builds of the libraries: + self.devicebuildarm64.build() + self.simulatorbuild64.build() + + # Create the framework directory structure: + temp_dir = tempfile.mkdtemp() + framework_name = name + ".framework" + framework_dir = os.path.join(temp_dir, framework_name) + versions_dir = os.path.join(framework_dir, "Versions") + a_dir = os.path.join(versions_dir, "A") + lib_path = os.path.join(a_dir, name) + headers_dir = os.path.join(a_dir, "Headers") + os.makedirs(headers_dir) + os.symlink("A", os.path.join(versions_dir, "Current")) + os.symlink(os.path.join("Versions", "Current", "Headers"), + os.path.join(framework_dir, "Headers")) + os.symlink(os.path.join("Versions", "Current", name), + os.path.join(framework_dir, name)) + + # Move public headers: + for filename in os.listdir(self.devicebuildarm64.public_headers_path()): + shutil.move(os.path.join(self.devicebuildarm64.public_headers_path(), filename), headers_dir) + #shutil.move(self.devicebuildarm64.public_headers_path(), headers_dir) + + # Use lipo to create one fat static library: + lipo_cmd = ["lipo", "-create", + self.devicebuildarm64.built_product_path(), + self.simulatorbuild64.built_product_path(), + "-output", lib_path] + logging.debug("Executing: %s" % " ".join(lipo_cmd)) + if subprocess.call(lipo_cmd): + raise PebbleXcodeBuildException("lipo failed") + + # Move to outdir: + if self.outdir: + if not os.path.exists(self.outdir): + os.makedirs(self.outdir) + self._built_product_path = os.path.join(self.outdir, + framework_name) + self._public_headers_path = os.path.join(self.outdir, + framework_name, + "Versions", + "A", "Headers") + if os.path.exists(self._built_product_path): + shutil.rmtree(self._built_product_path) + shutil.move(framework_dir, self._built_product_path) + else: + self._built_product_path = framework_dir + self._public_headers_path = headers_dir + + def built_product_path(self): + return self._built_product_path + + def public_headers_path(self): + return self._public_headers_path From bde6a43159fbe1f9f13bf115ae5259265722a84f Mon Sep 17 00:00:00 2001 From: Dario Segura Date: Tue, 13 Oct 2015 23:20:50 -0400 Subject: [PATCH 64/69] [TVOS] Moved tvOS schemes to the shared data folder. --- .../xcschemes/JavaScriptCore tvOS.xcscheme | 80 +++++++++++++++++++ .../xcshareddata/xcschemes/WTF tvOS.xcscheme | 80 +++++++++++++++++++ 2 files changed, 160 insertions(+) create mode 100644 JavaScriptCore/JavaScriptCore.xcodeproj/xcshareddata/xcschemes/JavaScriptCore tvOS.xcscheme create mode 100644 WTF/WTF.xcodeproj/xcshareddata/xcschemes/WTF tvOS.xcscheme diff --git a/JavaScriptCore/JavaScriptCore.xcodeproj/xcshareddata/xcschemes/JavaScriptCore tvOS.xcscheme b/JavaScriptCore/JavaScriptCore.xcodeproj/xcshareddata/xcschemes/JavaScriptCore tvOS.xcscheme new file mode 100644 index 00000000..44ca77c2 --- /dev/null +++ b/JavaScriptCore/JavaScriptCore.xcodeproj/xcshareddata/xcschemes/JavaScriptCore tvOS.xcscheme @@ -0,0 +1,80 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/WTF/WTF.xcodeproj/xcshareddata/xcschemes/WTF tvOS.xcscheme b/WTF/WTF.xcodeproj/xcshareddata/xcschemes/WTF tvOS.xcscheme new file mode 100644 index 00000000..eb614b59 --- /dev/null +++ b/WTF/WTF.xcodeproj/xcshareddata/xcschemes/WTF tvOS.xcscheme @@ -0,0 +1,80 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + From 84abbecddca189f1d8b7d4847de52718db31d094 Mon Sep 17 00:00:00 2001 From: Dario Segura Date: Wed, 14 Oct 2015 17:26:55 -0400 Subject: [PATCH 65/69] [TVOS] maketvos script names the output framework JavaScriptCore instead of JavaScriptCore-tvOS --- maketvos.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/maketvos.py b/maketvos.py index c707e0c7..09b99396 100755 --- a/maketvos.py +++ b/maketvos.py @@ -23,14 +23,14 @@ def build(out, derived_data_path): jsc = FrameworkBuild(workspace="JavaScriptCore-iOS.xcworkspace", scheme="JavaScriptCore tvOS", - name="JavaScriptCore-tvOS", + name="JavaScriptCore", conf="Production", outdir=outdir, derived_data_path=derived_data_path) jsc.build() # FIXME: wtf headers are copied... remove them: - shutil.rmtree(os.path.join(outdir, 'JavaScriptCore-tvOS.framework', + shutil.rmtree(os.path.join(outdir, 'JavaScriptCore.framework', 'Headers', 'wtf')) return outdir From fccffeeeed23919ac37b27c0e11a9a88102d92c3 Mon Sep 17 00:00:00 2001 From: Dario Segura Date: Wed, 21 Oct 2015 15:36:08 -0400 Subject: [PATCH 66/69] [TVOS] Adds the -fembed-bitcode flag to build script so the framework can be used while archiving tvOS builds. --- xcodebuildtvos.py | 1 + 1 file changed, 1 insertion(+) diff --git a/xcodebuildtvos.py b/xcodebuildtvos.py index 1e608c41..52533816 100755 --- a/xcodebuildtvos.py +++ b/xcodebuildtvos.py @@ -67,6 +67,7 @@ def _get_params(self): # Auto-select SDK if archs is set: sdk = self._get_sdk_string() params.extend(("-sdk", sdk)) + params.append("OTHER_CFLAGS=-fembed-bitcode") return params def _xcodebuild(self, *actions): From 81c198ce218a442083effd3cc2ba65e1dc26dda5 Mon Sep 17 00:00:00 2001 From: Dario Segura Date: Wed, 21 Oct 2015 18:44:48 -0400 Subject: [PATCH 67/69] [TVOS] Suppressed unused argument warning (promoted to error by default) to avoid issues while building from command line for tvOS. --- xcodebuildtvos.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/xcodebuildtvos.py b/xcodebuildtvos.py index 52533816..b214ee72 100755 --- a/xcodebuildtvos.py +++ b/xcodebuildtvos.py @@ -67,7 +67,8 @@ def _get_params(self): # Auto-select SDK if archs is set: sdk = self._get_sdk_string() params.extend(("-sdk", sdk)) - params.append("OTHER_CFLAGS=-fembed-bitcode") + + params.append("OTHER_CFLAGS=-Qunused-arguments -fembed-bitcode") return params def _xcodebuild(self, *actions): From c6520264e901144078770c4bb24a11704bbe495b Mon Sep 17 00:00:00 2001 From: Dominic Szablewski Date: Thu, 22 Oct 2015 18:32:05 +0200 Subject: [PATCH 68/69] Only embed bitcode for device build; see #32 --- xcodebuildtvos.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/xcodebuildtvos.py b/xcodebuildtvos.py index b214ee72..ad3b2c0f 100755 --- a/xcodebuildtvos.py +++ b/xcodebuildtvos.py @@ -68,7 +68,11 @@ def _get_params(self): sdk = self._get_sdk_string() params.extend(("-sdk", sdk)) - params.append("OTHER_CFLAGS=-Qunused-arguments -fembed-bitcode") + is_device = len([arch for arch in self.archs + if arch.startswith("arm")]) > 0 + if is_device: + params.append("OTHER_CFLAGS=-Qunused-arguments -fembed-bitcode") + return params def _xcodebuild(self, *actions): From 544b3a2f17758b081f33ac44829479ff5a82ae79 Mon Sep 17 00:00:00 2001 From: Dominic Szablewski Date: Wed, 30 Mar 2016 12:29:53 +0200 Subject: [PATCH 69/69] Added discontinued notice --- README.md | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/README.md b/README.md index a4318902..a27a0117 100644 --- a/README.md +++ b/README.md @@ -1,3 +1,9 @@ +### This Project has been discontinued – Mar. 2016 + +JSC is now a public library on iOS and tvOS. [Ejecta](https://github.com/phoboslab/Ejecta) has switched to the JSC library provided by the System. It still has some limitations (no native Typed Array API) as of 2016.03.30, but they are mostly workaroundable. + +Also, compiling it for tvOS requires bitcode compilation now, which this fork of JSC does not support. You can read up on the [fascinating details in my blog](http://phoboslab.org/log/2015/11/the-absolute-worst-way-to-read-typed-array-data-with-javascriptcore). + # JavaScriptCore iOS The JavaScriptCore library is part of the [WebKit project](http://www.webkit.org/) and thus Open Source. However, in the sources you get from the [WebKit SVN](https://svn.webkit.org/repository/webkit/trunk), the XCode project files are curiously missing an iOS compile target. The sources you get from [opensource.apple.com](http://opensource.apple.com/release/ios-601/) are missing the project files altogether. You can't compile it at all. That's quite the Open Source spirit, Apple!