Changeset 242100 in webkit


Ignore:
Timestamp:
Feb 26, 2019, 12:49:50 PM (6 years ago)
Author:
mark.lam@apple.com
Message:

Unpoison MacroAssemblerCodePtr, ClassInfo pointers, and a few other things.
https://bugs.webkit.org/show_bug.cgi?id=195039

Reviewed by Saam Barati.

  1. Unpoison MacroAssemblerCodePtrs, ReturnAddressPtr.
  2. Replace PoisonedClassInfoPtr with ClassInfo*.
  3. Replace PoisonedMasmPtr with const void*.
  4. Remove all references to CodeBlockPoison, JITCodePoison, and GlobalDataPoison.
  • API/JSCallbackObject.h:
  • API/JSObjectRef.cpp:

(classInfoPrivate):

  • assembler/MacroAssemblerCodeRef.h:

(JSC::FunctionPtr::FunctionPtr):
(JSC::FunctionPtr::executableAddress const):
(JSC::FunctionPtr::retaggedExecutableAddress const):
(JSC::ReturnAddressPtr::ReturnAddressPtr):
(JSC::ReturnAddressPtr::value const):
(JSC::MacroAssemblerCodePtr::MacroAssemblerCodePtr):
(JSC::MacroAssemblerCodePtr::createFromExecutableAddress):
(JSC::MacroAssemblerCodePtr:: const):
(JSC::MacroAssemblerCodePtr::operator! const):
(JSC::MacroAssemblerCodePtr::operator== const):
(JSC::MacroAssemblerCodePtr::hash const):
(JSC::MacroAssemblerCodePtr::emptyValue):
(JSC::MacroAssemblerCodePtr::deletedValue):
(JSC::FunctionPtr<tag>::FunctionPtr):
(JSC::MacroAssemblerCodePtr::poisonedPtr const): Deleted.

  • b3/B3LowerMacros.cpp:
  • b3/testb3.cpp:

(JSC::B3::testInterpreter):

  • dfg/DFGOSRExitCompilerCommon.h:

(JSC::DFG::adjustFrameAndStackInOSRExitCompilerThunk):

  • dfg/DFGSpeculativeJIT.cpp:

(JSC::DFG::SpeculativeJIT::compileCheckSubClass):
(JSC::DFG::SpeculativeJIT::compileNewStringObject):
(JSC::DFG::SpeculativeJIT::emitSwitchIntJump):
(JSC::DFG::SpeculativeJIT::emitSwitchImm):
(JSC::DFG::SpeculativeJIT::emitSwitchCharStringJump):
(JSC::DFG::SpeculativeJIT::emitSwitchChar):

  • dfg/DFGSpeculativeJIT.h:
  • ftl/FTLLowerDFGToB3.cpp:

(JSC::FTL::DFG::LowerDFGToB3::compileNewStringObject):
(JSC::FTL::DFG::LowerDFGToB3::compileCheckSubClass):

  • jit/AssemblyHelpers.h:

(JSC::AssemblyHelpers::emitAllocateDestructibleObject):

  • jit/ThunkGenerators.cpp:

(JSC::virtualThunkFor):
(JSC::boundThisNoArgsFunctionCallGenerator):

  • runtime/JSCPoison.h:
  • runtime/JSDestructibleObject.h:

(JSC::JSDestructibleObject::classInfo const):

  • runtime/JSSegmentedVariableObject.h:

(JSC::JSSegmentedVariableObject::classInfo const):

  • runtime/Structure.h:
  • runtime/VM.h:
  • wasm/WasmB3IRGenerator.cpp:

(JSC::Wasm::B3IRGenerator::addCall):
(JSC::Wasm::B3IRGenerator::addCallIndirect):

  • wasm/WasmBinding.cpp:

(JSC::Wasm::wasmToWasm):

