[Webkit-unassigned] [Bug 102240] [V8] Rename dispatchWrap

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Tue Nov 27 01:05:12 PST 2012


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





--- Comment #7 from Kentaro Hara <haraken at chromium.org>  2012-11-27 01:07:23 PST ---
(In reply to comment #6)
> I moved the functionality around.  wrap used to first check the wrapper cache then built the wrapped object. toV8 checked the wrapper, then called wrap, which often checked the cache a number of times. I ensured now that the check is only performed once, in toV8 (or toV8fast, or toV8Object), and then the call is passed to wrap. No wrap call should be made outside of the bindings.
> 
> A V8NoWrapperCache means that there will never be a cache used for such object, so wrap is not generated, and in that case, we must have a custom v8 implementation since we have no idea what the intention is such a call.
> 
> Sometimes a wrap implementation  might want to use the wrapper cache though, and just do some type checking and dispatch the wrap call down the subclass chain. That's marked as V8CustomToJSObject or CustomToJSObject.
> 
> By splitting functionality I ensured that the wrapper cache check is pretty much always autogenerated and performed just once. Additionally, it meant that toV8 and toV8Fast can almost always be generated, which wasn't previously the case for classes marked (V8)CustomToJSObject

Thanks, I understand that we now have only one cache check.

[1] However, from the perspective of developers, the current IDL attributes look a bit confusing.

As far as I see:

- If we want to write custom toV8(), we need to specify [(V8)CustomToJSObject] and [V8NoWrapperCache].

- If we want to write custom wrap(), we need to specify [(V8)CustomToJSObject] only.

- Then what should we specify if we want to write both custom toV8() and custom wrap() ?

I'd be happy if we could clean up the IDL attributes.


[2] Do we really need to expose both custom toV8() and custom wrap() to make the number of cache checks once ?


[3] Just to clarify, would you elaborate on why the following structure won't work? (I'd like to understand what is making the situation complicated.)

  call path: toV8Fast() => toV8() => createWrapper()

  - toV8Fast() does the cache check.
  - toV8() can be custom to let developers write any delegation logic.
  - createWrapper() creates a new V8 object.

-- 
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