Unreviewed, rolling out r225620
authormcatanzaro@igalia.com <mcatanzaro@igalia.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 7 Dec 2017 16:32:42 +0000 (16:32 +0000)
committermcatanzaro@igalia.com <mcatanzaro@igalia.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 7 Dec 2017 16:32:42 +0000 (16:32 +0000)
https://bugs.webkit.org/show_bug.cgi?id=180514
<rdar://problem/35901694>

It broke the build with GCC 7, and I don't know how to fix it.

Source/JavaScriptCore:

* API/JSCallbackObject.h:
* API/JSObjectRef.cpp:
(classInfoPrivate):
* JavaScriptCore.xcodeproj/project.pbxproj:
* Sources.txt:
* assembler/MacroAssemblerCodeRef.h:
(JSC::FunctionPtr::FunctionPtr):
(JSC::FunctionPtr::value const):
(JSC::FunctionPtr::executableAddress const):
(JSC::ReturnAddressPtr::ReturnAddressPtr):
(JSC::ReturnAddressPtr::value const):
(JSC::MacroAssemblerCodePtr::MacroAssemblerCodePtr):
(JSC::MacroAssemblerCodePtr::createFromExecutableAddress):
(JSC::MacroAssemblerCodePtr::scrambledPtr const):
(JSC::MacroAssemblerCodePtr:: const):
(JSC::MacroAssemblerCodePtr::operator! const):
(JSC::MacroAssemblerCodePtr::operator== const):
(JSC::MacroAssemblerCodePtr::emptyValue):
(JSC::MacroAssemblerCodePtr::deletedValue):
(JSC::MacroAssemblerCodePtr::poisonedPtr const): Deleted.
* b3/B3LowerMacros.cpp:
* b3/testb3.cpp:
(JSC::B3::testInterpreter):
* dfg/DFGSpeculativeJIT.cpp:
(JSC::DFG::SpeculativeJIT::checkArray):
(JSC::DFG::SpeculativeJIT::compileCheckSubClass):
(JSC::DFG::SpeculativeJIT::compileNewStringObject):
(JSC::DFG::SpeculativeJIT::emitSwitchIntJump):
* ftl/FTLLowerDFGToB3.cpp:
(JSC::FTL::DFG::LowerDFGToB3::compileNewStringObject):
(JSC::FTL::DFG::LowerDFGToB3::compileCheckSubClass):
* jit/AssemblyHelpers.h:
(JSC::AssemblyHelpers::emitAllocateDestructibleObject):
* jit/SpecializedThunkJIT.h:
(JSC::SpecializedThunkJIT::loadArgumentWithSpecificClass):
* jit/ThunkGenerators.cpp:
(JSC::virtualThunkFor):
(JSC::boundThisNoArgsFunctionCallGenerator):
* llint/LLIntSlowPaths.cpp:
(JSC::LLInt::handleHostCall):
(JSC::LLInt::setUpCall):
* llint/LowLevelInterpreter64.asm:
* runtime/InitializeThreading.cpp:
(JSC::initializeThreading):
* runtime/JSCScrambledPtr.cpp: Renamed from Source/JavaScriptCore/runtime/JSCPoisonedPtr.cpp.
(JSC::initializeScrambledPtrKeys):
* runtime/JSCScrambledPtr.h: Renamed from Source/JavaScriptCore/runtime/JSCPoisonedPtr.h.
* runtime/JSDestructibleObject.h:
(JSC::JSDestructibleObject::classInfo const):
* runtime/JSSegmentedVariableObject.h:
(JSC::JSSegmentedVariableObject::classInfo const):
* runtime/Structure.h:
* runtime/VM.h:

Source/WTF:

* WTF.xcodeproj/project.pbxproj:
* wtf/CMakeLists.txt:
* wtf/Poisoned.h: Removed.
* wtf/ScrambledPtr.cpp: Renamed from Source/WTF/wtf/Poisoned.cpp.
(WTF::makeScrambledPtrKey):
* wtf/ScrambledPtr.h: Added.
(WTF::ScrambledPtr::ScrambledPtr):
(WTF::ScrambledPtr::assertIsScrambled const):
(WTF::ScrambledPtr::assertIsNotScrambled const):
(WTF::ScrambledPtr::descrambled const):
(WTF::ScrambledPtr::operator-> const):
(WTF::ScrambledPtr::bits const):
(WTF::ScrambledPtr::operator! const):
(WTF::ScrambledPtr::operator bool const):
(WTF::ScrambledPtr::operator== const):
(WTF::ScrambledPtr::operator==):
(WTF::ScrambledPtr::operator=):
(WTF::ScrambledPtr::scramble):
(WTF::ScrambledPtr::descramble):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@225629 268f45cc-cd09-0410-ab3c-d52691b4dbfc

28 files changed:
Source/JavaScriptCore/API/JSCallbackObject.h
Source/JavaScriptCore/API/JSObjectRef.cpp
Source/JavaScriptCore/ChangeLog
Source/JavaScriptCore/JavaScriptCore.xcodeproj/project.pbxproj
Source/JavaScriptCore/Sources.txt
Source/JavaScriptCore/assembler/MacroAssemblerCodeRef.h
Source/JavaScriptCore/b3/B3LowerMacros.cpp
Source/JavaScriptCore/b3/testb3.cpp
Source/JavaScriptCore/dfg/DFGSpeculativeJIT.cpp
Source/JavaScriptCore/ftl/FTLLowerDFGToB3.cpp
Source/JavaScriptCore/jit/AssemblyHelpers.h
Source/JavaScriptCore/jit/SpecializedThunkJIT.h
Source/JavaScriptCore/jit/ThunkGenerators.cpp
Source/JavaScriptCore/llint/LLIntSlowPaths.cpp
Source/JavaScriptCore/llint/LowLevelInterpreter64.asm
Source/JavaScriptCore/runtime/InitializeThreading.cpp
Source/JavaScriptCore/runtime/JSCScrambledPtr.cpp [moved from Source/JavaScriptCore/runtime/JSCPoisonedPtr.cpp with 85% similarity]
Source/JavaScriptCore/runtime/JSCScrambledPtr.h [moved from Source/JavaScriptCore/runtime/JSCPoisonedPtr.h with 80% similarity]
Source/JavaScriptCore/runtime/JSDestructibleObject.h
Source/JavaScriptCore/runtime/JSSegmentedVariableObject.h
Source/JavaScriptCore/runtime/Structure.h
Source/JavaScriptCore/runtime/VM.h
Source/WTF/ChangeLog
Source/WTF/WTF.xcodeproj/project.pbxproj
Source/WTF/wtf/CMakeLists.txt
Source/WTF/wtf/Poisoned.h [deleted file]
Source/WTF/wtf/ScrambledPtr.cpp [moved from Source/WTF/wtf/Poisoned.cpp with 81% similarity]
Source/WTF/wtf/ScrambledPtr.h [new file with mode: 0644]

index 5a00645..83f38be 100644 (file)
@@ -27,7 +27,7 @@
 #ifndef JSCallbackObject_h
 #define JSCallbackObject_h
 
-#include "JSCPoisonedPtr.h"
+#include "JSCScrambledPtr.h"
 #include "JSObjectRef.h"
 #include "JSValueRef.h"
 #include "JSObject.h"
@@ -234,7 +234,7 @@ private:
     static EncodedJSValue callbackGetter(ExecState*, EncodedJSValue, PropertyName);
 
     std::unique_ptr<JSCallbackObjectData> m_callbackObjectData;
-    PoisonedClassInfoPtr m_classInfo;
+    ClassInfoScrambledPtr m_classInfo;
 };
 
 } // namespace JSC
index 6747337..5bff2af 100644 (file)
@@ -431,7 +431,7 @@ static const ClassInfo* classInfoPrivate(JSObject* jsObject)
     if (vm.currentlyDestructingCallbackObject != jsObject)
         return jsObject->classInfo(vm);
 
-    return vm.currentlyDestructingCallbackObjectClassInfo.unpoisoned();
+    return vm.currentlyDestructingCallbackObjectClassInfo.descrambled();
 }
 
 void* JSObjectGetPrivate(JSObjectRef object)
