[Webkit-unassigned] [Bug 40214] New: Clean up error construction / throwing in JSC.

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Sun Jun 6 15:30:13 PDT 2010


https://bugs.webkit.org/show_bug.cgi?id=40214

           Summary: Clean up error construction / throwing in JSC.
           Product: WebKit
           Version: 528+ (Nightly build)
          Platform: PC
        OS/Version: Mac OS X 10.5
            Status: NEW
          Severity: Normal
          Priority: P2
         Component: JavaScriptCore
        AssignedTo: webkit-unassigned at lists.webkit.org
        ReportedBy: barraclough at apple.com


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(...)".

-- 
Configure bugmail: https://bugs.webkit.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.



More information about the webkit-unassigned mailing list