<?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>131495</bug_id>
          
          <creation_ts>2014-04-10 09:56:20 -0700</creation_ts>
          <short_desc>LLINT loadisFromInstruction should handle the big endian case</short_desc>
          <delta_ts>2014-04-29 06:13:34 -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></keywords>
          <priority>P2</priority>
          <bug_severity>Normal</bug_severity>
          <target_milestone>---</target_milestone>
          
          <blocked>128743</blocked>
          <everconfirmed>1</everconfirmed>
          <reporter name="Mark Lam">mark.lam</reporter>
          <assigned_to name="Mark Lam">mark.lam</assigned_to>
          <cc>commit-queue</cc>
    
    <cc>fpizlo</cc>
    
    <cc>ggaren</cc>
    
    <cc>mhahnenberg</cc>
    
    <cc>mmirman</cc>
    
    <cc>msaboff</cc>
    
    <cc>oliver</cc>
    
    <cc>tpopela</cc>
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>999550</commentid>
    <comment_count>0</comment_count>
    <who name="Mark Lam">mark.lam</who>
    <bug_when>2014-04-10 09:56:20 -0700</bug_when>
    <thetext>The LLINT loadisFromInstruction macro aims to load the least significant 32-bit word from the 64-bit bytecode instruction stream and sign extend it.  For big endian machines, the current implementation would load the wrong 32-bit word.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>999551</commentid>
    <comment_count>1</comment_count>
      <attachid>229055</attachid>
    <who name="Mark Lam">mark.lam</who>
    <bug_when>2014-04-10 10:01:55 -0700</bug_when>
    <thetext>Created attachment 229055
The patch.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>999552</commentid>
    <comment_count>2</comment_count>
      <attachid>229056</attachid>
    <who name="Mark Lam">mark.lam</who>
    <bug_when>2014-04-10 10:03:47 -0700</bug_when>
    <thetext>Created attachment 229056
patch 2: updated comment.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>999557</commentid>
    <comment_count>3</comment_count>
      <attachid>229056</attachid>
    <who name="Mark Hahnenberg">mhahnenberg</who>
    <bug_when>2014-04-10 10:12:37 -0700</bug_when>
    <thetext>Comment on attachment 229056
patch 2: updated comment.

