]> git.saurik.com Git - apple/javascriptcore.git/blobdiff - interpreter/CallFrameClosure.h
JavaScriptCore-1097.3.3.tar.gz
[apple/javascriptcore.git] / interpreter / CallFrameClosure.h
index a301060d26b56d3aefaa3cad8e378a0c085013c0..2a841511a9d40f7a7d422f2f22685efbf1003606 100644 (file)
@@ -36,22 +36,24 @@ struct CallFrameClosure {
     JSGlobalData* globalData;
     Register* oldEnd;
     ScopeChainNode* scopeChain;
-    int expectedParams;
-    int providedParams;
+    int parameterCountIncludingThis;
+    int argumentCountIncludingThis;
     
-    void setArgument(int arg, JSValue value)
+    void setThis(JSValue value)
     {
-        if (arg < expectedParams)
-            newCallFrame[arg - RegisterFile::CallFrameHeaderSize - expectedParams] = value;
-        else
-            newCallFrame[arg - RegisterFile::CallFrameHeaderSize - expectedParams - providedParams] = value;
+        newCallFrame->setThisValue(value);
     }
+
+    void setArgument(int argument, JSValue value)
+    {
+        newCallFrame->setArgument(argument, value);
+    }
+
     void resetCallFrame()
     {
         newCallFrame->setScopeChain(scopeChain);
-        newCallFrame->setCalleeArguments(JSValue());
-        for (int i = providedParams; i < expectedParams; ++i)
-            newCallFrame[i - RegisterFile::CallFrameHeaderSize - expectedParams] = jsUndefined();
+        for (int i = argumentCountIncludingThis; i < parameterCountIncludingThis; ++i)
+            newCallFrame->setArgument(i, jsUndefined());
     }
 };