Diff
Modified: trunk/Source/_javascript_Core/API/APICallbackFunction.h (267517 => 267518)
--- trunk/Source/_javascript_Core/API/APICallbackFunction.h 2020-09-24 04:33:24 UTC (rev 267517)
+++ trunk/Source/_javascript_Core/API/APICallbackFunction.h 2020-09-24 05:59:46 UTC (rev 267518)
@@ -35,14 +35,12 @@
namespace JSC {
struct APICallbackFunction {
-
-template <typename T> static EncodedJSValue JSC_HOST_CALL call(JSGlobalObject*, CallFrame*);
-template <typename T> static EncodedJSValue JSC_HOST_CALL construct(JSGlobalObject*, CallFrame*);
-
+ template <typename T> static EncodedJSValue callImpl(JSGlobalObject*, CallFrame*);
+ template <typename T> static EncodedJSValue constructImpl(JSGlobalObject*, CallFrame*);
};
template <typename T>
-EncodedJSValue JSC_HOST_CALL APICallbackFunction::call(JSGlobalObject* globalObject, CallFrame* callFrame)
+EncodedJSValue APICallbackFunction::callImpl(JSGlobalObject* globalObject, CallFrame* callFrame)
{
VM& vm = getVM(globalObject);
auto scope = DECLARE_THROW_SCOPE(vm);
@@ -75,7 +73,7 @@
}
template <typename T>
-EncodedJSValue JSC_HOST_CALL APICallbackFunction::construct(JSGlobalObject* globalObject, CallFrame* callFrame)
+EncodedJSValue APICallbackFunction::constructImpl(JSGlobalObject* globalObject, CallFrame* callFrame)
{
VM& vm = getVM(globalObject);
auto scope = DECLARE_THROW_SCOPE(vm);
Modified: trunk/Source/_javascript_Core/API/JSCallbackConstructor.cpp (267517 => 267518)
--- trunk/Source/_javascript_Core/API/JSCallbackConstructor.cpp 2020-09-24 04:33:24 UTC (rev 267517)
+++ trunk/Source/_javascript_Core/API/JSCallbackConstructor.cpp 2020-09-24 05:59:46 UTC (rev 267518)
@@ -61,11 +61,16 @@
static_cast<JSCallbackConstructor*>(cell)->JSCallbackConstructor::~JSCallbackConstructor();
}
+static EncodedJSValue JSC_HOST_CALL constructJSCallbackConstructor(JSGlobalObject* globalObject, CallFrame* callFrame)
+{
+ return APICallbackFunction::constructImpl<JSCallbackConstructor>(globalObject, callFrame);
+}
+
CallData JSCallbackConstructor::getConstructData(JSCell*)
{
CallData constructData;
constructData.type = CallData::Type::Native;
- constructData.native.function = APICallbackFunction::construct<JSCallbackConstructor>;
+ constructData.native.function = constructJSCallbackConstructor;
return constructData;
}
Modified: trunk/Source/_javascript_Core/API/JSCallbackFunction.cpp (267517 => 267518)
--- trunk/Source/_javascript_Core/API/JSCallbackFunction.cpp 2020-09-24 04:33:24 UTC (rev 267517)
+++ trunk/Source/_javascript_Core/API/JSCallbackFunction.cpp 2020-09-24 05:59:46 UTC (rev 267518)
@@ -35,8 +35,13 @@
const ClassInfo JSCallbackFunction::s_info = { "CallbackFunction", &InternalFunction::s_info, nullptr, nullptr, CREATE_METHOD_TABLE(JSCallbackFunction) };
+static EncodedJSValue JSC_HOST_CALL callJSCallbackFunction(JSGlobalObject* globalObject, CallFrame* callFrame)
+{
+ return APICallbackFunction::callImpl<JSCallbackFunction>(globalObject, callFrame);
+}
+
JSCallbackFunction::JSCallbackFunction(VM& vm, Structure* structure, JSObjectCallAsFunctionCallback callback)
- : InternalFunction(vm, structure, APICallbackFunction::call<JSCallbackFunction>, nullptr)
+ : InternalFunction(vm, structure, callJSCallbackFunction, nullptr)
, m_callback(callback)
{
}
Modified: trunk/Source/_javascript_Core/API/ObjCCallbackFunction.mm (267517 => 267518)
--- trunk/Source/_javascript_Core/API/ObjCCallbackFunction.mm 2020-09-24 04:33:24 UTC (rev 267517)
+++ trunk/Source/_javascript_Core/API/ObjCCallbackFunction.mm 2020-09-24 05:59:46 UTC (rev 267518)
@@ -535,8 +535,18 @@
const JSC::ClassInfo ObjCCallbackFunction::s_info = { "CallbackFunction", &Base::s_info, nullptr, nullptr, CREATE_METHOD_TABLE(ObjCCallbackFunction) };
+static EncodedJSValue JSC_HOST_CALL callObjCCallbackFunction(JSGlobalObject* globalObject, CallFrame* callFrame)
+{
+ return APICallbackFunction::callImpl<ObjCCallbackFunction>(globalObject, callFrame);
+}
+
+static EncodedJSValue JSC_HOST_CALL constructObjCCallbackFunction(JSGlobalObject* globalObject, CallFrame* callFrame)
+{
+ return APICallbackFunction::constructImpl<ObjCCallbackFunction>(globalObject, callFrame);
+}
+
ObjCCallbackFunction::ObjCCallbackFunction(JSC::VM& vm, JSC::Structure* structure, JSObjectCallAsFunctionCallback functionCallback, JSObjectCallAsConstructorCallback constructCallback, std::unique_ptr<ObjCCallbackFunctionImpl> impl)
- : Base(vm, structure, APICallbackFunction::call<ObjCCallbackFunction>, impl->isConstructible() ? APICallbackFunction::construct<ObjCCallbackFunction> : nullptr)
+ : Base(vm, structure, callObjCCallbackFunction, impl->isConstructible() ? constructObjCCallbackFunction : nullptr)
, m_functionCallback(functionCallback)
, m_constructCallback(constructCallback)
, m_impl(WTFMove(impl))
Modified: trunk/Source/_javascript_Core/API/glib/JSCCallbackFunction.cpp (267517 => 267518)
--- trunk/Source/_javascript_Core/API/glib/JSCCallbackFunction.cpp 2020-09-24 04:33:24 UTC (rev 267517)
+++ trunk/Source/_javascript_Core/API/glib/JSCCallbackFunction.cpp 2020-09-24 05:59:46 UTC (rev 267518)
@@ -52,6 +52,16 @@
const ClassInfo JSCCallbackFunction::s_info = { "CallbackFunction", &InternalFunction::s_info, nullptr, nullptr, CREATE_METHOD_TABLE(JSCCallbackFunction) };
+static EncodedJSValue JSC_HOST_CALL callJSCCallbackFunction(JSGlobalObject* globalObject, CallFrame* callFrame)
+{
+ return APICallbackFunction::callImpl<JSCCallbackFunction>(globalObject, callFrame);
+}
+
+static EncodedJSValue JSC_HOST_CALL constructJSCCallbackFunction(JSGlobalObject* globalObject, CallFrame* callFrame)
+{
+ return APICallbackFunction::constructImpl<JSCCallbackFunction>(globalObject, callFrame);
+}
+
JSCCallbackFunction* JSCCallbackFunction::create(VM& vm, JSGlobalObject* globalObject, const String& name, Type type, JSCClass* jscClass, GRefPtr<GClosure>&& closure, GType returnType, Optional<Vector<GType>>&& parameters)
{
Structure* structure = globalObject->glibCallbackFunctionStructure();
@@ -61,7 +71,7 @@
}
JSCCallbackFunction::JSCCallbackFunction(VM& vm, Structure* structure, Type type, JSCClass* jscClass, GRefPtr<GClosure>&& closure, GType returnType, Optional<Vector<GType>>&& parameters)
- : InternalFunction(vm, structure, APICallbackFunction::call<JSCCallbackFunction>, type == Type::Constructor ? APICallbackFunction::construct<JSCCallbackFunction> : nullptr)
+ : InternalFunction(vm, structure, callJSCCallbackFunction, type == Type::Constructor ? constructJSCCallbackFunction : nullptr)
, m_functionCallback(callAsFunction)
, m_constructCallback(callAsConstructor)
, m_type(type)
Modified: trunk/Source/_javascript_Core/ChangeLog (267517 => 267518)
--- trunk/Source/_javascript_Core/ChangeLog 2020-09-24 04:33:24 UTC (rev 267517)
+++ trunk/Source/_javascript_Core/ChangeLog 2020-09-24 05:59:46 UTC (rev 267518)
@@ -1,3 +1,91 @@
+2020-09-23 Yusuke Suzuki <[email protected]>
+
+ [JSC] Simply some of template-specialized host functions by defining each function
+ https://bugs.webkit.org/show_bug.cgi?id=216907
+
+ Reviewed by Saam Barati.
+
+ This makes automatically-registering these functions in JIT-caging easy.
+
+ * API/APICallbackFunction.h:
+ (JSC::APICallbackFunction::callImpl):
+ (JSC::APICallbackFunction::constructImpl):
+ (JSC::APICallbackFunction::call): Deleted.
+ (JSC::APICallbackFunction::construct): Deleted.
+ * API/JSCallbackConstructor.cpp:
+ (JSC::constructJSCallbackConstructor):
+ (JSC::JSCallbackConstructor::getConstructData):
+ * API/JSCallbackFunction.cpp:
+ (JSC::callJSCallbackFunction):
+ (JSC::JSCallbackFunction::JSCallbackFunction):
+ * API/ObjCCallbackFunction.mm:
+ (JSC::callObjCCallbackFunction):
+ (JSC::constructObjCCallbackFunction):
+ (JSC::ObjCCallbackFunction::ObjCCallbackFunction):
+ * API/glib/JSCCallbackFunction.cpp:
+ (JSC::callJSCCallbackFunction):
+ (JSC::constructJSCCallbackFunction):
+ (JSC::JSCCallbackFunction::JSCCallbackFunction):
+ * dfg/DFGOperations.h:
+ * jit/JITOperations.cpp:
+ * jit/JITOperations.h:
+ * jsc.cpp:
+ (accessorMakeMasquerader):
+ * runtime/JSArrayBufferConstructor.cpp:
+ (JSC::JSGenericArrayBufferConstructor<sharingMode>::JSGenericArrayBufferConstructor):
+ (JSC::JSGenericArrayBufferConstructor<sharingMode>::constructImpl):
+ (JSC::constructArrayBuffer):
+ (JSC::constructSharedArrayBuffer):
+ (JSC::JSGenericArrayBufferConstructor<sharingMode>::constructArrayBuffer): Deleted.
+ * runtime/JSArrayBufferConstructor.h:
+ * runtime/JSCustomGetterSetterFunction.cpp:
+ (JSC::customGetterSetterFunctionCall):
+ (JSC::JSCustomGetterSetterFunction::customGetterSetterFunctionCall): Deleted.
+ * runtime/JSCustomGetterSetterFunction.h:
+ * runtime/NativeErrorConstructor.cpp:
+ (JSC::NativeErrorConstructor<errorType>::constructImpl):
+ (JSC::NativeErrorConstructor<errorType>::callImpl):
+ (JSC::callEvalError):
+ (JSC::constructEvalError):
+ (JSC::callRangeError):
+ (JSC::constructRangeError):
+ (JSC::callReferenceError):
+ (JSC::constructReferenceError):
+ (JSC::callSyntaxError):
+ (JSC::constructSyntaxError):
+ (JSC::callTypeError):
+ (JSC::constructTypeError):
+ (JSC::callURIError):
+ (JSC::constructURIError):
+ (JSC::callFunction):
+ (JSC::constructFunction):
+ (JSC::NativeErrorConstructor<errorType>::NativeErrorConstructor):
+ (JSC::NativeErrorConstructorBase::finishCreation):
+ (JSC::NativeErrorConstructor<errorType>::constructNativeErrorConstructor): Deleted.
+ (JSC::NativeErrorConstructor<errorType>::callNativeErrorConstructor): Deleted.
+ * runtime/NativeErrorConstructor.h:
+ * runtime/RegExpConstructor.cpp:
+ (JSC::regExpConstructorDollarImpl):
+ (JSC::regExpConstructorDollar1):
+ (JSC::regExpConstructorDollar2):
+ (JSC::regExpConstructorDollar3):
+ (JSC::regExpConstructorDollar4):
+ (JSC::regExpConstructorDollar5):
+ (JSC::regExpConstructorDollar6):
+ (JSC::regExpConstructorDollar7):
+ (JSC::regExpConstructorDollar8):
+ (JSC::regExpConstructorDollar9):
+ (JSC::regExpConstructorInput):
+ (JSC::regExpConstructorMultiline):
+ (JSC::regExpConstructorLastMatch):
+ (JSC::regExpConstructorLastParen):
+ (JSC::regExpConstructorLeftContext):
+ (JSC::regExpConstructorRightContext):
+ (JSC::setRegExpConstructorInput):
+ (JSC::setRegExpConstructorMultiline):
+ (JSC::regExpConstructorDollar): Deleted.
+ * tools/JSDollarVM.cpp:
+
2020-09-23 Alexey Shvayka <[email protected]>
Update Array.prototype.sort to be consistent with tightened spec
Modified: trunk/Source/_javascript_Core/dfg/DFGOperations.h (267517 => 267518)
--- trunk/Source/_javascript_Core/dfg/DFGOperations.h 2020-09-24 04:33:24 UTC (rev 267517)
+++ trunk/Source/_javascript_Core/dfg/DFGOperations.h 2020-09-24 05:59:46 UTC (rev 267518)
@@ -303,8 +303,6 @@
size_t JIT_OPERATION operationNumberIsInteger(JSGlobalObject*, EncodedJSValue);
-size_t JIT_OPERATION operationDefaultHasInstance(JSGlobalObject*, JSCell* value, JSCell* proto);
-
char* JIT_OPERATION operationNewRawObject(VM*, Structure*, int32_t, Butterfly*) WTF_INTERNAL;
JSCell* JIT_OPERATION operationNewObjectWithButterfly(VM*, Structure*, Butterfly*) WTF_INTERNAL;
JSCell* JIT_OPERATION operationNewObjectWithButterflyWithIndexingHeaderAndVectorLength(VM*, Structure*, unsigned length, Butterfly*) WTF_INTERNAL;
Modified: trunk/Source/_javascript_Core/jit/JITOperations.cpp (267517 => 267518)
--- trunk/Source/_javascript_Core/jit/JITOperations.cpp 2020-09-24 04:33:24 UTC (rev 267517)
+++ trunk/Source/_javascript_Core/jit/JITOperations.cpp 2020-09-24 05:59:46 UTC (rev 267518)
@@ -2110,16 +2110,6 @@
}
#endif
-void JIT_OPERATION operationPopScope(JSGlobalObject* globalObject, int32_t scopeReg)
-{
- VM& vm = globalObject->vm();
- CallFrame* callFrame = DECLARE_CALL_FRAME(vm);
- JITOperationPrologueCallFrameTracer tracer(vm, callFrame);
-
- auto& scopeSlot = callFrame->uncheckedR(VirtualRegister(scopeReg));
- scopeSlot = scopeSlot.Register::scope()->next();
-}
-
size_t JIT_OPERATION operationInstanceOfCustom(JSGlobalObject* globalObject, EncodedJSValue encodedValue, JSObject* constructor, EncodedJSValue encodedHasInstance)
{
VM& vm = globalObject->vm();
Modified: trunk/Source/_javascript_Core/jit/JITOperations.h (267517 => 267518)
--- trunk/Source/_javascript_Core/jit/JITOperations.h 2020-09-24 04:33:24 UTC (rev 267517)
+++ trunk/Source/_javascript_Core/jit/JITOperations.h 2020-09-24 05:59:46 UTC (rev 267518)
@@ -255,7 +255,6 @@
void JIT_OPERATION operationPutGetterSetter(JSGlobalObject*, JSCell*, UniquedStringImpl*, int32_t attribute, JSCell*, JSCell*) WTF_INTERNAL;
#endif
void JIT_OPERATION operationPushFunctionNameScope(JSGlobalObject*, int32_t, SymbolTable*, EncodedJSValue) WTF_INTERNAL;
-void JIT_OPERATION operationPopScope(JSGlobalObject*, int32_t) WTF_INTERNAL;
EncodedJSValue JIT_OPERATION operationGetByValOptimize(JSGlobalObject*, StructureStubInfo*, ArrayProfile*, EncodedJSValue encodedBase, EncodedJSValue encodedSubscript) WTF_INTERNAL;
EncodedJSValue JIT_OPERATION operationGetByValGeneric(JSGlobalObject*, StructureStubInfo*, ArrayProfile*, EncodedJSValue encodedBase, EncodedJSValue encodedSubscript) WTF_INTERNAL;
Modified: trunk/Source/_javascript_Core/jsc.cpp (267517 => 267518)
--- trunk/Source/_javascript_Core/jsc.cpp 2020-09-24 04:33:24 UTC (rev 267517)
+++ trunk/Source/_javascript_Core/jsc.cpp 2020-09-24 05:59:46 UTC (rev 267518)
@@ -455,6 +455,12 @@
return String::fromUTF8WithLatin1Fallback(utf8.data(), utf8.size());
}
+static EncodedJSValue JIT_OPERATION accessorMakeMasquerader(JSGlobalObject* globalObject, EncodedJSValue, PropertyName)
+{
+ VM& vm = globalObject->vm();
+ return JSValue::encode(InternalFunction::createFunctionThatMasqueradesAsUndefined(vm, globalObject, 0, "IsHTMLDDA"_s, functionCallMasquerader));
+}
+
class GlobalObject final : public JSGlobalObject {
public:
using Base = JSGlobalObject;
@@ -606,9 +612,7 @@
dollar->putDirect(vm, Identifier::fromString(vm, "global"), this, DontEnum);
dollar->putDirectCustomAccessor(vm, Identifier::fromString(vm, "IsHTMLDDA"),
- CustomGetterSetter::create(vm, [](JSGlobalObject* globalObject, EncodedJSValue, PropertyName) {
- return functionMakeMasquerader(globalObject, nullptr);
- }, nullptr),
+ CustomGetterSetter::create(vm, accessorMakeMasquerader, nullptr),
static_cast<unsigned>(PropertyAttribute::CustomValue)
);
@@ -664,7 +668,7 @@
return true;
}
- static bool testCustomAccessorSetter(JSGlobalObject* lexicalGlobalObject, EncodedJSValue thisValue, EncodedJSValue encodedValue)
+ static bool JIT_OPERATION testCustomAccessorSetter(JSGlobalObject* lexicalGlobalObject, EncodedJSValue thisValue, EncodedJSValue encodedValue)
{
VM& vm = lexicalGlobalObject->vm();
RELEASE_ASSERT(JSValue::decode(thisValue).isCell());
@@ -675,7 +679,7 @@
return testCustomSetterImpl(lexicalGlobalObject, thisObject, encodedValue, "_testCustomAccessorSetter");
}
- static bool testCustomValueSetter(JSGlobalObject* lexicalGlobalObject, EncodedJSValue thisValue, EncodedJSValue encodedValue)
+ static bool JIT_OPERATION testCustomValueSetter(JSGlobalObject* lexicalGlobalObject, EncodedJSValue thisValue, EncodedJSValue encodedValue)
{
VM& vm = lexicalGlobalObject->vm();
RELEASE_ASSERT(JSValue::decode(thisValue).isCell());
Modified: trunk/Source/_javascript_Core/runtime/JSArrayBufferConstructor.cpp (267517 => 267518)
--- trunk/Source/_javascript_Core/runtime/JSArrayBufferConstructor.cpp 2020-09-24 04:33:24 UTC (rev 267517)
+++ trunk/Source/_javascript_Core/runtime/JSArrayBufferConstructor.cpp 2020-09-24 05:59:46 UTC (rev 267518)
@@ -35,6 +35,8 @@
static EncodedJSValue JSC_HOST_CALL arrayBufferFuncIsView(JSGlobalObject*, CallFrame*);
static EncodedJSValue JSC_HOST_CALL callArrayBuffer(JSGlobalObject*, CallFrame*);
+static EncodedJSValue JSC_HOST_CALL constructArrayBuffer(JSGlobalObject*, CallFrame*);
+static EncodedJSValue JSC_HOST_CALL constructSharedArrayBuffer(JSGlobalObject*, CallFrame*);
template<>
const ClassInfo JSArrayBufferConstructor::s_info = {
@@ -50,7 +52,7 @@
template<ArrayBufferSharingMode sharingMode>
JSGenericArrayBufferConstructor<sharingMode>::JSGenericArrayBufferConstructor(VM& vm, Structure* structure)
- : Base(vm, structure, callArrayBuffer, JSGenericArrayBufferConstructor<sharingMode>::constructArrayBuffer)
+ : Base(vm, structure, callArrayBuffer, sharingMode == ArrayBufferSharingMode::Default ? constructArrayBuffer : constructSharedArrayBuffer)
{
}
@@ -69,7 +71,7 @@
}
template<ArrayBufferSharingMode sharingMode>
-EncodedJSValue JSC_HOST_CALL JSGenericArrayBufferConstructor<sharingMode>::constructArrayBuffer(JSGlobalObject* globalObject, CallFrame* callFrame)
+EncodedJSValue JSGenericArrayBufferConstructor<sharingMode>::constructImpl(JSGlobalObject* globalObject, CallFrame* callFrame)
{
VM& vm = globalObject->vm();
auto scope = DECLARE_THROW_SCOPE(vm);
@@ -122,6 +124,16 @@
return JSValue::encode(throwConstructorCannotBeCalledAsFunctionTypeError(globalObject, scope, "ArrayBuffer"));
}
+static EncodedJSValue JSC_HOST_CALL constructArrayBuffer(JSGlobalObject* globalObject, CallFrame* callFrame)
+{
+ return JSGenericArrayBufferConstructor<ArrayBufferSharingMode::Default>::constructImpl(globalObject, callFrame);
+}
+
+static EncodedJSValue JSC_HOST_CALL constructSharedArrayBuffer(JSGlobalObject* globalObject, CallFrame* callFrame)
+{
+ return JSGenericArrayBufferConstructor<ArrayBufferSharingMode::Shared>::constructImpl(globalObject, callFrame);
+}
+
// ------------------------------ Functions --------------------------------
// ECMA 24.1.3.1
Modified: trunk/Source/_javascript_Core/runtime/JSArrayBufferConstructor.h (267517 => 267518)
--- trunk/Source/_javascript_Core/runtime/JSArrayBufferConstructor.h 2020-09-24 04:33:24 UTC (rev 267517)
+++ trunk/Source/_javascript_Core/runtime/JSArrayBufferConstructor.h 2020-09-24 05:59:46 UTC (rev 267518)
@@ -51,11 +51,11 @@
static const ClassInfo s_info; // This is never accessed directly, since that would break linkage on some compilers.
static const ClassInfo* info();
+ static EncodedJSValue constructImpl(JSGlobalObject*, CallFrame*);
+
private:
JSGenericArrayBufferConstructor(VM&, Structure*);
void finishCreation(VM&, JSArrayBufferPrototype*, GetterSetter* speciesSymbol);
-
- static EncodedJSValue JSC_HOST_CALL constructArrayBuffer(JSGlobalObject*, CallFrame*);
};
using JSArrayBufferConstructor = JSGenericArrayBufferConstructor<ArrayBufferSharingMode::Default>;
Modified: trunk/Source/_javascript_Core/runtime/JSCustomGetterSetterFunction.cpp (267517 => 267518)
--- trunk/Source/_javascript_Core/runtime/JSCustomGetterSetterFunction.cpp 2020-09-24 04:33:24 UTC (rev 267517)
+++ trunk/Source/_javascript_Core/runtime/JSCustomGetterSetterFunction.cpp 2020-09-24 05:59:46 UTC (rev 267518)
@@ -33,7 +33,7 @@
const ClassInfo JSCustomGetterSetterFunction::s_info = { "Function", &Base::s_info, nullptr, nullptr, CREATE_METHOD_TABLE(JSCustomGetterSetterFunction) };
-EncodedJSValue JSC_HOST_CALL JSCustomGetterSetterFunction::customGetterSetterFunctionCall(JSGlobalObject* globalObject, CallFrame* callFrame)
+static EncodedJSValue JSC_HOST_CALL customGetterSetterFunctionCall(JSGlobalObject* globalObject, CallFrame* callFrame)
{
VM& vm = globalObject->vm();
auto scope = DECLARE_THROW_SCOPE(vm);
Modified: trunk/Source/_javascript_Core/runtime/JSCustomGetterSetterFunction.h (267517 => 267518)
--- trunk/Source/_javascript_Core/runtime/JSCustomGetterSetterFunction.h 2020-09-24 04:33:24 UTC (rev 267517)
+++ trunk/Source/_javascript_Core/runtime/JSCustomGetterSetterFunction.h 2020-09-24 05:59:46 UTC (rev 267518)
@@ -56,17 +56,15 @@
DECLARE_EXPORT_INFO;
+ CustomGetterSetter* customGetterSetter() const { return m_getterSetter.get(); }
+ bool isSetter() const { return m_type == Type::Setter; }
+ const PropertyName& propertyName() const { return m_propertyName; }
+
private:
JSCustomGetterSetterFunction(VM&, NativeExecutable*, JSGlobalObject*, Structure*, Type, const PropertyName&);
void finishCreation(VM&, NativeExecutable*, CustomGetterSetter*, const String&);
static void visitChildren(JSCell*, SlotVisitor&);
- static EncodedJSValue JSC_HOST_CALL customGetterSetterFunctionCall(JSGlobalObject*, CallFrame*);
-
- CustomGetterSetter* customGetterSetter() const { return m_getterSetter.get(); }
- bool isSetter() const { return m_type == Type::Setter; }
- const PropertyName& propertyName() const { return m_propertyName; }
-
WriteBarrier<CustomGetterSetter> m_getterSetter;
Type m_type;
PropertyName m_propertyName;
Modified: trunk/Source/_javascript_Core/runtime/NativeErrorConstructor.cpp (267517 => 267518)
--- trunk/Source/_javascript_Core/runtime/NativeErrorConstructor.cpp 2020-09-24 04:33:24 UTC (rev 267517)
+++ trunk/Source/_javascript_Core/runtime/NativeErrorConstructor.cpp 2020-09-24 05:59:46 UTC (rev 267518)
@@ -32,22 +32,8 @@
const ClassInfo NativeErrorConstructorBase::s_info = { "Function", &Base::s_info, nullptr, nullptr, CREATE_METHOD_TABLE(NativeErrorConstructorBase) };
template<ErrorType errorType>
-NativeErrorConstructor<errorType>::NativeErrorConstructor(VM& vm, Structure* structure)
- : NativeErrorConstructorBase(vm, structure, NativeErrorConstructor<errorType>::callNativeErrorConstructor, NativeErrorConstructor<errorType>::constructNativeErrorConstructor)
+inline EncodedJSValue NativeErrorConstructor<errorType>::constructImpl(JSGlobalObject* globalObject, CallFrame* callFrame)
{
-}
-
-void NativeErrorConstructorBase::finishCreation(VM& vm, NativeErrorPrototype* prototype, ErrorType errorType)
-{
- Base::finishCreation(vm, 1, errorTypeName(errorType), PropertyAdditionMode::WithoutStructureTransition);
- ASSERT(inherits(vm, info()));
-
- putDirectWithoutTransition(vm, vm.propertyNames->prototype, prototype, PropertyAttribute::DontDelete | PropertyAttribute::ReadOnly | PropertyAttribute::DontEnum);
-}
-
-template<ErrorType errorType>
-EncodedJSValue JSC_HOST_CALL NativeErrorConstructor<errorType>::constructNativeErrorConstructor(JSGlobalObject* globalObject, CallFrame* callFrame)
-{
VM& vm = globalObject->vm();
auto scope = DECLARE_THROW_SCOPE(vm);
JSValue message = callFrame->argument(0);
@@ -63,7 +49,7 @@
}
template<ErrorType errorType>
-EncodedJSValue JSC_HOST_CALL NativeErrorConstructor<errorType>::callNativeErrorConstructor(JSGlobalObject* globalObject, CallFrame* callFrame)
+inline EncodedJSValue NativeErrorConstructor<errorType>::callImpl(JSGlobalObject* globalObject, CallFrame* callFrame)
{
JSValue message = callFrame->argument(0);
Structure* errorStructure = globalObject->errorStructure(errorType);
@@ -70,6 +56,100 @@
return JSValue::encode(ErrorInstance::create(globalObject, errorStructure, message, nullptr, TypeNothing, false));
}
+static EncodedJSValue JSC_HOST_CALL callEvalError(JSGlobalObject* globalObject, CallFrame* callFrame)
+{
+ return NativeErrorConstructor<ErrorType::EvalError>::callImpl(globalObject, callFrame);
+}
+static EncodedJSValue JSC_HOST_CALL constructEvalError(JSGlobalObject* globalObject, CallFrame* callFrame)
+{
+ return NativeErrorConstructor<ErrorType::EvalError>::constructImpl(globalObject, callFrame);
+}
+
+static EncodedJSValue JSC_HOST_CALL callRangeError(JSGlobalObject* globalObject, CallFrame* callFrame)
+{
+ return NativeErrorConstructor<ErrorType::RangeError>::callImpl(globalObject, callFrame);
+}
+static EncodedJSValue JSC_HOST_CALL constructRangeError(JSGlobalObject* globalObject, CallFrame* callFrame)
+{
+ return NativeErrorConstructor<ErrorType::RangeError>::constructImpl(globalObject, callFrame);
+}
+
+static EncodedJSValue JSC_HOST_CALL callReferenceError(JSGlobalObject* globalObject, CallFrame* callFrame)
+{
+ return NativeErrorConstructor<ErrorType::ReferenceError>::callImpl(globalObject, callFrame);
+}
+static EncodedJSValue JSC_HOST_CALL constructReferenceError(JSGlobalObject* globalObject, CallFrame* callFrame)
+{
+ return NativeErrorConstructor<ErrorType::ReferenceError>::constructImpl(globalObject, callFrame);
+}
+
+static EncodedJSValue JSC_HOST_CALL callSyntaxError(JSGlobalObject* globalObject, CallFrame* callFrame)
+{
+ return NativeErrorConstructor<ErrorType::SyntaxError>::callImpl(globalObject, callFrame);
+}
+static EncodedJSValue JSC_HOST_CALL constructSyntaxError(JSGlobalObject* globalObject, CallFrame* callFrame)
+{
+ return NativeErrorConstructor<ErrorType::SyntaxError>::constructImpl(globalObject, callFrame);
+}
+
+static EncodedJSValue JSC_HOST_CALL callTypeError(JSGlobalObject* globalObject, CallFrame* callFrame)
+{
+ return NativeErrorConstructor<ErrorType::TypeError>::callImpl(globalObject, callFrame);
+}
+static EncodedJSValue JSC_HOST_CALL constructTypeError(JSGlobalObject* globalObject, CallFrame* callFrame)
+{
+ return NativeErrorConstructor<ErrorType::TypeError>::constructImpl(globalObject, callFrame);
+}
+
+static EncodedJSValue JSC_HOST_CALL callURIError(JSGlobalObject* globalObject, CallFrame* callFrame)
+{
+ return NativeErrorConstructor<ErrorType::URIError>::callImpl(globalObject, callFrame);
+}
+static EncodedJSValue JSC_HOST_CALL constructURIError(JSGlobalObject* globalObject, CallFrame* callFrame)
+{
+ return NativeErrorConstructor<ErrorType::URIError>::constructImpl(globalObject, callFrame);
+}
+
+static constexpr auto callFunction(ErrorType errorType) -> decltype(&callEvalError)
+{
+ switch (errorType) {
+ case ErrorType::EvalError: return callEvalError;
+ case ErrorType::RangeError: return callRangeError;
+ case ErrorType::ReferenceError: return callReferenceError;
+ case ErrorType::SyntaxError: return callSyntaxError;
+ case ErrorType::TypeError: return callTypeError;
+ case ErrorType::URIError: return callURIError;
+ default: return nullptr;
+ }
+}
+
+static constexpr auto constructFunction(ErrorType errorType) -> decltype(&constructEvalError)
+{
+ switch (errorType) {
+ case ErrorType::EvalError: return constructEvalError;
+ case ErrorType::RangeError: return constructRangeError;
+ case ErrorType::ReferenceError: return constructReferenceError;
+ case ErrorType::SyntaxError: return constructSyntaxError;
+ case ErrorType::TypeError: return constructTypeError;
+ case ErrorType::URIError: return constructURIError;
+ default: return nullptr;
+ }
+}
+
+template<ErrorType errorType>
+NativeErrorConstructor<errorType>::NativeErrorConstructor(VM& vm, Structure* structure)
+ : NativeErrorConstructorBase(vm, structure, callFunction(errorType), constructFunction(errorType))
+{
+}
+
+void NativeErrorConstructorBase::finishCreation(VM& vm, NativeErrorPrototype* prototype, ErrorType errorType)
+{
+ Base::finishCreation(vm, 1, errorTypeName(errorType), PropertyAdditionMode::WithoutStructureTransition);
+ ASSERT(inherits(vm, info()));
+
+ putDirectWithoutTransition(vm, vm.propertyNames->prototype, prototype, PropertyAttribute::DontDelete | PropertyAttribute::ReadOnly | PropertyAttribute::DontEnum);
+}
+
template class NativeErrorConstructor<ErrorType::EvalError>;
template class NativeErrorConstructor<ErrorType::RangeError>;
template class NativeErrorConstructor<ErrorType::ReferenceError>;
Modified: trunk/Source/_javascript_Core/runtime/NativeErrorConstructor.h (267517 => 267518)
--- trunk/Source/_javascript_Core/runtime/NativeErrorConstructor.h 2020-09-24 04:33:24 UTC (rev 267517)
+++ trunk/Source/_javascript_Core/runtime/NativeErrorConstructor.h 2020-09-24 05:59:46 UTC (rev 267518)
@@ -59,10 +59,10 @@
constructor->finishCreation(vm, prototype, errorType);
return constructor;
}
+
+ static EncodedJSValue callImpl(JSGlobalObject*, CallFrame*);
+ static EncodedJSValue constructImpl(JSGlobalObject*, CallFrame*);
private:
- static EncodedJSValue JSC_HOST_CALL callNativeErrorConstructor(JSGlobalObject*, CallFrame*);
- static EncodedJSValue JSC_HOST_CALL constructNativeErrorConstructor(JSGlobalObject*, CallFrame*);
-
NativeErrorConstructor(VM&, Structure*);
};
Modified: trunk/Source/_javascript_Core/runtime/RegExpConstructor.cpp (267517 => 267518)
--- trunk/Source/_javascript_Core/runtime/RegExpConstructor.cpp 2020-09-24 04:33:24 UTC (rev 267517)
+++ trunk/Source/_javascript_Core/runtime/RegExpConstructor.cpp 2020-09-24 05:59:46 UTC (rev 267518)
@@ -29,18 +29,24 @@
namespace JSC {
-static EncodedJSValue regExpConstructorInput(JSGlobalObject*, EncodedJSValue, PropertyName);
-static EncodedJSValue regExpConstructorMultiline(JSGlobalObject*, EncodedJSValue, PropertyName);
-static EncodedJSValue regExpConstructorLastMatch(JSGlobalObject*, EncodedJSValue, PropertyName);
-static EncodedJSValue regExpConstructorLastParen(JSGlobalObject*, EncodedJSValue, PropertyName);
-static EncodedJSValue regExpConstructorLeftContext(JSGlobalObject*, EncodedJSValue, PropertyName);
-static EncodedJSValue regExpConstructorRightContext(JSGlobalObject*, EncodedJSValue, PropertyName);
-template<int N>
-static EncodedJSValue regExpConstructorDollar(JSGlobalObject*, EncodedJSValue, PropertyName);
+static EncodedJSValue JIT_OPERATION regExpConstructorInput(JSGlobalObject*, EncodedJSValue, PropertyName);
+static EncodedJSValue JIT_OPERATION regExpConstructorMultiline(JSGlobalObject*, EncodedJSValue, PropertyName);
+static EncodedJSValue JIT_OPERATION regExpConstructorLastMatch(JSGlobalObject*, EncodedJSValue, PropertyName);
+static EncodedJSValue JIT_OPERATION regExpConstructorLastParen(JSGlobalObject*, EncodedJSValue, PropertyName);
+static EncodedJSValue JIT_OPERATION regExpConstructorLeftContext(JSGlobalObject*, EncodedJSValue, PropertyName);
+static EncodedJSValue JIT_OPERATION regExpConstructorRightContext(JSGlobalObject*, EncodedJSValue, PropertyName);
+static EncodedJSValue JIT_OPERATION regExpConstructorDollar1(JSGlobalObject*, EncodedJSValue, PropertyName);
+static EncodedJSValue JIT_OPERATION regExpConstructorDollar2(JSGlobalObject*, EncodedJSValue, PropertyName);
+static EncodedJSValue JIT_OPERATION regExpConstructorDollar3(JSGlobalObject*, EncodedJSValue, PropertyName);
+static EncodedJSValue JIT_OPERATION regExpConstructorDollar4(JSGlobalObject*, EncodedJSValue, PropertyName);
+static EncodedJSValue JIT_OPERATION regExpConstructorDollar5(JSGlobalObject*, EncodedJSValue, PropertyName);
+static EncodedJSValue JIT_OPERATION regExpConstructorDollar6(JSGlobalObject*, EncodedJSValue, PropertyName);
+static EncodedJSValue JIT_OPERATION regExpConstructorDollar7(JSGlobalObject*, EncodedJSValue, PropertyName);
+static EncodedJSValue JIT_OPERATION regExpConstructorDollar8(JSGlobalObject*, EncodedJSValue, PropertyName);
+static EncodedJSValue JIT_OPERATION regExpConstructorDollar9(JSGlobalObject*, EncodedJSValue, PropertyName);
+static bool JIT_OPERATION setRegExpConstructorInput(JSGlobalObject*, EncodedJSValue, EncodedJSValue);
+static bool JIT_OPERATION setRegExpConstructorMultiline(JSGlobalObject*, EncodedJSValue, EncodedJSValue);
-static bool setRegExpConstructorInput(JSGlobalObject*, EncodedJSValue, EncodedJSValue);
-static bool setRegExpConstructorMultiline(JSGlobalObject*, EncodedJSValue, EncodedJSValue);
-
} // namespace JSC
#include "RegExpConstructor.lut.h"
@@ -63,15 +69,15 @@
$` regExpConstructorLeftContext DontDelete|ReadOnly|DontEnum
rightContext regExpConstructorRightContext DontDelete|ReadOnly
$' regExpConstructorRightContext DontDelete|ReadOnly|DontEnum
- $1 regExpConstructorDollar<1> DontDelete|ReadOnly
- $2 regExpConstructorDollar<2> DontDelete|ReadOnly
- $3 regExpConstructorDollar<3> DontDelete|ReadOnly
- $4 regExpConstructorDollar<4> DontDelete|ReadOnly
- $5 regExpConstructorDollar<5> DontDelete|ReadOnly
- $6 regExpConstructorDollar<6> DontDelete|ReadOnly
- $7 regExpConstructorDollar<7> DontDelete|ReadOnly
- $8 regExpConstructorDollar<8> DontDelete|ReadOnly
- $9 regExpConstructorDollar<9> DontDelete|ReadOnly
+ $1 regExpConstructorDollar1 DontDelete|ReadOnly
+ $2 regExpConstructorDollar2 DontDelete|ReadOnly
+ $3 regExpConstructorDollar3 DontDelete|ReadOnly
+ $4 regExpConstructorDollar4 DontDelete|ReadOnly
+ $5 regExpConstructorDollar5 DontDelete|ReadOnly
+ $6 regExpConstructorDollar6 DontDelete|ReadOnly
+ $7 regExpConstructorDollar7 DontDelete|ReadOnly
+ $8 regExpConstructorDollar8 DontDelete|ReadOnly
+ $9 regExpConstructorDollar9 DontDelete|ReadOnly
@end
*/
@@ -95,49 +101,86 @@
}
template<int N>
-EncodedJSValue regExpConstructorDollar(JSGlobalObject*, EncodedJSValue thisValue, PropertyName)
+inline EncodedJSValue regExpConstructorDollarImpl(JSGlobalObject*, EncodedJSValue thisValue, PropertyName)
{
JSGlobalObject* globalObject = jsCast<RegExpConstructor*>(JSValue::decode(thisValue))->globalObject();
return JSValue::encode(globalObject->regExpGlobalData().getBackref(globalObject, N));
}
-EncodedJSValue regExpConstructorInput(JSGlobalObject*, EncodedJSValue thisValue, PropertyName)
+EncodedJSValue JIT_OPERATION regExpConstructorDollar1(JSGlobalObject* globalObject, EncodedJSValue thisValue, PropertyName propertyName)
{
+ return regExpConstructorDollarImpl<1>(globalObject, thisValue, propertyName);
+}
+EncodedJSValue JIT_OPERATION regExpConstructorDollar2(JSGlobalObject* globalObject, EncodedJSValue thisValue, PropertyName propertyName)
+{
+ return regExpConstructorDollarImpl<2>(globalObject, thisValue, propertyName);
+}
+EncodedJSValue JIT_OPERATION regExpConstructorDollar3(JSGlobalObject* globalObject, EncodedJSValue thisValue, PropertyName propertyName)
+{
+ return regExpConstructorDollarImpl<3>(globalObject, thisValue, propertyName);
+}
+EncodedJSValue JIT_OPERATION regExpConstructorDollar4(JSGlobalObject* globalObject, EncodedJSValue thisValue, PropertyName propertyName)
+{
+ return regExpConstructorDollarImpl<4>(globalObject, thisValue, propertyName);
+}
+EncodedJSValue JIT_OPERATION regExpConstructorDollar5(JSGlobalObject* globalObject, EncodedJSValue thisValue, PropertyName propertyName)
+{
+ return regExpConstructorDollarImpl<5>(globalObject, thisValue, propertyName);
+}
+EncodedJSValue JIT_OPERATION regExpConstructorDollar6(JSGlobalObject* globalObject, EncodedJSValue thisValue, PropertyName propertyName)
+{
+ return regExpConstructorDollarImpl<6>(globalObject, thisValue, propertyName);
+}
+EncodedJSValue JIT_OPERATION regExpConstructorDollar7(JSGlobalObject* globalObject, EncodedJSValue thisValue, PropertyName propertyName)
+{
+ return regExpConstructorDollarImpl<7>(globalObject, thisValue, propertyName);
+}
+EncodedJSValue JIT_OPERATION regExpConstructorDollar8(JSGlobalObject* globalObject, EncodedJSValue thisValue, PropertyName propertyName)
+{
+ return regExpConstructorDollarImpl<8>(globalObject, thisValue, propertyName);
+}
+EncodedJSValue JIT_OPERATION regExpConstructorDollar9(JSGlobalObject* globalObject, EncodedJSValue thisValue, PropertyName propertyName)
+{
+ return regExpConstructorDollarImpl<9>(globalObject, thisValue, propertyName);
+}
+
+EncodedJSValue JIT_OPERATION regExpConstructorInput(JSGlobalObject*, EncodedJSValue thisValue, PropertyName)
+{
JSGlobalObject* globalObject = jsCast<RegExpConstructor*>(JSValue::decode(thisValue))->globalObject();
return JSValue::encode(globalObject->regExpGlobalData().input());
}
-EncodedJSValue regExpConstructorMultiline(JSGlobalObject*, EncodedJSValue thisValue, PropertyName)
+EncodedJSValue JIT_OPERATION regExpConstructorMultiline(JSGlobalObject*, EncodedJSValue thisValue, PropertyName)
{
JSGlobalObject* globalObject = jsCast<RegExpConstructor*>(JSValue::decode(thisValue))->globalObject();
return JSValue::encode(jsBoolean(globalObject->regExpGlobalData().multiline()));
}
-EncodedJSValue regExpConstructorLastMatch(JSGlobalObject*, EncodedJSValue thisValue, PropertyName)
+EncodedJSValue JIT_OPERATION regExpConstructorLastMatch(JSGlobalObject*, EncodedJSValue thisValue, PropertyName)
{
JSGlobalObject* globalObject = jsCast<RegExpConstructor*>(JSValue::decode(thisValue))->globalObject();
return JSValue::encode(globalObject->regExpGlobalData().getBackref(globalObject, 0));
}
-EncodedJSValue regExpConstructorLastParen(JSGlobalObject*, EncodedJSValue thisValue, PropertyName)
+EncodedJSValue JIT_OPERATION regExpConstructorLastParen(JSGlobalObject*, EncodedJSValue thisValue, PropertyName)
{
JSGlobalObject* globalObject = jsCast<RegExpConstructor*>(JSValue::decode(thisValue))->globalObject();
return JSValue::encode(globalObject->regExpGlobalData().getLastParen(globalObject));
}
-EncodedJSValue regExpConstructorLeftContext(JSGlobalObject*, EncodedJSValue thisValue, PropertyName)
+EncodedJSValue JIT_OPERATION regExpConstructorLeftContext(JSGlobalObject*, EncodedJSValue thisValue, PropertyName)
{
JSGlobalObject* globalObject = jsCast<RegExpConstructor*>(JSValue::decode(thisValue))->globalObject();
return JSValue::encode(globalObject->regExpGlobalData().getLeftContext(globalObject));
}
-EncodedJSValue regExpConstructorRightContext(JSGlobalObject*, EncodedJSValue thisValue, PropertyName)
+EncodedJSValue JIT_OPERATION regExpConstructorRightContext(JSGlobalObject*, EncodedJSValue thisValue, PropertyName)
{
JSGlobalObject* globalObject = jsCast<RegExpConstructor*>(JSValue::decode(thisValue))->globalObject();
return JSValue::encode(globalObject->regExpGlobalData().getRightContext(globalObject));
}
-bool setRegExpConstructorInput(JSGlobalObject* globalObject, EncodedJSValue thisValue, EncodedJSValue value)
+bool JIT_OPERATION setRegExpConstructorInput(JSGlobalObject* globalObject, EncodedJSValue thisValue, EncodedJSValue value)
{
VM& vm = globalObject->vm();
auto scope = DECLARE_THROW_SCOPE(vm);
@@ -152,7 +195,7 @@
return false;
}
-bool setRegExpConstructorMultiline(JSGlobalObject* globalObject, EncodedJSValue thisValue, EncodedJSValue value)
+bool JIT_OPERATION setRegExpConstructorMultiline(JSGlobalObject* globalObject, EncodedJSValue thisValue, EncodedJSValue value)
{
VM& vm = globalObject->vm();
auto scope = DECLARE_THROW_SCOPE(vm);
Modified: trunk/Source/_javascript_Core/tools/JSDollarVM.cpp (267517 => 267518)
--- trunk/Source/_javascript_Core/tools/JSDollarVM.cpp 2020-09-24 04:33:24 UTC (rev 267517)
+++ trunk/Source/_javascript_Core/tools/JSDollarVM.cpp 2020-09-24 05:59:46 UTC (rev 267518)
@@ -1495,13 +1495,13 @@
};
-static EncodedJSValue customGetAccessor(JSGlobalObject*, EncodedJSValue thisValue, PropertyName)
+static EncodedJSValue JIT_OPERATION customGetAccessor(JSGlobalObject*, EncodedJSValue thisValue, PropertyName)
{
// Passed |this|
return thisValue;
}
-static EncodedJSValue customGetValue(JSGlobalObject* globalObject, EncodedJSValue slotValue, PropertyName)
+static EncodedJSValue JIT_OPERATION customGetValue(JSGlobalObject* globalObject, EncodedJSValue slotValue, PropertyName)
{
RELEASE_ASSERT(JSValue::decode(slotValue).inherits<JSTestCustomGetterSetter>(globalObject->vm()));
// Passed property holder.
@@ -1508,17 +1508,17 @@
return slotValue;
}
-static EncodedJSValue customGetAccessorGlobalObject(JSGlobalObject* globalObject, EncodedJSValue, PropertyName)
+static EncodedJSValue JIT_OPERATION customGetAccessorGlobalObject(JSGlobalObject* globalObject, EncodedJSValue, PropertyName)
{
return JSValue::encode(globalObject);
}
-static EncodedJSValue customGetValueGlobalObject(JSGlobalObject* globalObject, EncodedJSValue, PropertyName)
+static EncodedJSValue JIT_OPERATION customGetValueGlobalObject(JSGlobalObject* globalObject, EncodedJSValue, PropertyName)
{
return JSValue::encode(globalObject);
}
-static bool customSetAccessor(JSGlobalObject* globalObject, EncodedJSValue thisObject, EncodedJSValue encodedValue)
+static bool JIT_OPERATION customSetAccessor(JSGlobalObject* globalObject, EncodedJSValue thisObject, EncodedJSValue encodedValue)
{
DollarVMAssertScope assertScope;
VM& vm = globalObject->vm();
@@ -1532,7 +1532,7 @@
return true;
}
-static bool customSetValue(JSGlobalObject* globalObject, EncodedJSValue slotValue, EncodedJSValue encodedValue)
+static bool JIT_OPERATION customSetValue(JSGlobalObject* globalObject, EncodedJSValue slotValue, EncodedJSValue encodedValue)
{
DollarVMAssertScope assertScope;
VM& vm = globalObject->vm();
@@ -1548,7 +1548,7 @@
return true;
}
-static bool customFunctionSetter(JSGlobalObject* globalObject, EncodedJSValue, EncodedJSValue encodedValue)
+static bool JIT_OPERATION customFunctionSetter(JSGlobalObject* globalObject, EncodedJSValue, EncodedJSValue encodedValue)
{
DollarVMAssertScope assertScope;
VM& vm = globalObject->vm();