JS DOM wrappers' impl() functions should return references.
authorakling@apple.com <akling@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 10 Oct 2013 12:01:51 +0000 (12:01 +0000)
committerakling@apple.com <akling@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 10 Oct 2013 12:01:51 +0000 (12:01 +0000)
<https://webkit.org/b/122497>

Reviewed by Antti Koivisto.

JS DOM wrappers always have a corresponding WebCore object during
their lifetime, so make impl() return a reference.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@157215 268f45cc-cd09-0410-ab3c-d52691b4dbfc

141 files changed:
Source/WebCore/ChangeLog
Source/WebCore/bindings/generic/BindingSecurity.cpp
Source/WebCore/bindings/generic/BindingSecurity.h
Source/WebCore/bindings/js/BindingState.cpp
Source/WebCore/bindings/js/JSAttrCustom.cpp
Source/WebCore/bindings/js/JSAudioBufferSourceNodeCustom.cpp
Source/WebCore/bindings/js/JSAudioTrackCustom.cpp
Source/WebCore/bindings/js/JSAudioTrackListCustom.cpp
Source/WebCore/bindings/js/JSBiquadFilterNodeCustom.cpp
Source/WebCore/bindings/js/JSCSSRuleCustom.cpp
Source/WebCore/bindings/js/JSCSSRuleListCustom.cpp
Source/WebCore/bindings/js/JSCSSStyleDeclarationCustom.cpp
Source/WebCore/bindings/js/JSCSSValueCustom.cpp
Source/WebCore/bindings/js/JSCanvasRenderingContext2DCustom.cpp
Source/WebCore/bindings/js/JSCanvasRenderingContextCustom.cpp
Source/WebCore/bindings/js/JSClipboardCustom.cpp
Source/WebCore/bindings/js/JSCryptoCustom.cpp
Source/WebCore/bindings/js/JSCustomXPathNSResolver.cpp
Source/WebCore/bindings/js/JSDOMBinding.cpp
Source/WebCore/bindings/js/JSDOMBinding.h
Source/WebCore/bindings/js/JSDOMFormDataCustom.cpp
Source/WebCore/bindings/js/JSDOMMimeTypeArrayCustom.cpp
Source/WebCore/bindings/js/JSDOMPluginArrayCustom.cpp
Source/WebCore/bindings/js/JSDOMPluginCustom.cpp
Source/WebCore/bindings/js/JSDOMStringListCustom.cpp
Source/WebCore/bindings/js/JSDOMStringMapCustom.cpp
Source/WebCore/bindings/js/JSDOMWindowBase.cpp
Source/WebCore/bindings/js/JSDOMWindowBase.h
Source/WebCore/bindings/js/JSDOMWindowCustom.cpp
Source/WebCore/bindings/js/JSDOMWindowShell.cpp
Source/WebCore/bindings/js/JSDedicatedWorkerGlobalScopeCustom.cpp
Source/WebCore/bindings/js/JSDocumentCustom.cpp
Source/WebCore/bindings/js/JSEventCustom.cpp
Source/WebCore/bindings/js/JSEventListener.cpp
Source/WebCore/bindings/js/JSEventTargetCustom.cpp
Source/WebCore/bindings/js/JSFileReaderCustom.cpp
Source/WebCore/bindings/js/JSHTMLAllCollectionCustom.cpp
Source/WebCore/bindings/js/JSHTMLCanvasElementCustom.cpp
Source/WebCore/bindings/js/JSHTMLCollectionCustom.cpp
Source/WebCore/bindings/js/JSHTMLDocumentCustom.cpp
Source/WebCore/bindings/js/JSHTMLElementCustom.cpp
Source/WebCore/bindings/js/JSHTMLFormControlsCollectionCustom.cpp
Source/WebCore/bindings/js/JSHTMLFormElementCustom.cpp
Source/WebCore/bindings/js/JSHTMLFrameElementCustom.cpp
Source/WebCore/bindings/js/JSHTMLFrameSetElementCustom.cpp
Source/WebCore/bindings/js/JSHTMLInputElementCustom.cpp
Source/WebCore/bindings/js/JSHTMLLinkElementCustom.cpp
Source/WebCore/bindings/js/JSHTMLMediaElementCustom.cpp
Source/WebCore/bindings/js/JSHTMLOptionsCollectionCustom.cpp
Source/WebCore/bindings/js/JSHTMLSelectElementCustom.cpp
Source/WebCore/bindings/js/JSHTMLTemplateElementCustom.cpp
Source/WebCore/bindings/js/JSHistoryCustom.cpp
Source/WebCore/bindings/js/JSIDBDatabaseCustom.cpp
Source/WebCore/bindings/js/JSIDBObjectStoreCustom.cpp
Source/WebCore/bindings/js/JSInjectedScriptHostCustom.cpp
Source/WebCore/bindings/js/JSInspectorFrontendHostCustom.cpp
Source/WebCore/bindings/js/JSJavaScriptCallFrameCustom.cpp
Source/WebCore/bindings/js/JSLocationCustom.cpp
Source/WebCore/bindings/js/JSMediaSourceStatesCustom.cpp
Source/WebCore/bindings/js/JSMessageEventCustom.cpp
Source/WebCore/bindings/js/JSMessagePortCustom.cpp
Source/WebCore/bindings/js/JSMutationObserverCustom.cpp
Source/WebCore/bindings/js/JSNamedNodeMapCustom.cpp
Source/WebCore/bindings/js/JSNodeCustom.cpp
Source/WebCore/bindings/js/JSNodeFilterCustom.cpp
Source/WebCore/bindings/js/JSNodeListCustom.cpp
Source/WebCore/bindings/js/JSOscillatorNodeCustom.cpp
Source/WebCore/bindings/js/JSPannerNodeCustom.cpp
Source/WebCore/bindings/js/JSPluginElementFunctions.cpp
Source/WebCore/bindings/js/JSPopStateEventCustom.cpp
Source/WebCore/bindings/js/JSRTCStatsResponseCustom.cpp
Source/WebCore/bindings/js/JSSVGElementInstanceCustom.cpp
Source/WebCore/bindings/js/JSSVGLengthCustom.cpp
Source/WebCore/bindings/js/JSSharedWorkerCustom.cpp
Source/WebCore/bindings/js/JSStorageCustom.cpp
Source/WebCore/bindings/js/JSStyleSheetCustom.cpp
Source/WebCore/bindings/js/JSStyleSheetListCustom.cpp
Source/WebCore/bindings/js/JSTextTrackCueCustom.cpp
Source/WebCore/bindings/js/JSTextTrackCustom.cpp
Source/WebCore/bindings/js/JSTextTrackListCustom.cpp
Source/WebCore/bindings/js/JSTrackCustom.cpp
Source/WebCore/bindings/js/JSTrackEventCustom.cpp
Source/WebCore/bindings/js/JSVideoTrackCustom.cpp
Source/WebCore/bindings/js/JSVideoTrackListCustom.cpp
Source/WebCore/bindings/js/JSWebGLRenderingContextCustom.cpp
Source/WebCore/bindings/js/JSWorkerCustom.cpp
Source/WebCore/bindings/js/JSWorkerGlobalScopeBase.h
Source/WebCore/bindings/js/JSWorkerGlobalScopeCustom.cpp
Source/WebCore/bindings/js/JSXMLHttpRequestCustom.cpp
Source/WebCore/bindings/js/JSXPathResultCustom.cpp
Source/WebCore/bindings/js/JSXSLTProcessorCustom.cpp
Source/WebCore/bindings/js/PageScriptDebugServer.cpp
Source/WebCore/bindings/js/ScheduledAction.cpp
Source/WebCore/bindings/js/ScriptCachedFrameData.cpp
Source/WebCore/bindings/js/ScriptController.cpp
Source/WebCore/bindings/js/ScriptDebugServer.cpp
Source/WebCore/bindings/js/ScriptState.cpp
Source/WebCore/bindings/objc/DOM.mm
Source/WebCore/bindings/objc/DOMImplementationFront.cpp
Source/WebCore/bindings/objc/DOMUtility.mm
Source/WebCore/bindings/objc/WebScriptObject.mm
Source/WebCore/bindings/scripts/CodeGeneratorJS.pm
Source/WebCore/bindings/scripts/test/JS/JSTestActiveDOMObject.cpp
Source/WebCore/bindings/scripts/test/JS/JSTestActiveDOMObject.h
Source/WebCore/bindings/scripts/test/JS/JSTestCustomNamedGetter.cpp
Source/WebCore/bindings/scripts/test/JS/JSTestCustomNamedGetter.h
Source/WebCore/bindings/scripts/test/JS/JSTestEventConstructor.cpp
Source/WebCore/bindings/scripts/test/JS/JSTestEventConstructor.h
Source/WebCore/bindings/scripts/test/JS/JSTestEventTarget.cpp
Source/WebCore/bindings/scripts/test/JS/JSTestEventTarget.h
Source/WebCore/bindings/scripts/test/JS/JSTestException.cpp
Source/WebCore/bindings/scripts/test/JS/JSTestException.h
Source/WebCore/bindings/scripts/test/JS/JSTestInterface.cpp
Source/WebCore/bindings/scripts/test/JS/JSTestInterface.h
Source/WebCore/bindings/scripts/test/JS/JSTestMediaQueryListListener.cpp
Source/WebCore/bindings/scripts/test/JS/JSTestMediaQueryListListener.h
Source/WebCore/bindings/scripts/test/JS/JSTestNamedConstructor.cpp
Source/WebCore/bindings/scripts/test/JS/JSTestNamedConstructor.h
Source/WebCore/bindings/scripts/test/JS/JSTestNode.cpp
Source/WebCore/bindings/scripts/test/JS/JSTestNode.h
Source/WebCore/bindings/scripts/test/JS/JSTestObj.cpp
Source/WebCore/bindings/scripts/test/JS/JSTestObj.h
Source/WebCore/bindings/scripts/test/JS/JSTestOverloadedConstructors.cpp
Source/WebCore/bindings/scripts/test/JS/JSTestOverloadedConstructors.h
Source/WebCore/bindings/scripts/test/JS/JSTestSerializedScriptValueInterface.cpp
Source/WebCore/bindings/scripts/test/JS/JSTestSerializedScriptValueInterface.h
Source/WebCore/bindings/scripts/test/JS/JSTestTypedefs.cpp
Source/WebCore/bindings/scripts/test/JS/JSTestTypedefs.h
Source/WebCore/bindings/scripts/test/JS/JSattribute.cpp
Source/WebCore/bindings/scripts/test/JS/JSattribute.h
Source/WebCore/bindings/scripts/test/JS/JSreadonly.cpp
Source/WebCore/bindings/scripts/test/JS/JSreadonly.h
Source/WebCore/bridge/runtime_method.cpp
Source/WebCore/svg/properties/SVGStaticListPropertyTearOff.h
Source/WebCore/svg/properties/SVGStaticPropertyTearOff.h
Source/WebCore/svg/properties/SVGStaticPropertyWithParentTearOff.h
Source/WebKit/efl/WebCoreSupport/DumpRenderTreeSupportEfl.cpp
Source/WebKit/mac/WebView/WebFrame.mm
Source/WebKit/mac/WebView/WebScriptDebugger.mm
Source/WebKit/win/WebFrame.cpp
Source/WebKit2/WebProcess/WebPage/WebFrame.cpp

index d0ffd41..0a665b7 100644 (file)
@@ -1,3 +1,13 @@
+2013-10-10  Andreas Kling  <akling@apple.com>
+
+        JS DOM wrappers' impl() functions should return references.
+        <https://webkit.org/b/122497>
+
+        Reviewed by Antti Koivisto.
+
+        JS DOM wrappers always have a corresponding WebCore object during
+        their lifetime, so make impl() return a reference.
+
 2013-10-10  Sergio Correia  <sergio.correia@openbossa.org>
 
         Fix debug build after r157210
index 73c995b..3605faf 100644 (file)
@@ -61,9 +61,9 @@ static bool canAccessDocument(BindingState* state, Document* targetDocument, Sec
     return false;
 }
 
-bool BindingSecurity::shouldAllowAccessToDOMWindow(BindingState* state, DOMWindow* target, SecurityReportingOption reportingOption)
+bool BindingSecurity::shouldAllowAccessToDOMWindow(BindingState* state, DOMWindow& target, SecurityReportingOption reportingOption)
 {
-    return target && canAccessDocument(state, target->document(), reportingOption);
+    return canAccessDocument(state, target.document(), reportingOption);
 }
 
 bool BindingSecurity::shouldAllowAccessToFrame(BindingState* state, Frame* target, SecurityReportingOption reportingOption)
index eea1668..24ac7a7 100644 (file)
@@ -47,7 +47,7 @@ enum SecurityReportingOption {
 class BindingSecurity {
 public:
     static bool shouldAllowAccessToNode(BindingState*, Node*);
-    static bool shouldAllowAccessToDOMWindow(BindingState*, DOMWindow*, SecurityReportingOption = ReportSecurityError);
+    static bool shouldAllowAccessToDOMWindow(BindingState*, DOMWindow&, SecurityReportingOption = ReportSecurityError);
     static bool shouldAllowAccessToFrame(BindingState*, Frame*, SecurityReportingOption = ReportSecurityError);
     static bool allowSettingFrameSrcToJavascriptUrl(BindingState*, HTMLFrameElementBase*, const String& value);
 };
index 825468b..5e84dc2 100644 (file)
@@ -39,12 +39,12 @@ namespace WebCore {
 
 DOMWindow* activeDOMWindow(ExecState* exec)
 {
-    return asJSDOMWindow(exec->lexicalGlobalObject())->impl();
+    return &asJSDOMWindow(exec->lexicalGlobalObject())->impl();
 }
 
 DOMWindow* firstDOMWindow(ExecState* exec)
 {
-    return asJSDOMWindow(exec->dynamicGlobalObject())->impl();
+    return &asJSDOMWindow(exec->dynamicGlobalObject())->impl();
 }
 
 }
index 476b721..07e1689 100644 (file)
@@ -47,7 +47,7 @@ void JSAttr::visitChildren(JSCell* cell, SlotVisitor& visitor)
     ASSERT(thisObject->structure()->typeInfo().overridesVisitChildren());
 
     Base::visitChildren(thisObject, visitor);
-    Element* element = thisObject->impl()->ownerElement();
+    Element* element = thisObject->impl().ownerElement();
     if (!element)
         return;
     visitor.addOpaqueRoot(root(element));
index 4e3daab..853576a 100644 (file)
@@ -40,14 +40,13 @@ namespace WebCore {
 
 void JSAudioBufferSourceNode::setBuffer(ExecState* exec, JSValue value)
 {
-    AudioBufferSourceNode* imp = impl();
     AudioBuffer* buffer = toAudioBuffer(value);
     if (!buffer) {
         exec->vm().throwException(exec, createTypeError(exec, "Value is not of type AudioBuffer"));
         return;
     }
     
-    if (!imp->setBuffer(buffer))
+    if (!impl().setBuffer(buffer))
         exec->vm().throwException(exec, createTypeError(exec, "AudioBuffer unsupported number of channels"));
 }
 
index f70bdbb..2929807 100644 (file)
@@ -43,8 +43,8 @@ void JSAudioTrack::visitChildren(JSCell* cell, SlotVisitor& visitor)
     ASSERT(jsAudioTrack->structure()->typeInfo().overridesVisitChildren());
     Base::visitChildren(jsAudioTrack, visitor);
 
-    AudioTrack* audioTrack = jsAudioTrack->impl();
-    visitor.addOpaqueRoot(root(audioTrack));
+    AudioTrack& audioTrack = jsAudioTrack->impl();
+    visitor.addOpaqueRoot(root(&audioTrack));
 }
 
 } // namespace WebCore
index 976ff4a..23fd0b9 100644 (file)
@@ -43,9 +43,9 @@ void JSAudioTrackList::visitChildren(JSCell* cell, SlotVisitor& visitor)
     ASSERT(jsAudioTrackList->structure()->typeInfo().overridesVisitChildren());
     Base::visitChildren(jsAudioTrackList, visitor);
 
-    AudioTrackList* audioTrackList = jsAudioTrackList->impl();
-    visitor.addOpaqueRoot(root(audioTrackList->element()));
-    audioTrackList->visitJSEventListeners(visitor);
+    AudioTrackList& audioTrackList = jsAudioTrackList->impl();
+    visitor.addOpaqueRoot(root(audioTrackList.element()));
+    audioTrackList.visitJSEventListeners(visitor);
 }
 
 } // namespace WebCore
