Refactor binding generated casted-this checks
authorcommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sat, 8 Oct 2016 13:09:30 +0000 (13:09 +0000)
committercommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sat, 8 Oct 2016 13:09:30 +0000 (13:09 +0000)
https://bugs.webkit.org/show_bug.cgi?id=162677

Patch by Youenn Fablet <youenn@apple.com> on 2016-10-08
Reviewed by Darin Adler.

No change of behavior.

Split the attribute getter function in two, one with the signature expected by JSCore and one used after casted-this checks.

The second function takes directly a JSXX object and returns a JSValue instead of an EncodedJSValue.
In the future, the second function should only take references.

Introducing BindingCaller as a way to templatize binding code used to cast thisValue with the desired JSXX value.
This allows implementing the first function using the second function as template parameter.

Introducing JSClass::castForAttribute as a way to encapsulate differences in the way to handle thisValue access.

* bindings/js/JSDOMBinding.h:
(WebCore::BindingCaller::attribute):
* bindings/scripts/CodeGeneratorJS.pm:
(GenerateHeader):
(GenerateImplementation):
* bindings/scripts/test/JS/JSTestActiveDOMObject.cpp:
* bindings/scripts/test/JS/JSTestActiveDOMObject.h:
* bindings/scripts/test/JS/JSTestEventConstructor.cpp:
* bindings/scripts/test/JS/JSTestEventConstructor.h:
* bindings/scripts/test/JS/JSTestException.cpp:
* bindings/scripts/test/JS/JSTestException.h:
* bindings/scripts/test/JS/JSTestGlobalObject.cpp:
* bindings/scripts/test/JS/JSTestInterface.cpp:
* bindings/scripts/test/JS/JSTestInterface.h:
* bindings/scripts/test/JS/JSTestJSBuiltinConstructor.cpp:
* bindings/scripts/test/JS/JSTestJSBuiltinConstructor.h:
* bindings/scripts/test/JS/JSTestNode.cpp:
* bindings/scripts/test/JS/JSTestNode.h:
* bindings/scripts/test/JS/JSTestNondeterministic.cpp:
* bindings/scripts/test/JS/JSTestNondeterministic.h:
* bindings/scripts/test/JS/JSTestObj.cpp:
* bindings/scripts/test/JS/JSTestObj.h:
* bindings/scripts/test/JS/JSTestSerializedScriptValueInterface.cpp:
* bindings/scripts/test/JS/JSTestSerializedScriptValueInterface.h:
* bindings/scripts/test/JS/JSTestTypedefs.cpp:
* bindings/scripts/test/JS/JSTestTypedefs.h:
* bindings/scripts/test/JS/JSattribute.cpp:
* bindings/scripts/test/JS/JSattribute.h:

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

27 files changed:
Source/WebCore/ChangeLog
Source/WebCore/bindings/js/JSDOMBinding.h
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/JSTestEventConstructor.cpp
Source/WebCore/bindings/scripts/test/JS/JSTestEventConstructor.h
Source/WebCore/bindings/scripts/test/JS/JSTestException.cpp
Source/WebCore/bindings/scripts/test/JS/JSTestException.h
Source/WebCore/bindings/scripts/test/JS/JSTestGlobalObject.cpp
Source/WebCore/bindings/scripts/test/JS/JSTestGlobalObject.h
Source/WebCore/bindings/scripts/test/JS/JSTestInterface.cpp
Source/WebCore/bindings/scripts/test/JS/JSTestInterface.h
Source/WebCore/bindings/scripts/test/JS/JSTestJSBuiltinConstructor.cpp
Source/WebCore/bindings/scripts/test/JS/JSTestJSBuiltinConstructor.h
Source/WebCore/bindings/scripts/test/JS/JSTestNode.cpp
Source/WebCore/bindings/scripts/test/JS/JSTestNode.h
Source/WebCore/bindings/scripts/test/JS/JSTestNondeterministic.cpp
Source/WebCore/bindings/scripts/test/JS/JSTestNondeterministic.h
Source/WebCore/bindings/scripts/test/JS/JSTestObj.cpp
Source/WebCore/bindings/scripts/test/JS/JSTestObj.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

index 9277bbf..01424a9 100644 (file)
@@ -1,3 +1,51 @@
+2016-10-08  Youenn Fablet  <youenn@apple.com>
+
+        Refactor binding generated casted-this checks
+        https://bugs.webkit.org/show_bug.cgi?id=162677
+
+        Reviewed by Darin Adler.
+
+        No change of behavior.
+
+        Split the attribute getter function in two, one with the signature expected by JSCore and one used after casted-this checks.
+
+        The second function takes directly a JSXX object and returns a JSValue instead of an EncodedJSValue.
+        In the future, the second function should only take references.
+
+        Introducing BindingCaller as a way to templatize binding code used to cast thisValue with the desired JSXX value.
+        This allows implementing the first function using the second function as template parameter.
+
+        Introducing JSClass::castForAttribute as a way to encapsulate differences in the way to handle thisValue access.
+
+        * bindings/js/JSDOMBinding.h:
+        (WebCore::BindingCaller::attribute):
+        * bindings/scripts/CodeGeneratorJS.pm:
+        (GenerateHeader):
+        (GenerateImplementation):
+        * bindings/scripts/test/JS/JSTestActiveDOMObject.cpp:
+        * bindings/scripts/test/JS/JSTestActiveDOMObject.h:
+        * bindings/scripts/test/JS/JSTestEventConstructor.cpp:
+        * bindings/scripts/test/JS/JSTestEventConstructor.h:
+        * bindings/scripts/test/JS/JSTestException.cpp:
+        * bindings/scripts/test/JS/JSTestException.h:
+        * bindings/scripts/test/JS/JSTestGlobalObject.cpp:
+        * bindings/scripts/test/JS/JSTestInterface.cpp:
+        * bindings/scripts/test/JS/JSTestInterface.h:
+        * bindings/scripts/test/JS/JSTestJSBuiltinConstructor.cpp:
+        * bindings/scripts/test/JS/JSTestJSBuiltinConstructor.h:
+        * bindings/scripts/test/JS/JSTestNode.cpp:
+        * bindings/scripts/test/JS/JSTestNode.h:
+        * bindings/scripts/test/JS/JSTestNondeterministic.cpp:
+        * bindings/scripts/test/JS/JSTestNondeterministic.h:
+        * bindings/scripts/test/JS/JSTestObj.cpp:
+        * bindings/scripts/test/JS/JSTestObj.h:
+        * bindings/scripts/test/JS/JSTestSerializedScriptValueInterface.cpp:
+        * bindings/scripts/test/JS/JSTestSerializedScriptValueInterface.h:
+        * bindings/scripts/test/JS/JSTestTypedefs.cpp:
+        * bindings/scripts/test/JS/JSTestTypedefs.h:
+        * bindings/scripts/test/JS/JSattribute.cpp:
+        * bindings/scripts/test/JS/JSattribute.h:
+
 2016-10-08  Enrique Ocaña González  <eocanha@igalia.com>
 
         Missing include in MediaDescription
index 12bd1db..573652d 100644 (file)
@@ -382,6 +382,28 @@ struct VariadicHelper : public VariadicHelperBase<JSClass, DOMClass> {
 
 template<typename VariadicHelper> typename VariadicHelper::Result toArguments(JSC::ExecState&, size_t startIndex = 0);
 
+enum class CastedThisErrorBehavior { Throw, ReturnEarly };
+
+template<typename JSClass>
+struct BindingCaller {
+    using AttributeGetterFunction = JSC::JSValue(JSC::ExecState*, JSClass*, JSC::ThrowScope&);
+
+    template<AttributeGetterFunction getter, CastedThisErrorBehavior shouldThrow = CastedThisErrorBehavior::Throw>
+    static JSC::EncodedJSValue attribute(JSC::ExecState* state, JSC::EncodedJSValue thisValue, const char* attributeName)
+    {
+        ASSERT(state);
+        auto throwScope = DECLARE_THROW_SCOPE(state->vm());
+        auto* thisObject = JSClass::castForAttribute(state, thisValue);
+        if (UNLIKELY(!thisObject)) {
+            ASSERT(JSClass::info());
+            return shouldThrow == CastedThisErrorBehavior::Throw ?
+                throwGetterTypeError(*state, throwScope, JSClass::info()->className, attributeName) : JSC::JSValue::encode(JSC::jsUndefined());
+        }
+        // FIXME: We should refactor the binding generated code to use references for state and thisObject.
+        return JSC::JSValue::encode(getter(state, thisObject, throwScope));
+    }
+};
+
 // Inline functions and template definitions.
 
 inline JSC::Structure* DOMConstructorObject::createStructure(JSC::VM& vm, JSC::JSGlobalObject* globalObject, JSC::JSValue prototype)
index fb866c3..1e1ab5c 100644 (file)
@@ -1410,6 +1410,8 @@ sub GenerateHeader
 
     # Attribute and function enums
     if ($numAttributes > 0) {
+        push(@headerContent, "    static ${className}* castForAttribute(JSC::ExecState*, JSC::EncodedJSValue);\n");
+
         foreach (@{$interface->attributes}) {
             my $attribute = $_;
             $numCustomAttributes++ if HasCustomGetter($attribute->signature->extendedAttributes);
@@ -2403,12 +2405,12 @@ sub GenerateImplementation
         }
 
         push(@implContent, $endAppleCopyright) if $inAppleCopyright;
-
         push(@implContent, "\n");
     }
 
     if ($numAttributes > 0 || NeedsConstructorProperty($interface)) {
         push(@implContent, "// Attributes\n\n");
+
         foreach my $attribute (@{$interface->attributes}) {
             next if $attribute->signature->extendedAttributes->{ForwardDeclareInHeader};
             next if IsJSBuiltin($interface, $attribute);
@@ -2857,6 +2859,26 @@ sub GenerateImplementation
         }
 
     }
+
+    if ($numAttributes > 0) {
+        my $castingFunction = $interface->extendedAttributes->{"CustomProxyToJSObject"} ? "to${className}" : GetCastingHelperForThisObject($interface);
+        # FIXME: Remove ImplicitThis keyword as it is no longer defined by WebIDL spec and is only used in DOMWindow.
+        if ($interface->extendedAttributes->{"ImplicitThis"}) {
+            push(@implContent, "inline ${className}* ${className}::castForAttribute(ExecState* state, EncodedJSValue thisValue)\n");
+            push(@implContent, "{\n");
+            push(@implContent, "    JSValue decodedThisValue = JSValue::decode(thisValue);\n");
+            push(@implContent, "    if (decodedThisValue.isUndefinedOrNull())\n");
+            push(@implContent, "        decodedThisValue = state->thisValue().toThis(state, NotStrictMode);\n");
+            push(@implContent, "    return $castingFunction(decodedThisValue);\n");
+            push(@implContent, "}\n\n");
+        } else {
+            push(@implContent, "inline ${className}* ${className}::castForAttribute(JSC::ExecState*, EncodedJSValue thisValue)\n");
+            push(@implContent, "{\n");
+            push(@implContent, "    return $castingFunction(JSValue::decode(thisValue));\n");
+            push(@implContent, "}\n\n");
+        }
+    }
+
     $numAttributes = $numAttributes + 1 if NeedsConstructorProperty($interface);
     if ($numAttributes > 0) {
         foreach my $attribute (@{$interface->attributes}) {
@@ -2874,31 +2896,31 @@ sub GenerateImplementation
             my $attributeConditionalString = $codeGenerator->GenerateConditionalString($attribute->signature);
             push(@implContent, "#if ${attributeConditionalString}\n") if $attributeConditionalString;
 
-            push(@implContent, "EncodedJSValue ${getFunctionName}(ExecState* state, EncodedJSValue thisValue, PropertyName)\n");
-            push(@implContent, "{\n");
+            if (!$attribute->isStatic || $attribute->signature->type =~ /Constructor$/) {
+                my $templateParameters = "${getFunctionName}Getter";
+                $templateParameters .= ", CastedThisErrorBehavior::ReturnEarly" if ($attribute->signature->extendedAttributes->{LenientThis});
+                push(@implContent, "static inline JSValue ${getFunctionName}Getter(ExecState*, ${className}*, ThrowScope& throwScope);\n\n");
 
-            push(@implContent, "    VM& vm = state->vm();\n");
-            push(@implContent, "    auto throwScope = DECLARE_THROW_SCOPE(vm);\n");
-            push(@implContent, "    UNUSED_PARAM(throwScope);\n");
-            push(@implContent, "    UNUSED_PARAM(thisValue);\n");
+                push(@implContent, "EncodedJSValue ${getFunctionName}(ExecState* state, EncodedJSValue thisValue, PropertyName)\n");
+                push(@implContent, "{\n");
+                push(@implContent, "    return BindingCaller<${className}>::attribute<${templateParameters}>(state, thisValue, \"$name\");\n");
+                push(@implContent, "}\n\n");
 
-            if (!$attribute->isStatic || $attribute->signature->type =~ /Constructor$/) {
-                push(@implContent, "    JSValue decodedThisValue = JSValue::decode(thisValue);\n");
-                my $castingFunction = $interface->extendedAttributes->{CustomProxyToJSObject} ? "to${className}" : GetCastingHelperForThisObject($interface);
-                # http://heycam.github.io/webidl/#ImplicitThis
-                if ($interface->extendedAttributes->{ImplicitThis}) {
-                    push(@implContent, "    auto* castedThis = decodedThisValue.isUndefinedOrNull() ? $castingFunction(state->thisValue().toThis(state, NotStrictMode)) : $castingFunction(decodedThisValue);\n");
-                } else {
-                    push(@implContent, "    auto* castedThis = $castingFunction(decodedThisValue);\n");
-                }
-                push(@implContent, "    if (UNLIKELY(!castedThis)) {\n");
-                if ($attribute->signature->extendedAttributes->{LenientThis}) {
-                    push(@implContent, "        return JSValue::encode(jsUndefined());\n");
-                } else {
-                    push(@implContent, "        return throwGetterTypeError(*state, throwScope, \"$visibleInterfaceName\", \"$name\");\n");
-                }
-                push(@implContent, "    }\n");
+                push(@implContent, "static inline JSValue ${getFunctionName}Getter(ExecState* state, ${className}* thisObject, ThrowScope& throwScope)\n");
+                push(@implContent, "{\n");
+                push(@implContent, "    UNUSED_PARAM(throwScope);\n");
+            } else {
+                push(@implContent, "static inline JSValue ${getFunctionName}Getter(ExecState*);\n\n");
+
+                push(@implContent, "EncodedJSValue ${getFunctionName}(ExecState* state, EncodedJSValue, PropertyName)\n");
+                push(@implContent, "{\n");
+                push(@implContent, "    return JSValue::encode(${getFunctionName}Getter(state));\n");
+                push(@implContent, "}\n\n");
+
+                push(@implContent, "static inline JSValue ${getFunctionName}Getter(ExecState* state)\n");
+                push(@implContent, "{\n");
             }
+            push(@implContent, "    UNUSED_PARAM(state);\n");
 
             my @arguments = ();
             if ($getterMayThrowLegacyException && !HasCustomGetter($attribute->signature->extendedAttributes)) {
@@ -2916,11 +2938,11 @@ sub GenerateImplementation
                     AddToImplIncludes("Frame.h");
                     AddToImplIncludes("Settings.h");
                     my $enable_function = ToMethodName($attribute->signature->extendedAttributes->{EnabledBySetting}) . "Enabled";
-                    push(@implContent, "    if (UNLIKELY(!castedThis->wrapped().frame()))\n");
-                    push(@implContent, "        return JSValue::encode(jsUndefined());\n");
-                    push(@implContent, "    Settings& settings = castedThis->wrapped().frame()->settings();\n");
+                    push(@implContent, "    if (UNLIKELY(!thisObject->wrapped().frame()))\n");
+                    push(@implContent, "        return jsUndefined();\n");
+                    push(@implContent, "    Settings& settings = thisObject->wrapped().frame()->settings();\n");
                     push(@implContent, "    if (!settings.$enable_function())\n");
-                    push(@implContent, "        return JSValue::encode(jsUndefined());\n");
+                    push(@implContent, "        return jsUndefined();\n");
                 }
             }
 
@@ -2930,11 +2952,11 @@ sub GenerateImplementation
                 !$attribute->signature->extendedAttributes->{DoNotCheckSecurity} &&
                 !$attribute->signature->extendedAttributes->{DoNotCheckSecurityOnGetter}) {
                 if ($interfaceName eq "DOMWindow") {
-                    push(@implContent, "    if (!BindingSecurity::shouldAllowAccessToDOMWindow(state, castedThis->wrapped(), ThrowSecurityError))\n");
+                    push(@implContent, "    if (!BindingSecurity::shouldAllowAccessToDOMWindow(state, thisObject->wrapped(), ThrowSecurityError))\n");
                 } else {
-                    push(@implContent, "    if (!BindingSecurity::shouldAllowAccessToFrame(state, castedThis->wrapped().frame(), ThrowSecurityError))\n");
+                    push(@implContent, "    if (!BindingSecurity::shouldAllowAccessToFrame(state, thisObject->wrapped().frame(), ThrowSecurityError))\n");
                 }
-                push(@implContent, "        return JSValue::encode(jsUndefined());\n");
+                push(@implContent, "        return jsUndefined();\n");
             }
 
             if ($attribute->signature->extendedAttributes->{Nondeterministic}) {
@@ -2951,11 +2973,11 @@ sub GenerateImplementation
                 my $exceptionCode = $getterMayThrowLegacyExceptionWithMessage ? "ec.code" : ($getterMayThrowLegacyException ? "ec" : "0");
                 push(@implContent, "    static NeverDestroyed<const AtomicString> bindingName(\"$interfaceName.$name\", AtomicString::ConstructFromLiteral);\n");
                 push(@implContent, "    if (cursor.isCapturing()) {\n");
-                push(@implContent, "        $memoizedType memoizedResult = castedThis->wrapped().$implGetterFunctionName(" . join(", ", @arguments) . ");\n");
+                push(@implContent, "        $memoizedType memoizedResult = thisObject->wrapped().$implGetterFunctionName(" . join(", ", @arguments) . ");\n");
                 push(@implContent, "        cursor.appendInput<MemoizedDOMResult<$memoizedType>>(bindingName.get().string(), memoizedResult, $exceptionCode);\n");
-                push(@implContent, "        JSValue result = " . NativeToJSValue($attribute->signature, 0, $interface, "memoizedResult", "castedThis") . ";\n");
+                push(@implContent, "        JSValue result = " . NativeToJSValue($attribute->signature, 0, $interface, "memoizedResult", "thisObject") . ";\n");
                 push(@implContent, "        setDOMException(state, throwScope, ec);\n") if $getterMayThrowLegacyException;
-                push(@implContent, "        return JSValue::encode(result);\n");
+                push(@implContent, "        return result;\n");
                 push(@implContent, "    }\n");
                 push(@implContent, "\n");
                 push(@implContent, "    if (cursor.isReplaying()) {\n");
@@ -2963,60 +2985,59 @@ sub GenerateImplementation
                 push(@implContent, "        MemoizedDOMResultBase* input = cursor.fetchInput<MemoizedDOMResultBase>();\n");
                 push(@implContent, "        if (input && input->convertTo<$memoizedType>(memoizedResult)) {\n");
                 # FIXME: the generated code should report an error if an input cannot be fetched or converted.
-                push(@implContent, "            JSValue result = " . NativeToJSValue($attribute->signature, 0, $interface, "memoizedResult", "castedThis") . ";\n");
+                push(@implContent, "            JSValue result = " . NativeToJSValue($attribute->signature, 0, $interface, "memoizedResult", "thisObject") . ";\n");
                 push(@implContent, "            setDOMException(state, throwScope, input->exceptionCode());\n") if $getterMayThrowLegacyException;
-                push(@implContent, "            return JSValue::encode(result);\n");
+                push(@implContent, "            return result;\n");
                 push(@implContent, "        }\n");
                 push(@implContent, "    }\n");
                 push(@implContent, "#endif\n");
             } # attribute Nondeterministic
 
             if (HasCustomGetter($attribute->signature->extendedAttributes)) {
-                push(@implContent, "    return JSValue::encode(castedThis->$implGetterFunctionName(*state));\n");
+                push(@implContent, "    return thisObject->$implGetterFunctionName(*state);\n");
             } elsif ($attribute->signature->extendedAttributes->{CheckSecurityForNode}) {
                 $implIncludes{"JSDOMBinding.h"} = 1;
-                push(@implContent, "    auto& impl = castedThis->wrapped();\n");
-                push(@implContent, "    return JSValue::encode(shouldAllowAccessToNode(state, impl." . $attribute->signature->name . "()) ? " . NativeToJSValue($attribute->signature, 0, $interface, "impl.$implGetterFunctionName()", "castedThis") . " : jsNull());\n");
+                push(@implContent, "    auto& impl = thisObject->wrapped();\n");
+                push(@implContent, "    return shouldAllowAccessToNode(state, impl." . $attribute->signature->name . "()) ? " . NativeToJSValue($attribute->signature, 0, $interface, "impl.$implGetterFunctionName()", "thisObject") . " : jsNull();\n");
             } elsif ($type eq "EventHandler") {
                 $implIncludes{"EventNames.h"} = 1;
                 my $getter = $attribute->signature->extendedAttributes->{WindowEventHandler} ? "windowEventHandlerAttribute"
                     : $attribute->signature->extendedAttributes->{DocumentEventHandler} ? "documentEventHandlerAttribute"
                     : "eventHandlerAttribute";
                 my $eventName = EventHandlerAttributeEventName($attribute);
-                push(@implContent, "    UNUSED_PARAM(state);\n");
-                push(@implContent, "    return JSValue::encode($getter(castedThis->wrapped(), $eventName));\n");
+                push(@implContent, "    return $getter(thisObject->wrapped(), $eventName);\n");
             } elsif ($attribute->signature->type =~ /Constructor$/) {
                 my $constructorType = $attribute->signature->type;
                 $constructorType =~ s/Constructor$//;
-                # When Constructor attribute is used by DOMWindow.idl, it's correct to pass castedThis as the global object
-                # When JSDOMWrappers have a back-pointer to the globalObject we can pass castedThis->globalObject()
+                # When Constructor attribute is used by DOMWindow.idl, it's correct to pass thisObject as the global object
+                # When JSDOMWrappers have a back-pointer to the globalObject we can pass thisObject->globalObject()
                 if ($interfaceName eq "DOMWindow") {
                     my $named = ($constructorType =~ /Named$/) ? "Named" : "";
                     $constructorType =~ s/Named$//;
-                    push(@implContent, "    return JSValue::encode(JS" . $constructorType . "::get${named}Constructor(state->vm(), castedThis));\n");
+                    push(@implContent, "    return JS" . $constructorType . "::get${named}Constructor(state->vm(), thisObject);\n");
                 } else {
                     AddToImplIncludes("JS" . $constructorType . ".h", $attribute->signature->extendedAttributes->{Conditional});
-                    push(@implContent, "    return JSValue::encode(JS" . $constructorType . "::getConstructor(state->vm(), castedThis->globalObject()));\n");
+                    push(@implContent, "    return JS" . $constructorType . "::getConstructor(state->vm(), thisObject->globalObject());\n");
                 }
             } elsif (!$attribute->signature->extendedAttributes->{GetterMayThrowLegacyException} && !$attribute->signature->extendedAttributes->{GetterMayThrowLegacyExceptionWithMessage}) {
                 my $cacheIndex = 0;
                 if ($attribute->signature->extendedAttributes->{CachedAttribute}) {
                     $cacheIndex = $currentCachedAttribute;
                     $currentCachedAttribute++;
-                    push(@implContent, "    if (JSValue cachedValue = castedThis->m_" . $attribute->signature->name . ".get())\n");
-                    push(@implContent, "        return JSValue::encode(cachedValue);\n");
+                    push(@implContent, "    if (JSValue cachedValue = thisObject->m_" . $attribute->signature->name . ".get())\n");
+                    push(@implContent, "        return cachedValue;\n");
                 }
 
-                my @callWithArgs = GenerateCallWith($attribute->signature->extendedAttributes->{CallWith}, \@implContent, "JSValue::encode(jsUndefined())");
+                my @callWithArgs = GenerateCallWith($attribute->signature->extendedAttributes->{CallWith}, \@implContent, "jsUndefined()");
 
                 if ($svgListPropertyType) {
-                    push(@implContent, "    JSValue result =  " . NativeToJSValue($attribute->signature, 0, $interface, "castedThis->wrapped().$implGetterFunctionName(" . (join ", ", @callWithArgs) . ")", "castedThis") . ";\n");
+                    push(@implContent, "    JSValue result =  " . NativeToJSValue($attribute->signature, 0, $interface, "thisObject->wrapped().$implGetterFunctionName(" . (join ", ", @callWithArgs) . ")", "thisObject") . ";\n");
                 } elsif ($svgPropertyOrListPropertyType) {
-                    push(@implContent, "    $svgPropertyOrListPropertyType& impl = castedThis->wrapped().propertyReference();\n");
+                    push(@implContent, "    $svgPropertyOrListPropertyType& impl = thisObject->wrapped().propertyReference();\n");
                     if ($svgPropertyOrListPropertyType eq "float") { # Special case for JSSVGNumber
-                        push(@implContent, "    JSValue result = " . NativeToJSValue($attribute->signature, 0, $interface, "impl", "castedThis") . ";\n");
+                        push(@implContent, "    JSValue result = " . NativeToJSValue($attribute->signature, 0, $interface, "impl", "thisObject") . ";\n");
                     } else {
-                        push(@implContent, "    JSValue result = " . NativeToJSValue($attribute->signature, 0, $interface, "impl.$implGetterFunctionName(" . (join ", ", @callWithArgs) . ")", "castedThis") . ";\n");
+                        push(@implContent, "    JSValue result = " . NativeToJSValue($attribute->signature, 0, $interface, "impl.$implGetterFunctionName(" . (join ", ", @callWithArgs) . ")", "thisObject") . ";\n");
 
                     }
                 } else {
@@ -3033,40 +3054,38 @@ sub GenerateImplementation
                     }
 
                     unshift(@arguments, @callWithArgs);
-                    my $jsType = NativeToJSValue($attribute->signature, 0, $interface, "${functionName}(" . join(", ", @arguments) . ")", "castedThis");
-                    push(@implContent, "    auto& impl = castedThis->wrapped();\n") if !$attribute->isStatic;
+                    my $jsType = NativeToJSValue($attribute->signature, 0, $interface, "${functionName}(" . join(", ", @arguments) . ")", "thisObject");
+                    push(@implContent, "    auto& impl = thisObject->wrapped();\n") if !$attribute->isStatic;
                     if ($codeGenerator->IsSVGAnimatedType($type)) {
                         push(@implContent, "    auto obj = $jsType;\n");
-                        push(@implContent, "    JSValue result = toJS(state, castedThis->globalObject(), obj.get());\n");
+                        push(@implContent, "    JSValue result = toJS(state, thisObject->globalObject(), obj.get());\n");
                     } else {
                         push(@implContent, "    JSValue result = $jsType;\n");
                     }
                 }
 
-                push(@implContent, "    castedThis->m_" . $attribute->signature->name . ".set(state->vm(), castedThis, result);\n") if $attribute->signature->extendedAttributes->{CachedAttribute};
-                push(@implContent, "    return JSValue::encode(result);\n");
+                push(@implContent, "    thisObject->m_" . $attribute->signature->name . ".set(state->vm(), thisObject, result);\n") if $attribute->signature->extendedAttributes->{CachedAttribute};
+                push(@implContent, "    return result;\n");
 
             } else {
-                unshift(@arguments, GenerateCallWith($attribute->signature->extendedAttributes->{CallWith}, \@implContent, "JSValue::encode(jsUndefined())"));
+                unshift(@arguments, GenerateCallWith($attribute->signature->extendedAttributes->{CallWith}, \@implContent, "jsUndefined()"));
 
                 if ($svgPropertyOrListPropertyType) {
-                    push(@implContent, "    $svgPropertyOrListPropertyType impl(*castedThis->wrapped());\n");
-                    push(@implContent, "    JSValue result = " . NativeToJSValue($attribute->signature, 0, $interface, "impl.$implGetterFunctionName(" . join(", ", @arguments) . ")", "castedThis") . ";\n");
+                    push(@implContent, "    $svgPropertyOrListPropertyType impl(*thisObject->wrapped());\n");
+                    push(@implContent, "    JSValue result = " . NativeToJSValue($attribute->signature, 0, $interface, "impl.$implGetterFunctionName(" . join(", ", @arguments) . ")", "thisObject") . ";\n");
                 } else {
-                    push(@implContent, "    auto& impl = castedThis->wrapped();\n");
-                    push(@implContent, "    JSValue result = " . NativeToJSValue($attribute->signature, 0, $interface, "impl.$implGetterFunctionName(" . join(", ", @arguments) . ")", "castedThis") . ";\n");
+                    push(@implContent, "    auto& impl = thisObject->wrapped();\n");
+                    push(@implContent, "    JSValue result = " . NativeToJSValue($attribute->signature, 0, $interface, "impl.$implGetterFunctionName(" . join(", ", @arguments) . ")", "thisObject") . ";\n");
                 }
 
                 push(@implContent, "    setDOMException(state, throwScope, ec);\n");
 
-                push(@implContent, "    return JSValue::encode(result);\n");
+                push(@implContent, "    return result;\n");
             }
 
             push(@implContent, "}\n\n");
 
-            push(@implContent, "#endif\n") if $attributeConditionalString;
-
-            push(@implContent, "\n");
+            push(@implContent, "#endif\n\n") if $attributeConditionalString;
         }
 
         if (NeedsConstructorProperty($interface)) {
index ae7c1dd..d218d0e 100644 (file)
@@ -140,25 +140,29 @@ void JSTestActiveDOMObject::destroy(JSC::JSCell* cell)
     thisObject->JSTestActiveDOMObject::~JSTestActiveDOMObject();
 }
 
