<?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>211592</bug_id>
          
          <creation_ts>2020-05-07 13:18:31 -0700</creation_ts>
          <short_desc>CLoop JSC broken on 32-bit big endian</short_desc>
          <delta_ts>2021-02-18 16:15:53 -0800</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="q66">q66</reporter>
          <assigned_to name="Nobody">webkit-unassigned</assigned_to>
          <cc>julianaito</cc>
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>1650325</commentid>
    <comment_count>0</comment_count>
      <attachid>398788</attachid>
    <who name="q66">q66</who>
    <bug_when>2020-05-07 13:18:31 -0700</bug_when>
    <thetext>Created attachment 398788
proposed patch

For quite a few versions, CLoop JSC has been broken on 32-bit BE (e.g. 32-bit PowerPC). I tried debugging around it some time ago and found that specifically on 32-bit BE platforms, some things need offsetting by PayloadOffset (4 on BE, 0 on LE, regardless of 32-bit or 64-bit), just like is done in various other places already, presumably because on 32-bit BE you might have 32-bit values in 64-bit storage at an offset.

I attached the proposed patch. With this, all versions of WebKit I&apos;ve had access to (including latest master) work on 32-bit BE (tested on a PowerBook G4; we&apos;ve shipped a variant of this in my distribution at least since WebKit Gtk 2.24). I&apos;m not sure if the JSVALUE64 ifs are needed in these specific paths, that would need figuring out if those paths ever get called on 64-bit, since on 64-bit BE WebKit works perfectly fine even now. That said, I tried the patch without the conditional JSVALUE64 checking and it also seems to have worked on both 32 and 64-bit BE - I put them there to be on the safe side (in order to possibly not regress some edge cases for 64-bit BE).

Could someone with knowledge of these code paths pitch in and say if JSVALUE64 needs to be checked or not, or possibly where?

For now this is here for review. Once it gets some feedback, I can make it into a proper patch with a ChangeLog entry and so on.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1714899</commentid>
    <comment_count>1</comment_count>
    <who name="Charlene Wendling">julianaito</who>
    <bug_when>2020-12-15 13:24:20 -0800</bug_when>
    <thetext>That patch fixes the JS runtime on OpenBSD/macppc, thanks Daniel.

I hope to see that patch reviewed one day.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1731080</commentid>
    <comment_count>2</comment_count>
    <who name="q66">q66</who>
    <bug_when>2021-02-18 16:15:53 -0800</bug_when>
    <thetext>fixed https://bugs.webkit.org/show_bug.cgi?id=221710</thetext>
  </long_desc>
      
          <attachment
              isobsolete="0"
              ispatch="1"
              isprivate="0"
          >
            <attachid>398788</attachid>
            <date>2020-05-07 13:18:31 -0700</date>
            <delta_ts>2020-05-07 13:18:31 -0700</delta_ts>
            <desc>proposed patch</desc>
            <filename>ppc-llint.patch</filename>
            <type>text/plain</type>
            <size>1765</size>
            <attacher name="q66">q66</attacher>
            
              <data encoding="base64">LS0tIGEvU291cmNlL0phdmFTY3JpcHRDb3JlL2xsaW50L0xvd0xldmVsSW50ZXJwcmV0ZXIzMl82
NC5hc20KKysrIGIvU291cmNlL0phdmFTY3JpcHRDb3JlL2xsaW50L0xvd0xldmVsSW50ZXJwcmV0
ZXIzMl82NC5hc20KQEAgLTE0ODAsMTMgKzE0ODAsMjEgQEAgbGxpbnRPcFdpdGhNZXRhZGF0YShv
cF9wdXRfYnlfaWQsIE9wUHV0QnlJZCwgb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