<?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>120080</bug_id>
          
          <creation_ts>2013-08-20 12:57:17 -0700</creation_ts>
          <short_desc>REGRESSION (r153222, 32-bit): NULL JSValue() seen when running peacekeeper benchmark</short_desc>
          <delta_ts>2013-09-05 06:35:26 -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>528+ (Nightly build)</version>
          <rep_platform>Unspecified</rep_platform>
          <op_sys>Unspecified</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>FIXED</resolution>
          
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords>InRadar</keywords>
          <priority>P2</priority>
          <bug_severity>Normal</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Chris Curtis">chris_curtis</reporter>
          <assigned_to name="Chris Curtis">chris_curtis</assigned_to>
          <cc>abrhm</cc>
    
    <cc>bfulgham</cc>
    
    <cc>commit-queue</cc>
    
    <cc>compnerd</cc>
    
    <cc>fpizlo</cc>
    
    <cc>ggaren</cc>
    
    <cc>jbriance</cc>
    
    <cc>kadam</cc>
    
    <cc>mark.lam</cc>
    
    <cc>msaboff</cc>
    
    <cc>oliver</cc>
    
    <cc>ossy</cc>
    
    <cc>peavo</cc>
    
    <cc>zarvai</cc>
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>919176</commentid>
    <comment_count>0</comment_count>
    <who name="Chris Curtis">chris_curtis</who>
    <bug_when>2013-08-20 12:57:17 -0700</bug_when>
    <thetext>This is a follow up error coming from https://bugs.webkit.org/show_bug.cgi?id=119812. The JSValue that is passed into errorDescriptionForValue should never be isEmpty().</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>920153</commentid>
    <comment_count>1</comment_count>
    <who name="Julien Brianceau">jbriance</who>
    <bug_when>2013-08-23 02:42:54 -0700</bug_when>
    <thetext>After bisseting a lot, I think this empty JSValue in errorDescriptionForValue() regression appeared in r153222 (in the middle of the FTL).

The test page I use to stimulate the issue: http://peacekeeper.futuremark.com/ (no need to launch the benchmark, just loading the front page).

My environment: sh4 32-bit with LLINT and baseline JIT, without DFG JIT, using Qt port.

The different tests I made:
- with r153221: no problem, page is loaded correctly and errorDescriptionForValue() is never called with empty JSValue()
- with r153222: errorDescriptionForValue() IS called with empty JSValue()
- with r153222 with JIT disabled (through JSC_useJIT=false): no problem, page is loaded correctly and errorDescriptionForValue() is never called with empty JSValue()

If this could help, with latest revision (r154475) with the same environment + DFG JIT enabled, I get this:
- with r154475: errorDescriptionForValue() IS called with empty JSValue()
- with r154475 with DFG JIT disabled (through JSC_useDFGJIT=false): errorDescriptionForValue() IS called with empty JSValue()
- with r154475 with JIT disabled (through JSC_useJIT=false): no problem, page is loaded correctly

Oliver, could you please take a quick look to your modifications related to 32-bit JIT made in r153222 that could lead to this ?

Thanks,</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>920308</commentid>
    <comment_count>2</comment_count>
    <who name="Geoffrey Garen">ggaren</who>
    <bug_when>2013-08-23 11:18:15 -0700</bug_when>
    <thetext>&lt;rdar://problem/14820996&gt;</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>921183</commentid>
    <comment_count>3</comment_count>
    <who name="Julien Brianceau">jbriance</who>
    <bug_when>2013-08-26 15:08:03 -0700</bug_when>
    <thetext>I tested with a configuration which is more common: X86 32-bit with LLINT, baseline JIT and DFG_JIT enabled, using Qt port.

I get the same results with http://peacekeeper.futuremark.com/ on r154475:
- with r154475: errorDescriptionForValue() IS called with empty JSValue()
- with r154475 with DFG JIT disabled (through JSC_useDFGJIT=false): errorDescriptionForValue() IS called with empty JSValue()
- with r154475 with JIT disabled (through JSC_useJIT=false): no problem, page is loaded correctly</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>921714</commentid>
    <comment_count>4</comment_count>
    <who name="Alexey Proskuryakov">ap</who>
    <bug_when>2013-08-27 15:51:34 -0700</bug_when>
    <thetext>See also: bug 119395.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>921886</commentid>
    <comment_count>5</comment_count>
      <attachid>209859</attachid>
    <who name="Julien Brianceau">jbriance</who>
    <bug_when>2013-08-28 02:25:35 -0700</bug_when>
    <thetext>Created attachment 209859
Revert changes introduced by r153222 in emitSlow_op_get_argument_by_val for 32-bit

