<?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>157741</bug_id>
          
          <creation_ts>2016-05-16 08:54:22 -0700</creation_ts>
          <short_desc>JSC: DFG::SpeculativeJIT::compile special case for MIPS for PutByValWithThis</short_desc>
          <delta_ts>2016-05-19 10:26:15 -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>Other</version>
          <rep_platform>Other</rep_platform>
          <op_sys>Linux</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>FIXED</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="Guillaume Emont">guijemont</reporter>
          <assigned_to name="Nobody">webkit-unassigned</assigned_to>
          <cc>annulen</cc>
    
    <cc>commit-queue</cc>
    
    <cc>guijemont</cc>
    
    <cc>jbriance</cc>
    
    <cc>keith_miller</cc>
    
    <cc>mark.lam</cc>
    
    <cc>msaboff</cc>
    
    <cc>saam</cc>
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>1193392</commentid>
    <comment_count>0</comment_count>
    <who name="Guillaume Emont">guijemont</who>
    <bug_when>2016-05-16 08:54:22 -0700</bug_when>
    <thetext>WebKit does not build on MIPS due to the change in http://trac.webkit.org/changeset/200586 . A special case is needed for MIPS as well as x86 because MIPS doesn&apos;t have enough registers either, and the function call ABI is different on MIPS.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1193393</commentid>
    <comment_count>1</comment_count>
    <who name="Guillaume Emont">guijemont</who>
    <bug_when>2016-05-16 08:54:35 -0700</bug_when>
    <thetext>I am working on a patch.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1193407</commentid>
    <comment_count>2</comment_count>
      <attachid>279023</attachid>
    <who name="Guillaume Emont">guijemont</who>
    <bug_when>2016-05-16 10:32:00 -0700</bug_when>
    <thetext>Created attachment 279023
Patch

A patch addressing the issue</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1193416</commentid>
    <comment_count>3</comment_count>
    <who name="Guillaume Emont">guijemont</who>
    <bug_when>2016-05-16 10:41:59 -0700</bug_when>
    <thetext>This is the code my patch generates:

  move    a0,s8                                                                                                                                                
  move    a1,zero                                                                                                                                              
  sw      v1,-12(s8)                                                                                                                                           
  sw      v0,-16(s8)                                                                                                                                           
  lw      t6,-20(s8)                                                                                                                                           
  lw      v0,-24(s8)                                                                                                                                           
  sw      t5,-36(s8)                                                                                                                                           
  sw      t4,-40(s8)                                                                                                                                           
  lw      v1,-12(s8)                                                                                                                                           
  lw      t4,-16(s8)                                                                                                                                           
  move    a2,v0                                                                                                                                                
  move    a3,t6                                                                                                                                                
  sw      t2,16(sp)                                                                                                                                            
  sw      t3,20(sp)                                                                                                                                            
  sw      t4,24(sp)                                                                                                                                            
  sw      v1,28(sp)                                                                                                                                            
  sw      t3,-28(s8)                                                                                                                                           
  sw      t2,-32(s8)                                                                                                                                           
  lw      v0,-36(s8)                                                                                                                                           
  lw      v1,-40(s8)                                                                                                                                           
  sw      v1,32(sp)                                                                                                                                            
  sw      v0,36(sp)                                                                                                                                            
  li      t0,2                                                                                                                                                 
  sw      t0,28(s8)                                                                                                                                            
  lui     t9,0x1d3                                                                                                                                             
  ori     t9,t9,0x33f4                                                                                                                                         
  jalr    t9                                                                                                                                                   
  nop               

I am wondering whether there is a way to have basePayload and baseTag load directly into the right argument registers, which would save these two moves.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1193445</commentid>
    <comment_count>4</comment_count>
      <attachid>279023</attachid>
    <who name="Saam Barati">saam</who>
    <bug_when>2016-05-16 11:31:05 -0700</bug_when>
    <thetext>Comment on attachment 279023
Patch

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

&gt; Source/JavaScriptCore/dfg/DFGSpeculativeJIT32_64.cpp:2931
&gt; +        m_jit.move(TrustedImm32(0), GPRInfo::argumentGPR1);

