Title: [230369] trunk/Source/_javascript_Core
Revision
230369
Author
utatane....@gmail.com
Date
2018-04-07 11:15:03 -0700 (Sat, 07 Apr 2018)

Log Message

[JSC] Remove several asXXX functions
https://bugs.webkit.org/show_bug.cgi?id=184355

Reviewed by JF Bastien.

Remove asActivation, asInternalFunction, and asGetterSetter.
Use jsCast<> / jsDynamicCast<> consistently.

* runtime/ArrayConstructor.cpp:
(JSC::constructArrayWithSizeQuirk):
* runtime/AsyncFunctionConstructor.cpp:
(JSC::callAsyncFunctionConstructor):
(JSC::constructAsyncFunctionConstructor):
* runtime/AsyncGeneratorFunctionConstructor.cpp:
(JSC::callAsyncGeneratorFunctionConstructor):
(JSC::constructAsyncGeneratorFunctionConstructor):
* runtime/BooleanConstructor.cpp:
(JSC::constructWithBooleanConstructor):
* runtime/DateConstructor.cpp:
(JSC::constructWithDateConstructor):
* runtime/ErrorConstructor.cpp:
(JSC::Interpreter::constructWithErrorConstructor):
(JSC::Interpreter::callErrorConstructor):
* runtime/FunctionConstructor.cpp:
(JSC::constructWithFunctionConstructor):
(JSC::callFunctionConstructor):
* runtime/FunctionPrototype.cpp:
(JSC::functionProtoFuncToString):
* runtime/GeneratorFunctionConstructor.cpp:
(JSC::callGeneratorFunctionConstructor):
(JSC::constructGeneratorFunctionConstructor):
* runtime/GetterSetter.h:
(JSC::asGetterSetter): Deleted.
* runtime/InternalFunction.h:
(JSC::asInternalFunction): Deleted.
* runtime/JSGenericTypedArrayViewConstructorInlines.h:
(JSC::constructGenericTypedArrayView):
* runtime/JSLexicalEnvironment.h:
(JSC::asActivation): Deleted.
* runtime/JSObject.cpp:
(JSC::validateAndApplyPropertyDescriptor):
* runtime/MapConstructor.cpp:
(JSC::constructMap):
* runtime/PropertyDescriptor.cpp:
(JSC::PropertyDescriptor::setDescriptor):
* runtime/RegExpConstructor.cpp:
(JSC::constructWithRegExpConstructor):
(JSC::callRegExpConstructor):
* runtime/SetConstructor.cpp:
(JSC::constructSet):
* runtime/StringConstructor.cpp:
(JSC::constructWithStringConstructor):
* runtime/WeakMapConstructor.cpp:
(JSC::constructWeakMap):
* runtime/WeakSetConstructor.cpp:
(JSC::constructWeakSet):
* wasm/js/WebAssemblyCompileErrorConstructor.cpp:
(JSC::constructJSWebAssemblyCompileError):
(JSC::callJSWebAssemblyCompileError):
* wasm/js/WebAssemblyLinkErrorConstructor.cpp:
(JSC::constructJSWebAssemblyLinkError):
(JSC::callJSWebAssemblyLinkError):
* wasm/js/WebAssemblyRuntimeErrorConstructor.cpp:
(JSC::constructJSWebAssemblyRuntimeError):
(JSC::callJSWebAssemblyRuntimeError):

Modified Paths

Diff

Modified: trunk/Source/_javascript_Core/ChangeLog (230368 => 230369)