I didn&apos;t get this NULL JSValue when reverting the change introduced by r153222 in emitSlow_op_get_argument_by_val for 32-bit (JITOpcodes32_64.cpp). It doesn&apos;t create regressions for me (sh4 32-bit, Qt port, LLINT+baseline JIT+DFG) with:
- Tools/Scripts/run-javascriptcore-tests
- Tools/Scripts/run-fast-jsc
- SunSpider 1.0
- v8-v4 test suite</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>922025</commentid>
    <comment_count>6</comment_count>
      <attachid>209859</attachid>
    <who name="Oliver Hunt">oliver</who>
    <bug_when>2013-08-28 08:50:26 -0700</bug_when>
    <thetext>Comment on attachment 209859
Revert changes introduced by r153222 in emitSlow_op_get_argument_by_val for 32-bit

Weird, this looks fine as the 64bit path doesn&apos;t use the slow path machinery, but i&apos;m curious as the LLINT does, and we use the SlowPathCall type for numerous other sites.  I wonder if JITSlowPathCall::call isn&apos;t getting the windows calling convention right?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>922027</commentid>
    <comment_count>7</comment_count>
    <who name="Julien Brianceau">jbriance</who>
    <bug_when>2013-08-28 08:56:52 -0700</bug_when>
    <thetext>(In reply to comment #6)
&gt; (From update of attachment 209859 [details])
&gt; Weird, this looks fine as the 64bit path doesn&apos;t use the slow path machinery, but i&apos;m curious as the LLINT does, and we use the SlowPathCall type for numerous other sites.  I wonder if JITSlowPathCall::call isn&apos;t getting the windows calling convention right?
To be honest, this is an empirical fix, based on the diff between r153221 and 153222 + diff between 32-bit and 64-bit.
It turns out that this fixes the issue and doesn&apos;t create regressions for me (sh4 32-bit Linux, Qt, LLINT+baseline JIT+DFG), but I won&apos;t be able to explain why it fixes it yet :/</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>922028</commentid>
    <comment_count>8</comment_count>
    <who name="Oliver Hunt">oliver</who>
    <bug_when>2013-08-28 09:02:15 -0700</bug_when>
    <thetext>(In reply to comment #7)
&gt; (In reply to comment #6)
&gt; &gt; (From update of attachment 209859 [details] [details])
&gt; &gt; Weird, this looks fine as the 64bit path doesn&apos;t use the slow path machinery, but i&apos;m curious as the LLINT does, and we use the SlowPathCall type for numerous other sites.  I wonder if JITSlowPathCall::call isn&apos;t getting the windows calling convention right?
&gt; To be honest, this is an empirical fix, based on the diff between r153221 and 153222 + diff between 32-bit and 64-bit.
&gt; It turns out that this fixes the issue and doesn&apos;t create regressions for me (sh4 32-bit Linux, Qt, LLINT+baseline JIT+DFG), but I won&apos;t be able to explain why it fixes it yet :/

Okay, I _believe_ that the SlowPathCall is incorrectly reloading the call frame register from topCallFrame, should be writing the callFrameRegister to topCallFrame instead as topCallFrame is no longer guaranteed to be a reasonable call frame after we&apos;ve returned to the hit - it&apos;s only valid while in host code.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>922056</commentid>
    <comment_count>9</comment_count>
      <attachid>209859</attachid>
    <who name="Darin Adler">darin</who>
    <bug_when>2013-08-28 09:42:48 -0700</bug_when>
    <thetext>Comment on attachment 209859
Revert changes introduced by r153222 in emitSlow_op_get_argument_by_val for 32-bit

All WebKit bug fixes need a to come with test that shows the bug and prevents future regression. This fix looks OK but we need a test.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>922623</commentid>
    <comment_count>10</comment_count>
      <attachid>209859</attachid>
    <who name="Michael Saboff">msaboff</who>
    <bug_when>2013-08-29 13:10:30 -0700</bug_when>
    <thetext>Comment on attachment 209859
Revert changes introduced by r153222 in emitSlow_op_get_argument_by_val for 32-bit

After some sleuthing as to what was going on, this is the right fix.  The reason is due to where the results from the create_arguments call end up.  slow_path_create_arguments will put the results in the virtual register specified by currentInstruction[1].u.operand as it is intended to be the used for processing op_create_arguments.  When using cgi_op_create_arguments, the result is left in regT0 and regT1, and we need to explicitly emit the stores as this patch does.  Notice that we actually want the result in currentInstruction[2].u.operand instead of the operand at index 1.  That is because when processing op_get_argument_by_value we only call create_arguments when the arguments virtual register contains the EmptyValueTag, effectively materializing the arguments as needed.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>922625</commentid>
    <comment_count>11</comment_count>
      <attachid>209859</attachid>
    <who name="Darin Adler">darin</who>
    <bug_when>2013-08-29 13:12:57 -0700</bug_when>
    <thetext>Comment on attachment 209859
Revert changes introduced by r153222 in emitSlow_op_get_argument_by_val for 32-bit

Michael, what about a test case?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>922642</commentid>
    <comment_count>12</comment_count>
      <attachid>209859</attachid>
    <who name="WebKit Commit Bot">commit-queue</who>
    <bug_when>2013-08-29 13:34:30 -0700</bug_when>
    <thetext>Comment on attachment 209859
Revert changes introduced by r153222 in emitSlow_op_get_argument_by_val for 32-bit

Clearing flags on attachment: 209859

Committed r154839: &lt;http://trac.webkit.org/changeset/154839&gt;</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>922643</commentid>
    <comment_count>13</comment_count>
    <who name="WebKit Commit Bot">commit-queue</who>
    <bug_when>2013-08-29 13:34:33 -0700</bug_when>
    <thetext>All reviewed patches have been landed.  Closing bug.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>922647</commentid>
    <comment_count>14</comment_count>
    <who name="Michael Saboff">msaboff</who>
    <bug_when>2013-08-29 13:42:11 -0700</bug_when>
    <thetext>(In reply to comment #11)
&gt; (From update of attachment 209859 [details])
&gt; Michael, what about a test case?

I&apos;ll work on one.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>922706</commentid>
    <comment_count>15</comment_count>
    <who name="Michael Saboff">msaboff</who>
    <bug_when>2013-08-29 15:47:39 -0700</bug_when>
    <thetext>(In reply to comment #14)
&gt; (In reply to comment #11)
&gt; &gt; (From update of attachment 209859 [details] [details])
&gt; &gt; Michael, what about a test case?
&gt; 
&gt; I&apos;ll work on one.

Test landed in change set r154846 &lt;http://trac.webkit.org/changeset/154846&gt;</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>924994</commentid>
    <comment_count>16</comment_count>
    <who name="">peavo</who>
    <bug_when>2013-09-05 06:35:26 -0700</bug_when>
    <thetext>*** Bug 119395 has been marked as a duplicate of this bug. ***</thetext>
  </long_desc>
      
          <attachment
              isobsolete="0"
              ispatch="1"
              isprivate="0"
          >
            <attachid>209859</attachid>
            <date>2013-08-28 02:25:35 -0700</date>
            <delta_ts>2013-08-29 13:34:30 -0700</delta_ts>
            <desc>Revert changes introduced by r153222 in emitSlow_op_get_argument_by_val for 32-bit</desc>
            <filename>bug-120080.patch</filename>
            <type>text/plain</type>
            <size>1478</size>
            <attacher name="Julien Brianceau">jbriance</attacher>
            
              <data encoding="base64">SW5kZXg6IFNvdXJjZS9KYXZhU2NyaXB0Q29yZS9DaGFuZ2VMb2cKPT09PT09PT09PT09PT09PT09
PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PQotLS0gU291
cmNlL0phdmFTY3JpcHRDb3JlL0NoYW5nZUxvZwkocmV2aXNpb24gMTU0NzI2KQorKysgU291cmNl
L0phdmFTY3JpcHRDb3JlL0NoYW5nZUxvZwkod29ya2luZyBjb3B5KQpAQCAtMSwzICsxLDEzIEBA
CisyMDEzLTA4LTI4ICBKdWxpZW4gQnJpYW5jZWF1ICA8amJyaWFuY2VAY2lzY28uY29tPgorCisg
ICAgICAgIFJFR1JFU1NJT04ocjE1MzIyMi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93UGF0aENhbGwodGhpcywgY3VycmVudElu
c3RydWN0aW9uLCBzbG93X3BhdGhfY3JlYXRlX2FyZ3VtZW50cyk7Ci0gICAgc2xvd1BhdGhDYWxs
LmNhbGwoKTsKKyAgICBKSVRTdHViQ2FsbCh0aGlzLCBjdGlfb3BfY3JlYXRlX2FyZ3VtZW50cyku
Y2FsbCgpOworICAgIGVtaXRTdG9yZShhcmd1bWVudHMsIHJlZ1QxLCByZWdUMCk7CisgICAgZW1p
dFN0b3JlKHVubW9kaWZpZWRBcmd1bWVudHNSZWdpc3Rlcihhcmd1bWVudHMpLCByZWdUMSwgcmVn
VDApOwogICAgIAogICAgIHNraXBBcmd1bWVudHNDcmVhdGlvbi5saW5rKHRoaXMpOwogICAgIEpJ
VFN0dWJDYWxsIHN0dWJDYWxsKHRoaXMsIGN0aV9vcF9nZXRfYnlfdmFsX2dlbmVyaWMpOwo=
</data>

          </attachment>
      

    </bug>

</bugzilla>