| Differences between
and this patch
- Source/JavaScriptCore/ChangeLog +155 lines
Lines 1-3 Source/JavaScriptCore/ChangeLog_sec1
1
2016-03-06  Filip Pizlo  <fpizlo@apple.com>
2
3
        DFG should know how to speculate StringOrOther
4
        https://bugs.webkit.org/show_bug.cgi?id=155094
5
6
        Reviewed by NOBODY (OOPS!).
7
8
        Any code that processes the regexp matches array was previously doing a relatively expensive
9
        Branch(Untyped:). This introduces a new use kind called StringOrOther, which is perfect for
10
        code that loops over the matches array and branches on the entries being non-empty.
11
12
        To do this, I needed to introduce code into the FTL that creates new blocks. We still had that
13
        awful FTL_NEW_BLOCK idiom since the only way to debug LLVM IR was to ascribe names to basic
14
        blocks. B3 IR is inherently more debuggable since unlike LLVM, B3 knows how to always respect
15
        code origin, and it knows how to print the code origin nicely in the dumps. So, rather than
16
        continue using FTL_NEW_BLOCK(m_out, ("things")), I replaced all of that stuff with
17
        m_out.newBlock(). It's much nicer that way.
18
19
        This is a tiny speed-up on Octane/regexp at best. I was hoping for more. Oh well.
20
21
        * bytecode/SpeculatedType.h:
22
        (JSC::isStringSpeculation):
23
        (JSC::isStringOrOtherSpeculation):
24
        (JSC::isSymbolSpeculation):
25
        * dfg/DFGFixupPhase.cpp:
26
        (JSC::DFG::FixupPhase::fixupNode):
27
        * dfg/DFGNode.h:
28
        (JSC::DFG::Node::shouldSpeculateString):
29
        (JSC::DFG::Node::shouldSpeculateStringOrOther):
30
        (JSC::DFG::Node::shouldSpeculateStringObject):
31
        * dfg/DFGSafeToExecute.h:
32
        (JSC::DFG::SafeToExecuteEdge::operator()):
33
        * dfg/DFGSpeculativeJIT.cpp:
34
        (JSC::DFG::SpeculativeJIT::compileStringZeroLength):
35
        (JSC::DFG::SpeculativeJIT::compileLogicalNotStringOrOther):
36
        (JSC::DFG::SpeculativeJIT::emitStringBranch):
37
        (JSC::DFG::SpeculativeJIT::emitStringOrOtherBranch):
38
        (JSC::DFG::SpeculativeJIT::compileConstantStoragePointer):
39
        (JSC::DFG::SpeculativeJIT::speculateObjectOrOther):
40
        (JSC::DFG::SpeculativeJIT::speculateString):
41
        (JSC::DFG::SpeculativeJIT::speculateStringOrOther):
42
        (JSC::DFG::SpeculativeJIT::speculateStringIdentAndLoadStorage):
43
        (JSC::DFG::SpeculativeJIT::speculate):
44
        * dfg/DFGSpeculativeJIT.h:
45
        * dfg/DFGSpeculativeJIT32_64.cpp:
46
        (JSC::DFG::SpeculativeJIT::compileLogicalNot):
47
        (JSC::DFG::SpeculativeJIT::emitBranch):
48
        * dfg/DFGSpeculativeJIT64.cpp:
49
        (JSC::DFG::SpeculativeJIT::compileLogicalNot):
50
        (JSC::DFG::SpeculativeJIT::emitBranch):
51
        * dfg/DFGUseKind.cpp:
52
        (WTF::printInternal):
53
        * dfg/DFGUseKind.h:
54
        (JSC::DFG::typeFilterFor):
55
        * ftl/FTLCapabilities.cpp:
56
        (JSC::FTL::canCompile):
57
        * ftl/FTLLowerDFGToB3.cpp:
58
        (JSC::FTL::DFG::LowerDFGToB3::lower):
59
        (JSC::FTL::DFG::LowerDFGToB3::compileDoubleRep):
60
        (JSC::FTL::DFG::LowerDFGToB3::compileBooleanToNumber):
61
        (JSC::FTL::DFG::LowerDFGToB3::compileToThis):
62
        (JSC::FTL::DFG::LowerDFGToB3::compileArithMul):
63
        (JSC::FTL::DFG::LowerDFGToB3::compileArithDiv):
64
        (JSC::FTL::DFG::LowerDFGToB3::compileArithMod):
65
        (JSC::FTL::DFG::LowerDFGToB3::compileArithMinOrMax):
66
        (JSC::FTL::DFG::LowerDFGToB3::compileArithPow):
67
        (JSC::FTL::DFG::LowerDFGToB3::compileArithRound):
68
        (JSC::FTL::DFG::LowerDFGToB3::compileCheckStructure):
69
        (JSC::FTL::DFG::LowerDFGToB3::compileArrayifyToStructure):
70
        (JSC::FTL::DFG::LowerDFGToB3::compileGetById):
71
        (JSC::FTL::DFG::LowerDFGToB3::compileGetIndexedPropertyStorage):
72
        (JSC::FTL::DFG::LowerDFGToB3::compileGetTypedArrayByteOffset):
73
        (JSC::FTL::DFG::LowerDFGToB3::compileGetByVal):
74
        (JSC::FTL::DFG::LowerDFGToB3::compilePutByVal):
75
        (JSC::FTL::DFG::LowerDFGToB3::compileArrayPush):
76
        (JSC::FTL::DFG::LowerDFGToB3::compileArrayPop):
77
        (JSC::FTL::DFG::LowerDFGToB3::compileCreateActivation):
78
        (JSC::FTL::DFG::LowerDFGToB3::compileNewFunction):
79
        (JSC::FTL::DFG::LowerDFGToB3::compileCreateDirectArguments):
80
        (JSC::FTL::DFG::LowerDFGToB3::compileCopyRest):
81
        (JSC::FTL::DFG::LowerDFGToB3::compileGetRestLength):
82
        (JSC::FTL::DFG::LowerDFGToB3::compileNewArrayWithSize):
83
        (JSC::FTL::DFG::LowerDFGToB3::compileNewTypedArray):
84
        (JSC::FTL::DFG::LowerDFGToB3::compileToStringOrCallStringConstructor):
85
        (JSC::FTL::DFG::LowerDFGToB3::compileToPrimitive):
86
        (JSC::FTL::DFG::LowerDFGToB3::compileMakeRope):
87
        (JSC::FTL::DFG::LowerDFGToB3::compileStringCharAt):
88
        (JSC::FTL::DFG::LowerDFGToB3::compileStringCharCodeAt):
89
        (JSC::FTL::DFG::LowerDFGToB3::compileStringFromCharCode):
90
        (JSC::FTL::DFG::LowerDFGToB3::compileMultiGetByOffset):
91
        (JSC::FTL::DFG::LowerDFGToB3::compileMultiPutByOffset):
92
        (JSC::FTL::DFG::LowerDFGToB3::compileNotifyWrite):
93
        (JSC::FTL::DFG::LowerDFGToB3::compileCompareStrictEq):
94
        (JSC::FTL::DFG::LowerDFGToB3::compileForwardVarargs):
95
        (JSC::FTL::DFG::LowerDFGToB3::compileSwitch):
96
        (JSC::FTL::DFG::LowerDFGToB3::compileIsString):
97
        (JSC::FTL::DFG::LowerDFGToB3::compileIsObject):
98
        (JSC::FTL::DFG::LowerDFGToB3::compileIsObjectOrNull):
99
        (JSC::FTL::DFG::LowerDFGToB3::compileIsFunction):
100
        (JSC::FTL::DFG::LowerDFGToB3::compileTypeOf):
101
        (JSC::FTL::DFG::LowerDFGToB3::compileOverridesHasInstance):
102
        (JSC::FTL::DFG::LowerDFGToB3::compileInstanceOf):
103
        (JSC::FTL::DFG::LowerDFGToB3::compileHasIndexedProperty):
104
        (JSC::FTL::DFG::LowerDFGToB3::compileHasStructureProperty):
105
        (JSC::FTL::DFG::LowerDFGToB3::compileGetDirectPname):
106
        (JSC::FTL::DFG::LowerDFGToB3::compileGetEnumeratorStructurePname):
107
        (JSC::FTL::DFG::LowerDFGToB3::compileGetEnumeratorGenericPname):
108
        (JSC::FTL::DFG::LowerDFGToB3::compileMaterializeNewObject):
109
        (JSC::FTL::DFG::LowerDFGToB3::compileMaterializeCreateActivation):
110
        (JSC::FTL::DFG::LowerDFGToB3::compileCheckWatchdogTimer):
111
        (JSC::FTL::DFG::LowerDFGToB3::checkStructure):
112
        (JSC::FTL::DFG::LowerDFGToB3::numberOrNotCellToInt32):
113
        (JSC::FTL::DFG::LowerDFGToB3::checkInferredType):
114
        (JSC::FTL::DFG::LowerDFGToB3::allocatePropertyStorageWithSizeImpl):
115
        (JSC::FTL::DFG::LowerDFGToB3::loadVectorWithBarrier):
116
        (JSC::FTL::DFG::LowerDFGToB3::copyBarrier):
117
        (JSC::FTL::DFG::LowerDFGToB3::loadVectorReadOnly):
118
        (JSC::FTL::DFG::LowerDFGToB3::compareEqObjectOrOtherToObject):
119
        (JSC::FTL::DFG::LowerDFGToB3::nonSpeculativeCompare):
120
        (JSC::FTL::DFG::LowerDFGToB3::stringsEqual):
121
        (JSC::FTL::DFG::LowerDFGToB3::allocateCell):
122
        (JSC::FTL::DFG::LowerDFGToB3::allocateVariableSizedObject):
123
        (JSC::FTL::DFG::LowerDFGToB3::allocateBasicStorageAndGetEnd):
124
        (JSC::FTL::DFG::LowerDFGToB3::allocateObject):
125
        (JSC::FTL::DFG::LowerDFGToB3::allocateJSArray):
126
        (JSC::FTL::DFG::LowerDFGToB3::boolify):
127
        (JSC::FTL::DFG::LowerDFGToB3::equalNullOrUndefined):
128
        (JSC::FTL::DFG::LowerDFGToB3::contiguousPutByValOutOfBounds):
129
        (JSC::FTL::DFG::LowerDFGToB3::switchString):
130
        (JSC::FTL::DFG::LowerDFGToB3::switchStringRecurse):
131
        (JSC::FTL::DFG::LowerDFGToB3::buildTypeOf):
132
        (JSC::FTL::DFG::LowerDFGToB3::doubleToInt32):
133
        (JSC::FTL::DFG::LowerDFGToB3::sensibleDoubleToInt32):
134
        (JSC::FTL::DFG::LowerDFGToB3::strictInt52ToJSValue):
135
        (JSC::FTL::DFG::LowerDFGToB3::jsValueToStrictInt52):
136
        (JSC::FTL::DFG::LowerDFGToB3::convertDoubleToInt32):
137
        (JSC::FTL::DFG::LowerDFGToB3::speculate):
138
        (JSC::FTL::DFG::LowerDFGToB3::speculateCellOrOther):
139
        (JSC::FTL::DFG::LowerDFGToB3::speculateObjectOrOther):
140
        (JSC::FTL::DFG::LowerDFGToB3::speculateString):
141
        (JSC::FTL::DFG::LowerDFGToB3::speculateStringOrOther):
142
        (JSC::FTL::DFG::LowerDFGToB3::speculateStringIdent):
143
        (JSC::FTL::DFG::LowerDFGToB3::speculateStringOrStringObject):
144
        (JSC::FTL::DFG::LowerDFGToB3::speculateRealNumber):
145
        (JSC::FTL::DFG::LowerDFGToB3::speculateNotStringVar):
146
        (JSC::FTL::DFG::LowerDFGToB3::emitStoreBarrier):
147
        (JSC::FTL::DFG::LowerDFGToB3::callCheck):
148
        * ftl/FTLOutput.cpp:
149
        (JSC::FTL::Output::initialize):
150
        (JSC::FTL::Output::newBlock):
151
        (JSC::FTL::Output::check):
152
        * ftl/FTLOutput.h:
153
        (JSC::FTL::Output::setFrequency):
154
        (JSC::FTL::Output::insertNewBlocksBefore):
155
1
2016-03-06  Filip Pizlo  <fpizlo@apple.com>
156
2016-03-06  Filip Pizlo  <fpizlo@apple.com>
2
157
3
        RegExpMatchesArray doesn't know how to have a bad time
158
        RegExpMatchesArray doesn't know how to have a bad time
- 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 923-928 private: Source/JavaScriptCore/dfg/DFGFixupPhase.cpp_sec2
923
                fixEdge<DoubleRepUse>(node->child1());
925
                fixEdge<DoubleRepUse>(node->child1());
924
            else if (node->child1()->shouldSpeculateString())
926
            else if (node->child1()->shouldSpeculateString())
925
                fixEdge<StringUse>(node->child1());
927
                fixEdge<StringUse>(node->child1());
928
            else if (node->child1()->shouldSpeculateStringOrOther())
929
                fixEdge<StringOrOtherUse>(node->child1());
926
            break;
930
            break;
927
        }
931
        }
928
            
932
            
- 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 / +74 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->child1(), (~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(valueRegs, 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(valueRegs, 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 6661-6671 void SpeculativeJIT::speculateObjectOrOt Source/JavaScriptCore/dfg/DFGSpeculativeJIT.cpp_sec3
6661
        operand.jsValueRegs(), edge, (~SpecCell) | SpecObject, m_jit.branchIfNotObject(gpr));
6706
        operand.jsValueRegs(), edge, (~SpecCell) | SpecObject, m_jit.branchIfNotObject(gpr));
6662
    MacroAssembler::Jump done = m_jit.jump();
6707
    MacroAssembler::Jump done = m_jit.jump();
6663
    notCell.link(&m_jit);
6708
    notCell.link(&m_jit);
6664
    if (needsTypeCheck(edge, SpecCell | SpecOther)) {
6709
    DFG_TYPE_CHECK(
6665
        typeCheck(
6710
        operand.jsValueRegs(), edge, SpecCell | SpecOther,
6666
            operand.jsValueRegs(), edge, SpecCell | SpecOther,
6711
        m_jit.branchIfNotOther(operand.jsValueRegs(), tempGPR));
6667
            m_jit.branchIfNotOther(operand.jsValueRegs(), tempGPR));
6668
    }
6669
    done.link(&m_jit);
6712
    done.link(&m_jit);
6670
}
6713
}
6671
6714
Lines 6675-6680 void SpeculativeJIT::speculateString(Edg Source/JavaScriptCore/dfg/DFGSpeculativeJIT.cpp_sec4
6675
        JSValueSource::unboxedCell(cell), edge, SpecString | ~SpecCell, m_jit.branchIfNotString(cell));
6718
        JSValueSource::unboxedCell(cell), edge, SpecString | ~SpecCell, m_jit.branchIfNotString(cell));
