Skip to content
Permalink
Browse files
Refactoring: Rename ScrambledPtr to Poisoned.
https://bugs.webkit.org/show_bug.cgi?id=180514

Reviewed by Saam Barati.

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::poisonedPtr const):
(JSC::MacroAssemblerCodePtr:: const):
(JSC::MacroAssemblerCodePtr::operator! const):
(JSC::MacroAssemblerCodePtr::operator== const):
(JSC::MacroAssemblerCodePtr::emptyValue):
(JSC::MacroAssemblerCodePtr::deletedValue):
(JSC::MacroAssemblerCodePtr::scrambledPtr 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/JSCPoisonedPtr.cpp: Copied from Source/JavaScriptCore/runtime/JSCScrambledPtr.cpp.
(JSC::initializePoison):
(JSC::initializeScrambledPtrKeys): Deleted.
* runtime/JSCPoisonedPtr.h: Copied from Source/JavaScriptCore/runtime/JSCScrambledPtr.h.
* runtime/JSCScrambledPtr.cpp: Removed.
* runtime/JSCScrambledPtr.h: Removed.
* runtime/JSDestructibleObject.h:
(JSC::JSDestructibleObject::classInfo const):
* runtime/JSSegmentedVariableObject.h:
(JSC::JSSegmentedVariableObject::classInfo const):
* runtime/Structure.h:
* runtime/VM.h:

Source/WTF:

We're switching our nomenclature to "poisoning" instead of "scrambling" pointers.
This allows us to use shorter names.

This patch is almost purely refactoring, except for one change: the PoisonedImpl
template class (previously ScrambledPtr) has been modified to allow usage of
a constexpr uint32_t poison value (see Int32Poisoned) in addition to a runtime
determined uintptr_t poison value (see Poisoned).

* WTF.xcodeproj/project.pbxproj:
* wtf/CMakeLists.txt:
* wtf/Poisoned.cpp: Copied from Source/WTF/wtf/ScrambledPtr.cpp.
(WTF::makePoison):
(WTF::makeScrambledPtrKey): Deleted.
* wtf/Poisoned.h: Copied from Source/WTF/wtf/ScrambledPtr.h.
(WTF::PoisonedImpl::PoisonedImpl):
(WTF::PoisonedImpl::assertIsPoisoned const):
(WTF::PoisonedImpl::assertIsNotPoisoned const):
(WTF::PoisonedImpl::unpoisoned const):
(WTF::PoisonedImpl::operator-> const):
(WTF::PoisonedImpl::bits const):
(WTF::PoisonedImpl::operator! const):
(WTF::PoisonedImpl::operator bool const):
(WTF::PoisonedImpl::operator== const):
(WTF::PoisonedImpl::operator==):
(WTF::PoisonedImpl::operator=):
(WTF::PoisonedImpl::poison):
(WTF::PoisonedImpl::unpoison):
(WTF::ScrambledPtr::ScrambledPtr): Deleted.
(WTF::ScrambledPtr::assertIsScrambled const): Deleted.
(WTF::ScrambledPtr::assertIsNotScrambled const): Deleted.
(WTF::ScrambledPtr::descrambled const): Deleted.
(WTF::ScrambledPtr::operator-> const): Deleted.
(WTF::ScrambledPtr::bits const): Deleted.
(WTF::ScrambledPtr::operator! const): Deleted.
(WTF::ScrambledPtr::operator bool const): Deleted.
(WTF::ScrambledPtr::operator== const): Deleted.
(WTF::ScrambledPtr::operator==): Deleted.
(WTF::ScrambledPtr::operator=): Deleted.
(WTF::ScrambledPtr::scramble): Deleted.
(WTF::ScrambledPtr::descramble): Deleted.
* wtf/ScrambledPtr.cpp: Removed.
* wtf/ScrambledPtr.h: Removed.



Canonical link: https://commits.webkit.org/196440@main
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@225620 268f45cc-cd09-0410-ab3c-d52691b4dbfc
  • Loading branch information
Mark Lam committed Dec 7, 2017
1 parent cf6bc5b commit 66491beda405b7c5cb2c241ff2787927b763f202
Showing with 368 additions and 243 deletions.
  1. +2 −2 Source/JavaScriptCore/API/JSCallbackObject.h
  2. +1 −1 Source/JavaScriptCore/API/JSObjectRef.cpp
  3. +64 −0 Source/JavaScriptCore/ChangeLog
  4. +6 −6 Source/JavaScriptCore/JavaScriptCore.xcodeproj/project.pbxproj
  5. +1 −1 Source/JavaScriptCore/Sources.txt
  6. +45 −45 Source/JavaScriptCore/assembler/MacroAssemblerCodeRef.h
  7. +3 −3 Source/JavaScriptCore/b3/B3LowerMacros.cpp
  8. +3 −3 Source/JavaScriptCore/b3/testb3.cpp
  9. +7 −7 Source/JavaScriptCore/dfg/DFGSpeculativeJIT.cpp
  10. +3 −3 Source/JavaScriptCore/ftl/FTLLowerDFGToB3.cpp
  11. +1 −1 Source/JavaScriptCore/jit/AssemblyHelpers.h
  12. +1 −1 Source/JavaScriptCore/jit/SpecializedThunkJIT.h
  13. +2 −2 Source/JavaScriptCore/jit/ThunkGenerators.cpp
  14. +4 −4 Source/JavaScriptCore/llint/LLIntSlowPaths.cpp
  15. +1 −1 Source/JavaScriptCore/llint/LowLevelInterpreter64.asm
  16. +1 −1 Source/JavaScriptCore/runtime/InitializeThreading.cpp
  17. +6 −6 Source/JavaScriptCore/runtime/{JSCScrambledPtr.cpp → JSCPoisonedPtr.cpp}
  18. +6 −6 Source/JavaScriptCore/runtime/{JSCScrambledPtr.h → JSCPoisonedPtr.h}
  19. +2 −2 Source/JavaScriptCore/runtime/JSDestructibleObject.h
  20. +2 −2 Source/JavaScriptCore/runtime/JSSegmentedVariableObject.h
  21. +2 −2 Source/JavaScriptCore/runtime/Structure.h
  22. +1 −1 Source/JavaScriptCore/runtime/VM.h
  23. +50 −0 Source/WTF/ChangeLog
  24. +6 −6 Source/WTF/WTF.xcodeproj/project.pbxproj
  25. +2 −2 Source/WTF/wtf/CMakeLists.txt
  26. +6 −6 Source/WTF/wtf/{ScrambledPtr.cpp → Poisoned.cpp}
  27. +140 −0 Source/WTF/wtf/Poisoned.h
  28. +0 −129 Source/WTF/wtf/ScrambledPtr.h
@@ -27,7 +27,7 @@
#ifndef JSCallbackObject_h
#define JSCallbackObject_h

#include "JSCScrambledPtr.h"
#include "JSCPoisonedPtr.h"
#include "JSObjectRef.h"
#include "JSValueRef.h"
#include "JSObject.h"
@@ -234,7 +234,7 @@ class JSCallbackObject : public Parent {
static EncodedJSValue callbackGetter(ExecState*, EncodedJSValue, PropertyName);

std::unique_ptr<JSCallbackObjectData> m_callbackObjectData;
ClassInfoScrambledPtr m_classInfo;
PoisonedClassInfoPtr m_classInfo;
};

} // namespace JSC
@@ -431,7 +431,7 @@ static const ClassInfo* classInfoPrivate(JSObject* jsObject)
if (vm.currentlyDestructingCallbackObject != jsObject)
return jsObject->classInfo(vm);