index 35dcca8..862ee34 100644 (file)
@@ -1,3 +1,65 @@
+2017-12-07  Michael Catanzaro  <mcatanzaro@igalia.com>
+
+        Unreviewed, rolling out r225620
+        https://bugs.webkit.org/show_bug.cgi?id=180514
+        <rdar://problem/35901694>
+
+        It broke the build with GCC 7, and I don't know how to fix it.
+
+        * API/JSCallbackObject.h:
+        * API/JSObjectRef.cpp:
+        (classInfoPrivate):
+        * JavaScriptCore.xcodeproj/project.pbxproj:
+        * Sources.txt:
+        * assembler/MacroAssemblerCodeRef.h:
+        (JSC::FunctionPtr::FunctionPtr):
+        (JSC::FunctionPtr::value const):
+        (JSC::FunctionPtr::executableAddress const):
+        (JSC::ReturnAddressPtr::ReturnAddressPtr):
+        (JSC::ReturnAddressPtr::value const):
+        (JSC::MacroAssemblerCodePtr::MacroAssemblerCodePtr):
+        (JSC::MacroAssemblerCodePtr::createFromExecutableAddress):
+        (JSC::MacroAssemblerCodePtr::scrambledPtr const):
+        (JSC::MacroAssemblerCodePtr:: const):
+        (JSC::MacroAssemblerCodePtr::operator! const):
+        (JSC::MacroAssemblerCodePtr::operator== const):
+        (JSC::MacroAssemblerCodePtr::emptyValue):
+        (JSC::MacroAssemblerCodePtr::deletedValue):
+        (JSC::MacroAssemblerCodePtr::poisonedPtr const): Deleted.
+        * b3/B3LowerMacros.cpp:
+        * b3/testb3.cpp:
+        (JSC::B3::testInterpreter):
+        * dfg/DFGSpeculativeJIT.cpp:
+        (JSC::DFG::SpeculativeJIT::checkArray):
+        (JSC::DFG::SpeculativeJIT::compileCheckSubClass):
+        (JSC::DFG::SpeculativeJIT::compileNewStringObject):
+        (JSC::DFG::SpeculativeJIT::emitSwitchIntJump):
+        * ftl/FTLLowerDFGToB3.cpp:
+        (JSC::FTL::DFG::LowerDFGToB3::compileNewStringObject):
+        (JSC::FTL::DFG::LowerDFGToB3::compileCheckSubClass):
+        * jit/AssemblyHelpers.h:
+        (JSC::AssemblyHelpers::emitAllocateDestructibleObject):
+        * jit/SpecializedThunkJIT.h:
+        (JSC::SpecializedThunkJIT::loadArgumentWithSpecificClass):
+        * jit/ThunkGenerators.cpp:
+        (JSC::virtualThunkFor):
+        (JSC::boundThisNoArgsFunctionCallGenerator):
+        * llint/LLIntSlowPaths.cpp:
+        (JSC::LLInt::handleHostCall):
+        (JSC::LLInt::setUpCall):
+        * llint/LowLevelInterpreter64.asm:
+        * runtime/InitializeThreading.cpp:
+        (JSC::initializeThreading):
+        * runtime/JSCScrambledPtr.cpp: Renamed from Source/JavaScriptCore/runtime/JSCPoisonedPtr.cpp.
+        (JSC::initializeScrambledPtrKeys):
+        * runtime/JSCScrambledPtr.h: Renamed from Source/JavaScriptCore/runtime/JSCPoisonedPtr.h.
+        * runtime/JSDestructibleObject.h:
+        (JSC::JSDestructibleObject::classInfo const):
+        * runtime/JSSegmentedVariableObject.h:
+        (JSC::JSSegmentedVariableObject::classInfo const):
+        * runtime/Structure.h:
+        * runtime/VM.h:
+
 2017-12-06  Mark Lam  <mark.lam@apple.com>
 
         Refactoring: Rename ScrambledPtr to Poisoned.
index 025ef88..b7a6a14 100644 (file)
                FE1C0FFD1B193E9800B53FCA /* Exception.h in Headers */ = {isa = PBXBuildFile; fileRef = FE1C0FFC1B193E9800B53FCA /* Exception.h */; settings = {ATTRIBUTES = (Private, ); }; };
                FE20CE9E15F04A9500DF3430 /* LLIntCLoop.h in Headers */ = {isa = PBXBuildFile; fileRef = FE20CE9C15F04A9500DF3430 /* LLIntCLoop.h */; settings = {ATTRIBUTES = (Private, ); }; };
                FE2A87601F02381600EB31B2 /* MinimumReservedZoneSize.h in Headers */ = {isa = PBXBuildFile; fileRef = FE2A875F1F02381600EB31B2 /* MinimumReservedZoneSize.h */; };
-               FE2B0B691FD227E00075DA5F /* JSCPoisonedPtr.h in Headers */ = {isa = PBXBuildFile; fileRef = FE2B0B671FD0D2960075DA5F /* JSCPoisonedPtr.h */; settings = {ATTRIBUTES = (Private, ); }; };
+               FE2B0B691FD227E00075DA5F /* JSCScrambledPtr.h in Headers */ = {isa = PBXBuildFile; fileRef = FE2B0B671FD0D2960075DA5F /* JSCScrambledPtr.h */; settings = {ATTRIBUTES = (Private, ); }; };
                FE3022D31E3D73A500BAC493 /* SigillCrashAnalyzer.h in Headers */ = {isa = PBXBuildFile; fileRef = FE3022D11E3D739600BAC493 /* SigillCrashAnalyzer.h */; settings = {ATTRIBUTES = (Private, ); }; };
                FE3022D71E42857300BAC493 /* VMInspector.h in Headers */ = {isa = PBXBuildFile; fileRef = FE3022D51E42856700BAC493 /* VMInspector.h */; };
                FE318FE01CAC982F00DFCC54 /* ECMAScriptSpecInternalFunctions.h in Headers */ = {isa = PBXBuildFile; fileRef = FE318FDE1CAC8C5300DFCC54 /* ECMAScriptSpecInternalFunctions.h */; };
                FE20CE9B15F04A9500DF3430 /* LLIntCLoop.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = LLIntCLoop.cpp; path = llint/LLIntCLoop.cpp; sourceTree = "<group>"; };
                FE20CE9C15F04A9500DF3430 /* LLIntCLoop.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = LLIntCLoop.h; path = llint/LLIntCLoop.h; sourceTree = "<group>"; };
                FE2A875F1F02381600EB31B2 /* MinimumReservedZoneSize.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = MinimumReservedZoneSize.h; sourceTree = "<group>"; };
-               FE2B0B671FD0D2960075DA5F /* JSCPoisonedPtr.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSCPoisonedPtr.h; sourceTree = "<group>"; };
-               FE2B0B681FD0D2970075DA5F /* JSCPoisonedPtr.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSCPoisonedPtr.cpp; sourceTree = "<group>"; };
+               FE2B0B671FD0D2960075DA5F /* JSCScrambledPtr.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSCScrambledPtr.h; sourceTree = "<group>"; };
+               FE2B0B681FD0D2970075DA5F /* JSCScrambledPtr.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSCScrambledPtr.cpp; sourceTree = "<group>"; };
                FE2E6A7A1D6EA5FE0060F896 /* ThrowScope.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = ThrowScope.cpp; sourceTree = "<group>"; };
                FE3022D01E3D739600BAC493 /* SigillCrashAnalyzer.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = SigillCrashAnalyzer.cpp; sourceTree = "<group>"; };
                FE3022D11E3D739600BAC493 /* SigillCrashAnalyzer.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SigillCrashAnalyzer.h; sourceTree = "<group>"; };
                                F692A8870255597D01FF60F7 /* JSCJSValue.cpp */,
                                14ABB36E099C076400E2A24F /* JSCJSValue.h */,
                                865A30F0135007E100CDB49E /* JSCJSValueInlines.h */,
-                               FE2B0B681FD0D2970075DA5F /* JSCPoisonedPtr.cpp */,
-                               FE2B0B671FD0D2960075DA5F /* JSCPoisonedPtr.h */,
+                               FE2B0B681FD0D2970075DA5F /* JSCScrambledPtr.cpp */,
+                               FE2B0B671FD0D2960075DA5F /* JSCScrambledPtr.h */,
                                72AAF7CB1D0D318B005E60BE /* JSCustomGetterSetterFunction.cpp */,
                                72AAF7CC1D0D318B005E60BE /* JSCustomGetterSetterFunction.h */,
                                0F2B66BD17B6B5AB00A7AE3F /* JSDataView.cpp */,
                                0FEC852A1BDACDAC0080FF74 /* B3PhaseScope.h in Headers */,
                                0F37308D1C0BD29100052BFA /* B3PhiChildren.h in Headers */,
                                0FEC852C1BDACDAC0080FF74 /* B3Procedure.h in Headers */,
