| Differences between
and this patch
- Source/JavaScriptCore/bytecode/SpeculatedType.h +5 lines
Lines 149-154 inline bool isStringSpeculation(Speculat Source/JavaScriptCore/bytecode/SpeculatedType.h_sec1
149
    return !!value && (value & SpecString) == value;
149
    return !!value && (value & SpecString) == value;
150
}
150
}
151
151
152
inline bool isStringOrOtherSpeculation(SpeculatedType value)
153
{
154
    return !!value && (value & (SpecString | SpecOther)) == value;
155
}
156
152
inline bool isSymbolSpeculation(SpeculatedType value)
157
inline bool isSymbolSpeculation(SpeculatedType value)
153
{
158
{
154
    return value == SpecSymbol;
159
    return value == SpecSymbol;
- Source/JavaScriptCore/dfg/DFGFixupPhase.cpp +4 lines
Lines 418-423 private: Source/JavaScriptCore/dfg/DFGFixupPhase.cpp_sec1
418
                fixEdge<DoubleRepUse>(node->child1());
418
                fixEdge<DoubleRepUse>(node->child1());
419
            else if (node->child1()->shouldSpeculateString())
419
            else if (node->child1()->shouldSpeculateString())
420
                fixEdge<StringUse>(node->child1());
420
                fixEdge<StringUse>(node->child1());
421
            else if (node->child1()->shouldSpeculateStringOrOther())
422
                fixEdge<StringOrOtherUse>(node->child1());
421
            break;
423
            break;
422
        }
424
        }
423
425
Lines 921-926 private: Source/JavaScriptCore/dfg/DFGFixupPhase.cpp_sec2
921
                fixEdge<DoubleRepUse>(node->child1());
923
                fixEdge<DoubleRepUse>(node->child1());
922
            else if (node->child1()->shouldSpeculateString())
924
            else if (node->child1()->shouldSpeculateString())
923
                fixEdge<StringUse>(node->child1());
925
                fixEdge<StringUse>(node->child1());
926
            else if (node->child1()->shouldSpeculateStringOrOther())
927
                fixEdge<StringOrOtherUse>(node->child1());
924
            break;
928
            break;
925
        }
929
        }
926
            
930
            
- Source/JavaScriptCore/dfg/DFGNode.h +5 lines
Lines 1957-1962 struct Node { Source/JavaScriptCore/dfg/DFGNode.h_sec1
1957
        return isStringSpeculation(prediction());
1957
        return isStringSpeculation(prediction());
1958
    }
1958
    }
1959
 
1959
 
1960
    bool shouldSpeculateStringOrOther()
1961
    {
1962
        return isStringOrOtherSpeculation(prediction());
1963
    }
1964
 
1960
    bool shouldSpeculateStringObject()
1965
    bool shouldSpeculateStringObject()
