Skip to content

Commit

Permalink
Merge r229087 - Replace TrustedImmPtr(0) with TrustedImmPtr(nullptr)
Browse files Browse the repository at this point in the history
https://bugs.webkit.org/show_bug.cgi?id=183195

Reviewed by Mark Lam.

* assembler/AbstractMacroAssembler.h:
(JSC::AbstractMacroAssembler::TrustedImmPtr::TrustedImmPtr):
* assembler/MacroAssembler.h:
(JSC::MacroAssembler::patchableBranchPtr):
(JSC::MacroAssembler::patchableBranchPtrWithPatch):
* assembler/MacroAssemblerARM.h:
(JSC::MacroAssemblerARM::branchPtrWithPatch):
(JSC::MacroAssemblerARM::storePtrWithPatch):
* assembler/MacroAssemblerARM64.h:
(JSC::MacroAssemblerARM64::call):
(JSC::MacroAssemblerARM64::tailRecursiveCall):
(JSC::MacroAssemblerARM64::branchPtrWithPatch):
(JSC::MacroAssemblerARM64::patchableBranchPtrWithPatch):
(JSC::MacroAssemblerARM64::storePtrWithPatch):
* assembler/MacroAssemblerARMv7.h:
(JSC::MacroAssemblerARMv7::branchPtrWithPatch):
(JSC::MacroAssemblerARMv7::patchableBranchPtr):
(JSC::MacroAssemblerARMv7::patchableBranchPtrWithPatch):
(JSC::MacroAssemblerARMv7::storePtrWithPatch):
* assembler/MacroAssemblerMIPS.h:
(JSC::MacroAssemblerMIPS::branchPtrWithPatch):
(JSC::MacroAssemblerMIPS::storePtrWithPatch):
* assembler/MacroAssemblerX86.h:
(JSC::MacroAssemblerX86::branchPtrWithPatch):
* assembler/MacroAssemblerX86_64.h:
(JSC::MacroAssemblerX86_64::callWithSlowPathReturnType):
(JSC::MacroAssemblerX86_64::call):
(JSC::MacroAssemblerX86_64::tailRecursiveCall):
(JSC::MacroAssemblerX86_64::makeTailRecursiveCall):
(JSC::MacroAssemblerX86_64::branchPtrWithPatch):
* bytecode/AccessCase.cpp:
(JSC::AccessCase::generateImpl):
* dfg/DFGSpeculativeJIT.cpp:
(JSC::DFG::SpeculativeJIT::emitAllocateRawObject):
(JSC::DFG::SpeculativeJIT::compileToLowerCase):
(JSC::DFG::SpeculativeJIT::compileMakeRope):
(JSC::DFG::SpeculativeJIT::compileGetTypedArrayByteOffset):
(JSC::DFG::SpeculativeJIT::compileNewFunctionCommon):
(JSC::DFG::SpeculativeJIT::compileCreateDirectArguments):
(JSC::DFG::SpeculativeJIT::compileNewArrayWithSpread):
(JSC::DFG::SpeculativeJIT::compileArraySlice):
(JSC::DFG::SpeculativeJIT::compileAllocatePropertyStorage):
(JSC::DFG::SpeculativeJIT::compileReallocatePropertyStorage):
(JSC::DFG::SpeculativeJIT::compileNewTypedArrayWithSize):
* dfg/DFGSpeculativeJIT.h:
(JSC::DFG::SpeculativeJIT::TrustedImmPtr::TrustedImmPtr):
* dfg/DFGSpeculativeJIT32_64.cpp:
(JSC::DFG::SpeculativeJIT::compile):
(JSC::DFG::SpeculativeJIT::compileAllocateNewArrayWithSize):
* dfg/DFGSpeculativeJIT64.cpp:
(JSC::DFG::SpeculativeJIT::emitCall):
(JSC::DFG::SpeculativeJIT::compile):
(JSC::DFG::SpeculativeJIT::compileAllocateNewArrayWithSize):
* dfg/DFGThunks.cpp:
(JSC::DFG::osrExitGenerationThunkGenerator):
* ftl/FTLLowerDFGToB3.cpp:
(JSC::FTL::DFG::LowerDFGToB3::compileCallOrConstruct):
(JSC::FTL::DFG::LowerDFGToB3::compileTailCall):
(JSC::FTL::DFG::LowerDFGToB3::compileCallOrConstructVarargs):
* ftl/FTLThunks.cpp:
(JSC::FTL::genericGenerationThunkGenerator):
* jit/AssemblyHelpers.cpp:
(JSC::AssemblyHelpers::debugCall):
(JSC::AssemblyHelpers::sanitizeStackInline):
* jit/IntrinsicEmitter.cpp:
(JSC::IntrinsicGetterAccessCase::emitIntrinsicGetter):
* jit/JITCall.cpp:
(JSC::JIT::compileOpCall):
* jit/JITCall32_64.cpp:
(JSC::JIT::compileOpCall):
* jit/ScratchRegisterAllocator.cpp:
(JSC::ScratchRegisterAllocator::restoreUsedRegistersFromScratchBufferForCall):
* wasm/js/WasmToJS.cpp:
(JSC::Wasm::wasmToJS):
* yarr/YarrJIT.cpp:
(JSC::Yarr::YarrGenerator::initParenContextFreeList):
(JSC::Yarr::YarrGenerator::storeToFrameWithPatch):
(JSC::Yarr::YarrGenerator::generate):
  • Loading branch information