-                               FE2B0B691FD227E00075DA5F /* JSCPoisonedPtr.h in Headers */,
+                               FE2B0B691FD227E00075DA5F /* JSCScrambledPtr.h in Headers */,
                                0FEC852D1BDACDAC0080FF74 /* B3ProcedureInlines.h in Headers */,
                                0F725CAA1C503DED00AD943A /* B3PureCSE.h in Headers */,
                                43422A671C16267800E2EB98 /* B3ReduceDoubleToFloat.h in Headers */,
index 0ae4431..d821657 100644 (file)
@@ -772,7 +772,7 @@ runtime/JSAsyncFunction.cpp
 runtime/JSAsyncGeneratorFunction.cpp
 runtime/JSBoundFunction.cpp
 runtime/JSCJSValue.cpp
-runtime/JSCPoisonedPtr.cpp
+runtime/JSCScrambledPtr.cpp
 runtime/JSCallee.cpp
 runtime/JSCell.cpp
 runtime/JSCustomGetterSetterFunction.cpp
index 3f236b2..1c82cca 100644 (file)
@@ -26,7 +26,7 @@
 #pragma once
 
 #include "ExecutableAllocator.h"
-#include "JSCPoisonedPtr.h"
+#include "JSCScrambledPtr.h"
 #include <wtf/DataLog.h>
 #include <wtf/PrintStream.h>
 #include <wtf/RefPtr.h>
@@ -67,7 +67,7 @@ public:
     FunctionPtr(returnType(*value)())
         : m_value((void*)value)
     {
-        PoisonedMasmPtr::assertIsNotPoisoned(m_value);
+        MasmScrambledPtr::assertIsNotScrambled(m_value);
         ASSERT_VALID_CODE_POINTER(m_value);
     }
 
@@ -75,7 +75,7 @@ public:
     FunctionPtr(returnType(*value)(argType1))
         : m_value((void*)value)
     {
-        PoisonedMasmPtr::assertIsNotPoisoned(m_value);
+        MasmScrambledPtr::assertIsNotScrambled(m_value);
         ASSERT_VALID_CODE_POINTER(m_value);
     }
 
@@ -83,7 +83,7 @@ public:
     FunctionPtr(returnType(*value)(argType1, argType2))
         : m_value((void*)value)
     {
-        PoisonedMasmPtr::assertIsNotPoisoned(m_value);
+        MasmScrambledPtr::assertIsNotScrambled(m_value);
         ASSERT_VALID_CODE_POINTER(m_value);
     }
 
@@ -91,7 +91,7 @@ public:
     FunctionPtr(returnType(*value)(argType1, argType2, argType3))
         : m_value((void*)value)
     {
-        PoisonedMasmPtr::assertIsNotPoisoned(m_value);
+        MasmScrambledPtr::assertIsNotScrambled(m_value);
         ASSERT_VALID_CODE_POINTER(m_value);
     }
 
@@ -99,7 +99,7 @@ public:
     FunctionPtr(returnType(*value)(argType1, argType2, argType3, argType4))
         : m_value((void*)value)
     {
-        PoisonedMasmPtr::assertIsNotPoisoned(m_value);
+        MasmScrambledPtr::assertIsNotScrambled(m_value);
         ASSERT_VALID_CODE_POINTER(m_value);
     }
 
@@ -107,7 +107,7 @@ public:
     FunctionPtr(returnType(*value)(argType1, argType2, argType3, argType4, argType5))
         : m_value((void*)value)
     {
-        PoisonedMasmPtr::assertIsNotPoisoned(m_value);
+        MasmScrambledPtr::assertIsNotScrambled(m_value);
         ASSERT_VALID_CODE_POINTER(m_value);
     }
 
@@ -115,7 +115,7 @@ public:
     FunctionPtr(returnType(*value)(argType1, argType2, argType3, argType4, argType5, argType6))
         : m_value((void*)value)
     {
-        PoisonedMasmPtr::assertIsNotPoisoned(m_value);
+        MasmScrambledPtr::assertIsNotScrambled(m_value);
         ASSERT_VALID_CODE_POINTER(m_value);
     }
 // MSVC doesn't seem to treat functions with different calling conventions as
@@ -126,7 +126,7 @@ public:
     FunctionPtr(returnType (CDECL *value)())
         : m_value((void*)value)
     {
-        PoisonedMasmPtr::assertIsNotPoisoned(m_value);
+        MasmScrambledPtr::assertIsNotScrambled(m_value);
         ASSERT_VALID_CODE_POINTER(m_value);
     }
 
@@ -134,7 +134,7 @@ public:
     FunctionPtr(returnType (CDECL *value)(argType1))
         : m_value((void*)value)
     {
-        PoisonedMasmPtr::assertIsNotPoisoned(m_value);
+        MasmScrambledPtr::assertIsNotScrambled(m_value);
         ASSERT_VALID_CODE_POINTER(m_value);
     }
 
@@ -142,7 +142,7 @@ public:
     FunctionPtr(returnType (CDECL *value)(argType1, argType2))
         : m_value((void*)value)
     {
-        PoisonedMasmPtr::assertIsNotPoisoned(m_value);
+        MasmScrambledPtr::assertIsNotScrambled(m_value);
         ASSERT_VALID_CODE_POINTER(m_value);
     }
 
@@ -150,7 +150,7 @@ public:
     FunctionPtr(returnType (CDECL *value)(argType1, argType2, argType3))
         : m_value((void*)value)
     {
-        PoisonedMasmPtr::assertIsNotPoisoned(m_value);
+        MasmScrambledPtr::assertIsNotScrambled(m_value);
         ASSERT_VALID_CODE_POINTER(m_value);
     }
 
@@ -158,7 +158,7 @@ public:
     FunctionPtr(returnType (CDECL *value)(argType1, argType2, argType3, argType4))
         : m_value((void*)value)
     {
-        PoisonedMasmPtr::assertIsNotPoisoned(m_value);
+        MasmScrambledPtr::assertIsNotScrambled(m_value);
         ASSERT_VALID_CODE_POINTER(m_value);
     }
 #endif
@@ -169,7 +169,7 @@ public:
     FunctionPtr(returnType (FASTCALL *value)())
         : m_value((void*)value)
     {
-        PoisonedMasmPtr::assertIsNotPoisoned(m_value);
+        MasmScrambledPtr::assertIsNotScrambled(m_value);
         ASSERT_VALID_CODE_POINTER(m_value);
     }
 
@@ -177,7 +177,7 @@ public:
     FunctionPtr(returnType (FASTCALL *value)(argType1))
         : m_value((void*)value)
     {
-        PoisonedMasmPtr::assertIsNotPoisoned(m_value);
+        MasmScrambledPtr::assertIsNotScrambled(m_value);
         ASSERT_VALID_CODE_POINTER(m_value);
     }
 
@@ -185,7 +185,7 @@ public:
     FunctionPtr(returnType (FASTCALL *value)(argType1, argType2))
         : m_value((void*)value)
     {
-        PoisonedMasmPtr::assertIsNotPoisoned(m_value);
+        MasmScrambledPtr::assertIsNotScrambled(m_value);
         ASSERT_VALID_CODE_POINTER(m_value);
     }
 
@@ -193,7 +193,7 @@ public:
     FunctionPtr(returnType (FASTCALL *value)(argType1, argType2, argType3))
         : m_value((void*)value)
     {
-        PoisonedMasmPtr::assertIsNotPoisoned(m_value);
+        MasmScrambledPtr::assertIsNotScrambled(m_value);
         ASSERT_VALID_CODE_POINTER(m_value);
     }
 
@@ -201,7 +201,7 @@ public:
     FunctionPtr(returnType (FASTCALL *value)(argType1, argType2, argType3, argType4))
         : m_value((void*)value)
     {
-        PoisonedMasmPtr::assertIsNotPoisoned(m_value);
+        MasmScrambledPtr::assertIsNotScrambled(m_value);
         ASSERT_VALID_CODE_POINTER(m_value);
     }
 #endif
@@ -213,7 +213,7 @@ public:
         // (I guess on RVTC function pointers have a different constness to GCC/MSVC?)
         : m_value((void*)value)
     {
-        PoisonedMasmPtr::assertIsNotPoisoned(m_value);
+        MasmScrambledPtr::assertIsNotScrambled(m_value);
         ASSERT_VALID_CODE_POINTER(m_value);
     }
 
