Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
Intermittent removal of adoptedStyleSheet CSSStyleSheet instances whe…
…n assigning adoptedStyleSheet array https://bugs.webkit.org/show_bug.cgi?id=254844 rdar://107768559 Reviewed by Mark Lam. JSObservableArray is using ArrayClass, but this is wrong: this is not implementing what Array in DFG etc. requires. As a result, DFG attempt to read length in the same way to normal array, and it just reads empty butterfly. 1. JSObservableArray must not say ArrayClass. ArrayClass is more strict form (like, ArrayType), and DerivedArray normally should not use it. 2. We also fix NPAPI's half-broken RuntimeArray's ArrayClass to NonArray. 3. We also change iteration protocol to consider this new scheme: we should only allow fast iteration for normal pure JSArray. * JSTests/stress/spread-for-runtime-array.js: Added. (shouldBe): (test): * Source/JavaScriptCore/dfg/DFGByteCodeParser.cpp: (JSC::DFG::ByteCodeParser::parseBlock): * Source/JavaScriptCore/runtime/CommonSlowPaths.cpp: (JSC::iteratorNextTryFastImpl): * Source/JavaScriptCore/runtime/IteratorOperations.cpp: (JSC::getIterationMode): * Source/JavaScriptCore/runtime/JSGenericTypedArrayViewConstructorInlines.h: (JSC::constructGenericTypedArrayViewWithArguments): * Source/JavaScriptCore/runtime/JSGenericTypedArrayViewInlines.h: (JSC::JSGenericTypedArrayView<Adaptor>::setFromArrayLike): * Source/JavaScriptCore/runtime/JSGenericTypedArrayViewPrototypeFunctions.h: (JSC::genericTypedArrayViewPrivateFuncFromFast): * Source/JavaScriptCore/tools/JSDollarVM.cpp: * Source/WebCore/bindings/js/JSObservableArray.h: * Source/WebCore/bridge/runtime_array.h: Canonical link: https://commits.webkit.org/266464@main
- Loading branch information
1 parent
1989bf2
commit a347abe
Showing
10 changed files
with
46 additions
and
10 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
function shouldBe(actual, expected) { | ||
if (actual !== expected) | ||
throw new Error('bad value: ' + actual); | ||
} | ||
|
||
var list = [ | ||
[0, 1, 2, 3, 4, 5], | ||
[], | ||
["Hello", "World"], | ||
]; | ||
|
||
for (var i = 0; i < 1e4; ++i) { | ||
for (var array of list) { | ||
$vm.ensureArrayStorage(array); | ||
array.hey = 42; | ||
var iterator = array[Symbol.iterator](); | ||
while (!iterator.next().done); | ||
} | ||
} | ||
|
||
var runtimeArray = $vm.createRuntimeArray(0, 1, 2, 3, 4, 5, 6); | ||
runtimeArray[10] = "Hello"; | ||
shouldBe(runtimeArray[10], "Hello"); | ||
|
||
function test(runtimeArray) | ||
{ | ||
var array = [...runtimeArray]; | ||
shouldBe(array.length, 7); | ||
} | ||
noInline(test); | ||
|
||
for (var i = 0; i < 1e5; ++i) | ||
test(runtimeArray); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
a347abe
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi colleagues, @Constellation, my team is also interested in getting this fix.
Do you already know when will it be released, in which version?