Ignore:
Timestamp:
Jan 8, 2018, 1:05:17 PM (7 years ago)
Author:
[email protected]
Message:

Apply poisoning to more pointers in JSC.
https://bugs.webkit.org/show_bug.cgi?id=181096
<rdar://problem/36182970>

Reviewed by JF Bastien.

Source/JavaScriptCore:

  • assembler/MacroAssembler.h:

(JSC::MacroAssembler::xorPtr):

  • assembler/MacroAssemblerARM64.h:

(JSC::MacroAssemblerARM64::xor64):

  • assembler/MacroAssemblerX86_64.h:

(JSC::MacroAssemblerX86_64::xor64):

  • Add xorPtr implementation.
  • bytecode/CodeBlock.cpp:

(JSC::CodeBlock::inferredName const):
(JSC::CodeBlock::CodeBlock):
(JSC::CodeBlock::finishCreation):
(JSC::CodeBlock::~CodeBlock):
(JSC::CodeBlock::setConstantRegisters):
(JSC::CodeBlock::visitWeakly):
(JSC::CodeBlock::visitChildren):
(JSC::CodeBlock::propagateTransitions):
(JSC::CodeBlock::WeakReferenceHarvester::visitWeakReferences):
(JSC::CodeBlock::finalizeLLIntInlineCaches):
(JSC::CodeBlock::finalizeBaselineJITInlineCaches):
(JSC::CodeBlock::UnconditionalFinalizer::finalizeUnconditionally):
(JSC::CodeBlock::jettison):
(JSC::CodeBlock::predictedMachineCodeSize):
(JSC::CodeBlock::findPC):

  • bytecode/CodeBlock.h:

(JSC::CodeBlock::UnconditionalFinalizer::UnconditionalFinalizer):
(JSC::CodeBlock::WeakReferenceHarvester::WeakReferenceHarvester):
(JSC::CodeBlock::stubInfoBegin):
(JSC::CodeBlock::stubInfoEnd):
(JSC::CodeBlock::callLinkInfosBegin):
(JSC::CodeBlock::callLinkInfosEnd):
(JSC::CodeBlock::instructions):
(JSC::CodeBlock::instructions const):
(JSC::CodeBlock::vm const):

  • dfg/DFGOSRExitCompilerCommon.h:

(JSC::DFG::adjustFrameAndStackInOSRExitCompilerThunk):

  • jit/JIT.h:
  • llint/LLIntOfflineAsmConfig.h:
  • llint/LowLevelInterpreter.asm:
  • llint/LowLevelInterpreter64.asm:
  • parser/UnlinkedSourceCode.h:
  • runtime/JSCPoison.h:
  • runtime/JSGlobalObject.cpp:

(JSC::JSGlobalObject::init):

  • runtime/JSGlobalObject.h:
  • runtime/JSScriptFetchParameters.h:
  • runtime/JSScriptFetcher.h:
  • runtime/StructureTransitionTable.h:
  • wasm/js/JSWebAssemblyCodeBlock.cpp:

(JSC::JSWebAssemblyCodeBlock::JSWebAssemblyCodeBlock):
(JSC::JSWebAssemblyCodeBlock::visitChildren):
(JSC::JSWebAssemblyCodeBlock::UnconditionalFinalizer::finalizeUnconditionally):

  • wasm/js/JSWebAssemblyCodeBlock.h:

Source/WTF:

Added support for PoisonedBag and PoisonedRefCountedArray.

  • wtf/Bag.h:

(WTF::Private::BagNode::BagNode):
(WTF::Bag::Bag):
(WTF::Bag::operator=):
(WTF::Bag::clear):
(WTF::Bag::add):
(WTF::Bag::begin):
(WTF::Bag::unwrappedHead):
(WTF::Bag::Node::Node): Deleted.

  • wtf/BagToHashMap.h:

(WTF::toHashMap):

  • wtf/Poisoned.h:

(WTF::constExprPoisonRandom):
(WTF::makeConstExprPoison):

  • wtf/RefCountedArray.h:

(WTF::RefCountedArray::RefCountedArray):
(WTF::RefCountedArray::clone const):
(WTF::RefCountedArray::operator=):
(WTF::RefCountedArray::~RefCountedArray):
(WTF::RefCountedArray::refCount const):
(WTF::RefCountedArray::size const):
(WTF::RefCountedArray::data):
(WTF::RefCountedArray::begin):
(WTF::RefCountedArray::end):
(WTF::RefCountedArray::data const):
(WTF::RefCountedArray::begin const):
(WTF::RefCountedArray::operator== const):
(WTF::RefCountedArray::Header::fromPayload):

  • wtf/WTFAssertions.cpp:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/JavaScriptCore/llint/LowLevelInterpreter64.asm

    r225913 r226530  
    1 # Copyright (C) 2011-2017 Apple Inc. All rights reserved.
     1# Copyright (C) 2011-2018 Apple Inc. All rights reserved.
    22#
    33# Redistribution and use in source and binary forms, with or without
     
    4646    loadp CodeBlock[cfr], PB
    4747    loadp CodeBlock::m_instructions[PB], PB
     48    unpoison(CodeBlockPoison, PB)
    4849    loadisFromInstruction(1, t1)
    4950    storeq r0, [cfr, t1, 8]
     
    483484    loadp CodeBlock[cfr], scratch
    484485    loadp CodeBlock::m_vm[scratch], scratch
     486    unpoison(CodeBlockPoison, scratch)
    485487    loadp VM::heap + Heap::m_structureIDTable + StructureIDTable::m_table[scratch], scratch
    486488    loadp [scratch, structureIDThenStructure, 8], structureIDThenStructure
     
    496498    loadp CodeBlock[cfr], cell
    497499    loadp CodeBlock::m_vm[cell], cell
     500    unpoison(CodeBlockPoison, cell)
    498501    loadp VM::heap + Heap::m_structureIDTable + StructureIDTable::m_table[cell], cell
    499502    loadp [cell, structure, 8], structure
     
    560563    loadp CodeBlock[cfr], t1
    561564    loadp CodeBlock::m_instructions[t1], PB
     565    unpoison(CodeBlockPoison, PB)
    562566    move 0, PC
    563567    jmp doneLabel
     
    19501954    storei t2, ArgumentCount + PayloadOffset[t3]
    19511955    move t3, sp
    1952     if X86_64_WIN
    1953         prepareCall(LLIntCallLinkInfo::machineCodeTarget[t1], t2, t3, t4)
    1954         callTargetFunction(LLIntCallLinkInfo::machineCodeTarget[t1])
    1955     else
     1956    if POISON
    19561957        loadp _g_jitCodePoison, t2
    19571958        xorp LLIntCallLinkInfo::machineCodeTarget[t1], t2
    19581959        prepareCall(t2, t1, t3, t4)
    19591960        callTargetFunction(t2)
     1961    else
     1962        prepareCall(LLIntCallLinkInfo::machineCodeTarget[t1], t2, t3, t4)
     1963        callTargetFunction(LLIntCallLinkInfo::machineCodeTarget[t1])
    19601964    end
    19611965
     
    20042008    loadp CodeBlock[cfr], PB
    20052009    loadp CodeBlock::m_instructions[PB], PB
     2010    unpoison(CodeBlockPoison, PB)
    20062011    loadp VM::targetInterpreterPCForThrow[t3], PC
    20072012    subp PB, PC
     
    24962501    loadp CodeBlock[cfr], t1
    24972502    loadp CodeBlock::m_vm[t1], t1
     2503    unpoison(CodeBlockPoison, t1)
    24982504    # t1 is holding the pointer to the typeProfilerLog.
    24992505    loadp VM::m_typeProfilerLog[t1], t1
Note: See TracChangeset for help on using the changeset viewer.