Bug 80453

Summary: [meta] Remove V8HiddenPropertyName::hiddenReferenceName()
Product: WebKit Reporter: Kentaro Hara <haraken>
Component: WebCore JavaScriptAssignee: Kentaro Hara <haraken>
Status: RESOLVED INVALID    
Severity: Normal CC: abarth, arv, burg
Priority: P2    
Version: 528+ (Nightly build)   
Hardware: Unspecified   
OS: Unspecified   
Bug Depends on: 80462    
Bug Blocks:    

Description Kentaro Hara 2012-03-06 16:33:52 PST
As bug 80376 indicated, V8HiddenPropertyName::hiddenReferenceName() is very slow. It allocates a string on v8::Handle every time a DOM attribute is accessed, in spite of the fact that the returned string is static. We should remove V8HiddenPropertyName::hiddenReferenceName() and allocate the string statically on v8::Persistent.

Another thing we need to do is to remove V8_DEFINE_HIDDEN_PROPERTY(). Although it enables us to use V8HiddenPropertyName::fooName(), we need to add  V8_HIDDEN_PROPERTIES() entries to V8HiddenPropertyName.h every time we want to add a new fooName. This makes it difficult to generate V8HiddenPropertyName::fooName() in code generators, since the code generators cannot modify V8HiddenPropertyName.h. Thus, instead of V8HiddenPropertyName::fooName(), we can define a new macro DEFINE_STATIC_HIDDEN_PROPERTY(fooName), which just defines fooName statically.

Overall, the goal is to replace the current code:

    someFunction(..., V8HiddenPropertyName::hiddenReferenceName("fooName"), ...);

with

    DEFINE_STATIC_HIDDEN_PROPERTY(fooName);
    someFunction(..., fooName, ...);

By adding the DEFINE_STATIC_HIDDEN_PROPERTY() to V8BindingMacros.h, maybe we can remove V8HiddenPropertyName.{h,cpp} completely.

I'll post patches step by step.