--- trunk/Source/_javascript_Core/ChangeLog	2018-04-07 08:35:00 UTC (rev 230368)
+++ trunk/Source/_javascript_Core/ChangeLog	2018-04-07 18:15:03 UTC (rev 230369)
@@ -1,3 +1,71 @@
+2018-04-07  Yusuke Suzuki  <utatane....@gmail.com>
+
+        [JSC] Remove several asXXX functions
+        https://bugs.webkit.org/show_bug.cgi?id=184355
+
+        Reviewed by JF Bastien.
+
+        Remove asActivation, asInternalFunction, and asGetterSetter.
+        Use jsCast<> / jsDynamicCast<> consistently.
+
+        * runtime/ArrayConstructor.cpp:
+        (JSC::constructArrayWithSizeQuirk):
+        * runtime/AsyncFunctionConstructor.cpp:
+        (JSC::callAsyncFunctionConstructor):
+        (JSC::constructAsyncFunctionConstructor):
+        * runtime/AsyncGeneratorFunctionConstructor.cpp:
+        (JSC::callAsyncGeneratorFunctionConstructor):
+        (JSC::constructAsyncGeneratorFunctionConstructor):
+        * runtime/BooleanConstructor.cpp:
+        (JSC::constructWithBooleanConstructor):
+        * runtime/DateConstructor.cpp:
+        (JSC::constructWithDateConstructor):
+        * runtime/ErrorConstructor.cpp:
+        (JSC::Interpreter::constructWithErrorConstructor):
+        (JSC::Interpreter::callErrorConstructor):
+        * runtime/FunctionConstructor.cpp:
+        (JSC::constructWithFunctionConstructor):
+        (JSC::callFunctionConstructor):
+        * runtime/FunctionPrototype.cpp:
+        (JSC::functionProtoFuncToString):
+        * runtime/GeneratorFunctionConstructor.cpp:
+        (JSC::callGeneratorFunctionConstructor):
+        (JSC::constructGeneratorFunctionConstructor):
+        * runtime/GetterSetter.h:
+        (JSC::asGetterSetter): Deleted.
+        * runtime/InternalFunction.h:
+        (JSC::asInternalFunction): Deleted.
+        * runtime/JSGenericTypedArrayViewConstructorInlines.h:
+        (JSC::constructGenericTypedArrayView):
+        * runtime/JSLexicalEnvironment.h:
+        (JSC::asActivation): Deleted.
+        * runtime/JSObject.cpp:
+        (JSC::validateAndApplyPropertyDescriptor):
+        * runtime/MapConstructor.cpp:
+        (JSC::constructMap):
+        * runtime/PropertyDescriptor.cpp:
+        (JSC::PropertyDescriptor::setDescriptor):
+        * runtime/RegExpConstructor.cpp:
+        (JSC::constructWithRegExpConstructor):
+        (JSC::callRegExpConstructor):
+        * runtime/SetConstructor.cpp:
+        (JSC::constructSet):
+        * runtime/StringConstructor.cpp:
+        (JSC::constructWithStringConstructor):
+        * runtime/WeakMapConstructor.cpp:
+        (JSC::constructWeakMap):
+        * runtime/WeakSetConstructor.cpp:
+        (JSC::constructWeakSet):
+        * wasm/js/WebAssemblyCompileErrorConstructor.cpp:
+        (JSC::constructJSWebAssemblyCompileError):
+        (JSC::callJSWebAssemblyCompileError):
+        * wasm/js/WebAssemblyLinkErrorConstructor.cpp:
+        (JSC::constructJSWebAssemblyLinkError):
+        (JSC::callJSWebAssemblyLinkError):
+        * wasm/js/WebAssemblyRuntimeErrorConstructor.cpp:
+        (JSC::constructJSWebAssemblyRuntimeError):
+        (JSC::callJSWebAssemblyRuntimeError):
+
 2018-04-05  Mark Lam  <mark....@apple.com>
 
         MacroAssemblerCodePtr::retagged() should not re-decorate the pointer on ARMv7.

Modified: trunk/Source/_javascript_Core/runtime/ArrayConstructor.cpp (230368 => 230369)


