WebKit Bugzilla
New
Browse
Log In
×
Sign in with GitHub
or
Remember my login
Create Account
·
Forgot Password
Forgotten password account recovery
RESOLVED FIXED
186692
Properly zero unused property storage offsets
https://bugs.webkit.org/show_bug.cgi?id=186692
Summary
Properly zero unused property storage offsets
Keith Miller
Reported
2018-06-15 13:57:23 PDT
Properly zero unused property storage offsets
Attachments
Patch
(26.16 KB, patch)
2018-06-15 14:04 PDT
,
Keith Miller
no flags
Details
Formatted Diff
Diff
Archive of layout-test-results from ews113 for mac-sierra
(390.19 KB, application/zip)
2018-06-15 15:07 PDT
,
EWS Watchlist
no flags
Details
Patch
(32.14 KB, patch)
2018-06-15 15:55 PDT
,
Keith Miller
no flags
Details
Formatted Diff
Diff
Archive of layout-test-results from ews116 for mac-sierra
(3.09 MB, application/zip)
2018-06-15 17:29 PDT
,
EWS Watchlist
no flags
Details
Archive of layout-test-results from ews204 for win-future
(12.74 MB, application/zip)
2018-06-15 18:29 PDT
,
EWS Watchlist
no flags
Details
Patch
(35.94 KB, patch)
2018-06-15 20:22 PDT
,
Keith Miller
no flags
Details
Formatted Diff
Diff
Patch
(34.65 KB, patch)
2018-06-15 20:24 PDT
,
Keith Miller
no flags
Details
Formatted Diff
Diff
Archive of layout-test-results from ews113 for mac-sierra
(2.48 MB, application/zip)
2018-06-15 21:52 PDT
,
EWS Watchlist
no flags
Details
Archive of layout-test-results from ews107 for mac-sierra-wk2
(3.02 MB, application/zip)
2018-06-15 22:29 PDT
,
EWS Watchlist
no flags
Details
Patch
(32.13 KB, patch)
2018-06-18 12:04 PDT
,
Keith Miller
no flags
Details
Formatted Diff
Diff
Archive of layout-test-results from ews114 for mac-sierra
(3.29 MB, application/zip)
2018-06-18 13:24 PDT
,
EWS Watchlist
no flags
Details
Patch
(36.06 KB, patch)
2018-06-18 14:46 PDT
,
Keith Miller
no flags
Details
Formatted Diff
Diff
Patch
(36.06 KB, patch)
2018-06-18 15:37 PDT
,
Keith Miller
no flags
Details
Formatted Diff
Diff
Patch
(36.40 KB, patch)
2018-06-18 15:51 PDT
,
Keith Miller
no flags
Details
Formatted Diff
Diff
Show Obsolete
(7)
View All
Add attachment
proposed patch, testcase, etc.
Keith Miller
Comment 1
2018-06-15 14:04:31 PDT
Created
attachment 342843
[details]
Patch
EWS Watchlist
Comment 2
2018-06-15 14:06:06 PDT
Attachment 342843
[details]
did not pass style-queue: ERROR: Source/JavaScriptCore/runtime/Butterfly.h:166: The parameter name "vm" adds no information, so it should be removed. [readability/parameter_name] [5] ERROR: Source/JavaScriptCore/runtime/Butterfly.h:166: The parameter name "indexingHeader" adds no information, so it should be removed. [readability/parameter_name] [5] ERROR: Source/JavaScriptCore/runtime/JSObject.cpp:1184: Declaration has space between type name and * in propertyCapacity * sizeof [whitespace/declaration] [3] Total errors found: 3 in 9 files If any of these errors are false positives, please file a bug against check-webkit-style.
EWS Watchlist
Comment 3
2018-06-15 15:07:39 PDT
Comment on
attachment 342843
[details]
Patch
Attachment 342843
[details]
did not pass mac-debug-ews (mac): Output:
http://webkit-queues.webkit.org/results/8202573
Number of test failures exceeded the failure limit.
EWS Watchlist
Comment 4
2018-06-15 15:07:41 PDT
Created
attachment 342851
[details]
Archive of layout-test-results from ews113 for mac-sierra The attached test failures were seen while running run-webkit-tests on the mac-debug-ews. Bot: ews113 Port: mac-sierra Platform: Mac OS X 10.12.6
Keith Miller
Comment 5
2018-06-15 15:55:56 PDT
Created
attachment 342854
[details]
Patch
EWS Watchlist
Comment 6
2018-06-15 15:58:43 PDT
Attachment 342854
[details]
did not pass style-queue: ERROR: Source/JavaScriptCore/runtime/Butterfly.h:168: The parameter name "vm" adds no information, so it should be removed. [readability/parameter_name] [5] ERROR: Source/JavaScriptCore/runtime/Butterfly.h:168: The parameter name "indexingHeader" adds no information, so it should be removed. [readability/parameter_name] [5] ERROR: Source/JavaScriptCore/runtime/JSObject.cpp:1184: Declaration has space between type name and * in propertyCapacity * sizeof [whitespace/declaration] [3] Total errors found: 3 in 10 files If any of these errors are false positives, please file a bug against check-webkit-style.
Geoffrey Garen
Comment 7
2018-06-15 16:17:55 PDT
Comment on
attachment 342854
[details]
Patch View in context:
https://bugs.webkit.org/attachment.cgi?id=342854&action=review
Test case please. r=me with test case and fix for test time regression if needed.
> Source/JavaScriptCore/ChangeLog:12 > + or creating a RegExp matches array we never cleared the unused
array, we never clear
> Source/JavaScriptCore/runtime/ObjectInitializationScope.cpp:94 > + for (int64_t i = 0; i < static_cast<int64_t>(structure->outOfLineCapacity()); i++) { > + // We rely on properties past the last offset be zero for concurrent GC. > + if (i + firstOutOfLineOffset > structure->lastOffset()) > + ASSERT(!butterfly->propertyStorage()[-i - 1].get()); > + else if (isScribbledValue(butterfly->propertyStorage()[-i - 1].get())) { > + dataLogLn("Found scribbled property at i = ", -i - 1); > + ASSERT_NOT_REACHED(); > + } > + }
If this increases debug test time too much, you need to find a way to do this assertion conditionally.
EWS Watchlist
Comment 8
2018-06-15 17:29:26 PDT
Comment on
attachment 342854
[details]
Patch
Attachment 342854
[details]
did not pass mac-debug-ews (mac): Output:
http://webkit-queues.webkit.org/results/8204362
Number of test failures exceeded the failure limit.
EWS Watchlist
Comment 9
2018-06-15 17:29:27 PDT
Created
attachment 342859
[details]
Archive of layout-test-results from ews116 for mac-sierra The attached test failures were seen while running run-webkit-tests on the mac-debug-ews. Bot: ews116 Port: mac-sierra Platform: Mac OS X 10.12.6
EWS Watchlist
Comment 10
2018-06-15 18:28:59 PDT
Comment on
attachment 342854
[details]
Patch
Attachment 342854
[details]
did not pass win-ews (win): Output:
http://webkit-queues.webkit.org/results/8204839
New failing tests: http/tests/preload/onload_event.html
EWS Watchlist
Comment 11
2018-06-15 18:29:09 PDT
Created
attachment 342865
[details]
Archive of layout-test-results from ews204 for win-future The attached test failures were seen while running run-webkit-tests on the win-ews. Bot: ews204 Port: win-future Platform: CYGWIN_NT-6.1-2.9.0-0.318-5-3-x86_64-64bit
Keith Miller
Comment 12
2018-06-15 18:29:20 PDT
rdar://problem/39489288
Saam Barati
Comment 13
2018-06-15 19:10:15 PDT
Comment on
attachment 342854
[details]
Patch View in context:
https://bugs.webkit.org/attachment.cgi?id=342854&action=review
> Source/JavaScriptCore/runtime/RegExpMatchesArray.h:-52 > - unsigned i = (createUninitialized ? initialLength : 0);
Why this change?
Keith Miller
Comment 14
2018-06-15 19:17:14 PDT
Comment on
attachment 342854
[details]
Patch View in context:
https://bugs.webkit.org/attachment.cgi?id=342854&action=review
>> Source/JavaScriptCore/runtime/RegExpMatchesArray.h:-52 >> - unsigned i = (createUninitialized ? initialLength : 0); > > Why this change?
createUninitialized was always false. We only ever pass a custom structure.
Keith Miller
Comment 15
2018-06-15 20:22:58 PDT
Created
attachment 342872
[details]
Patch
EWS Watchlist
Comment 16
2018-06-15 20:24:13 PDT
Attachment 342872
[details]
did not pass style-queue: ERROR: Source/JavaScriptCore/runtime/Butterfly.h:168: The parameter name "vm" adds no information, so it should be removed. [readability/parameter_name] [5] ERROR: Source/JavaScriptCore/runtime/Butterfly.h:168: The parameter name "indexingHeader" adds no information, so it should be removed. [readability/parameter_name] [5] ERROR: Source/JavaScriptCore/runtime/JSObject.cpp:1184: Declaration has space between type name and * in propertyCapacity * sizeof [whitespace/declaration] [3] Total errors found: 3 in 11 files If any of these errors are false positives, please file a bug against check-webkit-style.
Keith Miller
Comment 17
2018-06-15 20:24:30 PDT
Created
attachment 342873
[details]
Patch
EWS Watchlist
Comment 18
2018-06-15 20:27:13 PDT
Attachment 342873
[details]
did not pass style-queue: ERROR: Source/JavaScriptCore/runtime/Butterfly.h:168: The parameter name "vm" adds no information, so it should be removed. [readability/parameter_name] [5] ERROR: Source/JavaScriptCore/runtime/Butterfly.h:168: The parameter name "indexingHeader" adds no information, so it should be removed. [readability/parameter_name] [5] ERROR: Source/JavaScriptCore/runtime/JSObject.cpp:1184: Declaration has space between type name and * in propertyCapacity * sizeof [whitespace/declaration] [3] Total errors found: 3 in 13 files If any of these errors are false positives, please file a bug against check-webkit-style.
EWS Watchlist
Comment 19
2018-06-15 21:52:23 PDT
Comment on
attachment 342873
[details]
Patch
Attachment 342873
[details]
did not pass mac-debug-ews (mac): Output:
http://webkit-queues.webkit.org/results/8207177
Number of test failures exceeded the failure limit.
EWS Watchlist
Comment 20
2018-06-15 21:52:24 PDT
Created
attachment 342875
[details]
Archive of layout-test-results from ews113 for mac-sierra The attached test failures were seen while running run-webkit-tests on the mac-debug-ews. Bot: ews113 Port: mac-sierra Platform: Mac OS X 10.12.6
EWS Watchlist
Comment 21
2018-06-15 22:28:59 PDT
Comment on
attachment 342873
[details]
Patch
Attachment 342873
[details]
did not pass mac-wk2-ews (mac-wk2): Output:
http://webkit-queues.webkit.org/results/8207436
New failing tests: css3/filters/backdrop/add-remove-add-backdrop-filter.html
EWS Watchlist
Comment 22
2018-06-15 22:29:01 PDT
Created
attachment 342876
[details]
Archive of layout-test-results from ews107 for mac-sierra-wk2 The attached test failures were seen while running run-webkit-tests on the mac-wk2-ews. Bot: ews107 Port: mac-sierra-wk2 Platform: Mac OS X 10.12.6
Mark Lam
Comment 23
2018-06-16 11:11:40 PDT
Comment on
attachment 342873
[details]
Patch View in context:
https://bugs.webkit.org/attachment.cgi?id=342873&action=review
> Source/JavaScriptCore/ChangeLog:13 > + proprety storage. This patch fixes that issue and gets most users
typo: /proprety/property/
> Source/JavaScriptCore/runtime/Butterfly.h:166 > + static Butterfly* tryCreateUninitialized(VM&, ObjectInitializationScope*, JSObject* intendedOwner, size_t preCapacity, size_t propertyCapacity, bool hasIndexingHeader, size_t indexingPayloadSizeInBytes, GCDeferralContext* = nullptr); > + static Butterfly* createUninitialized(VM&, ObjectInitializationScope*, JSObject* intendedOwner, size_t preCapacity, size_t propertyCapacity, bool hasIndexingHeader, size_t indexingPayloadSizeInBytes);
I see that operationAllocateSimplePropertyStorageWithInitialCapacity, operationAllocateSimplePropertyStorage, and tryCreateUninitializedRegExpMatchesArray are the only 2 clients that calls these without a ObjectInitializationScope. I suggest that you: 1. Change all clients to instantiate and pass a ObjectInitializationScope anyway. 2. Pass a ObjectInitializationScope& instead of a ObjectInitializationScope*. 3. Remove the VM& argument. You can get the VM& from the ObjectInitializationScope&. ObjectInitializationScope was designed to work this way. That will keep the interface simpler, and removes the question of whether ObjectInitializationScope is needed or not (preventing someone from making the wrong choice in the future when adding new code).
> Source/JavaScriptCore/runtime/ButterflyInlines.h:89 > + if (initializationScope) > + initializationScope->notifyAllocated(intendedOwner, wasCreatedUnitializated);
Remove the initializationScope condition (after changing this function to take a ObjectInitializationScope& instead of ObjectInitializationScope*).
> Source/JavaScriptCore/runtime/ButterflyInlines.h:102 > + if (initializationScope) > + initializationScope->notifyAllocated(intendedOwner, wasCreatedUnitializated);
Remove the initializationScope condition (after changing this function to take a ObjectInitializationScope& instead of ObjectInitializationScope*).
> Source/JavaScriptCore/runtime/JSObject.cpp:1185 > +
Please remove whitespace.
Keith Miller
Comment 24
2018-06-16 12:26:03 PDT
Comment on
attachment 342873
[details]
Patch View in context:
https://bugs.webkit.org/attachment.cgi?id=342873&action=review
>> Source/JavaScriptCore/ChangeLog:13 >> + proprety storage. This patch fixes that issue and gets most users > > typo: /proprety/property/
fixed.
>> Source/JavaScriptCore/runtime/Butterfly.h:166 >> + static Butterfly* createUninitialized(VM&, ObjectInitializationScope*, JSObject* intendedOwner, size_t preCapacity, size_t propertyCapacity, bool hasIndexingHeader, size_t indexingPayloadSizeInBytes); > > I see that operationAllocateSimplePropertyStorageWithInitialCapacity, operationAllocateSimplePropertyStorage, and tryCreateUninitializedRegExpMatchesArray are the only 2 clients that calls these without a ObjectInitializationScope. I suggest that you: > 1. Change all clients to instantiate and pass a ObjectInitializationScope anyway. > 2. Pass a ObjectInitializationScope& instead of a ObjectInitializationScope*. > 3. Remove the VM& argument. You can get the VM& from the ObjectInitializationScope&. ObjectInitializationScope was designed to work this way. > > That will keep the interface simpler, and removes the question of whether ObjectInitializationScope is needed or not (preventing someone from making the wrong choice in the future when adding new code).
I don't see how that would work. The DFG/FTL operations don't actually initialize the object while the ObjectInitializationScope would be alive. Are you proposing that there should be a new method to drop the initialization scope?
>> Source/JavaScriptCore/runtime/JSObject.cpp:1185 >> + > > Please remove whitespace.
Fixed.
Filip Pizlo
Comment 25
2018-06-18 11:34:42 PDT
Comment on
attachment 342873
[details]
Patch I would rip out the part of this patch that adds more uses of ObjectInitializationScope. In RegExpMatchesArray, we already use GCDeferralContext, which may not interact great with the DisallowGC that ObjectInitializationScope does.
Keith Miller
Comment 26
2018-06-18 12:04:07 PDT
Created
attachment 342959
[details]
Patch
EWS Watchlist
Comment 27
2018-06-18 12:05:54 PDT
Attachment 342959
[details]
did not pass style-queue: ERROR: Source/JavaScriptCore/runtime/Butterfly.h:168: The parameter name "vm" adds no information, so it should be removed. [readability/parameter_name] [5] ERROR: Source/JavaScriptCore/runtime/Butterfly.h:168: The parameter name "indexingHeader" adds no information, so it should be removed. [readability/parameter_name] [5] ERROR: Source/JavaScriptCore/runtime/JSObject.cpp:1181: Declaration has space between type name and * in propertyCapacity * sizeof [whitespace/declaration] [3] Total errors found: 3 in 13 files If any of these errors are false positives, please file a bug against check-webkit-style.
EWS Watchlist
Comment 28
2018-06-18 13:24:26 PDT
Comment on
attachment 342959
[details]
Patch
Attachment 342959
[details]
did not pass mac-debug-ews (mac): Output:
http://webkit-queues.webkit.org/results/8235221
Number of test failures exceeded the failure limit.
EWS Watchlist
Comment 29
2018-06-18 13:24:27 PDT
Created
attachment 342967
[details]
Archive of layout-test-results from ews114 for mac-sierra The attached test failures were seen while running run-webkit-tests on the mac-debug-ews. Bot: ews114 Port: mac-sierra Platform: Mac OS X 10.12.6
Keith Miller
Comment 30
2018-06-18 14:46:25 PDT
Created
attachment 342972
[details]
Patch
EWS Watchlist
Comment 31
2018-06-18 14:49:16 PDT
Attachment 342972
[details]
did not pass style-queue: ERROR: Source/JavaScriptCore/runtime/Butterfly.h:168: The parameter name "vm" adds no information, so it should be removed. [readability/parameter_name] [5] ERROR: Source/JavaScriptCore/runtime/Butterfly.h:168: The parameter name "indexingHeader" adds no information, so it should be removed. [readability/parameter_name] [5] ERROR: Source/JavaScriptCore/runtime/JSObject.cpp:1181: Declaration has space between type name and * in propertyCapacity * sizeof [whitespace/declaration] [3] Total errors found: 3 in 13 files If any of these errors are false positives, please file a bug against check-webkit-style.
Keith Miller
Comment 32
2018-06-18 15:37:49 PDT
Created
attachment 342981
[details]
Patch
EWS Watchlist
Comment 33
2018-06-18 15:40:30 PDT
Attachment 342981
[details]
did not pass style-queue: ERROR: Source/JavaScriptCore/runtime/Butterfly.h:168: The parameter name "vm" adds no information, so it should be removed. [readability/parameter_name] [5] ERROR: Source/JavaScriptCore/runtime/Butterfly.h:168: The parameter name "indexingHeader" adds no information, so it should be removed. [readability/parameter_name] [5] ERROR: Source/JavaScriptCore/runtime/JSObject.cpp:1181: Declaration has space between type name and * in propertyCapacity * sizeof [whitespace/declaration] [3] Total errors found: 3 in 13 files If any of these errors are false positives, please file a bug against check-webkit-style.
Keith Miller
Comment 34
2018-06-18 15:51:56 PDT
Created
attachment 342983
[details]
Patch
EWS Watchlist
Comment 35
2018-06-18 15:53:50 PDT
Attachment 342983
[details]
did not pass style-queue: ERROR: Source/JavaScriptCore/runtime/Butterfly.h:167: The parameter name "vm" adds no information, so it should be removed. [readability/parameter_name] [5] ERROR: Source/JavaScriptCore/runtime/Butterfly.h:167: The parameter name "indexingHeader" adds no information, so it should be removed. [readability/parameter_name] [5] ERROR: Source/JavaScriptCore/runtime/JSObject.cpp:1181: Declaration has space between type name and * in propertyCapacity * sizeof [whitespace/declaration] [3] Total errors found: 3 in 13 files If any of these errors are false positives, please file a bug against check-webkit-style.
WebKit Commit Bot
Comment 36
2018-06-18 16:53:34 PDT
Comment on
attachment 342983
[details]
Patch Clearing flags on attachment: 342983 Committed
r232951
: <
https://trac.webkit.org/changeset/232951
>
WebKit Commit Bot
Comment 37
2018-06-18 16:53:36 PDT
All reviewed patches have been landed. Closing bug.
Saam Barati
Comment 38
2018-06-18 18:19:10 PDT
Comment on
attachment 342983
[details]
Patch View in context:
https://bugs.webkit.org/attachment.cgi?id=342983&action=review
> Source/JavaScriptCore/runtime/JSArray.cpp:55 > + ASSERT_UNUSED(globalObject, globalObject->isOriginalArrayStructure(structure) || structure == globalObject->regExpMatchesArrayStructure() || structure == globalObject->regExpMatchesArrayWithGroupsStructure());
This is crashing for me on a debug build
Saam Barati
Comment 39
2018-06-18 18:22:53 PDT
(In reply to Saam Barati from
comment #38
)
> Comment on
attachment 342983
[details]
> Patch > > View in context: >
https://bugs.webkit.org/attachment.cgi?id=342983&action=review
> > > Source/JavaScriptCore/runtime/JSArray.cpp:55 > > + ASSERT_UNUSED(globalObject, globalObject->isOriginalArrayStructure(structure) || structure == globalObject->regExpMatchesArrayStructure() || structure == globalObject->regExpMatchesArrayWithGroupsStructure()); > > This is crashing for me on a debug build
repro test case: ``` class A extends Array { } new A; ```
Keith Miller
Comment 40
2018-06-18 18:25:01 PDT
Comment on
attachment 342983
[details]
Patch View in context:
https://bugs.webkit.org/attachment.cgi?id=342983&action=review
>>> Source/JavaScriptCore/runtime/JSArray.cpp:55 >>> + ASSERT_UNUSED(globalObject, globalObject->isOriginalArrayStructure(structure) || structure == globalObject->regExpMatchesArrayStructure() || structure == globalObject->regExpMatchesArrayWithGroupsStructure()); >> >> This is crashing for me on a debug build > > repro test case: > > ``` > class A extends Array { } > new A; > ```
Yeah, I can see how this would break for that... I should just get rid of that assert. It doesn't do very much.
Note
You need to
log in
before you can comment on or make changes to this bug.
Top of Page
Format For Printing
XML
Clone This Bug