Does this fix all big endian issues? It seems to me like we do lots of loadi instructions assuming little endianness.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>999558</commentid>
    <comment_count>4</comment_count>
    <who name="Mark Lam">mark.lam</who>
    <bug_when>2014-04-10 10:14:22 -0700</bug_when>
    <thetext>(In reply to comment #3)
&gt; (From update of attachment 229056 [details])
&gt; Does this fix all big endian issues? It seems to me like we do lots of loadi instructions assuming little endianness.

I would not presume that.  Tomas has been analyzing big endian failures in https://bugs.webkit.org/show_bug.cgi?id=12874.  I’m just knocking them down one at a time when he reports them.  This one happens to be the next one.  It may or may not be the last.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>999559</commentid>
    <comment_count>5</comment_count>
    <who name="Mark Hahnenberg">mhahnenberg</who>
    <bug_when>2014-04-10 10:15:31 -0700</bug_when>
    <thetext>(In reply to comment #4)
&gt; (In reply to comment #3)
&gt; &gt; (From update of attachment 229056 [details] [details])
&gt; &gt; Does this fix all big endian issues? It seems to me like we do lots of loadi instructions assuming little endianness.
&gt; 
&gt; I would not presume that.  Tomas has been analyzing big endian failures in https://bugs.webkit.org/show_bug.cgi?id=12874.  I’m just knocking them down one at a time when he reports them.  This one happens to be the next one.  It may or may not be the last.

Hmm. Assuming this isn&apos;t the last one, is there a better way to handle these bugs rather than slapping if BIG_ENDIAN everywhere? Could this be handled in the backend somehow?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>999561</commentid>
    <comment_count>6</comment_count>
    <who name="Mark Hahnenberg">mhahnenberg</who>
    <bug_when>2014-04-10 10:18:46 -0700</bug_when>
    <thetext>(In reply to comment #5)
&gt; (In reply to comment #4)
&gt; &gt; (In reply to comment #3)
&gt; &gt; &gt; (From update of attachment 229056 [details] [details] [details])
&gt; &gt; &gt; Does this fix all big endian issues? It seems to me like we do lots of loadi instructions assuming little endianness.
&gt; &gt; 
&gt; &gt; I would not presume that.  Tomas has been analyzing big endian failures in https://bugs.webkit.org/show_bug.cgi?id=12874.  I’m just knocking them down one at a time when he reports them.  This one happens to be the next one.  It may or may not be the last.
&gt; 
&gt; Hmm. Assuming this isn&apos;t the last one, is there a better way to handle these bugs rather than slapping if BIG_ENDIAN everywhere? Could this be handled in the backend somehow?

Or maybe we just need a macro that provides a good abstraction for loading 32 bits that has a single if BIG_ENDIAN and then use that everywhere.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>999564</commentid>
    <comment_count>7</comment_count>
    <who name="Mark Lam">mark.lam</who>
    <bug_when>2014-04-10 10:19:50 -0700</bug_when>
    <thetext>(In reply to comment #5)
&gt; (In reply to comment #4)
&gt; &gt; (In reply to comment #3)
&gt; &gt; &gt; (From update of attachment 229056 [details] [details] [details])
&gt; &gt; &gt; Does this fix all big endian issues? It seems to me like we do lots of loadi instructions assuming little endianness.
&gt; &gt; 
&gt; &gt; I would not presume that.  Tomas has been analyzing big endian failures in https://bugs.webkit.org/show_bug.cgi?id=12874.  I’m just knocking them down one at a time when he reports them.  This one happens to be the next one.  It may or may not be the last.
&gt; 
&gt; Hmm. Assuming this isn&apos;t the last one, is there a better way to handle these bugs rather than slapping if BIG_ENDIAN everywhere? Could this be handled in the backend somehow?

Correction on the url from my previous comment: it should be https://bugs.webkit.org/show_bug.cgi?id=128743.

That would be inappropriate to rig loadi in the backend because a loadi can be used to load the most significant 32-bit if that is the intent.  I’m going by the rule that the LLINT asm is assembly, and we should coding it the same way an assembly programmer would code.  In this case, the issue isolated to a macro, and that “if BIG_ENDIAN” is isolated.  Note: this is not a new idiom.  It was already in use previously, and I adopted it here to solve the issue.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>999567</commentid>
    <comment_count>8</comment_count>
      <attachid>229056</attachid>
    <who name="Mark Hahnenberg">mhahnenberg</who>
    <bug_when>2014-04-10 10:20:42 -0700</bug_when>
    <thetext>Comment on attachment 229056
patch 2: updated comment.

Okay, we&apos;ll refactor as we encounter new issues. YAGNI! r=me</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>999576</commentid>
    <comment_count>9</comment_count>
      <attachid>229056</attachid>
    <who name="WebKit Commit Bot">commit-queue</who>
    <bug_when>2014-04-10 10:50:42 -0700</bug_when>
    <thetext>Comment on attachment 229056
patch 2: updated comment.

Clearing flags on attachment: 229056

Committed r167076: &lt;http://trac.webkit.org/changeset/167076&gt;</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>999577</commentid>
    <comment_count>10</comment_count>
    <who name="WebKit Commit Bot">commit-queue</who>
    <bug_when>2014-04-10 10:50:46 -0700</bug_when>
    <thetext>All reviewed patches have been landed.  Closing bug.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1004922</commentid>
    <comment_count>11</comment_count>
    <who name="Mark Lam">mark.lam</who>
    <bug_when>2014-04-29 06:13:34 -0700</bug_when>
    <thetext>For the record, this fix was invalid.  https://bugs.webkit.org/show_bug.cgi?id=132330 will undo it, and make it right.</thetext>
  </long_desc>
      
          <attachment
              isobsolete="1"
              ispatch="1"
              isprivate="0"
          >
            <attachid>229055</attachid>
            <date>2014-04-10 10:01:55 -0700</date>
            <delta_ts>2014-04-10 10:03:47 -0700</delta_ts>
            <desc>The patch.</desc>
            <filename>bug-131495.patch</filename>
            <type>text/plain</type>
            <size>1547</size>
            <attacher name="Mark Lam">mark.lam</attacher>
            
              <data encoding="base64">SW5kZXg6IFNvdXJjZS9KYXZhU2NyaXB0Q29yZS9DaGFuZ2VMb2cKPT09PT09PT09PT09PT09PT09
PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PQotLS0gU291
cmNlL0phdmFTY3JpcHRDb3JlL0NoYW5nZUxvZwkocmV2aXNpb24gMTY3MDczKQorKysgU291cmNl
L0phdmFTY3JpcHRDb3JlL0NoYW5nZUxvZwkod29ya2luZyBjb3B5KQpAQCAtMSwzICsxLDIwIEBA
CisyMDE0LTA0LTEwICBNYXJrIExhbSAgPG1hcmsubGFtQGFwcGxlLmNvbT4KKworICAgICAgICBM
TElOVCBsb2FkaXNGcm9tSW5zdHJ1Y3Rpb24gc2hvdWxkIGhhbmRsZSBiaWcgZW5kaWFuIGNhc2Uu
CisgICAgICAgIDxodHRwczovL3dlYmtpdC5vcmcvYi8xMzE0OTU+CisKKyAgICAgICAgUmV2aWV3
ZWQgYnkgTk9CT0RZIChPT1BTISkuCisKKyAgICAgICAgVGhlIExMSU5UIGxvYWRpc0Zyb21JbnN0
cnVjdGlvbiBtYWNybyBhaW1zIHRvIGxvYWQgdGhlIGxlYXN0IHNpZ25pZmljYW50CisgICAgICAg
IDMyLWJpdCB3b3JkIGZyb20gdGhlIDY0LWJpdCBieXRlY29kZSBpbnN0cnVjdGlvbiBzdHJlYW0g
YW5kIHNpZ24gZXh0ZW5kCisgICAgICAgIGl0LiAgRm9yIGJpZyBlbmRpYW4gbWFjaGluZXMsIHRo
ZSBjdXJyZW50IGltcGxlbWVudGF0aW9uIHdvdWxkIGxvYWQgdGhlCisgICAgICAgIHdyb25nIDMy
LWJpdCB3b3JkLgorCisgICAgICAgIFdpdGhvdXQgdGhpcyBmaXgsIHRoZSBKU0MgdGVzdHMgd2ls
bCBjcmFzaCBvbiBiaWcgZW5kaWFuIG1hY2hpbmVzLgorICAgICAgICBUaGFua3MgdG8gVG9tYXMg
UG9wZWxhIGZvciBkaWFnbm9zaW5nIHRoaXMgaXNzdWUuCisKKyAgICAgICAgKiBsbGludC9Mb3dM
ZXZlbEludGVycHJldGVyLmFzbToKKwogMjAxNC0wNC0wOSAgTWFyayBMYW0gIDxtYXJrLmxhbUBh
cHBsZS5jb20+CiAKICAgICAgICAgVGVtcG9yYXJpbHkgZGlzYWJsZSB0aGUgSklUIGZvciB0aGUg
V2luZG93cyBwb3J0LgpJbmRleDogU291cmNlL0phdmFTY3JpcHRDb3JlL2xsaW50L0xvd0xldmVs
SW50ZXJwcmV0ZXIuYXNtCj09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09
PT09PT09PT09PT09PT09PT09PT09PT09PT0KLS0tIFNvdXJjZS9KYXZhU2NyaXB0Q29yZS9sbGlu
dC9Mb3dMZXZlbEludGVycHJldGVyLmFzbQkocmV2aXNpb24gMTY3MDczKQorKysgU291cmNlL0ph
dmFTY3JpcHRDb3JlL2xsaW50L0xvd0xldmVsSW50ZXJwcmV0ZXIuYXNtCSh3b3JraW5nIGNvcHkp
CkBAIC0xMDYsNyArMTA2LDExIEBAIGlmIEpTVkFMVUU2NAogICAgIGNvbnN0IHRhZ01hc2sgPSBj
c3IyCiAgICAgCiAgICAgbWFjcm8gbG9hZGlzRnJvbUluc3RydWN0aW9uKG9mZnNldCwgZGVzdCkK
K2lmIEJJR19FTkRJQU4KKyAgICAgICAgbG9hZGlzIDQgKyBvZmZzZXQgKiA4W1BCLCBQQywgOF0s
IGRlc3QKK2Vsc2UKICAgICAgICAgbG9hZGlzIG9mZnNldCAqIDhbUEIsIFBDLCA4XSwgZGVzdAor
ZW5kCiAgICAgZW5kCiAgICAgCiAgICAgbWFjcm8gbG9hZHBGcm9tSW5zdHJ1Y3Rpb24ob2Zmc2V0
LCBkZXN0KQo=
</data>

          </attachment>
          <attachment
              isobsolete="0"
              ispatch="1"
              isprivate="0"
          >
            <attachid>229056</attachid>
            <date>2014-04-10 10:03:47 -0700</date>
            <delta_ts>2014-04-10 10:50:42 -0700</delta_ts>
            <desc>patch 2: updated comment.</desc>
            <filename>bug-131495.patch</filename>
            <type>text/plain</type>
            <size>1551</size>
            <attacher name="Mark Lam">mark.lam</attacher>
            
              <data encoding="base64">SW5kZXg6IFNvdXJjZS9KYXZhU2NyaXB0Q29yZS9DaGFuZ2VMb2cKPT09PT09PT09PT09PT09PT09
PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PQotLS0gU291
cmNlL0phdmFTY3JpcHRDb3JlL0NoYW5nZUxvZwkocmV2aXNpb24gMTY3MDczKQorKysgU291cmNl
L0phdmFTY3JpcHRDb3JlL0NoYW5nZUxvZwkod29ya2luZyBjb3B5KQpAQCAtMSwzICsxLDIwIEBA
CisyMDE0LTA0LTEwICBNYXJrIExhbSAgPG1hcmsubGFtQGFwcGxlLmNvbT4KKworICAgICAgICBM
TElOVCBsb2FkaXNGcm9tSW5zdHJ1Y3Rpb24gc2hvdWxkIGhhbmRsZSB0aGUgYmlnIGVuZGlhbiBj
YXNlLgorICAgICAgICA8aHR0cHM6Ly93ZWJraXQub3JnL2IvMTMxNDk1PgorCisgICAgICAgIFJl
dmlld2VkIGJ5IE5PQk9EWSAoT09QUyEpLgorCisgICAgICAgIFRoZSBMTElOVCBsb2FkaXNGcm9t
SW5zdHJ1Y3Rpb24gbWFjcm8gYWltcyB0byBsb2FkIHRoZSBsZWFzdCBzaWduaWZpY2FudAorICAg
ICAgICAzMi1iaXQgd29yZCBmcm9tIHRoZSA2NC1iaXQgYnl0ZWNvZGUgaW5zdHJ1Y3Rpb24gc3Ry
ZWFtIGFuZCBzaWduIGV4dGVuZAorICAgICAgICBpdC4gIEZvciBiaWcgZW5kaWFuIG1hY2hpbmVz
LCB0aGUgY3VycmVudCBpbXBsZW1lbnRhdGlvbiB3b3VsZCBsb2FkIHRoZQorICAgICAgICB3cm9u
ZyAzMi1iaXQgd29yZC4KKworICAg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Uluc3RydWN0aW9uKG9m
ZnNldCwgZGVzdCkK
</data>

          </attachment>
      

    </bug>

</bugzilla>