Bug 158798 - Moved key function of JSC::StringSourceProvider to JSC library.
Summary: Moved key function of JSC::StringSourceProvider to JSC library.
Status: NEW
Alias: None
Product: WebKit
Classification: Unclassified
Component: JavaScriptCore (show other bugs)
Version: WebKit Local Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Nobody
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2016-06-15 10:38 PDT by Konstantin Tokarev
Modified: 2016-06-16 04:52 PDT (History)
5 users (show)

See Also:


Attachments
Patch (1.91 KB, patch)
2016-06-15 10:40 PDT, Konstantin Tokarev
no flags Details | Formatted Diff | Diff
Patch (1.91 KB, patch)
2016-06-15 10:48 PDT, Konstantin Tokarev
mark.lam: review-
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Konstantin Tokarev 2016-06-15 10:38:11 PDT
This change allows to compile JSC with disabled RTTI, and use it in code which is compiled with RTTI enabled.
Comment 1 Konstantin Tokarev 2016-06-15 10:40:01 PDT
Created attachment 281371 [details]
Patch
Comment 2 Konstantin Tokarev 2016-06-15 10:48:17 PDT
Created attachment 281373 [details]
Patch
Comment 3 Mark Lam 2016-06-15 10:49:10 PDT
Comment on attachment 281373 [details]
Patch

r=me if the EWS bots are happy.
Comment 4 Mark Lam 2016-06-15 16:15:42 PDT
Comment on attachment 281373 [details]
Patch

Bots are not happy.
Comment 5 Mark Lam 2016-06-15 17:57:32 PDT
The bots are complaining about:
Undefined symbols for architecture i386:
  "vtable for JSC::StringSourceProvider", referenced from:

I think your patch is incorrect.  What you want is to move the StringSourceProvider constructor to the cpp file, and make that JS_EXPORT_PRIVATE.  Then, you won't need to export the vtable.  You also don't need to override the destructor.
Comment 6 Konstantin Tokarev 2016-06-16 04:52:24 PDT
Intention of this patch was to move vtable of JSC::StringSourceProvider into JSC library/framework, as opposed to generation of vtable in user code as it's done now. Itanium C++ ABI says:

"The virtual table for a class is emitted in the same object containing the definition of its key function, i.e. the first non-pure virtual function that is not inline at the point of class definition. If there is no key function, it is emitted everywhere used."

So, making first virtual function (in this case, dtor) non-inline should move vtable definition into the library (and I believe this is the good thing on its own). Patch in its current form works as expected on Linux and Windows.

I'll investigate it further.