Source/JavaScriptCore/ChangeLog

 12016-01-08 Filip Pizlo <fpizlo@apple.com>
 2
 3 FTL B3 fails to realize that binary snippets might choose to omit their fast path
 4 https://bugs.webkit.org/show_bug.cgi?id=152901
 5
 6 Reviewed by NOBODY (OOPS!).
 7
 8 This reduces the number of failures from 99 to 35.
 9
 10 * ftl/FTLLowerDFGToLLVM.cpp:
 11 (JSC::FTL::DFG::LowerDFGToLLVM::emitBinarySnippet):
 12
1132016-01-08 Saam barati <sbarati@apple.com>
214
315 restoreCalleeSavesFromVMCalleeSavesBuffer should use the scratch register
194772

Source/JavaScriptCore/ftl/FTLLowerDFGToLLVM.cpp

@@private:
75747574
75757575 Box<CCallHelpers::JumpList> exceptions =
75767576 exceptionHandle->scheduleExitCreation(params)->jumps(jit);
7577 
 7577
75787578 auto generator = Box<BinaryArithOpGenerator>::create(
75797579 leftOperand, rightOperand, JSValueRegs(params[0].gpr()),
75807580 JSValueRegs(params[1].gpr()), JSValueRegs(params[2].gpr()),

@@private:
75827582 scratchFPRUsage == NeedScratchFPR ? params.fpScratch(2) : InvalidFPRReg);
75837583
75847584 generator->generateFastPath(jit);
7585  generator->endJumpList().link(&jit);
7586  CCallHelpers::Label done = jit.label();
75877585
7588  params.addLatePath(
7589  [=] (CCallHelpers& jit) {
7590  AllowMacroScratchRegisterUsage allowScratch(jit);
 7586 if (generator->didEmitFastPath()) {
 7587 generator->endJumpList().link(&jit);
 7588 CCallHelpers::Label done = jit.label();
 7589
 7590 params.addLatePath(
 7591 [=] (CCallHelpers& jit) {
 7592 AllowMacroScratchRegisterUsage allowScratch(jit);
75917593
7592  generator->slowPathJumpList().link(&jit);
7593  callOperation(
7594  *state, params.unavailableRegisters(), jit, node->origin.semantic,
7595  exceptions.get(), slowPathFunction, params[0].gpr(),
7596  params[1].gpr(), params[2].gpr());
7597  jit.jump().linkTo(done, &jit);
7598  });
 7594 generator->slowPathJumpList().link(&jit);
 7595 callOperation(
 7596 *state, params.unavailableRegisters(), jit, node->origin.semantic,
 7597 exceptions.get(), slowPathFunction, params[0].gpr(),
 7598 params[1].gpr(), params[2].gpr());
 7599 jit.jump().linkTo(done, &jit);
 7600 });
 7601 } else {
 7602 callOperation(
 7603 *state, params.unavailableRegisters(), jit, node->origin.semantic,
 7604 exceptions.get(), slowPathFunction, params[0].gpr(), params[1].gpr(),
 7605 params[2].gpr());
 7606 }
75997607 });
76007608
76017609 setJSValue(patchpoint);
194748