Bug 187505 - Add WTF_MAKE_FAST_ALLOCATED for lots of ScriptWrappable-derived classes
Summary: Add WTF_MAKE_FAST_ALLOCATED for lots of ScriptWrappable-derived classes
Status: NEW
Alias: None
Product: WebKit
Classification: Unclassified
Component: New Bugs (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Simon Fraser (smfr)
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2018-07-09 21:53 PDT by Simon Fraser (smfr)
Modified: 2018-07-11 19:30 PDT (History)
4 users (show)

See Also:


Attachments
Patch (30.28 KB, patch)
2018-07-09 21:54 PDT, Simon Fraser (smfr)
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Simon Fraser (smfr) 2018-07-09 21:53:06 PDT
Add WTF_MAKE_FAST_ALLOCATED for lots of ScriptWrappable-derived classes
Comment 1 Simon Fraser (smfr) 2018-07-09 21:54:27 PDT
Created attachment 344663 [details]
Patch
Comment 2 Chris Dumez 2018-07-09 22:34:16 PDT
Why don’t We add it to ScriptWrappable class instead?
Comment 3 Simon Fraser (smfr) 2018-07-09 22:59:39 PDT
I'm fuzzy on how it behaves with multiple inheritance.
Comment 4 Yusuke Suzuki 2018-07-10 02:39:13 PDT
(In reply to Simon Fraser (smfr) from comment #3)
> I'm fuzzy on how it behaves with multiple inheritance.

It should work since all the implementation have the same code. The allocation size `size_t` will be passed by the C++ runtime, which is calculated at the callsite of `new`. So, multiple inheritance should work.
Comment 5 Fujii Hironori 2018-07-11 19:24:26 PDT
(In reply to Yusuke Suzuki from comment #4)
> It should work since all the implementation have the same code. The
> allocation size `size_t` will be passed by the C++ runtime, which is
> calculated at the callsite of `new`. So, multiple inheritance should work.

Is this right?
I get "error: request for member 'operator new' is ambiguous".
https://godbolt.org/g/Zx38fe
Comment 6 Fujii Hironori 2018-07-11 19:30:57 PDT
It can be solved by adding "using Base1::operator new;".
https://godbolt.org/g/u6SEQC