WebKit Bugzilla
New
Browse
Log In
×
Sign in with GitHub
or
Remember my login
Create Account
·
Forgot Password
Forgotten password account recovery
RESOLVED FIXED
40214
Clean up error construction / throwing in JSC.
https://bugs.webkit.org/show_bug.cgi?id=40214
Summary
Clean up error construction / throwing in JSC.
Gavin Barraclough
Reported
2010-06-06 15:30:12 PDT
The one egregious insanity here is that creating an error requires a VM-entry-esqe-host call (the string argument is wrapped as a JS object & pushed on the RegisterFile, then unwrapped back to a UString). Changing this also means you only require a global object, not an ExecState, to create an error. The methods to create error objects are also parameterized requiring a switch on the type, which can be made cleaner and faster by moving to a separate method per error type. Code to add divot information to error had been duplicated, and is coalesced back into a single function. Convenience methods added to create & throw type & syntax error with a default error message, since this is a common case. Also, errors are currently thrown either using "throwError(exec, error)" or "exec->setException(error)" - unify on the former, since this is more commonly used. Add "throwVMError(exec, error)" equivalents, as a convenience for cases where the result was being wrapped in "JSValue::encode(...)".
Attachments
The patch
(202.32 KB, patch)
2010-06-06 15:36 PDT
,
Gavin Barraclough
sam
: review+
Details
Formatted Diff
Diff
View All
Add attachment
proposed patch, testcase, etc.
Gavin Barraclough
Comment 1
2010-06-06 15:36:20 PDT
Created
attachment 57983
[details]
The patch
WebKit Review Bot
Comment 2
2010-06-06 15:38:21 PDT
Attachment 57983
[details]
did not pass style-queue: Failed to run "['WebKitTools/Scripts/check-webkit-style', '--no-squash']" exit_code: 1 JavaScriptCore/runtime/Error.h:28: Alphabetical sorting problem. [build/include_order] [4] Total errors found: 1 in 87 files If any of these errors are false positives, please file a bug against check-webkit-style.
Sam Weinig
Comment 3
2010-06-06 15:51:29 PDT
Comment on
attachment 57983
[details]
The patch Looks good other than changing the type variable in op_new_error. r=me
WebKit Review Bot
Comment 4
2010-06-06 17:04:37 PDT
Attachment 57983
[details]
did not build on win: Build output:
http://webkit-commit-queue.appspot.com/results/3085180
Gavin Barraclough
Comment 5
2010-06-06 17:09:28 PDT
http://trac.webkit.org/changeset/60762
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