return vm.currentlyDestructingCallbackObjectClassInfo.descrambled();
return vm.currentlyDestructingCallbackObjectClassInfo.unpoisoned();
}

void* JSObjectGetPrivate(JSObjectRef object)
@@ -1,3 +1,67 @@
2017-12-06 Mark Lam <mark.lam@apple.com>

Refactoring: Rename ScrambledPtr to Poisoned.
https://bugs.webkit.org/show_bug.cgi?id=180514

Reviewed by Saam Barati.

* 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::poisonedPtr const):
(JSC::MacroAssemblerCodePtr:: const):
(JSC::MacroAssemblerCodePtr::operator! const):
(JSC::MacroAssemblerCodePtr::operator== const):
(JSC::MacroAssemblerCodePtr::emptyValue):
(JSC::MacroAssemblerCodePtr::deletedValue):
(JSC::MacroAssemblerCodePtr::scrambledPtr 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/JSCPoisonedPtr.cpp: Copied from Source/JavaScriptCore/runtime/JSCScrambledPtr.cpp.
(JSC::initializePoison):
(JSC::initializeScrambledPtrKeys): Deleted.
* runtime/JSCPoisonedPtr.h: Copied from Source/JavaScriptCore/runtime/JSCScrambledPtr.h.
* runtime/JSCScrambledPtr.cpp: Removed.
* runtime/JSCScrambledPtr.h: Removed.
* runtime/JSDestructibleObject.h:
(JSC::JSDestructibleObject::classInfo const):
* runtime/JSSegmentedVariableObject.h:
(JSC::JSSegmentedVariableObject::classInfo const):
* runtime/Structure.h:
* runtime/VM.h:

2017-12-02 Darin Adler <darin@apple.com>

Modernize some aspects of text codecs, eliminate WebKit use of strcasecmp
@@ -1720,7 +1720,7 @@
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 /* JSCScrambledPtr.h in Headers */ = {isa = PBXBuildFile; fileRef = FE2B0B671FD0D2960075DA5F /* JSCScrambledPtr.h */; settings = {ATTRIBUTES = (Private, ); }; };
FE2B0B691FD227E00075DA5F /* JSCPoisonedPtr.h in Headers */ = {isa = PBXBuildFile; fileRef = FE2B0B671FD0D2960075DA5F /* JSCPoisonedPtr.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 */; };
@@ -4598,8 +4598,8 @@
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 /* 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>"; };
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>"; };
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>"; };
@@ -6543,8 +6543,8 @@
F692A8870255597D01FF60F7 /* JSCJSValue.cpp */,
14ABB36E099C076400E2A24F /* JSCJSValue.h */,
865A30F0135007E100CDB49E /* JSCJSValueInlines.h */,
FE2B0B681FD0D2970075DA5F /* JSCScrambledPtr.cpp */,
FE2B0B671FD0D2960075DA5F /* JSCScrambledPtr.h */,
FE2B0B681FD0D2970075DA5F /* JSCPoisonedPtr.cpp */,
FE2B0B671FD0D2960075DA5F /* JSCPoisonedPtr.h */,
72AAF7CB1D0D318B005E60BE /* JSCustomGetterSetterFunction.cpp */,
72AAF7CC1D0D318B005E60BE /* JSCustomGetterSetterFunction.h */,
0F2B66BD17B6B5AB00A7AE3F /* JSDataView.cpp */,
@@ -8155,7 +8155,7 @@
0FEC852A1BDACDAC0080FF74 /* B3PhaseScope.h in Headers */,
0F37308D1C0BD29100052BFA /* B3PhiChildren.h in Headers */,
0FEC852C1BDACDAC0080FF74 /* B3Procedure.h in Headers */,
FE2B0B691FD227E00075DA5F /* JSCScrambledPtr.h in Headers */,
FE2B0B691FD227E00075DA5F /* JSCPoisonedPtr.h in Headers */,
0FEC852D1BDACDAC0080FF74 /* B3ProcedureInlines.h in Headers */,
0F725CAA1C503DED00AD943A /* B3PureCSE.h in Headers */,
43422A671C16267800E2EB98 /* B3ReduceDoubleToFloat.h in Headers */,
@@ -772,7 +772,7 @@ runtime/JSAsyncFunction.cpp
runtime/JSAsyncGeneratorFunction.cpp
runtime/JSBoundFunction.cpp
runtime/JSCJSValue.cpp
runtime/JSCScrambledPtr.cpp
runtime/JSCPoisonedPtr.cpp
runtime/JSCallee.cpp
runtime/JSCell.cpp
runtime/JSCustomGetterSetterFunction.cpp

0 comments on commit 66491be

Please sign in to comment.