Title: [206212] trunk/Source/_javascript_Core
Revision
206212
Author
msab...@apple.com
Date
2016-09-21 09:26:13 -0700 (Wed, 21 Sep 2016)

Log 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):

Modified Paths

Diff

Modified: trunk/Source/_javascript_Core/ChangeLog (206211 => 206212)


--- trunk/Source/_javascript_Core/ChangeLog	2016-09-21 16:25:14 UTC (rev 206211)
+++ trunk/Source/_javascript_Core/ChangeLog	2016-09-21 16:26:13 UTC (rev 206212)
@@ -1,3 +1,38 @@
+2016-09-21  Michael Saboff  <msab...@apple.com>
+
+        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):
+
 2016-09-21  Csaba Osztrogonác  <o...@webkit.org>
 
         [ARM] Unreviewed buildfix after r206136.

Modified: trunk/Source/_javascript_Core/b3/B3Procedure.cpp (206211 => 206212)


--- trunk/Source/_javascript_Core/b3/B3Procedure.cpp	2016-09-21 16:25:14 UTC (rev 206211)
+++ trunk/Source/_javascript_Core/b3/B3Procedure.cpp	2016-09-21 16:26:13 UTC (rev 206212)
@@ -295,14 +295,14 @@
     return result;
 }
 
-unsigned Procedure::callArgAreaSize() const
+unsigned Procedure::callArgAreaSizeInBytes() const
 {
-    return code().callArgAreaSize();
+    return code().callArgAreaSizeInBytes();
 }
 
-void Procedure::requestCallArgAreaSize(unsigned size)
+void Procedure::requestCallArgAreaSizeInBytes(unsigned size)
 {
-    code().requestCallArgAreaSize(size);
+    code().requestCallArgAreaSizeInBytes(size);
 }
 
 unsigned Procedure::frameSize() const

Modified: trunk/Source/_javascript_Core/b3/B3Procedure.h (206211 => 206212)


--- trunk/Source/_javascript_Core/b3/B3Procedure.h	2016-09-21 16:25:14 UTC (rev 206211)
+++ trunk/Source/_javascript_Core/b3/B3Procedure.h	2016-09-21 16:26:13 UTC (rev 206212)
@@ -210,8 +210,8 @@
     const Air::Code& code() const { return *m_code; }
     Air::Code& code() { return *m_code; }
 
-    unsigned callArgAreaSize() const;
-    void requestCallArgAreaSize(unsigned size);
+    unsigned callArgAreaSizeInBytes() const;
+    void requestCallArgAreaSizeInBytes(unsigned size);
 
     JS_EXPORT_PRIVATE unsigned frameSize() const;
     const RegisterAtOffsetList& calleeSaveRegisters() const;

Modified: trunk/Source/_javascript_Core/b3/air/AirAllocateStack.cpp (206211 => 206212)


--- trunk/Source/_javascript_Core/b3/air/AirAllocateStack.cpp	2016-09-21 16:25:14 UTC (rev 206211)
+++ trunk/Source/_javascript_Core/b3/air/AirAllocateStack.cpp	2016-09-21 16:26:13 UTC (rev 206212)
@@ -240,13 +240,13 @@
                     // such an awesome assumption.
                     // FIXME: https://bugs.webkit.org/show_bug.cgi?id=150454
                     ASSERT(arg.offset() >= 0);
-                    code.requestCallArgAreaSize(arg.offset() + 8);
+                    code.requestCallArgAreaSizeInBytes(arg.offset() + 8);
                 }
             }
         }
     }
 
-    code.setFrameSize(frameSizeForStackSlots + code.callArgAreaSize());
+    code.setFrameSize(frameSizeForStackSlots + code.callArgAreaSizeInBytes());
 
     // Finally, transform the code to use Addr's instead of StackSlot's. This is a lossless
     // transformation since we can search the StackSlots array to figure out which StackSlot any

Modified: trunk/Source/_javascript_Core/b3/air/AirCCallingConvention.cpp (206211 => 206212)


--- trunk/Source/_javascript_Core/b3/air/AirCCallingConvention.cpp	2016-09-21 16:25:14 UTC (rev 206211)
+++ trunk/Source/_javascript_Core/b3/air/AirCCallingConvention.cpp	2016-09-21 16:26:13 UTC (rev 206212)
@@ -85,7 +85,7 @@
         result.append(
             marshallCCallArgument(gpArgumentCount, fpArgumentCount, stackOffset, value->child(i)));
     }