kmiller68 authored and carlosgcampos committed Mar 5, 2018
1 parent f8526d3 commit 8847315
Show file tree
Hide file tree
Showing 24 changed files with 154 additions and 79 deletions.
86 changes: 86 additions & 0 deletions Source/JavaScriptCore/ChangeLog
@@ -1,3 +1,89 @@
2018-02-27 Keith Miller <keith_miller@apple.com>

Replace TrustedImmPtr(0) with TrustedImmPtr(nullptr)
https://bugs.webkit.org/show_bug.cgi?id=183195

Reviewed by Mark Lam.

* assembler/AbstractMacroAssembler.h:
(JSC::AbstractMacroAssembler::TrustedImmPtr::TrustedImmPtr):
* assembler/MacroAssembler.h:
(JSC::MacroAssembler::patchableBranchPtr):
(JSC::MacroAssembler::patchableBranchPtrWithPatch):
* assembler/MacroAssemblerARM.h:
(JSC::MacroAssemblerARM::branchPtrWithPatch):
(JSC::MacroAssemblerARM::storePtrWithPatch):
* assembler/MacroAssemblerARM64.h:
(JSC::MacroAssemblerARM64::call):
(JSC::MacroAssemblerARM64::tailRecursiveCall):
(JSC::MacroAssemblerARM64::branchPtrWithPatch):
(JSC::MacroAssemblerARM64::patchableBranchPtrWithPatch):
(JSC::MacroAssemblerARM64::storePtrWithPatch):
* assembler/MacroAssemblerARMv7.h:
(JSC::MacroAssemblerARMv7::branchPtrWithPatch):
(JSC::MacroAssemblerARMv7::patchableBranchPtr):
(JSC::MacroAssemblerARMv7::patchableBranchPtrWithPatch):
(JSC::MacroAssemblerARMv7::storePtrWithPatch):
* assembler/MacroAssemblerMIPS.h:
(JSC::MacroAssemblerMIPS::branchPtrWithPatch):
(JSC::MacroAssemblerMIPS::storePtrWithPatch):
* assembler/MacroAssemblerX86.h:
(JSC::MacroAssemblerX86::branchPtrWithPatch):
* assembler/MacroAssemblerX86_64.h:
(JSC::MacroAssemblerX86_64::callWithSlowPathReturnType):
(JSC::MacroAssemblerX86_64::call):
(JSC::MacroAssemblerX86_64::tailRecursiveCall):
(JSC::MacroAssemblerX86_64::makeTailRecursiveCall):
(JSC::MacroAssemblerX86_64::branchPtrWithPatch):
* bytecode/AccessCase.cpp:
(JSC::AccessCase::generateImpl):
* dfg/DFGSpeculativeJIT.cpp:
(JSC::DFG::SpeculativeJIT::emitAllocateRawObject):
(JSC::DFG::SpeculativeJIT::compileToLowerCase):
(JSC::DFG::SpeculativeJIT::compileMakeRope):
(JSC::DFG::SpeculativeJIT::compileGetTypedArrayByteOffset):
(JSC::DFG::SpeculativeJIT::compileNewFunctionCommon):
(JSC::DFG::SpeculativeJIT::compileCreateDirectArguments):
(JSC::DFG::SpeculativeJIT::compileNewArrayWithSpread):
(JSC::DFG::SpeculativeJIT::compileArraySlice):
(JSC::DFG::SpeculativeJIT::compileAllocatePropertyStorage):
(JSC::DFG::SpeculativeJIT::compileReallocatePropertyStorage):
(JSC::DFG::SpeculativeJIT::compileNewTypedArrayWithSize):
* dfg/DFGSpeculativeJIT.h:
(JSC::DFG::SpeculativeJIT::TrustedImmPtr::TrustedImmPtr):
* dfg/DFGSpeculativeJIT32_64.cpp:
(JSC::DFG::SpeculativeJIT::compile):
(JSC::DFG::SpeculativeJIT::compileAllocateNewArrayWithSize):
* dfg/DFGSpeculativeJIT64.cpp:
(JSC::DFG::SpeculativeJIT::emitCall):
(JSC::DFG::SpeculativeJIT::compile):
(JSC::DFG::SpeculativeJIT::compileAllocateNewArrayWithSize):
* dfg/DFGThunks.cpp:
(JSC::DFG::osrExitGenerationThunkGenerator):
* ftl/FTLLowerDFGToB3.cpp:
(JSC::FTL::DFG::LowerDFGToB3::compileCallOrConstruct):
(JSC::FTL::DFG::LowerDFGToB3::compileTailCall):
(JSC::FTL::DFG::LowerDFGToB3::compileCallOrConstructVarargs):
* ftl/FTLThunks.cpp:
(JSC::FTL::genericGenerationThunkGenerator):
* jit/AssemblyHelpers.cpp:
(JSC::AssemblyHelpers::debugCall):
(JSC::AssemblyHelpers::sanitizeStackInline):
* jit/IntrinsicEmitter.cpp:
(JSC::IntrinsicGetterAccessCase::emitIntrinsicGetter):
* jit/JITCall.cpp:
(JSC::JIT::compileOpCall):
* jit/JITCall32_64.cpp:
(JSC::JIT::compileOpCall):
* jit/ScratchRegisterAllocator.cpp:
(JSC::ScratchRegisterAllocator::restoreUsedRegistersFromScratchBufferForCall):
* wasm/js/WasmToJS.cpp:
(JSC::Wasm::wasmToJS):
* yarr/YarrJIT.cpp:
(JSC::Yarr::YarrGenerator::initParenContextFreeList):
(JSC::Yarr::YarrGenerator::storeToFrameWithPatch):
(JSC::Yarr::YarrGenerator::generate):

