]> git.saurik.com Git - apple/javascriptcore.git/blobdiff - debugger/DebuggerCallFrame.cpp
JavaScriptCore-1218.0.1.tar.gz
[apple/javascriptcore.git] / debugger / DebuggerCallFrame.cpp
index 08fba4a6b4cb8a00991d55749907f5e2f8076155..a5d045cb90631dab6edb74241247e338a5ab590e 100644 (file)
 #include "JSFunction.h"
 #include "CodeBlock.h"
 #include "Interpreter.h"
+#include "Operations.h"
 #include "Parser.h"
 
 namespace JSC {
 
-const UString* DebuggerCallFrame::functionName() const
+String DebuggerCallFrame::functionName() const
 {
     if (!m_callFrame->codeBlock())
-        return 0;
+        return String();
 
     if (!m_callFrame->callee())
-        return 0;
+        return String();
 
     JSObject* function = m_callFrame->callee();
     if (!function || !function->inherits(&JSFunction::s_info))
-        return 0;
-    return &asFunction(function)->name(m_callFrame);
+        return String();
+    return jsCast<JSFunction*>(function)->name(m_callFrame);
 }
     
-UString DebuggerCallFrame::calculatedFunctionName() const
+String DebuggerCallFrame::calculatedFunctionName() const
 {
     if (!m_callFrame->codeBlock())
-        return UString();
+        return String();
 
     JSObject* function = m_callFrame->callee();
-    if (!function || !function->inherits(&JSFunction::s_info))
-        return UString();
 
-    return asFunction(function)->calculatedDisplayName(m_callFrame);
+    if (!function)
+        return String();
+
+    return getCalculatedDisplayName(m_callFrame, function);
 }
 
 DebuggerCallFrame::Type DebuggerCallFrame::type() const
@@ -83,22 +85,22 @@ JSObject* DebuggerCallFrame::thisObject() const
     return asObject(thisValue);
 }
 
-JSValue DebuggerCallFrame::evaluate(const UString& script, JSValue& exception) const
+JSValue DebuggerCallFrame::evaluate(const String& script, JSValue& exception) const
 {
     if (!m_callFrame->codeBlock())
         return JSValue();
     
-    JSGlobalData& globalData = m_callFrame->globalData();
-    EvalExecutable* eval = EvalExecutable::create(m_callFrame, makeSource(script), m_callFrame->codeBlock()->isStrictMode());
-    if (globalData.exception) {
-        exception = globalData.exception;
-        globalData.exception = JSValue();
+    VM& vm = m_callFrame->vm();
+    EvalExecutable* eval = EvalExecutable::create(m_callFrame, m_callFrame->codeBlock()->unlinkedCodeBlock()->codeCacheForEval(), makeSource(script), m_callFrame->codeBlock()->isStrictMode());
+    if (vm.exception) {
+        exception = vm.exception;
+        vm.exception = JSValue();
     }
 
-    JSValue result = globalData.interpreter->execute(eval, m_callFrame, thisObject(), m_callFrame->scopeChain());
-    if (globalData.exception) {
-        exception = globalData.exception;
-        globalData.exception = JSValue();
+    JSValue result = vm.interpreter->execute(eval, m_callFrame, thisObject(), m_callFrame->scope());
+    if (vm.exception) {
+        exception = vm.exception;
+        vm.exception = JSValue();
     }
     ASSERT(result);
     return result;