<?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>150936</bug_id>
          
          <creation_ts>2015-11-05 09:56:32 -0800</creation_ts>
          <short_desc>Crash in sorting-benchmark.js on ARM64 with full op_sub FTL coverage</short_desc>
          <delta_ts>2015-11-12 01:58:01 -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>WebKit Local 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>
          
          <blocked>150712</blocked>
          <everconfirmed>1</everconfirmed>
          <reporter name="Mark Lam">mark.lam</reporter>
          <assigned_to name="Mark Lam">mark.lam</assigned_to>
          <cc>benjamin</cc>
    
    <cc>fpizlo</cc>
    
    <cc>ggaren</cc>
    
    <cc>keith_miller</cc>
    
    <cc>msaboff</cc>
    
    <cc>ossy</cc>
    
    <cc>saam</cc>
    
    <cc>webkit-bug-importer</cc>
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>1139638</commentid>
    <comment_count>0</comment_count>
    <who name="Mark Lam">mark.lam</who>
    <bug_when>2015-11-05 09:56:32 -0800</bug_when>
    <thetext>I think this is a latent bug that has been masked by the fact that we didn&apos;t previously had FTL coverage for op_sub untyped operands.  With the add support for op_sub untyped operands, we now get the following crash on ARM64:

ASSERTION FAILED: exception
/Volumes/Data/ws2/OpenSource/Source/JavaScriptCore/jit/JITExceptions.cpp(54) : void JSC::genericUnwind(JSC::VM *, JSC::ExecState *, JSC::UnwindStart)
1   0x100bf13b0 WTFCrash
2   0x1007a9200 JSC::genericUnwind(JSC::VM*, JSC::ExecState*, JSC::UnwindStart)
3   0x1007bc33c lookupExceptionHandler
4   0x13f517234
5   0x13f4ec974
6   0x10096e8a8 llint_entry
7   0x100968bc8 vmEntryToJavaScript
8   0x1007a6160 JSC::JITCode::execute(JSC::VM*, JSC::ProtoCallFrame*)
9   0x100778030 JSC::Interpreter::execute(JSC::ProgramExecutable*, JSC::ExecState*, JSC::JSObject*)
10  0x1001f968c JSC::evaluate(JSC::ExecState*, JSC::SourceCode const&amp;, JSC::JSValue, WTF::NakedPtr&lt;JSC::Exception&gt;&amp;)
11  0x100009f0c runWithScripts(GlobalObject*, WTF::Vector&lt;Script, 0ul, WTF::CrashOnOverflow, 16ul&gt; const&amp;, bool, bool)
12  0x100008f38 jscmain(int, char**)
13  0x100008b80 main
14  0x18148a8b8 &lt;redacted&gt;

Some facts:
1. This only manifests if function benchmark#ERdD87 is FTL compiled.
   Previously, this function was prevented from being compiled due to inadequate FTL coverage of op_sub untyped operands.
2. The failure is due to the vm-&gt;exception() returning a NULL value in genericUnwind().
   Some debugging reviews that no exception was actually thrown (hence, the NULL vm-&gt;exception() value).  We got this crash probably because of some erroneous jump (or fall thru code) in the FTL.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1139639</commentid>
    <comment_count>1</comment_count>
    <who name="Mark Lam">mark.lam</who>
    <bug_when>2015-11-05 09:58:04 -0800</bug_when>
    <thetext>I should add:
3. This issue only manifests on ARM64.
   It does not manifest on X64_64.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1139640</commentid>
    <comment_count>2</comment_count>
    <who name="Radar WebKit Bug Importer">webkit-bug-importer</who>
    <bug_when>2015-11-05 09:58:37 -0800</bug_when>
    <thetext>&lt;rdar://problem/23413932&gt;</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1139710</commentid>
    <comment_count>3</comment_count>
    <who name="Mark Lam">mark.lam</who>
    <bug_when>2015-11-05 12:29:11 -0800</bug_when>
    <thetext>Investigation notes:

1. Minimum DFG white list:
benchmark#Be0R5z
bottom_up_merge_sort#A5p6f2

2. Minimum inlining depth for reproduction: 2

