Changeset 206212 in webkit


Ignore:
Timestamp:
Sep 21, 2016 9:26:13 AM (8 years ago)
Author:
msaboff@apple.com
Message:

FTL needs to reserve callee stack space in bytes
https://bugs.webkit.org/show_bug.cgi?id=162324

Reviewed by Geoffrey Garen.

Changed two instances where we call B3::Procedure::requestCallArgAreaSize() with the
number of JSValue sized objects of stack space instead of bytes. The correct units
to use is bytes.

Renamed both the Air and B3 related callArgAreaSize() to callArgAreaSizeInBytes().

No new tests as this doesn't surface as an issue when arguments are passed on the stack.

  • b3/B3Procedure.cpp:

(JSC::B3::Procedure::callArgAreaSizeInBytes):
(JSC::B3::Procedure::requestCallArgAreaSizeInBytes):
(JSC::B3::Procedure::callArgAreaSize): Deleted.
(JSC::B3::Procedure::requestCallArgAreaSize): Deleted.

  • b3/B3Procedure.h:
  • b3/air/AirAllocateStack.cpp:

(JSC::B3::Air::allocateStack):

  • b3/air/AirCCallingConvention.cpp:

(JSC::B3::Air::computeCCallingConvention):

  • b3/air/AirCode.h:

(JSC::B3::Air::Code::callArgAreaSizeInBytes):
(JSC::B3::Air::Code::requestCallArgAreaSizeInBytes):
(JSC::B3::Air::Code::callArgAreaSize): Deleted.
(JSC::B3::Air::Code::requestCallArgAreaSize): Deleted.

  • ftl/FTLLowerDFGToB3.cpp:

(JSC::FTL::DFG::LowerDFGToB3::compileCallOrConstruct):
(JSC::FTL::DFG::LowerDFGToB3::compileCallOrConstructVarargs):
(JSC::FTL::DFG::LowerDFGToB3::compileCallEval):