+inline JSTestActiveDOMObject* JSTestActiveDOMObject::castForAttribute(JSC::ExecState*, EncodedJSValue thisValue)
+{
+    return jsDynamicCast<JSTestActiveDOMObject*>(JSValue::decode(thisValue));
+}
+
+static inline JSValue jsTestActiveDOMObjectExcitingAttrGetter(ExecState*, JSTestActiveDOMObject*, ThrowScope& throwScope);
+
 EncodedJSValue jsTestActiveDOMObjectExcitingAttr(ExecState* state, EncodedJSValue thisValue, PropertyName)
 {
-    VM& vm = state->vm();
-    auto throwScope = DECLARE_THROW_SCOPE(vm);
+    return BindingCaller<JSTestActiveDOMObject>::attribute<jsTestActiveDOMObjectExcitingAttrGetter>(state, thisValue, "excitingAttr");
+}
+
+static inline JSValue jsTestActiveDOMObjectExcitingAttrGetter(ExecState* state, JSTestActiveDOMObject* thisObject, ThrowScope& throwScope)
+{
     UNUSED_PARAM(throwScope);
-    UNUSED_PARAM(thisValue);
-    JSValue decodedThisValue = JSValue::decode(thisValue);
-    auto* castedThis = jsDynamicCast<JSTestActiveDOMObject*>(decodedThisValue);
-    if (UNLIKELY(!castedThis)) {
-        return throwGetterTypeError(*state, throwScope, "TestActiveDOMObject", "excitingAttr");
-    }
-    if (!BindingSecurity::shouldAllowAccessToFrame(state, castedThis->wrapped().frame(), ThrowSecurityError))
-        return JSValue::encode(jsUndefined());
-    auto& impl = castedThis->wrapped();
+    UNUSED_PARAM(state);
+    if (!BindingSecurity::shouldAllowAccessToFrame(state, thisObject->wrapped().frame(), ThrowSecurityError))
+        return jsUndefined();
+    auto& impl = thisObject->wrapped();
     JSValue result = jsNumber(impl.excitingAttr());
-    return JSValue::encode(result);
+    return result;
 }
 
-
 EncodedJSValue jsTestActiveDOMObjectConstructor(ExecState* state, EncodedJSValue thisValue, PropertyName)
 {
     VM& vm = state->vm();
index 40d5a27..7a5ceb8 100644 (file)
@@ -49,6 +49,7 @@ public:
     }
 
     static JSC::JSValue getConstructor(JSC::VM&, const JSC::JSGlobalObject*);
+    static JSTestActiveDOMObject* castForAttribute(JSC::ExecState*, JSC::EncodedJSValue);
 public:
     static const unsigned StructureFlags = JSC::HasStaticPropertyTable | Base::StructureFlags;
 protected:
index 88f835d..3a45c28 100644 (file)
@@ -178,55 +178,58 @@ void JSTestEventConstructor::destroy(JSC::JSCell* cell)
     thisObject->JSTestEventConstructor::~JSTestEventConstructor();
 }
 
+inline JSTestEventConstructor* JSTestEventConstructor::castForAttribute(JSC::ExecState*, EncodedJSValue thisValue)
+{
+    return jsDynamicCast<JSTestEventConstructor*>(JSValue::decode(thisValue));
+}
+
+static inline JSValue jsTestEventConstructorAttr1Getter(ExecState*, JSTestEventConstructor*, ThrowScope& throwScope);
+
 EncodedJSValue jsTestEventConstructorAttr1(ExecState* state, EncodedJSValue thisValue, PropertyName)
 {
-    VM& vm = state->vm();
-    auto throwScope = DECLARE_THROW_SCOPE(vm);
+    return BindingCaller<JSTestEventConstructor>::attribute<jsTestEventConstructorAttr1Getter>(state, thisValue, "attr1");
+}
+
+static inline JSValue jsTestEventConstructorAttr1Getter(ExecState* state, JSTestEventConstructor* thisObject, ThrowScope& throwScope)
+{
     UNUSED_PARAM(throwScope);
-    UNUSED_PARAM(thisValue);
-    JSValue decodedThisValue = JSValue::decode(thisValue);
-    auto* castedThis = jsDynamicCast<JSTestEventConstructor*>(decodedThisValue);
-    if (UNLIKELY(!castedThis)) {
-        return throwGetterTypeError(*state, throwScope, "TestEventConstructor", "attr1");
-    }
-    auto& impl = castedThis->wrapped();
+    UNUSED_PARAM(state);
+    auto& impl = thisObject->wrapped();
     JSValue result = jsStringWithCache(state, impl.attr1());
-    return JSValue::encode(result);
+    return result;
 }
 
+static inline JSValue jsTestEventConstructorAttr2Getter(ExecState*, JSTestEventConstructor*, ThrowScope& throwScope);
 
 EncodedJSValue jsTestEventConstructorAttr2(ExecState* state, EncodedJSValue thisValue, PropertyName)
 {
-    VM& vm = state->vm();
-    auto throwScope = DECLARE_THROW_SCOPE(vm);
+    return BindingCaller<JSTestEventConstructor>::attribute<jsTestEventConstructorAttr2Getter>(state, thisValue, "attr2");
+}
+
+static inline JSValue jsTestEventConstructorAttr2Getter(ExecState* state, JSTestEventConstructor* thisObject, ThrowScope& throwScope)
+{
     UNUSED_PARAM(throwScope);
-    UNUSED_PARAM(thisValue);
-    JSValue decodedThisValue = JSValue::decode(thisValue);
-    auto* castedThis = jsDynamicCast<JSTestEventConstructor*>(decodedThisValue);
-    if (UNLIKELY(!castedThis)) {
-        return throwGetterTypeError(*state, throwScope, "TestEventConstructor", "attr2");
-    }
-    auto& impl = castedThis->wrapped();
+    UNUSED_PARAM(state);
+    auto& impl = thisObject->wrapped();
     JSValue result = jsStringWithCache(state, impl.attr2());
-    return JSValue::encode(result);
+    return result;
 }
 
-
 #if ENABLE(SPECIAL_EVENT)
+static inline JSValue jsTestEventConstructorAttr3Getter(ExecState*, JSTestEventConstructor*, ThrowScope& throwScope);
+
 EncodedJSValue jsTestEventConstructorAttr3(ExecState* state, EncodedJSValue thisValue, PropertyName)
 {
-    VM& vm = state->vm();
-    auto throwScope = DECLARE_THROW_SCOPE(vm);
+    return BindingCaller<JSTestEventConstructor>::attribute<jsTestEventConstructorAttr3Getter>(state, thisValue, "attr3");
+}
+
+static inline JSValue jsTestEventConstructorAttr3Getter(ExecState* state, JSTestEventConstructor* thisObject, ThrowScope& throwScope)
+{
     UNUSED_PARAM(throwScope);
-    UNUSED_PARAM(thisValue);
-    JSValue decodedThisValue = JSValue::decode(thisValue);
-    auto* castedThis = jsDynamicCast<JSTestEventConstructor*>(decodedThisValue);
-    if (UNLIKELY(!castedThis)) {
-        return throwGetterTypeError(*state, throwScope, "TestEventConstructor", "attr3");
-    }
-    auto& impl = castedThis->wrapped();
+    UNUSED_PARAM(state);
+    auto& impl = thisObject->wrapped();
     JSValue result = jsStringWithCache(state, impl.attr3());
-    return JSValue::encode(result);
+    return result;
 }
 
 #endif
index d7abe71..facd106 100644 (file)
@@ -51,6 +51,7 @@ public:
     }
 
     static JSC::JSValue getConstructor(JSC::VM&, const JSC::JSGlobalObject*);
+    static JSTestEventConstructor* castForAttribute(JSC::ExecState*, JSC::EncodedJSValue);
 protected:
     JSTestEventConstructor(JSC::Structure*, JSDOMGlobalObject&, Ref<TestEventConstructor>&&);
 
index 150f2cb..31c6ae9 100644 (file)
@@ -132,23 +132,27 @@ void JSTestException::destroy(JSC::JSCell* cell)
     thisObject->JSTestException::~JSTestException();
 }
 
+inline JSTestException* JSTestException::castForAttribute(JSC::ExecState*, EncodedJSValue thisValue)
+{
+    return jsDynamicCast<JSTestException*>(JSValue::decode(thisValue));
+}
+
+static inline JSValue jsTestExceptionNameGetter(ExecState*, JSTestException*, ThrowScope& throwScope);
+
 EncodedJSValue jsTestExceptionName(ExecState* state, EncodedJSValue thisValue, PropertyName)
 {
-    VM& vm = state->vm();
-    auto throwScope = DECLARE_THROW_SCOPE(vm);
+    return BindingCaller<JSTestException>::attribute<jsTestExceptionNameGetter>(state, thisValue, "name");
+}
+
+static inline JSValue jsTestExceptionNameGetter(ExecState* state, JSTestException* thisObject, ThrowScope& throwScope)
+{
     UNUSED_PARAM(throwScope);
-    UNUSED_PARAM(thisValue);
-    JSValue decodedThisValue = JSValue::decode(thisValue);
-    auto* castedThis = jsDynamicCast<JSTestException*>(decodedThisValue);
-    if (UNLIKELY(!castedThis)) {
-        return throwGetterTypeError(*state, throwScope, "TestException", "name");
-    }
-    auto& impl = castedThis->wrapped();
+    UNUSED_PARAM(state);
+    auto& impl = thisObject->wrapped();
     JSValue result = jsStringWithCache(state, impl.name());
-    return JSValue::encode(result);
+    return result;
 }
 
-
 EncodedJSValue jsTestExceptionConstructor(ExecState* state, EncodedJSValue thisValue, PropertyName)
 {
     VM& vm = state->vm();
index 372e5d4..d71a6b6 100644 (file)
@@ -50,6 +50,7 @@ public:
     }
 
     static JSC::JSValue getConstructor(JSC::VM&, const JSC::JSGlobalObject*);
+    static JSTestException* castForAttribute(JSC::ExecState*, JSC::EncodedJSValue);
 public:
     static const unsigned StructureFlags = JSC::HasStaticPropertyTable | Base::StructureFlags;
 protected:
index d1d3c18..22a52b0 100644 (file)
@@ -177,74 +177,77 @@ void JSTestGlobalObject::destroy(JSC::JSCell* cell)
     thisObject->JSTestGlobalObject::~JSTestGlobalObject();
 }
 
+inline JSTestGlobalObject* JSTestGlobalObject::castForAttribute(JSC::ExecState*, EncodedJSValue thisValue)
+{
+    return jsDynamicCast<JSTestGlobalObject*>(JSValue::decode(thisValue));
+}
+
+static inline JSValue jsTestGlobalObjectRegularAttributeGetter(ExecState*, JSTestGlobalObject*, ThrowScope& throwScope);
+
 EncodedJSValue jsTestGlobalObjectRegularAttribute(ExecState* state, EncodedJSValue thisValue, PropertyName)
 {
-    VM& vm = state->vm();
-    auto throwScope = DECLARE_THROW_SCOPE(vm);
+    return BindingCaller<JSTestGlobalObject>::attribute<jsTestGlobalObjectRegularAttributeGetter>(state, thisValue, "regularAttribute");
+}
+
+static inline JSValue jsTestGlobalObjectRegularAttributeGetter(ExecState* state, JSTestGlobalObject* thisObject, ThrowScope& throwScope)
+{
     UNUSED_PARAM(throwScope);
-    UNUSED_PARAM(thisValue);
-    JSValue decodedThisValue = JSValue::decode(thisValue);
-    auto* castedThis = jsDynamicCast<JSTestGlobalObject*>(decodedThisValue);
-    if (UNLIKELY(!castedThis)) {
-        return throwGetterTypeError(*state, throwScope, "TestGlobalObject", "regularAttribute");
-    }
-    auto& impl = castedThis->wrapped();
+    UNUSED_PARAM(state);
+    auto& impl = thisObject->wrapped();
     JSValue result = jsStringWithCache(state, impl.regularAttribute());
-    return JSValue::encode(result);
+    return result;
 }
 
+static inline JSValue jsTestGlobalObjectPublicAndPrivateAttributeGetter(ExecState*, JSTestGlobalObject*, ThrowScope& throwScope);
 
 EncodedJSValue jsTestGlobalObjectPublicAndPrivateAttribute(ExecState* state, EncodedJSValue thisValue, PropertyName)
 {
-    VM& vm = state->vm();
-    auto throwScope = DECLARE_THROW_SCOPE(vm);
+    return BindingCaller<JSTestGlobalObject>::attribute<jsTestGlobalObjectPublicAndPrivateAttributeGetter>(state, thisValue, "publicAndPrivateAttribute");
+}
+
+static inline JSValue jsTestGlobalObjectPublicAndPrivateAttributeGetter(ExecState* state, JSTestGlobalObject* thisObject, ThrowScope& throwScope)
+{
     UNUSED_PARAM(throwScope);
-    UNUSED_PARAM(thisValue);
-    JSValue decodedThisValue = JSValue::decode(thisValue);
-    auto* castedThis = jsDynamicCast<JSTestGlobalObject*>(decodedThisValue);
-    if (UNLIKELY(!castedThis)) {
-        return throwGetterTypeError(*state, throwScope, "TestGlobalObject", "publicAndPrivateAttribute");
-    }
-    auto& impl = castedThis->wrapped();
+    UNUSED_PARAM(state);
+    auto& impl = thisObject->wrapped();
     JSValue result = jsStringWithCache(state, impl.publicAndPrivateAttribute());
-    return JSValue::encode(result);
+    return result;
 }
 
-
 #if ENABLE(TEST_FEATURE)
+static inline JSValue jsTestGlobalObjectPublicAndPrivateConditionalAttributeGetter(ExecState*, JSTestGlobalObject*, ThrowScope& throwScope);
+
 EncodedJSValue jsTestGlobalObjectPublicAndPrivateConditionalAttribute(ExecState* state, EncodedJSValue thisValue, PropertyName)
 {
-    VM& vm = state->vm();
-    auto throwScope = DECLARE_THROW_SCOPE(vm);
+    return BindingCaller<JSTestGlobalObject>::attribute<jsTestGlobalObjectPublicAndPrivateConditionalAttributeGetter>(state, thisValue, "publicAndPrivateConditionalAttribute");
+}
+
+static inline JSValue jsTestGlobalObjectPublicAndPrivateConditionalAttributeGetter(ExecState* state, JSTestGlobalObject* thisObject, ThrowScope& throwScope)
+{
     UNUSED_PARAM(throwScope);
-    UNUSED_PARAM(thisValue);
-    JSValue decodedThisValue = JSValue::decode(thisValue);
-    auto* castedThis = jsDynamicCast<JSTestGlobalObject*>(decodedThisValue);
-    if (UNLIKELY(!castedThis)) {
-        return throwGetterTypeError(*state, throwScope, "TestGlobalObject", "publicAndPrivateConditionalAttribute");
-    }
-    auto& impl = castedThis->wrapped();
+    UNUSED_PARAM(state);
+    auto& impl = thisObject->wrapped();
     JSValue result = jsStringWithCache(state, impl.publicAndPrivateConditionalAttribute());
-    return JSValue::encode(result);
+    return result;
 }
 
 #endif
 
 #if ENABLE(TEST_FEATURE)
+static inline JSValue jsTestGlobalObjectEnabledAtRuntimeAttributeGetter(ExecState*, JSTestGlobalObject*, ThrowScope& throwScope);
+
 EncodedJSValue jsTestGlobalObjectEnabledAtRuntimeAttribute(ExecState* state, EncodedJSValue thisValue, PropertyName)
 {
-    VM& vm = state->vm();
-    auto throwScope = DECLARE_THROW_SCOPE(vm);
+    return BindingCaller<JSTestGlobalObject>::attribute<jsTestGlobalObjectEnabledAtRuntimeAttributeGetter>(state, thisValue, "enabledAtRuntimeAttribute");
+}
+
+static inline JSValue jsTestGlobalObjectEnabledAtRuntimeAttributeGetter(ExecState* state, JSTestGlobalObject* thisObject, ThrowScope& throwScope)
+{
     UNUSED_PARAM(throwScope);
-    UNUSED_PARAM(thisValue);
-    JSValue decodedThisValue = JSValue::decode(thisValue);
-    auto* castedThis = jsDynamicCast<JSTestGlobalObject*>(decodedThisValue);
-    if (UNLIKELY(!castedThis)) {
-        return throwGetterTypeError(*state, throwScope, "TestGlobalObject", "enabledAtRuntimeAttribute");
-    }
-    auto& impl = castedThis->wrapped();
+    UNUSED_PARAM(state);
+    auto& impl = thisObject->wrapped();
     JSValue result = jsStringWithCache(state, impl.enabledAtRuntimeAttribute());
-    return JSValue::encode(result);
+    return result;
 }
 
 #endif
index 27842e1..f5c9279 100644 (file)
@@ -51,6 +51,7 @@ public:
     }
 
     static JSC::JSValue getConstructor(JSC::VM&, const JSC::JSGlobalObject*);
+    static JSTestGlobalObject* castForAttribute(JSC::ExecState*, JSC::EncodedJSValue);
 public:
     static const unsigned StructureFlags = JSC::HasStaticPropertyTable | Base::StructureFlags;
 protected:
index 7acc37e..946ade0 100644 (file)
@@ -410,202 +410,223 @@ void JSTestInterface::destroy(JSC::JSCell* cell)
     thisObject->JSTestInterface::~JSTestInterface();
 }
 
+inline JSTestInterface* JSTestInterface::castForAttribute(JSC::ExecState*, EncodedJSValue thisValue)
+{
+    return jsDynamicCast<JSTestInterface*>(JSValue::decode(thisValue));
+}
+
 #if ENABLE(Condition22) || ENABLE(Condition23)
-EncodedJSValue jsTestInterfaceConstructorImplementsStaticReadOnlyAttr(ExecState* state, EncodedJSValue thisValue, PropertyName)
+static inline JSValue jsTestInterfaceConstructorImplementsStaticReadOnlyAttrGetter(ExecState*);
+
+EncodedJSValue jsTestInterfaceConstructorImplementsStaticReadOnlyAttr(ExecState* state, EncodedJSValue, PropertyName)
 {
-    VM& vm = state->vm();
-    auto throwScope = DECLARE_THROW_SCOPE(vm);
-    UNUSED_PARAM(throwScope);
-    UNUSED_PARAM(thisValue);
+    return JSValue::encode(jsTestInterfaceConstructorImplementsStaticReadOnlyAttrGetter(state));
+}
+
+static inline JSValue jsTestInterfaceConstructorImplementsStaticReadOnlyAttrGetter(ExecState* state)
+{
+    UNUSED_PARAM(state);
     JSValue result = jsNumber(TestInterface::implementsStaticReadOnlyAttr());
-    return JSValue::encode(result);
+    return result;
 }
 
 #endif
 
 #if ENABLE(Condition22) || ENABLE(Condition23)
-EncodedJSValue jsTestInterfaceConstructorImplementsStaticAttr(ExecState* state, EncodedJSValue thisValue, PropertyName)
+static inline JSValue jsTestInterfaceConstructorImplementsStaticAttrGetter(ExecState*);
+
+EncodedJSValue jsTestInterfaceConstructorImplementsStaticAttr(ExecState* state, EncodedJSValue, PropertyName)
 {
-    VM& vm = state->vm();
-    auto throwScope = DECLARE_THROW_SCOPE(vm);
-    UNUSED_PARAM(throwScope);
-    UNUSED_PARAM(thisValue);
+    return JSValue::encode(jsTestInterfaceConstructorImplementsStaticAttrGetter(state));
+}
+
+static inline JSValue jsTestInterfaceConstructorImplementsStaticAttrGetter(ExecState* state)
+{
+    UNUSED_PARAM(state);
     JSValue result = jsStringWithCache(state, TestInterface::implementsStaticAttr());
-    return JSValue::encode(result);
+    return result;
 }
 
 #endif
 
 #if ENABLE(Condition22) || ENABLE(Condition23)
+static inline JSValue jsTestInterfaceImplementsStr1Getter(ExecState*, JSTestInterface*, ThrowScope& throwScope);
+
 EncodedJSValue jsTestInterfaceImplementsStr1(ExecState* state, EncodedJSValue thisValue, PropertyName)
 {
-    VM& vm = state->vm();
-    auto throwScope = DECLARE_THROW_SCOPE(vm);
+    return BindingCaller<JSTestInterface>::attribute<jsTestInterfaceImplementsStr1Getter>(state, thisValue, "implementsStr1");
+}
+
+static inline JSValue jsTestInterfaceImplementsStr1Getter(ExecState* state, JSTestInterface* thisObject, ThrowScope& throwScope)
+{
     UNUSED_PARAM(throwScope);
-    UNUSED_PARAM(thisValue);
-    JSValue decodedThisValue = JSValue::decode(thisValue);
-    auto* castedThis = jsDynamicCast<JSTestInterface*>(decodedThisValue);
-    if (UNLIKELY(!castedThis)) {
-        return throwGetterTypeError(*state, throwScope, "TestInterface", "implementsStr1");
-    }
-    auto& impl = castedThis->wrapped();
+    UNUSED_PARAM(state);
+    auto& impl = thisObject->wrapped();
     JSValue result = jsStringWithCache(state, impl.implementsStr1());
-    return JSValue::encode(result);
+    return result;
 }
 
 #endif
 
 #if ENABLE(Condition22) || ENABLE(Condition23)
+static inline JSValue jsTestInterfaceImplementsStr2Getter(ExecState*, JSTestInterface*, ThrowScope& throwScope);
+
 EncodedJSValue jsTestInterfaceImplementsStr2(ExecState* state, EncodedJSValue thisValue, PropertyName)
 {
-    VM& vm = state->vm();
-    auto throwScope = DECLARE_THROW_SCOPE(vm);
+    return BindingCaller<JSTestInterface>::attribute<jsTestInterfaceImplementsStr2Getter>(state, thisValue, "implementsStr2");
+}
+
+static inline JSValue jsTestInterfaceImplementsStr2Getter(ExecState* state, JSTestInterface* thisObject, ThrowScope& throwScope)
+{
     UNUSED_PARAM(throwScope);
-    UNUSED_PARAM(thisValue);
-    JSValue decodedThisValue = JSValue::decode(thisValue);
-    auto* castedThis = jsDynamicCast<JSTestInterface*>(decodedThisValue);
-    if (UNLIKELY(!castedThis)) {
-        return throwGetterTypeError(*state, throwScope, "TestInterface", "implementsStr2");
-    }
-    auto& impl = castedThis->wrapped();
+    UNUSED_PARAM(state);
+    auto& impl = thisObject->wrapped();
     JSValue result = jsStringWithCache(state, impl.implementsStr2());
-    return JSValue::encode(result);
+    return result;
 }
 
 #endif
 
 #if ENABLE(Condition22) || ENABLE(Condition23)
+static inline JSValue jsTestInterfaceImplementsStr3Getter(ExecState*, JSTestInterface*, ThrowScope& throwScope);
+
 EncodedJSValue jsTestInterfaceImplementsStr3(ExecState* state, EncodedJSValue thisValue, PropertyName)
 {
-    VM& vm = state->vm();
-    auto throwScope = DECLARE_THROW_SCOPE(vm);
+    return BindingCaller<JSTestInterface>::attribute<jsTestInterfaceImplementsStr3Getter>(state, thisValue, "implementsStr3");
+}
+
+static inline JSValue jsTestInterfaceImplementsStr3Getter(ExecState* state, JSTestInterface* thisObject, ThrowScope& throwScope)
+{
     UNUSED_PARAM(throwScope);
-    UNUSED_PARAM(thisValue);
-    JSValue decodedThisValue = JSValue::decode(thisValue);
-    auto* castedThis = jsDynamicCast<JSTestInterface*>(decodedThisValue);
-    if (UNLIKELY(!castedThis)) {
-        return throwGetterTypeError(*state, throwScope, "TestInterface", "implementsStr3");
-    }
-    return JSValue::encode(castedThis->implementsStr3(*state));
+    UNUSED_PARAM(state);
+    return thisObject->implementsStr3(*state);
 }
 
 #endif
 
 #if ENABLE(Condition22) || ENABLE(Condition23)
+static inline JSValue jsTestInterfaceImplementsNodeGetter(ExecState*, JSTestInterface*, ThrowScope& throwScope);
+
 EncodedJSValue jsTestInterfaceImplementsNode(ExecState* state, EncodedJSValue thisValue, PropertyName)
 {
-    VM& vm = state->vm();
-    auto throwScope = DECLARE_THROW_SCOPE(vm);
+    return BindingCaller<JSTestInterface>::attribute<jsTestInterfaceImplementsNodeGetter>(state, thisValue, "implementsNode");
+}
+
+static inline JSValue jsTestInterfaceImplementsNodeGetter(ExecState* state, JSTestInterface* thisObject, ThrowScope& throwScope)
+{
     UNUSED_PARAM(throwScope);
-    UNUSED_PARAM(thisValue);
-    JSValue decodedThisValue = JSValue::decode(thisValue);
-    auto* castedThis = jsDynamicCast<JSTestInterface*>(decodedThisValue);
-    if (UNLIKELY(!castedThis)) {
-        return throwGetterTypeError(*state, throwScope, "TestInterface", "implementsNode");
-    }
-    auto& impl = castedThis->wrapped();
-    JSValue result = toJS(state, castedThis->globalObject(), impl.implementsNode());
-    return JSValue::encode(result);
+    UNUSED_PARAM(state);
+    auto& impl = thisObject->wrapped();
+    JSValue result = toJS(state, thisObject->globalObject(), impl.implementsNode());
+    return result;
 }
 
 #endif
 
 #if ENABLE(Condition11) || ENABLE(Condition12)
-EncodedJSValue jsTestInterfaceConstructorSupplementalStaticReadOnlyAttr(ExecState* state, EncodedJSValue thisValue, PropertyName)
+static inline JSValue jsTestInterfaceConstructorSupplementalStaticReadOnlyAttrGetter(ExecState*);
+
+EncodedJSValue jsTestInterfaceConstructorSupplementalStaticReadOnlyAttr(ExecState* state, EncodedJSValue, PropertyName)
 {
-    VM& vm = state->vm();
-    auto throwScope = DECLARE_THROW_SCOPE(vm);
-    UNUSED_PARAM(throwScope);
-    UNUSED_PARAM(thisValue);
+    return JSValue::encode(jsTestInterfaceConstructorSupplementalStaticReadOnlyAttrGetter(state));
+}
+
+static inline JSValue jsTestInterfaceConstructorSupplementalStaticReadOnlyAttrGetter(ExecState* state)
+{
+    UNUSED_PARAM(state);
     JSValue result = jsNumber(WebCore::TestSupplemental::supplementalStaticReadOnlyAttr());
-    return JSValue::encode(result);
+    return result;
 }
 
 #endif
 
 #if ENABLE(Condition11) || ENABLE(Condition12)
-EncodedJSValue jsTestInterfaceConstructorSupplementalStaticAttr(ExecState* state, EncodedJSValue thisValue, PropertyName)
+static inline JSValue jsTestInterfaceConstructorSupplementalStaticAttrGetter(ExecState*);
+
+EncodedJSValue jsTestInterfaceConstructorSupplementalStaticAttr(ExecState* state, EncodedJSValue, PropertyName)
 {
-    VM& vm = state->vm();
-    auto throwScope = DECLARE_THROW_SCOPE(vm);
-    UNUSED_PARAM(throwScope);
-    UNUSED_PARAM(thisValue);
+    return JSValue::encode(jsTestInterfaceConstructorSupplementalStaticAttrGetter(state));
+}
+
+static inline JSValue jsTestInterfaceConstructorSupplementalStaticAttrGetter(ExecState* state)
+{
+    UNUSED_PARAM(state);
     JSValue result = jsStringWithCache(state, WebCore::TestSupplemental::supplementalStaticAttr());
-    return JSValue::encode(result);
+    return result;
 }
 
 #endif
 
 #if ENABLE(Condition11) || ENABLE(Condition12)
+static inline JSValue jsTestInterfaceSupplementalStr1Getter(ExecState*, JSTestInterface*, ThrowScope& throwScope);
+
 EncodedJSValue jsTestInterfaceSupplementalStr1(ExecState* state, EncodedJSValue thisValue, PropertyName)
 {
-    VM& vm = state->vm();
-    auto throwScope = DECLARE_THROW_SCOPE(vm);
+    return BindingCaller<JSTestInterface>::attribute<jsTestInterfaceSupplementalStr1Getter>(state, thisValue, "supplementalStr1");
+}
+
+static inline JSValue jsTestInterfaceSupplementalStr1Getter(ExecState* state, JSTestInterface* thisObject, ThrowScope& throwScope)
+{
     UNUSED_PARAM(throwScope);
-    UNUSED_PARAM(thisValue);
-    JSValue decodedThisValue = JSValue::decode(thisValue);
-    auto* castedThis = jsDynamicCast<JSTestInterface*>(decodedThisValue);
-    if (UNLIKELY(!castedThis)) {
-        return throwGetterTypeError(*state, throwScope, "TestInterface", "supplementalStr1");
-    }
-    auto& impl = castedThis->wrapped();
+    UNUSED_PARAM(state);
+    auto& impl = thisObject->wrapped();
     JSValue result = jsStringWithCache(state, WebCore::TestSupplemental::supplementalStr1(impl));
-    return JSValue::encode(result);
+    return result;
 }
 
 #endif
 
 #if ENABLE(Condition11) || ENABLE(Condition12)
