[Webkit-unassigned] [Bug 166658] New: Reduce the use of EncodedJSValue, and use JSValue instead.

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Tue Jan 3 13:44:22 PST 2017


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

            Bug ID: 166658
           Summary: Reduce the use of EncodedJSValue, and use JSValue
                    instead.
    Classification: Unclassified
           Product: WebKit
           Version: WebKit Local Build
          Hardware: Unspecified
                OS: Unspecified
            Status: NEW
          Severity: Normal
          Priority: P2
         Component: JavaScriptCore
          Assignee: webkit-unassigned at lists.webkit.org
          Reporter: mark.lam at apple.com

Existing code uses EncodedJSValue for passing JSValues in and out of host functions.  However, it does not seem that this is necessary in most cases.  Specifically, NativeFunction, GetValueFunc, and PutValueFunc can all use JSValue with no performance implications.  Using JSValue directly (instead of EncodedJSValue) also improves type safety, and reduces the need to marshal values back and forth using JSValue::encode() and JSValue::decode().  This makes the code more easy to read and write, with no performance loss.

The 2 primary reason for code to still use EncodedJSValue are:
1. functions that require C linkage (e.g. JIT_OPERATION functions).
2. as an element storage type where using EncodedJSValue allows us to use the trivial constructor for int64_t.

Note: this patch is not exhaustive in removing all unnecessary uses of EncodedJSValue.  It merely tries to reduce it as much as possible with minimal effort.

-- 
You are receiving this mail because:
You are the assignee for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.webkit.org/pipermail/webkit-unassigned/attachments/20170103/6570c0a0/attachment.html>


More information about the webkit-unassigned mailing list