Bug 80453 - [meta] Remove V8HiddenPropertyName::hiddenReferenceName()
Summary: [meta] Remove V8HiddenPropertyName::hiddenReferenceName()
Status: RESOLVED INVALID
Alias: None
Product: WebKit
Classification: Unclassified
Component: WebCore JavaScript (show other bugs)
Version: 528+ (Nightly build)
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Kentaro Hara
URL:
Keywords:
Depends on: 80462
Blocks:
  Show dependency treegraph
 
Reported: 2012-03-06 16:33 PST by Kentaro Hara
Modified: 2014-12-16 00:55 PST (History)
3 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
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.