Title: [114803] trunk/Source/_javascript_Core
Revision
114803
Author
oli...@apple.com
Date
2012-04-20 17:12:04 -0700 (Fri, 20 Apr 2012)

Log Message

Add an ability to find the extent of a callframe
https://bugs.webkit.org/show_bug.cgi?id=84513

Reviewed by Filip Pizlo.

Add a function to get the extent of a callframe and
use that function for a new assertion to make sure the
RegisterFile makes sense using that information.

* interpreter/CallFrame.cpp:
(JSC::CallFrame::frameExtentInternal):
(JSC):
* interpreter/CallFrame.h:
(JSC::ExecState::frameExtent):
(ExecState):
* interpreter/Interpreter.cpp:
(JSC::Interpreter::executeCall):

Modified Paths

Diff

Modified: trunk/Source/_javascript_Core/ChangeLog (114802 => 114803)


--- trunk/Source/_javascript_Core/ChangeLog	2012-04-21 00:07:13 UTC (rev 114802)
+++ trunk/Source/_javascript_Core/ChangeLog	2012-04-21 00:12:04 UTC (rev 114803)
@@ -1,3 +1,23 @@
+2012-04-20  Oliver Hunt  <oli...@apple.com>
+
+        Add an ability to find the extent of a callframe
+        https://bugs.webkit.org/show_bug.cgi?id=84513
+
+        Reviewed by Filip Pizlo.
+
+        Add a function to get the extent of a callframe and
+        use that function for a new assertion to make sure the
+        RegisterFile makes sense using that information.
+
+        * interpreter/CallFrame.cpp:
+        (JSC::CallFrame::frameExtentInternal):
+        (JSC):
+        * interpreter/CallFrame.h:
+        (JSC::ExecState::frameExtent):
+        (ExecState):
+        * interpreter/Interpreter.cpp:
+        (JSC::Interpreter::executeCall):
+
 2012-04-20  Benjamin Poulain  <bpoul...@apple.com>
 
         Inline the JSArray constructor

Modified: trunk/Source/_javascript_Core/interpreter/CallFrame.cpp (114802 => 114803)


--- trunk/Source/_javascript_Core/interpreter/CallFrame.cpp	2012-04-21 00:07:13 UTC (rev 114802)
+++ trunk/Source/_javascript_Core/interpreter/CallFrame.cpp	2012-04-21 00:12:04 UTC (rev 114803)
@@ -183,4 +183,11 @@
 }
 #endif
 
+Register* CallFrame::frameExtentInternal()
+{
+    CodeBlock* codeBlock = this->codeBlock();
+    ASSERT(codeBlock);
+    return registers() + codeBlock->m_numCalleeRegisters;
 }
+
+}

Modified: trunk/Source/_javascript_Core/interpreter/CallFrame.h (114802 => 114803)


--- trunk/Source/_javascript_Core/interpreter/CallFrame.h	2012-04-21 00:07:13 UTC (rev 114802)
+++ trunk/Source/_javascript_Core/interpreter/CallFrame.h	2012-04-21 00:12:04 UTC (rev 114803)
@@ -125,6 +125,15 @@
         }
 #endif
 
+        Register* frameExtent()
+        {
+            if (!codeBlock())
+                return registers();
+            return frameExtentInternal();
+        }
+    
+        Register* frameExtentInternal();
+    
 #if ENABLE(DFG_JIT)
         InlineCallFrame* inlineCallFrame() const { return this[RegisterFile::ReturnPC].asInlineCallFrame(); }
         unsigned codeOriginIndexForDFG() const { return this[RegisterFile::ArgumentCount].tag(); }

Modified: trunk/Source/_javascript_Core/interpreter/Interpreter.cpp (114802 => 114803)


--- trunk/Source/_javascript_Core/interpreter/Interpreter.cpp	2012-04-21 00:07:13 UTC (rev 114802)
+++ trunk/Source/_javascript_Core/interpreter/Interpreter.cpp	2012-04-21 00:12:04 UTC (rev 114803)
@@ -1252,6 +1252,8 @@
         return checkedReturn(throwStackOverflowError(callFrame));
 
     Register* oldEnd = m_registerFile.end();
+    ASSERT(callFrame->frameExtent() <= oldEnd || callFrame == callFrame->scopeChain()->globalObject->globalExec());
+    ASSERT(callFrame == callFrame->globalData().topCallFrame || callFrame == callFrame->scopeChain()->globalObject->globalExec());
     int argCount = 1 + args.size(); // implicit "this" parameter
     size_t registerOffset = argCount + RegisterFile::CallFrameHeaderSize;
 
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
http://lists.webkit.org/mailman/listinfo.cgi/webkit-changes

Reply via email to