diff options
author | Kent Hansen <kent.hansen@nokia.com> | 2010-02-11 10:55:52 (GMT) |
---|---|---|
committer | Kent Hansen <kent.hansen@nokia.com> | 2010-03-10 09:19:43 (GMT) |
commit | d73e11d56a094544f036fac3f6e4483d1104261e (patch) | |
tree | c292c8f53c660dae3f7681dc7acbbe788730a580 /src/3rdparty/javascriptcore/JavaScriptCore/debugger | |
parent | 20e2b87b5194abf7e9f08b7c42c030a57e2d6b28 (diff) | |
download | Qt-d73e11d56a094544f036fac3f6e4483d1104261e.zip Qt-d73e11d56a094544f036fac3f6e4483d1104261e.tar.gz Qt-d73e11d56a094544f036fac3f6e4483d1104261e.tar.bz2 |
Update src/3rdparty/javascriptcore and adapt src/script to the changes
- Update qscriptvalueiterator test to expect length property when
iterating arrays and strings.
- Use EvalExecutable::create() instead of EvalExecutable constructor.
The constructor is private.
- Reimplement getOwnPropertyDescriptor() in all custom script objects.
- Remove all reimplementations of getPropertyAttributes().
It doesn't exist in trunk anymore (getOwnPropertyDescriptor() is used
instead).
- Remove checkDontDelete argument from deleteProperty() reimplementations.
The purpose of this argument was to support deleting properties
with attribute Undeletable from C++. But it was quite an invasive
patch to JavaScriptCore, and it doesn't seem worth it. If this feature
is really crucial it should be re-done upstream.
One of the tests needed to be updated so it's not sensitive to the
C++ undeletability.
- Adapt getOwnPropertyNames() reimplementations to signature change.
- Add missing QScriptObject structure flags, otherwise we don't get all virtual calls.
- Remove our patch for reporting column numbers in the debugger callbacks.
It was just too intrusive. As with the checkDontDelete issue, this should
be redone upstream if it's really important. In 4.7, QScriptEngineAgent
will always report a column number of 1.
Other compilation fixes:
- InternalFunction::name() takes an ExecState* argument, not GlobalData*
- ScopeChain::globalObject is no longer a function but a member variable
- ScopeChainNode constructor takes a GlobalObject argument
- Heap::collect() is called collectAllGarbage()
- JSValue::strictEqual() takes an ExecState* argument
- Debugger::exception() takes a bool hasHandler argument
- Debugger no longer reports column number (we decided to drop that patch from JSC)
- UString doesn't have operator+=(char*)
- Update the autotests to reflect the columnNumber=1 change.
- Add helper class to avoid crashing inside JSC.
Ever since r52856 in WebKit trunk, this is needed. There are probably a lot of
other public API functions that need this guard as well, but I'll add them as they
are discovered.
- Update mkdist-javascriptcore tag, exclude a few more files.
- Set ENABLE_JSC_MULTIPLE_THREADS=0 define on Mac due to r52355 in trunk.
Reviewed-by: Simon Hausmann
Diffstat (limited to 'src/3rdparty/javascriptcore/JavaScriptCore/debugger')
5 files changed, 28 insertions, 25 deletions
diff --git a/src/3rdparty/javascriptcore/JavaScriptCore/debugger/Debugger.cpp b/src/3rdparty/javascriptcore/JavaScriptCore/debugger/Debugger.cpp index db02329..1d2e4fb 100644 --- a/src/3rdparty/javascriptcore/JavaScriptCore/debugger/Debugger.cpp +++ b/src/3rdparty/javascriptcore/JavaScriptCore/debugger/Debugger.cpp @@ -67,8 +67,9 @@ void Debugger::recompileAllJSFunctions(JSGlobalData* globalData) FunctionExecutableSet functionExecutables; SourceProviderMap sourceProviders; - Heap::iterator heapEnd = globalData->heap.primaryHeapEnd(); - for (Heap::iterator it = globalData->heap.primaryHeapBegin(); it != heapEnd; ++it) { + LiveObjectIterator it = globalData->heap.primaryHeapBegin(); + LiveObjectIterator heapEnd = globalData->heap.primaryHeapEnd(); + for ( ; it != heapEnd; ++it) { if (!(*it)->inherits(&JSFunction::info)) continue; @@ -100,12 +101,12 @@ JSValue evaluateInGlobalCallFrame(const UString& script, JSValue& exception, JSG { CallFrame* globalCallFrame = globalObject->globalExec(); - EvalExecutable eval(globalCallFrame, makeSource(script)); - JSObject* error = eval.compile(globalCallFrame, globalCallFrame->scopeChain()); + RefPtr<EvalExecutable> eval = EvalExecutable::create(globalCallFrame, makeSource(script)); + JSObject* error = eval->compile(globalCallFrame, globalCallFrame->scopeChain()); if (error) return error; - return globalObject->globalData()->interpreter->execute(&eval, globalCallFrame, globalObject, globalCallFrame->scopeChain(), &exception); + return globalObject->globalData()->interpreter->execute(eval.get(), globalCallFrame, globalObject, globalCallFrame->scopeChain(), &exception); } } // namespace JSC diff --git a/src/3rdparty/javascriptcore/JavaScriptCore/debugger/Debugger.h b/src/3rdparty/javascriptcore/JavaScriptCore/debugger/Debugger.h index 811818d..3725478 100644 --- a/src/3rdparty/javascriptcore/JavaScriptCore/debugger/Debugger.h +++ b/src/3rdparty/javascriptcore/JavaScriptCore/debugger/Debugger.h @@ -47,8 +47,7 @@ namespace JSC { { UNUSED_PARAM(id); }; - virtual void scriptLoad(QT_PREPEND_NAMESPACE(qint64) id, - const UString &program, + virtual void scriptLoad(QT_PREPEND_NAMESPACE(qint64) id, const UString &program, const UString &fileName, int baseLineNumber) { UNUSED_PARAM(id); @@ -90,14 +89,14 @@ namespace JSC { #endif virtual void sourceParsed(ExecState*, const SourceCode&, int errorLineNumber, const UString& errorMessage) = 0; - virtual void exception(const DebuggerCallFrame&, intptr_t sourceID, int lineNumber) = 0; - virtual void atStatement(const DebuggerCallFrame&, intptr_t sourceID, int lineNumber, int column) = 0; + virtual void exception(const DebuggerCallFrame&, intptr_t sourceID, int lineNumber, bool hasHandler) = 0; + virtual void atStatement(const DebuggerCallFrame&, intptr_t sourceID, int lineNumber) = 0; virtual void callEvent(const DebuggerCallFrame&, intptr_t sourceID, int lineNumber) = 0; virtual void returnEvent(const DebuggerCallFrame&, intptr_t sourceID, int lineNumber) = 0; virtual void willExecuteProgram(const DebuggerCallFrame&, intptr_t sourceID, int lineNumber) = 0; virtual void didExecuteProgram(const DebuggerCallFrame&, intptr_t sourceID, int lineNumber) = 0; - virtual void didReachBreakpoint(const DebuggerCallFrame&, intptr_t sourceID, int lineNumber, int column) = 0; + virtual void didReachBreakpoint(const DebuggerCallFrame&, intptr_t sourceID, int lineNumber) = 0; void recompileAllJSFunctions(JSGlobalData*); diff --git a/src/3rdparty/javascriptcore/JavaScriptCore/debugger/DebuggerActivation.cpp b/src/3rdparty/javascriptcore/JavaScriptCore/debugger/DebuggerActivation.cpp index fa41374..0444d23 100644 --- a/src/3rdparty/javascriptcore/JavaScriptCore/debugger/DebuggerActivation.cpp +++ b/src/3rdparty/javascriptcore/JavaScriptCore/debugger/DebuggerActivation.cpp @@ -66,19 +66,19 @@ void DebuggerActivation::putWithAttributes(ExecState* exec, const Identifier& pr m_activation->putWithAttributes(exec, propertyName, value, attributes); } -bool DebuggerActivation::deleteProperty(ExecState* exec, const Identifier& propertyName, bool checkDontDelete) +bool DebuggerActivation::deleteProperty(ExecState* exec, const Identifier& propertyName) { - return m_activation->deleteProperty(exec, propertyName, checkDontDelete); + return m_activation->deleteProperty(exec, propertyName); } -void DebuggerActivation::getOwnPropertyNames(ExecState* exec, PropertyNameArray& propertyNames, bool includeNonEnumerable) +void DebuggerActivation::getOwnPropertyNames(ExecState* exec, PropertyNameArray& propertyNames, EnumerationMode mode) { - m_activation->getPropertyNames(exec, propertyNames); + m_activation->getPropertyNames(exec, propertyNames, mode); } -bool DebuggerActivation::getPropertyAttributes(JSC::ExecState* exec, const Identifier& propertyName, unsigned& attributes) const +bool DebuggerActivation::getOwnPropertyDescriptor(ExecState* exec, const Identifier& propertyName, PropertyDescriptor& descriptor) { - return m_activation->getPropertyAttributes(exec, propertyName, attributes); + return m_activation->getOwnPropertyDescriptor(exec, propertyName, descriptor); } void DebuggerActivation::defineGetter(ExecState* exec, const Identifier& propertyName, JSObject* getterFunction, unsigned attributes) diff --git a/src/3rdparty/javascriptcore/JavaScriptCore/debugger/DebuggerActivation.h b/src/3rdparty/javascriptcore/JavaScriptCore/debugger/DebuggerActivation.h index 9bb1acd..354fcb8 100644 --- a/src/3rdparty/javascriptcore/JavaScriptCore/debugger/DebuggerActivation.h +++ b/src/3rdparty/javascriptcore/JavaScriptCore/debugger/DebuggerActivation.h @@ -41,9 +41,9 @@ namespace JSC { virtual bool getOwnPropertySlot(ExecState*, const Identifier& propertyName, PropertySlot&); virtual void put(ExecState*, const Identifier& propertyName, JSValue, PutPropertySlot&); virtual void putWithAttributes(ExecState*, const Identifier& propertyName, JSValue, unsigned attributes); - virtual bool deleteProperty(ExecState*, const Identifier& propertyName, bool checkDontDelete = true); - virtual void getOwnPropertyNames(ExecState*, PropertyNameArray&, bool includeNonEnumerable = false); - virtual bool getPropertyAttributes(ExecState*, const Identifier& propertyName, unsigned& attributes) const; + virtual bool deleteProperty(ExecState*, const Identifier& propertyName); + virtual void getOwnPropertyNames(ExecState*, PropertyNameArray&, EnumerationMode mode = ExcludeDontEnumProperties); + virtual bool getOwnPropertyDescriptor(ExecState*, const Identifier&, PropertyDescriptor&); virtual void defineGetter(ExecState*, const Identifier& propertyName, JSObject* getterFunction, unsigned attributes); virtual void defineSetter(ExecState*, const Identifier& propertyName, JSObject* setterFunction, unsigned attributes); virtual JSValue lookupGetter(ExecState*, const Identifier& propertyName); @@ -51,9 +51,12 @@ namespace JSC { static PassRefPtr<Structure> createStructure(JSValue prototype) { - return Structure::create(prototype, TypeInfo(ObjectType, HasDefaultGetPropertyNames)); + return Structure::create(prototype, TypeInfo(ObjectType, StructureFlags)); } + protected: + static const unsigned StructureFlags = OverridesGetOwnPropertySlot | OverridesMarkChildren | JSObject::StructureFlags; + private: JSActivation* m_activation; }; diff --git a/src/3rdparty/javascriptcore/JavaScriptCore/debugger/DebuggerCallFrame.cpp b/src/3rdparty/javascriptcore/JavaScriptCore/debugger/DebuggerCallFrame.cpp index 88b14e6..c6b4223 100644 --- a/src/3rdparty/javascriptcore/JavaScriptCore/debugger/DebuggerCallFrame.cpp +++ b/src/3rdparty/javascriptcore/JavaScriptCore/debugger/DebuggerCallFrame.cpp @@ -44,7 +44,7 @@ const UString* DebuggerCallFrame::functionName() const JSFunction* function = asFunction(m_callFrame->callee()); if (!function) return 0; - return &function->name(&m_callFrame->globalData()); + return &function->name(m_callFrame); } UString DebuggerCallFrame::calculatedFunctionName() const @@ -55,7 +55,7 @@ UString DebuggerCallFrame::calculatedFunctionName() const JSFunction* function = asFunction(m_callFrame->callee()); if (!function) return 0; - return function->calculatedDisplayName(&m_callFrame->globalData()); + return function->calculatedDisplayName(m_callFrame); } DebuggerCallFrame::Type DebuggerCallFrame::type() const @@ -79,12 +79,12 @@ JSValue DebuggerCallFrame::evaluate(const UString& script, JSValue& exception) c if (!m_callFrame->codeBlock()) return JSValue(); - EvalExecutable eval(m_callFrame, makeSource(script)); - JSObject* error = eval.compile(m_callFrame, m_callFrame->scopeChain()); + RefPtr<EvalExecutable> eval = EvalExecutable::create(m_callFrame, makeSource(script)); + JSObject* error = eval->compile(m_callFrame, m_callFrame->scopeChain()); if (error) return error; - return m_callFrame->scopeChain()->globalData->interpreter->execute(&eval, m_callFrame, thisObject(), m_callFrame->scopeChain(), &exception); + return m_callFrame->scopeChain()->globalData->interpreter->execute(eval.get(), m_callFrame, thisObject(), m_callFrame->scopeChain(), &exception); } } // namespace JSC |