@@ -221,12 +221,12 @@ public:
 
     void* value() const
     {
-        PoisonedMasmPtr::assertIsNotPoisoned(m_value);
+        MasmScrambledPtr::assertIsNotScrambled(m_value);
         return m_value;
     }
     void* executableAddress() const
     {
-        PoisonedMasmPtr::assertIsNotPoisoned(m_value);
+        MasmScrambledPtr::assertIsNotScrambled(m_value);
         return m_value;
     }
 
@@ -247,20 +247,20 @@ public:
     explicit ReturnAddressPtr(void* value)
         : m_value(value)
     {
-        PoisonedMasmPtr::assertIsNotPoisoned(m_value);
+        MasmScrambledPtr::assertIsNotScrambled(m_value);
         ASSERT_VALID_CODE_POINTER(m_value);
     }
 
     explicit ReturnAddressPtr(FunctionPtr function)
         : m_value(function.value())
     {
-        PoisonedMasmPtr::assertIsNotPoisoned(m_value);
+        MasmScrambledPtr::assertIsNotScrambled(m_value);
         ASSERT_VALID_CODE_POINTER(m_value);
     }
 
     void* value() const
     {
-        PoisonedMasmPtr::assertIsNotPoisoned(m_value);
+        MasmScrambledPtr::assertIsNotScrambled(m_value);
         return m_value;
     }
     
@@ -288,7 +288,7 @@ public:
         : m_value(value)
 #endif
     {
-        m_value.assertIsPoisoned();
+        m_value.assertIsScrambled();
         ASSERT(value);
         ASSERT_VALID_CODE_POINTER(m_value);
     }
@@ -298,8 +298,8 @@ public:
         ASSERT(value);
         ASSERT_VALID_CODE_POINTER(value);
         MacroAssemblerCodePtr result;
-        result.m_value = PoisonedMasmPtr(value);
-        result.m_value.assertIsPoisoned();
+        result.m_value = MasmScrambledPtr(value);
+        result.m_value.assertIsScrambled();
         return result;
     }
 
@@ -309,42 +309,42 @@ public:
         : m_value(ra.value())
     {
         ASSERT(ra.value());
-        m_value.assertIsPoisoned();
+        m_value.assertIsScrambled();
         ASSERT_VALID_CODE_POINTER(m_value);
     }
 
-    PoisonedMasmPtr poisonedPtr() const { return m_value; }
+    MasmScrambledPtr scrambledPtr() const { return m_value; }
 
     template<typename T = void*>
     T executableAddress() const
     {
-        m_value.assertIsPoisoned();
-        return m_value.unpoisoned<T>();
+        m_value.assertIsScrambled();
+        return m_value ? m_value.descrambled<T>() : static_cast<T>(0);
     }
 #if CPU(ARM_THUMB2)
     // To use this pointer as a data address remove the decoration.
     template<typename T = void*>
     T dataLocation() const
     {
-        m_value.assertIsPoisoned();
+        m_value.assertIsScrambled();
         ASSERT_VALID_CODE_POINTER(m_value);
-        return bitwise_cast<T>(m_value ? m_value.unpoisoned<char*>() - 1 : nullptr);
+        return bitwise_cast<T>(m_value ? m_value.descrambled<char*>() - 1 : nullptr);
     }
 #else
     template<typename T = void*>
     T dataLocation() const
     {
-        m_value.assertIsPoisoned();
+        m_value.assertIsScrambled();
         ASSERT_VALID_CODE_POINTER(m_value);
-        return m_value.unpoisoned<T>();
+        return m_value ? m_value.descrambled<T>() : static_cast<T>(0);
     }
 #endif
 
     bool operator!() const
     {
-#if ENABLE(POISON_ASSERTS)
+#if ENABLE(SCRAMBLED_PTR_ASSERTS)
         if (!isEmptyValue() && !isDeletedValue())
-            m_value.assertIsPoisoned();
+            m_value.assertIsScrambled();
 #endif
         return !m_value;
     }
@@ -352,17 +352,17 @@ public:
     
     bool operator==(const MacroAssemblerCodePtr& other) const
     {
-#if ENABLE(POISON_ASSERTS)
+#if ENABLE(SCRAMBLED_PTR_ASSERTS)
         if (!isEmptyValue() && !isDeletedValue())
-            m_value.assertIsPoisoned();
+            m_value.assertIsScrambled();
         if (!other.isEmptyValue() && !other.isDeletedValue())
-            other.m_value.assertIsPoisoned();
+            other.m_value.assertIsScrambled();
 #endif
         return m_value == other.m_value;
     }
 
     // Disallow any casting operations (except for booleans). Instead, the client
-    // should be asking for poisonedPtr() or executableAddress() explicitly.
+    // should be asking for scrambledPtr() or executableAddress() explicitly.
     template<typename T, typename = std::enable_if_t<!std::is_same<T, bool>::value>>
     operator T() = delete;
 
@@ -389,10 +389,10 @@ public:
     static void initialize();
 
 private:
-    static PoisonedMasmPtr emptyValue() { return PoisonedMasmPtr(1); }
-    static PoisonedMasmPtr deletedValue() { return PoisonedMasmPtr(2); }
+    static MasmScrambledPtr emptyValue() { return MasmScrambledPtr(1); }
+    static MasmScrambledPtr deletedValue() { return MasmScrambledPtr(2); }
 
-    PoisonedMasmPtr m_value;
+    MasmScrambledPtr m_value;
 };
 
 struct MacroAssemblerCodePtrHash {
@@ -479,7 +479,7 @@ private:
 inline FunctionPtr::FunctionPtr(MacroAssemblerCodePtr ptr)
     : m_value(ptr.executableAddress())
 {
-    PoisonedMasmPtr::assertIsNotPoisoned(m_value);
+    MasmScrambledPtr::assertIsNotScrambled(m_value);
     ASSERT_VALID_CODE_POINTER(m_value);
 }
 
index 0eaf0ea..d6cdb62 100644 (file)
@@ -505,12 +505,12 @@ private:
                         
                         GPRReg index = params[0].gpr();
                         GPRReg scratch = params.gpScratch(0);
-                        GPRReg poisonScratch = params.gpScratch(1);
+                        GPRReg descramblerKey = params.gpScratch(1);
 
-                        jit.move(CCallHelpers::TrustedImm64(g_masmPoison), poisonScratch);
+                        jit.move(CCallHelpers::TrustedImm64(g_masmScrambledPtrKey), descramblerKey);
                         jit.move(CCallHelpers::TrustedImmPtr(jumpTable), scratch);
                         jit.load64(CCallHelpers::BaseIndex(scratch, index, CCallHelpers::timesPtr()), scratch);
-                        jit.xor64(poisonScratch, scratch);
+                        jit.xor64(descramblerKey, scratch);
                         jit.jump(scratch);
 
                         // These labels are guaranteed to be populated before either late paths or
index 1df21dd..cab23f6 100644 (file)
@@ -13030,12 +13030,12 @@ void testInterpreter()
                 params.proc().addDataSection(sizeof(MacroAssemblerCodePtr) * labels.size()));
 
             GPRReg scratch = params.gpScratch(0);
-            GPRReg poisonScratch = params.gpScratch(1);
+            GPRReg descramblerKey = params.gpScratch(1);
 
             jit.move(CCallHelpers::TrustedImmPtr(jumpTable), scratch);
-            jit.move(CCallHelpers::TrustedImm64(g_masmPoison), poisonScratch);
+            jit.move(CCallHelpers::TrustedImm64(g_masmScrambledPtrKey), descramblerKey);
             jit.load64(CCallHelpers::BaseIndex(scratch, params[0].gpr(), CCallHelpers::timesPtr()), scratch);
-            jit.xor64(poisonScratch, scratch);
+            jit.xor64(descramblerKey, scratch);
             jit.jump(scratch);
 
             jit.addLinkTask(
index df774d2..7efca1f 100644 (file)
@@ -868,7 +868,7 @@ void SpeculativeJIT::checkArray(Node* node)
         m_jit.branchPtr(
             MacroAssembler::NotEqual,
             MacroAssembler::Address(temp.gpr(), Structure::classInfoOffset()),
-            TrustedImmPtr(PoisonedClassInfoPtr(expectedClassInfo).bits())));
+            TrustedImmPtr(ClassInfoScrambledPtr(expectedClassInfo).bits())));
 
     noResult(m_currentNode);
 }
