Skip to content

Commit

Permalink
Merge r245403 from safari-607-branch
Browse files Browse the repository at this point in the history
This fixes the build after the r245047 merge.

* bytecompiler/BytecodeGenerator.cpp:
(JSC::BytecodeGenerator::emitEqualityOpImpl):
(JSC::BytecodeGenerator::emitEqualityOp): Deleted.
* bytecompiler/BytecodeGenerator.h:
(JSC::BytecodeGenerator::emitEqualityOp):
  • Loading branch information
Kocsen Chung authored and mcatanzaro committed Aug 4, 2019
1 parent 0b2e10c commit 88af82a
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 13 deletions.
22 changes: 10 additions & 12 deletions Source/JavaScriptCore/bytecompiler/BytecodeGenerator.cpp
Expand Up @@ -1709,8 +1709,7 @@ RegisterID* BytecodeGenerator::emitDec(RegisterID* srcDst)
return srcDst;
}

template<typename EqOp>
RegisterID* BytecodeGenerator::emitEqualityOp(RegisterID* dst, RegisterID* src1, RegisterID* src2)
bool BytecodeGenerator::emitEqualityOpImpl(RegisterID* dst, RegisterID* src1, RegisterID* src2)
{
if (!canDoPeepholeOptimization())
return false;
Expand All @@ -1725,48 +1724,47 @@ RegisterID* BytecodeGenerator::emitEqualityOp(RegisterID* dst, RegisterID* src1,
if (value == "undefined") {
rewind();
OpIsUndefined::emit(this, dst, op.m_value);
return dst;
return true;
}
if (value == "boolean") {
rewind();
OpIsBoolean::emit(this, dst, op.m_value);
return dst;
return true;
}
if (value == "number") {
rewind();
OpIsNumber::emit(this, dst, op.m_value);
return dst;
return true;
}
if (value == "string") {
rewind();
OpIsCellWithType::emit(this, dst, op.m_value, StringType);
return dst;
return true;
}
if (value == "symbol") {
rewind();
OpIsCellWithType::emit(this, dst, op.m_value, SymbolType);
return dst;
return true;
}
if (Options::useBigInt() && value == "bigint") {
rewind();
OpIsCellWithType::emit(this, dst, op.m_value, BigIntType);
return dst;
return true;
}
if (value == "object") {
rewind();
OpIsObjectOrNull::emit(this, dst, op.m_value);
return dst;
return true;
}
if (value == "function") {
rewind();
OpIsFunction::emit(this, dst, op.m_value);
return dst;
return true;
}
}
}

EqOp::emit(this, dst, src1, src2);
return dst;
return false;
}

void BytecodeGenerator::emitTypeProfilerExpressionInfo(const JSTextPosition& startDivot, const JSTextPosition& endDivot)
Expand Down
10 changes: 9 additions & 1 deletion Source/JavaScriptCore/bytecompiler/BytecodeGenerator.h
Expand Up @@ -710,7 +710,15 @@ namespace JSC {
RegisterID* emitBinaryOp(OpcodeID, RegisterID* dst, RegisterID* src1, RegisterID* src2, OperandTypes);

template<typename EqOp>
RegisterID* emitEqualityOp(RegisterID* dst, RegisterID* src1, RegisterID* src2);
RegisterID* emitEqualityOp(RegisterID* dst, RegisterID* src1, RegisterID* src2)
{
if (!emitEqualityOpImpl(dst, src1, src2))
EqOp::emit(this, dst, src1, src2);
return dst;
}

bool emitEqualityOpImpl(RegisterID* dst, RegisterID* src1, RegisterID* src2);

RegisterID* emitCreateThis(RegisterID* dst);
void emitTDZCheck(RegisterID* target);
bool needsTDZCheck(const Variable&);
Expand Down

0 comments on commit 88af82a

Please sign in to comment.