diff options
author | Steve Block <steveblock@google.com> | 2011-05-25 19:08:45 +0100 |
---|---|---|
committer | Steve Block <steveblock@google.com> | 2011-06-08 13:51:31 +0100 |
commit | 2bde8e466a4451c7319e3a072d118917957d6554 (patch) | |
tree | 28f4a1b869a513e565c7760d0e6a06e7cf1fe95a /Source/JavaScriptCore/debugger | |
parent | 6939c99b71d9372d14a0c74a772108052e8c48c8 (diff) | |
download | external_webkit-2bde8e466a4451c7319e3a072d118917957d6554.zip external_webkit-2bde8e466a4451c7319e3a072d118917957d6554.tar.gz external_webkit-2bde8e466a4451c7319e3a072d118917957d6554.tar.bz2 |
Merge WebKit at r82507: Initial merge by git
Change-Id: I60ce9d780725b58b45e54165733a8ffee23b683e
Diffstat (limited to 'Source/JavaScriptCore/debugger')
4 files changed, 28 insertions, 19 deletions
diff --git a/Source/JavaScriptCore/debugger/Debugger.cpp b/Source/JavaScriptCore/debugger/Debugger.cpp index b999446..64f6002 100644 --- a/Source/JavaScriptCore/debugger/Debugger.cpp +++ b/Source/JavaScriptCore/debugger/Debugger.cpp @@ -29,7 +29,9 @@ #include "Parser.h" #include "Protect.h" -namespace JSC { +namespace { + +using namespace JSC; class Recompiler { public: @@ -82,6 +84,10 @@ inline void Recompiler::operator()(JSCell* cell) m_sourceProviders.add(executable->source().provider(), exec); } +} // namespace + +namespace JSC { + Debugger::~Debugger() { HashSet<JSGlobalObject*>::iterator end = m_globalObjects.end(); @@ -118,16 +124,18 @@ void Debugger::recompileAllJSFunctions(JSGlobalData* globalData) JSValue evaluateInGlobalCallFrame(const UString& script, JSValue& exception, JSGlobalObject* globalObject) { CallFrame* globalCallFrame = globalObject->globalExec(); + JSGlobalData& globalData = globalObject->globalData(); - RefPtr<EvalExecutable> eval = EvalExecutable::create(globalCallFrame, makeSource(script), false); - JSObject* error = eval->compile(globalCallFrame, globalCallFrame->scopeChain()); - if (error) - return error; + EvalExecutable* eval = EvalExecutable::create(globalCallFrame, makeSource(script), false); + if (!eval) { + exception = globalData.exception; + globalData.exception = JSValue(); + return exception; + } - JSGlobalData& globalData = globalObject->globalData(); - JSValue result = globalData.interpreter->execute(eval.get(), globalCallFrame, globalObject, globalCallFrame->scopeChain()); + JSValue result = globalData.interpreter->execute(eval, globalCallFrame, globalObject, globalCallFrame->scopeChain()); if (globalData.exception) { - exception = globalData.exception.get(); + exception = globalData.exception; globalData.exception = JSValue(); } ASSERT(result); diff --git a/Source/JavaScriptCore/debugger/DebuggerActivation.cpp b/Source/JavaScriptCore/debugger/DebuggerActivation.cpp index 62a2e54..50ba746 100644 --- a/Source/JavaScriptCore/debugger/DebuggerActivation.cpp +++ b/Source/JavaScriptCore/debugger/DebuggerActivation.cpp @@ -31,7 +31,7 @@ namespace JSC { DebuggerActivation::DebuggerActivation(JSGlobalData& globalData, JSObject* activation) - : JSNonFinalObject(DebuggerActivation::createStructure(jsNull())) + : JSNonFinalObject(DebuggerActivation::createStructure(globalData, jsNull())) { ASSERT(activation); ASSERT(activation->isActivationObject()); diff --git a/Source/JavaScriptCore/debugger/DebuggerActivation.h b/Source/JavaScriptCore/debugger/DebuggerActivation.h index 01a4907..f22d2ff 100644 --- a/Source/JavaScriptCore/debugger/DebuggerActivation.h +++ b/Source/JavaScriptCore/debugger/DebuggerActivation.h @@ -49,9 +49,9 @@ namespace JSC { virtual JSValue lookupGetter(ExecState*, const Identifier& propertyName); virtual JSValue lookupSetter(ExecState*, const Identifier& propertyName); - static PassRefPtr<Structure> createStructure(JSValue prototype) + static PassRefPtr<Structure> createStructure(JSGlobalData& globalData, JSValue prototype) { - return Structure::create(prototype, TypeInfo(ObjectType, StructureFlags), AnonymousSlotCount, &s_info); + return Structure::create(globalData, prototype, TypeInfo(ObjectType, StructureFlags), AnonymousSlotCount, &s_info); } protected: diff --git a/Source/JavaScriptCore/debugger/DebuggerCallFrame.cpp b/Source/JavaScriptCore/debugger/DebuggerCallFrame.cpp index d778bd5..08fba4a 100644 --- a/Source/JavaScriptCore/debugger/DebuggerCallFrame.cpp +++ b/Source/JavaScriptCore/debugger/DebuggerCallFrame.cpp @@ -87,16 +87,17 @@ JSValue DebuggerCallFrame::evaluate(const UString& script, JSValue& exception) c { if (!m_callFrame->codeBlock()) return JSValue(); - - RefPtr<EvalExecutable> eval = EvalExecutable::create(m_callFrame, makeSource(script), m_callFrame->codeBlock()->isStrictMode()); - JSObject* error = eval->compile(m_callFrame, m_callFrame->scopeChain()); - if (error) - return error; - + JSGlobalData& globalData = m_callFrame->globalData(); - JSValue result = globalData.interpreter->execute(eval.get(), m_callFrame, thisObject(), m_callFrame->scopeChain()); + EvalExecutable* eval = EvalExecutable::create(m_callFrame, makeSource(script), m_callFrame->codeBlock()->isStrictMode()); + if (globalData.exception) { + exception = globalData.exception; + globalData.exception = JSValue(); + } + + JSValue result = globalData.interpreter->execute(eval, m_callFrame, thisObject(), m_callFrame->scopeChain()); if (globalData.exception) { - exception = globalData.exception.get(); + exception = globalData.exception; globalData.exception = JSValue(); } ASSERT(result); |