Ignore:
Timestamp:
Dec 1, 2015, 11:31:58 AM (10 years ago)
Author:
[email protected]
Message:

Refactor FTL sub snippet code to support general binary op snippets.
https://bugs.webkit.org/show_bug.cgi?id=151706

Reviewed by Geoffrey Garen.

  • ftl/FTLCompile.cpp:
  • Moved the BinarySnippetRegisterContext to FTLCompileBinaryOp.cpp verbatim.
  • Generalize generateArithSubICFastPath() to generateBinaryOpICFastPath(). It now uses snippet specific helpers in FTLCompileBinaryOp.cpp to generate the fast paths.
  • ftl/FTLCompileBinaryOp.cpp: Added.

(JSC::FTL::BinarySnippetRegisterContext::BinarySnippetRegisterContext):
(JSC::FTL::BinarySnippetRegisterContext::initializeRegisters):
(JSC::FTL::BinarySnippetRegisterContext::restoreRegisters):

  • Moved here without changed from FTLCompile.cpp.

(JSC::FTL::generateArithSubFastPath):

  • ftl/FTLCompileBinaryOp.h: Added.
  • ftl/FTLInlineCacheDescriptor.h:

(JSC::FTL::BinaryOpDescriptor::nodeType):
(JSC::FTL::BinaryOpDescriptor::size):
(JSC::FTL::BinaryOpDescriptor::name):
(JSC::FTL::BinaryOpDescriptor::fastPathICName):
(JSC::FTL::BinaryOpDescriptor::slowPathFunction):
(JSC::FTL::BinaryOpDescriptor::leftOperand):
(JSC::FTL::BinaryOpDescriptor::rightOperand):
(JSC::FTL::BinaryOpDescriptor::BinaryOpDescriptor):
(JSC::FTL::ArithSubDescriptor::ArithSubDescriptor): Deleted.
(JSC::FTL::ArithSubDescriptor::leftType): Deleted.
(JSC::FTL::ArithSubDescriptor::rightType): Deleted.

  • Refactor ArithSubDescriptor into BinaryOpDescriptor, and re-add a sub-class ArithSubDescriptor as specializations of BinaryOpDescriptor.
  • ftl/FTLInlineCacheDescriptorInlines.h: Added.

(JSC::FTL::ArithSubDescriptor::ArithSubDescriptor):
(JSC::FTL::ArithSubDescriptor::icSize):

  • ftl/FTLLowerDFGToLLVM.cpp:

(JSC::FTL::DFG::LowerDFGToLLVM::compileArithAddOrSub):

  • ftl/FTLOSRExit.cpp:

(JSC::FTL::OSRExit::willArriveAtExitFromIndirectExceptionCheck):
(JSC::FTL::OSRExit::willArriveAtOSRExitFromCallOperation):

  • ftl/FTLOSRExit.h:
  • ftl/FTLState.h:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/JavaScriptCore/ftl/FTLLowerDFGToLLVM.cpp

    r192882 r192896  
    16561656            StackmapArgumentList arguments;
    16571657            arguments.append(m_out.constInt64(stackmapID));
    1658             arguments.append(m_out.constInt32(sizeOfArithSub()));
     1658            arguments.append(m_out.constInt32(ArithSubDescriptor::icSize()));
    16591659            arguments.append(constNull(m_out.ref8));
    16601660            arguments.append(m_out.constInt32(2));
     
    16621662            arguments.append(right);
    16631663
    1664             appendOSRExitArgumentsForPatchpointIfWillCatchException(arguments, ExceptionType::SubGenerator, 3); // left, right, and result show up in the stackmap locations.
     1664            appendOSRExitArgumentsForPatchpointIfWillCatchException(arguments,
     1665                ExceptionType::BinaryOpGenerator, 3); // left, right, and result show up in the stackmap locations.
    16651666
    16661667            LValue call = m_out.call(m_out.int64, m_out.patchpointInt64Intrinsic(), arguments);
    16671668            setInstructionCallingConvention(call, LLVMAnyRegCallConv);
    16681669
    1669             m_ftlState.arithSubs.append(ArithSubDescriptor(stackmapID, m_node->origin.semantic,
    1670                 abstractValue(m_node->child1()).resultType(),
    1671                 abstractValue(m_node->child2()).resultType()));
     1670            SnippetOperand leftOperand(abstractValue(m_node->child1()).resultType());
     1671            SnippetOperand rightOperand(abstractValue(m_node->child2()).resultType());
     1672            m_ftlState.binaryOps.append(ArithSubDescriptor(stackmapID, m_node->origin.semantic, leftOperand, rightOperand));
    16721673
    16731674            setJSValue(call);
Note: See TracChangeset for help on using the changeset viewer.