--- trunk/Source/_javascript_Core/runtime/ArrayConstructor.cpp	2018-04-07 08:35:00 UTC (rev 230368)
+++ trunk/Source/_javascript_Core/runtime/ArrayConstructor.cpp	2018-04-07 18:15:03 UTC (rev 230369)
@@ -87,7 +87,7 @@
 
 static inline JSValue constructArrayWithSizeQuirk(ExecState* exec, const ArgList& args, JSValue newTarget)
 {
-    JSGlobalObject* globalObject = asInternalFunction(exec->jsCallee())->globalObject();
+    JSGlobalObject* globalObject = jsCast<InternalFunction*>(exec->jsCallee())->globalObject();
 
     // a single numeric argument denotes the array size (!)
     if (args.size() == 1)

Modified: trunk/Source/_javascript_Core/runtime/AsyncFunctionConstructor.cpp (230368 => 230369)


--- trunk/Source/_javascript_Core/runtime/AsyncFunctionConstructor.cpp	2018-04-07 08:35:00 UTC (rev 230368)
+++ trunk/Source/_javascript_Core/runtime/AsyncFunctionConstructor.cpp	2018-04-07 18:15:03 UTC (rev 230369)
@@ -39,13 +39,13 @@
 static EncodedJSValue JSC_HOST_CALL callAsyncFunctionConstructor(ExecState* exec)
 {
     ArgList args(exec);
-    return JSValue::encode(constructFunction(exec, asInternalFunction(exec->jsCallee())->globalObject(), args, FunctionConstructionMode::Async));
+    return JSValue::encode(constructFunction(exec, jsCast<InternalFunction*>(exec->jsCallee())->globalObject(), args, FunctionConstructionMode::Async));
 }
 
 static EncodedJSValue JSC_HOST_CALL constructAsyncFunctionConstructor(ExecState* exec)
 {
     ArgList args(exec);
-    return JSValue::encode(constructFunction(exec, asInternalFunction(exec->jsCallee())->globalObject(), args, FunctionConstructionMode::Async));
+    return JSValue::encode(constructFunction(exec, jsCast<InternalFunction*>(exec->jsCallee())->globalObject(), args, FunctionConstructionMode::Async));
 }
 
 AsyncFunctionConstructor::AsyncFunctionConstructor(VM& vm, Structure* structure)

Modified: trunk/Source/_javascript_Core/runtime/AsyncGeneratorFunctionConstructor.cpp (230368 => 230369)


--- trunk/Source/_javascript_Core/runtime/AsyncGeneratorFunctionConstructor.cpp	2018-04-07 08:35:00 UTC (rev 230368)
+++ trunk/Source/_javascript_Core/runtime/AsyncGeneratorFunctionConstructor.cpp	2018-04-07 18:15:03 UTC (rev 230369)
@@ -39,13 +39,13 @@
 static EncodedJSValue JSC_HOST_CALL callAsyncGeneratorFunctionConstructor(ExecState* exec)
 {
     ArgList args(exec);
-    return JSValue::encode(constructFunction(exec, asInternalFunction(exec->jsCallee())->globalObject(), args, FunctionConstructionMode::AsyncGenerator));
+    return JSValue::encode(constructFunction(exec, jsCast<InternalFunction*>(exec->jsCallee())->globalObject(), args, FunctionConstructionMode::AsyncGenerator));
 }
 
 static EncodedJSValue JSC_HOST_CALL constructAsyncGeneratorFunctionConstructor(ExecState* exec)
 {
     ArgList args(exec);
-    return JSValue::encode(constructFunction(exec, asInternalFunction(exec->jsCallee())->globalObject(), args, FunctionConstructionMode::AsyncGenerator));
+    return JSValue::encode(constructFunction(exec, jsCast<InternalFunction*>(exec->jsCallee())->globalObject(), args, FunctionConstructionMode::AsyncGenerator));
 }
 
 AsyncGeneratorFunctionConstructor::AsyncGeneratorFunctionConstructor(VM& vm, Structure* structure)

Modified: trunk/Source/_javascript_Core/runtime/BooleanConstructor.cpp (230368 => 230369)


--- trunk/Source/_javascript_Core/runtime/BooleanConstructor.cpp	2018-04-07 08:35:00 UTC (rev 230368)
+++ trunk/Source/_javascript_Core/runtime/BooleanConstructor.cpp	2018-04-07 18:15:03 UTC (rev 230369)
@@ -43,7 +43,7 @@
     VM& vm = exec->vm();
     auto scope = DECLARE_THROW_SCOPE(vm);
     JSValue boolean = jsBoolean(exec->argument(0).toBoolean(exec));
-    Structure* booleanStructure = InternalFunction::createSubclassStructure(exec, exec->newTarget(), asInternalFunction(exec->jsCallee())->globalObject()->booleanObjectStructure());
+    Structure* booleanStructure = InternalFunction::createSubclassStructure(exec, exec->newTarget(), jsCast<InternalFunction*>(exec->jsCallee())->globalObject()->booleanObjectStructure());
     RETURN_IF_EXCEPTION(scope, encodedJSValue());
     BooleanObject* obj = BooleanObject::create(vm, booleanStructure);
     obj->setInternalValue(vm, boolean);

Modified: trunk/Source/_javascript_Core/runtime/DateConstructor.cpp (230368 => 230369)


--- trunk/Source/_javascript_Core/runtime/DateConstructor.cpp	2018-04-07 08:35:00 UTC (rev 230368)
+++ trunk/Source/_javascript_Core/runtime/DateConstructor.cpp	2018-04-07 18:15:03 UTC (rev 230369)
@@ -154,7 +154,7 @@
 static EncodedJSValue JSC_HOST_CALL constructWithDateConstructor(ExecState* exec)
 {
     ArgList args(exec);
-    return JSValue::encode(constructDate(exec, asInternalFunction(exec->jsCallee())->globalObject(), exec->newTarget(), args));
+    return JSValue::encode(constructDate(exec, jsCast<InternalFunction*>(exec->jsCallee())->globalObject(), exec->newTarget(), args));
 }
 
 // ECMA 15.9.2

Modified: trunk/Source/_javascript_Core/runtime/ErrorConstructor.cpp (230368 => 230369)


--- trunk/Source/_javascript_Core/runtime/ErrorConstructor.cpp	2018-04-07 08:35:00 UTC (rev 230368)
+++ trunk/Source/_javascript_Core/runtime/ErrorConstructor.cpp	2018-04-07 18:15:03 UTC (rev 230369)
@@ -57,7 +57,7 @@
     VM& vm = exec->vm();
     auto scope = DECLARE_THROW_SCOPE(vm);
     JSValue message = exec->argument(0);
-    Structure* errorStructure = InternalFunction::createSubclassStructure(exec, exec->newTarget(), asInternalFunction(exec->jsCallee())->globalObject()->errorStructure());
+    Structure* errorStructure = InternalFunction::createSubclassStructure(exec, exec->newTarget(), jsCast<InternalFunction*>(exec->jsCallee())->globalObject()->errorStructure());
     RETURN_IF_EXCEPTION(scope, encodedJSValue());
     scope.release();
     return JSValue::encode(ErrorInstance::create(exec, errorStructure, message, nullptr, TypeNothing, false));
@@ -66,7 +66,7 @@
 EncodedJSValue JSC_HOST_CALL Interpreter::callErrorConstructor(ExecState* exec)
 {
     JSValue message = exec->argument(0);
-    Structure* errorStructure = asInternalFunction(exec->jsCallee())->globalObject()->errorStructure();
+    Structure* errorStructure = jsCast<InternalFunction*>(exec->jsCallee())->globalObject()->errorStructure();
     return JSValue::encode(ErrorInstance::create(exec, errorStructure, message, nullptr, TypeNothing, false));
 }
 

Modified: trunk/Source/_javascript_Core/runtime/FunctionConstructor.cpp (230368 => 230369)


--- trunk/Source/_javascript_Core/runtime/FunctionConstructor.cpp	2018-04-07 08:35:00 UTC (rev 230368)
+++ trunk/Source/_javascript_Core/runtime/FunctionConstructor.cpp	2018-04-07 18:15:03 UTC (rev 230369)
@@ -41,7 +41,7 @@
 static EncodedJSValue JSC_HOST_CALL constructWithFunctionConstructor(ExecState* exec)
 {
     ArgList args(exec);
-    return JSValue::encode(constructFunction(exec, asInternalFunction(exec->jsCallee())->globalObject(), args, FunctionConstructionMode::Function, exec->newTarget()));
+    return JSValue::encode(constructFunction(exec, jsCast<InternalFunction*>(exec->jsCallee())->globalObject(), args, FunctionConstructionMode::Function, exec->newTarget()));
 }
 
 // ECMA 15.3.1 The Function Constructor Called as a Function
@@ -48,7 +48,7 @@
 static EncodedJSValue JSC_HOST_CALL callFunctionConstructor(ExecState* exec)
 {
     ArgList args(exec);
-    return JSValue::encode(constructFunction(exec, asInternalFunction(exec->jsCallee())->globalObject(), args));
+    return JSValue::encode(constructFunction(exec, jsCast<InternalFunction*>(exec->jsCallee())->globalObject(), args));
 }
 
 FunctionConstructor::FunctionConstructor(VM& vm, Structure* structure)

Modified: trunk/Source/_javascript_Core/runtime/FunctionPrototype.cpp (230368 => 230369)


--- trunk/Source/_javascript_Core/runtime/FunctionPrototype.cpp	2018-04-07 08:35:00 UTC (rev 230368)
+++ trunk/Source/_javascript_Core/runtime/FunctionPrototype.cpp	2018-04-07 18:15:03 UTC (rev 230369)
@@ -117,7 +117,7 @@
     }
 
     if (thisValue.inherits<InternalFunction>(vm)) {
-        InternalFunction* function = asInternalFunction(thisValue);
+        InternalFunction* function = jsCast<InternalFunction*>(thisValue);
         scope.release();
         return JSValue::encode(jsMakeNontrivialString(exec, "function ", function->name(), "() {\n    [native code]\n}"));
     }