+static inline JSValue jsTestInterfaceSupplementalStr2Getter(ExecState*, JSTestInterface*, ThrowScope& throwScope);
+
 EncodedJSValue jsTestInterfaceSupplementalStr2(ExecState* state, EncodedJSValue thisValue, PropertyName)
 {
-    VM& vm = state->vm();
-    auto throwScope = DECLARE_THROW_SCOPE(vm);
+    return BindingCaller<JSTestInterface>::attribute<jsTestInterfaceSupplementalStr2Getter>(state, thisValue, "supplementalStr2");
+}
+
+static inline JSValue jsTestInterfaceSupplementalStr2Getter(ExecState* state, JSTestInterface* thisObject, ThrowScope& throwScope)
+{
     UNUSED_PARAM(throwScope);
-    UNUSED_PARAM(thisValue);
-    JSValue decodedThisValue = JSValue::decode(thisValue);
-    auto* castedThis = jsDynamicCast<JSTestInterface*>(decodedThisValue);
-    if (UNLIKELY(!castedThis)) {
-        return throwGetterTypeError(*state, throwScope, "TestInterface", "supplementalStr2");
-    }
-    auto& impl = castedThis->wrapped();
+    UNUSED_PARAM(state);
+    auto& impl = thisObject->wrapped();
     JSValue result = jsStringWithCache(state, WebCore::TestSupplemental::supplementalStr2(impl));
-    return JSValue::encode(result);
+    return result;
 }
 
 #endif
 
 #if ENABLE(Condition11) || ENABLE(Condition12)
+static inline JSValue jsTestInterfaceSupplementalStr3Getter(ExecState*, JSTestInterface*, ThrowScope& throwScope);
+
 EncodedJSValue jsTestInterfaceSupplementalStr3(ExecState* state, EncodedJSValue thisValue, PropertyName)
 {
-    VM& vm = state->vm();
-    auto throwScope = DECLARE_THROW_SCOPE(vm);
+    return BindingCaller<JSTestInterface>::attribute<jsTestInterfaceSupplementalStr3Getter>(state, thisValue, "supplementalStr3");
+}
+
+static inline JSValue jsTestInterfaceSupplementalStr3Getter(ExecState* state, JSTestInterface* thisObject, ThrowScope& throwScope)
+{
     UNUSED_PARAM(throwScope);
-    UNUSED_PARAM(thisValue);
-    JSValue decodedThisValue = JSValue::decode(thisValue);
-    auto* castedThis = jsDynamicCast<JSTestInterface*>(decodedThisValue);
-    if (UNLIKELY(!castedThis)) {
-        return throwGetterTypeError(*state, throwScope, "TestInterface", "supplementalStr3");
-    }
-    return JSValue::encode(castedThis->supplementalStr3(*state));
+    UNUSED_PARAM(state);
+    return thisObject->supplementalStr3(*state);
 }
 
 #endif
 
 #if ENABLE(Condition11) || ENABLE(Condition12)
+static inline JSValue jsTestInterfaceSupplementalNodeGetter(ExecState*, JSTestInterface*, ThrowScope& throwScope);
+
 EncodedJSValue jsTestInterfaceSupplementalNode(ExecState* state, EncodedJSValue thisValue, PropertyName)
 {
-    VM& vm = state->vm();
-    auto throwScope = DECLARE_THROW_SCOPE(vm);
+    return BindingCaller<JSTestInterface>::attribute<jsTestInterfaceSupplementalNodeGetter>(state, thisValue, "supplementalNode");
+}
+
+static inline JSValue jsTestInterfaceSupplementalNodeGetter(ExecState* state, JSTestInterface* thisObject, ThrowScope& throwScope)
+{
     UNUSED_PARAM(throwScope);
-    UNUSED_PARAM(thisValue);
-    JSValue decodedThisValue = JSValue::decode(thisValue);
-    auto* castedThis = jsDynamicCast<JSTestInterface*>(decodedThisValue);
-    if (UNLIKELY(!castedThis)) {
-        return throwGetterTypeError(*state, throwScope, "TestInterface", "supplementalNode");
-    }
-    auto& impl = castedThis->wrapped();
-    JSValue result = toJS(state, castedThis->globalObject(), WebCore::TestSupplemental::supplementalNode(impl));
-    return JSValue::encode(result);
+    UNUSED_PARAM(state);
+    auto& impl = thisObject->wrapped();
+    JSValue result = toJS(state, thisObject->globalObject(), WebCore::TestSupplemental::supplementalNode(impl));
+    return result;
 }
 
 #endif
index bd63a94..eda3d14 100644 (file)
@@ -54,6 +54,7 @@ public:
     }
 
     static JSC::JSValue getConstructor(JSC::VM&, const JSC::JSGlobalObject*);
+    static JSTestInterface* castForAttribute(JSC::ExecState*, JSC::EncodedJSValue);
 
     // Custom attributes
 #if ENABLE(Condition22) || ENABLE(Condition23)
index 8321786..828a3e2 100644 (file)
@@ -132,35 +132,38 @@ void JSTestJSBuiltinConstructor::destroy(JSC::JSCell* cell)
     thisObject->JSTestJSBuiltinConstructor::~JSTestJSBuiltinConstructor();
 }
 
+inline JSTestJSBuiltinConstructor* JSTestJSBuiltinConstructor::castForAttribute(JSC::ExecState*, EncodedJSValue thisValue)
+{
+    return jsDynamicCast<JSTestJSBuiltinConstructor*>(JSValue::decode(thisValue));
+}
+
+static inline JSValue jsTestJSBuiltinConstructorTestAttributeCustomGetter(ExecState*, JSTestJSBuiltinConstructor*, ThrowScope& throwScope);
+
 EncodedJSValue jsTestJSBuiltinConstructorTestAttributeCustom(ExecState* state, EncodedJSValue thisValue, PropertyName)
 {
-    VM& vm = state->vm();
-    auto throwScope = DECLARE_THROW_SCOPE(vm);
+    return BindingCaller<JSTestJSBuiltinConstructor>::attribute<jsTestJSBuiltinConstructorTestAttributeCustomGetter>(state, thisValue, "testAttributeCustom");
+}
+
+static inline JSValue jsTestJSBuiltinConstructorTestAttributeCustomGetter(ExecState* state, JSTestJSBuiltinConstructor* thisObject, ThrowScope& throwScope)
+{
     UNUSED_PARAM(throwScope);
-    UNUSED_PARAM(thisValue);
-    JSValue decodedThisValue = JSValue::decode(thisValue);
-    auto* castedThis = jsDynamicCast<JSTestJSBuiltinConstructor*>(decodedThisValue);
-    if (UNLIKELY(!castedThis)) {
-        return throwGetterTypeError(*state, throwScope, "TestJSBuiltinConstructor", "testAttributeCustom");
-    }
-    return JSValue::encode(castedThis->testAttributeCustom(*state));
+    UNUSED_PARAM(state);
+    return thisObject->testAttributeCustom(*state);
 }
 
+static inline JSValue jsTestJSBuiltinConstructorTestAttributeRWCustomGetter(ExecState*, JSTestJSBuiltinConstructor*, ThrowScope& throwScope);
 
 EncodedJSValue jsTestJSBuiltinConstructorTestAttributeRWCustom(ExecState* state, EncodedJSValue thisValue, PropertyName)
 {
-    VM& vm = state->vm();
-    auto throwScope = DECLARE_THROW_SCOPE(vm);
-    UNUSED_PARAM(throwScope);
-    UNUSED_PARAM(thisValue);
-    JSValue decodedThisValue = JSValue::decode(thisValue);
-    auto* castedThis = jsDynamicCast<JSTestJSBuiltinConstructor*>(decodedThisValue);
-    if (UNLIKELY(!castedThis)) {
-        return throwGetterTypeError(*state, throwScope, "TestJSBuiltinConstructor", "testAttributeRWCustom");
-    }
-    return JSValue::encode(castedThis->testAttributeRWCustom(*state));
+    return BindingCaller<JSTestJSBuiltinConstructor>::attribute<jsTestJSBuiltinConstructorTestAttributeRWCustomGetter>(state, thisValue, "testAttributeRWCustom");
 }
 
+static inline JSValue jsTestJSBuiltinConstructorTestAttributeRWCustomGetter(ExecState* state, JSTestJSBuiltinConstructor* thisObject, ThrowScope& throwScope)
+{
+    UNUSED_PARAM(throwScope);
+    UNUSED_PARAM(state);
+    return thisObject->testAttributeRWCustom(*state);
+}
 
 EncodedJSValue jsTestJSBuiltinConstructorConstructor(ExecState* state, EncodedJSValue thisValue, PropertyName)
 {
index b8c5931..f4d4834 100644 (file)
@@ -46,6 +46,7 @@ public:
     }
 
     static JSC::JSValue getConstructor(JSC::VM&, const JSC::JSGlobalObject*);
+    static JSTestJSBuiltinConstructor* castForAttribute(JSC::ExecState*, JSC::EncodedJSValue);
     static void visitChildren(JSCell*, JSC::SlotVisitor&);
 
 
index 4e9a13c..694fd2f 100644 (file)
@@ -168,23 +168,27 @@ JSObject* JSTestNode::prototype(VM& vm, JSGlobalObject* globalObject)
     return getDOMPrototype<JSTestNode>(vm, globalObject);
 }
 
+inline JSTestNode* JSTestNode::castForAttribute(JSC::ExecState*, EncodedJSValue thisValue)
+{
+    return jsDynamicCast<JSTestNode*>(JSValue::decode(thisValue));
+}
+
+static inline JSValue jsTestNodeNameGetter(ExecState*, JSTestNode*, ThrowScope& throwScope);
+
 EncodedJSValue jsTestNodeName(ExecState* state, EncodedJSValue thisValue, PropertyName)
 {
-    VM& vm = state->vm();
-    auto throwScope = DECLARE_THROW_SCOPE(vm);
+    return BindingCaller<JSTestNode>::attribute<jsTestNodeNameGetter>(state, thisValue, "name");
+}
+
+static inline JSValue jsTestNodeNameGetter(ExecState* state, JSTestNode* thisObject, ThrowScope& throwScope)
+{
     UNUSED_PARAM(throwScope);
-    UNUSED_PARAM(thisValue);
-    JSValue decodedThisValue = JSValue::decode(thisValue);
-    auto* castedThis = jsDynamicCast<JSTestNode*>(decodedThisValue);
-    if (UNLIKELY(!castedThis)) {
-        return throwGetterTypeError(*state, throwScope, "TestNode", "name");
-    }
-    auto& impl = castedThis->wrapped();
+    UNUSED_PARAM(state);
+    auto& impl = thisObject->wrapped();
     JSValue result = jsStringWithCache(state, impl.name());
-    return JSValue::encode(result);
+    return result;
 }
 
-
 EncodedJSValue jsTestNodeConstructor(ExecState* state, EncodedJSValue thisValue, PropertyName)
 {
     VM& vm = state->vm();
index 3863dbf..68ee9ed 100644 (file)
@@ -47,6 +47,7 @@ public:
     }
 
     static JSC::JSValue getConstructor(JSC::VM&, const JSC::JSGlobalObject*);
+    static JSTestNode* castForAttribute(JSC::ExecState*, JSC::EncodedJSValue);
     static void visitChildren(JSCell*, JSC::SlotVisitor&);
 
     TestNode& wrapped() const
index b6e25be..0513731 100644 (file)
@@ -143,26 +143,31 @@ void JSTestNondeterministic::destroy(JSC::JSCell* cell)
     thisObject->JSTestNondeterministic::~JSTestNondeterministic();
 }
 
