Changeset 295608 in webkit for trunk/Source/JavaScriptCore/tools/JSDollarVM.cpp
- Timestamp:
- Jun 16, 2022, 1:11:51 PM (3 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/JavaScriptCore/tools/JSDollarVM.cpp
r295270 r295608 888 888 }; 889 889 890 static JSC_DECLARE_HOST_FUNCTION(staticDontDeleteDontEnumMethod); 891 892 class StaticDontDeleteDontEnum : public JSNonFinalObject { 893 public: 894 using Base = JSNonFinalObject; 895 static constexpr unsigned StructureFlags = Base::StructureFlags | HasStaticPropertyTable; 896 897 StaticDontDeleteDontEnum(VM& vm, Structure* structure) 898 : Base(vm, structure) 899 { 900 DollarVMAssertScope assertScope; 901 } 902 903 DECLARE_INFO; 904 905 template<typename CellType, SubspaceAccess> 906 static CompleteSubspace* subspaceFor(VM& vm) 907 { 908 return &vm.cellSpace(); 909 } 910 911 static Structure* createStructure(VM& vm, JSGlobalObject* globalObject, JSValue prototype) 912 { 913 DollarVMAssertScope assertScope; 914 return Structure::create(vm, globalObject, prototype, TypeInfo(ObjectType, StructureFlags), info()); 915 } 916 917 static StaticDontDeleteDontEnum* create(VM& vm, Structure* structure) 918 { 919 DollarVMAssertScope assertScope; 920 StaticDontDeleteDontEnum* result = new (NotNull, allocateCell<StaticDontDeleteDontEnum>(vm)) StaticDontDeleteDontEnum(vm, structure); 921 result->finishCreation(vm); 922 return result; 923 } 924 }; 925 926 JSC_DEFINE_HOST_FUNCTION(staticDontDeleteDontEnumMethod, (JSGlobalObject*, CallFrame*)) 927 { 928 DollarVMAssertScope assertScope; 929 return encodedJSUndefined(); 930 } 931 932 static const struct CompactHashIndex staticDontDeleteDontEnumTableIndex[8] = { 933 { 0, -1 }, 934 { 1, -1 }, 935 { -1, -1 }, 936 { -1, -1 }, 937 { -1, -1 }, 938 { 2, -1 }, 939 { -1, -1 }, 940 { -1, -1 }, 941 }; 942 943 static const struct HashTableValue staticDontDeleteDontEnumTableValues[3] = { 944 { "dontEnum"_s, static_cast<unsigned>(PropertyAttribute::Function|PropertyAttribute::DontEnum), NoIntrinsic, { (intptr_t)static_cast<RawNativeFunction>(staticDontDeleteDontEnumMethod), (intptr_t)(0) } }, 945 { "dontDelete"_s, static_cast<unsigned>(PropertyAttribute::Function|PropertyAttribute::DontDelete), NoIntrinsic, { (intptr_t)static_cast<RawNativeFunction>(staticDontDeleteDontEnumMethod), (intptr_t)(0) } }, 946 { "dontDeleteDontEnum"_s, static_cast<unsigned>(PropertyAttribute::Function|PropertyAttribute::DontDelete|PropertyAttribute::DontEnum), NoIntrinsic, { (intptr_t)static_cast<RawNativeFunction>(staticDontDeleteDontEnumMethod), (intptr_t)(0) } }, 947 }; 948 949 static const struct HashTable staticDontDeleteDontEnumTable = 950 { 3, 7, false, nullptr, staticDontDeleteDontEnumTableValues, staticDontDeleteDontEnumTableIndex }; 951 890 952 class ObjectDoingSideEffectPutWithoutCorrectSlotStatus : public JSNonFinalObject { 891 953 using Base = JSNonFinalObject; … … 1804 1866 const ClassInfo StaticCustomAccessor::s_info = { "StaticCustomAccessor"_s, &Base::s_info, &staticCustomAccessorTable, nullptr, CREATE_METHOD_TABLE(StaticCustomAccessor) }; 1805 1867 const ClassInfo StaticCustomValue::s_info = { "StaticCustomValue"_s, &Base::s_info, &staticCustomValueTable, nullptr, CREATE_METHOD_TABLE(StaticCustomValue) }; 1868 const ClassInfo StaticDontDeleteDontEnum::s_info = { "StaticDontDeleteDontEnum"_s, &Base::s_info, &staticDontDeleteDontEnumTable, nullptr, CREATE_METHOD_TABLE(StaticDontDeleteDontEnum) }; 1806 1869 const ClassInfo ObjectDoingSideEffectPutWithoutCorrectSlotStatus::s_info = { "ObjectDoingSideEffectPutWithoutCorrectSlotStatus"_s, &Base::s_info, &staticCustomAccessorTable, nullptr, CREATE_METHOD_TABLE(ObjectDoingSideEffectPutWithoutCorrectSlotStatus) }; 1807 1870 … … 2080 2143 static JSC_DECLARE_HOST_FUNCTION(functionCreateStaticCustomAccessor); 2081 2144 static JSC_DECLARE_HOST_FUNCTION(functionCreateStaticCustomValue); 2145 static JSC_DECLARE_HOST_FUNCTION(functionCreateStaticDontDeleteDontEnum); 2082 2146 static JSC_DECLARE_HOST_FUNCTION(functionCreateObjectDoingSideEffectPutWithoutCorrectSlotStatus); 2083 2147 static JSC_DECLARE_HOST_FUNCTION(functionCreateEmptyFunctionWithName); … … 3082 3146 } 3083 3147 3148 JSC_DEFINE_HOST_FUNCTION(functionCreateStaticDontDeleteDontEnum, (JSGlobalObject* globalObject, CallFrame*)) 3149 { 3150 DollarVMAssertScope assertScope; 3151 VM& vm = globalObject->vm(); 3152 JSLockHolder lock(vm); 3153 Structure* structure = StaticDontDeleteDontEnum::createStructure(vm, globalObject, jsNull()); 3154 auto* result = StaticDontDeleteDontEnum::create(vm, structure); 3155 return JSValue::encode(result); 3156 } 3157 3084 3158 JSC_DEFINE_HOST_FUNCTION(functionCreateObjectDoingSideEffectPutWithoutCorrectSlotStatus, (JSGlobalObject* globalObject, CallFrame* callFrame)) 3085 3159 { … … 3928 4002 addFunction(vm, "createStaticCustomAccessor"_s, functionCreateStaticCustomAccessor, 0); 3929 4003 addFunction(vm, "createStaticCustomValue"_s, functionCreateStaticCustomValue, 0); 4004 addFunction(vm, "createStaticDontDeleteDontEnum"_s, functionCreateStaticDontDeleteDontEnum, 0); 3930 4005 addFunction(vm, "createObjectDoingSideEffectPutWithoutCorrectSlotStatus"_s, functionCreateObjectDoingSideEffectPutWithoutCorrectSlotStatus, 0); 3931 4006 addFunction(vm, "createEmptyFunctionWithName"_s, functionCreateEmptyFunctionWithName, 1);
Note:
See TracChangeset
for help on using the changeset viewer.