Currently, when we wrap a WebCore object for use in V8, we insert 2 internal fields: a pointer to the WebCore object itself, and an integer indicating the V8ClassIndex::V8WrapperType. Instead of the integer, we could use a struct that includes pointers to the appropriate versions of functions that WebCore might need for this object. I believe the callbacks would be: * A pointer to the appropriate GetTemplate function * A pointer to a function that derefs the WebCore object (if it is refcounted, need in V8GCController.cpp) * A pointer to a function that casts the WebCore object to an ActiveDOMObject if possible (needed for appropriate handling of active objects in DOMData.cpp) This will allow us to remove any place that we're using a macro'ed switch statement based on the declarations in V8Index.h, as well as delete V8Index.cpp. Once this change is in, I plan on working toward generating an equivalent to V8Index.h.
Created attachment 50343 [details] patch This appears to be essentially a no-op in terms of Dromaeo performance (within a fraction of 1% from previous results).
Attachment 50343 [details] did not build on chromium: Build output: http://webkit-commit-queue.appspot.com/results/481007
Created attachment 50347 [details] patch with build file changes
This is better than peanut butter, jelly and bread put together. Anton, do you have any concerns with this patch?
(In reply to comment #4) > This is better than peanut butter, jelly and bread put together. Anton, do you > have any concerns with this patch? I'm allergic to peanuts, you insensitive clod!
(In reply to comment #5) > (In reply to comment #4) > > This is better than peanut butter, jelly and bread put together. Anton, do you > > have any concerns with this patch? > > I'm allergic to peanuts, you insensitive clod! Darn it! I've gotta stop falling into this food sensitivity trap.
What about sunflower butter? http://www.nutsonline.com/snacks/sunflowerseeds/butter.html?source=googlebase
(In reply to comment #7) > What about sunflower butter? > http://www.nutsonline.com/snacks/sunflowerseeds/butter.html?source=googlebase I'm generally ok with seeds, so it's probably safe. However, unlike the individual in their testimonial, I do not crave peanut butter nor any substitute. It is the Kryptonite to my Superman, the CodeGeneratorV8.pm to my comprehensible codebase.
Does this have any memory implications?
(In reply to comment #9) > Does this have any memory implications? AFAICT, no. I ran chromium's memory_tests, which passed locally. If you have any recommendations on other tests to run, I would be happy to hear them. In terms of what is supposed be happening, instead of storing an integer, we're storing a pointer to a static struct that contents an integer and 3 function pointers. Unless I screwed something up, that should be negligible.
LGTM. And I like it.
Comment on attachment 50347 [details] patch with build file changes beam me up, Scotty.
http://trac.webkit.org/changeset/55798