+inline JSTestNondeterministic* JSTestNondeterministic::castForAttribute(JSC::ExecState*, EncodedJSValue thisValue)
+{
+    return jsDynamicCast<JSTestNondeterministic*>(JSValue::decode(thisValue));
+}
+
+static inline JSValue jsTestNondeterministicNondeterministicReadonlyAttrGetter(ExecState*, JSTestNondeterministic*, ThrowScope& throwScope);
+
 EncodedJSValue jsTestNondeterministicNondeterministicReadonlyAttr(ExecState* state, EncodedJSValue thisValue, PropertyName)
 {
-    VM& vm = state->vm();
-    auto throwScope = DECLARE_THROW_SCOPE(vm);
+    return BindingCaller<JSTestNondeterministic>::attribute<jsTestNondeterministicNondeterministicReadonlyAttrGetter>(state, thisValue, "nondeterministicReadonlyAttr");
+}
+
+static inline JSValue jsTestNondeterministicNondeterministicReadonlyAttrGetter(ExecState* state, JSTestNondeterministic* thisObject, ThrowScope& throwScope)
+{
     UNUSED_PARAM(throwScope);
-    UNUSED_PARAM(thisValue);
-    JSValue decodedThisValue = JSValue::decode(thisValue);
-    auto* castedThis = jsDynamicCast<JSTestNondeterministic*>(decodedThisValue);
-    if (UNLIKELY(!castedThis)) {
-        return throwGetterTypeError(*state, throwScope, "TestNondeterministic", "nondeterministicReadonlyAttr");
-    }
+    UNUSED_PARAM(state);
 #if ENABLE(WEB_REPLAY)
     JSGlobalObject* globalObject = state->lexicalGlobalObject();
     InputCursor& cursor = globalObject->inputCursor();
     static NeverDestroyed<const AtomicString> bindingName("TestNondeterministic.nondeterministicReadonlyAttr", AtomicString::ConstructFromLiteral);
     if (cursor.isCapturing()) {
-        int32_t memoizedResult = castedThis->wrapped().nondeterministicReadonlyAttr();
+        int32_t memoizedResult = thisObject->wrapped().nondeterministicReadonlyAttr();
         cursor.appendInput<MemoizedDOMResult<int32_t>>(bindingName.get().string(), memoizedResult, 0);
         JSValue result = jsNumber(memoizedResult);
-        return JSValue::encode(result);
+        return result;
     }
 
     if (cursor.isReplaying()) {
@@ -170,36 +175,35 @@ EncodedJSValue jsTestNondeterministicNondeterministicReadonlyAttr(ExecState* sta
         MemoizedDOMResultBase* input = cursor.fetchInput<MemoizedDOMResultBase>();
         if (input && input->convertTo<int32_t>(memoizedResult)) {
             JSValue result = jsNumber(memoizedResult);
-            return JSValue::encode(result);
+            return result;
         }
     }
 #endif
-    auto& impl = castedThis->wrapped();
+    auto& impl = thisObject->wrapped();
     JSValue result = jsNumber(impl.nondeterministicReadonlyAttr());
-    return JSValue::encode(result);
+    return result;
 }
 
+static inline JSValue jsTestNondeterministicNondeterministicWriteableAttrGetter(ExecState*, JSTestNondeterministic*, ThrowScope& throwScope);
 
 EncodedJSValue jsTestNondeterministicNondeterministicWriteableAttr(ExecState* state, EncodedJSValue thisValue, PropertyName)
 {
-    VM& vm = state->vm();
-    auto throwScope = DECLARE_THROW_SCOPE(vm);
+    return BindingCaller<JSTestNondeterministic>::attribute<jsTestNondeterministicNondeterministicWriteableAttrGetter>(state, thisValue, "nondeterministicWriteableAttr");
+}
+
+static inline JSValue jsTestNondeterministicNondeterministicWriteableAttrGetter(ExecState* state, JSTestNondeterministic* thisObject, ThrowScope& throwScope)
+{
     UNUSED_PARAM(throwScope);
-    UNUSED_PARAM(thisValue);
-    JSValue decodedThisValue = JSValue::decode(thisValue);
-    auto* castedThis = jsDynamicCast<JSTestNondeterministic*>(decodedThisValue);
-    if (UNLIKELY(!castedThis)) {
-        return throwGetterTypeError(*state, throwScope, "TestNondeterministic", "nondeterministicWriteableAttr");
-    }
+    UNUSED_PARAM(state);
 #if ENABLE(WEB_REPLAY)
     JSGlobalObject* globalObject = state->lexicalGlobalObject();
     InputCursor& cursor = globalObject->inputCursor();
     static NeverDestroyed<const AtomicString> bindingName("TestNondeterministic.nondeterministicWriteableAttr", AtomicString::ConstructFromLiteral);
     if (cursor.isCapturing()) {
-        String memoizedResult = castedThis->wrapped().nondeterministicWriteableAttr();
+        String memoizedResult = thisObject->wrapped().nondeterministicWriteableAttr();
         cursor.appendInput<MemoizedDOMResult<String>>(bindingName.get().string(), memoizedResult, 0);
         JSValue result = jsStringWithCache(state, memoizedResult);
-        return JSValue::encode(result);
+        return result;
     }
 
     if (cursor.isReplaying()) {
@@ -207,36 +211,35 @@ EncodedJSValue jsTestNondeterministicNondeterministicWriteableAttr(ExecState* st
         MemoizedDOMResultBase* input = cursor.fetchInput<MemoizedDOMResultBase>();
         if (input && input->convertTo<String>(memoizedResult)) {
             JSValue result = jsStringWithCache(state, memoizedResult);
-            return JSValue::encode(result);
+            return result;
         }
     }
 #endif
-    auto& impl = castedThis->wrapped();
+    auto& impl = thisObject->wrapped();
     JSValue result = jsStringWithCache(state, impl.nondeterministicWriteableAttr());
-    return JSValue::encode(result);
+    return result;
 }
 
+static inline JSValue jsTestNondeterministicNondeterministicExceptionAttrGetter(ExecState*, JSTestNondeterministic*, ThrowScope& throwScope);
 
 EncodedJSValue jsTestNondeterministicNondeterministicExceptionAttr(ExecState* state, EncodedJSValue thisValue, PropertyName)
 {
-    VM& vm = state->vm();
-    auto throwScope = DECLARE_THROW_SCOPE(vm);
+    return BindingCaller<JSTestNondeterministic>::attribute<jsTestNondeterministicNondeterministicExceptionAttrGetter>(state, thisValue, "nondeterministicExceptionAttr");
+}
+
+static inline JSValue jsTestNondeterministicNondeterministicExceptionAttrGetter(ExecState* state, JSTestNondeterministic* thisObject, ThrowScope& throwScope)
+{
     UNUSED_PARAM(throwScope);
-    UNUSED_PARAM(thisValue);
-    JSValue decodedThisValue = JSValue::decode(thisValue);
-    auto* castedThis = jsDynamicCast<JSTestNondeterministic*>(decodedThisValue);
-    if (UNLIKELY(!castedThis)) {
-        return throwGetterTypeError(*state, throwScope, "TestNondeterministic", "nondeterministicExceptionAttr");
-    }
+    UNUSED_PARAM(state);
 #if ENABLE(WEB_REPLAY)
     JSGlobalObject* globalObject = state->lexicalGlobalObject();
     InputCursor& cursor = globalObject->inputCursor();
     static NeverDestroyed<const AtomicString> bindingName("TestNondeterministic.nondeterministicExceptionAttr", AtomicString::ConstructFromLiteral);
     if (cursor.isCapturing()) {
-        String memoizedResult = castedThis->wrapped().nondeterministicExceptionAttr();
+        String memoizedResult = thisObject->wrapped().nondeterministicExceptionAttr();
         cursor.appendInput<MemoizedDOMResult<String>>(bindingName.get().string(), memoizedResult, 0);
         JSValue result = jsStringWithCache(state, memoizedResult);
-        return JSValue::encode(result);
+        return result;
     }
 
     if (cursor.isReplaying()) {
@@ -244,38 +247,37 @@ EncodedJSValue jsTestNondeterministicNondeterministicExceptionAttr(ExecState* st
         MemoizedDOMResultBase* input = cursor.fetchInput<MemoizedDOMResultBase>();
         if (input && input->convertTo<String>(memoizedResult)) {
             JSValue result = jsStringWithCache(state, memoizedResult);
-            return JSValue::encode(result);
+            return result;
         }
     }
 #endif
-    auto& impl = castedThis->wrapped();
+    auto& impl = thisObject->wrapped();
     JSValue result = jsStringWithCache(state, impl.nondeterministicExceptionAttr());
-    return JSValue::encode(result);
+    return result;
 }
 
+static inline JSValue jsTestNondeterministicNondeterministicGetterExceptionAttrGetter(ExecState*, JSTestNondeterministic*, ThrowScope& throwScope);
 
 EncodedJSValue jsTestNondeterministicNondeterministicGetterExceptionAttr(ExecState* state, EncodedJSValue thisValue, PropertyName)
 {
-    VM& vm = state->vm();
-    auto throwScope = DECLARE_THROW_SCOPE(vm);
+    return BindingCaller<JSTestNondeterministic>::attribute<jsTestNondeterministicNondeterministicGetterExceptionAttrGetter>(state, thisValue, "nondeterministicGetterExceptionAttr");
+}
+
+static inline JSValue jsTestNondeterministicNondeterministicGetterExceptionAttrGetter(ExecState* state, JSTestNondeterministic* thisObject, ThrowScope& throwScope)
+{
     UNUSED_PARAM(throwScope);
-    UNUSED_PARAM(thisValue);
-    JSValue decodedThisValue = JSValue::decode(thisValue);
-    auto* castedThis = jsDynamicCast<JSTestNondeterministic*>(decodedThisValue);
-    if (UNLIKELY(!castedThis)) {
-        return throwGetterTypeError(*state, throwScope, "TestNondeterministic", "nondeterministicGetterExceptionAttr");
-    }
+    UNUSED_PARAM(state);
     ExceptionCode ec = 0;
 #if ENABLE(WEB_REPLAY)
     JSGlobalObject* globalObject = state->lexicalGlobalObject();
     InputCursor& cursor = globalObject->inputCursor();
     static NeverDestroyed<const AtomicString> bindingName("TestNondeterministic.nondeterministicGetterExceptionAttr", AtomicString::ConstructFromLiteral);
     if (cursor.isCapturing()) {
-        String memoizedResult = castedThis->wrapped().nondeterministicGetterExceptionAttr(ec);
+        String memoizedResult = thisObject->wrapped().nondeterministicGetterExceptionAttr(ec);
         cursor.appendInput<MemoizedDOMResult<String>>(bindingName.get().string(), memoizedResult, ec);
         JSValue result = jsStringWithCache(state, memoizedResult);
         setDOMException(state, throwScope, ec);
-        return JSValue::encode(result);
+        return result;
     }
 
     if (cursor.isReplaying()) {
@@ -284,37 +286,36 @@ EncodedJSValue jsTestNondeterministicNondeterministicGetterExceptionAttr(ExecSta
         if (input && input->convertTo<String>(memoizedResult)) {
             JSValue result = jsStringWithCache(state, memoizedResult);
             setDOMException(state, throwScope, input->exceptionCode());
-            return JSValue::encode(result);
+            return result;
         }
     }
 #endif
-    auto& impl = castedThis->wrapped();
+    auto& impl = thisObject->wrapped();
     JSValue result = jsStringWithCache(state, impl.nondeterministicGetterExceptionAttr(ec));
     setDOMException(state, throwScope, ec);
-    return JSValue::encode(result);
+    return result;
 }
 
+static inline JSValue jsTestNondeterministicNondeterministicSetterExceptionAttrGetter(ExecState*, JSTestNondeterministic*, ThrowScope& throwScope);
 
 EncodedJSValue jsTestNondeterministicNondeterministicSetterExceptionAttr(ExecState* state, EncodedJSValue thisValue, PropertyName)
 {
-    VM& vm = state->vm();
-    auto throwScope = DECLARE_THROW_SCOPE(vm);
+    return BindingCaller<JSTestNondeterministic>::attribute<jsTestNondeterministicNondeterministicSetterExceptionAttrGetter>(state, thisValue, "nondeterministicSetterExceptionAttr");
+}
+
+static inline JSValue jsTestNondeterministicNondeterministicSetterExceptionAttrGetter(ExecState* state, JSTestNondeterministic* thisObject, ThrowScope& throwScope)
+{
     UNUSED_PARAM(throwScope);
-    UNUSED_PARAM(thisValue);
-    JSValue decodedThisValue = JSValue::decode(thisValue);
-    auto* castedThis = jsDynamicCast<JSTestNondeterministic*>(decodedThisValue);
-    if (UNLIKELY(!castedThis)) {
-        return throwGetterTypeError(*state, throwScope, "TestNondeterministic", "nondeterministicSetterExceptionAttr");
-    }
+    UNUSED_PARAM(state);
 #if ENABLE(WEB_REPLAY)
     JSGlobalObject* globalObject = state->lexicalGlobalObject();
     InputCursor& cursor = globalObject->inputCursor();
     static NeverDestroyed<const AtomicString> bindingName("TestNondeterministic.nondeterministicSetterExceptionAttr", AtomicString::ConstructFromLiteral);
     if (cursor.isCapturing()) {
-        String memoizedResult = castedThis->wrapped().nondeterministicSetterExceptionAttr();
+        String memoizedResult = thisObject->wrapped().nondeterministicSetterExceptionAttr();
         cursor.appendInput<MemoizedDOMResult<String>>(bindingName.get().string(), memoizedResult, 0);
         JSValue result = jsStringWithCache(state, memoizedResult);
-        return JSValue::encode(result);
+        return result;
     }
 
     if (cursor.isReplaying()) {
@@ -322,16 +323,15 @@ EncodedJSValue jsTestNondeterministicNondeterministicSetterExceptionAttr(ExecSta
         MemoizedDOMResultBase* input = cursor.fetchInput<MemoizedDOMResultBase>();
         if (input && input->convertTo<String>(memoizedResult)) {
             JSValue result = jsStringWithCache(state, memoizedResult);
-            return JSValue::encode(result);
+            return result;
         }
     }
 #endif
-    auto& impl = castedThis->wrapped();
+    auto& impl = thisObject->wrapped();
     JSValue result = jsStringWithCache(state, impl.nondeterministicSetterExceptionAttr());
-    return JSValue::encode(result);
+    return result;
 }
 
-
 EncodedJSValue jsTestNondeterministicConstructor(ExecState* state, EncodedJSValue thisValue, PropertyName)
 {
     VM& vm = state->vm();
index f96cb76..1d7e860 100644 (file)
@@ -49,6 +49,7 @@ public:
     }
 
     static JSC::JSValue getConstructor(JSC::VM&, const JSC::JSGlobalObject*);
+    static JSTestNondeterministic* castForAttribute(JSC::ExecState*, JSC::EncodedJSValue);
 protected:
     JSTestNondeterministic(JSC::Structure*, JSDOMGlobalObject&, Ref<TestNondeterministic>&&);
 
index 1848074..4e5627e 100644 (file)
@@ -1711,1546 +1711,1475 @@ bool JSTestObj::getOwnPropertySlotByIndex(JSObject* object, ExecState* state, un
     return Base::getOwnPropertySlotByIndex(thisObject, state, index, slot);
 }
 
+inline JSTestObj* JSTestObj::castForAttribute(JSC::ExecState*, EncodedJSValue thisValue)
+{
+    return jsDynamicCast<JSTestObj*>(JSValue::decode(thisValue));
+}
+
+static inline JSValue jsTestObjReadOnlyLongAttrGetter(ExecState*, JSTestObj*, ThrowScope& throwScope);
+
 EncodedJSValue jsTestObjReadOnlyLongAttr(ExecState* state, EncodedJSValue thisValue, PropertyName)
 {
-    VM& vm = state->vm();
-    auto throwScope = DECLARE_THROW_SCOPE(vm);
+    return BindingCaller<JSTestObj>::attribute<jsTestObjReadOnlyLongAttrGetter>(state, thisValue, "readOnlyLongAttr");
+}
+
+static inline JSValue jsTestObjReadOnlyLongAttrGetter(ExecState* state, JSTestObj* thisObject, ThrowScope& throwScope)
+{
     UNUSED_PARAM(throwScope);
-    UNUSED_PARAM(thisValue);
-    JSValue decodedThisValue = JSValue::decode(thisValue);
-    auto* castedThis = jsDynamicCast<JSTestObj*>(decodedThisValue);
-    if (UNLIKELY(!castedThis)) {
-        return throwGetterTypeError(*state, throwScope, "TestObject", "readOnlyLongAttr");
-    }
-    auto& impl = castedThis->wrapped();
+    UNUSED_PARAM(state);
+    auto& impl = thisObject->wrapped();
     JSValue result = jsNumber(impl.readOnlyLongAttr());
-    return JSValue::encode(result);
+    return result;
 }
 
+static inline JSValue jsTestObjReadOnlyStringAttrGetter(ExecState*, JSTestObj*, ThrowScope& throwScope);
 
 EncodedJSValue jsTestObjReadOnlyStringAttr(ExecState* state, EncodedJSValue thisValue, PropertyName)
 {
-    VM& vm = state->vm();
-    auto throwScope = DECLARE_THROW_SCOPE(vm);
+    return BindingCaller<JSTestObj>::attribute<jsTestObjReadOnlyStringAttrGetter>(state, thisValue, "readOnlyStringAttr");
+}
+
+static inline JSValue jsTestObjReadOnlyStringAttrGetter(ExecState* state, JSTestObj* thisObject, ThrowScope& throwScope)
+{
     UNUSED_PARAM(throwScope);
-    UNUSED_PARAM(thisValue);
-    JSValue decodedThisValue = JSValue::decode(thisValue);
-    auto* castedThis = jsDynamicCast<JSTestObj*>(decodedThisValue);
-    if (UNLIKELY(!castedThis)) {
-        return throwGetterTypeError(*state, throwScope, "TestObject", "readOnlyStringAttr");
-    }
-    auto& impl = castedThis->wrapped();
+    UNUSED_PARAM(state);
+    auto& impl = thisObject->wrapped();
     JSValue result = jsStringWithCache(state, impl.readOnlyStringAttr());
-    return JSValue::encode(result);
+    return result;
 }
 
+static inline JSValue jsTestObjReadOnlyTestObjAttrGetter(ExecState*, JSTestObj*, ThrowScope& throwScope);
 
 EncodedJSValue jsTestObjReadOnlyTestObjAttr(ExecState* state, EncodedJSValue thisValue, PropertyName)
 {
-    VM& vm = state->vm();
-    auto throwScope = DECLARE_THROW_SCOPE(vm);
+    return BindingCaller<JSTestObj>::attribute<jsTestObjReadOnlyTestObjAttrGetter>(state, thisValue, "readOnlyTestObjAttr");
+}
+
+static inline JSValue jsTestObjReadOnlyTestObjAttrGetter(ExecState* state, JSTestObj* thisObject, ThrowScope& throwScope)
+{
     UNUSED_PARAM(throwScope);
-    UNUSED_PARAM(thisValue);
-    JSValue decodedThisValue = JSValue::decode(thisValue);
-    auto* castedThis = jsDynamicCast<JSTestObj*>(decodedThisValue);
-    if (UNLIKELY(!castedThis)) {
-        return throwGetterTypeError(*state, throwScope, "TestObject", "readOnlyTestObjAttr");
-    }
-    auto& impl = castedThis->wrapped();
-    JSValue result = toJS(state, castedThis->globalObject(), impl.readOnlyTestObjAttr());
-    return JSValue::encode(result);
+    UNUSED_PARAM(state);
+    auto& impl = thisObject->wrapped();
+    JSValue result = toJS(state, thisObject->globalObject(), impl.readOnlyTestObjAttr());
+    return result;
 }
 
+static inline JSValue jsTestObjConstructorStaticReadOnlyLongAttrGetter(ExecState*);
 
-EncodedJSValue jsTestObjConstructorStaticReadOnlyLongAttr(ExecState* state, EncodedJSValue thisValue, PropertyName)
+EncodedJSValue jsTestObjConstructorStaticReadOnlyLongAttr(ExecState* state, EncodedJSValue, PropertyName)
 {
-    VM& vm = state->vm();
-    auto throwScope = DECLARE_THROW_SCOPE(vm);
-    UNUSED_PARAM(throwScope);
-    UNUSED_PARAM(thisValue);
+    return JSValue::encode(jsTestObjConstructorStaticReadOnlyLongAttrGetter(state));
+}
+
+static inline JSValue jsTestObjConstructorStaticReadOnlyLongAttrGetter(ExecState* state)
+{
+    UNUSED_PARAM(state);
     JSValue result = jsNumber(TestObj::staticReadOnlyLongAttr());
-    return JSValue::encode(result);
+    return result;
 }
 
+static inline JSValue jsTestObjConstructorStaticStringAttrGetter(ExecState*);
 
-EncodedJSValue jsTestObjConstructorStaticStringAttr(ExecState* state, EncodedJSValue thisValue, PropertyName)
+EncodedJSValue jsTestObjConstructorStaticStringAttr(ExecState* state, EncodedJSValue, PropertyName)
 {
-    VM& vm = state->vm();
-    auto throwScope = DECLARE_THROW_SCOPE(vm);
-    UNUSED_PARAM(throwScope);
-    UNUSED_PARAM(thisValue);
+    return JSValue::encode(jsTestObjConstructorStaticStringAttrGetter(state));
+}
+
+static inline JSValue jsTestObjConstructorStaticStringAttrGetter(ExecState* state)
+{
+    UNUSED_PARAM(state);
     JSValue result = jsStringWithCache(state, TestObj::staticStringAttr());
-    return JSValue::encode(result);
+    return result;
 }
 
+static inline JSValue jsTestObjConstructorTestSubObjGetter(ExecState*, JSTestObj*, ThrowScope& throwScope);
 
 EncodedJSValue jsTestObjConstructorTestSubObj(ExecState* state, EncodedJSValue thisValue, PropertyName)
 {
-    VM& vm = state->vm();
-    auto throwScope = DECLARE_THROW_SCOPE(vm);
+    return BindingCaller<JSTestObj>::attribute<jsTestObjConstructorTestSubObjGetter>(state, thisValue, "TestSubObj");
+}
+
+static inline JSValue jsTestObjConstructorTestSubObjGetter(ExecState* state, JSTestObj* thisObject, ThrowScope& throwScope)
+{
     UNUSED_PARAM(throwScope);
-    UNUSED_PARAM(thisValue);
-    JSValue decodedThisValue = JSValue::decode(thisValue);
-    auto* castedThis = jsDynamicCast<JSTestObj*>(decodedThisValue);
-    if (UNLIKELY(!castedThis)) {
-        return throwGetterTypeError(*state, throwScope, "TestObject", "TestSubObj");
-    }
-    return JSValue::encode(JSTestSubObj::getConstructor(state->vm(), castedThis->globalObject()));
+    UNUSED_PARAM(state);
+    return JSTestSubObj::getConstructor(state->vm(), thisObject->globalObject());
 }
 
+static inline JSValue jsTestObjTestSubObjEnabledBySettingConstructorGetter(ExecState*, JSTestObj*, ThrowScope& throwScope);
 
 EncodedJSValue jsTestObjTestSubObjEnabledBySettingConstructor(ExecState* state, EncodedJSValue thisValue, PropertyName)
 {
-    VM& vm = state->vm();
-    auto throwScope = DECLARE_THROW_SCOPE(vm);
+    return BindingCaller<JSTestObj>::attribute<jsTestObjTestSubObjEnabledBySettingConstructorGetter>(state, thisValue, "TestSubObjEnabledBySetting");
+}
+
+static inline JSValue jsTestObjTestSubObjEnabledBySettingConstructorGetter(ExecState* state, JSTestObj* thisObject, ThrowScope& throwScope)
+{
     UNUSED_PARAM(throwScope);
-    UNUSED_PARAM(thisValue);
-    JSValue decodedThisValue = JSValue::decode(thisValue);
-    auto* castedThis = jsDynamicCast<JSTestObj*>(decodedThisValue);
-    if (UNLIKELY(!castedThis)) {
-        return throwGetterTypeError(*state, throwScope, "TestObject", "TestSubObjEnabledBySetting");
-    }
-    if (UNLIKELY(!castedThis->wrapped().frame()))
-        return JSValue::encode(jsUndefined());
-    Settings& settings = castedThis->wrapped().frame()->settings();
+    UNUSED_PARAM(state);
+    if (UNLIKELY(!thisObject->wrapped().frame()))
+        return jsUndefined();
+    Settings& settings = thisObject->wrapped().frame()->settings();
     if (!settings.testSettingEnabled())
-        return JSValue::encode(jsUndefined());
-    return JSValue::encode(JSTestSubObj::getConstructor(state->vm(), castedThis->globalObject()));
+        return jsUndefined();
+    return JSTestSubObj::getConstructor(state->vm(), thisObject->globalObject());
 }
 
+static inline JSValue jsTestObjEnumAttrGetter(ExecState*, JSTestObj*, ThrowScope& throwScope);
 
 EncodedJSValue jsTestObjEnumAttr(ExecState* state, EncodedJSValue thisValue, PropertyName)
 {
-    VM& vm = state->vm();
-    auto throwScope = DECLARE_THROW_SCOPE(vm);
+    return BindingCaller<JSTestObj>::attribute<jsTestObjEnumAttrGetter>(state, thisValue, "enumAttr");
+}
+
+static inline JSValue jsTestObjEnumAttrGetter(ExecState* state, JSTestObj* thisObject, ThrowScope& throwScope)
+{
     UNUSED_PARAM(throwScope);
-    UNUSED_PARAM(thisValue);
-    JSValue decodedThisValue = JSValue::decode(thisValue);
-    auto* castedThis = jsDynamicCast<JSTestObj*>(decodedThisValue);
-    if (UNLIKELY(!castedThis)) {
-        return throwGetterTypeError(*state, throwScope, "TestObject", "enumAttr");
-    }
-    auto& impl = castedThis->wrapped();
+    UNUSED_PARAM(state);
+    auto& impl = thisObject->wrapped();
     JSValue result = jsStringWithCache(state, impl.enumAttr());
-    return JSValue::encode(result);
+    return result;
 }
 
+static inline JSValue jsTestObjByteAttrGetter(ExecState*, JSTestObj*, ThrowScope& throwScope);
 
 EncodedJSValue jsTestObjByteAttr(ExecState* state, EncodedJSValue thisValue, PropertyName)
 {
-    VM& vm = state->vm();
-    auto throwScope = DECLARE_THROW_SCOPE(vm);
+    return BindingCaller<JSTestObj>::attribute<jsTestObjByteAttrGetter>(state, thisValue, "byteAttr");
+}
+
+static inline JSValue jsTestObjByteAttrGetter(ExecState* state, JSTestObj* thisObject, ThrowScope& throwScope)
+{
     UNUSED_PARAM(throwScope);
-    UNUSED_PARAM(thisValue);
-    JSValue decodedThisValue = JSValue::decode(thisValue);
-    auto* castedThis = jsDynamicCast<JSTestObj*>(decodedThisValue);
-    if (UNLIKELY(!castedThis)) {
-        return throwGetterTypeError(*state, throwScope, "TestObject", "byteAttr");
-    }
-    auto& impl = castedThis->wrapped();
+    UNUSED_PARAM(state);
+    auto& impl = thisObject->wrapped();
     JSValue result = jsNumber(impl.byteAttr());
-    return JSValue::encode(result);
+    return result;
 }
 
+static inline JSValue jsTestObjOctetAttrGetter(ExecState*, JSTestObj*, ThrowScope& throwScope);
 
 EncodedJSValue jsTestObjOctetAttr(ExecState* state, EncodedJSValue thisValue, PropertyName)
 {
-    VM& vm = state->vm();
-    auto throwScope = DECLARE_THROW_SCOPE(vm);
+    return BindingCaller<JSTestObj>::attribute<jsTestObjOctetAttrGetter>(state, thisValue, "octetAttr");
+}
+
+static inline JSValue jsTestObjOctetAttrGetter(ExecState* state, JSTestObj* thisObject, ThrowScope& throwScope)
+{
     UNUSED_PARAM(throwScope);
-    UNUSED_PARAM(thisValue);
-    JSValue decodedThisValue = JSValue::decode(thisValue);
-    auto* castedThis = jsDynamicCast<JSTestObj*>(decodedThisValue);
-    if (UNLIKELY(!castedThis)) {
-        return throwGetterTypeError(*state, throwScope, "TestObject", "octetAttr");
-    }
-    auto& impl = castedThis->wrapped();
+    UNUSED_PARAM(state);
+    auto& impl = thisObject->wrapped();
     JSValue result = jsNumber(impl.octetAttr());
-    return JSValue::encode(result);
+    return result;
 }
 
+static inline JSValue jsTestObjShortAttrGetter(ExecState*, JSTestObj*, ThrowScope& throwScope);
 
 EncodedJSValue jsTestObjShortAttr(ExecState* state, EncodedJSValue thisValue, PropertyName)
 {
-    VM& vm = state->vm();
-    auto throwScope = DECLARE_THROW_SCOPE(vm);
+    return BindingCaller<JSTestObj>::attribute<jsTestObjShortAttrGetter>(state, thisValue, "shortAttr");
+}
+
+static inline JSValue jsTestObjShortAttrGetter(ExecState* state, JSTestObj* thisObject, ThrowScope& throwScope)
+{
     UNUSED_PARAM(throwScope);
-    UNUSED_PARAM(thisValue);
-    JSValue decodedThisValue = JSValue::decode(thisValue);
-    auto* castedThis = jsDynamicCast<JSTestObj*>(decodedThisValue);
-    if (UNLIKELY(!castedThis)) {
-        return throwGetterTypeError(*state, throwScope, "TestObject", "shortAttr");
-    }
-    auto& impl = castedThis->wrapped();
+    UNUSED_PARAM(state);
+    auto& impl = thisObject->wrapped();
     JSValue result = jsNumber(impl.shortAttr());
-    return JSValue::encode(result);
+    return result;
 }
 
+static inline JSValue jsTestObjClampedShortAttrGetter(ExecState*, JSTestObj*, ThrowScope& throwScope);
 
 EncodedJSValue jsTestObjClampedShortAttr(ExecState* state, EncodedJSValue thisValue, PropertyName)
 {
-    VM& vm = state->vm();
-    auto throwScope = DECLARE_THROW_SCOPE(vm);
+    return BindingCaller<JSTestObj>::attribute<jsTestObjClampedShortAttrGetter>(state, thisValue, "clampedShortAttr");
+}
+
+static inline JSValue jsTestObjClampedShortAttrGetter(ExecState* state, JSTestObj* thisObject, ThrowScope& throwScope)
+{
     UNUSED_PARAM(throwScope);
-    UNUSED_PARAM(thisValue);
-    JSValue decodedThisValue = JSValue::decode(thisValue);
-    auto* castedThis = jsDynamicCast<JSTestObj*>(decodedThisValue);
-    if (UNLIKELY(!castedThis)) {
-        return throwGetterTypeError(*state, throwScope, "TestObject", "clampedShortAttr");
-    }
-    auto& impl = castedThis->wrapped();
+    UNUSED_PARAM(state);
+    auto& impl = thisObject->wrapped();
     JSValue result = jsNumber(impl.clampedShortAttr());
-    return JSValue::encode(result);
+    return result;
 }
 
+static inline JSValue jsTestObjEnforceRangeShortAttrGetter(ExecState*, JSTestObj*, ThrowScope& throwScope);
 
 EncodedJSValue jsTestObjEnforceRangeShortAttr(ExecState* state, EncodedJSValue thisValue, PropertyName)
 {
-    VM& vm = state->vm();
-    auto throwScope = DECLARE_THROW_SCOPE(vm);
+    return BindingCaller<JSTestObj>::attribute<jsTestObjEnforceRangeShortAttrGetter>(state, thisValue, "enforceRangeShortAttr");
+}
+
+static inline JSValue jsTestObjEnforceRangeShortAttrGetter(ExecState* state, JSTestObj* thisObject, ThrowScope& throwScope)
+{
     UNUSED_PARAM(throwScope);
-    UNUSED_PARAM(thisValue);
-    JSValue decodedThisValue = JSValue::decode(thisValue);
-    auto* castedThis = jsDynamicCast<JSTestObj*>(decodedThisValue);
-    if (UNLIKELY(!castedThis)) {
-        return throwGetterTypeError(*state, throwScope, "TestObject", "enforceRangeShortAttr");
-    }
-    auto& impl = castedThis->wrapped();
+    UNUSED_PARAM(state);
+    auto& impl = thisObject->wrapped();
     JSValue result = jsNumber(impl.enforceRangeShortAttr());
-    return JSValue::encode(result);
+    return result;
 }
 
+static inline JSValue jsTestObjUnsignedShortAttrGetter(ExecState*, JSTestObj*, ThrowScope& throwScope);
 
 EncodedJSValue jsTestObjUnsignedShortAttr(ExecState* state, EncodedJSValue thisValue, PropertyName)
 {
-    VM& vm = state->vm();
-    auto throwScope = DECLARE_THROW_SCOPE(vm);
+    return BindingCaller<JSTestObj>::attribute<jsTestObjUnsignedShortAttrGetter>(state, thisValue, "unsignedShortAttr");
+}
+
+static inline JSValue jsTestObjUnsignedShortAttrGetter(ExecState* state, JSTestObj* thisObject, ThrowScope& throwScope)
+{
     UNUSED_PARAM(throwScope);
-    UNUSED_PARAM(thisValue);
-    JSValue decodedThisValue = JSValue::decode(thisValue);
-    auto* castedThis = jsDynamicCast<JSTestObj*>(decodedThisValue);
-    if (UNLIKELY(!castedThis)) {
-        return throwGetterTypeError(*state, throwScope, "TestObject", "unsignedShortAttr");
-    }
-    auto& impl = castedThis->wrapped();
+    UNUSED_PARAM(state);
+    auto& impl = thisObject->wrapped();
     JSValue result = jsNumber(impl.unsignedShortAttr());
-    return JSValue::encode(result);
+    return result;
 }
 
+static inline JSValue jsTestObjLongAttrGetter(ExecState*, JSTestObj*, ThrowScope& throwScope);
 
 EncodedJSValue jsTestObjLongAttr(ExecState* state, EncodedJSValue thisValue, PropertyName)
 {
-    VM& vm = state->vm();
-    auto throwScope = DECLARE_THROW_SCOPE(vm);
+    return BindingCaller<JSTestObj>::attribute<jsTestObjLongAttrGetter>(state, thisValue, "longAttr");
+}
+
+static inline JSValue jsTestObjLongAttrGetter(ExecState* state, JSTestObj* thisObject, ThrowScope& throwScope)
+{
     UNUSED_PARAM(throwScope);
-    UNUSED_PARAM(thisValue);
-    JSValue decodedThisValue = JSValue::decode(thisValue);
-    auto* castedThis = jsDynamicCast<JSTestObj*>(decodedThisValue);
-    if (UNLIKELY(!castedThis)) {
-        return throwGetterTypeError(*state, throwScope, "TestObject", "longAttr");
-    }
-    auto& impl = castedThis->wrapped();
+    UNUSED_PARAM(state);
+    auto& impl = thisObject->wrapped();
     JSValue result = jsNumber(impl.longAttr());
-    return JSValue::encode(result);
+    return result;
 }
 
+static inline JSValue jsTestObjLongLongAttrGetter(ExecState*, JSTestObj*, ThrowScope& throwScope);
 
 EncodedJSValue jsTestObjLongLongAttr(ExecState* state, EncodedJSValue thisValue, PropertyName)
 {
-    VM& vm = state->vm();
-    auto throwScope = DECLARE_THROW_SCOPE(vm);
+    return BindingCaller<JSTestObj>::attribute<jsTestObjLongLongAttrGetter>(state, thisValue, "longLongAttr");
+}
+
+static inline JSValue jsTestObjLongLongAttrGetter(ExecState* state, JSTestObj* thisObject, ThrowScope& throwScope)
+{
     UNUSED_PARAM(throwScope);
-    UNUSED_PARAM(thisValue);
-    JSValue decodedThisValue = JSValue::decode(thisValue);
-    auto* castedThis = jsDynamicCast<JSTestObj*>(decodedThisValue);
-    if (UNLIKELY(!castedThis)) {
-        return throwGetterTypeError(*state, throwScope, "TestObject", "longLongAttr");
-    }
-    auto& impl = castedThis->wrapped();
+    UNUSED_PARAM(state);
+    auto& impl = thisObject->wrapped();
     JSValue result = jsNumber(impl.longLongAttr());
-    return JSValue::encode(result);
+    return result;
 }
 
+static inline JSValue jsTestObjUnsignedLongLongAttrGetter(ExecState*, JSTestObj*, ThrowScope& throwScope);
 
 EncodedJSValue jsTestObjUnsignedLongLongAttr(ExecState* state, EncodedJSValue thisValue, PropertyName)
 {
-    VM& vm = state->vm();
-    auto throwScope = DECLARE_THROW_SCOPE(vm);
+    return BindingCaller<JSTestObj>::attribute<jsTestObjUnsignedLongLongAttrGetter>(state, thisValue, "unsignedLongLongAttr");
+}
+
+static inline JSValue jsTestObjUnsignedLongLongAttrGetter(ExecState* state, JSTestObj* thisObject, ThrowScope& throwScope)
+{
     UNUSED_PARAM(throwScope);
-    UNUSED_PARAM(thisValue);
-    JSValue decodedThisValue = JSValue::decode(thisValue);
-    auto* castedThis = jsDynamicCast<JSTestObj*>(decodedThisValue);
-    if (UNLIKELY(!castedThis)) {
-        return throwGetterTypeError(*state, throwScope, "TestObject", "unsignedLongLongAttr");
-    }
-    auto& impl = castedThis->wrapped();
+    UNUSED_PARAM(state);
+    auto& impl = thisObject->wrapped();
     JSValue result = jsNumber(impl.unsignedLongLongAttr());
-    return JSValue::encode(result);
+    return result;
 }
 
+static inline JSValue jsTestObjStringAttrGetter(ExecState*, JSTestObj*, ThrowScope& throwScope);
 
 EncodedJSValue jsTestObjStringAttr(ExecState* state, EncodedJSValue thisValue, PropertyName)
 {
-    VM& vm = state->vm();
-    auto throwScope = DECLARE_THROW_SCOPE(vm);
+    return BindingCaller<JSTestObj>::attribute<jsTestObjStringAttrGetter>(state, thisValue, "stringAttr");
+}
+
+static inline JSValue jsTestObjStringAttrGetter(ExecState* state, JSTestObj* thisObject, ThrowScope& throwScope)
+{
     UNUSED_PARAM(throwScope);
-    UNUSED_PARAM(thisValue);
-    JSValue decodedThisValue = JSValue::decode(thisValue);
-    auto* castedThis = jsDynamicCast<JSTestObj*>(decodedThisValue);
-    if (UNLIKELY(!castedThis)) {
-        return throwGetterTypeError(*state, throwScope, "TestObject", "stringAttr");
-    }
-    auto& impl = castedThis->wrapped();
+    UNUSED_PARAM(state);
+    auto& impl = thisObject->wrapped();
     JSValue result = jsStringWithCache(state, impl.stringAttr());
-    return JSValue::encode(result);
+    return result;
 }
 
+static inline JSValue jsTestObjUsvstringAttrGetter(ExecState*, JSTestObj*, ThrowScope& throwScope);
 
 EncodedJSValue jsTestObjUsvstringAttr(ExecState* state, EncodedJSValue thisValue, PropertyName)
 {
-    VM& vm = state->vm();
-    auto throwScope = DECLARE_THROW_SCOPE(vm);
+    return BindingCaller<JSTestObj>::attribute<jsTestObjUsvstringAttrGetter>(state, thisValue, "usvstringAttr");
+}
+
+static inline JSValue jsTestObjUsvstringAttrGetter(ExecState* state, JSTestObj* thisObject, ThrowScope& throwScope)
+{
     UNUSED_PARAM(throwScope);
-    UNUSED_PARAM(thisValue);
-    JSValue decodedThisValue = JSValue::decode(thisValue);
-    auto* castedThis = jsDynamicCast<JSTestObj*>(decodedThisValue);
-    if (UNLIKELY(!castedThis)) {
-        return throwGetterTypeError(*state, throwScope, "TestObject", "usvstringAttr");
-    }
-    auto& impl = castedThis->wrapped();
+    UNUSED_PARAM(state);
+    auto& impl = thisObject->wrapped();
     JSValue result = jsStringWithCache(state, impl.usvstringAttr());
-    return JSValue::encode(result);
+    return result;
 }
 
+static inline JSValue jsTestObjTestObjAttrGetter(ExecState*, JSTestObj*, ThrowScope& throwScope);
 
 EncodedJSValue jsTestObjTestObjAttr(ExecState* state, EncodedJSValue thisValue, PropertyName)
 {
-    VM& vm = state->vm();
-    auto throwScope = DECLARE_THROW_SCOPE(vm);
+    return BindingCaller<JSTestObj>::attribute<jsTestObjTestObjAttrGetter>(state, thisValue, "testObjAttr");
+}
+
+static inline JSValue jsTestObjTestObjAttrGetter(ExecState* state, JSTestObj* thisObject, ThrowScope& throwScope)
+{
     UNUSED_PARAM(throwScope);
-    UNUSED_PARAM(thisValue);
-    JSValue decodedThisValue = JSValue::decode(thisValue);
-    auto* castedThis = jsDynamicCast<JSTestObj*>(decodedThisValue);
-    if (UNLIKELY(!castedThis)) {
-        return throwGetterTypeError(*state, throwScope, "TestObject", "testObjAttr");
-    }
-    auto& impl = castedThis->wrapped();
-    JSValue result = toJS(state, castedThis->globalObject(), impl.testObjAttr());
-    return JSValue::encode(result);
+    UNUSED_PARAM(state);
+    auto& impl = thisObject->wrapped();
+    JSValue result = toJS(state, thisObject->globalObject(), impl.testObjAttr());
+    return result;
 }
 
+static inline JSValue jsTestObjTestNullableObjAttrGetter(ExecState*, JSTestObj*, ThrowScope& throwScope);
 
 EncodedJSValue jsTestObjTestNullableObjAttr(ExecState* state, EncodedJSValue thisValue, PropertyName)
 {
-    VM& vm = state->vm();
-    auto throwScope = DECLARE_THROW_SCOPE(vm);
+    return BindingCaller<JSTestObj>::attribute<jsTestObjTestNullableObjAttrGetter>(state, thisValue, "testNullableObjAttr");
+}
+
+static inline JSValue jsTestObjTestNullableObjAttrGetter(ExecState* state, JSTestObj* thisObject, ThrowScope& throwScope)
+{
     UNUSED_PARAM(throwScope);
-    UNUSED_PARAM(thisValue);
-    JSValue decodedThisValue = JSValue::decode(thisValue);
-    auto* castedThis = jsDynamicCast<JSTestObj*>(decodedThisValue);
-    if (UNLIKELY(!castedThis)) {
-        return throwGetterTypeError(*state, throwScope, "TestObject", "testNullableObjAttr");
-    }
-    auto& impl = castedThis->wrapped();
-    JSValue result = toJS(state, castedThis->globalObject(), impl.testNullableObjAttr());
-    return JSValue::encode(result);
+    UNUSED_PARAM(state);
+    auto& impl = thisObject->wrapped();
+    JSValue result = toJS(state, thisObject->globalObject(), impl.testNullableObjAttr());
+    return result;
 }
 
+static inline JSValue jsTestObjLenientTestObjAttrGetter(ExecState*, JSTestObj*, ThrowScope& throwScope);
 
 EncodedJSValue jsTestObjLenientTestObjAttr(ExecState* state, EncodedJSValue thisValue, PropertyName)
 {
-    VM& vm = state->vm();
-    auto throwScope = DECLARE_THROW_SCOPE(vm);
+    return BindingCaller<JSTestObj>::attribute<jsTestObjLenientTestObjAttrGetter, CastedThisErrorBehavior::ReturnEarly>(state, thisValue, "lenientTestObjAttr");
+}
+
+static inline JSValue jsTestObjLenientTestObjAttrGetter(ExecState* state, JSTestObj* thisObject, ThrowScope& throwScope)
+{
     UNUSED_PARAM(throwScope);
-    UNUSED_PARAM(thisValue);
-    JSValue decodedThisValue = JSValue::decode(thisValue);
-    auto* castedThis = jsDynamicCast<JSTestObj*>(decodedThisValue);
-    if (UNLIKELY(!castedThis)) {
-        return JSValue::encode(jsUndefined());
-    }
-    auto& impl = castedThis->wrapped();
-    JSValue result = toJS(state, castedThis->globalObject(), impl.lenientTestObjAttr());
-    return JSValue::encode(result);
+    UNUSED_PARAM(state);
+    auto& impl = thisObject->wrapped();
+    JSValue result = toJS(state, thisObject->globalObject(), impl.lenientTestObjAttr());
+    return result;
 }
 
+static inline JSValue jsTestObjUnforgeableAttrGetter(ExecState*, JSTestObj*, ThrowScope& throwScope);
 
 EncodedJSValue jsTestObjUnforgeableAttr(ExecState* state, EncodedJSValue thisValue, PropertyName)
 {
-    VM& vm = state->vm();
-    auto throwScope = DECLARE_THROW_SCOPE(vm);
+    return BindingCaller<JSTestObj>::attribute<jsTestObjUnforgeableAttrGetter>(state, thisValue, "unforgeableAttr");
+}
+
+static inline JSValue jsTestObjUnforgeableAttrGetter(ExecState* state, JSTestObj* thisObject, ThrowScope& throwScope)
+{
     UNUSED_PARAM(throwScope);
-    UNUSED_PARAM(thisValue);
-    JSValue decodedThisValue = JSValue::decode(thisValue);
-    auto* castedThis = jsDynamicCast<JSTestObj*>(decodedThisValue);
-    if (UNLIKELY(!castedThis)) {
-        return throwGetterTypeError(*state, throwScope, "TestObject", "unforgeableAttr");
-    }
-    auto& impl = castedThis->wrapped();
+    UNUSED_PARAM(state);
+    auto& impl = thisObject->wrapped();
     JSValue result = jsStringWithCache(state, impl.unforgeableAttr());
-    return JSValue::encode(result);
+    return result;
 }
 
+static inline JSValue jsTestObjStringAttrTreatingNullAsEmptyStringGetter(ExecState*, JSTestObj*, ThrowScope& throwScope);
 
 EncodedJSValue jsTestObjStringAttrTreatingNullAsEmptyString(ExecState* state, EncodedJSValue thisValue, PropertyName)
 {
-    VM& vm = state->vm();
-    auto throwScope = DECLARE_THROW_SCOPE(vm);
+    return BindingCaller<JSTestObj>::attribute<jsTestObjStringAttrTreatingNullAsEmptyStringGetter>(state, thisValue, "stringAttrTreatingNullAsEmptyString");
+}
+
+static inline JSValue jsTestObjStringAttrTreatingNullAsEmptyStringGetter(ExecState* state, JSTestObj* thisObject, ThrowScope& throwScope)
+{
     UNUSED_PARAM(throwScope);
-    UNUSED_PARAM(thisValue);
-    JSValue decodedThisValue = JSValue::decode(thisValue);
-    auto* castedThis = jsDynamicCast<JSTestObj*>(decodedThisValue);
-    if (UNLIKELY(!castedThis)) {
-        return throwGetterTypeError(*state, throwScope, "TestObject", "stringAttrTreatingNullAsEmptyString");
-    }
-    auto& impl = castedThis->wrapped();
+    UNUSED_PARAM(state);
+    auto& impl = thisObject->wrapped();
     JSValue result = jsStringWithCache(state, impl.stringAttrTreatingNullAsEmptyString());
-    return JSValue::encode(result);
+    return result;
 }
 
+static inline JSValue jsTestObjUsvstringAttrTreatingNullAsEmptyStringGetter(ExecState*, JSTestObj*, ThrowScope& throwScope);
 
 EncodedJSValue jsTestObjUsvstringAttrTreatingNullAsEmptyString(ExecState* state, EncodedJSValue thisValue, PropertyName)
 {
-    VM& vm = state->vm();
-    auto throwScope = DECLARE_THROW_SCOPE(vm);
+    return BindingCaller<JSTestObj>::attribute<jsTestObjUsvstringAttrTreatingNullAsEmptyStringGetter>(state, thisValue, "usvstringAttrTreatingNullAsEmptyString");
+}
+
+static inline JSValue jsTestObjUsvstringAttrTreatingNullAsEmptyStringGetter(ExecState* state, JSTestObj* thisObject, ThrowScope& throwScope)
+{
     UNUSED_PARAM(throwScope);
-    UNUSED_PARAM(thisValue);
-    JSValue decodedThisValue = JSValue::decode(thisValue);
-    auto* castedThis = jsDynamicCast<JSTestObj*>(decodedThisValue);
-    if (UNLIKELY(!castedThis)) {
-        return throwGetterTypeError(*state, throwScope, "TestObject", "usvstringAttrTreatingNullAsEmptyString");
-    }
-    auto& impl = castedThis->wrapped();
+    UNUSED_PARAM(state);
+    auto& impl = thisObject->wrapped();
     JSValue result = jsStringWithCache(state, impl.usvstringAttrTreatingNullAsEmptyString());
-    return JSValue::encode(result);
+    return result;
 }
 
+static inline JSValue jsTestObjImplementationEnumAttrGetter(ExecState*, JSTestObj*, ThrowScope& throwScope);
 
 EncodedJSValue jsTestObjImplementationEnumAttr(ExecState* state, EncodedJSValue thisValue, PropertyName)
 {
-    VM& vm = state->vm();
-    auto throwScope = DECLARE_THROW_SCOPE(vm);
+    return BindingCaller<JSTestObj>::attribute<jsTestObjImplementationEnumAttrGetter>(state, thisValue, "implementationEnumAttr");
+}
+
+static inline JSValue jsTestObjImplementationEnumAttrGetter(ExecState* state, JSTestObj* thisObject, ThrowScope& throwScope)
+{
     UNUSED_PARAM(throwScope);
-    UNUSED_PARAM(thisValue);
-    JSValue decodedThisValue = JSValue::decode(thisValue);
-    auto* castedThis = jsDynamicCast<JSTestObj*>(decodedThisValue);
-    if (UNLIKELY(!castedThis)) {
-        return throwGetterTypeError(*state, throwScope, "TestObject", "implementationEnumAttr");
-    }
-    auto& impl = castedThis->wrapped();
+    UNUSED_PARAM(state);
+    auto& impl = thisObject->wrapped();
     JSValue result = jsStringWithCache(state, impl.implementationEnumAttr());
-    return JSValue::encode(result);
+    return result;
 }
 
+static inline JSValue jsTestObjXMLObjAttrGetter(ExecState*, JSTestObj*, ThrowScope& throwScope);
 
 EncodedJSValue jsTestObjXMLObjAttr(ExecState* state, EncodedJSValue thisValue, PropertyName)
 {
-    VM& vm = state->vm();
-    auto throwScope = DECLARE_THROW_SCOPE(vm);
+    return BindingCaller<JSTestObj>::attribute<jsTestObjXMLObjAttrGetter>(state, thisValue, "XMLObjAttr");
+}
+
+static inline JSValue jsTestObjXMLObjAttrGetter(ExecState* state, JSTestObj* thisObject, ThrowScope& throwScope)
+{
     UNUSED_PARAM(throwScope);
-    UNUSED_PARAM(thisValue);
-    JSValue decodedThisValue = JSValue::decode(thisValue);
-    auto* castedThis = jsDynamicCast<JSTestObj*>(decodedThisValue);
-    if (UNLIKELY(!castedThis)) {
-        return throwGetterTypeError(*state, throwScope, "TestObject", "XMLObjAttr");
-    }
-    auto& impl = castedThis->wrapped();
-    JSValue result = toJS(state, castedThis->globalObject(), impl.xmlObjAttr());
-    return JSValue::encode(result);
+    UNUSED_PARAM(state);
+    auto& impl = thisObject->wrapped();
+    JSValue result = toJS(state, thisObject->globalObject(), impl.xmlObjAttr());
+    return result;
 }
 
+static inline JSValue jsTestObjCreateGetter(ExecState*, JSTestObj*, ThrowScope& throwScope);
 
 EncodedJSValue jsTestObjCreate(ExecState* state, EncodedJSValue thisValue, PropertyName)
 {
-    VM& vm = state->vm();
-    auto throwScope = DECLARE_THROW_SCOPE(vm);
+    return BindingCaller<JSTestObj>::attribute<jsTestObjCreateGetter>(state, thisValue, "create");
+}
+
+static inline JSValue jsTestObjCreateGetter(ExecState* state, JSTestObj* thisObject, ThrowScope& throwScope)
+{
     UNUSED_PARAM(throwScope);
-    UNUSED_PARAM(thisValue);
-    JSValue decodedThisValue = JSValue::decode(thisValue);
-    auto* castedThis = jsDynamicCast<JSTestObj*>(decodedThisValue);
-    if (UNLIKELY(!castedThis)) {
-        return throwGetterTypeError(*state, throwScope, "TestObject", "create");
-    }
-    auto& impl = castedThis->wrapped();
+    UNUSED_PARAM(state);
+    auto& impl = thisObject->wrapped();
     JSValue result = jsBoolean(impl.isCreate());
-    return JSValue::encode(result);
+    return result;
 }
 
+static inline JSValue jsTestObjReflectedStringAttrGetter(ExecState*, JSTestObj*, ThrowScope& throwScope);
 
 EncodedJSValue jsTestObjReflectedStringAttr(ExecState* state, EncodedJSValue thisValue, PropertyName)
 {
-    VM& vm = state->vm();
-    auto throwScope = DECLARE_THROW_SCOPE(vm);
+    return BindingCaller<JSTestObj>::attribute<jsTestObjReflectedStringAttrGetter>(state, thisValue, "reflectedStringAttr");
+}
+
+static inline JSValue jsTestObjReflectedStringAttrGetter(ExecState* state, JSTestObj* thisObject, ThrowScope& throwScope)
+{
     UNUSED_PARAM(throwScope);
-    UNUSED_PARAM(thisValue);
-    JSValue decodedThisValue = JSValue::decode(thisValue);
-    auto* castedThis = jsDynamicCast<JSTestObj*>(decodedThisValue);
-    if (UNLIKELY(!castedThis)) {
-        return throwGetterTypeError(*state, throwScope, "TestObject", "reflectedStringAttr");
-    }
-    auto& impl = castedThis->wrapped();
+    UNUSED_PARAM(state);
+    auto& impl = thisObject->wrapped();
     JSValue result = jsStringWithCache(state, impl.attributeWithoutSynchronization(WebCore::HTMLNames::reflectedstringattrAttr));
-    return JSValue::encode(result);
+    return result;
 }
 
+static inline JSValue jsTestObjReflectedUSVStringAttrGetter(ExecState*, JSTestObj*, ThrowScope& throwScope);
 
 EncodedJSValue jsTestObjReflectedUSVStringAttr(ExecState* state, EncodedJSValue thisValue, PropertyName)
 {
-    VM& vm = state->vm();
-    auto throwScope = DECLARE_THROW_SCOPE(vm);
+    return BindingCaller<JSTestObj>::attribute<jsTestObjReflectedUSVStringAttrGetter>(state, thisValue, "reflectedUSVStringAttr");
+}
+
+static inline JSValue jsTestObjReflectedUSVStringAttrGetter(ExecState* state, JSTestObj* thisObject, ThrowScope& throwScope)
+{
     UNUSED_PARAM(throwScope);
-    UNUSED_PARAM(thisValue);
-    JSValue decodedThisValue = JSValue::decode(thisValue);
-    auto* castedThis = jsDynamicCast<JSTestObj*>(decodedThisValue);
-    if (UNLIKELY(!castedThis)) {
-        return throwGetterTypeError(*state, throwScope, "TestObject", "reflectedUSVStringAttr");
-    }
-    auto& impl = castedThis->wrapped();
+    UNUSED_PARAM(state);
+    auto& impl = thisObject->wrapped();
     JSValue result = jsStringWithCache(state, impl.attributeWithoutSynchronization(WebCore::HTMLNames::reflectedusvstringattrAttr));
-    return JSValue::encode(result);
+    return result;
 }
 
+static inline JSValue jsTestObjReflectedIntegralAttrGetter(ExecState*, JSTestObj*, ThrowScope& throwScope);
 
 EncodedJSValue jsTestObjReflectedIntegralAttr(ExecState* state, EncodedJSValue thisValue, PropertyName)
 {
-    VM& vm = state->vm();
-    auto throwScope = DECLARE_THROW_SCOPE(vm);
+    return BindingCaller<JSTestObj>::attribute<jsTestObjReflectedIntegralAttrGetter>(state, thisValue, "reflectedIntegralAttr");
+}
+
+static inline JSValue jsTestObjReflectedIntegralAttrGetter(ExecState* state, JSTestObj* thisObject, ThrowScope& throwScope)
+{
     UNUSED_PARAM(throwScope);
-    UNUSED_PARAM(thisValue);
-    JSValue decodedThisValue = JSValue::decode(thisValue);
-    auto* castedThis = jsDynamicCast<JSTestObj*>(decodedThisValue);
-    if (UNLIKELY(!castedThis)) {
-        return throwGetterTypeError(*state, throwScope, "TestObject", "reflectedIntegralAttr");
-    }
-    auto& impl = castedThis->wrapped();
+    UNUSED_PARAM(state);
+    auto& impl = thisObject->wrapped();
     JSValue result = jsNumber(impl.getIntegralAttribute(WebCore::HTMLNames::reflectedintegralattrAttr));
-    return JSValue::encode(result);
+    return result;
 }
 
+static inline JSValue jsTestObjReflectedUnsignedIntegralAttrGetter(ExecState*, JSTestObj*, ThrowScope& throwScope);
 
 EncodedJSValue jsTestObjReflectedUnsignedIntegralAttr(ExecState* state, EncodedJSValue thisValue, PropertyName)
 {
-    VM& vm = state->vm();
-    auto throwScope = DECLARE_THROW_SCOPE(vm);
+    return BindingCaller<JSTestObj>::attribute<jsTestObjReflectedUnsignedIntegralAttrGetter>(state, thisValue, "reflectedUnsignedIntegralAttr");
+}
+
+static inline JSValue jsTestObjReflectedUnsignedIntegralAttrGetter(ExecState* state, JSTestObj* thisObject, ThrowScope& throwScope)
+{
     UNUSED_PARAM(throwScope);
-    UNUSED_PARAM(thisValue);
-    JSValue decodedThisValue = JSValue::decode(thisValue);
-    auto* castedThis = jsDynamicCast<JSTestObj*>(decodedThisValue);
-    if (UNLIKELY(!castedThis)) {
-        return throwGetterTypeError(*state, throwScope, "TestObject", "reflectedUnsignedIntegralAttr");
-    }
-    auto& impl = castedThis->wrapped();
+    UNUSED_PARAM(state);
+    auto& impl = thisObject->wrapped();
     JSValue result = jsNumber(std::max(0, impl.getIntegralAttribute(WebCore::HTMLNames::reflectedunsignedintegralattrAttr)));
-    return JSValue::encode(result);
+    return result;
 }
 
+static inline JSValue jsTestObjReflectedBooleanAttrGetter(ExecState*, JSTestObj*, ThrowScope& throwScope);
 
 EncodedJSValue jsTestObjReflectedBooleanAttr(ExecState* state, EncodedJSValue thisValue, PropertyName)
 {
-    VM& vm = state->vm();
-    auto throwScope = DECLARE_THROW_SCOPE(vm);
+    return BindingCaller<JSTestObj>::attribute<jsTestObjReflectedBooleanAttrGetter>(state, thisValue, "reflectedBooleanAttr");
+}
+
+static inline JSValue jsTestObjReflectedBooleanAttrGetter(ExecState* state, JSTestObj* thisObject, ThrowScope& throwScope)
+{
     UNUSED_PARAM(throwScope);
-    UNUSED_PARAM(thisValue);
-    JSValue decodedThisValue = JSValue::decode(thisValue);
-    auto* castedThis = jsDynamicCast<JSTestObj*>(decodedThisValue);
-    if (UNLIKELY(!castedThis)) {
-        return throwGetterTypeError(*state, throwScope, "TestObject", "reflectedBooleanAttr");
-    }
-    auto& impl = castedThis->wrapped();
+    UNUSED_PARAM(state);
+    auto& impl = thisObject->wrapped();
     JSValue result = jsBoolean(impl.hasAttributeWithoutSynchronization(WebCore::HTMLNames::reflectedbooleanattrAttr));
-    return JSValue::encode(result);
+    return result;
 }
 
+static inline JSValue jsTestObjReflectedURLAttrGetter(ExecState*, JSTestObj*, ThrowScope& throwScope);
 
 EncodedJSValue jsTestObjReflectedURLAttr(ExecState* state, EncodedJSValue thisValue, PropertyName)
 {
-    VM& vm = state->vm();
-    auto throwScope = DECLARE_THROW_SCOPE(vm);
+    return BindingCaller<JSTestObj>::attribute<jsTestObjReflectedURLAttrGetter>(state, thisValue, "reflectedURLAttr");
+}
+
+static inline JSValue jsTestObjReflectedURLAttrGetter(ExecState* state, JSTestObj* thisObject, ThrowScope& throwScope)
+{
     UNUSED_PARAM(throwScope);
-    UNUSED_PARAM(thisValue);
-    JSValue decodedThisValue = JSValue::decode(thisValue);
-    auto* castedThis = jsDynamicCast<JSTestObj*>(decodedThisValue);
-    if (UNLIKELY(!castedThis)) {
-        return throwGetterTypeError(*state, throwScope, "TestObject", "reflectedURLAttr");
-    }
-    auto& impl = castedThis->wrapped();
+    UNUSED_PARAM(state);
+    auto& impl = thisObject->wrapped();
     JSValue result = jsStringWithCache(state, impl.getURLAttribute(WebCore::HTMLNames::reflectedurlattrAttr));
-    return JSValue::encode(result);
+    return result;
 }
 
+static inline JSValue jsTestObjReflectedUSVURLAttrGetter(ExecState*, JSTestObj*, ThrowScope& throwScope);
 
 EncodedJSValue jsTestObjReflectedUSVURLAttr(ExecState* state, EncodedJSValue thisValue, PropertyName)
 {
-    VM& vm = state->vm();
-    auto throwScope = DECLARE_THROW_SCOPE(vm);
+    return BindingCaller<JSTestObj>::attribute<jsTestObjReflectedUSVURLAttrGetter>(state, thisValue, "reflectedUSVURLAttr");
+}
+
+static inline JSValue jsTestObjReflectedUSVURLAttrGetter(ExecState* state, JSTestObj* thisObject, ThrowScope& throwScope)
+{
     UNUSED_PARAM(throwScope);
-    UNUSED_PARAM(thisValue);
-    JSValue decodedThisValue = JSValue::decode(thisValue);
-    auto* castedThis = jsDynamicCast<JSTestObj*>(decodedThisValue);
-    if (UNLIKELY(!castedThis)) {
-        return throwGetterTypeError(*state, throwScope, "TestObject", "reflectedUSVURLAttr");
-    }
-    auto& impl = castedThis->wrapped();
+    UNUSED_PARAM(state);
+    auto& impl = thisObject->wrapped();
     JSValue result = jsStringWithCache(state, impl.getURLAttribute(WebCore::HTMLNames::reflectedusvurlattrAttr));
-    return JSValue::encode(result);
+    return result;
 }
 
+static inline JSValue jsTestObjReflectedStringAttrGetter(ExecState*, JSTestObj*, ThrowScope& throwScope);
 
 EncodedJSValue jsTestObjReflectedStringAttr(ExecState* state, EncodedJSValue thisValue, PropertyName)
 {
-    VM& vm = state->vm();
-    auto throwScope = DECLARE_THROW_SCOPE(vm);
+    return BindingCaller<JSTestObj>::attribute<jsTestObjReflectedStringAttrGetter>(state, thisValue, "reflectedStringAttr");
+}
+
+static inline JSValue jsTestObjReflectedStringAttrGetter(ExecState* state, JSTestObj* thisObject, ThrowScope& throwScope)
+{
     UNUSED_PARAM(throwScope);
-    UNUSED_PARAM(thisValue);
-    JSValue decodedThisValue = JSValue::decode(thisValue);
-    auto* castedThis = jsDynamicCast<JSTestObj*>(decodedThisValue);
-    if (UNLIKELY(!castedThis)) {
-        return throwGetterTypeError(*state, throwScope, "TestObject", "reflectedStringAttr");
-    }
-    auto& impl = castedThis->wrapped();
+    UNUSED_PARAM(state);
+    auto& impl = thisObject->wrapped();
     JSValue result = jsStringWithCache(state, impl.attributeWithoutSynchronization(WebCore::HTMLNames::customContentStringAttrAttr));
-    return JSValue::encode(result);
+    return result;
 }
 
+static inline JSValue jsTestObjReflectedCustomIntegralAttrGetter(ExecState*, JSTestObj*, ThrowScope& throwScope);
 
 EncodedJSValue jsTestObjReflectedCustomIntegralAttr(ExecState* state, EncodedJSValue thisValue, PropertyName)
 {
-    VM& vm = state->vm();
-    auto throwScope = DECLARE_THROW_SCOPE(vm);
+    return BindingCaller<JSTestObj>::attribute<jsTestObjReflectedCustomIntegralAttrGetter>(state, thisValue, "reflectedCustomIntegralAttr");
+}
+
+static inline JSValue jsTestObjReflectedCustomIntegralAttrGetter(ExecState* state, JSTestObj* thisObject, ThrowScope& throwScope)
+{
     UNUSED_PARAM(throwScope);
-    UNUSED_PARAM(thisValue);
-    JSValue decodedThisValue = JSValue::decode(thisValue);
-    auto* castedThis = jsDynamicCast<JSTestObj*>(decodedThisValue);
-    if (UNLIKELY(!castedThis)) {
-        return throwGetterTypeError(*state, throwScope, "TestObject", "reflectedCustomIntegralAttr");
-    }
-    auto& impl = castedThis->wrapped();
+    UNUSED_PARAM(state);
+    auto& impl = thisObject->wrapped();
     JSValue result = jsNumber(impl.getIntegralAttribute(WebCore::HTMLNames::customContentIntegralAttrAttr));
-    return JSValue::encode(result);
+    return result;
 }
 
+static inline JSValue jsTestObjReflectedCustomBooleanAttrGetter(ExecState*, JSTestObj*, ThrowScope& throwScope);
 
 EncodedJSValue jsTestObjReflectedCustomBooleanAttr(ExecState* state, EncodedJSValue thisValue, PropertyName)
 {
-    VM& vm = state->vm();
-    auto throwScope = DECLARE_THROW_SCOPE(vm);
+    return BindingCaller<JSTestObj>::attribute<jsTestObjReflectedCustomBooleanAttrGetter>(state, thisValue, "reflectedCustomBooleanAttr");
+}
+
+static inline JSValue jsTestObjReflectedCustomBooleanAttrGetter(ExecState* state, JSTestObj* thisObject, ThrowScope& throwScope)
+{
     UNUSED_PARAM(throwScope);
-    UNUSED_PARAM(thisValue);
-    JSValue decodedThisValue = JSValue::decode(thisValue);
-    auto* castedThis = jsDynamicCast<JSTestObj*>(decodedThisValue);
-    if (UNLIKELY(!castedThis)) {
-        return throwGetterTypeError(*state, throwScope, "TestObject", "reflectedCustomBooleanAttr");
-    }
-    auto& impl = castedThis->wrapped();
+    UNUSED_PARAM(state);
+    auto& impl = thisObject->wrapped();
     JSValue result = jsBoolean(impl.hasAttributeWithoutSynchronization(WebCore::HTMLNames::customContentBooleanAttrAttr));
-    return JSValue::encode(result);
+    return result;
 }
 
+static inline JSValue jsTestObjReflectedCustomURLAttrGetter(ExecState*, JSTestObj*, ThrowScope& throwScope);
 
 EncodedJSValue jsTestObjReflectedCustomURLAttr(ExecState* state, EncodedJSValue thisValue, PropertyName)
 {
-    VM& vm = state->vm();
-    auto throwScope = DECLARE_THROW_SCOPE(vm);
+    return BindingCaller<JSTestObj>::attribute<jsTestObjReflectedCustomURLAttrGetter>(state, thisValue, "reflectedCustomURLAttr");
+}
+
+static inline JSValue jsTestObjReflectedCustomURLAttrGetter(ExecState* state, JSTestObj* thisObject, ThrowScope& throwScope)
+{
     UNUSED_PARAM(throwScope);
-    UNUSED_PARAM(thisValue);
-    JSValue decodedThisValue = JSValue::decode(thisValue);
-    auto* castedThis = jsDynamicCast<JSTestObj*>(decodedThisValue);
-    if (UNLIKELY(!castedThis)) {
-        return throwGetterTypeError(*state, throwScope, "TestObject", "reflectedCustomURLAttr");
-    }
-    auto& impl = castedThis->wrapped();
+    UNUSED_PARAM(state);
+    auto& impl = thisObject->wrapped();
     JSValue result = jsStringWithCache(state, impl.getURLAttribute(WebCore::HTMLNames::customContentURLAttrAttr));
-    return JSValue::encode(result);
+    return result;
 }
 
-
 #if ENABLE(TEST_FEATURE)
+static inline JSValue jsTestObjEnabledAtRuntimeAttributeGetter(ExecState*, JSTestObj*, ThrowScope& throwScope);
+
 EncodedJSValue jsTestObjEnabledAtRuntimeAttribute(ExecState* state, EncodedJSValue thisValue, PropertyName)
 {
-    VM& vm = state->vm();
-    auto throwScope = DECLARE_THROW_SCOPE(vm);
+    return BindingCaller<JSTestObj>::attribute<jsTestObjEnabledAtRuntimeAttributeGetter>(state, thisValue, "enabledAtRuntimeAttribute");
+}
+
+static inline JSValue jsTestObjEnabledAtRuntimeAttributeGetter(ExecState* state, JSTestObj* thisObject, ThrowScope& throwScope)
+{
     UNUSED_PARAM(throwScope);
-    UNUSED_PARAM(thisValue);
-    JSValue decodedThisValue = JSValue::decode(thisValue);
-    auto* castedThis = jsDynamicCast<JSTestObj*>(decodedThisValue);
-    if (UNLIKELY(!castedThis)) {
-        return throwGetterTypeError(*state, throwScope, "TestObject", "enabledAtRuntimeAttribute");
-    }
-    auto& impl = castedThis->wrapped();
+    UNUSED_PARAM(state);
+    auto& impl = thisObject->wrapped();
     JSValue result = jsStringWithCache(state, impl.enabledAtRuntimeAttribute());
-    return JSValue::encode(result);
+    return result;
 }
 
 #endif
 
+static inline JSValue jsTestObjTypedArrayAttrGetter(ExecState*, JSTestObj*, ThrowScope& throwScope);
+
 EncodedJSValue jsTestObjTypedArrayAttr(ExecState* state, EncodedJSValue thisValue, PropertyName)
 {
-    VM& vm = state->vm();
-    auto throwScope = DECLARE_THROW_SCOPE(vm);
+    return BindingCaller<JSTestObj>::attribute<jsTestObjTypedArrayAttrGetter>(state, thisValue, "typedArrayAttr");
+}
+
+static inline JSValue jsTestObjTypedArrayAttrGetter(ExecState* state, JSTestObj* thisObject, ThrowScope& throwScope)
+{
     UNUSED_PARAM(throwScope);
-    UNUSED_PARAM(thisValue);
-    JSValue decodedThisValue = JSValue::decode(thisValue);
-    auto* castedThis = jsDynamicCast<JSTestObj*>(decodedThisValue);
-    if (UNLIKELY(!castedThis)) {
-        return throwGetterTypeError(*state, throwScope, "TestObject", "typedArrayAttr");
-    }
-    auto& impl = castedThis->wrapped();
-    JSValue result = toJS(state, castedThis->globalObject(), impl.typedArrayAttr());
-    return JSValue::encode(result);
+    UNUSED_PARAM(state);
+    auto& impl = thisObject->wrapped();
+    JSValue result = toJS(state, thisObject->globalObject(), impl.typedArrayAttr());
+    return result;
 }
 
+static inline JSValue jsTestObjAttrWithGetterExceptionGetter(ExecState*, JSTestObj*, ThrowScope& throwScope);
 
 EncodedJSValue jsTestObjAttrWithGetterException(ExecState* state, EncodedJSValue thisValue, PropertyName)
 {
-    VM& vm = state->vm();
-    auto throwScope = DECLARE_THROW_SCOPE(vm);
+    return BindingCaller<JSTestObj>::attribute<jsTestObjAttrWithGetterExceptionGetter>(state, thisValue, "attrWithGetterException");
+}
+
+static inline JSValue jsTestObjAttrWithGetterExceptionGetter(ExecState* state, JSTestObj* thisObject, ThrowScope& throwScope)
+{
     UNUSED_PARAM(throwScope);
-    UNUSED_PARAM(thisValue);
-    JSValue decodedThisValue = JSValue::decode(thisValue);
-    auto* castedThis = jsDynamicCast<JSTestObj*>(decodedThisValue);
-    if (UNLIKELY(!castedThis)) {
-        return throwGetterTypeError(*state, throwScope, "TestObject", "attrWithGetterException");
-    }
+    UNUSED_PARAM(state);
     ExceptionCode ec = 0;
-    auto& impl = castedThis->wrapped();
+    auto& impl = thisObject->wrapped();
     JSValue result = jsNumber(impl.attrWithGetterException(ec));
     setDOMException(state, throwScope, ec);
-    return JSValue::encode(result);
+    return result;
 }
 
+static inline JSValue jsTestObjAttrWithGetterExceptionWithMessageGetter(ExecState*, JSTestObj*, ThrowScope& throwScope);
 
 EncodedJSValue jsTestObjAttrWithGetterExceptionWithMessage(ExecState* state, EncodedJSValue thisValue, PropertyName)
 {
-    VM& vm = state->vm();
-    auto throwScope = DECLARE_THROW_SCOPE(vm);
-    UNUSED_PARAM(throwScope);
-    UNUSED_PARAM(thisValue);
-    JSValue decodedThisValue = JSValue::decode(thisValue);
-    auto* castedThis = jsDynamicCast<JSTestObj*>(decodedThisValue);
-    if (UNLIKELY(!castedThis)) {
-        return throwGetterTypeError(*state, throwScope, "TestObject", "attrWithGetterExceptionWithMessage");
-    }
+    return BindingCaller<JSTestObj>::attribute<jsTestObjAttrWithGetterExceptionWithMessageGetter>(state, thisValue, "attrWithGetterExceptionWithMessage");
+}
+
+static inline JSValue jsTestObjAttrWithGetterExceptionWithMessageGetter(ExecState* state, JSTestObj* thisObject, ThrowScope& throwScope)
+{
+    UNUSED_PARAM(throwScope);
+    UNUSED_PARAM(state);
     ExceptionCodeWithMessage ec;
-    auto& impl = castedThis->wrapped();
+    auto& impl = thisObject->wrapped();
     JSValue result = jsNumber(impl.attrWithGetterExceptionWithMessage(ec));
     setDOMException(state, throwScope, ec);
-    return JSValue::encode(result);
+    return result;
 }
 
+static inline JSValue jsTestObjAttrWithSetterExceptionGetter(ExecState*, JSTestObj*, ThrowScope& throwScope);
 
 EncodedJSValue jsTestObjAttrWithSetterException(ExecState* state, EncodedJSValue thisValue, PropertyName)
 {
-    VM& vm = state->vm();
-    auto throwScope = DECLARE_THROW_SCOPE(vm);
+    return BindingCaller<JSTestObj>::attribute<jsTestObjAttrWithSetterExceptionGetter>(state, thisValue, "attrWithSetterException");
+}
+
+static inline JSValue jsTestObjAttrWithSetterExceptionGetter(ExecState* state, JSTestObj* thisObject, ThrowScope& throwScope)
+{
     UNUSED_PARAM(throwScope);
-    UNUSED_PARAM(thisValue);
-    JSValue decodedThisValue = JSValue::decode(thisValue);
-    auto* castedThis = jsDynamicCast<JSTestObj*>(decodedThisValue);
-    if (UNLIKELY(!castedThis)) {
-        return throwGetterTypeError(*state, throwScope, "TestObject", "attrWithSetterException");
-    }
-    auto& impl = castedThis->wrapped();
+    UNUSED_PARAM(state);
+    auto& impl = thisObject->wrapped();
     JSValue result = jsNumber(impl.attrWithSetterException());
-    return JSValue::encode(result);
+    return result;
 }
 
+static inline JSValue jsTestObjAttrWithSetterExceptionWithMessageGetter(ExecState*, JSTestObj*, ThrowScope& throwScope);
 
 EncodedJSValue jsTestObjAttrWithSetterExceptionWithMessage(ExecState* state, EncodedJSValue thisValue, PropertyName)
 {
-    VM& vm = state->vm();
-    auto throwScope = DECLARE_THROW_SCOPE(vm);
+    return BindingCaller<JSTestObj>::attribute<jsTestObjAttrWithSetterExceptionWithMessageGetter>(state, thisValue, "attrWithSetterExceptionWithMessage");
+}
+
+static inline JSValue jsTestObjAttrWithSetterExceptionWithMessageGetter(ExecState* state, JSTestObj* thisObject, ThrowScope& throwScope)
+{
     UNUSED_PARAM(throwScope);
-    UNUSED_PARAM(thisValue);
-    JSValue decodedThisValue = JSValue::decode(thisValue);
-    auto* castedThis = jsDynamicCast<JSTestObj*>(decodedThisValue);
-    if (UNLIKELY(!castedThis)) {
-        return throwGetterTypeError(*state, throwScope, "TestObject", "attrWithSetterExceptionWithMessage");
-    }
-    auto& impl = castedThis->wrapped();
+    UNUSED_PARAM(state);
+    auto& impl = thisObject->wrapped();
     JSValue result = jsNumber(impl.attrWithSetterExceptionWithMessage());
-    return JSValue::encode(result);
+    return result;
 }
 
+static inline JSValue jsTestObjStringAttrWithGetterExceptionGetter(ExecState*, JSTestObj*, ThrowScope& throwScope);
 
 EncodedJSValue jsTestObjStringAttrWithGetterException(ExecState* state, EncodedJSValue thisValue, PropertyName)
 {
-    VM& vm = state->vm();
-    auto throwScope = DECLARE_THROW_SCOPE(vm);
+    return BindingCaller<JSTestObj>::attribute<jsTestObjStringAttrWithGetterExceptionGetter>(state, thisValue, "stringAttrWithGetterException");
+}
+
+static inline JSValue jsTestObjStringAttrWithGetterExceptionGetter(ExecState* state, JSTestObj* thisObject, ThrowScope& throwScope)
+{
     UNUSED_PARAM(throwScope);
-    UNUSED_PARAM(thisValue);
-    JSValue decodedThisValue = JSValue::decode(thisValue);
-    auto* castedThis = jsDynamicCast<JSTestObj*>(decodedThisValue);
-    if (UNLIKELY(!castedThis)) {
-        return throwGetterTypeError(*state, throwScope, "TestObject", "stringAttrWithGetterException");
-    }
+    UNUSED_PARAM(state);
     ExceptionCode ec = 0;
-    auto& impl = castedThis->wrapped();
+    auto& impl = thisObject->wrapped();
     JSValue result = jsStringWithCache(state, impl.stringAttrWithGetterException(ec));
     setDOMException(state, throwScope, ec);
-    return JSValue::encode(result);
+    return result;
 }
 
+static inline JSValue jsTestObjStringAttrWithSetterExceptionGetter(ExecState*, JSTestObj*, ThrowScope& throwScope);
 
 EncodedJSValue jsTestObjStringAttrWithSetterException(ExecState* state, EncodedJSValue thisValue, PropertyName)
 {
-    VM& vm = state->vm();
-    auto throwScope = DECLARE_THROW_SCOPE(vm);
+    return BindingCaller<JSTestObj>::attribute<jsTestObjStringAttrWithSetterExceptionGetter>(state, thisValue, "stringAttrWithSetterException");
+}
+
+static inline JSValue jsTestObjStringAttrWithSetterExceptionGetter(ExecState* state, JSTestObj* thisObject, ThrowScope& throwScope)
+{
     UNUSED_PARAM(throwScope);
-    UNUSED_PARAM(thisValue);
-    JSValue decodedThisValue = JSValue::decode(thisValue);
-    auto* castedThis = jsDynamicCast<JSTestObj*>(decodedThisValue);
-    if (UNLIKELY(!castedThis)) {
-        return throwGetterTypeError(*state, throwScope, "TestObject", "stringAttrWithSetterException");
-    }
-    auto& impl = castedThis->wrapped();
+    UNUSED_PARAM(state);
+    auto& impl = thisObject->wrapped();
     JSValue result = jsStringWithCache(state, impl.stringAttrWithSetterException());
-    return JSValue::encode(result);
+    return result;
 }
 
+static inline JSValue jsTestObjCustomAttrGetter(ExecState*, JSTestObj*, ThrowScope& throwScope);
 
 EncodedJSValue jsTestObjCustomAttr(ExecState* state, EncodedJSValue thisValue, PropertyName)
 {
-    VM& vm = state->vm();
-    auto throwScope = DECLARE_THROW_SCOPE(vm);
+    return BindingCaller<JSTestObj>::attribute<jsTestObjCustomAttrGetter>(state, thisValue, "customAttr");
+}
+
+static inline JSValue jsTestObjCustomAttrGetter(ExecState* state, JSTestObj* thisObject, ThrowScope& throwScope)
+{
     UNUSED_PARAM(throwScope);
-    UNUSED_PARAM(thisValue);
-    JSValue decodedThisValue = JSValue::decode(thisValue);
-    auto* castedThis = jsDynamicCast<JSTestObj*>(decodedThisValue);
-    if (UNLIKELY(!castedThis)) {
-        return throwGetterTypeError(*state, throwScope, "TestObject", "customAttr");
-    }
-    return JSValue::encode(castedThis->customAttr(*state));
+    UNUSED_PARAM(state);
+    return thisObject->customAttr(*state);
 }
 
+static inline JSValue jsTestObjOnfooGetter(ExecState*, JSTestObj*, ThrowScope& throwScope);
 
 EncodedJSValue jsTestObjOnfoo(ExecState* state, EncodedJSValue thisValue, PropertyName)
 {
-    VM& vm = state->vm();
-    auto throwScope = DECLARE_THROW_SCOPE(vm);
+    return BindingCaller<JSTestObj>::attribute<jsTestObjOnfooGetter>(state, thisValue, "onfoo");
+}
+
+static inline JSValue jsTestObjOnfooGetter(ExecState* state, JSTestObj* thisObject, ThrowScope& throwScope)
+{
     UNUSED_PARAM(throwScope);
-    UNUSED_PARAM(thisValue);
-    JSValue decodedThisValue = JSValue::decode(thisValue);
-    auto* castedThis = jsDynamicCast<JSTestObj*>(decodedThisValue);
-    if (UNLIKELY(!castedThis)) {
-        return throwGetterTypeError(*state, throwScope, "TestObject", "onfoo");
-    }
     UNUSED_PARAM(state);
-    return JSValue::encode(eventHandlerAttribute(castedThis->wrapped(), eventNames().fooEvent));
+    return eventHandlerAttribute(thisObject->wrapped(), eventNames().fooEvent);
 }
 
+static inline JSValue jsTestObjOnwebkitfooGetter(ExecState*, JSTestObj*, ThrowScope& throwScope);
 
 EncodedJSValue jsTestObjOnwebkitfoo(ExecState* state, EncodedJSValue thisValue, PropertyName)
 {
-    VM& vm = state->vm();
-    auto throwScope = DECLARE_THROW_SCOPE(vm);
+    return BindingCaller<JSTestObj>::attribute<jsTestObjOnwebkitfooGetter>(state, thisValue, "onwebkitfoo");
+}
+
+static inline JSValue jsTestObjOnwebkitfooGetter(ExecState* state, JSTestObj* thisObject, ThrowScope& throwScope)
+{
     UNUSED_PARAM(throwScope);
-    UNUSED_PARAM(thisValue);
-    JSValue decodedThisValue = JSValue::decode(thisValue);
-    auto* castedThis = jsDynamicCast<JSTestObj*>(decodedThisValue);
-    if (UNLIKELY(!castedThis)) {
-        return throwGetterTypeError(*state, throwScope, "TestObject", "onwebkitfoo");
-    }
     UNUSED_PARAM(state);
-    return JSValue::encode(eventHandlerAttribute(castedThis->wrapped(), eventNames().fooEvent));
+    return eventHandlerAttribute(thisObject->wrapped(), eventNames().fooEvent);
 }
 
+static inline JSValue jsTestObjWithScriptStateAttributeGetter(ExecState*, JSTestObj*, ThrowScope& throwScope);
 
 EncodedJSValue jsTestObjWithScriptStateAttribute(ExecState* state, EncodedJSValue thisValue, PropertyName)
 {
-    VM& vm = state->vm();
-    auto throwScope = DECLARE_THROW_SCOPE(vm);
+    return BindingCaller<JSTestObj>::attribute<jsTestObjWithScriptStateAttributeGetter>(state, thisValue, "withScriptStateAttribute");
+}
+
+static inline JSValue jsTestObjWithScriptStateAttributeGetter(ExecState* state, JSTestObj* thisObject, ThrowScope& throwScope)
+{
     UNUSED_PARAM(throwScope);
-    UNUSED_PARAM(thisValue);
-    JSValue decodedThisValue = JSValue::decode(thisValue);
-    auto* castedThis = jsDynamicCast<JSTestObj*>(decodedThisValue);
-    if (UNLIKELY(!castedThis)) {
-        return throwGetterTypeError(*state, throwScope, "TestObject", "withScriptStateAttribute");
-    }
-    auto& impl = castedThis->wrapped();
+    UNUSED_PARAM(state);
+    auto& impl = thisObject->wrapped();
     JSValue result = jsNumber(impl.withScriptStateAttribute(*state));
-    return JSValue::encode(result);
+    return result;
 }
 
+static inline JSValue jsTestObjWithCallWithAndSetterCallWithAttributeGetter(ExecState*, JSTestObj*, ThrowScope& throwScope);
 
 EncodedJSValue jsTestObjWithCallWithAndSetterCallWithAttribute(ExecState* state, EncodedJSValue thisValue, PropertyName)
 {
-    VM& vm = state->vm();
-    auto throwScope = DECLARE_THROW_SCOPE(vm);
+    return BindingCaller<JSTestObj>::attribute<jsTestObjWithCallWithAndSetterCallWithAttributeGetter>(state, thisValue, "withCallWithAndSetterCallWithAttribute");
+}
+
+static inline JSValue jsTestObjWithCallWithAndSetterCallWithAttributeGetter(ExecState* state, JSTestObj* thisObject, ThrowScope& throwScope)
+{
     UNUSED_PARAM(throwScope);
-    UNUSED_PARAM(thisValue);
-    JSValue decodedThisValue = JSValue::decode(thisValue);
-    auto* castedThis = jsDynamicCast<JSTestObj*>(decodedThisValue);
-    if (UNLIKELY(!castedThis)) {
-        return throwGetterTypeError(*state, throwScope, "TestObject", "withCallWithAndSetterCallWithAttribute");
-    }
-    auto& impl = castedThis->wrapped();
+    UNUSED_PARAM(state);
+    auto& impl = thisObject->wrapped();
     JSValue result = jsNumber(impl.withCallWithAndSetterCallWithAttribute(*state));
-    return JSValue::encode(result);
+    return result;
 }
 
+static inline JSValue jsTestObjWithScriptExecutionContextAttributeGetter(ExecState*, JSTestObj*, ThrowScope& throwScope);
 
 EncodedJSValue jsTestObjWithScriptExecutionContextAttribute(ExecState* state, EncodedJSValue thisValue, PropertyName)
 {
-    VM& vm = state->vm();
-    auto throwScope = DECLARE_THROW_SCOPE(vm);
+    return BindingCaller<JSTestObj>::attribute<jsTestObjWithScriptExecutionContextAttributeGetter>(state, thisValue, "withScriptExecutionContextAttribute");
+}
+
+static inline JSValue jsTestObjWithScriptExecutionContextAttributeGetter(ExecState* state, JSTestObj* thisObject, ThrowScope& throwScope)
+{
     UNUSED_PARAM(throwScope);
-    UNUSED_PARAM(thisValue);
-    JSValue decodedThisValue = JSValue::decode(thisValue);
-    auto* castedThis = jsDynamicCast<JSTestObj*>(decodedThisValue);
-    if (UNLIKELY(!castedThis)) {
-        return throwGetterTypeError(*state, throwScope, "TestObject", "withScriptExecutionContextAttribute");
-    }
+    UNUSED_PARAM(state);
     auto* context = jsCast<JSDOMGlobalObject*>(state->lexicalGlobalObject())->scriptExecutionContext();
     if (!context)
-        return JSValue::encode(jsUndefined());
-    auto& impl = castedThis->wrapped();
-    JSValue result = toJS(state, castedThis->globalObject(), impl.withScriptExecutionContextAttribute(*context));
-    return JSValue::encode(result);
+        return jsUndefined();
+    auto& impl = thisObject->wrapped();
+    JSValue result = toJS(state, thisObject->globalObject(), impl.withScriptExecutionContextAttribute(*context));
+    return result;
 }
 
+static inline JSValue jsTestObjWithScriptStateAttributeRaisesGetter(ExecState*, JSTestObj*, ThrowScope& throwScope);
 
 EncodedJSValue jsTestObjWithScriptStateAttributeRaises(ExecState* state, EncodedJSValue thisValue, PropertyName)
 {
-    VM& vm = state->vm();
-    auto throwScope = DECLARE_THROW_SCOPE(vm);
+    return BindingCaller<JSTestObj>::attribute<jsTestObjWithScriptStateAttributeRaisesGetter>(state, thisValue, "withScriptStateAttributeRaises");
+}
+
+static inline JSValue jsTestObjWithScriptStateAttributeRaisesGetter(ExecState* state, JSTestObj* thisObject, ThrowScope& throwScope)
+{
     UNUSED_PARAM(throwScope);
-    UNUSED_PARAM(thisValue);
-    JSValue decodedThisValue = JSValue::decode(thisValue);
-    auto* castedThis = jsDynamicCast<JSTestObj*>(decodedThisValue);
-    if (UNLIKELY(!castedThis)) {
-        return throwGetterTypeError(*state, throwScope, "TestObject", "withScriptStateAttributeRaises");
-    }
+    UNUSED_PARAM(state);
     ExceptionCode ec = 0;
-    auto& impl = castedThis->wrapped();
-    JSValue result = toJS(state, castedThis->globalObject(), impl.withScriptStateAttributeRaises(*state, ec));
+    auto& impl = thisObject->wrapped();
+    JSValue result = toJS(state, thisObject->globalObject(), impl.withScriptStateAttributeRaises(*state, ec));
     setDOMException(state, throwScope, ec);
-    return JSValue::encode(result);
+    return result;
 }
 
+static inline JSValue jsTestObjWithScriptExecutionContextAttributeRaisesGetter(ExecState*, JSTestObj*, ThrowScope& throwScope);
 
 EncodedJSValue jsTestObjWithScriptExecutionContextAttributeRaises(ExecState* state, EncodedJSValue thisValue, PropertyName)
 {
-    VM& vm = state->vm();
-    auto throwScope = DECLARE_THROW_SCOPE(vm);
+    return BindingCaller<JSTestObj>::attribute<jsTestObjWithScriptExecutionContextAttributeRaisesGetter>(state, thisValue, "withScriptExecutionContextAttributeRaises");
+}
+
+static inline JSValue jsTestObjWithScriptExecutionContextAttributeRaisesGetter(ExecState* state, JSTestObj* thisObject, ThrowScope& throwScope)
+{
     UNUSED_PARAM(throwScope);
-    UNUSED_PARAM(thisValue);
-    JSValue decodedThisValue = JSValue::decode(thisValue);
-    auto* castedThis = jsDynamicCast<JSTestObj*>(decodedThisValue);
-    if (UNLIKELY(!castedThis)) {
-        return throwGetterTypeError(*state, throwScope, "TestObject", "withScriptExecutionContextAttributeRaises");
-    }
+    UNUSED_PARAM(state);
     ExceptionCode ec = 0;
     auto* context = jsCast<JSDOMGlobalObject*>(state->lexicalGlobalObject())->scriptExecutionContext();
     if (!context)
-        return JSValue::encode(jsUndefined());
-    auto& impl = castedThis->wrapped();
-    JSValue result = toJS(state, castedThis->globalObject(), impl.withScriptExecutionContextAttributeRaises(*context, ec));
+        return jsUndefined();
+    auto& impl = thisObject->wrapped();
+    JSValue result = toJS(state, thisObject->globalObject(), impl.withScriptExecutionContextAttributeRaises(*context, ec));
     setDOMException(state, throwScope, ec);
-    return JSValue::encode(result);
+    return result;
 }
 
+static inline JSValue jsTestObjWithScriptExecutionContextAndScriptStateAttributeGetter(ExecState*, JSTestObj*, ThrowScope& throwScope);
 
 EncodedJSValue jsTestObjWithScriptExecutionContextAndScriptStateAttribute(ExecState* state, EncodedJSValue thisValue, PropertyName)
 {
-    VM& vm = state->vm();
-    auto throwScope = DECLARE_THROW_SCOPE(vm);
+    return BindingCaller<JSTestObj>::attribute<jsTestObjWithScriptExecutionContextAndScriptStateAttributeGetter>(state, thisValue, "withScriptExecutionContextAndScriptStateAttribute");
+}
+
+static inline JSValue jsTestObjWithScriptExecutionContextAndScriptStateAttributeGetter(ExecState* state, JSTestObj* thisObject, ThrowScope& throwScope)
+{
     UNUSED_PARAM(throwScope);
-    UNUSED_PARAM(thisValue);
-    JSValue decodedThisValue = JSValue::decode(thisValue);
-    auto* castedThis = jsDynamicCast<JSTestObj*>(decodedThisValue);
-    if (UNLIKELY(!castedThis)) {
-        return throwGetterTypeError(*state, throwScope, "TestObject", "withScriptExecutionContextAndScriptStateAttribute");
-    }
+    UNUSED_PARAM(state);
     auto* context = jsCast<JSDOMGlobalObject*>(state->lexicalGlobalObject())->scriptExecutionContext();
     if (!context)
-        return JSValue::encode(jsUndefined());
-    auto& impl = castedThis->wrapped();
-    JSValue result = toJS(state, castedThis->globalObject(), impl.withScriptExecutionContextAndScriptStateAttribute(*state, *context));
-    return JSValue::encode(result);
+        return jsUndefined();
+    auto& impl = thisObject->wrapped();
+    JSValue result = toJS(state, thisObject->globalObject(), impl.withScriptExecutionContextAndScriptStateAttribute(*state, *context));
+    return result;
 }
 
+static inline JSValue jsTestObjWithScriptExecutionContextAndScriptStateAttributeRaisesGetter(ExecState*, JSTestObj*, ThrowScope& throwScope);
 
 EncodedJSValue jsTestObjWithScriptExecutionContextAndScriptStateAttributeRaises(ExecState* state, EncodedJSValue thisValue, PropertyName)
 {
-    VM& vm = state->vm();
-    auto throwScope = DECLARE_THROW_SCOPE(vm);
+    return BindingCaller<JSTestObj>::attribute<jsTestObjWithScriptExecutionContextAndScriptStateAttributeRaisesGetter>(state, thisValue, "withScriptExecutionContextAndScriptStateAttributeRaises");
+}
+
+static inline JSValue jsTestObjWithScriptExecutionContextAndScriptStateAttributeRaisesGetter(ExecState* state, JSTestObj* thisObject, ThrowScope& throwScope)
+{
     UNUSED_PARAM(throwScope);
-    UNUSED_PARAM(thisValue);
-    JSValue decodedThisValue = JSValue::decode(thisValue);
-    auto* castedThis = jsDynamicCast<JSTestObj*>(decodedThisValue);
-    if (UNLIKELY(!castedThis)) {
-        return throwGetterTypeError(*state, throwScope, "TestObject", "withScriptExecutionContextAndScriptStateAttributeRaises");
-    }
+    UNUSED_PARAM(state);
     ExceptionCode ec = 0;
     auto* context = jsCast<JSDOMGlobalObject*>(state->lexicalGlobalObject())->scriptExecutionContext();
     if (!context)
-        return JSValue::encode(jsUndefined());
-    auto& impl = castedThis->wrapped();
-    JSValue result = toJS(state, castedThis->globalObject(), impl.withScriptExecutionContextAndScriptStateAttributeRaises(*state, *context, ec));
+        return jsUndefined();
+    auto& impl = thisObject->wrapped();
+    JSValue result = toJS(state, thisObject->globalObject(), impl.withScriptExecutionContextAndScriptStateAttributeRaises(*state, *context, ec));
     setDOMException(state, throwScope, ec);
-    return JSValue::encode(result);
+    return result;
 }
 
+static inline JSValue jsTestObjWithScriptExecutionContextAndScriptStateWithSpacesAttributeGetter(ExecState*, JSTestObj*, ThrowScope& throwScope);
 
 EncodedJSValue jsTestObjWithScriptExecutionContextAndScriptStateWithSpacesAttribute(ExecState* state, EncodedJSValue thisValue, PropertyName)
 {
-    VM& vm = state->vm();
-    auto throwScope = DECLARE_THROW_SCOPE(vm);
+    return BindingCaller<JSTestObj>::attribute<jsTestObjWithScriptExecutionContextAndScriptStateWithSpacesAttributeGetter>(state, thisValue, "withScriptExecutionContextAndScriptStateWithSpacesAttribute");
+}
+
+static inline JSValue jsTestObjWithScriptExecutionContextAndScriptStateWithSpacesAttributeGetter(ExecState* state, JSTestObj* thisObject, ThrowScope& throwScope)
+{
     UNUSED_PARAM(throwScope);
-    UNUSED_PARAM(thisValue);
-    JSValue decodedThisValue = JSValue::decode(thisValue);
-    auto* castedThis = jsDynamicCast<JSTestObj*>(decodedThisValue);
-    if (UNLIKELY(!castedThis)) {
-        return throwGetterTypeError(*state, throwScope, "TestObject", "withScriptExecutionContextAndScriptStateWithSpacesAttribute");
-    }
+    UNUSED_PARAM(state);
     auto* context = jsCast<JSDOMGlobalObject*>(state->lexicalGlobalObject())->scriptExecutionContext();
     if (!context)
-        return JSValue::encode(jsUndefined());
-    auto& impl = castedThis->wrapped();
-    JSValue result = toJS(state, castedThis->globalObject(), impl.withScriptExecutionContextAndScriptStateWithSpacesAttribute(*state, *context));
-    return JSValue::encode(result);
+        return jsUndefined();
+    auto& impl = thisObject->wrapped();
+    JSValue result = toJS(state, thisObject->globalObject(), impl.withScriptExecutionContextAndScriptStateWithSpacesAttribute(*state, *context));
+    return result;
 }
 
+static inline JSValue jsTestObjWithScriptArgumentsAndCallStackAttributeGetter(ExecState*, JSTestObj*, ThrowScope& throwScope);
 
 EncodedJSValue jsTestObjWithScriptArgumentsAndCallStackAttribute(ExecState* state, EncodedJSValue thisValue, PropertyName)
 {
-    VM& vm = state->vm();
-    auto throwScope = DECLARE_THROW_SCOPE(vm);
-    UNUSED_PARAM(throwScope);
-    UNUSED_PARAM(thisValue);
-    JSValue decodedThisValue = JSValue::decode(thisValue);
-    auto* castedThis = jsDynamicCast<JSTestObj*>(decodedThisValue);
-    if (UNLIKELY(!castedThis)) {
-        return throwGetterTypeError(*state, throwScope, "TestObject", "withScriptArgumentsAndCallStackAttribute");
-    }
-    auto& impl = castedThis->wrapped();
-    JSValue result = toJS(state, castedThis->globalObject(), impl.withScriptArgumentsAndCallStackAttribute());
-    return JSValue::encode(result);
+    return BindingCaller<JSTestObj>::attribute<jsTestObjWithScriptArgumentsAndCallStackAttributeGetter>(state, thisValue, "withScriptArgumentsAndCallStackAttribute");
 }
 
+static inline JSValue jsTestObjWithScriptArgumentsAndCallStackAttributeGetter(ExecState* state, JSTestObj* thisObject, ThrowScope& throwScope)
+{
+    UNUSED_PARAM(throwScope);
+    UNUSED_PARAM(state);
+    auto& impl = thisObject->wrapped();
+    JSValue result = toJS(state, thisObject->globalObject(), impl.withScriptArgumentsAndCallStackAttribute());
+    return result;
+}
 
 #if ENABLE(Condition1)
+static inline JSValue jsTestObjConditionalAttr1Getter(ExecState*, JSTestObj*, ThrowScope& throwScope);
+
 EncodedJSValue jsTestObjConditionalAttr1(ExecState* state, EncodedJSValue thisValue, PropertyName)
 {
-    VM& vm = state->vm();
-    auto throwScope = DECLARE_THROW_SCOPE(vm);
+    return BindingCaller<JSTestObj>::attribute<jsTestObjConditionalAttr1Getter>(state, thisValue, "conditionalAttr1");
+}
+
+static inline JSValue jsTestObjConditionalAttr1Getter(ExecState* state, JSTestObj* thisObject, ThrowScope& throwScope)
+{
     UNUSED_PARAM(throwScope);
-    UNUSED_PARAM(thisValue);
-    JSValue decodedThisValue = JSValue::decode(thisValue);
-    auto* castedThis = jsDynamicCast<JSTestObj*>(decodedThisValue);
-    if (UNLIKELY(!castedThis)) {
-        return throwGetterTypeError(*state, throwScope, "TestObject", "conditionalAttr1");
-    }
-    auto& impl = castedThis->wrapped();
+    UNUSED_PARAM(state);
+    auto& impl = thisObject->wrapped();
     JSValue result = jsNumber(impl.conditionalAttr1());
-    return JSValue::encode(result);
+    return result;
 }
 
 #endif
 
 #if ENABLE(Condition1) && ENABLE(Condition2)
+static inline JSValue jsTestObjConditionalAttr2Getter(ExecState*, JSTestObj*, ThrowScope& throwScope);
+
 EncodedJSValue jsTestObjConditionalAttr2(ExecState* state, EncodedJSValue thisValue, PropertyName)
 {
-    VM& vm = state->vm();
-    auto throwScope = DECLARE_THROW_SCOPE(vm);
+    return BindingCaller<JSTestObj>::attribute<jsTestObjConditionalAttr2Getter>(state, thisValue, "conditionalAttr2");
+}
+
+static inline JSValue jsTestObjConditionalAttr2Getter(ExecState* state, JSTestObj* thisObject, ThrowScope& throwScope)
+{
     UNUSED_PARAM(throwScope);
-    UNUSED_PARAM(thisValue);
-    JSValue decodedThisValue = JSValue::decode(thisValue);
-    auto* castedThis = jsDynamicCast<JSTestObj*>(decodedThisValue);
-    if (UNLIKELY(!castedThis)) {
-        return throwGetterTypeError(*state, throwScope, "TestObject", "conditionalAttr2");
-    }
-    auto& impl = castedThis->wrapped();
+    UNUSED_PARAM(state);
+    auto& impl = thisObject->wrapped();
     JSValue result = jsNumber(impl.conditionalAttr2());
-    return JSValue::encode(result);
+    return result;
 }
 
 #endif
 
 #if ENABLE(Condition1) || ENABLE(Condition2)
+static inline JSValue jsTestObjConditionalAttr3Getter(ExecState*, JSTestObj*, ThrowScope& throwScope);
+
 EncodedJSValue jsTestObjConditionalAttr3(ExecState* state, EncodedJSValue thisValue, PropertyName)
 {
-    VM& vm = state->vm();
-    auto throwScope = DECLARE_THROW_SCOPE(vm);
+    return BindingCaller<JSTestObj>::attribute<jsTestObjConditionalAttr3Getter>(state, thisValue, "conditionalAttr3");
+}
+
+static inline JSValue jsTestObjConditionalAttr3Getter(ExecState* state, JSTestObj* thisObject, ThrowScope& throwScope)
+{
     UNUSED_PARAM(throwScope);
-    UNUSED_PARAM(thisValue);
-    JSValue decodedThisValue = JSValue::decode(thisValue);
-    auto* castedThis = jsDynamicCast<JSTestObj*>(decodedThisValue);
-    if (UNLIKELY(!castedThis)) {
-        return throwGetterTypeError(*state, throwScope, "TestObject", "conditionalAttr3");
-    }
-    auto& impl = castedThis->wrapped();
+    UNUSED_PARAM(state);
+    auto& impl = thisObject->wrapped();
     JSValue result = jsNumber(impl.conditionalAttr3());
-    return JSValue::encode(result);
+    return result;
 }
 
 #endif
 
 #if ENABLE(Condition1)
+static inline JSValue jsTestObjConditionalAttr4ConstructorGetter(ExecState*, JSTestObj*, ThrowScope& throwScope);
+
 EncodedJSValue jsTestObjConditionalAttr4Constructor(ExecState* state, EncodedJSValue thisValue, PropertyName)
 {
-    VM& vm = state->vm();
-    auto throwScope = DECLARE_THROW_SCOPE(vm);
+    return BindingCaller<JSTestObj>::attribute<jsTestObjConditionalAttr4ConstructorGetter>(state, thisValue, "conditionalAttr4");
+}
+
+static inline JSValue jsTestObjConditionalAttr4ConstructorGetter(ExecState* state, JSTestObj* thisObject, ThrowScope& throwScope)
+{
     UNUSED_PARAM(throwScope);
-    UNUSED_PARAM(thisValue);
-    JSValue decodedThisValue = JSValue::decode(thisValue);
-    auto* castedThis = jsDynamicCast<JSTestObj*>(decodedThisValue);
-    if (UNLIKELY(!castedThis)) {
-        return throwGetterTypeError(*state, throwScope, "TestObject", "conditionalAttr4");
-    }
-    return JSValue::encode(JSTestObjectA::getConstructor(state->vm(), castedThis->globalObject()));
+    UNUSED_PARAM(state);
+    return JSTestObjectA::getConstructor(state->vm(), thisObject->globalObject());
 }
 
 #endif
 
 #if ENABLE(Condition1) && ENABLE(Condition2)
+static inline JSValue jsTestObjConditionalAttr5ConstructorGetter(ExecState*, JSTestObj*, ThrowScope& throwScope);
+
 EncodedJSValue jsTestObjConditionalAttr5Constructor(ExecState* state, EncodedJSValue thisValue, PropertyName)
 {
-    VM& vm = state->vm();
-    auto throwScope = DECLARE_THROW_SCOPE(vm);
+    return BindingCaller<JSTestObj>::attribute<jsTestObjConditionalAttr5ConstructorGetter>(state, thisValue, "conditionalAttr5");
+}
+
+static inline JSValue jsTestObjConditionalAttr5ConstructorGetter(ExecState* state, JSTestObj* thisObject, ThrowScope& throwScope)
+{
     UNUSED_PARAM(throwScope);
-    UNUSED_PARAM(thisValue);
-    JSValue decodedThisValue = JSValue::decode(thisValue);
-    auto* castedThis = jsDynamicCast<JSTestObj*>(decodedThisValue);
-    if (UNLIKELY(!castedThis)) {
-        return throwGetterTypeError(*state, throwScope, "TestObject", "conditionalAttr5");
-    }
-    return JSValue::encode(JSTestObjectB::getConstructor(state->vm(), castedThis->globalObject()));
+    UNUSED_PARAM(state);
+    return JSTestObjectB::getConstructor(state->vm(), thisObject->globalObject());
 }
 
 #endif
 
 #if ENABLE(Condition1) || ENABLE(Condition2)
+static inline JSValue jsTestObjConditionalAttr6ConstructorGetter(ExecState*, JSTestObj*, ThrowScope& throwScope);
+
 EncodedJSValue jsTestObjConditionalAttr6Constructor(ExecState* state, EncodedJSValue thisValue, PropertyName)
 {
-    VM& vm = state->vm();
-    auto throwScope = DECLARE_THROW_SCOPE(vm);
+    return BindingCaller<JSTestObj>::attribute<jsTestObjConditionalAttr6ConstructorGetter>(state, thisValue, "conditionalAttr6");
+}
+
+static inline JSValue jsTestObjConditionalAttr6ConstructorGetter(ExecState* state, JSTestObj* thisObject, ThrowScope& throwScope)
+{
     UNUSED_PARAM(throwScope);
-    UNUSED_PARAM(thisValue);
-    JSValue decodedThisValue = JSValue::decode(thisValue);
-    auto* castedThis = jsDynamicCast<JSTestObj*>(decodedThisValue);
-    if (UNLIKELY(!castedThis)) {
-        return throwGetterTypeError(*state, throwScope, "TestObject", "conditionalAttr6");
-    }
-    return JSValue::encode(JSTestObjectC::getConstructor(state->vm(), castedThis->globalObject()));
+    UNUSED_PARAM(state);
+    return JSTestObjectC::getConstructor(state->vm(), thisObject->globalObject());
 }
 
 #endif
 
+static inline JSValue jsTestObjCachedAttribute1Getter(ExecState*, JSTestObj*, ThrowScope& throwScope);
+
 EncodedJSValue jsTestObjCachedAttribute1(ExecState* state, EncodedJSValue thisValue, PropertyName)
 {
-    VM& vm = state->vm();
-    auto throwScope = DECLARE_THROW_SCOPE(vm);
-    UNUSED_PARAM(throwScope);
-    UNUSED_PARAM(thisValue);
-    JSValue decodedThisValue = JSValue::decode(thisValue);
-    auto* castedThis = jsDynamicCast<JSTestObj*>(decodedThisValue);
-    if (UNLIKELY(!castedThis)) {
-        return throwGetterTypeError(*state, throwScope, "TestObject", "cachedAttribute1");
-    }
-    if (JSValue cachedValue = castedThis->m_cachedAttribute1.get())
-        return JSValue::encode(cachedValue);
-    auto& impl = castedThis->wrapped();
+    return BindingCaller<JSTestObj>::attribute<jsTestObjCachedAttribute1Getter>(state, thisValue, "cachedAttribute1");
+}
+
+static inline JSValue jsTestObjCachedAttribute1Getter(ExecState* state, JSTestObj* thisObject, ThrowScope& throwScope)
+{
+    UNUSED_PARAM(throwScope);
+    UNUSED_PARAM(state);
+    if (JSValue cachedValue = thisObject->m_cachedAttribute1.get())
+        return cachedValue;
+    auto& impl = thisObject->wrapped();
     JSValue result = impl.cachedAttribute1();
-    castedThis->m_cachedAttribute1.set(state->vm(), castedThis, result);
-    return JSValue::encode(result);
+    thisObject->m_cachedAttribute1.set(state->vm(), thisObject, result);
+    return result;
 }
 
+static inline JSValue jsTestObjCachedAttribute2Getter(ExecState*, JSTestObj*, ThrowScope& throwScope);
 
 EncodedJSValue jsTestObjCachedAttribute2(ExecState* state, EncodedJSValue thisValue, PropertyName)
 {
-    VM& vm = state->vm();
-    auto throwScope = DECLARE_THROW_SCOPE(vm);
+    return BindingCaller<JSTestObj>::attribute<jsTestObjCachedAttribute2Getter>(state, thisValue, "cachedAttribute2");
+}
+
+static inline JSValue jsTestObjCachedAttribute2Getter(ExecState* state, JSTestObj* thisObject, ThrowScope& throwScope)
+{
     UNUSED_PARAM(throwScope);
-    UNUSED_PARAM(thisValue);
-    JSValue decodedThisValue = JSValue::decode(thisValue);
-    auto* castedThis = jsDynamicCast<JSTestObj*>(decodedThisValue);
-    if (UNLIKELY(!castedThis)) {
-        return throwGetterTypeError(*state, throwScope, "TestObject", "cachedAttribute2");
-    }
-    if (JSValue cachedValue = castedThis->m_cachedAttribute2.get())
-        return JSValue::encode(cachedValue);
-    auto& impl = castedThis->wrapped();
+    UNUSED_PARAM(state);
+    if (JSValue cachedValue = thisObject->m_cachedAttribute2.get())
+        return cachedValue;
+    auto& impl = thisObject->wrapped();
     JSValue result = impl.cachedAttribute2();
-    castedThis->m_cachedAttribute2.set(state->vm(), castedThis, result);
-    return JSValue::encode(result);
+    thisObject->m_cachedAttribute2.set(state->vm(), thisObject, result);
+    return result;
 }
 
+static inline JSValue jsTestObjAnyAttributeGetter(ExecState*, JSTestObj*, ThrowScope& throwScope);
 
 EncodedJSValue jsTestObjAnyAttribute(ExecState* state, EncodedJSValue thisValue, PropertyName)
 {
-    VM& vm = state->vm();
-    auto throwScope = DECLARE_THROW_SCOPE(vm);
+    return BindingCaller<JSTestObj>::attribute<jsTestObjAnyAttributeGetter>(state, thisValue, "anyAttribute");
+}
+
+static inline JSValue jsTestObjAnyAttributeGetter(ExecState* state, JSTestObj* thisObject, ThrowScope& throwScope)
+{
     UNUSED_PARAM(throwScope);
-    UNUSED_PARAM(thisValue);
-    JSValue decodedThisValue = JSValue::decode(thisValue);
-    auto* castedThis = jsDynamicCast<JSTestObj*>(decodedThisValue);
-    if (UNLIKELY(!castedThis)) {
-        return throwGetterTypeError(*state, throwScope, "TestObject", "anyAttribute");
-    }
-    auto& impl = castedThis->wrapped();
+    UNUSED_PARAM(state);
+    auto& impl = thisObject->wrapped();
     JSValue result = impl.anyAttribute();
-    return JSValue::encode(result);
+    return result;
 }
 
+static inline JSValue jsTestObjContentDocumentGetter(ExecState*, JSTestObj*, ThrowScope& throwScope);
 
 EncodedJSValue jsTestObjContentDocument(ExecState* state, EncodedJSValue thisValue, PropertyName)
 {
-    VM& vm = state->vm();
-    auto throwScope = DECLARE_THROW_SCOPE(vm);
+    return BindingCaller<JSTestObj>::attribute<jsTestObjContentDocumentGetter>(state, thisValue, "contentDocument");
+}
+
+static inline JSValue jsTestObjContentDocumentGetter(ExecState* state, JSTestObj* thisObject, ThrowScope& throwScope)
+{
     UNUSED_PARAM(throwScope);
-    UNUSED_PARAM(thisValue);
-    JSValue decodedThisValue = JSValue::decode(thisValue);
-    auto* castedThis = jsDynamicCast<JSTestObj*>(decodedThisValue);
-    if (UNLIKELY(!castedThis)) {
-        return throwGetterTypeError(*state, throwScope, "TestObject", "contentDocument");
-    }
-    auto& impl = castedThis->wrapped();
-    return JSValue::encode(shouldAllowAccessToNode(state, impl.contentDocument()) ? toJS(state, castedThis->globalObject(), impl.contentDocument()) : jsNull());
+    UNUSED_PARAM(state);
+    auto& impl = thisObject->wrapped();
+    return shouldAllowAccessToNode(state, impl.contentDocument()) ? toJS(state, thisObject->globalObject(), impl.contentDocument()) : jsNull();
 }
 
+static inline JSValue jsTestObjMutablePointGetter(ExecState*, JSTestObj*, ThrowScope& throwScope);
 
 EncodedJSValue jsTestObjMutablePoint(ExecState* state, EncodedJSValue thisValue, PropertyName)
 {
-    VM& vm = state->vm();
-    auto throwScope = DECLARE_THROW_SCOPE(vm);
+    return BindingCaller<JSTestObj>::attribute<jsTestObjMutablePointGetter>(state, thisValue, "mutablePoint");
+}
+
+static inline JSValue jsTestObjMutablePointGetter(ExecState* state, JSTestObj* thisObject, ThrowScope& throwScope)
+{
     UNUSED_PARAM(throwScope);
-    UNUSED_PARAM(thisValue);
-    JSValue decodedThisValue = JSValue::decode(thisValue);
-    auto* castedThis = jsDynamicCast<JSTestObj*>(decodedThisValue);
-    if (UNLIKELY(!castedThis)) {
-        return throwGetterTypeError(*state, throwScope, "TestObject", "mutablePoint");
-    }
-    auto& impl = castedThis->wrapped();
-    JSValue result = toJS(state, castedThis->globalObject(), SVGStaticPropertyTearOff<TestObj, SVGPoint>::create(impl, impl.mutablePoint(), &TestObj::updateMutablePoint));
-    return JSValue::encode(result);
+    UNUSED_PARAM(state);
+    auto& impl = thisObject->wrapped();
+    JSValue result = toJS(state, thisObject->globalObject(), SVGStaticPropertyTearOff<TestObj, SVGPoint>::create(impl, impl.mutablePoint(), &TestObj::updateMutablePoint));
+    return result;
 }
 
+static inline JSValue jsTestObjImmutablePointGetter(ExecState*, JSTestObj*, ThrowScope& throwScope);
 
 EncodedJSValue jsTestObjImmutablePoint(ExecState* state, EncodedJSValue thisValue, PropertyName)
 {
-    VM& vm = state->vm();
-    auto throwScope = DECLARE_THROW_SCOPE(vm);
+    return BindingCaller<JSTestObj>::attribute<jsTestObjImmutablePointGetter>(state, thisValue, "immutablePoint");
+}
+
+static inline JSValue jsTestObjImmutablePointGetter(ExecState* state, JSTestObj* thisObject, ThrowScope& throwScope)
+{
     UNUSED_PARAM(throwScope);
-    UNUSED_PARAM(thisValue);
-    JSValue decodedThisValue = JSValue::decode(thisValue);
-    auto* castedThis = jsDynamicCast<JSTestObj*>(decodedThisValue);
-    if (UNLIKELY(!castedThis)) {
-        return throwGetterTypeError(*state, throwScope, "TestObject", "immutablePoint");
-    }
-    auto& impl = castedThis->wrapped();
-    JSValue result = toJS(state, castedThis->globalObject(), SVGPropertyTearOff<SVGPoint>::create(impl.immutablePoint()));
-    return JSValue::encode(result);
+    UNUSED_PARAM(state);
+    auto& impl = thisObject->wrapped();
+    JSValue result = toJS(state, thisObject->globalObject(), SVGPropertyTearOff<SVGPoint>::create(impl.immutablePoint()));
+    return result;
 }
 
+static inline JSValue jsTestObjStrawberryGetter(ExecState*, JSTestObj*, ThrowScope& throwScope);
 
 EncodedJSValue jsTestObjStrawberry(ExecState* state, EncodedJSValue thisValue, PropertyName)
 {
-    VM& vm = state->vm();
-    auto throwScope = DECLARE_THROW_SCOPE(vm);
+    return BindingCaller<JSTestObj>::attribute<jsTestObjStrawberryGetter>(state, thisValue, "strawberry");
+}
+
+static inline JSValue jsTestObjStrawberryGetter(ExecState* state, JSTestObj* thisObject, ThrowScope& throwScope)
+{
     UNUSED_PARAM(throwScope);
-    UNUSED_PARAM(thisValue);
-    JSValue decodedThisValue = JSValue::decode(thisValue);
-    auto* castedThis = jsDynamicCast<JSTestObj*>(decodedThisValue);
-    if (UNLIKELY(!castedThis)) {
-        return throwGetterTypeError(*state, throwScope, "TestObject", "strawberry");
-    }
-    auto& impl = castedThis->wrapped();
+    UNUSED_PARAM(state);
+    auto& impl = thisObject->wrapped();
     JSValue result = jsNumber(impl.blueberry());
-    return JSValue::encode(result);
+    return result;
 }
 
+static inline JSValue jsTestObjDescriptionGetter(ExecState*, JSTestObj*, ThrowScope& throwScope);
 
 EncodedJSValue jsTestObjDescription(ExecState* state, EncodedJSValue thisValue, PropertyName)
 {
-    VM& vm = state->vm();
-    auto throwScope = DECLARE_THROW_SCOPE(vm);
+    return BindingCaller<JSTestObj>::attribute<jsTestObjDescriptionGetter>(state, thisValue, "description");
+}
+
+static inline JSValue jsTestObjDescriptionGetter(ExecState* state, JSTestObj* thisObject, ThrowScope& throwScope)
+{
     UNUSED_PARAM(throwScope);
-    UNUSED_PARAM(thisValue);
-    JSValue decodedThisValue = JSValue::decode(thisValue);
-    auto* castedThis = jsDynamicCast<JSTestObj*>(decodedThisValue);
-    if (UNLIKELY(!castedThis)) {
-        return throwGetterTypeError(*state, throwScope, "TestObject", "description");
-    }
-    auto& impl = castedThis->wrapped();
+    UNUSED_PARAM(state);
+    auto& impl = thisObject->wrapped();
     JSValue result = jsNumber(impl.description());
-    return JSValue::encode(result);
+    return result;
 }
 
+static inline JSValue jsTestObjIdGetter(ExecState*, JSTestObj*, ThrowScope& throwScope);
 
 EncodedJSValue jsTestObjId(ExecState* state, EncodedJSValue thisValue, PropertyName)
 {
-    VM& vm = state->vm();
-    auto throwScope = DECLARE_THROW_SCOPE(vm);
+    return BindingCaller<JSTestObj>::attribute<jsTestObjIdGetter>(state, thisValue, "id");
+}
+
+static inline JSValue jsTestObjIdGetter(ExecState* state, JSTestObj* thisObject, ThrowScope& throwScope)
+{
     UNUSED_PARAM(throwScope);
-    UNUSED_PARAM(thisValue);
-    JSValue decodedThisValue = JSValue::decode(thisValue);
-    auto* castedThis = jsDynamicCast<JSTestObj*>(decodedThisValue);
-    if (UNLIKELY(!castedThis)) {
-        return throwGetterTypeError(*state, throwScope, "TestObject", "id");
-    }
-    auto& impl = castedThis->wrapped();
+    UNUSED_PARAM(state);
+    auto& impl = thisObject->wrapped();
     JSValue result = jsNumber(impl.id());
-    return JSValue::encode(result);
+    return result;
 }
 
+static inline JSValue jsTestObjHashGetter(ExecState*, JSTestObj*, ThrowScope& throwScope);
 
 EncodedJSValue jsTestObjHash(ExecState* state, EncodedJSValue thisValue, PropertyName)
 {
-    VM& vm = state->vm();
-    auto throwScope = DECLARE_THROW_SCOPE(vm);
+    return BindingCaller<JSTestObj>::attribute<jsTestObjHashGetter>(state, thisValue, "hash");
+}
+
+static inline JSValue jsTestObjHashGetter(ExecState* state, JSTestObj* thisObject, ThrowScope& throwScope)
+{
     UNUSED_PARAM(throwScope);
-    UNUSED_PARAM(thisValue);
-    JSValue decodedThisValue = JSValue::decode(thisValue);
-    auto* castedThis = jsDynamicCast<JSTestObj*>(decodedThisValue);
-    if (UNLIKELY(!castedThis)) {
-        return throwGetterTypeError(*state, throwScope, "TestObject", "hash");
-    }
-    auto& impl = castedThis->wrapped();
+    UNUSED_PARAM(state);
+    auto& impl = thisObject->wrapped();
     JSValue result = jsStringWithCache(state, impl.hash());
-    return JSValue::encode(result);
+    return result;
 }
 
+static inline JSValue jsTestObjReplaceableAttributeGetter(ExecState*, JSTestObj*, ThrowScope& throwScope);
 
 EncodedJSValue jsTestObjReplaceableAttribute(ExecState* state, EncodedJSValue thisValue, PropertyName)
 {
-    VM& vm = state->vm();
-    auto throwScope = DECLARE_THROW_SCOPE(vm);
+    return BindingCaller<JSTestObj>::attribute<jsTestObjReplaceableAttributeGetter>(state, thisValue, "replaceableAttribute");
+}
+
+static inline JSValue jsTestObjReplaceableAttributeGetter(ExecState* state, JSTestObj* thisObject, ThrowScope& throwScope)
+{
     UNUSED_PARAM(throwScope);
-    UNUSED_PARAM(thisValue);
-    JSValue decodedThisValue = JSValue::decode(thisValue);
-    auto* castedThis = jsDynamicCast<JSTestObj*>(decodedThisValue);
-    if (UNLIKELY(!castedThis)) {
-        return throwGetterTypeError(*state, throwScope, "TestObject", "replaceableAttribute");
-    }
-    auto& impl = castedThis->wrapped();
+    UNUSED_PARAM(state);
+    auto& impl = thisObject->wrapped();
     JSValue result = jsNumber(impl.replaceableAttribute());
-    return JSValue::encode(result);
+    return result;
 }
 
+static inline JSValue jsTestObjNullableDoubleAttributeGetter(ExecState*, JSTestObj*, ThrowScope& throwScope);
 
 EncodedJSValue jsTestObjNullableDoubleAttribute(ExecState* state, EncodedJSValue thisValue, PropertyName)
 {
-    VM& vm = state->vm();
-    auto throwScope = DECLARE_THROW_SCOPE(vm);
+    return BindingCaller<JSTestObj>::attribute<jsTestObjNullableDoubleAttributeGetter>(state, thisValue, "nullableDoubleAttribute");
+}
+
+static inline JSValue jsTestObjNullableDoubleAttributeGetter(ExecState* state, JSTestObj* thisObject, ThrowScope& throwScope)
+{
     UNUSED_PARAM(throwScope);
-    UNUSED_PARAM(thisValue);
-    JSValue decodedThisValue = JSValue::decode(thisValue);
-    auto* castedThis = jsDynamicCast<JSTestObj*>(decodedThisValue);
-    if (UNLIKELY(!castedThis)) {
-        return throwGetterTypeError(*state, throwScope, "TestObject", "nullableDoubleAttribute");
-    }
-    auto& impl = castedThis->wrapped();
+    UNUSED_PARAM(state);
+    auto& impl = thisObject->wrapped();
     JSValue result = toNullableJSNumber(impl.nullableDoubleAttribute());
-    return JSValue::encode(result);
+    return result;
 }
 
+static inline JSValue jsTestObjNullableLongAttributeGetter(ExecState*, JSTestObj*, ThrowScope& throwScope);
 
 EncodedJSValue jsTestObjNullableLongAttribute(ExecState* state, EncodedJSValue thisValue, PropertyName)
 {
-    VM& vm = state->vm();
-    auto throwScope = DECLARE_THROW_SCOPE(vm);
+    return BindingCaller<JSTestObj>::attribute<jsTestObjNullableLongAttributeGetter>(state, thisValue, "nullableLongAttribute");
+}
+
+static inline JSValue jsTestObjNullableLongAttributeGetter(ExecState* state, JSTestObj* thisObject, ThrowScope& throwScope)
+{
     UNUSED_PARAM(throwScope);
-    UNUSED_PARAM(thisValue);
-    JSValue decodedThisValue = JSValue::decode(thisValue);
-    auto* castedThis = jsDynamicCast<JSTestObj*>(decodedThisValue);
-    if (UNLIKELY(!castedThis)) {
-        return throwGetterTypeError(*state, throwScope, "TestObject", "nullableLongAttribute");
-    }
-    auto& impl = castedThis->wrapped();
+    UNUSED_PARAM(state);
+    auto& impl = thisObject->wrapped();
     JSValue result = toNullableJSNumber(impl.nullableLongAttribute());
-    return JSValue::encode(result);
+    return result;
 }
 
+static inline JSValue jsTestObjNullableBooleanAttributeGetter(ExecState*, JSTestObj*, ThrowScope& throwScope);
 
 EncodedJSValue jsTestObjNullableBooleanAttribute(ExecState* state, EncodedJSValue thisValue, PropertyName)
 {
-    VM& vm = state->vm();
-    auto throwScope = DECLARE_THROW_SCOPE(vm);
+    return BindingCaller<JSTestObj>::attribute<jsTestObjNullableBooleanAttributeGetter>(state, thisValue, "nullableBooleanAttribute");
+}
+
+static inline JSValue jsTestObjNullableBooleanAttributeGetter(ExecState* state, JSTestObj* thisObject, ThrowScope& throwScope)
+{
     UNUSED_PARAM(throwScope);
-    UNUSED_PARAM(thisValue);
-    JSValue decodedThisValue = JSValue::decode(thisValue);
-    auto* castedThis = jsDynamicCast<JSTestObj*>(decodedThisValue);
-    if (UNLIKELY(!castedThis)) {
-        return throwGetterTypeError(*state, throwScope, "TestObject", "nullableBooleanAttribute");
-    }
-    auto& impl = castedThis->wrapped();
+    UNUSED_PARAM(state);
+    auto& impl = thisObject->wrapped();
     JSValue result = jsBoolean(impl.nullableBooleanAttribute());
-    return JSValue::encode(result);
+    return result;
 }
 
+static inline JSValue jsTestObjNullableStringAttributeGetter(ExecState*, JSTestObj*, ThrowScope& throwScope);
 
 EncodedJSValue jsTestObjNullableStringAttribute(ExecState* state, EncodedJSValue thisValue, PropertyName)
 {
-    VM& vm = state->vm();
-    auto throwScope = DECLARE_THROW_SCOPE(vm);
+    return BindingCaller<JSTestObj>::attribute<jsTestObjNullableStringAttributeGetter>(state, thisValue, "nullableStringAttribute");
+}
+
+static inline JSValue jsTestObjNullableStringAttributeGetter(ExecState* state, JSTestObj* thisObject, ThrowScope& throwScope)
+{
     UNUSED_PARAM(throwScope);
-    UNUSED_PARAM(thisValue);
-    JSValue decodedThisValue = JSValue::decode(thisValue);
-    auto* castedThis = jsDynamicCast<JSTestObj*>(decodedThisValue);
-    if (UNLIKELY(!castedThis)) {
-        return throwGetterTypeError(*state, throwScope, "TestObject", "nullableStringAttribute");
-    }
-    auto& impl = castedThis->wrapped();
+    UNUSED_PARAM(state);
+    auto& impl = thisObject->wrapped();
     JSValue result = jsStringOrNull(state, impl.nullableStringAttribute());
-    return JSValue::encode(result);
+    return result;
 }
 
+static inline JSValue jsTestObjNullableLongSettableAttributeGetter(ExecState*, JSTestObj*, ThrowScope& throwScope);
 
 EncodedJSValue jsTestObjNullableLongSettableAttribute(ExecState* state, EncodedJSValue thisValue, PropertyName)
 {
-    VM& vm = state->vm();
-    auto throwScope = DECLARE_THROW_SCOPE(vm);
+    return BindingCaller<JSTestObj>::attribute<jsTestObjNullableLongSettableAttributeGetter>(state, thisValue, "nullableLongSettableAttribute");
+}
+
+static inline JSValue jsTestObjNullableLongSettableAttributeGetter(ExecState* state, JSTestObj* thisObject, ThrowScope& throwScope)
+{
     UNUSED_PARAM(throwScope);
-    UNUSED_PARAM(thisValue);
-    JSValue decodedThisValue = JSValue::decode(thisValue);
-    auto* castedThis = jsDynamicCast<JSTestObj*>(decodedThisValue);
-    if (UNLIKELY(!castedThis)) {
-        return throwGetterTypeError(*state, throwScope, "TestObject", "nullableLongSettableAttribute");
-    }
-    auto& impl = castedThis->wrapped();
+    UNUSED_PARAM(state);
+    auto& impl = thisObject->wrapped();
     JSValue result = toNullableJSNumber(impl.nullableLongSettableAttribute());
-    return JSValue::encode(result);
+    return result;
 }
 
+static inline JSValue jsTestObjNullableStringSettableAttributeGetter(ExecState*, JSTestObj*, ThrowScope& throwScope);
 
 EncodedJSValue jsTestObjNullableStringSettableAttribute(ExecState* state, EncodedJSValue thisValue, PropertyName)
 {
-    VM& vm = state->vm();
-    auto throwScope = DECLARE_THROW_SCOPE(vm);
+    return BindingCaller<JSTestObj>::attribute<jsTestObjNullableStringSettableAttributeGetter>(state, thisValue, "nullableStringSettableAttribute");
+}
+
+static inline JSValue jsTestObjNullableStringSettableAttributeGetter(ExecState* state, JSTestObj* thisObject, ThrowScope& throwScope)
+{
     UNUSED_PARAM(throwScope);
-    UNUSED_PARAM(thisValue);
-    JSValue decodedThisValue = JSValue::decode(thisValue);
-    auto* castedThis = jsDynamicCast<JSTestObj*>(decodedThisValue);
-    if (UNLIKELY(!castedThis)) {
-        return throwGetterTypeError(*state, throwScope, "TestObject", "nullableStringSettableAttribute");
-    }
-    auto& impl = castedThis->wrapped();
+    UNUSED_PARAM(state);
+    auto& impl = thisObject->wrapped();
     JSValue result = jsStringOrNull(state, impl.nullableStringSettableAttribute());
-    return JSValue::encode(result);
+    return result;
 }
 
+static inline JSValue jsTestObjNullableUSVStringSettableAttributeGetter(ExecState*, JSTestObj*, ThrowScope& throwScope);
 
 EncodedJSValue jsTestObjNullableUSVStringSettableAttribute(ExecState* state, EncodedJSValue thisValue, PropertyName)
 {
-    VM& vm = state->vm();
-    auto throwScope = DECLARE_THROW_SCOPE(vm);
+    return BindingCaller<JSTestObj>::attribute<jsTestObjNullableUSVStringSettableAttributeGetter>(state, thisValue, "nullableUSVStringSettableAttribute");
+}
+
+static inline JSValue jsTestObjNullableUSVStringSettableAttributeGetter(ExecState* state, JSTestObj* thisObject, ThrowScope& throwScope)
+{
     UNUSED_PARAM(throwScope);
-    UNUSED_PARAM(thisValue);
-    JSValue decodedThisValue = JSValue::decode(thisValue);
-    auto* castedThis = jsDynamicCast<JSTestObj*>(decodedThisValue);
-    if (UNLIKELY(!castedThis)) {
-        return throwGetterTypeError(*state, throwScope, "TestObject", "nullableUSVStringSettableAttribute");
-    }
-    auto& impl = castedThis->wrapped();
+    UNUSED_PARAM(state);
+    auto& impl = thisObject->wrapped();
     JSValue result = jsStringOrNull(state, impl.nullableUSVStringSettableAttribute());
-    return JSValue::encode(result);
+    return result;
 }
 
+static inline JSValue jsTestObjNullableStringValueGetter(ExecState*, JSTestObj*, ThrowScope& throwScope);
 
 EncodedJSValue jsTestObjNullableStringValue(ExecState* state, EncodedJSValue thisValue, PropertyName)
 {
-    VM& vm = state->vm();
-    auto throwScope = DECLARE_THROW_SCOPE(vm);
+    return BindingCaller<JSTestObj>::attribute<jsTestObjNullableStringValueGetter>(state, thisValue, "nullableStringValue");
+}
+
+static inline JSValue jsTestObjNullableStringValueGetter(ExecState* state, JSTestObj* thisObject, ThrowScope& throwScope)
+{
     UNUSED_PARAM(throwScope);
-    UNUSED_PARAM(thisValue);
-    JSValue decodedThisValue = JSValue::decode(thisValue);
-    auto* castedThis = jsDynamicCast<JSTestObj*>(decodedThisValue);
-    if (UNLIKELY(!castedThis)) {
-        return throwGetterTypeError(*state, throwScope, "TestObject", "nullableStringValue");
-    }
+    UNUSED_PARAM(state);
     ExceptionCode ec = 0;
-    auto& impl = castedThis->wrapped();
+    auto& impl = thisObject->wrapped();
     JSValue result = toNullableJSNumber(impl.nullableStringValue(ec));
     setDOMException(state, throwScope, ec);
-    return JSValue::encode(result);
+    return result;
 }
 
+static inline JSValue jsTestObjAttributeGetter(ExecState*, JSTestObj*, ThrowScope& throwScope);
 
 EncodedJSValue jsTestObjAttribute(ExecState* state, EncodedJSValue thisValue, PropertyName)
 {
-    VM& vm = state->vm();
-    auto throwScope = DECLARE_THROW_SCOPE(vm);
+    return BindingCaller<JSTestObj>::attribute<jsTestObjAttributeGetter>(state, thisValue, "attribute");
+}
+
+static inline JSValue jsTestObjAttributeGetter(ExecState* state, JSTestObj* thisObject, ThrowScope& throwScope)
+{
     UNUSED_PARAM(throwScope);
-    UNUSED_PARAM(thisValue);
-    JSValue decodedThisValue = JSValue::decode(thisValue);
-    auto* castedThis = jsDynamicCast<JSTestObj*>(decodedThisValue);
-    if (UNLIKELY(!castedThis)) {
-        return throwGetterTypeError(*state, throwScope, "TestObject", "attribute");
-    }
-    auto& impl = castedThis->wrapped();
+    UNUSED_PARAM(state);
+    auto& impl = thisObject->wrapped();
     JSValue result = jsStringWithCache(state, impl.attribute());
-    return JSValue::encode(result);
+    return result;
 }
 
+static inline JSValue jsTestObjAttributeWithReservedEnumTypeGetter(ExecState*, JSTestObj*, ThrowScope& throwScope);
 
 EncodedJSValue jsTestObjAttributeWithReservedEnumType(ExecState* state, EncodedJSValue thisValue, PropertyName)
 {
-    VM& vm = state->vm();
-    auto throwScope = DECLARE_THROW_SCOPE(vm);
+    return BindingCaller<JSTestObj>::attribute<jsTestObjAttributeWithReservedEnumTypeGetter>(state, thisValue, "attributeWithReservedEnumType");
+}
+
+static inline JSValue jsTestObjAttributeWithReservedEnumTypeGetter(ExecState* state, JSTestObj* thisObject, ThrowScope& throwScope)
+{
     UNUSED_PARAM(throwScope);
-    UNUSED_PARAM(thisValue);
-    JSValue decodedThisValue = JSValue::decode(thisValue);
-    auto* castedThis = jsDynamicCast<JSTestObj*>(decodedThisValue);
-    if (UNLIKELY(!castedThis)) {
-        return throwGetterTypeError(*state, throwScope, "TestObject", "attributeWithReservedEnumType");
-    }
-    auto& impl = castedThis->wrapped();
+    UNUSED_PARAM(state);
+    auto& impl = thisObject->wrapped();
     JSValue result = jsStringWithCache(state, impl.attributeWithReservedEnumType());
-    return JSValue::encode(result);
+    return result;
 }
 
+static inline JSValue jsTestObjPutForwardsAttributeGetter(ExecState*, JSTestObj*, ThrowScope& throwScope);
 
 EncodedJSValue jsTestObjPutForwardsAttribute(ExecState* state, EncodedJSValue thisValue, PropertyName)
 {
-    VM& vm = state->vm();
-    auto throwScope = DECLARE_THROW_SCOPE(vm);
+    return BindingCaller<JSTestObj>::attribute<jsTestObjPutForwardsAttributeGetter>(state, thisValue, "putForwardsAttribute");
+}
+
+static inline JSValue jsTestObjPutForwardsAttributeGetter(ExecState* state, JSTestObj* thisObject, ThrowScope& throwScope)
+{
     UNUSED_PARAM(throwScope);
-    UNUSED_PARAM(thisValue);
-    JSValue decodedThisValue = JSValue::decode(thisValue);
-    auto* castedThis = jsDynamicCast<JSTestObj*>(decodedThisValue);
-    if (UNLIKELY(!castedThis)) {
-        return throwGetterTypeError(*state, throwScope, "TestObject", "putForwardsAttribute");
-    }
-    auto& impl = castedThis->wrapped();
-    JSValue result = toJS(state, castedThis->globalObject(), impl.putForwardsAttribute());
-    return JSValue::encode(result);
+    UNUSED_PARAM(state);
+    auto& impl = thisObject->wrapped();
+    JSValue result = toJS(state, thisObject->globalObject(), impl.putForwardsAttribute());
+    return result;
 }
 
+static inline JSValue jsTestObjPutForwardsNullableAttributeGetter(ExecState*, JSTestObj*, ThrowScope& throwScope);
 
 EncodedJSValue jsTestObjPutForwardsNullableAttribute(ExecState* state, EncodedJSValue thisValue, PropertyName)
 {
-    VM& vm = state->vm();
-    auto throwScope = DECLARE_THROW_SCOPE(vm);
+    return BindingCaller<JSTestObj>::attribute<jsTestObjPutForwardsNullableAttributeGetter>(state, thisValue, "putForwardsNullableAttribute");
+}
+
+static inline JSValue jsTestObjPutForwardsNullableAttributeGetter(ExecState* state, JSTestObj* thisObject, ThrowScope& throwScope)
+{
     UNUSED_PARAM(throwScope);
-    UNUSED_PARAM(thisValue);
-    JSValue decodedThisValue = JSValue::decode(thisValue);
-    auto* castedThis = jsDynamicCast<JSTestObj*>(decodedThisValue);
-    if (UNLIKELY(!castedThis)) {
-        return throwGetterTypeError(*state, throwScope, "TestObject", "putForwardsNullableAttribute");
-    }
-    auto& impl = castedThis->wrapped();
-    JSValue result = toJS(state, castedThis->globalObject(), impl.putForwardsNullableAttribute());
-    return JSValue::encode(result);
+    UNUSED_PARAM(state);
+    auto& impl = thisObject->wrapped();
+    JSValue result = toJS(state, thisObject->globalObject(), impl.putForwardsNullableAttribute());
+    return result;
 }
 
+static inline JSValue jsTestObjStringifierAttributeGetter(ExecState*, JSTestObj*, ThrowScope& throwScope);
 
 EncodedJSValue jsTestObjStringifierAttribute(ExecState* state, EncodedJSValue thisValue, PropertyName)
 {
-    VM& vm = state->vm();
-    auto throwScope = DECLARE_THROW_SCOPE(vm);
+    return BindingCaller<JSTestObj>::attribute<jsTestObjStringifierAttributeGetter>(state, thisValue, "stringifierAttribute");
+}
+
+static inline JSValue jsTestObjStringifierAttributeGetter(ExecState* state, JSTestObj* thisObject, ThrowScope& throwScope)
+{
     UNUSED_PARAM(throwScope);
-    UNUSED_PARAM(thisValue);
-    JSValue decodedThisValue = JSValue::decode(thisValue);
-    auto* castedThis = jsDynamicCast<JSTestObj*>(decodedThisValue);
-    if (UNLIKELY(!castedThis)) {
-        return throwGetterTypeError(*state, throwScope, "TestObject", "stringifierAttribute");
-    }
-    auto& impl = castedThis->wrapped();
+    UNUSED_PARAM(state);
+    auto& impl = thisObject->wrapped();
     JSValue result = jsStringWithCache(state, impl.stringifierAttribute());
-    return JSValue::encode(result);
+    return result;
 }
 
-
 EncodedJSValue jsTestObjConstructor(ExecState* state, EncodedJSValue thisValue, PropertyName)
 {
     VM& vm = state->vm();
index 0791139..b6a92e0 100644 (file)
@@ -53,6 +53,7 @@ public:
 
     static void getOwnPropertyNames(JSC::JSObject*, JSC::ExecState*, JSC::PropertyNameArray&, JSC::EnumerationMode = JSC::EnumerationMode());
     static JSC::JSValue getConstructor(JSC::VM&, const JSC::JSGlobalObject*);
+    static JSTestObj* castForAttribute(JSC::ExecState*, JSC::EncodedJSValue);
     mutable JSC::WriteBarrier<JSC::Unknown> m_cachedAttribute1;
     mutable JSC::WriteBarrier<JSC::Unknown> m_cachedAttribute2;
     static void visitChildren(JSCell*, JSC::SlotVisitor&);
index 15bf3dc..863dbdd 100644 (file)
@@ -132,96 +132,96 @@ void JSTestSerializedScriptValueInterface::destroy(JSC::JSCell* cell)
     thisObject->JSTestSerializedScriptValueInterface::~JSTestSerializedScriptValueInterface();
 }
 
+inline JSTestSerializedScriptValueInterface* JSTestSerializedScriptValueInterface::castForAttribute(JSC::ExecState*, EncodedJSValue thisValue)
+{
+    return jsDynamicCast<JSTestSerializedScriptValueInterface*>(JSValue::decode(thisValue));
+}
+
+static inline JSValue jsTestSerializedScriptValueInterfaceValueGetter(ExecState*, JSTestSerializedScriptValueInterface*, ThrowScope& throwScope);
+
 EncodedJSValue jsTestSerializedScriptValueInterfaceValue(ExecState* state, EncodedJSValue thisValue, PropertyName)
 {
-    VM& vm = state->vm();
-    auto throwScope = DECLARE_THROW_SCOPE(vm);
+    return BindingCaller<JSTestSerializedScriptValueInterface>::attribute<jsTestSerializedScriptValueInterfaceValueGetter>(state, thisValue, "value");
+}
+
+static inline JSValue jsTestSerializedScriptValueInterfaceValueGetter(ExecState* state, JSTestSerializedScriptValueInterface* thisObject, ThrowScope& throwScope)
+{
     UNUSED_PARAM(throwScope);
-    UNUSED_PARAM(thisValue);
-    JSValue decodedThisValue = JSValue::decode(thisValue);
-    auto* castedThis = jsDynamicCast<JSTestSerializedScriptValueInterface*>(decodedThisValue);
-    if (UNLIKELY(!castedThis)) {
-        return throwGetterTypeError(*state, throwScope, "TestSerializedScriptValueInterface", "value");
-    }
-    auto& impl = castedThis->wrapped();
-    JSValue result = impl.value() ? impl.value()->deserialize(state, castedThis->globalObject(), 0) : jsNull();
-    return JSValue::encode(result);
+    UNUSED_PARAM(state);
+    auto& impl = thisObject->wrapped();
+    JSValue result = impl.value() ? impl.value()->deserialize(state, thisObject->globalObject(), 0) : jsNull();
+    return result;
 }
 
+static inline JSValue jsTestSerializedScriptValueInterfaceReadonlyValueGetter(ExecState*, JSTestSerializedScriptValueInterface*, ThrowScope& throwScope);
 
 EncodedJSValue jsTestSerializedScriptValueInterfaceReadonlyValue(ExecState* state, EncodedJSValue thisValue, PropertyName)
 {
-    VM& vm = state->vm();
-    auto throwScope = DECLARE_THROW_SCOPE(vm);
+    return BindingCaller<JSTestSerializedScriptValueInterface>::attribute<jsTestSerializedScriptValueInterfaceReadonlyValueGetter>(state, thisValue, "readonlyValue");
+}
+
+static inline JSValue jsTestSerializedScriptValueInterfaceReadonlyValueGetter(ExecState* state, JSTestSerializedScriptValueInterface* thisObject, ThrowScope& throwScope)
+{
     UNUSED_PARAM(throwScope);
-    UNUSED_PARAM(thisValue);
-    JSValue decodedThisValue = JSValue::decode(thisValue);
-    auto* castedThis = jsDynamicCast<JSTestSerializedScriptValueInterface*>(decodedThisValue);
-    if (UNLIKELY(!castedThis)) {
-        return throwGetterTypeError(*state, throwScope, "TestSerializedScriptValueInterface", "readonlyValue");
-    }
-    auto& impl = castedThis->wrapped();
-    JSValue result = impl.readonlyValue() ? impl.readonlyValue()->deserialize(state, castedThis->globalObject(), 0) : jsNull();
-    return JSValue::encode(result);
+    UNUSED_PARAM(state);
+    auto& impl = thisObject->wrapped();
+    JSValue result = impl.readonlyValue() ? impl.readonlyValue()->deserialize(state, thisObject->globalObject(), 0) : jsNull();
+    return result;
 }
 
+static inline JSValue jsTestSerializedScriptValueInterfaceCachedValueGetter(ExecState*, JSTestSerializedScriptValueInterface*, ThrowScope& throwScope);
 
 EncodedJSValue jsTestSerializedScriptValueInterfaceCachedValue(ExecState* state, EncodedJSValue thisValue, PropertyName)
 {
-    VM& vm = state->vm();
-    auto throwScope = DECLARE_THROW_SCOPE(vm);
+    return BindingCaller<JSTestSerializedScriptValueInterface>::attribute<jsTestSerializedScriptValueInterfaceCachedValueGetter>(state, thisValue, "cachedValue");
+}
+
+static inline JSValue jsTestSerializedScriptValueInterfaceCachedValueGetter(ExecState* state, JSTestSerializedScriptValueInterface* thisObject, ThrowScope& throwScope)
+{
     UNUSED_PARAM(throwScope);
-    UNUSED_PARAM(thisValue);
-    JSValue decodedThisValue = JSValue::decode(thisValue);
-    auto* castedThis = jsDynamicCast<JSTestSerializedScriptValueInterface*>(decodedThisValue);
-    if (UNLIKELY(!castedThis)) {
-        return throwGetterTypeError(*state, throwScope, "TestSerializedScriptValueInterface", "cachedValue");
-    }
-    if (JSValue cachedValue = castedThis->m_cachedValue.get())
-        return JSValue::encode(cachedValue);
-    auto& impl = castedThis->wrapped();
-    JSValue result = impl.cachedValue() ? impl.cachedValue()->deserialize(state, castedThis->globalObject(), 0) : jsNull();
-    castedThis->m_cachedValue.set(state->vm(), castedThis, result);
-    return JSValue::encode(result);
+    UNUSED_PARAM(state);
+    if (JSValue cachedValue = thisObject->m_cachedValue.get())
+        return cachedValue;
+    auto& impl = thisObject->wrapped();
+    JSValue result = impl.cachedValue() ? impl.cachedValue()->deserialize(state, thisObject->globalObject(), 0) : jsNull();
+    thisObject->m_cachedValue.set(state->vm(), thisObject, result);
+    return result;
 }
 
+static inline JSValue jsTestSerializedScriptValueInterfacePortsGetter(ExecState*, JSTestSerializedScriptValueInterface*, ThrowScope& throwScope);
 
 EncodedJSValue jsTestSerializedScriptValueInterfacePorts(ExecState* state, EncodedJSValue thisValue, PropertyName)
 {
-    VM& vm = state->vm();
-    auto throwScope = DECLARE_THROW_SCOPE(vm);
+    return BindingCaller<JSTestSerializedScriptValueInterface>::attribute<jsTestSerializedScriptValueInterfacePortsGetter>(state, thisValue, "ports");
+}
+
+static inline JSValue jsTestSerializedScriptValueInterfacePortsGetter(ExecState* state, JSTestSerializedScriptValueInterface* thisObject, ThrowScope& throwScope)
+{
     UNUSED_PARAM(throwScope);
-    UNUSED_PARAM(thisValue);
-    JSValue decodedThisValue = JSValue::decode(thisValue);
-    auto* castedThis = jsDynamicCast<JSTestSerializedScriptValueInterface*>(decodedThisValue);
-    if (UNLIKELY(!castedThis)) {
-        return throwGetterTypeError(*state, throwScope, "TestSerializedScriptValueInterface", "ports");
-    }
-    auto& impl = castedThis->wrapped();
-    JSValue result = jsArray(state, castedThis->globalObject(), impl.ports());
-    return JSValue::encode(result);
+    UNUSED_PARAM(state);
+    auto& impl = thisObject->wrapped();
+    JSValue result = jsArray(state, thisObject->globalObject(), impl.ports());
+    return result;
 }
 
+static inline JSValue jsTestSerializedScriptValueInterfaceCachedReadonlyValueGetter(ExecState*, JSTestSerializedScriptValueInterface*, ThrowScope& throwScope);
 
 EncodedJSValue jsTestSerializedScriptValueInterfaceCachedReadonlyValue(ExecState* state, EncodedJSValue thisValue, PropertyName)
 {
-    VM& vm = state->vm();
-    auto throwScope = DECLARE_THROW_SCOPE(vm);
-    UNUSED_PARAM(throwScope);
-    UNUSED_PARAM(thisValue);
-    JSValue decodedThisValue = JSValue::decode(thisValue);
-    auto* castedThis = jsDynamicCast<JSTestSerializedScriptValueInterface*>(decodedThisValue);
-    if (UNLIKELY(!castedThis)) {
-        return throwGetterTypeError(*state, throwScope, "TestSerializedScriptValueInterface", "cachedReadonlyValue");
-    }
-    if (JSValue cachedValue = castedThis->m_cachedReadonlyValue.get())
-        return JSValue::encode(cachedValue);
-    auto& impl = castedThis->wrapped();
-    JSValue result = impl.cachedReadonlyValue() ? impl.cachedReadonlyValue()->deserialize(state, castedThis->globalObject(), 0) : jsNull();
-    castedThis->m_cachedReadonlyValue.set(state->vm(), castedThis, result);
-    return JSValue::encode(result);
+    return BindingCaller<JSTestSerializedScriptValueInterface>::attribute<jsTestSerializedScriptValueInterfaceCachedReadonlyValueGetter>(state, thisValue, "cachedReadonlyValue");
 }
 
+static inline JSValue jsTestSerializedScriptValueInterfaceCachedReadonlyValueGetter(ExecState* state, JSTestSerializedScriptValueInterface* thisObject, ThrowScope& throwScope)
+{
+    UNUSED_PARAM(throwScope);
+    UNUSED_PARAM(state);
+    if (JSValue cachedValue = thisObject->m_cachedReadonlyValue.get())
+        return cachedValue;
+    auto& impl = thisObject->wrapped();
+    JSValue result = impl.cachedReadonlyValue() ? impl.cachedReadonlyValue()->deserialize(state, thisObject->globalObject(), 0) : jsNull();
+    thisObject->m_cachedReadonlyValue.set(state->vm(), thisObject, result);
+    return result;
+}
 
 EncodedJSValue jsTestSerializedScriptValueInterfaceConstructor(ExecState* state, EncodedJSValue thisValue, PropertyName)
 {
index 49e5b46..db58775 100644 (file)
@@ -51,6 +51,7 @@ public:
     }
 
     static JSC::JSValue getConstructor(JSC::VM&, const JSC::JSGlobalObject*);
+    static JSTestSerializedScriptValueInterface* castForAttribute(JSC::ExecState*, JSC::EncodedJSValue);
     mutable JSC::WriteBarrier<JSC::Unknown> m_cachedValue;
     mutable JSC::WriteBarrier<JSC::Unknown> m_cachedReadonlyValue;
     static void visitChildren(JSCell*, JSC::SlotVisitor&);
index 9b1a972..3f3e0a4 100644 (file)
@@ -210,127 +210,125 @@ void JSTestTypedefs::destroy(JSC::JSCell* cell)
     thisObject->JSTestTypedefs::~JSTestTypedefs();
 }
 
+inline JSTestTypedefs* JSTestTypedefs::castForAttribute(JSC::ExecState*, EncodedJSValue thisValue)
+{
+    return jsDynamicCast<JSTestTypedefs*>(JSValue::decode(thisValue));
+}
+
+static inline JSValue jsTestTypedefsUnsignedLongLongAttrGetter(ExecState*, JSTestTypedefs*, ThrowScope& throwScope);
+
 EncodedJSValue jsTestTypedefsUnsignedLongLongAttr(ExecState* state, EncodedJSValue thisValue, PropertyName)
 {
-    VM& vm = state->vm();
-    auto throwScope = DECLARE_THROW_SCOPE(vm);
+    return BindingCaller<JSTestTypedefs>::attribute<jsTestTypedefsUnsignedLongLongAttrGetter>(state, thisValue, "unsignedLongLongAttr");
+}
+
+static inline JSValue jsTestTypedefsUnsignedLongLongAttrGetter(ExecState* state, JSTestTypedefs* thisObject, ThrowScope& throwScope)
+{
     UNUSED_PARAM(throwScope);
-    UNUSED_PARAM(thisValue);
-    JSValue decodedThisValue = JSValue::decode(thisValue);
-    auto* castedThis = jsDynamicCast<JSTestTypedefs*>(decodedThisValue);
-    if (UNLIKELY(!castedThis)) {
-        return throwGetterTypeError(*state, throwScope, "TestTypedefs", "unsignedLongLongAttr");
-    }
-    auto& impl = castedThis->wrapped();
+    UNUSED_PARAM(state);
+    auto& impl = thisObject->wrapped();
     JSValue result = jsNumber(impl.unsignedLongLongAttr());
-    return JSValue::encode(result);
+    return result;
 }
 
+static inline JSValue jsTestTypedefsImmutableSerializedScriptValueGetter(ExecState*, JSTestTypedefs*, ThrowScope& throwScope);
 
 EncodedJSValue jsTestTypedefsImmutableSerializedScriptValue(ExecState* state, EncodedJSValue thisValue, PropertyName)
 {
-    VM& vm = state->vm();
-    auto throwScope = DECLARE_THROW_SCOPE(vm);
+    return BindingCaller<JSTestTypedefs>::attribute<jsTestTypedefsImmutableSerializedScriptValueGetter>(state, thisValue, "immutableSerializedScriptValue");
+}
+
+static inline JSValue jsTestTypedefsImmutableSerializedScriptValueGetter(ExecState* state, JSTestTypedefs* thisObject, ThrowScope& throwScope)
+{
     UNUSED_PARAM(throwScope);
-    UNUSED_PARAM(thisValue);
-    JSValue decodedThisValue = JSValue::decode(thisValue);
-    auto* castedThis = jsDynamicCast<JSTestTypedefs*>(decodedThisValue);
-    if (UNLIKELY(!castedThis)) {
-        return throwGetterTypeError(*state, throwScope, "TestTypedefs", "immutableSerializedScriptValue");
-    }
-    auto& impl = castedThis->wrapped();
-    JSValue result = impl.immutableSerializedScriptValue() ? impl.immutableSerializedScriptValue()->deserialize(state, castedThis->globalObject(), 0) : jsNull();
-    return JSValue::encode(result);
+    UNUSED_PARAM(state);
+    auto& impl = thisObject->wrapped();
+    JSValue result = impl.immutableSerializedScriptValue() ? impl.immutableSerializedScriptValue()->deserialize(state, thisObject->globalObject(), 0) : jsNull();
+    return result;
 }
 
+static inline JSValue jsTestTypedefsConstructorTestSubObjGetter(ExecState*, JSTestTypedefs*, ThrowScope& throwScope);
 
 EncodedJSValue jsTestTypedefsConstructorTestSubObj(ExecState* state, EncodedJSValue thisValue, PropertyName)
 {
-    VM& vm = state->vm();
-    auto throwScope = DECLARE_THROW_SCOPE(vm);
+    return BindingCaller<JSTestTypedefs>::attribute<jsTestTypedefsConstructorTestSubObjGetter>(state, thisValue, "TestSubObj");
+}
+
+static inline JSValue jsTestTypedefsConstructorTestSubObjGetter(ExecState* state, JSTestTypedefs* thisObject, ThrowScope& throwScope)
+{
     UNUSED_PARAM(throwScope);
-    UNUSED_PARAM(thisValue);
-    JSValue decodedThisValue = JSValue::decode(thisValue);
-    auto* castedThis = jsDynamicCast<JSTestTypedefs*>(decodedThisValue);
-    if (UNLIKELY(!castedThis)) {
-        return throwGetterTypeError(*state, throwScope, "TestTypedefs", "TestSubObj");
-    }
-    return JSValue::encode(JSTestSubObj::getConstructor(state->vm(), castedThis->globalObject()));
+    UNUSED_PARAM(state);
+    return JSTestSubObj::getConstructor(state->vm(), thisObject->globalObject());
 }
 
+static inline JSValue jsTestTypedefsAttrWithGetterExceptionGetter(ExecState*, JSTestTypedefs*, ThrowScope& throwScope);
 
 EncodedJSValue jsTestTypedefsAttrWithGetterException(ExecState* state, EncodedJSValue thisValue, PropertyName)
 {
-    VM& vm = state->vm();
-    auto throwScope = DECLARE_THROW_SCOPE(vm);
+    return BindingCaller<JSTestTypedefs>::attribute<jsTestTypedefsAttrWithGetterExceptionGetter>(state, thisValue, "attrWithGetterException");
+}
+
+static inline JSValue jsTestTypedefsAttrWithGetterExceptionGetter(ExecState* state, JSTestTypedefs* thisObject, ThrowScope& throwScope)
+{
     UNUSED_PARAM(throwScope);
-    UNUSED_PARAM(thisValue);
-    JSValue decodedThisValue = JSValue::decode(thisValue);
-    auto* castedThis = jsDynamicCast<JSTestTypedefs*>(decodedThisValue);
-    if (UNLIKELY(!castedThis)) {
-        return throwGetterTypeError(*state, throwScope, "TestTypedefs", "attrWithGetterException");
-    }
+    UNUSED_PARAM(state);
     ExceptionCode ec = 0;
-    auto& impl = castedThis->wrapped();
+    auto& impl = thisObject->wrapped();
     JSValue result = jsNumber(impl.attrWithGetterException(ec));
     setDOMException(state, throwScope, ec);
-    return JSValue::encode(result);
+    return result;
 }
 
+static inline JSValue jsTestTypedefsAttrWithSetterExceptionGetter(ExecState*, JSTestTypedefs*, ThrowScope& throwScope);
 
 EncodedJSValue jsTestTypedefsAttrWithSetterException(ExecState* state, EncodedJSValue thisValue, PropertyName)
 {
-    VM& vm = state->vm();
-    auto throwScope = DECLARE_THROW_SCOPE(vm);
+    return BindingCaller<JSTestTypedefs>::attribute<jsTestTypedefsAttrWithSetterExceptionGetter>(state, thisValue, "attrWithSetterException");
+}
+
+static inline JSValue jsTestTypedefsAttrWithSetterExceptionGetter(ExecState* state, JSTestTypedefs* thisObject, ThrowScope& throwScope)
+{
     UNUSED_PARAM(throwScope);
-    UNUSED_PARAM(thisValue);
-    JSValue decodedThisValue = JSValue::decode(thisValue);
-    auto* castedThis = jsDynamicCast<JSTestTypedefs*>(decodedThisValue);
-    if (UNLIKELY(!castedThis)) {
-        return throwGetterTypeError(*state, throwScope, "TestTypedefs", "attrWithSetterException");
-    }
-    auto& impl = castedThis->wrapped();
+    UNUSED_PARAM(state);
+    auto& impl = thisObject->wrapped();
     JSValue result = jsNumber(impl.attrWithSetterException());
-    return JSValue::encode(result);
+    return result;
 }
 
+static inline JSValue jsTestTypedefsStringAttrWithGetterExceptionGetter(ExecState*, JSTestTypedefs*, ThrowScope& throwScope);
 
 EncodedJSValue jsTestTypedefsStringAttrWithGetterException(ExecState* state, EncodedJSValue thisValue, PropertyName)
 {
-    VM& vm = state->vm();
-    auto throwScope = DECLARE_THROW_SCOPE(vm);
+    return BindingCaller<JSTestTypedefs>::attribute<jsTestTypedefsStringAttrWithGetterExceptionGetter>(state, thisValue, "stringAttrWithGetterException");
+}
+
+static inline JSValue jsTestTypedefsStringAttrWithGetterExceptionGetter(ExecState* state, JSTestTypedefs* thisObject, ThrowScope& throwScope)
+{
     UNUSED_PARAM(throwScope);
-    UNUSED_PARAM(thisValue);
-    JSValue decodedThisValue = JSValue::decode(thisValue);
-    auto* castedThis = jsDynamicCast<JSTestTypedefs*>(decodedThisValue);
-    if (UNLIKELY(!castedThis)) {
-        return throwGetterTypeError(*state, throwScope, "TestTypedefs", "stringAttrWithGetterException");
-    }
+    UNUSED_PARAM(state);
     ExceptionCode ec = 0;
-    auto& impl = castedThis->wrapped();
+    auto& impl = thisObject->wrapped();
     JSValue result = jsStringWithCache(state, impl.stringAttrWithGetterException(ec));
     setDOMException(state, throwScope, ec);
-    return JSValue::encode(result);
+    return result;
 }
 
+static inline JSValue jsTestTypedefsStringAttrWithSetterExceptionGetter(ExecState*, JSTestTypedefs*, ThrowScope& throwScope);
 
 EncodedJSValue jsTestTypedefsStringAttrWithSetterException(ExecState* state, EncodedJSValue thisValue, PropertyName)
 {
-    VM& vm = state->vm();
-    auto throwScope = DECLARE_THROW_SCOPE(vm);
+    return BindingCaller<JSTestTypedefs>::attribute<jsTestTypedefsStringAttrWithSetterExceptionGetter>(state, thisValue, "stringAttrWithSetterException");
+}
+
+static inline JSValue jsTestTypedefsStringAttrWithSetterExceptionGetter(ExecState* state, JSTestTypedefs* thisObject, ThrowScope& throwScope)
+{
     UNUSED_PARAM(throwScope);
-    UNUSED_PARAM(thisValue);
-    JSValue decodedThisValue = JSValue::decode(thisValue);
-    auto* castedThis = jsDynamicCast<JSTestTypedefs*>(decodedThisValue);
-    if (UNLIKELY(!castedThis)) {
-        return throwGetterTypeError(*state, throwScope, "TestTypedefs", "stringAttrWithSetterException");
-    }
-    auto& impl = castedThis->wrapped();
+    UNUSED_PARAM(state);
+    auto& impl = thisObject->wrapped();
     JSValue result = jsStringWithCache(state, impl.stringAttrWithSetterException());
-    return JSValue::encode(result);
+    return result;
 }
 
-
 EncodedJSValue jsTestTypedefsConstructor(ExecState* state, EncodedJSValue thisValue, PropertyName)
 {
     VM& vm = state->vm();
index b1d36bf..19bf488 100644 (file)
@@ -49,6 +49,7 @@ public:
     }
 
     static JSC::JSValue getConstructor(JSC::VM&, const JSC::JSGlobalObject*);
+    static JSTestTypedefs* castForAttribute(JSC::ExecState*, JSC::EncodedJSValue);
 public:
     static const unsigned StructureFlags = JSC::HasStaticPropertyTable | Base::StructureFlags;
 protected:
index 8c835ae..528d6c4 100644 (file)
@@ -132,23 +132,27 @@ void JSattribute::destroy(JSC::JSCell* cell)
     thisObject->JSattribute::~JSattribute();
 }
 
+inline JSattribute* JSattribute::castForAttribute(JSC::ExecState*, EncodedJSValue thisValue)
+{
+    return jsDynamicCast<JSattribute*>(JSValue::decode(thisValue));
+}
+
+static inline JSValue jsattributeReadonlyGetter(ExecState*, JSattribute*, ThrowScope& throwScope);
+
 EncodedJSValue jsattributeReadonly(ExecState* state, EncodedJSValue thisValue, PropertyName)
 {
-    VM& vm = state->vm();
-    auto throwScope = DECLARE_THROW_SCOPE(vm);
+    return BindingCaller<JSattribute>::attribute<jsattributeReadonlyGetter>(state, thisValue, "readonly");
+}
+
+static inline JSValue jsattributeReadonlyGetter(ExecState* state, JSattribute* thisObject, ThrowScope& throwScope)
+{
     UNUSED_PARAM(throwScope);
-    UNUSED_PARAM(thisValue);
-    JSValue decodedThisValue = JSValue::decode(thisValue);
-    auto* castedThis = jsDynamicCast<JSattribute*>(decodedThisValue);
-    if (UNLIKELY(!castedThis)) {
-        return throwGetterTypeError(*state, throwScope, "attribute", "readonly");
-    }
-    auto& impl = castedThis->wrapped();
+    UNUSED_PARAM(state);
+    auto& impl = thisObject->wrapped();
     JSValue result = jsStringWithCache(state, impl.readonly());
-    return JSValue::encode(result);
+    return result;
 }
 
-
 EncodedJSValue jsattributeConstructor(ExecState* state, EncodedJSValue thisValue, PropertyName)
 {
     VM& vm = state->vm();
index c9c8cd8..3822daf 100644 (file)
@@ -50,6 +50,7 @@ public:
     }
 
     static JSC::JSValue getConstructor(JSC::VM&, const JSC::JSGlobalObject*);
+    static JSattribute* castForAttribute(JSC::ExecState*, JSC::EncodedJSValue);
 public:
     static const unsigned StructureFlags = JSC::HasStaticPropertyTable | Base::StructureFlags;
 protected: