Ignore:
Timestamp:
Jan 29, 2014, 11:18:54 AM (12 years ago)
Author:
[email protected]
Message:

Merge the jsCStack branch
https://bugs.webkit.org/show_bug.cgi?id=127763

Reviewed by Mark Hahnenberg.

Source/JavaScriptCore:

Changes from http://svn.webkit.org/repository/webkit/branches/jsCStack
up to changeset 162958.

Source/WebCore:

Changes from http://svn.webkit.org/repository/webkit/branches/jsCStack
up to changeset 162958.

Source/WTF:

Changes from http://svn.webkit.org/repository/webkit/branches/jsCStack
up to changeset 162958.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/JavaScriptCore/dfg/DFGSpeculativeJIT.cpp

    r161438 r163027  
    13471347   
    13481348    m_jit.jitAssertHasValidCallFrame();
     1349    m_jit.jitAssertTagsInPlace();
     1350    m_jit.jitAssertArgumentCountSane();
    13491351
    13501352    for (size_t i = 0; i < m_block->variablesAtHead.numberOfArguments(); ++i) {
     
    15331535}
    15341536
     1537void SpeculativeJIT::prepareJITCodeForTierUp()
     1538{
     1539    unsigned numberOfCalls = 0;
     1540   
     1541    for (BlockIndex blockIndex = m_jit.graph().numBlocks(); blockIndex--;) {
     1542        BasicBlock* block = m_jit.graph().block(blockIndex);
     1543        if (!block)
     1544            continue;
     1545       
     1546        for (unsigned nodeIndex = block->size(); nodeIndex--;) {
     1547            Node* node = block->at(nodeIndex);
     1548           
     1549            switch (node->op()) {
     1550            case Call:
     1551            case Construct:
     1552                numberOfCalls++;
     1553                break;
     1554               
     1555            default:
     1556                break;
     1557            }
     1558        }
     1559    }
     1560   
     1561    m_jit.jitCode()->slowPathCalls.fill(0, numberOfCalls);
     1562}
     1563
    15351564bool SpeculativeJIT::compile()
    15361565{
    15371566    checkArgumentTypes();
    1538 
     1567   
     1568    if (m_jit.graph().m_plan.willTryToTierUp)
     1569        prepareJITCodeForTierUp();
     1570   
    15391571    ASSERT(!m_currentNode);
    15401572    for (BlockIndex blockIndex = 0; blockIndex < m_jit.graph().numBlocks(); ++blockIndex) {
     
    23912423    ASSERT(valueGPR != storageReg);
    23922424    MacroAssembler::Jump outOfBounds = jumpForTypedArrayOutOfBounds(node, base, property);
     2425    if (node->arrayMode().isInBounds() && outOfBounds.isSet()) {
     2426        speculationCheck(OutOfBounds, JSValueSource(), 0, outOfBounds);
     2427        outOfBounds = MacroAssembler::Jump();
     2428    }
    23932429
    23942430    switch (elementSize(type)) {
     
    24662502   
    24672503    MacroAssembler::Jump outOfBounds = jumpForTypedArrayOutOfBounds(node, base, property);
     2504    if (node->arrayMode().isInBounds() && outOfBounds.isSet()) {
     2505        speculationCheck(OutOfBounds, JSValueSource(), 0, outOfBounds);
     2506        outOfBounds = MacroAssembler::Jump();
     2507    }
    24682508   
    24692509    switch (elementSize(type)) {
     
    34303470        GPRReg multiplyAnswerGPR = multiplyAnswer.gpr();
    34313471
     3472        JITCompiler::JumpList done;
     3473       
     3474        if (shouldCheckOverflow(node->arithMode()))
     3475            speculationCheck(Overflow, JSValueRegs(), 0, m_jit.branchTest32(JITCompiler::Zero, divisorGPR));
     3476        else {
     3477            JITCompiler::Jump denominatorNotZero = m_jit.branchTest32(JITCompiler::NonZero, divisorGPR);
     3478            m_jit.move(divisorGPR, quotientThenRemainderGPR);
     3479            done.append(m_jit.jump());
     3480            denominatorNotZero.link(&m_jit);
     3481        }
     3482
    34323483        m_jit.assembler().sdiv(quotientThenRemainderGPR, dividendGPR, divisorGPR);
    34333484        // FIXME: It seems like there are cases where we don't need this? What if we have
     
    34463497        }
    34473498
     3499        done.link(&m_jit);
     3500       
    34483501        int32Result(quotientThenRemainderGPR, node);
    34493502#elif CPU(ARM64)
     
    34563509        GPRReg multiplyAnswerGPR = multiplyAnswer.gpr();
    34573510
     3511        JITCompiler::JumpList done;
     3512   
     3513        if (shouldCheckOverflow(node->arithMode()))
     3514            speculationCheck(Overflow, JSValueRegs(), 0, m_jit.branchTest32(JITCompiler::Zero, divisorGPR));
     3515        else {
     3516            JITCompiler::Jump denominatorNotZero = m_jit.branchTest32(JITCompiler::NonZero, divisorGPR);
     3517            m_jit.move(divisorGPR, quotientThenRemainderGPR);
     3518            done.append(m_jit.jump());
     3519            denominatorNotZero.link(&m_jit);
     3520        }
     3521
    34583522        m_jit.assembler().sdiv<32>(quotientThenRemainderGPR, dividendGPR, divisorGPR);
    34593523        // FIXME: It seems like there are cases where we don't need this? What if we have
     
    34713535            numeratorPositive.link(&m_jit);
    34723536        }
     3537
     3538        done.link(&m_jit);
    34733539
    34743540        int32Result(quotientThenRemainderGPR, node);
Note: See TracChangeset for help on using the changeset viewer.