<?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>39034</bug_id>
          
          <creation_ts>2010-05-12 17:00:44 -0700</creation_ts>
          <short_desc>String Indexing Failure on JSVALUE32 targets</short_desc>
          <delta_ts>2010-05-14 05:40:08 -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>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>0</everconfirmed>
          <reporter name="Chao-ying Fu">fu</reporter>
          <assigned_to name="Nobody">webkit-unassigned</assigned_to>
          <cc>commit-queue</cc>
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>224985</commentid>
    <comment_count>0</comment_count>
    <who name="Chao-ying Fu">fu</who>
    <bug_when>2010-05-12 17:00:44 -0700</bug_when>
    <thetext>From today&apos;s testing, I got two regressions on MIPS.
        ecma_3/Date/15.9.5.4.js
        ecma_3/Function/regress-58274.js

2 regressions found.
0 tests fixed.

  The string access is not correct, if I access from the beginning a[0], a[1], a[2], ....
Ex 1:
# ./jsc
&gt; a=&quot;01&quot;
01
&gt; a[0]
0
&gt; a[1]
0 &lt;--- THIS IS WRONG!
&gt; a[2]
undefined

Ex 2:
# ./jsc
&gt; a=&quot;01&quot;
01
&gt; a[2]
undefined
&gt; a[1]
1 &lt;--- THIS IS CORRECT!
&gt; a[0]
0

  From debugging, I think the code in JIT::stringGetByValStubGenerator() may contain redundant code.
Ex:
...
#if USE(JSVALUE64)
    jit.zeroExtend32ToPtr(regT1, regT1);
#else
    jit.emitFastArithImmToInt(regT1);
#endif
...

  The same code appears in &quot;JIT::emit_op_get_by_val()&quot;.  So, we may execute one more time in stringGetByValStubGenerator().

  I need to comment out jit.emitFastArithImmToInt(regT1) for MIPS to fix two new regressions.  Otherwise, regT1 is shifted right by 1 bit (twice) and the index to a string is wrong.

  I will post a patch soon.  Thanks a lot!</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>225031</commentid>
    <comment_count>1</comment_count>
      <attachid>55924</attachid>
    <who name="Chao-ying Fu">fu</who>
    <bug_when>2010-05-12 18:26:56 -0700</bug_when>
    <thetext>Created attachment 55924
Remove zero-extend/shift-right on regT1

Tested it on MIPS.
0 regressions found.
0 tests fixed.
OK.

For other platforms, people need to test it. Thanks!</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>225041</commentid>
    <comment_count>2</comment_count>
      <attachid>55924</attachid>
    <who name="Oliver Hunt">oliver</who>
    <bug_when>2010-05-12 18:39:13 -0700</bug_when>
    <thetext>Comment on attachment 55924
Remove zero-extend/shift-right on regT1

r=me</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>225768</commentid>
    <comment_count>3</comment_count>
      <attachid>55924</attachid>
    <who name="WebKit Commit Bot">commit-queue</who>
    <bug_when>2010-05-14 05:40:04 -0700</bug_when>
    <thetext>Comment on attachment 55924
Remove zero-extend/shift-right on regT1

Clearing flags on attachment: 55924

Committed r59469: &lt;http://trac.webkit.org/changeset/59469&gt;</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>225769</commentid>
    <comment_count>4</comment_count>
    <who name="WebKit Commit Bot">commit-queue</who>
    <bug_when>2010-05-14 05:40:08 -0700</bug_when>
    <thetext>All reviewed patches have been landed.  Closing bug.</thetext>
  </long_desc>
      
          <attachment
              isobsolete="0"
              ispatch="1"
              isprivate="0"
          >
            <attachid>55924</attachid>
            <date>2010-05-12 18:26:56 -0700</date>
            <delta_ts>2010-05-14 05:40:03 -0700</delta_ts>
            <desc>Remove zero-extend/shift-right on regT1</desc>
            <filename>jit.diff</filename>
            <type>text/plain</type>
            <size>1514</size>
            <attacher name="Chao-ying Fu">fu</attacher>
            
              <data encoding="base64">SW5kZXg6IEphdmFTY3JpcHRDb3JlL0NoYW5nZUxvZwo9PT09PT09PT09PT09PT09PT09PT09PT09
PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09Ci0tLSBKYXZhU2NyaXB0
Q29yZS9DaGFuZ2VMb2cJKHJldmlzaW9uIDU5MzMyKQorKysgSmF2YVNjcmlwdENvcmUvQ2hhbmdl
TG9nCSh3b3JraW5nIGNvcHkpCkBAIC0xLDMgKzEsMTYgQEAKKzIwMTAtMDUtMTIgIENoYW8teWlu
ZyBGdSAgPGZ1QG1pcHMuY29tPgorCisgICAgICAgIFJldmlld2VkIGJ5IE5PQk9EWSAoT09QUyEp
LgorCisgICAgICAgIFN0cmluZyBJbmRleGluZyBGYWlsdXJlIG9uIEpTVkFMVUUzMiB0YXJnZXRz
CisgICAgICAgIGh0dHBzOi8vYnVncy53ZWJraXQub3JnL3Nob3dfYnVnLmNnaT9pZD0zOTAzNAor
CisgICAgICAgIFJlbW92ZSB6ZXJvLWV4dGVuZC9zaGlmdC1yaWdodCBjb2RlIG9uIHJlZ1QxLCBi
ZWNhdXNlIHdlIGFscmVhZHkgaGF2ZQorICAgICAgICBpdCBpbiBlbWl0X29wX2dldF9ieV92YWwo
KS4KKworICAgICAgICAqIGppdC9KSVRQcm9wZXJ0eUFjY2Vzcy5jcHA6CisgICAgICAgIChKU0M6
OkpJVDo6c3RyaW5nR2V0QnlWYWxTdHViR2VuZXJhdG9yKToKKwogMjAxMC0wNS0xMiAgT2xpdmVy
IEh1bnQgIDxvbGl2ZXJAYXBwbGUuY29tPgogCi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