]> git.saurik.com Git - apple/javascriptcore.git/blobdiff - interpreter/CachedCall.h
JavaScriptCore-1097.3.tar.gz
[apple/javascriptcore.git] / interpreter / CachedCall.h
index eb48a03d67a55ac1ee249fc251b244c2ba245e5f..ea55d90e580fbb65623726baf02575b8a09b98b8 100644 (file)
 #include "Interpreter.h"
 
 namespace JSC {
-    class CachedCall : public Noncopyable {
+    class CachedCall {
+        WTF_MAKE_NONCOPYABLE(CachedCall); WTF_MAKE_FAST_ALLOCATED;
     public:
-        CachedCall(CallFrame* callFrame, JSFunction* function, int argCount, JSValue* exception)
+        CachedCall(CallFrame* callFrame, JSFunction* function, int argumentCount)
             : m_valid(false)
             , m_interpreter(callFrame->interpreter())
-            , m_exception(exception)
-            , m_globalObjectScope(callFrame, function->scope().globalObject())
+            , m_globalObjectScope(callFrame->globalData(), function->scope()->globalObject.get())
         {
             ASSERT(!function->isHostFunction());
-            m_closure = m_interpreter->prepareForRepeatCall(function->jsExecutable(), callFrame, function, argCount, function->scope().node(), exception);
-            m_valid = !*exception;
+            m_closure = m_interpreter->prepareForRepeatCall(function->jsExecutable(), callFrame, function, argumentCount + 1, function->scope());
+            m_valid = !callFrame->hadException();
         }
         
         JSValue call()
         { 
             ASSERT(m_valid);
-            return m_interpreter->execute(m_closure, m_exception);
+            return m_interpreter->execute(m_closure);
         }
-        void setThis(JSValue v) { m_closure.setArgument(0, v); }
-        void setArgument(int n, JSValue v) { m_closure.setArgument(n + 1, v); }
+        void setThis(JSValue v) { m_closure.setThis(v); }
+        void setArgument(int n, JSValue v) { m_closure.setArgument(n, v); }
 
         CallFrame* newCallFrame(ExecState* exec)
         {
@@ -69,7 +69,6 @@ namespace JSC {
     private:
         bool m_valid;
         Interpreter* m_interpreter;
-        JSValue* m_exception;
         DynamicGlobalObjectScope m_globalObjectScope;
         CallFrameClosure m_closure;
     };