1961
    {
1966
    {
1962
        return isStringObjectSpeculation(prediction());
1967
        return isStringObjectSpeculation(prediction());
- Source/JavaScriptCore/dfg/DFGSafeToExecute.h +1 lines
Lines 61-66 public: Source/JavaScriptCore/dfg/DFGSafeToExecute.h_sec1
61
        case ObjectOrOtherUse:
61
        case ObjectOrOtherUse:
62
        case StringIdentUse:
62
        case StringIdentUse:
63
        case StringUse:
63
        case StringUse:
64
        case StringOrOtherUse:
64
        case SymbolUse:
65
        case SymbolUse:
65
        case StringObjectUse:
66
        case StringObjectUse:
66
        case StringOrStringObjectUse:
67
        case StringOrStringObjectUse:
- Source/JavaScriptCore/dfg/DFGSpeculativeJIT32_64.cpp +8 lines
Lines 1629-1634 void SpeculativeJIT::compileLogicalNot(N Source/JavaScriptCore/dfg/DFGSpeculativeJIT32_64.cpp_sec1
1629
    case StringUse:
1629
    case StringUse:
1630
        return compileStringZeroLength(node);
1630
        return compileStringZeroLength(node);
1631
1631
1632
    case StringOrOtherUse:
1633
        return compileLogicalNotStringOrOther(node);
1634
1632
    default:
1635
    default:
1633
        RELEASE_ASSERT_NOT_REACHED();
1636
        RELEASE_ASSERT_NOT_REACHED();
1634
        break;
1637
        break;
Lines 1719-1724 void SpeculativeJIT::emitBranch(Node* no Source/JavaScriptCore/dfg/DFGSpeculativeJIT32_64.cpp_sec2
1719
        return;
1722
        return;
1720
    }
1723
    }
1721
1724
1725
    case StringOrOtherUse: {
1726
        emitStringOrOtherBranch(node->child1(), taken, notTaken);
1727
        return;
1728
    }
1729
1722
    case DoubleRepUse:
1730
    case DoubleRepUse:
1723
    case Int32Use: {
1731
    case Int32Use: {
1724
        if (node->child1().useKind() == Int32Use) {
1732
        if (node->child1().useKind() == Int32Use) {
- Source/JavaScriptCore/dfg/DFGSpeculativeJIT64.cpp +8 lines
Lines 1774-1779 void SpeculativeJIT::compileLogicalNot(N Source/JavaScriptCore/dfg/DFGSpeculativeJIT64.cpp_sec1
1774
    case StringUse:
1774
    case StringUse:
1775
        return compileStringZeroLength(node);
1775
        return compileStringZeroLength(node);
1776
1776
1777
    case StringOrOtherUse:
1778
        return compileLogicalNotStringOrOther(node);
1779
1777
    default:
1780
    default:
1778
        DFG_CRASH(m_jit.graph(), node, "Bad use kind");
1781
        DFG_CRASH(m_jit.graph(), node, "Bad use kind");
1779
        break;
1782
        break;
Lines 1875-1880 void SpeculativeJIT::emitBranch(Node* no Source/JavaScriptCore/dfg/DFGSpeculativeJIT64.cpp_sec2
1875
        return;
1878
        return;
1876
    }
1879
    }
1877
1880
1881
    case StringOrOtherUse: {
1882
        emitStringOrOtherBranch(node->child1(), taken, notTaken);
1883
        return;
1884
    }
1885
1878
    case UntypedUse:
1886
    case UntypedUse:
1879
    case BooleanUse:
1887
    case BooleanUse:
1880
    case KnownBooleanUse: {
1888
    case KnownBooleanUse: {
- Source/JavaScriptCore/dfg/DFGSpeculativeJIT.cpp -5 / +72 lines
Lines 5117-5122 void SpeculativeJIT::compileStringZeroLe Source/JavaScriptCore/dfg/DFGSpeculativeJIT.cpp_sec1
5117
    unblessedBooleanResult(eqGPR, node);
5117
    unblessedBooleanResult(eqGPR, node);
5118
}
5118
}
5119
5119
5120
void SpeculativeJIT::compileLogicalNotStringOrOther(Node* node)
5121
{
5122
    JSValueOperand value(this, node->child1());
5123
    GPRTemporary temp(this);
5124
    JSValueRegs valueRegs = value.jsValueRegs();
5125
    GPRReg tempGPR = temp.gpr();
5126
5127
    JITCompiler::Jump notCell = m_jit.branchIfNotCell(valueRegs);
5128
    GPRReg cellGPR = valueRegs.payloadGPR();
5129
    DFG_TYPE_CHECK(
5130
        valueRegs, node->chuld1(), (~SpecCell) | SpecString, m_jit.branchIfNotString(cellGPR));
5131
    m_jit.test32(
5132
        JITCompiler::Zero, JITCompiler::Address(cellGPR, JSString::offsetOfLength()),
5133
        JITCompiler::TrustedImm32(-1), tempGPR);
5134
    JITCompiler::Jump done = m_jit.jump();
5135
    notCell.link(&m_jit);
5136
    DFG_TYPE_CHECK(
5137
        valueRegs, node->child1(), SpecCell | SpecOther, m_jit.branchIfNotOther(valueRets, tempGPR));
5138
    m_jit.move(TrustedImm32(1), tempGPR);
5139
    done.link(&m_jit);
5140
5141
    unblessedBooleanResult(tempGPR, node);
5142
}
5143
5120
void SpeculativeJIT::emitStringBranch(Edge nodeUse, BasicBlock* taken, BasicBlock* notTaken)
5144
void SpeculativeJIT::emitStringBranch(Edge nodeUse, BasicBlock* taken, BasicBlock* notTaken)
5121
{
5145
{
5122
    SpeculateCellOperand str(this, nodeUse);
5146
    SpeculateCellOperand str(this, nodeUse);
Lines 5126-5131 void SpeculativeJIT::emitStringBranch(Ed Source/JavaScriptCore/dfg/DFGSpeculativeJIT.cpp_sec2
5126
    noResult(m_currentNode);
5150
    noResult(m_currentNode);
5127
}
5151
}
5128
5152
5153
void SpeculativeJIT::emitStringOrOtherBranch(Edge nodeUse, BasicBlock* taken, BasicBlock* notTaken)
5154
{
5155
    JSValueOperand value(this, nodeUse);
5156
    GPRTemporary temp(this);
5157
    JSValueRegs valueRegs = value.jsValueRegs();
5158
    GPRReg tempGPR = temp.gpr();
5159
    
5160
    JITCompiler::Jump notCell = m_jit.branchIfNotCell(valueRegs);
5161
    GPRReg cellGPR = valueRegs.payloadGPR();
5162
    DFG_TYPE_CHECK(valueRegs, nodeUse, (~SpecCell) | SpecString, m_jit.branchIfNotString(cellGPR));
5163
    branchTest32(
5164
        JITCompiler::Zero, JITCompiler::Address(cellGPR, JSString::offsetOfLength()),
5165
        JITCompiler::TrustedImm32(-1), notTaken);
5166
    jump(taken, ForceJump);
5167
    notCell.link(&m_jit);
5168
    DFG_TYPE_CHECK(
5169
        valueRegs, nodeUse, SpecCell | SpecOther, m_jit.branchIfNotOther(valueRets, tempGPR));
5170
    jump(notTaken);
5171
    noResult(m_currentNode);
5172
}
5173
5129
void SpeculativeJIT::compileConstantStoragePointer(Node* node)
5174
void SpeculativeJIT::compileConstantStoragePointer(Node* node)
5130
{
5175
{
5131
    GPRTemporary storage(this);
5176
    GPRTemporary storage(this);
Lines 6651-6661 void SpeculativeJIT::speculateObjectOrOt Source/JavaScriptCore/dfg/DFGSpeculativeJIT.cpp_sec3
6651
        operand.jsValueRegs(), edge, (~SpecCell) | SpecObject, m_jit.branchIfNotObject(gpr));
6696
        operand.jsValueRegs(), edge, (~SpecCell) | SpecObject, m_jit.branchIfNotObject(gpr));
6652
    MacroAssembler::Jump done = m_jit.jump();
6697
    MacroAssembler::Jump done = m_jit.jump();
6653
    notCell.link(&m_jit);
6698
    notCell.link(&m_jit);
6654
    if (needsTypeCheck(edge, SpecCell | SpecOther)) {
6699
    DFG_TYPE_CHECK(
6655
        typeCheck(
6700
        operand.jsValueRegs(), edge, SpecCell | SpecOther, m_jit.branchIfNotOther(regs, tempGPR));
6656
            operand.jsValueRegs(), edge, SpecCell | SpecOther,
6657
            m_jit.branchIfNotOther(operand.jsValueRegs(), tempGPR));
6658
    }
6659
    done.link(&m_jit);
6701
    done.link(&m_jit);
6660
}
6702
}
6661
6703
Lines 6665-6670 void SpeculativeJIT::speculateString(Edg Source/JavaScriptCore/dfg/DFGSpeculativeJIT.cpp_sec4
6665
        JSValueSource::unboxedCell(cell), edge, SpecString | ~SpecCell, m_jit.branchIfNotString(cell));
6707
        JSValueSource::unboxedCell(cell), edge, SpecString | ~SpecCell, m_jit.branchIfNotString(cell));
6666
}
6708
}
6667
6709
6710
void SpeculativeJIT::speculateStringOrOther(Edge edge, JSValueRegs regs, GPRReg scratch)
6711
{
6712
    JITCompiler::Jump notCell = m_jit.branchIfNotCell(regs);
6713
    GPRReg cell = regs.payloadGPR();
6714
    DFG_TYPE_CHECK(regs, edge, (~SpecCell) | SpecString, m_jit.branchIfNotString(cell));
6715
    JITCompiler::Jump done = m_jit.jump();
6716
    DFG_TYPE_CHECK(regs, edge, SpecCell | SpecOther, m_jit.branchIfNotOther(regs, scratch));
6717
    done.link(&m_jit);
6718
}
6719
6720
void SpeculativeJIT::speculateStringOrOther(Edge edge)
6721
{
6722
    if (!needsTypeCheck(edge, SpecString | SpecOther))
6723
        return;
6724
6725
    JSValueOperand operand(this, edge, ManualOperandSpeculation);
6726
    GPRTemporary temp(this);
6727
    JSValueRegs regs = operand.jsValueRegs();
6728
    GPRReg tempGPR = temp.gpr();
6729
    speculateStringOrOther(edge, regs, tempGPR);
6730
}
6731
6668
void SpeculativeJIT::speculateStringIdentAndLoadStorage(Edge edge, GPRReg string, GPRReg storage)
6732
void SpeculativeJIT::speculateStringIdentAndLoadStorage(Edge edge, GPRReg string, GPRReg storage)
6669
{
6733
{
6670
    m_jit.loadPtr(MacroAssembler::Address(string, JSString::offsetOfValue()), storage);
6734
    m_jit.loadPtr(MacroAssembler::Address(string, JSString::offsetOfValue()), storage);
Lines 6912-6917 void SpeculativeJIT::speculate(Node*, Ed Source/JavaScriptCore/dfg/DFGSpeculativeJIT.cpp_sec5
6912
    case StringUse:
6976
    case StringUse:
6913
        speculateString(edge);
6977
        speculateString(edge);
6914
        break;
6978
        break;
6979
    case StringOrOtherUse:
6980
        speculateStringOrOther(edge);
6981
        break;
6915
    case SymbolUse:
6982
    case SymbolUse:
6916
        speculateSymbol(edge);
6983
        speculateSymbol(edge);
6917
        break;
6984
        break;
- Source/JavaScriptCore/dfg/DFGSpeculativeJIT.h +4 lines
Lines 2218-2223 public: Source/JavaScriptCore/dfg/DFGSpeculativeJIT.h_sec1
2218
    void compileObjectToObjectOrOtherEquality(Edge leftChild, Edge rightChild);
2218
    void compileObjectToObjectOrOtherEquality(Edge leftChild, Edge rightChild);
2219
    void compileObjectOrOtherLogicalNot(Edge value);
2219
    void compileObjectOrOtherLogicalNot(Edge value);
2220
    void compileLogicalNot(Node*);
2220
    void compileLogicalNot(Node*);
2221
    void compileLogicalNotStringOrOther(Node*);
2221
    void compileStringEquality(
2222
    void compileStringEquality(
2222
        Node*, GPRReg leftGPR, GPRReg rightGPR, GPRReg lengthGPR,
2223
        Node*, GPRReg leftGPR, GPRReg rightGPR, GPRReg lengthGPR,
2223
        GPRReg leftTempGPR, GPRReg rightTempGPR, GPRReg leftTemp2GPR,
2224
        GPRReg leftTempGPR, GPRReg rightTempGPR, GPRReg leftTemp2GPR,
Lines 2237-2242 public: Source/JavaScriptCore/dfg/DFGSpeculativeJIT.h_sec2
2237
2238
2238
    void emitObjectOrOtherBranch(Edge value, BasicBlock* taken, BasicBlock* notTaken);
2239
    void emitObjectOrOtherBranch(Edge value, BasicBlock* taken, BasicBlock* notTaken);
2239
    void emitStringBranch(Edge value, BasicBlock* taken, BasicBlock* notTaken);
2240
    void emitStringBranch(Edge value, BasicBlock* taken, BasicBlock* notTaken);
2241
    void emitStringOrOtherBranch(Edge value, BasicBlock* taken, BasicBlock* notTaken);
2240
    void emitBranch(Node*);
2242
    void emitBranch(Node*);
2241
    
2243
    
2242
    struct StringSwitchCase {
2244
    struct StringSwitchCase {
Lines 2552-2557 public: Source/JavaScriptCore/dfg/DFGSpeculativeJIT.h_sec3
2552
    void speculateStringIdent(Edge edge, GPRReg string);
2554
    void speculateStringIdent(Edge edge, GPRReg string);
2553
    void speculateStringIdent(Edge);
2555
    void speculateStringIdent(Edge);
2554
    void speculateString(Edge);
2556
    void speculateString(Edge);
2557
    void speculateStringOrOther(Edge, JSValueRegs, GPRReg scratch);
2558
    void speculateStringOrOther(Edge);
2555
    void speculateNotStringVar(Edge);
2559
    void speculateNotStringVar(Edge);
2556
    template<typename StructureLocationType>
2560
    template<typename StructureLocationType>
2557
    void speculateStringObjectForStructure(Edge, StructureLocationType);
2561
    void speculateStringObjectForStructure(Edge, StructureLocationType);
- Source/JavaScriptCore/dfg/DFGUseKind.cpp +3 lines
Lines 103-108 void printInternal(PrintStream& out, Use Source/JavaScriptCore/dfg/DFGUseKind.cpp_sec1
103
    case StringUse:
103
    case StringUse:
104
        out.print("String");
104
        out.print("String");
105
        return;
105
        return;
106
    case StringOrOtherUse:
107
        out.print("StringOrOther");
108
        return;
106
    case KnownStringUse:
109
    case KnownStringUse:
107
        out.print("KnownString");
110
        out.print("KnownString");
108
        return;
111
        return;
- Source/JavaScriptCore/dfg/DFGUseKind.h +3 lines
Lines 59-64 enum UseKind { Source/JavaScriptCore/dfg/DFGUseKind.h_sec1
59
    ObjectOrOtherUse,
59
    ObjectOrOtherUse,
60
    StringIdentUse,
60
    StringIdentUse,
61
    StringUse,
61
    StringUse,
62
    StringOrOtherUse,
62
    KnownStringUse,
63
    KnownStringUse,
63
    KnownPrimitiveUse, // This bizarre type arises for op_strcat, which has a bytecode guarantee that it will only see primitives (i.e. not objects).
64
    KnownPrimitiveUse, // This bizarre type arises for op_strcat, which has a bytecode guarantee that it will only see primitives (i.e. not objects).
64
    SymbolUse,
65
    SymbolUse,
Lines 127-132 inline SpeculatedType typeFilterFor(UseK Source/JavaScriptCore/dfg/DFGUseKind.h_sec2
127
    case StringUse:
128
    case StringUse:
128
    case KnownStringUse:
129
    case KnownStringUse:
129
        return SpecString;
130
        return SpecString;
131
    case StringOrOtherUse:
132
        return SpecString | SpecOther;
130
    case KnownPrimitiveUse:
133
    case KnownPrimitiveUse:
131
        return SpecHeapTop & ~SpecObject;
134
        return SpecHeapTop & ~SpecObject;
132
    case SymbolUse:
135
    case SymbolUse:
- Source/JavaScriptCore/ftl/FTLCapabilities.cpp +1 lines
Lines 462-467 CapabilityLevel canCompile(Graph& graph) Source/JavaScriptCore/ftl/FTLCapabilities.cpp_sec1
462
                case FunctionUse:
462
                case FunctionUse:
463
                case ObjectOrOtherUse:
463
                case ObjectOrOtherUse:
464
                case StringUse:
464
                case StringUse:
465
                case StringOrOtherUse:
465
                case KnownStringUse:
466
                case KnownStringUse:
466
                case KnownPrimitiveUse:
467
                case KnownPrimitiveUse:
467
                case StringObjectUse:
468
                case StringObjectUse:
- Source/JavaScriptCore/ftl/FTLLowerDFGToB3.cpp -331 / +385 lines
Lines 154-171 public: Source/JavaScriptCore/ftl/FTLLowerDFGToB3.cpp_sec1
154
        // We use prologue frequency for all of the initialization code.
154
        // We use prologue frequency for all of the initialization code.
155
        m_out.setFrequency(1);
155
        m_out.setFrequency(1);
156
        
156
        
157
        m_prologue = FTL_NEW_BLOCK(m_out, ("Prologue"));
157
        m_prologue = m_out.newBlock();
158
        LBasicBlock stackOverflow = FTL_NEW_BLOCK(m_out, ("Stack overflow"));
158
        LBasicBlock stackOverflow = m_out.newBlock();
159
        m_handleExceptions = FTL_NEW_BLOCK(m_out, ("Handle Exceptions"));
159
        m_handleExceptions = m_out.newBlock();
160
        
160
        
161
        LBasicBlock checkArguments = FTL_NEW_BLOCK(m_out, ("Check arguments"));
161
        LBasicBlock checkArguments = m_out.newBlock();
162
162
163
        for (BlockIndex blockIndex = 0; blockIndex < m_graph.numBlocks(); ++blockIndex) {
163
        for (BlockIndex blockIndex = 0; blockIndex < m_graph.numBlocks(); ++blockIndex) {
164
            m_highBlock = m_graph.block(blockIndex);
164
            m_highBlock = m_graph.block(blockIndex);
165
            if (!m_highBlock)
165
            if (!m_highBlock)
166
                continue;
166
                continue;
167
            m_out.setFrequency(m_highBlock->executionCount);
167
            m_out.setFrequency(m_highBlock->executionCount);
168
            m_blocks.add(m_highBlock, FTL_NEW_BLOCK(m_out, ("Block ", *m_highBlock)));
168
            m_blocks.add(m_highBlock, m_out.newBlock());
169
        }
169
        }
170
170
171
        // Back to prologue frequency for any bocks that get sneakily created in the initialization code.
171
        // Back to prologue frequency for any bocks that get sneakily created in the initialization code.
Lines 1049-1056 private: Source/JavaScriptCore/ftl/FTLLowerDFGToB3.cpp_sec2
1049
            
1049
            
1050
            LValue doubleValue = unboxDouble(value);
1050
            LValue doubleValue = unboxDouble(value);
1051
            
1051
            
1052
            LBasicBlock intCase = FTL_NEW_BLOCK(m_out, ("DoubleRep RealNumberUse int case"));
1052
            LBasicBlock intCase = m_out.newBlock();
1053
            LBasicBlock continuation = FTL_NEW_BLOCK(m_out, ("DoubleRep continuation"));
1053
            LBasicBlock continuation = m_out.newBlock();
1054
            
1054
            
1055
            ValueFromBlock fastResult = m_out.anchor(doubleValue);
1055
            ValueFromBlock fastResult = m_out.anchor(doubleValue);
1056
            m_out.branch(
1056
            m_out.branch(
Lines 1077-1087 private: Source/JavaScriptCore/ftl/FTLLowerDFGToB3.cpp_sec3
1077
            
1077
            
1078
            LValue value = lowJSValue(m_node->child1(), ManualOperandSpeculation);
1078
            LValue value = lowJSValue(m_node->child1(), ManualOperandSpeculation);
1079
1079
1080
            LBasicBlock intCase = FTL_NEW_BLOCK(m_out, ("jsValueToDouble unboxing int case"));
1080
            LBasicBlock intCase = m_out.newBlock();
1081
            LBasicBlock doubleTesting = FTL_NEW_BLOCK(m_out, ("jsValueToDouble testing double case"));
1081
            LBasicBlock doubleTesting = m_out.newBlock();
1082
            LBasicBlock doubleCase = FTL_NEW_BLOCK(m_out, ("jsValueToDouble unboxing double case"));
1082
            LBasicBlock doubleCase = m_out.newBlock();
1083
            LBasicBlock nonDoubleCase = FTL_NEW_BLOCK(m_out, ("jsValueToDouble testing undefined case"));
1083
            LBasicBlock nonDoubleCase = m_out.newBlock();
1084
            LBasicBlock continuation = FTL_NEW_BLOCK(m_out, ("jsValueToDouble unboxing continuation"));
1084
            LBasicBlock continuation = m_out.newBlock();
1085
            
1085
            
1086
            m_out.branch(
1086
            m_out.branch(
1087
                isNotInt32(value, provenType(m_node->child1())),
1087
                isNotInt32(value, provenType(m_node->child1())),
Lines 1102-1113 private: Source/JavaScriptCore/ftl/FTLLowerDFGToB3.cpp_sec4
1102
            m_out.jump(continuation);
1102
            m_out.jump(continuation);
1103
1103
1104
            if (shouldConvertNonNumber) {
1104
            if (shouldConvertNonNumber) {
1105
                LBasicBlock undefinedCase = FTL_NEW_BLOCK(m_out, ("jsValueToDouble converting undefined case"));
1105
                LBasicBlock undefinedCase = m_out.newBlock();
1106
                LBasicBlock testNullCase = FTL_NEW_BLOCK(m_out, ("jsValueToDouble testing null case"));
1106
                LBasicBlock testNullCase = m_out.newBlock();
1107
                LBasicBlock nullCase = FTL_NEW_BLOCK(m_out, ("jsValueToDouble converting null case"));
1107
                LBasicBlock nullCase = m_out.newBlock();
1108
                LBasicBlock testBooleanTrueCase = FTL_NEW_BLOCK(m_out, ("jsValueToDouble testing boolean true case"));
1108
                LBasicBlock testBooleanTrueCase = m_out.newBlock();
1109
                LBasicBlock convertBooleanTrueCase = FTL_NEW_BLOCK(m_out, ("jsValueToDouble convert boolean true case"));
1109
                LBasicBlock convertBooleanTrueCase = m_out.newBlock();
1110
                LBasicBlock convertBooleanFalseCase = FTL_NEW_BLOCK(m_out, ("jsValueToDouble convert boolean false case"));
1110
                LBasicBlock convertBooleanFalseCase = m_out.newBlock();
1111
1111
1112
                m_out.appendTo(nonDoubleCase, undefinedCase);
1112
                m_out.appendTo(nonDoubleCase, undefinedCase);
1113
                LValue valueIsUndefined = m_out.equal(value, m_out.constInt64(ValueUndefined));
1113
                LValue valueIsUndefined = m_out.equal(value, m_out.constInt64(ValueUndefined));
Lines 1275-1282 private: Source/JavaScriptCore/ftl/FTLLowerDFGToB3.cpp_sec5
1275
                return;
1275
                return;
1276
            }
1276
            }
1277
            
1277
            
1278
            LBasicBlock booleanCase = FTL_NEW_BLOCK(m_out, ("BooleanToNumber boolean case"));
1278
            LBasicBlock booleanCase = m_out.newBlock();
1279
            LBasicBlock continuation = FTL_NEW_BLOCK(m_out, ("BooleanToNumber continuation"));
1279
            LBasicBlock continuation = m_out.newBlock();
1280
            
1280
            
1281
            ValueFromBlock notBooleanResult = m_out.anchor(value);
1281
            ValueFromBlock notBooleanResult = m_out.anchor(value);
1282
            m_out.branch(
1282
            m_out.branch(
Lines 1384-1392 private: Source/JavaScriptCore/ftl/FTLLowerDFGToB3.cpp_sec6
1384
    {
1384
    {
1385
        LValue value = lowJSValue(m_node->child1());
1385
        LValue value = lowJSValue(m_node->child1());
1386
        
1386
        
1387
        LBasicBlock isCellCase = FTL_NEW_BLOCK(m_out, ("ToThis is cell case"));
1387
        LBasicBlock isCellCase = m_out.newBlock();
1388
        LBasicBlock slowCase = FTL_NEW_BLOCK(m_out, ("ToThis slow case"));
1388
        LBasicBlock slowCase = m_out.newBlock();
1389
        LBasicBlock continuation = FTL_NEW_BLOCK(m_out, ("ToThis continuation"));
1389
        LBasicBlock continuation = m_out.newBlock();
1390
        
1390
        
1391
        m_out.branch(
1391
        m_out.branch(
1392
            isCell(value, provenType(m_node->child1())), usually(isCellCase), rarely(slowCase));
1392
            isCell(value, provenType(m_node->child1())), usually(isCellCase), rarely(slowCase));
Lines 1519-1526 private: Source/JavaScriptCore/ftl/FTLLowerDFGToB3.cpp_sec7
1519
            }
1519
            }
1520
            
1520
            
1521
            if (shouldCheckNegativeZero(m_node->arithMode())) {
1521
            if (shouldCheckNegativeZero(m_node->arithMode())) {
1522
                LBasicBlock slowCase = FTL_NEW_BLOCK(m_out, ("ArithMul slow case"));
1522
                LBasicBlock slowCase = m_out.newBlock();
1523
                LBasicBlock continuation = FTL_NEW_BLOCK(m_out, ("ArithMul continuation"));
1523
                LBasicBlock continuation = m_out.newBlock();
1524
                
1524
                
1525
                m_out.branch(
1525
                m_out.branch(
1526
                    m_out.notZero32(result), usually(continuation), rarely(slowCase));
1526
                    m_out.notZero32(result), usually(continuation), rarely(slowCase));
Lines 1545-1552 private: Source/JavaScriptCore/ftl/FTLLowerDFGToB3.cpp_sec8
1545
            blessSpeculation(result, Overflow, noValue(), nullptr, m_origin);
1545
            blessSpeculation(result, Overflow, noValue(), nullptr, m_origin);
1546
1546
1547
            if (shouldCheckNegativeZero(m_node->arithMode())) {
1547
            if (shouldCheckNegativeZero(m_node->arithMode())) {
1548
                LBasicBlock slowCase = FTL_NEW_BLOCK(m_out, ("ArithMul slow case"));
1548
                LBasicBlock slowCase = m_out.newBlock();
1549
                LBasicBlock continuation = FTL_NEW_BLOCK(m_out, ("ArithMul continuation"));
1549
                LBasicBlock continuation = m_out.newBlock();
1550
                
1550
                
1551
                m_out.branch(
1551
                m_out.branch(
1552
                    m_out.notZero64(result), usually(continuation), rarely(slowCase));
1552
                    m_out.notZero64(result), usually(continuation), rarely(slowCase));
Lines 1587-1594 private: Source/JavaScriptCore/ftl/FTLLowerDFGToB3.cpp_sec9
1587
            LValue denominator = lowInt32(m_node->child2());
1587
            LValue denominator = lowInt32(m_node->child2());
1588
1588
1589
            if (shouldCheckNegativeZero(m_node->arithMode())) {
1589
            if (shouldCheckNegativeZero(m_node->arithMode())) {
1590
                LBasicBlock zeroNumerator = FTL_NEW_BLOCK(m_out, ("ArithDiv zero numerator"));
1590
                LBasicBlock zeroNumerator = m_out.newBlock();
1591
                LBasicBlock numeratorContinuation = FTL_NEW_BLOCK(m_out, ("ArithDiv numerator continuation"));
1591
                LBasicBlock numeratorContinuation = m_out.newBlock();
1592
1592
1593
                m_out.branch(
1593
                m_out.branch(
1594
                    m_out.isZero32(numerator),
1594
                    m_out.isZero32(numerator),
Lines 1605-1612 private: Source/JavaScriptCore/ftl/FTLLowerDFGToB3.cpp_sec10
1605
            }
1605
            }
1606
            
1606
            
1607
            if (shouldCheckOverflow(m_node->arithMode())) {
1607
            if (shouldCheckOverflow(m_node->arithMode())) {
1608
                LBasicBlock unsafeDenominator = FTL_NEW_BLOCK(m_out, ("ArithDiv unsafe denominator"));
1608
                LBasicBlock unsafeDenominator = m_out.newBlock();
1609
                LBasicBlock continuation = FTL_NEW_BLOCK(m_out, ("ArithDiv continuation"));
1609
                LBasicBlock continuation = m_out.newBlock();
1610
1610
1611
                LValue adjustedDenominator = m_out.add(denominator, m_out.int32One);
1611
                LValue adjustedDenominator = m_out.add(denominator, m_out.int32One);
1612
                m_out.branch(
1612
                m_out.branch(
Lines 1657-1664 private: Source/JavaScriptCore/ftl/FTLLowerDFGToB3.cpp_sec11
1657
1657
1658
            LValue remainder;
1658
            LValue remainder;
1659
            if (shouldCheckOverflow(m_node->arithMode())) {
1659
            if (shouldCheckOverflow(m_node->arithMode())) {
1660
                LBasicBlock unsafeDenominator = FTL_NEW_BLOCK(m_out, ("ArithMod unsafe denominator"));
1660
                LBasicBlock unsafeDenominator = m_out.newBlock();
1661
                LBasicBlock continuation = FTL_NEW_BLOCK(m_out, ("ArithMod continuation"));
1661
                LBasicBlock continuation = m_out.newBlock();
1662
1662
1663
                LValue adjustedDenominator = m_out.add(denominator, m_out.int32One);
1663
                LValue adjustedDenominator = m_out.add(denominator, m_out.int32One);
1664
                m_out.branch(
1664
                m_out.branch(
Lines 1678-1685 private: Source/JavaScriptCore/ftl/FTLLowerDFGToB3.cpp_sec12
1678
                remainder = m_out.chillMod(numerator, denominator);
1678
                remainder = m_out.chillMod(numerator, denominator);
1679
1679
1680
            if (shouldCheckNegativeZero(m_node->arithMode())) {
1680
            if (shouldCheckNegativeZero(m_node->arithMode())) {
1681
                LBasicBlock negativeNumerator = FTL_NEW_BLOCK(m_out, ("ArithMod negative numerator"));
1681
                LBasicBlock negativeNumerator = m_out.newBlock();
1682
                LBasicBlock numeratorContinuation = FTL_NEW_BLOCK(m_out, ("ArithMod numerator continuation"));
1682
                LBasicBlock numeratorContinuation = m_out.newBlock();
1683
1683
1684
                m_out.branch(
1684
                m_out.branch(
1685
                    m_out.lessThan(numerator, m_out.int32Zero),
1685
                    m_out.lessThan(numerator, m_out.int32Zero),
Lines 1730-1737 private: Source/JavaScriptCore/ftl/FTLLowerDFGToB3.cpp_sec13
1730
            LValue left = lowDouble(m_node->child1());
1730
            LValue left = lowDouble(m_node->child1());
1731
            LValue right = lowDouble(m_node->child2());
1731
            LValue right = lowDouble(m_node->child2());
1732
            
1732
            
1733
            LBasicBlock notLessThan = FTL_NEW_BLOCK(m_out, ("ArithMin/ArithMax not less than"));
1733
            LBasicBlock notLessThan = m_out.newBlock();
1734
            LBasicBlock continuation = FTL_NEW_BLOCK(m_out, ("ArithMin/ArithMax continuation"));
1734
            LBasicBlock continuation = m_out.newBlock();
1735
            
1735
            
1736
            Vector<ValueFromBlock, 2> results;
1736
            Vector<ValueFromBlock, 2> results;
1737
            
1737
            
Lines 1800-1813 private: Source/JavaScriptCore/ftl/FTLLowerDFGToB3.cpp_sec14
1800
            LValue base = lowDouble(m_node->child1());
1800
            LValue base = lowDouble(m_node->child1());
1801
            LValue exponent = lowDouble(m_node->child2());
1801
            LValue exponent = lowDouble(m_node->child2());
1802
1802
1803
            LBasicBlock integerExponentIsSmallBlock = FTL_NEW_BLOCK(m_out, ("ArithPow test integer exponent is small."));
1803
            LBasicBlock integerExponentIsSmallBlock = m_out.newBlock();
1804
            LBasicBlock integerExponentPowBlock = FTL_NEW_BLOCK(m_out, ("ArithPow pow(double, (int)double)."));
1804
            LBasicBlock integerExponentPowBlock = m_out.newBlock();
1805
            LBasicBlock doubleExponentPowBlockEntry = FTL_NEW_BLOCK(m_out, ("ArithPow pow(double, double)."));
1805
            LBasicBlock doubleExponentPowBlockEntry = m_out.newBlock();
1806
            LBasicBlock nanExceptionExponentIsInfinity = FTL_NEW_BLOCK(m_out, ("ArithPow NaN Exception, check exponent is infinity."));
1806
            LBasicBlock nanExceptionExponentIsInfinity = m_out.newBlock();
1807
            LBasicBlock nanExceptionBaseIsOne = FTL_NEW_BLOCK(m_out, ("ArithPow NaN Exception, check base is one."));
1807
            LBasicBlock nanExceptionBaseIsOne = m_out.newBlock();
1808
            LBasicBlock powBlock = FTL_NEW_BLOCK(m_out, ("ArithPow regular pow"));
1808
            LBasicBlock powBlock = m_out.newBlock();
1809
            LBasicBlock nanExceptionResultIsNaN = FTL_NEW_BLOCK(m_out, ("ArithPow NaN Exception, result is NaN."));
1809
            LBasicBlock nanExceptionResultIsNaN = m_out.newBlock();
1810
            LBasicBlock continuation = FTL_NEW_BLOCK(m_out, ("ArithPow continuation"));
1810
            LBasicBlock continuation = m_out.newBlock();
1811
1811
1812
            LValue integerExponent = m_out.doubleToInt(exponent);
1812
            LValue integerExponent = m_out.doubleToInt(exponent);
1813
            LValue integerExponentConvertedToDouble = m_out.intToDouble(integerExponent);
1813
            LValue integerExponentConvertedToDouble = m_out.intToDouble(integerExponent);
Lines 1911-1918 private: Source/JavaScriptCore/ftl/FTLLowerDFGToB3.cpp_sec15
1911
            LValue value = lowDouble(m_node->child1());
1911
            LValue value = lowDouble(m_node->child1());
1912
            result = m_out.doubleFloor(m_out.doubleAdd(value, m_out.constDouble(0.5)));
1912
            result = m_out.doubleFloor(m_out.doubleAdd(value, m_out.constDouble(0.5)));
1913
        } else {
1913
        } else {
1914
            LBasicBlock realPartIsMoreThanHalf = FTL_NEW_BLOCK(m_out, ("ArithRound should round down"));
1914
            LBasicBlock realPartIsMoreThanHalf = m_out.newBlock();
1915
            LBasicBlock continuation = FTL_NEW_BLOCK(m_out, ("ArithRound continuation"));
1915
            LBasicBlock continuation = m_out.newBlock();
1916
1916
1917
            LValue value = lowDouble(m_node->child1());
1917
            LValue value = lowDouble(m_node->child1());
1918
            LValue integerValue = m_out.doubleCeil(value);
1918
            LValue integerValue = m_out.doubleCeil(value);
Lines 2117-2125 private: Source/JavaScriptCore/ftl/FTLLowerDFGToB3.cpp_sec16
2117
        case CellOrOtherUse: {
2117
        case CellOrOtherUse: {
2118
            LValue value = lowJSValue(m_node->child1(), ManualOperandSpeculation);
2118
            LValue value = lowJSValue(m_node->child1(), ManualOperandSpeculation);
2119
2119
2120
            LBasicBlock cellCase = FTL_NEW_BLOCK(m_out, ("CheckStructure CellOrOtherUse cell case"));
2120
            LBasicBlock cellCase = m_out.newBlock();
2121
            LBasicBlock notCellCase = FTL_NEW_BLOCK(m_out, ("CheckStructure CellOrOtherUse not cell case"));
2121
            LBasicBlock notCellCase = m_out.newBlock();
2122
            LBasicBlock continuation = FTL_NEW_BLOCK(m_out, ("CheckStructure CellOrOtherUse continuation"));
2122
            LBasicBlock continuation = m_out.newBlock();
2123
2123
2124
            m_out.branch(
2124
            m_out.branch(
2125
                isCell(value, provenType(m_node->child1())), unsure(cellCase), unsure(notCellCase));
2125
                isCell(value, provenType(m_node->child1())), unsure(cellCase), unsure(notCellCase));
Lines 2192-2199 private: Source/JavaScriptCore/ftl/FTLLowerDFGToB3.cpp_sec17
2192
        LValue cell = lowCell(m_node->child1());
2192
        LValue cell = lowCell(m_node->child1());
2193
        LValue property = !!m_node->child2() ? lowInt32(m_node->child2()) : 0;
2193
        LValue property = !!m_node->child2() ? lowInt32(m_node->child2()) : 0;
2194
        
2194
        
2195
        LBasicBlock unexpectedStructure = FTL_NEW_BLOCK(m_out, ("ArrayifyToStructure unexpected structure"));
2195
        LBasicBlock unexpectedStructure = m_out.newBlock();
2196
        LBasicBlock continuation = FTL_NEW_BLOCK(m_out, ("ArrayifyToStructure continuation"));
2196
        LBasicBlock continuation = m_out.newBlock();
2197
        
2197
        
2198
        LValue structureID = m_out.load32(cell, m_heaps.JSCell_structureID);
2198
        LValue structureID = m_out.load32(cell, m_heaps.JSCell_structureID);
2199
        
2199
        
Lines 2275-2283 private: Source/JavaScriptCore/ftl/FTLLowerDFGToB3.cpp_sec18
2275
            // https://bugs.webkit.org/show_bug.cgi?id=127830
2275
            // https://bugs.webkit.org/show_bug.cgi?id=127830
2276
            LValue value = lowJSValue(m_node->child1());
2276
            LValue value = lowJSValue(m_node->child1());
2277
            
2277
            
2278
            LBasicBlock cellCase = FTL_NEW_BLOCK(m_out, ("GetById untyped cell case"));
2278
            LBasicBlock cellCase = m_out.newBlock();
2279
            LBasicBlock notCellCase = FTL_NEW_BLOCK(m_out, ("GetById untyped not cell case"));
2279
            LBasicBlock notCellCase = m_out.newBlock();
2280
            LBasicBlock continuation = FTL_NEW_BLOCK(m_out, ("GetById untyped continuation"));
2280
            LBasicBlock continuation = m_out.newBlock();
2281
            
2281
            
2282
            m_out.branch(
2282
            m_out.branch(
2283
                isCell(value, provenType(m_node->child1())), unsure(cellCase), unsure(notCellCase));
2283
                isCell(value, provenType(m_node->child1())), unsure(cellCase), unsure(notCellCase));
Lines 2394-2401 private: Source/JavaScriptCore/ftl/FTLLowerDFGToB3.cpp_sec19
2394
        LValue cell = lowCell(m_node->child1());
2394
        LValue cell = lowCell(m_node->child1());
2395
        
2395
        
2396
        if (m_node->arrayMode().type() == Array::String) {
2396
        if (m_node->arrayMode().type() == Array::String) {
2397
            LBasicBlock slowPath = FTL_NEW_BLOCK(m_out, ("GetIndexedPropertyStorage String slow case"));
2397
            LBasicBlock slowPath = m_out.newBlock();
2398
            LBasicBlock continuation = FTL_NEW_BLOCK(m_out, ("GetIndexedPropertyStorage String continuation"));
2398
            LBasicBlock continuation = m_out.newBlock();
2399
2399
2400
            LValue fastResultValue = m_out.loadPtr(cell, m_heaps.JSString_value);
2400
            LValue fastResultValue = m_out.loadPtr(cell, m_heaps.JSString_value);
2401
            ValueFromBlock fastResult = m_out.anchor(fastResultValue);
2401
            ValueFromBlock fastResult = m_out.anchor(fastResultValue);
Lines 2436-2444 private: Source/JavaScriptCore/ftl/FTLLowerDFGToB3.cpp_sec20
2436
    {
2436
    {
2437
        LValue basePtr = lowCell(m_node->child1());    
2437
        LValue basePtr = lowCell(m_node->child1());    
2438
2438
2439
        LBasicBlock simpleCase = FTL_NEW_BLOCK(m_out, ("GetTypedArrayByteOffset wasteless typed array"));
2439
        LBasicBlock simpleCase = m_out.newBlock();
2440
        LBasicBlock wastefulCase = FTL_NEW_BLOCK(m_out, ("GetTypedArrayByteOffset wasteful typed array"));
2440
        LBasicBlock wastefulCase = m_out.newBlock();
2441
        LBasicBlock continuation = FTL_NEW_BLOCK(m_out, ("GetTypedArrayByteOffset continuation"));
2441
        LBasicBlock continuation = m_out.newBlock();
2442
        
2442
        
2443
        LValue mode = m_out.load32(basePtr, m_heaps.JSArrayBufferView_mode);
2443
        LValue mode = m_out.load32(basePtr, m_heaps.JSArrayBufferView_mode);
2444
        m_out.branch(
2444
        m_out.branch(
Lines 2546-2554 private: Source/JavaScriptCore/ftl/FTLLowerDFGToB3.cpp_sec21
2546
            
2546
            
2547
            LValue base = lowCell(m_node->child1());
2547
            LValue base = lowCell(m_node->child1());
2548
            
2548
            
2549
            LBasicBlock fastCase = FTL_NEW_BLOCK(m_out, ("GetByVal int/contiguous fast case"));
2549
            LBasicBlock fastCase = m_out.newBlock();
2550
            LBasicBlock slowCase = FTL_NEW_BLOCK(m_out, ("GetByVal int/contiguous slow case"));
2550
            LBasicBlock slowCase = m_out.newBlock();
2551
            LBasicBlock continuation = FTL_NEW_BLOCK(m_out, ("GetByVal int/contiguous continuation"));
2551
            LBasicBlock continuation = m_out.newBlock();
2552
            
2552
            
2553
            m_out.branch(
2553
            m_out.branch(
2554
                m_out.aboveOrEqual(
2554
                m_out.aboveOrEqual(
Lines 2593-2602 private: Source/JavaScriptCore/ftl/FTLLowerDFGToB3.cpp_sec22
2593
            
2593
            
2594
            LValue base = lowCell(m_node->child1());
2594
            LValue base = lowCell(m_node->child1());
2595
            
2595
            
2596
            LBasicBlock inBounds = FTL_NEW_BLOCK(m_out, ("GetByVal double in bounds"));
2596
            LBasicBlock inBounds = m_out.newBlock();
2597
            LBasicBlock boxPath = FTL_NEW_BLOCK(m_out, ("GetByVal double boxing"));
2597
            LBasicBlock boxPath = m_out.newBlock();
2598
            LBasicBlock slowCase = FTL_NEW_BLOCK(m_out, ("GetByVal double slow case"));
2598
            LBasicBlock slowCase = m_out.newBlock();
2599
            LBasicBlock continuation = FTL_NEW_BLOCK(m_out, ("GetByVal double continuation"));
2599
            LBasicBlock continuation = m_out.newBlock();
2600
            
2600
            
2601
            m_out.branch(
2601
            m_out.branch(
2602
                m_out.aboveOrEqual(
2602
                m_out.aboveOrEqual(
Lines 2664-2672 private: Source/JavaScriptCore/ftl/FTLLowerDFGToB3.cpp_sec23
2664
            LValue table = m_out.loadPtr(base, m_heaps.ScopedArguments_table);
2664
            LValue table = m_out.loadPtr(base, m_heaps.ScopedArguments_table);
2665
            LValue namedLength = m_out.load32(table, m_heaps.ScopedArgumentsTable_length);
2665
            LValue namedLength = m_out.load32(table, m_heaps.ScopedArgumentsTable_length);
2666
            
2666
            
2667
            LBasicBlock namedCase = FTL_NEW_BLOCK(m_out, ("GetByVal ScopedArguments named case"));
2667
            LBasicBlock namedCase = m_out.newBlock();
2668
            LBasicBlock overflowCase = FTL_NEW_BLOCK(m_out, ("GetByVal ScopedArguments overflow case"));
2668
            LBasicBlock overflowCase = m_out.newBlock();
2669
            LBasicBlock continuation = FTL_NEW_BLOCK(m_out, ("GetByVal ScopedArguments continuation"));
2669
            LBasicBlock continuation = m_out.newBlock();
2670
            
2670
            
2671
            m_out.branch(
2671
            m_out.branch(
2672
                m_out.aboveOrEqual(index, namedLength), unsure(overflowCase), unsure(namedCase));
2672
                m_out.aboveOrEqual(index, namedLength), unsure(overflowCase), unsure(namedCase));
Lines 2872-2878 private: Source/JavaScriptCore/ftl/FTLLowerDFGToB3.cpp_sec24
2872
        case Array::Int32:
2872
        case Array::Int32:
2873
        case Array::Double:
2873
        case Array::Double:
2874
        case Array::Contiguous: {
2874
        case Array::Contiguous: {
2875
            LBasicBlock continuation = FTL_NEW_BLOCK(m_out, ("PutByVal continuation"));
2875
            LBasicBlock continuation = m_out.newBlock();
2876
            LBasicBlock outerLastNext = m_out.appendTo(m_out.m_block, continuation);
2876
            LBasicBlock outerLastNext = m_out.appendTo(m_out.m_block, continuation);
2877
            
2877
            
2878
            switch (m_node->arrayMode().type()) {
2878
            switch (m_node->arrayMode().type()) {
Lines 2966-2973 private: Source/JavaScriptCore/ftl/FTLLowerDFGToB3.cpp_sec25
2966
                        if (isClamped(type)) {
2966
                        if (isClamped(type)) {
2967
                            ASSERT(elementSize(type) == 1);
2967
                            ASSERT(elementSize(type) == 1);
2968
                            
2968
                            
2969
                            LBasicBlock atLeastZero = FTL_NEW_BLOCK(m_out, ("PutByVal int clamp atLeastZero"));
2969
                            LBasicBlock atLeastZero = m_out.newBlock();
2970
                            LBasicBlock continuation = FTL_NEW_BLOCK(m_out, ("PutByVal int clamp continuation"));
2970
                            LBasicBlock continuation = m_out.newBlock();
2971
                            
2971
                            
2972
                            Vector<ValueFromBlock, 2> intValues;
2972
                            Vector<ValueFromBlock, 2> intValues;
2973
                            intValues.append(m_out.anchor(m_out.int32Zero));
2973
                            intValues.append(m_out.anchor(m_out.int32Zero));
Lines 2995-3003 private: Source/JavaScriptCore/ftl/FTLLowerDFGToB3.cpp_sec26
2995
                        if (isClamped(type)) {
2995
                        if (isClamped(type)) {
2996
                            ASSERT(elementSize(type) == 1);
2996
                            ASSERT(elementSize(type) == 1);
2997
                            
2997
                            
2998
                            LBasicBlock atLeastZero = FTL_NEW_BLOCK(m_out, ("PutByVal double clamp atLeastZero"));
2998
                            LBasicBlock atLeastZero = m_out.newBlock();
2999
                            LBasicBlock withinRange = FTL_NEW_BLOCK(m_out, ("PutByVal double clamp withinRange"));
2999
                            LBasicBlock withinRange = m_out.newBlock();
3000
                            LBasicBlock continuation = FTL_NEW_BLOCK(m_out, ("PutByVal double clamp continuation"));
3000
                            LBasicBlock continuation = m_out.newBlock();
3001
                            
3001
                            
3002
                            Vector<ValueFromBlock, 3> intValues;
3002
                            Vector<ValueFromBlock, 3> intValues;
3003
                            intValues.append(m_out.anchor(m_out.int32Zero));
3003
                            intValues.append(m_out.anchor(m_out.int32Zero));
Lines 3059-3066 private: Source/JavaScriptCore/ftl/FTLLowerDFGToB3.cpp_sec27
3059
                if (m_node->arrayMode().isInBounds() || m_node->op() == PutByValAlias)
3059
                if (m_node->arrayMode().isInBounds() || m_node->op() == PutByValAlias)
3060
                    m_out.store(valueToStore, pointer, storeType);
3060
                    m_out.store(valueToStore, pointer, storeType);
3061
                else {
3061
                else {
3062
                    LBasicBlock isInBounds = FTL_NEW_BLOCK(m_out, ("PutByVal typed array in bounds case"));
3062
                    LBasicBlock isInBounds = m_out.newBlock();
3063
                    LBasicBlock continuation = FTL_NEW_BLOCK(m_out, ("PutByVal typed array continuation"));
3063
                    LBasicBlock continuation = m_out.newBlock();
3064
                    
3064
                    
3065
                    m_out.branch(
3065
                    m_out.branch(
3066
                        m_out.aboveOrEqual(index, lowInt32(child5)),
3066
                        m_out.aboveOrEqual(index, lowInt32(child5)),
Lines 3146-3154 private: Source/JavaScriptCore/ftl/FTLLowerDFGToB3.cpp_sec28
3146
3146
3147
            LValue prevLength = m_out.load32(storage, m_heaps.Butterfly_publicLength);
3147
            LValue prevLength = m_out.load32(storage, m_heaps.Butterfly_publicLength);
3148
            
3148
            
3149
            LBasicBlock fastPath = FTL_NEW_BLOCK(m_out, ("ArrayPush fast path"));
3149
            LBasicBlock fastPath = m_out.newBlock();
3150
            LBasicBlock slowPath = FTL_NEW_BLOCK(m_out, ("ArrayPush slow path"));
3150
            LBasicBlock slowPath = m_out.newBlock();
3151
            LBasicBlock continuation = FTL_NEW_BLOCK(m_out, ("ArrayPush continuation"));
3151
            LBasicBlock continuation = m_out.newBlock();
3152
            
3152
            
3153
            m_out.branch(
3153
            m_out.branch(
3154
                m_out.aboveOrEqual(
3154
                m_out.aboveOrEqual(
Lines 3196-3204 private: Source/JavaScriptCore/ftl/FTLLowerDFGToB3.cpp_sec29
3196
        case Array::Contiguous: {
3196
        case Array::Contiguous: {
3197
            IndexedAbstractHeap& heap = m_heaps.forArrayType(m_node->arrayMode().type());
3197
            IndexedAbstractHeap& heap = m_heaps.forArrayType(m_node->arrayMode().type());
3198
            
3198
            
3199
            LBasicBlock fastCase = FTL_NEW_BLOCK(m_out, ("ArrayPop fast case"));
3199
            LBasicBlock fastCase = m_out.newBlock();
3200
            LBasicBlock slowCase = FTL_NEW_BLOCK(m_out, ("ArrayPop slow case"));
3200
            LBasicBlock slowCase = m_out.newBlock();
3201
            LBasicBlock continuation = FTL_NEW_BLOCK(m_out, ("ArrayPop continuation"));
3201
            LBasicBlock continuation = m_out.newBlock();
3202
            
3202
            
3203
            LValue prevLength = m_out.load32(storage, m_heaps.Butterfly_publicLength);
3203
            LValue prevLength = m_out.load32(storage, m_heaps.Butterfly_publicLength);
3204
            
3204
            
Lines 3258-3265 private: Source/JavaScriptCore/ftl/FTLLowerDFGToB3.cpp_sec30
3258
            return;
3258
            return;
3259
        }
3259
        }
3260
        
3260
        
3261
        LBasicBlock slowPath = FTL_NEW_BLOCK(m_out, ("CreateActivation slow path"));
3261
        LBasicBlock slowPath = m_out.newBlock();
3262
        LBasicBlock continuation = FTL_NEW_BLOCK(m_out, ("CreateActivation continuation"));
3262
        LBasicBlock continuation = m_out.newBlock();
3263
        
3263
        
3264
        LBasicBlock lastNext = m_out.insertNewBlocksBefore(slowPath);
3264
        LBasicBlock lastNext = m_out.insertNewBlocksBefore(slowPath);
3265
        
3265
        
Lines 3317-3324 private: Source/JavaScriptCore/ftl/FTLLowerDFGToB3.cpp_sec31
3317
            isGeneratorFunction ? m_graph.globalObjectFor(m_node->origin.semantic)->generatorFunctionStructure() :
3317
            isGeneratorFunction ? m_graph.globalObjectFor(m_node->origin.semantic)->generatorFunctionStructure() :
3318
            m_graph.globalObjectFor(m_node->origin.semantic)->functionStructure();
3318
            m_graph.globalObjectFor(m_node->origin.semantic)->functionStructure();
3319
        
3319
        
3320
        LBasicBlock slowPath = FTL_NEW_BLOCK(m_out, ("NewFunction slow path"));
3320
        LBasicBlock slowPath = m_out.newBlock();
3321
        LBasicBlock continuation = FTL_NEW_BLOCK(m_out, ("NewFunction continuation"));
3321
        LBasicBlock continuation = m_out.newBlock();
3322
        
3322
        
3323
        LBasicBlock lastNext = m_out.insertNewBlocksBefore(slowPath);
3323
        LBasicBlock lastNext = m_out.insertNewBlocksBefore(slowPath);
3324
        
3324
        
Lines 3372-3379 private: Source/JavaScriptCore/ftl/FTLLowerDFGToB3.cpp_sec32
3372
        
3372
        
3373
        unsigned minCapacity = m_graph.baselineCodeBlockFor(m_node->origin.semantic)->numParameters() - 1;
3373
        unsigned minCapacity = m_graph.baselineCodeBlockFor(m_node->origin.semantic)->numParameters() - 1;
3374
        
3374
        
3375
        LBasicBlock slowPath = FTL_NEW_BLOCK(m_out, ("CreateDirectArguments slow path"));
3375
        LBasicBlock slowPath = m_out.newBlock();
3376
        LBasicBlock continuation = FTL_NEW_BLOCK(m_out, ("CreateDirectArguments continuation"));
3376
        LBasicBlock continuation = m_out.newBlock();
3377
        
3377
        
3378
        LBasicBlock lastNext = m_out.insertNewBlocksBefore(slowPath);
3378
        LBasicBlock lastNext = m_out.insertNewBlocksBefore(slowPath);
3379
        
3379
        
Lines 3430-3437 private: Source/JavaScriptCore/ftl/FTLLowerDFGToB3.cpp_sec33
3430
        } else {
3430
        } else {
3431
            LValue stackBase = getArgumentsStart();
3431
            LValue stackBase = getArgumentsStart();
3432
            
3432
            
3433
            LBasicBlock loop = FTL_NEW_BLOCK(m_out, ("CreateDirectArguments loop body"));
3433
            LBasicBlock loop = m_out.newBlock();
3434
            LBasicBlock end = FTL_NEW_BLOCK(m_out, ("CreateDirectArguments loop end"));
3434
            LBasicBlock end = m_out.newBlock();
3435
3435
3436
            ValueFromBlock originalLength;
3436
            ValueFromBlock originalLength;
3437
            if (minCapacity) {
3437
            if (minCapacity) {
Lines 3490-3497 private: Source/JavaScriptCore/ftl/FTLLowerDFGToB3.cpp_sec34
3490
3490
3491
    void compileCopyRest()
3491
    void compileCopyRest()
3492
    {            
3492
    {            
3493
        LBasicBlock doCopyRest = FTL_NEW_BLOCK(m_out, ("CopyRest C call"));
3493
        LBasicBlock doCopyRest = m_out.newBlock();
3494
        LBasicBlock continuation = FTL_NEW_BLOCK(m_out, ("FillRestParameter continuation"));
3494
        LBasicBlock continuation = m_out.newBlock();
3495
3495
3496
        LValue arrayLength = lowInt32(m_node->child2());
3496
        LValue arrayLength = lowInt32(m_node->child2());
3497
3497
Lines 3512-3519 private: Source/JavaScriptCore/ftl/FTLLowerDFGToB3.cpp_sec35
3512
3512
3513
    void compileGetRestLength()
3513
    void compileGetRestLength()
3514
    {
3514
    {
3515
        LBasicBlock nonZeroLength = FTL_NEW_BLOCK(m_out, ("GetRestLength non zero"));
3515
        LBasicBlock nonZeroLength = m_out.newBlock();
3516
        LBasicBlock continuation = FTL_NEW_BLOCK(m_out, ("GetRestLength continuation"));
3516
        LBasicBlock continuation = m_out.newBlock();
3517
        
3517
        
3518
        ValueFromBlock zeroLengthResult = m_out.anchor(m_out.constInt32(0));
3518
        ValueFromBlock zeroLengthResult = m_out.anchor(m_out.constInt32(0));
3519
3519
Lines 3669-3679 private: Source/JavaScriptCore/ftl/FTLLowerDFGToB3.cpp_sec36
3669
                || hasDouble(structure->indexingType())
3669
                || hasDouble(structure->indexingType())
3670
                || hasContiguous(structure->indexingType()));
3670
                || hasContiguous(structure->indexingType()));
3671
3671
3672
            LBasicBlock fastCase = FTL_NEW_BLOCK(m_out, ("NewArrayWithSize fast case"));
3672
            LBasicBlock fastCase = m_out.newBlock();
3673
            LBasicBlock largeCase = FTL_NEW_BLOCK(m_out, ("NewArrayWithSize large case"));
3673
            LBasicBlock largeCase = m_out.newBlock();
3674
            LBasicBlock failCase = FTL_NEW_BLOCK(m_out, ("NewArrayWithSize fail case"));
3674
            LBasicBlock failCase = m_out.newBlock();
3675
            LBasicBlock slowCase = FTL_NEW_BLOCK(m_out, ("NewArrayWithSize slow case"));
3675
            LBasicBlock slowCase = m_out.newBlock();
3676
            LBasicBlock continuation = FTL_NEW_BLOCK(m_out, ("NewArrayWithSize continuation"));
3676
            LBasicBlock continuation = m_out.newBlock();
3677
            
3677
            
3678
            m_out.branch(
3678
            m_out.branch(
3679
                m_out.aboveOrEqual(publicLength, m_out.constInt32(MIN_ARRAY_STORAGE_CONSTRUCTION_LENGTH)),
3679
                m_out.aboveOrEqual(publicLength, m_out.constInt32(MIN_ARRAY_STORAGE_CONSTRUCTION_LENGTH)),
Lines 3700-3707 private: Source/JavaScriptCore/ftl/FTLLowerDFGToB3.cpp_sec37
3700
            m_out.store32(vectorLength, butterfly, m_heaps.Butterfly_vectorLength);
3700
            m_out.store32(vectorLength, butterfly, m_heaps.Butterfly_vectorLength);
3701
            
3701
            
3702
            if (hasDouble(m_node->indexingType())) {
3702
            if (hasDouble(m_node->indexingType())) {
3703
                LBasicBlock initLoop = FTL_NEW_BLOCK(m_out, ("NewArrayWithSize double init loop"));
3703
                LBasicBlock initLoop = m_out.newBlock();
3704
                LBasicBlock initDone = FTL_NEW_BLOCK(m_out, ("NewArrayWithSize double init done"));
3704
                LBasicBlock initDone = m_out.newBlock();
3705
                
3705
                
3706
                ValueFromBlock originalIndex = m_out.anchor(vectorLength);
3706
                ValueFromBlock originalIndex = m_out.anchor(vectorLength);
3707
                ValueFromBlock originalPointer = m_out.anchor(butterfly);
3707
                ValueFromBlock originalPointer = m_out.anchor(butterfly);
Lines 3774-3783 private: Source/JavaScriptCore/ftl/FTLLowerDFGToB3.cpp_sec38
3774
3774
3775
            LValue size = lowInt32(m_node->child1());
3775
            LValue size = lowInt32(m_node->child1());
3776
3776
3777
            LBasicBlock smallEnoughCase = FTL_NEW_BLOCK(m_out, ("NewTypedArray small enough case"));
3777
            LBasicBlock smallEnoughCase = m_out.newBlock();
3778
            LBasicBlock nonZeroCase = FTL_NEW_BLOCK(m_out, ("NewTypedArray non-zero case"));
3778
            LBasicBlock nonZeroCase = m_out.newBlock();
3779
            LBasicBlock slowCase = FTL_NEW_BLOCK(m_out, ("NewTypedArray slow case"));
3779
            LBasicBlock slowCase = m_out.newBlock();
3780
            LBasicBlock continuation = FTL_NEW_BLOCK(m_out, ("NewTypedArray continuation"));
3780
            LBasicBlock continuation = m_out.newBlock();
3781
3781
3782
            m_out.branch(
3782
            m_out.branch(
3783
                m_out.above(size, m_out.constInt32(JSArrayBufferView::fastSizeLimit)),
3783
                m_out.above(size, m_out.constInt32(JSArrayBufferView::fastSizeLimit)),
Lines 3876-3883 private: Source/JavaScriptCore/ftl/FTLLowerDFGToB3.cpp_sec39
3876
            LValue cell = lowCell(m_node->child1());
3876
            LValue cell = lowCell(m_node->child1());
3877
            LValue structureID = m_out.load32(cell, m_heaps.JSCell_structureID);
3877
            LValue structureID = m_out.load32(cell, m_heaps.JSCell_structureID);
3878
            
3878
            
3879
            LBasicBlock notString = FTL_NEW_BLOCK(m_out, ("ToString StringOrStringObject not string case"));
3879
            LBasicBlock notString = m_out.newBlock();
3880
            LBasicBlock continuation = FTL_NEW_BLOCK(m_out, ("ToString StringOrStringObject continuation"));
3880
            LBasicBlock continuation = m_out.newBlock();
3881
            
3881
            
3882
            ValueFromBlock simpleResult = m_out.anchor(cell);
3882
            ValueFromBlock simpleResult = m_out.anchor(cell);
3883
            m_out.branch(
3883
            m_out.branch(
Lines 3905-3913 private: Source/JavaScriptCore/ftl/FTLLowerDFGToB3.cpp_sec40
3905
            else
3905
            else
3906
                value = lowJSValue(m_node->child1());
3906
                value = lowJSValue(m_node->child1());
3907
            
3907
            
3908
            LBasicBlock isCell = FTL_NEW_BLOCK(m_out, ("ToString CellUse/UntypedUse is cell"));
3908
            LBasicBlock isCell = m_out.newBlock();
3909
            LBasicBlock notString = FTL_NEW_BLOCK(m_out, ("ToString CellUse/UntypedUse not string"));
3909
            LBasicBlock notString = m_out.newBlock();
3910
            LBasicBlock continuation = FTL_NEW_BLOCK(m_out, ("ToString CellUse/UntypedUse continuation"));
3910
            LBasicBlock continuation = m_out.newBlock();
3911
            
3911
            
3912
            LValue isCellPredicate;
3912
            LValue isCellPredicate;
3913
            if (m_node->child1().useKind() == CellUse)
3913
            if (m_node->child1().useKind() == CellUse)
Lines 3949-3957 private: Source/JavaScriptCore/ftl/FTLLowerDFGToB3.cpp_sec41
3949
    {
3949
    {
3950
        LValue value = lowJSValue(m_node->child1());
3950
        LValue value = lowJSValue(m_node->child1());
3951
        
3951
        
3952
        LBasicBlock isCellCase = FTL_NEW_BLOCK(m_out, ("ToPrimitive cell case"));
3952
        LBasicBlock isCellCase = m_out.newBlock();
3953
        LBasicBlock isObjectCase = FTL_NEW_BLOCK(m_out, ("ToPrimitive object case"));
3953
        LBasicBlock isObjectCase = m_out.newBlock();
3954
        LBasicBlock continuation = FTL_NEW_BLOCK(m_out, ("ToPrimitive continuation"));
3954
        LBasicBlock continuation = m_out.newBlock();
3955
        
3955
        
3956
        Vector<ValueFromBlock, 3> results;
3956
        Vector<ValueFromBlock, 3> results;
3957
        
3957
        
Lines 3988-3995 private: Source/JavaScriptCore/ftl/FTLLowerDFGToB3.cpp_sec42
3988
            numKids = 2;
3988
            numKids = 2;
3989
        }
3989
        }
3990
        
3990
        
3991
        LBasicBlock slowPath = FTL_NEW_BLOCK(m_out, ("MakeRope slow path"));
3991
        LBasicBlock slowPath = m_out.newBlock();
3992
        LBasicBlock continuation = FTL_NEW_BLOCK(m_out, ("MakeRope continuation"));
3992
        LBasicBlock continuation = m_out.newBlock();
3993
        
3993
        
3994
        LBasicBlock lastNext = m_out.insertNewBlocksBefore(slowPath);
3994
        LBasicBlock lastNext = m_out.insertNewBlocksBefore(slowPath);
3995
        
3995
        
Lines 4059-4067 private: Source/JavaScriptCore/ftl/FTLLowerDFGToB3.cpp_sec43
4059
        LValue index = lowInt32(m_node->child2());
4059
        LValue index = lowInt32(m_node->child2());
4060
        LValue storage = lowStorage(m_node->child3());
4060
        LValue storage = lowStorage(m_node->child3());
4061
            
4061
            
4062
        LBasicBlock fastPath = FTL_NEW_BLOCK(m_out, ("GetByVal String fast path"));
4062
        LBasicBlock fastPath = m_out.newBlock();
4063
        LBasicBlock slowPath = FTL_NEW_BLOCK(m_out, ("GetByVal String slow path"));
4063
        LBasicBlock slowPath = m_out.newBlock();
4064
        LBasicBlock continuation = FTL_NEW_BLOCK(m_out, ("GetByVal String continuation"));
4064
        LBasicBlock continuation = m_out.newBlock();
4065
            
4065
            
4066
        m_out.branch(
4066
        m_out.branch(
4067
            m_out.aboveOrEqual(
4067
            m_out.aboveOrEqual(
Lines 4072-4081 private: Source/JavaScriptCore/ftl/FTLLowerDFGToB3.cpp_sec44
4072
            
4072
            
4073
        LValue stringImpl = m_out.loadPtr(base, m_heaps.JSString_value);
4073
        LValue stringImpl = m_out.loadPtr(base, m_heaps.JSString_value);
4074
            
4074
            
4075
        LBasicBlock is8Bit = FTL_NEW_BLOCK(m_out, ("GetByVal String 8-bit case"));
4075
        LBasicBlock is8Bit = m_out.newBlock();
4076
        LBasicBlock is16Bit = FTL_NEW_BLOCK(m_out, ("GetByVal String 16-bit case"));
4076
        LBasicBlock is16Bit = m_out.newBlock();
4077
        LBasicBlock bitsContinuation = FTL_NEW_BLOCK(m_out, ("GetByVal String bitness continuation"));
4077
        LBasicBlock bitsContinuation = m_out.newBlock();
4078
        LBasicBlock bigCharacter = FTL_NEW_BLOCK(m_out, ("GetByVal String big character"));
4078
        LBasicBlock bigCharacter = m_out.newBlock();
4079
            
4079
            
4080
        m_out.branch(
4080
        m_out.branch(
4081
            m_out.testIsZero32(
4081
            m_out.testIsZero32(
Lines 4137-4143 private: Source/JavaScriptCore/ftl/FTLLowerDFGToB3.cpp_sec45
4137
                m_graph.watchpoints().addLazily(globalObject->stringPrototype()->structure()->transitionWatchpointSet());
4137
                m_graph.watchpoints().addLazily(globalObject->stringPrototype()->structure()->transitionWatchpointSet());
4138
                m_graph.watchpoints().addLazily(globalObject->objectPrototype()->structure()->transitionWatchpointSet());
4138
                m_graph.watchpoints().addLazily(globalObject->objectPrototype()->structure()->transitionWatchpointSet());
4139
                
4139
                
4140
                LBasicBlock negativeIndex = FTL_NEW_BLOCK(m_out, ("GetByVal String negative index"));
4140
                LBasicBlock negativeIndex = m_out.newBlock();
4141
                    
4141
                    
4142
                results.append(m_out.anchor(m_out.constInt64(JSValue::encode(jsUndefined()))));
4142
                results.append(m_out.anchor(m_out.constInt64(JSValue::encode(jsUndefined()))));
4143
                m_out.branch(
4143
                m_out.branch(
Lines 4159-4167 private: Source/JavaScriptCore/ftl/FTLLowerDFGToB3.cpp_sec46
4159
    
4159
    
4160
    void compileStringCharCodeAt()
4160
    void compileStringCharCodeAt()
4161
    {
4161
    {
4162
        LBasicBlock is8Bit = FTL_NEW_BLOCK(m_out, ("StringCharCodeAt 8-bit case"));
4162
        LBasicBlock is8Bit = m_out.newBlock();
4163
        LBasicBlock is16Bit = FTL_NEW_BLOCK(m_out, ("StringCharCodeAt 16-bit case"));
4163
        LBasicBlock is16Bit = m_out.newBlock();
4164
        LBasicBlock continuation = FTL_NEW_BLOCK(m_out, ("StringCharCodeAt continuation"));
4164
        LBasicBlock continuation = m_out.newBlock();
4165
4165
4166
        LValue base = lowCell(m_node->child1());
4166
        LValue base = lowCell(m_node->child1());
4167
        LValue index = lowInt32(m_node->child2());
4167
        LValue index = lowInt32(m_node->child2());
Lines 4217-4225 private: Source/JavaScriptCore/ftl/FTLLowerDFGToB3.cpp_sec47
4217
4217
4218
        LValue value = lowInt32(childEdge);
4218
        LValue value = lowInt32(childEdge);
4219
        
4219
        
4220
        LBasicBlock smallIntCase = FTL_NEW_BLOCK(m_out, ("StringFromCharCode small int case"));
4220
        LBasicBlock smallIntCase = m_out.newBlock();
4221
        LBasicBlock slowCase = FTL_NEW_BLOCK(m_out, ("StringFromCharCode slow case"));
4221
        LBasicBlock slowCase = m_out.newBlock();
4222
        LBasicBlock continuation = FTL_NEW_BLOCK(m_out, ("StringFromCharCode continuation"));
4222
        LBasicBlock continuation = m_out.newBlock();
4223
4223
4224
        m_out.branch(
4224
        m_out.branch(
4225
            m_out.aboveOrEqual(value, m_out.constInt32(0xff)),
4225
            m_out.aboveOrEqual(value, m_out.constInt32(0xff)),
Lines 4279-4287 private: Source/JavaScriptCore/ftl/FTLLowerDFGToB3.cpp_sec48
4279
        
4279
        
4280
        Vector<LBasicBlock, 2> blocks(data.cases.size());
4280
        Vector<LBasicBlock, 2> blocks(data.cases.size());
4281
        for (unsigned i = data.cases.size(); i--;)
4281
        for (unsigned i = data.cases.size(); i--;)
4282
            blocks[i] = FTL_NEW_BLOCK(m_out, ("MultiGetByOffset case ", i));
4282
            blocks[i] = m_out.newBlock();
4283
        LBasicBlock exit = FTL_NEW_BLOCK(m_out, ("MultiGetByOffset fail"));
4283
        LBasicBlock exit = m_out.newBlock();
4284
        LBasicBlock continuation = FTL_NEW_BLOCK(m_out, ("MultiGetByOffset continuation"));
4284
        LBasicBlock continuation = m_out.newBlock();
4285
        
4285
        
4286
        Vector<SwitchCase, 2> cases;
4286
        Vector<SwitchCase, 2> cases;
4287
        StructureSet baseSet;
4287
        StructureSet baseSet;
Lines 4361-4369 private: Source/JavaScriptCore/ftl/FTLLowerDFGToB3.cpp_sec49
4361
        
4361
        
4362
        Vector<LBasicBlock, 2> blocks(data.variants.size());
4362
        Vector<LBasicBlock, 2> blocks(data.variants.size());
4363
        for (unsigned i = data.variants.size(); i--;)
4363
        for (unsigned i = data.variants.size(); i--;)
4364
            blocks[i] = FTL_NEW_BLOCK(m_out, ("MultiPutByOffset case ", i));
4364
            blocks[i] = m_out.newBlock();
4365
        LBasicBlock exit = FTL_NEW_BLOCK(m_out, ("MultiPutByOffset fail"));
4365
        LBasicBlock exit = m_out.newBlock();
4366
        LBasicBlock continuation = FTL_NEW_BLOCK(m_out, ("MultiPutByOffset continuation"));
4366
        LBasicBlock continuation = m_out.newBlock();
4367
        
4367
        
4368
        Vector<SwitchCase, 2> cases;
4368
        Vector<SwitchCase, 2> cases;
4369
        StructureSet baseSet;
4369
        StructureSet baseSet;
Lines 4436-4443 private: Source/JavaScriptCore/ftl/FTLLowerDFGToB3.cpp_sec50
4436
    {
4436
    {
4437
        WatchpointSet* set = m_node->watchpointSet();
4437
        WatchpointSet* set = m_node->watchpointSet();
4438
        
4438
        
4439
        LBasicBlock isNotInvalidated = FTL_NEW_BLOCK(m_out, ("NotifyWrite not invalidated case"));
4439
        LBasicBlock isNotInvalidated = m_out.newBlock();
4440
        LBasicBlock continuation = FTL_NEW_BLOCK(m_out, ("NotifyWrite continuation"));
4440
        LBasicBlock continuation = m_out.newBlock();
4441
        
4441
        
4442
        LValue state = m_out.load8ZeroExt32(m_out.absolute(set->addressOfState()));
4442
        LValue state = m_out.load8ZeroExt32(m_out.absolute(set->addressOfState()));
4443
        m_out.branch(
4443
        m_out.branch(
Lines 4588-4595 private: Source/JavaScriptCore/ftl/FTLLowerDFGToB3.cpp_sec51
4588
            LValue left = lowCell(m_node->child1());
4588
            LValue left = lowCell(m_node->child1());
4589
            LValue right = lowCell(m_node->child2());
4589
            LValue right = lowCell(m_node->child2());
4590
4590
4591
            LBasicBlock notTriviallyEqualCase = FTL_NEW_BLOCK(m_out, ("CompareStrictEq/String not trivially equal case"));
4591
            LBasicBlock notTriviallyEqualCase = m_out.newBlock();
4592
            LBasicBlock continuation = FTL_NEW_BLOCK(m_out, ("CompareStrictEq/String continuation"));
4592
            LBasicBlock continuation = m_out.newBlock();
4593
4593
4594
            speculateString(m_node->child1(), left);
4594
            speculateString(m_node->child1(), left);
4595
4595
Lines 4666-4674 private: Source/JavaScriptCore/ftl/FTLLowerDFGToB3.cpp_sec52
4666
            LValue left = lowStringIdent(leftEdge);
4666
            LValue left = lowStringIdent(leftEdge);
4667
            LValue rightValue = lowJSValue(rightEdge, ManualOperandSpeculation);
4667
            LValue rightValue = lowJSValue(rightEdge, ManualOperandSpeculation);
4668
            
4668
            
4669
            LBasicBlock isCellCase = FTL_NEW_BLOCK(m_out, ("CompareStrictEq StringIdent to NotStringVar is cell case"));
4669
            LBasicBlock isCellCase = m_out.newBlock();
4670
            LBasicBlock isStringCase = FTL_NEW_BLOCK(m_out, ("CompareStrictEq StringIdent to NotStringVar is string case"));
4670
            LBasicBlock isStringCase = m_out.newBlock();
4671
            LBasicBlock continuation = FTL_NEW_BLOCK(m_out, ("CompareStrictEq StringIdent to NotStringVar continuation"));
4671
            LBasicBlock continuation = m_out.newBlock();
4672
            
4672
            
4673
            ValueFromBlock notCellResult = m_out.anchor(m_out.booleanFalse);
4673
            ValueFromBlock notCellResult = m_out.anchor(m_out.booleanFalse);
4674
            m_out.branch(
4674
            m_out.branch(
Lines 5284-5293 private: Source/JavaScriptCore/ftl/FTLLowerDFGToB3.cpp_sec53
5284
        LValue sourceStart = getArgumentsStart(inlineCallFrame);
5284
        LValue sourceStart = getArgumentsStart(inlineCallFrame);
5285
        LValue targetStart = addressFor(data->machineStart).value();
5285
        LValue targetStart = addressFor(data->machineStart).value();
5286
5286
5287
        LBasicBlock undefinedLoop = FTL_NEW_BLOCK(m_out, ("ForwardVarargs undefined loop body"));
5287
        LBasicBlock undefinedLoop = m_out.newBlock();
5288
        LBasicBlock mainLoopEntry = FTL_NEW_BLOCK(m_out, ("ForwardVarargs main loop entry"));
5288
        LBasicBlock mainLoopEntry = m_out.newBlock();
5289
        LBasicBlock mainLoop = FTL_NEW_BLOCK(m_out, ("ForwardVarargs main loop body"));
5289
        LBasicBlock mainLoop = m_out.newBlock();
5290
        LBasicBlock continuation = FTL_NEW_BLOCK(m_out, ("ForwardVarargs continuation"));
5290
        LBasicBlock continuation = m_out.newBlock();
5291
        
5291
        
5292
        LValue lengthAsPtr = m_out.zeroExtPtr(length);
5292
        LValue lengthAsPtr = m_out.zeroExtPtr(length);
5293
        LValue loopBoundValue = m_out.constIntPtr(data->mandatoryMinimum);
5293
        LValue loopBoundValue = m_out.constIntPtr(data->mandatoryMinimum);
Lines 5348-5354 private: Source/JavaScriptCore/ftl/FTLLowerDFGToB3.cpp_sec54
5348
        switch (data->kind) {
5348
        switch (data->kind) {
5349
        case SwitchImm: {
5349
        case SwitchImm: {
5350
            Vector<ValueFromBlock, 2> intValues;
5350
            Vector<ValueFromBlock, 2> intValues;
5351
            LBasicBlock switchOnInts = FTL_NEW_BLOCK(m_out, ("Switch/SwitchImm int case"));
5351
            LBasicBlock switchOnInts = m_out.newBlock();
5352
            
5352
            
5353
            LBasicBlock lastNext = m_out.appendTo(m_out.m_block, switchOnInts);
5353
            LBasicBlock lastNext = m_out.appendTo(m_out.m_block, switchOnInts);
5354
            
5354
            
Lines 5360-5368 private: Source/JavaScriptCore/ftl/FTLLowerDFGToB3.cpp_sec55
5360
            }
5360
            }
5361
                
5361
                
5362
            case UntypedUse: {
5362
            case UntypedUse: {
5363
                LBasicBlock isInt = FTL_NEW_BLOCK(m_out, ("Switch/SwitchImm is int"));
5363
                LBasicBlock isInt = m_out.newBlock();
5364
                LBasicBlock isNotInt = FTL_NEW_BLOCK(m_out, ("Switch/SwitchImm is not int"));
5364
                LBasicBlock isNotInt = m_out.newBlock();
5365
                LBasicBlock isDouble = FTL_NEW_BLOCK(m_out, ("Switch/SwitchImm is double"));
5365
                LBasicBlock isDouble = m_out.newBlock();
5366
                
5366
                
5367
                LValue boxedValue = lowJSValue(m_node->child1());
5367
                LValue boxedValue = lowJSValue(m_node->child1());
5368
                m_out.branch(isNotInt32(boxedValue), unsure(isNotInt), unsure(isInt));
5368
                m_out.branch(isNotInt32(boxedValue), unsure(isNotInt), unsure(isInt));
Lines 5415-5422 private: Source/JavaScriptCore/ftl/FTLLowerDFGToB3.cpp_sec56
5415
            case UntypedUse: {
5415
            case UntypedUse: {
5416
                LValue unboxedValue = lowJSValue(m_node->child1());
5416
                LValue unboxedValue = lowJSValue(m_node->child1());
5417
                
5417
                
5418
                LBasicBlock isCellCase = FTL_NEW_BLOCK(m_out, ("Switch/SwitchChar is cell"));
5418
                LBasicBlock isCellCase = m_out.newBlock();
5419
                LBasicBlock isStringCase = FTL_NEW_BLOCK(m_out, ("Switch/SwitchChar is string"));
5419
                LBasicBlock isStringCase = m_out.newBlock();
5420
                
5420
                
5421
                m_out.branch(
5421
                m_out.branch(
5422
                    isNotCell(unboxedValue, provenType(m_node->child1())),
5422
                    isNotCell(unboxedValue, provenType(m_node->child1())),
Lines 5438-5449 private: Source/JavaScriptCore/ftl/FTLLowerDFGToB3.cpp_sec57
5438
                break;
5438
                break;
5439
            }
5439
            }
5440
            
5440
            
5441
            LBasicBlock lengthIs1 = FTL_NEW_BLOCK(m_out, ("Switch/SwitchChar length is 1"));
5441
            LBasicBlock lengthIs1 = m_out.newBlock();
5442
            LBasicBlock needResolution = FTL_NEW_BLOCK(m_out, ("Switch/SwitchChar resolution"));
5442
            LBasicBlock needResolution = m_out.newBlock();
5443
            LBasicBlock resolved = FTL_NEW_BLOCK(m_out, ("Switch/SwitchChar resolved"));
5443
            LBasicBlock resolved = m_out.newBlock();
5444
            LBasicBlock is8Bit = FTL_NEW_BLOCK(m_out, ("Switch/SwitchChar 8bit"));
5444
            LBasicBlock is8Bit = m_out.newBlock();
5445
            LBasicBlock is16Bit = FTL_NEW_BLOCK(m_out, ("Switch/SwitchChar 16bit"));
5445
            LBasicBlock is16Bit = m_out.newBlock();
5446
            LBasicBlock continuation = FTL_NEW_BLOCK(m_out, ("Switch/SwitchChar continuation"));
5446
            LBasicBlock continuation = m_out.newBlock();
5447
            
5447
            
5448
            m_out.branch(
5448
            m_out.branch(
5449
                m_out.notEqual(
5449
                m_out.notEqual(
Lines 5512-5519 private: Source/JavaScriptCore/ftl/FTLLowerDFGToB3.cpp_sec58
5512
            case UntypedUse: {
5512
            case UntypedUse: {
5513
                LValue value = lowJSValue(m_node->child1());
5513
                LValue value = lowJSValue(m_node->child1());
5514
                
5514
                
5515
                LBasicBlock isCellBlock = FTL_NEW_BLOCK(m_out, ("Switch/SwitchString Untyped cell case"));
5515
                LBasicBlock isCellBlock = m_out.newBlock();
5516
                LBasicBlock isStringBlock = FTL_NEW_BLOCK(m_out, ("Switch/SwitchString Untyped string case"));
5516
                LBasicBlock isStringBlock = m_out.newBlock();
5517
                
5517
                
5518
                m_out.branch(
5518
                m_out.branch(
5519
                    isCell(value, provenType(m_node->child1())),
5519
                    isCell(value, provenType(m_node->child1())),
Lines 5548-5554 private: Source/JavaScriptCore/ftl/FTLLowerDFGToB3.cpp_sec59
5548
                
5548
                
5549
            case UntypedUse: {
5549
            case UntypedUse: {
5550
                LValue value = lowJSValue(m_node->child1());
5550
                LValue value = lowJSValue(m_node->child1());
5551
                LBasicBlock cellCase = FTL_NEW_BLOCK(m_out, ("Switch/SwitchCell cell case"));
5551
                LBasicBlock cellCase = m_out.newBlock();
5552
                m_out.branch(
5552
                m_out.branch(
5553
                    isCell(value, provenType(m_node->child1())),
5553
                    isCell(value, provenType(m_node->child1())),
5554
                    unsure(cellCase), unsure(lowBlock(data->fallThrough.block)));
5554
                    unsure(cellCase), unsure(lowBlock(data->fallThrough.block)));
Lines 5658-5665 private: Source/JavaScriptCore/ftl/FTLLowerDFGToB3.cpp_sec60
5658
    {
5658
    {
5659
        LValue value = lowJSValue(m_node->child1());
5659
        LValue value = lowJSValue(m_node->child1());
5660
        
5660
        
5661
        LBasicBlock isCellCase = FTL_NEW_BLOCK(m_out, ("IsString cell case"));
5661
        LBasicBlock isCellCase = m_out.newBlock();
5662
        LBasicBlock continuation = FTL_NEW_BLOCK(m_out, ("IsString continuation"));
5662
        LBasicBlock continuation = m_out.newBlock();
5663
        
5663
        
5664
        ValueFromBlock notCellResult = m_out.anchor(m_out.booleanFalse);
5664
        ValueFromBlock notCellResult = m_out.anchor(m_out.booleanFalse);
5665
        m_out.branch(
5665
        m_out.branch(
Lines 5677-5684 private: Source/JavaScriptCore/ftl/FTLLowerDFGToB3.cpp_sec61
5677
    {
5677
    {
5678
        LValue value = lowJSValue(m_node->child1());
5678
        LValue value = lowJSValue(m_node->child1());
5679
5679
5680
        LBasicBlock isCellCase = FTL_NEW_BLOCK(m_out, ("IsObject cell case"));
5680
        LBasicBlock isCellCase = m_out.newBlock();
5681
        LBasicBlock continuation = FTL_NEW_BLOCK(m_out, ("IsObject continuation"));
5681
        LBasicBlock continuation = m_out.newBlock();
5682
5682
5683
        ValueFromBlock notCellResult = m_out.anchor(m_out.booleanFalse);
5683
        ValueFromBlock notCellResult = m_out.anchor(m_out.booleanFalse);
5684
        m_out.branch(
5684
        m_out.branch(
Lines 5699-5710 private: Source/JavaScriptCore/ftl/FTLLowerDFGToB3.cpp_sec62
5699
        Edge child = m_node->child1();
5699
        Edge child = m_node->child1();
5700
        LValue value = lowJSValue(child);
5700
        LValue value = lowJSValue(child);
5701
        
5701
        
5702
        LBasicBlock cellCase = FTL_NEW_BLOCK(m_out, ("IsObjectOrNull cell case"));
5702
        LBasicBlock cellCase = m_out.newBlock();
5703
        LBasicBlock notFunctionCase = FTL_NEW_BLOCK(m_out, ("IsObjectOrNull not function case"));
5703
        LBasicBlock notFunctionCase = m_out.newBlock();
5704
        LBasicBlock objectCase = FTL_NEW_BLOCK(m_out, ("IsObjectOrNull object case"));
5704
        LBasicBlock objectCase = m_out.newBlock();
5705
        LBasicBlock slowPath = FTL_NEW_BLOCK(m_out, ("IsObjectOrNull slow path"));
5705
        LBasicBlock slowPath = m_out.newBlock();
5706
        LBasicBlock notCellCase = FTL_NEW_BLOCK(m_out, ("IsObjectOrNull not cell case"));
5706
        LBasicBlock notCellCase = m_out.newBlock();
5707
        LBasicBlock continuation = FTL_NEW_BLOCK(m_out, ("IsObjectOrNull continuation"));
5707
        LBasicBlock continuation = m_out.newBlock();
5708
        
5708
        
5709
        m_out.branch(isCell(value, provenType(child)), unsure(cellCase), unsure(notCellCase));
5709
        m_out.branch(isCell(value, provenType(child)), unsure(cellCase), unsure(notCellCase));
5710
        
5710
        
Lines 5755-5764 private: Source/JavaScriptCore/ftl/FTLLowerDFGToB3.cpp_sec63
5755
        Edge child = m_node->child1();
5755
        Edge child = m_node->child1();
5756
        LValue value = lowJSValue(child);
5756
        LValue value = lowJSValue(child);
5757
        
5757
        
5758
        LBasicBlock cellCase = FTL_NEW_BLOCK(m_out, ("IsFunction cell case"));
5758
        LBasicBlock cellCase = m_out.newBlock();
5759
        LBasicBlock notFunctionCase = FTL_NEW_BLOCK(m_out, ("IsFunction not function case"));
5759
        LBasicBlock notFunctionCase = m_out.newBlock();
5760
        LBasicBlock slowPath = FTL_NEW_BLOCK(m_out, ("IsFunction slow path"));
5760
        LBasicBlock slowPath = m_out.newBlock();
5761
        LBasicBlock continuation = FTL_NEW_BLOCK(m_out, ("IsFunction continuation"));
5761
        LBasicBlock continuation = m_out.newBlock();
5762
        
5762
        
5763
        ValueFromBlock notCellResult = m_out.anchor(m_out.booleanFalse);
5763
        ValueFromBlock notCellResult = m_out.anchor(m_out.booleanFalse);
5764
        m_out.branch(
5764
        m_out.branch(
Lines 5797-5803 private: Source/JavaScriptCore/ftl/FTLLowerDFGToB3.cpp_sec64
5797
        Edge child = m_node->child1();
5797
        Edge child = m_node->child1();
5798
        LValue value = lowJSValue(child);
5798
        LValue value = lowJSValue(child);
5799
        
5799
        
5800
        LBasicBlock continuation = FTL_NEW_BLOCK(m_out, ("TypeOf continuation"));
5800
        LBasicBlock continuation = m_out.newBlock();
5801
        LBasicBlock lastNext = m_out.insertNewBlocksBefore(continuation);
5801
        LBasicBlock lastNext = m_out.insertNewBlocksBefore(continuation);
5802
        
5802
        
5803
        Vector<ValueFromBlock> results;
5803
        Vector<ValueFromBlock> results;
Lines 5894-5901 private: Source/JavaScriptCore/ftl/FTLLowerDFGToB3.cpp_sec65
5894
        LValue constructor = lowCell(m_node->child1());
5894
        LValue constructor = lowCell(m_node->child1());
5895
        LValue hasInstance = lowJSValue(m_node->child2());
5895
        LValue hasInstance = lowJSValue(m_node->child2());
5896
5896
5897
        LBasicBlock defaultHasInstance = FTL_NEW_BLOCK(m_out, ("OverridesHasInstance Symbol.hasInstance is default"));
5897
        LBasicBlock defaultHasInstance = m_out.newBlock();
5898
        LBasicBlock continuation = FTL_NEW_BLOCK(m_out, ("OverridesHasInstance continuation"));
5898
        LBasicBlock continuation = m_out.newBlock();
5899
5899
5900
        // Unlike in the DFG, we don't worry about cleaning this code up for the case where we have proven the hasInstanceValue is a constant as B3 should fix it for us.
5900
        // Unlike in the DFG, we don't worry about cleaning this code up for the case where we have proven the hasInstanceValue is a constant as B3 should fix it for us.
5901
5901
Lines 5934-5943 private: Source/JavaScriptCore/ftl/FTLLowerDFGToB3.cpp_sec66
5934
        
5934
        
5935
        LValue prototype = lowCell(m_node->child2());
5935
        LValue prototype = lowCell(m_node->child2());
5936
        
5936
        
5937
        LBasicBlock isCellCase = FTL_NEW_BLOCK(m_out, ("InstanceOf cell case"));
5937
        LBasicBlock isCellCase = m_out.newBlock();
5938
        LBasicBlock loop = FTL_NEW_BLOCK(m_out, ("InstanceOf loop"));
5938
        LBasicBlock loop = m_out.newBlock();
5939
        LBasicBlock notYetInstance = FTL_NEW_BLOCK(m_out, ("InstanceOf not yet instance"));
5939
        LBasicBlock notYetInstance = m_out.newBlock();
5940
        LBasicBlock continuation = FTL_NEW_BLOCK(m_out, ("InstanceOf continuation"));
5940
        LBasicBlock continuation = m_out.newBlock();
5941
        
5941
        
5942
        LValue condition;
5942
        LValue condition;
5943
        if (m_node->child1().useKind() == UntypedUse)
5943
        if (m_node->child1().useKind() == UntypedUse)
Lines 6006-6014 private: Source/JavaScriptCore/ftl/FTLLowerDFGToB3.cpp_sec67
6006
            IndexedAbstractHeap& heap = m_node->arrayMode().type() == Array::Int32 ?
6006
            IndexedAbstractHeap& heap = m_node->arrayMode().type() == Array::Int32 ?
6007
                m_heaps.indexedInt32Properties : m_heaps.indexedContiguousProperties;
6007
                m_heaps.indexedInt32Properties : m_heaps.indexedContiguousProperties;
6008
6008
6009
            LBasicBlock checkHole = FTL_NEW_BLOCK(m_out, ("HasIndexedProperty int/contiguous check hole"));
6009
            LBasicBlock checkHole = m_out.newBlock();
6010
            LBasicBlock slowCase = FTL_NEW_BLOCK(m_out, ("HasIndexedProperty int/contiguous slow case"));
6010
            LBasicBlock slowCase = m_out.newBlock();
6011
            LBasicBlock continuation = FTL_NEW_BLOCK(m_out, ("HasIndexedProperty int/contiguous continuation"));
6011
            LBasicBlock continuation = m_out.newBlock();
6012
6012
6013
            if (!m_node->arrayMode().isInBounds()) {
6013
            if (!m_node->arrayMode().isInBounds()) {
6014
                m_out.branch(
6014
                m_out.branch(
Lines 6041-6049 private: Source/JavaScriptCore/ftl/FTLLowerDFGToB3.cpp_sec68
6041
            
6041
            
6042
            IndexedAbstractHeap& heap = m_heaps.indexedDoubleProperties;
6042
            IndexedAbstractHeap& heap = m_heaps.indexedDoubleProperties;
6043
            
6043
            
6044
            LBasicBlock checkHole = FTL_NEW_BLOCK(m_out, ("HasIndexedProperty double check hole"));
6044
            LBasicBlock checkHole = m_out.newBlock();
6045
            LBasicBlock slowCase = FTL_NEW_BLOCK(m_out, ("HasIndexedProperty double slow case"));
6045
            LBasicBlock slowCase = m_out.newBlock();
6046
            LBasicBlock continuation = FTL_NEW_BLOCK(m_out, ("HasIndexedProperty double continuation"));
6046
            LBasicBlock continuation = m_out.newBlock();
6047
            
6047
            
6048
            if (!m_node->arrayMode().isInBounds()) {
6048
            if (!m_node->arrayMode().isInBounds()) {
6049
                m_out.branch(
6049
                m_out.branch(
Lines 6089-6097 private: Source/JavaScriptCore/ftl/FTLLowerDFGToB3.cpp_sec69
6089
        LValue property = lowString(m_node->child2());
6089
        LValue property = lowString(m_node->child2());
6090
        LValue enumerator = lowCell(m_node->child3());
6090
        LValue enumerator = lowCell(m_node->child3());
6091
6091
6092
        LBasicBlock correctStructure = FTL_NEW_BLOCK(m_out, ("HasStructureProperty correct structure"));
6092
        LBasicBlock correctStructure = m_out.newBlock();
6093
        LBasicBlock wrongStructure = FTL_NEW_BLOCK(m_out, ("HasStructureProperty wrong structure"));
6093
        LBasicBlock wrongStructure = m_out.newBlock();
6094
        LBasicBlock continuation = FTL_NEW_BLOCK(m_out, ("HasStructureProperty continuation"));
6094
        LBasicBlock continuation = m_out.newBlock();
6095
6095
6096
        m_out.branch(m_out.notEqual(
6096
        m_out.branch(m_out.notEqual(
6097
            m_out.load32(base, m_heaps.JSCell_structureID),
6097
            m_out.load32(base, m_heaps.JSCell_structureID),
Lines 6120-6130 private: Source/JavaScriptCore/ftl/FTLLowerDFGToB3.cpp_sec70
6120
        LValue index = lowInt32(m_graph.varArgChild(m_node, 2));
6120
        LValue index = lowInt32(m_graph.varArgChild(m_node, 2));
6121
        LValue enumerator = lowCell(m_graph.varArgChild(m_node, 3));
6121
        LValue enumerator = lowCell(m_graph.varArgChild(m_node, 3));
6122
6122
6123
        LBasicBlock checkOffset = FTL_NEW_BLOCK(m_out, ("GetDirectPname check offset"));
6123
        LBasicBlock checkOffset = m_out.newBlock();
6124
        LBasicBlock inlineLoad = FTL_NEW_BLOCK(m_out, ("GetDirectPname inline load"));
6124
        LBasicBlock inlineLoad = m_out.newBlock();
6125
        LBasicBlock outOfLineLoad = FTL_NEW_BLOCK(m_out, ("GetDirectPname out-of-line load"));
6125
        LBasicBlock outOfLineLoad = m_out.newBlock();
6126
        LBasicBlock slowCase = FTL_NEW_BLOCK(m_out, ("GetDirectPname slow case"));
6126
        LBasicBlock slowCase = m_out.newBlock();
6127
        LBasicBlock continuation = FTL_NEW_BLOCK(m_out, ("GetDirectPname continuation"));
6127
        LBasicBlock continuation = m_out.newBlock();
6128
6128
6129
        m_out.branch(m_out.notEqual(
6129
        m_out.branch(m_out.notEqual(
6130
            m_out.load32(base, m_heaps.JSCell_structureID),
6130
            m_out.load32(base, m_heaps.JSCell_structureID),
Lines 6176-6184 private: Source/JavaScriptCore/ftl/FTLLowerDFGToB3.cpp_sec71
6176
        LValue enumerator = lowCell(m_node->child1());
6176
        LValue enumerator = lowCell(m_node->child1());
6177
        LValue index = lowInt32(m_node->child2());
6177
        LValue index = lowInt32(m_node->child2());
6178
6178
6179
        LBasicBlock inBounds = FTL_NEW_BLOCK(m_out, ("GetEnumeratorStructurePname in bounds"));
6179
        LBasicBlock inBounds = m_out.newBlock();
6180
        LBasicBlock outOfBounds = FTL_NEW_BLOCK(m_out, ("GetEnumeratorStructurePname out of bounds"));
6180
        LBasicBlock outOfBounds = m_out.newBlock();
6181
        LBasicBlock continuation = FTL_NEW_BLOCK(m_out, ("GetEnumeratorStructurePname continuation"));
6181
        LBasicBlock continuation = m_out.newBlock();
6182
6182
6183
        m_out.branch(m_out.below(index, m_out.load32(enumerator, m_heaps.JSPropertyNameEnumerator_endStructurePropertyIndex)),
6183
        m_out.branch(m_out.below(index, m_out.load32(enumerator, m_heaps.JSPropertyNameEnumerator_endStructurePropertyIndex)),
6184
            usually(inBounds), rarely(outOfBounds));
6184
            usually(inBounds), rarely(outOfBounds));
Lines 6202-6210 private: Source/JavaScriptCore/ftl/FTLLowerDFGToB3.cpp_sec72
6202
        LValue enumerator = lowCell(m_node->child1());
6202
        LValue enumerator = lowCell(m_node->child1());
6203
        LValue index = lowInt32(m_node->child2());
6203
        LValue index = lowInt32(m_node->child2());
6204
6204
6205
        LBasicBlock inBounds = FTL_NEW_BLOCK(m_out, ("GetEnumeratorGenericPname in bounds"));
6205
        LBasicBlock inBounds = m_out.newBlock();
6206
        LBasicBlock outOfBounds = FTL_NEW_BLOCK(m_out, ("GetEnumeratorGenericPname out of bounds"));
6206
        LBasicBlock outOfBounds = m_out.newBlock();
6207
        LBasicBlock continuation = FTL_NEW_BLOCK(m_out, ("GetEnumeratorGenericPname continuation"));
6207
        LBasicBlock continuation = m_out.newBlock();
6208
6208
6209
        m_out.branch(m_out.below(index, m_out.load32(enumerator, m_heaps.JSPropertyNameEnumerator_endGenericPropertyIndex)),
6209
        m_out.branch(m_out.below(index, m_out.load32(enumerator, m_heaps.JSPropertyNameEnumerator_endGenericPropertyIndex)),
6210
            usually(inBounds), rarely(outOfBounds));
6210
            usually(inBounds), rarely(outOfBounds));
Lines 6253-6261 private: Source/JavaScriptCore/ftl/FTLLowerDFGToB3.cpp_sec73
6253
        
6253
        
6254
        Vector<LBasicBlock, 1> blocks(set.size());
6254
        Vector<LBasicBlock, 1> blocks(set.size());
6255
        for (unsigned i = set.size(); i--;)
6255
        for (unsigned i = set.size(); i--;)
6256
            blocks[i] = FTL_NEW_BLOCK(m_out, ("MaterializeNewObject case ", i));
6256
            blocks[i] = m_out.newBlock();
6257
        LBasicBlock dummyDefault = FTL_NEW_BLOCK(m_out, ("MaterializeNewObject default case"));
6257
        LBasicBlock dummyDefault = m_out.newBlock();
6258
        LBasicBlock outerContinuation = FTL_NEW_BLOCK(m_out, ("MaterializeNewObject continuation"));
6258
        LBasicBlock outerContinuation = m_out.newBlock();
6259
        
6259
        
6260
        Vector<SwitchCase, 1> cases(set.size());
6260
        Vector<SwitchCase, 1> cases(set.size());
6261
        for (unsigned i = set.size(); i--;)
6261
        for (unsigned i = set.size(); i--;)
Lines 6279-6286 private: Source/JavaScriptCore/ftl/FTLLowerDFGToB3.cpp_sec74
6279
                size_t allocationSize = JSFinalObject::allocationSize(structure->inlineCapacity());
6279
                size_t allocationSize = JSFinalObject::allocationSize(structure->inlineCapacity());
6280
                MarkedAllocator* allocator = &vm().heap.allocatorForObjectWithoutDestructor(allocationSize);
6280
                MarkedAllocator* allocator = &vm().heap.allocatorForObjectWithoutDestructor(allocationSize);
6281
                
6281
                
6282
                LBasicBlock slowPath = FTL_NEW_BLOCK(m_out, ("MaterializeNewObject complex object allocation slow path"));
6282
                LBasicBlock slowPath = m_out.newBlock();
6283
                LBasicBlock continuation = FTL_NEW_BLOCK(m_out, ("MaterializeNewObject complex object allocation continuation"));
6283
                LBasicBlock continuation = m_out.newBlock();
6284
                
6284
                
6285
                LBasicBlock lastNext = m_out.insertNewBlocksBefore(slowPath);
6285
                LBasicBlock lastNext = m_out.insertNewBlocksBefore(slowPath);
6286
                
6286
                
Lines 6359-6366 private: Source/JavaScriptCore/ftl/FTLLowerDFGToB3.cpp_sec75
6359
        ASSERT(table == m_graph.varArgChild(m_node, 0)->castConstant<SymbolTable*>());
6359
        ASSERT(table == m_graph.varArgChild(m_node, 0)->castConstant<SymbolTable*>());
6360
        Structure* structure = m_graph.globalObjectFor(m_node->origin.semantic)->activationStructure();
6360
        Structure* structure = m_graph.globalObjectFor(m_node->origin.semantic)->activationStructure();
6361
6361
6362
        LBasicBlock slowPath = FTL_NEW_BLOCK(m_out, ("MaterializeCreateActivation slow path"));
6362
        LBasicBlock slowPath = m_out.newBlock();
6363
        LBasicBlock continuation = FTL_NEW_BLOCK(m_out, ("MaterializeCreateActivation continuation"));
6363
        LBasicBlock continuation = m_out.newBlock();
6364
6364
6365
        LBasicBlock lastNext = m_out.insertNewBlocksBefore(slowPath);
6365
        LBasicBlock lastNext = m_out.insertNewBlocksBefore(slowPath);
6366
6366
Lines 6420-6427 private: Source/JavaScriptCore/ftl/FTLLowerDFGToB3.cpp_sec76
6420
6420
6421
    void compileCheckWatchdogTimer()
6421
    void compileCheckWatchdogTimer()
6422
    {
6422
    {
6423
        LBasicBlock timerDidFire = FTL_NEW_BLOCK(m_out, ("CheckWatchdogTimer timer did fire"));
6423
        LBasicBlock timerDidFire = m_out.newBlock();
6424
        LBasicBlock continuation = FTL_NEW_BLOCK(m_out, ("CheckWatchdogTimer continuation"));
6424
        LBasicBlock continuation = m_out.newBlock();
6425
        
6425
        
6426
        LValue state = m_out.load8ZeroExt32(m_out.absolute(vm().watchdog()->timerDidFireAddress()));
6426
        LValue state = m_out.load8ZeroExt32(m_out.absolute(vm().watchdog()->timerDidFireAddress()));
6427
        m_out.branch(m_out.isZero32(state),
6427
        m_out.branch(m_out.isZero32(state),
Lines 6673-6683 private: Source/JavaScriptCore/ftl/FTLLowerDFGToB3.cpp_sec77
6673
            return;
6673
            return;
6674
        }
6674
        }
6675
        
6675
        
6676
        LBasicBlock continuation = FTL_NEW_BLOCK(m_out, ("checkStructure continuation"));
6676
        LBasicBlock continuation = m_out.newBlock();
6677
        
6677
        
6678
        LBasicBlock lastNext = m_out.insertNewBlocksBefore(continuation);
6678
        LBasicBlock lastNext = m_out.insertNewBlocksBefore(continuation);
6679
        for (unsigned i = 0; i < set.size() - 1; ++i) {
6679
        for (unsigned i = 0; i < set.size() - 1; ++i) {
6680
            LBasicBlock nextStructure = FTL_NEW_BLOCK(m_out, ("checkStructure nextStructure"));
6680
            LBasicBlock nextStructure = m_out.newBlock();
6681
            m_out.branch(
6681
            m_out.branch(
6682
                m_out.equal(structureDiscriminant, weakStructureDiscriminant(set[i])),
6682
                m_out.equal(structureDiscriminant, weakStructureDiscriminant(set[i])),
6683
                unsure(continuation), unsure(nextStructure));
6683
                unsure(continuation), unsure(nextStructure));
Lines 6694-6708 private: Source/JavaScriptCore/ftl/FTLLowerDFGToB3.cpp_sec78
6694
    
6694
    
6695
    LValue numberOrNotCellToInt32(Edge edge, LValue value)
6695
    LValue numberOrNotCellToInt32(Edge edge, LValue value)
6696
    {
6696
    {
6697
        LBasicBlock intCase = FTL_NEW_BLOCK(m_out, ("ValueToInt32 int case"));
6697
        LBasicBlock intCase = m_out.newBlock();
6698
        LBasicBlock notIntCase = FTL_NEW_BLOCK(m_out, ("ValueToInt32 not int case"));
6698
        LBasicBlock notIntCase = m_out.newBlock();
6699
        LBasicBlock doubleCase = 0;
6699
        LBasicBlock doubleCase = 0;
6700
        LBasicBlock notNumberCase = 0;
6700
        LBasicBlock notNumberCase = 0;
6701
        if (edge.useKind() == NotCellUse) {
6701
        if (edge.useKind() == NotCellUse) {
6702
            doubleCase = FTL_NEW_BLOCK(m_out, ("ValueToInt32 double case"));
6702
            doubleCase = m_out.newBlock();
6703
            notNumberCase = FTL_NEW_BLOCK(m_out, ("ValueToInt32 not number case"));
6703
            notNumberCase = m_out.newBlock();
6704
        }
6704
        }
6705
        LBasicBlock continuation = FTL_NEW_BLOCK(m_out, ("ValueToInt32 continuation"));
6705
        LBasicBlock continuation = m_out.newBlock();
6706
        
6706
        
6707
        Vector<ValueFromBlock> results;
6707
        Vector<ValueFromBlock> results;
6708
        
6708
        
Lines 6806-6814 private: Source/JavaScriptCore/ftl/FTLLowerDFGToB3.cpp_sec79
6806
            return;
6806
            return;
6807
6807
6808
        case InferredType::ObjectWithStructureOrOther: {
6808
        case InferredType::ObjectWithStructureOrOther: {
6809
            LBasicBlock cellCase = FTL_NEW_BLOCK(m_out, ("checkInferredType ObjectWithStructureOrOther cell case"));
6809
            LBasicBlock cellCase = m_out.newBlock();
6810
            LBasicBlock notCellCase = FTL_NEW_BLOCK(m_out, ("checkInferredType ObjectWithStructureOrOther not cell case"));
6810
            LBasicBlock notCellCase = m_out.newBlock();
6811
            LBasicBlock continuation = FTL_NEW_BLOCK(m_out, ("checkInferredType ObjectWithStructureOrOther continuation"));
6811
            LBasicBlock continuation = m_out.newBlock();
6812
6812
6813
            m_out.branch(isCell(value, provenType(edge)), unsure(cellCase), unsure(notCellCase));
6813
            m_out.branch(isCell(value, provenType(edge)), unsure(cellCase), unsure(notCellCase));
6814
6814
Lines 6842-6850 private: Source/JavaScriptCore/ftl/FTLLowerDFGToB3.cpp_sec80
6842
            return;
6842
            return;
6843
6843
6844
        case InferredType::ObjectOrOther: {
6844
        case InferredType::ObjectOrOther: {
6845
            LBasicBlock cellCase = FTL_NEW_BLOCK(m_out, ("checkInferredType ObjectOrOther cell case"));
6845
            LBasicBlock cellCase = m_out.newBlock();
6846
            LBasicBlock notCellCase = FTL_NEW_BLOCK(m_out, ("checkInferredType ObjectOrOther not cell case"));
6846
            LBasicBlock notCellCase = m_out.newBlock();
6847
            LBasicBlock continuation = FTL_NEW_BLOCK(m_out, ("checkInferredType ObjectOrOther continuation"));
6847
            LBasicBlock continuation = m_out.newBlock();
6848
6848
6849
            m_out.branch(isCell(value, provenType(edge)), unsure(cellCase), unsure(notCellCase));
6849
            m_out.branch(isCell(value, provenType(edge)), unsure(cellCase), unsure(notCellCase));
6850
6850
Lines 6963-6970 private: Source/JavaScriptCore/ftl/FTLLowerDFGToB3.cpp_sec81
6963
    
6963
    
6964
    LValue allocatePropertyStorageWithSizeImpl(size_t sizeInValues)
6964
    LValue allocatePropertyStorageWithSizeImpl(size_t sizeInValues)
6965
    {
6965
    {
6966
        LBasicBlock slowPath = FTL_NEW_BLOCK(m_out, ("allocatePropertyStorageWithSizeImpl slow path"));
6966
        LBasicBlock slowPath = m_out.newBlock();
6967
        LBasicBlock continuation = FTL_NEW_BLOCK(m_out, ("allocatePropertyStorageWithSizeImpl continuation"));
6967
        LBasicBlock continuation = m_out.newBlock();
6968
        
6968
        
6969
        LBasicBlock lastNext = m_out.insertNewBlocksBefore(slowPath);
6969
        LBasicBlock lastNext = m_out.insertNewBlocksBefore(slowPath);
6970
        
6970
        
Lines 7083-7090 private: Source/JavaScriptCore/ftl/FTLLowerDFGToB3.cpp_sec82
7083
        return copyBarrier(
7083
        return copyBarrier(
7084
            fastResultValue,
7084
            fastResultValue,
7085
            [&] () -> LValue {
7085
            [&] () -> LValue {
7086
                LBasicBlock slowPath = FTL_NEW_BLOCK(m_out, ("loadVectorWithBarrier slow path"));
7086
                LBasicBlock slowPath = m_out.newBlock();
7087
                LBasicBlock continuation = FTL_NEW_BLOCK(m_out, ("loadVectorWithBarrier continuation"));
7087
                LBasicBlock continuation = m_out.newBlock();
7088
7088
7089
                ValueFromBlock fastResult = m_out.anchor(fastResultValue);
7089
                ValueFromBlock fastResult = m_out.anchor(fastResultValue);
7090
                m_out.branch(isFastTypedArray(object), rarely(slowPath), usually(continuation));
7090
                m_out.branch(isFastTypedArray(object), rarely(slowPath), usually(continuation));
Lines 7121-7128 private: Source/JavaScriptCore/ftl/FTLLowerDFGToB3.cpp_sec83
7121
    template<typename Functor>
7121
    template<typename Functor>
7122
    LValue copyBarrier(LValue pointer, const Functor& functor)
7122
    LValue copyBarrier(LValue pointer, const Functor& functor)
7123
    {
7123
    {
7124
        LBasicBlock slowPath = FTL_NEW_BLOCK(m_out, ("copyBarrier slow path"));
7124
        LBasicBlock slowPath = m_out.newBlock();
7125
        LBasicBlock continuation = FTL_NEW_BLOCK(m_out, ("copyBarrier continuation"));
7125
        LBasicBlock continuation = m_out.newBlock();
7126
7126
7127
        ValueFromBlock fastResult = m_out.anchor(pointer);
7127
        ValueFromBlock fastResult = m_out.anchor(pointer);
7128
        m_out.branch(isInToSpace(pointer), usually(continuation), rarely(slowPath));
7128
        m_out.branch(isInToSpace(pointer), usually(continuation), rarely(slowPath));
Lines 7150-7157 private: Source/JavaScriptCore/ftl/FTLLowerDFGToB3.cpp_sec84
7150
    {
7150
    {
7151
        LValue fastResultValue = m_out.loadPtr(object, m_heaps.JSArrayBufferView_vector);
7151
        LValue fastResultValue = m_out.loadPtr(object, m_heaps.JSArrayBufferView_vector);
7152
7152
7153
        LBasicBlock possiblyFromSpace = FTL_NEW_BLOCK(m_out, ("loadVectorReadOnly possibly from space"));
7153
        LBasicBlock possiblyFromSpace = m_out.newBlock();
7154
        LBasicBlock continuation = FTL_NEW_BLOCK(m_out, ("loadVectorReadOnly continuation"));
7154
        LBasicBlock continuation = m_out.newBlock();
7155
7155
7156
        ValueFromBlock fastResult = m_out.anchor(fastResultValue);
7156
        ValueFromBlock fastResult = m_out.anchor(fastResultValue);
7157
7157
Lines 7230-7238 private: Source/JavaScriptCore/ftl/FTLLowerDFGToB3.cpp_sec85
7230
        
7230
        
7231
        speculateTruthyObject(rightChild, rightCell, SpecObject);
7231
        speculateTruthyObject(rightChild, rightCell, SpecObject);
7232
        
7232
        
7233
        LBasicBlock leftCellCase = FTL_NEW_BLOCK(m_out, ("CompareEqObjectOrOtherToObject left cell case"));
7233
        LBasicBlock leftCellCase = m_out.newBlock();
7234
        LBasicBlock leftNotCellCase = FTL_NEW_BLOCK(m_out, ("CompareEqObjectOrOtherToObject left not cell case"));
7234
        LBasicBlock leftNotCellCase = m_out.newBlock();
7235
        LBasicBlock continuation = FTL_NEW_BLOCK(m_out, ("CompareEqObjectOrOtherToObject continuation"));
7235
        LBasicBlock continuation = m_out.newBlock();
7236
        
7236
        
7237
        m_out.branch(
7237
        m_out.branch(
7238
            isCell(leftValue, provenType(leftChild)),
7238
            isCell(leftValue, provenType(leftChild)),
Lines 7274-7283 private: Source/JavaScriptCore/ftl/FTLLowerDFGToB3.cpp_sec86
7274
        LValue left = lowJSValue(m_node->child1());
7274
        LValue left = lowJSValue(m_node->child1());
7275
        LValue right = lowJSValue(m_node->child2());
7275
        LValue right = lowJSValue(m_node->child2());
7276
        
7276
        
7277
        LBasicBlock leftIsInt = FTL_NEW_BLOCK(m_out, ("CompareEq untyped left is int"));
7277
        LBasicBlock leftIsInt = m_out.newBlock();
7278
        LBasicBlock fastPath = FTL_NEW_BLOCK(m_out, ("CompareEq untyped fast path"));
7278
        LBasicBlock fastPath = m_out.newBlock();
7279
        LBasicBlock slowPath = FTL_NEW_BLOCK(m_out, ("CompareEq untyped slow path"));
7279
        LBasicBlock slowPath = m_out.newBlock();
7280
        LBasicBlock continuation = FTL_NEW_BLOCK(m_out, ("CompareEq untyped continuation"));
7280
        LBasicBlock continuation = m_out.newBlock();
7281
        
7281
        
7282
        m_out.branch(isNotInt32(left), rarely(slowPath), usually(leftIsInt));
7282
        m_out.branch(isNotInt32(left), rarely(slowPath), usually(leftIsInt));
7283
        
7283
        
Lines 7299-7316 private: Source/JavaScriptCore/ftl/FTLLowerDFGToB3.cpp_sec87
7299
7299
7300
    LValue stringsEqual(LValue leftJSString, LValue rightJSString)
7300
    LValue stringsEqual(LValue leftJSString, LValue rightJSString)
7301
    {
7301
    {
7302
        LBasicBlock notTriviallyUnequalCase = FTL_NEW_BLOCK(m_out, ("stringsEqual not trivially unequal case"));
7302
        LBasicBlock notTriviallyUnequalCase = m_out.newBlock();
7303
        LBasicBlock notEmptyCase = FTL_NEW_BLOCK(m_out, ("stringsEqual not empty case"));
7303
        LBasicBlock notEmptyCase = m_out.newBlock();
7304
        LBasicBlock leftReadyCase = FTL_NEW_BLOCK(m_out, ("stringsEqual left ready case"));
7304
        LBasicBlock leftReadyCase = m_out.newBlock();
7305
        LBasicBlock rightReadyCase = FTL_NEW_BLOCK(m_out, ("stringsEqual right ready case"));
7305
        LBasicBlock rightReadyCase = m_out.newBlock();
7306
        LBasicBlock left8BitCase = FTL_NEW_BLOCK(m_out, ("stringsEqual left 8-bit case"));
7306
        LBasicBlock left8BitCase = m_out.newBlock();
7307
        LBasicBlock right8BitCase = FTL_NEW_BLOCK(m_out, ("stringsEqual right 8-bit case"));
7307
        LBasicBlock right8BitCase = m_out.newBlock();
7308
        LBasicBlock loop = FTL_NEW_BLOCK(m_out, ("stringsEqual loop"));
7308
        LBasicBlock loop = m_out.newBlock();
7309
        LBasicBlock bytesEqual = FTL_NEW_BLOCK(m_out, ("stringsEqual bytes equal"));
7309
        LBasicBlock bytesEqual = m_out.newBlock();
7310
        LBasicBlock trueCase = FTL_NEW_BLOCK(m_out, ("stringsEqual true case"));
7310
        LBasicBlock trueCase = m_out.newBlock();
7311
        LBasicBlock falseCase = FTL_NEW_BLOCK(m_out, ("stringsEqual false case"));
7311
        LBasicBlock falseCase = m_out.newBlock();
7312
        LBasicBlock slowCase = FTL_NEW_BLOCK(m_out, ("stringsEqual slow case"));
7312
        LBasicBlock slowCase = m_out.newBlock();
7313
        LBasicBlock continuation = FTL_NEW_BLOCK(m_out, ("stringsEqual continuation"));
7313
        LBasicBlock continuation = m_out.newBlock();
7314
7314
7315
        LValue length = m_out.load32(leftJSString, m_heaps.JSString_length);
7315
        LValue length = m_out.load32(leftJSString, m_heaps.JSString_length);
7316
7316
Lines 7585-7591 private: Source/JavaScriptCore/ftl/FTLLowerDFGToB3.cpp_sec88
7585
7585
7586
    LValue allocateCell(LValue allocator, LBasicBlock slowPath)
7586
    LValue allocateCell(LValue allocator, LBasicBlock slowPath)
7587
    {
7587
    {
7588
        LBasicBlock success = FTL_NEW_BLOCK(m_out, ("object allocation success"));
7588
        LBasicBlock success = m_out.newBlock();
7589
    
7589
    
7590
        LValue result;
7590
        LValue result;
7591
        LValue condition;
7591
        LValue condition;
Lines 7655-7664 private: Source/JavaScriptCore/ftl/FTLLowerDFGToB3.cpp_sec89
7655
7655
7656
        LValue subspace = m_out.constIntPtr(&vm().heap.subspaceForObjectOfType<ClassType>());
7656
        LValue subspace = m_out.constIntPtr(&vm().heap.subspaceForObjectOfType<ClassType>());
7657
        
7657
        
7658
        LBasicBlock smallCaseBlock = FTL_NEW_BLOCK(m_out, ("allocateVariableSizedObject small case"));
7658
        LBasicBlock smallCaseBlock = m_out.newBlock();
7659
        LBasicBlock largeOrOversizeCaseBlock = FTL_NEW_BLOCK(m_out, ("allocateVariableSizedObject large or oversize case"));
7659
        LBasicBlock largeOrOversizeCaseBlock = m_out.newBlock();
7660
        LBasicBlock largeCaseBlock = FTL_NEW_BLOCK(m_out, ("allocateVariableSizedObject large case"));
7660
        LBasicBlock largeCaseBlock = m_out.newBlock();
7661
        LBasicBlock continuation = FTL_NEW_BLOCK(m_out, ("allocateVariableSizedObject continuation"));
7661
        LBasicBlock continuation = m_out.newBlock();
7662
        
7662
        
7663
        LValue uproundedSize = m_out.add(size, m_out.constInt32(MarkedSpace::preciseStep - 1));
7663
        LValue uproundedSize = m_out.add(size, m_out.constInt32(MarkedSpace::preciseStep - 1));
7664
        LValue isSmall = m_out.below(uproundedSize, m_out.constInt32(MarkedSpace::preciseCutoff));
7664
        LValue isSmall = m_out.below(uproundedSize, m_out.constInt32(MarkedSpace::preciseCutoff));
Lines 7694-7700 private: Source/JavaScriptCore/ftl/FTLLowerDFGToB3.cpp_sec90
7694
    {
7694
    {
7695
        CopiedAllocator& allocator = vm().heap.storageAllocator();
7695
        CopiedAllocator& allocator = vm().heap.storageAllocator();
7696
        
7696
        
7697
        LBasicBlock success = FTL_NEW_BLOCK(m_out, ("storage allocation success"));
7697
        LBasicBlock success = m_out.newBlock();
7698
        
7698
        
7699
        LValue remaining = m_out.loadPtr(m_out.absolute(&allocator.m_currentRemaining));
7699
        LValue remaining = m_out.loadPtr(m_out.absolute(&allocator.m_currentRemaining));
7700
        LValue newRemaining = m_out.sub(remaining, size);
7700
        LValue newRemaining = m_out.sub(remaining, size);
Lines 7720-7727 private: Source/JavaScriptCore/ftl/FTLLowerDFGToB3.cpp_sec91
7720
        size_t allocationSize = JSFinalObject::allocationSize(structure->inlineCapacity());
7720
        size_t allocationSize = JSFinalObject::allocationSize(structure->inlineCapacity());
7721
        MarkedAllocator* allocator = &vm().heap.allocatorForObjectWithoutDestructor(allocationSize);
7721
        MarkedAllocator* allocator = &vm().heap.allocatorForObjectWithoutDestructor(allocationSize);
7722
        
7722
        
7723
        LBasicBlock slowPath = FTL_NEW_BLOCK(m_out, ("allocateObject slow path"));
7723
        LBasicBlock slowPath = m_out.newBlock();
7724
        LBasicBlock continuation = FTL_NEW_BLOCK(m_out, ("allocateObject continuation"));
7724
        LBasicBlock continuation = m_out.newBlock();
7725
        
7725
        
7726
        LBasicBlock lastNext = m_out.insertNewBlocksBefore(slowPath);
7726
        LBasicBlock lastNext = m_out.insertNewBlocksBefore(slowPath);
7727
        
7727
        
Lines 7798-7805 private: Source/JavaScriptCore/ftl/FTLLowerDFGToB3.cpp_sec92
7798
    
7798
    
7799
    ArrayValues allocateJSArray(Structure* structure, unsigned numElements)
7799
    ArrayValues allocateJSArray(Structure* structure, unsigned numElements)
7800
    {
7800
    {
7801
        LBasicBlock slowPath = FTL_NEW_BLOCK(m_out, ("JSArray allocation slow path"));
7801
        LBasicBlock slowPath = m_out.newBlock();
7802
        LBasicBlock continuation = FTL_NEW_BLOCK(m_out, ("JSArray allocation continuation"));
7802
        LBasicBlock continuation = m_out.newBlock();
7803
        
7803
        
7804
        LBasicBlock lastNext = m_out.insertNewBlocksBefore(slowPath);
7804
        LBasicBlock lastNext = m_out.insertNewBlocksBefore(slowPath);
7805
        
7805
        
Lines 7850-7855 private: Source/JavaScriptCore/ftl/FTLLowerDFGToB3.cpp_sec93
7850
            LValue length = m_out.load32NonNegative(stringValue, m_heaps.JSString_length);
7850
            LValue length = m_out.load32NonNegative(stringValue, m_heaps.JSString_length);
7851
            return m_out.notEqual(length, m_out.int32Zero);
7851
            return m_out.notEqual(length, m_out.int32Zero);
7852
        }
7852
        }
7853
        case StringOrOtherUse: {
7854
            LValue value = lowJSValue(edge, ManualOperandSpeculation);
7855
7856
            LBasicBlock cellCase = m_out.newBlock();
7857
            LBasicBlock notCellCase = m_out.newBlock();
7858
            LBasicBlock continuation = m_out.newBlock();
7859
7860
            m_out.branch(isCell(value, provenType(edge)), unsure(cellCase), unsure(notCellCase));
7861
            
7862
            LBasicBlock lastNext = m_out.appendTo(cellCase, notCellCase);
7863
            
7864
            FTL_TYPE_CHECK(jsValueValue(value), edge, (~SpecCell) | SpecString, isNotString(value));
7865
            LValue length = m_out.load32NonNegative(value, m_heaps.JSString_length);
7866
            ValueFromBlock cellResult = m_out.anchor(m_out.notEqual(length, m_out.int32Zero));
7867
            m_out.jump(continuation);
7868
            
7869
            m_out.appendTo(notCellCase, continuation);
7870
            
7871
            FTL_TYPE_CHECK(jsValueValue(value), edge, SpecCell | SpecOther, isNotOther(value));
7872
            ValueFromBlock notCellResult = m_out.anchor(m_out.booleanTrue);
7873
            m_out.jump(continuation);
7874
            m_out.appendTo(continuation, lastNext);
7875
7876
            return m_out.phi(Int32, cellResult, notCellResult);
7877
        }
7853
        case UntypedUse: {
7878
        case UntypedUse: {
7854
            LValue value = lowJSValue(edge);
7879
            LValue value = lowJSValue(edge);
7855
            
7880
            
Lines 7869-7883 private: Source/JavaScriptCore/ftl/FTLLowerDFGToB3.cpp_sec94
7869
            //     result = value == jsTrue
7894
            //     result = value == jsTrue
7870
            // }
7895
            // }
7871
            
7896
            
7872
            LBasicBlock cellCase = FTL_NEW_BLOCK(m_out, ("Boolify untyped cell case"));
7897
            LBasicBlock cellCase = m_out.newBlock();
7873
            LBasicBlock stringCase = FTL_NEW_BLOCK(m_out, ("Boolify untyped string case"));
7898
            LBasicBlock stringCase = m_out.newBlock();
7874
            LBasicBlock notStringCase = FTL_NEW_BLOCK(m_out, ("Boolify untyped not string case"));
7899
            LBasicBlock notStringCase = m_out.newBlock();
7875
            LBasicBlock notCellCase = FTL_NEW_BLOCK(m_out, ("Boolify untyped not cell case"));
7900
            LBasicBlock notCellCase = m_out.newBlock();
7876
            LBasicBlock int32Case = FTL_NEW_BLOCK(m_out, ("Boolify untyped int32 case"));
7901
            LBasicBlock int32Case = m_out.newBlock();
7877
            LBasicBlock notInt32Case = FTL_NEW_BLOCK(m_out, ("Boolify untyped not int32 case"));
7902
            LBasicBlock notInt32Case = m_out.newBlock();
7878
            LBasicBlock doubleCase = FTL_NEW_BLOCK(m_out, ("Boolify untyped double case"));
7903
            LBasicBlock doubleCase = m_out.newBlock();
7879
            LBasicBlock notDoubleCase = FTL_NEW_BLOCK(m_out, ("Boolify untyped not double case"));
7904
            LBasicBlock notDoubleCase = m_out.newBlock();
7880
            LBasicBlock continuation = FTL_NEW_BLOCK(m_out, ("Boolify untyped continuation"));
7905
            LBasicBlock continuation = m_out.newBlock();
7881
            
7906
            
7882
            Vector<ValueFromBlock> results;
7907
            Vector<ValueFromBlock> results;
7883
            
7908
            
Lines 7899-7905 private: Source/JavaScriptCore/ftl/FTLLowerDFGToB3.cpp_sec95
7899
            if (masqueradesAsUndefinedWatchpointIsStillValid())
7924
            if (masqueradesAsUndefinedWatchpointIsStillValid())
7900
                isTruthyObject = m_out.booleanTrue;
7925
                isTruthyObject = m_out.booleanTrue;
7901
            else {
7926
            else {
7902
                LBasicBlock masqueradesCase = FTL_NEW_BLOCK(m_out, ("Boolify untyped masquerades case"));
7927
                LBasicBlock masqueradesCase = m_out.newBlock();
7903
                
7928
                
7904
                results.append(m_out.anchor(m_out.booleanTrue));
7929
                results.append(m_out.anchor(m_out.booleanTrue));
7905
                
7930
                
Lines 7971-7979 private: Source/JavaScriptCore/ftl/FTLLowerDFGToB3.cpp_sec96
7971
        
7996
        
7972
        LValue value = lowJSValue(edge, operandMode);
7997
        LValue value = lowJSValue(edge, operandMode);
7973
        
7998
        
7974
        LBasicBlock cellCase = FTL_NEW_BLOCK(m_out, ("EqualNullOrUndefined cell case"));
7999
        LBasicBlock cellCase = m_out.newBlock();
7975
        LBasicBlock primitiveCase = FTL_NEW_BLOCK(m_out, ("EqualNullOrUndefined primitive case"));
8000
        LBasicBlock primitiveCase = m_out.newBlock();
7976
        LBasicBlock continuation = FTL_NEW_BLOCK(m_out, ("EqualNullOrUndefined continuation"));
8001
        LBasicBlock continuation = m_out.newBlock();
7977
        
8002
        
7978
        m_out.branch(isNotCell(value, provenType(edge)), unsure(primitiveCase), unsure(cellCase));
8003
        m_out.branch(isNotCell(value, provenType(edge)), unsure(primitiveCase), unsure(cellCase));
7979
        
8004
        
Lines 7995-8001 private: Source/JavaScriptCore/ftl/FTLLowerDFGToB3.cpp_sec97
7995
            m_out.jump(continuation);
8020
            m_out.jump(continuation);
7996
        } else {
8021
        } else {
7997
            LBasicBlock masqueradesCase =
8022
            LBasicBlock masqueradesCase =
7998
                FTL_NEW_BLOCK(m_out, ("EqualNullOrUndefined masquerades case"));
8023
                m_out.newBlock();
7999
                
8024
                
8000
            results.append(m_out.anchor(m_out.booleanFalse));
8025
            results.append(m_out.anchor(m_out.booleanFalse));
8001
            
8026
            
Lines 8052-8060 private: Source/JavaScriptCore/ftl/FTLLowerDFGToB3.cpp_sec98
8052
            index, m_out.load32NonNegative(storage, m_heaps.Butterfly_publicLength));
8077
            index, m_out.load32NonNegative(storage, m_heaps.Butterfly_publicLength));
8053
        if (!m_node->arrayMode().isInBounds()) {
8078
        if (!m_node->arrayMode().isInBounds()) {
8054
            LBasicBlock notInBoundsCase =
8079
            LBasicBlock notInBoundsCase =
8055
                FTL_NEW_BLOCK(m_out, ("PutByVal not in bounds"));
8080
                m_out.newBlock();
8056
            LBasicBlock performStore =
8081
            LBasicBlock performStore =
8057
                FTL_NEW_BLOCK(m_out, ("PutByVal perform store"));
8082
                m_out.newBlock();
8058
                
8083
                
8059
            m_out.branch(isNotInBounds, unsure(notInBoundsCase), unsure(performStore));
8084
            m_out.branch(isNotInBounds, unsure(notInBoundsCase), unsure(performStore));
8060
                
8085
                
Lines 8067-8075 private: Source/JavaScriptCore/ftl/FTLLowerDFGToB3.cpp_sec99
8067
                speculate(OutOfBounds, noValue(), 0, isOutOfBounds);
8092
                speculate(OutOfBounds, noValue(), 0, isOutOfBounds);
8068
            else {
8093
            else {
8069
                LBasicBlock outOfBoundsCase =
8094
                LBasicBlock outOfBoundsCase =
8070
                    FTL_NEW_BLOCK(m_out, ("PutByVal out of bounds"));
8095
                    m_out.newBlock();
8071
                LBasicBlock holeCase =
8096
                LBasicBlock holeCase =
8072
                    FTL_NEW_BLOCK(m_out, ("PutByVal hole case"));
8097
                    m_out.newBlock();
8073
                    
8098
                    
8074
                m_out.branch(isOutOfBounds, rarely(outOfBoundsCase), usually(holeCase));
8099
                m_out.branch(isOutOfBounds, rarely(outOfBoundsCase), usually(holeCase));
8075
                    
8100
                    
Lines 8144-8152 private: Source/JavaScriptCore/ftl/FTLLowerDFGToB3.cpp_sec100
8144
        LValue stringImpl = m_out.loadPtr(string, m_heaps.JSString_value);
8169
        LValue stringImpl = m_out.loadPtr(string, m_heaps.JSString_value);
8145
        LValue length = m_out.load32(string, m_heaps.JSString_length);
8170
        LValue length = m_out.load32(string, m_heaps.JSString_length);
8146
        
8171
        
8147
        LBasicBlock hasImplBlock = FTL_NEW_BLOCK(m_out, ("Switch/SwitchString has impl case"));
8172
        LBasicBlock hasImplBlock = m_out.newBlock();
8148
        LBasicBlock is8BitBlock = FTL_NEW_BLOCK(m_out, ("Switch/SwitchString is 8 bit case"));
8173
        LBasicBlock is8BitBlock = m_out.newBlock();
8149
        LBasicBlock slowBlock = FTL_NEW_BLOCK(m_out, ("Switch/SwitchString slow case"));
8174
        LBasicBlock slowBlock = m_out.newBlock();
8150
        
8175
        
8151
        m_out.branch(m_out.isNull(stringImpl), unsure(slowBlock), unsure(hasImplBlock));
8176
        m_out.branch(m_out.isNull(stringImpl), unsure(slowBlock), unsure(hasImplBlock));
8152
        
8177
        
Lines 8322-8328 private: Source/JavaScriptCore/ftl/FTLLowerDFGToB3.cpp_sec101
8322
        
8347
        
8323
        Vector<LBasicBlock> characterBlocks;
8348
        Vector<LBasicBlock> characterBlocks;
8324
        for (CharacterCase& myCase : characterCases)
8349
        for (CharacterCase& myCase : characterCases)
8325
            characterBlocks.append(FTL_NEW_BLOCK(m_out, ("Switch/SwitchString case for ", myCase.character, " at index ", commonChars)));
8350
            characterBlocks.append(m_out.newBlock());
8326
        
8351
        
8327
        Vector<SwitchCase> switchCases;
8352
        Vector<SwitchCase> switchCases;
8328
        for (unsigned i = 0; i < characterCases.size(); ++i) {
8353
        for (unsigned i = 0; i < characterCases.size(); ++i) {
Lines 8416-8422 private: Source/JavaScriptCore/ftl/FTLLowerDFGToB3.cpp_sec102
8416
    // contination and set it as the nextBlock (m_out.insertNewBlocksBefore(continuation)) before
8441
    // contination and set it as the nextBlock (m_out.insertNewBlocksBefore(continuation)) before
8417
    // calling this. For example:
8442
    // calling this. For example:
8418
    //
8443
    //
8419
    // LBasicBlock continuation = FTL_NEW_BLOCK(m_out, ("My continuation"));
8444
    // LBasicBlock continuation = m_out.newBlock();
8420
    // LBasicBlock lastNext = m_out.insertNewBlocksBefore(continuation);
8445
    // LBasicBlock lastNext = m_out.insertNewBlocksBefore(continuation);
8421
    // buildTypeOf(
8446
    // buildTypeOf(
8422
    //     child, value,
8447
    //     child, value,
Lines 8456-8477 private: Source/JavaScriptCore/ftl/FTLLowerDFGToB3.cpp_sec103
8456
        //     return undefined
8481
        //     return undefined
8457
        // }
8482
        // }
8458
        
8483
        
8459
        LBasicBlock cellCase = FTL_NEW_BLOCK(m_out, ("buildTypeOf cell case"));
8484
        LBasicBlock cellCase = m_out.newBlock();
8460
        LBasicBlock objectCase = FTL_NEW_BLOCK(m_out, ("buildTypeOf object case"));
8485
        LBasicBlock objectCase = m_out.newBlock();
8461
        LBasicBlock functionCase = FTL_NEW_BLOCK(m_out, ("buildTypeOf function case"));
8486
        LBasicBlock functionCase = m_out.newBlock();
8462
        LBasicBlock notFunctionCase = FTL_NEW_BLOCK(m_out, ("buildTypeOf not function case"));
8487
        LBasicBlock notFunctionCase = m_out.newBlock();
8463
        LBasicBlock reallyObjectCase = FTL_NEW_BLOCK(m_out, ("buildTypeOf really object case"));
8488
        LBasicBlock reallyObjectCase = m_out.newBlock();
8464
        LBasicBlock slowPath = FTL_NEW_BLOCK(m_out, ("buildTypeOf slow path"));
8489
        LBasicBlock slowPath = m_out.newBlock();
8465
        LBasicBlock unreachable = FTL_NEW_BLOCK(m_out, ("buildTypeOf unreachable"));
8490
        LBasicBlock unreachable = m_out.newBlock();
8466
        LBasicBlock notObjectCase = FTL_NEW_BLOCK(m_out, ("buildTypeOf not object case"));
8491
        LBasicBlock notObjectCase = m_out.newBlock();
8467
        LBasicBlock stringCase = FTL_NEW_BLOCK(m_out, ("buildTypeOf string case"));
8492
        LBasicBlock stringCase = m_out.newBlock();
8468
        LBasicBlock symbolCase = FTL_NEW_BLOCK(m_out, ("buildTypeOf symbol case"));
8493
        LBasicBlock symbolCase = m_out.newBlock();
8469
        LBasicBlock notCellCase = FTL_NEW_BLOCK(m_out, ("buildTypeOf not cell case"));
8494
        LBasicBlock notCellCase = m_out.newBlock();
8470
        LBasicBlock numberCase = FTL_NEW_BLOCK(m_out, ("buildTypeOf number case"));
8495
        LBasicBlock numberCase = m_out.newBlock();
8471
        LBasicBlock notNumberCase = FTL_NEW_BLOCK(m_out, ("buildTypeOf not number case"));
8496
        LBasicBlock notNumberCase = m_out.newBlock();
8472
        LBasicBlock notNullCase = FTL_NEW_BLOCK(m_out, ("buildTypeOf not null case"));
8497
        LBasicBlock notNullCase = m_out.newBlock();
8473
        LBasicBlock booleanCase = FTL_NEW_BLOCK(m_out, ("buildTypeOf boolean case"));
8498
        LBasicBlock booleanCase = m_out.newBlock();
8474
        LBasicBlock undefinedCase = FTL_NEW_BLOCK(m_out, ("buildTypeOf undefined case"));
8499
        LBasicBlock undefinedCase = m_out.newBlock();
8475
        
8500
        
8476
        m_out.branch(isCell(value, provenType(child)), unsure(cellCase), unsure(notCellCase));
8501
        m_out.branch(isCell(value, provenType(child)), unsure(cellCase), unsure(notCellCase));
8477
        
8502
        
Lines 8551-8560 private: Source/JavaScriptCore/ftl/FTLLowerDFGToB3.cpp_sec104
8551
    
8576
    
8552
    LValue doubleToInt32(LValue doubleValue, double low, double high, bool isSigned = true)
8577
    LValue doubleToInt32(LValue doubleValue, double low, double high, bool isSigned = true)
8553
    {
8578
    {
8554
        LBasicBlock greatEnough = FTL_NEW_BLOCK(m_out, ("doubleToInt32 greatEnough"));
8579
        LBasicBlock greatEnough = m_out.newBlock();
8555
        LBasicBlock withinRange = FTL_NEW_BLOCK(m_out, ("doubleToInt32 withinRange"));
8580
        LBasicBlock withinRange = m_out.newBlock();
8556
        LBasicBlock slowPath = FTL_NEW_BLOCK(m_out, ("doubleToInt32 slowPath"));
8581
        LBasicBlock slowPath = m_out.newBlock();
8557
        LBasicBlock continuation = FTL_NEW_BLOCK(m_out, ("doubleToInt32 continuation"));
8582
        LBasicBlock continuation = m_out.newBlock();
8558
        
8583
        
8559
        Vector<ValueFromBlock, 2> results;
8584
        Vector<ValueFromBlock, 2> results;
8560
        
8585
        
Lines 8595-8602 private: Source/JavaScriptCore/ftl/FTLLowerDFGToB3.cpp_sec105
8595
    
8620
    
8596
    LValue sensibleDoubleToInt32(LValue doubleValue)
8621
    LValue sensibleDoubleToInt32(LValue doubleValue)
8597
    {
8622
    {
8598
        LBasicBlock slowPath = FTL_NEW_BLOCK(m_out, ("sensible doubleToInt32 slow path"));
8623
        LBasicBlock slowPath = m_out.newBlock();
8599
        LBasicBlock continuation = FTL_NEW_BLOCK(m_out, ("sensible doubleToInt32 continuation"));
8624
        LBasicBlock continuation = m_out.newBlock();
8600
8625
8601
        LValue fastResultValue = m_out.doubleToInt(doubleValue);
8626
        LValue fastResultValue = m_out.doubleToInt(doubleValue);
8602
        ValueFromBlock fastResult = m_out.anchor(fastResultValue);
8627
        ValueFromBlock fastResult = m_out.anchor(fastResultValue);
Lines 9110-9118 private: Source/JavaScriptCore/ftl/FTLLowerDFGToB3.cpp_sec106
9110
    
9135
    
9111
    LValue strictInt52ToJSValue(LValue value)
9136
    LValue strictInt52ToJSValue(LValue value)
9112
    {
9137
    {
9113
        LBasicBlock isInt32 = FTL_NEW_BLOCK(m_out, ("strictInt52ToJSValue isInt32 case"));
9138
        LBasicBlock isInt32 = m_out.newBlock();
9114
        LBasicBlock isDouble = FTL_NEW_BLOCK(m_out, ("strictInt52ToJSValue isDouble case"));
9139
        LBasicBlock isDouble = m_out.newBlock();
9115
        LBasicBlock continuation = FTL_NEW_BLOCK(m_out, ("strictInt52ToJSValue continuation"));
9140
        LBasicBlock continuation = m_out.newBlock();
9116
        
9141
        
9117
        Vector<ValueFromBlock, 2> results;
9142
        Vector<ValueFromBlock, 2> results;
9118
            
9143
            
Lines 9190-9198 private: Source/JavaScriptCore/ftl/FTLLowerDFGToB3.cpp_sec107
9190
    
9215
    
9191
    LValue jsValueToStrictInt52(Edge edge, LValue boxedValue)
9216
    LValue jsValueToStrictInt52(Edge edge, LValue boxedValue)
9192
    {
9217
    {
9193
        LBasicBlock intCase = FTL_NEW_BLOCK(m_out, ("jsValueToInt52 unboxing int case"));
9218
        LBasicBlock intCase = m_out.newBlock();
9194
        LBasicBlock doubleCase = FTL_NEW_BLOCK(m_out, ("jsValueToInt52 unboxing double case"));
9219
        LBasicBlock doubleCase = m_out.newBlock();
9195
        LBasicBlock continuation = FTL_NEW_BLOCK(m_out, ("jsValueToInt52 unboxing continuation"));
9220
        LBasicBlock continuation = m_out.newBlock();
9196
            
9221
            
9197
        LValue isNotInt32;
9222
        LValue isNotInt32;
9198
        if (!m_interpreter.needsTypeCheck(edge, SpecInt32))
9223
        if (!m_interpreter.needsTypeCheck(edge, SpecInt32))
Lines 9244-9251 private: Source/JavaScriptCore/ftl/FTLLowerDFGToB3.cpp_sec108
9244
        speculate(Overflow, FormattedValue(DataFormatDouble, value), m_node, valueNotConvertibleToInteger);
9269
        speculate(Overflow, FormattedValue(DataFormatDouble, value), m_node, valueNotConvertibleToInteger);
9245
9270
9246
        if (shouldCheckNegativeZero) {
9271
        if (shouldCheckNegativeZero) {
9247
            LBasicBlock valueIsZero = FTL_NEW_BLOCK(m_out, ("ConvertDoubleToInt32 on zero"));
9272
            LBasicBlock valueIsZero = m_out.newBlock();
9248
            LBasicBlock continuation = FTL_NEW_BLOCK(m_out, ("ConvertDoubleToInt32 continuation"));
9273
            LBasicBlock continuation = m_out.newBlock();
9249
            m_out.branch(m_out.isZero32(integerValue), unsure(valueIsZero), unsure(continuation));
9274
            m_out.branch(m_out.isZero32(integerValue), unsure(valueIsZero), unsure(continuation));
9250
9275
9251
            LBasicBlock lastNext = m_out.appendTo(valueIsZero, continuation);
9276
            LBasicBlock lastNext = m_out.appendTo(valueIsZero, continuation);
Lines 9398-9403 private: Source/JavaScriptCore/ftl/FTLLowerDFGToB3.cpp_sec109
9398
        case StringUse:
9423
        case StringUse:
9399
            speculateString(edge);
9424
            speculateString(edge);
9400
            break;
9425
            break;
9426
        case StringOrOtherUse:
9427
            speculateStringOrOther(edge);
9428
            break;
9401
        case StringIdentUse:
9429
        case StringIdentUse:
9402
            speculateStringIdent(edge);
9430
            speculateStringIdent(edge);
9403
            break;
9431
            break;
Lines 9461-9468 private: Source/JavaScriptCore/ftl/FTLLowerDFGToB3.cpp_sec110
9461
    {
9489
    {
9462
        LValue value = lowJSValue(edge, ManualOperandSpeculation);
9490
        LValue value = lowJSValue(edge, ManualOperandSpeculation);
9463
9491
9464
        LBasicBlock isNotCell = FTL_NEW_BLOCK(m_out, ("Speculate CellOrOther not cell"));
9492
        LBasicBlock isNotCell = m_out.newBlock();
9465
        LBasicBlock continuation = FTL_NEW_BLOCK(m_out, ("Speculate CellOrOther continuation"));
9493
        LBasicBlock continuation = m_out.newBlock();
9466
9494
9467
        m_out.branch(isCell(value, provenType(edge)), unsure(continuation), unsure(isNotCell));
9495
        m_out.branch(isCell(value, provenType(edge)), unsure(continuation), unsure(isNotCell));
9468
9496
Lines 9637-9645 private: Source/JavaScriptCore/ftl/FTLLowerDFGToB3.cpp_sec111
9637
        
9665
        
9638
        LValue value = lowJSValue(edge, ManualOperandSpeculation);
9666
        LValue value = lowJSValue(edge, ManualOperandSpeculation);
9639
        
9667
        
9640
        LBasicBlock cellCase = FTL_NEW_BLOCK(m_out, ("speculateObjectOrOther cell case"));
9668
        LBasicBlock cellCase = m_out.newBlock();
9641
        LBasicBlock primitiveCase = FTL_NEW_BLOCK(m_out, ("speculateObjectOrOther primitive case"));
9669
        LBasicBlock primitiveCase = m_out.newBlock();
9642
        LBasicBlock continuation = FTL_NEW_BLOCK(m_out, ("speculateObjectOrOther continuation"));
9670
        LBasicBlock continuation = m_out.newBlock();
9643
        
9671
        
9644
        m_out.branch(isNotCell(value, provenType(edge)), unsure(primitiveCase), unsure(cellCase));
9672
        m_out.branch(isNotCell(value, provenType(edge)), unsure(primitiveCase), unsure(cellCase));
9645
        
9673
        
Lines 9692-9697 private: Source/JavaScriptCore/ftl/FTLLowerDFGToB3.cpp_sec112
9692
        speculateString(edge, lowCell(edge));
9720
        speculateString(edge, lowCell(edge));
9693
    }
9721
    }
9694
    
9722
    
9723
    void speculateStringOrOther(Edge edge, LValue value)
9724
    {
9725
        LBasicBlock cellCase = m_out.newBlock();
9726
        LBasicBlock notCellCase = m_out.newBlock();
9727
        LBasicBlock continuation = m_out.newBlock();
9728
9729
        m_out.branch(isCell(value, provenType(edge)), unsure(cellCase), unsure(notCellCase));
9730
9731
        LBasicBlock lastNext = m_out.appendTo(cellCase, notCellCase);
9732
9733
        FTL_TYPE_CHECK(jsValueValue(value), edge, (~SpecCell) | SpecString, isNotString(value));
9734
9735
        m_out.jump(continuation);
9736
        m_out.appendTo(notCellCase, continuation);
9737
9738
        FTL_TYPE_CHECK(jsValueValue(value), edge, SpecCell | SpecOther, isNotOther(value));
9739
9740
        m_out.jump(continuation);
9741
        m_out.appendTo(continuation, lastNext);
9742
    }
9743
    
9744
    void speculateStringOrOther(Edge edge)
9745
    {
9746
        speculateStringOrOther(edge, lowJSValue(edge, ManualOperandSpeculation));
9747
    }
9748
    
9695
    void speculateStringIdent(Edge edge, LValue string, LValue stringImpl)
9749
    void speculateStringIdent(Edge edge, LValue string, LValue stringImpl)
9696
    {
9750
    {
9697
        if (!m_interpreter.needsTypeCheck(edge, SpecStringIdent | ~SpecString))
9751
        if (!m_interpreter.needsTypeCheck(edge, SpecStringIdent | ~SpecString))
Lines 9725-9732 private: Source/JavaScriptCore/ftl/FTLLowerDFGToB3.cpp_sec113
9725
        if (!m_interpreter.needsTypeCheck(edge, SpecString | SpecStringObject))
9779
        if (!m_interpreter.needsTypeCheck(edge, SpecString | SpecStringObject))
9726
            return;
9780
            return;
9727
        
9781
        
9728
        LBasicBlock notString = FTL_NEW_BLOCK(m_out, ("Speculate StringOrStringObject not string case"));
9782
        LBasicBlock notString = m_out.newBlock();
9729
        LBasicBlock continuation = FTL_NEW_BLOCK(m_out, ("Speculate StringOrStringObject continuation"));
9783
        LBasicBlock continuation = m_out.newBlock();
9730
        
9784
        
9731
        LValue structureID = m_out.load32(lowCell(edge), m_heaps.JSCell_structureID);
9785
        LValue structureID = m_out.load32(lowCell(edge), m_heaps.JSCell_structureID);
9732
        m_out.branch(
9786
        m_out.branch(
Lines 9798-9805 private: Source/JavaScriptCore/ftl/FTLLowerDFGToB3.cpp_sec114
9798
        LValue value = lowJSValue(edge, ManualOperandSpeculation);
9852
        LValue value = lowJSValue(edge, ManualOperandSpeculation);
9799
        LValue doubleValue = unboxDouble(value);
9853
        LValue doubleValue = unboxDouble(value);
9800
        
9854
        
9801
        LBasicBlock intCase = FTL_NEW_BLOCK(m_out, ("speculateRealNumber int case"));
9855
        LBasicBlock intCase = m_out.newBlock();
9802
        LBasicBlock continuation = FTL_NEW_BLOCK(m_out, ("speculateRealNumber continuation"));
9856
        LBasicBlock continuation = m_out.newBlock();
9803
        
9857
        
9804
        m_out.branch(
9858
        m_out.branch(
9805
            m_out.doubleEqual(doubleValue, doubleValue),
9859
            m_out.doubleEqual(doubleValue, doubleValue),
Lines 9847-9855 private: Source/JavaScriptCore/ftl/FTLLowerDFGToB3.cpp_sec115
9847
        
9901
        
9848
        LValue value = lowJSValue(edge, ManualOperandSpeculation);
9902
        LValue value = lowJSValue(edge, ManualOperandSpeculation);
9849
        
9903
        
9850
        LBasicBlock isCellCase = FTL_NEW_BLOCK(m_out, ("Speculate NotStringVar is cell case"));
9904
        LBasicBlock isCellCase = m_out.newBlock();
9851
        LBasicBlock isStringCase = FTL_NEW_BLOCK(m_out, ("Speculate NotStringVar is string case"));
9905
        LBasicBlock isStringCase = m_out.newBlock();
9852
        LBasicBlock continuation = FTL_NEW_BLOCK(m_out, ("Speculate NotStringVar continuation"));
9906
        LBasicBlock continuation = m_out.newBlock();
9853
        
9907
        
9854
        m_out.branch(isCell(value, provenType(edge)), unsure(isCellCase), unsure(continuation));
9908
        m_out.branch(isCell(value, provenType(edge)), unsure(isCellCase), unsure(continuation));
9855
        
9909
        
Lines 9902-9909 private: Source/JavaScriptCore/ftl/FTLLowerDFGToB3.cpp_sec116
9902
9956
9903
    void emitStoreBarrier(LValue base)
9957
    void emitStoreBarrier(LValue base)
9904
    {
9958
    {
9905
        LBasicBlock slowPath = FTL_NEW_BLOCK(m_out, ("Store barrier slow path"));
9959
        LBasicBlock slowPath = m_out.newBlock();
9906
        LBasicBlock continuation = FTL_NEW_BLOCK(m_out, ("Store barrier continuation"));
9960
        LBasicBlock continuation = m_out.newBlock();
9907
9961
9908
        m_out.branch(
9962
        m_out.branch(
9909
            m_out.notZero32(loadCellState(base)), usually(continuation), rarely(slowPath));
9963
            m_out.notZero32(loadCellState(base)), usually(continuation), rarely(slowPath));
Lines 10026-10032 private: Source/JavaScriptCore/ftl/FTLLowerDFGToB3.cpp_sec117
10026
            return;
10080
            return;
10027
        }
10081
        }
10028
10082
10029
        LBasicBlock continuation = FTL_NEW_BLOCK(m_out, ("Exception check continuation"));
10083
        LBasicBlock continuation = m_out.newBlock();
10030
10084
10031
        m_out.branch(
10085
        m_out.branch(
10032
            hadException, rarely(m_handleExceptions), usually(continuation));
10086
            hadException, rarely(m_handleExceptions), usually(continuation));
- Source/JavaScriptCore/ftl/FTLOutput.cpp -1 / +1 lines
Lines 49-55 void Output::initialize(AbstractHeapRepo Source/JavaScriptCore/ftl/FTLOutput.cpp_sec1
49
    m_heaps = &heaps;
49
    m_heaps = &heaps;
50
}
50
}
51
51
52
LBasicBlock Output::newBlock(const char*)
52
LBasicBlock Output::newBlock()
53
{
53
{
54
    LBasicBlock result = m_proc.addBlock(m_frequency);
54
    LBasicBlock result = m_proc.addBlock(m_frequency);
55
55
- Source/JavaScriptCore/ftl/FTLOutput.h -6 / +1 lines
Lines 82-88 public: Source/JavaScriptCore/ftl/FTLOutput.h_sec1
82
        m_frequency = value;
82
        m_frequency = value;
83
    }
83
    }
84
84
85
    LBasicBlock newBlock(const char* name = "");
85
    LBasicBlock newBlock();
86
86
87
    LBasicBlock insertNewBlocksBefore(LBasicBlock nextBlock)
87
    LBasicBlock insertNewBlocksBefore(LBasicBlock nextBlock)
88
    {
88
    {
Lines 524-534 inline LValue Output::fround(LValue doub Source/JavaScriptCore/ftl/FTLOutput.h_sec2
524
#pragma GCC diagnostic pop
524
#pragma GCC diagnostic pop
525
#endif // COMPILER(GCC_OR_CLANG)
525
#endif // COMPILER(GCC_OR_CLANG)
526
526
527
#define FTL_NEW_BLOCK(output, nameArguments) \
528
    (LIKELY(!verboseCompilationEnabled()) \
529
    ? (output).newBlock() \
530
    : (output).newBlock((toCString nameArguments).data()))
531
532
} } // namespace JSC::FTL
527
} } // namespace JSC::FTL
533
528
534
#endif // ENABLE(FTL_JIT)
529
#endif // ENABLE(FTL_JIT)

Return to Bug 155094