You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit d4c4d4b
Browse filesBrowse the repository at this point in the historyBrowse files
[JSC] Add Array::OriginalArray DFG::ArrayMode, which can handle both CoW array and non-CoW array
https://bugs.webkit.org/show_bug.cgi?id=272259
rdar://125997646
Reviewed by Alexey Shvayka.
This extends DFG::ArrayMode and introduces OriginalArray. And we rename old OriginalArray to OriginalNonCopyOnWriteArray.
OriginalArray can handle both CoW and non-CoW original arrays. The purpose of this is telling DFG / FTL that we still see original arrays.
This allows some of optimizations because it makes clobberising rules more precise.
* Source/JavaScriptCore/bytecode/StructureSet.h:
* Source/JavaScriptCore/dfg/DFGArrayMode.cpp:
(JSC::DFG::ArrayMode::originalArrayStructures const):
(JSC::DFG::ArrayMode::alreadyChecked const):
(JSC::DFG::arrayClassToString):
(JSC::DFG::ArrayMode::originalArrayStructure const): Deleted.
* Source/JavaScriptCore/dfg/DFGArrayMode.h:
(JSC::DFG::ArrayMode::withProfile const):
(JSC::DFG::ArrayMode::isJSArray const):
(JSC::DFG::ArrayMode::isJSArrayWithOriginalStructure const):
(JSC::DFG::ArrayMode::arrayModesWithIndexingShapes const):
* Source/JavaScriptCore/dfg/DFGFixupPhase.cpp:
(JSC::DFG::FixupPhase::checkArray):
* Source/JavaScriptCore/dfg/DFGSpeculativeJIT.cpp:
(JSC::DFG::SpeculativeJIT::jumpSlowForUnwantedArrayMode):
* Source/JavaScriptCore/ftl/FTLLowerDFGToB3.cpp:
(JSC::FTL::DFG::LowerDFGToB3::compileCompareStrictEq):
Canonical link: https://commits.webkit.org/277174@main
// If ArrayMode is Array::OriginalCopyOnWriteArray or Array::OriginalArray, CheckArray is never emitted. Instead, we always emit CheckStructure.
508
+
// If ArrayMode is Array::OriginalArray, Array::OriginalCopyOnWriteArray, or Array::OriginalNonCopyOnWriteArray, CheckArray is never emitted. Instead, we always emit CheckStructure.
478
509
// So, we should perform the same check to the CheckStructure here.
Copy file name to clipboardExpand all lines: Source/JavaScriptCore/dfg/DFGArrayMode.h
+18-8Lines changed: 18 additions & 8 deletions
Original file line number
Diff line number
Diff line change
@@ -29,6 +29,7 @@
29
29
30
30
#include"ArrayProfile.h"
31
31
#include"SpeculatedType.h"
32
+
#include"StructureSet.h"
32
33
33
34
namespaceJSC {
34
35
@@ -85,7 +86,8 @@ enum Class : uint8_t {
85
86
NonArray, // Definitely some object that is not a JSArray.
86
87
OriginalNonArray, // Definitely some object that is not a JSArray, but that object has the original structure.
87
88
Array, // Definitely a JSArray, and may or may not have custom properties or have undergone some other bizarre transitions.
88
-
OriginalArray, // Definitely a JSArray, and still has one of the primordial JSArray structures for the global object that this code block (possibly inlined code block) belongs to.
89
+
OriginalArray, // Definitely a JSArray, and still has one of the primordial JSArray structures and/or copy on write structures for the global object that this code block (possibly inlined code block) belongs to.
90
+
OriginalNonCopyOnWriteArray, // Definitely a JSArray, and still has one of the primordial JSArray structures for the global object that this code block (possibly inlined code block) belongs to.
89
91
OriginalCopyOnWriteArray, // Definitely a copy on write JSArray, and still has one of the primordial JSArray copy on write structures for the global object that this code block (possibly inlined code block) belongs to.
90
92
PossiblyArray // Some object that may or may not be a JSArray.
91
93
};
@@ -241,9 +243,9 @@ class ArrayMode {
241
243
if (hasSeenCopyOnWriteArray(arrayModes) && !hasSeenWritableArray(arrayModes))
0 commit comments