3. JS stack trace at point of failure:

      frame 0x16fd79780 {
         name: benchmark
         sourceURL: sorting-benchmark.js
         isInlinedFrame: false
         callee: 0x102c605b0
         returnPC: 0x11d3ca250
         callerFrame: 0x16fd79880
         rawLocationBits: 0 0x0
         codeBlock: 0x102cf4d00 benchmark#Be0R5z:[0x102cf4d00-&gt;0x102c66500-&gt;0x102c74900, FTLFunctionCall, 182]
            hasCodeOrigins: true
            callSiteIndex: 0 of 5
            line: 117
            column: 6
      }
      frame 0x16fd79880 {
         name: main
         sourceURL: sorting-benchmark.js
         isInlinedFrame: false
         callee: 0x102c604f0
         returnPC: 0x100a091a8
         callerFrame: 0x16fd798f0
         rawLocationBits: 288 0x120
         codeBlock: 0x102c67700 main#BBIyow:[0x102c67700-&gt;0x102c74600, BaselineFunctionCall, 848]
            bytecodeOffset: 288 of 848
            line: 159
            column: 14
      }
      frame 0x16fd798f0 {
         name: global code
         sourceURL: sorting-benchmark.js
         isInlinedFrame: false
         callee: 0x102c2bde0
         returnPC: 0x100a034c8
         callerFrame: 0x0
         rawLocationBits: 288 0x120
         codeBlock: 0x102c67d00 &lt;global&gt;#AA6tQf:[0x102c67d00-&gt;0x102c7da00, LLIntGlobal, 299]
            bytecodeOffset: 288 of 299
            line: 164
            column: 3
      }

4. After eliminating all uses of the subtraction operator from being DFG (and therefore FTL) compiled, I can still reproduce the crash.  This confirms that this issue is indeed not related to the support for op_sub in the FTL.

   Details: to do this experiment, I did the following:
   1. Use the DFG whitelist to only compile the 2 functions above: benchmark and bottom_up_merge_sort.
   2. noInline() every other function that uses the subtraction operator.
   3. Change the Date subtraction in benchmark() to an addition instead.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1140450</commentid>
    <comment_count>4</comment_count>
    <who name="Mark Lam">mark.lam</who>
    <bug_when>2015-11-09 11:58:43 -0800</bug_when>
    <thetext>I managed to reduce the test case a bit more and only DFG &amp; FTL compile 1 function: bottom_up_merge_sort.

With the above test case, I was observing that register x26 was getting trashed.  So, on Geoff&apos;s suggestion, before each call in the baseline JIT (plus call ICs, and a few other places) I stash away the value of x26 and x27 (a tag register) in a global vector, and overwrote them with a synthesized value.  On return from the call, I verify that x26 and x27 should contain the values that I put there, and then I restore the original values that I stashed away in the global vector.  The intent is to confirm that each callee is actually restoring the callee save registers.  x26 and x27 are both callee saved, and hence, should be restored.

With this test, I am able to catch restoration issues.  Some facts about the issue:

5. FTL compilation is necessary to reproduce the issue.

6. DFG / FTL OSR entry is not needed.

7. x26 was not restored after an OSR exit from the FTL function.

8. Added probe logging shows:

    mlam FTL Prologue: x27:0x104008a78 x26:0x10000003               // First line in FTL prologue. x26 is what I set it to be.
    mlam FTL Prologue 2000: x27:0x104008a78 x26:0xffff000000000002  // Further down in the FTL prologue, x26 is already trashed.

    // Generating the OSR exit off-ramp:
Compiling OSR exit with exitID = 2
    Owning block: bottom_up_merge_sort#CdOV1a:[0x1040a9f00-&gt;0x1040aae00-&gt;0x104060600, FTLFunctionCall, 619]  // OSR exiting.

    // Running the OSR exit off-ramp:
    mlam OSR EXIT TOP by FTL OSRExitCompiler::compileStub: x27:0x104008a78 x26:0xffff000000000002 @ bottom_up_merge_sort#CdOV1a:[0x1040a9f00-&gt;0x1040aae00-&gt;0x104060600, FTLFunctionCall, 619]
    mlam OSR EXIT BOTTOM by FTL OSRExitCompiler::compileStub: x27:0xffff000000000000 x26:0xffff000000000002 @ bottom_up_merge_sort#CdOV1a:[0x1040a9f00-&gt;0x1040aae00-&gt;0x104060600, FTLFunctionCall, 619]

    // At the end of the OSR exit, we find that x26 was not restored by the OSR exit off-ramp.
    mlam ERROR @ AFTER [3] EXIT BOTTOM by FTL OSRExitCompiler::compileStub: x26: expect 0x10000003, actual 0xffff000000000002 @ codeBlock bottom_up_merge_sort#CdOV1a:[0x1040a9f00-&gt;0x1040aae00-&gt;0x104060600, FTLFunctionCall, 619] bottom_up_merge_sort#CdOV1a:[0x1040a9

