Diff
Modified: trunk/Source/_javascript_Core/ChangeLog (260983 => 260984)
--- trunk/Source/_javascript_Core/ChangeLog 2020-05-01 04:43:28 UTC (rev 260983)
+++ trunk/Source/_javascript_Core/ChangeLog 2020-05-01 05:38:06 UTC (rev 260984)
@@ -1,5 +1,131 @@
2020-04-30 Ross Kirsling <ross.kirsl...@sony.com>
+ TriState should be an enum class and use "Indeterminate" instead of "Mixed"
+ https://bugs.webkit.org/show_bug.cgi?id=211268
+
+ Reviewed by Mark Lam.
+
+ * b3/B3Const32Value.cpp:
+ (JSC::B3::Const32Value::equalConstant const):
+ (JSC::B3::Const32Value::notEqualConstant const):
+ (JSC::B3::Const32Value::lessThanConstant const):
+ (JSC::B3::Const32Value::greaterThanConstant const):
+ (JSC::B3::Const32Value::lessEqualConstant const):
+ (JSC::B3::Const32Value::greaterEqualConstant const):
+ (JSC::B3::Const32Value::aboveConstant const):
+ (JSC::B3::Const32Value::belowConstant const):
+ (JSC::B3::Const32Value::aboveEqualConstant const):
+ (JSC::B3::Const32Value::belowEqualConstant const):
+ * b3/B3Const64Value.cpp:
+ (JSC::B3::Const64Value::equalConstant const):
+ (JSC::B3::Const64Value::notEqualConstant const):
+ (JSC::B3::Const64Value::lessThanConstant const):
+ (JSC::B3::Const64Value::greaterThanConstant const):
+ (JSC::B3::Const64Value::lessEqualConstant const):
+ (JSC::B3::Const64Value::greaterEqualConstant const):
+ (JSC::B3::Const64Value::aboveConstant const):
+ (JSC::B3::Const64Value::belowConstant const):
+ (JSC::B3::Const64Value::aboveEqualConstant const):
+ (JSC::B3::Const64Value::belowEqualConstant const):
+ * b3/B3ConstDoubleValue.cpp:
+ (JSC::B3::ConstDoubleValue::equalConstant const):
+ (JSC::B3::ConstDoubleValue::notEqualConstant const):
+ (JSC::B3::ConstDoubleValue::lessThanConstant const):
+ (JSC::B3::ConstDoubleValue::greaterThanConstant const):
+ (JSC::B3::ConstDoubleValue::lessEqualConstant const):
+ (JSC::B3::ConstDoubleValue::greaterEqualConstant const):
+ (JSC::B3::ConstDoubleValue::equalOrUnorderedConstant const):
+ * b3/B3ConstFloatValue.cpp:
+ (JSC::B3::ConstFloatValue::equalConstant const):
+ (JSC::B3::ConstFloatValue::notEqualConstant const):
+ (JSC::B3::ConstFloatValue::lessThanConstant const):
+ (JSC::B3::ConstFloatValue::greaterThanConstant const):
+ (JSC::B3::ConstFloatValue::lessEqualConstant const):
+ (JSC::B3::ConstFloatValue::greaterEqualConstant const):
+ (JSC::B3::ConstFloatValue::equalOrUnorderedConstant const):
+ * b3/B3Procedure.cpp:
+ (JSC::B3::Procedure::addBoolConstant):
+ * b3/B3Procedure.h:
+ * b3/B3ReduceStrength.cpp:
+ * b3/B3Value.cpp:
+ (JSC::B3::Value::equalConstant const):
+ (JSC::B3::Value::notEqualConstant const):
+ (JSC::B3::Value::lessThanConstant const):
+ (JSC::B3::Value::greaterThanConstant const):
+ (JSC::B3::Value::lessEqualConstant const):
+ (JSC::B3::Value::greaterEqualConstant const):
+ (JSC::B3::Value::aboveConstant const):
+ (JSC::B3::Value::belowConstant const):
+ (JSC::B3::Value::aboveEqualConstant const):
+ (JSC::B3::Value::belowEqualConstant const):
+ (JSC::B3::Value::equalOrUnorderedConstant const):
+ (JSC::B3::Value::asTriState const):
+ * b3/B3Value.h:
+ * bytecode/CodeBlock.cpp:
+ (JSC::CodeBlock::~CodeBlock):
+ (JSC::CodeBlock::thresholdForJIT):
+ * bytecode/UnlinkedCodeBlock.cpp:
+ (JSC::UnlinkedCodeBlock::UnlinkedCodeBlock):
+ * bytecode/UnlinkedFunctionExecutable.cpp:
+ (JSC::UnlinkedFunctionExecutable::visitChildren):
+ * bytecompiler/NodesCodegen.cpp:
+ (JSC::ConstantNode::emitBytecodeInConditionContext):
+ (JSC::BinaryOpNode::emitBytecodeInConditionContext):
+ (JSC::BinaryOpNode::tryFoldToBranch):
+ * dfg/DFGByteCodeParser.cpp:
+ (JSC::DFG::ByteCodeParser::handleIntrinsicCall):
+ * dfg/DFGCFGSimplificationPhase.cpp:
+ (JSC::DFG::CFGSimplificationPhase::run):
+ * dfg/DFGLazyJSValue.cpp:
+ (JSC::DFG::equalToSingleCharacter):
+ (JSC::DFG::equalToStringImpl):
+ (JSC::DFG::LazyJSValue::strictEqual const):
+ * dfg/DFGSpeculativeJIT64.cpp:
+ (JSC::DFG::SpeculativeJIT::compile):
+ * ftl/FTLLowerDFGToB3.cpp:
+ (JSC::FTL::DFG::LowerDFGToB3::compileDataViewGet):
+ (JSC::FTL::DFG::LowerDFGToB3::compileDataViewSet):
+ * ftl/FTLOutput.cpp:
+ (JSC::FTL::Output::equal):
+ (JSC::FTL::Output::notEqual):
+ (JSC::FTL::Output::above):
+ (JSC::FTL::Output::aboveOrEqual):
+ (JSC::FTL::Output::below):
+ (JSC::FTL::Output::belowOrEqual):
+ (JSC::FTL::Output::greaterThan):
+ (JSC::FTL::Output::greaterThanOrEqual):
+ (JSC::FTL::Output::lessThan):
+ (JSC::FTL::Output::lessThanOrEqual):
+ * jit/JITOperations.cpp:
+ * runtime/CachedTypes.cpp:
+ (JSC::UnlinkedCodeBlock::UnlinkedCodeBlock):
+ * runtime/DefinePropertyAttributes.h:
+ (JSC::DefinePropertyAttributes::DefinePropertyAttributes):
+ (JSC::DefinePropertyAttributes::hasWritable const):
+ (JSC::DefinePropertyAttributes::writable const):
+ (JSC::DefinePropertyAttributes::hasConfigurable const):
+ (JSC::DefinePropertyAttributes::configurable const):
+ (JSC::DefinePropertyAttributes::hasEnumerable const):
+ (JSC::DefinePropertyAttributes::enumerable const):
+ (JSC::DefinePropertyAttributes::setWritable):
+ (JSC::DefinePropertyAttributes::setConfigurable):
+ (JSC::DefinePropertyAttributes::setEnumerable):
+ * runtime/IntlCollator.cpp:
+ (JSC::IntlCollator::initializeCollator):
+ * runtime/IntlDateTimeFormat.cpp:
+ (JSC::IntlDateTimeFormat::initializeDateTimeFormat):
+ * runtime/IntlNumberFormat.cpp:
+ (JSC::IntlNumberFormat::initializeNumberFormat):
+ * runtime/IntlObject.cpp:
+ (JSC::intlBooleanOption):
+ * runtime/JSCJSValueInlines.h:
+ (JSC::JSValue::pureStrictEqual):
+ (JSC::JSValue::pureToBoolean const):
+ * runtime/JSCellInlines.h:
+ (JSC::JSCell::pureToBoolean const):
+
+2020-04-30 Ross Kirsling <ross.kirsl...@sony.com>
+
[JSC] intlBooleanOption should return TriState instead of taking an out param
https://bugs.webkit.org/show_bug.cgi?id=211256
Modified: trunk/Source/_javascript_Core/b3/B3Const32Value.cpp (260983 => 260984)
--- trunk/Source/_javascript_Core/b3/B3Const32Value.cpp 2020-05-01 04:43:28 UTC (rev 260983)
+++ trunk/Source/_javascript_Core/b3/B3Const32Value.cpp 2020-05-01 05:38:06 UTC (rev 260984)
@@ -207,7 +207,7 @@
TriState Const32Value::equalConstant(const Value* other) const
{
if (!other->hasInt32())
- return MixedTriState;
+ return TriState::Indeterminate;
return triState(m_value == other->asInt32());
}
@@ -214,7 +214,7 @@
TriState Const32Value::notEqualConstant(const Value* other) const
{
if (!other->hasInt32())
- return MixedTriState;
+ return TriState::Indeterminate;
return triState(m_value != other->asInt32());
}
@@ -222,9 +222,9 @@
{
// INT32_MAX < x is always false.
if (static_cast<int32_t>(m_value) == std::numeric_limits<int32_t>::max())
- return FalseTriState;
+ return TriState::False;
if (!other->hasInt32())
- return MixedTriState;
+ return TriState::Indeterminate;
return triState(m_value < other->asInt32());
}
@@ -232,9 +232,9 @@
{
// INT32_MIN > x is always false.
if (static_cast<int32_t>(m_value) == std::numeric_limits<int32_t>::min())
- return FalseTriState;
+ return TriState::False;
if (!other->hasInt32())
- return MixedTriState;
+ return TriState::Indeterminate;
return triState(m_value > other->asInt32());
}
@@ -242,9 +242,9 @@
{
// INT32_MIN <= x is always true.
if (static_cast<int32_t>(m_value) == std::numeric_limits<int32_t>::min())
- return TrueTriState;
+ return TriState::True;
if (!other->hasInt32())
- return MixedTriState;
+ return TriState::Indeterminate;
return triState(m_value <= other->asInt32());
}
@@ -252,9 +252,9 @@
{
// INT32_MAX >= x is always true.
if (static_cast<int32_t>(m_value) == std::numeric_limits<int32_t>::max())
- return TrueTriState;
+ return TriState::True;
if (!other->hasInt32())
- return MixedTriState;
+ return TriState::Indeterminate;
return triState(m_value >= other->asInt32());
}
@@ -262,9 +262,9 @@
{
// UINT32_MIN > x is always false.
if (static_cast<uint32_t>(m_value) == std::numeric_limits<uint32_t>::min())
- return FalseTriState;
+ return TriState::False;
if (!other->hasInt32())
- return MixedTriState;
+ return TriState::Indeterminate;
return triState(static_cast<uint32_t>(m_value) > static_cast<uint32_t>(other->asInt32()));
}
@@ -272,9 +272,9 @@
{
// UINT32_MAX < x is always false.
if (static_cast<uint32_t>(m_value) == std::numeric_limits<uint32_t>::max())
- return FalseTriState;
+ return TriState::False;
if (!other->hasInt32())
- return MixedTriState;
+ return TriState::Indeterminate;
return triState(static_cast<uint32_t>(m_value) < static_cast<uint32_t>(other->asInt32()));
}
@@ -282,9 +282,9 @@
{
// UINT32_MAX >= x is always true.
if (static_cast<uint32_t>(m_value) == std::numeric_limits<uint32_t>::max())
- return TrueTriState;
+ return TriState::True;
if (!other->hasInt32())
- return MixedTriState;
+ return TriState::Indeterminate;
return triState(static_cast<uint32_t>(m_value) >= static_cast<uint32_t>(other->asInt32()));
}
@@ -292,9 +292,9 @@
{
// UINT32_MIN <= x is always true.
if (static_cast<uint32_t>(m_value) == std::numeric_limits<uint32_t>::min())
- return TrueTriState;
+ return TriState::True;
if (!other->hasInt32())
- return MixedTriState;
+ return TriState::Indeterminate;
return triState(static_cast<uint32_t>(m_value) <= static_cast<uint32_t>(other->asInt32()));
}
Modified: trunk/Source/_javascript_Core/b3/B3Const64Value.cpp (260983 => 260984)
--- trunk/Source/_javascript_Core/b3/B3Const64Value.cpp 2020-05-01 04:43:28 UTC (rev 260983)
+++ trunk/Source/_javascript_Core/b3/B3Const64Value.cpp 2020-05-01 05:38:06 UTC (rev 260984)
@@ -207,7 +207,7 @@
TriState Const64Value::equalConstant(const Value* other) const
{
if (!other->hasInt64())
- return MixedTriState;
+ return TriState::Indeterminate;
return triState(m_value == other->asInt64());
}
@@ -214,7 +214,7 @@
TriState Const64Value::notEqualConstant(const Value* other) const
{
if (!other->hasInt64())
- return MixedTriState;
+ return TriState::Indeterminate;
return triState(m_value != other->asInt64());
}
@@ -222,9 +222,9 @@
{
// INT64_MAX < x is always false.
if (static_cast<int64_t>(m_value) == std::numeric_limits<int64_t>::max())
- return FalseTriState;
+ return TriState::False;
if (!other->hasInt64())
- return MixedTriState;
+ return TriState::Indeterminate;
return triState(m_value < other->asInt64());
}
@@ -232,9 +232,9 @@
{
// INT64_MIN > x is always false.
if (static_cast<int64_t>(m_value) == std::numeric_limits<int64_t>::min())
- return FalseTriState;
+ return TriState::False;
if (!other->hasInt64())
- return MixedTriState;
+ return TriState::Indeterminate;
return triState(m_value > other->asInt64());
}
@@ -242,9 +242,9 @@
{
// INT64_MIN <= x is always true.
if (static_cast<int64_t>(m_value) == std::numeric_limits<int64_t>::min())
- return TrueTriState;
+ return TriState::True;
if (!other->hasInt64())
- return MixedTriState;
+ return TriState::Indeterminate;
return triState(m_value <= other->asInt64());
}
@@ -252,9 +252,9 @@
{
// INT64_MAX >= x is always true.
if (static_cast<int64_t>(m_value) == std::numeric_limits<int64_t>::max())
- return TrueTriState;
+ return TriState::True;
if (!other->hasInt64())
- return MixedTriState;
+ return TriState::Indeterminate;
return triState(m_value >= other->asInt64());
}
@@ -262,9 +262,9 @@
{
// UINT64_MIN > x is always false.
if (static_cast<uint64_t>(m_value) == std::numeric_limits<uint64_t>::min())
- return FalseTriState;
+ return TriState::False;
if (!other->hasInt64())
- return MixedTriState;
+ return TriState::Indeterminate;
return triState(static_cast<uint64_t>(m_value) > static_cast<uint64_t>(other->asInt64()));
}
@@ -272,9 +272,9 @@
{
// UINT64_MAX < x is always false.
if (static_cast<uint64_t>(m_value) == std::numeric_limits<uint64_t>::max())
- return FalseTriState;
+ return TriState::False;
if (!other->hasInt64())
- return MixedTriState;
+ return TriState::Indeterminate;
return triState(static_cast<uint64_t>(m_value) < static_cast<uint64_t>(other->asInt64()));
}
@@ -282,9 +282,9 @@
{
// UINT64_MAX >= x is always true.
if (static_cast<uint64_t>(m_value) == std::numeric_limits<uint64_t>::max())
- return TrueTriState;
+ return TriState::True;
if (!other->hasInt64())
- return MixedTriState;
+ return TriState::Indeterminate;
return triState(static_cast<uint64_t>(m_value) >= static_cast<uint64_t>(other->asInt64()));
}
@@ -292,9 +292,9 @@
{
// UINT64_MIN <= x is always true.
if (static_cast<uint64_t>(m_value) == std::numeric_limits<uint64_t>::min())
- return TrueTriState;
+ return TriState::True;
if (!other->hasInt64())
- return MixedTriState;
+ return TriState::Indeterminate;
return triState(static_cast<uint64_t>(m_value) <= static_cast<uint64_t>(other->asInt64()));
}
Modified: trunk/Source/_javascript_Core/b3/B3ConstDoubleValue.cpp (260983 => 260984)
--- trunk/Source/_javascript_Core/b3/B3ConstDoubleValue.cpp 2020-05-01 04:43:28 UTC (rev 260983)
+++ trunk/Source/_javascript_Core/b3/B3ConstDoubleValue.cpp 2020-05-01 05:38:06 UTC (rev 260984)
@@ -141,7 +141,7 @@
TriState ConstDoubleValue::equalConstant(const Value* other) const
{
if (!other->hasDouble())
- return MixedTriState;
+ return TriState::Indeterminate;
return triState(m_value == other->asDouble());
}
@@ -148,7 +148,7 @@
TriState ConstDoubleValue::notEqualConstant(const Value* other) const
{
if (!other->hasDouble())
- return MixedTriState;
+ return TriState::Indeterminate;
return triState(m_value != other->asDouble());
}
@@ -155,7 +155,7 @@
TriState ConstDoubleValue::lessThanConstant(const Value* other) const
{
if (!other->hasDouble())
- return MixedTriState;
+ return TriState::Indeterminate;
return triState(m_value < other->asDouble());
}
@@ -162,7 +162,7 @@
TriState ConstDoubleValue::greaterThanConstant(const Value* other) const
{
if (!other->hasDouble())
- return MixedTriState;
+ return TriState::Indeterminate;
return triState(m_value > other->asDouble());
}
@@ -169,7 +169,7 @@
TriState ConstDoubleValue::lessEqualConstant(const Value* other) const
{
if (!other->hasDouble())
- return MixedTriState;
+ return TriState::Indeterminate;
return triState(m_value <= other->asDouble());
}
@@ -176,7 +176,7 @@
TriState ConstDoubleValue::greaterEqualConstant(const Value* other) const
{
if (!other->hasDouble())
- return MixedTriState;
+ return TriState::Indeterminate;
return triState(m_value >= other->asDouble());
}
@@ -183,10 +183,10 @@
TriState ConstDoubleValue::equalOrUnorderedConstant(const Value* other) const
{
if (std::isnan(m_value))
- return TrueTriState;
+ return TriState::True;
if (!other->hasDouble())
- return MixedTriState;
+ return TriState::Indeterminate;
double otherValue = other->asDouble();
return triState(std::isunordered(m_value, otherValue) || m_value == otherValue);
}
Modified: trunk/Source/_javascript_Core/b3/B3ConstFloatValue.cpp (260983 => 260984)
--- trunk/Source/_javascript_Core/b3/B3ConstFloatValue.cpp 2020-05-01 04:43:28 UTC (rev 260983)
+++ trunk/Source/_javascript_Core/b3/B3ConstFloatValue.cpp 2020-05-01 05:38:06 UTC (rev 260984)
@@ -133,7 +133,7 @@
TriState ConstFloatValue::equalConstant(const Value* other) const
{
if (!other->hasFloat())
- return MixedTriState;
+ return TriState::Indeterminate;
return triState(m_value == other->asFloat());
}
@@ -140,7 +140,7 @@
TriState ConstFloatValue::notEqualConstant(const Value* other) const
{
if (!other->hasFloat())
- return MixedTriState;
+ return TriState::Indeterminate;
return triState(m_value != other->asFloat());
}
@@ -147,7 +147,7 @@
TriState ConstFloatValue::lessThanConstant(const Value* other) const
{
if (!other->hasFloat())
- return MixedTriState;
+ return TriState::Indeterminate;
return triState(m_value < other->asFloat());
}
@@ -154,7 +154,7 @@
TriState ConstFloatValue::greaterThanConstant(const Value* other) const
{
if (!other->hasFloat())
- return MixedTriState;
+ return TriState::Indeterminate;
return triState(m_value > other->asFloat());
}
@@ -161,7 +161,7 @@
TriState ConstFloatValue::lessEqualConstant(const Value* other) const
{
if (!other->hasFloat())
- return MixedTriState;
+ return TriState::Indeterminate;
return triState(m_value <= other->asFloat());
}
@@ -168,7 +168,7 @@
TriState ConstFloatValue::greaterEqualConstant(const Value* other) const
{
if (!other->hasFloat())
- return MixedTriState;
+ return TriState::Indeterminate;
return triState(m_value >= other->asFloat());
}
@@ -175,10 +175,10 @@
TriState ConstFloatValue::equalOrUnorderedConstant(const Value* other) const
{
if (std::isnan(m_value))
- return TrueTriState;
+ return TriState::True;
if (!other->hasFloat())
- return MixedTriState;
+ return TriState::Indeterminate;
float otherValue = other->asFloat();
return triState(std::isunordered(m_value, otherValue) || m_value == otherValue);
}
Modified: trunk/Source/_javascript_Core/b3/B3Procedure.cpp (260983 => 260984)
--- trunk/Source/_javascript_Core/b3/B3Procedure.cpp 2020-05-01 04:43:28 UTC (rev 260983)
+++ trunk/Source/_javascript_Core/b3/B3Procedure.cpp 2020-05-01 05:38:06 UTC (rev 260984)
@@ -164,13 +164,13 @@
{
int32_t value = 0;
switch (triState) {
- case FalseTriState:
+ case TriState::False:
value = 0;
break;
- case TrueTriState:
+ case TriState::True:
value = 1;
break;
- case MixedTriState:
+ case TriState::Indeterminate:
return nullptr;
}
Modified: trunk/Source/_javascript_Core/b3/B3Procedure.h (260983 => 260984)
--- trunk/Source/_javascript_Core/b3/B3Procedure.h 2020-05-01 04:43:28 UTC (rev 260983)
+++ trunk/Source/_javascript_Core/b3/B3Procedure.h 2020-05-01 05:38:06 UTC (rev 260984)
@@ -139,7 +139,7 @@
Value* addBottom(Origin, Type);
Value* addBottom(Value*);
- // Returns null for MixedTriState.
+ // Returns null for TriState::Indeterminate.
Value* addBoolConstant(Origin, TriState);
void resetValueOwners();
Modified: trunk/Source/_javascript_Core/b3/B3ReduceStrength.cpp (260983 => 260984)
--- trunk/Source/_javascript_Core/b3/B3ReduceStrength.cpp 2020-05-01 04:43:28 UTC (rev 260983)
+++ trunk/Source/_javascript_Core/b3/B3ReduceStrength.cpp 2020-05-01 05:38:06 UTC (rev 260984)
@@ -1894,7 +1894,7 @@
case AboveEqual:
case BelowEqual: {
CanonicalizedComparison comparison = canonicalizeComparison(m_value);
- TriState result = MixedTriState;
+ TriState result = TriState::Indeterminate;
switch (comparison.opcode) {
case LessThan:
result = comparison.operands[1]->greaterThanConstant(comparison.operands[0]);
@@ -2167,7 +2167,7 @@
// Turn this: Branch(0, then, else)
// Into this: Jump(else)
- if (triState == FalseTriState) {
+ if (triState == TriState::False) {
m_block->taken().block()->removePredecessor(m_block);
m_value->replaceWithJump(m_block, m_block->notTaken());
m_changedCFG = true;
@@ -2176,7 +2176,7 @@
// Turn this: Branch(not 0, then, else)
// Into this: Jump(then)
- if (triState == TrueTriState) {
+ if (triState == TriState::True) {
m_block->notTaken().block()->removePredecessor(m_block);
m_value->replaceWithJump(m_block, m_block->taken());
m_changedCFG = true;
Modified: trunk/Source/_javascript_Core/b3/B3Value.cpp (260983 => 260984)
--- trunk/Source/_javascript_Core/b3/B3Value.cpp 2020-05-01 04:43:28 UTC (rev 260983)
+++ trunk/Source/_javascript_Core/b3/B3Value.cpp 2020-05-01 05:38:06 UTC (rev 260984)
@@ -379,57 +379,57 @@
TriState Value::equalConstant(const Value*) const
{
- return MixedTriState;
+ return TriState::Indeterminate;
}
TriState Value::notEqualConstant(const Value*) const
{
- return MixedTriState;
+ return TriState::Indeterminate;
}
TriState Value::lessThanConstant(const Value*) const
{
- return MixedTriState;
+ return TriState::Indeterminate;
}
TriState Value::greaterThanConstant(const Value*) const
{
- return MixedTriState;
+ return TriState::Indeterminate;
}
TriState Value::lessEqualConstant(const Value*) const
{
- return MixedTriState;
+ return TriState::Indeterminate;
}
TriState Value::greaterEqualConstant(const Value*) const
{
- return MixedTriState;
+ return TriState::Indeterminate;
}
TriState Value::aboveConstant(const Value*) const
{
- return MixedTriState;
+ return TriState::Indeterminate;
}
TriState Value::belowConstant(const Value*) const
{
- return MixedTriState;
+ return TriState::Indeterminate;
}
TriState Value::aboveEqualConstant(const Value*) const
{
- return MixedTriState;
+ return TriState::Indeterminate;
}
TriState Value::belowEqualConstant(const Value*) const
{
- return MixedTriState;
+ return TriState::Indeterminate;
}
TriState Value::equalOrUnorderedConstant(const Value*) const
{
- return MixedTriState;
+ return TriState::Indeterminate;
}
Value* Value::invertedCompare(Procedure& proc) const
@@ -520,7 +520,7 @@
case ConstFloat:
return triState(asFloat() != 0.);
default:
- return MixedTriState;
+ return TriState::Indeterminate;
}
}
Modified: trunk/Source/_javascript_Core/b3/B3Value.h (260983 => 260984)
--- trunk/Source/_javascript_Core/b3/B3Value.h 2020-05-01 04:43:28 UTC (rev 260983)
+++ trunk/Source/_javascript_Core/b3/B3Value.h 2020-05-01 05:38:06 UTC (rev 260984)
@@ -290,8 +290,8 @@
bool isRounded() const;
TriState asTriState() const;
- bool isLikeZero() const { return asTriState() == FalseTriState; }
- bool isLikeNonZero() const { return asTriState() == TrueTriState; }
+ bool isLikeZero() const { return asTriState() == TriState::False; }
+ bool isLikeNonZero() const { return asTriState() == TriState::True; }
Effects effects() const;
Modified: trunk/Source/_javascript_Core/bytecode/CodeBlock.cpp (260983 => 260984)
--- trunk/Source/_javascript_Core/bytecode/CodeBlock.cpp 2020-05-01 04:43:28 UTC (rev 260983)
+++ trunk/Source/_javascript_Core/bytecode/CodeBlock.cpp 2020-05-01 05:38:06 UTC (rev 260984)
@@ -853,8 +853,8 @@
if (UNLIKELY(vm.m_perBytecodeProfiler))
vm.m_perBytecodeProfiler->notifyDestruction(this);
- if (!vm.heap.isShuttingDown() && unlinkedCodeBlock()->didOptimize() == MixedTriState)
- unlinkedCodeBlock()->setDidOptimize(FalseTriState);
+ if (!vm.heap.isShuttingDown() && unlinkedCodeBlock()->didOptimize() == TriState::Indeterminate)
+ unlinkedCodeBlock()->setDidOptimize(TriState::False);
#if ENABLE(VERBOSE_VALUE_PROFILE)
dumpValueProfiles();
@@ -3385,11 +3385,11 @@
int32_t CodeBlock::thresholdForJIT(int32_t threshold)
{
switch (unlinkedCodeBlock()->didOptimize()) {
- case MixedTriState:
+ case TriState::Indeterminate:
return threshold;
- case FalseTriState:
+ case TriState::False:
return threshold * 4;
- case TrueTriState:
+ case TriState::True:
return threshold / 2;
}
ASSERT_NOT_REACHED();
Modified: trunk/Source/_javascript_Core/bytecode/UnlinkedCodeBlock.cpp (260983 => 260984)
--- trunk/Source/_javascript_Core/bytecode/UnlinkedCodeBlock.cpp 2020-05-01 04:43:28 UTC (rev 260983)
+++ trunk/Source/_javascript_Core/bytecode/UnlinkedCodeBlock.cpp 2020-05-01 05:38:06 UTC (rev 260984)
@@ -69,7 +69,7 @@
, m_derivedContextType(static_cast<unsigned>(info.derivedContextType()))
, m_evalContextType(static_cast<unsigned>(info.evalContextType()))
, m_codeType(static_cast<unsigned>(codeType))
- , m_didOptimize(static_cast<unsigned>(MixedTriState))
+ , m_didOptimize(static_cast<unsigned>(TriState::Indeterminate))
, m_age(0)
, m_hasCheckpoints(false)
, m_parseMode(info.parseMode())
@@ -78,7 +78,7 @@
{
ASSERT(m_constructorKind == static_cast<unsigned>(info.constructorKind()));
ASSERT(m_codeType == static_cast<unsigned>(codeType));
- ASSERT(m_didOptimize == static_cast<unsigned>(MixedTriState));
+ ASSERT(m_didOptimize == static_cast<unsigned>(TriState::Indeterminate));
if (info.needsClassFieldInitializer() == NeedsClassFieldInitializer::Yes) {
createRareDataIfNecessary(holdLock(cellLock()));
m_rareData->m_needsClassFieldInitializer = static_cast<unsigned>(NeedsClassFieldInitializer::Yes);
Modified: trunk/Source/_javascript_Core/bytecode/UnlinkedFunctionExecutable.cpp (260983 => 260984)
--- trunk/Source/_javascript_Core/bytecode/UnlinkedFunctionExecutable.cpp 2020-05-01 04:43:28 UTC (rev 260983)
+++ trunk/Source/_javascript_Core/bytecode/UnlinkedFunctionExecutable.cpp 2020-05-01 05:38:06 UTC (rev 260984)
@@ -152,7 +152,7 @@
auto markIfProfitable = [&] (WriteBarrier<UnlinkedFunctionCodeBlock>& unlinkedCodeBlock) {
if (!unlinkedCodeBlock)
return;
- if (unlinkedCodeBlock->didOptimize() == TrueTriState)
+ if (unlinkedCodeBlock->didOptimize() == TriState::True)
visitor.append(unlinkedCodeBlock);
else if (unlinkedCodeBlock->age() < UnlinkedCodeBlock::maxAge)
visitor.append(unlinkedCodeBlock);
Modified: trunk/Source/_javascript_Core/bytecompiler/NodesCodegen.cpp (260983 => 260984)
--- trunk/Source/_javascript_Core/bytecompiler/NodesCodegen.cpp 2020-05-01 04:43:28 UTC (rev 260983)
+++ trunk/Source/_javascript_Core/bytecompiler/NodesCodegen.cpp 2020-05-01 05:38:06 UTC (rev 260984)
@@ -103,15 +103,15 @@
TriState value = jsValue(generator).pureToBoolean();
if (UNLIKELY(needsDebugHook())) {
- if (value != MixedTriState)
+ if (value != TriState::Indeterminate)
generator.emitDebugHook(this);
}
- if (value == MixedTriState)
+ if (value == TriState::Indeterminate)
ExpressionNode::emitBytecodeInConditionContext(generator, trueTarget, falseTarget, fallThroughMode);
- else if (value == TrueTriState && fallThroughMode == FallThroughMeansFalse)
+ else if (value == TriState::True && fallThroughMode == FallThroughMeansFalse)
generator.emitJump(trueTarget);
- else if (value == FalseTriState && fallThroughMode == FallThroughMeansTrue)
+ else if (value == TriState::False && fallThroughMode == FallThroughMeansTrue)
generator.emitJump(falseTarget);
// All other cases are unconditional fall-throughs, like "if (true)".
@@ -2476,13 +2476,13 @@
tryFoldToBranch(generator, branchCondition, branchExpression);
if (UNLIKELY(needsDebugHook())) {
- if (branchCondition != MixedTriState)
+ if (branchCondition != TriState::Indeterminate)
generator.emitDebugHook(this);
}
- if (branchCondition == MixedTriState)
+ if (branchCondition == TriState::Indeterminate)
ExpressionNode::emitBytecodeInConditionContext(generator, trueTarget, falseTarget, fallThroughMode);
- else if (branchCondition == TrueTriState)
+ else if (branchCondition == TriState::True)
generator.emitNodeInConditionContext(branchExpression, trueTarget, falseTarget, fallThroughMode);
else
generator.emitNodeInConditionContext(branchExpression, falseTarget, trueTarget, invert(fallThroughMode));
@@ -2504,7 +2504,7 @@
void BinaryOpNode::tryFoldToBranch(BytecodeGenerator& generator, TriState& branchCondition, ExpressionNode*& branchExpression)
{
- branchCondition = MixedTriState;
+ branchCondition = TriState::Indeterminate;
branchExpression = 0;
ConstantNode* constant = 0;
@@ -2527,9 +2527,9 @@
return;
if (opcodeID == op_eq || opcodeID == op_stricteq)
- branchCondition = triState(value.pureToBoolean());
+ branchCondition = triState(value.pureToBoolean() != TriState::False);
else if (opcodeID == op_neq || opcodeID == op_nstricteq)
- branchCondition = triState(!value.pureToBoolean());
+ branchCondition = triState(value.pureToBoolean() == TriState::False);
}
RegisterID* BinaryOpNode::emitBytecode(BytecodeGenerator& generator, RegisterID* dst)
Modified: trunk/Source/_javascript_Core/dfg/DFGByteCodeParser.cpp (260983 => 260984)
--- trunk/Source/_javascript_Core/dfg/DFGByteCodeParser.cpp 2020-05-01 04:43:28 UTC (rev 260983)
+++ trunk/Source/_javascript_Core/dfg/DFGByteCodeParser.cpp 2020-05-01 05:38:06 UTC (rev 260984)
@@ -3487,11 +3487,11 @@
RELEASE_ASSERT_NOT_REACHED();
}
- TriState isLittleEndian = MixedTriState;
+ TriState isLittleEndian = TriState::Indeterminate;
Node* littleEndianChild = nullptr;
if (byteSize > 1) {
if (argumentCountIncludingThis < 3)
- isLittleEndian = FalseTriState;
+ isLittleEndian = TriState::False;
else {
littleEndianChild = get(virtualRegisterForArgumentIncludingThis(2, registerOffset));
if (littleEndianChild->hasConstant()) {
@@ -3498,11 +3498,11 @@
JSValue constant = littleEndianChild->constant()->value();
if (constant) {
isLittleEndian = constant.pureToBoolean();
- if (isLittleEndian != MixedTriState)
+ if (isLittleEndian != TriState::Indeterminate)
littleEndianChild = nullptr;
}
} else
- isLittleEndian = MixedTriState;
+ isLittleEndian = TriState::Indeterminate;
}
}
@@ -3572,11 +3572,11 @@
RELEASE_ASSERT_NOT_REACHED();
}
- TriState isLittleEndian = MixedTriState;
+ TriState isLittleEndian = TriState::Indeterminate;
Node* littleEndianChild = nullptr;
if (byteSize > 1) {
if (argumentCountIncludingThis < 4)
- isLittleEndian = FalseTriState;
+ isLittleEndian = TriState::False;
else {
littleEndianChild = get(virtualRegisterForArgumentIncludingThis(3, registerOffset));
if (littleEndianChild->hasConstant()) {
@@ -3583,11 +3583,11 @@
JSValue constant = littleEndianChild->constant()->value();
if (constant) {
isLittleEndian = constant.pureToBoolean();
- if (isLittleEndian != MixedTriState)
+ if (isLittleEndian != TriState::Indeterminate)
littleEndianChild = nullptr;
}
} else
- isLittleEndian = MixedTriState;
+ isLittleEndian = TriState::Indeterminate;
}
}
Modified: trunk/Source/_javascript_Core/dfg/DFGCFGSimplificationPhase.cpp (260983 => 260984)
--- trunk/Source/_javascript_Core/dfg/DFGCFGSimplificationPhase.cpp 2020-05-01 04:43:28 UTC (rev 260983)
+++ trunk/Source/_javascript_Core/dfg/DFGCFGSimplificationPhase.cpp 2020-05-01 05:38:06 UTC (rev 260984)
@@ -170,17 +170,17 @@
Node* terminal = block->terminal();
if (terminal->child1()->hasConstant()) {
FrozenValue* value = terminal->child1()->constant();
- TriState found = FalseTriState;
+ TriState found = TriState::False;
BasicBlock* targetBlock = 0;
- for (unsigned i = data->cases.size(); found == FalseTriState && i--;) {
+ for (unsigned i = data->cases.size(); found == TriState::False && i--;) {
found = data->cases[i].value.strictEqual(value);
- if (found == TrueTriState)
+ if (found == TriState::True)
targetBlock = data->cases[i].target.block;
}
- if (found == MixedTriState)
+ if (found == TriState::Indeterminate)
break;
- if (found == FalseTriState)
+ if (found == TriState::False)
targetBlock = data->fallThrough.block;
ASSERT(targetBlock);
Modified: trunk/Source/_javascript_Core/dfg/DFGLazyJSValue.cpp (260983 => 260984)
--- trunk/Source/_javascript_Core/dfg/DFGLazyJSValue.cpp 2020-05-01 04:43:28 UTC (rev 260983)
+++ trunk/Source/_javascript_Core/dfg/DFGLazyJSValue.cpp 2020-05-01 05:38:06 UTC (rev 260984)
@@ -62,15 +62,15 @@
static TriState equalToSingleCharacter(JSValue value, UChar character)
{
if (!value.isString())
- return FalseTriState;
+ return TriState::False;
JSString* jsString = asString(value);
if (jsString->length() != 1)
- return FalseTriState;
+ return TriState::False;
const StringImpl* string = jsString->tryGetValueImpl();
if (!string)
- return MixedTriState;
+ return TriState::Indeterminate;
return triState(string->at(0) == character);
}
@@ -78,12 +78,12 @@
static TriState equalToStringImpl(JSValue value, StringImpl* stringImpl)
{
if (!value.isString())
- return FalseTriState;
+ return TriState::False;
JSString* jsString = asString(value);
const StringImpl* string = jsString->tryGetValueImpl();
if (!string)
- return MixedTriState;
+ return TriState::Indeterminate;
return triState(WTF::equal(stringImpl, string));
}
@@ -142,18 +142,18 @@
switch (other.m_kind) {
case KnownValue: {
if (!value()->value() || !other.value()->value())
- return value()->value() == other.value()->value() ? TrueTriState : FalseTriState;
+ return value()->value() == other.value()->value() ? TriState::True : TriState::False;
return JSValue::pureStrictEqual(value()->value(), other.value()->value());
}
case SingleCharacterString: {
if (!value()->value())
- return FalseTriState;
+ return TriState::False;
return equalToSingleCharacter(value()->value(), other.character());
}
case KnownStringImpl:
case NewStringImpl: {
if (!value()->value())
- return FalseTriState;
+ return TriState::False;
return equalToStringImpl(value()->value(), other.stringImpl());
}
}
@@ -165,7 +165,7 @@
case KnownStringImpl:
case NewStringImpl:
if (other.stringImpl()->length() != 1)
- return FalseTriState;
+ return TriState::False;
return triState(other.stringImpl()->at(0) == character());
case KnownValue:
return other.strictEqual(*this);
@@ -184,7 +184,7 @@
break;
}
RELEASE_ASSERT_NOT_REACHED();
- return FalseTriState;
+ return TriState::False;
}
uintptr_t LazyJSValue::switchLookupValue(SwitchKind kind) const
Modified: trunk/Source/_javascript_Core/dfg/DFGSpeculativeJIT64.cpp (260983 => 260984)
--- trunk/Source/_javascript_Core/dfg/DFGSpeculativeJIT64.cpp 2020-05-01 04:43:28 UTC (rev 260983)
+++ trunk/Source/_javascript_Core/dfg/DFGSpeculativeJIT64.cpp 2020-05-01 05:38:06 UTC (rev 260984)
@@ -5118,9 +5118,9 @@
m_jit.signExtend16To32(t2, t2);
};
- if (data.isLittleEndian == FalseTriState)
+ if (data.isLittleEndian == TriState::False)
emitBigEndianLoad();
- else if (data.isLittleEndian == TrueTriState)
+ else if (data.isLittleEndian == TriState::True)
emitLittleEndianLoad();
else {
RELEASE_ASSERT(isLittleEndianGPR != InvalidGPRReg);
@@ -5137,9 +5137,9 @@
case 4: {
m_jit.load32(baseIndex, t2);
- if (data.isLittleEndian == FalseTriState)
+ if (data.isLittleEndian == TriState::False)
m_jit.byteSwap32(t2);
- else if (data.isLittleEndian == MixedTriState) {
+ else if (data.isLittleEndian == TriState::Indeterminate) {
RELEASE_ASSERT(isLittleEndianGPR != InvalidGPRReg);
auto isLittleEndian = m_jit.branchTest32(MacroAssembler::NonZero, isLittleEndianGPR, TrustedImm32(1));
m_jit.byteSwap32(t2);
@@ -5173,9 +5173,9 @@
m_jit.convertFloatToDouble(resultFPR, resultFPR);
};
- if (data.isLittleEndian == TrueTriState)
+ if (data.isLittleEndian == TriState::True)
emitLittleEndianCode();
- else if (data.isLittleEndian == FalseTriState)
+ else if (data.isLittleEndian == TriState::False)
emitBigEndianCode();
else {
RELEASE_ASSERT(isLittleEndianGPR != InvalidGPRReg);
@@ -5200,9 +5200,9 @@
m_jit.move64ToDouble(t2, resultFPR);
};
- if (data.isLittleEndian == TrueTriState)
+ if (data.isLittleEndian == TriState::True)
emitLittleEndianCode();
- else if (data.isLittleEndian == FalseTriState)
+ else if (data.isLittleEndian == TriState::False)
emitBigEndianCode();
else {
RELEASE_ASSERT(isLittleEndianGPR != InvalidGPRReg);
@@ -5312,9 +5312,9 @@
m_jit.store32(t3, baseIndex);
};
- if (data.isLittleEndian == FalseTriState)
+ if (data.isLittleEndian == TriState::False)
emitBigEndianCode();
- else if (data.isLittleEndian == TrueTriState)
+ else if (data.isLittleEndian == TriState::True)
emitLittleEndianCode();
else {
RELEASE_ASSERT(isLittleEndianGPR != InvalidGPRReg);
@@ -5338,9 +5338,9 @@
m_jit.store64(t3, baseIndex);
};
- if (data.isLittleEndian == FalseTriState)
+ if (data.isLittleEndian == TriState::False)
emitBigEndianCode();
- else if (data.isLittleEndian == TrueTriState)
+ else if (data.isLittleEndian == TriState::True)
emitLittleEndianCode();
else {
RELEASE_ASSERT(isLittleEndianGPR != InvalidGPRReg);
@@ -5372,9 +5372,9 @@
m_jit.store16(t3, baseIndex);
};
- if (data.isLittleEndian == FalseTriState)
+ if (data.isLittleEndian == TriState::False)
emitBigEndianCode();
- else if (data.isLittleEndian == TrueTriState)
+ else if (data.isLittleEndian == TriState::True)
emitLittleEndianCode();
else {
RELEASE_ASSERT(isLittleEndianGPR != InvalidGPRReg);
@@ -5400,9 +5400,9 @@
m_jit.store32(t3, baseIndex);
};
- if (data.isLittleEndian == FalseTriState)
+ if (data.isLittleEndian == TriState::False)
emitBigEndianCode();
- else if (data.isLittleEndian == TrueTriState)
+ else if (data.isLittleEndian == TriState::True)
emitLittleEndianCode();
else {
RELEASE_ASSERT(isLittleEndianGPR != InvalidGPRReg);
Modified: trunk/Source/_javascript_Core/ftl/FTLLowerDFGToB3.cpp (260983 => 260984)
--- trunk/Source/_javascript_Core/ftl/FTLLowerDFGToB3.cpp 2020-05-01 04:43:28 UTC (rev 260983)
+++ trunk/Source/_javascript_Core/ftl/FTLLowerDFGToB3.cpp 2020-05-01 05:38:06 UTC (rev 260984)
@@ -14190,9 +14190,9 @@
return patchpoint;
};
- if (data.isLittleEndian == FalseTriState)
+ if (data.isLittleEndian == TriState::False)
setInt32(emitBigEndianLoad());
- else if (data.isLittleEndian == TrueTriState)
+ else if (data.isLittleEndian == TriState::True)
setInt32(emitLittleEndianLoad());
else
setInt32(emitCodeBasedOnEndiannessBranch(isLittleEndian, emitLittleEndianLoad, emitBigEndianLoad));
@@ -14202,9 +14202,9 @@
case 4: {
LValue loadedValue = m_out.load32(pointer);
- if (data.isLittleEndian == FalseTriState)
+ if (data.isLittleEndian == TriState::False)
loadedValue = byteSwap32(loadedValue);
- else if (data.isLittleEndian == MixedTriState) {
+ else if (data.isLittleEndian == TriState::Indeterminate) {
auto emitLittleEndianCode = [&] {
return loadedValue;
};
@@ -14247,9 +14247,9 @@
return patchpoint;
};
- if (data.isLittleEndian == TrueTriState)
+ if (data.isLittleEndian == TriState::True)
setDouble(emitLittleEndianCode());
- else if (data.isLittleEndian == FalseTriState)
+ else if (data.isLittleEndian == TriState::False)
setDouble(emitBigEndianCode());
else
setDouble(emitCodeBasedOnEndiannessBranch(isLittleEndian, emitLittleEndianCode, emitBigEndianCode));
@@ -14267,9 +14267,9 @@
return m_out.bitCast(loadedValue, Double);
};
- if (data.isLittleEndian == TrueTriState)
+ if (data.isLittleEndian == TriState::True)
setDouble(emitLittleEndianCode());
- else if (data.isLittleEndian == FalseTriState)
+ else if (data.isLittleEndian == TriState::False)
setDouble(emitBigEndianCode());
else
setDouble(emitCodeBasedOnEndiannessBranch(isLittleEndian, emitLittleEndianCode, emitBigEndianCode));
@@ -14338,9 +14338,9 @@
return nullptr;
};
- if (data.isLittleEndian == FalseTriState)
+ if (data.isLittleEndian == TriState::False)
emitBigEndianCode();
- else if (data.isLittleEndian == TrueTriState)
+ else if (data.isLittleEndian == TriState::True)
emitLittleEndianCode();
else
emitCodeBasedOnEndiannessBranch(isLittleEndian, emitLittleEndianCode, emitBigEndianCode);
@@ -14356,9 +14356,9 @@
return nullptr;
};
- if (data.isLittleEndian == FalseTriState)
+ if (data.isLittleEndian == TriState::False)
emitBigEndianCode();
- else if (data.isLittleEndian == TrueTriState)
+ else if (data.isLittleEndian == TriState::True)
emitLittleEndianCode();
else
emitCodeBasedOnEndiannessBranch(isLittleEndian, emitLittleEndianCode, emitBigEndianCode);
@@ -14389,9 +14389,9 @@
return nullptr;
};
- if (data.isLittleEndian == FalseTriState)
+ if (data.isLittleEndian == TriState::False)
emitBigEndianCode();
- else if (data.isLittleEndian == TrueTriState)
+ else if (data.isLittleEndian == TriState::True)
emitLittleEndianCode();
else
emitCodeBasedOnEndiannessBranch(isLittleEndian, emitLittleEndianCode, emitBigEndianCode);
@@ -14412,9 +14412,9 @@
return nullptr;
};
- if (data.isLittleEndian == FalseTriState)
+ if (data.isLittleEndian == TriState::False)
emitBigEndianCode();
- else if (data.isLittleEndian == TrueTriState)
+ else if (data.isLittleEndian == TriState::True)
emitLittleEndianCode();
else
emitCodeBasedOnEndiannessBranch(isLittleEndian, emitLittleEndianCode, emitBigEndianCode);
Modified: trunk/Source/_javascript_Core/ftl/FTLOutput.cpp (260983 => 260984)
--- trunk/Source/_javascript_Core/ftl/FTLOutput.cpp 2020-05-01 04:43:28 UTC (rev 260983)
+++ trunk/Source/_javascript_Core/ftl/FTLOutput.cpp 2020-05-01 05:38:06 UTC (rev 260984)
@@ -498,8 +498,8 @@
LValue Output::equal(LValue left, LValue right)
{
TriState result = left->equalConstant(right);
- if (result != MixedTriState)
- return constBool(result == TrueTriState);
+ if (result != TriState::Indeterminate)
+ return constBool(result == TriState::True);
return m_block->appendNew<B3::Value>(m_proc, B3::Equal, origin(), left, right);
}
@@ -506,8 +506,8 @@
LValue Output::notEqual(LValue left, LValue right)
{
TriState result = left->notEqualConstant(right);
- if (result != MixedTriState)
- return constBool(result == TrueTriState);
+ if (result != TriState::Indeterminate)
+ return constBool(result == TriState::True);
return m_block->appendNew<B3::Value>(m_proc, B3::NotEqual, origin(), left, right);
}
@@ -514,8 +514,8 @@
LValue Output::above(LValue left, LValue right)
{
TriState result = left->aboveConstant(right);
- if (result != MixedTriState)
- return constBool(result == TrueTriState);
+ if (result != TriState::Indeterminate)
+ return constBool(result == TriState::True);
return m_block->appendNew<B3::Value>(m_proc, B3::Above, origin(), left, right);
}
@@ -522,8 +522,8 @@
LValue Output::aboveOrEqual(LValue left, LValue right)
{
TriState result = left->aboveEqualConstant(right);
- if (result != MixedTriState)
- return constBool(result == TrueTriState);
+ if (result != TriState::Indeterminate)
+ return constBool(result == TriState::True);
return m_block->appendNew<B3::Value>(m_proc, B3::AboveEqual, origin(), left, right);
}
@@ -530,8 +530,8 @@
LValue Output::below(LValue left, LValue right)
{
TriState result = left->belowConstant(right);
- if (result != MixedTriState)
- return constBool(result == TrueTriState);
+ if (result != TriState::Indeterminate)
+ return constBool(result == TriState::True);
return m_block->appendNew<B3::Value>(m_proc, B3::Below, origin(), left, right);
}
@@ -538,8 +538,8 @@
LValue Output::belowOrEqual(LValue left, LValue right)
{
TriState result = left->belowEqualConstant(right);
- if (result != MixedTriState)
- return constBool(result == TrueTriState);
+ if (result != TriState::Indeterminate)
+ return constBool(result == TriState::True);
return m_block->appendNew<B3::Value>(m_proc, B3::BelowEqual, origin(), left, right);
}
@@ -546,8 +546,8 @@
LValue Output::greaterThan(LValue left, LValue right)
{
TriState result = left->greaterThanConstant(right);
- if (result != MixedTriState)
- return constBool(result == TrueTriState);
+ if (result != TriState::Indeterminate)
+ return constBool(result == TriState::True);
return m_block->appendNew<B3::Value>(m_proc, B3::GreaterThan, origin(), left, right);
}
@@ -554,8 +554,8 @@
LValue Output::greaterThanOrEqual(LValue left, LValue right)
{
TriState result = left->greaterEqualConstant(right);
- if (result != MixedTriState)
- return constBool(result == TrueTriState);
+ if (result != TriState::Indeterminate)
+ return constBool(result == TriState::True);
return m_block->appendNew<B3::Value>(m_proc, B3::GreaterEqual, origin(), left, right);
}
@@ -562,8 +562,8 @@
LValue Output::lessThan(LValue left, LValue right)
{
TriState result = left->lessThanConstant(right);
- if (result != MixedTriState)
- return constBool(result == TrueTriState);
+ if (result != TriState::Indeterminate)
+ return constBool(result == TriState::True);
return m_block->appendNew<B3::Value>(m_proc, B3::LessThan, origin(), left, right);
}
@@ -570,8 +570,8 @@
LValue Output::lessThanOrEqual(LValue left, LValue right)
{
TriState result = left->lessEqualConstant(right);
- if (result != MixedTriState)
- return constBool(result == TrueTriState);
+ if (result != TriState::Indeterminate)
+ return constBool(result == TriState::True);
return m_block->appendNew<B3::Value>(m_proc, B3::LessEqual, origin(), left, right);
}
Modified: trunk/Source/_javascript_Core/jit/JITOperations.cpp (260983 => 260984)
--- trunk/Source/_javascript_Core/jit/JITOperations.cpp 2020-05-01 04:43:28 UTC (rev 260983)
+++ trunk/Source/_javascript_Core/jit/JITOperations.cpp 2020-05-01 05:38:06 UTC (rev 260984)
@@ -1717,7 +1717,7 @@
dataLogLnIf(Options::verboseOSR(), "Performing OSR ", codeBlock, " -> ", optimizedCodeBlock);
codeBlock->optimizeSoon();
- codeBlock->unlinkedCodeBlock()->setDidOptimize(TrueTriState);
+ codeBlock->unlinkedCodeBlock()->setDidOptimize(TriState::True);
void* targetPC = vm.getCTIStub(DFG::osrEntryThunkGenerator).code().executableAddress();
targetPC = retagCodePtr(targetPC, JITThunkPtrTag, bitwise_cast<PtrTag>(callFrame));
return encodeResult(targetPC, dataBuffer);
Modified: trunk/Source/_javascript_Core/runtime/CachedTypes.cpp (260983 => 260984)
--- trunk/Source/_javascript_Core/runtime/CachedTypes.cpp 2020-05-01 04:43:28 UTC (rev 260983)
+++ trunk/Source/_javascript_Core/runtime/CachedTypes.cpp 2020-05-01 05:38:06 UTC (rev 260984)
@@ -2060,7 +2060,7 @@
, m_evalContextType(cachedCodeBlock.evalContextType())
, m_codeType(cachedCodeBlock.codeType())
- , m_didOptimize(static_cast<unsigned>(MixedTriState))
+ , m_didOptimize(static_cast<unsigned>(TriState::Indeterminate))
, m_age(0)
, m_hasCheckpoints(cachedCodeBlock.hasCheckpoints())
Modified: trunk/Source/_javascript_Core/runtime/DefinePropertyAttributes.h (260983 => 260984)
--- trunk/Source/_javascript_Core/runtime/DefinePropertyAttributes.h 2020-05-01 04:43:28 UTC (rev 260983)
+++ trunk/Source/_javascript_Core/runtime/DefinePropertyAttributes.h 2020-05-01 05:38:06 UTC (rev 260984)
@@ -32,9 +32,9 @@
class DefinePropertyAttributes {
public:
- static_assert(FalseTriState == 0, "FalseTriState is 0.");
- static_assert(TrueTriState == 1, "TrueTriState is 1.");
- static_assert(MixedTriState == 2, "MixedTriState is 2.");
+ static_assert(!static_cast<uint8_t>(TriState::False), "TriState::False is 0.");
+ static_assert(static_cast<uint8_t>(TriState::True) == 1, "TriState::True is 1.");
+ static_assert(static_cast<uint8_t>(TriState::Indeterminate) == 2, "TriState::Indeterminate is 2.");
static constexpr unsigned ConfigurableShift = 0;
static constexpr unsigned EnumerableShift = 2;
@@ -45,12 +45,12 @@
DefinePropertyAttributes()
: m_attributes(
- (MixedTriState << ConfigurableShift)
- | (MixedTriState << EnumerableShift)
- | (MixedTriState << WritableShift)
- | (0 << ValueShift)
- | (0 << GetShift)
- | (0 << SetShift))
+ (static_cast<uint8_t>(TriState::Indeterminate) << ConfigurableShift)
+ | (static_cast<uint8_t>(TriState::Indeterminate) << EnumerableShift)
+ | (static_cast<uint8_t>(TriState::Indeterminate) << WritableShift)
+ | (static_cast<uint8_t>(TriState::False) << ValueShift)
+ | (static_cast<uint8_t>(TriState::False) << GetShift)
+ | (static_cast<uint8_t>(TriState::False) << SetShift))
{
}
@@ -96,7 +96,7 @@
bool hasWritable() const
{
- return extractTriState(WritableShift) != MixedTriState;
+ return extractTriState(WritableShift) != TriState::Indeterminate;
}
Optional<bool> writable() const
@@ -103,12 +103,12 @@
{
if (!hasWritable())
return WTF::nullopt;
- return extractTriState(WritableShift) == TrueTriState;
+ return extractTriState(WritableShift) == TriState::True;
}
bool hasConfigurable() const
{
- return extractTriState(ConfigurableShift) != MixedTriState;
+ return extractTriState(ConfigurableShift) != TriState::Indeterminate;
}
Optional<bool> configurable() const
@@ -115,12 +115,12 @@
{
if (!hasConfigurable())
return WTF::nullopt;
- return extractTriState(ConfigurableShift) == TrueTriState;
+ return extractTriState(ConfigurableShift) == TriState::True;
}
bool hasEnumerable() const
{
- return extractTriState(EnumerableShift) != MixedTriState;
+ return extractTriState(EnumerableShift) != TriState::Indeterminate;
}
Optional<bool> enumerable() const
@@ -127,22 +127,22 @@
{
if (!hasEnumerable())
return WTF::nullopt;
- return extractTriState(EnumerableShift) == TrueTriState;
+ return extractTriState(EnumerableShift) == TriState::True;
}
void setWritable(bool value)
{
- fillWithTriState(value ? TrueTriState : FalseTriState, WritableShift);
+ fillWithTriState(value ? TriState::True : TriState::False, WritableShift);
}
void setConfigurable(bool value)
{
- fillWithTriState(value ? TrueTriState : FalseTriState, ConfigurableShift);
+ fillWithTriState(value ? TriState::True : TriState::False, ConfigurableShift);
}
void setEnumerable(bool value)
{
- fillWithTriState(value ? TrueTriState : FalseTriState, EnumerableShift);
+ fillWithTriState(value ? TriState::True : TriState::False, EnumerableShift);
}
private:
@@ -149,7 +149,7 @@
void fillWithTriState(TriState state, unsigned shift)
{
unsigned mask = 0b11 << shift;
- m_attributes = (m_attributes & ~mask) | (state << shift);
+ m_attributes = (m_attributes & ~mask) | (static_cast<uint8_t>(state) << shift);
}
TriState extractTriState(unsigned shift) const
Modified: trunk/Source/_javascript_Core/runtime/IntlCollator.cpp (260983 => 260984)
--- trunk/Source/_javascript_Core/runtime/IntlCollator.cpp 2020-05-01 04:43:28 UTC (rev 260983)
+++ trunk/Source/_javascript_Core/runtime/IntlCollator.cpp 2020-05-01 05:38:06 UTC (rev 260984)
@@ -201,8 +201,8 @@
TriState numeric = intlBooleanOption(globalObject, options, vm.propertyNames->numeric);
RETURN_IF_EXCEPTION(scope, void());
- if (numeric != MixedTriState)
- opt.add("kn"_s, numeric == TrueTriState ? "true"_s : "false"_s);
+ if (numeric != TriState::Indeterminate)
+ opt.add("kn"_s, numeric == TriState::True ? "true"_s : "false"_s);
String caseFirstOption = intlStringOption(globalObject, options, vm.propertyNames->caseFirst, { "upper", "lower", "false" }, "caseFirst must be either \"upper\", \"lower\", or \"false\"", nullptr);
RETURN_IF_EXCEPTION(scope, void());
@@ -243,7 +243,7 @@
TriState ignorePunctuation = intlBooleanOption(globalObject, options, vm.propertyNames->ignorePunctuation);
RETURN_IF_EXCEPTION(scope, void());
- m_ignorePunctuation = (ignorePunctuation == TrueTriState);
+ m_ignorePunctuation = (ignorePunctuation == TriState::True);
UErrorCode status = U_ZERO_ERROR;
m_collator = std::unique_ptr<UCollator, UCollatorDeleter>(ucol_open(m_locale.utf8().data(), &status));
Modified: trunk/Source/_javascript_Core/runtime/IntlDateTimeFormat.cpp (260983 => 260984)
--- trunk/Source/_javascript_Core/runtime/IntlDateTimeFormat.cpp 2020-05-01 04:43:28 UTC (rev 260983)
+++ trunk/Source/_javascript_Core/runtime/IntlDateTimeFormat.cpp 2020-05-01 05:38:06 UTC (rev 260984)
@@ -468,7 +468,7 @@
TriState hour12 = intlBooleanOption(globalObject, options, vm.propertyNames->hour12);
RETURN_IF_EXCEPTION(scope, void());
- bool isHour12Undefined = (hour12 == MixedTriState);
+ bool isHour12Undefined = (hour12 == TriState::Indeterminate);
String hourCycle = intlStringOption(globalObject, options, vm.propertyNames->hourCycle, { "h11", "h12", "h23", "h24" }, "hourCycle must be \"h11\", \"h12\", \"h23\", or \"h24\"", nullptr);
RETURN_IF_EXCEPTION(scope, void());
@@ -582,7 +582,7 @@
if (hour == "2-digit") {
if (isHour12Undefined && m_hourCycle.isNull())
skeletonBuilder.appendLiteral("jj");
- else if (hour12 == TrueTriState)
+ else if (hour12 == TriState::True)
skeletonBuilder.appendLiteral("hh");
else
skeletonBuilder.appendLiteral("HH");
@@ -589,7 +589,7 @@
} else if (hour == "numeric") {
if (isHour12Undefined && m_hourCycle.isNull())
skeletonBuilder.append('j');
- else if (hour12 == TrueTriState)
+ else if (hour12 == TriState::True)
skeletonBuilder.append('h');
else
skeletonBuilder.append('H');
Modified: trunk/Source/_javascript_Core/runtime/IntlNumberFormat.cpp (260983 => 260984)
--- trunk/Source/_javascript_Core/runtime/IntlNumberFormat.cpp 2020-05-01 04:43:28 UTC (rev 260983)
+++ trunk/Source/_javascript_Core/runtime/IntlNumberFormat.cpp 2020-05-01 05:38:06 UTC (rev 260984)
@@ -283,7 +283,7 @@
TriState useGrouping = intlBooleanOption(globalObject, options, Identifier::fromString(vm, "useGrouping"));
RETURN_IF_EXCEPTION(scope, void());
- m_useGrouping = useGrouping != FalseTriState;
+ m_useGrouping = useGrouping != TriState::False;
UNumberFormatStyle style = UNUM_DEFAULT;
switch (m_style) {
Modified: trunk/Source/_javascript_Core/runtime/IntlObject.cpp (260983 => 260984)
--- trunk/Source/_javascript_Core/runtime/IntlObject.cpp 2020-05-01 04:43:28 UTC (rev 260983)
+++ trunk/Source/_javascript_Core/runtime/IntlObject.cpp 2020-05-01 05:38:06 UTC (rev 260984)
@@ -209,16 +209,16 @@
auto scope = DECLARE_THROW_SCOPE(vm);
if (options.isUndefined())
- return MixedTriState;
+ return TriState::Indeterminate;
JSObject* opts = options.toObject(globalObject);
- RETURN_IF_EXCEPTION(scope, MixedTriState);
+ RETURN_IF_EXCEPTION(scope, TriState::Indeterminate);
JSValue value = opts->get(globalObject, property);
- RETURN_IF_EXCEPTION(scope, MixedTriState);
+ RETURN_IF_EXCEPTION(scope, TriState::Indeterminate);
if (value.isUndefined())
- return MixedTriState;
+ return TriState::Indeterminate;
return triState(value.toBoolean(globalObject));
}
Modified: trunk/Source/_javascript_Core/runtime/JSCJSValueInlines.h (260983 => 260984)
--- trunk/Source/_javascript_Core/runtime/JSCJSValueInlines.h 2020-05-01 04:43:28 UTC (rev 260983)
+++ trunk/Source/_javascript_Core/runtime/JSCJSValueInlines.h 2020-05-01 05:38:06 UTC (rev 260984)
@@ -1262,7 +1262,7 @@
const StringImpl* v1String = asString(v1)->tryGetValueImpl();
const StringImpl* v2String = asString(v2)->tryGetValueImpl();
if (!v1String || !v2String)
- return MixedTriState;
+ return TriState::Indeterminate;
return triState(WTF::equal(*v1String, *v2String));
}
if (v1.asCell()->isHeapBigInt() && v2.asCell()->isHeapBigInt())
@@ -1275,16 +1275,16 @@
inline TriState JSValue::pureToBoolean() const
{
if (isInt32())
- return asInt32() ? TrueTriState : FalseTriState;
+ return asInt32() ? TriState::True : TriState::False;
if (isDouble())
- return isNotZeroAndOrdered(asDouble()) ? TrueTriState : FalseTriState; // false for NaN
+ return isNotZeroAndOrdered(asDouble()) ? TriState::True : TriState::False; // false for NaN
if (isCell())
return asCell()->pureToBoolean();
#if USE(BIGINT32)
if (isBigInt32())
- return bigInt32AsInt32() ? TrueTriState : FalseTriState;
+ return bigInt32AsInt32() ? TriState::True : TriState::False;
#endif
- return isTrue() ? TrueTriState : FalseTriState;
+ return isTrue() ? TriState::True : TriState::False;
}
ALWAYS_INLINE bool JSValue::requireObjectCoercible(JSGlobalObject* globalObject) const
Modified: trunk/Source/_javascript_Core/runtime/JSCellInlines.h (260983 => 260984)
--- trunk/Source/_javascript_Core/runtime/JSCellInlines.h 2020-05-01 04:43:28 UTC (rev 260983)
+++ trunk/Source/_javascript_Core/runtime/JSCellInlines.h 2020-05-01 05:38:06 UTC (rev 260984)
@@ -330,12 +330,12 @@
inline TriState JSCell::pureToBoolean() const
{
if (isString())
- return static_cast<const JSString*>(this)->toBoolean() ? TrueTriState : FalseTriState;
+ return static_cast<const JSString*>(this)->toBoolean() ? TriState::True : TriState::False;
if (isHeapBigInt())
- return static_cast<const JSBigInt*>(this)->toBoolean() ? TrueTriState : FalseTriState;
+ return static_cast<const JSBigInt*>(this)->toBoolean() ? TriState::True : TriState::False;
if (isSymbol())
- return TrueTriState;
- return MixedTriState;
+ return TriState::True;
+ return TriState::Indeterminate;
}
inline void JSCellLock::lock()
Modified: trunk/Source/WTF/ChangeLog (260983 => 260984)
--- trunk/Source/WTF/ChangeLog 2020-05-01 04:43:28 UTC (rev 260983)
+++ trunk/Source/WTF/ChangeLog 2020-05-01 05:38:06 UTC (rev 260984)
@@ -1,3 +1,15 @@
+2020-04-30 Ross Kirsling <ross.kirsl...@sony.com>
+
+ TriState should be an enum class and use "Indeterminate" instead of "Mixed"
+ https://bugs.webkit.org/show_bug.cgi?id=211268
+
+ Reviewed by Mark Lam.
+
+ The word "indeterminate" comes from boost::tribool.
+ A third state is generally not "mixed" but rather unknown.
+
+ * wtf/TriState.h:
+
2020-04-29 Fujii Hironori <hironori.fu...@sony.com>
[Win] Deadlock in WTF::Thread::didExit() while WebKitNetworkProcess.exe is exiting
Modified: trunk/Source/WTF/wtf/TriState.h (260983 => 260984)
--- trunk/Source/WTF/wtf/TriState.h 2020-05-01 04:43:28 UTC (rev 260983)
+++ trunk/Source/WTF/wtf/TriState.h 2020-05-01 05:38:06 UTC (rev 260984)
@@ -27,10 +27,10 @@
namespace WTF {
-enum TriState : uint8_t {
- FalseTriState,
- TrueTriState,
- MixedTriState
+enum class TriState : uint8_t {
+ False,
+ True,
+ Indeterminate
};
inline TriState triState(bool boolean)
@@ -41,7 +41,4 @@
}
using WTF::TriState;
-using WTF::FalseTriState;
-using WTF::TrueTriState;
-using WTF::MixedTriState;
using WTF::triState;
Modified: trunk/Source/WebCore/ChangeLog (260983 => 260984)
--- trunk/Source/WebCore/ChangeLog 2020-05-01 04:43:28 UTC (rev 260983)
+++ trunk/Source/WebCore/ChangeLog 2020-05-01 05:38:06 UTC (rev 260984)
@@ -1,3 +1,30 @@
+2020-04-30 Ross Kirsling <ross.kirsl...@sony.com>
+
+ TriState should be an enum class and use "Indeterminate" instead of "Mixed"
+ https://bugs.webkit.org/show_bug.cgi?id=211268
+
+ Reviewed by Mark Lam.
+
+ * dom/Document.cpp:
+ (WebCore::Document::queryCommandIndeterm):
+ (WebCore::Document::queryCommandState):
+ * editing/EditingStyle.cpp:
+ (WebCore::EditingStyle::triStateOfStyle const):
+ (WebCore::EditingStyle::hasStyle):
+ * editing/Editor.cpp:
+ (WebCore::Editor::selectionUnorderedListState const):
+ (WebCore::Editor::selectionOrderedListState const):
+ * editing/EditorCommand.cpp:
+ (WebCore::isStylePresent):
+ (WebCore::stateStyle):
+ (WebCore::stateTextWritingDirection):
+ (WebCore::stateNone):
+ (WebCore::stateStyleWithCSS):
+ (WebCore::Editor::Command::state const):
+ (WebCore::Editor::Command::value const):
+ * page/ContextMenuController.cpp:
+ (WebCore::ContextMenuController::checkOrEnableIfNeeded const):
+
2020-04-30 Simon Fraser <simon.fra...@apple.com>
Clean up some EventHandler coordinate-related naming and fix ScrollableArea::lastKnownMousePosition() conversions
Modified: trunk/Source/WebCore/dom/Document.cpp (260983 => 260984)
--- trunk/Source/WebCore/dom/Document.cpp 2020-05-01 04:43:28 UTC (rev 260983)
+++ trunk/Source/WebCore/dom/Document.cpp 2020-05-01 05:38:06 UTC (rev 260984)
@@ -5558,12 +5558,12 @@
bool Document::queryCommandIndeterm(const String& commandName)
{
- return command(this, commandName).state() == MixedTriState;
+ return command(this, commandName).state() == TriState::Indeterminate;
}
bool Document::queryCommandState(const String& commandName)
{
- return command(this, commandName).state() == TrueTriState;
+ return command(this, commandName).state() == TriState::True;
}
bool Document::queryCommandSupported(const String& commandName)
Modified: trunk/Source/WebCore/editing/EditingStyle.cpp (260983 => 260984)
--- trunk/Source/WebCore/editing/EditingStyle.cpp 2020-05-01 04:43:28 UTC (rev 260983)
+++ trunk/Source/WebCore/editing/EditingStyle.cpp 2020-05-01 05:38:06 UTC (rev 260984)
@@ -752,7 +752,7 @@
TriState EditingStyle::triStateOfStyle(EditingStyle* style) const
{
if (!style || !style->m_mutableStyle)
- return FalseTriState;
+ return TriState::False;
return triStateOfStyle(*style->m_mutableStyle, DoNotIgnoreTextOnlyProperties);
}
@@ -760,7 +760,7 @@
TriState EditingStyle::triStateOfStyle(T& styleToCompare, ShouldIgnoreTextOnlyProperties shouldIgnoreTextOnlyProperties) const
{
if (!m_mutableStyle)
- return TrueTriState;
+ return TriState::True;
RefPtr<MutableStyleProperties> difference = getPropertiesNotIn(*m_mutableStyle, styleToCompare);
@@ -768,22 +768,22 @@
difference->removePropertiesInSet(textOnlyProperties, WTF_ARRAY_LENGTH(textOnlyProperties));
if (difference->isEmpty())
- return TrueTriState;
+ return TriState::True;
if (difference->propertyCount() == m_mutableStyle->propertyCount())
- return FalseTriState;
+ return TriState::False;
- return MixedTriState;
+ return TriState::Indeterminate;
}
TriState EditingStyle::triStateOfStyle(const VisibleSelection& selection) const
{
if (!selection.isCaretOrRange())
- return FalseTriState;
+ return TriState::False;
if (selection.isCaret())
return triStateOfStyle(EditingStyle::styleAtSelectionStart(selection).get());
- TriState state = FalseTriState;
+ TriState state = TriState::False;
bool nodeIsStart = true;
for (Node* node = selection.start().deprecatedNode(); node; node = NodeTraversal::next(*node)) {
if (node->renderer() && node->hasEditableStyle()) {
@@ -793,7 +793,7 @@
state = nodeState;
nodeIsStart = false;
} else if (state != nodeState && node->isTextNode()) {
- state = MixedTriState;
+ state = TriState::Indeterminate;
break;
}
}
@@ -1482,7 +1482,7 @@
bool EditingStyle::hasStyle(CSSPropertyID propertyID, const String& value)
{
- return EditingStyle::create(propertyID, value)->triStateOfStyle(this) != FalseTriState;
+ return EditingStyle::create(propertyID, value)->triStateOfStyle(this) != TriState::False;
}
RefPtr<EditingStyle> EditingStyle::styleAtSelectionStart(const VisibleSelection& selection, bool shouldUseBackgroundColorInEffect)
Modified: trunk/Source/WebCore/editing/Editor.cpp (260983 => 260984)
--- trunk/Source/WebCore/editing/Editor.cpp 2020-05-01 04:43:28 UTC (rev 260983)
+++ trunk/Source/WebCore/editing/Editor.cpp 2020-05-01 05:38:06 UTC (rev 260984)
@@ -814,15 +814,15 @@
{
if (m_document.selection().isCaret()) {
if (enclosingElementWithTag(m_document.selection().selection().start(), ulTag))
- return TrueTriState;
+ return TriState::True;
} else if (m_document.selection().isRange()) {
auto* startNode = enclosingElementWithTag(m_document.selection().selection().start(), ulTag);
auto* endNode = enclosingElementWithTag(m_document.selection().selection().end(), ulTag);
if (startNode && endNode && startNode == endNode)
- return TrueTriState;
+ return TriState::True;
}
- return FalseTriState;
+ return TriState::False;
}
TriState Editor::selectionOrderedListState() const
@@ -829,15 +829,15 @@
{
if (m_document.selection().isCaret()) {
if (enclosingElementWithTag(m_document.selection().selection().start(), olTag))
- return TrueTriState;
+ return TriState::True;
} else if (m_document.selection().isRange()) {
auto* startNode = enclosingElementWithTag(m_document.selection().selection().start(), olTag);
auto* endNode = enclosingElementWithTag(m_document.selection().selection().end(), olTag);
if (startNode && endNode && startNode == endNode)
- return TrueTriState;
+ return TriState::True;
}
- return FalseTriState;
+ return TriState::False;
}
RefPtr<Node> Editor::insertOrderedList()
Modified: trunk/Source/WebCore/editing/EditorCommand.cpp (260983 => 260984)
--- trunk/Source/WebCore/editing/EditorCommand.cpp 2020-05-01 04:43:28 UTC (rev 260983)
+++ trunk/Source/WebCore/editing/EditorCommand.cpp 2020-05-01 05:38:06 UTC (rev 260984)
@@ -121,7 +121,7 @@
// Windows: present throughout the selection
if (editor.behavior().shouldToggleStyleBasedOnStartOfSelection())
return editor.selectionStartHasStyle(propertyID, onValue);
- return editor.selectionHasStyle(propertyID, onValue) == TrueTriState;
+ return editor.selectionHasStyle(propertyID, onValue) == TriState::True;
}
static bool executeApplyStyle(Frame& frame, EditorCommandSource source, EditAction action, CSSPropertyID propertyID, const String& propertyValue)
@@ -191,7 +191,7 @@
static TriState stateStyle(Frame& frame, CSSPropertyID propertyID, const char* desiredValue)
{
if (frame.editor().behavior().shouldToggleStyleBasedOnStartOfSelection())
- return frame.editor().selectionStartHasStyle(propertyID, desiredValue) ? TrueTriState : FalseTriState;
+ return frame.editor().selectionStartHasStyle(propertyID, desiredValue) ? TriState::True : TriState::False;
return frame.editor().selectionHasStyle(propertyID, desiredValue);
}
@@ -207,8 +207,8 @@
bool hasNestedOrMultipleEmbeddings;
WritingDirection selectionDirection = EditingStyle::textDirectionForSelection(frame.selection().selection(),
frame.selection().typingStyle(), hasNestedOrMultipleEmbeddings);
- // FXIME: We should be returning MixedTriState when selectionDirection == direction && hasNestedOrMultipleEmbeddings
- return (selectionDirection == direction && !hasNestedOrMultipleEmbeddings) ? TrueTriState : FalseTriState;
+ // FXIME: We should be returning TriState::Indeterminate when selectionDirection == direction && hasNestedOrMultipleEmbeddings
+ return (selectionDirection == direction && !hasNestedOrMultipleEmbeddings) ? TriState::True : TriState::False;
}
static unsigned verticalScrollDistance(Frame& frame)
@@ -1438,7 +1438,7 @@
static TriState stateNone(Frame&, Event*)
{
- return FalseTriState;
+ return TriState::False;
}
static TriState stateBold(Frame& frame, Event*)
@@ -1463,7 +1463,7 @@
static TriState stateStyleWithCSS(Frame& frame, Event*)
{
- return frame.editor().shouldStyleWithCSS() ? TrueTriState : FalseTriState;
+ return frame.editor().shouldStyleWithCSS() ? TriState::True : TriState::False;
}
static TriState stateSubscript(Frame& frame, Event*)
@@ -1906,7 +1906,7 @@
TriState Editor::Command::state(Event* triggeringEvent) const
{
if (!isSupported() || !m_frame)
- return FalseTriState;
+ return TriState::False;
return m_command->state(*m_frame, triggeringEvent);
}
@@ -1915,7 +1915,7 @@
if (!isSupported() || !m_frame)
return String();
if (m_command->value == valueNull && m_command->state != stateNone)
- return m_command->state(*m_frame, triggeringEvent) == TrueTriState ? "true"_s : "false"_s;
+ return m_command->state(*m_frame, triggeringEvent) == TriState::True ? "true"_s : "false"_s;
return m_command->value(*m_frame, triggeringEvent);
}
Modified: trunk/Source/WebCore/page/ContextMenuController.cpp (260983 => 260984)
--- trunk/Source/WebCore/page/ContextMenuController.cpp 2020-05-01 04:43:28 UTC (rev 260983)
+++ trunk/Source/WebCore/page/ContextMenuController.cpp 2020-05-01 05:38:06 UTC (rev 260984)
@@ -1172,25 +1172,25 @@
case ContextMenuItemTagLeftToRight:
case ContextMenuItemTagRightToLeft: {
String direction = item.action() == ContextMenuItemTagLeftToRight ? "ltr" : "rtl";
- shouldCheck = frame->editor().selectionHasStyle(CSSPropertyDirection, direction) != FalseTriState;
+ shouldCheck = frame->editor().selectionHasStyle(CSSPropertyDirection, direction) != TriState::False;
shouldEnable = true;
break;
}
case ContextMenuItemTagTextDirectionDefault: {
Editor::Command command = frame->editor().command("MakeTextWritingDirectionNatural");
- shouldCheck = command.state() == TrueTriState;
+ shouldCheck = command.state() == TriState::True;
shouldEnable = command.isEnabled();
break;
}
case ContextMenuItemTagTextDirectionLeftToRight: {
Editor::Command command = frame->editor().command("MakeTextWritingDirectionLeftToRight");
- shouldCheck = command.state() == TrueTriState;
+ shouldCheck = command.state() == TriState::True;
shouldEnable = command.isEnabled();
break;
}
case ContextMenuItemTagTextDirectionRightToLeft: {
Editor::Command command = frame->editor().command("MakeTextWritingDirectionRightToLeft");
- shouldCheck = command.state() == TrueTriState;
+ shouldCheck = command.state() == TriState::True;
shouldEnable = command.isEnabled();
break;
}
@@ -1231,7 +1231,7 @@
break;
#endif
case ContextMenuItemTagUnderline: {
- shouldCheck = frame->editor().selectionHasStyle(CSSPropertyWebkitTextDecorationsInEffect, "underline") != FalseTriState;
+ shouldCheck = frame->editor().selectionHasStyle(CSSPropertyWebkitTextDecorationsInEffect, "underline") != TriState::False;
shouldEnable = frame->editor().canEditRichly();
break;
}
@@ -1244,12 +1244,12 @@
shouldEnable = true;
break;
case ContextMenuItemTagItalic: {
- shouldCheck = frame->editor().selectionHasStyle(CSSPropertyFontStyle, "italic") != FalseTriState;
+ shouldCheck = frame->editor().selectionHasStyle(CSSPropertyFontStyle, "italic") != TriState::False;
shouldEnable = frame->editor().canEditRichly();
break;
}
case ContextMenuItemTagBold: {
- shouldCheck = frame->editor().selectionHasStyle(CSSPropertyFontWeight, "bold") != FalseTriState;
+ shouldCheck = frame->editor().selectionHasStyle(CSSPropertyFontWeight, "bold") != TriState::False;
shouldEnable = frame->editor().canEditRichly();
break;
}
Modified: trunk/Source/WebKit/ChangeLog (260983 => 260984)
--- trunk/Source/WebKit/ChangeLog 2020-05-01 04:43:28 UTC (rev 260983)
+++ trunk/Source/WebKit/ChangeLog 2020-05-01 05:38:06 UTC (rev 260984)
@@ -1,3 +1,16 @@
+2020-04-30 Ross Kirsling <ross.kirsl...@sony.com>
+
+ TriState should be an enum class and use "Indeterminate" instead of "Mixed"
+ https://bugs.webkit.org/show_bug.cgi?id=211268
+
+ Reviewed by Mark Lam.
+
+ * WebProcess/WebPage/WebPage.cpp:
+ (WebKit::WebPage::validateCommand):
+
+ * WebProcess/WebPage/glib/WebPageGLib.cpp:
+ (WebKit::WebPage::getPlatformEditorState const):
+
2020-04-30 Jiewen Tan <jiewen_...@apple.com>
[WebAuthn] Require user gestures for LocalAuthenticator
Modified: trunk/Source/WebKit/WebProcess/WebPage/WebPage.cpp (260983 => 260984)
--- trunk/Source/WebKit/WebProcess/WebPage/WebPage.cpp 2020-05-01 04:43:28 UTC (rev 260983)
+++ trunk/Source/WebKit/WebProcess/WebPage/WebPage.cpp 2020-05-01 05:38:06 UTC (rev 260984)
@@ -2835,7 +2835,7 @@
isEnabled = pluginView->isEditingCommandEnabled(commandName);
else {
Editor::Command command = frame.editor().command(commandName);
- state = command.state();
+ state = (command.state() != TriState::False);
isEnabled = command.isSupported() && command.isEnabled();
}
Modified: trunk/Source/WebKit/WebProcess/WebPage/glib/WebPageGLib.cpp (260983 => 260984)
--- trunk/Source/WebKit/WebProcess/WebPage/glib/WebPageGLib.cpp 2020-05-01 04:43:28 UTC (rev 260983)
+++ trunk/Source/WebKit/WebProcess/WebPage/glib/WebPageGLib.cpp 2020-05-01 05:38:06 UTC (rev 260984)
@@ -83,13 +83,13 @@
#if PLATFORM(GTK)
const Editor& editor = frame.editor();
if (selection.isRange()) {
- if (editor.selectionHasStyle(CSSPropertyFontWeight, "bold") == TrueTriState)
+ if (editor.selectionHasStyle(CSSPropertyFontWeight, "bold") == TriState::True)
postLayoutData.typingAttributes |= AttributeBold;
- if (editor.selectionHasStyle(CSSPropertyFontStyle, "italic") == TrueTriState)
+ if (editor.selectionHasStyle(CSSPropertyFontStyle, "italic") == TriState::True)
postLayoutData.typingAttributes |= AttributeItalics;
- if (editor.selectionHasStyle(CSSPropertyWebkitTextDecorationsInEffect, "underline") == TrueTriState)
+ if (editor.selectionHasStyle(CSSPropertyWebkitTextDecorationsInEffect, "underline") == TriState::True)
postLayoutData.typingAttributes |= AttributeUnderline;
- if (editor.selectionHasStyle(CSSPropertyWebkitTextDecorationsInEffect, "line-through") == TrueTriState)
+ if (editor.selectionHasStyle(CSSPropertyWebkitTextDecorationsInEffect, "line-through") == TriState::True)
postLayoutData.typingAttributes |= AttributeStrikeThrough;
} else if (selection.isCaret()) {
if (editor.selectionStartHasStyle(CSSPropertyFontWeight, "bold"))
Modified: trunk/Source/WebKitLegacy/mac/ChangeLog (260983 => 260984)
--- trunk/Source/WebKitLegacy/mac/ChangeLog 2020-05-01 04:43:28 UTC (rev 260983)
+++ trunk/Source/WebKitLegacy/mac/ChangeLog 2020-05-01 05:38:06 UTC (rev 260984)
@@ -1,3 +1,14 @@
+2020-04-30 Ross Kirsling <ross.kirsl...@sony.com>
+
+ TriState should be an enum class and use "Indeterminate" instead of "Mixed"
+ https://bugs.webkit.org/show_bug.cgi?id=211268
+
+ Reviewed by Mark Lam.
+
+ * WebView/WebHTMLView.mm:
+ (kit):
+ (-[WebHTMLView validateUserInterfaceItemWithoutDelegate:]):
+
2020-04-30 Antoine Quint <grao...@apple.com>
Remove -[WebView setCSSAnimationsSuspended:]
Modified: trunk/Source/WebKitLegacy/mac/WebView/WebHTMLView.mm (260983 => 260984)
--- trunk/Source/WebKitLegacy/mac/WebView/WebHTMLView.mm 2020-05-01 04:43:28 UTC (rev 260983)
+++ trunk/Source/WebKitLegacy/mac/WebView/WebHTMLView.mm 2020-05-01 05:38:06 UTC (rev 260984)
@@ -1013,12 +1013,12 @@
static NSControlStateValue kit(TriState state)
{
switch (state) {
- case FalseTriState:
- return NSControlStateValueOff;
- case TrueTriState:
- return NSControlStateValueOn;
- case MixedTriState:
- return NSControlStateValueMixed;
+ case TriState::False:
+ return NSControlStateValueOff;
+ case TriState::True:
+ return NSControlStateValueOn;
+ case TriState::Indeterminate:
+ return NSControlStateValueMixed;
}
ASSERT_NOT_REACHED();
return NSControlStateValueOff;
@@ -2948,7 +2948,7 @@
NSMenuItem *menuItem = (NSMenuItem *)item;
if ([menuItem isKindOfClass:[NSMenuItem class]]) {
String direction = writingDirection == NSWritingDirectionLeftToRight ? "ltr" : "rtl";
- [menuItem setState:frame->editor().selectionHasStyle(WebCore::CSSPropertyDirection, direction)];
+ [menuItem setState:(frame->editor().selectionHasStyle(WebCore::CSSPropertyDirection, direction) != TriState::False)];
}
return [self _canEdit];
}
@@ -2965,7 +2965,7 @@
if ([menuItem isKindOfClass:[NSMenuItem class]]) {
// Take control of the title of the menu item instead of just checking/unchecking it because
// a check would be ambiguous.
- [menuItem setTitle:frame->editor().selectionHasStyle(WebCore::CSSPropertyDirection, "rtl")
+ [menuItem setTitle:(frame->editor().selectionHasStyle(WebCore::CSSPropertyDirection, "rtl") != TriState::False)
? UI_STRING_INTERNAL("Left to Right", "Left to Right context menu item")
: UI_STRING_INTERNAL("Right to Left", "Right to Left context menu item")];
}