2018-02-26 Mark Lam <mark.lam@apple.com>

Modernize FINALIZE_CODE and peer macros to use __VA_ARGS__ arguments.
Expand Down
9 changes: 3 additions & 6 deletions Source/JavaScriptCore/assembler/AbstractMacroAssembler.h
Expand Up @@ -252,13 +252,10 @@ class AbstractMacroAssembler : public AbstractMacroAssemblerBase {
: m_value(value)
{
}

// This is only here so that TrustedImmPtr(0) does not confuse the C++
// overload handling rules.
explicit TrustedImmPtr(int value)
: m_value(0)

explicit TrustedImmPtr(std::nullptr_t)
: m_value(nullptr)
{
ASSERT_UNUSED(value, !value);
}

explicit TrustedImmPtr(size_t value)
Expand Down
4 changes: 2 additions & 2 deletions Source/JavaScriptCore/assembler/MacroAssembler.h
Expand Up @@ -417,12 +417,12 @@ class MacroAssembler : public MacroAssemblerBase {
}

#if !CPU(ARM_THUMB2) && !CPU(ARM64)
PatchableJump patchableBranchPtr(RelationalCondition cond, Address left, TrustedImmPtr right = TrustedImmPtr(0))
PatchableJump patchableBranchPtr(RelationalCondition cond, Address left, TrustedImmPtr right = TrustedImmPtr(nullptr))
{
return PatchableJump(branchPtr(cond, left, right));
}

PatchableJump patchableBranchPtrWithPatch(RelationalCondition cond, Address left, DataLabelPtr& dataLabel, TrustedImmPtr initialRightValue = TrustedImmPtr(0))
PatchableJump patchableBranchPtrWithPatch(RelationalCondition cond, Address left, DataLabelPtr& dataLabel, TrustedImmPtr initialRightValue = TrustedImmPtr(nullptr))
{
return PatchableJump(branchPtrWithPatch(cond, left, dataLabel, initialRightValue));
}
Expand Down
6 changes: 3 additions & 3 deletions Source/JavaScriptCore/assembler/MacroAssemblerARM.h
Expand Up @@ -1149,15 +1149,15 @@ class MacroAssemblerARM : public AbstractMacroAssembler<Assembler> {
return dataLabel;
}

Jump branchPtrWithPatch(RelationalCondition cond, RegisterID left, DataLabelPtr& dataLabel, TrustedImmPtr initialRightValue = TrustedImmPtr(0))
Jump branchPtrWithPatch(RelationalCondition cond, RegisterID left, DataLabelPtr& dataLabel, TrustedImmPtr initialRightValue = TrustedImmPtr(nullptr))
{
ensureSpace(3 * sizeof(ARMWord), 2 * sizeof(ARMWord));
dataLabel = moveWithPatch(initialRightValue, ARMRegisters::S1);
Jump jump = branch32(cond, left, ARMRegisters::S1, true);
return jump;
}

Jump branchPtrWithPatch(RelationalCondition cond, Address left, DataLabelPtr& dataLabel, TrustedImmPtr initialRightValue = TrustedImmPtr(0))
Jump branchPtrWithPatch(RelationalCondition cond, Address left, DataLabelPtr& dataLabel, TrustedImmPtr initialRightValue = TrustedImmPtr(nullptr))
{
load32(left, ARMRegisters::S1);
ensureSpace(3 * sizeof(ARMWord), 2 * sizeof(ARMWord));
Expand All @@ -1184,7 +1184,7 @@ class MacroAssemblerARM : public AbstractMacroAssembler<Assembler> {

DataLabelPtr storePtrWithPatch(ImplicitAddress address)
{
return storePtrWithPatch(TrustedImmPtr(0), address);
return storePtrWithPatch(TrustedImmPtr(nullptr), address);
}

// Floating point operators
Expand Down
12 changes: 6 additions & 6 deletions Source/JavaScriptCore/assembler/MacroAssemblerARM64.h
Expand Up @@ -3080,7 +3080,7 @@ class MacroAssemblerARM64 : public AbstractMacroAssembler<Assembler> {
ALWAYS_INLINE Call call()
{
AssemblerLabel pointerLabel = m_assembler.label();
moveWithFixedWidth(TrustedImmPtr(0), getCachedDataTempRegisterIDAndInvalidate());
moveWithFixedWidth(TrustedImmPtr(nullptr), getCachedDataTempRegisterIDAndInvalidate());
invalidateAllTempRegisters();
m_assembler.blr(dataTempRegister);
AssemblerLabel callLabel = m_assembler.label();
Expand Down Expand Up @@ -3166,7 +3166,7 @@ class MacroAssemblerARM64 : public AbstractMacroAssembler<Assembler> {
{
// Like a normal call, but don't link.
AssemblerLabel pointerLabel = m_assembler.label();
moveWithFixedWidth(TrustedImmPtr(0), getCachedDataTempRegisterIDAndInvalidate());
moveWithFixedWidth(TrustedImmPtr(nullptr), getCachedDataTempRegisterIDAndInvalidate());
m_assembler.br(dataTempRegister);
AssemblerLabel callLabel = m_assembler.label();
ASSERT_UNUSED(pointerLabel, Assembler::getDifferenceBetweenLabels(callLabel, pointerLabel) == REPATCH_OFFSET_CALL_TO_POINTER);
Expand Down Expand Up @@ -3300,14 +3300,14 @@ class MacroAssemblerARM64 : public AbstractMacroAssembler<Assembler> {
return label;
}

ALWAYS_INLINE Jump branchPtrWithPatch(RelationalCondition cond, RegisterID left, DataLabelPtr& dataLabel, TrustedImmPtr initialRightValue = TrustedImmPtr(0))
ALWAYS_INLINE Jump branchPtrWithPatch(RelationalCondition cond, RegisterID left, DataLabelPtr& dataLabel, TrustedImmPtr initialRightValue = TrustedImmPtr(nullptr))
{
dataLabel = DataLabelPtr(this);
moveWithPatch(initialRightValue, getCachedDataTempRegisterIDAndInvalidate());
return branch64(cond, left, dataTempRegister);
}

ALWAYS_INLINE Jump branchPtrWithPatch(RelationalCondition cond, Address left, DataLabelPtr& dataLabel, TrustedImmPtr initialRightValue = TrustedImmPtr(0))
ALWAYS_INLINE Jump branchPtrWithPatch(RelationalCondition cond, Address left, DataLabelPtr& dataLabel, TrustedImmPtr initialRightValue = TrustedImmPtr(nullptr))
{
dataLabel = DataLabelPtr(this);
moveWithPatch(initialRightValue, getCachedDataTempRegisterIDAndInvalidate());
Expand Down Expand Up @@ -3369,7 +3369,7 @@ class MacroAssemblerARM64 : public AbstractMacroAssembler<Assembler> {
return PatchableJump(result);
}

PatchableJump patchableBranchPtrWithPatch(RelationalCondition cond, Address left, DataLabelPtr& dataLabel, TrustedImmPtr initialRightValue = TrustedImmPtr(0))
PatchableJump patchableBranchPtrWithPatch(RelationalCondition cond, Address left, DataLabelPtr& dataLabel, TrustedImmPtr initialRightValue = TrustedImmPtr(nullptr))
{
m_makeJumpPatchable = true;
Jump result = branchPtrWithPatch(cond, left, dataLabel, initialRightValue);
Expand Down Expand Up @@ -3403,7 +3403,7 @@ class MacroAssemblerARM64 : public AbstractMacroAssembler<Assembler> {

ALWAYS_INLINE DataLabelPtr storePtrWithPatch(ImplicitAddress address)
{
return storePtrWithPatch(TrustedImmPtr(0), address);
return storePtrWithPatch(TrustedImmPtr(nullptr), address);
}

static void reemitInitialMoveWithPatch(void* address, void* value)
Expand Down
10 changes: 5 additions & 5 deletions Source/JavaScriptCore/assembler/MacroAssemblerARMv7.h
Expand Up @@ -1875,13 +1875,13 @@ class MacroAssemblerARMv7 : public AbstractMacroAssembler<Assembler> {
return DataLabelPtr(this);
}

ALWAYS_INLINE Jump branchPtrWithPatch(RelationalCondition cond, RegisterID left, DataLabelPtr& dataLabel, TrustedImmPtr initialRightValue = TrustedImmPtr(0))
ALWAYS_INLINE Jump branchPtrWithPatch(RelationalCondition cond, RegisterID left, DataLabelPtr& dataLabel, TrustedImmPtr initialRightValue = TrustedImmPtr(nullptr))
{
dataLabel = moveWithPatch(initialRightValue, dataTempRegister);
return branch32(cond, left, dataTempRegister);
}

ALWAYS_INLINE Jump branchPtrWithPatch(RelationalCondition cond, Address left, DataLabelPtr& dataLabel, TrustedImmPtr initialRightValue = TrustedImmPtr(0))
ALWAYS_INLINE Jump branchPtrWithPatch(RelationalCondition cond, Address left, DataLabelPtr& dataLabel, TrustedImmPtr initialRightValue = TrustedImmPtr(nullptr))
{
load32(left, addressTempRegister);
dataLabel = moveWithPatch(initialRightValue, dataTempRegister);
Expand All @@ -1895,7 +1895,7 @@ class MacroAssemblerARMv7 : public AbstractMacroAssembler<Assembler> {
return branch32(cond, addressTempRegister, dataTempRegister);
}

PatchableJump patchableBranchPtr(RelationalCondition cond, Address left, TrustedImmPtr right = TrustedImmPtr(0))
PatchableJump patchableBranchPtr(RelationalCondition cond, Address left, TrustedImmPtr right = TrustedImmPtr(nullptr))
{
m_makeJumpPatchable = true;
Jump result = branch32(cond, left, TrustedImm32(right));
Expand Down Expand Up @@ -1927,7 +1927,7 @@ class MacroAssemblerARMv7 : public AbstractMacroAssembler<Assembler> {
return PatchableJump(result);
}

PatchableJump patchableBranchPtrWithPatch(RelationalCondition cond, Address left, DataLabelPtr& dataLabel, TrustedImmPtr initialRightValue = TrustedImmPtr(0))
PatchableJump patchableBranchPtrWithPatch(RelationalCondition cond, Address left, DataLabelPtr& dataLabel, TrustedImmPtr initialRightValue = TrustedImmPtr(nullptr))
{
m_makeJumpPatchable = true;
Jump result = branchPtrWithPatch(cond, left, dataLabel, initialRightValue);
Expand Down Expand Up @@ -1958,7 +1958,7 @@ class MacroAssemblerARMv7 : public AbstractMacroAssembler<Assembler> {
store32(dataTempRegister, address);
return label;
}
ALWAYS_INLINE DataLabelPtr storePtrWithPatch(ImplicitAddress address) { return storePtrWithPatch(TrustedImmPtr(0), address); }
ALWAYS_INLINE DataLabelPtr storePtrWithPatch(ImplicitAddress address) { return storePtrWithPatch(TrustedImmPtr(nullptr), address); }


ALWAYS_INLINE Call tailRecursiveCall()
Expand Down
6 changes: 3 additions & 3 deletions Source/JavaScriptCore/assembler/MacroAssemblerMIPS.h
Expand Up @@ -2377,7 +2377,7 @@ class MacroAssemblerMIPS : public AbstractMacroAssembler<Assembler> {
return label;
}

Jump branchPtrWithPatch(RelationalCondition cond, RegisterID left, DataLabelPtr& dataLabel, TrustedImmPtr initialRightValue = TrustedImmPtr(0))
Jump branchPtrWithPatch(RelationalCondition cond, RegisterID left, DataLabelPtr& dataLabel, TrustedImmPtr initialRightValue = TrustedImmPtr(nullptr))
{
m_fixedWidth = true;
dataLabel = moveWithPatch(initialRightValue, immTempRegister);
Expand All @@ -2386,7 +2386,7 @@ class MacroAssemblerMIPS : public AbstractMacroAssembler<Assembler> {
return temp;
}

Jump branchPtrWithPatch(RelationalCondition cond, Address left, DataLabelPtr& dataLabel, TrustedImmPtr initialRightValue = TrustedImmPtr(0))
Jump branchPtrWithPatch(RelationalCondition cond, Address left, DataLabelPtr& dataLabel, TrustedImmPtr initialRightValue = TrustedImmPtr(nullptr))
{
m_fixedWidth = true;
load32(left, dataTempRegister);
Expand Down Expand Up @@ -2417,7 +2417,7 @@ class MacroAssemblerMIPS : public AbstractMacroAssembler<Assembler> {

DataLabelPtr storePtrWithPatch(ImplicitAddress address)
{
return storePtrWithPatch(TrustedImmPtr(0), address);
return storePtrWithPatch(TrustedImmPtr(nullptr), address);
}

Call tailRecursiveCall()
Expand Down
4 changes: 2 additions & 2 deletions Source/JavaScriptCore/assembler/MacroAssemblerX86.h
Expand Up @@ -259,15 +259,15 @@ class MacroAssemblerX86 : public MacroAssemblerX86Common {
return Jump(m_assembler.jCC(x86Condition(cond)));
}

Jump branchPtrWithPatch(RelationalCondition cond, RegisterID left, DataLabelPtr& dataLabel, TrustedImmPtr initialRightValue = TrustedImmPtr(0))
Jump branchPtrWithPatch(RelationalCondition cond, RegisterID left, DataLabelPtr& dataLabel, TrustedImmPtr initialRightValue = TrustedImmPtr(nullptr))
{
padBeforePatch();
m_assembler.cmpl_ir_force32(initialRightValue.asIntptr(), left);
dataLabel = DataLabelPtr(this);
return Jump(m_assembler.jCC(x86Condition(cond)));
}

Jump branchPtrWithPatch(RelationalCondition cond, Address left, DataLabelPtr& dataLabel, TrustedImmPtr initialRightValue = TrustedImmPtr(0))
Jump branchPtrWithPatch(RelationalCondition cond, Address left, DataLabelPtr& dataLabel, TrustedImmPtr initialRightValue = TrustedImmPtr(nullptr))
{
padBeforePatch();
m_assembler.cmpl_im_force32(initialRightValue.asIntptr(), left.offset, left.base);
Expand Down
12 changes: 6 additions & 6 deletions Source/JavaScriptCore/assembler/MacroAssemblerX86_64.h
Expand Up @@ -176,7 +176,7 @@ class MacroAssemblerX86_64 : public MacroAssemblerX86Common {
move(X86Registers::esp, X86Registers::ecx);
add64(TrustedImm32(4 * sizeof(int64_t)), X86Registers::ecx);

DataLabelPtr label = moveWithPatch(TrustedImmPtr(0), scratchRegister());
DataLabelPtr label = moveWithPatch(TrustedImmPtr(nullptr), scratchRegister());
Call result = Call(m_assembler.call(scratchRegister()), Call::Linkable);

add64(TrustedImm32(8 * sizeof(int64_t)), X86Registers::esp);
Expand Down Expand Up @@ -214,7 +214,7 @@ class MacroAssemblerX86_64 : public MacroAssemblerX86Common {
// In addition, we need to allocate 16 bytes for two more parameters, since the call can have up to 6 parameters.
sub64(TrustedImm32(8 * sizeof(int64_t)), X86Registers::esp);
#endif
DataLabelPtr label = moveWithPatch(TrustedImmPtr(0), scratchRegister());
DataLabelPtr label = moveWithPatch(TrustedImmPtr(nullptr), scratchRegister());
Call result = Call(m_assembler.call(scratchRegister()), Call::Linkable);
#if OS(WINDOWS)
add64(TrustedImm32(8 * sizeof(int64_t)), X86Registers::esp);
Expand All @@ -232,7 +232,7 @@ class MacroAssemblerX86_64 : public MacroAssemblerX86Common {

Call tailRecursiveCall()
{
DataLabelPtr label = moveWithPatch(TrustedImmPtr(0), scratchRegister());
DataLabelPtr label = moveWithPatch(TrustedImmPtr(nullptr), scratchRegister());
Jump newJump = Jump(m_assembler.jmp_r(scratchRegister()));
ASSERT_UNUSED(label, differenceBetween(label, newJump) == REPATCH_OFFSET_CALL_R11);
return Call::fromTailJump(newJump);
Expand All @@ -241,7 +241,7 @@ class MacroAssemblerX86_64 : public MacroAssemblerX86Common {
Call makeTailRecursiveCall(Jump oldJump)
{
oldJump.link(this);
DataLabelPtr label = moveWithPatch(TrustedImmPtr(0), scratchRegister());
DataLabelPtr label = moveWithPatch(TrustedImmPtr(nullptr), scratchRegister());
Jump newJump = Jump(m_assembler.jmp_r(scratchRegister()));
ASSERT_UNUSED(label, differenceBetween(label, newJump) == REPATCH_OFFSET_CALL_R11);
return Call::fromTailJump(newJump);
Expand Down Expand Up @@ -1414,13 +1414,13 @@ class MacroAssemblerX86_64 : public MacroAssemblerX86Common {
return DataLabelPtr(this);
}

Jump branchPtrWithPatch(RelationalCondition cond, RegisterID left, DataLabelPtr& dataLabel, TrustedImmPtr initialRightValue = TrustedImmPtr(0))
Jump branchPtrWithPatch(RelationalCondition cond, RegisterID left, DataLabelPtr& dataLabel, TrustedImmPtr initialRightValue = TrustedImmPtr(nullptr))
{
dataLabel = moveWithPatch(initialRightValue, scratchRegister());
return branch64(cond, left, scratchRegister());
}

Jump branchPtrWithPatch(RelationalCondition cond, Address left, DataLabelPtr& dataLabel, TrustedImmPtr initialRightValue = TrustedImmPtr(0))
Jump branchPtrWithPatch(RelationalCondition cond, Address left, DataLabelPtr& dataLabel, TrustedImmPtr initialRightValue = TrustedImmPtr(nullptr))
{
dataLabel = moveWithPatch(initialRightValue, scratchRegister());
return branch64(cond, left, scratchRegister());
Expand Down
4 changes: 2 additions & 2 deletions Source/JavaScriptCore/bytecode/AccessCase.cpp
Expand Up @@ -782,7 +782,7 @@ void AccessCase::generateImpl(AccessGenerationState& state)

CCallHelpers::Jump slowCase = jit.branchPtrWithPatch(
CCallHelpers::NotEqual, loadedValueGPR, addressOfLinkFunctionCheck,
CCallHelpers::TrustedImmPtr(0));
CCallHelpers::TrustedImmPtr(nullptr));

fastPathCall = jit.nearCall();
if (m_type == Getter)
Expand Down Expand Up @@ -987,7 +987,7 @@ void AccessCase::generateImpl(AccessGenerationState& state)
}

for (size_t offset = oldSize; offset < newSize; offset += sizeof(void*))
jit.storePtr(CCallHelpers::TrustedImmPtr(0), CCallHelpers::Address(scratchGPR, -static_cast<ptrdiff_t>(offset + sizeof(JSValue) + sizeof(void*))));
jit.storePtr(CCallHelpers::TrustedImmPtr(nullptr), CCallHelpers::Address(scratchGPR, -static_cast<ptrdiff_t>(offset + sizeof(JSValue) + sizeof(void*))));
} else {
// Handle the case where we are allocating out-of-line using an operation.
RegisterSet extraRegistersToPreserve;
Expand Down

0 comments on commit 8847315

Please sign in to comment.