Bug 171404 - Fix some RELEASE_ASSERT failures caused by OutOfMemoryErrors.
Summary: Fix some RELEASE_ASSERT failures caused by OutOfMemoryErrors.
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: JavaScriptCore (show other bugs)
Version: WebKit Local Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Mark Lam
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2017-04-27 16:29 PDT by Mark Lam
Modified: 2017-05-01 15:24 PDT (History)
6 users (show)

See Also:


Attachments
proposed patch. (13.06 KB, patch)
2017-04-27 17:03 PDT, Mark Lam
no flags Details | Formatted Diff | Diff
proposed patch. (13.25 KB, patch)
2017-04-27 17:27 PDT, Mark Lam
saam: review+
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Mark Lam 2017-04-27 16:29:38 PDT
Patch coming.
Comment 1 Radar WebKit Bug Importer 2017-04-27 16:30:20 PDT
<rdar://problem/31876178>
Comment 2 Mark Lam 2017-04-27 17:03:41 PDT
Created attachment 308483 [details]
proposed patch.
Comment 3 JF Bastien 2017-04-27 17:15:01 PDT
Comment on attachment 308483 [details]
proposed patch.

View in context: https://bugs.webkit.org/attachment.cgi?id=308483&action=review

> Source/JavaScriptCore/runtime/JSCInlines.h:2
> + * Copyright (C) 2014-2017 Apple Inc. All rights reserved.

Is that legit? I though commas delimited a break, and dashes a range, so you're adding 2015 in there as a date where work was performed along with 2017.

> Source/JavaScriptCore/runtime/JSCellInlines.h:145
> +template<typename T, bool assertOnFailure, bool takesDeferralContext>

I like having enum classes instead of bools.

> Source/JavaScriptCore/runtime/JSGlobalObject.h:3
> + *  Copyright (C) 2007-2017 Apple Inc. All rights reserved.

Ditto.
Comment 4 Mark Lam 2017-04-27 17:26:02 PDT
Comment on attachment 308483 [details]
proposed patch.

View in context: https://bugs.webkit.org/attachment.cgi?id=308483&action=review

>> Source/JavaScriptCore/runtime/JSCInlines.h:2
>> + * Copyright (C) 2014-2017 Apple Inc. All rights reserved.
> 
> Is that legit? I though commas delimited a break, and dashes a range, so you're adding 2015 in there as a date where work was performed along with 2017.

Yes, we've been told to do it this way now.  My understanding of it is that we've always held the copyright for the file even if we didn't modify it in those tween years.

>> Source/JavaScriptCore/runtime/JSCellInlines.h:145
>> +template<typename T, bool assertOnFailure, bool takesDeferralContext>
> 
> I like having enum classes instead of bools.

Will apply enum classes to placate you.
Comment 5 Mark Lam 2017-04-27 17:27:54 PDT
Created attachment 308484 [details]
proposed patch.
Comment 6 Saam Barati 2017-04-27 18:07:41 PDT
Comment on attachment 308484 [details]
proposed patch.

View in context: https://bugs.webkit.org/attachment.cgi?id=308484&action=review

> Source/JavaScriptCore/runtime/JSCellInlines.h:146
> +template<typename T, AllocationFailureMode mode, GCDeferralContextArgPresense deferralContextArgPresence>
> +void* tryAllocateCellHelper(Heap& heap, GCDeferralContext* deferralContext, size_t size)

I would mark this as ALWAYS_INLINE

> Source/JavaScriptCore/runtime/JSFixedArray.h:47
>      ALWAYS_INLINE static JSFixedArray* createFromArray(ExecState* exec, VM& vm, JSArray* array)
>      {

The caller of this from operationMaterializeObjectInOSR is not OK w/ returning nullptr here. Please fix to make that release assert.
Comment 7 Mark Lam 2017-04-27 21:02:40 PDT
Comment on attachment 308484 [details]
proposed patch.

View in context: https://bugs.webkit.org/attachment.cgi?id=308484&action=review

Thanks for the review.

>> Source/JavaScriptCore/runtime/JSCellInlines.h:146
>> +void* tryAllocateCellHelper(Heap& heap, GCDeferralContext* deferralContext, size_t size)
> 
> I would mark this as ALWAYS_INLINE

Fixed.

>> Source/JavaScriptCore/runtime/JSFixedArray.h:47
>>      {
> 
> The caller of this from operationMaterializeObjectInOSR is not OK w/ returning nullptr here. Please fix to make that release assert.

I did.  See above diff in FTLOperations.cpp.
Comment 8 Mark Lam 2017-04-27 21:16:40 PDT
Landed in r215919: <http://trac.webkit.org/r215919>.
Comment 9 Saam Barati 2017-04-27 21:57:25 PDT
Comment on attachment 308484 [details]
proposed patch.

View in context: https://bugs.webkit.org/attachment.cgi?id=308484&action=review

>>> Source/JavaScriptCore/runtime/JSFixedArray.h:47
>>>      {
>> 
>> The caller of this from operationMaterializeObjectInOSR is not OK w/ returning nullptr here. Please fix to make that release assert.
> 
> I did.  See above diff in FTLOperations.cpp.

👍🏽. I missed that when reading the code.