Bug 173573 - repatchIn needs to lock the CodeBlock's lock
Summary: repatchIn needs to lock the CodeBlock's lock
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: JavaScriptCore (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Saam Barati
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2017-06-19 18:12 PDT by Saam Barati
Modified: 2017-06-20 00:15 PDT (History)
11 users (show)

See Also:


Attachments
patch (1.71 KB, patch)
2017-06-19 18:50 PDT, Saam Barati
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Saam Barati 2017-06-19 18:12:54 PDT
...
Comment 1 Saam Barati 2017-06-19 18:50:29 PDT
Created attachment 313348 [details]
patch
Comment 2 Yusuke Suzuki 2017-06-19 19:03:49 PDT
Comment on attachment 313348 [details]
patch

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

r=me

> Source/JavaScriptCore/jit/Repatch.cpp:560
>      if (tryRepatchIn(exec, base, ident, wasFound, slot, stubInfo) == GiveUpOnCache)
>          ftlThunkAwareRepatchCall(exec->codeBlock(), stubInfo.slowPathCallLocation(), operationIn);

BTW, how about passing the lock to these repatch functions? (const AbstractLocker&). Of course, it should be done in a separate patch b/c it involves other Get/Put changes.
Comment 3 Saam Barati 2017-06-19 23:46:43 PDT
(In reply to Yusuke Suzuki from comment #2)
> Comment on attachment 313348 [details]
> patch
> 
> View in context:
> https://bugs.webkit.org/attachment.cgi?id=313348&action=review
> 
> r=me
> 
> > Source/JavaScriptCore/jit/Repatch.cpp:560
> >      if (tryRepatchIn(exec, base, ident, wasFound, slot, stubInfo) == GiveUpOnCache)
> >          ftlThunkAwareRepatchCall(exec->codeBlock(), stubInfo.slowPathCallLocation(), operationIn);
> 
> BTW, how about passing the lock to these repatch functions? (const
> AbstractLocker&). Of course, it should be done in a separate patch b/c it
> involves other Get/Put changes.

Yup I’ll make a patch to do this. It took me a bit before I realized which functions were grabbing the lock. It’s not obvious that it’s held from some places.
Comment 4 WebKit Commit Bot 2017-06-20 00:15:22 PDT
Comment on attachment 313348 [details]
patch

Clearing flags on attachment: 313348

Committed r218552: <http://trac.webkit.org/changeset/218552>
Comment 5 WebKit Commit Bot 2017-06-20 00:15:23 PDT
All reviewed patches have been landed.  Closing bug.