Bug 34606

Summary: [V8] Clean up code for getting a v8::FunctionTemplate
Product: WebKit Reporter: Nate Chapin <japhet>
Component: WebCore Misc.Assignee: Nate Chapin <japhet>
Status: RESOLVED FIXED    
Severity: Normal CC: dglazkov
Priority: P2    
Version: 528+ (Nightly build)   
Hardware: All   
OS: All   
Attachments:
Description Flags
patch dglazkov: review+

Nate Chapin
Reported 2010-02-04 11:56:06 PST
Each generated V8 class has a private GetTemplate() function. V8ClassIndex is a friend of those classes, and it has a big, long, macro'ed switch statement that it uses to return the correct FunctionTemplate based on the passed in V8ClassIndex::WrapperType. It also creates a cache of these templates, in spite of the fact that each generated class already caches its own FunctionTemplate. To clean this up: 1. Make GetTemplate() public, un-friend V8ClassIndex 2. Remove the duplicate caching of FunctionTemplates 3. When the type of FunctionTemplate desired is known, call V8<classname>::GetTemplate() directly instead of using V8ClassIndex.
Attachments
patch (17.20 KB, patch)
2010-02-04 12:02 PST, Nate Chapin
dglazkov: review+
Nate Chapin
Comment 1 2010-02-04 12:02:29 PST
Dimitri Glazkov (Google)
Comment 2 2010-02-04 15:26:26 PST
Comment on attachment 48158 [details] patch sounds good. Are we going to rename GetTemplate() to template(), to match WebKit spirit?
Nate Chapin
Comment 3 2010-02-04 15:42:34 PST
If you'd like. This patch or a later one?
Dimitri Glazkov (Google)
Comment 4 2010-02-04 17:23:06 PST
l8r.
Nate Chapin
Comment 5 2010-02-05 08:31:41 PST
Note You need to log in before you can comment on or make changes to this bug.