Modified: trunk/Source/_javascript_Core/runtime/GeneratorFunctionConstructor.cpp (230368 => 230369)


--- trunk/Source/_javascript_Core/runtime/GeneratorFunctionConstructor.cpp	2018-04-07 08:35:00 UTC (rev 230368)
+++ trunk/Source/_javascript_Core/runtime/GeneratorFunctionConstructor.cpp	2018-04-07 18:15:03 UTC (rev 230369)
@@ -39,13 +39,13 @@
 static EncodedJSValue JSC_HOST_CALL callGeneratorFunctionConstructor(ExecState* exec)
 {
     ArgList args(exec);
-    return JSValue::encode(constructFunction(exec, asInternalFunction(exec->jsCallee())->globalObject(), args, FunctionConstructionMode::Generator));
+    return JSValue::encode(constructFunction(exec, jsCast<InternalFunction*>(exec->jsCallee())->globalObject(), args, FunctionConstructionMode::Generator));
 }
 
 static EncodedJSValue JSC_HOST_CALL constructGeneratorFunctionConstructor(ExecState* exec)
 {
     ArgList args(exec);
-    return JSValue::encode(constructFunction(exec, asInternalFunction(exec->jsCallee())->globalObject(), args, FunctionConstructionMode::Generator, exec->newTarget()));
+    return JSValue::encode(constructFunction(exec, jsCast<InternalFunction*>(exec->jsCallee())->globalObject(), args, FunctionConstructionMode::Generator, exec->newTarget()));
 }
 
 GeneratorFunctionConstructor::GeneratorFunctionConstructor(VM& vm, Structure* structure)

