diff options
Diffstat (limited to 'WebCore/bindings/v8/MainThreadDOMData.cpp')
-rw-r--r-- | WebCore/bindings/v8/MainThreadDOMData.cpp | 20 |
1 files changed, 18 insertions, 2 deletions
diff --git a/WebCore/bindings/v8/MainThreadDOMData.cpp b/WebCore/bindings/v8/MainThreadDOMData.cpp index ea34444..b1b63bf 100644 --- a/WebCore/bindings/v8/MainThreadDOMData.cpp +++ b/WebCore/bindings/v8/MainThreadDOMData.cpp @@ -39,14 +39,30 @@ MainThreadDOMData::MainThreadDOMData() : m_defaultStore(this) { } + +MainThreadDOMData* MainThreadDOMData::getCurrent() +{ + ASSERT(WTF::isMainThread()); + DEFINE_STATIC_LOCAL(MainThreadDOMData, mainThreadDOMData, ()); + return &mainThreadDOMData; +} -DOMDataStore& MainThreadDOMData::getStore() +DOMDataStore& MainThreadDOMData::getMainThreadStore() { + // This is broken out as a separate non-virtual method from getStore() + // so that it can be inlined by getCurrentMainThreadStore, which is + // a hot spot in Dromaeo DOM tests. ASSERT(WTF::isMainThread()); V8IsolatedWorld* world = V8IsolatedWorld::getEntered(); - if (world) + if (UNLIKELY(world != 0)) return *world->getDOMDataStore(); return m_defaultStore; } +DOMDataStore& MainThreadDOMData::getCurrentMainThreadStore() +{ + return getCurrent()->getMainThreadStore(); +} + + } // namespace WebCore |