WebKit Bugzilla
Attachment 338783 Details for
Bug 184976
: Push the definition of PtrTag down to the WTF layer.
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
patch for landing + CMake fixes.
bug-184976.patch (text/plain), 46.28 KB, created by
Mark Lam
on 2018-04-25 13:39:20 PDT
(
hide
)
Description:
patch for landing + CMake fixes.
Filename:
MIME Type:
Creator:
Mark Lam
Created:
2018-04-25 13:39:20 PDT
Size:
46.28 KB
patch
obsolete
>Index: Source/JavaScriptCore/ChangeLog >=================================================================== >--- Source/JavaScriptCore/ChangeLog (revision 231000) >+++ Source/JavaScriptCore/ChangeLog (working copy) >@@ -1,3 +1,33 @@ >+2018-04-25 Mark Lam <mark.lam@apple.com> >+ >+ Push the definition of PtrTag down to the WTF layer. >+ https://bugs.webkit.org/show_bug.cgi?id=184976 >+ <rdar://problem/39723901> >+ >+ Reviewed by Saam Barati. >+ >+ * CMakeLists.txt: >+ * JavaScriptCore.xcodeproj/project.pbxproj: >+ * assembler/ARM64Assembler.h: >+ * assembler/AbstractMacroAssembler.h: >+ * assembler/MacroAssemblerCodeRef.cpp: >+ * assembler/MacroAssemblerCodeRef.h: >+ * b3/B3MathExtras.cpp: >+ * bytecode/LLIntCallLinkInfo.h: >+ * disassembler/Disassembler.h: >+ * ftl/FTLJITCode.cpp: >+ * interpreter/InterpreterInlines.h: >+ * jit/ExecutableAllocator.h: >+ * jit/JITOperations.cpp: >+ * jit/ThunkGenerator.h: >+ * jit/ThunkGenerators.h: >+ * llint/LLIntOffsetsExtractor.cpp: >+ * llint/LLIntPCRanges.h: >+ * runtime/JSCPtrTag.h: Added. >+ * runtime/NativeFunction.h: >+ * runtime/PtrTag.h: Removed. >+ * runtime/VMTraps.cpp: >+ > 2018-04-25 Michael Catanzaro <mcatanzaro@igalia.com> > > [GTK] Miscellaneous build cleanups >Index: Source/JavaScriptCore/CMakeLists.txt >=================================================================== >--- Source/JavaScriptCore/CMakeLists.txt (revision 230998) >+++ Source/JavaScriptCore/CMakeLists.txt (working copy) >@@ -770,6 +770,7 @@ set(JavaScriptCore_PRIVATE_FRAMEWORK_HEA > runtime/JSCJSValue.h > runtime/JSCJSValueInlines.h > runtime/JSCPoison.h >+ runtime/JSCPtrTag.h > runtime/JSCallee.h > runtime/JSCast.h > runtime/JSCell.h >@@ -838,7 +839,6 @@ set(JavaScriptCore_PRIVATE_FRAMEWORK_HEA > runtime/Operations.h > runtime/Options.h > runtime/ParseInt.h >- runtime/PtrTag.h > runtime/PrivateName.h > runtime/ProgramExecutable.h > runtime/PromiseDeferredTimer.h >Index: Source/JavaScriptCore/JavaScriptCore.xcodeproj/project.pbxproj >=================================================================== >--- Source/JavaScriptCore/JavaScriptCore.xcodeproj/project.pbxproj (revision 230998) >+++ Source/JavaScriptCore/JavaScriptCore.xcodeproj/project.pbxproj (working copy) >@@ -1771,8 +1771,8 @@ > FE63DD541EA9B61E00103A69 /* Printer.h in Headers */ = {isa = PBXBuildFile; fileRef = FE63DD531EA9B60E00103A69 /* Printer.h */; settings = {ATTRIBUTES = (Private, ); }; }; > FE6491371D78F01D00A694D4 /* ExceptionScope.h in Headers */ = {isa = PBXBuildFile; fileRef = FE6491361D78F01300A694D4 /* ExceptionScope.h */; settings = {ATTRIBUTES = (Private, ); }; }; > FE68C6371B90DE040042BCB3 /* MacroAssemblerPrinter.h in Headers */ = {isa = PBXBuildFile; fileRef = FE68C6361B90DDD90042BCB3 /* MacroAssemblerPrinter.h */; settings = {ATTRIBUTES = (Private, ); }; }; >- FE6C1E4A20366F0100BDC2B7 /* PtrTag.h in Headers */ = {isa = PBXBuildFile; fileRef = FE9AE1C82032C887002B6934 /* PtrTag.h */; settings = {ATTRIBUTES = (Private, ); }; }; > FE6F56DE1E64EAD600D17801 /* VMTraps.h in Headers */ = {isa = PBXBuildFile; fileRef = FE6F56DD1E64E92000D17801 /* VMTraps.h */; settings = {ATTRIBUTES = (Private, ); }; }; >+ FE7497E6209001B10003565B /* JSCPtrTag.h in Headers */ = {isa = PBXBuildFile; fileRef = FE7497E5209001B00003565B /* JSCPtrTag.h */; settings = {ATTRIBUTES = (Private, ); }; }; > FE7C41961B97FC4B00F4D598 /* PingPongStackOverflowTest.cpp in Sources */ = {isa = PBXBuildFile; fileRef = FEDA50D41B97F442009A3B4F /* PingPongStackOverflowTest.cpp */; }; > FE80C1971D775CDD008510C0 /* CatchScope.h in Headers */ = {isa = PBXBuildFile; fileRef = FE80C1961D775B27008510C0 /* CatchScope.h */; settings = {ATTRIBUTES = (Private, ); }; }; > FE99B2491C24C3D300C82159 /* JITNegGenerator.h in Headers */ = {isa = PBXBuildFile; fileRef = FE99B2481C24B6D300C82159 /* JITNegGenerator.h */; }; >@@ -4707,6 +4707,7 @@ > FE68C6361B90DDD90042BCB3 /* MacroAssemblerPrinter.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MacroAssemblerPrinter.h; sourceTree = "<group>"; }; > FE6F56DC1E64E92000D17801 /* VMTraps.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = VMTraps.cpp; sourceTree = "<group>"; }; > FE6F56DD1E64E92000D17801 /* VMTraps.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = VMTraps.h; sourceTree = "<group>"; }; >+ FE7497E5209001B00003565B /* JSCPtrTag.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSCPtrTag.h; sourceTree = "<group>"; }; > FE80C1961D775B27008510C0 /* CatchScope.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CatchScope.h; sourceTree = "<group>"; }; > FE80C1981D775FB4008510C0 /* CatchScope.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = CatchScope.cpp; sourceTree = "<group>"; }; > FE80C19A1D7768FD008510C0 /* ExceptionEventLocation.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = ExceptionEventLocation.cpp; sourceTree = "<group>"; }; >@@ -4714,7 +4715,6 @@ > FE98B5B61BB9AE110073E7A6 /* JITSubGenerator.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JITSubGenerator.h; sourceTree = "<group>"; }; > FE99B2471C24B6D300C82159 /* JITNegGenerator.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JITNegGenerator.cpp; sourceTree = "<group>"; }; > FE99B2481C24B6D300C82159 /* JITNegGenerator.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JITNegGenerator.h; sourceTree = "<group>"; }; >- FE9AE1C82032C887002B6934 /* PtrTag.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PtrTag.h; sourceTree = "<group>"; }; > FEA0861E182B7A0400F6D851 /* Breakpoint.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Breakpoint.h; sourceTree = "<group>"; }; > FEA0861F182B7A0400F6D851 /* DebuggerPrimitives.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DebuggerPrimitives.h; sourceTree = "<group>"; }; > FEA0C4001CDD7D0E00481991 /* FunctionWhitelist.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = FunctionWhitelist.cpp; sourceTree = "<group>"; }; >@@ -6743,6 +6743,7 @@ > 2A05ABD41961DF2400341750 /* JSPropertyNameEnumerator.h */, > 862553CE16136AA5009F17D0 /* JSProxy.cpp */, > 862553CF16136AA5009F17D0 /* JSProxy.h */, >+ FE7497E5209001B00003565B /* JSCPtrTag.h */, > 534638721E70D01500F12AC1 /* JSRunLoopTimer.cpp */, > 534638701E70CF3D00F12AC1 /* JSRunLoopTimer.h */, > 14874AE115EBDE4A002E3587 /* JSScope.cpp */, >@@ -6881,7 +6882,6 @@ > 79B00CBB1C6AB07E0088C65D /* ProxyObject.h */, > 79160DBB1C8E3EC8008C085A /* ProxyRevoke.cpp */, > 79160DBC1C8E3EC8008C085A /* ProxyRevoke.h */, >- FE9AE1C82032C887002B6934 /* PtrTag.h */, > 0F5780A118FE1E98001E72D9 /* PureNaN.h */, > 0F0CD4C015F1A6040032F1C0 /* PutDirectIndexMode.h */, > 147B84620E6DE6B1004775A4 /* PutPropertySlot.h */, >@@ -9061,6 +9061,7 @@ > 7C008CDB187124BB00955C24 /* JSPromiseDeferred.h in Headers */, > 7C184E1F17BEE22E007CB63A /* JSPromisePrototype.h in Headers */, > 996B731F1BDA08EF00331B84 /* JSPromisePrototype.lut.h in Headers */, >+ FE7497E6209001B10003565B /* JSCPtrTag.h in Headers */, > 2A05ABD61961DF2400341750 /* JSPropertyNameEnumerator.h in Headers */, > 862553D216136E1A009F17D0 /* JSProxy.h in Headers */, > A552C3801ADDB8FE00139726 /* JSRemoteInspector.h in Headers */, >@@ -9287,7 +9288,6 @@ > 79B00CBD1C6AB07E0088C65D /* ProxyConstructor.h in Headers */, > 79B00CBF1C6AB07E0088C65D /* ProxyObject.h in Headers */, > 79160DBE1C8E3EC8008C085A /* ProxyRevoke.h in Headers */, >- FE6C1E4A20366F0100BDC2B7 /* PtrTag.h in Headers */, > 0F5780A218FE1E98001E72D9 /* PureNaN.h in Headers */, > 0F15CD231BA5F9860031FFD3 /* PutByIdFlags.h in Headers */, > 0F9332A414CA7DD90085F3C6 /* PutByIdStatus.h in Headers */, >Index: Source/JavaScriptCore/assembler/ARM64Assembler.h >=================================================================== >--- Source/JavaScriptCore/assembler/ARM64Assembler.h (revision 230998) >+++ Source/JavaScriptCore/assembler/ARM64Assembler.h (working copy) >@@ -29,7 +29,7 @@ > > #include "AssemblerBuffer.h" > #include "AssemblerCommon.h" >-#include "PtrTag.h" >+#include "JSCPtrTag.h" > #include <limits.h> > #include <wtf/Assertions.h> > #include <wtf/Vector.h> >Index: Source/JavaScriptCore/assembler/AbstractMacroAssembler.h >=================================================================== >--- Source/JavaScriptCore/assembler/AbstractMacroAssembler.h (revision 230998) >+++ Source/JavaScriptCore/assembler/AbstractMacroAssembler.h (working copy) >@@ -31,10 +31,10 @@ > #include "CPU.h" > #include "CodeLocation.h" > #include "JSCJSValue.h" >+#include "JSCPtrTag.h" > #include "MacroAssemblerCodeRef.h" > #include "MacroAssemblerHelpers.h" > #include "Options.h" >-#include "PtrTag.h" > #include <wtf/CryptographicallyRandomNumber.h> > #include <wtf/Noncopyable.h> > #include <wtf/SharedTask.h> >Index: Source/JavaScriptCore/assembler/MacroAssemblerCodeRef.cpp >=================================================================== >--- Source/JavaScriptCore/assembler/MacroAssemblerCodeRef.cpp (revision 230998) >+++ Source/JavaScriptCore/assembler/MacroAssemblerCodeRef.cpp (working copy) >@@ -28,7 +28,7 @@ > > #include "Disassembler.h" > #include "JSCInlines.h" >-#include "PtrTag.h" >+#include "JSCPtrTag.h" > #include <mutex> > > namespace JSC { >Index: Source/JavaScriptCore/assembler/MacroAssemblerCodeRef.h >=================================================================== >--- Source/JavaScriptCore/assembler/MacroAssemblerCodeRef.h (revision 230998) >+++ Source/JavaScriptCore/assembler/MacroAssemblerCodeRef.h (working copy) >@@ -27,7 +27,7 @@ > > #include "ExecutableAllocator.h" > #include "JSCPoison.h" >-#include "PtrTag.h" >+#include "JSCPtrTag.h" > #include <wtf/DataLog.h> > #include <wtf/PrintStream.h> > #include <wtf/RefPtr.h> >Index: Source/JavaScriptCore/b3/B3MathExtras.cpp >=================================================================== >--- Source/JavaScriptCore/b3/B3MathExtras.cpp (revision 230998) >+++ Source/JavaScriptCore/b3/B3MathExtras.cpp (working copy) >@@ -35,8 +35,8 @@ > #include "B3ConstPtrValue.h" > #include "B3UpsilonValue.h" > #include "B3ValueInlines.h" >+#include "JSCPtrTag.h" > #include "MathCommon.h" >-#include "PtrTag.h" > > namespace JSC { namespace B3 { > >Index: Source/JavaScriptCore/bytecode/LLIntCallLinkInfo.h >=================================================================== >--- Source/JavaScriptCore/bytecode/LLIntCallLinkInfo.h (revision 230998) >+++ Source/JavaScriptCore/bytecode/LLIntCallLinkInfo.h (working copy) >@@ -25,9 +25,9 @@ > > #pragma once > >+#include "JSCPtrTag.h" > #include "JSFunction.h" > #include "MacroAssemblerCodeRef.h" >-#include "PtrTag.h" > #include <wtf/SentinelLinkedList.h> > > namespace JSC { >Index: Source/JavaScriptCore/disassembler/Disassembler.h >=================================================================== >--- Source/JavaScriptCore/disassembler/Disassembler.h (revision 230998) >+++ Source/JavaScriptCore/disassembler/Disassembler.h (working copy) >@@ -25,8 +25,8 @@ > > #pragma once > >+#include "JSCPtrTag.h" > #include "JSExportMacros.h" >-#include "PtrTag.h" > #include <functional> > #include <wtf/PrintStream.h> > #include <wtf/text/CString.h> >Index: Source/JavaScriptCore/ftl/FTLJITCode.cpp >=================================================================== >--- Source/JavaScriptCore/ftl/FTLJITCode.cpp (revision 230998) >+++ Source/JavaScriptCore/ftl/FTLJITCode.cpp (working copy) >@@ -29,7 +29,7 @@ > #if ENABLE(FTL_JIT) > > #include "FTLState.h" >-#include "PtrTag.h" >+#include "JSCPtrTag.h" > > namespace JSC { namespace FTL { > >Index: Source/JavaScriptCore/interpreter/InterpreterInlines.h >=================================================================== >--- Source/JavaScriptCore/interpreter/InterpreterInlines.h (revision 230998) >+++ Source/JavaScriptCore/interpreter/InterpreterInlines.h (working copy) >@@ -28,8 +28,8 @@ > > #include "Instruction.h" > #include "Interpreter.h" >+#include "JSCPtrTag.h" > #include "LLIntData.h" >-#include "PtrTag.h" > #include "UnlinkedCodeBlock.h" > > namespace JSC { >Index: Source/JavaScriptCore/jit/ExecutableAllocator.h >=================================================================== >--- Source/JavaScriptCore/jit/ExecutableAllocator.h (revision 230998) >+++ Source/JavaScriptCore/jit/ExecutableAllocator.h (working copy) >@@ -26,7 +26,7 @@ > #pragma once > > #include "JITCompilationEffort.h" >-#include "PtrTag.h" >+#include "JSCPtrTag.h" > #include <stddef.h> // for ptrdiff_t > #include <limits> > #include <wtf/Assertions.h> >Index: Source/JavaScriptCore/jit/JITOperations.cpp >=================================================================== >--- Source/JavaScriptCore/jit/JITOperations.cpp (revision 230998) >+++ Source/JavaScriptCore/jit/JITOperations.cpp (working copy) >@@ -55,6 +55,7 @@ > #include "JSAsyncFunction.h" > #include "JSAsyncGeneratorFunction.h" > #include "JSCInlines.h" >+#include "JSCPtrTag.h" > #include "JSGeneratorFunction.h" > #include "JSGlobalObjectFunctions.h" > #include "JSLexicalEnvironment.h" >@@ -64,7 +65,6 @@ > #include "PolymorphicAccess.h" > #include "ProgramCodeBlock.h" > #include "PropertyName.h" >-#include "PtrTag.h" > #include "RegExpObject.h" > #include "Repatch.h" > #include "ScopedArguments.h" >Index: Source/JavaScriptCore/jit/ThunkGenerator.h >=================================================================== >--- Source/JavaScriptCore/jit/ThunkGenerator.h (revision 230998) >+++ Source/JavaScriptCore/jit/ThunkGenerator.h (working copy) >@@ -27,7 +27,7 @@ > > #if ENABLE(JIT) > >-#include "PtrTag.h" >+#include "JSCPtrTag.h" > > namespace JSC { > class VM; >Index: Source/JavaScriptCore/jit/ThunkGenerators.h >=================================================================== >--- Source/JavaScriptCore/jit/ThunkGenerators.h (revision 230998) >+++ Source/JavaScriptCore/jit/ThunkGenerators.h (working copy) >@@ -26,7 +26,7 @@ > #pragma once > > #include "CodeSpecializationKind.h" >-#include "PtrTag.h" >+#include "JSCPtrTag.h" > > #if ENABLE(JIT) > namespace JSC { >Index: Source/JavaScriptCore/llint/LLIntOffsetsExtractor.cpp >=================================================================== >--- Source/JavaScriptCore/llint/LLIntOffsetsExtractor.cpp (revision 230998) >+++ Source/JavaScriptCore/llint/LLIntOffsetsExtractor.cpp (working copy) >@@ -38,6 +38,7 @@ > #include "Interpreter.h" > #include "JSArray.h" > #include "JSArrayBufferView.h" >+#include "JSCPtrTag.h" > #include "JSCast.h" > #include "JSFunction.h" > #include "JSGlobalObject.h" >@@ -51,7 +52,6 @@ > #include "MarkedSpace.h" > #include "NativeExecutable.h" > #include "ProtoCallFrame.h" >-#include "PtrTag.h" > #include "ShadowChicken.h" > #include "Structure.h" > #include "StructureChain.h" >Index: Source/JavaScriptCore/llint/LLIntPCRanges.h >=================================================================== >--- Source/JavaScriptCore/llint/LLIntPCRanges.h (revision 230998) >+++ Source/JavaScriptCore/llint/LLIntPCRanges.h (working copy) >@@ -25,7 +25,7 @@ > > #pragma once > >-#include "PtrTag.h" >+#include "JSCPtrTag.h" > > namespace JSC { > >Index: Source/JavaScriptCore/runtime/JSCPtrTag.h >=================================================================== >--- Source/JavaScriptCore/runtime/JSCPtrTag.h (nonexistent) >+++ Source/JavaScriptCore/runtime/JSCPtrTag.h (working copy) >@@ -0,0 +1,59 @@ >+/* >+ * Copyright (C) 2018 Apple Inc. All rights reserved. >+ * >+ * Redistribution and use in source and binary forms, with or without >+ * modification, are permitted provided that the following conditions >+ * are met: >+ * 1. Redistributions of source code must retain the above copyright >+ * notice, this list of conditions and the following disclaimer. >+ * 2. Redistributions in binary form must reproduce the above copyright >+ * notice, this list of conditions and the following disclaimer in the >+ * documentation and/or other materials provided with the distribution. >+ * >+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. ``AS IS'' AND ANY >+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE >+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR >+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR >+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, >+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, >+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR >+ * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY >+ * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT >+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE >+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. >+ */ >+ >+#pragma once >+ >+#include <wtf/PtrTag.h> >+ >+namespace JSC { >+ >+using PtrTag = WTF::PtrTag; >+ >+#define FOR_EACH_JSC_PTRTAG(v) \ >+ v(B3CCallPtrTag) \ >+ v(B3CompilationPtrTag) \ >+ v(BytecodePtrTag) \ >+ v(DisassemblyPtrTag) \ >+ v(ExceptionHandlerPtrTag) \ >+ v(JITThunkPtrTag) \ >+ v(JITStubRoutinePtrTag) \ >+ v(JSEntryPtrTag) \ >+ v(JSInternalPtrTag) \ >+ v(JSSwitchPtrTag) \ >+ v(LinkBufferPtrTag) \ >+ v(OperationPtrTag) \ >+ v(OSRExitPtrTag) \ >+ v(SlowPathPtrTag) \ >+ v(WasmEntryPtrTag) \ >+ v(Yarr8BitPtrTag) \ >+ v(Yarr16BitPtrTag) \ >+ v(YarrMatchOnly8BitPtrTag) \ >+ v(YarrMatchOnly16BitPtrTag) \ >+ v(YarrBacktrackPtrTag) \ >+ >+FOR_EACH_JSC_PTRTAG(WTF_DECLARE_PTRTAG) >+ >+} // namespace JSC >+ >Index: Source/JavaScriptCore/runtime/NativeFunction.h >=================================================================== >--- Source/JavaScriptCore/runtime/NativeFunction.h (revision 230998) >+++ Source/JavaScriptCore/runtime/NativeFunction.h (working copy) >@@ -26,7 +26,7 @@ > #pragma once > > #include "JSCJSValue.h" >-#include "PtrTag.h" >+#include "JSCPtrTag.h" > > namespace JSC { > >Index: Source/JavaScriptCore/runtime/PtrTag.h >=================================================================== >--- Source/JavaScriptCore/runtime/PtrTag.h (revision 230998) >+++ Source/JavaScriptCore/runtime/PtrTag.h (nonexistent) >@@ -1,180 +0,0 @@ >-/* >- * Copyright (C) 2018 Apple Inc. All rights reserved. >- * >- * Redistribution and use in source and binary forms, with or without >- * modification, are permitted provided that the following conditions >- * are met: >- * 1. Redistributions of source code must retain the above copyright >- * notice, this list of conditions and the following disclaimer. >- * 2. Redistributions in binary form must reproduce the above copyright >- * notice, this list of conditions and the following disclaimer in the >- * documentation and/or other materials provided with the distribution. >- * >- * THIS SOFTWARE IS PROVIDED BY APPLE INC. ``AS IS'' AND ANY >- * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE >- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR >- * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR >- * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, >- * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, >- * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR >- * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY >- * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT >- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE >- * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. >- */ >- >-#pragma once >- >-#include <wtf/PointerPreparations.h> >- >-namespace JSC { >- >-#define FOR_EACH_BASE_PTRTAG_ENUM(v) \ >- v(NoPtrTag) \ >- v(CFunctionPtrTag) \ >- >-#define FOR_EACH_ADDITIONAL_PTRTAG_ENUM(v) \ >- v(B3CCallPtrTag) \ >- v(B3CompilationPtrTag) \ >- v(BytecodePtrTag) \ >- v(DisassemblyPtrTag) \ >- v(ExceptionHandlerPtrTag) \ >- v(JITThunkPtrTag) \ >- v(JITStubRoutinePtrTag) \ >- v(JSEntryPtrTag) \ >- v(JSInternalPtrTag) \ >- v(JSSwitchPtrTag) \ >- v(LinkBufferPtrTag) \ >- v(OperationPtrTag) \ >- v(OSRExitPtrTag) \ >- v(SlowPathPtrTag) \ >- v(WasmEntryPtrTag) \ >- v(Yarr8BitPtrTag) \ >- v(Yarr16BitPtrTag) \ >- v(YarrMatchOnly8BitPtrTag) \ >- v(YarrMatchOnly16BitPtrTag) \ >- v(YarrBacktrackPtrTag) \ >- >-#define FOR_EACH_PTRTAG_ENUM(v) \ >- FOR_EACH_BASE_PTRTAG_ENUM(v) \ >- FOR_EACH_ADDITIONAL_PTRTAG_ENUM(v) \ >- >-enum PtrTag : uintptr_t { >- NoPtrTag, >- CFunctionPtrTag, >- >-#ifndef PTRTAG_ENUM_HASH >-#define DECLARE_PTRTAG_ENUM(tag) tag, >-#else >-#define DECLARE_PTRTAG_ENUM(tag) tag = PTRTAG_ENUM_HASH(tag), >-#endif >- FOR_EACH_ADDITIONAL_PTRTAG_ENUM(DECLARE_PTRTAG_ENUM) >-#undef DECLARE_PTRTAG_ENUM >-}; >- >-static_assert(static_cast<uintptr_t>(NoPtrTag) == static_cast<uintptr_t>(0), ""); >-static_assert(static_cast<uintptr_t>(CFunctionPtrTag) == static_cast<uintptr_t>(1), ""); >- >-inline const char* ptrTagName(PtrTag tag) >-{ >-#define RETURN_PTRTAG_NAME(_tagName) case _tagName: return #_tagName; >- switch (tag) { >- FOR_EACH_PTRTAG_ENUM(RETURN_PTRTAG_NAME) >- default: return "<unknown>"; >- } >-#undef RETURN_PTRTAG_NAME >-} >- >-#if !USE(POINTER_PROFILING) >- >-inline const char* tagForPtr(const void*) { return "<no tag>"; } >- >-template<typename... Arguments> >-inline constexpr PtrTag ptrTag(Arguments&&...) { return NoPtrTag; } >- >-template<typename T, typename PtrType, typename = std::enable_if_t<std::is_pointer<PtrType>::value && !std::is_same<T, PtrType>::value>> >-inline constexpr T tagCodePtr(PtrType ptr, PtrTag) { return bitwise_cast<T>(ptr); } >- >-template<typename T, PtrTag, typename PtrType, typename = std::enable_if_t<std::is_pointer<PtrType>::value>> >-inline T tagCodePtr(PtrType ptr) { return bitwise_cast<T>(ptr); } >- >-template<typename PtrType, typename = std::enable_if_t<std::is_pointer<PtrType>::value>> >-inline constexpr PtrType tagCodePtr(PtrType ptr, PtrTag) { return ptr; } >- >-template<PtrTag, typename PtrType, typename = std::enable_if_t<std::is_pointer<PtrType>::value>> >-inline PtrType tagCodePtr(PtrType ptr) { return ptr; } >- >-template<typename T, typename PtrType, typename = std::enable_if_t<std::is_pointer<PtrType>::value && !std::is_same<T, PtrType>::value>> >-inline constexpr T untagCodePtr(PtrType ptr, PtrTag) { return bitwise_cast<T>(ptr); } >- >-template<typename T, PtrTag, typename PtrType, typename = std::enable_if_t<std::is_pointer<PtrType>::value>> >-inline T untagCodePtr(PtrType ptr) { return bitwise_cast<T>(ptr); } >- >-template<typename PtrType, typename = std::enable_if_t<std::is_pointer<PtrType>::value>> >-inline constexpr PtrType untagCodePtr(PtrType ptr, PtrTag) { return ptr; } >- >-template<PtrTag, typename PtrType, typename = std::enable_if_t<std::is_pointer<PtrType>::value>> >-inline PtrType untagCodePtr(PtrType ptr) { return ptr; } >- >-template<typename T, typename PtrType, typename = std::enable_if_t<std::is_pointer<PtrType>::value && !std::is_same<T, PtrType>::value>> >-inline constexpr T retagCodePtr(PtrType ptr, PtrTag, PtrTag) { return bitwise_cast<T>(ptr); } >- >-template<typename T, PtrTag, PtrTag, typename PtrType, typename = std::enable_if_t<std::is_pointer<PtrType>::value>> >-inline T retagCodePtr(PtrType ptr) { return bitwise_cast<T>(ptr); } >- >-template<typename PtrType, typename = std::enable_if_t<std::is_pointer<PtrType>::value>> >-inline constexpr PtrType retagCodePtr(PtrType ptr, PtrTag, PtrTag) { return ptr; } >- >-template<PtrTag, PtrTag, typename PtrType, typename = std::enable_if_t<std::is_pointer<PtrType>::value>> >-inline PtrType retagCodePtr(PtrType ptr) { return ptr; } >- >-template<typename T, typename PtrType, typename = std::enable_if_t<std::is_pointer<PtrType>::value && !std::is_same<T, PtrType>::value>> >-inline constexpr T removeCodePtrTag(PtrType ptr) { return bitwise_cast<T>(ptr); } >- >-template<typename PtrType, typename = std::enable_if_t<std::is_pointer<PtrType>::value>> >-inline constexpr PtrType removeCodePtrTag(PtrType ptr) { return ptr; } >- >-template<typename T, typename PtrType, typename = std::enable_if_t<std::is_pointer<PtrType>::value && !std::is_same<T, PtrType>::value>> >-inline T tagCFunctionPtr(PtrType ptr, PtrTag) { return bitwise_cast<T>(ptr); } >- >-template<typename T, PtrTag, typename PtrType, typename = std::enable_if_t<std::is_pointer<PtrType>::value>> >-inline T tagCFunctionPtr(PtrType ptr) { return bitwise_cast<T>(ptr); } >- >-template<typename PtrType, typename = std::enable_if_t<std::is_pointer<PtrType>::value>> >-inline PtrType tagCFunctionPtr(PtrType ptr, PtrTag) { return ptr; } >- >-template<PtrTag, typename PtrType, typename = std::enable_if_t<std::is_pointer<PtrType>::value>> >-inline PtrType tagCFunctionPtr(PtrType ptr) { return ptr; } >- >-template<typename T, typename PtrType, typename = std::enable_if_t<std::is_pointer<PtrType>::value && !std::is_same<T, PtrType>::value>> >-inline T untagCFunctionPtr(PtrType ptr, PtrTag) { return bitwise_cast<T>(ptr); } >- >-template<typename T, PtrTag, typename PtrType, typename = std::enable_if_t<std::is_pointer<PtrType>::value>> >-inline T untagCFunctionPtr(PtrType ptr) { return bitwise_cast<T>(ptr); } >- >-template<typename PtrType, typename = std::enable_if_t<std::is_pointer<PtrType>::value>> >-inline PtrType untagCFunctionPtr(PtrType ptr, PtrTag) { return ptr; } >- >-template<PtrTag, typename PtrType, typename = std::enable_if_t<std::is_pointer<PtrType>::value>> >-inline PtrType untagCFunctionPtr(PtrType ptr) { return ptr; } >- >-template<typename PtrType> void assertIsCFunctionPtr(PtrType) { } >-template<typename PtrType> void assertIsNullOrCFunctionPtr(PtrType) { } >- >-template<typename PtrType> void assertIsNotTagged(PtrType) { } >-template<typename PtrType> void assertIsTagged(PtrType) { } >-template<typename PtrType> void assertIsNullOrTagged(PtrType) { } >- >-template<typename PtrType> void assertIsTaggedWith(PtrType, PtrTag) { } >-template<typename PtrType> void assertIsNullOrTaggedWith(PtrType, PtrTag) { } >- >-#define CALL_WITH_PTRTAG(callInstructionString, targetRegisterString, tag) \ >- callInstructionString " " targetRegisterString "\n" >- >-#endif // !USE(POINTER_PROFILING) >- >-} // namespace JSC >- >-#if USE(APPLE_INTERNAL_SDK) && __has_include(<WebKitAdditions/PtrTagSupport.h>) >-#include <WebKitAdditions/PtrTagSupport.h> >-#endif >Index: Source/JavaScriptCore/runtime/VMTraps.cpp >=================================================================== >--- Source/JavaScriptCore/runtime/VMTraps.cpp (revision 230998) >+++ Source/JavaScriptCore/runtime/VMTraps.cpp (working copy) >@@ -32,12 +32,12 @@ > #include "DFGCommonData.h" > #include "ExceptionHelpers.h" > #include "HeapInlines.h" >+#include "JSCPtrTag.h" > #include "LLIntPCRanges.h" > #include "MachineContext.h" > #include "MachineStackMarker.h" > #include "MacroAssembler.h" > #include "MacroAssemblerCodeRef.h" >-#include "PtrTag.h" > #include "VM.h" > #include "VMInspector.h" > #include "Watchdog.h" >Index: Source/WTF/ChangeLog >=================================================================== >--- Source/WTF/ChangeLog (revision 230998) >+++ Source/WTF/ChangeLog (working copy) >@@ -1,3 +1,35 @@ >+2018-04-25 Mark Lam <mark.lam@apple.com> >+ >+ Push the definition of PtrTag down to the WTF layer. >+ https://bugs.webkit.org/show_bug.cgi?id=184976 >+ <rdar://problem/39723901> >+ >+ Reviewed by Saam Barati. >+ >+ This is in preparation for doing pointer profiling at the WTF layer as well. >+ Also deleted an unused ptrTag() function. >+ >+ * WTF.xcodeproj/project.pbxproj: >+ * wtf/CMakeLists.txt: >+ * wtf/PtrTag.h: Copied from Source/JavaScriptCore/runtime/PtrTag.h. >+ (WTF::makePtrTagHash): >+ (JSC::ptrTagName): Deleted. >+ (JSC::tagForPtr): Deleted. >+ (JSC::ptrTag): Deleted. >+ (JSC::tagCodePtr): Deleted. >+ (JSC::untagCodePtr): Deleted. >+ (JSC::retagCodePtr): Deleted. >+ (JSC::removeCodePtrTag): Deleted. >+ (JSC::tagCFunctionPtr): Deleted. >+ (JSC::untagCFunctionPtr): Deleted. >+ (JSC::assertIsCFunctionPtr): Deleted. >+ (JSC::assertIsNullOrCFunctionPtr): Deleted. >+ (JSC::assertIsNotTagged): Deleted. >+ (JSC::assertIsTagged): Deleted. >+ (JSC::assertIsNullOrTagged): Deleted. >+ (JSC::assertIsTaggedWith): Deleted. >+ (JSC::assertIsNullOrTaggedWith): Deleted. >+ > 2018-04-25 Dean Jackson <dino@apple.com> > > Make a better flag for system preview, and disable it where necessary >Index: Source/WTF/WTF.xcodeproj/project.pbxproj >=================================================================== >--- Source/WTF/WTF.xcodeproj/project.pbxproj (revision 230998) >+++ Source/WTF/WTF.xcodeproj/project.pbxproj (working copy) >@@ -633,6 +633,7 @@ > FE05FAE61FDB214300093230 /* DumbPtrTraits.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DumbPtrTraits.h; sourceTree = "<group>"; }; > FE05FAFE1FE5007500093230 /* WTFAssertions.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = WTFAssertions.cpp; sourceTree = "<group>"; }; > FE05FB041FE8453200093230 /* PoisonedUniquePtr.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PoisonedUniquePtr.h; sourceTree = "<group>"; }; >+ FE7497E4208FFCAA0003565B /* PtrTag.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PtrTag.h; sourceTree = "<group>"; }; > FE8225301B2A1E5B00BA68FD /* NakedPtr.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = NakedPtr.h; sourceTree = "<group>"; }; > FE85416C1FBE285B008DA5DA /* Poisoned.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = Poisoned.cpp; sourceTree = "<group>"; }; > FE85416D1FBE285C008DA5DA /* Poisoned.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Poisoned.h; sourceTree = "<group>"; }; >@@ -1010,6 +1011,7 @@ > 0FC4488216FE9FE100844BE9 /* ProcessID.h */, > 7AF023B42061E16F00A8EFD6 /* ProcessPrivilege.cpp */, > 7AF023B32061E16C00A8EFD6 /* ProcessPrivilege.h */, >+ FE7497E4208FFCAA0003565B /* PtrTag.h */, > 143F611D1565F0F900DB514A /* RAMSize.cpp */, > 143F611E1565F0F900DB514A /* RAMSize.h */, > C8F597CA2A57417FBAB92FD6 /* RandomDevice.cpp */, >Index: Source/WTF/wtf/CMakeLists.txt >=================================================================== >--- Source/WTF/wtf/CMakeLists.txt (revision 230998) >+++ Source/WTF/wtf/CMakeLists.txt (working copy) >@@ -167,6 +167,7 @@ set(WTF_PUBLIC_HEADERS > PriorityQueue.h > ProcessID.h > ProcessPrivilege.h >+ PtrTag.h > RAMSize.h > RandomDevice.h > RandomNumber.h >Index: Source/WTF/wtf/PtrTag.h >=================================================================== >--- Source/WTF/wtf/PtrTag.h (revision 230998) (from Source/JavaScriptCore/runtime/PtrTag.h:230998) >+++ Source/WTF/wtf/PtrTag.h (working copy) >@@ -0,0 +1,180 @@ >+/* >+ * Copyright (C) 2018 Apple Inc. All rights reserved. >+ * >+ * Redistribution and use in source and binary forms, with or without >+ * modification, are permitted provided that the following conditions >+ * are met: >+ * 1. Redistributions of source code must retain the above copyright >+ * notice, this list of conditions and the following disclaimer. >+ * 2. Redistributions in binary form must reproduce the above copyright >+ * notice, this list of conditions and the following disclaimer in the >+ * documentation and/or other materials provided with the distribution. >+ * >+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. ``AS IS'' AND ANY >+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE >+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR >+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR >+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, >+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, >+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR >+ * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY >+ * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT >+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE >+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. >+ */ >+ >+#pragma once >+ >+#include <wtf/PointerPreparations.h> >+ >+namespace JSC { >+ >+#define FOR_EACH_BASE_PTRTAG_ENUM(v) \ >+ v(NoPtrTag) \ >+ v(CFunctionPtrTag) \ >+ >+#define FOR_EACH_ADDITIONAL_PTRTAG_ENUM(v) \ >+ v(B3CCallPtrTag) \ >+ v(B3CompilationPtrTag) \ >+ v(BytecodePtrTag) \ >+ v(DisassemblyPtrTag) \ >+ v(ExceptionHandlerPtrTag) \ >+ v(JITThunkPtrTag) \ >+ v(JITStubRoutinePtrTag) \ >+ v(JSEntryPtrTag) \ >+ v(JSInternalPtrTag) \ >+ v(JSSwitchPtrTag) \ >+ v(LinkBufferPtrTag) \ >+ v(OperationPtrTag) \ >+ v(OSRExitPtrTag) \ >+ v(SlowPathPtrTag) \ >+ v(WasmEntryPtrTag) \ >+ v(Yarr8BitPtrTag) \ >+ v(Yarr16BitPtrTag) \ >+ v(YarrMatchOnly8BitPtrTag) \ >+ v(YarrMatchOnly16BitPtrTag) \ >+ v(YarrBacktrackPtrTag) \ >+ >+#define FOR_EACH_PTRTAG_ENUM(v) \ >+ FOR_EACH_BASE_PTRTAG_ENUM(v) \ >+ FOR_EACH_ADDITIONAL_PTRTAG_ENUM(v) \ >+ >+enum PtrTag : uintptr_t { >+ NoPtrTag, >+ CFunctionPtrTag, >+ >+#ifndef PTRTAG_ENUM_HASH >+#define DECLARE_PTRTAG_ENUM(tag) tag, >+#else >+#define DECLARE_PTRTAG_ENUM(tag) tag = PTRTAG_ENUM_HASH(tag), >+#endif >+ FOR_EACH_ADDITIONAL_PTRTAG_ENUM(DECLARE_PTRTAG_ENUM) >+#undef DECLARE_PTRTAG_ENUM >+}; >+ >+static_assert(static_cast<uintptr_t>(NoPtrTag) == static_cast<uintptr_t>(0), ""); >+static_assert(static_cast<uintptr_t>(CFunctionPtrTag) == static_cast<uintptr_t>(1), ""); >+ >+inline const char* ptrTagName(PtrTag tag) >+{ >+#define RETURN_PTRTAG_NAME(_tagName) case _tagName: return #_tagName; >+ switch (tag) { >+ FOR_EACH_PTRTAG_ENUM(RETURN_PTRTAG_NAME) >+ default: return "<unknown>"; >+ } >+#undef RETURN_PTRTAG_NAME >+} >+ >+#if !USE(POINTER_PROFILING) >+ >+inline const char* tagForPtr(const void*) { return "<no tag>"; } >+ >+template<typename... Arguments> >+inline constexpr PtrTag ptrTag(Arguments&&...) { return NoPtrTag; } >+ >+template<typename T, typename PtrType, typename = std::enable_if_t<std::is_pointer<PtrType>::value && !std::is_same<T, PtrType>::value>> >+inline constexpr T tagCodePtr(PtrType ptr, PtrTag) { return bitwise_cast<T>(ptr); } >+ >+template<typename T, PtrTag, typename PtrType, typename = std::enable_if_t<std::is_pointer<PtrType>::value>> >+inline T tagCodePtr(PtrType ptr) { return bitwise_cast<T>(ptr); } >+ >+template<typename PtrType, typename = std::enable_if_t<std::is_pointer<PtrType>::value>> >+inline constexpr PtrType tagCodePtr(PtrType ptr, PtrTag) { return ptr; } >+ >+template<PtrTag, typename PtrType, typename = std::enable_if_t<std::is_pointer<PtrType>::value>> >+inline PtrType tagCodePtr(PtrType ptr) { return ptr; } >+ >+template<typename T, typename PtrType, typename = std::enable_if_t<std::is_pointer<PtrType>::value && !std::is_same<T, PtrType>::value>> >+inline constexpr T untagCodePtr(PtrType ptr, PtrTag) { return bitwise_cast<T>(ptr); } >+ >+template<typename T, PtrTag, typename PtrType, typename = std::enable_if_t<std::is_pointer<PtrType>::value>> >+inline T untagCodePtr(PtrType ptr) { return bitwise_cast<T>(ptr); } >+ >+template<typename PtrType, typename = std::enable_if_t<std::is_pointer<PtrType>::value>> >+inline constexpr PtrType untagCodePtr(PtrType ptr, PtrTag) { return ptr; } >+ >+template<PtrTag, typename PtrType, typename = std::enable_if_t<std::is_pointer<PtrType>::value>> >+inline PtrType untagCodePtr(PtrType ptr) { return ptr; } >+ >+template<typename T, typename PtrType, typename = std::enable_if_t<std::is_pointer<PtrType>::value && !std::is_same<T, PtrType>::value>> >+inline constexpr T retagCodePtr(PtrType ptr, PtrTag, PtrTag) { return bitwise_cast<T>(ptr); } >+ >+template<typename T, PtrTag, PtrTag, typename PtrType, typename = std::enable_if_t<std::is_pointer<PtrType>::value>> >+inline T retagCodePtr(PtrType ptr) { return bitwise_cast<T>(ptr); } >+ >+template<typename PtrType, typename = std::enable_if_t<std::is_pointer<PtrType>::value>> >+inline constexpr PtrType retagCodePtr(PtrType ptr, PtrTag, PtrTag) { return ptr; } >+ >+template<PtrTag, PtrTag, typename PtrType, typename = std::enable_if_t<std::is_pointer<PtrType>::value>> >+inline PtrType retagCodePtr(PtrType ptr) { return ptr; } >+ >+template<typename T, typename PtrType, typename = std::enable_if_t<std::is_pointer<PtrType>::value && !std::is_same<T, PtrType>::value>> >+inline constexpr T removeCodePtrTag(PtrType ptr) { return bitwise_cast<T>(ptr); } >+ >+template<typename PtrType, typename = std::enable_if_t<std::is_pointer<PtrType>::value>> >+inline constexpr PtrType removeCodePtrTag(PtrType ptr) { return ptr; } >+ >+template<typename T, typename PtrType, typename = std::enable_if_t<std::is_pointer<PtrType>::value && !std::is_same<T, PtrType>::value>> >+inline T tagCFunctionPtr(PtrType ptr, PtrTag) { return bitwise_cast<T>(ptr); } >+ >+template<typename T, PtrTag, typename PtrType, typename = std::enable_if_t<std::is_pointer<PtrType>::value>> >+inline T tagCFunctionPtr(PtrType ptr) { return bitwise_cast<T>(ptr); } >+ >+template<typename PtrType, typename = std::enable_if_t<std::is_pointer<PtrType>::value>> >+inline PtrType tagCFunctionPtr(PtrType ptr, PtrTag) { return ptr; } >+ >+template<PtrTag, typename PtrType, typename = std::enable_if_t<std::is_pointer<PtrType>::value>> >+inline PtrType tagCFunctionPtr(PtrType ptr) { return ptr; } >+ >+template<typename T, typename PtrType, typename = std::enable_if_t<std::is_pointer<PtrType>::value && !std::is_same<T, PtrType>::value>> >+inline T untagCFunctionPtr(PtrType ptr, PtrTag) { return bitwise_cast<T>(ptr); } >+ >+template<typename T, PtrTag, typename PtrType, typename = std::enable_if_t<std::is_pointer<PtrType>::value>> >+inline T untagCFunctionPtr(PtrType ptr) { return bitwise_cast<T>(ptr); } >+ >+template<typename PtrType, typename = std::enable_if_t<std::is_pointer<PtrType>::value>> >+inline PtrType untagCFunctionPtr(PtrType ptr, PtrTag) { return ptr; } >+ >+template<PtrTag, typename PtrType, typename = std::enable_if_t<std::is_pointer<PtrType>::value>> >+inline PtrType untagCFunctionPtr(PtrType ptr) { return ptr; } >+ >+template<typename PtrType> void assertIsCFunctionPtr(PtrType) { } >+template<typename PtrType> void assertIsNullOrCFunctionPtr(PtrType) { } >+ >+template<typename PtrType> void assertIsNotTagged(PtrType) { } >+template<typename PtrType> void assertIsTagged(PtrType) { } >+template<typename PtrType> void assertIsNullOrTagged(PtrType) { } >+ >+template<typename PtrType> void assertIsTaggedWith(PtrType, PtrTag) { } >+template<typename PtrType> void assertIsNullOrTaggedWith(PtrType, PtrTag) { } >+ >+#define CALL_WITH_PTRTAG(callInstructionString, targetRegisterString, tag) \ >+ callInstructionString " " targetRegisterString "\n" >+ >+#endif // !USE(POINTER_PROFILING) >+ >+} // namespace JSC >+ >+#if USE(APPLE_INTERNAL_SDK) && __has_include(<WebKitAdditions/PtrTagSupport.h>) >+#include <WebKitAdditions/PtrTagSupport.h> >+#endif >Index: Source/WTF/wtf/PtrTag.h >=================================================================== >--- Source/WTF/wtf/PtrTag.h (revision 230998) >+++ Source/WTF/wtf/PtrTag.h (working copy) >@@ -27,71 +27,49 @@ > > #include <wtf/PointerPreparations.h> > >-namespace JSC { >+namespace WTF { > >-#define FOR_EACH_BASE_PTRTAG_ENUM(v) \ >+#define FOR_EACH_BASE_WTF_PTRTAG(v) \ > v(NoPtrTag) \ > v(CFunctionPtrTag) \ > >-#define FOR_EACH_ADDITIONAL_PTRTAG_ENUM(v) \ >- v(B3CCallPtrTag) \ >- v(B3CompilationPtrTag) \ >- v(BytecodePtrTag) \ >- v(DisassemblyPtrTag) \ >- v(ExceptionHandlerPtrTag) \ >- v(JITThunkPtrTag) \ >- v(JITStubRoutinePtrTag) \ >- v(JSEntryPtrTag) \ >- v(JSInternalPtrTag) \ >- v(JSSwitchPtrTag) \ >- v(LinkBufferPtrTag) \ >- v(OperationPtrTag) \ >- v(OSRExitPtrTag) \ >- v(SlowPathPtrTag) \ >- v(WasmEntryPtrTag) \ >- v(Yarr8BitPtrTag) \ >- v(Yarr16BitPtrTag) \ >- v(YarrMatchOnly8BitPtrTag) \ >- v(YarrMatchOnly16BitPtrTag) \ >- v(YarrBacktrackPtrTag) \ >- >-#define FOR_EACH_PTRTAG_ENUM(v) \ >- FOR_EACH_BASE_PTRTAG_ENUM(v) \ >- FOR_EACH_ADDITIONAL_PTRTAG_ENUM(v) \ >+#define FOR_EACH_ADDITIONAL_WTF_PTRTAG(v) \ >+ >+#define FOR_EACH_WTF_PTRTAG(v) \ >+ FOR_EACH_BASE_WTF_PTRTAG(v) \ >+ FOR_EACH_ADDITIONAL_WTF_PTRTAG(v) \ > > enum PtrTag : uintptr_t { > NoPtrTag, > CFunctionPtrTag, >+}; > >-#ifndef PTRTAG_ENUM_HASH >-#define DECLARE_PTRTAG_ENUM(tag) tag, >-#else >-#define DECLARE_PTRTAG_ENUM(tag) tag = PTRTAG_ENUM_HASH(tag), >+#ifndef WTF_PTRTAG_HASH >+template<size_t N> >+constexpr uintptr_t makePtrTagHash(const char (&str)[N]) >+{ >+ uintptr_t result = 134775813; >+ for (size_t i = 0; i < N; ++i) >+ result += ((result * str[i]) ^ (result >> 16)); >+ return result & 0xffff; >+} >+ >+#define WTF_PTRTAG_HASH(tag) WTF::makePtrTagHash(#tag) > #endif >- FOR_EACH_ADDITIONAL_PTRTAG_ENUM(DECLARE_PTRTAG_ENUM) >-#undef DECLARE_PTRTAG_ENUM >-}; >+ >+#define WTF_DECLARE_PTRTAG(tag) \ >+ constexpr PtrTag tag = static_cast<PtrTag>(WTF_PTRTAG_HASH(#tag)); \ >+ static_assert(tag != NoPtrTag && tag != CFunctionPtrTag, ""); > > static_assert(static_cast<uintptr_t>(NoPtrTag) == static_cast<uintptr_t>(0), ""); > static_assert(static_cast<uintptr_t>(CFunctionPtrTag) == static_cast<uintptr_t>(1), ""); > >-inline const char* ptrTagName(PtrTag tag) >-{ >-#define RETURN_PTRTAG_NAME(_tagName) case _tagName: return #_tagName; >- switch (tag) { >- FOR_EACH_PTRTAG_ENUM(RETURN_PTRTAG_NAME) >- default: return "<unknown>"; >- } >-#undef RETURN_PTRTAG_NAME >-} >+FOR_EACH_ADDITIONAL_WTF_PTRTAG(WTF_DECLARE_PTRTAG) > > #if !USE(POINTER_PROFILING) > > inline const char* tagForPtr(const void*) { return "<no tag>"; } > >-template<typename... Arguments> >-inline constexpr PtrTag ptrTag(Arguments&&...) { return NoPtrTag; } >- > template<typename T, typename PtrType, typename = std::enable_if_t<std::is_pointer<PtrType>::value && !std::is_same<T, PtrType>::value>> > inline constexpr T tagCodePtr(PtrType ptr, PtrTag) { return bitwise_cast<T>(ptr); } > >@@ -173,8 +151,29 @@ template<typename PtrType> void assertIs > > #endif // !USE(POINTER_PROFILING) > >-} // namespace JSC >+} // namespace WTF >+ >+using WTF::CFunctionPtrTag; >+using WTF::NoPtrTag; >+using WTF::PtrTag; > > #if USE(APPLE_INTERNAL_SDK) && __has_include(<WebKitAdditions/PtrTagSupport.h>) > #include <WebKitAdditions/PtrTagSupport.h> > #endif >+ >+using WTF::tagForPtr; >+ >+using WTF::tagCodePtr; >+using WTF::untagCodePtr; >+using WTF::retagCodePtr; >+using WTF::removeCodePtrTag; >+using WTF::tagCFunctionPtr; >+using WTF::untagCFunctionPtr; >+ >+using WTF::assertIsCFunctionPtr; >+using WTF::assertIsNullOrCFunctionPtr; >+using WTF::assertIsNotTagged; >+using WTF::assertIsTagged; >+using WTF::assertIsNullOrTagged; >+using WTF::assertIsTaggedWith; >+using WTF::assertIsNullOrTaggedWith; >Index: Source/WebCore/ChangeLog >=================================================================== >--- Source/WebCore/ChangeLog (revision 230998) >+++ Source/WebCore/ChangeLog (working copy) >@@ -1,3 +1,20 @@ >+2018-04-25 Mark Lam <mark.lam@apple.com> >+ >+ Push the definition of PtrTag down to the WTF layer. >+ https://bugs.webkit.org/show_bug.cgi?id=184976 >+ <rdar://problem/39723901> >+ >+ Reviewed by Saam Barati. >+ >+ No new tests needed. This is covered by existing tests. >+ >+ * cssjit/CSSPtrTag.h: >+ * cssjit/SelectorCompiler.h: >+ (WebCore::SelectorCompiler::ruleCollectorSimpleSelectorCheckerFunction): >+ (WebCore::SelectorCompiler::querySelectorSimpleSelectorCheckerFunction): >+ (WebCore::SelectorCompiler::ruleCollectorSelectorCheckerFunctionWithCheckingContext): >+ (WebCore::SelectorCompiler::querySelectorSelectorCheckerFunctionWithCheckingContext): >+ > 2018-04-25 Per Arne Vollan <pvollan@apple.com> > > [Win] Crash under WebCore::SimpleLineLayout::generateLineBoxTree >Index: Source/WebCore/cssjit/CSSPtrTag.h >=================================================================== >--- Source/WebCore/cssjit/CSSPtrTag.h (revision 230998) >+++ Source/WebCore/cssjit/CSSPtrTag.h (working copy) >@@ -27,12 +27,15 @@ > > #if ENABLE(CSS_SELECTOR_JIT) > >-#include <JavaScriptCore/PtrTag.h> >+#include <JavaScriptCore/JSCPtrTag.h> > > namespace WebCore { > >-static constexpr JSC::PtrTag CSSSelectorPtrTag = static_cast<JSC::PtrTag>(0xc551); >-static constexpr JSC::PtrTag CSSOperationPtrTag = static_cast<JSC::PtrTag>(0xc552); >+#define FOR_EACH_CSS_PTRTAG(v) \ >+ v(CSSSelectorPtrTag) \ >+ v(CSSOperationPtrTag) \ >+ >+FOR_EACH_CSS_PTRTAG(WTF_DECLARE_PTRTAG) > > } // namespace WebCore > >Index: Source/WebCore/cssjit/SelectorCompiler.h >=================================================================== >--- Source/WebCore/cssjit/SelectorCompiler.h (revision 230998) >+++ Source/WebCore/cssjit/SelectorCompiler.h (working copy) >@@ -58,25 +58,25 @@ SelectorCompilationStatus compileSelecto > inline RuleCollectorSimpleSelectorChecker ruleCollectorSimpleSelectorCheckerFunction(void* executableAddress, SelectorCompilationStatus compilationStatus) > { > ASSERT_UNUSED(compilationStatus, compilationStatus == SelectorCompilationStatus::SimpleSelectorChecker); >- return JSC::untagCFunctionPtr<RuleCollectorSimpleSelectorChecker, CSSSelectorPtrTag>(executableAddress); >+ return WTF::untagCFunctionPtr<RuleCollectorSimpleSelectorChecker, CSSSelectorPtrTag>(executableAddress); > } > > inline QuerySelectorSimpleSelectorChecker querySelectorSimpleSelectorCheckerFunction(void* executableAddress, SelectorCompilationStatus compilationStatus) > { > ASSERT_UNUSED(compilationStatus, compilationStatus == SelectorCompilationStatus::SimpleSelectorChecker); >- return JSC::untagCFunctionPtr<QuerySelectorSimpleSelectorChecker, CSSSelectorPtrTag>(executableAddress); >+ return WTF::untagCFunctionPtr<QuerySelectorSimpleSelectorChecker, CSSSelectorPtrTag>(executableAddress); > } > > inline RuleCollectorSelectorCheckerWithCheckingContext ruleCollectorSelectorCheckerFunctionWithCheckingContext(void* executableAddress, SelectorCompilationStatus compilationStatus) > { > ASSERT_UNUSED(compilationStatus, compilationStatus == SelectorCompilationStatus::SelectorCheckerWithCheckingContext); >- return JSC::untagCFunctionPtr<RuleCollectorSelectorCheckerWithCheckingContext, CSSSelectorPtrTag>(executableAddress); >+ return WTF::untagCFunctionPtr<RuleCollectorSelectorCheckerWithCheckingContext, CSSSelectorPtrTag>(executableAddress); > } > > inline QuerySelectorSelectorCheckerWithCheckingContext querySelectorSelectorCheckerFunctionWithCheckingContext(void* executableAddress, SelectorCompilationStatus compilationStatus) > { > ASSERT_UNUSED(compilationStatus, compilationStatus == SelectorCompilationStatus::SelectorCheckerWithCheckingContext); >- return JSC::untagCFunctionPtr<QuerySelectorSelectorCheckerWithCheckingContext, CSSSelectorPtrTag>(executableAddress); >+ return WTF::untagCFunctionPtr<QuerySelectorSelectorCheckerWithCheckingContext, CSSSelectorPtrTag>(executableAddress); > } > > } // namespace SelectorCompiler
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Formatted Diff
|
Diff
Attachments on
bug 184976
:
338772
| 338783