Modified: trunk/Source/_javascript_Core/runtime/GetterSetter.h (230368 => 230369)


--- trunk/Source/_javascript_Core/runtime/GetterSetter.h	2018-04-07 08:35:00 UTC (rev 230368)
+++ trunk/Source/_javascript_Core/runtime/GetterSetter.h	2018-04-07 18:15:03 UTC (rev 230369)
@@ -139,14 +139,6 @@
     WriteBarrier<JSObject> m_setter;  
 };
 
-GetterSetter* asGetterSetter(JSValue);
-
-inline GetterSetter* asGetterSetter(JSValue value)
-{
-    ASSERT_WITH_SECURITY_IMPLICATION(value.asCell()->isGetterSetter());
-    return static_cast<GetterSetter*>(value.asCell());
-}
-
 JSValue callGetter(ExecState*, JSValue base, JSValue getterSetter);
 JS_EXPORT_PRIVATE bool callSetter(ExecState*, JSValue base, JSValue getterSetter, JSValue, ECMAMode);
 

Modified: trunk/Source/_javascript_Core/runtime/InternalFunction.h (230368 => 230369)


--- trunk/Source/_javascript_Core/runtime/InternalFunction.h	2018-04-07 08:35:00 UTC (rev 230368)
+++ trunk/Source/_javascript_Core/runtime/InternalFunction.h	2018-04-07 18:15:03 UTC (rev 230369)
@@ -87,14 +87,6 @@
     WriteBarrier<JSString> m_originalName;
 };
 
-InternalFunction* asInternalFunction(JSValue);
-
-inline InternalFunction* asInternalFunction(JSValue value)
-{
-    ASSERT(asObject(value)->inherits<InternalFunction>(*value.getObject()->vm()));
-    return static_cast<InternalFunction*>(asObject(value));
-}
-
 ALWAYS_INLINE Structure* InternalFunction::createSubclassStructure(ExecState* exec, JSValue newTarget, Structure* baseClass)
 {
     // We allow newTarget == JSValue() because the API needs to be able to create classes without having a real JS frame.

Modified: trunk/Source/_javascript_Core/runtime/JSGenericTypedArrayViewConstructorInlines.h (230368 => 230369)


--- trunk/Source/_javascript_Core/runtime/JSGenericTypedArrayViewConstructorInlines.h	2018-04-07 08:35:00 UTC (rev 230368)
+++ trunk/Source/_javascript_Core/runtime/JSGenericTypedArrayViewConstructorInlines.h	2018-04-07 18:15:03 UTC (rev 230369)
@@ -210,7 +210,7 @@
     VM& vm = exec->vm();
     auto scope = DECLARE_THROW_SCOPE(vm);
 
-    InternalFunction* function = asInternalFunction(exec->jsCallee());
+    InternalFunction* function = jsCast<InternalFunction*>(exec->jsCallee());
     Structure* parentStructure = function->globalObject()->typedArrayStructure(ViewClass::TypedArrayStorageType);
     Structure* structure = InternalFunction::createSubclassStructure(exec, exec->newTarget(), parentStructure);
     RETURN_IF_EXCEPTION(scope, encodedJSValue());

Modified: trunk/Source/_javascript_Core/runtime/JSLexicalEnvironment.h (230368 => 230369)


--- trunk/Source/_javascript_Core/runtime/JSLexicalEnvironment.h	2018-04-07 08:35:00 UTC (rev 230368)
+++ trunk/Source/_javascript_Core/runtime/JSLexicalEnvironment.h	2018-04-07 18:15:03 UTC (rev 230369)
@@ -143,10 +143,4 @@
 {
 }
 
-inline JSLexicalEnvironment* asActivation(JSValue value)
-{
-    ASSERT(asObject(value)->inherits<JSLexicalEnvironment>(*value.getObject()->vm()));
-    return jsCast<JSLexicalEnvironment*>(asObject(value));
-}
-    
 } // namespace JSC