Location:
trunk/Source/JavaScriptCore
Files:
19 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/JavaScriptCore/API/JSCallbackObject.h

    r239557 r242100  
    11/*
    2  * Copyright (C) 2006-2018 Apple Inc. All rights reserved.
     2 * Copyright (C) 2006-2019 Apple Inc. All rights reserved.
    33 * Copyright (C) 2007 Eric Seidel <eric@webkit.org>
    44 *
     
    229229
    230230    WTF::PoisonedUniquePtr<JSCallbackObjectPoison, JSCallbackObjectData> m_callbackObjectData;
    231     PoisonedClassInfoPtr m_classInfo;
     231    const ClassInfo* m_classInfo { nullptr };
    232232};
    233233
  • trunk/Source/JavaScriptCore/API/JSObjectRef.cpp

    r237009 r242100  
    11/*
    2  * Copyright (C) 2006-2017 Apple Inc. All rights reserved.
     2 * Copyright (C) 2006-2019 Apple Inc. All rights reserved.
    33 * Copyright (C) 2008 Kelvin W Sherlock (ksherlock@gmail.com)
    44 *
     
    552552        return jsObject->classInfo(vm);
    553553
    554     return vm.currentlyDestructingCallbackObjectClassInfo.unpoisoned();
     554    return vm.currentlyDestructingCallbackObjectClassInfo;
    555555}
    556556
  • trunk/Source/JavaScriptCore/ChangeLog

    r242096 r242100  
     12019-02-26  Mark Lam  <mark.lam@apple.com>
     2
     3        Unpoison MacroAssemblerCodePtr, ClassInfo pointers, and a few other things.
     4        https://bugs.webkit.org/show_bug.cgi?id=195039
     5
     6        Reviewed by Saam Barati.
     7
     8        1. Unpoison MacroAssemblerCodePtrs, ReturnAddressPtr.
     9        2. Replace PoisonedClassInfoPtr with ClassInfo*.
     10        3. Replace PoisonedMasmPtr with const void*.
     11        4. Remove all references to CodeBlockPoison, JITCodePoison, and GlobalDataPoison.
     12
     13        * API/JSCallbackObject.h:
     14        * API/JSObjectRef.cpp:
     15        (classInfoPrivate):
     16        * assembler/MacroAssemblerCodeRef.h:
     17        (JSC::FunctionPtr::FunctionPtr):
     18        (JSC::FunctionPtr::executableAddress const):
     19        (JSC::FunctionPtr::retaggedExecutableAddress const):
     20        (JSC::ReturnAddressPtr::ReturnAddressPtr):
     21        (JSC::ReturnAddressPtr::value const):
     22        (JSC::MacroAssemblerCodePtr::MacroAssemblerCodePtr):
     23        (JSC::MacroAssemblerCodePtr::createFromExecutableAddress):
     24        (JSC::MacroAssemblerCodePtr:: const):
     25        (JSC::MacroAssemblerCodePtr::operator! const):
     26        (JSC::MacroAssemblerCodePtr::operator== const):
     27        (JSC::MacroAssemblerCodePtr::hash const):
     28        (JSC::MacroAssemblerCodePtr::emptyValue):
     29        (JSC::MacroAssemblerCodePtr::deletedValue):
     30        (JSC::FunctionPtr<tag>::FunctionPtr):
     31        (JSC::MacroAssemblerCodePtr::poisonedPtr const): Deleted.
     32        * b3/B3LowerMacros.cpp:
     33        * b3/testb3.cpp:
     34        (JSC::B3::testInterpreter):
     35        * dfg/DFGOSRExitCompilerCommon.h:
     36        (JSC::DFG::adjustFrameAndStackInOSRExitCompilerThunk):
     37        * dfg/DFGSpeculativeJIT.cpp:
     38        (JSC::DFG::SpeculativeJIT::compileCheckSubClass):
     39        (JSC::DFG::SpeculativeJIT::compileNewStringObject):
     40        (JSC::DFG::SpeculativeJIT::emitSwitchIntJump):
     41        (JSC::DFG::SpeculativeJIT::emitSwitchImm):
     42        (JSC::DFG::SpeculativeJIT::emitSwitchCharStringJump):
     43        (JSC::DFG::SpeculativeJIT::emitSwitchChar):
     44        * dfg/DFGSpeculativeJIT.h:
     45        * ftl/FTLLowerDFGToB3.cpp:
     46        (JSC::FTL::DFG::LowerDFGToB3::compileNewStringObject):
     47        (JSC::FTL::DFG::LowerDFGToB3::compileCheckSubClass):
     48        * jit/AssemblyHelpers.h:
     49        (JSC::AssemblyHelpers::emitAllocateDestructibleObject):
     50        * jit/ThunkGenerators.cpp:
     51        (JSC::virtualThunkFor):
     52        (JSC::boundThisNoArgsFunctionCallGenerator):
     53        * runtime/JSCPoison.h:
     54        * runtime/JSDestructibleObject.h:
     55        (JSC::JSDestructibleObject::classInfo const):
     56        * runtime/JSSegmentedVariableObject.h:
     57        (JSC::JSSegmentedVariableObject::classInfo const):
     58        * runtime/Structure.h:
     59        * runtime/VM.h:
     60        * wasm/WasmB3IRGenerator.cpp:
     61        (JSC::Wasm::B3IRGenerator::addCall):
     62        (JSC::Wasm::B3IRGenerator::addCallIndirect):
     63        * wasm/WasmBinding.cpp:
     64        (JSC::Wasm::wasmToWasm):
     65
    1662019-02-26  Mark Lam  <mark.lam@apple.com>
    267
  • trunk/Source/JavaScriptCore/assembler/MacroAssemblerCodeRef.h

    r237547 r242100  
    11/*
    2  * Copyright (C) 2009-2018 Apple Inc. All rights reserved.
     2 * Copyright (C) 2009-2019 Apple Inc. All rights reserved.
    33 *
    44 * Redistribution and use in source and binary forms, with or without
     
    2727
    2828#include "ExecutableAllocator.h"
    29 #include "JSCPoison.h"
    3029#include "JSCPtrTag.h"
    3130#include <wtf/DataLog.h>
     
    7574    {
    7675        assertIsNullOrCFunctionPtr(value);
    77         PoisonedMasmPtr::assertIsNotPoisoned(m_value);
    7876        ASSERT_NULL_OR_VALID_CODE_POINTER(m_value);
    7977    }
     
    8886    {
    8987        assertIsNullOrCFunctionPtr(value);
    90         PoisonedMasmPtr::assertIsNotPoisoned(m_value);
    9188        ASSERT_NULL_OR_VALID_CODE_POINTER(m_value);
    9289    }
     
    10198    {
    10299        assertIsNullOrCFunctionPtr(value);
    103         PoisonedMasmPtr::assertIsNotPoisoned(m_value);
    104100        ASSERT_NULL_OR_VALID_CODE_POINTER(m_value);
    105101    }
     
    115111    {
    116112        assertIsNullOrCFunctionPtr(value);
    117         PoisonedMasmPtr::assertIsNotPoisoned(m_value);
    118113        ASSERT_NULL_OR_VALID_CODE_POINTER(m_value);
    119114    }
     
    131126    void* executableAddress() const
    132127    {
    133         PoisonedMasmPtr::assertIsNotPoisoned(m_value);
    134128        return m_value;
    135129    }
     
    138132    void* retaggedExecutableAddress() const
    139133    {
    140         PoisonedMasmPtr::assertIsNotPoisoned(m_value);
    141134        return retagCodePtr<tag, newTag>(m_value);
    142135    }
     
    153146        : m_value(retagCodePtr<otherTag, tag>(other.executableAddress()))
    154147    {
    155         PoisonedMasmPtr::assertIsNotPoisoned(m_value);
    156148        ASSERT_NULL_OR_VALID_CODE_POINTER(m_value);
    157149    }
     
    180172        : m_value(value)
    181173    {
    182         PoisonedMasmPtr::assertIsNotPoisoned(m_value);
    183174        ASSERT_VALID_CODE_POINTER(m_value);
    184175    }
     
    188179        : m_value(untagCodePtr<tag>(function.executableAddress()))
    189180    {
    190         PoisonedMasmPtr::assertIsNotPoisoned(m_value);
    191181        ASSERT_VALID_CODE_POINTER(m_value);
    192182    }
     
    194184    const void* value() const
    195185    {
    196         PoisonedMasmPtr::assertIsNotPoisoned(m_value);
    197186        return m_value;
    198187    }
     
    232221    {
    233222        assertIsTaggedWith(value, tag);
    234         m_value.assertIsPoisoned();
    235223        ASSERT(value);
    236224#if CPU(ARM_THUMB2)
    237225        ASSERT(!(reinterpret_cast<uintptr_t>(value) & 1));
    238226#endif
    239         ASSERT_VALID_CODE_POINTER(m_value.unpoisoned());
     227        ASSERT_VALID_CODE_POINTER(m_value);
    240228    }
    241229
     
    246234        assertIsTaggedWith(value, tag);
    247235        MacroAssemblerCodePtr result;
    248         result.m_value = PoisonedMasmPtr(value);
    249         result.m_value.assertIsPoisoned();
     236        result.m_value = value;
    250237        return result;
    251238    }
     
    256243        assertIsNotTagged(ra.value());
    257244        ASSERT(ra.value());
    258         m_value.assertIsPoisoned();
    259         ASSERT_VALID_CODE_POINTER(m_value.unpoisoned());
    260     }
    261 
    262     PoisonedMasmPtr poisonedPtr() const { return m_value; }
     245        ASSERT_VALID_CODE_POINTER(m_value);
     246    }
    263247
    264248    template<PtrTag newTag>
     
    273257    T executableAddress() const
    274258    {
    275         m_value.assertIsPoisoned();
    276         return m_value.unpoisoned<T>();
     259        return bitwise_cast<T>(m_value);
    277260    }
    278261
     
    280263    T untaggedExecutableAddress() const
    281264    {
    282         m_value.assertIsPoisoned();
    283         return untagCodePtr<T, tag>(m_value.unpoisoned());
     265        return untagCodePtr<T, tag>(m_value);
    284266    }
    285267
     
    287269    T retaggedExecutableAddress() const
    288270    {
    289         m_value.assertIsPoisoned();
    290         return retagCodePtr<T, tag, newTag>(m_value.unpoisoned());
     271        return retagCodePtr<T, tag, newTag>(m_value);
    291272    }
    292273
     
    296277    T dataLocation() const
    297278    {
    298         m_value.assertIsPoisoned();
    299         ASSERT_VALID_CODE_POINTER(m_value.unpoisoned());
    300         return bitwise_cast<T>(m_value ? m_value.unpoisoned<char*>() - 1 : nullptr);
     279        ASSERT_VALID_CODE_POINTER(m_value);
     280        return bitwise_cast<T>(m_value ? bitwise_cast<char*>(m_value) - 1 : nullptr);
    301281    }
    302282#else
     
    304284    T dataLocation() const
    305285    {
    306         m_value.assertIsPoisoned();
    307         ASSERT_VALID_CODE_POINTER(m_value);
    308         return untagCodePtr<T, tag>(m_value.unpoisoned());
     286        ASSERT_VALID_CODE_POINTER(m_value);
     287        return untagCodePtr<T, tag>(m_value);
    309288    }
    310289#endif
     
    312291    bool operator!() const
    313292    {
    314 #if ENABLE(POISON_ASSERTS)
    315         if (!isEmptyValue() && !isDeletedValue())
    316             m_value.assertIsPoisoned();
    317 #endif
    318293        return !m_value;
    319294    }
     
    322297    bool operator==(const MacroAssemblerCodePtr& other) const
    323298    {
    324 #if ENABLE(POISON_ASSERTS)
    325         if (!isEmptyValue() && !isDeletedValue())
    326             m_value.assertIsPoisoned();
    327         if (!other.isEmptyValue() && !other.isDeletedValue())
    328             other.m_value.assertIsPoisoned();
    329 #endif
    330299        return m_value == other.m_value;
    331300    }
    332301
    333302    // Disallow any casting operations (except for booleans). Instead, the client
    334     // should be asking for poisonedPtr() or executableAddress() explicitly.
     303    // should be asking executableAddress() explicitly.
    335304    template<typename T, typename = std::enable_if_t<!std::is_same<T, bool>::value>>
    336305    operator T() = delete;
     
    357326    bool isDeletedValue() const { return m_value == deletedValue(); }
    358327
    359     unsigned hash() const { return IntHash<uintptr_t>::hash(m_value.bits()); }
     328    unsigned hash() const { return PtrHash<const void*>::hash(m_value); }
    360329
    361330    static void initialize();
    362331
    363332private:
    364     static PoisonedMasmPtr emptyValue() { return PoisonedMasmPtr(AlreadyPoisoned, 1); }
    365     static PoisonedMasmPtr deletedValue() { return PoisonedMasmPtr(AlreadyPoisoned, 2); }
    366 
    367     PoisonedMasmPtr m_value;
     333    static const void* emptyValue() { return bitwise_cast<void*>(static_cast<intptr_t>(1)); }
     334    static const void* deletedValue() { return bitwise_cast<void*>(static_cast<intptr_t>(2)); }
     335
     336    const void* m_value { nullptr };
    368337};
    369338
     
    489458    : m_value(ptr.executableAddress())
    490459{
    491     PoisonedMasmPtr::assertIsNotPoisoned(m_value);
    492460}
    493461
  • trunk/Source/JavaScriptCore/b3/B3LowerMacros.cpp

    r241217 r242100  
    11/*
    2  * Copyright (C) 2015-2018 Apple Inc. All rights reserved.
     2 * Copyright (C) 2015-2019 Apple Inc. All rights reserved.
    33 *
    44 * Redistribution and use in source and binary forms, with or without
     
    508508                        GPRReg index = params[0].gpr();
    509509                        GPRReg scratch = params.gpScratch(0);
    510                         GPRReg poisonScratch = params.gpScratch(1);
    511 
    512                         jit.move(CCallHelpers::TrustedImm64(JITCodePoison::key()), poisonScratch);
     510
    513511                        jit.move(CCallHelpers::TrustedImmPtr(jumpTable), scratch);
    514512                        jit.load64(CCallHelpers::BaseIndex(scratch, index, CCallHelpers::timesPtr()), scratch);
    515                         jit.xor64(poisonScratch, scratch);
    516513                        jit.jump(scratch, JSSwitchPtrTag);
    517514
  • trunk/Source/JavaScriptCore/b3/testb3.cpp

    r242068 r242100  
    11/*
    2  * Copyright (C) 2015-2018 Apple Inc. All rights reserved.
     2 * Copyright (C) 2015-2019 Apple Inc. All rights reserved.
    33 *
    44 * Redistribution and use in source and binary forms, with or without
     
    1346313463
    1346413464            GPRReg scratch = params.gpScratch(0);
    13465             GPRReg poisonScratch = params.gpScratch(1);
    1346613465
    1346713466            jit.move(CCallHelpers::TrustedImmPtr(jumpTable), scratch);
    13468             jit.move(CCallHelpers::TrustedImm64(JITCodePoison::key()), poisonScratch);
    1346913467            jit.load64(CCallHelpers::BaseIndex(scratch, params[0].gpr(), CCallHelpers::timesPtr()), scratch);
    13470             jit.xor64(poisonScratch, scratch);
    1347113468            jit.jump(scratch, B3CompilationPtrTag);
    1347213469
  • trunk/Source/JavaScriptCore/dfg/DFGOSRExitCompilerCommon.h

    r227527 r242100  
    11/*
    2  * Copyright (C) 2013-2018 Apple Inc. All rights reserved.
     2 * Copyright (C) 2013-2019 Apple Inc. All rights reserved.
    33 *
    44 * Redistribution and use in source and binary forms, with or without
     
    8888    jit.loadPtr(MacroAssembler::Address(GPRInfo::callFrameRegister, CallFrameSlot::codeBlock * static_cast<int>(sizeof(Register))), GPRInfo::regT0);
    8989    jit.loadPtr(MacroAssembler::Address(GPRInfo::regT0, CodeBlock::jitCodeOffset()), GPRInfo::regT0);
    90     jit.xorPtr(MacroAssembler::TrustedImmPtr(CodeBlockPoison::key()), GPRInfo::regT0);
    9190    jit.addPtr(MacroAssembler::TrustedImm32(JITCodeType::commonDataOffset()), GPRInfo::regT0);
    9291    jit.load32(MacroAssembler::Address(GPRInfo::regT0, CommonData::frameRegisterCountOffset()), GPRInfo::regT0);
  • trunk/Source/JavaScriptCore/dfg/DFGSpeculativeJIT.cpp

    r242015 r242100  
    93429342        m_jit.emitLoadStructure(*m_jit.vm(), baseGPR, otherGPR, specifiedGPR);
    93439343        m_jit.loadPtr(CCallHelpers::Address(otherGPR, Structure::classInfoOffset()), otherGPR);
    9344 #if USE(JSVALUE64)
    9345         m_jit.move(CCallHelpers::TrustedImm64(GlobalDataPoison::key()), specifiedGPR);
    9346         m_jit.xor64(specifiedGPR, otherGPR);
    9347 #endif
    93489344        m_jit.move(CCallHelpers::TrustedImmPtr(node->classInfo()), specifiedGPR);
    93499345
     
    96399635   
    96409636    m_jit.storePtr(
    9641         TrustedImmPtr(PoisonedClassInfoPtr(StringObject::info()).bits()),
     9637        TrustedImmPtr(StringObject::info()),
    96429638        JITCompiler::Address(resultGPR, JSDestructibleObject::classInfoOffset()));
    96439639#if USE(JSVALUE64)
     
    1048210478
    1048310479void SpeculativeJIT::emitSwitchIntJump(
    10484     SwitchData* data, GPRReg value, GPRReg scratch, GPRReg poisonScratch)
     10480    SwitchData* data, GPRReg value, GPRReg scratch)
    1048510481{
    1048610482    SimpleJumpTable& table = m_jit.codeBlock()->switchJumpTable(data->switchTableIndex);
     
    1049010486        m_jit.branch32(JITCompiler::AboveOrEqual, value, Imm32(table.ctiOffsets.size())),
    1049110487        data->fallThrough.block);
    10492     UNUSED_PARAM(poisonScratch); // Placate the 32-bit build.
    10493 #if USE(JSVALUE64)
    10494     m_jit.move(TrustedImm64(JITCodePoison::key()), poisonScratch);
    10495 #endif
    1049610488    m_jit.move(TrustedImmPtr(table.ctiOffsets.begin()), scratch);
    1049710489    m_jit.loadPtr(JITCompiler::BaseIndex(scratch, value, JITCompiler::timesPtr()), scratch);
    1049810490   
    10499 #if USE(JSVALUE64)
    10500     m_jit.xor64(poisonScratch, scratch);
    10501 #endif
    1050210491    m_jit.jump(scratch, JSSwitchPtrTag);
    1050310492    data->didUseJumpTable = true;
     
    1051010499        SpeculateInt32Operand value(this, node->child1());
    1051110500        GPRTemporary temp(this);
    10512         GPRTemporary temp2(this);
    10513         emitSwitchIntJump(data, value.gpr(), temp.gpr(), temp2.gpr());
     10501        emitSwitchIntJump(data, value.gpr(), temp.gpr());
    1051410502        noResult(node);
    1051510503        break;
     
    1051910507        JSValueOperand value(this, node->child1());
    1052010508        GPRTemporary temp(this);
    10521         GPRTemporary temp2(this);
    1052210509        JSValueRegs valueRegs = value.jsValueRegs();
    1052310510        GPRReg scratch = temp.gpr();
    10524         GPRReg scratch2 = temp2.gpr();
    1052510511
    1052610512        value.use();
    1052710513
    1052810514        auto notInt32 = m_jit.branchIfNotInt32(valueRegs);
    10529         emitSwitchIntJump(data, valueRegs.payloadGPR(), scratch, scratch2);
     10515        emitSwitchIntJump(data, valueRegs.payloadGPR(), scratch);
    1053010516        notInt32.link(&m_jit);
    1053110517        addBranch(m_jit.branchIfNotNumber(valueRegs, scratch), data->fallThrough.block);
     
    1054610532
    1054710533void SpeculativeJIT::emitSwitchCharStringJump(
    10548     SwitchData* data, GPRReg value, GPRReg scratch, GPRReg scratch2)
     10534    SwitchData* data, GPRReg value, GPRReg scratch)
    1054910535{
    1055010536    addBranch(
     
    1057710563   
    1057810564    ready.link(&m_jit);
    10579     emitSwitchIntJump(data, scratch, value, scratch2);
     10565    emitSwitchIntJump(data, scratch, value);
    1058010566}
    1058110567
     
    1058610572        SpeculateCellOperand op1(this, node->child1());
    1058710573        GPRTemporary temp(this);
    10588         GPRTemporary temp2(this);
    1058910574
    1059010575        GPRReg op1GPR = op1.gpr();
    1059110576        GPRReg tempGPR = temp.gpr();
    10592         GPRReg temp2GPR = temp2.gpr();
    1059310577
    1059410578        op1.use();
    1059510579
    1059610580        speculateString(node->child1(), op1GPR);
    10597         emitSwitchCharStringJump(data, op1GPR, tempGPR, temp2GPR);
     10581        emitSwitchCharStringJump(data, op1GPR, tempGPR);
    1059810582        noResult(node, UseChildrenCalledExplicitly);
    1059910583        break;
     
    1060310587        JSValueOperand op1(this, node->child1());
    1060410588        GPRTemporary temp(this);
    10605         GPRTemporary temp2(this);
    1060610589
    1060710590        JSValueRegs op1Regs = op1.jsValueRegs();
    1060810591        GPRReg tempGPR = temp.gpr();
    10609         GPRReg temp2GPR = temp2.gpr();
    1061010592
    1061110593        op1.use();
     
    1061510597        addBranch(m_jit.branchIfNotString(op1Regs.payloadGPR()), data->fallThrough.block);
    1061610598       
    10617         emitSwitchCharStringJump(data, op1Regs.payloadGPR(), tempGPR, temp2GPR);
     10599        emitSwitchCharStringJump(data, op1Regs.payloadGPR(), tempGPR);
    1061810600        noResult(node, UseChildrenCalledExplicitly);
    1061910601        break;
  • trunk/Source/JavaScriptCore/dfg/DFGSpeculativeJIT.h

    r240327 r242100  
    11/*
    2  * Copyright (C) 2011-2018 Apple Inc. All rights reserved.
     2 * Copyright (C) 2011-2019 Apple Inc. All rights reserved.
    33 *
    44 * Redistribution and use in source and binary forms, with or without
     
    12371237    };
    12381238   
    1239     void emitSwitchIntJump(SwitchData*, GPRReg value, GPRReg scratch, GPRReg scratch2);
     1239    void emitSwitchIntJump(SwitchData*, GPRReg value, GPRReg scratch);
    12401240    void emitSwitchImm(Node*, SwitchData*);
    1241     void emitSwitchCharStringJump(SwitchData*, GPRReg value, GPRReg scratch, GPRReg scratch2);
     1241    void emitSwitchCharStringJump(SwitchData*, GPRReg value, GPRReg scratch);
    12421242    void emitSwitchChar(Node*, SwitchData*);
    12431243    void emitBinarySwitchStringRecurse(
  • trunk/Source/JavaScriptCore/ftl/FTLLowerDFGToB3.cpp

    r242096 r242100  
    56465646
    56475647        LValue fastResultValue = allocateObject<StringObject>(structure, m_out.intPtrZero, slowCase);
    5648         m_out.storePtr(m_out.constIntPtr(PoisonedClassInfoPtr(StringObject::info()).bits()), fastResultValue, m_heaps.JSDestructibleObject_classInfo);
     5648        m_out.storePtr(m_out.constIntPtr(StringObject::info()), fastResultValue, m_heaps.JSDestructibleObject_classInfo);
    56495649        m_out.store64(string, fastResultValue, m_heaps.JSWrapperObject_internalValue);
    56505650        mutatorFence();
     
    1215412154
    1215512155            LValue structure = loadStructure(cell);
    12156             LValue poisonedClassInfo = m_out.loadPtr(structure, m_heaps.Structure_classInfo);
    12157             LValue classInfo = m_out.bitXor(poisonedClassInfo, m_out.constInt64(GlobalDataPoison::key()));
     12156            LValue classInfo = m_out.loadPtr(structure, m_heaps.Structure_classInfo);
    1215812157            ValueFromBlock otherAtStart = m_out.anchor(classInfo);
    1215912158            m_out.jump(loop);
  • trunk/Source/JavaScriptCore/jit/AssemblyHelpers.h

    r242096 r242100  
    17991799        auto butterfly = TrustedImmPtr(nullptr);
    18001800        emitAllocateJSObject<ClassType>(vm, resultGPR, TrustedImmPtr(structure), butterfly, scratchGPR1, scratchGPR2, slowPath);
    1801         storePtr(TrustedImmPtr(PoisonedClassInfoPtr(structure->classInfo()).bits()), Address(resultGPR, JSDestructibleObject::classInfoOffset()));
     1801        storePtr(TrustedImmPtr(structure->classInfo()), Address(resultGPR, JSDestructibleObject::classInfoOffset()));
    18021802    }
    18031803   
  • trunk/Source/JavaScriptCore/jit/ThunkGenerators.cpp

    r241214 r242100  
    11/*
    2  * Copyright (C) 2010-2018 Apple Inc. All rights reserved.
     2 * Copyright (C) 2010-2019 Apple Inc. All rights reserved.
    33 *
    44 * Redistribution and use in source and binary forms, with or without
     
    214214    // Now we know that we have a CodeBlock, and we're committed to making a fast
    215215    // call.
    216 #if USE(JSVALUE64)
    217     jit.move(CCallHelpers::TrustedImm64(JITCodePoison::key()), GPRInfo::regT1);
    218     jit.xor64(GPRInfo::regT1, GPRInfo::regT4);
    219 #endif
    220216
    221217    // Make a tail call. This will return back to JIT code.
     
    12491245    CCallHelpers::Jump noCode = jit.branchTestPtr(CCallHelpers::Zero, GPRInfo::regT0);
    12501246   
    1251 #if USE(JSVALUE64)
    1252     jit.move(CCallHelpers::TrustedImm64(JITCodePoison::key()), GPRInfo::regT1);
    1253     jit.xor64(GPRInfo::regT1, GPRInfo::regT0);
    1254 #endif
    12551247    emitPointerValidation(jit, GPRInfo::regT0, JSEntryPtrTag);
    12561248    jit.call(GPRInfo::regT0, JSEntryPtrTag);
  • trunk/Source/JavaScriptCore/runtime/JSCPoison.h

    r241649 r242100  
    11/*
    2  * Copyright (C) 2017-2018 Apple Inc. All rights reserved.
     2 * Copyright (C) 2017-2019 Apple Inc. All rights reserved.
    33 *
    44 * Redistribution and use in source and binary forms, with or without
     
    3333#define FOR_EACH_JSC_POISON(v) \
    3434    v(ArrayPrototype) \
    35     v(CodeBlock) \
    36     v(GlobalData) \
    37     v(JITCode) \
    3835    v(JSAPIWrapperObject) \
    3936    v(JSArrayBuffer) \
     
    6663#undef DECLARE_POISON
    6764
    68 struct ClassInfo;
    69 
    70 using PoisonedClassInfoPtr = Poisoned<GlobalDataPoison, const ClassInfo*>;
    71 using PoisonedMasmPtr = Poisoned<JITCodePoison, const void*>;
    72 
    7365void initializePoison();
    7466
  • trunk/Source/JavaScriptCore/runtime/JSDestructibleObject.h

    r240965 r242100  
    11/*
    2  * Copyright (C) 2012-2017 Apple Inc. All rights reserved.
     2 * Copyright (C) 2012-2019 Apple Inc. All rights reserved.
    33 *
    44 * Redistribution and use in source and binary forms, with or without
     
    4444    }
    4545
    46     const ClassInfo* classInfo() const { return m_classInfo.unpoisoned(); }
     46    const ClassInfo* classInfo() const { return m_classInfo; }
    4747   
    4848    static ptrdiff_t classInfoOffset() { return OBJECT_OFFSETOF(JSDestructibleObject, m_classInfo); }
     
    5757
    5858private:
    59     PoisonedClassInfoPtr m_classInfo;
     59    const ClassInfo* m_classInfo;
    6060};
    6161
  • trunk/Source/JavaScriptCore/runtime/JSSegmentedVariableObject.h

    r240965 r242100  
    11/*
    2  * Copyright (C) 2012-2017 Apple Inc. All rights reserved.
     2 * Copyright (C) 2012-2019 Apple Inc. All rights reserved.
    33 *
    44 * Redistribution and use in source and binary forms, with or without
     
    9797    }
    9898   
    99     const ClassInfo* classInfo() const { return m_classInfo.unpoisoned(); }
     99    const ClassInfo* classInfo() const { return m_classInfo; }
    100100   
    101101protected:
     
    108108private:
    109109    SegmentedVector<WriteBarrier<Unknown>, 16> m_variables;
    110     PoisonedClassInfoPtr m_classInfo;
     110    const ClassInfo* m_classInfo;
    111111    ConcurrentJSLock m_lock;
    112112    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.
  • trunk/Source/JavaScriptCore/runtime/Structure.h

    r240965 r242100  
    11/*
    2  * Copyright (C) 2008-2018 Apple Inc. All rights reserved.
     2 * Copyright (C) 2008-2019 Apple Inc. All rights reserved.
    33 *
    44 * Redistribution and use in source and binary forms, with or without
     
    491491    void setObjectToStringValue(ExecState*, VM&, JSString* value, PropertySlot toStringTagSymbolSlot);
    492492
    493     const ClassInfo* classInfo() const { return m_classInfo.unpoisoned(); }
     493    const ClassInfo* classInfo() const { return m_classInfo; }
    494494
    495495    static ptrdiff_t structureIDOffset()
     
    769769    RefPtr<UniquedStringImpl> m_nameInPrevious;
    770770
    771     PoisonedClassInfoPtr m_classInfo;
     771    const ClassInfo* m_classInfo;
    772772
    773773    StructureTransitionTable m_transitionTable;
  • trunk/Source/JavaScriptCore/runtime/VM.h

    r242015 r242100  
    547547   
    548548    JSCell* currentlyDestructingCallbackObject;
    549     PoisonedClassInfoPtr currentlyDestructingCallbackObjectClassInfo;
     549    const ClassInfo* currentlyDestructingCallbackObjectClassInfo { nullptr };
    550550
    551551    AtomicStringTable* m_atomicStringTable;
  • trunk/Source/JavaScriptCore/wasm/WasmB3IRGenerator.cpp

    r241657 r242100  
    11/*
    2  * Copyright (C) 2016-2018 Apple Inc. All rights reserved.
     2 * Copyright (C) 2016-2019 Apple Inc. All rights reserved.
    33 *
    44 * Redistribution and use in source and binary forms, with or without
     
    11291129        Value* jumpDestination = isEmbedderBlock->appendNew<MemoryValue>(m_proc,
    11301130            Load, pointerType(), origin(), instanceValue(), safeCast<int32_t>(Instance::offsetOfWasmToEmbedderStub(functionIndex)));
    1131         if (Options::usePoisoning())
    1132             jumpDestination = isEmbedderBlock->appendNew<Value>(m_proc, BitXor, origin(), jumpDestination, isEmbedderBlock->appendNew<Const64Value>(m_proc, origin(), g_JITCodePoison));
    11331131
    11341132        Value* embedderCallResult = wasmCallingConvention().setupCall(m_proc, isEmbedderBlock, origin(), args, toB3Type(returnType),
     
    13091307        m_currentBlock->appendNew<MemoryValue>(m_proc, Load, pointerType(), origin(), callableFunction,
    13101308            safeCast<int32_t>(WasmToWasmImportableFunction::offsetOfEntrypointLoadLocation())));
    1311     if (Options::usePoisoning())
    1312         calleeCode = m_currentBlock->appendNew<Value>(m_proc, BitXor, origin(), calleeCode, m_currentBlock->appendNew<Const64Value>(m_proc, origin(), g_JITCodePoison));
    13131309
    13141310    Type returnType = signature.returnType();
  • trunk/Source/JavaScriptCore/wasm/WasmBinding.cpp

    r230748 r242100  
    11/*
    2  * Copyright (C) 2016-2018 Apple Inc. All rights reserved.
     2 * Copyright (C) 2016-2019 Apple Inc. All rights reserved.
    33 *
    44 * Redistribution and use in source and binary forms, with or without
     
    7979    // Tail call into the callee WebAssembly function.
    8080    jit.loadPtr(scratch, scratch);
    81     if (Options::usePoisoning())
    82         jit.xorPtr(JIT::TrustedImmPtr(g_JITCodePoison), scratch);
    8381    jit.jump(scratch, WasmEntryPtrTag);
    8482
Note: See TracChangeset for help on using the changeset viewer.