Location:
trunk/Source/JavaScriptCore
Files:
7 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/JavaScriptCore/ChangeLog

    r206207 r206212  
     12016-09-21  Michael Saboff  <msaboff@apple.com>
     2
     3        FTL needs to reserve callee stack space in bytes
     4        https://bugs.webkit.org/show_bug.cgi?id=162324
     5
     6        Reviewed by Geoffrey Garen.
     7
     8        Changed two instances where we call B3::Procedure::requestCallArgAreaSize() with the
     9        number of JSValue sized objects of stack space instead of bytes.  The correct units
     10        to use is bytes.
     11
     12        Renamed both the Air and B3 related callArgAreaSize() to callArgAreaSizeInBytes().
     13
     14        No new tests as this doesn't surface as an issue when arguments are passed on the stack.
     15
     16        * b3/B3Procedure.cpp:
     17        (JSC::B3::Procedure::callArgAreaSizeInBytes):
     18        (JSC::B3::Procedure::requestCallArgAreaSizeInBytes):
     19        (JSC::B3::Procedure::callArgAreaSize): Deleted.
     20        (JSC::B3::Procedure::requestCallArgAreaSize): Deleted.
     21        * b3/B3Procedure.h:
     22        * b3/air/AirAllocateStack.cpp:
     23        (JSC::B3::Air::allocateStack):
     24        * b3/air/AirCCallingConvention.cpp:
     25        (JSC::B3::Air::computeCCallingConvention):
     26        * b3/air/AirCode.h:
     27        (JSC::B3::Air::Code::callArgAreaSizeInBytes):
     28        (JSC::B3::Air::Code::requestCallArgAreaSizeInBytes):
     29        (JSC::B3::Air::Code::callArgAreaSize): Deleted.
     30        (JSC::B3::Air::Code::requestCallArgAreaSize): Deleted.
     31        * ftl/FTLLowerDFGToB3.cpp:
     32        (JSC::FTL::DFG::LowerDFGToB3::compileCallOrConstruct):
     33        (JSC::FTL::DFG::LowerDFGToB3::compileCallOrConstructVarargs):
     34        (JSC::FTL::DFG::LowerDFGToB3::compileCallEval):
     35
    1362016-09-21  Csaba Osztrogonác  <ossy@webkit.org>
    237
  • trunk/Source/JavaScriptCore/b3/B3Procedure.cpp

    r203670 r206212  
    296296}
    297297
    298 unsigned Procedure::callArgAreaSize() const
    299 {
    300     return code().callArgAreaSize();
    301 }
    302 
    303 void Procedure::requestCallArgAreaSize(unsigned size)
    304 {
    305     code().requestCallArgAreaSize(size);
     298unsigned Procedure::callArgAreaSizeInBytes() const
     299{
     300    return code().callArgAreaSizeInBytes();
     301}
     302
     303void Procedure::requestCallArgAreaSizeInBytes(unsigned size)
     304{
     305    code().requestCallArgAreaSizeInBytes(size);
    306306}
    307307
  • trunk/Source/JavaScriptCore/b3/B3Procedure.h

    r204920 r206212  
    211211    Air::Code& code() { return *m_code; }
    212212
    213     unsigned callArgAreaSize() const;
    214     void requestCallArgAreaSize(unsigned size);
     213    unsigned callArgAreaSizeInBytes() const;
     214    void requestCallArgAreaSizeInBytes(unsigned size);
    215215
    216216    JS_EXPORT_PRIVATE unsigned frameSize() const;
  • trunk/Source/JavaScriptCore/b3/air/AirAllocateStack.cpp

    r201783 r206212  
    241241                    // FIXME: https://bugs.webkit.org/show_bug.cgi?id=150454
    242242                    ASSERT(arg.offset() >= 0);
    243                     code.requestCallArgAreaSize(arg.offset() + 8);
     243                    code.requestCallArgAreaSizeInBytes(arg.offset() + 8);
    244244                }
    245245            }
     
    247247    }
    248248
    249     code.setFrameSize(frameSizeForStackSlots + code.callArgAreaSize());
     249    code.setFrameSize(frameSizeForStackSlots + code.callArgAreaSizeInBytes());
    250250
    251251    // Finally, transform the code to use Addr's instead of StackSlot's. This is a lossless
  • trunk/Source/JavaScriptCore/b3/air/AirCCallingConvention.cpp

    r195139 r206212  
    8686            marshallCCallArgument(gpArgumentCount, fpArgumentCount, stackOffset, value->child(i)));
    8787    }
    88     code.requestCallArgAreaSize(WTF::roundUpToMultipleOf(stackAlignmentBytes(), stackOffset));
     88    code.requestCallArgAreaSizeInBytes(WTF::roundUpToMultipleOf(stackAlignmentBytes(), stackOffset));
    8989    return result;
    9090}
  • trunk/Source/JavaScriptCore/b3/air/AirCode.h

    r204920 r206212  
    102102    }
    103103
    104     unsigned callArgAreaSize() const { return m_callArgAreaSize; }
     104    unsigned callArgAreaSizeInBytes() const { return m_callArgAreaSize; }
    105105
    106106    // You can call this before code generation to force a minimum call arg area size.
    107     void requestCallArgAreaSize(unsigned size)
     107    void requestCallArgAreaSizeInBytes(unsigned size)
    108108    {
    109109        m_callArgAreaSize = std::max(
  • trunk/Source/JavaScriptCore/ftl/FTLLowerDFGToB3.cpp

    r206136 r206212  
    52945294        LValue jsCallee = lowJSValue(m_graph.varArgChild(node, 0));
    52955295
    5296         unsigned frameSize = CallFrame::headerSizeInRegisters + numArgs;
    5297         unsigned alignedFrameSize = WTF::roundUpToMultipleOf(stackAlignmentRegisters(), frameSize);
     5296        unsigned frameSize = (CallFrame::headerSizeInRegisters + numArgs) * sizeof(EncodedJSValue);
     5297        unsigned alignedFrameSize = WTF::roundUpToMultipleOf(stackAlignmentBytes(), frameSize);
    52985298
    52995299        // JS->JS calling convention requires that the caller allows this much space on top of stack to
     
    53055305        //   shouldn't rely on Air to infer the trashed stack property based on the arguments it ends
    53065306        //   up seeing.
    5307         m_proc.requestCallArgAreaSize(alignedFrameSize);
     5307        m_proc.requestCallArgAreaSizeInBytes(alignedFrameSize);
    53085308
    53095309        // Collect the arguments, since this can generate code and we want to generate it before we emit
     
    55555555            WTF::roundUpToMultipleOf(stackAlignmentBytes(), 5 * sizeof(EncodedJSValue));
    55565556
    5557         m_proc.requestCallArgAreaSize(minimumJSCallAreaSize);
     5557        m_proc.requestCallArgAreaSizeInBytes(minimumJSCallAreaSize);
    55585558       
    55595559        CodeOrigin codeOrigin = codeOriginDescriptionOfCallSite();
     
    57815781        LValue jsCallee = lowJSValue(m_graph.varArgChild(node, 0));
    57825782       
    5783         unsigned frameSize = CallFrame::headerSizeInRegisters + numArgs;
    5784         unsigned alignedFrameSize = WTF::roundUpToMultipleOf(stackAlignmentRegisters(), frameSize);
    5785        
    5786         m_proc.requestCallArgAreaSize(alignedFrameSize);
     5783        unsigned frameSize = (CallFrame::headerSizeInRegisters + numArgs) * sizeof(EncodedJSValue);
     5784        unsigned alignedFrameSize = WTF::roundUpToMultipleOf(stackAlignmentBytes(), frameSize);
     5785       
     5786        m_proc.requestCallArgAreaSizeInBytes(alignedFrameSize);
    57875787       
    57885788        Vector<ConstrainedValue> arguments;
Note: See TracChangeset for help on using the changeset viewer.