@@ -8706,7 +8706,7 @@ void SpeculativeJIT::compileCheckSubClass(Node* node)
         m_jit.emitLoadStructure(*m_jit.vm(), baseGPR, otherGPR, specifiedGPR);
         m_jit.loadPtr(CCallHelpers::Address(otherGPR, Structure::classInfoOffset()), otherGPR);
 #if USE(JSVALUE64)
-        m_jit.move(CCallHelpers::TrustedImm64(g_classInfoPoison), specifiedGPR);
+        m_jit.move(CCallHelpers::TrustedImm64(g_classInfoScrambledPtrKey), specifiedGPR);
         m_jit.xor64(specifiedGPR, otherGPR);
 #endif
         m_jit.move(CCallHelpers::TrustedImmPtr(node->classInfo()), specifiedGPR);
@@ -9003,7 +9003,7 @@ void SpeculativeJIT::compileNewStringObject(Node* node)
         slowPath);
     
     m_jit.storePtr(
-        TrustedImmPtr(PoisonedClassInfoPtr(StringObject::info()).bits()),
+        TrustedImmPtr(ClassInfoScrambledPtr(StringObject::info()).bits()),
         JITCompiler::Address(resultGPR, JSDestructibleObject::classInfoOffset()));
 #if USE(JSVALUE64)
     m_jit.store64(
@@ -9774,7 +9774,7 @@ void SpeculativeJIT::speculate(Node*, Edge edge)
 }
 
 void SpeculativeJIT::emitSwitchIntJump(
-    SwitchData* data, GPRReg value, GPRReg scratch, GPRReg poisonScratch)
+    SwitchData* data, GPRReg value, GPRReg scratch, GPRReg descramblerKeyScratch)
 {
     SimpleJumpTable& table = m_jit.codeBlock()->switchJumpTable(data->switchTableIndex);
     table.ensureCTITable();
@@ -9782,15 +9782,15 @@ void SpeculativeJIT::emitSwitchIntJump(
     addBranch(
         m_jit.branch32(JITCompiler::AboveOrEqual, value, Imm32(table.ctiOffsets.size())),
         data->fallThrough.block);
-    UNUSED_PARAM(poisonScratch); // Placate the 32-bit build.
+    UNUSED_PARAM(descramblerKeyScratch); // Placate the 32-bit build.
 #if USE(JSVALUE64)
-    m_jit.move(TrustedImm64(g_masmPoison), poisonScratch);
+    m_jit.move(TrustedImm64(g_masmScrambledPtrKey), descramblerKeyScratch);
 #endif
     m_jit.move(TrustedImmPtr(table.ctiOffsets.begin()), scratch);
     m_jit.loadPtr(JITCompiler::BaseIndex(scratch, value, JITCompiler::timesPtr()), scratch);
     
 #if USE(JSVALUE64)
-    m_jit.xor64(poisonScratch, scratch);
+    m_jit.xor64(descramblerKeyScratch, scratch);
 #endif
     m_jit.jump(scratch);
     data->didUseJumpTable = true;
index d945071..b397785 100644 (file)
@@ -5010,7 +5010,7 @@ private:
         LBasicBlock lastNext = m_out.insertNewBlocksBefore(slowCase);
 
         LValue fastResultValue = allocateObject<StringObject>(structure, m_out.intPtrZero, slowCase);
-        m_out.storePtr(m_out.constIntPtr(PoisonedClassInfoPtr(StringObject::info()).bits()), fastResultValue, m_heaps.JSDestructibleObject_classInfo);
+        m_out.storePtr(m_out.constIntPtr(ClassInfoScrambledPtr(StringObject::info()).bits()), fastResultValue, m_heaps.JSDestructibleObject_classInfo);
         m_out.store64(string, fastResultValue, m_heaps.JSWrapperObject_internalValue);
         mutatorFence();
         ValueFromBlock fastResult = m_out.anchor(fastResultValue);
@@ -11170,8 +11170,8 @@ private:
             LBasicBlock continuation = m_out.newBlock();
 
             LValue structure = loadStructure(cell);
-            LValue poisonedClassInfo = m_out.loadPtr(structure, m_heaps.Structure_classInfo);
-            LValue classInfo = m_out.bitXor(poisonedClassInfo, m_out.constInt64(g_classInfoPoison));
+            LValue scrambledClassInfo = m_out.loadPtr(structure, m_heaps.Structure_classInfo);
+            LValue classInfo = m_out.bitXor(scrambledClassInfo, m_out.constInt64(g_classInfoScrambledPtrKey));
             ValueFromBlock otherAtStart = m_out.anchor(classInfo);
             m_out.jump(loop);
 
index 93bde6e..41cc1bc 100644 (file)
@@ -1625,7 +1625,7 @@ public:
     void emitAllocateDestructibleObject(VM& vm, GPRReg resultGPR, Structure* structure, GPRReg scratchGPR1, GPRReg scratchGPR2, JumpList& slowPath)
     {
         emitAllocateJSObject<ClassType>(vm, resultGPR, TrustedImmPtr(structure), TrustedImmPtr(0), scratchGPR1, scratchGPR2, slowPath);
-        storePtr(TrustedImmPtr(PoisonedClassInfoPtr(structure->classInfo()).bits()), Address(resultGPR, JSDestructibleObject::classInfoOffset()));
+        storePtr(TrustedImmPtr(ClassInfoScrambledPtr(structure->classInfo()).bits()), Address(resultGPR, JSDestructibleObject::classInfoOffset()));
     }
     
     void emitInitializeInlineStorage(GPRReg baseGPR, unsigned inlineCapacity)
index ebbbdce..4baa1e8 100644 (file)
@@ -77,7 +77,7 @@ namespace JSC {
         {
             loadCellArgument(argument, dst);
             emitLoadStructure(*vm(), dst, scratch, dst);
-            appendFailure(branchPtr(NotEqual, Address(scratch, Structure::classInfoOffset()), TrustedImmPtr(PoisonedClassInfoPtr(classInfo).bits())));
+            appendFailure(branchPtr(NotEqual, Address(scratch, Structure::classInfoOffset()), TrustedImmPtr(ClassInfoScrambledPtr(classInfo).bits())));
             // We have to reload the argument since emitLoadStructure clobbered it.
             loadCellArgument(argument, dst);
         }
index ba4de93..6614202 100644 (file)
@@ -214,7 +214,7 @@ MacroAssemblerCodeRef virtualThunkFor(VM* vm, CallLinkInfo& callLinkInfo)
     // Now we know that we have a CodeBlock, and we're committed to making a fast
     // call.
 #if USE(JSVALUE64)
-    jit.move(CCallHelpers::TrustedImm64(g_masmPoison), GPRInfo::regT1);
+    jit.move(CCallHelpers::TrustedImm64(g_masmScrambledPtrKey), GPRInfo::regT1);
     jit.xor64(GPRInfo::regT1, GPRInfo::regT4);
 #endif
 
@@ -1163,7 +1163,7 @@ MacroAssemblerCodeRef boundThisNoArgsFunctionCallGenerator(VM* vm)
     CCallHelpers::Jump noCode = jit.branchTestPtr(CCallHelpers::Zero, GPRInfo::regT0);
     
 #if USE(JSVALUE64)
-    jit.move(CCallHelpers::TrustedImm64(g_masmPoison), GPRInfo::regT1);
+    jit.move(CCallHelpers::TrustedImm64(g_masmScrambledPtrKey), GPRInfo::regT1);
     jit.xor64(GPRInfo::regT1, GPRInfo::regT0);
 #endif
     emitPointerValidation(jit, GPRInfo::regT0);
index 6616f27..7a15e22 100644 (file)
@@ -1303,7 +1303,7 @@ static SlowPathReturnType handleHostCall(ExecState* execCallee, Instruction* pc,
             execCallee->setCallee(asObject(callee));
             vm.hostCallReturnValue = JSValue::decode(callData.native.function(execCallee));
             
-            PoisonedMasmPtr::assertIsNotPoisoned(LLInt::getCodePtr(getHostCallReturnValue));
+            MasmScrambledPtr::assertIsNotScrambled(LLInt::getCodePtr(getHostCallReturnValue));
             LLINT_CALL_RETURN(execCallee, execCallee, LLInt::getCodePtr(getHostCallReturnValue));
         }
         
@@ -1327,7 +1327,7 @@ static SlowPathReturnType handleHostCall(ExecState* execCallee, Instruction* pc,
         execCallee->setCallee(asObject(callee));
         vm.hostCallReturnValue = JSValue::decode(constructData.native.function(execCallee));
 
-        PoisonedMasmPtr::assertIsNotPoisoned(LLInt::getCodePtr(getHostCallReturnValue));
+        MasmScrambledPtr::assertIsNotScrambled(LLInt::getCodePtr(getHostCallReturnValue));
         LLINT_CALL_RETURN(execCallee, execCallee, LLInt::getCodePtr(getHostCallReturnValue));
     }
     
@@ -1368,7 +1368,7 @@ inline SlowPathReturnType setUpCall(ExecState* execCallee, Instruction* pc, Code
                 callLinkInfo->machineCodeTarget = codePtr;
             }
 
-            PoisonedMasmPtr::assertIsNotPoisoned(codePtr.executableAddress());
+            MasmScrambledPtr::assertIsNotScrambled(codePtr.executableAddress());
             LLINT_CALL_RETURN(exec, execCallee, codePtr.executableAddress());
         }
         throwScope.release();
@@ -1419,7 +1419,7 @@ inline SlowPathReturnType setUpCall(ExecState* execCallee, Instruction* pc, Code
             codeBlock->linkIncomingCall(exec, callLinkInfo);
     }
 
-    PoisonedMasmPtr::assertIsNotPoisoned(codePtr.executableAddress());
+    MasmScrambledPtr::assertIsNotScrambled(codePtr.executableAddress());
     LLINT_CALL_RETURN(exec, execCallee, codePtr.executableAddress());
 }
 
index 8c671a9..1af64a4 100644 (file)
@@ -1950,7 +1950,7 @@ macro doCall(slowPath, prepareCall)
         prepareCall(LLIntCallLinkInfo::machineCodeTarget[t1], t2, t3, t4)
         callTargetFunction(LLIntCallLinkInfo::machineCodeTarget[t1])
     else
-        loadp _g_masmPoison, t2
+        loadp _g_masmScrambledPtrKey, t2
         xorp LLIntCallLinkInfo::machineCodeTarget[t1], t2
         prepareCall(t2, t1, t3, t4)
         callTargetFunction(t2)
index bf8c50a..af286cc 100644 (file)
@@ -59,7 +59,7 @@ void initializeThreading()
 
     std::call_once(initializeThreadingOnceFlag, []{
         WTF::initializeThreading();
-        initializePoison();
+        initializeScrambledPtrKeys();
         Options::initialize();
 #if ENABLE(WRITE_BARRIER_PROFILING)
         WriteBarrierCounters::initialize();
  */
 
 #include "config.h"
-#include "JSCPoisonedPtr.h"
+#include "JSCScrambledPtr.h"
 
 namespace JSC {
 
-uintptr_t g_classInfoPoison;
-uintptr_t g_masmPoison;
+uintptr_t g_classInfoScrambledPtrKey;
+uintptr_t g_masmScrambledPtrKey;
 
-void initializePoison()
+void initializeScrambledPtrKeys()
 {
     static std::once_flag initializeOnceFlag;
     std::call_once(initializeOnceFlag, [] {
-        g_classInfoPoison = makePoison();
-        g_masmPoison = makePoison();
+        g_classInfoScrambledPtrKey = makeScrambledPtrKey();
+        g_masmScrambledPtrKey = makeScrambledPtrKey();
     });
 }
 
 
 #pragma once
 
-#include <wtf/Poisoned.h>
+#include <wtf/ScrambledPtr.h>
 
 namespace JSC {
 
-extern "C" JS_EXPORTDATA uintptr_t g_classInfoPoison;
-extern "C" JS_EXPORTDATA uintptr_t g_masmPoison;
+extern "C" JS_EXPORTDATA uintptr_t g_classInfoScrambledPtrKey;
+extern "C" JS_EXPORTDATA uintptr_t g_masmScrambledPtrKey;
 
 struct ClassInfo;
 
-using PoisonedClassInfoPtr = Poisoned<g_classInfoPoison, const ClassInfo*>;
-using PoisonedMasmPtr = Poisoned<g_masmPoison, void*>;
+using ClassInfoScrambledPtr = ScrambledPtr<const ClassInfo*, g_classInfoScrambledPtrKey>;
+using MasmScrambledPtr = ScrambledPtr<void*, g_masmScrambledPtrKey>;
 
-void initializePoison();
+void initializeScrambledPtrKeys();
 
 } // namespace JSC
 
index 43828f0..a1fc2b7 100644 (file)
@@ -43,7 +43,7 @@ public:
         return &vm.destructibleObjectSpace;
     }
 
-    const ClassInfo* classInfo() const { return m_classInfo.unpoisoned(); }
+    const ClassInfo* classInfo() const { return m_classInfo.descrambled(); }
     
     static ptrdiff_t classInfoOffset() { return OBJECT_OFFSETOF(JSDestructibleObject, m_classInfo); }
 
@@ -56,7 +56,7 @@ protected:
     }
 
 private:
-    PoisonedClassInfoPtr m_classInfo;
+    ClassInfoScrambledPtr m_classInfo;
 };
 
 } // namespace JSC