index 7eb7646..fe342b8 100644 (file)
@@ -38,12 +38,10 @@ namespace WebCore {
 
 void JSBiquadFilterNode::setType(ExecState* exec, JSValue value)
 {
-    BiquadFilterNode* imp = impl();
-
 #if ENABLE(LEGACY_WEB_AUDIO)
     if (value.isNumber()) {
         uint32_t type = value.toUInt32(exec);
-        if (!imp->setType(type))
+        if (!impl().setType(type))
             exec->vm().throwException(exec, createTypeError(exec, "Illegal BiquadFilterNode type"));
         return;
     }
@@ -52,7 +50,7 @@ void JSBiquadFilterNode::setType(ExecState* exec, JSValue value)
     if (value.isString()) {
         String type = value.toString(exec)->value(exec);
         if (type == "lowpass" || type == "highpass" || type == "bandpass" || type == "lowshelf" || type == "highshelf" || type == "peaking" || type == "notch" || type == "allpass") {
-            imp->setType(type);
+            impl().setType(type);
             return;
         }
     }
index e3c4b68..dc90530 100644 (file)
@@ -65,7 +65,7 @@ void JSCSSRule::visitChildren(JSCell* cell, SlotVisitor& visitor)
     COMPILE_ASSERT(StructureFlags & OverridesVisitChildren, OverridesVisitChildrenWithoutSettingFlag);
     ASSERT(thisObject->structure()->typeInfo().overridesVisitChildren());
     Base::visitChildren(thisObject, visitor);
-    visitor.addOpaqueRoot(root(thisObject->impl()));
+    visitor.addOpaqueRoot(root(&thisObject->impl()));
 }
 
 JSValue toJS(ExecState* exec, JSDOMGlobalObject* globalObject, CSSRule* rule)
index f60c7a1..d4c22a8 100644 (file)
@@ -41,9 +41,9 @@ bool JSCSSRuleListOwner::isReachableFromOpaqueRoots(JSC::Handle<JSC::Unknown> ha
     JSCSSRuleList* jsCSSRuleList = jsCast<JSCSSRuleList*>(handle.get().asCell());
     if (!jsCSSRuleList->hasCustomProperties())
         return false;
-    if (CSSStyleSheet* styleSheet = jsCSSRuleList->impl()->styleSheet())
+    if (CSSStyleSheet* styleSheet = jsCSSRuleList->impl().styleSheet())
         return visitor.containsOpaqueRoot(root(styleSheet));
-    if (CSSRule* cssRule = jsCSSRuleList->impl()->item(0))
+    if (CSSRule* cssRule = jsCSSRuleList->impl().item(0))
         return visitor.containsOpaqueRoot(root(cssRule));
     return false;
 }
index 0c93cee..ff09ccc 100644 (file)
@@ -56,7 +56,7 @@ void JSCSSStyleDeclaration::visitChildren(JSCell* cell, SlotVisitor& visitor)
     COMPILE_ASSERT(StructureFlags & OverridesVisitChildren, OverridesVisitChildrenWithoutSettingFlag);
     ASSERT(thisObject->structure()->typeInfo().overridesVisitChildren());
     Base::visitChildren(thisObject, visitor);
-    visitor.addOpaqueRoot(root(thisObject->impl()));
+    visitor.addOpaqueRoot(root(&thisObject->impl()));
 }
 
 class CSSPropertyInfo {
@@ -284,7 +284,7 @@ static inline JSValue getPropertyValueFallback(ExecState* exec, JSCSSStyleDeclar
 {
     // If the property is a shorthand property (such as "padding"),
     // it can only be accessed using getPropertyValue.
-    return jsStringWithCache(exec, thisObj->impl()->getPropertyValueInternal(static_cast<CSSPropertyID>(index)));
+    return jsStringWithCache(exec, thisObj->impl().getPropertyValueInternal(static_cast<CSSPropertyID>(index)));
 }
 
 static inline JSValue cssPropertyGetterPixelOrPosPrefix(ExecState* exec, JSCSSStyleDeclaration* thisObj, unsigned propertyID)
@@ -294,7 +294,7 @@ static inline JSValue cssPropertyGetterPixelOrPosPrefix(ExecState* exec, JSCSSSt
     // posTop returns "CSS top" as number value in unit pixels _if_ its a
     // positioned element. if it is not a positioned element, return 0
     // from MSIE documentation FIXME: IMPLEMENT THAT (Dirk)
-    RefPtr<CSSValue> v = thisObj->impl()->getPropertyCSSValueInternal(static_cast<CSSPropertyID>(propertyID));
+    RefPtr<CSSValue> v = thisObj->impl().getPropertyCSSValueInternal(static_cast<CSSPropertyID>(propertyID));
     if (v) {
         if (v->isPrimitiveValue())
             return jsNumber(static_pointer_cast<CSSPrimitiveValue>(v)->getFloatValue(CSSPrimitiveValue::CSS_PX));
@@ -311,7 +311,7 @@ static JSValue cssPropertyGetterPixelOrPosPrefixCallback(ExecState* exec, JSValu
 
 static inline JSValue cssPropertyGetter(ExecState* exec, JSCSSStyleDeclaration* thisObj, unsigned propertyID)
 {
-    RefPtr<CSSValue> v = thisObj->impl()->getPropertyCSSValueInternal(static_cast<CSSPropertyID>(propertyID));
+    RefPtr<CSSValue> v = thisObj->impl().getPropertyCSSValueInternal(static_cast<CSSPropertyID>(propertyID));
     if (v)
         return jsStringOrNull(exec, v->cssText());
 
@@ -356,7 +356,7 @@ bool JSCSSStyleDeclaration::putDelegate(ExecState* exec, PropertyName propertyNa
     }
 
     ExceptionCode ec = 0;
-    impl()->setPropertyInternal(static_cast<CSSPropertyID>(propertyInfo.propertyID), propValue, important, ec);
+    impl().setPropertyInternal(static_cast<CSSPropertyID>(propertyInfo.propertyID), propValue, important, ec);
     setDOMException(exec, ec);
     return true;
 }
@@ -367,11 +367,11 @@ JSValue JSCSSStyleDeclaration::getPropertyCSSValue(ExecState* exec)
     if (exec->hadException())
         return jsUndefined();
 
-    RefPtr<CSSValue> cssValue = impl()->getPropertyCSSValue(propertyName);
+    RefPtr<CSSValue> cssValue = impl().getPropertyCSSValue(propertyName);
     if (!cssValue)
         return jsNull();
 
-    currentWorld(exec).m_cssValueRoots.add(cssValue.get(), root(impl())); // Balanced by JSCSSValueOwner::finalize().
+    currentWorld(exec).m_cssValueRoots.add(cssValue.get(), root(&impl())); // Balanced by JSCSSValueOwner::finalize().
     return toJS(exec, globalObject(), WTF::getPtr(cssValue));
 }
 
@@ -380,7 +380,7 @@ void JSCSSStyleDeclaration::getOwnPropertyNames(JSObject* object, ExecState* exe
     JSCSSStyleDeclaration* thisObject = jsCast<JSCSSStyleDeclaration*>(object);
     ASSERT_GC_OBJECT_INHERITS(thisObject, info());
 
-    unsigned length = thisObject->impl()->length();
+    unsigned length = thisObject->impl().length();
     for (unsigned i = 0; i < length; ++i)
         propertyNames.add(Identifier::from(exec, i));
 
index 81863e5..feee014 100644 (file)
@@ -61,7 +61,7 @@ bool JSCSSValueOwner::isReachableFromOpaqueRoots(JSC::Handle<JSC::Unknown> handl
     if (!jsCSSValue->hasCustomProperties())
         return false;
     DOMWrapperWorld* world = static_cast<DOMWrapperWorld*>(context);
-    void* root = world->m_cssValueRoots.get(jsCSSValue->impl());
+    void* root = world->m_cssValueRoots.get(&jsCSSValue->impl());
     if (!root)
         return false;
     return visitor.containsOpaqueRoot(root);
@@ -71,8 +71,8 @@ void JSCSSValueOwner::finalize(JSC::Handle<JSC::Unknown> handle, void* context)
 {
     JSCSSValue* jsCSSValue = jsCast<JSCSSValue*>(handle.get().asCell());
     DOMWrapperWorld& world = *static_cast<DOMWrapperWorld*>(context);
-    world.m_cssValueRoots.remove(jsCSSValue->impl());
-    uncacheWrapper(world, jsCSSValue->impl(), jsCSSValue);
+    world.m_cssValueRoots.remove(&jsCSSValue->impl());
+    uncacheWrapper(world, &jsCSSValue->impl(), jsCSSValue);
     jsCSSValue->releaseImpl();
 }
 
index cd9dcba..efa539f 100644 (file)
@@ -53,46 +53,45 @@ static CanvasStyle toHTMLCanvasStyle(ExecState*, JSValue value)
         return CanvasStyle();
     JSObject* object = asObject(value);
     if (object->inherits(JSCanvasGradient::info()))
-        return CanvasStyle(jsCast<JSCanvasGradient*>(object)->impl());
+        return CanvasStyle(&jsCast<JSCanvasGradient*>(object)->impl());
     if (object->inherits(JSCanvasPattern::info()))
-        return CanvasStyle(jsCast<JSCanvasPattern*>(object)->impl());
+        return CanvasStyle(&jsCast<JSCanvasPattern*>(object)->impl());
     return CanvasStyle();
 }
 
 JSValue JSCanvasRenderingContext2D::strokeStyle(ExecState* exec) const
 {
-    return toJS(exec, globalObject(), impl()->strokeStyle());
+    return toJS(exec, globalObject(), impl().strokeStyle());
 }
 
 void JSCanvasRenderingContext2D::setStrokeStyle(ExecState* exec, JSValue value)
 {
-    CanvasRenderingContext2D* context = impl();
+    CanvasRenderingContext2D& context = impl();
     if (value.isString()) {
-        context->setStrokeColor(asString(value)->value(exec));
+        context.setStrokeColor(asString(value)->value(exec));
         return;
     }
-    context->setStrokeStyle(toHTMLCanvasStyle(exec, value));
+    context.setStrokeStyle(toHTMLCanvasStyle(exec, value));
 }
 
 JSValue JSCanvasRenderingContext2D::fillStyle(ExecState* exec) const
 {
-    return toJS(exec, globalObject(), impl()->fillStyle());
+    return toJS(exec, globalObject(), impl().fillStyle());
 }
 
 void JSCanvasRenderingContext2D::setFillStyle(ExecState* exec, JSValue value)
 {
-    CanvasRenderingContext2D* context = impl();
+    CanvasRenderingContext2D& context = impl();
     if (value.isString()) {
-        context->setFillColor(asString(value)->value(exec));
+        context.setFillColor(asString(value)->value(exec));
         return;
     }
-    context->setFillStyle(toHTMLCanvasStyle(exec, value));
+    context.setFillStyle(toHTMLCanvasStyle(exec, value));
 }
 
 JSValue JSCanvasRenderingContext2D::webkitLineDash(ExecState* exec) const
 {
-    CanvasRenderingContext2D* context = impl();
-    const Vector<float>& dash = context->getLineDash();
+    const Vector<float>& dash = impl().getLineDash();
 
     MarkedArgumentBuffer list;
     Vector<float>::const_iterator end = dash.end();
@@ -116,7 +115,7 @@ void JSCanvasRenderingContext2D::setWebkitLineDash(ExecState* exec, JSValue valu
         dash.append(elem);
     }
 
-    impl()->setWebkitLineDash(dash);
+    impl().setWebkitLineDash(dash);
 }
 
 } // namespace WebCore
index 57e5f3a..161eb47 100644 (file)
@@ -47,7 +47,7 @@ void JSCanvasRenderingContext::visitChildren(JSCell* cell, SlotVisitor& visitor)
     ASSERT(thisObject->structure()->typeInfo().overridesVisitChildren());
     Base::visitChildren(thisObject, visitor);
 
-    visitor.addOpaqueRoot(root(thisObject->impl()->canvas()));
+    visitor.addOpaqueRoot(root(thisObject->impl().canvas()));
 }
 
 JSC::JSValue toJS(JSC::ExecState* exec, JSDOMGlobalObject* globalObject, CanvasRenderingContext* object)
index 03c943e..4731444 100644 (file)
@@ -37,7 +37,7 @@ namespace WebCore {
 
 JSValue JSClipboard::types(ExecState* exec) const
 {
-    Vector<String> types = impl()->types();
+    Vector<String> types = impl().types();
     return types.isEmpty() ? jsNull() : jsArray(exec, globalObject(), types);
 }
 
index 2208971..9d11771 100644 (file)
@@ -46,7 +46,7 @@ JSValue JSCrypto::getRandomValues(ExecState* exec)
         return throwTypeError(exec);
 
     ExceptionCode ec = 0;
-    impl()->getRandomValues(arrayBufferView.get(), ec);
+    impl().getRandomValues(arrayBufferView.get(), ec);
 
     if (ec) {
         setDOMException(exec, ec);
index 84e711b..9a52427 100644 (file)
@@ -80,7 +80,7 @@ String JSCustomXPathNSResolver::lookupNamespaceURI(const String& prefix)
         callType = m_customResolver->methodTable()->getCallData(m_customResolver.get(), callData);
         if (callType == CallTypeNone) {
             // FIXME: <http://webkit.org/b/114312> JSCustomXPathNSResolver::lookupNamespaceURI Console Message should include Line, Column, and SourceURL
-            if (PageConsole* console = m_globalObject->impl()->pageConsole())
+            if (PageConsole* console = m_globalObject->impl().pageConsole())
                 console->addMessage(JSMessageSource, ErrorMessageLevel, "XPathNSResolver does not have a lookupNamespaceURI method.");
             return String();
         }
index 97e8b03..6a9be46 100644 (file)
@@ -156,7 +156,7 @@ void reportException(ExecState* exec, JSValue exception, CachedScript* cachedScr
 
     JSDOMGlobalObject* globalObject = jsCast<JSDOMGlobalObject*>(exec->lexicalGlobalObject());
     if (JSDOMWindow* window = jsDynamicCast<JSDOMWindow*>(globalObject)) {
-        if (!window->impl()->isCurrentlyDisplayedInFrame())
+        if (!window->impl().isCurrentlyDisplayedInFrame())
             return;
     }
 
@@ -255,13 +255,11 @@ bool shouldAllowAccessToFrame(ExecState* exec, Frame* frame, String& message)
     return false;
 }
 
-bool shouldAllowAccessToDOMWindow(ExecState* exec, DOMWindow* target, String& message)
+bool shouldAllowAccessToDOMWindow(ExecState* exec, DOMWindow& target, String& message)
 {
-    if (!target)
-        return false;
     if (BindingSecurity::shouldAllowAccessToDOMWindow(exec, target, DoNotReportSecurityError))
         return true;
-    message = target->crossDomainAccessErrorMessage(activeDOMWindow(exec));
+    message = target.crossDomainAccessErrorMessage(activeDOMWindow(exec));
     return false;
 }
 
index de37b07..13a8c65 100644 (file)
@@ -558,7 +558,7 @@ class DOMStringList;
     bool shouldAllowAccessToNode(JSC::ExecState*, Node*);
     bool shouldAllowAccessToFrame(JSC::ExecState*, Frame*);
     bool shouldAllowAccessToFrame(JSC::ExecState*, Frame*, String& message);
-    bool shouldAllowAccessToDOMWindow(BindingState*, DOMWindow*, String& message);
+    bool shouldAllowAccessToDOMWindow(BindingState*, DOMWindow&, String& message);
 
     void printErrorMessageForFrame(Frame*, const String& message);
     JSC::JSValue objectToStringFunctionGetter(JSC::ExecState*, JSC::JSValue, JSC::PropertyName);
index bd82f78..6d371b3 100644 (file)
@@ -43,7 +43,7 @@ namespace WebCore {
 
 static HTMLFormElement* toHTMLFormElement(JSC::JSValue value)
 {
-    return value.inherits(JSHTMLFormElement::info()) ? jsCast<JSHTMLFormElement*>(asObject(value))->impl() : 0;
+    return value.inherits(JSHTMLFormElement::info()) ? &jsCast<JSHTMLFormElement*>(asObject(value))->impl() : 0;
 }
 
 EncodedJSValue JSC_HOST_CALL JSDOMFormDataConstructor::constructJSDOMFormData(ExecState* exec)
@@ -66,9 +66,9 @@ JSValue JSDOMFormData::append(ExecState* exec)
             String filename;
             if (exec->argumentCount() >= 3 && !exec->argument(2).isUndefinedOrNull())
                 filename = exec->argument(2).toString(exec)->value(exec);
-            impl()->append(name, toBlob(value), filename);
+            impl().append(name, toBlob(value), filename);
         } else
-            impl()->append(name, value.toString(exec)->value(exec));
+            impl().append(name, value.toString(exec)->value(exec));
     }
 
     return jsUndefined();
index 2cb94f9..2985bdf 100644 (file)
@@ -36,7 +36,7 @@ bool JSDOMMimeTypeArray::canGetItemsForName(ExecState*, DOMMimeTypeArray* mimeTy
 JSValue JSDOMMimeTypeArray::nameGetter(ExecState* exec, JSValue slotBase, PropertyName propertyName)
 {
     JSDOMMimeTypeArray* thisObj = jsCast<JSDOMMimeTypeArray*>(asObject(slotBase));
-    return toJS(exec, thisObj->globalObject(), thisObj->impl()->namedItem(propertyNameToAtomicString(propertyName)));
+    return toJS(exec, thisObj->globalObject(), thisObj->impl().namedItem(propertyNameToAtomicString(propertyName)));
 }
 
 } // namespace WebCore
index c19d5c7..7e165d5 100644 (file)
@@ -36,7 +36,7 @@ bool JSDOMPluginArray::canGetItemsForName(ExecState*, DOMPluginArray* pluginArra
 JSValue JSDOMPluginArray::nameGetter(ExecState* exec, JSValue slotBase, PropertyName propertyName)
 {
     JSDOMPluginArray* thisObj = jsCast<JSDOMPluginArray*>(asObject(slotBase));
-    return toJS(exec, thisObj->globalObject(), thisObj->impl()->namedItem(propertyNameToAtomicString(propertyName)));
+    return toJS(exec, thisObj->globalObject(), thisObj->impl().namedItem(propertyNameToAtomicString(propertyName)));
 }
 
 } // namespace WebCore
index a8b91d2..c196106 100644 (file)
@@ -35,7 +35,7 @@ bool JSDOMPlugin::canGetItemsForName(ExecState*, DOMPlugin* plugin, PropertyName
 JSValue JSDOMPlugin::nameGetter(ExecState* exec, JSValue slotBase, PropertyName propertyName)
 {
     JSDOMPlugin* thisObj = jsCast<JSDOMPlugin*>(asObject(slotBase));
-    return toJS(exec, thisObj->globalObject(), thisObj->impl()->namedItem(propertyNameToAtomicString(propertyName)));
+    return toJS(exec, thisObj->globalObject(), thisObj->impl().namedItem(propertyNameToAtomicString(propertyName)));
 }
 
 } // namespace WebCore
index 96b707d..b73378d 100644 (file)
@@ -26,7 +26,7 @@ namespace WebCore {
 PassRefPtr<DOMStringList> toDOMStringList(ExecState* exec, JSValue value)
 {
     if (value.inherits(JSDOMStringList::info()))
-        return jsCast<JSDOMStringList*>(asObject(value))->impl();
+        return &jsCast<JSDOMStringList*>(asObject(value))->impl();
 
     if (!isJSArray(value))
         return 0;
index 06c1de1..5ea6752 100644 (file)
@@ -43,7 +43,7 @@ bool JSDOMStringMap::canGetItemsForName(ExecState*, DOMStringMap* impl, Property
 JSValue JSDOMStringMap::nameGetter(ExecState* exec, JSValue slotBase, PropertyName propertyName)
 {
     JSDOMStringMap* thisObj = jsCast<JSDOMStringMap*>(asObject(slotBase));
-    return jsStringWithCache(exec, thisObj->impl()->item(propertyNameToAtomicString(propertyName)));
+    return jsStringWithCache(exec, thisObj->impl().item(propertyNameToAtomicString(propertyName)));
 }
 
 void JSDOMStringMap::getOwnPropertyNames(JSObject* object, ExecState* exec, PropertyNameArray& propertyNames, EnumerationMode mode)
@@ -81,7 +81,7 @@ bool JSDOMStringMap::putDelegate(ExecState* exec, PropertyName propertyName, JSV
     if (exec->hadException())
         return false;
     ExceptionCode ec = 0;
-    impl()->setItem(propertyNameToString(propertyName), stringValue, ec);
+    impl().setItem(propertyNameToString(propertyName), stringValue, ec);
     setDOMException(exec, ec);
     return !ec;
 }
index c29e6d5..839f7b3 100644 (file)
@@ -92,7 +92,7 @@ ScriptExecutionContext* JSDOMWindowBase::scriptExecutionContext() const
 
 void JSDOMWindowBase::printErrorMessage(const String& message) const
 {
-    printErrorMessageForFrame(impl()->frame(), message);
+    printErrorMessageForFrame(impl().frame(), message);
 }
 
 bool JSDOMWindowBase::supportsProfiling(const JSGlobalObject* object)
@@ -102,7 +102,7 @@ bool JSDOMWindowBase::supportsProfiling(const JSGlobalObject* object)
     return false;
 #else
     const JSDOMWindowBase* thisObject = static_cast<const JSDOMWindowBase*>(object);
-    Frame* frame = thisObject->impl()->frame();
+    Frame* frame = thisObject->impl().frame();
     if (!frame)
         return false;
 
@@ -121,7 +121,7 @@ bool JSDOMWindowBase::supportsRichSourceInfo(const JSGlobalObject* object)
     return false;
 #else
     const JSDOMWindowBase* thisObject = static_cast<const JSDOMWindowBase*>(object);
-    Frame* frame = thisObject->impl()->frame();
+    Frame* frame = thisObject->impl().frame();
     if (!frame)
         return false;
 
@@ -139,8 +139,8 @@ bool JSDOMWindowBase::supportsRichSourceInfo(const JSGlobalObject* object)
 bool JSDOMWindowBase::shouldInterruptScript(const JSGlobalObject* object)
 {
     const JSDOMWindowBase* thisObject = static_cast<const JSDOMWindowBase*>(object);
-    ASSERT(thisObject->impl()->frame());
-    Page* page = thisObject->impl()->frame()->page();
+    ASSERT(thisObject->impl().frame());
+    Page* page = thisObject->impl().frame()->page();
 
     // See <rdar://problem/5479443>. We don't think that page can ever be NULL
     // in this case, but if it is, we've gotten into a state where we may have
@@ -158,7 +158,7 @@ bool JSDOMWindowBase::shouldInterruptScript(const JSGlobalObject* object)
 bool JSDOMWindowBase::javaScriptExperimentsEnabled(const JSGlobalObject* object)
 {
     const JSDOMWindowBase* thisObject = static_cast<const JSDOMWindowBase*>(object);
-    Frame* frame = thisObject->impl()->frame();
+    Frame* frame = thisObject->impl().frame();
     if (!frame)
         return false;
     return frame->settings().javaScriptExperimentsEnabled();
index 8ca50b5..659ce0f 100644 (file)
@@ -45,7 +45,7 @@ namespace WebCore {
     public:
         void updateDocument();
 
-        DOMWindow* impl() const { return m_impl.get(); }
+        DOMWindow& impl() const { return *m_impl; }
         ScriptExecutionContext* scriptExecutionContext() const;
 
         // Called just before removing this window from the JSDOMWindowShell.
index d4067c2..52e20d1 100644 (file)
@@ -65,8 +65,8 @@ void JSDOMWindow::visitChildren(JSCell* cell, SlotVisitor& visitor)
     ASSERT(thisObject->structure()->typeInfo().overridesVisitChildren());
     Base::visitChildren(thisObject, visitor);
 
-    thisObject->impl()->visitJSEventListeners(visitor);
-    if (Frame* frame = thisObject->impl()->frame())
+    thisObject->impl().visitJSEventListeners(visitor);
+    if (Frame* frame = thisObject->impl().frame())
         visitor.addOpaqueRoot(frame);
 }
 
@@ -78,18 +78,18 @@ JSValue nonCachingStaticFunctionGetter(ExecState* exec, JSValue, PropertyName pr
 
 static JSValue childFrameGetter(ExecState* exec, JSValue slotBase, PropertyName propertyName)
 {
-    return toJS(exec, jsCast<JSDOMWindow*>(asObject(slotBase))->impl()->frame()->tree().scopedChild(propertyNameToAtomicString(propertyName))->document()->domWindow());
+    return toJS(exec, jsCast<JSDOMWindow*>(asObject(slotBase))->impl().frame()->tree().scopedChild(propertyNameToAtomicString(propertyName))->document()->domWindow());
 }
 
 static JSValue indexGetter(ExecState* exec, JSValue slotBase, unsigned index)
 {
-    return toJS(exec, jsCast<JSDOMWindow*>(asObject(slotBase))->impl()->frame()->tree().scopedChild(index)->document()->domWindow());
+    return toJS(exec, jsCast<JSDOMWindow*>(asObject(slotBase))->impl().frame()->tree().scopedChild(index)->document()->domWindow());
 }
 
 static JSValue namedItemGetter(ExecState* exec, JSValue slotBase, PropertyName propertyName)
 {
     JSDOMWindowBase* thisObj = jsCast<JSDOMWindow*>(asObject(slotBase));
-    Document* document = thisObj->impl()->frame()->document();
+    Document* document = thisObj->impl().frame()->document();
 
     ASSERT(BindingSecurity::shouldAllowAccessToDOMWindow(exec, thisObj->impl()));
     ASSERT(document);
@@ -121,7 +121,7 @@ bool JSDOMWindow::getOwnPropertySlot(JSObject* object, ExecState* exec, Property
     // We don't want any properties other than "close" and "closed" on a frameless window (i.e. one whose page got closed,
     // or whose iframe got removed).
     // FIXME: This doesn't fully match Firefox, which allows at least toString in addition to those.
-    if (!thisObject->impl()->frame()) {
+    if (!thisObject->impl().frame()) {
         // The following code is safe for cross-domain and same domain use.
         // It ignores any custom properties that might be set on the DOMWindow (including a custom prototype).
         entry = s_info.propHashTable(exec)->entry(exec, propertyName);
@@ -180,7 +180,7 @@ bool JSDOMWindow::getOwnPropertySlot(JSObject* object, ExecState* exec, Property
                     return true;
                 }
             } else if (entry->function() == jsDOMWindowPrototypeFunctionShowModalDialog) {
-                if (!DOMWindow::canShowModalDialog(thisObject->impl()->frame())) {
+                if (!DOMWindow::canShowModalDialog(thisObject->impl().frame())) {
                     slot.setUndefined();
                     return true;
                 }
@@ -207,7 +207,7 @@ bool JSDOMWindow::getOwnPropertySlot(JSObject* object, ExecState* exec, Property
     // naming frames things that conflict with window properties that
     // are in Moz but not IE. Since we have some of these, we have to do
     // it the Moz way.
-    if (thisObject->impl()->frame()->tree().scopedChild(propertyNameToAtomicString(propertyName))) {
+    if (thisObject->impl().frame()->tree().scopedChild(propertyNameToAtomicString(propertyName))) {
         slot.setCustom(thisObject, ReadOnly | DontDelete | DontEnum, childFrameGetter);
         return true;
     }
@@ -230,7 +230,7 @@ bool JSDOMWindow::getOwnPropertySlot(JSObject* object, ExecState* exec, Property
 
     // allow window[1] or parent[1] etc. (#56983)
     unsigned i = propertyName.asIndex();
-    if (i < thisObject->impl()->frame()->tree().scopedChildCount()) {
+    if (i < thisObject->impl().frame()->tree().scopedChildCount()) {
         ASSERT(i != PropertyName::NotAnIndex);
         slot.setCustomIndex(thisObject, ReadOnly | DontDelete | DontEnum, i, indexGetter);
         return true;
@@ -243,7 +243,7 @@ bool JSDOMWindow::getOwnPropertySlot(JSObject* object, ExecState* exec, Property
     }
 
     // Allow shortcuts like 'Image1' instead of document.images.Image1
-    Document* document = thisObject->impl()->frame()->document();
+    Document* document = thisObject->impl().frame()->document();
     if (document->isHTMLDocument()) {
         AtomicStringImpl* atomicPropertyName = findAtomicString(propertyName);
         if (atomicPropertyName && toHTMLDocument(document)->hasWindowNamedItem(*atomicPropertyName)) {
@@ -259,7 +259,7 @@ bool JSDOMWindow::getOwnPropertySlotByIndex(JSObject* object, ExecState* exec, u
 {
     JSDOMWindow* thisObject = jsCast<JSDOMWindow*>(object);
     
-    if (!thisObject->impl()->frame()) {
+    if (!thisObject->impl().frame()) {
         // FIXME: We should have a message here that explains why the property access/function call was
         // not allowed. 
         slot.setUndefined();
@@ -284,7 +284,7 @@ bool JSDOMWindow::getOwnPropertySlotByIndex(JSObject* object, ExecState* exec, u
     // naming frames things that conflict with window properties that
     // are in Moz but not IE. Since we have some of these, we have to do
     // it the Moz way.
-    if (thisObject->impl()->frame()->tree().scopedChild(propertyNameToAtomicString(propertyName))) {
+    if (thisObject->impl().frame()->tree().scopedChild(propertyNameToAtomicString(propertyName))) {
         slot.setCustom(thisObject, ReadOnly | DontDelete | DontEnum, childFrameGetter);
         return true;
     }
@@ -306,7 +306,7 @@ bool JSDOMWindow::getOwnPropertySlotByIndex(JSObject* object, ExecState* exec, u
     // We need to test the correct priority order.
 
     // allow window[1] or parent[1] etc. (#56983)
-    if (index < thisObject->impl()->frame()->tree().scopedChildCount()) {
+    if (index < thisObject->impl().frame()->tree().scopedChildCount()) {
         ASSERT(index != PropertyName::NotAnIndex);
         slot.setCustomIndex(thisObject, ReadOnly | DontDelete | DontEnum, index, indexGetter);
         return true;
@@ -319,7 +319,7 @@ bool JSDOMWindow::getOwnPropertySlotByIndex(JSObject* object, ExecState* exec, u
     }
 
     // Allow shortcuts like 'Image1' instead of document.images.Image1
-    Document* document = thisObject->impl()->frame()->document();
+    Document* document = thisObject->impl().frame()->document();
     if (document->isHTMLDocument()) {
         AtomicStringImpl* atomicPropertyName = findAtomicString(propertyName);
         if (atomicPropertyName && toHTMLDocument(document)->hasWindowNamedItem(*atomicPropertyName)) {
@@ -334,7 +334,7 @@ bool JSDOMWindow::getOwnPropertySlotByIndex(JSObject* object, ExecState* exec, u
 void JSDOMWindow::put(JSCell* cell, ExecState* exec, PropertyName propertyName, JSValue value, PutPropertySlot& slot)
 {
     JSDOMWindow* thisObject = jsCast<JSDOMWindow*>(cell);
-    if (!thisObject->impl()->frame())
+    if (!thisObject->impl().frame())
         return;
 
     // Optimization: access JavaScript global variables directly before involving the DOM.
@@ -354,7 +354,7 @@ void JSDOMWindow::put(JSCell* cell, ExecState* exec, PropertyName propertyName,
 void JSDOMWindow::putByIndex(JSCell* cell, ExecState* exec, unsigned index, JSValue value, bool shouldThrow)
 {
     JSDOMWindow* thisObject = jsCast<JSDOMWindow*>(cell);
-    if (!thisObject->impl()->frame())
+    if (!thisObject->impl().frame())
         return;
     
     PropertyName propertyName = Identifier::from(exec, index);
@@ -440,7 +440,7 @@ void JSDOMWindow::setLocation(ExecState* exec, JSValue value)
     if (exec->hadException())
         return;
 
-    if (Location* location = impl()->location())
+    if (Location* location = impl().location())
         location->setHref(locationString, activeDOMWindow(exec), firstDOMWindow(exec));
 }
 
@@ -471,7 +471,7 @@ JSValue JSDOMWindow::open(ExecState* exec)
     if (exec->hadException())
         return jsUndefined();
 
-    RefPtr<DOMWindow> openedWindow = impl()->open(urlString, frameName, windowFeaturesString, activeDOMWindow(exec), firstDOMWindow(exec));
+    RefPtr<DOMWindow> openedWindow = impl().open(urlString, frameName, windowFeaturesString, activeDOMWindow(exec), firstDOMWindow(exec));
     if (!openedWindow)
         return jsUndefined();
     return toJS(exec, openedWindow.get());
@@ -530,7 +530,7 @@ JSValue JSDOMWindow::showModalDialog(ExecState* exec)
 
     DialogHandler handler(exec);
 
-    impl()->showModalDialog(urlString, dialogFeaturesString, activeDOMWindow(exec), firstDOMWindow(exec), setUpDialog, &handler);
+    impl().showModalDialog(urlString, dialogFeaturesString, activeDOMWindow(exec), firstDOMWindow(exec), setUpDialog, &handler);
 
     return handler.returnValue();
 }
@@ -578,12 +578,12 @@ static JSValue handlePostMessage(DOMWindow* impl, ExecState* exec)
 
 JSValue JSDOMWindow::postMessage(ExecState* exec)
 {
-    return handlePostMessage(impl(), exec);
+    return handlePostMessage(&impl(), exec);
 }
 
 JSValue JSDOMWindow::setTimeout(ExecState* exec)
 {
-    ContentSecurityPolicy* contentSecurityPolicy = impl()->document() ? impl()->document()->contentSecurityPolicy() : 0;
+    ContentSecurityPolicy* contentSecurityPolicy = impl().document() ? impl().document()->contentSecurityPolicy() : 0;
     OwnPtr<ScheduledAction> action = ScheduledAction::create(exec, currentWorld(exec), contentSecurityPolicy);
     if (exec->hadException())
         return jsUndefined();
@@ -594,7 +594,7 @@ JSValue JSDOMWindow::setTimeout(ExecState* exec)
     int delay = exec->argument(1).toInt32(exec);
 
     ExceptionCode ec = 0;
-    int result = impl()->setTimeout(action.release(), delay, ec);
+    int result = impl().setTimeout(action.release(), delay, ec);
     setDOMException(exec, ec);
 
     return jsNumber(result);
@@ -602,7 +602,7 @@ JSValue JSDOMWindow::setTimeout(ExecState* exec)
 
 JSValue JSDOMWindow::setInterval(ExecState* exec)
 {
-    ContentSecurityPolicy* contentSecurityPolicy = impl()->document() ? impl()->document()->contentSecurityPolicy() : 0;
+    ContentSecurityPolicy* contentSecurityPolicy = impl().document() ? impl().document()->contentSecurityPolicy() : 0;
     OwnPtr<ScheduledAction> action = ScheduledAction::create(exec, currentWorld(exec), contentSecurityPolicy);
     if (exec->hadException())
         return jsUndefined();
@@ -612,7 +612,7 @@ JSValue JSDOMWindow::setInterval(ExecState* exec)
         return jsNumber(0);
 
     ExceptionCode ec = 0;
-    int result = impl()->setInterval(action.release(), delay, ec);
+    int result = impl().setInterval(action.release(), delay, ec);
     setDOMException(exec, ec);
 
     return jsNumber(result);
@@ -620,7 +620,7 @@ JSValue JSDOMWindow::setInterval(ExecState* exec)
 
 JSValue JSDOMWindow::addEventListener(ExecState* exec)
 {
-    Frame* frame = impl()->frame();
+    Frame* frame = impl().frame();
     if (!frame)
         return jsUndefined();
 
@@ -628,13 +628,13 @@ JSValue JSDOMWindow::addEventListener(ExecState* exec)
     if (!listener.isObject())
         return jsUndefined();
 
-    impl()->addEventListener(exec->argument(0).toString(exec)->value(exec), JSEventListener::create(asObject(listener), this, false, currentWorld(exec)), exec->argument(2).toBoolean(exec));
+    impl().addEventListener(exec->argument(0).toString(exec)->value(exec), JSEventListener::create(asObject(listener), this, false, currentWorld(exec)), exec->argument(2).toBoolean(exec));
     return jsUndefined();
 }
 
 JSValue JSDOMWindow::removeEventListener(ExecState* exec)
 {
-    Frame* frame = impl()->frame();
+    Frame* frame = impl().frame();
     if (!frame)
         return jsUndefined();
 
@@ -642,7 +642,7 @@ JSValue JSDOMWindow::removeEventListener(ExecState* exec)
     if (!listener.isObject())
         return jsUndefined();
 
-    impl()->removeEventListener(exec->argument(0).toString(exec)->value(exec), JSEventListener::create(asObject(listener), this, false, currentWorld(exec)).get(), exec->argument(2).toBoolean(exec));
+    impl().removeEventListener(exec->argument(0).toString(exec)->value(exec), JSEventListener::create(asObject(listener), this, false, currentWorld(exec)).get(), exec->argument(2).toBoolean(exec));
     return jsUndefined();
 }
 
@@ -652,7 +652,7 @@ DOMWindow* toDOMWindow(JSValue value)
         return 0;
     JSObject* object = asObject(value);
     if (object->inherits(JSDOMWindow::info()))
-        return jsCast<JSDOMWindow*>(object)->impl();
+        return &jsCast<JSDOMWindow*>(object)->impl();
     if (object->inherits(JSDOMWindowShell::info()))
         return jsCast<JSDOMWindowShell*>(object)->impl();
     return 0;
index 5973a27..d70cb30 100644 (file)
@@ -73,7 +73,7 @@ void JSDOMWindowShell::setWindow(PassRefPtr<DOMWindow> domWindow)
 {
     // Replacing JSDOMWindow via telling JSDOMWindowShell to use the same DOMWindow it already uses makes no sense,
     // so we'd better never try to.
-    ASSERT(!window() || domWindow.get() != window()->impl());
+    ASSERT(!window() || domWindow.get() != &window()->impl());
     // Explicitly protect the global object's prototype so it isn't collected
     // when we allocate the global object. (Once the global object is fully
     // constructed, it can mark its own prototype.)
@@ -96,7 +96,7 @@ void JSDOMWindowShell::setWindow(PassRefPtr<DOMWindow> domWindow)
 
 DOMWindow* JSDOMWindowShell::impl() const
 {
-    return window()->impl();
+    return &window()->impl();
 }
 
 // ----
index e5fc01a..45c6aa7 100644 (file)
@@ -44,7 +44,7 @@ namespace WebCore {
 
 JSC::JSValue JSDedicatedWorkerGlobalScope::postMessage(JSC::ExecState* exec)
 {
-    return handlePostMessage(exec, impl());
+    return handlePostMessage(exec, &impl());
 }
 
 } // namespace WebCore
index 2cce66c..1b5cf0a 100644 (file)
@@ -51,7 +51,7 @@ namespace WebCore {
 
 JSValue JSDocument::location(ExecState* exec) const
 {
-    Frame* frame = impl()->frame();
+    Frame* frame = impl().frame();
     if (!frame)
         return jsNull();
 
@@ -66,7 +66,7 @@ JSValue JSDocument::location(ExecState* exec) const
 
 void JSDocument::setLocation(ExecState* exec, JSValue value)
 {
-    Frame* frame = impl()->frame();
+    Frame* frame = impl().frame();
     if (!frame)
         return;
 
index c6ba004..e1698db 100644 (file)
@@ -45,7 +45,7 @@ namespace WebCore {
 
 JSValue JSEvent::clipboardData(ExecState* exec) const
 {
-    return impl()->isClipboardEvent() ? toJS(exec, globalObject(), impl()->clipboardData()) : jsUndefined();
+    return impl().isClipboardEvent() ? toJS(exec, globalObject(), impl().clipboardData()) : jsUndefined();
 }
 
 #define TRY_TO_WRAP_WITH_INTERFACE(interfaceName) \
index d0dd3f5..1dee60f 100644 (file)
@@ -94,10 +94,10 @@ void JSEventListener::handleEvent(ScriptExecutionContext* scriptExecutionContext
 
     if (scriptExecutionContext->isDocument()) {
         JSDOMWindow* window = jsCast<JSDOMWindow*>(globalObject);
-        if (!window->impl()->isCurrentlyDisplayedInFrame())
+        if (!window->impl().isCurrentlyDisplayedInFrame())
             return;
         // FIXME: Is this check needed for other contexts?
-        ScriptController& script = window->impl()->frame()->script();
+        ScriptController& script = window->impl().frame()->script();
         if (!script.canExecuteScripts(AboutToExecuteScript) || script.isPaused())
             return;
     }
index e3df91a..03958c6 100644 (file)
@@ -56,7 +56,7 @@ JSValue toJS(ExecState* exec, JSDOMGlobalObject* globalObject, EventTarget* targ
 
 #define TRY_TO_UNWRAP_WITH_INTERFACE(interfaceName) \
     if (value.inherits(JS##interfaceName::info()))                      \
-        return jsCast<JS##interfaceName*>(asObject(value))->impl();
+        return &jsCast<JS##interfaceName*>(asObject(value))->impl();
 
 EventTarget* toEventTarget(JSC::JSValue value)
 {
index dafa388..f2970b2 100644 (file)
@@ -44,10 +44,10 @@ namespace WebCore {
 
 JSValue JSFileReader::result(ExecState* exec) const
 {
-    FileReader* imp = impl();
-    if (imp->readType() == FileReaderLoader::ReadAsArrayBuffer)
-        return toJS(exec, globalObject(), WTF::getPtr(imp->arrayBufferResult()));
-    return jsOwnedStringOrNull(exec, imp->stringResult());
+    FileReader& imp = impl();
+    if (imp.readType() == FileReaderLoader::ReadAsArrayBuffer)
+        return toJS(exec, globalObject(), WTF::getPtr(imp.arrayBufferResult()));
+    return jsOwnedStringOrNull(exec, imp.stringResult());
 }
 
 } // namespace WebCore
index 84b379d..11f5519 100644 (file)
@@ -43,7 +43,7 @@ namespace WebCore {
 static JSValue getNamedItems(ExecState* exec, JSHTMLAllCollection* collection, PropertyName propertyName)
 {
     Vector<Ref<Element>> namedItems;
-    collection->impl()->namedItems(propertyNameToAtomicString(propertyName), namedItems);
+    collection->impl().namedItems(propertyNameToAtomicString(propertyName), namedItems);
 
     if (namedItems.isEmpty())
         return jsUndefined();
@@ -63,7 +63,7 @@ static EncodedJSValue JSC_HOST_CALL callHTMLAllCollection(ExecState* exec)
 
     // Do not use thisObj here. It can be the JSHTMLDocument, in the document.forms(i) case.
     JSHTMLAllCollection* jsCollection = jsCast<JSHTMLAllCollection*>(exec->callee());
-    HTMLAllCollection* collection = jsCollection->impl();
+    HTMLAllCollection& collection = jsCollection->impl();
 
     // Also, do we need the TypeError test here ?
 
@@ -72,7 +72,7 @@ static EncodedJSValue JSC_HOST_CALL callHTMLAllCollection(ExecState* exec)
         String string = exec->argument(0).toString(exec)->value(exec);
         unsigned index = toUInt32FromStringImpl(string.impl());
         if (index != PropertyName::NotAnIndex)
-            return JSValue::encode(toJS(exec, jsCollection->globalObject(), collection->item(index)));
+            return JSValue::encode(toJS(exec, jsCollection->globalObject(), collection.item(index)));
 
         // Support for document.images('<name>') etc.
         return JSValue::encode(getNamedItems(exec, jsCollection, Identifier(exec, string)));
@@ -82,7 +82,7 @@ static EncodedJSValue JSC_HOST_CALL callHTMLAllCollection(ExecState* exec)
     String string = exec->argument(0).toString(exec)->value(exec);
     unsigned index = toUInt32FromStringImpl(exec->argument(1).toWTFString(exec).impl());
     if (index != PropertyName::NotAnIndex) {
-        if (Node* node = collection->namedItemWithIndex(string, index))
+        if (Node* node = collection.namedItemWithIndex(string, index))
             return JSValue::encode(toJS(exec, jsCollection->globalObject(), node));
     }
 
@@ -110,7 +110,7 @@ JSValue JSHTMLAllCollection::item(ExecState* exec)
 {
     uint32_t index = toUInt32FromStringImpl(exec->argument(0).toString(exec)->value(exec).impl());
     if (index != PropertyName::NotAnIndex)
-        return toJS(exec, globalObject(), impl()->item(index));
+        return toJS(exec, globalObject(), impl().item(index));
     return getNamedItems(exec, this, Identifier(exec, exec->argument(0).toString(exec)->value(exec)));
 }
 
index d8e108f..fe6c8ba 100644 (file)
@@ -68,7 +68,7 @@ static void get3DContextAttributes(ExecState* exec, RefPtr<CanvasContextAttribut
 
 JSValue JSHTMLCanvasElement::getContext(ExecState* exec)
 {
-    HTMLCanvasElement* canvas = impl();
+    HTMLCanvasElement& canvas = impl();
     const String& contextId = exec->argument(0).toString(exec)->value(exec);
     
     RefPtr<CanvasContextAttributes> attrs;
@@ -80,18 +80,18 @@ JSValue JSHTMLCanvasElement::getContext(ExecState* exec)
     }
 #endif
     
-    CanvasRenderingContext* context = canvas->getContext(contextId, attrs.get());
+    CanvasRenderingContext* context = canvas.getContext(contextId, attrs.get());
     if (!context)
         return jsNull();
     JSValue jsValue = toJS(exec, globalObject(), WTF::getPtr(context));
-    if (InspectorInstrumentation::canvasAgentEnabled(&canvas->document())) {
+    if (InspectorInstrumentation::canvasAgentEnabled(&canvas.document())) {
         ScriptObject contextObject(exec, jsValue.getObject());
         ScriptObject wrapped;
         if (context->is2d())
-            wrapped = InspectorInstrumentation::wrapCanvas2DRenderingContextForInstrumentation(&canvas->document(), contextObject);
+            wrapped = InspectorInstrumentation::wrapCanvas2DRenderingContextForInstrumentation(&canvas.document(), contextObject);
 #if ENABLE(WEBGL)
         else if (context->is3d())
-            wrapped = InspectorInstrumentation::wrapWebGLRenderingContextForInstrumentation(&canvas->document(), contextObject);
+            wrapped = InspectorInstrumentation::wrapWebGLRenderingContextForInstrumentation(&canvas.document(), contextObject);
 #endif
         if (!wrapped.hasNoValue())
             return wrapped.jsValue();
@@ -101,7 +101,7 @@ JSValue JSHTMLCanvasElement::getContext(ExecState* exec)
 
 JSValue JSHTMLCanvasElement::probablySupportsContext(ExecState* exec)
 {
-    HTMLCanvasElement* canvas = impl();
+    HTMLCanvasElement& canvas = impl();
     if (!exec->argumentCount())
         return jsBoolean(false);
     const String& contextId = exec->uncheckedArgument(0).toString(exec)->value(exec);
@@ -117,12 +117,12 @@ JSValue JSHTMLCanvasElement::probablySupportsContext(ExecState* exec)
     }
 #endif
     
-    return jsBoolean(canvas->probablySupportsContext(contextId, attrs.get()));
+    return jsBoolean(canvas.probablySupportsContext(contextId, attrs.get()));
 }
 
 JSValue JSHTMLCanvasElement::toDataURL(ExecState* exec)
 {
-    HTMLCanvasElement* canvas = impl();
+    HTMLCanvasElement& canvas = impl();
     ExceptionCode ec = 0;
 
     const String& type = valueToStringWithUndefinedOrNullCheck(exec, exec->argument(0));
@@ -136,7 +136,7 @@ JSValue JSHTMLCanvasElement::toDataURL(ExecState* exec)
         }
     }
 
-    JSValue result = JSC::jsString(exec, canvas->toDataURL(type, qualityPtr, ec));
+    JSValue result = JSC::jsString(exec, canvas.toDataURL(type, qualityPtr, ec));
     setDOMException(exec, ec);
     return result;
 }
index 34a55ca..26a2c2c 100644 (file)
@@ -49,8 +49,7 @@ JSValue JSHTMLCollection::nameGetter(ExecState* exec, JSValue slotBase, Property
 {
     JSHTMLCollection* collection = jsCast<JSHTMLCollection*>(asObject(slotBase));
     const AtomicString& name = propertyNameToAtomicString(propertyName);
-    HTMLCollection* impl = collection->impl();
-    return toJS(exec, collection->globalObject(), impl->namedItem(name));
+    return toJS(exec, collection->globalObject(), collection->impl().namedItem(name));
 }
 
 JSValue toJS(ExecState* exec, JSDOMGlobalObject* globalObject, HTMLCollection* collection)
index 8734473..bf616b8 100644 (file)
@@ -60,20 +60,20 @@ bool JSHTMLDocument::canGetItemsForName(ExecState*, HTMLDocument* document, Prop
 JSValue JSHTMLDocument::nameGetter(ExecState* exec, JSValue slotBase, PropertyName propertyName)
 {
     JSHTMLDocument* thisObj = jsCast<JSHTMLDocument*>(asObject(slotBase));
-    HTMLDocument* document = thisObj->impl();
+    HTMLDocument& document = thisObj->impl();
 
     AtomicStringImpl* atomicPropertyName = findAtomicString(propertyName);
-    if (!atomicPropertyName || !document->hasDocumentNamedItem(*atomicPropertyName))
+    if (!atomicPropertyName || !document.hasDocumentNamedItem(*atomicPropertyName))
         return jsUndefined();
 
-    if (UNLIKELY(document->documentNamedItemContainsMultipleElements(*atomicPropertyName))) {
-        RefPtr<HTMLCollection> collection = document->documentNamedItems(atomicPropertyName);
+    if (UNLIKELY(document.documentNamedItemContainsMultipleElements(*atomicPropertyName))) {
+        RefPtr<HTMLCollection> collection = document.documentNamedItems(atomicPropertyName);
         ASSERT(!collection->isEmpty());
         ASSERT(!collection->hasExactlyOneItem());
         return toJS(exec, thisObj->globalObject(), WTF::getPtr(collection));
     }
 
-    Element* element = document->documentNamedItem(*atomicPropertyName);
+    Element* element = document.documentNamedItem(*atomicPropertyName);
     if (UNLIKELY(element->hasTagName(iframeTag))) {
         if (Frame* frame = toHTMLIFrameElement(element)->contentFrame())
             return toJS(exec, frame);
@@ -91,7 +91,7 @@ JSValue JSHTMLDocument::all(ExecState* exec) const
     if (v)
         return v;
 
-    return toJS(exec, globalObject(), impl()->all());
+    return toJS(exec, globalObject(), impl().all());
 }
 
 void JSHTMLDocument::setAll(ExecState* exec, JSValue value)
@@ -106,8 +106,7 @@ JSValue JSHTMLDocument::open(ExecState* exec)
 {
     // For compatibility with other browsers, pass open calls with more than 2 parameters to the window.
     if (exec->argumentCount() > 2) {
-        Frame* frame = impl()->frame();
-        if (frame) {
+        if (Frame* frame = impl().frame()) {
             JSDOMWindowShell* wrapper = toJSDOMWindowShell(frame, currentWorld(exec));
             if (wrapper) {
                 JSValue function = wrapper->get(exec, Identifier(exec, "open"));
@@ -123,10 +122,10 @@ JSValue JSHTMLDocument::open(ExecState* exec)
 
     // document.open clobbers the security context of the document and
     // aliases it with the active security context.
-    Document* activeDocument = asJSDOMWindow(exec->lexicalGlobalObject())->impl()->document();
+    Document* activeDocument = asJSDOMWindow(exec->lexicalGlobalObject())->impl().document();
 
     // In the case of two parameters or fewer, do a normal document open.
-    impl()->open(activeDocument);
+    impl().open(activeDocument);
     return this;
 }
 
@@ -153,19 +152,19 @@ static inline void documentWrite(ExecState* exec, HTMLDocument* document, Newlin
     if (addNewline)
         segmentedString.append(SegmentedString(String(&newlineCharacter, 1)));
 
-    Document* activeDocument = asJSDOMWindow(exec->lexicalGlobalObject())->impl()->document();
+    Document* activeDocument = asJSDOMWindow(exec->lexicalGlobalObject())->impl().document();
     document->write(segmentedString, activeDocument);
 }
 
 JSValue JSHTMLDocument::write(ExecState* exec)
 {
-    documentWrite(exec, impl(), DoNotAddNewline);
+    documentWrite(exec, &impl(), DoNotAddNewline);
     return jsUndefined();
 }
 
 JSValue JSHTMLDocument::writeln(ExecState* exec)
 {
-    documentWrite(exec, impl(), DoAddNewline);
+    documentWrite(exec, &impl(), DoAddNewline);
     return jsUndefined();
 }
 
index 74797bf..4ee3fd9 100644 (file)
@@ -36,17 +36,17 @@ using namespace JSC;
 
 JSScope* JSHTMLElement::pushEventHandlerScope(ExecState* exec, JSScope* scope) const
 {
-    HTMLElement* element = impl();
+    HTMLElement& element = impl();
 
     // The document is put on first, fall back to searching it only after the element and form.
-    scope = JSWithScope::create(exec, asObject(toJS(exec, globalObject(), &element->document())), scope);
+    scope = JSWithScope::create(exec, asObject(toJS(exec, globalObject(), &element.document())), scope);
 
     // The form is next, searched before the document, but after the element itself.
-    if (HTMLFormElement* form = element->form())
+    if (HTMLFormElement* form = element.form())
         scope = JSWithScope::create(exec, asObject(toJS(exec, globalObject(), form)), scope);
 
     // The element is on top, searched first.
-    return JSWithScope::create(exec, asObject(toJS(exec, globalObject(), element)), scope);
+    return JSWithScope::create(exec, asObject(toJS(exec, globalObject(), &element)), scope);
 }
 
 } // namespace WebCore
index 0dd9720..9008765 100644 (file)
@@ -41,15 +41,15 @@ static JSValue getNamedItems(ExecState* exec, JSHTMLFormControlsCollection* coll
 {
     Vector<Ref<Element>> namedItems;
     const AtomicString& name = propertyNameToAtomicString(propertyName);
-    collection->impl()->namedItems(name, namedItems);
+    collection->impl().namedItems(name, namedItems);
 
     if (namedItems.isEmpty())
         return jsUndefined();
     if (namedItems.size() == 1)
         return toJS(exec, collection->globalObject(), &namedItems[0].get());
 
-    ASSERT(collection->impl()->type() == FormControls);
-    return toJS(exec, collection->globalObject(), collection->impl()->ownerNode().radioNodeList(name).get());
+    ASSERT(collection->impl().type() == FormControls);
+    return toJS(exec, collection->globalObject(), collection->impl().ownerNode().radioNodeList(name).get());
 }
 
 bool JSHTMLFormControlsCollection::canGetItemsForName(ExecState*, HTMLFormControlsCollection* collection, PropertyName propertyName)
index 2145ff0..302f883 100644 (file)
@@ -44,11 +44,11 @@ bool JSHTMLFormElement::canGetItemsForName(ExecState*, HTMLFormElement* form, Pr
 
 JSValue JSHTMLFormElement::nameGetter(ExecState* exec, JSValue slotBase, PropertyName propertyName)
 {
-    JSHTMLElement* jsForm = jsCast<JSHTMLFormElement*>(asObject(slotBase));
-    HTMLFormElement* form = toHTMLFormElement(jsForm->impl());
+    JSHTMLFormElement* jsForm = jsCast<JSHTMLFormElement*>(asObject(slotBase));
+    HTMLFormElement& form = jsForm->impl();
 
     Vector<Ref<Element>> namedItems;
-    form->getNamedElements(propertyNameToAtomicString(propertyName), namedItems);
+    form.getNamedElements(propertyNameToAtomicString(propertyName), namedItems);
     
     if (namedItems.isEmpty())
         return jsUndefined();
index a12c71b..88f82c5 100644 (file)
@@ -53,13 +53,13 @@ static inline bool allowSettingJavascriptURL(ExecState* exec, HTMLFrameElement*
 
 void JSHTMLFrameElement::setLocation(ExecState* exec, JSValue value)
 {
-    HTMLFrameElement* imp = impl();
+    HTMLFrameElement& imp = impl();
     String locationValue = valueToStringWithNullCheck(exec, value);
 
-    if (!allowSettingJavascriptURL(exec, imp, locationValue))
+    if (!allowSettingJavascriptURL(exec, &imp, locationValue))
         return;
 
-    imp->setLocation(locationValue);
+    imp.setLocation(locationValue);
 }
 
 } // namespace WebCore
index 642f2f1..613fd20 100644 (file)
@@ -49,8 +49,8 @@ bool JSHTMLFrameSetElement::canGetItemsForName(ExecState*, HTMLFrameSetElement*
 
 JSValue JSHTMLFrameSetElement::nameGetter(ExecState* exec, JSValue slotBase, PropertyName propertyName)
 {
-    HTMLElement* element = jsCast<JSHTMLElement*>(asObject(slotBase))->impl();
-    Node* frameElement = element->children()->namedItem(propertyNameToAtomicString(propertyName));
+    HTMLElement& element = jsCast<JSHTMLElement*>(asObject(slotBase))->impl();
+    Node* frameElement = element.children()->namedItem(propertyNameToAtomicString(propertyName));
     if (Document* document = static_cast<HTMLFrameElement*>(frameElement)->contentDocument()) {
         if (JSDOMWindowShell* window = toJSDOMWindowShell(document->frame(), currentWorld(exec)))
             return window;
index 2ff6e86..42ebad3 100644 (file)
@@ -35,71 +35,71 @@ namespace WebCore {
 
 JSValue JSHTMLInputElement::selectionStart(ExecState* exec) const
 {
-    HTMLInputElement* input = impl();
-    if (!input->canHaveSelection())
+    HTMLInputElement& input = impl();
+    if (!input.canHaveSelection())
         return throwTypeError(exec);
 
-    return jsNumber(input->selectionStart());
+    return jsNumber(input.selectionStart());
 }
 
 void JSHTMLInputElement::setSelectionStart(ExecState* exec, JSValue value)
 {
-    HTMLInputElement* input = impl();
-    if (!input->canHaveSelection())
+    HTMLInputElement& input = impl();
+    if (!input.canHaveSelection())
         throwTypeError(exec);
 
-    input->setSelectionStart(value.toInt32(exec));
+    input.setSelectionStart(value.toInt32(exec));
 }
 
 JSValue JSHTMLInputElement::selectionEnd(ExecState* exec) const
 {
-    HTMLInputElement* input = impl();
-    if (!input->canHaveSelection())
+    HTMLInputElement& input = impl();
+    if (!input.canHaveSelection())
         return throwTypeError(exec);
 
-    return jsNumber(input->selectionEnd());
+    return jsNumber(input.selectionEnd());
 }
 
 void JSHTMLInputElement::setSelectionEnd(ExecState* exec, JSValue value)
 {
-    HTMLInputElement* input = impl();
-    if (!input->canHaveSelection())
+    HTMLInputElement& input = impl();
+    if (!input.canHaveSelection())
         throwTypeError(exec);
 
-    input->setSelectionEnd(value.toInt32(exec));
+    input.setSelectionEnd(value.toInt32(exec));
 }
 
 JSValue JSHTMLInputElement::selectionDirection(ExecState* exec) const
 {
-    HTMLInputElement* input = impl();
-    if (!input->canHaveSelection())
+    HTMLInputElement& input = impl();
+    if (!input.canHaveSelection())
         return throwTypeError(exec);
 
-    return jsStringWithCache(exec, input->selectionDirection());
+    return jsStringWithCache(exec, input.selectionDirection());
 }
 
 void JSHTMLInputElement::setSelectionDirection(ExecState* exec, JSValue value)
 {
-    HTMLInputElement* input = impl();
-    if (!input->canHaveSelection()) {
+    HTMLInputElement& input = impl();
+    if (!input.canHaveSelection()) {
         throwTypeError(exec);
         return;
     }
 
-    input->setSelectionDirection(value.toString(exec)->value(exec));
+    input.setSelectionDirection(value.toString(exec)->value(exec));
 }
 
 JSValue JSHTMLInputElement::setSelectionRange(ExecState* exec)
 {
-    HTMLInputElement* input = impl();
-    if (!input->canHaveSelection())
+    HTMLInputElement& input = impl();
+    if (!input.canHaveSelection())
         return throwTypeError(exec);
 
     int start = exec->argument(0).toInt32(exec);
     int end = exec->argument(1).toInt32(exec);
     String direction = exec->argument(2).toString(exec)->value(exec);
 
-    input->setSelectionRange(start, end, direction);
+    input.setSelectionRange(start, end, direction);
     return jsUndefined();
 }
 
index 5558693..d3a4b54 100644 (file)
@@ -38,12 +38,12 @@ namespace WebCore {
 
 JSValue JSHTMLLinkElement::sizes(ExecState* exec) const
 {
-    return toJS(exec, globalObject(), impl()->sizes());
+    return toJS(exec, globalObject(), impl().sizes());
 }
 
 void JSHTMLLinkElement::setSizes(ExecState* exec, JSValue value)
 {
-    impl()->setSizes(valueToStringWithNullCheck(exec, value));
+    impl().setSizes(valueToStringWithNullCheck(exec, value));
 }
 
 } // namespace WebCore
index c4265cb..1d40c60 100644 (file)
@@ -38,9 +38,9 @@ void JSHTMLMediaElement::setController(ExecState*, JSValue value)
 {
     // 4.8.10.11.2 Media controllers: controller attribute.
     // On setting, it must first remove the element's mediagroup attribute, if any, 
-    impl()->setMediaGroup(String());
+    impl().setMediaGroup(String());
     // and then set the current media controller to the given value.
-    impl()->setController(toMediaController(value));
+    impl().setController(toMediaController(value));
 }
 
 }
index 1c3fb90..4c926b1 100644 (file)
@@ -39,7 +39,6 @@ namespace WebCore {
 
 void JSHTMLOptionsCollection::setLength(ExecState* exec, JSValue value)
 {
-    HTMLOptionsCollection* imp = impl();
     ExceptionCode ec = 0;
     unsigned newLength = 0;
     double lengthValue = value.toNumber(exec);
@@ -52,29 +51,28 @@ void JSHTMLOptionsCollection::setLength(ExecState* exec, JSValue value)
             newLength = static_cast<unsigned>(lengthValue);
     }
     if (!ec)
-        imp->setLength(newLength, ec);
+        impl().setLength(newLength, ec);
     setDOMException(exec, ec);
 }
 
 void JSHTMLOptionsCollection::indexSetter(ExecState* exec, unsigned index, JSValue value)
 {
-    HTMLOptionsCollection* imp = impl();
-    HTMLSelectElement& base = toHTMLSelectElement(imp->ownerNode());
+    HTMLSelectElement& base = toHTMLSelectElement(impl().ownerNode());
     selectIndexSetter(&base, exec, index, value);
 }
 
 JSValue JSHTMLOptionsCollection::add(ExecState* exec)
 {
-    HTMLOptionsCollection* imp = impl();
+    HTMLOptionsCollection& imp = impl();
     HTMLOptionElement* option = toHTMLOptionElement(exec->argument(0));
     ExceptionCode ec = 0;
     if (exec->argumentCount() < 2)
-        imp->add(option, ec);
+        imp.add(option, ec);
     else {
         int index = exec->argument(1).toInt32(exec);
         if (exec->hadException())
             return jsUndefined();
-        imp->add(option, index, ec);
+        imp.add(option, index, ec);
     }
     setDOMException(exec, ec);
     return jsUndefined();
@@ -85,9 +83,9 @@ JSValue JSHTMLOptionsCollection::remove(ExecState* exec)
     // The argument can be an HTMLOptionElement or an index.
     JSValue argument = exec->argument(0);
     if (HTMLOptionElement* option = toHTMLOptionElement(argument))
-        impl()->remove(option);
+        impl().remove(option);
     else
-        impl()->remove(argument.toInt32(exec));
+        impl().remove(argument.toInt32(exec));
     return jsUndefined();
 }
 
index 1468cb9..43f694b 100644 (file)
@@ -34,7 +34,7 @@ using namespace HTMLNames;
 
 JSValue JSHTMLSelectElement::remove(ExecState* exec)
 {
-    HTMLSelectElement& select = *impl();
+    HTMLSelectElement& select = impl();
 
     if (!exec->argumentCount()) {
         // When called with no argument, we should call Element::remove() to detach.
@@ -69,7 +69,7 @@ void selectIndexSetter(HTMLSelectElement* select, JSC::ExecState* exec, unsigned
 
 void JSHTMLSelectElement::indexSetter(JSC::ExecState* exec, unsigned index, JSC::JSValue value)
 {
-    selectIndexSetter(impl(), exec, index, value);
+    selectIndexSetter(&impl(), exec, index, value);
 }
 
 }
index 63d9098..e4cda2b 100644 (file)
@@ -47,8 +47,7 @@ JSValue JSHTMLTemplateElement::content(ExecState* exec) const
 {
     JSLockHolder lock(exec);
 
-    HTMLTemplateElement* imp = impl();
-    DocumentFragment* content = imp->content();
+    DocumentFragment* content = impl().content();
 
     JSObject* wrapper = getCachedWrapper(currentWorld(exec), content);
     if (wrapper)
index 234649a..5ea6b38 100644 (file)
@@ -61,7 +61,7 @@ bool JSHistory::getOwnPropertySlotDelegate(ExecState* exec, PropertyName propert
     // Our custom code is only needed to implement the Window cross-domain scheme, so if access is
     // allowed, return false so the normal lookup will take place.
     String message;
-    if (shouldAllowAccessToFrame(exec, impl()->frame(), message))
+    if (shouldAllowAccessToFrame(exec, impl().frame(), message))
         return false;
 
     // Check for the few functions that we allow, even when called cross-domain.
@@ -89,7 +89,7 @@ bool JSHistory::getOwnPropertySlotDelegate(ExecState* exec, PropertyName propert
         }
     }
 
-    printErrorMessageForFrame(impl()->frame(), message);
+    printErrorMessageForFrame(impl().frame(), message);
     slot.setUndefined();
     return true;
 }
@@ -97,7 +97,7 @@ bool JSHistory::getOwnPropertySlotDelegate(ExecState* exec, PropertyName propert
 bool JSHistory::putDelegate(ExecState* exec, PropertyName, JSValue, PutPropertySlot&)
 {
     // Only allow putting by frames in the same origin.
-    if (!shouldAllowAccessToFrame(exec, impl()->frame()))
+    if (!shouldAllowAccessToFrame(exec, impl().frame()))
         return true;
     return false;
 }
@@ -106,7 +106,7 @@ bool JSHistory::deleteProperty(JSCell* cell, ExecState* exec, PropertyName prope
 {
     JSHistory* thisObject = jsCast<JSHistory*>(cell);
     // Only allow deleting by frames in the same origin.
-    if (!shouldAllowAccessToFrame(exec, thisObject->impl()->frame()))
+    if (!shouldAllowAccessToFrame(exec, thisObject->impl().frame()))
         return false;
     return Base::deleteProperty(thisObject, exec, propertyName);
 }
@@ -115,7 +115,7 @@ bool JSHistory::deletePropertyByIndex(JSCell* cell, ExecState* exec, unsigned pr
 {
     JSHistory* thisObject = jsCast<JSHistory*>(cell);
     // Only allow deleting by frames in the same origin.
-    if (!shouldAllowAccessToFrame(exec, thisObject->impl()->frame()))
+    if (!shouldAllowAccessToFrame(exec, thisObject->impl().frame()))
         return false;
     return Base::deletePropertyByIndex(thisObject, exec, propertyName);
 }
@@ -124,20 +124,20 @@ void JSHistory::getOwnPropertyNames(JSObject* object, ExecState* exec, PropertyN
 {
     JSHistory* thisObject = jsCast<JSHistory*>(object);
     // Only allow the history object to enumerated by frames in the same origin.
-    if (!shouldAllowAccessToFrame(exec, thisObject->impl()->frame()))
+    if (!shouldAllowAccessToFrame(exec, thisObject->impl().frame()))
         return;
     Base::getOwnPropertyNames(thisObject, exec, propertyNames, mode);
 }
 
 JSValue JSHistory::state(ExecState *exec) const
 {
-    History* history = impl();
+    History& history = impl();
 
     JSValue cachedValue = m_state.get();
-    if (!cachedValue.isEmpty() && !history->stateChanged())
+    if (!cachedValue.isEmpty() && !history.stateChanged())
         return cachedValue;
 
-    RefPtr<SerializedScriptValue> serialized = history->state();
+    RefPtr<SerializedScriptValue> serialized = history.state();
     JSValue result = serialized ? serialized->deserialize(exec, globalObject(), 0) : jsNull();
     const_cast<JSHistory*>(this)->m_state.set(exec->vm(), this, result);
     return result;
@@ -161,7 +161,7 @@ JSValue JSHistory::pushState(ExecState* exec)
     }
 
     ExceptionCode ec = 0;
-    impl()->stateObjectAdded(historyState.release(), title, url, History::StateObjectPush, ec);
+    impl().stateObjectAdded(historyState.release(), title, url, History::StateObjectPush, ec);
     setDOMException(exec, ec);
 
     m_state.clear();
@@ -187,7 +187,7 @@ JSValue JSHistory::replaceState(ExecState* exec)
     }
 
     ExceptionCode ec = 0;
-    impl()->stateObjectAdded(historyState.release(), title, url, History::StateObjectReplace, ec);
+    impl().stateObjectAdded(historyState.release(), title, url, History::StateObjectReplace, ec);
     setDOMException(exec, ec);
 
     m_state.clear();
index 9f803a9..9eae756 100644 (file)
@@ -75,7 +75,7 @@ JSValue JSIDBDatabase::createObjectStore(ExecState* exec)
     }
 
     ExceptionCode ec = 0;
-    JSValue result = toJS(exec, globalObject(), impl()->createObjectStore(name, keyPath, autoIncrement, ec).get());
+    JSValue result = toJS(exec, globalObject(), impl().createObjectStore(name, keyPath, autoIncrement, ec).get());
     setDOMException(exec, ec);
     return result;
 }
index fc8d3eb..74fd354 100644 (file)
@@ -76,7 +76,7 @@ JSValue JSIDBObjectStore::createIndex(ExecState* exec)
     }
 
     ExceptionCode ec = 0;
-    JSValue result = toJS(exec, globalObject(), impl()->createIndex(context, name, keyPath, unique, multiEntry, ec).get());
+    JSValue result = toJS(exec, globalObject(), impl().createIndex(context, name, keyPath, unique, multiEntry, ec).get());
     setDOMException(exec, ec);
     return result;
 }
index cd98de4..3cba24d 100644 (file)
@@ -90,7 +90,7 @@ JSValue JSInjectedScriptHost::inspectedObject(ExecState* exec)
     if (exec->argumentCount() < 1)
         return jsUndefined();
 
-    InjectedScriptHost::InspectableObject* object = impl()->inspectedObject(exec->uncheckedArgument(0).toInt32(exec));
+    InjectedScriptHost::InspectableObject* object = impl().inspectedObject(exec->uncheckedArgument(0).toInt32(exec));
     if (!object)
         return jsUndefined();
 
@@ -230,7 +230,7 @@ JSValue JSInjectedScriptHost::getEventListeners(ExecState* exec)
         return jsUndefined();
 
     Vector<EventListenerInfo> listenersArray;
-    impl()->getEventListenersImpl(node, listenersArray);
+    impl().getEventListenersImpl(node, listenersArray);
 
     JSObject* result = constructEmptyObject(exec);
     for (size_t i = 0; i < listenersArray.size(); ++i) {
@@ -249,7 +249,7 @@ JSValue JSInjectedScriptHost::inspect(ExecState* exec)
     if (exec->argumentCount() >= 2) {
         ScriptValue object(exec->vm(), exec->uncheckedArgument(0));
         ScriptValue hints(exec->vm(), exec->uncheckedArgument(1));
-        impl()->inspectImpl(object.toInspectorValue(exec), hints.toInspectorValue(exec));
+        impl().inspectImpl(object.toInspectorValue(exec), hints.toInspectorValue(exec));
     }
     return jsUndefined();
 }
@@ -261,7 +261,7 @@ JSValue JSInjectedScriptHost::databaseId(ExecState* exec)
 #if ENABLE(SQL_DATABASE)
     Database* database = toDatabase(exec->uncheckedArgument(0));
     if (database)
-        return jsStringWithCache(exec, impl()->databaseIdImpl(database));
+        return jsStringWithCache(exec, impl().databaseIdImpl(database));
 #endif
     return jsUndefined();
 }
@@ -272,7 +272,7 @@ JSValue JSInjectedScriptHost::storageId(ExecState* exec)
         return jsUndefined();
     Storage* storage = toStorage(exec->uncheckedArgument(0));
     if (storage)
-        return jsStringWithCache(exec, impl()->storageIdImpl(storage));
+        return jsStringWithCache(exec, impl().storageIdImpl(storage));
     return jsUndefined();
 }
 
index 0ecaf73..2175181 100644 (file)
@@ -141,7 +141,7 @@ JSValue JSInspectorFrontendHost::showContextMenu(ExecState* exec)
 #else
     Vector<ContextMenuItem> items = menu.items();
 #endif
-    impl()->showContextMenu(event, items);
+    impl().showContextMenu(event, items);
 #else
     UNUSED_PARAM(exec);
 #endif
index 3ba4e7b..65e092a 100644 (file)
@@ -40,7 +40,7 @@ namespace WebCore {
 JSValue JSJavaScriptCallFrame::evaluate(ExecState* exec)
 {
     JSValue exception;
-    JSValue result = impl()->evaluate(exec->argument(0).toString(exec)->value(exec), exception);
+    JSValue result = impl().evaluate(exec->argument(0).toString(exec)->value(exec), exception);
 
     if (exception)
         exec->vm().throwException(exec, exception);
@@ -50,12 +50,12 @@ JSValue JSJavaScriptCallFrame::evaluate(ExecState* exec)
 
 JSValue JSJavaScriptCallFrame::thisObject(ExecState*) const
 {
-    return impl()->thisValue();
+    return impl().thisValue();
 }
 
 JSValue JSJavaScriptCallFrame::type(ExecState* exec) const
 {
-    switch (impl()->type()) {
+    switch (impl().type()) {
         case DebuggerCallFrame::FunctionType:
             return jsString(exec, ASCIILiteral("function"));
         case DebuggerCallFrame::ProgramType:
@@ -68,10 +68,10 @@ JSValue JSJavaScriptCallFrame::type(ExecState* exec) const
 
 JSValue JSJavaScriptCallFrame::scopeChain(ExecState* exec) const
 {
-    if (!impl()->scopeChain())
+    if (!impl().scopeChain())
         return jsNull();
 
-    JSScope* scopeChain = impl()->scopeChain();
+    JSScope* scopeChain = impl().scopeChain();
     ScopeChainIterator iter = scopeChain->begin();
     ScopeChainIterator end = scopeChain->end();
 
@@ -89,14 +89,14 @@ JSValue JSJavaScriptCallFrame::scopeChain(ExecState* exec) const
 
 JSValue JSJavaScriptCallFrame::scopeType(ExecState* exec)
 {
-    if (!impl()->scopeChain())
+    if (!impl().scopeChain())
         return jsUndefined();
 
     if (!exec->argument(0).isInt32())
         return jsUndefined();
     int index = exec->argument(0).asInt32();
 
-    JSScope* scopeChain = impl()->scopeChain();
+    JSScope* scopeChain = impl().scopeChain();
     ScopeChainIterator end = scopeChain->end();
 
     bool foundLocalScope = false;
index b6591a3..5b4ad26 100644 (file)
@@ -47,7 +47,7 @@ static JSValue nonCachingStaticAssignFunctionGetter(ExecState* exec, JSValue, Pr
 
 bool JSLocation::getOwnPropertySlotDelegate(ExecState* exec, PropertyName propertyName, PropertySlot& slot)
 {
-    Frame* frame = impl()->frame();
+    Frame* frame = impl().frame();
     if (!frame) {
         slot.setUndefined();
         return true;
@@ -89,7 +89,7 @@ bool JSLocation::getOwnPropertySlotDelegate(ExecState* exec, PropertyName proper
 
 bool JSLocation::putDelegate(ExecState* exec, PropertyName propertyName, JSValue value, PutPropertySlot& slot)
 {
-    Frame* frame = impl()->frame();
+    Frame* frame = impl().frame();
     if (!frame)
         return true;
 
@@ -118,7 +118,7 @@ bool JSLocation::deleteProperty(JSCell* cell, ExecState* exec, PropertyName prop
 {
     JSLocation* thisObject = jsCast<JSLocation*>(cell);
     // Only allow deleting by frames in the same origin.
-    if (!shouldAllowAccessToFrame(exec, thisObject->impl()->frame()))
+    if (!shouldAllowAccessToFrame(exec, thisObject->impl().frame()))
         return false;
     return Base::deleteProperty(thisObject, exec, propertyName);
 }
@@ -127,7 +127,7 @@ bool JSLocation::deletePropertyByIndex(JSCell* cell, ExecState* exec, unsigned p
 {
     JSLocation* thisObject = jsCast<JSLocation*>(cell);
     // Only allow deleting by frames in the same origin.
-    if (!shouldAllowAccessToFrame(exec, thisObject->impl()->frame()))
+    if (!shouldAllowAccessToFrame(exec, thisObject->impl().frame()))
         return false;
     return Base::deletePropertyByIndex(thisObject, exec, propertyName);
 }
@@ -136,7 +136,7 @@ void JSLocation::getOwnPropertyNames(JSObject* object, ExecState* exec, Property
 {
     JSLocation* thisObject = jsCast<JSLocation*>(object);
     // Only allow the location object to enumerated by frames in the same origin.
-    if (!shouldAllowAccessToFrame(exec, thisObject->impl()->frame()))
+    if (!shouldAllowAccessToFrame(exec, thisObject->impl().frame()))
         return;
     Base::getOwnPropertyNames(thisObject, exec, propertyNames, mode);
 }
@@ -153,7 +153,7 @@ void JSLocation::setHref(ExecState* exec, JSValue value)
     String href = value.toString(exec)->value(exec);
     if (exec->hadException())
         return;
-    impl()->setHref(href, activeDOMWindow(exec), firstDOMWindow(exec));
+    impl().setHref(href, activeDOMWindow(exec), firstDOMWindow(exec));
 }
 
 void JSLocation::setProtocol(ExecState* exec, JSValue value)
@@ -162,7 +162,7 @@ void JSLocation::setProtocol(ExecState* exec, JSValue value)
     if (exec->hadException())
         return;
     ExceptionCode ec = 0;
-    impl()->setProtocol(protocol, activeDOMWindow(exec), firstDOMWindow(exec), ec);
+    impl().setProtocol(protocol, activeDOMWindow(exec), firstDOMWindow(exec), ec);
     setDOMException(exec, ec);
 }
 
@@ -171,7 +171,7 @@ void JSLocation::setHost(ExecState* exec, JSValue value)
     String host = value.toString(exec)->value(exec);
     if (exec->hadException())
         return;
-    impl()->setHost(host, activeDOMWindow(exec), firstDOMWindow(exec));
+    impl().setHost(host, activeDOMWindow(exec), firstDOMWindow(exec));
 }
 
 void JSLocation::setHostname(ExecState* exec, JSValue value)
@@ -179,7 +179,7 @@ void JSLocation::setHostname(ExecState* exec, JSValue value)
     String hostname = value.toString(exec)->value(exec);
     if (exec->hadException())
         return;
-    impl()->setHostname(hostname, activeDOMWindow(exec), firstDOMWindow(exec));
+    impl().setHostname(hostname, activeDOMWindow(exec), firstDOMWindow(exec));
 }
 
 void JSLocation::setPort(ExecState* exec, JSValue value)
@@ -187,7 +187,7 @@ void JSLocation::setPort(ExecState* exec, JSValue value)
     String port = value.toWTFString(exec);
     if (exec->hadException())
         return;
-    impl()->setPort(port, activeDOMWindow(exec), firstDOMWindow(exec));
+    impl().setPort(port, activeDOMWindow(exec), firstDOMWindow(exec));
 }
 
 void JSLocation::setPathname(ExecState* exec, JSValue value)
@@ -195,7 +195,7 @@ void JSLocation::setPathname(ExecState* exec, JSValue value)
     String pathname = value.toString(exec)->value(exec);
     if (exec->hadException())
         return;
-    impl()->setPathname(pathname, activeDOMWindow(exec), firstDOMWindow(exec));
+    impl().setPathname(pathname, activeDOMWindow(exec), firstDOMWindow(exec));
 }
 
 void JSLocation::setSearch(ExecState* exec, JSValue value)
@@ -203,7 +203,7 @@ void JSLocation::setSearch(ExecState* exec, JSValue value)
     String pathname = value.toString(exec)->value(exec);
     if (exec->hadException())
         return;
-    impl()->setSearch(pathname, activeDOMWindow(exec), firstDOMWindow(exec));
+    impl().setSearch(pathname, activeDOMWindow(exec), firstDOMWindow(exec));
 }
 
 void JSLocation::setHash(ExecState* exec, JSValue value)
@@ -211,7 +211,7 @@ void JSLocation::setHash(ExecState* exec, JSValue value)
     String hash = value.toString(exec)->value(exec);
     if (exec->hadException())
         return;
-    impl()->setHash(hash, activeDOMWindow(exec), firstDOMWindow(exec));
+    impl().setHash(hash, activeDOMWindow(exec), firstDOMWindow(exec));
 }
 
 JSValue JSLocation::replace(ExecState* exec)
@@ -219,13 +219,13 @@ JSValue JSLocation::replace(ExecState* exec)
     String urlString = exec->argument(0).toString(exec)->value(exec);
     if (exec->hadException())
         return jsUndefined();
-    impl()->replace(urlString, activeDOMWindow(exec), firstDOMWindow(exec));
+    impl().replace(urlString, activeDOMWindow(exec), firstDOMWindow(exec));
     return jsUndefined();
 }
 
 JSValue JSLocation::reload(ExecState* exec)
 {
-    impl()->reload(activeDOMWindow(exec));
+    impl().reload(activeDOMWindow(exec));
     return jsUndefined();
 }
 
@@ -234,17 +234,17 @@ JSValue JSLocation::assign(ExecState* exec)
     String urlString = exec->argument(0).toString(exec)->value(exec);
     if (exec->hadException())
         return jsUndefined();
-    impl()->assign(urlString, activeDOMWindow(exec), firstDOMWindow(exec));
+    impl().assign(urlString, activeDOMWindow(exec), firstDOMWindow(exec));
     return jsUndefined();
 }
 
 JSValue JSLocation::toStringFunction(ExecState* exec)
 {
-    Frame* frame = impl()->frame();
+    Frame* frame = impl().frame();
     if (!frame || !shouldAllowAccessToFrame(exec, frame))
         return jsUndefined();
 
-    return jsStringWithCache(exec, impl()->toString());
+    return jsStringWithCache(exec, impl().toString());
 }
 
 bool JSLocationPrototype::putDelegate(ExecState* exec, PropertyName propertyName, JSValue, PutPropertySlot&)
index cd145a6..96bade0 100644 (file)
@@ -37,50 +37,50 @@ namespace WebCore {
 
 JSValue JSMediaSourceStates::width(ExecState*) const
 {
-    if (!impl()->hasVideoSource())
+    if (!impl().hasVideoSource())
         return jsUndefined();
 
-    return jsNumber(impl()->width());
+    return jsNumber(impl().width());
 }
 
 JSValue JSMediaSourceStates::height(ExecState*) const
 {
-    if (!impl()->hasVideoSource())
+    if (!impl().hasVideoSource())
         return jsUndefined();
     
-    return jsNumber(impl()->height());
+    return jsNumber(impl().height());
 }
 
 JSValue JSMediaSourceStates::frameRate(ExecState*) const
 {
-    if (!impl()->hasVideoSource())
+    if (!impl().hasVideoSource())
         return jsUndefined();
     
-    return jsNumber(impl()->frameRate());
+    return jsNumber(impl().frameRate());
 }
 
 JSValue JSMediaSourceStates::aspectRatio(ExecState*) const
 {
-    if (!impl()->hasVideoSource())
+    if (!impl().hasVideoSource())
         return jsUndefined();
     
-    return jsNumber(impl()->aspectRatio());
+    return jsNumber(impl().aspectRatio());
 }
 
 JSValue JSMediaSourceStates::facingMode(ExecState* exec) const
 {
-    if (!impl()->hasVideoSource())
+    if (!impl().hasVideoSource())
         return jsUndefined();
 
-    return jsStringWithCache(exec, impl()->facingMode());
+    return jsStringWithCache(exec, impl().facingMode());
 }
 
 JSValue JSMediaSourceStates::volume(ExecState*) const
 {
-    if (impl()->hasVideoSource())
+    if (impl().hasVideoSource())
         return jsUndefined();
     
-    return jsNumber(impl()->volume());
+    return jsNumber(impl().volume());
 }
 
 } // namespace WebCore
index 1f027eb..0a9a4c1 100644 (file)
@@ -49,11 +49,11 @@ JSValue JSMessageEvent::data(ExecState* exec) const
     if (JSValue cachedValue = m_data.get())
         return cachedValue;
 
-    MessageEvent* event = impl();
+    MessageEvent& event = impl();
     JSValue result;
-    switch (event->dataType()) {
+    switch (event.dataType()) {
     case MessageEvent::DataTypeScriptValue: {
-        ScriptValue scriptValue = event->dataAsScriptValue();
+        ScriptValue scriptValue = event.dataAsScriptValue();
         if (scriptValue.hasNoValue())
             result = jsNull();
         else
@@ -62,8 +62,8 @@ JSValue JSMessageEvent::data(ExecState* exec) const
     }
 
     case MessageEvent::DataTypeSerializedScriptValue:
-        if (RefPtr<SerializedScriptValue> serializedValue = event->dataAsSerializedScriptValue()) {
-            MessagePortArray ports = impl()->ports();
+        if (RefPtr<SerializedScriptValue> serializedValue = event.dataAsSerializedScriptValue()) {
+            MessagePortArray ports = impl().ports();
             result = serializedValue->deserialize(exec, globalObject(), &ports, NonThrowing);
         }
         else
@@ -71,15 +71,15 @@ JSValue JSMessageEvent::data(ExecState* exec) const
         break;
 
     case MessageEvent::DataTypeString:
-        result = jsStringWithCache(exec, event->dataAsString());
+        result = jsStringWithCache(exec, event.dataAsString());
         break;
 
     case MessageEvent::DataTypeBlob:
-        result = toJS(exec, globalObject(), event->dataAsBlob());
+        result = toJS(exec, globalObject(), event.dataAsBlob());
         break;
 
     case MessageEvent::DataTypeArrayBuffer:
-        result = toJS(exec, globalObject(), event->dataAsArrayBuffer());
+        result = toJS(exec, globalObject(), event.dataAsArrayBuffer());
         break;
     }
 
@@ -109,8 +109,8 @@ static JSC::JSValue handleInitMessageEvent(JSMessageEvent* jsEvent, JSC::ExecSta
     if (exec->hadException())
         return jsUndefined();
 
-    MessageEvent* event = jsEvent->impl();
-    event->initMessageEvent(typeArg, canBubbleArg, cancelableArg, dataArg, originArg, lastEventIdArg, sourceArg, messagePorts.release());
+    MessageEvent& event = jsEvent->impl();
+    event.initMessageEvent(typeArg, canBubbleArg, cancelableArg, dataArg, originArg, lastEventIdArg, sourceArg, messagePorts.release());
     jsEvent->m_data.set(exec->vm(), jsEvent, dataArg.jsValue());
     return jsUndefined();
 }
index 2026219..33ed4dc 100644 (file)
@@ -60,7 +60,7 @@ void JSMessagePort::visitChildren(JSCell* cell, SlotVisitor& visitor)
 
 JSC::JSValue JSMessagePort::postMessage(JSC::ExecState* exec)
 {
-    return handlePostMessage(exec, impl());
+    return handlePostMessage(exec, &impl());
 }
 
 void fillMessagePortArray(JSC::ExecState* exec, JSC::JSValue value, MessagePortArray& portArray, ArrayBufferArray& arrayBuffers)
index c71728c..0976094 100644 (file)
@@ -63,9 +63,9 @@ EncodedJSValue JSC_HOST_CALL JSMutationObserverConstructor::constructJSMutationO
 
 bool JSMutationObserverOwner::isReachableFromOpaqueRoots(JSC::Handle<JSC::Unknown> handle, void*, SlotVisitor& visitor)
 {
-    MutationObserver* observer = jsCast<JSMutationObserver*>(handle.get().asCell())->impl();
-    HashSet<Node*> observedNodes = observer->getObservedNodes();
-    for (HashSet<Node*>::iterator it = observedNodes.begin(); it != observedNodes.end(); ++it) {
+    MutationObserver& observer = jsCast<JSMutationObserver*>(handle.get().asCell())->impl();
+    auto observedNodes = observer.getObservedNodes();
+    for (auto it = observedNodes.begin(), end = observedNodes.end(); it != end; ++it) {
         if (visitor.containsOpaqueRoot(root(*it)))
             return true;
     }
index 03fa0e8..940ce50 100644 (file)
@@ -43,7 +43,7 @@ bool JSNamedNodeMap::canGetItemsForName(ExecState*, NamedNodeMap* impl, Property
 JSValue JSNamedNodeMap::nameGetter(ExecState* exec, JSValue slotBase, PropertyName propertyName)
 {
     JSNamedNodeMap* thisObj = jsCast<JSNamedNodeMap*>(asObject(slotBase));
-    return toJS(exec, thisObj->globalObject(), thisObj->impl()->getNamedItem(propertyNameToAtomicString(propertyName)));
+    return toJS(exec, thisObj->globalObject(), thisObj->impl().getNamedItem(propertyNameToAtomicString(propertyName)));
 }
 
 } // namespace WebCore
index 03db487..129274b 100644 (file)
@@ -128,21 +128,21 @@ static inline bool isReachableFromDOM(JSNode* jsNode, Node* node, SlotVisitor& v
 bool JSNodeOwner::isReachableFromOpaqueRoots(JSC::Handle<JSC::Unknown> handle, void*, SlotVisitor& visitor)
 {
     JSNode* jsNode = jsCast<JSNode*>(handle.get().asCell());
-    return isReachableFromDOM(jsNode, jsNode->impl(), visitor);
+    return isReachableFromDOM(jsNode, &jsNode->impl(), visitor);
 }
 
 void JSNodeOwner::finalize(JSC::Handle<JSC::Unknown> handle, void* context)
 {
     JSNode* jsNode = static_cast<JSNode*>(handle.get().asCell());
     DOMWrapperWorld& world = *static_cast<DOMWrapperWorld*>(context);
-    uncacheWrapper(world, jsNode->impl(), jsNode);
+    uncacheWrapper(world, &jsNode->impl(), jsNode);
     jsNode->releaseImpl();
 }
 
 JSValue JSNode::insertBefore(ExecState* exec)
 {
     ExceptionCode ec = 0;
-    bool ok = impl()->insertBefore(toNode(exec->argument(0)), toNode(exec->argument(1)), ec, AttachLazily);
+    bool ok = impl().insertBefore(toNode(exec->argument(0)), toNode(exec->argument(1)), ec, AttachLazily);
     setDOMException(exec, ec);
     if (ok)
         return exec->argument(0);
@@ -152,7 +152,7 @@ JSValue JSNode::insertBefore(ExecState* exec)
 JSValue JSNode::replaceChild(ExecState* exec)
 {
     ExceptionCode ec = 0;
-    bool ok = impl()->replaceChild(toNode(exec->argument(0)), toNode(exec->argument(1)), ec, AttachLazily);
+    bool ok = impl().replaceChild(toNode(exec->argument(0)), toNode(exec->argument(1)), ec, AttachLazily);
     setDOMException(exec, ec);
     if (ok)
         return exec->argument(1);
@@ -162,7 +162,7 @@ JSValue JSNode::replaceChild(ExecState* exec)
 JSValue JSNode::removeChild(ExecState* exec)
 {
     ExceptionCode ec = 0;
-    bool ok = impl()->removeChild(toNode(exec->argument(0)), ec);
+    bool ok = impl().removeChild(toNode(exec->argument(0)), ec);
     setDOMException(exec, ec);
     if (ok)
         return exec->argument(0);
@@ -172,7 +172,7 @@ JSValue JSNode::removeChild(ExecState* exec)
 JSValue JSNode::appendChild(ExecState* exec)
 {
     ExceptionCode ec = 0;
-    bool ok = impl()->appendChild(toNode(exec->argument(0)), ec, AttachLazily);
+    bool ok = impl().appendChild(toNode(exec->argument(0)), ec, AttachLazily);
     setDOMException(exec, ec);
     if (ok)
         return exec->argument(0);
@@ -194,8 +194,8 @@ void JSNode::visitChildren(JSCell* cell, SlotVisitor& visitor)
     ASSERT(thisObject->structure()->typeInfo().overridesVisitChildren());
     Base::visitChildren(thisObject, visitor);
 
-    Node* node = thisObject->impl();
-    node->visitJSEventListeners(visitor);
+    Node& node = thisObject->impl();
+    node.visitJSEventListeners(visitor);
 
     visitor.addOpaqueRoot(root(node));
 }
index 3715b9b..877c985 100644 (file)
@@ -43,13 +43,13 @@ void JSNodeFilter::visitChildren(JSCell* cell, SlotVisitor& visitor)
     COMPILE_ASSERT(StructureFlags & OverridesVisitChildren, OverridesVisitChildrenWithoutSettingFlag);
     ASSERT(thisObject->structure()->typeInfo().overridesVisitChildren());
     Base::visitChildren(thisObject, visitor);
-    visitor.addOpaqueRoot(thisObject->impl());
+    visitor.addOpaqueRoot(&thisObject->impl());
 }
 
 PassRefPtr<NodeFilter> toNodeFilter(VM& vm, JSValue value)
 {
     if (value.inherits(JSNodeFilter::info()))
-        return jsCast<JSNodeFilter*>(asObject(value))->impl();
+        return &jsCast<JSNodeFilter*>(asObject(value))->impl();
 
     RefPtr<NodeFilter> result = NodeFilter::create();
     result->setCondition(JSNodeFilterCondition::create(vm, result.get(), value));
index 13dc32f..62928db 100644 (file)
@@ -41,9 +41,9 @@ bool JSNodeListOwner::isReachableFromOpaqueRoots(JSC::Handle<JSC::Unknown> handl
     JSNodeList* jsNodeList = jsCast<JSNodeList*>(handle.get().asCell());
     if (!jsNodeList->hasCustomProperties())
         return false;
-    if (!jsNodeList->impl()->isLiveNodeList())
+    if (!jsNodeList->impl().isLiveNodeList())
         return false;
-    return visitor.containsOpaqueRoot(root(static_cast<LiveNodeList*>(jsNodeList->impl())->ownerNode()));
+    return visitor.containsOpaqueRoot(root(static_cast<LiveNodeList&>(jsNodeList->impl()).ownerNode()));
 }
 
 bool JSNodeList::canGetItemsForName(ExecState*, NodeList* impl, PropertyName propertyName)
@@ -54,7 +54,7 @@ bool JSNodeList::canGetItemsForName(ExecState*, NodeList* impl, PropertyName pro
 JSValue JSNodeList::nameGetter(ExecState* exec, JSValue slotBase, PropertyName propertyName)
 {
     JSNodeList* thisObj = jsCast<JSNodeList*>(asObject(slotBase));
-    return toJS(exec, thisObj->globalObject(), thisObj->impl()->namedItem(propertyNameToAtomicString(propertyName)));
+    return toJS(exec, thisObj->globalObject(), thisObj->impl().namedItem(propertyNameToAtomicString(propertyName)));
 }
 
 } // namespace WebCore
index 4727566..f44625c 100644 (file)
@@ -38,12 +38,12 @@ namespace WebCore {
 
 void JSOscillatorNode::setType(ExecState* exec, JSValue value)
 {
-    OscillatorNode* imp = impl();
+    OscillatorNode& imp = impl();
 
 #if ENABLE(LEGACY_WEB_AUDIO)
     if (value.isNumber()) {
         uint32_t type = value.toUInt32(exec);
-        if (!imp->setType(type))
+        if (!imp.setType(type))
             exec->vm().throwException(exec, createTypeError(exec, "Illegal OscillatorNode type"));
         return;
     }
@@ -52,7 +52,7 @@ void JSOscillatorNode::setType(ExecState* exec, JSValue value)
     if (value.isString()) {
         String type = value.toString(exec)->value(exec);
         if (type == "sine" || type == "square" || type == "sawtooth" || type == "triangle") {
-            imp->setType(type);
+            imp.setType(type);
             return;
         }
     }
index eb216d2..f289785 100644 (file)
@@ -38,12 +38,12 @@ namespace WebCore {
 
 void JSPannerNode::setPanningModel(ExecState* exec, JSValue value)
 {
-    PannerNode* imp = impl();
+    PannerNode& imp = impl();
 
 #if ENABLE(LEGACY_WEB_AUDIO)
     if (value.isNumber()) {
         uint32_t model = value.toUInt32(exec);
-        if (!imp->setPanningModel(model))
+        if (!imp.setPanningModel(model))
             exec->vm().throwException(exec, createTypeError(exec, "Illegal panningModel"));
         return;
     }
@@ -52,7 +52,7 @@ void JSPannerNode::setPanningModel(ExecState* exec, JSValue value)
     if (value.isString()) {
         String model = value.toString(exec)->value(exec);
         if (model == "equalpower" || model == "HRTF" || model == "soundfield") {
-            imp->setPanningModel(model);
+            imp.setPanningModel(model);
             return;
         }
     }
@@ -62,12 +62,12 @@ void JSPannerNode::setPanningModel(ExecState* exec, JSValue value)
 
 void JSPannerNode::setDistanceModel(ExecState* exec, JSValue value)
 {
-    PannerNode* imp = impl();
+    PannerNode& imp = impl();
 
 #if ENABLE(LEGACY_WEB_AUDIO)
     if (value.isNumber()) {
         uint32_t model = value.toUInt32(exec);
-        if (!imp->setDistanceModel(model))
+        if (!imp.setDistanceModel(model))
             exec->vm().throwException(exec, createTypeError(exec, "Illegal distanceModel"));
         return;
     }
@@ -76,7 +76,7 @@ void JSPannerNode::setDistanceModel(ExecState* exec, JSValue value)
     if (value.isString()) {
         String model = value.toString(exec)->value(exec);
         if (model == "linear" || model == "inverse" || model == "exponential") {
-            imp->setDistanceModel(model);
+            imp.setDistanceModel(model);
             return;
         }
     }
index be74471..a73380b 100644 (file)
@@ -51,9 +51,9 @@ Instance* pluginInstance(HTMLElement& element)
     return instance;
 }
 
-static JSObject* pluginScriptObjectFromPluginViewBase(HTMLPlugInElement* pluginElement, JSGlobalObject* globalObject)
+static JSObject* pluginScriptObjectFromPluginViewBase(HTMLPlugInElement& pluginElement, JSGlobalObject* globalObject)
 {
-    Widget* pluginWidget = pluginElement->pluginWidget();
+    Widget* pluginWidget = pluginElement.pluginWidget();
     if (!pluginWidget)
         return 0;
     
@@ -66,21 +66,21 @@ static JSObject* pluginScriptObjectFromPluginViewBase(HTMLPlugInElement* pluginE
 
 static JSObject* pluginScriptObjectFromPluginViewBase(JSHTMLElement* jsHTMLElement)
 {
-    HTMLElement* element = jsHTMLElement->impl();
-    if (!isPluginElement(*element))
+    HTMLElement& element = jsHTMLElement->impl();
+    if (!isPluginElement(element))
         return 0;
 
-    HTMLPlugInElement* pluginElement = static_cast<HTMLPlugInElement*>(element);
+    HTMLPlugInElement& pluginElement = toHTMLPlugInElement(element);
     return pluginScriptObjectFromPluginViewBase(pluginElement, jsHTMLElement->globalObject());
 }
 
 JSObject* pluginScriptObject(ExecState* exec, JSHTMLElement* jsHTMLElement)
 {
-    HTMLElement* element = jsHTMLElement->impl();
-    if (!isPluginElement(*element))
+    HTMLElement& element = jsHTMLElement->impl();
+    if (!isPluginElement(element))
         return 0;
 
-    HTMLPlugInElement* pluginElement = static_cast<HTMLPlugInElement*>(element);
+    HTMLPlugInElement& pluginElement = toHTMLPlugInElement(element);
 
     // First, see if we can ask the plug-in view for its script object.
     if (JSObject* scriptObject = pluginScriptObjectFromPluginViewBase(pluginElement, jsHTMLElement->globalObject()))
@@ -89,7 +89,7 @@ JSObject* pluginScriptObject(ExecState* exec, JSHTMLElement* jsHTMLElement)
     // Otherwise, fall back to getting the object from the instance.
 
     // The plugin element holds an owning reference, so we don't have to.
-    Instance* instance = pluginElement->getInstance().get();
+    Instance* instance = pluginElement.getInstance().get();
     if (!instance || !instance->rootObject())
         return 0;
 
@@ -164,7 +164,7 @@ CallType pluginElementGetCallData(JSHTMLElement* element, CallData& callData)
         return CallTypeHost;
     }
     
-    Instance* instance = pluginInstance(*element->impl());
+    Instance* instance = pluginInstance(element->impl());
     if (!instance || !instance->supportsInvokeDefaultMethod())
         return CallTypeNone;
     callData.native.function = callPlugin;
index 5946ba3..e4d46f7 100644 (file)
@@ -51,13 +51,13 @@ JSValue JSPopStateEvent::state(ExecState* exec) const
     if (!cachedValue.isEmpty())
         return cachedValue;
 
-    PopStateEvent* event = impl();
+    PopStateEvent& event = impl();
 
-    if (!event->state().hasNoValue())
-        return cacheState(exec, const_cast<JSPopStateEvent*>(this), event->state().jsValue());
+    if (!event.state().hasNoValue())
+        return cacheState(exec, const_cast<JSPopStateEvent*>(this), event.state().jsValue());
 
-    History* history = event->history();
-    if (!history || !event->serializedState())
+    History* history = event.history();
+    if (!history || !event.serializedState())
         return cacheState(exec, const_cast<JSPopStateEvent*>(this), jsNull());
 
     // There's no cached value from a previous invocation, nor a state value was provided by the
@@ -66,14 +66,14 @@ JSValue JSPopStateEvent::state(ExecState* exec) const
     // The current history state object might've changed in the meantime, so we need to take care
     // of using the correct one, and always share the same deserialization with history.state.
 
-    bool isSameState = history->isSameAsCurrentState(event->serializedState().get());
+    bool isSameState = history->isSameAsCurrentState(event.serializedState().get());
     JSValue result;
 
     if (isSameState) {
         JSHistory* jsHistory = jsCast<JSHistory*>(toJS(exec, globalObject(), history).asCell());
         result = jsHistory->state(exec);
     } else
-        result = event->serializedState()->deserialize(exec, globalObject(), 0);
+        result = event.serializedState()->deserialize(exec, globalObject(), 0);
 
     return cacheState(exec, const_cast<JSPopStateEvent*>(this), result);
 }
index 598209a..ccddf0e 100644 (file)
@@ -43,7 +43,7 @@ bool JSRTCStatsResponse::canGetItemsForName(ExecState*, RTCStatsResponse* respon
 JSValue JSRTCStatsResponse::nameGetter(ExecState* exec, JSValue slotBase, PropertyName propertyName)
 {
     JSRTCStatsResponse* thisObj = jsCast<JSRTCStatsResponse*>(asObject(slotBase));
-    return toJS(exec, thisObj->globalObject(), thisObj->impl()->namedItem(propertyNameToAtomicString(propertyName)));
+    return toJS(exec, thisObj->globalObject(), thisObj->impl().namedItem(propertyNameToAtomicString(propertyName)));
 }
 
 } // namespace WebCore
index 808c430..b28e7cf 100644 (file)
@@ -44,7 +44,7 @@ void JSSVGElementInstance::visitChildren(JSC::JSCell* cell, JSC::SlotVisitor& vi
     // Skip JSEventTarget::visitChildren because event listener registration is
     // forwarded to the corresponding element.
     JSEventTarget::Base::visitChildren(thisObject, visitor);
-    visitor.addOpaqueRoot(root(thisObject->impl()->correspondingElement()));
+    visitor.addOpaqueRoot(root(thisObject->impl().correspondingElement()));
 }
 
 } // namespace WebCore
index bad8d38..cf78a03 100644 (file)
@@ -34,9 +34,9 @@ namespace WebCore {
 
 JSValue JSSVGLength::value(ExecState* exec) const
 {
-    SVGLength& podImp = impl()->propertyReference();
+    SVGLength& podImp = impl().propertyReference();
     ExceptionCode ec = 0;
-    SVGLengthContext lengthContext(impl()->contextElement());
+    SVGLengthContext lengthContext(impl().contextElement());
     float value = podImp.value(lengthContext, ec);
     if (ec) {
         setDOMException(exec, ec);
@@ -48,7 +48,7 @@ JSValue JSSVGLength::value(ExecState* exec) const
 
 void JSSVGLength::setValue(ExecState* exec, JSValue value)
 {
-    if (impl()->isReadOnly()) {
+    if (impl().isReadOnly()) {
         setDOMException(exec, NO_MODIFICATION_ALLOWED_ERR);
         return;
     }
@@ -58,27 +58,27 @@ void JSSVGLength::setValue(ExecState* exec, JSValue value)
         return;
     }
 
-    SVGLength& podImp = impl()->propertyReference();
+    SVGLength& podImp = impl().propertyReference();
 
     ExceptionCode ec = 0;
-    SVGLengthContext lengthContext(impl()->contextElement());
+    SVGLengthContext lengthContext(impl().contextElement());
     podImp.setValue(value.toFloat(exec), lengthContext, ec);
     if (ec) {
         setDOMException(exec, ec);
         return;
     }
 
-    impl()->commitChange();
+    impl().commitChange();
 }
 
 JSValue JSSVGLength::convertToSpecifiedUnits(ExecState* exec)
 {
-    if (impl()->isReadOnly()) {
+    if (impl().isReadOnly()) {
         setDOMException(exec, NO_MODIFICATION_ALLOWED_ERR);
         return jsUndefined();
     }
 
-    SVGLength& podImp = impl()->propertyReference();
+    SVGLength& podImp = impl().propertyReference();
 
     if (exec->argumentCount() < 1)
         return exec->vm().throwException(exec, createNotEnoughArgumentsError(exec));
@@ -88,14 +88,14 @@ JSValue JSSVGLength::convertToSpecifiedUnits(ExecState* exec)
         return jsUndefined();
 
     ExceptionCode ec = 0;
-    SVGLengthContext lengthContext(impl()->contextElement());
+    SVGLengthContext lengthContext(impl().contextElement());
     podImp.convertToSpecifiedUnits(unitType, lengthContext, ec);
     if (ec) {
         setDOMException(exec, ec);
         return jsUndefined();
     }
 
-    impl()->commitChange();
+    impl().commitChange();
     return jsUndefined();
 }
 
index 4f9a241..2c27864 100644 (file)
@@ -52,7 +52,7 @@ void JSSharedWorker::visitChildren(JSCell* cell, SlotVisitor& visitor)
     ASSERT(thisObject->structure()->typeInfo().overridesVisitChildren());
     Base::visitChildren(thisObject, visitor);
 
-    if (MessagePort* port = thisObject->impl()->port())
+    if (MessagePort* port = thisObject->impl().port())
         visitor.addOpaqueRoot(port);
 }
 
@@ -72,10 +72,10 @@ EncodedJSValue JSC_HOST_CALL JSSharedWorkerConstructor::constructJSSharedWorker(
         return JSValue::encode(JSValue());
 
     // FIXME: We need to use both the dynamic scope and the lexical scope (dynamic scope for resolving the worker URL)
-    DOMWindow* window = asJSDOMWindow(exec->lexicalGlobalObject())->impl();
+    DOMWindow& window = asJSDOMWindow(exec->lexicalGlobalObject())->impl();
     ExceptionCode ec = 0;
-    ASSERT(window->document());
-    RefPtr<SharedWorker> worker = SharedWorker::create(*window->document(), scriptURL, name, ec);
+    ASSERT(window.document());
+    RefPtr<SharedWorker> worker = SharedWorker::create(*window.document(), scriptURL, name, ec);
     if (ec) {
         setDOMException(exec, ec);
         return JSValue::encode(JSValue());
index 3014821..b27694c 100644 (file)
@@ -51,7 +51,7 @@ JSValue JSStorage::nameGetter(ExecState* exec, JSValue slotBase, PropertyName pr
         return asObject(prototype)->get(exec, propertyName);
  
     ExceptionCode ec = 0;
-    JSValue result = jsStringOrNull(exec, thisObj->impl()->getItem(propertyNameToString(propertyName), ec));
+    JSValue result = jsStringOrNull(exec, thisObj->impl().getItem(propertyNameToString(propertyName), ec));
     setDOMException(exec, ec);
     return result;
 }
@@ -117,7 +117,7 @@ bool JSStorage::putDelegate(ExecState* exec, PropertyName propertyName, JSValue
         return true;
     
     ExceptionCode ec = 0;
-    impl()->setItem(propertyNameToString(propertyName), stringValue, ec);
+    impl().setItem(propertyNameToString(propertyName), stringValue, ec);
     setDOMException(exec, ec);
 
     return true;
index 46a5656..f706306 100644 (file)
@@ -42,7 +42,7 @@ void JSStyleSheet::visitChildren(JSCell* cell, SlotVisitor& visitor)
     COMPILE_ASSERT(StructureFlags & OverridesVisitChildren, OverridesVisitChildrenWithoutSettingFlag);
     ASSERT(thisObject->structure()->typeInfo().overridesVisitChildren());
     Base::visitChildren(thisObject, visitor);
-    visitor.addOpaqueRoot(root(thisObject->impl()));
+    visitor.addOpaqueRoot(root(&thisObject->impl()));
 }
 
 JSValue toJS(ExecState* exec, JSDOMGlobalObject* globalObject, StyleSheet* styleSheet)
index 7017bce..9ac4e11 100644 (file)
@@ -43,7 +43,7 @@ bool JSStyleSheetList::canGetItemsForName(ExecState*, StyleSheetList* styleSheet
 JSValue JSStyleSheetList::nameGetter(ExecState* exec, JSValue slotBase, PropertyName propertyName)
 {
     JSStyleSheetList* thisObj = jsCast<JSStyleSheetList*>(asObject(slotBase));
-    HTMLStyleElement* element = thisObj->impl()->getNamedItem(propertyNameToString(propertyName));
+    HTMLStyleElement* element = thisObj->impl().getNamedItem(propertyNameToString(propertyName));
     ASSERT(element);
     return toJS(exec, thisObj->globalObject(), element->sheet());
 }
index 473eb52..1605ab3 100644 (file)
@@ -38,22 +38,22 @@ namespace WebCore {
 bool JSTextTrackCueOwner::isReachableFromOpaqueRoots(JSC::Handle<JSC::Unknown> handle, void*, SlotVisitor& visitor)
 {
     JSTextTrackCue* jsTextTrackCue = jsCast<JSTextTrackCue*>(handle.get().asCell());
-    TextTrackCue* textTrackCue = jsTextTrackCue->impl();
+    TextTrackCue& textTrackCue = jsTextTrackCue->impl();
 
     // If the cue is firing event listeners, its wrapper is reachable because
     // the wrapper is responsible for marking those event listeners.
-    if (textTrackCue->isFiringEventListeners())
+    if (textTrackCue.isFiringEventListeners())
         return true;
 
     // If the cue has no event listeners and has no custom properties, it is not reachable.
-    if (!textTrackCue->hasEventListeners() && !jsTextTrackCue->hasCustomProperties())
+    if (!textTrackCue.hasEventListeners() && !jsTextTrackCue->hasCustomProperties())
         return false;
 
     // If the cue is not associated with a track, it is not reachable.
-    if (!textTrackCue->track())
+    if (!textTrackCue.track())
         return false;
 
-    return visitor.containsOpaqueRoot(root(textTrackCue->track()));
+    return visitor.containsOpaqueRoot(root(textTrackCue.track()));
 }
 
 void JSTextTrackCue::visitChildren(JSCell* cell, SlotVisitor& visitor)
@@ -65,11 +65,11 @@ void JSTextTrackCue::visitChildren(JSCell* cell, SlotVisitor& visitor)
     Base::visitChildren(jsTextTrackCue, visitor);
     
     // Mark the cue's track root if it has one.
-    TextTrackCue* textTrackCue = jsTextTrackCue->impl();
-    if (TextTrack* textTrack = textTrackCue->track())
+    TextTrackCue& textTrackCue = jsTextTrackCue->impl();
+    if (TextTrack* textTrack = textTrackCue.track())
         visitor.addOpaqueRoot(root(textTrack));
     
-    textTrackCue->visitJSEventListeners(visitor);
+    textTrackCue.visitJSEventListeners(visitor);
 }
 
 } // namespace WebCore
index 7c5172a..9846fb9 100644 (file)
@@ -42,10 +42,10 @@ void JSTextTrack::visitChildren(JSCell* cell, SlotVisitor& visitor)
     ASSERT(jsTextTrack->structure()->typeInfo().overridesVisitChildren());
     Base::visitChildren(jsTextTrack, visitor);
 
-    TextTrack* textTrack = jsTextTrack->impl();
-    visitor.addOpaqueRoot(root(textTrack));
+    TextTrack& textTrack = jsTextTrack->impl();
+    visitor.addOpaqueRoot(root(&textTrack));
 
-    textTrack->visitJSEventListeners(visitor);
+    textTrack.visitJSEventListeners(visitor);
 }
 
 } // namespace WebCore
index 6c5ce8b..8be5ef4 100644 (file)
@@ -43,9 +43,9 @@ void JSTextTrackList::visitChildren(JSCell* cell, SlotVisitor& visitor)
     ASSERT(jsTextTrackList->structure()->typeInfo().overridesVisitChildren());
     Base::visitChildren(jsTextTrackList, visitor);
     
-    TextTrackList* textTrackList = jsTextTrackList->impl();
-    visitor.addOpaqueRoot(root(textTrackList->element()));
-    textTrackList->visitJSEventListeners(visitor);
+    TextTrackList& textTrackList = jsTextTrackList->impl();
+    visitor.addOpaqueRoot(root(textTrackList.element()));
+    textTrackList.visitJSEventListeners(visitor);
 }
     
 } // namespace WebCore
index 81b709c..0ad2336 100644 (file)
@@ -44,7 +44,7 @@ TrackBase* toTrack(JSValue value)
 
     JSObject* object = asObject(value);
     if (object->inherits(JSTextTrack::info()))
-        return jsCast<JSTextTrack*>(object)->impl();
+        return &jsCast<JSTextTrack*>(object)->impl();
     
     // FIXME: Fill in additional tests and casts here for VideoTrack and AudioTrack when 
     // they have been added to WebCore.
index f827313..3142cb1 100644 (file)
@@ -38,7 +38,7 @@ namespace WebCore {
 
 JSValue JSTrackEvent::track(ExecState* exec) const
 {
-    TrackBase* track = impl()->track();
+    TrackBase* track = impl().track();
     if (!track)
         return jsNull();
 
index 77cc341..ec3adcc 100644 (file)
@@ -43,8 +43,8 @@ void JSVideoTrack::visitChildren(JSCell* cell, SlotVisitor& visitor)
     ASSERT(jsVideoTrack->structure()->typeInfo().overridesVisitChildren());
     Base::visitChildren(jsVideoTrack, visitor);
 
-    VideoTrack* videoTrack = jsVideoTrack->impl();
-    visitor.addOpaqueRoot(root(videoTrack));
+    VideoTrack& videoTrack = jsVideoTrack->impl();
+    visitor.addOpaqueRoot(root(&videoTrack));
 }
 
 } // namespace WebCore
index fb9ab47..0a669d3 100644 (file)
@@ -43,9 +43,9 @@ void JSVideoTrackList::visitChildren(JSCell* cell, SlotVisitor& visitor)
     ASSERT(jsVideoTrackList->structure()->typeInfo().overridesVisitChildren());
     Base::visitChildren(jsVideoTrackList, visitor);
 
-    VideoTrackList* videoTrackList = jsVideoTrackList->impl();
-    visitor.addOpaqueRoot(root(videoTrackList->element()));
-    videoTrackList->visitJSEventListeners(visitor);
+    VideoTrackList& videoTrackList = jsVideoTrackList->impl();
+    visitor.addOpaqueRoot(root(videoTrackList.element()));
+    videoTrackList.visitJSEventListeners(visitor);
 }
 
 } // namespace WebCore
index 9506844..c195d01 100644 (file)
@@ -155,7 +155,7 @@ static JSValue getObjectParameter(JSWebGLRenderingContext* obj, ExecState* exec,
         return exec->vm().throwException(exec, createNotEnoughArgumentsError(exec));
 
     ExceptionCode ec = 0;
-    WebGLRenderingContext* context = obj->impl();
+    WebGLRenderingContext& context = obj->impl();
     unsigned target = exec->uncheckedArgument(0).toInt32(exec);
     if (exec->hadException())
         return jsUndefined();
@@ -165,17 +165,17 @@ static JSValue getObjectParameter(JSWebGLRenderingContext* obj, ExecState* exec,
     WebGLGetInfo info;
     switch (objectType) {
     case kBuffer:
-        info = context->getBufferParameter(target, pname, ec);
+        info = context.getBufferParameter(target, pname, ec);
         break;
     case kRenderbuffer:
-        info = context->getRenderbufferParameter(target, pname, ec);
+        info = context.getRenderbufferParameter(target, pname, ec);
         break;
     case kTexture:
-        info = context->getTexParameter(target, pname, ec);
+        info = context.getTexParameter(target, pname, ec);
         break;
     case kVertexAttrib:
         // target => index
-        info = context->getVertexAttrib(target, pname, ec);
+        info = context.getVertexAttrib(target, pname, ec);
         break;
     default:
         notImplemented();
@@ -237,7 +237,7 @@ void JSWebGLRenderingContext::visitChildren(JSCell* cell, SlotVisitor& visitor)
     COMPILE_ASSERT(StructureFlags & OverridesVisitChildren, OverridesVisitChildrenWithoutSettingFlag);
     ASSERT(thisObject->structure()->typeInfo().overridesVisitChildren());
     Base::visitChildren(thisObject, visitor);
-    visitor.addOpaqueRoot(thisObject->impl());
+    visitor.addOpaqueRoot(&thisObject->impl());
 }
 
 JSValue JSWebGLRenderingContext::getAttachedShaders(ExecState* exec)
@@ -245,12 +245,12 @@ JSValue JSWebGLRenderingContext::getAttachedShaders(ExecState* exec)
     if (exec->argumentCount() < 1)
         return exec->vm().throwException(exec, createNotEnoughArgumentsError(exec));
     ExceptionCode ec = 0;
-    WebGLRenderingContext* context = impl();
+    WebGLRenderingContext& context = impl();
     WebGLProgram* program = toWebGLProgram(exec->uncheckedArgument(0));
     if (!program && !exec->uncheckedArgument(0).isUndefinedOrNull())
         return throwTypeError(exec);
     Vector<RefPtr<WebGLShader> > shaders;
-    bool succeed = context->getAttachedShaders(program, shaders, ec);
+    bool succeed = context.getAttachedShaders(program, shaders, ec);
     if (ec) {
         setDOMException(exec, ec);
         return jsNull();
@@ -268,11 +268,11 @@ JSValue JSWebGLRenderingContext::getExtension(ExecState* exec)
     if (exec->argumentCount() < 1)
         return exec->vm().throwException(exec, createNotEnoughArgumentsError(exec));
 
-    WebGLRenderingContext* context = impl();
+    WebGLRenderingContext& context = impl();
     const String name = exec->uncheckedArgument(0).toString(exec)->value(exec);
     if (exec->hadException())
         return jsUndefined();
-    WebGLExtension* extension = context->getExtension(name);
+    WebGLExtension* extension = context.getExtension(name);
     return toJS(exec, globalObject(), extension);
 }
 
@@ -287,7 +287,7 @@ JSValue JSWebGLRenderingContext::getFramebufferAttachmentParameter(ExecState* ex
         return exec->vm().throwException(exec, createNotEnoughArgumentsError(exec));
 
     ExceptionCode ec = 0;
-    WebGLRenderingContext* context = impl();
+    WebGLRenderingContext& context = impl();
     unsigned target = exec->uncheckedArgument(0).toInt32(exec);
     if (exec->hadException())
         return jsUndefined();
@@ -297,7 +297,7 @@ JSValue JSWebGLRenderingContext::getFramebufferAttachmentParameter(ExecState* ex
     unsigned pname = exec->uncheckedArgument(2).toInt32(exec);
     if (exec->hadException())
         return jsUndefined();
-    WebGLGetInfo info = context->getFramebufferAttachmentParameter(target, attachment, pname, ec);
+    WebGLGetInfo info = context.getFramebufferAttachmentParameter(target, attachment, pname, ec);
     if (ec) {
         setDOMException(exec, ec);
         return jsUndefined();
@@ -311,11 +311,11 @@ JSValue JSWebGLRenderingContext::getParameter(ExecState* exec)
         return exec->vm().throwException(exec, createNotEnoughArgumentsError(exec));
 
     ExceptionCode ec = 0;
-    WebGLRenderingContext* context = impl();
+    WebGLRenderingContext& context = impl();
     unsigned pname = exec->uncheckedArgument(0).toInt32(exec);
     if (exec->hadException())
         return jsUndefined();
-    WebGLGetInfo info = context->getParameter(pname, ec);
+    WebGLGetInfo info = context.getParameter(pname, ec);
     if (ec) {
         setDOMException(exec, ec);
         return jsUndefined();
@@ -329,14 +329,14 @@ JSValue JSWebGLRenderingContext::getProgramParameter(ExecState* exec)
         return exec->vm().throwException(exec, createNotEnoughArgumentsError(exec));
 
     ExceptionCode ec = 0;
-    WebGLRenderingContext* context = impl();
+    WebGLRenderingContext& context = impl();
     WebGLProgram* program = toWebGLProgram(exec->uncheckedArgument(0));
     if (!program && !exec->uncheckedArgument(0).isUndefinedOrNull())
         return throwTypeError(exec);
     unsigned pname = exec->uncheckedArgument(1).toInt32(exec);
     if (exec->hadException())
         return jsUndefined();
-    WebGLGetInfo info = context->getProgramParameter(program, pname, ec);
+    WebGLGetInfo info = context.getProgramParameter(program, pname, ec);
     if (ec) {
         setDOMException(exec, ec);
         return jsUndefined();
@@ -355,14 +355,14 @@ JSValue JSWebGLRenderingContext::getShaderParameter(ExecState* exec)
         return exec->vm().throwException(exec, createNotEnoughArgumentsError(exec));
 
     ExceptionCode ec = 0;
-    WebGLRenderingContext* context = impl();
+    WebGLRenderingContext& context = impl();
     if (!exec->uncheckedArgument(0).isUndefinedOrNull() && !exec->uncheckedArgument(0).inherits(JSWebGLShader::info()))
         return throwTypeError(exec);
     WebGLShader* shader = toWebGLShader(exec->uncheckedArgument(0));
     unsigned pname = exec->uncheckedArgument(1).toInt32(exec);
     if (exec->hadException())
         return jsUndefined();
-    WebGLGetInfo info = context->getShaderParameter(shader, pname, ec);
+    WebGLGetInfo info = context.getShaderParameter(shader, pname, ec);
     if (ec) {
         setDOMException(exec, ec);
         return jsUndefined();
@@ -372,10 +372,10 @@ JSValue JSWebGLRenderingContext::getShaderParameter(ExecState* exec)
 
 JSValue JSWebGLRenderingContext::getSupportedExtensions(ExecState* exec)
 {
-    WebGLRenderingContext* context = impl();
-    if (context->isContextLost())
+    WebGLRenderingContext& context = impl();
+    if (context.isContextLost())
         return jsNull();
-    Vector<String> value = context->getSupportedExtensions();
+    Vector<String> value = context.getSupportedExtensions();
     MarkedArgumentBuffer list;
     for (size_t ii = 0; ii < value.size(); ++ii)
         list.append(jsStringWithCache(exec, value[ii]));
@@ -393,14 +393,14 @@ JSValue JSWebGLRenderingContext::getUniform(ExecState* exec)
         return exec->vm().throwException(exec, createNotEnoughArgumentsError(exec));
 
     ExceptionCode ec = 0;
-    WebGLRenderingContext* context = impl();
+    WebGLRenderingContext& context = impl();
     WebGLProgram* program = toWebGLProgram(exec->uncheckedArgument(0));
     if (!program && !exec->uncheckedArgument(0).isUndefinedOrNull())
         return throwTypeError(exec);
     WebGLUniformLocation* location = toWebGLUniformLocation(exec->uncheckedArgument(1));
     if (!location && !exec->uncheckedArgument(1).isUndefinedOrNull())
         return throwTypeError(exec);
-    WebGLGetInfo info = context->getUniform(program, location, ec);
+    WebGLGetInfo info = context.getUniform(program, location, ec);
     if (ec) {
         setDOMException(exec, ec);
         return jsUndefined();
@@ -459,7 +459,7 @@ static bool functionForUniform(DataFunctionToCall f)
     return false;
 }
 
-static JSC::JSValue dataFunctionf(DataFunctionToCall f, JSC::ExecState* exec, WebGLRenderingContext* context)
+static JSC::JSValue dataFunctionf(DataFunctionToCall f, JSC::ExecState* exec, WebGLRenderingContext& context)
 {
     if (exec->argumentCount() != 2)
         return exec->vm().throwException(exec, createNotEnoughArgumentsError(exec));
@@ -485,28 +485,28 @@ static JSC::JSValue dataFunctionf(DataFunctionToCall f, JSC::ExecState* exec, We
     if (webGLArray) {
         switch (f) {
         case f_uniform1v:
-            context->uniform1fv(location, webGLArray.get(), ec);
+            context.uniform1fv(location, webGLArray.get(), ec);
             break;
         case f_uniform2v:
-            context->uniform2fv(location, webGLArray.get(), ec);
+            context.uniform2fv(location, webGLArray.get(), ec);
             break;
         case f_uniform3v:
-            context->uniform3fv(location, webGLArray.get(), ec);
+            context.uniform3fv(location, webGLArray.get(), ec);
             break;
         case f_uniform4v:
-            context->uniform4fv(location, webGLArray.get(), ec);
+            context.uniform4fv(location, webGLArray.get(), ec);
             break;
         case f_vertexAttrib1v:
-            context->vertexAttrib1fv(index, webGLArray.get());
+            context.vertexAttrib1fv(index, webGLArray.get());
             break;
         case f_vertexAttrib2v:
-            context->vertexAttrib2fv(index, webGLArray.get());
+            context.vertexAttrib2fv(index, webGLArray.get());
             break;
         case f_vertexAttrib3v:
-            context->vertexAttrib3fv(index, webGLArray.get());
+            context.vertexAttrib3fv(index, webGLArray.get());
             break;
         case f_vertexAttrib4v:
-            context->vertexAttrib4fv(index, webGLArray.get());
+            context.vertexAttrib4fv(index, webGLArray.get());
             break;
         }
         
@@ -520,28 +520,28 @@ static JSC::JSValue dataFunctionf(DataFunctionToCall f, JSC::ExecState* exec, We
 
     switch (f) {
     case f_uniform1v:
-        context->uniform1fv(location, array.data(), array.size(), ec);
+        context.uniform1fv(location, array.data(), array.size(), ec);
         break;
     case f_uniform2v:
-        context->uniform2fv(location, array.data(), array.size(), ec);
+        context.uniform2fv(location, array.data(), array.size(), ec);
         break;
     case f_uniform3v:
-        context->uniform3fv(location, array.data(), array.size(), ec);
+        context.uniform3fv(location, array.data(), array.size(), ec);
         break;
     case f_uniform4v:
-        context->uniform4fv(location, array.data(), array.size(), ec);
+        context.uniform4fv(location, array.data(), array.size(), ec);
         break;
     case f_vertexAttrib1v:
-        context->vertexAttrib1fv(index, array.data(), array.size());
+        context.vertexAttrib1fv(index, array.data(), array.size());
         break;
     case f_vertexAttrib2v:
-        context->vertexAttrib2fv(index, array.data(), array.size());
+        context.vertexAttrib2fv(index, array.data(), array.size());
         break;
     case f_vertexAttrib3v:
-        context->vertexAttrib3fv(index, array.data(), array.size());
+        context.vertexAttrib3fv(index, array.data(), array.size());
         break;
     case f_vertexAttrib4v:
-        context->vertexAttrib4fv(index, array.data(), array.size());
+        context.vertexAttrib4fv(index, array.data(), array.size());
         break;
     }
     
@@ -549,7 +549,7 @@ static JSC::JSValue dataFunctionf(DataFunctionToCall f, JSC::ExecState* exec, We
     return jsUndefined();
 }
 
-static JSC::JSValue dataFunctioni(DataFunctionToCall f, JSC::ExecState* exec, WebGLRenderingContext* context)
+static JSC::JSValue dataFunctioni(DataFunctionToCall f, JSC::ExecState* exec, WebGLRenderingContext& context)
 {
     if (exec->argumentCount() != 2)
         return exec->vm().throwException(exec, createNotEnoughArgumentsError(exec));
@@ -564,16 +564,16 @@ static JSC::JSValue dataFunctioni(DataFunctionToCall f, JSC::ExecState* exec, We
     if (webGLArray) {
         switch (f) {
         case f_uniform1v:
-            context->uniform1iv(location, webGLArray.get(), ec);
+            context.uniform1iv(location, webGLArray.get(), ec);
             break;
         case f_uniform2v:
-            context->uniform2iv(location, webGLArray.get(), ec);
+            context.uniform2iv(location, webGLArray.get(), ec);
             break;
         case f_uniform3v:
-            context->uniform3iv(location, webGLArray.get(), ec);
+            context.uniform3iv(location, webGLArray.get(), ec);
             break;
         case f_uniform4v:
-            context->uniform4iv(location, webGLArray.get(), ec);
+            context.uniform4iv(location, webGLArray.get(), ec);
             break;
         default:
             break;
@@ -590,16 +590,16 @@ static JSC::JSValue dataFunctioni(DataFunctionToCall f, JSC::ExecState* exec, We
 
     switch (f) {
     case f_uniform1v:
-        context->uniform1iv(location, array.data(), array.size(), ec);
+        context.uniform1iv(location, array.data(), array.size(), ec);
         break;
     case f_uniform2v:
-        context->uniform2iv(location, array.data(), array.size(), ec);
+        context.uniform2iv(location, array.data(), array.size(), ec);
         break;
     case f_uniform3v:
-        context->uniform3iv(location, array.data(), array.size(), ec);
+        context.uniform3iv(location, array.data(), array.size(), ec);
         break;
     case f_uniform4v:
-        context->uniform4iv(location, array.data(), array.size(), ec);
+        context.uniform4iv(location, array.data(), array.size(), ec);
         break;
     default:
         break;
@@ -609,7 +609,7 @@ static JSC::JSValue dataFunctioni(DataFunctionToCall f, JSC::ExecState* exec, We
     return jsUndefined();
 }
 
-static JSC::JSValue dataFunctionMatrix(DataFunctionMatrixToCall f, JSC::ExecState* exec, WebGLRenderingContext* context)
+static JSC::JSValue dataFunctionMatrix(DataFunctionMatrixToCall f, JSC::ExecState* exec, WebGLRenderingContext& context)
 {
     if (exec->argumentCount() != 3)
         return exec->vm().throwException(exec, createNotEnoughArgumentsError(exec));
@@ -628,13 +628,13 @@ static JSC::JSValue dataFunctionMatrix(DataFunctionMatrixToCall f, JSC::ExecStat
     if (webGLArray) {
         switch (f) {
         case f_uniformMatrix2fv:
-            context->uniformMatrix2fv(location, transpose, webGLArray.get(), ec);
+            context.uniformMatrix2fv(location, transpose, webGLArray.get(), ec);
             break;
         case f_uniformMatrix3fv:
-            context->uniformMatrix3fv(location, transpose, webGLArray.get(), ec);
+            context.uniformMatrix3fv(location, transpose, webGLArray.get(), ec);
             break;
         case f_uniformMatrix4fv:
-            context->uniformMatrix4fv(location, transpose, webGLArray.get(), ec);
+            context.uniformMatrix4fv(location, transpose, webGLArray.get(), ec);
             break;
         }
         
@@ -648,13 +648,13 @@ static JSC::JSValue dataFunctionMatrix(DataFunctionMatrixToCall f, JSC::ExecStat
 
     switch (f) {
     case f_uniformMatrix2fv:
-        context->uniformMatrix2fv(location, transpose, array.data(), array.size(), ec);
+        context.uniformMatrix2fv(location, transpose, array.data(), array.size(), ec);
         break;
     case f_uniformMatrix3fv:
-        context->uniformMatrix3fv(location, transpose, array.data(), array.size(), ec);
+        context.uniformMatrix3fv(location, transpose, array.data(), array.size(), ec);
         break;
     case f_uniformMatrix4fv:
-        context->uniformMatrix4fv(location, transpose, array.data(), array.size(), ec);
+        context.uniformMatrix4fv(location, transpose, array.data(), array.size(), ec);
         break;
     }
 
index c5fec94..a40a05e 100644 (file)
@@ -43,7 +43,7 @@ namespace WebCore {
 
 JSC::JSValue JSWorker::postMessage(JSC::ExecState* exec)
 {
-    return handlePostMessage(exec, impl());
+    return handlePostMessage(exec, &impl());
 }
 
 EncodedJSValue JSC_HOST_CALL JSWorkerConstructor::constructJSWorker(ExecState* exec)
@@ -58,11 +58,11 @@ EncodedJSValue JSC_HOST_CALL JSWorkerConstructor::constructJSWorker(ExecState* e
         return JSValue::encode(JSValue());
 
     // See section 4.8.2 step 14 of WebWorkers for why this is the lexicalGlobalObject. 
-    DOMWindow* window = asJSDOMWindow(exec->lexicalGlobalObject())->impl();
+    DOMWindow& window = asJSDOMWindow(exec->lexicalGlobalObject())->impl();
 
     ExceptionCode ec = 0;
-    ASSERT(window->document());
-    RefPtr<Worker> worker = Worker::create(*window->document(), scriptURL, ec);
+    ASSERT(window.document());
+    RefPtr<Worker> worker = Worker::create(*window.document(), scriptURL, ec);
     if (ec) {
         setDOMException(exec, ec);
         return JSValue::encode(JSValue());
index 322c252..e2772ec 100644 (file)
@@ -45,7 +45,7 @@ namespace WebCore {
 
         DECLARE_INFO;
 
-        WorkerGlobalScope* impl() const { return m_impl.get(); }
+        WorkerGlobalScope& impl() const { return *m_impl; }
         ScriptExecutionContext* scriptExecutionContext() const;
 
         static JSC::Structure* createStructure(JSC::VM& vm, JSC::JSGlobalObject* globalObject, JSC::JSValue prototype)
index c81bc14..d6836e1 100644 (file)
@@ -61,12 +61,12 @@ void JSWorkerGlobalScope::visitChildren(JSCell* cell, SlotVisitor& visitor)
     ASSERT(thisObject->structure()->typeInfo().overridesVisitChildren());
     Base::visitChildren(thisObject, visitor);
 
-    if (WorkerLocation* location = thisObject->impl()->optionalLocation())
+    if (WorkerLocation* location = thisObject->impl().optionalLocation())
         visitor.addOpaqueRoot(location);
-    if (WorkerNavigator* navigator = thisObject->impl()->optionalNavigator())
+    if (WorkerNavigator* navigator = thisObject->impl().optionalNavigator())
         visitor.addOpaqueRoot(navigator);
 
-    thisObject->impl()->visitJSEventListeners(visitor);
+    thisObject->impl().visitJSEventListeners(visitor);
 }
 
 bool JSWorkerGlobalScope::getOwnPropertySlotDelegate(ExecState* exec, PropertyName propertyName, PropertySlot& slot)
@@ -90,31 +90,31 @@ JSValue JSWorkerGlobalScope::importScripts(ExecState* exec)
     }
     ExceptionCode ec = 0;
 
-    impl()->importScripts(urls, ec);
+    impl().importScripts(urls, ec);
     setDOMException(exec, ec);
     return jsUndefined();
 }
 
 JSValue JSWorkerGlobalScope::setTimeout(ExecState* exec)
 {
-    OwnPtr<ScheduledAction> action = ScheduledAction::create(exec, currentWorld(exec), impl()->contentSecurityPolicy());
+    OwnPtr<ScheduledAction> action = ScheduledAction::create(exec, currentWorld(exec), impl().contentSecurityPolicy());
     if (exec->hadException())
         return jsUndefined();
     if (!action)
         return jsNumber(0);
     int delay = exec->argument(1).toInt32(exec);
-    return jsNumber(impl()->setTimeout(action.release(), delay));
+    return jsNumber(impl().setTimeout(action.release(), delay));
 }
 
 JSValue JSWorkerGlobalScope::setInterval(ExecState* exec)
 {
-    OwnPtr<ScheduledAction> action = ScheduledAction::create(exec, currentWorld(exec), impl()->contentSecurityPolicy());
+    OwnPtr<ScheduledAction> action = ScheduledAction::create(exec, currentWorld(exec), impl().contentSecurityPolicy());
     if (exec->hadException())
         return jsUndefined();
     if (!action)
         return jsNumber(0);
     int delay = exec->argument(1).toInt32(exec);
-    return jsNumber(impl()->setInterval(action.release(), delay));
+    return jsNumber(impl().setInterval(action.release(), delay));
 }
 
 } // namespace WebCore
index 7041577..bb17a20 100644 (file)
@@ -88,7 +88,7 @@ JSValue JSXMLHttpRequest::open(ExecState* exec)
     if (exec->argumentCount() < 2)
         return exec->vm().throwException(exec, createNotEnoughArgumentsError(exec));
 
-    const URL& url = impl()->scriptExecutionContext()->completeURL(exec->uncheckedArgument(1).toString(exec)->value(exec));
+    const URL& url = impl().scriptExecutionContext()->completeURL(exec->uncheckedArgument(1).toString(exec)->value(exec));
     String method = exec->uncheckedArgument(0).toString(exec)->value(exec);
 
     ExceptionCode ec = 0;
@@ -99,13 +99,13 @@ JSValue JSXMLHttpRequest::open(ExecState* exec)
 
             if (!exec->argument(4).isUndefined()) {
                 String password = valueToStringWithNullCheck(exec, exec->uncheckedArgument(4));
-                impl()->open(method, url, async, user, password, ec);
+                impl().open(method, url, async, user, password, ec);
             } else
-                impl()->open(method, url, async, user, ec);
+                impl().open(method, url, async, user, ec);
         } else
-            impl()->open(method, url, async, ec);
+            impl().open(method, url, async, ec);
     } else
-        impl()->open(method, url, ec);
+        impl().open(method, url, ec);
 
     setDOMException(exec, ec);
     return jsUndefined();
@@ -145,30 +145,30 @@ private:
 
 JSValue JSXMLHttpRequest::send(ExecState* exec)
 {
-    InspectorInstrumentation::willSendXMLHttpRequest(impl()->scriptExecutionContext(), impl()->url());
+    InspectorInstrumentation::willSendXMLHttpRequest(impl().scriptExecutionContext(), impl().url());
 
     ExceptionCode ec = 0;
     JSValue val = exec->argument(0);
     if (val.isUndefinedOrNull())
-        impl()->send(ec);
+        impl().send(ec);
     else if (val.inherits(JSDocument::info()))
-        impl()->send(toDocument(val), ec);
+        impl().send(toDocument(val), ec);
     else if (val.inherits(JSBlob::info()))
-        impl()->send(toBlob(val), ec);
+        impl().send(toBlob(val), ec);
     else if (val.inherits(JSDOMFormData::info()))
-        impl()->send(toDOMFormData(val), ec);
+        impl().send(toDOMFormData(val), ec);
     else if (val.inherits(JSArrayBuffer::info()))
-        impl()->send(toArrayBuffer(val), ec);
+        impl().send(toArrayBuffer(val), ec);
     else if (val.inherits(JSArrayBufferView::info())) {
         RefPtr<ArrayBufferView> view = toArrayBufferView(val);
-        impl()->send(view.get(), ec);
+        impl().send(view.get(), ec);
     } else
-        impl()->send(val.toString(exec)->value(exec), ec);
+        impl().send(val.toString(exec)->value(exec), ec);
 
     SendFunctor functor;
     exec->iterate(functor);
-    impl()->setLastSendLineNumber(functor.line());
-    impl()->setLastSendURL(functor.url());
+    impl().setLastSendLineNumber(functor.line());
+    impl().setLastSendURL(functor.url());
     setDOMException(exec, ec);
     return jsUndefined();
 }
@@ -176,7 +176,7 @@ JSValue JSXMLHttpRequest::send(ExecState* exec)
 JSValue JSXMLHttpRequest::responseText(ExecState* exec) const
 {
     ExceptionCode ec = 0;
-    String text = impl()->responseText(ec);
+    String text = impl().responseText(ec);
     if (ec) {
         setDOMException(exec, ec);
         return jsUndefined();
@@ -186,7 +186,7 @@ JSValue JSXMLHttpRequest::responseText(ExecState* exec) const
 
 JSValue JSXMLHttpRequest::response(ExecState* exec) const
 {
-    switch (impl()->responseTypeCode()) {
+    switch (impl().responseTypeCode()) {
     case XMLHttpRequest::ResponseTypeDefault:
     case XMLHttpRequest::ResponseTypeText:
         return responseText(exec);
@@ -194,19 +194,19 @@ JSValue JSXMLHttpRequest::response(ExecState* exec) const
     case XMLHttpRequest::ResponseTypeJSON:
         {
             // FIXME: Use CachedAttribute for other types as well.
-            if (m_response && impl()->responseCacheIsValid())
+            if (m_response && impl().responseCacheIsValid())
                 return m_response.get();
 
-            if (!impl()->doneWithoutErrors())
+            if (!impl().doneWithoutErrors())
                 return jsNull();
 
-            JSValue value = JSONParse(exec, impl()->responseTextIgnoringResponseType());
+            JSValue value = JSONParse(exec, impl().responseTextIgnoringResponseType());
             if (!value)
                 value = jsNull();
             JSXMLHttpRequest* jsRequest = const_cast<JSXMLHttpRequest*>(this);
             jsRequest->m_response.set(exec->vm(), jsRequest, value);
 
-            impl()->didCacheResponseJSON();
+            impl().didCacheResponseJSON();
 
             return value;
         }
@@ -214,7 +214,7 @@ JSValue JSXMLHttpRequest::response(ExecState* exec) const
     case XMLHttpRequest::ResponseTypeDocument:
         {
             ExceptionCode ec = 0;
-            Document* document = impl()->responseXML(ec);
+            Document* document = impl().responseXML(ec);
             if (ec) {
                 setDOMException(exec, ec);
                 return jsUndefined();
@@ -223,10 +223,10 @@ JSValue JSXMLHttpRequest::response(ExecState* exec) const
         }
 
     case XMLHttpRequest::ResponseTypeBlob:
-        return toJS(exec, globalObject(), impl()->responseBlob());
+        return toJS(exec, globalObject(), impl().responseBlob());
 
     case XMLHttpRequest::ResponseTypeArrayBuffer:
-        return toJS(exec, globalObject(), impl()->responseArrayBuffer());
+        return toJS(exec, globalObject(), impl().responseArrayBuffer());
     }
 
     return jsUndefined();
index a5d4d4d..35ba892 100644 (file)
@@ -43,7 +43,7 @@ void JSXPathResult::visitChildren(JSCell* cell, SlotVisitor& visitor)
     ASSERT(thisObject->structure()->typeInfo().overridesVisitChildren());
     Base::visitChildren(thisObject, visitor);
 
-    const XPath::Value& xpathValue = thisObject->impl()->value();
+    const XPath::Value& xpathValue = thisObject->impl().value();
     if (xpathValue.isNodeSet()) {
         const XPath::NodeSet& nodesToMark = xpathValue.toNodeSet();
         for (size_t i = 0; i < nodesToMark.size(); ++i) {
index 405fba0..1086de2 100644 (file)
@@ -53,7 +53,7 @@ JSValue JSXSLTProcessor::setParameter(ExecState* exec)
     String namespaceURI = exec->uncheckedArgument(0).toString(exec)->value(exec);
     String localName = exec->uncheckedArgument(1).toString(exec)->value(exec);
     String value = exec->uncheckedArgument(2).toString(exec)->value(exec);
-    impl()->setParameter(namespaceURI, localName, value);
+    impl().setParameter(namespaceURI, localName, value);
     return jsUndefined();
 }
 
@@ -63,7 +63,7 @@ JSValue JSXSLTProcessor::getParameter(ExecState* exec)
         return jsUndefined();
     String namespaceURI = exec->uncheckedArgument(0).toString(exec)->value(exec);
     String localName = exec->uncheckedArgument(1).toString(exec)->value(exec);
-    String value = impl()->getParameter(namespaceURI, localName);
+    String value = impl().getParameter(namespaceURI, localName);
     return jsStringOrUndefined(exec, value);
 }
 
@@ -73,7 +73,7 @@ JSValue JSXSLTProcessor::removeParameter(ExecState* exec)
         return jsUndefined();
     String namespaceURI = exec->uncheckedArgument(0).toString(exec)->value(exec);
     String localName = exec->uncheckedArgument(1).toString(exec)->value(exec);
-    impl()->removeParameter(namespaceURI, localName);
+    impl().removeParameter(namespaceURI, localName);
     return jsUndefined();
 }
 
index 4d71bd9..8dae951 100644 (file)
@@ -60,7 +60,7 @@ static Page* toPage(JSGlobalObject* globalObject)
     ASSERT_ARG(globalObject, globalObject);
 
     JSDOMWindow* window = asJSDOMWindow(globalObject);
-    Frame* frame = window->impl()->frame();
+    Frame* frame = window->impl().frame();
     return frame ? frame->page() : 0;
 }
 
index 016931f..3856d01 100644 (file)
@@ -125,7 +125,7 @@ void ScheduledAction::execute(Document* document)
     if (!window)
         return;
 
-    RefPtr<Frame> frame = window->impl()->frame();
+    RefPtr<Frame> frame = window->impl().frame();
     if (!frame || !frame->script().canExecuteScripts(AboutToExecuteScript))
         return;
 
index 9322196..c4e12f9 100644 (file)
@@ -81,7 +81,7 @@ void ScriptCachedFrameData::restore(Frame& frame)
             windowShell->setWindow(window->vm(), window);
         else {
             DOMWindow* domWindow = frame.document()->domWindow();
-            if (windowShell->window()->impl() == domWindow)
+            if (&windowShell->window()->impl() == domWindow)
                 continue;
 
             windowShell->setWindow(domWindow);
index b538791..2780831 100644 (file)
@@ -182,7 +182,7 @@ void ScriptController::clearWindowShell(DOMWindow* newDOMWindow, bool goingIntoP
     for (ShellMap::iterator iter = m_windowShells.begin(); iter != m_windowShells.end(); ++iter) {
         JSDOMWindowShell* windowShell = iter->value.get();
 
-        if (windowShell->window()->impl() == newDOMWindow)
+        if (&windowShell->window()->impl() == newDOMWindow)
             continue;
 
         // Clear the debugger from the current window before setting the new window.
@@ -341,7 +341,7 @@ void ScriptController::collectIsolatedContexts(Vector<std::pair<JSC::ExecState*,
 {
     for (ShellMap::iterator iter = m_windowShells.begin(); iter != m_windowShells.end(); ++iter) {
         JSC::ExecState* exec = iter->value->window()->globalExec();
-        SecurityOrigin* origin = iter->value->window()->impl()->document()->securityOrigin();
+        SecurityOrigin* origin = iter->value->window()->impl().document()->securityOrigin();
         result.append(std::pair<JSC::ExecState*, SecurityOrigin*>(exec, origin));
     }
 }
index dc60db1..c2291c1 100644 (file)
@@ -212,8 +212,8 @@ bool ScriptDebugServer::evaluateBreakpointAction(const ScriptBreakpointAction& b
     DebuggerCallFrame* debuggerCallFrame = currentDebuggerCallFrame();
     switch (breakpointAction.type) {
     case ScriptBreakpointActionTypeLog: {
-        DOMWindow* window = asJSDOMWindow(debuggerCallFrame->dynamicGlobalObject())->impl();
-        if (PageConsole* console = window->pageConsole())
+        DOMWindow& window = asJSDOMWindow(debuggerCallFrame->dynamicGlobalObject())->impl();
+        if (PageConsole* console = window.pageConsole())
             console->addMessage(JSMessageSource, LogMessageLevel, breakpointAction.data);
         break;
     }
index de3b09a..f369b73 100644 (file)
@@ -54,7 +54,7 @@ DOMWindow* domWindowFromExecState(JSC::ExecState* scriptState)
     JSC::JSGlobalObject* globalObject = scriptState->lexicalGlobalObject();
     if (!globalObject->inherits(JSDOMWindowBase::info()))
         return 0;
-    return JSC::jsCast<JSDOMWindowBase*>(globalObject)->impl();
+    return &JSC::jsCast<JSDOMWindowBase*>(globalObject)->impl();
 }
 
 ScriptExecutionContext* scriptExecutionContextFromExecState(JSC::ExecState* scriptState)
index c02ef9f..29ccbe9 100644 (file)
@@ -313,8 +313,8 @@ id <DOMEventTarget> kit(WebCore::EventTarget* eventTarget)
     if (!object->inherits(JSNode::info()))
         return nil;
 
-    WebCore::Node* node = jsCast<JSNode*>(object)->impl();
-    return kit(node);
+    WebCore::Node& node = jsCast<JSNode*>(object)->impl();
+    return kit(&node);
 }
 
 @end
index 93db83b..aa19d15 100644 (file)
@@ -36,7 +36,7 @@ DOMImplementationFront* implementationFront(Document* document)
 
 DOMImplementationFront* implementationFront(JSDOMImplementation* wrapper)
 {
-    return reinterpret_cast<DOMImplementationFront*>(wrapper->impl());
+    return reinterpret_cast<DOMImplementationFront*>(&wrapper->impl());
 }
 
 void DOMImplementationFront::ref()
index 8231cb8..21696e6 100644 (file)
@@ -94,7 +94,7 @@ static inline id createDOMWrapper(JSC::JSObject* object)
 {
     #define WRAP(className) \
         if (object->inherits(WebCore::JS##className::info())) \
-            return kit(static_cast<WebCore::JS##className*>(object)->impl());
+            return kit(&static_cast<WebCore::JS##className*>(object)->impl());
 
     WRAP(CSSRule)
     WRAP(CSSRuleList)
index a41ea1a..014b0fb 100644 (file)
@@ -536,7 +536,7 @@ static void getListFromNSArray(ExecState *exec, NSArray *array, RootObject* root
 
         if (object->inherits(JSHTMLElement::info())) {
             // Plugin elements cache the instance internally.
-            if (ObjcInstance* instance = static_cast<ObjcInstance*>(pluginInstance(*jsCast<JSHTMLElement*>(object)->impl())))
+            if (ObjcInstance* instance = static_cast<ObjcInstance*>(pluginInstance(jsCast<JSHTMLElement*>(object)->impl())))
                 return instance->getObject();
         } else if (object->inherits(ObjCRuntimeObject::info())) {
             ObjCRuntimeObject* runtimeObject = static_cast<ObjCRuntimeObject*>(object);
index 1d22003..961bed2 100644 (file)
@@ -119,15 +119,15 @@ sub GenerateAttributeEventListenerCall
         $wrapperObject = "asObject(correspondingElementWrapper)";
 
         push(@GenerateEventListenerImpl, <<END);
-    JSValue correspondingElementWrapper = toJS(exec, castedThis->globalObject(), impl->correspondingElement());
+    JSValue correspondingElementWrapper = toJS(exec, castedThis->globalObject(), impl.correspondingElement());
     if (correspondingElementWrapper.isObject())
 END
 
-        # Add leading whitespace to format the impl->set... line correctly
+        # Add leading whitespace to format the impl.set... line correctly
         push(@GenerateEventListenerImpl, "    ");
     }
 
-    push(@GenerateEventListenerImpl, "    impl->set$implSetterFunctionName(createJSAttributeEventListener(exec, value, $wrapperObject));\n");
+    push(@GenerateEventListenerImpl, "    impl.set$implSetterFunctionName(createJSAttributeEventListener(exec, value, $wrapperObject));\n");
     return @GenerateEventListenerImpl;
 }
 
@@ -146,7 +146,7 @@ sub GenerateEventListenerCall
         $wrapperObject = "asObject(correspondingElementWrapper)";
 
         push(@GenerateEventListenerImpl, <<END);
-    JSValue correspondingElementWrapper = toJS(exec, castedThis->globalObject(), impl->correspondingElement());
+    JSValue correspondingElementWrapper = toJS(exec, castedThis->globalObject(), impl.correspondingElement());
     if (!correspondingElementWrapper.isObject())
         return JSValue::encode(jsUndefined());
 END
@@ -156,7 +156,7 @@ END
     JSValue listener = exec->argument(1);
     if (!listener.isObject())
         return JSValue::encode(jsUndefined());
-    impl->${functionName}EventListener(exec->argument(0).toString(exec)->value(exec), JSEventListener::create(asObject(listener), $wrapperObject, false, currentWorld(exec))$passRefPtrHandling, exec->argument(2).toBoolean(exec));
+    impl.${functionName}EventListener(exec->argument(0).toString(exec)->value(exec), JSEventListener::create(asObject(listener), $wrapperObject, false, currentWorld(exec))$passRefPtrHandling, exec->argument(2).toBoolean(exec));
     return JSValue::encode(jsUndefined());
 END
     return @GenerateEventListenerImpl;
@@ -391,7 +391,7 @@ sub GenerateGetOwnPropertySlotBody
         if ($indexedGetterFunction->signature->type eq "DOMString") {
             push(@getOwnPropertySlotImpl, "    if (index != PropertyName::NotAnIndex) {\n");
         } else {
-            push(@getOwnPropertySlotImpl, "    if (index != PropertyName::NotAnIndex && index < thisObject->impl()->length()) {\n");
+            push(@getOwnPropertySlotImpl, "    if (index != PropertyName::NotAnIndex && index < thisObject->impl().length()) {\n");
         }
         # Assume that if there's a setter, the index will be writable
         if ($interface->extendedAttributes->{"CustomIndexedSetter"}) {
@@ -409,7 +409,7 @@ sub GenerateGetOwnPropertySlotBody
     }
 
     if ($namedGetterFunction || $interface->extendedAttributes->{"CustomNamedGetter"}) {
-        push(@getOwnPropertySlotImpl, "    if (canGetItemsForName(exec, thisObject->impl(), propertyName)) {\n");
+        push(@getOwnPropertySlotImpl, "    if (canGetItemsForName(exec, &thisObject->impl(), propertyName)) {\n");
         push(@getOwnPropertySlotImpl, "        slot.setCustom(thisObject, ReadOnly | DontDelete | DontEnum, thisObject->nameGetter);\n");
         push(@getOwnPropertySlotImpl, "        return true;\n");
         push(@getOwnPropertySlotImpl, "    }\n");
@@ -852,7 +852,7 @@ sub GenerateHeader
     }
 
     if (!$hasParent) {
-        push(@headerContent, "    $implType* impl() const { return m_impl; }\n");
+        push(@headerContent, "    $implType& impl() const { return *m_impl; }\n");
         push(@headerContent, "    void releaseImpl() { m_impl->deref(); m_impl = 0; }\n\n");
         push(@headerContent, "    void releaseImplIfNotNull()\n");
         push(@headerContent, "    {\n");
@@ -864,9 +864,9 @@ sub GenerateHeader
         push(@headerContent, "private:\n");
         push(@headerContent, "    $implType* m_impl;\n");
     } else {
-        push(@headerContent, "    $interfaceName* impl() const\n");
+        push(@headerContent, "    $interfaceName& impl() const\n");
         push(@headerContent, "    {\n");
-        push(@headerContent, "        return static_cast<$interfaceName*>(Base::impl());\n");
+        push(@headerContent, "        return static_cast<$interfaceName&>(Base::impl());\n");
         push(@headerContent, "    }\n");
     }
 
@@ -1825,7 +1825,7 @@ sub GenerateImplementation
                 if ($indexedGetterFunction->signature->type eq "DOMString") {
                     push(@implContent, "    if (index <= MAX_ARRAY_INDEX) {\n");
                 } else {
-                    push(@implContent, "    if (index < thisObject->impl()->length()) {\n");
+                    push(@implContent, "    if (index < thisObject->impl().length()) {\n");
                 }
                 # Assume that if there's a setter, the index will be writable
                 if ($interface->extendedAttributes->{"CustomIndexedSetter"}) {
@@ -1844,7 +1844,7 @@ sub GenerateImplementation
 
             if ($namedGetterFunction || $interface->extendedAttributes->{"CustomNamedGetter"}) {
                 &$propertyNameGeneration();
-                push(@implContent, "    if (canGetItemsForName(exec, thisObject->impl(), propertyName)) {\n");
+                push(@implContent, "    if (canGetItemsForName(exec, &thisObject->impl(), propertyName)) {\n");
                 push(@implContent, "        slot.setCustom(thisObject, ReadOnly | DontDelete | DontEnum, thisObject->nameGetter);\n");
                 push(@implContent, "        return true;\n");
                 push(@implContent, "    }\n");
@@ -1893,9 +1893,9 @@ sub GenerateImplementation
                         AddToImplIncludes("Frame.h");
                         AddToImplIncludes("Settings.h");
                         my $enable_function = ToMethodName($attribute->signature->extendedAttributes->{"EnabledBySetting"}) . "Enabled";
-                        push(@implContent, "    if (!castedThis->impl()->frame())\n");
+                        push(@implContent, "    if (!castedThis->impl().frame())\n");
                         push(@implContent, "        return jsUndefined();\n");
-                        push(@implContent, "    Settings& settings = castedThis->impl()->frame()->settings();\n");
+                        push(@implContent, "    Settings& settings = castedThis->impl().frame()->settings();\n");
                         push(@implContent, "    if (!settings.$enable_function())\n");
                         push(@implContent, "        return jsUndefined();\n");
                     }
@@ -1917,18 +1917,18 @@ sub GenerateImplementation
                     push(@implContent, "    return castedThis->$implGetterFunctionName(exec);\n");
                 } elsif ($attribute->signature->extendedAttributes->{"CheckSecurityForNode"}) {
                     $implIncludes{"JSDOMBinding.h"} = 1;
-                    push(@implContent, "    $interfaceName* impl = castedThis->impl();\n");
-                    push(@implContent, "    return shouldAllowAccessToNode(exec, impl->" . $attribute->signature->name . "()) ? " . NativeToJSValue($attribute->signature, 0, $interfaceName, "impl->$implGetterFunctionName()", "castedThis") . " : jsNull();\n");
+                    push(@implContent, "    $interfaceName& impl = castedThis->impl();\n");
+                    push(@implContent, "    return shouldAllowAccessToNode(exec, impl." . $attribute->signature->name . "()) ? " . NativeToJSValue($attribute->signature, 0, $interfaceName, "impl.$implGetterFunctionName()", "castedThis") . " : jsNull();\n");
                 } elsif ($type eq "EventListener") {
                     $implIncludes{"EventListener.h"} = 1;
                     push(@implContent, "    UNUSED_PARAM(exec);\n");
-                    push(@implContent, "    $interfaceName* impl = castedThis->impl();\n");
-                    push(@implContent, "    if (EventListener* listener = impl->$implGetterFunctionName()) {\n");
+                    push(@implContent, "    $interfaceName& impl = castedThis->impl();\n");
+                    push(@implContent, "    if (EventListener* listener = impl.$implGetterFunctionName()) {\n");
                     push(@implContent, "        if (const JSEventListener* jsListener = JSEventListener::cast(listener)) {\n");
                     if ($interfaceName eq "Document" || $codeGenerator->InheritsInterface($interface, "WorkerGlobalScope")) {
-                        push(@implContent, "            if (JSObject* jsFunction = jsListener->jsFunction(impl))\n");
+                        push(@implContent, "            if (JSObject* jsFunction = jsListener->jsFunction(&impl))\n");
                     } else {
-                        push(@implContent, "            if (JSObject* jsFunction = jsListener->jsFunction(impl->scriptExecutionContext()))\n");
+                        push(@implContent, "            if (JSObject* jsFunction = jsListener->jsFunction(impl.scriptExecutionContext()))\n");
                     }
                     push(@implContent, "                return jsFunction;\n");
                     push(@implContent, "        }\n");
@@ -1962,13 +1962,13 @@ sub GenerateImplementation
                     my @callWithArgs = GenerateCallWith($attribute->signature->extendedAttributes->{"CallWith"}, \@implContent, "jsUndefined()");
 
                     if ($svgListPropertyType) {
-                        push(@implContent, "    JSValue result =  " . NativeToJSValue($attribute->signature, 0, $interfaceName, "castedThis->impl()->$implGetterFunctionName(" . (join ", ", @callWithArgs) . ")", "castedThis") . ";\n");
+                        push(@implContent, "    JSValue result =  " . NativeToJSValue($attribute->signature, 0, $interfaceName, "castedThis->impl().$implGetterFunctionName(" . (join ", ", @callWithArgs) . ")", "castedThis") . ";\n");
                     } elsif ($svgPropertyOrListPropertyType) {
-                        push(@implContent, "    $svgPropertyOrListPropertyType& impl = castedThis->impl()->propertyReference();\n");
+                        push(@implContent, "    $svgPropertyOrListPropertyType& impl = castedThis->impl().propertyReference();\n");
                         if ($svgPropertyOrListPropertyType eq "float") { # Special case for JSSVGNumber
-                            push(@implContent, "    JSValue result =  " . NativeToJSValue($attribute->signature, 0, $interfaceName, "impl", "castedThis") . ";\n");
+                            push(@implContent, "    JSValue result = " . NativeToJSValue($attribute->signature, 0, $interfaceName, "impl", "castedThis") . ";\n");
                         } else {
-                            push(@implContent, "    JSValue result =  " . NativeToJSValue($attribute->signature, 0, $interfaceName, "impl.$implGetterFunctionName(" . (join ", ", @callWithArgs) . ")", "castedThis") . ";\n");
+                            push(@implContent, "    JSValue result = " . NativeToJSValue($attribute->signature, 0, $interfaceName, "impl.$implGetterFunctionName(" . (join ", ", @callWithArgs) . ")", "castedThis") . ";\n");
 
                         }
                     } else {
@@ -1978,16 +1978,16 @@ sub GenerateImplementation
                             my $implementedBy = $attribute->signature->extendedAttributes->{"ImplementedBy"};
                             $implIncludes{"${implementedBy}.h"} = 1;
                             $functionName = "${implementedBy}::${functionName}";
-                            unshift(@arguments, "impl") if !$attribute->isStatic;
+                            unshift(@arguments, "&impl") if !$attribute->isStatic;
                         } elsif ($attribute->isStatic) {
                             $functionName = "${interfaceName}::${functionName}";
                         } else {
-                            $functionName = "impl->${functionName}";
+                            $functionName = "impl.${functionName}";
                         }
 
                         unshift(@arguments, @callWithArgs);
                         my $jsType = NativeToJSValue($attribute->signature, 0, $interfaceName, "${functionName}(" . join(", ", @arguments) . ")", "castedThis");
-                        push(@implContent, "    $interfaceName* impl = castedThis->impl();\n") if !$attribute->isStatic;
+                        push(@implContent, "    $interfaceName& impl = castedThis->impl();\n") if !$attribute->isStatic;
                         if ($codeGenerator->IsSVGAnimatedType($type)) {
                             push(@implContent, "    RefPtr<$type> obj = $jsType;\n");
                             push(@implContent, "    JSValue result =  toJS(exec, castedThis->globalObject(), obj.get());\n");
@@ -2019,8 +2019,8 @@ sub GenerateImplementation
                         push(@implContent, "    $svgPropertyOrListPropertyType impl(*castedThis->impl());\n");
                         push(@implContent, "    JSC::JSValue result = " . NativeToJSValue($attribute->signature, 0, $interfaceName, "impl.$implGetterFunctionName(" . join(", ", @arguments) . ")", "castedThis") . ";\n");
                     } else {
-                        push(@implContent, "    $interfaceName* impl = castedThis->impl();\n");
-                        push(@implContent, "    JSC::JSValue result = " . NativeToJSValue($attribute->signature, 0, $interfaceName, "impl->$implGetterFunctionName(" . join(", ", @arguments) . ")", "castedThis") . ";\n");
+                        push(@implContent, "    $interfaceName& impl = castedThis->impl();\n");
+                        push(@implContent, "    JSC::JSValue result = " . NativeToJSValue($attribute->signature, 0, $interfaceName, "impl.$implGetterFunctionName(" . join(", ", @arguments) . ")", "castedThis") . ";\n");
                     }
 
                     if ($isNullable) {
@@ -2141,7 +2141,7 @@ sub GenerateImplementation
                                     $implIncludes{"BindingSecurity.h"} = 1;
                                     push(@implContent, "    if (!BindingSecurity::shouldAllowAccessToDOMWindow(exec, jsCast<$className*>(thisObject)->impl()))\n");
                                 } else {
-                                    push(@implContent, "    if (!shouldAllowAccessToFrame(exec, jsCast<$className*>(thisObject)->impl()->frame()))\n");
+                                    push(@implContent, "    if (!shouldAllowAccessToFrame(exec, jsCast<$className*>(thisObject)->impl().frame()))\n");
                                 }
                                 push(@implContent, "        return;\n");
                             }
@@ -2156,10 +2156,10 @@ sub GenerateImplementation
                                 if ($windowEventListener) {
                                     push(@implContent, "    JSDOMGlobalObject* globalObject = castedThis->globalObject();\n");
                                 }
-                                push(@implContent, "    $interfaceName* impl = castedThis->impl();\n");
+                                push(@implContent, "    $interfaceName& impl = castedThis->impl();\n");
                                 if ((($interfaceName eq "DOMWindow") or ($interfaceName eq "WorkerGlobalScope")) and $name eq "onerror") {
                                     $implIncludes{"JSErrorHandler.h"} = 1;
-                                    push(@implContent, "    impl->set$implSetterFunctionName(createJSErrorHandler(exec, value, thisObject));\n");
+                                    push(@implContent, "    impl.set$implSetterFunctionName(createJSErrorHandler(exec, value, thisObject));\n");
                                 } else {
                                     push(@implContent, GenerateAttributeEventListenerCall($className, $implSetterFunctionName, $windowEventListener));
                                 }
@@ -2185,7 +2185,7 @@ sub GenerateImplementation
                             } else {
                                 if (!$attribute->isStatic) {
                                     push(@implContent, "    $className* castedThis = jsCast<$className*>(thisObject);\n");
-                                    push(@implContent, "    $implType* impl = castedThis->impl();\n");
+                                    push(@implContent, "    $implType& impl = castedThis->impl();\n");
                                 }
                                 push(@implContent, "    ExceptionCode ec = 0;\n") if $setterRaisesException;
 
@@ -2222,13 +2222,13 @@ sub GenerateImplementation
 
                                 if ($svgPropertyOrListPropertyType) {
                                     if ($svgPropertyType) {
-                                        push(@implContent, "    if (impl->isReadOnly()) {\n");
+                                        push(@implContent, "    if (impl.isReadOnly()) {\n");
                                         push(@implContent, "        setDOMException(exec, NO_MODIFICATION_ALLOWED_ERR);\n");
                                         push(@implContent, "        return;\n");
                                         push(@implContent, "    }\n");
                                         $implIncludes{"ExceptionCode.h"} = 1;
                                     }
-                                    push(@implContent, "    $svgPropertyOrListPropertyType& podImpl = impl->propertyReference();\n");
+                                    push(@implContent, "    $svgPropertyOrListPropertyType& podImpl = impl.propertyReference();\n");
                                     if ($svgPropertyOrListPropertyType eq "float") { # Special case for JSSVGNumber
                                         push(@implContent, "    podImpl = nativeValue;\n");
                                     } else {
@@ -2240,9 +2240,9 @@ sub GenerateImplementation
                                     if ($svgPropertyType) {
                                         if ($setterRaisesException) {
                                             push(@implContent, "    if (!ec)\n");
-                                            push(@implContent, "        impl->commitChange();\n");
+                                            push(@implContent, "        impl.commitChange();\n");
                                         } else {
-                                            push(@implContent, "    impl->commitChange();\n");
+                                            push(@implContent, "    impl.commitChange();\n");
                                         }
                                     }
                                 } else {
@@ -2255,12 +2255,12 @@ sub GenerateImplementation
                                     if ($attribute->signature->extendedAttributes->{"ImplementedBy"}) {
                                         my $implementedBy = $attribute->signature->extendedAttributes->{"ImplementedBy"};
                                         $implIncludes{"${implementedBy}.h"} = 1;
-                                        unshift(@arguments, "impl") if !$attribute->isStatic;
+                                        unshift(@arguments, "&impl") if !$attribute->isStatic;
                                         $functionName = "${implementedBy}::${functionName}";
                                     } elsif ($attribute->isStatic) {
                                         $functionName = "${interfaceName}::${functionName}";
                                     } else {
-                                        $functionName = "impl->${functionName}";
+                                        $functionName = "impl.${functionName}";
                                     }
 
                                     unshift(@arguments, GenerateCallWith($attribute->signature->extendedAttributes->{"CallWith"}, \@implContent, ""));
@@ -2288,7 +2288,7 @@ sub GenerateImplementation
                         $implIncludes{"BindingSecurity.h"} = 1;
                         push(@implContent, "    if (!BindingSecurity::shouldAllowAccessToDOMWindow(exec, jsCast<$className*>(thisObject)->impl()))\n");
                     } else {
-                        push(@implContent, "    if (!shouldAllowAccessToFrame(exec, jsCast<$className*>(thisObject)->impl()->frame()))\n");
+                        push(@implContent, "    if (!shouldAllowAccessToFrame(exec, jsCast<$className*>(thisObject)->impl().frame()))\n");
                     }
                     push(@implContent, "        return;\n");
                 }
@@ -2310,7 +2310,7 @@ sub GenerateImplementation
         push(@implContent, "{\n");
         push(@implContent, "    ${className}* thisObject = jsCast<${className}*>(object);\n");
         push(@implContent, "    ASSERT_GC_OBJECT_INHERITS(thisObject, info());\n");
-        push(@implContent, "    for (unsigned i = 0; i < thisObject->impl()->length(); ++i)\n");
+        push(@implContent, "    for (unsigned i = 0, count = thisObject->impl().length(); i < count; ++i)\n");
         push(@implContent, "        propertyNames.add(Identifier::from(exec, i));\n");
         push(@implContent, "     Base::getOwnPropertyNames(thisObject, exec, propertyNames, mode);\n");
         push(@implContent, "}\n\n");
@@ -2403,13 +2403,13 @@ sub GenerateImplementation
                 if ($isCustom) {
                     push(@implContent, "    return JSValue::encode(castedThis->" . $functionImplementationName . "(exec));\n");
                 } else {
-                    push(@implContent, "    $implType* impl = castedThis->impl();\n");
+                    push(@implContent, "    $implType& impl = castedThis->impl();\n");
                     if ($svgPropertyType) {
-                        push(@implContent, "    if (impl->isReadOnly()) {\n");
+                        push(@implContent, "    if (impl.isReadOnly()) {\n");
                         push(@implContent, "        setDOMException(exec, NO_MODIFICATION_ALLOWED_ERR);\n");
                         push(@implContent, "        return JSValue::encode(jsUndefined());\n");
                         push(@implContent, "    }\n");
-                        push(@implContent, "    $svgPropertyType& podImpl = impl->propertyReference();\n");
+                        push(@implContent, "    $svgPropertyType& podImpl = impl.propertyReference();\n");
                         $implIncludes{"ExceptionCode.h"} = 1;
                     }
 
@@ -2424,7 +2424,7 @@ sub GenerateImplementation
                         push(@implContent, "    ExceptionCode ec = 0;\n") if $raisesException;
 
                         if ($function->signature->extendedAttributes->{"CheckSecurityForNode"}) {
-                            push(@implContent, "    if (!shouldAllowAccessToNode(exec, impl->" . $function->signature->name . "(" . ($raisesException ? "ec" : "") .")))\n");
+                            push(@implContent, "    if (!shouldAllowAccessToNode(exec, impl." . $function->signature->name . "(" . ($raisesException ? "ec" : "") .")))\n");
                             push(@implContent, "        return JSValue::encode(jsNull());\n");
                             $implIncludes{"JSDOMBinding.h"} = 1;
                         }
@@ -2456,7 +2456,7 @@ sub GenerateImplementation
         push(@implContent, "    ASSERT(thisObject->structure()->typeInfo().overridesVisitChildren());\n");
         push(@implContent, "    Base::visitChildren(thisObject, visitor);\n");
         if ($interface->extendedAttributes->{"EventTarget"} || $interface->name eq "EventTarget") {
-            push(@implContent, "    thisObject->impl()->visitJSEventListeners(visitor);\n");
+            push(@implContent, "    thisObject->impl().visitJSEventListeners(visitor);\n");
         }
         if ($numCachedAttributes > 0) {
             foreach (@{$interface->attributes}) {
@@ -2507,9 +2507,9 @@ sub GenerateImplementation
         push(@implContent, "    ASSERT_GC_OBJECT_INHERITS(thisObj, info());\n");
         if ($indexedGetterFunction->signature->type eq "DOMString") {
             $implIncludes{"URL.h"} = 1;
-            push(@implContent, "    return jsStringOrUndefined(exec, thisObj->impl()->item(index));\n");
+            push(@implContent, "    return jsStringOrUndefined(exec, thisObj->impl().item(index));\n");
         } else {
-            push(@implContent, "    return toJS(exec, thisObj->globalObject(), thisObj->impl()->item(index));\n");
+            push(@implContent, "    return toJS(exec, thisObj->globalObject(), thisObj->impl().item(index));\n");
         }
         push(@implContent, "}\n\n");
         if ($interfaceName =~ /^HTML\w*Collection$/ or $interfaceName eq "RadioNodeList") {
@@ -2522,7 +2522,7 @@ sub GenerateImplementation
         push(@implContent, "\nJSValue ${className}::getByIndex(ExecState*, unsigned index)\n");
         push(@implContent, "{\n");
         push(@implContent, "    ASSERT_GC_OBJECT_INHERITS(this, info());\n");
-        push(@implContent, "    double result = impl()->item(index);\n");
+        push(@implContent, "    double result = impl().item(index);\n");
         # jsNumber conversion doesn't suppress signalling NaNs, so enforce that here.
         push(@implContent, "    if (std::isnan(result))\n");
         push(@implContent, "        return jsNaN();\n");
@@ -2543,7 +2543,7 @@ sub GenerateImplementation
             push(@implContent, "JSValue ${className}::nameGetter(ExecState* exec, JSValue slotBase, PropertyName propertyName)\n");
             push(@implContent, "{\n");
             push(@implContent, "    ${className}* thisObj = jsCast<$className*>(asObject(slotBase));\n");
-            push(@implContent, "    return toJS(exec, thisObj->globalObject(), thisObj->impl()->namedItem(propertyNameToAtomicString(propertyName)));\n");
+            push(@implContent, "    return toJS(exec, thisObj->globalObject(), thisObj->impl().namedItem(propertyNameToAtomicString(propertyName)));\n");
             push(@implContent, "}\n\n");
         }
     }
@@ -2554,7 +2554,7 @@ sub GenerateImplementation
         push(@implContent, "    if (js${interfaceName}->hasCustomProperties())\n");
         push(@implContent, "        return true;\n");
         if ($eventTarget) {
-            push(@implContent, "    if (js${interfaceName}->impl()->hasEventListeners())\n");
+            push(@implContent, "    if (js${interfaceName}->impl().hasEventListeners())\n");
             push(@implContent, "        return true;\n");
         }
         push(@implContent, "    return false;\n");
@@ -2571,11 +2571,11 @@ sub GenerateImplementation
         # FIXME: Fix this lifetime issue in the DOM, and move this hasPendingActivity
         # check below the isObservable check.
         if ($codeGenerator->InheritsExtendedAttribute($interface, "ActiveDOMObject")) {
-            push(@implContent, "    if (js${interfaceName}->impl()->hasPendingActivity())\n");
+            push(@implContent, "    if (js${interfaceName}->impl().hasPendingActivity())\n");
             push(@implContent, "        return true;\n");
         }
         if ($codeGenerator->InheritsExtendedAttribute($interface, "EventTarget")) {
-            push(@implContent, "    if (js${interfaceName}->impl()->isFiringEventListeners())\n");
+            push(@implContent, "    if (js${interfaceName}->impl().isFiringEventListeners())\n");
             push(@implContent, "        return true;\n");
         }
         if ($codeGenerator->InheritsInterface($interface, "Node")) {
@@ -2587,32 +2587,32 @@ sub GenerateImplementation
         if (GetGenerateIsReachable($interface)) {
             my $rootString;
             if (GetGenerateIsReachable($interface) eq "Impl") {
-                $rootString  = "    ${implType}* root = js${interfaceName}->impl();\n";
+                $rootString  = "    ${implType}* root = &js${interfaceName}->impl();\n";
             } elsif (GetGenerateIsReachable($interface) eq "ImplContext") {
-                $rootString  = "    WebGLRenderingContext* root = js${interfaceName}->impl()->context();\n";
+                $rootString  = "    WebGLRenderingContext* root = js${interfaceName}->impl().context();\n";
             } elsif (GetGenerateIsReachable($interface) eq "ImplFrame") {
-                $rootString  = "    Frame* root = js${interfaceName}->impl()->frame();\n";
+                $rootString  = "    Frame* root = js${interfaceName}->impl().frame();\n";
                 $rootString .= "    if (!root)\n";
                 $rootString .= "        return false;\n";
             } elsif (GetGenerateIsReachable($interface) eq "ImplDocument") {
-                $rootString  = "    Document* root = js${interfaceName}->impl()->document();\n";
+                $rootString  = "    Document* root = js${interfaceName}->impl().document();\n";
                 $rootString .= "    if (!root)\n";
                 $rootString .= "        return false;\n";
             } elsif (GetGenerateIsReachable($interface) eq "ImplElementRoot") {
                 $implIncludes{"Element.h"} = 1;
                 $implIncludes{"JSNodeCustom.h"} = 1;
-                $rootString  = "    Element* element = js${interfaceName}->impl()->element();\n";
+                $rootString  = "    Element* element = js${interfaceName}->impl().element();\n";
                 $rootString .= "    if (!element)\n";
                 $rootString .= "        return false;\n";
                 $rootString .= "    void* root = WebCore::root(element);\n";
             } elsif ($interfaceName eq "CanvasRenderingContext") {
-                $rootString  = "    void* root = WebCore::root(js${interfaceName}->impl()->canvas());\n";
+                $rootString  = "    void* root = WebCore::root(js${interfaceName}->impl().canvas());\n";
             } elsif (GetGenerateIsReachable($interface) eq "ImplOwnerNodeRoot") {
                 $implIncludes{"Element.h"} = 1;
                 $implIncludes{"JSNodeCustom.h"} = 1;
-                $rootString  = "    void* root = WebCore::root(js${interfaceName}->impl()->ownerNode());\n";
+                $rootString  = "    void* root = WebCore::root(js${interfaceName}->impl().ownerNode());\n";
             } else {
-                $rootString  = "    void* root = WebCore::root(js${interfaceName}->impl());\n";
+                $rootString  = "    void* root = WebCore::root(&js${interfaceName}->impl());\n";
             }
 
             push(@implContent, $rootString);
@@ -2633,7 +2633,7 @@ sub GenerateImplementation
         push(@implContent, "{\n");
         push(@implContent, "    JS${interfaceName}* js${interfaceName} = jsCast<JS${interfaceName}*>(handle.get().asCell());\n");
         push(@implContent, "    DOMWrapperWorld& world = *static_cast<DOMWrapperWorld*>(context);\n");
-        push(@implContent, "    uncacheWrapper(world, js${interfaceName}->impl(), js${interfaceName});\n");
+        push(@implContent, "    uncacheWrapper(world, &js${interfaceName}->impl(), js${interfaceName});\n");
         push(@implContent, "    js${interfaceName}->releaseImpl();\n");
         push(@implContent, "}\n\n");
     }
@@ -2714,7 +2714,7 @@ END
     if ((!$hasParent or $interface->extendedAttributes->{"JSGenerateToNativeObject"}) and !$interface->extendedAttributes->{"JSCustomToNativeObject"}) {
         push(@implContent, "$implType* to${interfaceName}(JSC::JSValue value)\n");
         push(@implContent, "{\n");
-        push(@implContent, "    return value.inherits(${className}::info()) ? jsCast<$className*>(asObject(value))->impl() : 0");
+        push(@implContent, "    return value.inherits(${className}::info()) ? &jsCast<$className*>(asObject(value))->impl() : 0");
         push(@implContent, ";\n}\n");
     }
 
@@ -2793,14 +2793,14 @@ sub GenerateParametersCheck
     my $implementedBy = $function->signature->extendedAttributes->{"ImplementedBy"};
     if ($implementedBy) {
         AddToImplIncludes("${implementedBy}.h");
-        unshift(@arguments, "impl") if !$function->isStatic;
+        unshift(@arguments, "&impl") if !$function->isStatic;
         $functionName = "${implementedBy}::${functionImplementationName}";
     } elsif ($function->isStatic) {
         $functionName = "${interfaceName}::${functionImplementationName}";
     } elsif ($svgPropertyOrListPropertyType and !$svgListPropertyType) {
         $functionName = "podImpl.${functionImplementationName}";
     } else {
-        $functionName = "impl->${functionImplementationName}";
+        $functionName = "impl.${functionImplementationName}";
     }
 
     if (!$function->signature->extendedAttributes->{"Constructor"}) {
@@ -2890,7 +2890,7 @@ sub GenerateParametersCheck
 
             if (!IsNativeType($argType)) {
                 push(@$outputArray, "    Vector<$nativeElementType> $name;\n");
-                push(@$outputArray, "    for (unsigned i = $argsIndex; i < exec->argumentCount(); ++i) {\n");
+                push(@$outputArray, "    for (unsigned i = $argsIndex, count = exec->argumentCount(); i < count; ++i) {\n");
                 push(@$outputArray, "        if (!exec->uncheckedArgument(i).inherits(JS${argType}::info()))\n");
                 push(@$outputArray, "            return throwVMTypeError(exec);\n");
                 push(@$outputArray, "        $name.append(to$argType(exec->uncheckedArgument(i)));\n");
@@ -3176,9 +3176,9 @@ sub GenerateImplementationFunctionCall()
         if ($svgPropertyType and !$function->isStatic) {
             if ($raisesException) {
                 push(@implContent, $indent . "if (!ec)\n"); 
-                push(@implContent, $indent . "    impl->commitChange();\n");
+                push(@implContent, $indent . "    impl.commitChange();\n");
             } else {
-                push(@implContent, $indent . "impl->commitChange();\n");
+                push(@implContent, $indent . "impl.commitChange();\n");
             }
         }
 
index 4f699f0..e3f7760 100644 (file)
@@ -137,8 +137,8 @@ JSValue jsTestActiveDOMObjectExcitingAttr(ExecState* exec, JSValue slotBase, Pro
     if (!BindingSecurity::shouldAllowAccessToDOMWindow(exec, castedThis->impl()))
         return jsUndefined();
     UNUSED_PARAM(exec);
-    TestActiveDOMObject* impl = castedThis->impl();
-    JSValue result = jsNumber(impl->excitingAttr());
+    TestActiveDOMObject& impl = castedThis->impl();
+    JSValue result = jsNumber(impl.excitingAttr());
     return result;
 }
 
@@ -165,13 +165,13 @@ EncodedJSValue JSC_HOST_CALL jsTestActiveDOMObjectPrototypeFunctionExcitingFunct
     ASSERT_GC_OBJECT_INHERITS(castedThis, JSTestActiveDOMObject::info());
     if (!BindingSecurity::shouldAllowAccessToDOMWindow(exec, castedThis->impl()))
         return JSValue::encode(jsUndefined());
-    TestActiveDOMObject* impl = castedThis->impl();
+    TestActiveDOMObject& impl = castedThis->impl();
     if (exec->argumentCount() < 1)
         return throwVMError(exec, createNotEnoughArgumentsError(exec));
     Node* nextChild(toNode(exec->argument(0)));
     if (exec->hadException())
         return JSValue::encode(jsUndefined());
-    impl->excitingFunction(nextChild);
+    impl.excitingFunction(nextChild);
     return JSValue::encode(jsUndefined());
 }
 
@@ -182,13 +182,13 @@ EncodedJSValue JSC_HOST_CALL jsTestActiveDOMObjectPrototypeFunctionPostMessage(E
         return throwVMTypeError(exec);
     JSTestActiveDOMObject* castedThis = jsCast<JSTestActiveDOMObject*>(asObject(thisValue));
     ASSERT_GC_OBJECT_INHERITS(castedThis, JSTestActiveDOMObject::info());
-    TestActiveDOMObject* impl = castedThis->impl();
+    TestActiveDOMObject& impl = castedThis->impl();
     if (exec->argumentCount() < 1)
         return throwVMError(exec, createNotEnoughArgumentsError(exec));
     const String& message(exec->argument(0).isEmpty() ? String() : exec->argument(0).toString(exec)->value(exec));
     if (exec->hadException())
         return JSValue::encode(jsUndefined());
-    impl->postMessage(message);
+    impl.postMessage(message);
     return JSValue::encode(jsUndefined());
 }
 
@@ -212,7 +212,7 @@ void JSTestActiveDOMObjectOwner::finalize(JSC::Handle<JSC::Unknown> handle, void
 {
     JSTestActiveDOMObject* jsTestActiveDOMObject = jsCast<JSTestActiveDOMObject*>(handle.get().asCell());
     DOMWrapperWorld& world = *static_cast<DOMWrapperWorld*>(context);
-    uncacheWrapper(world, jsTestActiveDOMObject->impl(), jsTestActiveDOMObject);
+    uncacheWrapper(world, &jsTestActiveDOMObject->impl(), jsTestActiveDOMObject);
     jsTestActiveDOMObject->releaseImpl();
 }
 
@@ -255,7 +255,7 @@ JSC::JSValue toJS(JSC::ExecState* exec, JSDOMGlobalObject* globalObject, TestAct
 
 TestActiveDOMObject* toTestActiveDOMObject(JSC::JSValue value)
 {
-    return value.inherits(JSTestActiveDOMObject::info()) ? jsCast<JSTestActiveDOMObject*>(asObject(value))->impl() : 0;
+    return value.inherits(JSTestActiveDOMObject::info()) ? &jsCast<JSTestActiveDOMObject*>(asObject(value))->impl() : 0;
 }
 
 }
index bbbeee5..2c15639 100644 (file)
@@ -51,7 +51,7 @@ public:
     }
 
     static JSC::JSValue getConstructor(JSC::VM&, JSC::JSGlobalObject*);
-    TestActiveDOMObject* impl() const { return m_impl; }
+    TestActiveDOMObject& impl() const { return *m_impl; }
     void releaseImpl() { m_impl->deref(); m_impl = 0; }
 
     void releaseImplIfNotNull()
index c983d1e..2f7bd53 100644 (file)
@@ -125,7 +125,7 @@ bool JSTestCustomNamedGetter::getOwnPropertySlot(JSObject* object, ExecState* ex
 {
     JSTestCustomNamedGetter* thisObject = jsCast<JSTestCustomNamedGetter*>(object);
     ASSERT_GC_OBJECT_INHERITS(thisObject, info());
-    if (canGetItemsForName(exec, thisObject->impl(), propertyName)) {
+    if (canGetItemsForName(exec, &thisObject->impl(), propertyName)) {
         slot.setCustom(thisObject, ReadOnly | DontDelete | DontEnum, thisObject->nameGetter);
         return true;
     }
@@ -137,7 +137,7 @@ bool JSTestCustomNamedGetter::getOwnPropertySlotByIndex(JSObject* object, ExecSt
     JSTestCustomNamedGetter* thisObject = jsCast<JSTestCustomNamedGetter*>(object);
     ASSERT_GC_OBJECT_INHERITS(thisObject, info());
     PropertyName propertyName = Identifier::from(exec, index);
-    if (canGetItemsForName(exec, thisObject->impl(), propertyName)) {
+    if (canGetItemsForName(exec, &thisObject->impl(), propertyName)) {
         slot.setCustom(thisObject, ReadOnly | DontDelete | DontEnum, thisObject->nameGetter);
         return true;
     }
@@ -162,13 +162,13 @@ EncodedJSValue JSC_HOST_CALL jsTestCustomNamedGetterPrototypeFunctionAnotherFunc
         return throwVMTypeError(exec);
     JSTestCustomNamedGetter* castedThis = jsCast<JSTestCustomNamedGetter*>(asObject(thisValue));
     ASSERT_GC_OBJECT_INHERITS(castedThis, JSTestCustomNamedGetter::info());
-    TestCustomNamedGetter* impl = castedThis->impl();
+    TestCustomNamedGetter& impl = castedThis->impl();
     if (exec->argumentCount() < 1)
         return throwVMError(exec, createNotEnoughArgumentsError(exec));
     const String& str(exec->argument(0).isEmpty() ? String() : exec->argument(0).toString(exec)->value(exec));
     if (exec->hadException())
         return JSValue::encode(jsUndefined());
-    impl->anotherFunction(str);
+    impl.anotherFunction(str);
     return JSValue::encode(jsUndefined());
 }
 
@@ -192,7 +192,7 @@ void JSTestCustomNamedGetterOwner::finalize(JSC::Handle<JSC::Unknown> handle, vo
 {
     JSTestCustomNamedGetter* jsTestCustomNamedGetter = jsCast<JSTestCustomNamedGetter*>(handle.get().asCell());
     DOMWrapperWorld& world = *static_cast<DOMWrapperWorld*>(context);
-    uncacheWrapper(world, jsTestCustomNamedGetter->impl(), jsTestCustomNamedGetter);
+    uncacheWrapper(world, &jsTestCustomNamedGetter->impl(), jsTestCustomNamedGetter);
     jsTestCustomNamedGetter->releaseImpl();
 }
 
@@ -235,7 +235,7 @@ JSC::JSValue toJS(JSC::ExecState* exec, JSDOMGlobalObject* globalObject, TestCus
 
 TestCustomNamedGetter* toTestCustomNamedGetter(JSC::JSValue value)
 {
-    return value.inherits(JSTestCustomNamedGetter::info()) ? jsCast<JSTestCustomNamedGetter*>(asObject(value))->impl() : 0;
+    return value.inherits(JSTestCustomNamedGetter::info()) ? &jsCast<JSTestCustomNamedGetter*>(asObject(value))->impl() : 0;
 }
 
 }
index 3750e05..7d9bda7 100644 (file)
@@ -52,7 +52,7 @@ public:
     }
 
     static JSC::JSValue getConstructor(JSC::VM&, JSC::JSGlobalObject*);
-    TestCustomNamedGetter* impl() const { return m_impl; }
+    TestCustomNamedGetter& impl() const { return *m_impl; }
     void releaseImpl() { m_impl->deref(); m_impl = 0; }
 
     void releaseImplIfNotNull()
index 53192b7..61ce42f 100644 (file)
@@ -171,8 +171,8 @@ JSValue jsTestEventConstructorAttr1(ExecState* exec, JSValue slotBase, PropertyN
 {
     JSTestEventConstructor* castedThis = jsCast<JSTestEventConstructor*>(asObject(slotBase));
     UNUSED_PARAM(exec);
-    TestEventConstructor* impl = castedThis->impl();
-    JSValue result = jsStringWithCache(exec, impl->attr1());
+    TestEventConstructor& impl = castedThis->impl();
+    JSValue result = jsStringWithCache(exec, impl.attr1());
     return result;
 }
 
@@ -181,8 +181,8 @@ JSValue jsTestEventConstructorAttr2(ExecState* exec, JSValue slotBase, PropertyN
 {
     JSTestEventConstructor* castedThis = jsCast<JSTestEventConstructor*>(asObject(slotBase));
     UNUSED_PARAM(exec);
-    TestEventConstructor* impl = castedThis->impl();
-    JSValue result = jsStringWithCache(exec, impl->attr2());
+    TestEventConstructor& impl = castedThis->impl();
+    JSValue result = jsStringWithCache(exec, impl.attr2());
     return result;
 }
 
@@ -218,7 +218,7 @@ void JSTestEventConstructorOwner::finalize(JSC::Handle<JSC::Unknown> handle, voi
 {
     JSTestEventConstructor* jsTestEventConstructor = jsCast<JSTestEventConstructor*>(handle.get().asCell());
     DOMWrapperWorld& world = *static_cast<DOMWrapperWorld*>(context);
-    uncacheWrapper(world, jsTestEventConstructor->impl(), jsTestEventConstructor);
+    uncacheWrapper(world, &jsTestEventConstructor->impl(), jsTestEventConstructor);
     jsTestEventConstructor->releaseImpl();
 }
 
@@ -261,7 +261,7 @@ JSC::JSValue toJS(JSC::ExecState* exec, JSDOMGlobalObject* globalObject, TestEve
 
 TestEventConstructor* toTestEventConstructor(JSC::JSValue value)
 {
-    return value.inherits(JSTestEventConstructor::info()) ? jsCast<JSTestEventConstructor*>(asObject(value))->impl() : 0;
+    return value.inherits(JSTestEventConstructor::info()) ? &jsCast<JSTestEventConstructor*>(asObject(value))->impl() : 0;
 }
 
 }
index 0f31406..5012e45 100644 (file)
@@ -53,7 +53,7 @@ public:
     }
 
     static JSC::JSValue getConstructor(JSC::VM&, JSC::JSGlobalObject*);
-    TestEventConstructor* impl() const { return m_impl; }
+    TestEventConstructor& impl() const { return *m_impl; }
     void releaseImpl() { m_impl->deref(); m_impl = 0; }
 
     void releaseImplIfNotNull()
index 136a7d4..8020923 100644 (file)
@@ -140,12 +140,12 @@ bool JSTestEventTarget::getOwnPropertySlot(JSObject* object, ExecState* exec, Pr
         return true;
     }
     unsigned index = propertyName.asIndex();
-    if (index != PropertyName::NotAnIndex && index < thisObject->impl()->length()) {
+    if (index != PropertyName::NotAnIndex && index < thisObject->impl().length()) {
         unsigned attributes = DontDelete | ReadOnly;
         slot.setCustomIndex(thisObject, attributes, index, indexGetter);
         return true;
     }
-    if (canGetItemsForName(exec, thisObject->impl(), propertyName)) {
+    if (canGetItemsForName(exec, &thisObject->impl(), propertyName)) {
         slot.setCustom(thisObject, ReadOnly | DontDelete | DontEnum, thisObject->nameGetter);
         return true;
     }
@@ -156,13 +156,13 @@ bool JSTestEventTarget::getOwnPropertySlotByIndex(JSObject* object, ExecState* e
 {
     JSTestEventTarget* thisObject = jsCast<JSTestEventTarget*>(object);
     ASSERT_GC_OBJECT_INHERITS(thisObject, info());
-    if (index < thisObject->impl()->length()) {
+    if (index < thisObject->impl().length()) {
         unsigned attributes = DontDelete | ReadOnly;
         slot.setCustomIndex(thisObject, attributes, index, thisObject->indexGetter);
         return true;
     }
     PropertyName propertyName = Identifier::from(exec, index);
-    if (canGetItemsForName(exec, thisObject->impl(), propertyName)) {
+    if (canGetItemsForName(exec, &thisObject->impl(), propertyName)) {
         slot.setCustom(thisObject, ReadOnly | DontDelete | DontEnum, thisObject->nameGetter);
         return true;
     }
@@ -179,7 +179,7 @@ void JSTestEventTarget::getOwnPropertyNames(JSObject* object, ExecState* exec, P
 {
     JSTestEventTarget* thisObject = jsCast<JSTestEventTarget*>(object);
     ASSERT_GC_OBJECT_INHERITS(thisObject, info());
-    for (unsigned i = 0; i < thisObject->impl()->length(); ++i)
+    for (unsigned i = 0, count = thisObject->impl().length(); i < count; ++i)
         propertyNames.add(Identifier::from(exec, i));
      Base::getOwnPropertyNames(thisObject, exec, propertyNames, mode);
 }
@@ -196,7 +196,7 @@ EncodedJSValue JSC_HOST_CALL jsTestEventTargetPrototypeFunctionItem(ExecState* e
         return throwVMTypeError(exec);
     JSTestEventTarget* castedThis = jsCast<JSTestEventTarget*>(asObject(thisValue));
     ASSERT_GC_OBJECT_INHERITS(castedThis, JSTestEventTarget::info());
-    TestEventTarget* impl = castedThis->impl();
+    TestEventTarget& impl = castedThis->impl();
     if (exec->argumentCount() < 1)
         return throwVMError(exec, createNotEnoughArgumentsError(exec));
     int index(toUInt32(exec, exec->argument(0), NormalConversion));
@@ -207,7 +207,7 @@ EncodedJSValue JSC_HOST_CALL jsTestEventTargetPrototypeFunctionItem(ExecState* e
     if (exec->hadException())
         return JSValue::encode(jsUndefined());
 
-    JSC::JSValue result = toJS(exec, castedThis->globalObject(), WTF::getPtr(impl->item(index)));
+    JSC::JSValue result = toJS(exec, castedThis->globalObject(), WTF::getPtr(impl.item(index)));
     return JSValue::encode(result);
 }
 
@@ -218,11 +218,11 @@ EncodedJSValue JSC_HOST_CALL jsTestEventTargetPrototypeFunctionAddEventListener(
         return throwVMTypeError(exec);
     JSTestEventTarget* castedThis = jsCast<JSTestEventTarget*>(asObject(thisValue));
     ASSERT_GC_OBJECT_INHERITS(castedThis, JSTestEventTarget::info());
-    TestEventTarget* impl = castedThis->impl();
+    TestEventTarget& impl = castedThis->impl();
     JSValue listener = exec->argument(1);
     if (!listener.isObject())
         return JSValue::encode(jsUndefined());
-    impl->addEventListener(exec->argument(0).toString(exec)->value(exec), JSEventListener::create(asObject(listener), castedThis, false, currentWorld(exec)), exec->argument(2).toBoolean(exec));
+    impl.addEventListener(exec->argument(0).toString(exec)->value(exec), JSEventListener::create(asObject(listener), castedThis, false, currentWorld(exec)), exec->argument(2).toBoolean(exec));
     return JSValue::encode(jsUndefined());
 }
 
@@ -233,11 +233,11 @@ EncodedJSValue JSC_HOST_CALL jsTestEventTargetPrototypeFunctionRemoveEventListen
         return throwVMTypeError(exec);
     JSTestEventTarget* castedThis = jsCast<JSTestEventTarget*>(asObject(thisValue));
     ASSERT_GC_OBJECT_INHERITS(castedThis, JSTestEventTarget::info());
-    TestEventTarget* impl = castedThis->impl();
+    TestEventTarget& impl = castedThis->impl();
     JSValue listener = exec->argument(1);
     if (!listener.isObject())
         return JSValue::encode(jsUndefined());
-    impl->removeEventListener(exec->argument(0).toString(exec)->value(exec), JSEventListener::create(asObject(listener), castedThis, false, currentWorld(exec)).get(), exec->argument(2).toBoolean(exec));
+    impl.removeEventListener(exec->argument(0).toString(exec)->value(exec), JSEventListener::create(asObject(listener), castedThis, false, currentWorld(exec)).get(), exec->argument(2).toBoolean(exec));
     return JSValue::encode(jsUndefined());
 }
 
@@ -248,7 +248,7 @@ EncodedJSValue JSC_HOST_CALL jsTestEventTargetPrototypeFunctionDispatchEvent(Exe
         return throwVMTypeError(exec);
     JSTestEventTarget* castedThis = jsCast<JSTestEventTarget*>(asObject(thisValue));
     ASSERT_GC_OBJECT_INHERITS(castedThis, JSTestEventTarget::info());
-    TestEventTarget* impl = castedThis->impl();
+    TestEventTarget& impl = castedThis->impl();
     if (exec->argumentCount() < 1)
         return throwVMError(exec, createNotEnoughArgumentsError(exec));
     ExceptionCode ec = 0;
@@ -256,7 +256,7 @@ EncodedJSValue JSC_HOST_CALL jsTestEventTargetPrototypeFunctionDispatchEvent(Exe
     if (exec->hadException())
         return JSValue::encode(jsUndefined());
 
-    JSC::JSValue result = jsBoolean(impl->dispatchEvent(evt, ec));
+    JSC::JSValue result = jsBoolean(impl.dispatchEvent(evt, ec));
     setDOMException(exec, ec);
     return JSValue::encode(result);
 }
@@ -268,7 +268,7 @@ void JSTestEventTarget::visitChildren(JSCell* cell, SlotVisitor& visitor)
     COMPILE_ASSERT(StructureFlags & OverridesVisitChildren, OverridesVisitChildrenWithoutSettingFlag);
     ASSERT(thisObject->structure()->typeInfo().overridesVisitChildren());
     Base::visitChildren(thisObject, visitor);
-    thisObject->impl()->visitJSEventListeners(visitor);
+    thisObject->impl().visitJSEventListeners(visitor);
 }
 
 
@@ -276,14 +276,14 @@ JSValue JSTestEventTarget::indexGetter(ExecState* exec, JSValue slotBase, unsign
 {
     JSTestEventTarget* thisObj = jsCast<JSTestEventTarget*>(asObject(slotBase));
     ASSERT_GC_OBJECT_INHERITS(thisObj, info());
-    return toJS(exec, thisObj->globalObject(), thisObj->impl()->item(index));
+    return toJS(exec, thisObj->globalObject(), thisObj->impl().item(index));
 }
 
 static inline bool isObservable(JSTestEventTarget* jsTestEventTarget)
 {
     if (jsTestEventTarget->hasCustomProperties())
         return true;
-    if (jsTestEventTarget->impl()->hasEventListeners())
+    if (jsTestEventTarget->impl().hasEventListeners())
         return true;
     return false;
 }
@@ -291,7 +291,7 @@ static inline bool isObservable(JSTestEventTarget* jsTestEventTarget)
 bool JSTestEventTargetOwner::isReachableFromOpaqueRoots(JSC::Handle<JSC::Unknown> handle, void*, SlotVisitor& visitor)
 {
     JSTestEventTarget* jsTestEventTarget = jsCast<JSTestEventTarget*>(handle.get().asCell());
-    if (jsTestEventTarget->impl()->isFiringEventListeners())
+    if (jsTestEventTarget->impl().isFiringEventListeners())
         return true;
     if (!isObservable(jsTestEventTarget))
         return false;
@@ -303,7 +303,7 @@ void JSTestEventTargetOwner::finalize(JSC::Handle<JSC::Unknown> handle, void* co
 {
     JSTestEventTarget* jsTestEventTarget = jsCast<JSTestEventTarget*>(handle.get().asCell());
     DOMWrapperWorld& world = *static_cast<DOMWrapperWorld*>(context);
-    uncacheWrapper(world, jsTestEventTarget->impl(), jsTestEventTarget);
+    uncacheWrapper(world, &jsTestEventTarget->impl(), jsTestEventTarget);
     jsTestEventTarget->releaseImpl();
 }
 
@@ -346,7 +346,7 @@ JSC::JSValue toJS(JSC::ExecState* exec, JSDOMGlobalObject* globalObject, TestEve
 
 TestEventTarget* toTestEventTarget(JSC::JSValue value)
 {
-    return value.inherits(JSTestEventTarget::info()) ? jsCast<JSTestEventTarget*>(asObject(value))->impl() : 0;
+    return value.inherits(JSTestEventTarget::info()) ? &jsCast<JSTestEventTarget*>(asObject(value))->impl() : 0;
 }
 
 }
index 53e2117..d23fa0b 100644 (file)
@@ -56,7 +56,7 @@ public:
     static JSC::JSValue getConstructor(JSC::VM&, JSC::JSGlobalObject*);
     static void visitChildren(JSCell*, JSC::SlotVisitor&);
 
-    TestEventTarget* impl() const { return m_impl; }
+    TestEventTarget& impl() const { return *m_impl; }
     void releaseImpl() { m_impl->deref(); m_impl = 0; }
 
     void releaseImplIfNotNull()
index 439c808..da82726 100644 (file)
@@ -124,8 +124,8 @@ JSValue jsTestExceptionName(ExecState* exec, JSValue slotBase, PropertyName)
 {
     JSTestException* castedThis = jsCast<JSTestException*>(asObject(slotBase));
     UNUSED_PARAM(exec);
-    TestException* impl = castedThis->impl();
-    JSValue result = jsStringWithCache(exec, impl->name());
+    TestException& impl = castedThis->impl();
+    JSValue result = jsStringWithCache(exec, impl.name());
     return result;
 }
 
@@ -161,7 +161,7 @@ void JSTestExceptionOwner::finalize(JSC::Handle<JSC::Unknown> handle, void* cont
 {
     JSTestException* jsTestException = jsCast<JSTestException*>(handle.get().asCell());
     DOMWrapperWorld& world = *static_cast<DOMWrapperWorld*>(context);
-    uncacheWrapper(world, jsTestException->impl(), jsTestException);
+    uncacheWrapper(world, &jsTestException->impl(), jsTestException);
     jsTestException->releaseImpl();
 }
 
@@ -204,7 +204,7 @@ JSC::JSValue toJS(JSC::ExecState* exec, JSDOMGlobalObject* globalObject, TestExc
 
 TestException* toTestException(JSC::JSValue value)
 {
-    return value.inherits(JSTestException::info()) ? jsCast<JSTestException*>(asObject(value))->impl() : 0;
+    return value.inherits(JSTestException::info()) ? &jsCast<JSTestException*>(asObject(value))->impl() : 0;
 }
 
 }
index cb40d34..644cae5 100644 (file)
@@ -51,7 +51,7 @@ public:
     }
 
     static JSC::JSValue getConstructor(JSC::VM&, JSC::JSGlobalObject*);
-    TestException* impl() const { return m_impl; }
+    TestException& impl() const { return *m_impl; }
     void releaseImpl() { m_impl->deref(); m_impl = 0; }
 
     void releaseImplIfNotNull()
index e2a0792..7f34313 100644 (file)
@@ -298,8 +298,8 @@ JSValue jsTestInterfaceImplementsStr1(ExecState* exec, JSValue slotBase, Propert
 {
     JSTestInterface* castedThis = jsCast<JSTestInterface*>(asObject(slotBase));
     UNUSED_PARAM(exec);
-    TestInterface* impl = castedThis->impl();
-    JSValue result = jsStringWithCache(exec, impl->implementsStr1());
+    TestInterface& impl = castedThis->impl();
+    JSValue result = jsStringWithCache(exec, impl.implementsStr1());
     return result;
 }
 
@@ -310,8 +310,8 @@ JSValue jsTestInterfaceImplementsStr2(ExecState* exec, JSValue slotBase, Propert
 {
     JSTestInterface* castedThis = jsCast<JSTestInterface*>(asObject(slotBase));
     UNUSED_PARAM(exec);
-    TestInterface* impl = castedThis->impl();
-    JSValue result = jsStringWithCache(exec, impl->implementsStr2());
+    TestInterface& impl = castedThis->impl();
+    JSValue result = jsStringWithCache(exec, impl.implementsStr2());
     return result;
 }
 
@@ -331,8 +331,8 @@ JSValue jsTestInterfaceImplementsNode(ExecState* exec, JSValue slotBase, Propert
 {
     JSTestInterface* castedThis = jsCast<JSTestInterface*>(asObject(slotBase));
     UNUSED_PARAM(exec);
-    TestInterface* impl = castedThis->impl();
-    JSValue result = toJS(exec, castedThis->globalObject(), WTF::getPtr(impl->implementsNode()));
+    TestInterface& impl = castedThis->impl();
+    JSValue result = toJS(exec, castedThis->globalObject(), WTF::getPtr(impl.implementsNode()));
     return result;
 }
 
@@ -365,8 +365,8 @@ JSValue jsTestInterfaceSupplementalStr1(ExecState* exec, JSValue slotBase, Prope
 {
     JSTestInterface* castedThis = jsCast<JSTestInterface*>(asObject(slotBase));
     UNUSED_PARAM(exec);
-    TestInterface* impl = castedThis->impl();
-    JSValue result = jsStringWithCache(exec, TestSupplemental::supplementalStr1(impl));
+    TestInterface& impl = castedThis->impl();
+    JSValue result = jsStringWithCache(exec, TestSupplemental::supplementalStr1(&impl));
     return result;
 }
 
@@ -377,8 +377,8 @@ JSValue jsTestInterfaceSupplementalStr2(ExecState* exec, JSValue slotBase, Prope
 {
     JSTestInterface* castedThis = jsCast<JSTestInterface*>(asObject(slotBase));
     UNUSED_PARAM(exec);
-    TestInterface* impl = castedThis->impl();
-    JSValue result = jsStringWithCache(exec, TestSupplemental::supplementalStr2(impl));
+    TestInterface& impl = castedThis->impl();
+    JSValue result = jsStringWithCache(exec, TestSupplemental::supplementalStr2(&impl));
     return result;
 }
 
@@ -398,8 +398,8 @@ JSValue jsTestInterfaceSupplementalNode(ExecState* exec, JSValue slotBase, Prope
 {
     JSTestInterface* castedThis = jsCast<JSTestInterface*>(asObject(slotBase));
     UNUSED_PARAM(exec);
-    TestInterface* impl = castedThis->impl();
-    JSValue result = toJS(exec, castedThis->globalObject(), WTF::getPtr(TestSupplemental::supplementalNode(impl)));
+    TestInterface& impl = castedThis->impl();
+    JSValue result = toJS(exec, castedThis->globalObject(), WTF::getPtr(TestSupplemental::supplementalNode(&impl)));
     return result;
 }
 
@@ -448,11 +448,11 @@ void setJSTestInterfaceImplementsStr2(ExecState* exec, JSObject* thisObject, JSV
 {
     UNUSED_PARAM(exec);
     JSTestInterface* castedThis = jsCast<JSTestInterface*>(thisObject);
-    TestInterface* impl = castedThis->impl();
+    TestInterface& impl = castedThis->impl();
     const String& nativeValue(value.isEmpty() ? String() : value.toString(exec)->value(exec));
     if (exec->hadException())
         return;
-    impl->setImplementsStr2(nativeValue);
+    impl.setImplementsStr2(nativeValue);
 }
 
 #endif
@@ -471,11 +471,11 @@ void setJSTestInterfaceImplementsNode(ExecState* exec, JSObject* thisObject, JSV
 {
     UNUSED_PARAM(exec);
     JSTestInterface* castedThis = jsCast<JSTestInterface*>(thisObject);
-    TestInterface* impl = castedThis->impl();
+    TestInterface& impl = castedThis->impl();
     Node* nativeValue(toNode(value));
     if (exec->hadException())
         return;
-    impl->setImplementsNode(nativeValue);
+    impl.setImplementsNode(nativeValue);
 }
 
 #endif
@@ -497,11 +497,11 @@ void setJSTestInterfaceSupplementalStr2(ExecState* exec, JSObject* thisObject, J
 {
     UNUSED_PARAM(exec);
     JSTestInterface* castedThis = jsCast<JSTestInterface*>(thisObject);
-    TestInterface* impl = castedThis->impl();
+    TestInterface& impl = castedThis->impl();
     const String& nativeValue(value.isEmpty() ? String() : value.toString(exec)->value(exec));
     if (exec->hadException())
         return;
-    TestSupplemental::setSupplementalStr2(impl, nativeValue);
+    TestSupplemental::setSupplementalStr2(&impl, nativeValue);
 }
 
 #endif
@@ -520,11 +520,11 @@ void setJSTestInterfaceSupplementalNode(ExecState* exec, JSObject* thisObject, J
 {
     UNUSED_PARAM(exec);
     JSTestInterface* castedThis = jsCast<JSTestInterface*>(thisObject);
-    TestInterface* impl = castedThis->impl();
+    TestInterface& impl = castedThis->impl();
     Node* nativeValue(toNode(value));
     if (exec->hadException())
         return;
-    TestSupplemental::setSupplementalNode(impl, nativeValue);
+    TestSupplemental::setSupplementalNode(&impl, nativeValue);
 }
 
 #endif
@@ -542,8 +542,8 @@ EncodedJSValue JSC_HOST_CALL jsTestInterfacePrototypeFunctionImplementsMethod1(E
         return throwVMTypeError(exec);
     JSTestInterface* castedThis = jsCast<JSTestInterface*>(asObject(thisValue));
     ASSERT_GC_OBJECT_INHERITS(castedThis, JSTestInterface::info());
-    TestInterface* impl = castedThis->impl();
-    impl->implementsMethod1();
+    TestInterface& impl = castedThis->impl();
+    impl.implementsMethod1();
     return JSValue::encode(jsUndefined());
 }
 
@@ -557,7 +557,7 @@ EncodedJSValue JSC_HOST_CALL jsTestInterfacePrototypeFunctionImplementsMethod2(E
         return throwVMTypeError(exec);
     JSTestInterface* castedThis = jsCast<JSTestInterface*>(asObject(thisValue));
     ASSERT_GC_OBJECT_INHERITS(castedThis, JSTestInterface::info());
-    TestInterface* impl = castedThis->impl();
+    TestInterface& impl = castedThis->impl();
     if (exec->argumentCount() < 2)
         return throwVMError(exec, createNotEnoughArgumentsError(exec));
     ExceptionCode ec = 0;
@@ -571,7 +571,7 @@ EncodedJSValue JSC_HOST_CALL jsTestInterfacePrototypeFunctionImplementsMethod2(E
     if (exec->hadException())
         return JSValue::encode(jsUndefined());
 
-    JSC::JSValue result = toJS(exec, castedThis->globalObject(), WTF::getPtr(impl->implementsMethod2(scriptContext, strArg, objArg, ec)));
+    JSC::JSValue result = toJS(exec, castedThis->globalObject(), WTF::getPtr(impl.implementsMethod2(scriptContext, strArg, objArg, ec)));
     setDOMException(exec, ec);
     return JSValue::encode(result);
 }
@@ -608,8 +608,8 @@ EncodedJSValue JSC_HOST_CALL jsTestInterfacePrototypeFunctionSupplementalMethod1
         return throwVMTypeError(exec);
     JSTestInterface* castedThis = jsCast<JSTestInterface*>(asObject(thisValue));
     ASSERT_GC_OBJECT_INHERITS(castedThis, JSTestInterface::info());
-    TestInterface* impl = castedThis->impl();
-    TestSupplemental::supplementalMethod1(impl);
+    TestInterface& impl = castedThis->impl();
+    TestSupplemental::supplementalMethod1(&impl);
     return JSValue::encode(jsUndefined());
 }
 
@@ -623,7 +623,7 @@ EncodedJSValue JSC_HOST_CALL jsTestInterfacePrototypeFunctionSupplementalMethod2
         return throwVMTypeError(exec);
     JSTestInterface* castedThis = jsCast<JSTestInterface*>(asObject(thisValue));
     ASSERT_GC_OBJECT_INHERITS(castedThis, JSTestInterface::info());
-    TestInterface* impl = castedThis->impl();
+    TestInterface& impl = castedThis->impl();
     if (exec->argumentCount() < 2)
         return throwVMError(exec, createNotEnoughArgumentsError(exec));
     ExceptionCode ec = 0;
@@ -637,7 +637,7 @@ EncodedJSValue JSC_HOST_CALL jsTestInterfacePrototypeFunctionSupplementalMethod2
     if (exec->hadException())
         return JSValue::encode(jsUndefined());
 
-    JSC::JSValue result = toJS(exec, castedThis->globalObject(), WTF::getPtr(TestSupplemental::supplementalMethod2(impl, scriptContext, strArg, objArg, ec)));
+    JSC::JSValue result = toJS(exec, castedThis->globalObject(), WTF::getPtr(TestSupplemental::supplementalMethod2(&impl, scriptContext, strArg, objArg, ec)));
     setDOMException(exec, ec);
     return JSValue::encode(result);
 }
@@ -710,7 +710,7 @@ static inline bool isObservable(JSTestInterface* jsTestInterface)
 bool JSTestInterfaceOwner::isReachableFromOpaqueRoots(JSC::Handle<JSC::Unknown> handle, void*, SlotVisitor& visitor)
 {
     JSTestInterface* jsTestInterface = jsCast<JSTestInterface*>(handle.get().asCell());
-    if (jsTestInterface->impl()->hasPendingActivity())
+    if (jsTestInterface->impl().hasPendingActivity())
         return true;
     if (!isObservable(jsTestInterface))
         return false;
@@ -722,7 +722,7 @@ void JSTestInterfaceOwner::finalize(JSC::Handle<JSC::Unknown> handle, void* cont
 {
     JSTestInterface* jsTestInterface = jsCast<JSTestInterface*>(handle.get().asCell());
     DOMWrapperWorld& world = *static_cast<DOMWrapperWorld*>(context);
-    uncacheWrapper(world, jsTestInterface->impl(), jsTestInterface);
+    uncacheWrapper(world, &jsTestInterface->impl(), jsTestInterface);
     jsTestInterface->releaseImpl();
 }
 
@@ -745,7 +745,7 @@ JSC::JSValue toJS(JSC::ExecState* exec, JSDOMGlobalObject* globalObject, TestInt
 
 TestInterface* toTestInterface(JSC::JSValue value)
 {
-    return value.inherits(JSTestInterface::info()) ? jsCast<JSTestInterface*>(asObject(value))->impl() : 0;
+    return value.inherits(JSTestInterface::info()) ? &jsCast<JSTestInterface*>(asObject(value))->impl() : 0;
 }
 
 }
index 44a6652..82f69b4 100644 (file)
@@ -78,7 +78,7 @@ public:
 #if ENABLE(Condition11) || ENABLE(Condition12)
     JSC::JSValue supplementalMethod3(JSC::ExecState*);
 #endif
-    TestInterface* impl() const { return m_impl; }
+    TestInterface& impl() const { return *m_impl; }
     void releaseImpl() { m_impl->deref(); m_impl = 0; }
 
     void releaseImplIfNotNull()
index 4eac294..34ef25e 100644 (file)
@@ -146,13 +146,13 @@ EncodedJSValue JSC_HOST_CALL jsTestMediaQueryListListenerPrototypeFunctionMethod
         return throwVMTypeError(exec);
     JSTestMediaQueryListListener* castedThis = jsCast<JSTestMediaQueryListListener*>(asObject(thisValue));
     ASSERT_GC_OBJECT_INHERITS(castedThis, JSTestMediaQueryListListener::info());
-    TestMediaQueryListListener* impl = castedThis->impl();
+    TestMediaQueryListListener& impl = castedThis->impl();
     if (exec->argumentCount() < 1)
         return throwVMError(exec, createNotEnoughArgumentsError(exec));
     if (!exec->argument(0).isFunction())
         return throwVMTypeError(exec);
     RefPtr<MediaQueryListListener> listener = JSMediaQueryListListener::create(asObject(exec->uncheckedArgument(0)), castedThis->globalObject());
-    impl->method(listener);
+    impl.method(listener);
     return JSValue::encode(jsUndefined());
 }
 
@@ -176,7 +176,7 @@ void JSTestMediaQueryListListenerOwner::finalize(JSC::Handle<JSC::Unknown> handl
 {
     JSTestMediaQueryListListener* jsTestMediaQueryListListener = jsCast<JSTestMediaQueryListListener*>(handle.get().asCell());
     DOMWrapperWorld& world = *static_cast<DOMWrapperWorld*>(context);
-    uncacheWrapper(world, jsTestMediaQueryListListener->impl(), jsTestMediaQueryListListener);
+    uncacheWrapper(world, &jsTestMediaQueryListListener->impl(), jsTestMediaQueryListListener);
     jsTestMediaQueryListListener->releaseImpl();
 }
 
@@ -219,7 +219,7 @@ JSC::JSValue toJS(JSC::ExecState* exec, JSDOMGlobalObject* globalObject, TestMed
 
 TestMediaQueryListListener* toTestMediaQueryListListener(JSC::JSValue value)
 {
-    return value.inherits(JSTestMediaQueryListListener::info()) ? jsCast<JSTestMediaQueryListListener*>(asObject(value))->impl() : 0;
+    return value.inherits(JSTestMediaQueryListListener::info()) ? &jsCast<JSTestMediaQueryListListener*>(asObject(value))->impl() : 0;
 }
 
 }
index 98ad102..fc74b66 100644 (file)
@@ -51,7 +51,7 @@ public:
     }
 
     static JSC::JSValue getConstructor(JSC::VM&, JSC::JSGlobalObject*);
-    TestMediaQueryListListener* impl() const { return m_impl; }
+    TestMediaQueryListListener& impl() const { return *m_impl; }
     void releaseImpl() { m_impl->deref(); m_impl = 0; }
 
     void releaseImplIfNotNull()
index fceecd5..dac2d16 100644 (file)
@@ -190,7 +190,7 @@ static inline bool isObservable(JSTestNamedConstructor* jsTestNamedConstructor)
 bool JSTestNamedConstructorOwner::isReachableFromOpaqueRoots(JSC::Handle<JSC::Unknown> handle, void*, SlotVisitor& visitor)
 {
     JSTestNamedConstructor* jsTestNamedConstructor = jsCast<JSTestNamedConstructor*>(handle.get().asCell());
-    if (jsTestNamedConstructor->impl()->hasPendingActivity())
+    if (jsTestNamedConstructor->impl().hasPendingActivity())
         return true;
     if (!isObservable(jsTestNamedConstructor))
         return false;
@@ -202,7 +202,7 @@ void JSTestNamedConstructorOwner::finalize(JSC::Handle<JSC::Unknown> handle, voi
 {
     JSTestNamedConstructor* jsTestNamedConstructor = jsCast<JSTestNamedConstructor*>(handle.get().asCell());
     DOMWrapperWorld& world = *static_cast<DOMWrapperWorld*>(context);
-    uncacheWrapper(world, jsTestNamedConstructor->impl(), jsTestNamedConstructor);
+    uncacheWrapper(world, &jsTestNamedConstructor->impl(), jsTestNamedConstructor);
     jsTestNamedConstructor->releaseImpl();
 }
 
@@ -245,7 +245,7 @@ JSC::JSValue toJS(JSC::ExecState* exec, JSDOMGlobalObject* globalObject, TestNam
 
 TestNamedConstructor* toTestNamedConstructor(JSC::JSValue value)
 {
-    return value.inherits(JSTestNamedConstructor::info()) ? jsCast<JSTestNamedConstructor*>(asObject(value))->impl() : 0;
+    return value.inherits(JSTestNamedConstructor::info()) ? &jsCast<JSTestNamedConstructor*>(asObject(value))->impl() : 0;
 }
 
 }
index fe43f3f..3e456a0 100644 (file)
@@ -53,7 +53,7 @@ public:
 
     static JSC::JSValue getConstructor(JSC::VM&, JSC::JSGlobalObject*);
     static JSC::JSValue getNamedConstructor(JSC::VM&, JSC::JSGlobalObject*);
-    TestNamedConstructor* impl() const { return m_impl; }
+    TestNamedConstructor& impl() const { return *m_impl; }
     void releaseImpl() { m_impl->deref(); m_impl = 0; }
 
     void releaseImplIfNotNull()
index 8cdc948..b6e6fc9 100644 (file)
@@ -139,7 +139,7 @@ void JSTestNode::visitChildren(JSCell* cell, SlotVisitor& visitor)
     COMPILE_ASSERT(StructureFlags & OverridesVisitChildren, OverridesVisitChildrenWithoutSettingFlag);
     ASSERT(thisObject->structure()->typeInfo().overridesVisitChildren());
     Base::visitChildren(thisObject, visitor);
-    thisObject->impl()->visitJSEventListeners(visitor);
+    thisObject->impl().visitJSEventListeners(visitor);
 }
 
 
index 4ef64ad..766a362 100644 (file)
@@ -50,9 +50,9 @@ public:
     static JSC::JSValue getConstructor(JSC::VM&, JSC::JSGlobalObject*);
     static void visitChildren(JSCell*, JSC::SlotVisitor&);
 
-    TestNode* impl() const
+    TestNode& impl() const
     {
-        return static_cast<TestNode*>(Base::impl());
+        return static_cast<TestNode&>(Base::impl());
     }
 protected:
     JSTestNode(JSC::Structure*, JSDOMGlobalObject*, PassRefPtr<TestNode>);
index bda1180..2f32d6a 100644 (file)
@@ -396,8 +396,8 @@ JSValue jsTestObjReadOnlyLongAttr(ExecState* exec, JSValue slotBase, PropertyNam
 {
     JSTestObj* castedThis = jsCast<JSTestObj*>(asObject(slotBase));
     UNUSED_PARAM(exec);
-    TestObj* impl = castedThis->impl();
-    JSValue result = jsNumber(impl->readOnlyLongAttr());
+    TestObj& impl = castedThis->impl();
+    JSValue result = jsNumber(impl.readOnlyLongAttr());
     return result;
 }
 
@@ -406,8 +406,8 @@ JSValue jsTestObjReadOnlyStringAttr(ExecState* exec, JSValue slotBase, PropertyN
 {
     JSTestObj* castedThis = jsCast<JSTestObj*>(asObject(slotBase));
     UNUSED_PARAM(exec);
-    TestObj* impl = castedThis->impl();
-    JSValue result = jsStringWithCache(exec, impl->readOnlyStringAttr());
+    TestObj& impl = castedThis->impl();
+    JSValue result = jsStringWithCache(exec, impl.readOnlyStringAttr());
     return result;
 }
 
@@ -416,8 +416,8 @@ JSValue jsTestObjReadOnlyTestObjAttr(ExecState* exec, JSValue slotBase, Property
 {
     JSTestObj* castedThis = jsCast<JSTestObj*>(asObject(slotBase));
     UNUSED_PARAM(exec);
-    TestObj* impl = castedThis->impl();
-    JSValue result = toJS(exec, castedThis->globalObject(), WTF::getPtr(impl->readOnlyTestObjAttr()));
+    TestObj& impl = castedThis->impl();
+    JSValue result = toJS(exec, castedThis->globalObject(), WTF::getPtr(impl.readOnlyTestObjAttr()));
     return result;
 }
 
@@ -450,9 +450,9 @@ JSValue jsTestObjConstructorTestSubObj(ExecState* exec, JSValue slotBase, Proper
 JSValue jsTestObjTestSubObjEnabledBySettingConstructor(ExecState* exec, JSValue slotBase, PropertyName)
 {
     JSTestObj* castedThis = jsCast<JSTestObj*>(asObject(slotBase));
-    if (!castedThis->impl()->frame())
+    if (!castedThis->impl().frame())
         return jsUndefined();
-    Settings& settings = castedThis->impl()->frame()->settings();
+    Settings& settings = castedThis->impl().frame()->settings();
     if (!settings.testSettingEnabled())
         return jsUndefined();
     return JSTestSubObj::getConstructor(exec->vm(), castedThis->globalObject());
@@ -463,8 +463,8 @@ JSValue jsTestObjEnumAttr(ExecState* exec, JSValue slotBase, PropertyName)
 {
     JSTestObj* castedThis = jsCast<JSTestObj*>(asObject(slotBase));
     UNUSED_PARAM(exec);
-    TestObj* impl = castedThis->impl();
-    JSValue result = jsStringWithCache(exec, impl->enumAttr());
+    TestObj& impl = castedThis->impl();
+    JSValue result = jsStringWithCache(exec, impl.enumAttr());
     return result;
 }
 
@@ -473,8 +473,8 @@ JSValue jsTestObjByteAttr(ExecState* exec, JSValue slotBase, PropertyName)
 {
     JSTestObj* castedThis = jsCast<JSTestObj*>(asObject(slotBase));
     UNUSED_PARAM(exec);
-    TestObj* impl = castedThis->impl();
-    JSValue result = jsNumber(impl->byteAttr());
+    TestObj& impl = castedThis->impl();
+    JSValue result = jsNumber(impl.byteAttr());
     return result;
 }
 
@@ -483,8 +483,8 @@ JSValue jsTestObjOctetAttr(ExecState* exec, JSValue slotBase, PropertyName)
 {
     JSTestObj* castedThis = jsCast<JSTestObj*>(asObject(slotBase));
     UNUSED_PARAM(exec);
-    TestObj* impl = castedThis->impl();
-    JSValue result = jsNumber(impl->octetAttr());
+    TestObj& impl = castedThis->impl();
+    JSValue result = jsNumber(impl.octetAttr());
     return result;
 }
 
@@ -493,8 +493,8 @@ JSValue jsTestObjShortAttr(ExecState* exec, JSValue slotBase, PropertyName)
 {
     JSTestObj* castedThis = jsCast<JSTestObj*>(asObject(slotBase));
     UNUSED_PARAM(exec);
-    TestObj* impl = castedThis->impl();
-    JSValue result = jsNumber(impl->shortAttr());
+    TestObj& impl = castedThis->impl();
+    JSValue result = jsNumber(impl.shortAttr());
     return result;
 }
 
@@ -503,8 +503,8 @@ JSValue jsTestObjUnsignedShortAttr(ExecState* exec, JSValue slotBase, PropertyNa
 {
     JSTestObj* castedThis = jsCast<JSTestObj*>(asObject(slotBase));
     UNUSED_PARAM(exec);
-    TestObj* impl = castedThis->impl();
-    JSValue result = jsNumber(impl->unsignedShortAttr());
+    TestObj& impl = castedThis->impl();
+    JSValue result = jsNumber(impl.unsignedShortAttr());
     return result;
 }
 
@@ -513,8 +513,8 @@ JSValue jsTestObjLongAttr(ExecState* exec, JSValue slotBase, PropertyName)
 {
     JSTestObj* castedThis = jsCast<JSTestObj*>(asObject(slotBase));
     UNUSED_PARAM(exec);
-    TestObj* impl = castedThis->impl();
-    JSValue result = jsNumber(impl->longAttr());
+    TestObj& impl = castedThis->impl();
+    JSValue result = jsNumber(impl.longAttr());
     return result;
 }
 
@@ -523,8 +523,8 @@ JSValue jsTestObjLongLongAttr(ExecState* exec, JSValue slotBase, PropertyName)
 {
     JSTestObj* castedThis = jsCast<JSTestObj*>(asObject(slotBase));
     UNUSED_PARAM(exec);
-    TestObj* impl = castedThis->impl();
-    JSValue result = jsNumber(impl->longLongAttr());
+    TestObj& impl = castedThis->impl();
+    JSValue result = jsNumber(impl.longLongAttr());
     return result;
 }
 
@@ -533,8 +533,8 @@ JSValue jsTestObjUnsignedLongLongAttr(ExecState* exec, JSValue slotBase, Propert
 {
     JSTestObj* castedThis = jsCast<JSTestObj*>(asObject(slotBase));
     UNUSED_PARAM(exec);
-    TestObj* impl = castedThis->impl();
-    JSValue result = jsNumber(impl->unsignedLongLongAttr());
+    TestObj& impl = castedThis->impl();
+    JSValue result = jsNumber(impl.unsignedLongLongAttr());
     return result;
 }
 
@@ -543,8 +543,8 @@ JSValue jsTestObjStringAttr(ExecState* exec, JSValue slotBase, PropertyName)
 {
     JSTestObj* castedThis = jsCast<JSTestObj*>(asObject(slotBase));
     UNUSED_PARAM(exec);
-    TestObj* impl = castedThis->impl();
-    JSValue result = jsStringWithCache(exec, impl->stringAttr());
+    TestObj& impl = castedThis->impl();
+    JSValue result = jsStringWithCache(exec, impl.stringAttr());
     return result;
 }
 
@@ -553,8 +553,8 @@ JSValue jsTestObjTestObjAttr(ExecState* exec, JSValue slotBase, PropertyName)
 {
     JSTestObj* castedThis = jsCast<JSTestObj*>(asObject(slotBase));
     UNUSED_PARAM(exec);
-    TestObj* impl = castedThis->impl();
-    JSValue result = toJS(exec, castedThis->globalObject(), WTF::getPtr(impl->testObjAttr()));
+    TestObj& impl = castedThis->impl();
+    JSValue result = toJS(exec, castedThis->globalObject(), WTF::getPtr(impl.testObjAttr()));
     return result;
 }
 
@@ -563,8 +563,8 @@ JSValue jsTestObjXMLObjAttr(ExecState* exec, JSValue slotBase, PropertyName)
 {
     JSTestObj* castedThis = jsCast<JSTestObj*>(asObject(slotBase));
     UNUSED_PARAM(exec);
-    TestObj* impl = castedThis->impl();
-    JSValue result = toJS(exec, castedThis->globalObject(), WTF::getPtr(impl->xmlObjAttr()));
+    TestObj& impl = castedThis->impl();
+    JSValue result = toJS(exec, castedThis->globalObject(), WTF::getPtr(impl.xmlObjAttr()));
     return result;
 }
 
@@ -573,8 +573,8 @@ JSValue jsTestObjCreate(ExecState* exec, JSValue slotBase, PropertyName)
 {
     JSTestObj* castedThis = jsCast<JSTestObj*>(asObject(slotBase));
     UNUSED_PARAM(exec);
-    TestObj* impl = castedThis->impl();
-    JSValue result = jsBoolean(impl->isCreate());
+    TestObj& impl = castedThis->impl();
+    JSValue result = jsBoolean(impl.isCreate());
     return result;
 }
 
@@ -583,8 +583,8 @@ JSValue jsTestObjReflectedStringAttr(ExecState* exec, JSValue slotBase, Property
 {
     JSTestObj* castedThis = jsCast<JSTestObj*>(asObject(slotBase));
     UNUSED_PARAM(exec);
-    TestObj* impl = castedThis->impl();
-    JSValue result = jsStringWithCache(exec, impl->fastGetAttribute(WebCore::HTMLNames::reflectedstringattrAttr));
+    TestObj& impl = castedThis->impl();
+    JSValue result = jsStringWithCache(exec, impl.fastGetAttribute(WebCore::HTMLNames::reflectedstringattrAttr));
     return result;
 }
 
@@ -593,8 +593,8 @@ JSValue jsTestObjReflectedIntegralAttr(ExecState* exec, JSValue slotBase, Proper
 {
     JSTestObj* castedThis = jsCast<JSTestObj*>(asObject(slotBase));
     UNUSED_PARAM(exec);
-    TestObj* impl = castedThis->impl();
-    JSValue result = jsNumber(impl->getIntegralAttribute(WebCore::HTMLNames::reflectedintegralattrAttr));
+    TestObj& impl = castedThis->impl();
+    JSValue result = jsNumber(impl.getIntegralAttribute(WebCore::HTMLNames::reflectedintegralattrAttr));
     return result;
 }
 
@@ -603,8 +603,8 @@ JSValue jsTestObjReflectedUnsignedIntegralAttr(ExecState* exec, JSValue slotBase
 {
     JSTestObj* castedThis = jsCast<JSTestObj*>(asObject(slotBase));
     UNUSED_PARAM(exec);
-    TestObj* impl = castedThis->impl();
-    JSValue result = jsNumber(std::max(0, impl->getIntegralAttribute(WebCore::HTMLNames::reflectedunsignedintegralattrAttr)));
+    TestObj& impl = castedThis->impl();
+    JSValue result = jsNumber(std::max(0, impl.getIntegralAttribute(WebCore::HTMLNames::reflectedunsignedintegralattrAttr)));
     return result;
 }
 
@@ -613,8 +613,8 @@ JSValue jsTestObjReflectedBooleanAttr(ExecState* exec, JSValue slotBase, Propert
 {
     JSTestObj* castedThis = jsCast<JSTestObj*>(asObject(slotBase));
     UNUSED_PARAM(exec);
-    TestObj* impl = castedThis->impl();
-    JSValue result = jsBoolean(impl->fastHasAttribute(WebCore::HTMLNames::reflectedbooleanattrAttr));
+    TestObj& impl = castedThis->impl();
+    JSValue result = jsBoolean(impl.fastHasAttribute(WebCore::HTMLNames::reflectedbooleanattrAttr));
     return result;
 }
 
@@ -623,8 +623,8 @@ JSValue jsTestObjReflectedURLAttr(ExecState* exec, JSValue slotBase, PropertyNam
 {
     JSTestObj* castedThis = jsCast<JSTestObj*>(asObject(slotBase));
     UNUSED_PARAM(exec);
-    TestObj* impl = castedThis->impl();
-    JSValue result = jsStringWithCache(exec, impl->getURLAttribute(WebCore::HTMLNames::reflectedurlattrAttr));
+    TestObj& impl = castedThis->impl();
+    JSValue result = jsStringWithCache(exec, impl.getURLAttribute(WebCore::HTMLNames::reflectedurlattrAttr));
     return result;
 }
 
@@ -633,8 +633,8 @@ JSValue jsTestObjReflectedStringAttr(ExecState* exec, JSValue slotBase, Property
 {
     JSTestObj* castedThis = jsCast<JSTestObj*>(asObject(slotBase));
     UNUSED_PARAM(exec);
-    TestObj* impl = castedThis->impl();
-    JSValue result = jsStringWithCache(exec, impl->fastGetAttribute(WebCore::HTMLNames::customContentStringAttrAttr));
+    TestObj& impl = castedThis->impl();
+    JSValue result = jsStringWithCache(exec, impl.fastGetAttribute(WebCore::HTMLNames::customContentStringAttrAttr));
     return result;
 }
 
@@ -643,8 +643,8 @@ JSValue jsTestObjReflectedCustomIntegralAttr(ExecState* exec, JSValue slotBase,
 {
     JSTestObj* castedThis = jsCast<JSTestObj*>(asObject(slotBase));
     UNUSED_PARAM(exec);
-    TestObj* impl = castedThis->impl();
-    JSValue result = jsNumber(impl->getIntegralAttribute(WebCore::HTMLNames::customContentIntegralAttrAttr));
+    TestObj& impl = castedThis->impl();
+    JSValue result = jsNumber(impl.getIntegralAttribute(WebCore::HTMLNames::customContentIntegralAttrAttr));
     return result;
 }
 
@@ -653,8 +653,8 @@ JSValue jsTestObjReflectedCustomBooleanAttr(ExecState* exec, JSValue slotBase, P
 {
     JSTestObj* castedThis = jsCast<JSTestObj*>(asObject(slotBase));
     UNUSED_PARAM(exec);
-    TestObj* impl = castedThis->impl();
-    JSValue result = jsBoolean(impl->fastHasAttribute(WebCore::HTMLNames::customContentBooleanAttrAttr));
+    TestObj& impl = castedThis->impl();
+    JSValue result = jsBoolean(impl.fastHasAttribute(WebCore::HTMLNames::customContentBooleanAttrAttr));
     return result;
 }
 
@@ -663,8 +663,8 @@ JSValue jsTestObjReflectedCustomURLAttr(ExecState* exec, JSValue slotBase, Prope
 {
     JSTestObj* castedThis = jsCast<JSTestObj*>(asObject(slotBase));
     UNUSED_PARAM(exec);
-    TestObj* impl = castedThis->impl();
-    JSValue result = jsStringWithCache(exec, impl->getURLAttribute(WebCore::HTMLNames::customContentURLAttrAttr));
+    TestObj& impl = castedThis->impl();
+    JSValue result = jsStringWithCache(exec, impl.getURLAttribute(WebCore::HTMLNames::customContentURLAttrAttr));
     return result;
 }
 
@@ -673,8 +673,8 @@ JSValue jsTestObjTypedArrayAttr(ExecState* exec, JSValue slotBase, PropertyName)
 {
     JSTestObj* castedThis = jsCast<JSTestObj*>(asObject(slotBase));
     UNUSED_PARAM(exec);
-    TestObj* impl = castedThis->impl();
-    JSValue result = toJS(exec, castedThis->globalObject(), WTF::getPtr(impl->typedArrayAttr()));
+    TestObj& impl = castedThis->impl();
+    JSValue result = toJS(exec, castedThis->globalObject(), WTF::getPtr(impl.typedArrayAttr()));
     return result;
 }
 
@@ -683,8 +683,8 @@ JSValue jsTestObjAttrWithGetterException(ExecState* exec, JSValue slotBase, Prop
 {
     JSTestObj* castedThis = jsCast<JSTestObj*>(asObject(slotBase));
     ExceptionCode ec = 0;
-    TestObj* impl = castedThis->impl();
-    JSC::JSValue result = jsNumber(impl->attrWithGetterException(ec));
+    TestObj& impl = castedThis->impl();
+    JSC::JSValue result = jsNumber(impl.attrWithGetterException(ec));
     setDOMException(exec, ec);
     return result;
 }
@@ -694,8 +694,8 @@ JSValue jsTestObjAttrWithSetterException(ExecState* exec, JSValue slotBase, Prop
 {
     JSTestObj* castedThis = jsCast<JSTestObj*>(asObject(slotBase));
     UNUSED_PARAM(exec);
-    TestObj* impl = castedThis->impl();
-    JSValue result = jsNumber(impl->attrWithSetterException());
+    TestObj& impl = castedThis->impl();
+    JSValue result = jsNumber(impl.attrWithSetterException());
     return result;
 }
 
@@ -704,8 +704,8 @@ JSValue jsTestObjStringAttrWithGetterException(ExecState* exec, JSValue slotBase
 {
     JSTestObj* castedThis = jsCast<JSTestObj*>(asObject(slotBase));
     ExceptionCode ec = 0;
-    TestObj* impl = castedThis->impl();
-    JSC::JSValue result = jsStringWithCache(exec, impl->stringAttrWithGetterException(ec));
+    TestObj& impl = castedThis->impl();
+    JSC::JSValue result = jsStringWithCache(exec, impl.stringAttrWithGetterException(ec));
     setDOMException(exec, ec);
     return result;
 }
@@ -715,8 +715,8 @@ JSValue jsTestObjStringAttrWithSetterException(ExecState* exec, JSValue slotBase
 {
     JSTestObj* castedThis = jsCast<JSTestObj*>(asObject(slotBase));
     UNUSED_PARAM(exec);
-    TestObj* impl = castedThis->impl();
-    JSValue result = jsStringWithCache(exec, impl->stringAttrWithSetterException());
+    TestObj& impl = castedThis->impl();
+    JSValue result = jsStringWithCache(exec, impl.stringAttrWithSetterException());
     return result;
 }
 
@@ -731,8 +731,8 @@ JSValue jsTestObjCustomAttr(ExecState* exec, JSValue slotBase, PropertyName)
 JSValue jsTestObjWithScriptStateAttribute(ExecState* exec, JSValue slotBase, PropertyName)
 {
     JSTestObj* castedThis = jsCast<JSTestObj*>(asObject(slotBase));
-    TestObj* impl = castedThis->impl();
-    JSValue result = jsNumber(impl->withScriptStateAttribute(exec));
+    TestObj& impl = castedThis->impl();
+    JSValue result = jsNumber(impl.withScriptStateAttribute(exec));
     return result;
 }
 
@@ -743,8 +743,8 @@ JSValue jsTestObjWithScriptExecutionContextAttribute(ExecState* exec, JSValue sl
     ScriptExecutionContext* scriptContext = jsCast<JSDOMGlobalObject*>(exec->lexicalGlobalObject())->scriptExecutionContext();
     if (!scriptContext)
         return jsUndefined();
-    TestObj* impl = castedThis->impl();
-    JSValue result = toJS(exec, castedThis->globalObject(), WTF::getPtr(impl->withScriptExecutionContextAttribute(scriptContext)));
+    TestObj& impl = castedThis->impl();
+    JSValue result = toJS(exec, castedThis->globalObject(), WTF::getPtr(impl.withScriptExecutionContextAttribute(scriptContext)));
     return result;
 }
 
@@ -753,8 +753,8 @@ JSValue jsTestObjWithScriptStateAttributeRaises(ExecState* exec, JSValue slotBas
 {
     JSTestObj* castedThis = jsCast<JSTestObj*>(asObject(slotBase));
     ExceptionCode ec = 0;
-    TestObj* impl = castedThis->impl();
-    JSC::JSValue result = toJS(exec, castedThis->globalObject(), WTF::getPtr(impl->withScriptStateAttributeRaises(exec, ec)));
+    TestObj& impl = castedThis->impl();
+    JSC::JSValue result = toJS(exec, castedThis->globalObject(), WTF::getPtr(impl.withScriptStateAttributeRaises(exec, ec)));
     setDOMException(exec, ec);
     return result;
 }
@@ -767,8 +767,8 @@ JSValue jsTestObjWithScriptExecutionContextAttributeRaises(ExecState* exec, JSVa
     ScriptExecutionContext* scriptContext = jsCast<JSDOMGlobalObject*>(exec->lexicalGlobalObject())->scriptExecutionContext();
     if (!scriptContext)
         return jsUndefined();
-    TestObj* impl = castedThis->impl();
-    JSC::JSValue result = toJS(exec, castedThis->globalObject(), WTF::getPtr(impl->withScriptExecutionContextAttributeRaises(scriptContext, ec)));
+    TestObj& impl = castedThis->impl();
+    JSC::JSValue result = toJS(exec, castedThis->globalObject(), WTF::getPtr(impl.withScriptExecutionContextAttributeRaises(scriptContext, ec)));
     setDOMException(exec, ec);
     return result;
 }
@@ -780,8 +780,8 @@ JSValue jsTestObjWithScriptExecutionContextAndScriptStateAttribute(ExecState* ex
     ScriptExecutionContext* scriptContext = jsCast<JSDOMGlobalObject*>(exec->lexicalGlobalObject())->scriptExecutionContext();
     if (!scriptContext)
         return jsUndefined();
-    TestObj* impl = castedThis->impl();
-    JSValue result = toJS(exec, castedThis->globalObject(), WTF::getPtr(impl->withScriptExecutionContextAndScriptStateAttribute(exec, scriptContext)));
+    TestObj& impl = castedThis->impl();
+    JSValue result = toJS(exec, castedThis->globalObject(), WTF::getPtr(impl.withScriptExecutionContextAndScriptStateAttribute(exec, scriptContext)));
     return result;
 }
 
@@ -793,8 +793,8 @@ JSValue jsTestObjWithScriptExecutionContextAndScriptStateAttributeRaises(ExecSta
     ScriptExecutionContext* scriptContext = jsCast<JSDOMGlobalObject*>(exec->lexicalGlobalObject())->scriptExecutionContext();
     if (!scriptContext)
         return jsUndefined();
-    TestObj* impl = castedThis->impl();
-    JSC::JSValue result = toJS(exec, castedThis->globalObject(), WTF::getPtr(impl->withScriptExecutionContextAndScriptStateAttributeRaises(exec, scriptContext, ec)));
+    TestObj& impl = castedThis->impl();
+    JSC::JSValue result = toJS(exec, castedThis->globalObject(), WTF::getPtr(impl.withScriptExecutionContextAndScriptStateAttributeRaises(exec, scriptContext, ec)));
     setDOMException(exec, ec);
     return result;
 }
@@ -806,8 +806,8 @@ JSValue jsTestObjWithScriptExecutionContextAndScriptStateWithSpacesAttribute(Exe
     ScriptExecutionContext* scriptContext = jsCast<JSDOMGlobalObject*>(exec->lexicalGlobalObject())->scriptExecutionContext();
     if (!scriptContext)
         return jsUndefined();
-    TestObj* impl = castedThis->impl();
-    JSValue result = toJS(exec, castedThis->globalObject(), WTF::getPtr(impl->withScriptExecutionContextAndScriptStateWithSpacesAttribute(exec, scriptContext)));
+    TestObj& impl = castedThis->impl();
+    JSValue result = toJS(exec, castedThis->globalObject(), WTF::getPtr(impl.withScriptExecutionContextAndScriptStateWithSpacesAttribute(exec, scriptContext)));
     return result;
 }
 
@@ -815,8 +815,8 @@ JSValue jsTestObjWithScriptExecutionContextAndScriptStateWithSpacesAttribute(Exe
 JSValue jsTestObjWithScriptArgumentsAndCallStackAttribute(ExecState* exec, JSValue slotBase, PropertyName)
 {
     JSTestObj* castedThis = jsCast<JSTestObj*>(asObject(slotBase));
-    TestObj* impl = castedThis->impl();
-    JSValue result = toJS(exec, castedThis->globalObject(), WTF::getPtr(impl->withScriptArgumentsAndCallStackAttribute()));
+    TestObj& impl = castedThis->impl();
+    JSValue result = toJS(exec, castedThis->globalObject(), WTF::getPtr(impl.withScriptArgumentsAndCallStackAttribute()));
     return result;
 }
 
@@ -826,8 +826,8 @@ JSValue jsTestObjConditionalAttr1(ExecState* exec, JSValue slotBase, PropertyNam
 {
     JSTestObj* castedThis = jsCast<JSTestObj*>(asObject(slotBase));
     UNUSED_PARAM(exec);
-    TestObj* impl = castedThis->impl();
-    JSValue result = jsNumber(impl->conditionalAttr1());
+    TestObj& impl = castedThis->impl();
+    JSValue result = jsNumber(impl.conditionalAttr1());
     return result;
 }
 
@@ -838,8 +838,8 @@ JSValue jsTestObjConditionalAttr2(ExecState* exec, JSValue slotBase, PropertyNam
 {
     JSTestObj* castedThis = jsCast<JSTestObj*>(asObject(slotBase));
     UNUSED_PARAM(exec);
-    TestObj* impl = castedThis->impl();
-    JSValue result = jsNumber(impl->conditionalAttr2());
+    TestObj& impl = castedThis->impl();
+    JSValue result = jsNumber(impl.conditionalAttr2());
     return result;
 }
 
@@ -850,8 +850,8 @@ JSValue jsTestObjConditionalAttr3(ExecState* exec, JSValue slotBase, PropertyNam
 {
     JSTestObj* castedThis = jsCast<JSTestObj*>(asObject(slotBase));
     UNUSED_PARAM(exec);
-    TestObj* impl = castedThis->impl();
-    JSValue result = jsNumber(impl->conditionalAttr3());
+    TestObj& impl = castedThis->impl();
+    JSValue result = jsNumber(impl.conditionalAttr3());