<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<!DOCTYPE bugzilla SYSTEM "https://bugs.webkit.org/page.cgi?id=bugzilla.dtd">

<bugzilla version="5.0.4.1"
          urlbase="https://bugs.webkit.org/"
          
          maintainer="admin@webkit.org"
>

    <bug>
          <bug_id>166097</bug_id>
          
          <creation_ts>2016-12-20 09:54:53 -0800</creation_ts>
          <short_desc>[JSC] JS Parser should work concurrently</short_desc>
          <delta_ts>2017-06-14 23:01:57 -0700</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>1</classification_id>
          <classification>Unclassified</classification>
          <product>WebKit</product>
          <component>JavaScriptCore</component>
          <version>WebKit Nightly Build</version>
          <rep_platform>Unspecified</rep_platform>
          <op_sys>Unspecified</op_sys>
          <bug_status>NEW</bug_status>
          <resolution></resolution>
          
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords></keywords>
          <priority>P2</priority>
          <bug_severity>Normal</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Yusuke Suzuki">ysuzuki</reporter>
          <assigned_to name="Yusuke Suzuki">ysuzuki</assigned_to>
          <cc>fpizlo</cc>
    
    <cc>koivisto</cc>
    
    <cc>saam</cc>
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>1261454</commentid>
    <comment_count>0</comment_count>
    <who name="Yusuke Suzuki">ysuzuki</who>
    <bug_when>2016-12-20 09:54:53 -0800</bug_when>
    <thetext>&lt;script async&gt;, &lt;script defer&gt; and ES6 modules can receive benefit from parsing JS concurrently.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1314590</commentid>
    <comment_count>1</comment_count>
    <who name="Yusuke Suzuki">ysuzuki</who>
    <bug_when>2017-06-01 06:10:13 -0700</bug_when>
    <thetext>The largest problem is Identifier&apos;s AtomicStringTable. We never want to access to one AtomicStringTable concurrently.
Fortunately, our parser infrastructure has ParserArena. And we access to Identifier through const Identifier*.

So, my current plan is

1. Decouple VM from ParserArena. This also decouples VM from Parser largely.
2. ParserArena should have AtomicStringTable like things. And Parser arena generates Identifier.
3. Finally, we will merge AtomicStrings in non-UI thread into main thread&apos;s table. The great thing is that ParserArena holds Identifiers. Thus, after merging AtomicStrings, we will replace Identifier&apos;s impl with main-thread AtomicStringImpls.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1314591</commentid>
    <comment_count>2</comment_count>
    <who name="Yusuke Suzuki">ysuzuki</who>
    <bug_when>2017-06-01 06:11:24 -0700</bug_when>
    <thetext>(In reply to Yusuke Suzuki from comment #0)
&gt; &lt;script async&gt;, &lt;script defer&gt; and ES6 modules can receive benefit from
&gt; parsing JS concurrently.

Since JSC&apos;s module mechanism is largely confined in JSC side, we can easily use concurrent JS parser in JSC. (I mean that it is not good design that WebCore touches concurrent JSC JS parsers).</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1314644</commentid>
    <comment_count>3</comment_count>
    <who name="Saam Barati">saam</who>
    <bug_when>2017-06-01 09:27:12 -0700</bug_when>
    <thetext>Cool! I remember talking to Antti at some point where he said he wanted this.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1315101</commentid>
    <comment_count>4</comment_count>
    <who name="Antti Koivisto">koivisto</who>
    <bug_when>2017-06-02 10:33:37 -0700</bug_when>
    <thetext>+1</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1319463</commentid>
    <comment_count>5</comment_count>
    <who name="Yusuke Suzuki">ysuzuki</who>
    <bug_when>2017-06-14 23:01:57 -0700</bug_when>
    <thetext>Interesting. http://dl.acm.org/citation.cfm?id=3004281
Yeah, we should consider pre-parse hash table and string table.</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>