Modified: trunk/Source/_javascript_Core/runtime/JSObject.cpp (230368 => 230369)


--- trunk/Source/_javascript_Core/runtime/JSObject.cpp	2018-04-07 08:35:00 UTC (rev 230368)
+++ trunk/Source/_javascript_Core/runtime/JSObject.cpp	2018-04-07 18:15:03 UTC (rev 230369)
@@ -3479,7 +3479,7 @@
             getterSetter->setGetter(vm, exec->lexicalGlobalObject(), getCustomGetterSetterFunctionForGetterSetter(exec, propertyName, customGetterSetter, JSCustomGetterSetterFunction::Type::Getter));
     } else {
         ASSERT(accessor.isGetterSetter());
-        getterSetter = asGetterSetter(accessor);
+        getterSetter = jsCast<GetterSetter*>(accessor);
     }
     if (descriptor.setterPresent()) {
         getterSetter = getterSetter->withSetter(vm, exec->lexicalGlobalObject(), descriptor.setterObject());

Modified: trunk/Source/_javascript_Core/runtime/MapConstructor.cpp (230368 => 230369)


--- trunk/Source/_javascript_Core/runtime/MapConstructor.cpp	2018-04-07 08:35:00 UTC (rev 230368)
+++ trunk/Source/_javascript_Core/runtime/MapConstructor.cpp	2018-04-07 18:15:03 UTC (rev 230369)
@@ -67,7 +67,7 @@
     VM& vm = exec->vm();
     auto scope = DECLARE_THROW_SCOPE(vm);
 
-    JSGlobalObject* globalObject = asInternalFunction(exec->jsCallee())->globalObject();
+    JSGlobalObject* globalObject = jsCast<InternalFunction*>(exec->jsCallee())->globalObject();
     Structure* mapStructure = InternalFunction::createSubclassStructure(exec, exec->newTarget(), globalObject->mapStructure());
     RETURN_IF_EXCEPTION(scope, encodedJSValue());
 

Modified: trunk/Source/_javascript_Core/runtime/PropertyDescriptor.cpp (230368 => 230369)


--- trunk/Source/_javascript_Core/runtime/PropertyDescriptor.cpp	2018-04-07 08:35:00 UTC (rev 230368)
+++ trunk/Source/_javascript_Core/runtime/PropertyDescriptor.cpp	2018-04-07 18:15:03 UTC (rev 230369)
@@ -120,7 +120,7 @@
     if (value.isGetterSetter()) {
         m_attributes &= ~PropertyAttribute::ReadOnly; // FIXME: we should be able to ASSERT this!
 
-        GetterSetter* accessor = asGetterSetter(value);
+        GetterSetter* accessor = jsCast<GetterSetter*>(value);
         m_getter = !accessor->isGetterNull() ? accessor->getter() : jsUndefined();
         m_setter = !accessor->isSetterNull() ? accessor->setter() : jsUndefined();
         m_seenAttributes = EnumerablePresent | ConfigurablePresent;

Modified: trunk/Source/_javascript_Core/runtime/RegExpConstructor.cpp (230368 => 230369)


--- trunk/Source/_javascript_Core/runtime/RegExpConstructor.cpp	2018-04-07 08:35:00 UTC (rev 230368)
+++ trunk/Source/_javascript_Core/runtime/RegExpConstructor.cpp	2018-04-07 18:15:03 UTC (rev 230369)
@@ -311,13 +311,13 @@
 static EncodedJSValue JSC_HOST_CALL constructWithRegExpConstructor(ExecState* exec)
 {
     ArgList args(exec);
-    return JSValue::encode(constructRegExp(exec, asInternalFunction(exec->jsCallee())->globalObject(), args, exec->jsCallee(), exec->newTarget()));
+    return JSValue::encode(constructRegExp(exec, jsCast<InternalFunction*>(exec->jsCallee())->globalObject(), args, exec->jsCallee(), exec->newTarget()));
 }
 
 static EncodedJSValue JSC_HOST_CALL callRegExpConstructor(ExecState* exec)
 {
     ArgList args(exec);
-    return JSValue::encode(constructRegExp(exec, asInternalFunction(exec->jsCallee())->globalObject(), args, exec->jsCallee()));
+    return JSValue::encode(constructRegExp(exec, jsCast<InternalFunction*>(exec->jsCallee())->globalObject(), args, exec->jsCallee()));
 }
 
 } // namespace JSC

Modified: trunk/Source/_javascript_Core/runtime/SetConstructor.cpp (230368 => 230369)


--- trunk/Source/_javascript_Core/runtime/SetConstructor.cpp	2018-04-07 08:35:00 UTC (rev 230368)
+++ trunk/Source/_javascript_Core/runtime/SetConstructor.cpp	2018-04-07 18:15:03 UTC (rev 230369)
@@ -67,7 +67,7 @@
     VM& vm = exec->vm();
     auto scope = DECLARE_THROW_SCOPE(vm);
 
-    JSGlobalObject* globalObject = asInternalFunction(exec->jsCallee())->globalObject();
+    JSGlobalObject* globalObject = jsCast<InternalFunction*>(exec->jsCallee())->globalObject();
     Structure* setStructure = InternalFunction::createSubclassStructure(exec, exec->newTarget(), globalObject->setStructure());
     RETURN_IF_EXCEPTION(scope, encodedJSValue());
 

Modified: trunk/Source/_javascript_Core/runtime/StringConstructor.cpp (230368 => 230369)


--- trunk/Source/_javascript_Core/runtime/StringConstructor.cpp	2018-04-07 08:35:00 UTC (rev 230368)
+++ trunk/Source/_javascript_Core/runtime/StringConstructor.cpp	2018-04-07 18:15:03 UTC (rev 230369)
@@ -124,7 +124,7 @@
 
 static EncodedJSValue JSC_HOST_CALL constructWithStringConstructor(ExecState* exec)
 {
-    JSGlobalObject* globalObject = asInternalFunction(exec->jsCallee())->globalObject();
+    JSGlobalObject* globalObject = jsCast<InternalFunction*>(exec->jsCallee())->globalObject();
     VM& vm = globalObject->vm();
     auto scope = DECLARE_THROW_SCOPE(vm);
 

Modified: trunk/Source/_javascript_Core/runtime/WeakMapConstructor.cpp (230368 => 230369)


--- trunk/Source/_javascript_Core/runtime/WeakMapConstructor.cpp	2018-04-07 08:35:00 UTC (rev 230368)
+++ trunk/Source/_javascript_Core/runtime/WeakMapConstructor.cpp	2018-04-07 18:15:03 UTC (rev 230369)
@@ -65,7 +65,7 @@
     VM& vm = exec->vm();
     auto scope = DECLARE_THROW_SCOPE(vm);
 
-    JSGlobalObject* globalObject = asInternalFunction(exec->jsCallee())->globalObject();
+    JSGlobalObject* globalObject = jsCast<InternalFunction*>(exec->jsCallee())->globalObject();
     Structure* weakMapStructure = InternalFunction::createSubclassStructure(exec, exec->newTarget(), globalObject->weakMapStructure());
     RETURN_IF_EXCEPTION(scope, encodedJSValue());
     JSWeakMap* weakMap = JSWeakMap::create(vm, weakMapStructure);

Modified: trunk/Source/_javascript_Core/runtime/WeakSetConstructor.cpp (230368 => 230369)


--- trunk/Source/_javascript_Core/runtime/WeakSetConstructor.cpp	2018-04-07 08:35:00 UTC (rev 230368)
+++ trunk/Source/_javascript_Core/runtime/WeakSetConstructor.cpp	2018-04-07 18:15:03 UTC (rev 230369)
@@ -65,7 +65,7 @@
     VM& vm = exec->vm();
     auto scope = DECLARE_THROW_SCOPE(vm);
 
-    JSGlobalObject* globalObject = asInternalFunction(exec->jsCallee())->globalObject();
+    JSGlobalObject* globalObject = jsCast<InternalFunction*>(exec->jsCallee())->globalObject();
     Structure* weakSetStructure = InternalFunction::createSubclassStructure(exec, exec->newTarget(), globalObject->weakSetStructure());
     RETURN_IF_EXCEPTION(scope, encodedJSValue());
     JSWeakSet* weakSet = JSWeakSet::create(vm, weakSetStructure);

Modified: trunk/Source/_javascript_Core/wasm/js/WebAssemblyCompileErrorConstructor.cpp (230368 => 230369)


--- trunk/Source/_javascript_Core/wasm/js/WebAssemblyCompileErrorConstructor.cpp	2018-04-07 08:35:00 UTC (rev 230368)
+++ trunk/Source/_javascript_Core/wasm/js/WebAssemblyCompileErrorConstructor.cpp	2018-04-07 18:15:03 UTC (rev 230369)
@@ -49,7 +49,7 @@
     auto& vm = exec->vm();
     auto scope = DECLARE_THROW_SCOPE(vm);
     JSValue message = exec->argument(0);
-    auto* structure = InternalFunction::createSubclassStructure(exec, exec->newTarget(), asInternalFunction(exec->jsCallee())->globalObject()->WebAssemblyCompileErrorStructure());
+    auto* structure = InternalFunction::createSubclassStructure(exec, exec->newTarget(), jsCast<InternalFunction*>(exec->jsCallee())->globalObject()->WebAssemblyCompileErrorStructure());
     RETURN_IF_EXCEPTION(scope, encodedJSValue());
     return JSValue::encode(JSWebAssemblyCompileError::create(exec, vm, structure, message));
 }
@@ -57,7 +57,7 @@
 static EncodedJSValue JSC_HOST_CALL callJSWebAssemblyCompileError(ExecState* exec)
 {
     JSValue message = exec->argument(0);
-    Structure* errorStructure = asInternalFunction(exec->jsCallee())->globalObject()->WebAssemblyCompileErrorStructure();
+    Structure* errorStructure = jsCast<InternalFunction*>(exec->jsCallee())->globalObject()->WebAssemblyCompileErrorStructure();
     return JSValue::encode(ErrorInstance::create(exec, errorStructure, message, nullptr, TypeNothing, false));
 }
 

Modified: trunk/Source/_javascript_Core/wasm/js/WebAssemblyLinkErrorConstructor.cpp (230368 => 230369)


--- trunk/Source/_javascript_Core/wasm/js/WebAssemblyLinkErrorConstructor.cpp	2018-04-07 08:35:00 UTC (rev 230368)
+++ trunk/Source/_javascript_Core/wasm/js/WebAssemblyLinkErrorConstructor.cpp	2018-04-07 18:15:03 UTC (rev 230369)
@@ -49,7 +49,7 @@
     auto& vm = exec->vm();
     auto scope = DECLARE_THROW_SCOPE(vm);
     JSValue message = exec->argument(0);
-    auto* structure = InternalFunction::createSubclassStructure(exec, exec->newTarget(), asInternalFunction(exec->jsCallee())->globalObject()->WebAssemblyLinkErrorStructure());
+    auto* structure = InternalFunction::createSubclassStructure(exec, exec->newTarget(), jsCast<InternalFunction*>(exec->jsCallee())->globalObject()->WebAssemblyLinkErrorStructure());
     RETURN_IF_EXCEPTION(scope, encodedJSValue());
     return JSValue::encode(JSWebAssemblyLinkError::create(exec, vm, structure, message));
 }
