Bug 32184

Summary: Handle out-of-memory conditions with JSC Ropes with a JS exception, rather than crashing.
Product: WebKit Reporter: Gavin Barraclough <barraclough>
Component: JavaScriptCoreAssignee: Gavin Barraclough <barraclough>
Status: RESOLVED FIXED    
Severity: Normal CC: webkit.review.bot
Priority: P2    
Version: 528+ (Nightly build)   
Hardware: PC   
OS: OS X 10.5   
Attachments:
Description Flags
The Patch
oliver: review+
Oooops, with required webcore/webkit changes. oliver: review+

Description Gavin Barraclough 2009-12-05 15:42:09 PST
Switch from using fastMalloc to tryFastMalloc, pass an ExecState to record the exception on.
Comment 1 Gavin Barraclough 2009-12-05 15:44:29 PST
Created attachment 44351 [details]
The Patch
Comment 2 WebKit Review Bot 2009-12-05 15:46:59 PST
Attachment 44351 [details] did not pass style-queue:

Failed to run "WebKitTools/Scripts/check-webkit-style" exit_code: 1
JavaScriptCore/jit/JITStubs.cpp:2464:  Tests for true/false, null/non-null, and zero/non-zero should all be done without equality comparisons.  [readability/comparison_to_zero] [5]
JavaScriptCore/runtime/PropertyDescriptor.cpp:162:  Boolean expressions that span multiple lines should have their operators on the left side of the line instead of the right side.  [whitespace/operators] [4]
JavaScriptCore/runtime/PropertyDescriptor.cpp:163:  Boolean expressions that span multiple lines should have their operators on the left side of the line instead of the right side.  [whitespace/operators] [4]
JavaScriptCore/runtime/PropertyDescriptor.cpp:164:  Boolean expressions that span multiple lines should have their operators on the left side of the line instead of the right side.  [whitespace/operators] [4]
Total errors found: 4
Comment 3 Oliver Hunt 2009-12-05 22:49:41 PST
Comment on attachment 44351 [details]
The Patch

r=me
Comment 4 Gavin Barraclough 2009-12-07 13:09:50 PST
Created attachment 44427 [details]
Oooops, with required webcore/webkit changes.
Comment 5 WebKit Review Bot 2009-12-07 13:11:08 PST
Attachment 44427 [details] did not pass style-queue:

Failed to run "WebKitTools/Scripts/check-webkit-style" exit_code: 1
JavaScriptCore/jit/JITStubs.cpp:2438:  Tests for true/false, null/non-null, and zero/non-zero should all be done without equality comparisons.  [readability/comparison_to_zero] [5]
JavaScriptCore/runtime/PropertyDescriptor.cpp:162:  Boolean expressions that span multiple lines should have their operators on the left side of the line instead of the right side.  [whitespace/operators] [4]
JavaScriptCore/runtime/PropertyDescriptor.cpp:163:  Boolean expressions that span multiple lines should have their operators on the left side of the line instead of the right side.  [whitespace/operators] [4]
JavaScriptCore/runtime/PropertyDescriptor.cpp:164:  Boolean expressions that span multiple lines should have their operators on the left side of the line instead of the right side.  [whitespace/operators] [4]
Total errors found: 4
Comment 6 Oliver Hunt 2009-12-07 13:14:40 PST
Comment on attachment 44427 [details]
Oooops, with required webcore/webkit changes.

bool getString(ScriptState* scriptState, String& result) const; (in ScriptValue.h)
'scriptState' name should be removed

Otherwise, r=me
Comment 7 Gavin Barraclough 2009-12-07 15:16:20 PST
Transmitting file data ..........................................
Committed revision 51801.