-    code.requestCallArgAreaSize(WTF::roundUpToMultipleOf(stackAlignmentBytes(), stackOffset));
+    code.requestCallArgAreaSizeInBytes(WTF::roundUpToMultipleOf(stackAlignmentBytes(), stackOffset));
     return result;
 }
 

Modified: trunk/Source/_javascript_Core/b3/air/AirCode.h (206211 => 206212)


--- trunk/Source/_javascript_Core/b3/air/AirCode.h	2016-09-21 16:25:14 UTC (rev 206211)
+++ trunk/Source/_javascript_Core/b3/air/AirCode.h	2016-09-21 16:26:13 UTC (rev 206212)
@@ -101,10 +101,10 @@
         ASSERT_NOT_REACHED();
     }
 
-    unsigned callArgAreaSize() const { return m_callArgAreaSize; }
+    unsigned callArgAreaSizeInBytes() const { return m_callArgAreaSize; }
 
     // You can call this before code generation to force a minimum call arg area size.
-    void requestCallArgAreaSize(unsigned size)
+    void requestCallArgAreaSizeInBytes(unsigned size)
     {
         m_callArgAreaSize = std::max(
             m_callArgAreaSize,

Modified: trunk/Source/_javascript_Core/ftl/FTLLowerDFGToB3.cpp (206211 => 206212)


--- trunk/Source/_javascript_Core/ftl/FTLLowerDFGToB3.cpp	2016-09-21 16:25:14 UTC (rev 206211)
+++ trunk/Source/_javascript_Core/ftl/FTLLowerDFGToB3.cpp	2016-09-21 16:26:13 UTC (rev 206212)
@@ -5293,8 +5293,8 @@
 
         LValue jsCallee = lowJSValue(m_graph.varArgChild(node, 0));
 
-        unsigned frameSize = CallFrame::headerSizeInRegisters + numArgs;
-        unsigned alignedFrameSize = WTF::roundUpToMultipleOf(stackAlignmentRegisters(), frameSize);
+        unsigned frameSize = (CallFrame::headerSizeInRegisters + numArgs) * sizeof(EncodedJSValue);
+        unsigned alignedFrameSize = WTF::roundUpToMultipleOf(stackAlignmentBytes(), frameSize);
 
         // JS->JS calling convention requires that the caller allows this much space on top of stack to
         // get trashed by the callee, even if not all of that space is used to pass arguments. We tell
@@ -5304,7 +5304,7 @@
         // - The trashed stack guarantee is logically separate from the act of passing arguments, so we
         //   shouldn't rely on Air to infer the trashed stack property based on the arguments it ends
         //   up seeing.
-        m_proc.requestCallArgAreaSize(alignedFrameSize);
+        m_proc.requestCallArgAreaSizeInBytes(alignedFrameSize);
 
         // Collect the arguments, since this can generate code and we want to generate it before we emit
         // the call.
@@ -5554,7 +5554,7 @@
             sizeof(CallerFrameAndPC) +
             WTF::roundUpToMultipleOf(stackAlignmentBytes(), 5 * sizeof(EncodedJSValue));
 
-        m_proc.requestCallArgAreaSize(minimumJSCallAreaSize);
+        m_proc.requestCallArgAreaSizeInBytes(minimumJSCallAreaSize);
         
         CodeOrigin codeOrigin = codeOriginDescriptionOfCallSite();
         State* state = &m_ftlState;
@@ -5780,10 +5780,10 @@
         
         LValue jsCallee = lowJSValue(m_graph.varArgChild(node, 0));
         
-        unsigned frameSize = CallFrame::headerSizeInRegisters + numArgs;
-        unsigned alignedFrameSize = WTF::roundUpToMultipleOf(stackAlignmentRegisters(), frameSize);
+        unsigned frameSize = (CallFrame::headerSizeInRegisters + numArgs) * sizeof(EncodedJSValue);
+        unsigned alignedFrameSize = WTF::roundUpToMultipleOf(stackAlignmentBytes(), frameSize);
         
-        m_proc.requestCallArgAreaSize(alignedFrameSize);
+        m_proc.requestCallArgAreaSizeInBytes(alignedFrameSize);
         
         Vector<ConstrainedValue> arguments;
         arguments.append(ConstrainedValue(jsCallee, ValueRep::reg(GPRInfo::regT0)));
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to