@@ -57,7 +57,7 @@
 static EncodedJSValue JSC_HOST_CALL callJSWebAssemblyLinkError(ExecState* exec)
 {
     JSValue message = exec->argument(0);
-    Structure* errorStructure = asInternalFunction(exec->jsCallee())->globalObject()->WebAssemblyLinkErrorStructure();
+    Structure* errorStructure = jsCast<InternalFunction*>(exec->jsCallee())->globalObject()->WebAssemblyLinkErrorStructure();
     return JSValue::encode(ErrorInstance::create(exec, errorStructure, message, nullptr, TypeNothing, false));
 }
 

Modified: trunk/Source/_javascript_Core/wasm/js/WebAssemblyRuntimeErrorConstructor.cpp (230368 => 230369)


--- trunk/Source/_javascript_Core/wasm/js/WebAssemblyRuntimeErrorConstructor.cpp	2018-04-07 08:35:00 UTC (rev 230368)
+++ trunk/Source/_javascript_Core/wasm/js/WebAssemblyRuntimeErrorConstructor.cpp	2018-04-07 18:15:03 UTC (rev 230369)
@@ -49,7 +49,7 @@
     auto& vm = exec->vm();
     auto scope = DECLARE_THROW_SCOPE(vm);
     JSValue message = exec->argument(0);
-    auto* structure = InternalFunction::createSubclassStructure(exec, exec->newTarget(), asInternalFunction(exec->jsCallee())->globalObject()->WebAssemblyRuntimeErrorStructure());
+    auto* structure = InternalFunction::createSubclassStructure(exec, exec->newTarget(), jsCast<InternalFunction*>(exec->jsCallee())->globalObject()->WebAssemblyRuntimeErrorStructure());
     RETURN_IF_EXCEPTION(scope, encodedJSValue());
     return JSValue::encode(JSWebAssemblyRuntimeError::create(exec, vm, structure, message));
 }
@@ -57,7 +57,7 @@
 static EncodedJSValue JSC_HOST_CALL callJSWebAssemblyRuntimeError(ExecState* exec)
 {
     JSValue message = exec->argument(0);
-    Structure* errorStructure = asInternalFunction(exec->jsCallee())->globalObject()->WebAssemblyRuntimeErrorStructure();
+    Structure* errorStructure = jsCast<InternalFunction*>(exec->jsCallee())->globalObject()->WebAssemblyRuntimeErrorStructure();
     return JSValue::encode(ErrorInstance::create(exec, errorStructure, message, nullptr, TypeNothing, false));
 }
 
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to