[JSC] StrictModeTypeErrorFunction is no longer used
authorcommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 22 Jan 2019 01:30:05 +0000 (01:30 +0000)
committercommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 22 Jan 2019 01:30:05 +0000 (01:30 +0000)
https://bugs.webkit.org/show_bug.cgi?id=193662

Patch by Yusuke Suzuki <ysuzuki@apple.com> on 2019-01-21
Reviewed by Mark Lam.

StrictModeTypeErrorFunction is no longer used. This patch drops it. Furthermore, it also allows us to drop
strictModeTypeErrorFunctionSpace from VM.

* runtime/Error.cpp:
(JSC::StrictModeTypeErrorFunction::destroy): Deleted.
* runtime/Error.h:
(): Deleted.
* runtime/VM.cpp:
(JSC::VM::VM):
* runtime/VM.h:

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

Source/JavaScriptCore/ChangeLog
Source/JavaScriptCore/runtime/Error.cpp
Source/JavaScriptCore/runtime/Error.h
Source/JavaScriptCore/runtime/VM.cpp
Source/JavaScriptCore/runtime/VM.h

index e37e391..34e1d93 100644 (file)
@@ -1,3 +1,21 @@
+2019-01-21  Yusuke Suzuki  <ysuzuki@apple.com>
+
+        [JSC] StrictModeTypeErrorFunction is no longer used
+        https://bugs.webkit.org/show_bug.cgi?id=193662
+
+        Reviewed by Mark Lam.
+
+        StrictModeTypeErrorFunction is no longer used. This patch drops it. Furthermore, it also allows us to drop
+        strictModeTypeErrorFunctionSpace from VM.
+
+        * runtime/Error.cpp:
+        (JSC::StrictModeTypeErrorFunction::destroy): Deleted.
+        * runtime/Error.h:
+        (): Deleted.
+        * runtime/VM.cpp:
+        (JSC::VM::VM):
+        * runtime/VM.h:
+
 2019-01-21  Caio Lima  <ticaiolima@gmail.com>
 
         DoesGC rule is wrong for nodes with BigIntUse
index 6388e4e..d933440 100644 (file)
@@ -361,14 +361,6 @@ JSObject* createOutOfMemoryError(ExecState* exec, const String& message)
     return error;
 }
 
-
-const ClassInfo StrictModeTypeErrorFunction::s_info = { "Function", &Base::s_info, nullptr, nullptr, CREATE_METHOD_TABLE(StrictModeTypeErrorFunction) };
-
-void StrictModeTypeErrorFunction::destroy(JSCell* cell)
-{
-    static_cast<StrictModeTypeErrorFunction*>(cell)->StrictModeTypeErrorFunction::~StrictModeTypeErrorFunction();
-}
-
 } // namespace JSC
 
 namespace WTF {
index 0d0a0b5..f94b005 100644 (file)
@@ -104,59 +104,6 @@ inline EncodedJSValue throwVMTypeError(ExecState* exec, ThrowScope& scope, const
 inline EncodedJSValue throwVMRangeError(ExecState* state, ThrowScope& scope, const String& errorMessage) { return JSValue::encode(throwRangeError(state, scope, errorMessage)); }
 inline EncodedJSValue throwVMDOMAttributeGetterTypeError(ExecState* state, ThrowScope& scope, const ClassInfo* classInfo, PropertyName propertyName) { return JSValue::encode(throwDOMAttributeGetterTypeError(state, scope, classInfo, propertyName)); }
 
-class StrictModeTypeErrorFunction final : public InternalFunction {
-private:
-    StrictModeTypeErrorFunction(VM& vm, Structure* structure, const String& message)
-        : InternalFunction(vm, structure, callThrowTypeError, constructThrowTypeError)
-        , m_message(message)
-    {
-    }
-
-    static void destroy(JSCell*);
-
-public:
-    typedef InternalFunction Base;
-    
-    template<typename CellType>
-    static IsoSubspace* subspaceFor(VM& vm)
-    {
-        return &vm.strictModeTypeErrorFunctionSpace;
-    }
-
-    static StrictModeTypeErrorFunction* create(VM& vm, Structure* structure, const String& message)
-    {
-        StrictModeTypeErrorFunction* function = new (NotNull, allocateCell<StrictModeTypeErrorFunction>(vm.heap)) StrictModeTypeErrorFunction(vm, structure, message);
-        function->finishCreation(vm, String());
-        return function;
-    }
-
-    static EncodedJSValue JSC_HOST_CALL constructThrowTypeError(ExecState* exec)
-    {
-        VM& vm = exec->vm();
-        auto scope = DECLARE_THROW_SCOPE(vm);
-        throwTypeError(exec, scope, static_cast<StrictModeTypeErrorFunction*>(exec->jsCallee())->m_message);
-        return JSValue::encode(jsNull());
-    }
-
-    static EncodedJSValue JSC_HOST_CALL callThrowTypeError(ExecState* exec)
-    {
-        VM& vm = exec->vm();
-        auto scope = DECLARE_THROW_SCOPE(vm);
-        throwTypeError(exec, scope, static_cast<StrictModeTypeErrorFunction*>(exec->jsCallee())->m_message);
-        return JSValue::encode(jsNull());
-    }
-
-    DECLARE_INFO;
-
-    static Structure* createStructure(VM& vm, JSGlobalObject* globalObject, JSValue prototype) 
-    { 
-        return Structure::create(vm, globalObject, prototype, TypeInfo(InternalFunctionType, StructureFlags), info()); 
-    }
-
-private:
-    String m_message;
-};
-
 } // namespace JSC
 
 namespace WTF {
index 7da563a..97f1aa9 100644 (file)
@@ -319,7 +319,6 @@ VM::VM(VMType vmType, HeapType heapType)
     , propertyTableSpace ISO_SUBSPACE_INIT(heap, destructibleCellHeapCellType.get(), PropertyTable)
     , proxyRevokeSpace ISO_SUBSPACE_INIT(heap, destructibleObjectHeapCellType.get(), ProxyRevoke)
     , regExpConstructorSpace ISO_SUBSPACE_INIT(heap, destructibleObjectHeapCellType.get(), RegExpConstructor)
-    , strictModeTypeErrorFunctionSpace ISO_SUBSPACE_INIT(heap, destructibleObjectHeapCellType.get(), StrictModeTypeErrorFunction)
     , structureRareDataSpace ISO_SUBSPACE_INIT(heap, destructibleCellHeapCellType.get(), StructureRareData)
     , structureSpace ISO_SUBSPACE_INIT(heap, destructibleCellHeapCellType.get(), Structure)
     , weakSetSpace ISO_SUBSPACE_INIT(heap, destructibleObjectHeapCellType.get(), JSWeakSet)
index 79f4d3b..7c68fc5 100644 (file)
@@ -394,7 +394,6 @@ public:
     IsoSubspace propertyTableSpace;
     IsoSubspace proxyRevokeSpace;
     IsoSubspace regExpConstructorSpace;
-    IsoSubspace strictModeTypeErrorFunctionSpace;
     IsoSubspace structureRareDataSpace;
     IsoSubspace structureSpace;
     IsoSubspace weakSetSpace;