Changeset 220624 in webkit


Ignore:
Timestamp:
Aug 12, 2017 11:40:07 AM (7 years ago)
Author:
fpizlo@apple.com
Message:

ScopedArguments overflow storage needs to be in the JSValue gigacage
https://bugs.webkit.org/show_bug.cgi?id=174923

Reviewed by Saam Barati.

ScopedArguments overflow storage sits at the end of the ScopedArguments object, so we put that
object into the JSValue gigacage.

  • dfg/DFGSpeculativeJIT.cpp:

(JSC::DFG::SpeculativeJIT::compileGetByValOnScopedArguments):

  • ftl/FTLLowerDFGToB3.cpp:

(JSC::FTL::DFG::LowerDFGToB3::compileGetByVal):

  • jit/JITPropertyAccess.cpp:

(JSC::JIT::emitScopedArgumentsGetByVal):

  • runtime/ScopedArguments.h:

(JSC::ScopedArguments::subspaceFor):
(JSC::ScopedArguments::overflowStorage const):

Location:
trunk/Source/JavaScriptCore
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/JavaScriptCore/ChangeLog

    r220618 r220624  
     12017-08-11  Filip Pizlo  <fpizlo@apple.com>
     2
     3        ScopedArguments overflow storage needs to be in the JSValue gigacage
     4        https://bugs.webkit.org/show_bug.cgi?id=174923
     5
     6        Reviewed by Saam Barati.
     7       
     8        ScopedArguments overflow storage sits at the end of the ScopedArguments object, so we put that
     9        object into the JSValue gigacage.
     10
     11        * dfg/DFGSpeculativeJIT.cpp:
     12        (JSC::DFG::SpeculativeJIT::compileGetByValOnScopedArguments):
     13        * ftl/FTLLowerDFGToB3.cpp:
     14        (JSC::FTL::DFG::LowerDFGToB3::compileGetByVal):
     15        * jit/JITPropertyAccess.cpp:
     16        (JSC::JIT::emitScopedArgumentsGetByVal):
     17        * runtime/ScopedArguments.h:
     18        (JSC::ScopedArguments::subspaceFor):
     19        (JSC::ScopedArguments::overflowStorage const):
     20
    1212017-08-11  Filip Pizlo  <fpizlo@apple.com>
    222
  • trunk/Source/JavaScriptCore/dfg/DFGSpeculativeJIT.cpp

    r220618 r220624  
    63266326    m_jit.neg32(scratch2Reg);
    63276327   
     6328    m_jit.cage(Gigacage::JSValue, baseReg);
     6329   
    63286330    m_jit.loadValue(
    63296331        MacroAssembler::BaseIndex(
  • trunk/Source/JavaScriptCore/ftl/FTLLowerDFGToB3.cpp

    r220618 r220624  
    35663566            m_out.appendTo(overflowCase, continuation);
    35673567           
    3568             // FIXME: I guess we need to cage overflow storage?
    3569             // https://bugs.webkit.org/show_bug.cgi?id=174923
    35703568            address = m_out.baseIndex(
    3571                 m_heaps.ScopedArguments_overflowStorage, base,
     3569                m_heaps.ScopedArguments_overflowStorage, caged(Gigacage::JSValue, base),
    35723570                m_out.zeroExtPtr(m_out.sub(index, namedLength)));
    35733571            LValue overflowValue = m_out.load64(address);
  • trunk/Source/JavaScriptCore/jit/JITPropertyAccess.cpp

    r220606 r220624  
    15521552    sub32(property, scratch2);
    15531553    neg32(scratch2);
     1554    cage(Gigacage::JSValue, base);
    15541555    loadValue(BaseIndex(base, scratch2, TimesEight, ScopedArguments::overflowStorageOffset()), result);
    15551556    slowCases.append(branchIfEmpty(result));
  • trunk/Source/JavaScriptCore/runtime/ScopedArguments.h

    r215345 r220624  
    4343
    4444public:
     45    template<typename CellType>
     46    static Subspace* subspaceFor(VM& vm)
     47    {
     48        RELEASE_ASSERT(!CellType::needsDestruction);
     49        return &vm.jsValueGigacageCellSpace;
     50    }
     51
    4552    // Creates an arguments object but leaves it uninitialized. This is dangerous if we GC right
    4653    // after allocation.
     
    155162    {
    156163        return bitwise_cast<WriteBarrier<Unknown>*>(
    157             bitwise_cast<char*>(this) + overflowStorageOffset());
     164            bitwise_cast<char*>(Gigacage::caged(Gigacage::JSValue, this)) + overflowStorageOffset());
    158165    }
    159    
    160166   
    161167    bool m_overrodeThings; // True if length, callee, and caller are fully materialized in the object.
Note: See TracChangeset for help on using the changeset viewer.