WebKit Bugzilla
New
Browse
Log In
×
Sign in with GitHub
or
Remember my login
Create Account
·
Forgot Password
Forgotten password account recovery
RESOLVED FIXED
31420
[V8] Table-driven setup for binding template callback functions
https://bugs.webkit.org/show_bug.cgi?id=31420
Summary
[V8] Table-driven setup for binding template callback functions
Jens Alfke
Reported
2009-11-12 10:34:27 PST
The ConfigureXXXTemplate() function generated for each binding class has a lot of common boilerplace that can be de-inlined, esp. since each of these functions is only called once. It also sets up the class's callback functions/methods with individual function calls, instead of using a table-driven approach (the way it already sets up accessors.) Changing these results in 100kbytes of code size savings on x86/32.
Attachments
patch
(16.10 KB, patch)
2009-11-12 10:37 PST
,
Jens Alfke
dglazkov
: review+
Details
Formatted Diff
Diff
View All
Add attachment
proposed patch, testcase, etc.
Jens Alfke
Comment 1
2009-11-12 10:37:28 PST
Created
attachment 43076
[details]
patch
Dimitri Glazkov (Google)
Comment 2
2009-11-12 10:51:10 PST
Comment on
attachment 43076
[details]
patch r=me, feel free to commit after this fix-up:
> +v8::Local<v8::Signature> configureTemplate(v8::Persistent<v8::FunctionTemplate>desc, > + const char *interfaceName, > + V8ClassIndex::V8WrapperType parentClassIndex, > + int fieldCount, > + const BatchedAttribute* attributes, > + size_t attributeCount, > + const BatchedCallback* callbacks, > + size_t callbackCount) > +{ > + desc->SetClassName(v8::String::New(interfaceName)); > + v8::Local<v8::ObjectTemplate> instance = desc->InstanceTemplate(); > + instance->SetInternalFieldCount(fieldCount); > + if (parentClassIndex) > + desc->Inherit(V8DOMWrapper::getTemplate(parentClassIndex)); > + if (attributeCount) > + batchConfigureAttributes(instance, desc->PrototypeTemplate(), > + attributes, attributeCount); > + v8::Local<v8::Signature> default_signature = v8::Signature::New(desc);
Should be defaultSignature in WebKit-land.
Jens Alfke
Comment 3
2009-11-12 13:18:57 PST
Fixed that variable name, thanks. Committed revision 50897.
Note
You need to
log in
before you can comment on or make changes to this bug.
Top of Page
Format For Printing
XML
Clone This Bug