index b92fd7f..21ae6e6 100644 (file)
@@ -94,7 +94,7 @@ public:
         return &vm.segmentedVariableObjectSpace;
     }
     
-    const ClassInfo* classInfo() const { return m_classInfo.unpoisoned(); }
+    const ClassInfo* classInfo() const { return m_classInfo.descrambled(); }
     
 protected:
     JSSegmentedVariableObject(VM&, Structure*, JSScope*);
@@ -107,7 +107,7 @@ private:
     SegmentedVector<WriteBarrier<Unknown>, 16> m_variables;
     ConcurrentJSLock m_lock;
     bool m_alreadyDestroyed { false }; // We use these assertions to check that we aren't doing ancient hacks that result in this being destroyed more than once.
-    PoisonedClassInfoPtr m_classInfo;
+    ClassInfoScrambledPtr m_classInfo;
 };
 
 } // namespace JSC
index cad1eed..65d658b 100644 (file)
@@ -468,7 +468,7 @@ public:
 
     void setObjectToStringValue(ExecState*, VM&, JSString* value, PropertySlot toStringTagSymbolSlot);
 
-    const ClassInfo* classInfo() const { return m_classInfo.unpoisoned(); }
+    const ClassInfo* classInfo() const { return m_classInfo.descrambled(); }
 
     static ptrdiff_t structureIDOffset()
     {
@@ -798,7 +798,7 @@ private:
 
     RefPtr<UniquedStringImpl> m_nameInPrevious;
 
-    PoisonedClassInfoPtr m_classInfo;
+    ClassInfoScrambledPtr m_classInfo;
 
     StructureTransitionTable m_transitionTable;
 
index 83426a4..a6c2d53 100644 (file)
@@ -414,7 +414,7 @@ public:
     std::unique_ptr<PromiseDeferredTimer> promiseDeferredTimer;
     
     JSCell* currentlyDestructingCallbackObject;
-    PoisonedClassInfoPtr currentlyDestructingCallbackObjectClassInfo;
+    ClassInfoScrambledPtr currentlyDestructingCallbackObjectClassInfo;
 
     AtomicStringTable* m_atomicStringTable;
     WTF::SymbolRegistry m_symbolRegistry;
index 552dd44..e0b4568 100644 (file)
@@ -1,3 +1,31 @@
+2017-12-07  Michael Catanzaro  <mcatanzaro@igalia.com>
+
+        Unreviewed, rolling out r225620
+        https://bugs.webkit.org/show_bug.cgi?id=180514
+        <rdar://problem/35901694>
+
+        It broke the build with GCC 7, and I don't know how to fix it.
+
+        * WTF.xcodeproj/project.pbxproj:
+        * wtf/CMakeLists.txt:
+        * wtf/Poisoned.h: Removed.
+        * wtf/ScrambledPtr.cpp: Renamed from Source/WTF/wtf/Poisoned.cpp.
+        (WTF::makeScrambledPtrKey):
+        * wtf/ScrambledPtr.h: Added.
+        (WTF::ScrambledPtr::ScrambledPtr):
+        (WTF::ScrambledPtr::assertIsScrambled const):
+        (WTF::ScrambledPtr::assertIsNotScrambled const):
+        (WTF::ScrambledPtr::descrambled const):
+        (WTF::ScrambledPtr::operator-> const):
+        (WTF::ScrambledPtr::bits const):
+        (WTF::ScrambledPtr::operator! const):
+        (WTF::ScrambledPtr::operator bool const):
+        (WTF::ScrambledPtr::operator== const):
+        (WTF::ScrambledPtr::operator==):
+        (WTF::ScrambledPtr::operator=):
+        (WTF::ScrambledPtr::scramble):
+        (WTF::ScrambledPtr::descramble):
+
 2017-12-06  Mark Lam  <mark.lam@apple.com>
 
         Refactoring: Rename ScrambledPtr to Poisoned.
index 682ddfe..de1d0f0 100644 (file)
                E38D6E271F5522E300A75CC4 /* StringBuilderJSON.cpp in Sources */ = {isa = PBXBuildFile; fileRef = E38D6E261F5522E300A75CC4 /* StringBuilderJSON.cpp */; };
                E4A0AD391A96245500536DF6 /* WorkQueue.cpp in Sources */ = {isa = PBXBuildFile; fileRef = E4A0AD371A96245500536DF6 /* WorkQueue.cpp */; };
                E4A0AD3D1A96253C00536DF6 /* WorkQueueCocoa.cpp in Sources */ = {isa = PBXBuildFile; fileRef = E4A0AD3C1A96253C00536DF6 /* WorkQueueCocoa.cpp */; };
-               FE85416E1FBE285D008DA5DA /* Poisoned.cpp in Sources */ = {isa = PBXBuildFile; fileRef = FE85416C1FBE285B008DA5DA /* Poisoned.cpp */; };
+               FE85416E1FBE285D008DA5DA /* ScrambledPtr.cpp in Sources */ = {isa = PBXBuildFile; fileRef = FE85416C1FBE285B008DA5DA /* ScrambledPtr.cpp */; };
                FEDACD3D1630F83F00C69634 /* StackStats.cpp in Sources */ = {isa = PBXBuildFile; fileRef = FEDACD3B1630F83F00C69634 /* StackStats.cpp */; };
 /* End PBXBuildFile section */
 
                EF7D6CD59D8642A8A0DA86AD /* StackTrace.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = StackTrace.h; sourceTree = "<group>"; };
                F72BBDB107FA424886178B9E /* SymbolImpl.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = SymbolImpl.cpp; 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>"; };
+               FE85416C1FBE285B008DA5DA /* ScrambledPtr.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = ScrambledPtr.cpp; sourceTree = "<group>"; };
+               FE85416D1FBE285C008DA5DA /* ScrambledPtr.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ScrambledPtr.h; sourceTree = "<group>"; };
                FE86A8741E59440200111BBF /* ForbidHeapAllocation.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ForbidHeapAllocation.h; sourceTree = "<group>"; };
                FE8925AF1D00DAEC0046907E /* Indenter.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Indenter.h; sourceTree = "<group>"; };
                FEDACD3B1630F83F00C69634 /* StackStats.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = StackStats.cpp; sourceTree = "<group>"; };
                                A876DBD7151816E500DADB95 /* Platform.h */,
                                E3200AB41E9A536D003B59D2 /* PlatformRegisters.h */,
                                0FF860941BCCBD740045127F /* PointerComparison.h */,
-                               FE85416C1FBE285B008DA5DA /* Poisoned.cpp */,
-                               FE85416D1FBE285C008DA5DA /* Poisoned.h */,
                                0F9D335D165DBA73005AD387 /* PrintStream.cpp */,
                                0F9D335E165DBA73005AD387 /* PrintStream.h */,
                                53EC253C1E95AD30000831B9 /* PriorityQueue.h */,
                                1469419516EAAFF80024E146 /* SchedulePairMac.mm */,
                                1A3524AA1D63A2FF0031729B /* Scope.h */,
                                0FEC84B01BDACD390080FF74 /* ScopedLambda.h */,
+                               FE85416C1FBE285B008DA5DA /* ScrambledPtr.cpp */,
+                               FE85416D1FBE285C008DA5DA /* ScrambledPtr.h */,
                                0F66B2841DC97BAB004A1D3F /* Seconds.cpp */,
                                0F66B2851DC97BAB004A1D3F /* Seconds.h */,
                                A8A47306151A825B004123FF /* SegmentedVector.h */,
                                1469419316EAAF6D0024E146 /* RunLoopTimerCF.cpp in Sources */,
                                1469419916EAB0410024E146 /* SchedulePairCF.cpp in Sources */,
                                1469419716EAAFF80024E146 /* SchedulePairMac.mm in Sources */,
-                               FE85416E1FBE285D008DA5DA /* Poisoned.cpp in Sources */,
+                               FE85416E1FBE285D008DA5DA /* ScrambledPtr.cpp in Sources */,
                                0F66B28E1DC97BAB004A1D3F /* Seconds.cpp in Sources */,
                                A8A47421151A825B004123FF /* SHA1.cpp in Sources */,
                                5311BD531EA71CAD00525281 /* Signals.cpp in Sources */,
index e622c70..a8cd5f6 100644 (file)
@@ -107,7 +107,6 @@ set(WTF_HEADERS
     ParkingLot.h
     Platform.h
     PlatformRegisters.h
-    Poisoned.h
     PrintStream.h
     ProcessID.h
     RAMSize.h
@@ -131,6 +130,7 @@ set(WTF_HEADERS
     SharedTask.h
     SaturatedArithmetic.h
     ScopedLambda.h
+    ScrambledPtr.h
     Seconds.h
     SegmentedVector.h
     SmallPtrSet.h
@@ -258,7 +258,6 @@ set(WTF_SOURCES
     ParallelHelperPool.cpp
     ParallelJobsGeneric.cpp
     ParkingLot.cpp
-    Poisoned.cpp
     PrintStream.cpp
     RAMSize.cpp
     RandomDevice.cpp
@@ -267,6 +266,7 @@ set(WTF_SOURCES
     RefCountedLeakCounter.cpp
     RunLoop.cpp
     SHA1.cpp
+    ScrambledPtr.cpp
     Seconds.cpp
     SixCharacterHash.cpp
     StackBounds.cpp
diff --git a/Source/WTF/wtf/Poisoned.h b/Source/WTF/wtf/Poisoned.h
deleted file mode 100644 (file)
index bfb43c1..0000000
+++ /dev/null
@@ -1,140 +0,0 @@
-/*
- * Copyright (C) 2017 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/Assertions.h>
-
-#define ENABLE_POISON_ASSERTS 0
-
-// Not currently supported for 32-bit or OS(WINDOWS) builds (because of missing llint support).
-// Make sure it's disabled.
-#if USE(JSVALUE32_64) || OS(WINDOWS)
-#undef ENABLE_POISON_ASSERTS
-#define ENABLE_POISON_ASSERTS 0
-#endif
-
-namespace WTF {
-
-using PoisonedBits = uintptr_t;
-
-template<typename KeyType, KeyType key, typename T, typename = std::enable_if_t<std::is_pointer<T>::value>>
-class PoisonedImpl {
-public:
-    PoisonedImpl() { }
-
-    explicit PoisonedImpl(T ptr)
-        : m_poisonedBits(poison(ptr))
-    {
-        ASSERT(ptr && m_poisonedBits);
-    }
-
-    PoisonedImpl(const PoisonedImpl&) = default;
-
-    explicit PoisonedImpl(PoisonedBits poisonedBits)
-        : m_poisonedBits(poisonedBits)
-    {
-        ASSERT(m_poisonedBits);
-    }
-
-#if ENABLE(POISON_ASSERTS)
-    template<typename U = void*>
-    static bool isPoisoned(U value) { return !value || (reinterpret_cast<uintptr_t>(value) & 0xffff000000000000); }
-    template<typename U = void*>
-    static void assertIsPoisoned(U value) { RELEASE_ASSERT(isPoisoned(value)); }
-    template<typename U = void*>
-    static void assertIsNotPoisoned(U value) { RELEASE_ASSERT(!isPoisoned(value)); }
-#else
-    template<typename U = void*> static void assertIsPoisoned(U) { }
-    template<typename U = void*> static void assertIsNotPoisoned(U) { }
-#endif
-    void assertIsPoisoned() const { assertIsPoisoned(m_poisonedBits); }
-    void assertIsNotPoisoned() const { assertIsNotPoisoned(m_poisonedBits); }
-
-    template<typename U = T>
-    U unpoisoned() const { return unpoison<U>(m_poisonedBits); }
-
-    ALWAYS_INLINE T operator->() const { return unpoison<T>(m_poisonedBits); }
-
-    template<typename U = PoisonedBits>
-    U bits() const { return bitwise_cast<U>(m_poisonedBits); }
-
-    bool operator!() const { return !m_poisonedBits; }
-    explicit operator bool() const { return !!m_poisonedBits; }
-
-    bool operator==(const PoisonedImpl& b) const
-    {
-        return m_poisonedBits == b.m_poisonedBits;
-    }
-
-    template<typename PtrType = void*, typename = typename std::enable_if<std::is_pointer<PtrType>::value>::type>
-    bool operator==(const PtrType b)
-    {
-        return unpoisoned<PtrType>() == b;
-    }
-
-    PoisonedImpl& operator=(T ptr)
-    {
-        m_poisonedBits = poison(ptr);
-        return *this;
-    }
-    PoisonedImpl& operator=(const PoisonedImpl&) = default;
-
-private:
-#if USE(JSVALUE64)
-    template<typename U>
-    ALWAYS_INLINE static PoisonedBits poison(U ptr) { return ptr ? bitwise_cast<PoisonedBits>(ptr) ^ key : 0; }
-    template<typename U>
-    ALWAYS_INLINE static U unpoison(PoisonedBits poisonedBits) { return poisonedBits ? bitwise_cast<U>(poisonedBits ^ key) : bitwise_cast<U>(0ll); }
-#else
-    template<typename U>
-    ALWAYS_INLINE static PoisonedBits poison(U ptr) { return bitwise_cast<PoisonedBits>(ptr); }
-    template<typename U>
-    ALWAYS_INLINE static U unpoison(PoisonedBits poisonedBits) { return bitwise_cast<U>(poisonedBits); }
-#endif
-
-    PoisonedBits m_poisonedBits { 0 };
-};
-
-template<uintptr_t& key, typename T>
-using Poisoned = PoisonedImpl<const uintptr_t&, key, T>;
-
-#if USE(JSVALUE64)
-template<uint32_t key, typename T>
-using Int32Poisoned = PoisonedImpl<uintptr_t, static_cast<uintptr_t>(key) << 32, T>;
-#else
-template<uint32_t, typename T>
-using Int32Poisoned = PoisonedImpl<uintptr_t, 0, T>;
-#endif
-
-WTF_EXPORT_PRIVATE uintptr_t makePoison();
-
-} // namespace WTF
-
-using WTF::Int32Poisoned;
-using WTF::Poisoned;
-using WTF::PoisonedBits;
-using WTF::makePoison;
-
similarity index 81%
rename from Source/WTF/wtf/Poisoned.cpp
rename to Source/WTF/wtf/ScrambledPtr.cpp
index fd0a9ec..4bd04d7 100644 (file)
  */
 
 #include "config.h"
-#include "Poisoned.h"
+#include "ScrambledPtr.h"
 
 #include <wtf/CryptographicallyRandomNumber.h>
 
 namespace WTF {
 
-uintptr_t makePoison()
+uintptr_t makeScrambledPtrKey()
 {
     uintptr_t key = cryptographicallyRandomNumber();
 #if USE(JSVALUE64) && !OS(WINDOWS)
     key = (key << 32) ^ (static_cast<uintptr_t>(cryptographicallyRandomNumber()) << 3);
-    // Ensure that the poisoned bits (pointer ^ key) do not make a valid pointer and
-    // cannot be 0. We ensure that it is zero so that the poisoned bits can also be
-    // used for a notmal zero check without needing to decoded first.
+    // Ensure that the scrambled bits (pointer ^ key) do not make a valid pointer and
+    // cannot be 0. We ensure that it is zero so that the scrambled bits can also be
+    // used for a notmal zero check without needing to descramble first.
     key |= (static_cast<uintptr_t>(0x1) << 63);
 #else
-    key = 0; // Poisoning is not supported on 32-bit or non-darwin platforms yet.
+    key = 0; // Scrambling is not supported on 32-bit or non-darwin platforms yet.
 #endif
     return key;
 }
diff --git a/Source/WTF/wtf/ScrambledPtr.h b/Source/WTF/wtf/ScrambledPtr.h
new file mode 100644 (file)
index 0000000..f49f029
--- /dev/null
@@ -0,0 +1,129 @@
+/*
+ * Copyright (C) 2017 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/Assertions.h>
+
+#define ENABLE_SCRAMBLED_PTR_ASSERTS 0
+
+// Not currently supported for 32-bit or OS(WINDOWS) builds (because of missing llint support).
+// Make sure it's disabled.
+#if USE(JSVALUE32_64) || OS(WINDOWS)
+#undef ENABLE_SCRAMBLED_PTR_ASSERTS
+#define ENABLE_SCRAMBLED_PTR_ASSERTS 0
+#endif
+
+namespace WTF {
+
+using ScrambledPtrBits = uintptr_t;
+
+template<typename T, uintptr_t& key, typename = std::enable_if_t<std::is_pointer<T>::value>>
+class ScrambledPtr {
+public:
+    ScrambledPtr() { }
+
+    explicit ScrambledPtr(T ptr)
+        : m_scrambledBits(scramble(ptr))
+    {
+        ASSERT(ptr && m_scrambledBits);
+    }
+
+    ScrambledPtr(const ScrambledPtr&) = default;
+
+    explicit ScrambledPtr(ScrambledPtrBits scrambledBits)
+        : m_scrambledBits(scrambledBits)
+    {
+        ASSERT(m_scrambledBits);
+    }
+
+#if ENABLE(SCRAMBLED_PTR_ASSERTS)
+    template<typename U = void*>
+    static bool isScrambled(U value) { return !value || (reinterpret_cast<uintptr_t>(value) & 0xffff000000000000); }
+    template<typename U = void*>
+    static void assertIsScrambled(U value) { RELEASE_ASSERT(isScrambled(value)); }
+    template<typename U = void*>
+    static void assertIsNotScrambled(U value) { RELEASE_ASSERT(!isScrambled(value)); }
+#else
+    template<typename U = void*> static void assertIsScrambled(U) { }
+    template<typename U = void*> static void assertIsNotScrambled(U) { }
+#endif
+    void assertIsScrambled() const { assertIsScrambled(m_scrambledBits); }
+    void assertIsNotScrambled() const { assertIsNotScrambled(m_scrambledBits); }
+
+    template<typename U = T>
+    U descrambled() const { return descramble<U>(m_scrambledBits); }
+
+    ALWAYS_INLINE T operator->() const { return descramble<T>(m_scrambledBits); }
+
+    template<typename U = ScrambledPtrBits>
+    U bits() const { return bitwise_cast<U>(m_scrambledBits); }
+
+    bool operator!() const { return !m_scrambledBits; }
+    explicit operator bool() const { return !!m_scrambledBits; }
+
+    bool operator==(const ScrambledPtr& b) const
+    {
+        return m_scrambledBits == b.m_scrambledBits;
+    }
+
+    template<typename PtrType = void*, typename = typename std::enable_if<std::is_pointer<PtrType>::value>::type>
+    bool operator==(const PtrType b)
+    {
+        return descrambled<PtrType>() == b;
+    }
+
+    ScrambledPtr& operator=(T ptr)
+    {
+        m_scrambledBits = ptr ? scramble(ptr) : 0;
+        return *this;
+    }
+    ScrambledPtr& operator=(const ScrambledPtr&) = default;
+
+private:
+#if USE(JSVALUE64)
+    template<typename U>
+    ALWAYS_INLINE static ScrambledPtrBits scramble(U ptr) { return bitwise_cast<ScrambledPtrBits>(ptr) ^ key; }
+    template<typename U>
+    ALWAYS_INLINE static U descramble(ScrambledPtrBits scrambledBits) { return bitwise_cast<U>(scrambledBits ^ key); }
+#else
+    template<typename U>
+    ALWAYS_INLINE static ScrambledPtrBits scramble(U ptr) { return bitwise_cast<ScrambledPtrBits>(ptr); }
+    template<typename U>
+    ALWAYS_INLINE static U descramble(ScrambledPtrBits scrambledBits) { return bitwise_cast<U>(scrambledBits); }
+#endif
+
+    ScrambledPtrBits m_scrambledBits { 0 };
+};
+
+void initializeScrambledPtr();
+WTF_EXPORT_PRIVATE uintptr_t makeScrambledPtrKey();
+
+} // namespace WTF
+
+using WTF::ScrambledPtr;
+using WTF::ScrambledPtrBits;
+using WTF::makeScrambledPtrKey;
+