Bug 60171 - [qt] Add function to check if QtWebKit was compiled with the JSC JIT
Summary: [qt] Add function to check if QtWebKit was compiled with the JSC JIT
Status: RESOLVED INVALID
Alias: None
Product: WebKit
Classification: Unclassified
Component: New Bugs (show other bugs)
Version: 528+ (Nightly build)
Hardware: Other OS X 10.5
: P2 Normal
Assignee: Holger Freyther
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-05-04 08:25 PDT by Holger Freyther
Modified: 2014-02-03 03:17 PST (History)
5 users (show)

See Also:


Attachments
Patch (1.95 KB, patch)
2011-05-04 08:44 PDT, Holger Freyther
eric: review-
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Holger Freyther 2011-05-04 08:25:44 PDT
[qt] Add function to check if QtWebKit was compiled with the JSC JIT
Comment 1 Holger Freyther 2011-05-04 08:44:14 PDT
Created attachment 92249 [details]
Patch
Comment 2 Laszlo Gombos 2011-05-07 06:18:12 PDT
JIT is a property of the ScriptEngine. Perhaps it make more sense to expose this functionality in the QtScript API.

Can you share key use-cases you had in mind ?
Comment 3 Holger Freyther 2011-05-07 06:34:14 PDT
(In reply to comment #2)
> JIT is a property of the ScriptEngine. Perhaps it make more sense to expose this functionality in the QtScript API.
> 
> Can you share key use-cases you had in mind ?

Good point. The use case is mostly to verify the Qt buildsystem, mostly the 'auto detection'. There is one regression in t 4.6 to 4.7 in regard to enabling the JIT by default.
Comment 4 Eric Seidel (no email) 2011-05-08 12:50:29 PDT
Why should any callers care what the underlying interpreter uses?
Comment 5 Holger Freyther 2011-05-08 13:33:17 PDT
(In reply to comment #4)
> Why should any callers care what the underlying interpreter uses?

Constructed and bad example:
If one would like to disable executable memory allocations.. one could check if the WebKit will need it and not disable it.

The real and boring motivation:
WebKit gets copied into src/3rdparty/webkit in Qt. When configuring Qt (and webkit as part of it) one has two javascript options:

    -no-javascript-jit . Do not build the JavaScriptCore JIT compiler.
 +  -javascript-jit .... Build the JavaScriptCore JIT compiler.

The default option will leave enabling the JIT to WebKit (wtf/Platform.h) and there was a 'regression' (Qt 4.6 had it enabled for MIPS, Qt 4.7 'accidently' disabled). So having an option to see the configuration of the compiled QtWebKit can be helpful to write a unit test (so maybe I should return a String with all ENABLEs and FEATUREs or such). So the goal right now is to have a test that the default compilation of Qt has the JIT enabled for x86, x86-64, ARM and MIPS.

The underlying assumption is that on a release (a stable branch) that a JIT will stay faster than the interpreter. For the development of trunk I am going to host a MIPS buildbot and run performance tests (they should spot a change in the default configuration as well).


So it would be interesting if you think it is worth of having 'introspection' on the build configuration and if yes have an opinion on how to achieve it
Comment 6 Alexis Menard (darktears) 2011-05-23 14:33:36 PDT
(In reply to comment #2)
> JIT is a property of the ScriptEngine. Perhaps it make more sense to expose this functionality in the QtScript API.
> 
> Can you share key use-cases you had in mind ?

I have to agree with that.
Comment 7 Caio Marcelo de Oliveira Filho 2011-05-25 10:48:28 PDT
(In reply to comment #5)
> The default option will leave enabling the JIT to WebKit (wtf/Platform.h) and there was a 'regression' (Qt 4.6 had it enabled for MIPS, Qt 4.7 'accidently' disabled). So having an option to see the configuration of the compiled QtWebKit can be helpful to write a unit test (so maybe I should return a String with all ENABLEs and FEATUREs or such). So the goal right now is to have a test that the default compilation of Qt has the JIT enabled for x86, x86-64, ARM and MIPS.

Holger, this looks like could be solved at build system level. The build system could generate a file with a function (not public API) that returns all the build parameters used in compilation so you can check them in your tests. What do you think?

I don't think is good to solve the issue separatedly just for the JIT case.
Comment 8 Holger Freyther 2011-05-25 11:00:06 PDT
Sure, being able to do /lib/ld-linux.so.2 /usr/lib/libQtCore.so.4.7.2 for QtWebKit would be nice. But then it would be tied to ELF. The other basic thing here is, I want to ask the artefact and not what the buildsystem thinks about it (e.g. I might only have the artefact).
Comment 9 Caio Marcelo de Oliveira Filho 2011-05-25 12:38:03 PDT
(In reply to comment #8)
> Sure, being able to do /lib/ld-linux.so.2 /usr/lib/libQtCore.so.4.7.2 for QtWebKit would be nice. But then it would be tied to ELF. The other basic thing here is, I want to ask the artefact and not what the buildsystem thinks about it (e.g. I might only have the artefact).

Got it. Note that by "not public API", I meant marking it as \internal -- since it's not something a typical user of QtWebKit is expected to use. Seems to be more about verification of the artifact, at least for now.

I was suggesting (inspired by your comment #5) that the build system could produce the function for you that return all the build parameters relevant. Of course just the configure line will not cut in your case.

What do you think about something like "bool qtWebKitHasFeature(const char*)" instead? I just think is strange to have a function only for this specific feature. What if later we need to test the artifact for other features too?
Comment 10 Benjamin Poulain 2011-05-30 15:01:59 PDT
I have to say, like the other, I don't think it is a good idea to expose that.

I can hardly see what kind of decision would be taken at runtime based on the function (apart from bugs workaround).
Comment 11 Eric Seidel (no email) 2011-06-02 08:05:44 PDT
Comment on attachment 92249 [details]
Patch

The consensus of the bug seems to be negative.
Comment 12 Jocelyn Turcotte 2014-02-03 03:17:44 PST
=== Bulk closing of Qt bugs ===

If you believe that this bug report is still relevant for a non-Qt port of webkit.org, please re-open it and remove [Qt] from the summary.

If you believe that this is still an important QtWebKit bug, please fill a new report at https://bugreports.qt-project.org and add a link to this issue. See http://qt-project.org/wiki/ReportingBugsInQt for additional guidelines.