<?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>279570</bug_id>
          
          <creation_ts>2024-09-11 19:39:16 -0700</creation_ts>
          <short_desc>[JSC] ObjectAllocationSinking should not omit phi insertion when pointer follows to the same value</short_desc>
          <delta_ts>2024-09-16 19:57:40 -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>WebKit 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="Jarred Sumner">jarred</reporter>
          <assigned_to name="Yusuke Suzuki">ysuzuki</assigned_to>
          <cc>webkit-bug-importer</cc>
    
    <cc>ysuzuki</cc>
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>2059548</commentid>
    <comment_count>0</comment_count>
    <who name="Jarred Sumner">jarred</who>
    <bug_when>2024-09-11 19:39:16 -0700</bug_when>
    <thetext>Code:
```
class Queue {
  _head;
  _tail;
  _length;
  constructor(items) {
    this._head = null;
    this._tail = null;
    this._length = 0;
    if (items) {
      for (const item of items) {
        this.enqueue(item);
      }
    }
  }
  enqueue(item) {
    const entry = {
      next: null,
      value: item,
    };
    if (this._tail) {
      this._tail.next = entry;
      this._tail = entry;
    } else {
      this._head = entry;
      this._tail = entry;
    }
    this._length++;
  }
  dequeue() {
    const entry = this._head;
    if (entry) {
      this._head = entry.next;
      this._length--;
      if (this._head === null) {
        this._tail = null;
      }
      return entry.value;
    } else {
      return null;
    }
  }
}
for (let i = 0; i &lt; 1e5; i++) {
  const queue = new Queue(new Set([&quot;foo&quot;, &quot;bar&quot;, &quot;baz&quot;]));
  if (queue.dequeue() !== &quot;foo&quot;) {
    throw new Error(&quot;Expected foo&quot;);
  }
  if (queue.dequeue() !== &quot;bar&quot;) {
    throw new Error(&quot;Expected bar&quot;);
  }
  if (queue.dequeue() !== &quot;baz&quot;) {
    throw new Error(&quot;Expected baz&quot;);
  }
}
```


- When the iteration count is changed from `1e5` to `1e3`, it doesn&apos;t throw. 
- When the JIT is disabled, it doesn&apos;t throw
- It doesn&apos;t throw in Node
- It throws in `jsc` and `bun`</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2059589</commentid>
    <comment_count>1</comment_count>
    <who name="Radar WebKit Bug Importer">webkit-bug-importer</who>
    <bug_when>2024-09-11 22:40:08 -0700</bug_when>
    <thetext>&lt;rdar://problem/135851156&gt;</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2059590</commentid>
    <comment_count>2</comment_count>
    <who name="Radar WebKit Bug Importer">webkit-bug-importer</who>
    <bug_when>2024-09-11 22:41:50 -0700</bug_when>
    <thetext>&lt;rdar://problem/135851268&gt;</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2059592</commentid>
    <comment_count>3</comment_count>
    <who name="Yusuke Suzuki">ysuzuki</who>
    <bug_when>2024-09-11 22:54:08 -0700</bug_when>
    <thetext>Pull request: https://github.com/WebKit/WebKit/pull/33527</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2059695</commentid>
    <comment_count>4</comment_count>
    <who name="EWS">ews-feeder</who>
    <bug_when>2024-09-12 09:33:57 -0700</bug_when>
    <thetext>Committed 283558@main (ba44420c913e): &lt;https://commits.webkit.org/283558@main&gt;

Reviewed commits have been landed. Closing PR #33527 and removing active labels.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2060526</commentid>
    <comment_count>5</comment_count>
    <who name="EWS">ews-feeder</who>
    <bug_when>2024-09-16 13:11:51 -0700</bug_when>
    <thetext>Committed 280938.337@safari-7619-branch (1648dc502217): &lt;https://commits.webkit.org/280938.337@safari-7619-branch&gt;

Reviewed commits have been landed. Closing PR #1779 and removing active labels.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2060666</commentid>
    <comment_count>6</comment_count>
    <who name="EWS">ews-feeder</who>
    <bug_when>2024-09-16 19:57:40 -0700</bug_when>
    <thetext>Committed 283286.49@safari-7620-branch (792fea9504e7): &lt;https://commits.webkit.org/283286.49@safari-7620-branch&gt;

Reviewed commits have been landed. Closing PR #1770 and removing active labels.</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>