Skip to content

Commit

Permalink
Merged r241753 - Fix DFG doesGC() for CompareEq/Less/LessEq/Greater/G…
Browse files Browse the repository at this point in the history
…reaterEq and CompareStrictEq nodes.

https://bugs.webkit.org/show_bug.cgi?id=194800
<rdar://problem/48183773>

Reviewed by Yusuke Suzuki.

Fix doesGC() for the following nodes:

    CompareEq:
    CompareLess:
    CompareLessEq:
    CompareGreater:
    CompareGreaterEq:
    CompareStrictEq:
        Only return false (i.e. does not GC) for child node use kinds that have
        been vetted to not do anything that can GC.  For all other use kinds
        (including StringUse and BigIntUse), we return true (i.e. does GC).

* dfg/DFGDoesGC.cpp:
(JSC::DFG::doesGC):
  • Loading branch information
aperezdc committed Feb 22, 2019
1 parent 793d4ed commit d401f62
Show file tree
Hide file tree
Showing 2 changed files with 63 additions and 6 deletions.
23 changes: 23 additions & 0 deletions Source/JavaScriptCore/ChangeLog
@@ -1,3 +1,26 @@
2019-02-18 Mark Lam <mark.lam@apple.com>

Fix DFG doesGC() for CompareEq/Less/LessEq/Greater/GreaterEq and CompareStrictEq nodes.
https://bugs.webkit.org/show_bug.cgi?id=194800
<rdar://problem/48183773>

Reviewed by Yusuke Suzuki.

Fix doesGC() for the following nodes:

CompareEq:
CompareLess:
CompareLessEq:
CompareGreater:
CompareGreaterEq:
CompareStrictEq:
Only return false (i.e. does not GC) for child node use kinds that have
been vetted to not do anything that can GC. For all other use kinds
(including StringUse and BigIntUse), we return true (i.e. does GC).

* dfg/DFGDoesGC.cpp:
(JSC::DFG::doesGC):

2019-01-09 Mark Lam <mark.lam@apple.com>

Gigacage disabling checks should handle the GIGACAGE_ALLOCATION_CAN_FAIL case properly.
Expand Down
46 changes: 40 additions & 6 deletions Source/JavaScriptCore/dfg/DFGDoesGC.cpp
Expand Up @@ -146,14 +146,8 @@ bool doesGC(Graph& graph, Node* node)
case RegExpTest:
case RegExpMatchFast:
case RegExpMatchFastGlobal:
case CompareLess:
case CompareLessEq:
case CompareGreater:
case CompareGreaterEq:
case CompareBelow:
case CompareBelowEq:
case CompareEq:
case CompareStrictEq:
case CompareEqPtr:
case SameValue:
case Call:
Expand Down Expand Up @@ -374,6 +368,46 @@ bool doesGC(Graph& graph, Node* node)
case MapSet:
return true;

case CompareEq:
case CompareLess:
case CompareLessEq:
case CompareGreater:
case CompareGreaterEq:
if (node->isBinaryUseKind(Int32Use)
#if USE(JSVALUE64)
|| node->isBinaryUseKind(Int52RepUse)
#endif
|| node->isBinaryUseKind(DoubleRepUse)
|| node->isBinaryUseKind(StringIdentUse)
)
return false;
if (node->op() == CompareEq) {
if (node->isBinaryUseKind(BooleanUse)
|| node->isBinaryUseKind(SymbolUse)
|| node->isBinaryUseKind(ObjectUse)
|| node->isBinaryUseKind(ObjectUse, ObjectOrOtherUse) || node->isBinaryUseKind(ObjectOrOtherUse, ObjectUse))
return false;
}
return true;

case CompareStrictEq:
if (node->isBinaryUseKind(BooleanUse)
|| node->isBinaryUseKind(Int32Use)
#if USE(JSVALUE64)
|| node->isBinaryUseKind(Int52RepUse)
#endif
|| node->isBinaryUseKind(DoubleRepUse)
|| node->isBinaryUseKind(SymbolUse)
|| node->isBinaryUseKind(SymbolUse, UntypedUse)
|| node->isBinaryUseKind(UntypedUse, SymbolUse)
|| node->isBinaryUseKind(StringIdentUse)
|| node->isBinaryUseKind(ObjectUse, UntypedUse) || node->isBinaryUseKind(UntypedUse, ObjectUse)
|| node->isBinaryUseKind(ObjectUse)
|| node->isBinaryUseKind(MiscUse, UntypedUse) || node->isBinaryUseKind(UntypedUse, MiscUse)
|| node->isBinaryUseKind(StringIdentUse, NotStringVarUse) || node->isBinaryUseKind(NotStringVarUse, StringIdentUse))
return false;
return true;

case GetIndexedPropertyStorage:
if (node->arrayMode().type() == Array::String)
return true;
Expand Down

0 comments on commit d401f62

Please sign in to comment.