9. The OSR off-ramp disassembly only shows the following references to x26:

    Code at [0x1c02a7c80, 0x1c02a8520):
         ...
         0x1c02a7d5c: 	stur	x26, [x0, #208]
         ...

   i.e. the off-ramp thinks that there is a value in x26 that needs to be flushed to the stack.  However, it does not think there&apos;s a value in x26 that it needs to restore.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1140472</commentid>
    <comment_count>5</comment_count>
    <who name="Michael Saboff">msaboff</who>
    <bug_when>2015-11-09 12:44:15 -0800</bug_when>
    <thetext>(In reply to comment #4)
&gt; I managed to reduce the test case a bit more and only DFG &amp; FTL compile 1
&gt; function: bottom_up_merge_sort.
&gt; 
&gt; With the above test case, I was observing that register x26 was getting
&gt; trashed.  So, on Geoff&apos;s suggestion, before each call in the baseline JIT
&gt; (plus call ICs, and a few other places) I stash away the value of x26 and
&gt; x27 (a tag register) in a global vector, and overwrote them with a
&gt; synthesized value.  On return from the call, I verify that x26 and x27
&gt; should contain the values that I put there, and then I restore the original
&gt; values that I stashed away in the global vector.  The intent is to confirm
&gt; that each callee is actually restoring the callee save registers.  x26 and
&gt; x27 are both callee saved, and hence, should be restored.
&gt; 
&gt; With this test, I am able to catch restoration issues.  Some facts about the
&gt; issue:
&gt; 
&gt; 5. FTL compilation is necessary to reproduce the issue.
&gt; 
&gt; 6. DFG / FTL OSR entry is not needed.
&gt; 
&gt; 7. x26 was not restored after an OSR exit from the FTL function.
&gt; 
&gt; 8. Added probe logging shows:
&gt; 
&gt;     mlam FTL Prologue: x27:0x104008a78 x26:0x10000003               // First
&gt; line in FTL prologue. x26 is what I set it to be.
&gt;     mlam FTL Prologue 2000: x27:0x104008a78 x26:0xffff000000000002  //
&gt; Further down in the FTL prologue, x26 is already trashed.
&gt; 
&gt;     // Generating the OSR exit off-ramp:
&gt; Compiling OSR exit with exitID = 2
&gt;     Owning block:
&gt; bottom_up_merge_sort#CdOV1a:[0x1040a9f00-&gt;0x1040aae00-&gt;0x104060600,
&gt; FTLFunctionCall, 619]  // OSR exiting.
&gt; 
&gt;     // Running the OSR exit off-ramp:
&gt;     mlam OSR EXIT TOP by FTL OSRExitCompiler::compileStub: x27:0x104008a78
&gt; x26:0xffff000000000002 @
&gt; bottom_up_merge_sort#CdOV1a:[0x1040a9f00-&gt;0x1040aae00-&gt;0x104060600,
&gt; FTLFunctionCall, 619]
&gt;     mlam OSR EXIT BOTTOM by FTL OSRExitCompiler::compileStub:
&gt; x27:0xffff000000000000 x26:0xffff000000000002 @
&gt; bottom_up_merge_sort#CdOV1a:[0x1040a9f00-&gt;0x1040aae00-&gt;0x104060600,
&gt; FTLFunctionCall, 619]
&gt; 
&gt;     // At the end of the OSR exit, we find that x26 was not restored by the
&gt; OSR exit off-ramp.
&gt;     mlam ERROR @ AFTER [3] EXIT BOTTOM by FTL OSRExitCompiler::compileStub:
&gt; x26: expect 0x10000003, actual 0xffff000000000002 @ codeBlock
&gt; bottom_up_merge_sort#CdOV1a:[0x1040a9f00-&gt;0x1040aae00-&gt;0x104060600,
&gt; FTLFunctionCall, 619] bottom_up_merge_sort#CdOV1a:[0x1040a9
&gt; 
&gt; 9. The OSR off-ramp disassembly only shows the following references to x26:
&gt; 
&gt;     Code at [0x1c02a7c80, 0x1c02a8520):
&gt;          ...
&gt;          0x1c02a7d5c: 	stur	x26, [x0, #208]
&gt;          ...
&gt; 
&gt;    i.e. the off-ramp thinks that there is a value in x26 that needs to be
&gt; flushed to the stack.  However, it does not think there&apos;s a value in x26
&gt; that it needs to restore.

I believe that is the code in the OSRExit handler that saves every register to a scratch buffer.  If that is the only reference to x26, then it sounds like the FTL doesn&apos;t think that it used x26.


Did the FTL compiled function save x26 and is it actively using it?  The unwind information for the function should show that it was saved and we turn that into the a RegisterAtOffsetList in parseUnwindInfo().  We use that registerAtOffset list to manage our callee saves, including during OSR exit processing.

You can also look at the FTL disassembly to see if the FTL function saves x26 and where it materializes the tag mask constant into x26.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1140507</commentid>
    <comment_count>6</comment_count>
    <who name="Mark Lam">mark.lam</who>
    <bug_when>2015-11-09 13:33:58 -0800</bug_when>
    <thetext>(In reply to comment #5)
&gt; You can also look at the FTL disassembly to see if the FTL function saves
&gt; x26 and where it materializes the tag mask constant into x26.

From the FTL disassembly:

Generated LLVM code after stackmap-based fix-up for bottom_up_merge_sort#CdOV1a:[0x104899f00-&gt;0x10489ae00-&gt;0x10486c600, FTLFunctionCall, 619] in FTLMode #0, __text:
         0x10de45ae0: 	stp	x28, x27, [sp, #-96]!
         0x10de45ae4: 	stp	x26, x25, [sp, #16]        // x26 saved right at the start of the function.
         0x10de45ae8: 	stp	x24, x23, [sp, #32]
         0x10de45aec: 	stp	x22, x21, [sp, #48]
         0x10de45af0: 	stp	x20, x19, [sp, #64]
         0x10de45af4: 	stp	x29, x30, [sp, #80]
         0x10de45af8: 	add	x29, sp, #80
         0x10de45afc: 	sub	sp, sp, #112
         ...
         0x10de45cac: 	movz	x26, #0xffff, lsl #48      // Next use still in the FTL prologue code at the block for checkArguments: no more saving to the stack before loading a value into it.
         0x10de45cb0: 	movk	x26, #0x2
         ...

Looks like the FTL did save it, but our OSR exit compiler is not aware of it.  The exit off-ramp contains the following:

         0x10de482bc: 	movz	x17, #0xcf68
         0x10de482c0: 	movk	x17, #0x490, lsl #16
         0x10de482c4: 	movk	x17, #0x1, lsl #32
         0x10de482c8: 	ldr	 x19, [x17, xzr]
         0x10de482cc: 	ldur	x20, [x17, #8]
         0x10de482d0: 	ldur	x21, [x17, #16]
         0x10de482d4: 	ldur	x22, [x17, #24]
         0x10de482d8: 	ldur	x23, [x17, #32]
         0x10de482dc: 	ldur	x24, [x17, #40]
         0x10de482e0: 	ldur	x25, [x17, #48]

x27 and x28 gets loaded with tag values early on but are also used to store other temp values later.  I didn&apos;t trace it too carefully.  x26 gets completely left out.  I&apos;ll look into the unwind info.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1140508</commentid>
    <comment_count>7</comment_count>
    <who name="Mark Lam">mark.lam</who>
    <bug_when>2015-11-09 13:40:56 -0800</bug_when>
    <thetext>parseUnwindInfo() saw UNWIND_ARM64_FRAME_X25_X26_PAIR.  The unwind info dump says:

Unwind info for bottom_up_merge_sort#CdOV1a:[0x104899f00-&gt;0x10489ae00-&gt;0x10486c600, FTLFunctionCall, 619]:
    %r19 at -8, %r20 at -16, %r21 at -24, %r22 at -32, %r23 at -40, %r24 at -48, %r25 at -56, %r26 at -64, %r27 at -72, %r28 at -80, %fp at 0

i.e. x26 is included.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1140524</commentid>
    <comment_count>8</comment_count>
    <who name="Michael Saboff">msaboff</who>
    <bug_when>2015-11-09 14:03:17 -0800</bug_when>
    <thetext>(In reply to comment #7)
&gt; parseUnwindInfo() saw UNWIND_ARM64_FRAME_X25_X26_PAIR.  The unwind info dump
&gt; says:
&gt; 
&gt; Unwind info for
&gt; bottom_up_merge_sort#CdOV1a:[0x104899f00-&gt;0x10489ae00-&gt;0x10486c600,
&gt; FTLFunctionCall, 619]:
&gt;     %r19 at -8, %r20 at -16, %r21 at -24, %r22 at -32, %r23 at -40, %r24 at
&gt; -48, %r25 at -56, %r26 at -64, %r27 at -72, %r28 at -80, %fp at 0
&gt; 
&gt; i.e. x26 is included.

Looks like this function uses all callee saves.

x27 &amp; x28 are filled with the tag contents, because we know that is what the baseline expects.

x26 will not be restored itself, because it is also callee save for the baseline.  The baseline never uses this register, but if it did, it could put whatever it wants in that register as it will restore the prior contents when it returns.

The contents at stack offsets -64, -72 and -80 for x26, x27 and x28 should be copied to the appropriate callee save locations for the baseline frame.  From memory these should be -24[%fp] for x26, -16[%fp] for x27 and -8[%fp] for x28.  When the baseline function we are OSR exiting to returns, it will restore the prior contents of x26, x27 and x28 of the caller.

I&apos;d look to make sure that all callee save values where copied from the stack offsets given in the unwind info to the scratch buffer.  Looks like this happens in the loop near FTLOSRExitCompiler.cpp::compileStub::lines 376-382.

Then make sure that the contents saved in that loop are restored to the right register or stack offset depending on whether or not the register is a callee save for the baseline.  That is done in the loop near FTLOSRExitCompiler.cpp::compileStub::lines 430-466.  For the callee saves, we should load into x0, storing from the same.

Verify that the generated assembly makes sense.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1140553</commentid>
    <comment_count>9</comment_count>
    <who name="Mark Lam">mark.lam</who>
    <bug_when>2015-11-09 14:55:37 -0800</bug_when>
    <thetext>(In reply to comment #8)
&gt; Verify that the generated assembly makes sense.

Yes, I think it make sense.  The x26 trail I was on turns out to be a red herring.  x26 turns out to also be a baseline callee save regs.  The FTL OSR exit stores the restore value in the baseline&apos;s callee save location on the stack.  When the baseline version of the function returns, x26 was indeed restored.  Hence, it was not right for me to assert the value of x26 on OSR exit.

Once I corrected that assertion, I&apos;m getting a crash elsewhere.  I&apos;ll continue to investigate.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1141125</commentid>
    <comment_count>10</comment_count>
    <who name="Mark Lam">mark.lam</who>
    <bug_when>2015-11-11 09:28:40 -0800</bug_when>
    <thetext>Here&apos;s the latest data on what is happening on the path to manifesting this issue:

1. There are 2 functions: benchmark() and bottom_up_merge_sort().  Let&apos;s call the A() and B() for brevity.
2. A() is FTL compiled.
3. B() is FTL compiled.
4. FTL A() calls FTL B().  At B()&apos;s FTL prologue, x26 contains the value I planted there.
5. FTL B() loops for a long time.
6. FTL B() goes through an OSR exit, and deopts to baseline.  The OSR exit off-ramp puts x26&apos;s original value in the baseline stash location in its stack frame.
7. Baseline B() gets DFG optimized, and we OSR enter into DFG B().
8. DFG B() returns to FTL A().  This is where I detect that x26 has not been restored to the value that I planted there.

The issue has to be in step (7) or (8).  My guess is that (7) is the culprit.  Digging into that next.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1141140</commentid>
    <comment_count>11</comment_count>
    <who name="Mark Lam">mark.lam</who>
    <bug_when>2015-11-11 10:06:19 -0800</bug_when>
    <thetext>(In reply to comment #10)
&gt; 7. Baseline B() gets DFG optimized, and we OSR enter into DFG B().
&gt; 8. DFG B() returns to FTL A().  This is where I detect that x26 has not been
&gt; restored to the value that I planted there.
&gt; 
&gt; The issue has to be in step (7) or (8).  My guess is that (7) is the
&gt; culprit.  Digging into that next.

I verified that (8) did not think x26 needs to be restored.  In the DFG return site, emitRestoreCalleeSaves() only restored x27 and x28 because codeBlock-&gt;calleeSaveRegisters() did not include x26.

This means that the OSR entry ramp into DFG B() should have restored x26 on OSR entry, or DFG B() should have included x26 in its callee saves.  Looking into the OSR entry ramp next.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1141212</commentid>
    <comment_count>12</comment_count>
    <who name="Mark Lam">mark.lam</who>
    <bug_when>2015-11-11 13:42:55 -0800</bug_when>
    <thetext>(In reply to comment #11)
&gt; This means that the OSR entry ramp into DFG B() should have restored x26 on
&gt; OSR entry, or DFG B() should have included x26 in its callee saves.  Looking
&gt; into the OSR entry ramp next.

Michael confirmed that the issue is in the OSR entry thunk.  The generic fix is for the entry trunk to restore the appropriate registers from the VM scratch buffer.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1141262</commentid>
    <comment_count>13</comment_count>
      <attachid>265329</attachid>
    <who name="Mark Lam">mark.lam</who>
    <bug_when>2015-11-11 16:18:06 -0800</bug_when>
    <thetext>Created attachment 265329
the patch.

Still doing a full test run locally.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1141270</commentid>
    <comment_count>14</comment_count>
      <attachid>265329</attachid>
    <who name="Michael Saboff">msaboff</who>
    <bug_when>2015-11-11 16:29:02 -0800</bug_when>
    <thetext>Comment on attachment 265329
the patch.

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

r=me

&gt; Source/JavaScriptCore/ChangeLog:8
&gt; +        The OSR entry thunk does not currently restore the callee saved registers.  As a result,

I think it is more accurate to say &quot;The OSR entry thunk does not restore callee saved registers that aren&apos;t saved by the DFG&quot;.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1141396</commentid>
    <comment_count>15</comment_count>
    <who name="Mark Lam">mark.lam</who>
    <bug_when>2015-11-11 23:07:05 -0800</bug_when>
    <thetext>Thanks.  Landed in r192352: &lt;http://trac.webkit.org/r192352&gt;.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1141421</commentid>
    <comment_count>16</comment_count>
    <who name="Csaba Osztrogonác">ossy</who>
    <bug_when>2015-11-12 01:58:01 -0800</bug_when>
    <thetext>*** Bug 149061 has been marked as a duplicate of this bug. ***</thetext>
  </long_desc>
      
          <attachment
              isobsolete="0"
              ispatch="1"
              isprivate="0"
          >
            <attachid>265329</attachid>
            <date>2015-11-11 16:18:06 -0800</date>
            <delta_ts>2015-11-11 16:29:02 -0800</delta_ts>
            <desc>the patch.</desc>
            <filename>bug-150936.patch</filename>
            <type>text/plain</type>
            <size>3647</size>
            <attacher name="Mark Lam">mark.lam</attacher>
            
              <data encoding="base64">SW5kZXg6IFNvdXJjZS9KYXZhU2NyaXB0Q29yZS9DaGFuZ2VMb2cKPT09PT09PT09PT09PT09PT09
PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PQotLS0gU291
cmNlL0phdmFTY3JpcHRDb3JlL0NoYW5nZUxvZwkocmV2aXNpb24gMTkyMzMxKQorKysgU291cmNl
L0phdmFTY3JpcHRDb3JlL0NoYW5nZUxvZwkod29ya2luZyBjb3B5KQpAQCAtMSwzICsxLDM5IEBA
CisyMDE1LTExLTExICBNYXJrIExhbSAgPG1hcmsubGFtQGFwcGxlLmNvbT4KKworICAgICAgICBD
cmFzaCBpbiBzb3J0aW5nLWJlbmNobWFyay5qcyBvbiBBUk02NCB3aXRoIGZ1bGwgb3Bfc3ViIEZU
TCBjb3ZlcmFnZS4KKyAgICAgICAga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lZ1QxKTsKICAgICAK
ICAgICBMaW5rQnVmZmVyIHBhdGNoQnVmZmVyKCp2bSwgaml0LCBHTE9CQUxfVEhVTktfSUQpOwo=
</data>
<flag name="review"
          id="290381"
          type_id="1"
          status="+"
          setter="msaboff"
    />
          </attachment>
      

    </bug>

</bugzilla>