WebKit Bugzilla
Attachment 339581 Details for
Bug 185309
: isCacheableArrayLength should return true for undecided arrays
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
Patch
bug-185309-20180504121355.patch (text/plain), 2.73 KB, created by
Keith Miller
on 2018-05-04 12:13:56 PDT
(
hide
)
Description:
Patch
Filename:
MIME Type:
Creator:
Keith Miller
Created:
2018-05-04 12:13:56 PDT
Size:
2.73 KB
patch
obsolete
>Subversion Revision: 231332 >diff --git a/Source/JavaScriptCore/ChangeLog b/Source/JavaScriptCore/ChangeLog >index 1a4e189677fa9870786d51e468622ca1e4a3acb8..727c2cd441c590ae72456c7882d9d495800ef159 100644 >--- a/Source/JavaScriptCore/ChangeLog >+++ b/Source/JavaScriptCore/ChangeLog >@@ -1,3 +1,16 @@ >+2018-05-04 Keith Miller <keith_miller@apple.com> >+ >+ isCacheableArrayLength should return true for undecided arrays >+ https://bugs.webkit.org/show_bug.cgi?id=185309 >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ Undecided arrays have butterflies so there is no reason why we >+ should not be able to cache their length. >+ >+ * bytecode/InlineAccess.cpp: >+ (JSC::InlineAccess::isCacheableArrayLength): >+ > 2018-05-03 Keith Miller <keith_miller@apple.com> > > Unreviewed, fix 32-bit profile offset for change in bytecode >diff --git a/Source/JavaScriptCore/bytecode/InlineAccess.cpp b/Source/JavaScriptCore/bytecode/InlineAccess.cpp >index d3dcfe0347550b2f04809089b1edbdfc81cb8628..9130b1e25d44e6635817ea78a483ef8cad679790 100644 >--- a/Source/JavaScriptCore/bytecode/InlineAccess.cpp >+++ b/Source/JavaScriptCore/bytecode/InlineAccess.cpp >@@ -249,9 +249,7 @@ bool InlineAccess::isCacheableArrayLength(StructureStubInfo& stubInfo, JSArray* > if (!hasFreeRegister(stubInfo)) > return false; > >- return array->indexingType() == ArrayWithInt32 >- || array->indexingType() == ArrayWithDouble >- || array->indexingType() == ArrayWithContiguous; >+ return !hasAnyArrayStorage(array->indexingType()) && array->indexingType() != ArrayClass; > } > > bool InlineAccess::generateArrayLength(StructureStubInfo& stubInfo, JSArray* array) >diff --git a/JSTests/ChangeLog b/JSTests/ChangeLog >index 2427143de3152e96c90bc09292bb1a87822a5765..235ce1d3c8aa06cc677a65c390997f22a25f6e5d 100644 >--- a/JSTests/ChangeLog >+++ b/JSTests/ChangeLog >@@ -1,3 +1,13 @@ >+2018-05-04 Keith Miller <keith_miller@apple.com> >+ >+ isCacheableArrayLength should return true for undecided arrays >+ https://bugs.webkit.org/show_bug.cgi?id=185309 >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ * stress/get-array-length-undecided.js: Added. >+ (test): >+ > 2018-05-03 Ryan Haddad <ryanhaddad@apple.com> > > Unreviewed, rolling out r231197. >diff --git a/JSTests/stress/get-array-length-undecided.js b/JSTests/stress/get-array-length-undecided.js >new file mode 100644 >index 0000000000000000000000000000000000000000..2ea39436478fca5661e4b441013da0cfc7760bb9 >--- /dev/null >+++ b/JSTests/stress/get-array-length-undecided.js >@@ -0,0 +1,10 @@ >+function test(array) { >+ return array.length; >+} >+noInline(test); >+ >+let array = new Array(10); >+for (let i = 0; i < 10000; i++) { >+ if (test(array) !== 10) >+ throw new Error("bad result"); >+}
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Formatted Diff
|
Diff
Attachments on
bug 185309
: 339581