Is this because 64-bit values need to be aligned on even registers?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1193452</commentid>
    <comment_count>5</comment_count>
      <attachid>279023</attachid>
    <who name="Konstantin Tokarev">annulen</who>
    <bug_when>2016-05-16 11:45:06 -0700</bug_when>
    <thetext>Comment on attachment 279023
Patch

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

&gt; Source/JavaScriptCore/dfg/DFGSpeculativeJIT32_64.cpp:2933
&gt; +        {

If we won&apos;t find a way to avoid excessive moves, I propose to merge this code with X86 code path. Only top 4 lines are different for MIPS, everything else looks like an exact copy of X86</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1193487</commentid>
    <comment_count>6</comment_count>
      <attachid>279023</attachid>
    <who name="Saam Barati">saam</who>
    <bug_when>2016-05-16 13:17:15 -0700</bug_when>
    <thetext>Comment on attachment 279023
Patch

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

&gt;&gt; Source/JavaScriptCore/dfg/DFGSpeculativeJIT32_64.cpp:2933
&gt;&gt; +        {
&gt; 
&gt; If we won&apos;t find a way to avoid excessive moves, I propose to merge this code with X86 code path. Only top 4 lines are different for MIPS, everything else looks like an exact copy of X86

IMO, this will make the code harder to read.

&gt; Source/JavaScriptCore/dfg/DFGSpeculativeJIT32_64.cpp:2947
&gt; +            m_jit.move(basePayload, GPRInfo::argumentGPR2);
&gt; +            m_jit.move(baseTag, GPRInfo::argumentGPR3);

This is wrong if basePayload/baseTag are aliased to argument registers w/ each other.
i.e, if basePayload is argumentGPR3 and baseTag is argumentGPR2, this code will do the wrong thing.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1193514</commentid>
    <comment_count>7</comment_count>
      <attachid>279023</attachid>
    <who name="Guillaume Emont">guijemont</who>
    <bug_when>2016-05-16 13:52:49 -0700</bug_when>
    <thetext>Comment on attachment 279023
Patch

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

&gt;&gt; Source/JavaScriptCore/dfg/DFGSpeculativeJIT32_64.cpp:2931
&gt;&gt; +        m_jit.move(TrustedImm32(0), GPRInfo::argumentGPR1);
&gt; 
&gt; Is this because 64-bit values need to be aligned on even registers?

That was my reasoning. Though looking at the code generated by gcc for operationPutByValWithThisStrict(), even in -O0 it never accesses $a1 or the corresponding address on the stack, so I will remove that one line in a subsequent version of the patch. The next value (which is 64 bits) definitely needs to be on $a2 and $a3 though (and accordingly, 4 stack entries need to be reserved for the values we put in $a0-$a3, though they don&apos;t need to be set by the caller.

&gt;&gt;&gt; Source/JavaScriptCore/dfg/DFGSpeculativeJIT32_64.cpp:2933
&gt;&gt;&gt; +        {
&gt;&gt; 
&gt;&gt; If we won&apos;t find a way to avoid excessive moves, I propose to merge this code with X86 code path. Only top 4 lines are different for MIPS, everything else looks like an exact copy of X86
&gt; 
&gt; IMO, this will make the code harder to read.

Guilty as charged: I copy-pasted the x86 code and worked from there, I think I was expecting more difference in the end. But yeah, I guess it&apos;s a matter of avoiding code duplication vs readability.

&gt;&gt; Source/JavaScriptCore/dfg/DFGSpeculativeJIT32_64.cpp:2947
&gt;&gt; +            m_jit.move(baseTag, GPRInfo::argumentGPR3);
&gt; 
&gt; This is wrong if basePayload/baseTag are aliased to argument registers w/ each other.
&gt; i.e, if basePayload is argumentGPR3 and baseTag is argumentGPR2, this code will do the wrong thing.

I thought this was not possible because the argumentGPR&apos;s are not in GPRInfo::toRegister() (and not counted in GPRInfo::numberOfRegisters). Including them might be an idea for the future though, as I suspect more registers available might improve performances (and ARM does that so it&apos;s probably possible), but I think that&apos;s a trickier change, and I&apos;d like to get the build unbroken.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1193519</commentid>
    <comment_count>8</comment_count>
      <attachid>279023</attachid>
    <who name="Saam Barati">saam</who>
    <bug_when>2016-05-16 14:01:38 -0700</bug_when>
    <thetext>Comment on attachment 279023
Patch

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

&gt;&gt;&gt; Source/JavaScriptCore/dfg/DFGSpeculativeJIT32_64.cpp:2947
&gt;&gt;&gt; +            m_jit.move(baseTag, GPRInfo::argumentGPR3);
&gt;&gt; 
&gt;&gt; This is wrong if basePayload/baseTag are aliased to argument registers w/ each other.
&gt;&gt; i.e, if basePayload is argumentGPR3 and baseTag is argumentGPR2, this code will do the wrong thing.
&gt; 
&gt; I thought this was not possible because the argumentGPR&apos;s are not in GPRInfo::toRegister() (and not counted in GPRInfo::numberOfRegisters). Including them might be an idea for the future though, as I suspect more registers available might improve performances (and ARM does that so it&apos;s probably possible), but I think that&apos;s a trickier change, and I&apos;d like to get the build unbroken.

I don&apos;t quite understand your response here. Tag/Payload regs will be allocated by the DFG&apos;s register allocator. It will happily use argument registers.
I don&apos;t think this makes the code harder to read. All code we write that sets up a call frame must account for this.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1193566</commentid>
    <comment_count>9</comment_count>
      <attachid>279023</attachid>
    <who name="Guillaume Emont">guijemont</who>
    <bug_when>2016-05-16 15:40:31 -0700</bug_when>
    <thetext>Comment on attachment 279023
Patch

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

&gt;&gt;&gt;&gt; Source/JavaScriptCore/dfg/DFGSpeculativeJIT32_64.cpp:2947
&gt;&gt;&gt;&gt; +            m_jit.move(baseTag, GPRInfo::argumentGPR3);
&gt;&gt;&gt; 
&gt;&gt;&gt; This is wrong if basePayload/baseTag are aliased to argument registers w/ each other.
&gt;&gt;&gt; i.e, if basePayload is argumentGPR3 and baseTag is argumentGPR2, this code will do the wrong thing.
&gt;&gt; 
&gt;&gt; I thought this was not possible because the argumentGPR&apos;s are not in GPRInfo::toRegister() (and not counted in GPRInfo::numberOfRegisters). Including them might be an idea for the future though, as I suspect more registers available might improve performances (and ARM does that so it&apos;s probably possible), but I think that&apos;s a trickier change, and I&apos;d like to get the build unbroken.
&gt; 
&gt; I don&apos;t quite understand your response here. Tag/Payload regs will be allocated by the DFG&apos;s register allocator. It will happily use argument registers.
&gt; I don&apos;t think this makes the code harder to read. All code we write that sets up a call frame must account for this.

Sorry if that wasn&apos;t clear, and there is a possibility that I misunderstand something. What I mean is that DFG::RegisterBank&lt;GPRInfo&gt;::allocate() (see ::allocateInternal()) uses GPRInfo::toRegister() (and GPRInfo::numberOfRegisters as RegisterBank::NUM_REGS) as its source of registers. In the case of MIPS, GPRInfo::toRegister() never returns an argumentGPRx. Therefore baseTag and basePayload cannot be an argumentGPRx register. That&apos;s my current understanding at least.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1193585</commentid>
    <comment_count>10</comment_count>
    <who name="Saam Barati">saam</who>
    <bug_when>2016-05-16 16:05:41 -0700</bug_when>
    <thetext>(In reply to comment #9)
&gt; Comment on attachment 279023 [details]
&gt; Patch
&gt; 
&gt; View in context:
&gt; https://bugs.webkit.org/attachment.cgi?id=279023&amp;action=review
&gt; 
&gt; &gt;&gt;&gt;&gt; Source/JavaScriptCore/dfg/DFGSpeculativeJIT32_64.cpp:2947
&gt; &gt;&gt;&gt;&gt; +            m_jit.move(baseTag, GPRInfo::argumentGPR3);
&gt; &gt;&gt;&gt; 
&gt; &gt;&gt;&gt; This is wrong if basePayload/baseTag are aliased to argument registers w/ each other.
&gt; &gt;&gt;&gt; i.e, if basePayload is argumentGPR3 and baseTag is argumentGPR2, this code will do the wrong thing.
&gt; &gt;&gt; 
&gt; &gt;&gt; I thought this was not possible because the argumentGPR&apos;s are not in GPRInfo::toRegister() (and not counted in GPRInfo::numberOfRegisters). Including them might be an idea for the future though, as I suspect more registers available might improve performances (and ARM does that so it&apos;s probably possible), but I think that&apos;s a trickier change, and I&apos;d like to get the build unbroken.
&gt; &gt; 
&gt; &gt; I don&apos;t quite understand your response here. Tag/Payload regs will be allocated by the DFG&apos;s register allocator. It will happily use argument registers.
&gt; &gt; I don&apos;t think this makes the code harder to read. All code we write that sets up a call frame must account for this.
&gt; 
&gt; Sorry if that wasn&apos;t clear, and there is a possibility that I misunderstand
&gt; something. What I mean is that DFG::RegisterBank&lt;GPRInfo&gt;::allocate() (see
&gt; ::allocateInternal()) uses GPRInfo::toRegister() (and
&gt; GPRInfo::numberOfRegisters as RegisterBank::NUM_REGS) as its source of
&gt; registers. In the case of MIPS, GPRInfo::toRegister() never returns an
&gt; argumentGPRx. Therefore baseTag and basePayload cannot be an argumentGPRx
&gt; register. That&apos;s my current understanding at least.
I see. Makes sense.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1193767</commentid>
    <comment_count>11</comment_count>
      <attachid>279023</attachid>
    <who name="Julien Brianceau">jbriance</who>
    <bug_when>2016-05-17 00:35:39 -0700</bug_when>
    <thetext>Comment on attachment 279023
Patch

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

Looks good to me

&gt;&gt;&gt; Source/JavaScriptCore/dfg/DFGSpeculativeJIT32_64.cpp:2931
&gt;&gt;&gt; +        m_jit.move(TrustedImm32(0), GPRInfo::argumentGPR1);
&gt;&gt; 
&gt;&gt; Is this because 64-bit values need to be aligned on even registers?
&gt; 
&gt; That was my reasoning. Though looking at the code generated by gcc for operationPutByValWithThisStrict(), even in -O0 it never accesses $a1 or the corresponding address on the stack, so I will remove that one line in a subsequent version of the patch. The next value (which is 64 bits) definitely needs to be on $a2 and $a3 though (and accordingly, 4 stack entries need to be reserved for the values we put in $a0-$a3, though they don&apos;t need to be set by the caller.

I agree, there is no need to set $a1 to 0 here.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1194793</commentid>
    <comment_count>12</comment_count>
      <attachid>279395</attachid>
    <who name="Guillaume Emont">guijemont</who>
    <bug_when>2016-05-19 09:54:58 -0700</bug_when>
    <thetext>Created attachment 279395
Patch

New patch, not setting up $a1 and explaining the &quot;alignment&quot;.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1194795</commentid>
    <comment_count>13</comment_count>
    <who name="Guillaume Emont">guijemont</who>
    <bug_when>2016-05-19 09:58:20 -0700</bug_when>
    <thetext>I spent some time trying to avoid the move, doing the following instead of setting up a JSValueOperand and moving its registers to $a2/$a3:

   VirtualRegister virtualRegister = m_jit.graph().varArgChild(node, 0)-&gt;virtualRegister();             
   m_jit.load32(JITCompiler::payloadFor(virtualRegister), GPRInfo::argumentGPR2);                       
   m_jit.load32(JITCompiler::tagFor(virtualRegister), GPRInfo::argumentGPR3);                           

But then, when I run super-property-access.js, I get this:

  # jsc super-property-access.js                                                                                                                               
  Exception: TypeError: Attempted to assign to readonly property.                                                                                              
  baz@super-property-access.js:442:23                                                                                                                          
  super-property-access.js:450:16                                                                                                                              
  test@super-property-access.js:9:10                                                                                                                           
  global code@super-property-access.js:429:5                                                                                                                   
  #

I spent some time investigating that but could not really understand what&apos;s wrong with that approach. So for now I think we can stick with the latest patch I posted.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1194814</commentid>
    <comment_count>14</comment_count>
      <attachid>279395</attachid>
    <who name="WebKit Commit Bot">commit-queue</who>
    <bug_when>2016-05-19 10:26:11 -0700</bug_when>
    <thetext>Comment on attachment 279395
Patch

Clearing flags on attachment: 279395

Committed r201170: &lt;http://trac.webkit.org/changeset/201170&gt;</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1194815</commentid>
    <comment_count>15</comment_count>
    <who name="WebKit Commit Bot">commit-queue</who>
    <bug_when>2016-05-19 10:26:15 -0700</bug_when>
    <thetext>All reviewed patches have been landed.  Closing bug.</thetext>
  </long_desc>
      
          <attachment
              isobsolete="1"
              ispatch="1"
              isprivate="0"
          >
            <attachid>279023</attachid>
            <date>2016-05-16 10:32:00 -0700</date>
            <delta_ts>2016-05-19 09:54:52 -0700</delta_ts>
            <desc>Patch</desc>
            <filename>bug-157741-20160516123256.patch</filename>
            <type>text/plain</type>
            <size>3387</size>
            <attacher name="Guillaume Emont">guijemont</attacher>
            
              <data encoding="base64">U3VidmVyc2lvbiBSZXZpc2lvbjogMjAwOTQyCmRpZmYgLS1naXQgYS9Tb3VyY2UvSmF2YVNjcmlw
dENvcmUvQ2hhbmdlTG9nIGIvU291cmNlL0phdmFTY3JpcHRDb3JlL0NoYW5nZUxvZwppbmRleCAw
MDc5Y2I4NjNhM2IzMzFkMDQxYjFmMjlmNzYzYTU5NjEwZWRmODMwLi4xOTY0NzIxZGRlNWU5NWUy
YjIzMjM5YWFjZWI0MzM5OWUyNmVmNGIwIDEwMDY0NAotLS0gYS9Tb3VyY2UvSmF2YVNjcmlwdENv
cmUvQ2hhbmdlTG9nCisrKyBiL1NvdXJjZS9KYXZhU2NyaXB0Q29yZS9DaGFuZ2VMb2cKQEAgLTEs
MyArMSwxNyBAQAorMjAxNi0wNS0xNiAgR3VpbGxhdW1lIEVtb250ICA8Z3VpamVtb250QGlnYWxp
YS5jb20+CisKKyAgICAgICAgSlNDOiBERkc6OlNwZWN1bGF0aXZlSklUOjpjb21waWxlIHNwZWNp
YWwgY2FzZSBmb3IgTUlQUyBmb3IgUHV0QnlWYWxXaXRoVGhpcworICAgICAgICBodHRwczovL2J1
Z3Mud2Via2l0Lm9yZy9zaG93X2J1Zy5jZ2k/aWQ9MTU3NzQxCisKKyAgICAgICAgUmV2aWV3ZWQg
YnkgTk9CT0RZIChPT1BTISkuCisKKyAgICAgICAgVGhlIFB1dEJ5VmFsV2l0aFRoaXMgY2FzZSBu
ZWVkcyBhIHNwZWNpYWwgY2FzZSBmb3IgTUlQUyBiZWNhdXNlIHdlCisgICAgICAgIGRvbid0IGhh
dmUgZW5vdWdoIHJlZ2lzdGVycy4gVGhlIHNwZWNpYWwgY2FzZSBuZWVkcyB0byBiZSBkaWZmZ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
LCAyKSk7CisgICAgICAgICAgICBHUFJSZWcgcHJvcGVydHlUYWcgPSBwcm9wZXJ0eS50YWdHUFIo
KTsKKyAgICAgICAgICAgIEdQUlJlZyBwcm9wZXJ0eVBheWxvYWQgPSBwcm9wZXJ0eS5wYXlsb2Fk
R1BSKCk7CisKKyAgICAgICAgICAgIG1faml0Lm1vdmUoYmFzZVBheWxvYWQsIEdQUkluZm86OmFy
Z3VtZW50R1BSMik7CisgICAgICAgICAgICBtX2ppdC5tb3ZlKGJhc2VUYWcsIEdQUkluZm86OmFy
Z3VtZW50R1BSMyk7CisKKyAgICAgICAgICAgIG1faml0LnBva2UodGhpc1ZhbHVlUGF5bG9hZCwg
aW5kZXgrKyk7CisgICAgICAgICAgICBtX2ppdC5wb2tlKHRoaXNWYWx1ZVRhZywgaW5kZXgrKyk7
CisKKyAgICAgICAgICAgIG1faml0LnBva2UocHJvcGVydHlQYXlsb2FkLCBpbmRleCsrKTsKKyAg
ICAgICAgICAgIG1faml0LnBva2UocHJvcGVydHlUYWcsIGluZGV4KyspOworCisgICAgICAgICAg
ICBmbHVzaFJlZ2lzdGVycygpOworICAgICAgICB9CisKKyAgICAgICAgSlNWYWx1ZU9wZXJhbmQg
dmFsdWUodGhpcywgbV9qaXQuZ3JhcGgoKS52YXJBcmdDaGlsZChub2RlLCAzKSk7CisgICAgICAg
IEdQUlJlZyB2YWx1ZVRhZyA9IHZhbHVlLnRhZ0dQUigpOworICAgICAgICBHUFJSZWcgdmFsdWVQ
YXlsb2FkID0gdmFsdWUucGF5bG9hZEdQUigpOworICAgICAgICBtX2ppdC5wb2tlKHZhbHVlUGF5
bG9hZCwgaW5kZXgrKyk7CisgICAgICAgIG1faml0LnBva2UodmFsdWVUYWcsIGluZGV4KyspOwor
CisgICAgICAgIGZsdXNoUmVnaXN0ZXJzKCk7CisgICAgICAgIGFwcGVuZENhbGwobV9qaXQuaXNT
dHJpY3RNb2RlRm9yKG5vZGUtPm9yaWdpbi5zZW1hbnRpYykgPyBvcGVyYXRpb25QdXRCeVZhbFdp
dGhUaGlzU3RyaWN0IDogb3BlcmF0aW9uUHV0QnlWYWxXaXRoVGhpcyk7CisgICAgICAgIG1faml0
LmV4Y2VwdGlvbkNoZWNrKCk7CiAjZWxzZQogICAgICAgICBzdGF0aWNfYXNzZXJ0KEdQUkluZm86
Om51bWJlck9mUmVnaXN0ZXJzID49IDgsICJXZSBhcmUgYXNzdW1pbmcgd2UgaGF2ZSBlbm91Z2gg
cmVnaXN0ZXJzIHRvIG1ha2UgdGhpcyBjYWxsIHdpdGhvdXQgaW5jcmVtZW50YWxseSBzZXR0aW5n
IHVwIHRoZSBhcmd1bWVudHMuIik7CiAK
</data>

          </attachment>
          <attachment
              isobsolete="0"
              ispatch="1"
              isprivate="0"
          >
            <attachid>279395</attachid>
            <date>2016-05-19 09:54:58 -0700</date>
            <delta_ts>2016-05-19 10:26:11 -0700</delta_ts>
            <desc>Patch</desc>
            <filename>bug-157741-20160519115557.patch</filename>
            <type>text/plain</type>
            <size>3595</size>
            <attacher name="Guillaume Emont">guijemont</attacher>
            
              <data encoding="base64">U3VidmVyc2lvbiBSZXZpc2lvbjogMjAwOTQyCmRpZmYgLS1naXQgYS9Tb3VyY2UvSmF2YVNjcmlw
dENvcmUvQ2hhbmdlTG9nIGIvU291cmNlL0phdmFTY3JpcHRDb3JlL0NoYW5nZUxvZwppbmRleCAw
MDc5Y2I4NjNhM2IzMzFkMDQxYjFmMjlmNzYzYTU5NjEwZWRmODMwLi42YzNiNmEzOGIzODFiZjI3
MjdlZWFmOWM2NjkzOTYwNjdhMjI0MjQ1IDEwMDY0NAotLS0gYS9Tb3VyY2UvSmF2YVNjcmlwdENv
cmUvQ2hhbmdlTG9nCisrKyBiL1NvdXJjZS9KYXZhU2NyaXB0Q29yZS9DaGFuZ2VMb2cKQEAgLTEs
MyArMSwxNyBAQAorMjAxNi0wNS0xOSAgR3VpbGxhdW1lIEVtb250ICA8Z3VpamVtb250QGlnYWxp
YS5jb20+C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LiIp
OwogCg==
</data>

          </attachment>
      

    </bug>

</bugzilla>