Bug 190317 - performJITMemcpy() should handle the case when the executable allocator is not initialized yet.
Summary: performJITMemcpy() should handle the case when the executable allocator is no...
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: JavaScriptCore (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Mark Lam
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2018-10-05 11:14 PDT by Mark Lam
Modified: 2018-10-05 12:15 PDT (History)
8 users (show)

See Also:


Attachments
proposed patch. (3.13 KB, patch)
2018-10-05 11:18 PDT, Mark Lam
saam: review+
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Mark Lam 2018-10-05 11:14:51 PDT
When SeparatedWXHeaps is in use, jitWriteThunkGenerator() will call performJITMemcpy() to copy memory before the JIT fixed memory pool is initialize.  Before r236864, performJITMemcpy() would just do a memcpy in that case.  We need to restore the equivalent behavior.

<rdar://problem/45039398>
Comment 1 Mark Lam 2018-10-05 11:18:38 PDT
Created attachment 351683 [details]
proposed patch.
Comment 2 Saam Barati 2018-10-05 11:21:56 PDT
Comment on attachment 351683 [details]
proposed patch.

View in context: https://bugs.webkit.org/attachment.cgi?id=351683&action=review

> Source/JavaScriptCore/ChangeLog:10
> +        to copy memory before the JIT fixed memory pool is initialize.  Before r236864,

s/initialize/initialized

> Source/JavaScriptCore/ChangeLog:11
> +        performJITMemcpy() would just do a memcpy in that case.  We need to restore the

Why not just make it call memcpy? This feels like a roundabout way to solve that issue IMO
Comment 3 Mark Lam 2018-10-05 11:24:52 PDT
(In reply to Saam Barati from comment #2)
> Comment on attachment 351683 [details]
> proposed patch.
> 
> View in context:
> https://bugs.webkit.org/attachment.cgi?id=351683&action=review
> 
> > Source/JavaScriptCore/ChangeLog:10
> > +        to copy memory before the JIT fixed memory pool is initialize.  Before r236864,
> 
> s/initialize/initialized

will fix.

> > Source/JavaScriptCore/ChangeLog:11
> > +        performJITMemcpy() would just do a memcpy in that case.  We need to restore the
> 
> Why not just make it call memcpy? This feels like a roundabout way to solve
> that issue IMO

Because jitWriteThunkGenerator() does not call performJITMemcpy() directly.  The call comes indirectly far below LinkBuffer::linkCode().
Comment 4 Saam Barati 2018-10-05 11:28:47 PDT
Comment on attachment 351683 [details]
proposed patch.

r=me
Comment 5 Mark Lam 2018-10-05 11:34:24 PDT
Thanks for the review.  Landed in r236880: <http://trac.webkit.org/r236880>.
Comment 6 Mark Lam 2018-10-05 12:15:24 PDT
+ build fix landed in r236881: <http://trac.webkit.org/r236881>.