Permalink
Show file tree
Hide file tree
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
[Qt] REGRESSION(r125428): fast/profiler/nested-start-and-stop-profile…
…r.html fails https://bugs.webkit.org/show_bug.cgi?id=93897 Reviewed by Kenneth Rohde Christiansen. Source/WebCore: Before r125428 run-time methods (wrapped signals, slots or invokable functions) were subclasses of JSInternalFunction and therefore real function objects in the JavaScript sense. r125428 changed them to be just callable objects, but they did not have Function.prototype as prototype anymore for example nor was their name correct (resulting in a layout test failure). This patch changes run-time methods back to being real function objects that have a correct name and have Function.prototype in their prototype change The objects returned by JSObjectMakeFunctionWithCallbackInjected are light-weight internal function objects that do not support JSObject{Set/Get}Private. Therefore we inject our own prototype right before the Function.prototype prototype, which uses private data to store a pointer to our C++ QtRuntimeMethod object. This complicates the retrieval of the pointer to that instance slightly, which is why this patch introduces the toRuntimeMethod convenience function that looks up our prototype first and does a check for type-safety. At the same time the patch removes the length properties from the run-time method itself as well as connect/disconnect. The length property on a function signifies the number of arguments, but in all three cases that number is actually variable, because of overloading. That is why we choose not to expose it in the first place. In QtInstance we cache the JS wrapper objects for QtRuntimeMethod in a JSWeakObjectMap. JSWeakObjectMap requires the stored objects to be either the result of JSObjectMake or the global object of a context ref (AFAICS), which is ensured using an ASSERT. Objects created via JSObjectMakeFunctionWithCalllback do not fall into the required category, cause a failing assertion and can therefore not be stored in the weak object map. Consequently this patch removes the use of JSWeakObjectMap again and goes back to the old way of using the internal Weak<> API, for the time being. In a future patch the storage will be simplified to not require the use of a weak object map cache for the run-time methods anymore. * bridge/qt/qt_instance.cpp: Remove unused WeakMap code. * bridge/qt/qt_instance.h: Remove method cache. (QtInstance): * bridge/qt/qt_runtime.cpp: (JSC::Bindings::prototypeForSignalsAndSlots): (JSC::Bindings::QtRuntimeMethod::call): (JSC::Bindings::QtRuntimeMethod::jsObjectRef): (JSC::Bindings::QtRuntimeMethod::toRuntimeMethod): (Bindings): (JSC::Bindings::QtRuntimeMethod::connectOrDisconnect): * bridge/qt/qt_runtime.h: (QtRuntimeMethod): Remove unused member variables. Source/WebKit/qt: Fixed some test expectations. * tests/qobjectbridge/tst_qobjectbridge.cpp: (tst_QObjectBridge::objectDeleted): Since runtime methods are real function objects again, we can go back to testing Function.prototype.call, as it was done before r125428. (tst_QObjectBridge::introspectQtMethods_data): Removed tests for the length property. (tst_QObjectBridge::introspectQtMethods): Changed test expectation of the properties of run-time methods back to being non-configurable, as before r125428. LayoutTests: * platform/qt/Skipped: Unskip test that is now passing. Canonical link: https://commits.webkit.org/112519@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@126287 268f45cc-cd09-0410-ab3c-d52691b4dbfc
- Loading branch information
Showing
9 changed files
with
134 additions
and
112 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters