[webkit-reviews] review requested: [Bug 31168] Add [HintAtomic] to IDLs to remove unnecessary string conversions in generated V8 DOM bindings : [Attachment 43381] path with different implementation

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Tue Nov 17 14:35:00 PST 2009


Jens Alfke <snej at chromium.org> has asked  for review:
Bug 31168: Add [HintAtomic] to IDLs to remove unnecessary string conversions in
generated V8 DOM bindings
https://bugs.webkit.org/show_bug.cgi?id=31168

Attachment 43381: path with different implementation
https://bugs.webkit.org/attachment.cgi?id=43381&action=review

------- Additional Comments from Jens Alfke <snej at chromium.org>
Here's a different implementation :)

No more IDL annotations. Instead, use a 'polymorphic return value' pattern to
generate the appropriate conversion function when a V8 value is assigned to
either a String or AtomicString parameter. The V8Parameter class in V8Binding.h
implements this — it's a wrapper for a v8 value with two conversion operators,
to String or AtomicString. Each inlines the appropriate conversion function.

V8Parameter is templatized because there are three possible modes for
conversion, depending on how null/undefined JavaScript values are to be
converted.

A note on CodeGeneratorPM: In a few functions like GetNativeTypeFromSignature I
changed a boolean 'isParameter' parameter to a numeric 'parameterIndex'. This
isn't strictly necessary for this patch, but in the future I want to do some
further optimization that will require knowing the parameter index at that
point; I didn't manage to get that ready for this patch but I want to leave the
parameter change in.


More information about the webkit-reviews mailing list