6676
}
6719
}
6677
6720
6721
void SpeculativeJIT::speculateStringOrOther(Edge edge, JSValueRegs regs, GPRReg scratch)
6722
{
6723
    JITCompiler::Jump notCell = m_jit.branchIfNotCell(regs);
6724
    GPRReg cell = regs.payloadGPR();
6725
    DFG_TYPE_CHECK(regs, edge, (~SpecCell) | SpecString, m_jit.branchIfNotString(cell));
6726
    JITCompiler::Jump done = m_jit.jump();
6727
    notCell.link(&m_jit);
6728
    DFG_TYPE_CHECK(regs, edge, SpecCell | SpecOther, m_jit.branchIfNotOther(regs, scratch));
6729
    done.link(&m_jit);
6730
}
6731
6732
void SpeculativeJIT::speculateStringOrOther(Edge edge)
6733
{
6734
    if (!needsTypeCheck(edge, SpecString | SpecOther))
6735
        return;
6736
6737
    JSValueOperand operand(this, edge, ManualOperandSpeculation);
6738
    GPRTemporary temp(this);
6739
    JSValueRegs regs = operand.jsValueRegs();
6740
    GPRReg tempGPR = temp.gpr();
6741
    speculateStringOrOther(edge, regs, tempGPR);
6742
}
6743
6678
void SpeculativeJIT::speculateStringIdentAndLoadStorage(Edge edge, GPRReg string, GPRReg storage)
6744
void SpeculativeJIT::speculateStringIdentAndLoadStorage(Edge edge, GPRReg string, GPRReg storage)
6679
{
6745
{
6680
    m_jit.loadPtr(MacroAssembler::Address(string, JSString::offsetOfValue()), storage);
6746
    m_jit.loadPtr(MacroAssembler::Address(string, JSString::offsetOfValue()), storage);
Lines 6922-6927 void SpeculativeJIT::speculate(Node*, Ed Source/JavaScriptCore/dfg/DFGSpeculativeJIT.cpp_sec5
6922
    case StringUse:
6988
    case StringUse:
6923
        speculateString(edge);
6989
        speculateString(edge);
6924
        break;
6990
        break;
6991
    case StringOrOtherUse:
6992
        speculateStringOrOther(edge);
6993
        break;
6925
    case SymbolUse:
6994
    case SymbolUse:
6926
        speculateSymbol(edge);
6995
        speculateSymbol(edge);
6927
        break;
6996
        break;
- Source/JavaScriptCore/dfg/DFGSpeculativeJIT.h +4 lines
Lines 2238-2243 public: Source/JavaScriptCore/dfg/DFGSpeculativeJIT.h_sec1
2238
    void compileObjectToObjectOrOtherEquality(Edge leftChild, Edge rightChild);
2238
    void compileObjectToObjectOrOtherEquality(Edge leftChild, Edge rightChild);
2239
    void compileObjectOrOtherLogicalNot(Edge value);
2239
    void compileObjectOrOtherLogicalNot(Edge value);
2240
    void compileLogicalNot(Node*);
2240
    void compileLogicalNot(Node*);
2241
    void compileLogicalNotStringOrOther(Node*);
2241
    void compileStringEquality(
2242
    void compileStringEquality(
2242
        Node*, GPRReg leftGPR, GPRReg rightGPR, GPRReg lengthGPR,
2243
        Node*, GPRReg leftGPR, GPRReg rightGPR, GPRReg lengthGPR,
2243
        GPRReg leftTempGPR, GPRReg rightTempGPR, GPRReg leftTemp2GPR,
2244
        GPRReg leftTempGPR, GPRReg rightTempGPR, GPRReg leftTemp2GPR,
Lines 2257-2262 public: Source/JavaScriptCore/dfg/DFGSpeculativeJIT.h_sec2
2257
2258
2258
    void emitObjectOrOtherBranch(Edge value, BasicBlock* taken, BasicBlock* notTaken);
2259
    void emitObjectOrOtherBranch(Edge value, BasicBlock* taken, BasicBlock* notTaken);
2259
    void emitStringBranch(Edge value, BasicBlock* taken, BasicBlock* notTaken);
2260
    void emitStringBranch(Edge value, BasicBlock* taken, BasicBlock* notTaken);
2261
    void emitStringOrOtherBranch(Edge value, BasicBlock* taken, BasicBlock* notTaken);
2260
    void emitBranch(Node*);
2262
    void emitBranch(Node*);
2261
    
2263
    
2262
    struct StringSwitchCase {
2264
    struct StringSwitchCase {
Lines 2573-2578 public: Source/JavaScriptCore/dfg/DFGSpeculativeJIT.h_sec3
2573
    void speculateStringIdent(Edge edge, GPRReg string);
2575
    void speculateStringIdent(Edge edge, GPRReg string);
2574
    void speculateStringIdent(Edge);
2576
    void speculateStringIdent(Edge);
2575
    void speculateString(Edge);
2577
    void speculateString(Edge);
2578
    void speculateStringOrOther(Edge, JSValueRegs, GPRReg scratch);
2579
    void speculateStringOrOther(Edge);
2576
    void speculateNotStringVar(Edge);
2580
    void speculateNotStringVar(Edge);
2577
    template<typename StructureLocationType>
2581
    template<typename StructureLocationType>
2578
    void speculateStringObjectForStructure(Edge, StructureLocationType);
2582
    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 463-468 CapabilityLevel canCompile(Graph& graph) Source/JavaScriptCore/ftl/FTLCapabilities.cpp_sec1
463
                case FunctionUse:
463
                case FunctionUse:
464
                case ObjectOrOtherUse:
464
                case ObjectOrOtherUse:
465
                case StringUse:
465
                case StringUse:
466
                case StringOrOtherUse:
466
                case KnownStringUse:
467
                case KnownStringUse:
467
                case KnownPrimitiveUse:
468
                case KnownPrimitiveUse:
468
                case StringObjectUse:
469
                case StringObjectUse:
- Source/JavaScriptCore/ftl/FTLLowerDFGToB3.cpp -332 / +386 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 1052-1059 private: Source/JavaScriptCore/ftl/FTLLowerDFGToB3.cpp_sec2
1052
            
1052
            
1053
            LValue doubleValue = unboxDouble(value);
1053
            LValue doubleValue = unboxDouble(value);
1054
            
1054
            
1055
            LBasicBlock intCase = FTL_NEW_BLOCK(m_out, ("DoubleRep RealNumberUse int case"));
1055
            LBasicBlock intCase = m_out.newBlock();
1056
            LBasicBlock continuation = FTL_NEW_BLOCK(m_out, ("DoubleRep continuation"));
1056
            LBasicBlock continuation = m_out.newBlock();
1057
            
1057
            
1058
            ValueFromBlock fastResult = m_out.anchor(doubleValue);
1058
            ValueFromBlock fastResult = m_out.anchor(doubleValue);
1059
            m_out.branch(
1059
            m_out.branch(
Lines 1080-1090 private: Source/JavaScriptCore/ftl/FTLLowerDFGToB3.cpp_sec3
1080
            
1080
            
1081
            LValue value = lowJSValue(m_node->child1(), ManualOperandSpeculation);
1081
            LValue value = lowJSValue(m_node->child1(), ManualOperandSpeculation);
1082
1082
1083
            LBasicBlock intCase = FTL_NEW_BLOCK(m_out, ("jsValueToDouble unboxing int case"));
1083
            LBasicBlock intCase = m_out.newBlock();
1084
            LBasicBlock doubleTesting = FTL_NEW_BLOCK(m_out, ("jsValueToDouble testing double case"));
1084
            LBasicBlock doubleTesting = m_out.newBlock();
1085
            LBasicBlock doubleCase = FTL_NEW_BLOCK(m_out, ("jsValueToDouble unboxing double case"));
1085
            LBasicBlock doubleCase = m_out.newBlock();
1086
            LBasicBlock nonDoubleCase = FTL_NEW_BLOCK(m_out, ("jsValueToDouble testing undefined case"));
1086
            LBasicBlock nonDoubleCase = m_out.newBlock();
1087
            LBasicBlock continuation = FTL_NEW_BLOCK(m_out, ("jsValueToDouble unboxing continuation"));
1087
            LBasicBlock continuation = m_out.newBlock();
1088
            
1088
            
1089
            m_out.branch(
1089
            m_out.branch(
1090
                isNotInt32(value, provenType(m_node->child1())),
1090
                isNotInt32(value, provenType(m_node->child1())),
Lines 1105-1116 private: Source/JavaScriptCore/ftl/FTLLowerDFGToB3.cpp_sec4
1105
            m_out.jump(continuation);
1105
            m_out.jump(continuation);
1106
1106
1107
            if (shouldConvertNonNumber) {
1107
            if (shouldConvertNonNumber) {
1108
                LBasicBlock undefinedCase = FTL_NEW_BLOCK(m_out, ("jsValueToDouble converting undefined case"));
1108
                LBasicBlock undefinedCase = m_out.newBlock();
1109
                LBasicBlock testNullCase = FTL_NEW_BLOCK(m_out, ("jsValueToDouble testing null case"));
1109
                LBasicBlock testNullCase = m_out.newBlock();
1110
                LBasicBlock nullCase = FTL_NEW_BLOCK(m_out, ("jsValueToDouble converting null case"));
1110
                LBasicBlock nullCase = m_out.newBlock();
1111
                LBasicBlock testBooleanTrueCase = FTL_NEW_BLOCK(m_out, ("jsValueToDouble testing boolean true case"));
1111
                LBasicBlock testBooleanTrueCase = m_out.newBlock();
1112
                LBasicBlock convertBooleanTrueCase = FTL_NEW_BLOCK(m_out, ("jsValueToDouble convert boolean true case"));
1112
                LBasicBlock convertBooleanTrueCase = m_out.newBlock();
1113
                LBasicBlock convertBooleanFalseCase = FTL_NEW_BLOCK(m_out, ("jsValueToDouble convert boolean false case"));
1113
                LBasicBlock convertBooleanFalseCase = m_out.newBlock();
1114
1114
1115
                m_out.appendTo(nonDoubleCase, undefinedCase);
1115
                m_out.appendTo(nonDoubleCase, undefinedCase);
1116
                LValue valueIsUndefined = m_out.equal(value, m_out.constInt64(ValueUndefined));
1116
                LValue valueIsUndefined = m_out.equal(value, m_out.constInt64(ValueUndefined));
Lines 1278-1285 private: Source/JavaScriptCore/ftl/FTLLowerDFGToB3.cpp_sec5
1278
                return;
1278
                return;
1279
            }
1279
            }
1280
            
1280
            
1281
            LBasicBlock booleanCase = FTL_NEW_BLOCK(m_out, ("BooleanToNumber boolean case"));
1281
            LBasicBlock booleanCase = m_out.newBlock();
1282
            LBasicBlock continuation = FTL_NEW_BLOCK(m_out, ("BooleanToNumber continuation"));
1282
            LBasicBlock continuation = m_out.newBlock();
1283
            
1283
            
1284
            ValueFromBlock notBooleanResult = m_out.anchor(value);
1284
            ValueFromBlock notBooleanResult = m_out.anchor(value);
1285
            m_out.branch(
1285
            m_out.branch(
Lines 1387-1395 private: Source/JavaScriptCore/ftl/FTLLowerDFGToB3.cpp_sec6
1387
    {
1387
    {
1388
        LValue value = lowJSValue(m_node->child1());
1388
        LValue value = lowJSValue(m_node->child1());
1389
        
1389
        
1390
        LBasicBlock isCellCase = FTL_NEW_BLOCK(m_out, ("ToThis is cell case"));
1390
        LBasicBlock isCellCase = m_out.newBlock();
1391
        LBasicBlock slowCase = FTL_NEW_BLOCK(m_out, ("ToThis slow case"));
1391
        LBasicBlock slowCase = m_out.newBlock();
1392
        LBasicBlock continuation = FTL_NEW_BLOCK(m_out, ("ToThis continuation"));
1392
        LBasicBlock continuation = m_out.newBlock();
1393
        
1393
        
1394
        m_out.branch(
1394
        m_out.branch(
1395
            isCell(value, provenType(m_node->child1())), usually(isCellCase), rarely(slowCase));
1395
            isCell(value, provenType(m_node->child1())), usually(isCellCase), rarely(slowCase));
Lines 1522-1529 private: Source/JavaScriptCore/ftl/FTLLowerDFGToB3.cpp_sec7
1522
            }
1522
            }
1523
            
1523
            
1524
            if (shouldCheckNegativeZero(m_node->arithMode())) {
1524
            if (shouldCheckNegativeZero(m_node->arithMode())) {
1525
                LBasicBlock slowCase = FTL_NEW_BLOCK(m_out, ("ArithMul slow case"));
1525
                LBasicBlock slowCase = m_out.newBlock();
1526
                LBasicBlock continuation = FTL_NEW_BLOCK(m_out, ("ArithMul continuation"));
1526
                LBasicBlock continuation = m_out.newBlock();
1527
                
1527
                
1528
                m_out.branch(
1528
                m_out.branch(
1529
                    m_out.notZero32(result), usually(continuation), rarely(slowCase));
1529
                    m_out.notZero32(result), usually(continuation), rarely(slowCase));
Lines 1548-1555 private: Source/JavaScriptCore/ftl/FTLLowerDFGToB3.cpp_sec8
1548
            blessSpeculation(result, Overflow, noValue(), nullptr, m_origin);
1548
            blessSpeculation(result, Overflow, noValue(), nullptr, m_origin);
1549
1549
1550
            if (shouldCheckNegativeZero(m_node->arithMode())) {
1550
            if (shouldCheckNegativeZero(m_node->arithMode())) {
1551
                LBasicBlock slowCase = FTL_NEW_BLOCK(m_out, ("ArithMul slow case"));
1551
                LBasicBlock slowCase = m_out.newBlock();
1552
                LBasicBlock continuation = FTL_NEW_BLOCK(m_out, ("ArithMul continuation"));
1552
                LBasicBlock continuation = m_out.newBlock();
1553
                
1553
                
1554
                m_out.branch(
1554
                m_out.branch(
1555
                    m_out.notZero64(result), usually(continuation), rarely(slowCase));
1555
                    m_out.notZero64(result), usually(continuation), rarely(slowCase));
Lines 1590-1597 private: Source/JavaScriptCore/ftl/FTLLowerDFGToB3.cpp_sec9
1590
            LValue denominator = lowInt32(m_node->child2());
1590
            LValue denominator = lowInt32(m_node->child2());
1591
1591
1592
            if (shouldCheckNegativeZero(m_node->arithMode())) {
1592
            if (shouldCheckNegativeZero(m_node->arithMode())) {
1593
                LBasicBlock zeroNumerator = FTL_NEW_BLOCK(m_out, ("ArithDiv zero numerator"));
1593
                LBasicBlock zeroNumerator = m_out.newBlock();
1594
                LBasicBlock numeratorContinuation = FTL_NEW_BLOCK(m_out, ("ArithDiv numerator continuation"));
1594
                LBasicBlock numeratorContinuation = m_out.newBlock();
1595
1595
1596
                m_out.branch(
1596
                m_out.branch(
1597
                    m_out.isZero32(numerator),
1597
                    m_out.isZero32(numerator),
Lines 1608-1615 private: Source/JavaScriptCore/ftl/FTLLowerDFGToB3.cpp_sec10
1608
            }
1608
            }
1609
            
1609
            
1610
            if (shouldCheckOverflow(m_node->arithMode())) {
1610
            if (shouldCheckOverflow(m_node->arithMode())) {
1611
                LBasicBlock unsafeDenominator = FTL_NEW_BLOCK(m_out, ("ArithDiv unsafe denominator"));
1611
                LBasicBlock unsafeDenominator = m_out.newBlock();
1612
                LBasicBlock continuation = FTL_NEW_BLOCK(m_out, ("ArithDiv continuation"));
1612
                LBasicBlock continuation = m_out.newBlock();
1613
1613
1614
                LValue adjustedDenominator = m_out.add(denominator, m_out.int32One);
1614
                LValue adjustedDenominator = m_out.add(denominator, m_out.int32One);
1615
                m_out.branch(
1615
                m_out.branch(
Lines 1660-1667 private: Source/JavaScriptCore/ftl/FTLLowerDFGToB3.cpp_sec11
1660
1660
1661
            LValue remainder;
1661
            LValue remainder;
1662
            if (shouldCheckOverflow(m_node->arithMode())) {
1662
            if (shouldCheckOverflow(m_node->arithMode())) {
1663
                LBasicBlock unsafeDenominator = FTL_NEW_BLOCK(m_out, ("ArithMod unsafe denominator"));
1663
                LBasicBlock unsafeDenominator = m_out.newBlock();
1664
                LBasicBlock continuation = FTL_NEW_BLOCK(m_out, ("ArithMod continuation"));
1664
                LBasicBlock continuation = m_out.newBlock();
1665
1665
1666
                LValue adjustedDenominator = m_out.add(denominator, m_out.int32One);
1666
                LValue adjustedDenominator = m_out.add(denominator, m_out.int32One);
1667
                m_out.branch(
1667
                m_out.branch(
Lines 1681-1688 private: Source/JavaScriptCore/ftl/FTLLowerDFGToB3.cpp_sec12
1681
                remainder = m_out.chillMod(numerator, denominator);
1681
                remainder = m_out.chillMod(numerator, denominator);
1682
1682
1683
            if (shouldCheckNegativeZero(m_node->arithMode())) {
1683
            if (shouldCheckNegativeZero(m_node->arithMode())) {
1684
                LBasicBlock negativeNumerator = FTL_NEW_BLOCK(m_out, ("ArithMod negative numerator"));
1684
                LBasicBlock negativeNumerator = m_out.newBlock();
1685
                LBasicBlock numeratorContinuation = FTL_NEW_BLOCK(m_out, ("ArithMod numerator continuation"));
1685
                LBasicBlock numeratorContinuation = m_out.newBlock();
1686
1686
1687
                m_out.branch(
1687
                m_out.branch(
1688
                    m_out.lessThan(numerator, m_out.int32Zero),
1688
                    m_out.lessThan(numerator, m_out.int32Zero),
Lines 1733-1740 private: Source/JavaScriptCore/ftl/FTLLowerDFGToB3.cpp_sec13
1733
            LValue left = lowDouble(m_node->child1());
1733
            LValue left = lowDouble(m_node->child1());
1734
            LValue right = lowDouble(m_node->child2());
1734
            LValue right = lowDouble(m_node->child2());
1735
            
1735
            
1736
            LBasicBlock notLessThan = FTL_NEW_BLOCK(m_out, ("ArithMin/ArithMax not less than"));
1736
            LBasicBlock notLessThan = m_out.newBlock();
1737
            LBasicBlock continuation = FTL_NEW_BLOCK(m_out, ("ArithMin/ArithMax continuation"));
1737
            LBasicBlock continuation = m_out.newBlock();
1738
            
1738
            
1739
            Vector<ValueFromBlock, 2> results;
1739
            Vector<ValueFromBlock, 2> results;
1740
            
1740
            
Lines 1803-1816 private: Source/JavaScriptCore/ftl/FTLLowerDFGToB3.cpp_sec14
1803
            LValue base = lowDouble(m_node->child1());
1803
            LValue base = lowDouble(m_node->child1());
1804
            LValue exponent = lowDouble(m_node->child2());
1804
            LValue exponent = lowDouble(m_node->child2());
1805
1805
1806
            LBasicBlock integerExponentIsSmallBlock = FTL_NEW_BLOCK(m_out, ("ArithPow test integer exponent is small."));
1806
            LBasicBlock integerExponentIsSmallBlock = m_out.newBlock();
1807
            LBasicBlock integerExponentPowBlock = FTL_NEW_BLOCK(m_out, ("ArithPow pow(double, (int)double)."));
1807
            LBasicBlock integerExponentPowBlock = m_out.newBlock();
1808
            LBasicBlock doubleExponentPowBlockEntry = FTL_NEW_BLOCK(m_out, ("ArithPow pow(double, double)."));
1808
            LBasicBlock doubleExponentPowBlockEntry = m_out.newBlock();
1809
            LBasicBlock nanExceptionExponentIsInfinity = FTL_NEW_BLOCK(m_out, ("ArithPow NaN Exception, check exponent is infinity."));
1809
            LBasicBlock nanExceptionExponentIsInfinity = m_out.newBlock();
1810
            LBasicBlock nanExceptionBaseIsOne = FTL_NEW_BLOCK(m_out, ("ArithPow NaN Exception, check base is one."));
1810
            LBasicBlock nanExceptionBaseIsOne = m_out.newBlock();
1811
            LBasicBlock powBlock = FTL_NEW_BLOCK(m_out, ("ArithPow regular pow"));
1811
            LBasicBlock powBlock = m_out.newBlock();
1812
            LBasicBlock nanExceptionResultIsNaN = FTL_NEW_BLOCK(m_out, ("ArithPow NaN Exception, result is NaN."));
1812
            LBasicBlock nanExceptionResultIsNaN = m_out.newBlock();
1813
            LBasicBlock continuation = FTL_NEW_BLOCK(m_out, ("ArithPow continuation"));
1813
            LBasicBlock continuation = m_out.newBlock();
1814
1814
1815
            LValue integerExponent = m_out.doubleToInt(exponent);
1815
            LValue integerExponent = m_out.doubleToInt(exponent);
1816
            LValue integerExponentConvertedToDouble = m_out.intToDouble(integerExponent);
1816
            LValue integerExponentConvertedToDouble = m_out.intToDouble(integerExponent);
Lines 1914-1921 private: Source/JavaScriptCore/ftl/FTLLowerDFGToB3.cpp_sec15
1914
            LValue value = lowDouble(m_node->child1());
1914
            LValue value = lowDouble(m_node->child1());
1915
            result = m_out.doubleFloor(m_out.doubleAdd(value, m_out.constDouble(0.5)));
1915
            result = m_out.doubleFloor(m_out.doubleAdd(value, m_out.constDouble(0.5)));
1916
        } else {
1916
        } else {
1917
            LBasicBlock realPartIsMoreThanHalf = FTL_NEW_BLOCK(m_out, ("ArithRound should round down"));
1917
            LBasicBlock realPartIsMoreThanHalf = m_out.newBlock();
1918
            LBasicBlock continuation = FTL_NEW_BLOCK(m_out, ("ArithRound continuation"));
1918
            LBasicBlock continuation = m_out.newBlock();
1919
1919
1920
            LValue value = lowDouble(m_node->child1());
1920
            LValue value = lowDouble(m_node->child1());
1921
            LValue integerValue = m_out.doubleCeil(value);
1921
            LValue integerValue = m_out.doubleCeil(value);
Lines 2120-2128 private: Source/JavaScriptCore/ftl/FTLLowerDFGToB3.cpp_sec16
2120
        case CellOrOtherUse: {
2120
        case CellOrOtherUse: {
2121
            LValue value = lowJSValue(m_node->child1(), ManualOperandSpeculation);
2121
            LValue value = lowJSValue(m_node->child1(), ManualOperandSpeculation);
2122
2122
2123
            LBasicBlock cellCase = FTL_NEW_BLOCK(m_out, ("CheckStructure CellOrOtherUse cell case"));
2123
            LBasicBlock cellCase = m_out.newBlock();
2124
            LBasicBlock notCellCase = FTL_NEW_BLOCK(m_out, ("CheckStructure CellOrOtherUse not cell case"));
2124
            LBasicBlock notCellCase = m_out.newBlock();
2125
            LBasicBlock continuation = FTL_NEW_BLOCK(m_out, ("CheckStructure CellOrOtherUse continuation"));
2125
            LBasicBlock continuation = m_out.newBlock();
2126
2126
2127
            m_out.branch(
2127
            m_out.branch(
2128
                isCell(value, provenType(m_node->child1())), unsure(cellCase), unsure(notCellCase));
2128
                isCell(value, provenType(m_node->child1())), unsure(cellCase), unsure(notCellCase));
Lines 2195-2202 private: Source/JavaScriptCore/ftl/FTLLowerDFGToB3.cpp_sec17
2195
        LValue cell = lowCell(m_node->child1());
2195
        LValue cell = lowCell(m_node->child1());
2196
        LValue property = !!m_node->child2() ? lowInt32(m_node->child2()) : 0;
2196
        LValue property = !!m_node->child2() ? lowInt32(m_node->child2()) : 0;
2197
        
2197
        
2198
        LBasicBlock unexpectedStructure = FTL_NEW_BLOCK(m_out, ("ArrayifyToStructure unexpected structure"));
2198
        LBasicBlock unexpectedStructure = m_out.newBlock();
2199
        LBasicBlock continuation = FTL_NEW_BLOCK(m_out, ("ArrayifyToStructure continuation"));
2199
        LBasicBlock continuation = m_out.newBlock();
2200
        
2200
        
2201
        LValue structureID = m_out.load32(cell, m_heaps.JSCell_structureID);
2201
        LValue structureID = m_out.load32(cell, m_heaps.JSCell_structureID);
2202
        
2202
        
Lines 2278-2286 private: Source/JavaScriptCore/ftl/FTLLowerDFGToB3.cpp_sec18
2278
            // https://bugs.webkit.org/show_bug.cgi?id=127830
2278
            // https://bugs.webkit.org/show_bug.cgi?id=127830
2279
            LValue value = lowJSValue(m_node->child1());
2279
            LValue value = lowJSValue(m_node->child1());
2280
            
2280
            
2281
            LBasicBlock cellCase = FTL_NEW_BLOCK(m_out, ("GetById untyped cell case"));
2281
            LBasicBlock cellCase = m_out.newBlock();
2282
            LBasicBlock notCellCase = FTL_NEW_BLOCK(m_out, ("GetById untyped not cell case"));
2282
            LBasicBlock notCellCase = m_out.newBlock();
2283
            LBasicBlock continuation = FTL_NEW_BLOCK(m_out, ("GetById untyped continuation"));
2283
            LBasicBlock continuation = m_out.newBlock();
2284
            
2284
            
2285
            m_out.branch(
2285
            m_out.branch(
2286
                isCell(value, provenType(m_node->child1())), unsure(cellCase), unsure(notCellCase));
2286
                isCell(value, provenType(m_node->child1())), unsure(cellCase), unsure(notCellCase));
Lines 2397-2404 private: Source/JavaScriptCore/ftl/FTLLowerDFGToB3.cpp_sec19
2397
        LValue cell = lowCell(m_node->child1());
2397
        LValue cell = lowCell(m_node->child1());
2398
        
2398
        
2399
        if (m_node->arrayMode().type() == Array::String) {
2399
        if (m_node->arrayMode().type() == Array::String) {
2400
            LBasicBlock slowPath = FTL_NEW_BLOCK(m_out, ("GetIndexedPropertyStorage String slow case"));
2400
            LBasicBlock slowPath = m_out.newBlock();
2401
            LBasicBlock continuation = FTL_NEW_BLOCK(m_out, ("GetIndexedPropertyStorage String continuation"));
2401
            LBasicBlock continuation = m_out.newBlock();
2402
2402
2403
            LValue fastResultValue = m_out.loadPtr(cell, m_heaps.JSString_value);
2403
            LValue fastResultValue = m_out.loadPtr(cell, m_heaps.JSString_value);
2404
            ValueFromBlock fastResult = m_out.anchor(fastResultValue);
2404
            ValueFromBlock fastResult = m_out.anchor(fastResultValue);
Lines 2439-2447 private: Source/JavaScriptCore/ftl/FTLLowerDFGToB3.cpp_sec20
2439
    {
2439
    {
2440
        LValue basePtr = lowCell(m_node->child1());    
2440
        LValue basePtr = lowCell(m_node->child1());    
2441
2441
2442
        LBasicBlock simpleCase = FTL_NEW_BLOCK(m_out, ("GetTypedArrayByteOffset wasteless typed array"));
2442
        LBasicBlock simpleCase = m_out.newBlock();
2443
        LBasicBlock wastefulCase = FTL_NEW_BLOCK(m_out, ("GetTypedArrayByteOffset wasteful typed array"));
2443
        LBasicBlock wastefulCase = m_out.newBlock();
2444
        LBasicBlock continuation = FTL_NEW_BLOCK(m_out, ("GetTypedArrayByteOffset continuation"));
2444
        LBasicBlock continuation = m_out.newBlock();
2445
        
2445
        
2446
        LValue mode = m_out.load32(basePtr, m_heaps.JSArrayBufferView_mode);
2446
        LValue mode = m_out.load32(basePtr, m_heaps.JSArrayBufferView_mode);
2447
        m_out.branch(
2447
        m_out.branch(
Lines 2549-2557 private: Source/JavaScriptCore/ftl/FTLLowerDFGToB3.cpp_sec21
2549
            
2549
            
2550
            LValue base = lowCell(m_node->child1());
2550
            LValue base = lowCell(m_node->child1());
2551
            
2551
            
2552
            LBasicBlock fastCase = FTL_NEW_BLOCK(m_out, ("GetByVal int/contiguous fast case"));
2552
            LBasicBlock fastCase = m_out.newBlock();
2553
            LBasicBlock slowCase = FTL_NEW_BLOCK(m_out, ("GetByVal int/contiguous slow case"));
2553
            LBasicBlock slowCase = m_out.newBlock();
2554
            LBasicBlock continuation = FTL_NEW_BLOCK(m_out, ("GetByVal int/contiguous continuation"));
2554
            LBasicBlock continuation = m_out.newBlock();
2555
            
2555
            
2556
            m_out.branch(
2556
            m_out.branch(
2557
                m_out.aboveOrEqual(
2557
                m_out.aboveOrEqual(
Lines 2596-2605 private: Source/JavaScriptCore/ftl/FTLLowerDFGToB3.cpp_sec22
2596
            
2596
            
2597
            LValue base = lowCell(m_node->child1());
2597
            LValue base = lowCell(m_node->child1());
2598
            
2598
            
2599
            LBasicBlock inBounds = FTL_NEW_BLOCK(m_out, ("GetByVal double in bounds"));
2599
            LBasicBlock inBounds = m_out.newBlock();
2600
            LBasicBlock boxPath = FTL_NEW_BLOCK(m_out, ("GetByVal double boxing"));
2600
            LBasicBlock boxPath = m_out.newBlock();
2601
            LBasicBlock slowCase = FTL_NEW_BLOCK(m_out, ("GetByVal double slow case"));
2601
            LBasicBlock slowCase = m_out.newBlock();
2602
            LBasicBlock continuation = FTL_NEW_BLOCK(m_out, ("GetByVal double continuation"));
2602
            LBasicBlock continuation = m_out.newBlock();
2603
            
2603
            
2604
            m_out.branch(
2604
            m_out.branch(
2605
                m_out.aboveOrEqual(
2605
                m_out.aboveOrEqual(
Lines 2667-2675 private: Source/JavaScriptCore/ftl/FTLLowerDFGToB3.cpp_sec23
2667
            LValue table = m_out.loadPtr(base, m_heaps.ScopedArguments_table);
2667
            LValue table = m_out.loadPtr(base, m_heaps.ScopedArguments_table);
2668
            LValue namedLength = m_out.load32(table, m_heaps.ScopedArgumentsTable_length);
2668
            LValue namedLength = m_out.load32(table, m_heaps.ScopedArgumentsTable_length);
2669
            
2669
            
2670
            LBasicBlock namedCase = FTL_NEW_BLOCK(m_out, ("GetByVal ScopedArguments named case"));
2670
            LBasicBlock namedCase = m_out.newBlock();
2671
            LBasicBlock overflowCase = FTL_NEW_BLOCK(m_out, ("GetByVal ScopedArguments overflow case"));
2671
            LBasicBlock overflowCase = m_out.newBlock();
2672
            LBasicBlock continuation = FTL_NEW_BLOCK(m_out, ("GetByVal ScopedArguments continuation"));
2672
            LBasicBlock continuation = m_out.newBlock();
2673
            
2673
            
2674
            m_out.branch(
2674
            m_out.branch(
2675
                m_out.aboveOrEqual(index, namedLength), unsure(overflowCase), unsure(namedCase));
2675
                m_out.aboveOrEqual(index, namedLength), unsure(overflowCase), unsure(namedCase));
Lines 2875-2881 private: Source/JavaScriptCore/ftl/FTLLowerDFGToB3.cpp_sec24
2875
        case Array::Int32:
2875
        case Array::Int32:
2876
        case Array::Double:
2876
        case Array::Double:
2877
        case Array::Contiguous: {
2877
        case Array::Contiguous: {
2878
            LBasicBlock continuation = FTL_NEW_BLOCK(m_out, ("PutByVal continuation"));
2878
            LBasicBlock continuation = m_out.newBlock();
2879
            LBasicBlock outerLastNext = m_out.appendTo(m_out.m_block, continuation);
2879
            LBasicBlock outerLastNext = m_out.appendTo(m_out.m_block, continuation);
2880
            
2880
            
2881
            switch (m_node->arrayMode().type()) {
2881
            switch (m_node->arrayMode().type()) {
Lines 2969-2976 private: Source/JavaScriptCore/ftl/FTLLowerDFGToB3.cpp_sec25
2969
                        if (isClamped(type)) {
2969
                        if (isClamped(type)) {
2970
                            ASSERT(elementSize(type) == 1);
2970
                            ASSERT(elementSize(type) == 1);
2971
                            
2971
                            
2972
                            LBasicBlock atLeastZero = FTL_NEW_BLOCK(m_out, ("PutByVal int clamp atLeastZero"));
2972
                            LBasicBlock atLeastZero = m_out.newBlock();
2973
                            LBasicBlock continuation = FTL_NEW_BLOCK(m_out, ("PutByVal int clamp continuation"));
2973
                            LBasicBlock continuation = m_out.newBlock();
2974
                            
2974
                            
2975
                            Vector<ValueFromBlock, 2> intValues;
2975
                            Vector<ValueFromBlock, 2> intValues;
2976
                            intValues.append(m_out.anchor(m_out.int32Zero));
2976
                            intValues.append(m_out.anchor(m_out.int32Zero));
Lines 2998-3006 private: Source/JavaScriptCore/ftl/FTLLowerDFGToB3.cpp_sec26
2998
                        if (isClamped(type)) {
2998
                        if (isClamped(type)) {
2999
                            ASSERT(elementSize(type) == 1);
2999
                            ASSERT(elementSize(type) == 1);
3000
                            
3000
                            
3001
                            LBasicBlock atLeastZero = FTL_NEW_BLOCK(m_out, ("PutByVal double clamp atLeastZero"));
3001
                            LBasicBlock atLeastZero = m_out.newBlock();
3002
                            LBasicBlock withinRange = FTL_NEW_BLOCK(m_out, ("PutByVal double clamp withinRange"));
3002
                            LBasicBlock withinRange = m_out.newBlock();
3003
                            LBasicBlock continuation = FTL_NEW_BLOCK(m_out, ("PutByVal double clamp continuation"));
3003
                            LBasicBlock continuation = m_out.newBlock();
3004
                            
3004
                            
3005
                            Vector<ValueFromBlock, 3> intValues;
3005
                            Vector<ValueFromBlock, 3> intValues;
3006
                            intValues.append(m_out.anchor(m_out.int32Zero));
3006
                            intValues.append(m_out.anchor(m_out.int32Zero));
Lines 3062-3069 private: Source/JavaScriptCore/ftl/FTLLowerDFGToB3.cpp_sec27
3062
                if (m_node->arrayMode().isInBounds() || m_node->op() == PutByValAlias)
3062
                if (m_node->arrayMode().isInBounds() || m_node->op() == PutByValAlias)
3063
                    m_out.store(valueToStore, pointer, storeType);
3063
                    m_out.store(valueToStore, pointer, storeType);
3064
                else {
3064
                else {
3065
                    LBasicBlock isInBounds = FTL_NEW_BLOCK(m_out, ("PutByVal typed array in bounds case"));
3065
                    LBasicBlock isInBounds = m_out.newBlock();
3066
                    LBasicBlock continuation = FTL_NEW_BLOCK(m_out, ("PutByVal typed array continuation"));
3066
                    LBasicBlock continuation = m_out.newBlock();
3067
                    
3067
                    
3068
                    m_out.branch(
3068
                    m_out.branch(
3069
                        m_out.aboveOrEqual(index, lowInt32(child5)),
3069
                        m_out.aboveOrEqual(index, lowInt32(child5)),
Lines 3149-3157 private: Source/JavaScriptCore/ftl/FTLLowerDFGToB3.cpp_sec28
3149
3149
3150
            LValue prevLength = m_out.load32(storage, m_heaps.Butterfly_publicLength);
3150
            LValue prevLength = m_out.load32(storage, m_heaps.Butterfly_publicLength);
3151
            
3151
            
3152
            LBasicBlock fastPath = FTL_NEW_BLOCK(m_out, ("ArrayPush fast path"));
3152
            LBasicBlock fastPath = m_out.newBlock();
3153
            LBasicBlock slowPath = FTL_NEW_BLOCK(m_out, ("ArrayPush slow path"));
3153
            LBasicBlock slowPath = m_out.newBlock();
3154
            LBasicBlock continuation = FTL_NEW_BLOCK(m_out, ("ArrayPush continuation"));
3154
            LBasicBlock continuation = m_out.newBlock();
3155
            
3155
            
3156
            m_out.branch(
3156
            m_out.branch(
3157
                m_out.aboveOrEqual(
3157
                m_out.aboveOrEqual(
Lines 3199-3207 private: Source/JavaScriptCore/ftl/FTLLowerDFGToB3.cpp_sec29
3199
        case Array::Contiguous: {
3199
        case Array::Contiguous: {
3200
            IndexedAbstractHeap& heap = m_heaps.forArrayType(m_node->arrayMode().type());
3200
            IndexedAbstractHeap& heap = m_heaps.forArrayType(m_node->arrayMode().type());
3201
            
3201
            
3202
            LBasicBlock fastCase = FTL_NEW_BLOCK(m_out, ("ArrayPop fast case"));
3202
            LBasicBlock fastCase = m_out.newBlock();
3203
            LBasicBlock slowCase = FTL_NEW_BLOCK(m_out, ("ArrayPop slow case"));
3203
            LBasicBlock slowCase = m_out.newBlock();
3204
            LBasicBlock continuation = FTL_NEW_BLOCK(m_out, ("ArrayPop continuation"));
3204
            LBasicBlock continuation = m_out.newBlock();
3205
            
3205
            
3206
            LValue prevLength = m_out.load32(storage, m_heaps.Butterfly_publicLength);
3206
            LValue prevLength = m_out.load32(storage, m_heaps.Butterfly_publicLength);
3207
            
3207
            
Lines 3261-3268 private: Source/JavaScriptCore/ftl/FTLLowerDFGToB3.cpp_sec30
3261
            return;
3261
            return;
3262
        }
3262
        }
3263
        
3263
        
3264
        LBasicBlock slowPath = FTL_NEW_BLOCK(m_out, ("CreateActivation slow path"));
3264
        LBasicBlock slowPath = m_out.newBlock();
3265
        LBasicBlock continuation = FTL_NEW_BLOCK(m_out, ("CreateActivation continuation"));
3265
        LBasicBlock continuation = m_out.newBlock();
3266
        
3266
        
3267
        LBasicBlock lastNext = m_out.insertNewBlocksBefore(slowPath);
3267
        LBasicBlock lastNext = m_out.insertNewBlocksBefore(slowPath);
3268
        
3268
        
Lines 3320-3327 private: Source/JavaScriptCore/ftl/FTLLowerDFGToB3.cpp_sec31
3320
            isGeneratorFunction ? m_graph.globalObjectFor(m_node->origin.semantic)->generatorFunctionStructure() :
3320
            isGeneratorFunction ? m_graph.globalObjectFor(m_node->origin.semantic)->generatorFunctionStructure() :
3321
            m_graph.globalObjectFor(m_node->origin.semantic)->functionStructure();
3321
            m_graph.globalObjectFor(m_node->origin.semantic)->functionStructure();
3322
        
3322
        
3323
        LBasicBlock slowPath = FTL_NEW_BLOCK(m_out, ("NewFunction slow path"));
3323
        LBasicBlock slowPath = m_out.newBlock();
3324
        LBasicBlock continuation = FTL_NEW_BLOCK(m_out, ("NewFunction continuation"));
3324
        LBasicBlock continuation = m_out.newBlock();
3325
        
3325
        
3326
        LBasicBlock lastNext = m_out.insertNewBlocksBefore(slowPath);
3326
        LBasicBlock lastNext = m_out.insertNewBlocksBefore(slowPath);
3327
        
3327
        
Lines 3375-3382 private: Source/JavaScriptCore/ftl/FTLLowerDFGToB3.cpp_sec32
3375
        
3375
        
3376
        unsigned minCapacity = m_graph.baselineCodeBlockFor(m_node->origin.semantic)->numParameters() - 1;
3376
        unsigned minCapacity = m_graph.baselineCodeBlockFor(m_node->origin.semantic)->numParameters() - 1;
3377
        
3377
        
3378
        LBasicBlock slowPath = FTL_NEW_BLOCK(m_out, ("CreateDirectArguments slow path"));
3378
        LBasicBlock slowPath = m_out.newBlock();
3379
        LBasicBlock continuation = FTL_NEW_BLOCK(m_out, ("CreateDirectArguments continuation"));
3379
        LBasicBlock continuation = m_out.newBlock();
3380
        
3380
        
3381
        LBasicBlock lastNext = m_out.insertNewBlocksBefore(slowPath);
3381
        LBasicBlock lastNext = m_out.insertNewBlocksBefore(slowPath);
3382
        
3382
        
Lines 3433-3440 private: Source/JavaScriptCore/ftl/FTLLowerDFGToB3.cpp_sec33
3433
        } else {
3433
        } else {
3434
            LValue stackBase = getArgumentsStart();
3434
            LValue stackBase = getArgumentsStart();
3435
            
3435
            
3436
            LBasicBlock loop = FTL_NEW_BLOCK(m_out, ("CreateDirectArguments loop body"));
3436
            LBasicBlock loop = m_out.newBlock();
3437
            LBasicBlock end = FTL_NEW_BLOCK(m_out, ("CreateDirectArguments loop end"));
3437
            LBasicBlock end = m_out.newBlock();
3438
3438
3439
            ValueFromBlock originalLength;
3439
            ValueFromBlock originalLength;
3440
            if (minCapacity) {
3440
            if (minCapacity) {
Lines 3493-3500 private: Source/JavaScriptCore/ftl/FTLLowerDFGToB3.cpp_sec34
3493
3493
3494
    void compileCopyRest()
3494
    void compileCopyRest()
3495
    {            
3495
    {            
3496
        LBasicBlock doCopyRest = FTL_NEW_BLOCK(m_out, ("CopyRest C call"));
3496
        LBasicBlock doCopyRest = m_out.newBlock();
3497
        LBasicBlock continuation = FTL_NEW_BLOCK(m_out, ("FillRestParameter continuation"));
3497
        LBasicBlock continuation = m_out.newBlock();
3498
3498
3499
        LValue arrayLength = lowInt32(m_node->child2());
3499
        LValue arrayLength = lowInt32(m_node->child2());
3500
3500
Lines 3515-3522 private: Source/JavaScriptCore/ftl/FTLLowerDFGToB3.cpp_sec35
3515
3515
3516
    void compileGetRestLength()
3516
    void compileGetRestLength()
3517
    {
3517
    {
3518
        LBasicBlock nonZeroLength = FTL_NEW_BLOCK(m_out, ("GetRestLength non zero"));
3518
        LBasicBlock nonZeroLength = m_out.newBlock();
3519
        LBasicBlock continuation = FTL_NEW_BLOCK(m_out, ("GetRestLength continuation"));
3519
        LBasicBlock continuation = m_out.newBlock();
3520
        
3520
        
3521
        ValueFromBlock zeroLengthResult = m_out.anchor(m_out.constInt32(0));
3521
        ValueFromBlock zeroLengthResult = m_out.anchor(m_out.constInt32(0));
3522
3522
Lines 3672-3682 private: Source/JavaScriptCore/ftl/FTLLowerDFGToB3.cpp_sec36
3672
                || hasDouble(structure->indexingType())
3672
                || hasDouble(structure->indexingType())
3673
                || hasContiguous(structure->indexingType()));
3673
                || hasContiguous(structure->indexingType()));
3674
3674
3675
            LBasicBlock fastCase = FTL_NEW_BLOCK(m_out, ("NewArrayWithSize fast case"));
3675
            LBasicBlock fastCase = m_out.newBlock();
3676
            LBasicBlock largeCase = FTL_NEW_BLOCK(m_out, ("NewArrayWithSize large case"));
3676
            LBasicBlock largeCase = m_out.newBlock();
3677
            LBasicBlock failCase = FTL_NEW_BLOCK(m_out, ("NewArrayWithSize fail case"));
3677
            LBasicBlock failCase = m_out.newBlock();
3678
            LBasicBlock slowCase = FTL_NEW_BLOCK(m_out, ("NewArrayWithSize slow case"));
3678
            LBasicBlock slowCase = m_out.newBlock();
3679
            LBasicBlock continuation = FTL_NEW_BLOCK(m_out, ("NewArrayWithSize continuation"));
3679
            LBasicBlock continuation = m_out.newBlock();
3680
            
3680
            
3681
            m_out.branch(
3681
            m_out.branch(
3682
                m_out.aboveOrEqual(publicLength, m_out.constInt32(MIN_ARRAY_STORAGE_CONSTRUCTION_LENGTH)),
3682
                m_out.aboveOrEqual(publicLength, m_out.constInt32(MIN_ARRAY_STORAGE_CONSTRUCTION_LENGTH)),
Lines 3703-3710 private: Source/JavaScriptCore/ftl/FTLLowerDFGToB3.cpp_sec37
3703
            m_out.store32(vectorLength, butterfly, m_heaps.Butterfly_vectorLength);
3703
            m_out.store32(vectorLength, butterfly, m_heaps.Butterfly_vectorLength);
3704
            
3704
            
3705
            if (hasDouble(m_node->indexingType())) {
3705
            if (hasDouble(m_node->indexingType())) {
3706
                LBasicBlock initLoop = FTL_NEW_BLOCK(m_out, ("NewArrayWithSize double init loop"));
3706
                LBasicBlock initLoop = m_out.newBlock();
3707
                LBasicBlock initDone = FTL_NEW_BLOCK(m_out, ("NewArrayWithSize double init done"));
3707
                LBasicBlock initDone = m_out.newBlock();
3708
                
3708
                
3709
                ValueFromBlock originalIndex = m_out.anchor(vectorLength);
3709
                ValueFromBlock originalIndex = m_out.anchor(vectorLength);
3710
                ValueFromBlock originalPointer = m_out.anchor(butterfly);
3710
                ValueFromBlock originalPointer = m_out.anchor(butterfly);
Lines 3777-3786 private: Source/JavaScriptCore/ftl/FTLLowerDFGToB3.cpp_sec38
3777
3777
3778
            LValue size = lowInt32(m_node->child1());
3778
            LValue size = lowInt32(m_node->child1());
3779
3779
3780
            LBasicBlock smallEnoughCase = FTL_NEW_BLOCK(m_out, ("NewTypedArray small enough case"));
3780
            LBasicBlock smallEnoughCase = m_out.newBlock();
3781
            LBasicBlock nonZeroCase = FTL_NEW_BLOCK(m_out, ("NewTypedArray non-zero case"));
3781
            LBasicBlock nonZeroCase = m_out.newBlock();
3782
            LBasicBlock slowCase = FTL_NEW_BLOCK(m_out, ("NewTypedArray slow case"));
3782
            LBasicBlock slowCase = m_out.newBlock();
3783
            LBasicBlock continuation = FTL_NEW_BLOCK(m_out, ("NewTypedArray continuation"));
3783
            LBasicBlock continuation = m_out.newBlock();
3784
3784
3785
            m_out.branch(
3785
            m_out.branch(
3786
                m_out.above(size, m_out.constInt32(JSArrayBufferView::fastSizeLimit)),
3786
                m_out.above(size, m_out.constInt32(JSArrayBufferView::fastSizeLimit)),
Lines 3879-3886 private: Source/JavaScriptCore/ftl/FTLLowerDFGToB3.cpp_sec39
3879
            LValue cell = lowCell(m_node->child1());
3879
            LValue cell = lowCell(m_node->child1());
3880
            LValue structureID = m_out.load32(cell, m_heaps.JSCell_structureID);
3880
            LValue structureID = m_out.load32(cell, m_heaps.JSCell_structureID);
3881
            
3881
            
3882
            LBasicBlock notString = FTL_NEW_BLOCK(m_out, ("ToString StringOrStringObject not string case"));
3882
            LBasicBlock notString = m_out.newBlock();
3883
            LBasicBlock continuation = FTL_NEW_BLOCK(m_out, ("ToString StringOrStringObject continuation"));
3883
            LBasicBlock continuation = m_out.newBlock();
3884
            
3884
            
3885
            ValueFromBlock simpleResult = m_out.anchor(cell);
3885
            ValueFromBlock simpleResult = m_out.anchor(cell);
3886
            m_out.branch(
3886
            m_out.branch(
Lines 3908-3916 private: Source/JavaScriptCore/ftl/FTLLowerDFGToB3.cpp_sec40
3908
            else
3908
            else
3909
                value = lowJSValue(m_node->child1());
3909
                value = lowJSValue(m_node->child1());
3910
            
3910
            
3911
            LBasicBlock isCell = FTL_NEW_BLOCK(m_out, ("ToString CellUse/UntypedUse is cell"));
3911
            LBasicBlock isCell = m_out.newBlock();
3912
            LBasicBlock notString = FTL_NEW_BLOCK(m_out, ("ToString CellUse/UntypedUse not string"));
3912
            LBasicBlock notString = m_out.newBlock();
3913
            LBasicBlock continuation = FTL_NEW_BLOCK(m_out, ("ToString CellUse/UntypedUse continuation"));
3913
            LBasicBlock continuation = m_out.newBlock();
3914
            
3914
            
3915
            LValue isCellPredicate;
3915
            LValue isCellPredicate;
3916
            if (m_node->child1().useKind() == CellUse)
3916
            if (m_node->child1().useKind() == CellUse)
Lines 3952-3960 private: Source/JavaScriptCore/ftl/FTLLowerDFGToB3.cpp_sec41
3952
    {
3952
    {
3953
        LValue value = lowJSValue(m_node->child1());
3953
        LValue value = lowJSValue(m_node->child1());
3954
        
3954
        
3955
        LBasicBlock isCellCase = FTL_NEW_BLOCK(m_out, ("ToPrimitive cell case"));
3955
        LBasicBlock isCellCase = m_out.newBlock();
3956
        LBasicBlock isObjectCase = FTL_NEW_BLOCK(m_out, ("ToPrimitive object case"));
3956
        LBasicBlock isObjectCase = m_out.newBlock();
3957
        LBasicBlock continuation = FTL_NEW_BLOCK(m_out, ("ToPrimitive continuation"));
3957
        LBasicBlock continuation = m_out.newBlock();
3958
        
3958
        
3959
        Vector<ValueFromBlock, 3> results;
3959
        Vector<ValueFromBlock, 3> results;
3960
        
3960
        
Lines 3991-3998 private: Source/JavaScriptCore/ftl/FTLLowerDFGToB3.cpp_sec42
3991
            numKids = 2;
3991
            numKids = 2;
3992
        }
3992
        }
3993
        
3993
        
3994
        LBasicBlock slowPath = FTL_NEW_BLOCK(m_out, ("MakeRope slow path"));
3994
        LBasicBlock slowPath = m_out.newBlock();
3995
        LBasicBlock continuation = FTL_NEW_BLOCK(m_out, ("MakeRope continuation"));
3995
        LBasicBlock continuation = m_out.newBlock();
3996
        
3996
        
3997
        LBasicBlock lastNext = m_out.insertNewBlocksBefore(slowPath);
3997
        LBasicBlock lastNext = m_out.insertNewBlocksBefore(slowPath);
3998
        
3998
        
Lines 4062-4070 private: Source/JavaScriptCore/ftl/FTLLowerDFGToB3.cpp_sec43
4062
        LValue index = lowInt32(m_node->child2());
4062
        LValue index = lowInt32(m_node->child2());
4063
        LValue storage = lowStorage(m_node->child3());
4063
        LValue storage = lowStorage(m_node->child3());
4064
            
4064
            
4065
        LBasicBlock fastPath = FTL_NEW_BLOCK(m_out, ("GetByVal String fast path"));
4065
        LBasicBlock fastPath = m_out.newBlock();
4066
        LBasicBlock slowPath = FTL_NEW_BLOCK(m_out, ("GetByVal String slow path"));
4066
        LBasicBlock slowPath = m_out.newBlock();
4067
        LBasicBlock continuation = FTL_NEW_BLOCK(m_out, ("GetByVal String continuation"));
4067
        LBasicBlock continuation = m_out.newBlock();
4068
            
4068
            
4069
        m_out.branch(
4069
        m_out.branch(
4070
            m_out.aboveOrEqual(
4070
            m_out.aboveOrEqual(
Lines 4075-4084 private: Source/JavaScriptCore/ftl/FTLLowerDFGToB3.cpp_sec44
4075
            
4075
            
4076
        LValue stringImpl = m_out.loadPtr(base, m_heaps.JSString_value);
4076
        LValue stringImpl = m_out.loadPtr(base, m_heaps.JSString_value);
4077
            
4077
            
4078
        LBasicBlock is8Bit = FTL_NEW_BLOCK(m_out, ("GetByVal String 8-bit case"));
4078
        LBasicBlock is8Bit = m_out.newBlock();
4079
        LBasicBlock is16Bit = FTL_NEW_BLOCK(m_out, ("GetByVal String 16-bit case"));
4079
        LBasicBlock is16Bit = m_out.newBlock();
4080
        LBasicBlock bitsContinuation = FTL_NEW_BLOCK(m_out, ("GetByVal String bitness continuation"));
4080
        LBasicBlock bitsContinuation = m_out.newBlock();
4081
        LBasicBlock bigCharacter = FTL_NEW_BLOCK(m_out, ("GetByVal String big character"));
4081
        LBasicBlock bigCharacter = m_out.newBlock();
4082
            
4082
            
4083
        m_out.branch(
4083
        m_out.branch(
4084
            m_out.testIsZero32(
4084
            m_out.testIsZero32(
Lines 4140-4146 private: Source/JavaScriptCore/ftl/FTLLowerDFGToB3.cpp_sec45
4140
                m_graph.watchpoints().addLazily(globalObject->stringPrototype()->structure()->transitionWatchpointSet());
4140
                m_graph.watchpoints().addLazily(globalObject->stringPrototype()->structure()->transitionWatchpointSet());
4141
                m_graph.watchpoints().addLazily(globalObject->objectPrototype()->structure()->transitionWatchpointSet());
4141
                m_graph.watchpoints().addLazily(globalObject->objectPrototype()->structure()->transitionWatchpointSet());
4142
                
4142
                
4143
                LBasicBlock negativeIndex = FTL_NEW_BLOCK(m_out, ("GetByVal String negative index"));
4143
                LBasicBlock negativeIndex = m_out.newBlock();
4144
                    
4144
                    
4145
                results.append(m_out.anchor(m_out.constInt64(JSValue::encode(jsUndefined()))));
4145
                results.append(m_out.anchor(m_out.constInt64(JSValue::encode(jsUndefined()))));
4146
                m_out.branch(
4146
                m_out.branch(
Lines 4162-4170 private: Source/JavaScriptCore/ftl/FTLLowerDFGToB3.cpp_sec46
4162
    
4162
    
4163
    void compileStringCharCodeAt()
4163
    void compileStringCharCodeAt()
4164
    {
4164
    {
4165
        LBasicBlock is8Bit = FTL_NEW_BLOCK(m_out, ("StringCharCodeAt 8-bit case"));
4165
        LBasicBlock is8Bit = m_out.newBlock();
4166
        LBasicBlock is16Bit = FTL_NEW_BLOCK(m_out, ("StringCharCodeAt 16-bit case"));
4166
        LBasicBlock is16Bit = m_out.newBlock();
4167
        LBasicBlock continuation = FTL_NEW_BLOCK(m_out, ("StringCharCodeAt continuation"));
4167
        LBasicBlock continuation = m_out.newBlock();
4168
4168
4169
        LValue base = lowCell(m_node->child1());
4169
        LValue base = lowCell(m_node->child1());
4170
        LValue index = lowInt32(m_node->child2());
4170
        LValue index = lowInt32(m_node->child2());
Lines 4220-4228 private: Source/JavaScriptCore/ftl/FTLLowerDFGToB3.cpp_sec47
4220
4220
4221
        LValue value = lowInt32(childEdge);
4221
        LValue value = lowInt32(childEdge);
4222
        
4222
        
4223
        LBasicBlock smallIntCase = FTL_NEW_BLOCK(m_out, ("StringFromCharCode small int case"));
4223
        LBasicBlock smallIntCase = m_out.newBlock();
4224
        LBasicBlock slowCase = FTL_NEW_BLOCK(m_out, ("StringFromCharCode slow case"));
4224
        LBasicBlock slowCase = m_out.newBlock();
4225
        LBasicBlock continuation = FTL_NEW_BLOCK(m_out, ("StringFromCharCode continuation"));
4225
        LBasicBlock continuation = m_out.newBlock();
4226
4226
4227
        m_out.branch(
4227
        m_out.branch(
4228
            m_out.aboveOrEqual(value, m_out.constInt32(0xff)),
4228
            m_out.aboveOrEqual(value, m_out.constInt32(0xff)),
Lines 4282-4290 private: Source/JavaScriptCore/ftl/FTLLowerDFGToB3.cpp_sec48
4282
        
4282
        
4283
        Vector<LBasicBlock, 2> blocks(data.cases.size());
4283
        Vector<LBasicBlock, 2> blocks(data.cases.size());
4284
        for (unsigned i = data.cases.size(); i--;)
4284
        for (unsigned i = data.cases.size(); i--;)
4285
            blocks[i] = FTL_NEW_BLOCK(m_out, ("MultiGetByOffset case ", i));
4285
            blocks[i] = m_out.newBlock();
4286
        LBasicBlock exit = FTL_NEW_BLOCK(m_out, ("MultiGetByOffset fail"));
4286
        LBasicBlock exit = m_out.newBlock();
4287
        LBasicBlock continuation = FTL_NEW_BLOCK(m_out, ("MultiGetByOffset continuation"));
4287
        LBasicBlock continuation = m_out.newBlock();
4288
        
4288
        
4289
        Vector<SwitchCase, 2> cases;
4289
        Vector<SwitchCase, 2> cases;
4290
        StructureSet baseSet;
4290
        StructureSet baseSet;
Lines 4364-4372 private: Source/JavaScriptCore/ftl/FTLLowerDFGToB3.cpp_sec49
4364
        
4364
        
4365
        Vector<LBasicBlock, 2> blocks(data.variants.size());
4365
        Vector<LBasicBlock, 2> blocks(data.variants.size());
4366
        for (unsigned i = data.variants.size(); i--;)
4366
        for (unsigned i = data.variants.size(); i--;)
4367
            blocks[i] = FTL_NEW_BLOCK(m_out, ("MultiPutByOffset case ", i));
4367
            blocks[i] = m_out.newBlock();
4368
        LBasicBlock exit = FTL_NEW_BLOCK(m_out, ("MultiPutByOffset fail"));
4368
        LBasicBlock exit = m_out.newBlock();
4369
        LBasicBlock continuation = FTL_NEW_BLOCK(m_out, ("MultiPutByOffset continuation"));
4369
        LBasicBlock continuation = m_out.newBlock();
4370
        
4370
        
4371
        Vector<SwitchCase, 2> cases;
4371
        Vector<SwitchCase, 2> cases;
4372
        StructureSet baseSet;
4372
        StructureSet baseSet;
Lines 4439-4446 private: Source/JavaScriptCore/ftl/FTLLowerDFGToB3.cpp_sec50
4439
    {
4439
    {
4440
        WatchpointSet* set = m_node->watchpointSet();
4440
        WatchpointSet* set = m_node->watchpointSet();
4441
        
4441
        
4442
        LBasicBlock isNotInvalidated = FTL_NEW_BLOCK(m_out, ("NotifyWrite not invalidated case"));
4442
        LBasicBlock isNotInvalidated = m_out.newBlock();
4443
        LBasicBlock continuation = FTL_NEW_BLOCK(m_out, ("NotifyWrite continuation"));
4443
        LBasicBlock continuation = m_out.newBlock();
4444
        
4444
        
4445
        LValue state = m_out.load8ZeroExt32(m_out.absolute(set->addressOfState()));
4445
        LValue state = m_out.load8ZeroExt32(m_out.absolute(set->addressOfState()));
4446
        m_out.branch(
4446
        m_out.branch(
Lines 4597-4604 private: Source/JavaScriptCore/ftl/FTLLowerDFGToB3.cpp_sec51
4597
            LValue left = lowCell(m_node->child1());
4597
            LValue left = lowCell(m_node->child1());
4598
            LValue right = lowCell(m_node->child2());
4598
            LValue right = lowCell(m_node->child2());
4599
4599
4600
            LBasicBlock notTriviallyEqualCase = FTL_NEW_BLOCK(m_out, ("CompareStrictEq/String not trivially equal case"));
4600
            LBasicBlock notTriviallyEqualCase = m_out.newBlock();
4601
            LBasicBlock continuation = FTL_NEW_BLOCK(m_out, ("CompareStrictEq/String continuation"));
4601
            LBasicBlock continuation = m_out.newBlock();
4602
4602
4603
            speculateString(m_node->child1(), left);
4603
            speculateString(m_node->child1(), left);
4604
4604
Lines 4675-4683 private: Source/JavaScriptCore/ftl/FTLLowerDFGToB3.cpp_sec52
4675
            LValue left = lowStringIdent(leftEdge);
4675
            LValue left = lowStringIdent(leftEdge);
4676
            LValue rightValue = lowJSValue(rightEdge, ManualOperandSpeculation);
4676
            LValue rightValue = lowJSValue(rightEdge, ManualOperandSpeculation);
4677
            
4677
            
4678
            LBasicBlock isCellCase = FTL_NEW_BLOCK(m_out, ("CompareStrictEq StringIdent to NotStringVar is cell case"));
4678
            LBasicBlock isCellCase = m_out.newBlock();
4679
            LBasicBlock isStringCase = FTL_NEW_BLOCK(m_out, ("CompareStrictEq StringIdent to NotStringVar is string case"));
4679
            LBasicBlock isStringCase = m_out.newBlock();
4680
            LBasicBlock continuation = FTL_NEW_BLOCK(m_out, ("CompareStrictEq StringIdent to NotStringVar continuation"));
4680
            LBasicBlock continuation = m_out.newBlock();
4681
            
4681
            
4682
            ValueFromBlock notCellResult = m_out.anchor(m_out.booleanFalse);
4682
            ValueFromBlock notCellResult = m_out.anchor(m_out.booleanFalse);
4683
            m_out.branch(
4683
            m_out.branch(
Lines 5293-5302 private: Source/JavaScriptCore/ftl/FTLLowerDFGToB3.cpp_sec53
5293
        LValue sourceStart = getArgumentsStart(inlineCallFrame);
5293
        LValue sourceStart = getArgumentsStart(inlineCallFrame);
5294
        LValue targetStart = addressFor(data->machineStart).value();
5294
        LValue targetStart = addressFor(data->machineStart).value();
5295
5295
5296
        LBasicBlock undefinedLoop = FTL_NEW_BLOCK(m_out, ("ForwardVarargs undefined loop body"));
5296
        LBasicBlock undefinedLoop = m_out.newBlock();
5297
        LBasicBlock mainLoopEntry = FTL_NEW_BLOCK(m_out, ("ForwardVarargs main loop entry"));
5297
        LBasicBlock mainLoopEntry = m_out.newBlock();
5298
        LBasicBlock mainLoop = FTL_NEW_BLOCK(m_out, ("ForwardVarargs main loop body"));
5298
        LBasicBlock mainLoop = m_out.newBlock();
5299
        LBasicBlock continuation = FTL_NEW_BLOCK(m_out, ("ForwardVarargs continuation"));
5299
        LBasicBlock continuation = m_out.newBlock();
5300
        
5300
        
5301
        LValue lengthAsPtr = m_out.zeroExtPtr(length);
5301
        LValue lengthAsPtr = m_out.zeroExtPtr(length);
5302
        LValue loopBoundValue = m_out.constIntPtr(data->mandatoryMinimum);
5302
        LValue loopBoundValue = m_out.constIntPtr(data->mandatoryMinimum);
Lines 5357-5363 private: Source/JavaScriptCore/ftl/FTLLowerDFGToB3.cpp_sec54
5357
        switch (data->kind) {
5357
        switch (data->kind) {
5358
        case SwitchImm: {
5358
        case SwitchImm: {
5359
            Vector<ValueFromBlock, 2> intValues;
5359
            Vector<ValueFromBlock, 2> intValues;
5360
            LBasicBlock switchOnInts = FTL_NEW_BLOCK(m_out, ("Switch/SwitchImm int case"));
5360
            LBasicBlock switchOnInts = m_out.newBlock();
5361
            
5361
            
5362
            LBasicBlock lastNext = m_out.appendTo(m_out.m_block, switchOnInts);
5362
            LBasicBlock lastNext = m_out.appendTo(m_out.m_block, switchOnInts);
5363
            
5363
            
Lines 5369-5377 private: Source/JavaScriptCore/ftl/FTLLowerDFGToB3.cpp_sec55
5369
            }
5369
            }
5370
                
5370
                
5371
            case UntypedUse: {
5371
            case UntypedUse: {
5372
                LBasicBlock isInt = FTL_NEW_BLOCK(m_out, ("Switch/SwitchImm is int"));
5372
                LBasicBlock isInt = m_out.newBlock();
5373
                LBasicBlock isNotInt = FTL_NEW_BLOCK(m_out, ("Switch/SwitchImm is not int"));
5373
                LBasicBlock isNotInt = m_out.newBlock();
5374
                LBasicBlock isDouble = FTL_NEW_BLOCK(m_out, ("Switch/SwitchImm is double"));
5374
                LBasicBlock isDouble = m_out.newBlock();
5375
                
5375
                
5376
                LValue boxedValue = lowJSValue(m_node->child1());
5376
                LValue boxedValue = lowJSValue(m_node->child1());
5377
                m_out.branch(isNotInt32(boxedValue), unsure(isNotInt), unsure(isInt));
5377
                m_out.branch(isNotInt32(boxedValue), unsure(isNotInt), unsure(isInt));
Lines 5424-5431 private: Source/JavaScriptCore/ftl/FTLLowerDFGToB3.cpp_sec56
5424
            case UntypedUse: {
5424
            case UntypedUse: {
5425
                LValue unboxedValue = lowJSValue(m_node->child1());
5425
                LValue unboxedValue = lowJSValue(m_node->child1());
5426
                
5426
                
5427
                LBasicBlock isCellCase = FTL_NEW_BLOCK(m_out, ("Switch/SwitchChar is cell"));
5427
                LBasicBlock isCellCase = m_out.newBlock();
5428
                LBasicBlock isStringCase = FTL_NEW_BLOCK(m_out, ("Switch/SwitchChar is string"));
5428
                LBasicBlock isStringCase = m_out.newBlock();
5429
                
5429
                
5430
                m_out.branch(
5430
                m_out.branch(
5431
                    isNotCell(unboxedValue, provenType(m_node->child1())),
5431
                    isNotCell(unboxedValue, provenType(m_node->child1())),
Lines 5447-5458 private: Source/JavaScriptCore/ftl/FTLLowerDFGToB3.cpp_sec57
5447
                break;
5447
                break;
5448
            }
5448
            }
5449
            
5449
            
5450
            LBasicBlock lengthIs1 = FTL_NEW_BLOCK(m_out, ("Switch/SwitchChar length is 1"));
5450
            LBasicBlock lengthIs1 = m_out.newBlock();
5451
            LBasicBlock needResolution = FTL_NEW_BLOCK(m_out, ("Switch/SwitchChar resolution"));
5451
            LBasicBlock needResolution = m_out.newBlock();
5452
            LBasicBlock resolved = FTL_NEW_BLOCK(m_out, ("Switch/SwitchChar resolved"));
5452
            LBasicBlock resolved = m_out.newBlock();
5453
            LBasicBlock is8Bit = FTL_NEW_BLOCK(m_out, ("Switch/SwitchChar 8bit"));
5453
            LBasicBlock is8Bit = m_out.newBlock();
5454
            LBasicBlock is16Bit = FTL_NEW_BLOCK(m_out, ("Switch/SwitchChar 16bit"));
5454
            LBasicBlock is16Bit = m_out.newBlock();
5455
            LBasicBlock continuation = FTL_NEW_BLOCK(m_out, ("Switch/SwitchChar continuation"));
5455
            LBasicBlock continuation = m_out.newBlock();
5456
            
5456
            
5457
            m_out.branch(
5457
            m_out.branch(
5458
                m_out.notEqual(
5458
                m_out.notEqual(
Lines 5521-5528 private: Source/JavaScriptCore/ftl/FTLLowerDFGToB3.cpp_sec58
5521
            case UntypedUse: {
5521
            case UntypedUse: {
5522
                LValue value = lowJSValue(m_node->child1());
5522
                LValue value = lowJSValue(m_node->child1());
5523
                
5523
                
5524
                LBasicBlock isCellBlock = FTL_NEW_BLOCK(m_out, ("Switch/SwitchString Untyped cell case"));
5524
                LBasicBlock isCellBlock = m_out.newBlock();
5525
                LBasicBlock isStringBlock = FTL_NEW_BLOCK(m_out, ("Switch/SwitchString Untyped string case"));
5525
                LBasicBlock isStringBlock = m_out.newBlock();
5526
                
5526
                
5527
                m_out.branch(
5527
                m_out.branch(
5528
                    isCell(value, provenType(m_node->child1())),
5528
                    isCell(value, provenType(m_node->child1())),
Lines 5557-5563 private: Source/JavaScriptCore/ftl/FTLLowerDFGToB3.cpp_sec59
5557
                
5557
                
5558
            case UntypedUse: {
5558
            case UntypedUse: {
5559
                LValue value = lowJSValue(m_node->child1());
5559
                LValue value = lowJSValue(m_node->child1());
5560
                LBasicBlock cellCase = FTL_NEW_BLOCK(m_out, ("Switch/SwitchCell cell case"));
5560
                LBasicBlock cellCase = m_out.newBlock();
5561
                m_out.branch(
5561
                m_out.branch(
5562
                    isCell(value, provenType(m_node->child1())),
5562
                    isCell(value, provenType(m_node->child1())),
5563
                    unsure(cellCase), unsure(lowBlock(data->fallThrough.block)));
5563
                    unsure(cellCase), unsure(lowBlock(data->fallThrough.block)));
Lines 5667-5674 private: Source/JavaScriptCore/ftl/FTLLowerDFGToB3.cpp_sec60
5667
    {
5667
    {
5668
        LValue value = lowJSValue(m_node->child1());
5668
        LValue value = lowJSValue(m_node->child1());
5669
        
5669
        
5670
        LBasicBlock isCellCase = FTL_NEW_BLOCK(m_out, ("IsString cell case"));
5670
        LBasicBlock isCellCase = m_out.newBlock();
5671
        LBasicBlock continuation = FTL_NEW_BLOCK(m_out, ("IsString continuation"));
5671
        LBasicBlock continuation = m_out.newBlock();
5672
        
5672
        
5673
        ValueFromBlock notCellResult = m_out.anchor(m_out.booleanFalse);
5673
        ValueFromBlock notCellResult = m_out.anchor(m_out.booleanFalse);
5674
        m_out.branch(
5674
        m_out.branch(
Lines 5686-5693 private: Source/JavaScriptCore/ftl/FTLLowerDFGToB3.cpp_sec61
5686
    {
5686
    {
5687
        LValue value = lowJSValue(m_node->child1());
5687
        LValue value = lowJSValue(m_node->child1());
5688
5688
5689
        LBasicBlock isCellCase = FTL_NEW_BLOCK(m_out, ("IsObject cell case"));
5689
        LBasicBlock isCellCase = m_out.newBlock();
5690
        LBasicBlock continuation = FTL_NEW_BLOCK(m_out, ("IsObject continuation"));
5690
        LBasicBlock continuation = m_out.newBlock();
5691
5691
5692
        ValueFromBlock notCellResult = m_out.anchor(m_out.booleanFalse);
5692
        ValueFromBlock notCellResult = m_out.anchor(m_out.booleanFalse);
5693
        m_out.branch(
5693
        m_out.branch(
Lines 5708-5719 private: Source/JavaScriptCore/ftl/FTLLowerDFGToB3.cpp_sec62
5708
        Edge child = m_node->child1();
5708
        Edge child = m_node->child1();
5709
        LValue value = lowJSValue(child);
5709
        LValue value = lowJSValue(child);
5710
        
5710
        
5711
        LBasicBlock cellCase = FTL_NEW_BLOCK(m_out, ("IsObjectOrNull cell case"));
5711
        LBasicBlock cellCase = m_out.newBlock();
5712
        LBasicBlock notFunctionCase = FTL_NEW_BLOCK(m_out, ("IsObjectOrNull not function case"));
5712
        LBasicBlock notFunctionCase = m_out.newBlock();
5713
        LBasicBlock objectCase = FTL_NEW_BLOCK(m_out, ("IsObjectOrNull object case"));
5713
        LBasicBlock objectCase = m_out.newBlock();
5714
        LBasicBlock slowPath = FTL_NEW_BLOCK(m_out, ("IsObjectOrNull slow path"));
5714
        LBasicBlock slowPath = m_out.newBlock();
5715
        LBasicBlock notCellCase = FTL_NEW_BLOCK(m_out, ("IsObjectOrNull not cell case"));
5715
        LBasicBlock notCellCase = m_out.newBlock();
5716
        LBasicBlock continuation = FTL_NEW_BLOCK(m_out, ("IsObjectOrNull continuation"));
5716
        LBasicBlock continuation = m_out.newBlock();
5717
        
5717
        
5718
        m_out.branch(isCell(value, provenType(child)), unsure(cellCase), unsure(notCellCase));
5718
        m_out.branch(isCell(value, provenType(child)), unsure(cellCase), unsure(notCellCase));
5719
        
5719
        
Lines 5764-5773 private: Source/JavaScriptCore/ftl/FTLLowerDFGToB3.cpp_sec63
5764
        Edge child = m_node->child1();
5764
        Edge child = m_node->child1();
5765
        LValue value = lowJSValue(child);
5765
        LValue value = lowJSValue(child);
5766
        
5766
        
5767
        LBasicBlock cellCase = FTL_NEW_BLOCK(m_out, ("IsFunction cell case"));
5767
        LBasicBlock cellCase = m_out.newBlock();
5768
        LBasicBlock notFunctionCase = FTL_NEW_BLOCK(m_out, ("IsFunction not function case"));
5768
        LBasicBlock notFunctionCase = m_out.newBlock();
5769
        LBasicBlock slowPath = FTL_NEW_BLOCK(m_out, ("IsFunction slow path"));
5769
        LBasicBlock slowPath = m_out.newBlock();
5770
        LBasicBlock continuation = FTL_NEW_BLOCK(m_out, ("IsFunction continuation"));
5770
        LBasicBlock continuation = m_out.newBlock();
5771
        
5771
        
5772
        ValueFromBlock notCellResult = m_out.anchor(m_out.booleanFalse);
5772
        ValueFromBlock notCellResult = m_out.anchor(m_out.booleanFalse);
5773
        m_out.branch(
5773
        m_out.branch(
Lines 5806-5812 private: Source/JavaScriptCore/ftl/FTLLowerDFGToB3.cpp_sec64
5806
        Edge child = m_node->child1();
5806
        Edge child = m_node->child1();
5807
        LValue value = lowJSValue(child);
5807
        LValue value = lowJSValue(child);
5808
        
5808
        
5809
        LBasicBlock continuation = FTL_NEW_BLOCK(m_out, ("TypeOf continuation"));
5809
        LBasicBlock continuation = m_out.newBlock();
5810
        LBasicBlock lastNext = m_out.insertNewBlocksBefore(continuation);
5810
        LBasicBlock lastNext = m_out.insertNewBlocksBefore(continuation);
5811
        
5811
        
5812
        Vector<ValueFromBlock> results;
5812
        Vector<ValueFromBlock> results;
Lines 5903-5910 private: Source/JavaScriptCore/ftl/FTLLowerDFGToB3.cpp_sec65
5903
        LValue constructor = lowCell(m_node->child1());
5903
        LValue constructor = lowCell(m_node->child1());
5904
        LValue hasInstance = lowJSValue(m_node->child2());
5904
        LValue hasInstance = lowJSValue(m_node->child2());
5905
5905
5906
        LBasicBlock defaultHasInstance = FTL_NEW_BLOCK(m_out, ("OverridesHasInstance Symbol.hasInstance is default"));
5906
        LBasicBlock defaultHasInstance = m_out.newBlock();
5907
        LBasicBlock continuation = FTL_NEW_BLOCK(m_out, ("OverridesHasInstance continuation"));
5907
        LBasicBlock continuation = m_out.newBlock();
5908
5908
5909
        // 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.
5909
        // 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.
5910
5910
Lines 5943-5952 private: Source/JavaScriptCore/ftl/FTLLowerDFGToB3.cpp_sec66
5943
        
5943
        
5944
        LValue prototype = lowCell(m_node->child2());
5944
        LValue prototype = lowCell(m_node->child2());
5945
        
5945
        
5946
        LBasicBlock isCellCase = FTL_NEW_BLOCK(m_out, ("InstanceOf cell case"));
5946
        LBasicBlock isCellCase = m_out.newBlock();
5947
        LBasicBlock loop = FTL_NEW_BLOCK(m_out, ("InstanceOf loop"));
5947
        LBasicBlock loop = m_out.newBlock();
5948
        LBasicBlock notYetInstance = FTL_NEW_BLOCK(m_out, ("InstanceOf not yet instance"));
5948
        LBasicBlock notYetInstance = m_out.newBlock();
5949
        LBasicBlock continuation = FTL_NEW_BLOCK(m_out, ("InstanceOf continuation"));
5949
        LBasicBlock continuation = m_out.newBlock();
5950
        
5950
        
5951
        LValue condition;
5951
        LValue condition;
5952
        if (m_node->child1().useKind() == UntypedUse)
5952
        if (m_node->child1().useKind() == UntypedUse)
Lines 6015-6023 private: Source/JavaScriptCore/ftl/FTLLowerDFGToB3.cpp_sec67
6015
            IndexedAbstractHeap& heap = m_node->arrayMode().type() == Array::Int32 ?
6015
            IndexedAbstractHeap& heap = m_node->arrayMode().type() == Array::Int32 ?
6016
                m_heaps.indexedInt32Properties : m_heaps.indexedContiguousProperties;
6016
                m_heaps.indexedInt32Properties : m_heaps.indexedContiguousProperties;
6017
6017
6018
            LBasicBlock checkHole = FTL_NEW_BLOCK(m_out, ("HasIndexedProperty int/contiguous check hole"));
6018
            LBasicBlock checkHole = m_out.newBlock();
6019
            LBasicBlock slowCase = FTL_NEW_BLOCK(m_out, ("HasIndexedProperty int/contiguous slow case"));
6019
            LBasicBlock slowCase = m_out.newBlock();
6020
            LBasicBlock continuation = FTL_NEW_BLOCK(m_out, ("HasIndexedProperty int/contiguous continuation"));
6020
            LBasicBlock continuation = m_out.newBlock();
6021
6021
6022
            if (!m_node->arrayMode().isInBounds()) {
6022
            if (!m_node->arrayMode().isInBounds()) {
6023
                m_out.branch(
6023
                m_out.branch(
Lines 6050-6058 private: Source/JavaScriptCore/ftl/FTLLowerDFGToB3.cpp_sec68
6050
            
6050
            
6051
            IndexedAbstractHeap& heap = m_heaps.indexedDoubleProperties;
6051
            IndexedAbstractHeap& heap = m_heaps.indexedDoubleProperties;
6052
            
6052
            
6053
            LBasicBlock checkHole = FTL_NEW_BLOCK(m_out, ("HasIndexedProperty double check hole"));
6053
            LBasicBlock checkHole = m_out.newBlock();
6054
            LBasicBlock slowCase = FTL_NEW_BLOCK(m_out, ("HasIndexedProperty double slow case"));
6054
            LBasicBlock slowCase = m_out.newBlock();
6055
            LBasicBlock continuation = FTL_NEW_BLOCK(m_out, ("HasIndexedProperty double continuation"));
6055
            LBasicBlock continuation = m_out.newBlock();
6056
            
6056
            
6057
            if (!m_node->arrayMode().isInBounds()) {
6057
            if (!m_node->arrayMode().isInBounds()) {
6058
                m_out.branch(
6058
                m_out.branch(
Lines 6098-6106 private: Source/JavaScriptCore/ftl/FTLLowerDFGToB3.cpp_sec69
6098
        LValue property = lowString(m_node->child2());
6098
        LValue property = lowString(m_node->child2());
6099
        LValue enumerator = lowCell(m_node->child3());
6099
        LValue enumerator = lowCell(m_node->child3());
6100
6100
6101
        LBasicBlock correctStructure = FTL_NEW_BLOCK(m_out, ("HasStructureProperty correct structure"));
6101
        LBasicBlock correctStructure = m_out.newBlock();
6102
        LBasicBlock wrongStructure = FTL_NEW_BLOCK(m_out, ("HasStructureProperty wrong structure"));
6102
        LBasicBlock wrongStructure = m_out.newBlock();
6103
        LBasicBlock continuation = FTL_NEW_BLOCK(m_out, ("HasStructureProperty continuation"));
6103
        LBasicBlock continuation = m_out.newBlock();
6104
6104
6105
        m_out.branch(m_out.notEqual(
6105
        m_out.branch(m_out.notEqual(
6106
            m_out.load32(base, m_heaps.JSCell_structureID),
6106
            m_out.load32(base, m_heaps.JSCell_structureID),
Lines 6129-6139 private: Source/JavaScriptCore/ftl/FTLLowerDFGToB3.cpp_sec70
6129
        LValue index = lowInt32(m_graph.varArgChild(m_node, 2));
6129
        LValue index = lowInt32(m_graph.varArgChild(m_node, 2));
6130
        LValue enumerator = lowCell(m_graph.varArgChild(m_node, 3));
6130
        LValue enumerator = lowCell(m_graph.varArgChild(m_node, 3));
6131
6131
6132
        LBasicBlock checkOffset = FTL_NEW_BLOCK(m_out, ("GetDirectPname check offset"));
6132
        LBasicBlock checkOffset = m_out.newBlock();
6133
        LBasicBlock inlineLoad = FTL_NEW_BLOCK(m_out, ("GetDirectPname inline load"));
6133
        LBasicBlock inlineLoad = m_out.newBlock();
6134
        LBasicBlock outOfLineLoad = FTL_NEW_BLOCK(m_out, ("GetDirectPname out-of-line load"));
6134
        LBasicBlock outOfLineLoad = m_out.newBlock();
6135
        LBasicBlock slowCase = FTL_NEW_BLOCK(m_out, ("GetDirectPname slow case"));
6135
        LBasicBlock slowCase = m_out.newBlock();
6136
        LBasicBlock continuation = FTL_NEW_BLOCK(m_out, ("GetDirectPname continuation"));
6136
        LBasicBlock continuation = m_out.newBlock();
6137
6137
6138
        m_out.branch(m_out.notEqual(
6138
        m_out.branch(m_out.notEqual(
6139
            m_out.load32(base, m_heaps.JSCell_structureID),
6139
            m_out.load32(base, m_heaps.JSCell_structureID),
Lines 6185-6193 private: Source/JavaScriptCore/ftl/FTLLowerDFGToB3.cpp_sec71
6185
        LValue enumerator = lowCell(m_node->child1());
6185
        LValue enumerator = lowCell(m_node->child1());
6186
        LValue index = lowInt32(m_node->child2());
6186
        LValue index = lowInt32(m_node->child2());
6187
6187
6188
        LBasicBlock inBounds = FTL_NEW_BLOCK(m_out, ("GetEnumeratorStructurePname in bounds"));
6188
        LBasicBlock inBounds = m_out.newBlock();
6189
        LBasicBlock outOfBounds = FTL_NEW_BLOCK(m_out, ("GetEnumeratorStructurePname out of bounds"));
6189
        LBasicBlock outOfBounds = m_out.newBlock();
6190
        LBasicBlock continuation = FTL_NEW_BLOCK(m_out, ("GetEnumeratorStructurePname continuation"));
6190
        LBasicBlock continuation = m_out.newBlock();
6191
6191
6192
        m_out.branch(m_out.below(index, m_out.load32(enumerator, m_heaps.JSPropertyNameEnumerator_endStructurePropertyIndex)),
6192
        m_out.branch(m_out.below(index, m_out.load32(enumerator, m_heaps.JSPropertyNameEnumerator_endStructurePropertyIndex)),
6193
            usually(inBounds), rarely(outOfBounds));
6193
            usually(inBounds), rarely(outOfBounds));
Lines 6211-6219 private: Source/JavaScriptCore/ftl/FTLLowerDFGToB3.cpp_sec72
6211
        LValue enumerator = lowCell(m_node->child1());
6211
        LValue enumerator = lowCell(m_node->child1());
6212
        LValue index = lowInt32(m_node->child2());
6212
        LValue index = lowInt32(m_node->child2());
6213
6213
6214
        LBasicBlock inBounds = FTL_NEW_BLOCK(m_out, ("GetEnumeratorGenericPname in bounds"));
6214
        LBasicBlock inBounds = m_out.newBlock();
6215
        LBasicBlock outOfBounds = FTL_NEW_BLOCK(m_out, ("GetEnumeratorGenericPname out of bounds"));
6215
        LBasicBlock outOfBounds = m_out.newBlock();
6216
        LBasicBlock continuation = FTL_NEW_BLOCK(m_out, ("GetEnumeratorGenericPname continuation"));
6216
        LBasicBlock continuation = m_out.newBlock();
6217
6217
6218
        m_out.branch(m_out.below(index, m_out.load32(enumerator, m_heaps.JSPropertyNameEnumerator_endGenericPropertyIndex)),
6218
        m_out.branch(m_out.below(index, m_out.load32(enumerator, m_heaps.JSPropertyNameEnumerator_endGenericPropertyIndex)),
6219
            usually(inBounds), rarely(outOfBounds));
6219
            usually(inBounds), rarely(outOfBounds));
Lines 6262-6270 private: Source/JavaScriptCore/ftl/FTLLowerDFGToB3.cpp_sec73
6262
        
6262
        
6263
        Vector<LBasicBlock, 1> blocks(set.size());
6263
        Vector<LBasicBlock, 1> blocks(set.size());
6264
        for (unsigned i = set.size(); i--;)
6264
        for (unsigned i = set.size(); i--;)
6265
            blocks[i] = FTL_NEW_BLOCK(m_out, ("MaterializeNewObject case ", i));
6265
            blocks[i] = m_out.newBlock();
6266
        LBasicBlock dummyDefault = FTL_NEW_BLOCK(m_out, ("MaterializeNewObject default case"));
6266
        LBasicBlock dummyDefault = m_out.newBlock();
6267
        LBasicBlock outerContinuation = FTL_NEW_BLOCK(m_out, ("MaterializeNewObject continuation"));
6267
        LBasicBlock outerContinuation = m_out.newBlock();
6268
        
6268
        
6269
        Vector<SwitchCase, 1> cases(set.size());
6269
        Vector<SwitchCase, 1> cases(set.size());
6270
        for (unsigned i = set.size(); i--;)
6270
        for (unsigned i = set.size(); i--;)
Lines 6288-6295 private: Source/JavaScriptCore/ftl/FTLLowerDFGToB3.cpp_sec74
6288
                size_t allocationSize = JSFinalObject::allocationSize(structure->inlineCapacity());
6288
                size_t allocationSize = JSFinalObject::allocationSize(structure->inlineCapacity());
6289
                MarkedAllocator* allocator = &vm().heap.allocatorForObjectWithoutDestructor(allocationSize);
6289
                MarkedAllocator* allocator = &vm().heap.allocatorForObjectWithoutDestructor(allocationSize);
6290
                
6290
                
6291
                LBasicBlock slowPath = FTL_NEW_BLOCK(m_out, ("MaterializeNewObject complex object allocation slow path"));
6291
                LBasicBlock slowPath = m_out.newBlock();
6292
                LBasicBlock continuation = FTL_NEW_BLOCK(m_out, ("MaterializeNewObject complex object allocation continuation"));
6292
                LBasicBlock continuation = m_out.newBlock();
6293
                
6293
                
6294
                LBasicBlock lastNext = m_out.insertNewBlocksBefore(slowPath);
6294
                LBasicBlock lastNext = m_out.insertNewBlocksBefore(slowPath);
6295
                
6295
                
Lines 6368-6375 private: Source/JavaScriptCore/ftl/FTLLowerDFGToB3.cpp_sec75
6368
        ASSERT(table == m_graph.varArgChild(m_node, 0)->castConstant<SymbolTable*>());
6368
        ASSERT(table == m_graph.varArgChild(m_node, 0)->castConstant<SymbolTable*>());
6369
        Structure* structure = m_graph.globalObjectFor(m_node->origin.semantic)->activationStructure();
6369
        Structure* structure = m_graph.globalObjectFor(m_node->origin.semantic)->activationStructure();
6370
6370
6371
        LBasicBlock slowPath = FTL_NEW_BLOCK(m_out, ("MaterializeCreateActivation slow path"));
6371
        LBasicBlock slowPath = m_out.newBlock();
6372
        LBasicBlock continuation = FTL_NEW_BLOCK(m_out, ("MaterializeCreateActivation continuation"));
6372
        LBasicBlock continuation = m_out.newBlock();
6373
6373
6374
        LBasicBlock lastNext = m_out.insertNewBlocksBefore(slowPath);
6374
        LBasicBlock lastNext = m_out.insertNewBlocksBefore(slowPath);
6375
6375
Lines 6429-6436 private: Source/JavaScriptCore/ftl/FTLLowerDFGToB3.cpp_sec76
6429
6429
6430
    void compileCheckWatchdogTimer()
6430
    void compileCheckWatchdogTimer()
6431
    {
6431
    {
6432
        LBasicBlock timerDidFire = FTL_NEW_BLOCK(m_out, ("CheckWatchdogTimer timer did fire"));
6432
        LBasicBlock timerDidFire = m_out.newBlock();
6433
        LBasicBlock continuation = FTL_NEW_BLOCK(m_out, ("CheckWatchdogTimer continuation"));
6433
        LBasicBlock continuation = m_out.newBlock();
6434
        
6434
        
6435
        LValue state = m_out.load8ZeroExt32(m_out.absolute(vm().watchdog()->timerDidFireAddress()));
6435
        LValue state = m_out.load8ZeroExt32(m_out.absolute(vm().watchdog()->timerDidFireAddress()));
6436
        m_out.branch(m_out.isZero32(state),
6436
        m_out.branch(m_out.isZero32(state),
Lines 6696-6706 private: Source/JavaScriptCore/ftl/FTLLowerDFGToB3.cpp_sec77
6696
            return;
6696
            return;
6697
        }
6697
        }
6698
        
6698
        
6699
        LBasicBlock continuation = FTL_NEW_BLOCK(m_out, ("checkStructure continuation"));
6699
        LBasicBlock continuation = m_out.newBlock();
6700
        
6700
        
6701
        LBasicBlock lastNext = m_out.insertNewBlocksBefore(continuation);
6701
        LBasicBlock lastNext = m_out.insertNewBlocksBefore(continuation);
6702
        for (unsigned i = 0; i < set.size() - 1; ++i) {
6702
        for (unsigned i = 0; i < set.size() - 1; ++i) {
6703
            LBasicBlock nextStructure = FTL_NEW_BLOCK(m_out, ("checkStructure nextStructure"));
6703
            LBasicBlock nextStructure = m_out.newBlock();
6704
            m_out.branch(
6704
            m_out.branch(
6705
                m_out.equal(structureDiscriminant, weakStructureDiscriminant(set[i])),
6705
                m_out.equal(structureDiscriminant, weakStructureDiscriminant(set[i])),
6706
                unsure(continuation), unsure(nextStructure));
6706
                unsure(continuation), unsure(nextStructure));
Lines 6717-6731 private: Source/JavaScriptCore/ftl/FTLLowerDFGToB3.cpp_sec78
6717
    
6717
    
6718
    LValue numberOrNotCellToInt32(Edge edge, LValue value)
6718
    LValue numberOrNotCellToInt32(Edge edge, LValue value)
6719
    {
6719
    {
6720
        LBasicBlock intCase = FTL_NEW_BLOCK(m_out, ("ValueToInt32 int case"));
6720
        LBasicBlock intCase = m_out.newBlock();
6721
        LBasicBlock notIntCase = FTL_NEW_BLOCK(m_out, ("ValueToInt32 not int case"));
6721
        LBasicBlock notIntCase = m_out.newBlock();
6722
        LBasicBlock doubleCase = 0;
6722
        LBasicBlock doubleCase = 0;
6723
        LBasicBlock notNumberCase = 0;
6723
        LBasicBlock notNumberCase = 0;
6724
        if (edge.useKind() == NotCellUse) {
6724
        if (edge.useKind() == NotCellUse) {
6725
            doubleCase = FTL_NEW_BLOCK(m_out, ("ValueToInt32 double case"));
6725
            doubleCase = m_out.newBlock();
6726
            notNumberCase = FTL_NEW_BLOCK(m_out, ("ValueToInt32 not number case"));
6726
            notNumberCase = m_out.newBlock();
6727
        }
6727
        }
6728
        LBasicBlock continuation = FTL_NEW_BLOCK(m_out, ("ValueToInt32 continuation"));
6728
        LBasicBlock continuation = m_out.newBlock();
6729
        
6729
        
6730
        Vector<ValueFromBlock> results;
6730
        Vector<ValueFromBlock> results;
6731
        
6731
        
Lines 6829-6837 private: Source/JavaScriptCore/ftl/FTLLowerDFGToB3.cpp_sec79
6829
            return;
6829
            return;
6830
6830
6831
        case InferredType::ObjectWithStructureOrOther: {
6831
        case InferredType::ObjectWithStructureOrOther: {
6832
            LBasicBlock cellCase = FTL_NEW_BLOCK(m_out, ("checkInferredType ObjectWithStructureOrOther cell case"));
6832
            LBasicBlock cellCase = m_out.newBlock();
6833
            LBasicBlock notCellCase = FTL_NEW_BLOCK(m_out, ("checkInferredType ObjectWithStructureOrOther not cell case"));
6833
            LBasicBlock notCellCase = m_out.newBlock();
6834
            LBasicBlock continuation = FTL_NEW_BLOCK(m_out, ("checkInferredType ObjectWithStructureOrOther continuation"));
6834
            LBasicBlock continuation = m_out.newBlock();
6835
6835
6836
            m_out.branch(isCell(value, provenType(edge)), unsure(cellCase), unsure(notCellCase));
6836
            m_out.branch(isCell(value, provenType(edge)), unsure(cellCase), unsure(notCellCase));
6837
6837
Lines 6865-6873 private: Source/JavaScriptCore/ftl/FTLLowerDFGToB3.cpp_sec80
6865
            return;
6865
            return;
6866
6866
6867
        case InferredType::ObjectOrOther: {
6867
        case InferredType::ObjectOrOther: {
6868
            LBasicBlock cellCase = FTL_NEW_BLOCK(m_out, ("checkInferredType ObjectOrOther cell case"));
6868
            LBasicBlock cellCase = m_out.newBlock();
6869
            LBasicBlock notCellCase = FTL_NEW_BLOCK(m_out, ("checkInferredType ObjectOrOther not cell case"));
6869
            LBasicBlock notCellCase = m_out.newBlock();
6870
            LBasicBlock continuation = FTL_NEW_BLOCK(m_out, ("checkInferredType ObjectOrOther continuation"));
6870
            LBasicBlock continuation = m_out.newBlock();
6871
6871
6872
            m_out.branch(isCell(value, provenType(edge)), unsure(cellCase), unsure(notCellCase));
6872
            m_out.branch(isCell(value, provenType(edge)), unsure(cellCase), unsure(notCellCase));
6873
6873
Lines 6986-6993 private: Source/JavaScriptCore/ftl/FTLLowerDFGToB3.cpp_sec81
6986
    
6986
    
6987
    LValue allocatePropertyStorageWithSizeImpl(size_t sizeInValues)
6987
    LValue allocatePropertyStorageWithSizeImpl(size_t sizeInValues)
6988
    {
6988
    {
6989
        LBasicBlock slowPath = FTL_NEW_BLOCK(m_out, ("allocatePropertyStorageWithSizeImpl slow path"));
6989
        LBasicBlock slowPath = m_out.newBlock();
6990
        LBasicBlock continuation = FTL_NEW_BLOCK(m_out, ("allocatePropertyStorageWithSizeImpl continuation"));
6990
        LBasicBlock continuation = m_out.newBlock();
6991
        
6991
        
6992
        LBasicBlock lastNext = m_out.insertNewBlocksBefore(slowPath);
6992
        LBasicBlock lastNext = m_out.insertNewBlocksBefore(slowPath);
6993
        
6993
        
Lines 7106-7113 private: Source/JavaScriptCore/ftl/FTLLowerDFGToB3.cpp_sec82
7106
        return copyBarrier(
7106
        return copyBarrier(
7107
            fastResultValue,
7107
            fastResultValue,
7108
            [&] () -> LValue {
7108
            [&] () -> LValue {
7109
                LBasicBlock slowPath = FTL_NEW_BLOCK(m_out, ("loadVectorWithBarrier slow path"));
7109
                LBasicBlock slowPath = m_out.newBlock();
7110
                LBasicBlock continuation = FTL_NEW_BLOCK(m_out, ("loadVectorWithBarrier continuation"));
7110
                LBasicBlock continuation = m_out.newBlock();
7111
7111
7112
                ValueFromBlock fastResult = m_out.anchor(fastResultValue);
7112
                ValueFromBlock fastResult = m_out.anchor(fastResultValue);
7113
                m_out.branch(isFastTypedArray(object), rarely(slowPath), usually(continuation));
7113
                m_out.branch(isFastTypedArray(object), rarely(slowPath), usually(continuation));
Lines 7144-7151 private: Source/JavaScriptCore/ftl/FTLLowerDFGToB3.cpp_sec83
7144
    template<typename Functor>
7144
    template<typename Functor>
7145
    LValue copyBarrier(LValue pointer, const Functor& functor)
7145
    LValue copyBarrier(LValue pointer, const Functor& functor)
7146
    {
7146
    {
7147
        LBasicBlock slowPath = FTL_NEW_BLOCK(m_out, ("copyBarrier slow path"));
7147
        LBasicBlock slowPath = m_out.newBlock();
7148
        LBasicBlock continuation = FTL_NEW_BLOCK(m_out, ("copyBarrier continuation"));
7148
        LBasicBlock continuation = m_out.newBlock();
7149
7149
7150
        ValueFromBlock fastResult = m_out.anchor(pointer);
7150
        ValueFromBlock fastResult = m_out.anchor(pointer);
7151
        m_out.branch(isInToSpace(pointer), usually(continuation), rarely(slowPath));
7151
        m_out.branch(isInToSpace(pointer), usually(continuation), rarely(slowPath));
Lines 7173-7180 private: Source/JavaScriptCore/ftl/FTLLowerDFGToB3.cpp_sec84
7173
    {
7173
    {
7174
        LValue fastResultValue = m_out.loadPtr(object, m_heaps.JSArrayBufferView_vector);
7174
        LValue fastResultValue = m_out.loadPtr(object, m_heaps.JSArrayBufferView_vector);
7175
7175
7176
        LBasicBlock possiblyFromSpace = FTL_NEW_BLOCK(m_out, ("loadVectorReadOnly possibly from space"));
7176
        LBasicBlock possiblyFromSpace = m_out.newBlock();
7177
        LBasicBlock continuation = FTL_NEW_BLOCK(m_out, ("loadVectorReadOnly continuation"));
7177
        LBasicBlock continuation = m_out.newBlock();
7178
7178
7179
        ValueFromBlock fastResult = m_out.anchor(fastResultValue);
7179
        ValueFromBlock fastResult = m_out.anchor(fastResultValue);
7180
7180
Lines 7253-7261 private: Source/JavaScriptCore/ftl/FTLLowerDFGToB3.cpp_sec85
7253
        
7253
        
7254
        speculateTruthyObject(rightChild, rightCell, SpecObject);
7254
        speculateTruthyObject(rightChild, rightCell, SpecObject);
7255
        
7255
        
7256
        LBasicBlock leftCellCase = FTL_NEW_BLOCK(m_out, ("CompareEqObjectOrOtherToObject left cell case"));
7256
        LBasicBlock leftCellCase = m_out.newBlock();
7257
        LBasicBlock leftNotCellCase = FTL_NEW_BLOCK(m_out, ("CompareEqObjectOrOtherToObject left not cell case"));
7257
        LBasicBlock leftNotCellCase = m_out.newBlock();
7258
        LBasicBlock continuation = FTL_NEW_BLOCK(m_out, ("CompareEqObjectOrOtherToObject continuation"));
7258
        LBasicBlock continuation = m_out.newBlock();
7259
        
7259
        
7260
        m_out.branch(
7260
        m_out.branch(
7261
            isCell(leftValue, provenType(leftChild)),
7261
            isCell(leftValue, provenType(leftChild)),
Lines 7297-7306 private: Source/JavaScriptCore/ftl/FTLLowerDFGToB3.cpp_sec86
7297
        LValue left = lowJSValue(m_node->child1());
7297
        LValue left = lowJSValue(m_node->child1());
7298
        LValue right = lowJSValue(m_node->child2());
7298
        LValue right = lowJSValue(m_node->child2());
7299
        
7299
        
7300
        LBasicBlock leftIsInt = FTL_NEW_BLOCK(m_out, ("CompareEq untyped left is int"));
7300
        LBasicBlock leftIsInt = m_out.newBlock();
7301
        LBasicBlock fastPath = FTL_NEW_BLOCK(m_out, ("CompareEq untyped fast path"));
7301
        LBasicBlock fastPath = m_out.newBlock();
7302
        LBasicBlock slowPath = FTL_NEW_BLOCK(m_out, ("CompareEq untyped slow path"));
7302
        LBasicBlock slowPath = m_out.newBlock();
7303
        LBasicBlock continuation = FTL_NEW_BLOCK(m_out, ("CompareEq untyped continuation"));
7303
        LBasicBlock continuation = m_out.newBlock();
7304
        
7304
        
7305
        m_out.branch(isNotInt32(left), rarely(slowPath), usually(leftIsInt));
7305
        m_out.branch(isNotInt32(left), rarely(slowPath), usually(leftIsInt));
7306
        
7306
        
Lines 7322-7339 private: Source/JavaScriptCore/ftl/FTLLowerDFGToB3.cpp_sec87
7322
7322
7323
    LValue stringsEqual(LValue leftJSString, LValue rightJSString)
7323
    LValue stringsEqual(LValue leftJSString, LValue rightJSString)
7324
    {
7324
    {
7325
        LBasicBlock notTriviallyUnequalCase = FTL_NEW_BLOCK(m_out, ("stringsEqual not trivially unequal case"));
7325
        LBasicBlock notTriviallyUnequalCase = m_out.newBlock();
7326
        LBasicBlock notEmptyCase = FTL_NEW_BLOCK(m_out, ("stringsEqual not empty case"));
7326
        LBasicBlock notEmptyCase = m_out.newBlock();
7327
        LBasicBlock leftReadyCase = FTL_NEW_BLOCK(m_out, ("stringsEqual left ready case"));
7327
        LBasicBlock leftReadyCase = m_out.newBlock();
7328
        LBasicBlock rightReadyCase = FTL_NEW_BLOCK(m_out, ("stringsEqual right ready case"));
7328
        LBasicBlock rightReadyCase = m_out.newBlock();
7329
        LBasicBlock left8BitCase = FTL_NEW_BLOCK(m_out, ("stringsEqual left 8-bit case"));
7329
        LBasicBlock left8BitCase = m_out.newBlock();
7330
        LBasicBlock right8BitCase = FTL_NEW_BLOCK(m_out, ("stringsEqual right 8-bit case"));
7330
        LBasicBlock right8BitCase = m_out.newBlock();
7331
        LBasicBlock loop = FTL_NEW_BLOCK(m_out, ("stringsEqual loop"));
7331
        LBasicBlock loop = m_out.newBlock();
7332
        LBasicBlock bytesEqual = FTL_NEW_BLOCK(m_out, ("stringsEqual bytes equal"));
7332
        LBasicBlock bytesEqual = m_out.newBlock();
7333
        LBasicBlock trueCase = FTL_NEW_BLOCK(m_out, ("stringsEqual true case"));
7333
        LBasicBlock trueCase = m_out.newBlock();
7334
        LBasicBlock falseCase = FTL_NEW_BLOCK(m_out, ("stringsEqual false case"));
7334
        LBasicBlock falseCase = m_out.newBlock();
7335
        LBasicBlock slowCase = FTL_NEW_BLOCK(m_out, ("stringsEqual slow case"));
7335
        LBasicBlock slowCase = m_out.newBlock();
7336
        LBasicBlock continuation = FTL_NEW_BLOCK(m_out, ("stringsEqual continuation"));
7336
        LBasicBlock continuation = m_out.newBlock();
7337
7337
7338
        LValue length = m_out.load32(leftJSString, m_heaps.JSString_length);
7338
        LValue length = m_out.load32(leftJSString, m_heaps.JSString_length);
7339
7339
Lines 7608-7614 private: Source/JavaScriptCore/ftl/FTLLowerDFGToB3.cpp_sec88
7608
7608
7609
    LValue allocateCell(LValue allocator, LBasicBlock slowPath)
7609
    LValue allocateCell(LValue allocator, LBasicBlock slowPath)
7610
    {
7610
    {
7611
        LBasicBlock success = FTL_NEW_BLOCK(m_out, ("object allocation success"));
7611
        LBasicBlock success = m_out.newBlock();
7612
    
7612
    
7613
        LValue result;
7613
        LValue result;
7614
        LValue condition;
7614
        LValue condition;
Lines 7678-7687 private: Source/JavaScriptCore/ftl/FTLLowerDFGToB3.cpp_sec89
7678
7678
7679
        LValue subspace = m_out.constIntPtr(&vm().heap.subspaceForObjectOfType<ClassType>());
7679
        LValue subspace = m_out.constIntPtr(&vm().heap.subspaceForObjectOfType<ClassType>());
7680
        
7680
        
7681
        LBasicBlock smallCaseBlock = FTL_NEW_BLOCK(m_out, ("allocateVariableSizedObject small case"));
7681
        LBasicBlock smallCaseBlock = m_out.newBlock();
7682
        LBasicBlock largeOrOversizeCaseBlock = FTL_NEW_BLOCK(m_out, ("allocateVariableSizedObject large or oversize case"));
7682
        LBasicBlock largeOrOversizeCaseBlock = m_out.newBlock();
7683
        LBasicBlock largeCaseBlock = FTL_NEW_BLOCK(m_out, ("allocateVariableSizedObject large case"));
7683
        LBasicBlock largeCaseBlock = m_out.newBlock();
7684
        LBasicBlock continuation = FTL_NEW_BLOCK(m_out, ("allocateVariableSizedObject continuation"));
7684
        LBasicBlock continuation = m_out.newBlock();
7685
        
7685
        
7686
        LValue uproundedSize = m_out.add(size, m_out.constInt32(MarkedSpace::preciseStep - 1));
7686
        LValue uproundedSize = m_out.add(size, m_out.constInt32(MarkedSpace::preciseStep - 1));
7687
        LValue isSmall = m_out.below(uproundedSize, m_out.constInt32(MarkedSpace::preciseCutoff));
7687
        LValue isSmall = m_out.below(uproundedSize, m_out.constInt32(MarkedSpace::preciseCutoff));
Lines 7717-7723 private: Source/JavaScriptCore/ftl/FTLLowerDFGToB3.cpp_sec90
7717
    {
7717
    {
7718
        CopiedAllocator& allocator = vm().heap.storageAllocator();
7718
        CopiedAllocator& allocator = vm().heap.storageAllocator();
7719
        
7719
        
7720
        LBasicBlock success = FTL_NEW_BLOCK(m_out, ("storage allocation success"));
7720
        LBasicBlock success = m_out.newBlock();
7721
        
7721
        
7722
        LValue remaining = m_out.loadPtr(m_out.absolute(&allocator.m_currentRemaining));
7722
        LValue remaining = m_out.loadPtr(m_out.absolute(&allocator.m_currentRemaining));
7723
        LValue newRemaining = m_out.sub(remaining, size);
7723
        LValue newRemaining = m_out.sub(remaining, size);
Lines 7743-7750 private: Source/JavaScriptCore/ftl/FTLLowerDFGToB3.cpp_sec91
7743
        size_t allocationSize = JSFinalObject::allocationSize(structure->inlineCapacity());
7743
        size_t allocationSize = JSFinalObject::allocationSize(structure->inlineCapacity());
7744
        MarkedAllocator* allocator = &vm().heap.allocatorForObjectWithoutDestructor(allocationSize);
7744
        MarkedAllocator* allocator = &vm().heap.allocatorForObjectWithoutDestructor(allocationSize);
7745
        
7745
        
7746
        LBasicBlock slowPath = FTL_NEW_BLOCK(m_out, ("allocateObject slow path"));
7746
        LBasicBlock slowPath = m_out.newBlock();
7747
        LBasicBlock continuation = FTL_NEW_BLOCK(m_out, ("allocateObject continuation"));
7747
        LBasicBlock continuation = m_out.newBlock();
7748
        
7748
        
7749
        LBasicBlock lastNext = m_out.insertNewBlocksBefore(slowPath);
7749
        LBasicBlock lastNext = m_out.insertNewBlocksBefore(slowPath);
7750
        
7750
        
Lines 7821-7828 private: Source/JavaScriptCore/ftl/FTLLowerDFGToB3.cpp_sec92
7821
    
7821
    
7822
    ArrayValues allocateJSArray(Structure* structure, unsigned numElements)
7822
    ArrayValues allocateJSArray(Structure* structure, unsigned numElements)
7823
    {
7823
    {
7824
        LBasicBlock slowPath = FTL_NEW_BLOCK(m_out, ("JSArray allocation slow path"));
7824
        LBasicBlock slowPath = m_out.newBlock();
7825
        LBasicBlock continuation = FTL_NEW_BLOCK(m_out, ("JSArray allocation continuation"));
7825
        LBasicBlock continuation = m_out.newBlock();
7826
        
7826
        
7827
        LBasicBlock lastNext = m_out.insertNewBlocksBefore(slowPath);
7827
        LBasicBlock lastNext = m_out.insertNewBlocksBefore(slowPath);
7828
        
7828
        
Lines 7873-7878 private: Source/JavaScriptCore/ftl/FTLLowerDFGToB3.cpp_sec93
7873
            LValue length = m_out.load32NonNegative(stringValue, m_heaps.JSString_length);
7873
            LValue length = m_out.load32NonNegative(stringValue, m_heaps.JSString_length);
7874
            return m_out.notEqual(length, m_out.int32Zero);
7874
            return m_out.notEqual(length, m_out.int32Zero);
7875
        }
7875
        }
7876
        case StringOrOtherUse: {
7877
            LValue value = lowJSValue(edge, ManualOperandSpeculation);
7878
7879
            LBasicBlock cellCase = m_out.newBlock();
7880
            LBasicBlock notCellCase = m_out.newBlock();
7881
            LBasicBlock continuation = m_out.newBlock();
7882
7883
            m_out.branch(isCell(value, provenType(edge)), unsure(cellCase), unsure(notCellCase));
7884
            
7885
            LBasicBlock lastNext = m_out.appendTo(cellCase, notCellCase);
7886
            
7887
            FTL_TYPE_CHECK(jsValueValue(value), edge, (~SpecCell) | SpecString, isNotString(value));
7888
            LValue length = m_out.load32NonNegative(value, m_heaps.JSString_length);
7889
            ValueFromBlock cellResult = m_out.anchor(m_out.notEqual(length, m_out.int32Zero));
7890
            m_out.jump(continuation);
7891
            
7892
            m_out.appendTo(notCellCase, continuation);
7893
            
7894
            FTL_TYPE_CHECK(jsValueValue(value), edge, SpecCell | SpecOther, isNotOther(value));
7895
            ValueFromBlock notCellResult = m_out.anchor(m_out.booleanFalse);
7896
            m_out.jump(continuation);
7897
            m_out.appendTo(continuation, lastNext);
7898
7899
            return m_out.phi(Int32, cellResult, notCellResult);
7900
        }
7876
        case UntypedUse: {
7901
        case UntypedUse: {
7877
            LValue value = lowJSValue(edge);
7902
            LValue value = lowJSValue(edge);
7878
            
7903
            
Lines 7892-7906 private: Source/JavaScriptCore/ftl/FTLLowerDFGToB3.cpp_sec94
7892
            //     result = value == jsTrue
7917
            //     result = value == jsTrue
7893
            // }
7918
            // }
7894
            
7919
            
7895
            LBasicBlock cellCase = FTL_NEW_BLOCK(m_out, ("Boolify untyped cell case"));
7920
            LBasicBlock cellCase = m_out.newBlock();
7896
            LBasicBlock stringCase = FTL_NEW_BLOCK(m_out, ("Boolify untyped string case"));
7921
            LBasicBlock stringCase = m_out.newBlock();
7897
            LBasicBlock notStringCase = FTL_NEW_BLOCK(m_out, ("Boolify untyped not string case"));
7922
            LBasicBlock notStringCase = m_out.newBlock();
7898
            LBasicBlock notCellCase = FTL_NEW_BLOCK(m_out, ("Boolify untyped not cell case"));
7923
            LBasicBlock notCellCase = m_out.newBlock();
7899
            LBasicBlock int32Case = FTL_NEW_BLOCK(m_out, ("Boolify untyped int32 case"));
7924
            LBasicBlock int32Case = m_out.newBlock();
7900
            LBasicBlock notInt32Case = FTL_NEW_BLOCK(m_out, ("Boolify untyped not int32 case"));
7925
            LBasicBlock notInt32Case = m_out.newBlock();
7901
            LBasicBlock doubleCase = FTL_NEW_BLOCK(m_out, ("Boolify untyped double case"));
7926
            LBasicBlock doubleCase = m_out.newBlock();
7902
            LBasicBlock notDoubleCase = FTL_NEW_BLOCK(m_out, ("Boolify untyped not double case"));
7927
            LBasicBlock notDoubleCase = m_out.newBlock();
7903
            LBasicBlock continuation = FTL_NEW_BLOCK(m_out, ("Boolify untyped continuation"));
7928
            LBasicBlock continuation = m_out.newBlock();
7904
            
7929
            
7905
            Vector<ValueFromBlock> results;
7930
            Vector<ValueFromBlock> results;
7906
            
7931
            
Lines 7922-7928 private: Source/JavaScriptCore/ftl/FTLLowerDFGToB3.cpp_sec95
7922
            if (masqueradesAsUndefinedWatchpointIsStillValid())
7947
            if (masqueradesAsUndefinedWatchpointIsStillValid())
7923
                isTruthyObject = m_out.booleanTrue;
7948
                isTruthyObject = m_out.booleanTrue;
7924
            else {
7949
            else {
7925
                LBasicBlock masqueradesCase = FTL_NEW_BLOCK(m_out, ("Boolify untyped masquerades case"));
7950
                LBasicBlock masqueradesCase = m_out.newBlock();
7926
                
7951
                
7927
                results.append(m_out.anchor(m_out.booleanTrue));
7952
                results.append(m_out.anchor(m_out.booleanTrue));
7928
                
7953
                
Lines 7994-8002 private: Source/JavaScriptCore/ftl/FTLLowerDFGToB3.cpp_sec96
7994
        
8019
        
7995
        LValue value = lowJSValue(edge, operandMode);
8020
        LValue value = lowJSValue(edge, operandMode);
7996
        
8021
        
7997
        LBasicBlock cellCase = FTL_NEW_BLOCK(m_out, ("EqualNullOrUndefined cell case"));
8022
        LBasicBlock cellCase = m_out.newBlock();
7998
        LBasicBlock primitiveCase = FTL_NEW_BLOCK(m_out, ("EqualNullOrUndefined primitive case"));
8023
        LBasicBlock primitiveCase = m_out.newBlock();
7999
        LBasicBlock continuation = FTL_NEW_BLOCK(m_out, ("EqualNullOrUndefined continuation"));
8024
        LBasicBlock continuation = m_out.newBlock();
8000
        
8025
        
8001
        m_out.branch(isNotCell(value, provenType(edge)), unsure(primitiveCase), unsure(cellCase));
8026
        m_out.branch(isNotCell(value, provenType(edge)), unsure(primitiveCase), unsure(cellCase));
8002
        
8027
        
Lines 8018-8024 private: Source/JavaScriptCore/ftl/FTLLowerDFGToB3.cpp_sec97
8018
            m_out.jump(continuation);
8043
            m_out.jump(continuation);
8019
        } else {
8044
        } else {
8020
            LBasicBlock masqueradesCase =
8045
            LBasicBlock masqueradesCase =
8021
                FTL_NEW_BLOCK(m_out, ("EqualNullOrUndefined masquerades case"));
8046
                m_out.newBlock();
8022
                
8047
                
8023
            results.append(m_out.anchor(m_out.booleanFalse));
8048
            results.append(m_out.anchor(m_out.booleanFalse));
8024
            
8049
            
Lines 8075-8083 private: Source/JavaScriptCore/ftl/FTLLowerDFGToB3.cpp_sec98
8075
            index, m_out.load32NonNegative(storage, m_heaps.Butterfly_publicLength));
8100
            index, m_out.load32NonNegative(storage, m_heaps.Butterfly_publicLength));
8076
        if (!m_node->arrayMode().isInBounds()) {
8101
        if (!m_node->arrayMode().isInBounds()) {
8077
            LBasicBlock notInBoundsCase =
8102
            LBasicBlock notInBoundsCase =
8078
                FTL_NEW_BLOCK(m_out, ("PutByVal not in bounds"));
8103
                m_out.newBlock();
8079
            LBasicBlock performStore =
8104
            LBasicBlock performStore =
8080
                FTL_NEW_BLOCK(m_out, ("PutByVal perform store"));
8105
                m_out.newBlock();
8081
                
8106
                
8082
            m_out.branch(isNotInBounds, unsure(notInBoundsCase), unsure(performStore));
8107
            m_out.branch(isNotInBounds, unsure(notInBoundsCase), unsure(performStore));
8083
                
8108
                
Lines 8090-8098 private: Source/JavaScriptCore/ftl/FTLLowerDFGToB3.cpp_sec99
8090
                speculate(OutOfBounds, noValue(), 0, isOutOfBounds);
8115
                speculate(OutOfBounds, noValue(), 0, isOutOfBounds);
8091
            else {
8116
            else {
8092
                LBasicBlock outOfBoundsCase =
8117
                LBasicBlock outOfBoundsCase =
8093
                    FTL_NEW_BLOCK(m_out, ("PutByVal out of bounds"));
8118
                    m_out.newBlock();
8094
                LBasicBlock holeCase =
8119
                LBasicBlock holeCase =
8095
                    FTL_NEW_BLOCK(m_out, ("PutByVal hole case"));
8120
                    m_out.newBlock();
8096
                    
8121
                    
8097
                m_out.branch(isOutOfBounds, rarely(outOfBoundsCase), usually(holeCase));
8122
                m_out.branch(isOutOfBounds, rarely(outOfBoundsCase), usually(holeCase));
8098
                    
8123
                    
Lines 8167-8175 private: Source/JavaScriptCore/ftl/FTLLowerDFGToB3.cpp_sec100
8167
        LValue stringImpl = m_out.loadPtr(string, m_heaps.JSString_value);
8192
        LValue stringImpl = m_out.loadPtr(string, m_heaps.JSString_value);
8168
        LValue length = m_out.load32(string, m_heaps.JSString_length);
8193
        LValue length = m_out.load32(string, m_heaps.JSString_length);
8169
        
8194
        
8170
        LBasicBlock hasImplBlock = FTL_NEW_BLOCK(m_out, ("Switch/SwitchString has impl case"));
8195
        LBasicBlock hasImplBlock = m_out.newBlock();
8171
        LBasicBlock is8BitBlock = FTL_NEW_BLOCK(m_out, ("Switch/SwitchString is 8 bit case"));
8196
        LBasicBlock is8BitBlock = m_out.newBlock();
8172
        LBasicBlock slowBlock = FTL_NEW_BLOCK(m_out, ("Switch/SwitchString slow case"));
8197
        LBasicBlock slowBlock = m_out.newBlock();
8173
        
8198
        
8174
        m_out.branch(m_out.isNull(stringImpl), unsure(slowBlock), unsure(hasImplBlock));
8199
        m_out.branch(m_out.isNull(stringImpl), unsure(slowBlock), unsure(hasImplBlock));
8175
        
8200
        
Lines 8344-8351 private: Source/JavaScriptCore/ftl/FTLLowerDFGToB3.cpp_sec101
8344
        characterCases.append(currentCase);
8369
        characterCases.append(currentCase);
8345
        
8370
        
8346
        Vector<LBasicBlock> characterBlocks;
8371
        Vector<LBasicBlock> characterBlocks;
8347
        for (CharacterCase& myCase : characterCases)
8372
        for (unsigned i = characterCases.size(); i--;)
8348
            characterBlocks.append(FTL_NEW_BLOCK(m_out, ("Switch/SwitchString case for ", myCase.character, " at index ", commonChars)));
8373
            characterBlocks.append(m_out.newBlock());
8349
        
8374
        
8350
        Vector<SwitchCase> switchCases;
8375
        Vector<SwitchCase> switchCases;
8351
        for (unsigned i = 0; i < characterCases.size(); ++i) {
8376
        for (unsigned i = 0; i < characterCases.size(); ++i) {
Lines 8439-8445 private: Source/JavaScriptCore/ftl/FTLLowerDFGToB3.cpp_sec102
8439
    // contination and set it as the nextBlock (m_out.insertNewBlocksBefore(continuation)) before
8464
    // contination and set it as the nextBlock (m_out.insertNewBlocksBefore(continuation)) before
8440
    // calling this. For example:
8465
    // calling this. For example:
8441
    //
8466
    //
8442
    // LBasicBlock continuation = FTL_NEW_BLOCK(m_out, ("My continuation"));
8467
    // LBasicBlock continuation = m_out.newBlock();
8443
    // LBasicBlock lastNext = m_out.insertNewBlocksBefore(continuation);
8468
    // LBasicBlock lastNext = m_out.insertNewBlocksBefore(continuation);
8444
    // buildTypeOf(
8469
    // buildTypeOf(
8445
    //     child, value,
8470
    //     child, value,
Lines 8479-8500 private: Source/JavaScriptCore/ftl/FTLLowerDFGToB3.cpp_sec103
8479
        //     return undefined
8504
        //     return undefined
8480
        // }
8505
        // }
8481
        
8506
        
8482
        LBasicBlock cellCase = FTL_NEW_BLOCK(m_out, ("buildTypeOf cell case"));
8507
        LBasicBlock cellCase = m_out.newBlock();
8483
        LBasicBlock objectCase = FTL_NEW_BLOCK(m_out, ("buildTypeOf object case"));
8508
        LBasicBlock objectCase = m_out.newBlock();
8484
        LBasicBlock functionCase = FTL_NEW_BLOCK(m_out, ("buildTypeOf function case"));
8509
        LBasicBlock functionCase = m_out.newBlock();
8485
        LBasicBlock notFunctionCase = FTL_NEW_BLOCK(m_out, ("buildTypeOf not function case"));
8510
        LBasicBlock notFunctionCase = m_out.newBlock();
8486
        LBasicBlock reallyObjectCase = FTL_NEW_BLOCK(m_out, ("buildTypeOf really object case"));
8511
        LBasicBlock reallyObjectCase = m_out.newBlock();
8487
        LBasicBlock slowPath = FTL_NEW_BLOCK(m_out, ("buildTypeOf slow path"));
8512
        LBasicBlock slowPath = m_out.newBlock();
8488
        LBasicBlock unreachable = FTL_NEW_BLOCK(m_out, ("buildTypeOf unreachable"));
8513
        LBasicBlock unreachable = m_out.newBlock();
8489
        LBasicBlock notObjectCase = FTL_NEW_BLOCK(m_out, ("buildTypeOf not object case"));
8514
        LBasicBlock notObjectCase = m_out.newBlock();
8490
        LBasicBlock stringCase = FTL_NEW_BLOCK(m_out, ("buildTypeOf string case"));
8515
        LBasicBlock stringCase = m_out.newBlock();
8491
        LBasicBlock symbolCase = FTL_NEW_BLOCK(m_out, ("buildTypeOf symbol case"));
8516
        LBasicBlock symbolCase = m_out.newBlock();
8492
        LBasicBlock notCellCase = FTL_NEW_BLOCK(m_out, ("buildTypeOf not cell case"));
8517
        LBasicBlock notCellCase = m_out.newBlock();
8493
        LBasicBlock numberCase = FTL_NEW_BLOCK(m_out, ("buildTypeOf number case"));
8518
        LBasicBlock numberCase = m_out.newBlock();
8494
        LBasicBlock notNumberCase = FTL_NEW_BLOCK(m_out, ("buildTypeOf not number case"));
8519
        LBasicBlock notNumberCase = m_out.newBlock();
8495
        LBasicBlock notNullCase = FTL_NEW_BLOCK(m_out, ("buildTypeOf not null case"));
8520
        LBasicBlock notNullCase = m_out.newBlock();
8496
        LBasicBlock booleanCase = FTL_NEW_BLOCK(m_out, ("buildTypeOf boolean case"));
8521
        LBasicBlock booleanCase = m_out.newBlock();
8497
        LBasicBlock undefinedCase = FTL_NEW_BLOCK(m_out, ("buildTypeOf undefined case"));
8522
        LBasicBlock undefinedCase = m_out.newBlock();
8498
        
8523
        
8499
        m_out.branch(isCell(value, provenType(child)), unsure(cellCase), unsure(notCellCase));
8524
        m_out.branch(isCell(value, provenType(child)), unsure(cellCase), unsure(notCellCase));
8500
        
8525
        
Lines 8574-8583 private: Source/JavaScriptCore/ftl/FTLLowerDFGToB3.cpp_sec104
8574
    
8599
    
8575
    LValue doubleToInt32(LValue doubleValue, double low, double high, bool isSigned = true)
8600
    LValue doubleToInt32(LValue doubleValue, double low, double high, bool isSigned = true)
8576
    {
8601
    {
8577
        LBasicBlock greatEnough = FTL_NEW_BLOCK(m_out, ("doubleToInt32 greatEnough"));
8602
        LBasicBlock greatEnough = m_out.newBlock();
8578
        LBasicBlock withinRange = FTL_NEW_BLOCK(m_out, ("doubleToInt32 withinRange"));
8603
        LBasicBlock withinRange = m_out.newBlock();
8579
        LBasicBlock slowPath = FTL_NEW_BLOCK(m_out, ("doubleToInt32 slowPath"));
8604
        LBasicBlock slowPath = m_out.newBlock();
8580
        LBasicBlock continuation = FTL_NEW_BLOCK(m_out, ("doubleToInt32 continuation"));
8605
        LBasicBlock continuation = m_out.newBlock();
8581
        
8606
        
8582
        Vector<ValueFromBlock, 2> results;
8607
        Vector<ValueFromBlock, 2> results;
8583
        
8608
        
Lines 8618-8625 private: Source/JavaScriptCore/ftl/FTLLowerDFGToB3.cpp_sec105
8618
    
8643
    
8619
    LValue sensibleDoubleToInt32(LValue doubleValue)
8644
    LValue sensibleDoubleToInt32(LValue doubleValue)
8620
    {
8645
    {
8621
        LBasicBlock slowPath = FTL_NEW_BLOCK(m_out, ("sensible doubleToInt32 slow path"));
8646
        LBasicBlock slowPath = m_out.newBlock();
8622
        LBasicBlock continuation = FTL_NEW_BLOCK(m_out, ("sensible doubleToInt32 continuation"));
8647
        LBasicBlock continuation = m_out.newBlock();
8623
8648
8624
        LValue fastResultValue = m_out.doubleToInt(doubleValue);
8649
        LValue fastResultValue = m_out.doubleToInt(doubleValue);
8625
        ValueFromBlock fastResult = m_out.anchor(fastResultValue);
8650
        ValueFromBlock fastResult = m_out.anchor(fastResultValue);
Lines 9133-9141 private: Source/JavaScriptCore/ftl/FTLLowerDFGToB3.cpp_sec106
9133
    
9158
    
9134
    LValue strictInt52ToJSValue(LValue value)
9159
    LValue strictInt52ToJSValue(LValue value)
9135
    {
9160
    {
9136
        LBasicBlock isInt32 = FTL_NEW_BLOCK(m_out, ("strictInt52ToJSValue isInt32 case"));
9161
        LBasicBlock isInt32 = m_out.newBlock();
9137
        LBasicBlock isDouble = FTL_NEW_BLOCK(m_out, ("strictInt52ToJSValue isDouble case"));
9162
        LBasicBlock isDouble = m_out.newBlock();
9138
        LBasicBlock continuation = FTL_NEW_BLOCK(m_out, ("strictInt52ToJSValue continuation"));
9163
        LBasicBlock continuation = m_out.newBlock();
9139
        
9164
        
9140
        Vector<ValueFromBlock, 2> results;
9165
        Vector<ValueFromBlock, 2> results;
9141
            
9166
            
Lines 9213-9221 private: Source/JavaScriptCore/ftl/FTLLowerDFGToB3.cpp_sec107
9213
    
9238
    
9214
    LValue jsValueToStrictInt52(Edge edge, LValue boxedValue)
9239
    LValue jsValueToStrictInt52(Edge edge, LValue boxedValue)
9215
    {
9240
    {
9216
        LBasicBlock intCase = FTL_NEW_BLOCK(m_out, ("jsValueToInt52 unboxing int case"));
9241
        LBasicBlock intCase = m_out.newBlock();
9217
        LBasicBlock doubleCase = FTL_NEW_BLOCK(m_out, ("jsValueToInt52 unboxing double case"));
9242
        LBasicBlock doubleCase = m_out.newBlock();
9218
        LBasicBlock continuation = FTL_NEW_BLOCK(m_out, ("jsValueToInt52 unboxing continuation"));
9243
        LBasicBlock continuation = m_out.newBlock();
9219
            
9244
            
9220
        LValue isNotInt32;
9245
        LValue isNotInt32;
9221
        if (!m_interpreter.needsTypeCheck(edge, SpecInt32))
9246
        if (!m_interpreter.needsTypeCheck(edge, SpecInt32))
Lines 9267-9274 private: Source/JavaScriptCore/ftl/FTLLowerDFGToB3.cpp_sec108
9267
        speculate(Overflow, FormattedValue(DataFormatDouble, value), m_node, valueNotConvertibleToInteger);
9292
        speculate(Overflow, FormattedValue(DataFormatDouble, value), m_node, valueNotConvertibleToInteger);
9268
9293
9269
        if (shouldCheckNegativeZero) {
9294
        if (shouldCheckNegativeZero) {
9270
            LBasicBlock valueIsZero = FTL_NEW_BLOCK(m_out, ("ConvertDoubleToInt32 on zero"));
9295
            LBasicBlock valueIsZero = m_out.newBlock();
9271
            LBasicBlock continuation = FTL_NEW_BLOCK(m_out, ("ConvertDoubleToInt32 continuation"));
9296
            LBasicBlock continuation = m_out.newBlock();
9272
            m_out.branch(m_out.isZero32(integerValue), unsure(valueIsZero), unsure(continuation));
9297
            m_out.branch(m_out.isZero32(integerValue), unsure(valueIsZero), unsure(continuation));
9273
9298
9274
            LBasicBlock lastNext = m_out.appendTo(valueIsZero, continuation);
9299
            LBasicBlock lastNext = m_out.appendTo(valueIsZero, continuation);
Lines 9421-9426 private: Source/JavaScriptCore/ftl/FTLLowerDFGToB3.cpp_sec109
9421
        case StringUse:
9446
        case StringUse:
9422
            speculateString(edge);
9447
            speculateString(edge);
9423
            break;
9448
            break;
9449
        case StringOrOtherUse:
9450
            speculateStringOrOther(edge);
9451
            break;
9424
        case StringIdentUse:
9452
        case StringIdentUse:
9425
            speculateStringIdent(edge);
9453
            speculateStringIdent(edge);
9426
            break;
9454
            break;
Lines 9484-9491 private: Source/JavaScriptCore/ftl/FTLLowerDFGToB3.cpp_sec110
9484
    {
9512
    {
9485
        LValue value = lowJSValue(edge, ManualOperandSpeculation);
9513
        LValue value = lowJSValue(edge, ManualOperandSpeculation);
9486
9514
9487
        LBasicBlock isNotCell = FTL_NEW_BLOCK(m_out, ("Speculate CellOrOther not cell"));
9515
        LBasicBlock isNotCell = m_out.newBlock();
9488
        LBasicBlock continuation = FTL_NEW_BLOCK(m_out, ("Speculate CellOrOther continuation"));
9516
        LBasicBlock continuation = m_out.newBlock();
9489
9517
9490
        m_out.branch(isCell(value, provenType(edge)), unsure(continuation), unsure(isNotCell));
9518
        m_out.branch(isCell(value, provenType(edge)), unsure(continuation), unsure(isNotCell));
9491
9519
Lines 9660-9668 private: Source/JavaScriptCore/ftl/FTLLowerDFGToB3.cpp_sec111
9660
        
9688
        
9661
        LValue value = lowJSValue(edge, ManualOperandSpeculation);
9689
        LValue value = lowJSValue(edge, ManualOperandSpeculation);
9662
        
9690
        
9663
        LBasicBlock cellCase = FTL_NEW_BLOCK(m_out, ("speculateObjectOrOther cell case"));
9691
        LBasicBlock cellCase = m_out.newBlock();
9664
        LBasicBlock primitiveCase = FTL_NEW_BLOCK(m_out, ("speculateObjectOrOther primitive case"));
9692
        LBasicBlock primitiveCase = m_out.newBlock();
9665
        LBasicBlock continuation = FTL_NEW_BLOCK(m_out, ("speculateObjectOrOther continuation"));
9693
        LBasicBlock continuation = m_out.newBlock();
9666
        
9694
        
9667
        m_out.branch(isNotCell(value, provenType(edge)), unsure(primitiveCase), unsure(cellCase));
9695
        m_out.branch(isNotCell(value, provenType(edge)), unsure(primitiveCase), unsure(cellCase));
9668
        
9696
        
Lines 9715-9720 private: Source/JavaScriptCore/ftl/FTLLowerDFGToB3.cpp_sec112
9715
        speculateString(edge, lowCell(edge));
9743
        speculateString(edge, lowCell(edge));
9716
    }
9744
    }
9717
    
9745
    
9746
    void speculateStringOrOther(Edge edge, LValue value)
9747
    {
9748
        LBasicBlock cellCase = m_out.newBlock();
9749
        LBasicBlock notCellCase = m_out.newBlock();
9750
        LBasicBlock continuation = m_out.newBlock();
9751
9752
        m_out.branch(isCell(value, provenType(edge)), unsure(cellCase), unsure(notCellCase));
9753
9754
        LBasicBlock lastNext = m_out.appendTo(cellCase, notCellCase);
9755
9756
        FTL_TYPE_CHECK(jsValueValue(value), edge, (~SpecCell) | SpecString, isNotString(value));
9757
9758
        m_out.jump(continuation);
9759
        m_out.appendTo(notCellCase, continuation);
9760
9761
        FTL_TYPE_CHECK(jsValueValue(value), edge, SpecCell | SpecOther, isNotOther(value));
9762
9763
        m_out.jump(continuation);
9764
        m_out.appendTo(continuation, lastNext);
9765
    }
9766
    
9767
    void speculateStringOrOther(Edge edge)
9768
    {
9769
        speculateStringOrOther(edge, lowJSValue(edge, ManualOperandSpeculation));
9770
    }
9771
    
9718
    void speculateStringIdent(Edge edge, LValue string, LValue stringImpl)
9772
    void speculateStringIdent(Edge edge, LValue string, LValue stringImpl)
9719
    {
9773
    {
9720
        if (!m_interpreter.needsTypeCheck(edge, SpecStringIdent | ~SpecString))
9774
        if (!m_interpreter.needsTypeCheck(edge, SpecStringIdent | ~SpecString))
Lines 9748-9755 private: Source/JavaScriptCore/ftl/FTLLowerDFGToB3.cpp_sec113
9748
        if (!m_interpreter.needsTypeCheck(edge, SpecString | SpecStringObject))
9802
        if (!m_interpreter.needsTypeCheck(edge, SpecString | SpecStringObject))
9749
            return;
9803
            return;
9750
        
9804
        
9751
        LBasicBlock notString = FTL_NEW_BLOCK(m_out, ("Speculate StringOrStringObject not string case"));
9805
        LBasicBlock notString = m_out.newBlock();
9752
        LBasicBlock continuation = FTL_NEW_BLOCK(m_out, ("Speculate StringOrStringObject continuation"));
9806
        LBasicBlock continuation = m_out.newBlock();
9753
        
9807
        
9754
        LValue structureID = m_out.load32(lowCell(edge), m_heaps.JSCell_structureID);
9808
        LValue structureID = m_out.load32(lowCell(edge), m_heaps.JSCell_structureID);
9755
        m_out.branch(
9809
        m_out.branch(
Lines 9821-9828 private: Source/JavaScriptCore/ftl/FTLLowerDFGToB3.cpp_sec114
9821
        LValue value = lowJSValue(edge, ManualOperandSpeculation);
9875
        LValue value = lowJSValue(edge, ManualOperandSpeculation);
9822
        LValue doubleValue = unboxDouble(value);
9876
        LValue doubleValue = unboxDouble(value);
9823
        
9877
        
9824
        LBasicBlock intCase = FTL_NEW_BLOCK(m_out, ("speculateRealNumber int case"));
9878
        LBasicBlock intCase = m_out.newBlock();
9825
        LBasicBlock continuation = FTL_NEW_BLOCK(m_out, ("speculateRealNumber continuation"));
9879
        LBasicBlock continuation = m_out.newBlock();
9826
        
9880
        
9827
        m_out.branch(
9881
        m_out.branch(
9828
            m_out.doubleEqual(doubleValue, doubleValue),
9882
            m_out.doubleEqual(doubleValue, doubleValue),
Lines 9870-9878 private: Source/JavaScriptCore/ftl/FTLLowerDFGToB3.cpp_sec115
9870
        
9924
        
9871
        LValue value = lowJSValue(edge, ManualOperandSpeculation);
9925
        LValue value = lowJSValue(edge, ManualOperandSpeculation);
9872
        
9926
        
9873
        LBasicBlock isCellCase = FTL_NEW_BLOCK(m_out, ("Speculate NotStringVar is cell case"));
9927
        LBasicBlock isCellCase = m_out.newBlock();
9874
        LBasicBlock isStringCase = FTL_NEW_BLOCK(m_out, ("Speculate NotStringVar is string case"));
9928
        LBasicBlock isStringCase = m_out.newBlock();
9875
        LBasicBlock continuation = FTL_NEW_BLOCK(m_out, ("Speculate NotStringVar continuation"));
9929
        LBasicBlock continuation = m_out.newBlock();
9876
        
9930
        
9877
        m_out.branch(isCell(value, provenType(edge)), unsure(isCellCase), unsure(continuation));
9931
        m_out.branch(isCell(value, provenType(edge)), unsure(isCellCase), unsure(continuation));
9878
        
9932
        
Lines 9925-9932 private: Source/JavaScriptCore/ftl/FTLLowerDFGToB3.cpp_sec116
9925
9979
9926
    void emitStoreBarrier(LValue base)
9980
    void emitStoreBarrier(LValue base)
9927
    {
9981
    {
9928
        LBasicBlock slowPath = FTL_NEW_BLOCK(m_out, ("Store barrier slow path"));
9982
        LBasicBlock slowPath = m_out.newBlock();
9929
        LBasicBlock continuation = FTL_NEW_BLOCK(m_out, ("Store barrier continuation"));
9983
        LBasicBlock continuation = m_out.newBlock();
9930
9984
9931
        m_out.branch(
9985
        m_out.branch(
9932
            m_out.notZero32(loadCellState(base)), usually(continuation), rarely(slowPath));
9986
            m_out.notZero32(loadCellState(base)), usually(continuation), rarely(slowPath));
Lines 10049-10055 private: Source/JavaScriptCore/ftl/FTLLowerDFGToB3.cpp_sec117
10049
            return;
10103
            return;
10050
        }
10104
        }
10051
10105
10052
        LBasicBlock continuation = FTL_NEW_BLOCK(m_out, ("Exception check continuation"));
10106
        LBasicBlock continuation = m_out.newBlock();
10053
10107
10054
        m_out.branch(
10108
        m_out.branch(
10055
            hadException, rarely(m_handleExceptions), usually(continuation));
10109
            hadException, rarely(m_handleExceptions), usually(continuation));
- Source/JavaScriptCore/ftl/FTLOutput.cpp -2 / +2 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
Lines 232-238 void Output::branch(LValue condition, LB Source/JavaScriptCore/ftl/FTLOutput.cpp_sec2
232
232
233
void Output::check(LValue condition, WeightedTarget taken, Weight notTakenWeight)
233
void Output::check(LValue condition, WeightedTarget taken, Weight notTakenWeight)
234
{
234
{
235
    LBasicBlock continuation = FTL_NEW_BLOCK(*this, ("Output::check continuation"));
235
    LBasicBlock continuation = newBlock();
236
    branch(condition, taken, WeightedTarget(continuation, notTakenWeight));
236
    branch(condition, taken, WeightedTarget(continuation, notTakenWeight));
237
    appendTo(continuation);
237
    appendTo(continuation);
238
}
238
}
- 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