mirror of
https://github.com/luau-lang/luau.git
synced 2025-05-04 10:33:46 +01:00
Disable fast path in compileCompareJump for vector constants because supporting it would require a new opcode
This commit is contained in:
parent
33c48485f1
commit
d29890ee39
1 changed files with 11 additions and 0 deletions
|
@ -1100,6 +1100,13 @@ struct Compiler
|
||||||
return cv && cv->type != Constant::Type_Unknown && !cv->isTruthful();
|
return cv && cv->type != Constant::Type_Unknown && !cv->isTruthful();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool isConstantVector(AstExpr* node)
|
||||||
|
{
|
||||||
|
const Constant* cv = constants.find(node);
|
||||||
|
|
||||||
|
return cv && cv->type == Constant::Type_Vector;
|
||||||
|
}
|
||||||
|
|
||||||
Constant getConstant(AstExpr* node)
|
Constant getConstant(AstExpr* node)
|
||||||
{
|
{
|
||||||
const Constant* cv = constants.find(node);
|
const Constant* cv = constants.find(node);
|
||||||
|
@ -1123,6 +1130,10 @@ struct Compiler
|
||||||
std::swap(left, right);
|
std::swap(left, right);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// disable fast path for vectors because supporting it would require a new opcode
|
||||||
|
if (isConstantVector(right))
|
||||||
|
operandIsConstant = false;
|
||||||
|
|
||||||
uint8_t rl = compileExprAuto(left, rs);
|
uint8_t rl = compileExprAuto(left, rs);
|
||||||
|
|
||||||
if (isEq && operandIsConstant)
|
if (isEq && operandIsConstant)
|
||||||
|
|
Loading…
Add table
Reference in a new issue