Changeset 267364 in webkit
- Timestamp:
- Sep 21, 2020, 1:41:07 PM (6 years ago)
- Location:
- trunk/Source
- Files:
-
- 56 edited
-
JavaScriptCore/API/JSCallbackFunction.cpp (modified) (1 diff)
-
JavaScriptCore/API/ObjCCallbackFunction.mm (modified) (1 diff)
-
JavaScriptCore/API/glib/JSCCallbackFunction.cpp (modified) (1 diff)
-
JavaScriptCore/ChangeLog (modified) (1 diff)
-
JavaScriptCore/runtime/AggregateErrorConstructor.cpp (modified) (1 diff)
-
JavaScriptCore/runtime/ArrayConstructor.cpp (modified) (1 diff)
-
JavaScriptCore/runtime/AsyncFunctionConstructor.cpp (modified) (1 diff)
-
JavaScriptCore/runtime/AsyncGeneratorFunctionConstructor.cpp (modified) (1 diff)
-
JavaScriptCore/runtime/BigIntConstructor.cpp (modified) (1 diff)
-
JavaScriptCore/runtime/BooleanConstructor.cpp (modified) (1 diff)
-
JavaScriptCore/runtime/DateConstructor.cpp (modified) (1 diff)
-
JavaScriptCore/runtime/ErrorConstructor.cpp (modified) (1 diff)
-
JavaScriptCore/runtime/FinalizationRegistryConstructor.cpp (modified) (1 diff)
-
JavaScriptCore/runtime/FunctionConstructor.cpp (modified) (1 diff)
-
JavaScriptCore/runtime/FunctionPrototype.cpp (modified) (1 diff)
-
JavaScriptCore/runtime/GeneratorFunctionConstructor.cpp (modified) (1 diff)
-
JavaScriptCore/runtime/InternalFunction.cpp (modified) (3 diffs)
-
JavaScriptCore/runtime/InternalFunction.h (modified) (1 diff)
-
JavaScriptCore/runtime/IntlCollatorConstructor.cpp (modified) (1 diff)
-
JavaScriptCore/runtime/IntlDateTimeFormatConstructor.cpp (modified) (1 diff)
-
JavaScriptCore/runtime/IntlDisplayNamesConstructor.cpp (modified) (1 diff)
-
JavaScriptCore/runtime/IntlLocaleConstructor.cpp (modified) (1 diff)
-
JavaScriptCore/runtime/IntlNumberFormatConstructor.cpp (modified) (1 diff)
-
JavaScriptCore/runtime/IntlPluralRulesConstructor.cpp (modified) (1 diff)
-
JavaScriptCore/runtime/IntlRelativeTimeFormatConstructor.cpp (modified) (1 diff)
-
JavaScriptCore/runtime/IntlSegmenterConstructor.cpp (modified) (1 diff)
-
JavaScriptCore/runtime/JSArrayBufferConstructor.cpp (modified) (1 diff)
-
JavaScriptCore/runtime/JSGenericTypedArrayViewConstructorInlines.h (modified) (1 diff)
-
JavaScriptCore/runtime/JSTypedArrayViewConstructor.cpp (modified) (1 diff)
-
JavaScriptCore/runtime/MapConstructor.cpp (modified) (1 diff)
-
JavaScriptCore/runtime/NativeErrorConstructor.cpp (modified) (1 diff)
-
JavaScriptCore/runtime/NullGetterFunction.h (modified) (1 diff)
-
JavaScriptCore/runtime/NullSetterFunction.h (modified) (1 diff)
-
JavaScriptCore/runtime/NumberConstructor.cpp (modified) (2 diffs)
-
JavaScriptCore/runtime/ObjectConstructor.cpp (modified) (1 diff)
-
JavaScriptCore/runtime/ProxyConstructor.cpp (modified) (1 diff)
-
JavaScriptCore/runtime/ProxyRevoke.cpp (modified) (1 diff)
-
JavaScriptCore/runtime/RegExpConstructor.cpp (modified) (1 diff)
-
JavaScriptCore/runtime/SetConstructor.cpp (modified) (1 diff)
-
JavaScriptCore/runtime/StringConstructor.cpp (modified) (1 diff)
-
JavaScriptCore/runtime/SymbolConstructor.cpp (modified) (1 diff)
-
JavaScriptCore/runtime/WeakMapConstructor.cpp (modified) (1 diff)
-
JavaScriptCore/runtime/WeakObjectRefConstructor.cpp (modified) (1 diff)
-
JavaScriptCore/runtime/WeakSetConstructor.cpp (modified) (1 diff)
-
JavaScriptCore/wasm/js/WebAssemblyCompileErrorConstructor.cpp (modified) (1 diff)
-
JavaScriptCore/wasm/js/WebAssemblyGlobalConstructor.cpp (modified) (1 diff)
-
JavaScriptCore/wasm/js/WebAssemblyInstanceConstructor.cpp (modified) (1 diff)
-
JavaScriptCore/wasm/js/WebAssemblyLinkErrorConstructor.cpp (modified) (1 diff)
-
JavaScriptCore/wasm/js/WebAssemblyMemoryConstructor.cpp (modified) (1 diff)
-
JavaScriptCore/wasm/js/WebAssemblyModuleConstructor.cpp (modified) (1 diff)
-
JavaScriptCore/wasm/js/WebAssemblyRuntimeErrorConstructor.cpp (modified) (1 diff)
-
JavaScriptCore/wasm/js/WebAssemblyTableConstructor.cpp (modified) (1 diff)
-
WebCore/ChangeLog (modified) (1 diff)
-
WebCore/bridge/runtime_method.cpp (modified) (1 diff)
-
WebKit/ChangeLog (modified) (1 diff)
-
WebKit/WebProcess/Plugins/Netscape/JSNPMethod.cpp (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/JavaScriptCore/API/JSCallbackFunction.cpp
r261895 r267364 44 44 void JSCallbackFunction::finishCreation(VM& vm, const String& name) 45 45 { 46 Base::finishCreation(vm, name);46 Base::finishCreation(vm, 0, name); 47 47 ASSERT(inherits(vm, info())); 48 48 } -
trunk/Source/JavaScriptCore/API/ObjCCallbackFunction.mm
r261569 r267364 548 548 Structure* structure = globalObject->objcCallbackFunctionStructure(); 549 549 ObjCCallbackFunction* function = new (NotNull, allocateCell<ObjCCallbackFunction>(vm.heap)) ObjCCallbackFunction(vm, structure, objCCallbackFunctionCallAsFunction, objCCallbackFunctionCallAsConstructor, WTFMove(impl)); 550 function->finishCreation(vm, name);550 function->finishCreation(vm, 0, name); 551 551 return function; 552 552 } -
trunk/Source/JavaScriptCore/API/glib/JSCCallbackFunction.cpp
r252875 r267364 57 57 Structure* structure = globalObject->glibCallbackFunctionStructure(); 58 58 JSCCallbackFunction* function = new (NotNull, allocateCell<JSCCallbackFunction>(vm.heap)) JSCCallbackFunction(vm, structure, type, jscClass, WTFMove(closure), returnType, WTFMove(parameters)); 59 function->finishCreation(vm, name);59 function->finishCreation(vm, 0, name); 60 60 return function; 61 61 } -
trunk/Source/JavaScriptCore/ChangeLog
r267348 r267364 1 2020-09-21 Keith Miller <keith_miller@apple.com> 2 3 Functions should consistently enumerate length before name 4 https://bugs.webkit.org/show_bug.cgi?id=216789 5 6 Reviewed by Yusuke Suzuki. 7 8 In https://github.com/tc39/ecma262/pull/2116, which has been 9 approved to be merged into the main JS spec, it's expected that 10 all functions should have their length property enumerated before 11 the name property. To ensure this invariant, this patch moves the 12 length set into InternalFunction::finishCreation. 13 14 There are no new tests since tests will be added to test262 when 15 the spec PR is merged. Adding tests to stress just means we will 16 have the same test twice, which seems like a waste. 17 18 * API/JSCallbackFunction.cpp: 19 (JSC::JSCallbackFunction::finishCreation): 20 * API/ObjCCallbackFunction.mm: 21 (JSC::ObjCCallbackFunction::create): 22 * API/glib/JSCCallbackFunction.cpp: 23 (JSC::JSCCallbackFunction::create): 24 * runtime/AggregateErrorConstructor.cpp: 25 (JSC::AggregateErrorConstructor::finishCreation): 26 * runtime/ArrayConstructor.cpp: 27 (JSC::ArrayConstructor::finishCreation): 28 * runtime/AsyncFunctionConstructor.cpp: 29 (JSC::AsyncFunctionConstructor::finishCreation): 30 * runtime/AsyncGeneratorFunctionConstructor.cpp: 31 (JSC::AsyncGeneratorFunctionConstructor::finishCreation): 32 * runtime/BigIntConstructor.cpp: 33 (JSC::BigIntConstructor::finishCreation): 34 * runtime/BooleanConstructor.cpp: 35 (JSC::BooleanConstructor::finishCreation): 36 * runtime/DateConstructor.cpp: 37 (JSC::DateConstructor::finishCreation): 38 * runtime/ErrorConstructor.cpp: 39 (JSC::ErrorConstructor::finishCreation): 40 * runtime/FinalizationRegistryConstructor.cpp: 41 (JSC::FinalizationRegistryConstructor::finishCreation): 42 * runtime/FunctionConstructor.cpp: 43 (JSC::FunctionConstructor::finishCreation): 44 * runtime/FunctionPrototype.cpp: 45 (JSC::FunctionPrototype::finishCreation): 46 * runtime/GeneratorFunctionConstructor.cpp: 47 (JSC::GeneratorFunctionConstructor::finishCreation): 48 * runtime/InternalFunction.cpp: 49 (JSC::InternalFunction::finishCreation): 50 (JSC::InternalFunction::createFunctionThatMasqueradesAsUndefined): 51 * runtime/InternalFunction.h: 52 * runtime/IntlCollatorConstructor.cpp: 53 (JSC::IntlCollatorConstructor::finishCreation): 54 * runtime/IntlDateTimeFormatConstructor.cpp: 55 (JSC::IntlDateTimeFormatConstructor::finishCreation): 56 * runtime/IntlDisplayNamesConstructor.cpp: 57 (JSC::IntlDisplayNamesConstructor::finishCreation): 58 * runtime/IntlLocaleConstructor.cpp: 59 (JSC::IntlLocaleConstructor::finishCreation): 60 * runtime/IntlNumberFormatConstructor.cpp: 61 (JSC::IntlNumberFormatConstructor::finishCreation): 62 * runtime/IntlPluralRulesConstructor.cpp: 63 (JSC::IntlPluralRulesConstructor::finishCreation): 64 * runtime/IntlRelativeTimeFormatConstructor.cpp: 65 (JSC::IntlRelativeTimeFormatConstructor::finishCreation): 66 * runtime/IntlSegmenterConstructor.cpp: 67 (JSC::IntlSegmenterConstructor::finishCreation): 68 * runtime/JSArrayBufferConstructor.cpp: 69 (JSC::JSGenericArrayBufferConstructor<sharingMode>::finishCreation): 70 * runtime/JSGenericTypedArrayViewConstructorInlines.h: 71 (JSC::JSGenericTypedArrayViewConstructor<ViewClass>::finishCreation): 72 * runtime/JSTypedArrayViewConstructor.cpp: 73 (JSC::JSTypedArrayViewConstructor::finishCreation): 74 * runtime/MapConstructor.cpp: 75 (JSC::MapConstructor::finishCreation): 76 * runtime/NativeErrorConstructor.cpp: 77 (JSC::NativeErrorConstructorBase::finishCreation): 78 * runtime/NullGetterFunction.h: 79 * runtime/NullSetterFunction.h: 80 * runtime/NumberConstructor.cpp: 81 (JSC::NumberConstructor::finishCreation): 82 * runtime/ObjectConstructor.cpp: 83 (JSC::ObjectConstructor::finishCreation): 84 * runtime/ProxyConstructor.cpp: 85 (JSC::ProxyConstructor::finishCreation): 86 * runtime/ProxyRevoke.cpp: 87 (JSC::ProxyRevoke::finishCreation): 88 * runtime/RegExpConstructor.cpp: 89 (JSC::RegExpConstructor::finishCreation): 90 * runtime/SetConstructor.cpp: 91 (JSC::SetConstructor::finishCreation): 92 * runtime/StringConstructor.cpp: 93 (JSC::StringConstructor::finishCreation): 94 * runtime/SymbolConstructor.cpp: 95 (JSC::SymbolConstructor::finishCreation): 96 * runtime/WeakMapConstructor.cpp: 97 (JSC::WeakMapConstructor::finishCreation): 98 * runtime/WeakObjectRefConstructor.cpp: 99 (JSC::WeakObjectRefConstructor::finishCreation): 100 * runtime/WeakSetConstructor.cpp: 101 (JSC::WeakSetConstructor::finishCreation): 102 * wasm/js/WebAssemblyCompileErrorConstructor.cpp: 103 (JSC::WebAssemblyCompileErrorConstructor::finishCreation): 104 * wasm/js/WebAssemblyGlobalConstructor.cpp: 105 (JSC::WebAssemblyGlobalConstructor::finishCreation): 106 * wasm/js/WebAssemblyInstanceConstructor.cpp: 107 (JSC::WebAssemblyInstanceConstructor::finishCreation): 108 * wasm/js/WebAssemblyLinkErrorConstructor.cpp: 109 (JSC::WebAssemblyLinkErrorConstructor::finishCreation): 110 * wasm/js/WebAssemblyMemoryConstructor.cpp: 111 (JSC::WebAssemblyMemoryConstructor::finishCreation): 112 * wasm/js/WebAssemblyModuleConstructor.cpp: 113 (JSC::WebAssemblyModuleConstructor::finishCreation): 114 * wasm/js/WebAssemblyRuntimeErrorConstructor.cpp: 115 (JSC::WebAssemblyRuntimeErrorConstructor::finishCreation): 116 * wasm/js/WebAssemblyTableConstructor.cpp: 117 (JSC::WebAssemblyTableConstructor::finishCreation): 118 1 119 2020-09-21 Yusuke Suzuki <ysuzuki@apple.com> 2 120 -
trunk/Source/JavaScriptCore/runtime/AggregateErrorConstructor.cpp
r261895 r267364 50 50 void AggregateErrorConstructor::finishCreation(VM& vm, AggregateErrorPrototype* prototype) 51 51 { 52 Base::finishCreation(vm, errorTypeName(ErrorType::AggregateError), NameAdditionMode::WithoutStructureTransition);52 Base::finishCreation(vm, 2, errorTypeName(ErrorType::AggregateError), PropertyAdditionMode::WithoutStructureTransition); 53 53 ASSERT(inherits(vm, info())); 54 54 55 putDirectWithoutTransition(vm, vm.propertyNames->length, jsNumber(2), PropertyAttribute::DontEnum | PropertyAttribute::ReadOnly);56 55 putDirectWithoutTransition(vm, vm.propertyNames->prototype, prototype, PropertyAttribute::DontDelete | PropertyAttribute::ReadOnly | PropertyAttribute::DontEnum); 57 56 } -
trunk/Source/JavaScriptCore/runtime/ArrayConstructor.cpp
r261895 r267364 54 54 void ArrayConstructor::finishCreation(VM& vm, JSGlobalObject* globalObject, ArrayPrototype* arrayPrototype, GetterSetter* speciesSymbol) 55 55 { 56 Base::finishCreation(vm, vm.propertyNames->Array.string(), NameAdditionMode::WithoutStructureTransition);56 Base::finishCreation(vm, 1, vm.propertyNames->Array.string(), PropertyAdditionMode::WithoutStructureTransition); 57 57 putDirectWithoutTransition(vm, vm.propertyNames->prototype, arrayPrototype, PropertyAttribute::DontEnum | PropertyAttribute::DontDelete | PropertyAttribute::ReadOnly); 58 putDirectWithoutTransition(vm, vm.propertyNames->length, jsNumber(1), PropertyAttribute::ReadOnly | PropertyAttribute::DontEnum);59 58 putDirectNonIndexAccessorWithoutTransition(vm, vm.propertyNames->speciesSymbol, speciesSymbol, PropertyAttribute::Accessor | PropertyAttribute::ReadOnly | PropertyAttribute::DontEnum); 60 59 JSC_BUILTIN_FUNCTION_WITHOUT_TRANSITION(vm.propertyNames->isArray, arrayConstructorIsArrayCodeGenerator, static_cast<unsigned>(PropertyAttribute::DontEnum)); -
trunk/Source/JavaScriptCore/runtime/AsyncFunctionConstructor.cpp
r261895 r267364 56 56 void AsyncFunctionConstructor::finishCreation(VM& vm, AsyncFunctionPrototype* prototype) 57 57 { 58 Base::finishCreation(vm, "AsyncFunction"_s, NameAdditionMode::WithoutStructureTransition);58 Base::finishCreation(vm, 1, "AsyncFunction"_s, PropertyAdditionMode::WithoutStructureTransition); 59 59 putDirectWithoutTransition(vm, vm.propertyNames->prototype, prototype, PropertyAttribute::DontEnum | PropertyAttribute::DontDelete | PropertyAttribute::ReadOnly); 60 putDirectWithoutTransition(vm, vm.propertyNames->length, jsNumber(1), PropertyAttribute::ReadOnly | PropertyAttribute::DontEnum);61 60 } 62 61 -
trunk/Source/JavaScriptCore/runtime/AsyncGeneratorFunctionConstructor.cpp
r261895 r267364 56 56 void AsyncGeneratorFunctionConstructor::finishCreation(VM& vm, AsyncGeneratorFunctionPrototype* prototype) 57 57 { 58 Base::finishCreation(vm, "AsyncGeneratorFunction"_s, NameAdditionMode::WithoutStructureTransition);58 Base::finishCreation(vm, 1, "AsyncGeneratorFunction"_s, PropertyAdditionMode::WithoutStructureTransition); 59 59 putDirectWithoutTransition(vm, vm.propertyNames->prototype, prototype, PropertyAttribute::DontEnum | PropertyAttribute::DontDelete | PropertyAttribute::ReadOnly); 60 61 // Number of arguments for constructor62 putDirectWithoutTransition(vm, vm.propertyNames->length, jsNumber(1), PropertyAttribute::ReadOnly | PropertyAttribute::DontEnum);63 60 } 64 61 -
trunk/Source/JavaScriptCore/runtime/BigIntConstructor.cpp
r262342 r267364 64 64 void BigIntConstructor::finishCreation(VM& vm, BigIntPrototype* bigIntPrototype) 65 65 { 66 Base::finishCreation(vm, "BigInt"_s, NameAdditionMode::WithoutStructureTransition);66 Base::finishCreation(vm, 1, "BigInt"_s, PropertyAdditionMode::WithoutStructureTransition); 67 67 ASSERT(inherits(vm, info())); 68 68 69 69 putDirectWithoutTransition(vm, vm.propertyNames->prototype, bigIntPrototype, PropertyAttribute::DontEnum | PropertyAttribute::DontDelete | PropertyAttribute::ReadOnly); 70 putDirectWithoutTransition(vm, vm.propertyNames->length, jsNumber(1), PropertyAttribute::ReadOnly | PropertyAttribute::DontEnum);71 70 } 72 71 -
trunk/Source/JavaScriptCore/runtime/BooleanConstructor.cpp
r261895 r267364 62 62 void BooleanConstructor::finishCreation(VM& vm, BooleanPrototype* booleanPrototype) 63 63 { 64 Base::finishCreation(vm, vm.propertyNames->Boolean.string(), NameAdditionMode::WithoutStructureTransition);64 Base::finishCreation(vm, 1, vm.propertyNames->Boolean.string(), PropertyAdditionMode::WithoutStructureTransition); 65 65 putDirectWithoutTransition(vm, vm.propertyNames->prototype, booleanPrototype, PropertyAttribute::DontEnum | PropertyAttribute::DontDelete | PropertyAttribute::ReadOnly); 66 putDirectWithoutTransition(vm, vm.propertyNames->length, jsNumber(1), PropertyAttribute::ReadOnly | PropertyAttribute::DontEnum);67 66 } 68 67 -
trunk/Source/JavaScriptCore/runtime/DateConstructor.cpp
r262535 r267364 63 63 void DateConstructor::finishCreation(VM& vm, DatePrototype* datePrototype) 64 64 { 65 Base::finishCreation(vm, vm.propertyNames->Date.string(), NameAdditionMode::WithoutStructureTransition);65 Base::finishCreation(vm, 7, vm.propertyNames->Date.string(), PropertyAdditionMode::WithoutStructureTransition); 66 66 putDirectWithoutTransition(vm, vm.propertyNames->prototype, datePrototype, PropertyAttribute::DontEnum | PropertyAttribute::DontDelete | PropertyAttribute::ReadOnly); 67 putDirectWithoutTransition(vm, vm.propertyNames->length, jsNumber(7), PropertyAttribute::ReadOnly | PropertyAttribute::DontEnum);68 67 } 69 68 -
trunk/Source/JavaScriptCore/runtime/ErrorConstructor.cpp
r261895 r267364 41 41 void ErrorConstructor::finishCreation(VM& vm, ErrorPrototype* errorPrototype) 42 42 { 43 Base::finishCreation(vm, vm.propertyNames->Error.string(), NameAdditionMode::WithoutStructureTransition);43 Base::finishCreation(vm, 1, vm.propertyNames->Error.string(), PropertyAdditionMode::WithoutStructureTransition); 44 44 // ECMA 15.11.3.1 Error.prototype 45 45 putDirectWithoutTransition(vm, vm.propertyNames->prototype, errorPrototype, PropertyAttribute::DontEnum | PropertyAttribute::DontDelete | PropertyAttribute::ReadOnly); 46 putDirectWithoutTransition(vm, vm.propertyNames->length, jsNumber(1), PropertyAttribute::DontEnum | PropertyAttribute::ReadOnly);47 46 putDirectWithoutTransition(vm, vm.propertyNames->stackTraceLimit, jsNumber(globalObject()->stackTraceLimit().valueOr(Options::defaultErrorStackTraceLimit())), static_cast<unsigned>(PropertyAttribute::None)); 48 47 } -
trunk/Source/JavaScriptCore/runtime/FinalizationRegistryConstructor.cpp
r264617 r267364 42 42 void FinalizationRegistryConstructor::finishCreation(VM& vm, FinalizationRegistryPrototype* prototype) 43 43 { 44 Base::finishCreation(vm, "FinalizationRegistry"_s, NameAdditionMode::WithoutStructureTransition);44 Base::finishCreation(vm, 1, "FinalizationRegistry"_s, PropertyAdditionMode::WithoutStructureTransition); 45 45 putDirectWithoutTransition(vm, vm.propertyNames->prototype, prototype, PropertyAttribute::DontEnum | PropertyAttribute::DontDelete | PropertyAttribute::ReadOnly); 46 putDirectWithoutTransition(vm, vm.propertyNames->length, jsNumber(1), PropertyAttribute::DontEnum | PropertyAttribute::ReadOnly);47 46 } 48 47 -
trunk/Source/JavaScriptCore/runtime/FunctionConstructor.cpp
r264304 r267364 58 58 void FunctionConstructor::finishCreation(VM& vm, FunctionPrototype* functionPrototype) 59 59 { 60 Base::finishCreation(vm, vm.propertyNames->Function.string(), NameAdditionMode::WithoutStructureTransition);60 Base::finishCreation(vm, 1, vm.propertyNames->Function.string(), PropertyAdditionMode::WithoutStructureTransition); 61 61 putDirectWithoutTransition(vm, vm.propertyNames->prototype, functionPrototype, PropertyAttribute::DontEnum | PropertyAttribute::DontDelete | PropertyAttribute::ReadOnly); 62 putDirectWithoutTransition(vm, vm.propertyNames->length, jsNumber(1), PropertyAttribute::ReadOnly | PropertyAttribute::DontEnum);63 62 } 64 63 -
trunk/Source/JavaScriptCore/runtime/FunctionPrototype.cpp
r266018 r267364 48 48 void FunctionPrototype::finishCreation(VM& vm, const String& name) 49 49 { 50 Base::finishCreation(vm, name, NameAdditionMode::WithoutStructureTransition);50 Base::finishCreation(vm, 0, name, PropertyAdditionMode::WithoutStructureTransition); 51 51 ASSERT(inherits(vm, info())); 52 putDirectWithoutTransition(vm, vm.propertyNames->length, jsNumber(0), PropertyAttribute::ReadOnly | PropertyAttribute::DontEnum);53 52 } 54 53 -
trunk/Source/JavaScriptCore/runtime/GeneratorFunctionConstructor.cpp
r261895 r267364 56 56 void GeneratorFunctionConstructor::finishCreation(VM& vm, GeneratorFunctionPrototype* generatorFunctionPrototype) 57 57 { 58 Base::finishCreation(vm, "GeneratorFunction"_s, NameAdditionMode::WithoutStructureTransition);58 Base::finishCreation(vm, 1, "GeneratorFunction"_s, PropertyAdditionMode::WithoutStructureTransition); 59 59 putDirectWithoutTransition(vm, vm.propertyNames->prototype, generatorFunctionPrototype, PropertyAttribute::DontEnum | PropertyAttribute::DontDelete | PropertyAttribute::ReadOnly); 60 putDirectWithoutTransition(vm, vm.propertyNames->length, jsNumber(1), PropertyAttribute::ReadOnly | PropertyAttribute::DontEnum);61 60 } 62 61 -
trunk/Source/JavaScriptCore/runtime/InternalFunction.cpp
r266210 r267364 44 44 } 45 45 46 void InternalFunction::finishCreation(VM& vm, const String& name, NameAdditionMode nameAdditionMode)46 void InternalFunction::finishCreation(VM& vm, unsigned length, const String& name, PropertyAdditionMode nameAdditionMode) 47 47 { 48 48 Base::finishCreation(vm); … … 52 52 ASSERT(methodTable(vm)->getConstructData == InternalFunction::info()->methodTable.getConstructData); 53 53 ASSERT(type() == InternalFunctionType || type() == NullSetterFunctionType); 54 54 55 JSString* nameString = jsString(vm, name); 55 56 m_originalName.set(vm, this, nameString); 56 if (nameAdditionMode == NameAdditionMode::WithStructureTransition) 57 // The enumeration order is length followed by name. So, we make sure to add the properties in that order. 58 if (nameAdditionMode == PropertyAdditionMode::WithStructureTransition) { 59 putDirect(vm, vm.propertyNames->length, jsNumber(length), PropertyAttribute::ReadOnly | PropertyAttribute::DontEnum); 57 60 putDirect(vm, vm.propertyNames->name, nameString, PropertyAttribute::ReadOnly | PropertyAttribute::DontEnum); 58 else 61 } else { 62 putDirectWithoutTransition(vm, vm.propertyNames->length, jsNumber(length), PropertyAttribute::ReadOnly | PropertyAttribute::DontEnum); 59 63 putDirectWithoutTransition(vm, vm.propertyNames->name, nameString, PropertyAttribute::ReadOnly | PropertyAttribute::DontEnum); 64 } 60 65 } 61 66 … … 160 165 globalObject->masqueradesAsUndefinedWatchpoint()->fireAll(globalObject->vm(), "Allocated masquerading object"); 161 166 InternalFunction* function = new (NotNull, allocateCell<InternalFunction>(vm.heap)) InternalFunction(vm, structure, nativeFunction); 162 function->finishCreation(vm, name, NameAdditionMode::WithoutStructureTransition); 163 function->putDirectWithoutTransition(vm, vm.propertyNames->length, jsNumber(length), PropertyAttribute::ReadOnly | PropertyAttribute::DontEnum); 167 function->finishCreation(vm, length, name, PropertyAdditionMode::WithoutStructureTransition); 164 168 return function; 165 169 } -
trunk/Source/JavaScriptCore/runtime/InternalFunction.h
r266210 r267364 87 87 JS_EXPORT_PRIVATE InternalFunction(VM&, Structure*, NativeFunction functionForCall, NativeFunction functionForConstruct = nullptr); 88 88 89 enum class NameAdditionMode { WithStructureTransition, WithoutStructureTransition };90 JS_EXPORT_PRIVATE void finishCreation(VM&, const String& name, NameAdditionMode = NameAdditionMode::WithStructureTransition);89 enum class PropertyAdditionMode { WithStructureTransition, WithoutStructureTransition }; 90 JS_EXPORT_PRIVATE void finishCreation(VM&, unsigned length, const String& name, PropertyAdditionMode = PropertyAdditionMode::WithStructureTransition); 91 91 92 92 JS_EXPORT_PRIVATE static CallData getConstructData(JSCell*); -
trunk/Source/JavaScriptCore/runtime/IntlCollatorConstructor.cpp
r261895 r267364 76 76 void IntlCollatorConstructor::finishCreation(VM& vm, IntlCollatorPrototype* collatorPrototype) 77 77 { 78 Base::finishCreation(vm, "Collator"_s, NameAdditionMode::WithoutStructureTransition);78 Base::finishCreation(vm, 0, "Collator"_s, PropertyAdditionMode::WithoutStructureTransition); 79 79 putDirectWithoutTransition(vm, vm.propertyNames->prototype, collatorPrototype, PropertyAttribute::DontEnum | PropertyAttribute::DontDelete | PropertyAttribute::ReadOnly); 80 putDirectWithoutTransition(vm, vm.propertyNames->length, jsNumber(0), PropertyAttribute::ReadOnly | PropertyAttribute::DontEnum);81 80 collatorPrototype->putDirectWithoutTransition(vm, vm.propertyNames->constructor, this, static_cast<unsigned>(PropertyAttribute::DontEnum)); 82 81 } -
trunk/Source/JavaScriptCore/runtime/IntlDateTimeFormatConstructor.cpp
r266655 r267364 75 75 void IntlDateTimeFormatConstructor::finishCreation(VM& vm, IntlDateTimeFormatPrototype* dateTimeFormatPrototype) 76 76 { 77 Base::finishCreation(vm, "DateTimeFormat"_s, NameAdditionMode::WithoutStructureTransition);77 Base::finishCreation(vm, 0, "DateTimeFormat"_s, PropertyAdditionMode::WithoutStructureTransition); 78 78 putDirectWithoutTransition(vm, vm.propertyNames->prototype, dateTimeFormatPrototype, PropertyAttribute::DontEnum | PropertyAttribute::DontDelete | PropertyAttribute::ReadOnly); 79 putDirectWithoutTransition(vm, vm.propertyNames->length, jsNumber(0), PropertyAttribute::ReadOnly | PropertyAttribute::DontEnum);80 79 } 81 80 -
trunk/Source/JavaScriptCore/runtime/IntlDisplayNamesConstructor.cpp
r264639 r267364 73 73 void IntlDisplayNamesConstructor::finishCreation(VM& vm, IntlDisplayNamesPrototype* displayNamesPrototype) 74 74 { 75 Base::finishCreation(vm, "DisplayNames"_s, NameAdditionMode::WithoutStructureTransition);75 Base::finishCreation(vm, 2, "DisplayNames"_s, PropertyAdditionMode::WithoutStructureTransition); 76 76 putDirectWithoutTransition(vm, vm.propertyNames->prototype, displayNamesPrototype, PropertyAttribute::DontEnum | PropertyAttribute::DontDelete | PropertyAttribute::ReadOnly); 77 putDirectWithoutTransition(vm, vm.propertyNames->length, jsNumber(2), PropertyAttribute::ReadOnly | PropertyAttribute::DontEnum);78 77 displayNamesPrototype->putDirectWithoutTransition(vm, vm.propertyNames->constructor, this, static_cast<unsigned>(PropertyAttribute::DontEnum)); 79 78 } -
trunk/Source/JavaScriptCore/runtime/IntlLocaleConstructor.cpp
r261895 r267364 59 59 void IntlLocaleConstructor::finishCreation(VM& vm, IntlLocalePrototype* localePrototype) 60 60 { 61 Base::finishCreation(vm, "Locale"_s, NameAdditionMode::WithoutStructureTransition);61 Base::finishCreation(vm, 1, "Locale"_s, PropertyAdditionMode::WithoutStructureTransition); 62 62 putDirectWithoutTransition(vm, vm.propertyNames->prototype, localePrototype, PropertyAttribute::DontEnum | PropertyAttribute::DontDelete | PropertyAttribute::ReadOnly); 63 putDirectWithoutTransition(vm, vm.propertyNames->length, jsNumber(1), PropertyAttribute::ReadOnly | PropertyAttribute::DontEnum);64 63 localePrototype->putDirectWithoutTransition(vm, vm.propertyNames->constructor, this, static_cast<unsigned>(PropertyAttribute::DontEnum)); 65 64 } -
trunk/Source/JavaScriptCore/runtime/IntlNumberFormatConstructor.cpp
r266655 r267364 75 75 void IntlNumberFormatConstructor::finishCreation(VM& vm, IntlNumberFormatPrototype* numberFormatPrototype) 76 76 { 77 Base::finishCreation(vm, "NumberFormat"_s, NameAdditionMode::WithoutStructureTransition);77 Base::finishCreation(vm, 0, "NumberFormat"_s, PropertyAdditionMode::WithoutStructureTransition); 78 78 putDirectWithoutTransition(vm, vm.propertyNames->prototype, numberFormatPrototype, PropertyAttribute::DontEnum | PropertyAttribute::DontDelete | PropertyAttribute::ReadOnly); 79 putDirectWithoutTransition(vm, vm.propertyNames->length, jsNumber(0), PropertyAttribute::ReadOnly | PropertyAttribute::DontEnum);80 79 } 81 80 -
trunk/Source/JavaScriptCore/runtime/IntlPluralRulesConstructor.cpp
r261895 r267364 75 75 void IntlPluralRulesConstructor::finishCreation(VM& vm, IntlPluralRulesPrototype* pluralRulesPrototype) 76 76 { 77 Base::finishCreation(vm, "PluralRules"_s, NameAdditionMode::WithoutStructureTransition);77 Base::finishCreation(vm, 0, "PluralRules"_s, PropertyAdditionMode::WithoutStructureTransition); 78 78 putDirectWithoutTransition(vm, vm.propertyNames->prototype, pluralRulesPrototype, PropertyAttribute::DontEnum | PropertyAttribute::DontDelete | PropertyAttribute::ReadOnly); 79 putDirectWithoutTransition(vm, vm.propertyNames->length, jsNumber(0), PropertyAttribute::ReadOnly | PropertyAttribute::DontEnum);80 79 pluralRulesPrototype->putDirectWithoutTransition(vm, vm.propertyNames->constructor, this, static_cast<unsigned>(PropertyAttribute::DontEnum)); 81 80 } -
trunk/Source/JavaScriptCore/runtime/IntlRelativeTimeFormatConstructor.cpp
r261895 r267364 74 74 void IntlRelativeTimeFormatConstructor::finishCreation(VM& vm, IntlRelativeTimeFormatPrototype* relativeTimeFormatPrototype) 75 75 { 76 Base::finishCreation(vm, "RelativeTimeFormat"_s, NameAdditionMode::WithoutStructureTransition);76 Base::finishCreation(vm, 0, "RelativeTimeFormat"_s, PropertyAdditionMode::WithoutStructureTransition); 77 77 putDirectWithoutTransition(vm, vm.propertyNames->prototype, relativeTimeFormatPrototype, PropertyAttribute::DontEnum | PropertyAttribute::DontDelete | PropertyAttribute::ReadOnly); 78 putDirectWithoutTransition(vm, vm.propertyNames->length, jsNumber(0), PropertyAttribute::ReadOnly | PropertyAttribute::DontEnum);79 78 relativeTimeFormatPrototype->putDirectWithoutTransition(vm, vm.propertyNames->constructor, this, static_cast<unsigned>(PropertyAttribute::DontEnum)); 80 79 } -
trunk/Source/JavaScriptCore/runtime/IntlSegmenterConstructor.cpp
r266032 r267364 73 73 void IntlSegmenterConstructor::finishCreation(VM& vm, IntlSegmenterPrototype* segmenterPrototype) 74 74 { 75 Base::finishCreation(vm, "Segmenter"_s, NameAdditionMode::WithoutStructureTransition);75 Base::finishCreation(vm, 0, "Segmenter"_s, PropertyAdditionMode::WithoutStructureTransition); 76 76 putDirectWithoutTransition(vm, vm.propertyNames->prototype, segmenterPrototype, PropertyAttribute::DontEnum | PropertyAttribute::DontDelete | PropertyAttribute::ReadOnly); 77 putDirectWithoutTransition(vm, vm.propertyNames->length, jsNumber(0), PropertyAttribute::ReadOnly | PropertyAttribute::DontEnum);78 77 segmenterPrototype->putDirectWithoutTransition(vm, vm.propertyNames->constructor, this, static_cast<unsigned>(PropertyAttribute::DontEnum)); 79 78 } -
trunk/Source/JavaScriptCore/runtime/JSArrayBufferConstructor.cpp
r261895 r267364 58 58 void JSGenericArrayBufferConstructor<sharingMode>::finishCreation(VM& vm, JSArrayBufferPrototype* prototype, GetterSetter* speciesSymbol) 59 59 { 60 Base::finishCreation(vm, arrayBufferSharingModeName(sharingMode), NameAdditionMode::WithoutStructureTransition);60 Base::finishCreation(vm, 1, arrayBufferSharingModeName(sharingMode), PropertyAdditionMode::WithoutStructureTransition); 61 61 putDirectWithoutTransition(vm, vm.propertyNames->prototype, prototype, PropertyAttribute::DontEnum | PropertyAttribute::DontDelete | PropertyAttribute::ReadOnly); 62 putDirectWithoutTransition(vm, vm.propertyNames->length, jsNumber(1), PropertyAttribute::DontEnum | PropertyAttribute::ReadOnly);63 62 putDirectNonIndexAccessorWithoutTransition(vm, vm.propertyNames->speciesSymbol, speciesSymbol, PropertyAttribute::Accessor | PropertyAttribute::ReadOnly | PropertyAttribute::DontEnum); 64 63 -
trunk/Source/JavaScriptCore/runtime/JSGenericTypedArrayViewConstructorInlines.h
r266529 r267364 53 53 void JSGenericTypedArrayViewConstructor<ViewClass>::finishCreation(VM& vm, JSGlobalObject* globalObject, JSObject* prototype, const String& name, FunctionExecutable* privateAllocator) 54 54 { 55 Base::finishCreation(vm, name, NameAdditionMode::WithoutStructureTransition);55 Base::finishCreation(vm, ViewClass::TypedArrayStorageType == TypeDataView ? 1 : 3, name, PropertyAdditionMode::WithoutStructureTransition); 56 56 putDirectWithoutTransition(vm, vm.propertyNames->prototype, prototype, PropertyAttribute::DontEnum | PropertyAttribute::DontDelete | PropertyAttribute::ReadOnly); 57 putDirectWithoutTransition(vm, vm.propertyNames->length, jsNumber(ViewClass::TypedArrayStorageType == TypeDataView ? 1 : 3), PropertyAttribute::DontEnum | PropertyAttribute::ReadOnly);58 57 putDirectWithoutTransition(vm, vm.propertyNames->BYTES_PER_ELEMENT, jsNumber(ViewClass::elementSize), PropertyAttribute::DontEnum | PropertyAttribute::ReadOnly | PropertyAttribute::DontDelete); 59 58 -
trunk/Source/JavaScriptCore/runtime/JSTypedArrayViewConstructor.cpp
r261895 r267364 44 44 void JSTypedArrayViewConstructor::finishCreation(VM& vm, JSGlobalObject* globalObject, JSTypedArrayViewPrototype* prototype, GetterSetter* speciesSymbol) 45 45 { 46 Base::finishCreation(vm, "TypedArray"_s, NameAdditionMode::WithoutStructureTransition);46 Base::finishCreation(vm, 0, "TypedArray"_s, PropertyAdditionMode::WithoutStructureTransition); 47 47 putDirectWithoutTransition(vm, vm.propertyNames->prototype, prototype, PropertyAttribute::DontEnum | PropertyAttribute::DontDelete | PropertyAttribute::ReadOnly); 48 putDirectWithoutTransition(vm, vm.propertyNames->length, jsNumber(0), PropertyAttribute::DontEnum | PropertyAttribute::ReadOnly);49 48 putDirectNonIndexAccessorWithoutTransition(vm, vm.propertyNames->speciesSymbol, speciesSymbol, PropertyAttribute::Accessor | PropertyAttribute::ReadOnly | PropertyAttribute::DontEnum); 50 49 -
trunk/Source/JavaScriptCore/runtime/MapConstructor.cpp
r261895 r267364 38 38 void MapConstructor::finishCreation(VM& vm, MapPrototype* mapPrototype, GetterSetter* speciesSymbol) 39 39 { 40 Base::finishCreation(vm, "Map"_s, NameAdditionMode::WithoutStructureTransition);40 Base::finishCreation(vm, 0, "Map"_s, PropertyAdditionMode::WithoutStructureTransition); 41 41 putDirectWithoutTransition(vm, vm.propertyNames->prototype, mapPrototype, PropertyAttribute::DontEnum | PropertyAttribute::DontDelete | PropertyAttribute::ReadOnly); 42 putDirectWithoutTransition(vm, vm.propertyNames->length, jsNumber(0), PropertyAttribute::DontEnum | PropertyAttribute::ReadOnly);43 42 putDirectNonIndexAccessorWithoutTransition(vm, vm.propertyNames->speciesSymbol, speciesSymbol, PropertyAttribute::Accessor | PropertyAttribute::ReadOnly | PropertyAttribute::DontEnum); 44 43 } -
trunk/Source/JavaScriptCore/runtime/NativeErrorConstructor.cpp
r261895 r267364 40 40 void NativeErrorConstructorBase::finishCreation(VM& vm, NativeErrorPrototype* prototype, ErrorType errorType) 41 41 { 42 Base::finishCreation(vm, errorTypeName(errorType), NameAdditionMode::WithoutStructureTransition);42 Base::finishCreation(vm, 1, errorTypeName(errorType), PropertyAdditionMode::WithoutStructureTransition); 43 43 ASSERT(inherits(vm, info())); 44 44 45 putDirectWithoutTransition(vm, vm.propertyNames->length, jsNumber(1), PropertyAttribute::DontEnum | PropertyAttribute::ReadOnly);46 45 putDirectWithoutTransition(vm, vm.propertyNames->prototype, prototype, PropertyAttribute::DontDelete | PropertyAttribute::ReadOnly | PropertyAttribute::DontEnum); 47 46 } -
trunk/Source/JavaScriptCore/runtime/NullGetterFunction.h
r253019 r267364 38 38 // Since NullGetterFunction is per JSGlobalObject, we use put-without-transition in InternalFunction::finishCreation. 39 39 NullGetterFunction* function = new (NotNull, allocateCell< NullGetterFunction>(vm.heap)) NullGetterFunction(vm, structure); 40 function->finishCreation(vm, String(), NameAdditionMode::WithoutStructureTransition);40 function->finishCreation(vm, 0, String(), PropertyAdditionMode::WithoutStructureTransition); 41 41 return function; 42 42 } -
trunk/Source/JavaScriptCore/runtime/NullSetterFunction.h
r263134 r267364 36 36 static NullSetterFunction* create(VM& vm, Structure* structure, ECMAMode ecmaMode) 37 37 { 38 NullSetterFunction* function = new (NotNull, allocateCell< NullSetterFunction>(vm.heap)) NullSetterFunction(vm, structure, ecmaMode);39 function->finishCreation(vm, String());38 NullSetterFunction* function = new (NotNull, allocateCell<NullSetterFunction>(vm.heap)) NullSetterFunction(vm, structure, ecmaMode); 39 function->finishCreation(vm, 0, String()); 40 40 return function; 41 41 } -
trunk/Source/JavaScriptCore/runtime/NumberConstructor.cpp
r261895 r267364 60 60 void NumberConstructor::finishCreation(VM& vm, NumberPrototype* numberPrototype) 61 61 { 62 Base::finishCreation(vm, vm.propertyNames->Number.string(), NameAdditionMode::WithoutStructureTransition);62 Base::finishCreation(vm, 1, vm.propertyNames->Number.string(), PropertyAdditionMode::WithoutStructureTransition); 63 63 ASSERT(inherits(vm, info())); 64 64 … … 66 66 67 67 putDirectWithoutTransition(vm, vm.propertyNames->prototype, numberPrototype, PropertyAttribute::DontEnum | PropertyAttribute::DontDelete | PropertyAttribute::ReadOnly); 68 putDirectWithoutTransition(vm, vm.propertyNames->length, jsNumber(1), PropertyAttribute::ReadOnly | PropertyAttribute::DontEnum);69 68 70 69 putDirectWithoutTransition(vm, Identifier::fromString(vm, "EPSILON"), jsDoubleNumber(std::numeric_limits<double>::epsilon()), PropertyAttribute::DontDelete | PropertyAttribute::DontEnum | PropertyAttribute::ReadOnly); -
trunk/Source/JavaScriptCore/runtime/ObjectConstructor.cpp
r267040 r267364 94 94 void ObjectConstructor::finishCreation(VM& vm, JSGlobalObject* globalObject, ObjectPrototype* objectPrototype) 95 95 { 96 Base::finishCreation(vm, vm.propertyNames->Object.string(), NameAdditionMode::WithoutStructureTransition);96 Base::finishCreation(vm, 1, vm.propertyNames->Object.string(), PropertyAdditionMode::WithoutStructureTransition); 97 97 98 98 putDirectWithoutTransition(vm, vm.propertyNames->prototype, objectPrototype, PropertyAttribute::DontEnum | PropertyAttribute::DontDelete | PropertyAttribute::ReadOnly); 99 putDirectWithoutTransition(vm, vm.propertyNames->length, jsNumber(1), PropertyAttribute::ReadOnly | PropertyAttribute::DontEnum);100 99 101 100 JSC_NATIVE_FUNCTION_WITHOUT_TRANSITION(vm.propertyNames->builtinNames().createPrivateName(), objectConstructorCreate, static_cast<unsigned>(PropertyAttribute::DontEnum), 2); -
trunk/Source/JavaScriptCore/runtime/ProxyConstructor.cpp
r261895 r267364 76 76 void ProxyConstructor::finishCreation(VM& vm, const char* name, JSGlobalObject* globalObject) 77 77 { 78 Base::finishCreation(vm, name, NameAdditionMode::WithStructureTransition); 79 putDirect(vm, vm.propertyNames->length, jsNumber(2), PropertyAttribute::DontEnum | PropertyAttribute::ReadOnly); 78 Base::finishCreation(vm, 2, name, PropertyAdditionMode::WithStructureTransition); 80 79 putDirect(vm, makeIdentifier(vm, "revocable"), JSFunction::create(vm, globalObject, 2, "revocable"_s, makeRevocableProxy)); 81 80 } -
trunk/Source/JavaScriptCore/runtime/ProxyRevoke.cpp
r261895 r267364 52 52 void ProxyRevoke::finishCreation(VM& vm, ProxyObject* proxy) 53 53 { 54 Base::finishCreation(vm, emptyString());54 Base::finishCreation(vm, 0, emptyString()); 55 55 m_proxy.set(vm, this, proxy); 56 57 putDirect(vm, vm.propertyNames->length, jsNumber(0), PropertyAttribute::ReadOnly | PropertyAttribute::DontEnum);58 56 } 59 57 -
trunk/Source/JavaScriptCore/runtime/RegExpConstructor.cpp
r261895 r267364 87 87 void RegExpConstructor::finishCreation(VM& vm, RegExpPrototype* regExpPrototype, GetterSetter* speciesSymbol) 88 88 { 89 Base::finishCreation(vm, vm.propertyNames->RegExp.string(), NameAdditionMode::WithoutStructureTransition);89 Base::finishCreation(vm, 2, vm.propertyNames->RegExp.string(), PropertyAdditionMode::WithoutStructureTransition); 90 90 ASSERT(inherits(vm, info())); 91 91 92 92 putDirectWithoutTransition(vm, vm.propertyNames->prototype, regExpPrototype, PropertyAttribute::DontEnum | PropertyAttribute::DontDelete | PropertyAttribute::ReadOnly); 93 putDirectWithoutTransition(vm, vm.propertyNames->length, jsNumber(2), PropertyAttribute::ReadOnly | PropertyAttribute::DontEnum);94 93 95 94 putDirectNonIndexAccessorWithoutTransition(vm, vm.propertyNames->speciesSymbol, speciesSymbol, PropertyAttribute::Accessor | PropertyAttribute::ReadOnly | PropertyAttribute::DontEnum); -
trunk/Source/JavaScriptCore/runtime/SetConstructor.cpp
r261755 r267364 38 38 void SetConstructor::finishCreation(VM& vm, SetPrototype* setPrototype, GetterSetter* speciesSymbol) 39 39 { 40 Base::finishCreation(vm, vm.propertyNames->Set.string(), NameAdditionMode::WithoutStructureTransition);40 Base::finishCreation(vm, 0, vm.propertyNames->Set.string(), PropertyAdditionMode::WithoutStructureTransition); 41 41 putDirectWithoutTransition(vm, vm.propertyNames->prototype, setPrototype, PropertyAttribute::DontEnum | PropertyAttribute::DontDelete | PropertyAttribute::ReadOnly); 42 putDirectWithoutTransition(vm, vm.propertyNames->length, jsNumber(0), PropertyAttribute::DontEnum | PropertyAttribute::ReadOnly);43 42 putDirectNonIndexAccessorWithoutTransition(vm, vm.propertyNames->speciesSymbol, speciesSymbol, PropertyAttribute::Accessor | PropertyAttribute::ReadOnly | PropertyAttribute::DontEnum); 44 43 } -
trunk/Source/JavaScriptCore/runtime/StringConstructor.cpp
r261895 r267364 60 60 void StringConstructor::finishCreation(VM& vm, StringPrototype* stringPrototype) 61 61 { 62 Base::finishCreation(vm, vm.propertyNames->String.string(), NameAdditionMode::WithoutStructureTransition);62 Base::finishCreation(vm, 1, vm.propertyNames->String.string(), PropertyAdditionMode::WithoutStructureTransition); 63 63 putDirectWithoutTransition(vm, vm.propertyNames->prototype, stringPrototype, PropertyAttribute::ReadOnly | PropertyAttribute::DontEnum | PropertyAttribute::DontDelete); 64 putDirectWithoutTransition(vm, vm.propertyNames->length, jsNumber(1), PropertyAttribute::ReadOnly | PropertyAttribute::DontEnum);65 64 } 66 65 -
trunk/Source/JavaScriptCore/runtime/SymbolConstructor.cpp
r261895 r267364 67 67 void SymbolConstructor::finishCreation(VM& vm, SymbolPrototype* prototype) 68 68 { 69 Base::finishCreation(vm, vm.propertyNames->Symbol.string(), NameAdditionMode::WithoutStructureTransition);69 Base::finishCreation(vm, 0, vm.propertyNames->Symbol.string(), PropertyAdditionMode::WithoutStructureTransition); 70 70 putDirectWithoutTransition(vm, vm.propertyNames->prototype, prototype, PropertyAttribute::DontEnum | PropertyAttribute::DontDelete | PropertyAttribute::ReadOnly); 71 putDirectWithoutTransition(vm, vm.propertyNames->length, jsNumber(0), PropertyAttribute::ReadOnly | PropertyAttribute::DontEnum);72 71 73 72 JSC_COMMON_PRIVATE_IDENTIFIERS_EACH_WELL_KNOWN_SYMBOL(INITIALIZE_WELL_KNOWN_SYMBOLS) -
trunk/Source/JavaScriptCore/runtime/WeakMapConstructor.cpp
r261895 r267364 38 38 void WeakMapConstructor::finishCreation(VM& vm, WeakMapPrototype* prototype) 39 39 { 40 Base::finishCreation(vm, "WeakMap"_s, NameAdditionMode::WithoutStructureTransition);40 Base::finishCreation(vm, 0, "WeakMap"_s, PropertyAdditionMode::WithoutStructureTransition); 41 41 putDirectWithoutTransition(vm, vm.propertyNames->prototype, prototype, PropertyAttribute::DontEnum | PropertyAttribute::DontDelete | PropertyAttribute::ReadOnly); 42 putDirectWithoutTransition(vm, vm.propertyNames->length, jsNumber(0), PropertyAttribute::DontEnum | PropertyAttribute::ReadOnly);43 42 } 44 43 -
trunk/Source/JavaScriptCore/runtime/WeakObjectRefConstructor.cpp
r261895 r267364 37 37 void WeakObjectRefConstructor::finishCreation(VM& vm, WeakObjectRefPrototype* prototype) 38 38 { 39 Base::finishCreation(vm, "WeakRef"_s, NameAdditionMode::WithoutStructureTransition);39 Base::finishCreation(vm, 1, "WeakRef"_s, PropertyAdditionMode::WithoutStructureTransition); 40 40 putDirectWithoutTransition(vm, vm.propertyNames->prototype, prototype, PropertyAttribute::DontEnum | PropertyAttribute::DontDelete | PropertyAttribute::ReadOnly); 41 putDirectWithoutTransition(vm, vm.propertyNames->length, jsNumber(1), PropertyAttribute::DontEnum | PropertyAttribute::ReadOnly);42 41 } 43 42 -
trunk/Source/JavaScriptCore/runtime/WeakSetConstructor.cpp
r261755 r267364 38 38 void WeakSetConstructor::finishCreation(VM& vm, WeakSetPrototype* prototype) 39 39 { 40 Base::finishCreation(vm, "WeakSet"_s, NameAdditionMode::WithoutStructureTransition);40 Base::finishCreation(vm, 0, "WeakSet"_s, PropertyAdditionMode::WithoutStructureTransition); 41 41 putDirectWithoutTransition(vm, vm.propertyNames->prototype, prototype, PropertyAttribute::DontEnum | PropertyAttribute::DontDelete | PropertyAttribute::ReadOnly); 42 putDirectWithoutTransition(vm, vm.propertyNames->length, jsNumber(0), PropertyAttribute::DontEnum | PropertyAttribute::ReadOnly);43 42 } 44 43 -
trunk/Source/JavaScriptCore/wasm/js/WebAssemblyCompileErrorConstructor.cpp
r262492 r267364 80 80 void WebAssemblyCompileErrorConstructor::finishCreation(VM& vm, WebAssemblyCompileErrorPrototype* prototype) 81 81 { 82 Base::finishCreation(vm, "CompileError"_s, NameAdditionMode::WithoutStructureTransition);82 Base::finishCreation(vm, 1, "CompileError"_s, PropertyAdditionMode::WithoutStructureTransition); 83 83 putDirectWithoutTransition(vm, vm.propertyNames->prototype, prototype, PropertyAttribute::ReadOnly | PropertyAttribute::DontEnum | PropertyAttribute::DontDelete); 84 putDirectWithoutTransition(vm, vm.propertyNames->length, jsNumber(1), PropertyAttribute::ReadOnly | PropertyAttribute::DontEnum);85 84 } 86 85 -
trunk/Source/JavaScriptCore/wasm/js/WebAssemblyGlobalConstructor.cpp
r261755 r267364 144 144 void WebAssemblyGlobalConstructor::finishCreation(VM& vm, WebAssemblyGlobalPrototype* prototype) 145 145 { 146 Base::finishCreation(vm, "Global"_s, NameAdditionMode::WithoutStructureTransition);146 Base::finishCreation(vm, 1, "Global"_s, PropertyAdditionMode::WithoutStructureTransition); 147 147 putDirectWithoutTransition(vm, vm.propertyNames->prototype, prototype, PropertyAttribute::DontEnum | PropertyAttribute::DontDelete | PropertyAttribute::ReadOnly); 148 putDirectWithoutTransition(vm, vm.propertyNames->length, jsNumber(1), PropertyAttribute::ReadOnly | PropertyAttribute::DontEnum);149 148 } 150 149 -
trunk/Source/JavaScriptCore/wasm/js/WebAssemblyInstanceConstructor.cpp
r262492 r267364 98 98 void WebAssemblyInstanceConstructor::finishCreation(VM& vm, WebAssemblyInstancePrototype* prototype) 99 99 { 100 Base::finishCreation(vm, "Instance"_s, NameAdditionMode::WithoutStructureTransition);100 Base::finishCreation(vm, 1, "Instance"_s, PropertyAdditionMode::WithoutStructureTransition); 101 101 putDirectWithoutTransition(vm, vm.propertyNames->prototype, prototype, PropertyAttribute::DontEnum | PropertyAttribute::DontDelete | PropertyAttribute::ReadOnly); 102 putDirectWithoutTransition(vm, vm.propertyNames->length, jsNumber(1), PropertyAttribute::ReadOnly | PropertyAttribute::DontEnum);103 102 } 104 103 -
trunk/Source/JavaScriptCore/wasm/js/WebAssemblyLinkErrorConstructor.cpp
r262492 r267364 80 80 void WebAssemblyLinkErrorConstructor::finishCreation(VM& vm, WebAssemblyLinkErrorPrototype* prototype) 81 81 { 82 Base::finishCreation(vm, "LinkError"_s, NameAdditionMode::WithoutStructureTransition);82 Base::finishCreation(vm, 1, "LinkError"_s, PropertyAdditionMode::WithoutStructureTransition); 83 83 putDirectWithoutTransition(vm, vm.propertyNames->prototype, prototype, PropertyAttribute::ReadOnly | PropertyAttribute::DontEnum | PropertyAttribute::DontDelete); 84 putDirectWithoutTransition(vm, vm.propertyNames->length, jsNumber(1), PropertyAttribute::ReadOnly | PropertyAttribute::DontEnum);85 84 } 86 85 -
trunk/Source/JavaScriptCore/wasm/js/WebAssemblyMemoryConstructor.cpp
r262098 r267364 136 136 void WebAssemblyMemoryConstructor::finishCreation(VM& vm, WebAssemblyMemoryPrototype* prototype) 137 137 { 138 Base::finishCreation(vm, "Memory"_s, NameAdditionMode::WithoutStructureTransition);138 Base::finishCreation(vm, 1, "Memory"_s, PropertyAdditionMode::WithoutStructureTransition); 139 139 putDirectWithoutTransition(vm, vm.propertyNames->prototype, prototype, PropertyAttribute::DontEnum | PropertyAttribute::DontDelete | PropertyAttribute::ReadOnly); 140 putDirectWithoutTransition(vm, vm.propertyNames->length, jsNumber(1), PropertyAttribute::ReadOnly | PropertyAttribute::DontEnum);141 140 } 142 141 -
trunk/Source/JavaScriptCore/wasm/js/WebAssemblyModuleConstructor.cpp
r262098 r267364 201 201 void WebAssemblyModuleConstructor::finishCreation(VM& vm, WebAssemblyModulePrototype* prototype) 202 202 { 203 Base::finishCreation(vm, "Module"_s, NameAdditionMode::WithoutStructureTransition);203 Base::finishCreation(vm, 1, "Module"_s, PropertyAdditionMode::WithoutStructureTransition); 204 204 putDirectWithoutTransition(vm, vm.propertyNames->prototype, prototype, PropertyAttribute::DontEnum | PropertyAttribute::DontDelete | PropertyAttribute::ReadOnly); 205 putDirectWithoutTransition(vm, vm.propertyNames->length, jsNumber(1), PropertyAttribute::ReadOnly | PropertyAttribute::DontEnum);206 205 } 207 206 -
trunk/Source/JavaScriptCore/wasm/js/WebAssemblyRuntimeErrorConstructor.cpp
r262492 r267364 82 82 void WebAssemblyRuntimeErrorConstructor::finishCreation(VM& vm, WebAssemblyRuntimeErrorPrototype* prototype) 83 83 { 84 Base::finishCreation(vm, "RuntimeError"_s, NameAdditionMode::WithoutStructureTransition);84 Base::finishCreation(vm, 1, "RuntimeError"_s, PropertyAdditionMode::WithoutStructureTransition); 85 85 putDirectWithoutTransition(vm, vm.propertyNames->prototype, prototype, PropertyAttribute::ReadOnly | PropertyAttribute::DontEnum | PropertyAttribute::DontDelete); 86 putDirectWithoutTransition(vm, vm.propertyNames->length, jsNumber(1), PropertyAttribute::ReadOnly | PropertyAttribute::DontEnum);87 86 } 88 87 -
trunk/Source/JavaScriptCore/wasm/js/WebAssemblyTableConstructor.cpp
r262098 r267364 128 128 void WebAssemblyTableConstructor::finishCreation(VM& vm, WebAssemblyTablePrototype* prototype) 129 129 { 130 Base::finishCreation(vm, "Table"_s, NameAdditionMode::WithoutStructureTransition);130 Base::finishCreation(vm, 1, "Table"_s, PropertyAdditionMode::WithoutStructureTransition); 131 131 putDirectWithoutTransition(vm, vm.propertyNames->prototype, prototype, PropertyAttribute::DontEnum | PropertyAttribute::DontDelete | PropertyAttribute::ReadOnly); 132 putDirectWithoutTransition(vm, vm.propertyNames->length, jsNumber(1), PropertyAttribute::ReadOnly | PropertyAttribute::DontEnum);133 132 } 134 133 -
trunk/Source/WebCore/ChangeLog
r267363 r267364 1 2020-09-21 Keith Miller <keith_miller@apple.com> 2 3 Functions should consistently enumerate length before name 4 https://bugs.webkit.org/show_bug.cgi?id=216789 5 6 Reviewed by Yusuke Suzuki. 7 8 RuntimeMethod inherits from InternalFunction which now sets length by default. 9 RuntimeMethod intercepts length in getOwnPropertySlot so the value we pick 10 doesn't actually matter. Technically, this uses a little extra memory but 11 that's not too big of a deal because RuntimeMethod's are rare (and I believe 12 deprecated). 13 14 * bridge/runtime_method.cpp: 15 (JSC::RuntimeMethod::finishCreation): 16 1 17 2020-09-20 Darin Adler <darin@apple.com> 2 18 -
trunk/Source/WebCore/bridge/runtime_method.cpp
r254010 r267364 55 55 void RuntimeMethod::finishCreation(VM& vm, const String& ident) 56 56 { 57 Base::finishCreation(vm, ident);57 Base::finishCreation(vm, 0, ident); 58 58 ASSERT(inherits(vm, info())); 59 59 } -
trunk/Source/WebKit/ChangeLog
r267363 r267364 1 2020-09-21 Keith Miller <keith_miller@apple.com> 2 3 Functions should consistently enumerate length before name 4 https://bugs.webkit.org/show_bug.cgi?id=216789 5 6 Reviewed by Yusuke Suzuki. 7 8 JSNPMethod inherits from InternalFunction which now sets length by default. 9 I chose 0 because it looks like this function doesn't directly look at any 10 arguments and I doubt anyone is looking at the length anyway. 11 12 * WebProcess/Plugins/Netscape/JSNPMethod.cpp: 13 (WebKit::JSNPMethod::finishCreation): 14 1 15 2020-09-20 Darin Adler <darin@apple.com> 2 16 -
trunk/Source/WebKit/WebProcess/Plugins/Netscape/JSNPMethod.cpp
r252875 r267364 57 57 void JSNPMethod::finishCreation(VM& vm, const String& name) 58 58 { 59 Base::finishCreation(vm, name);59 Base::finishCreation(vm, 0, name); 60 60 ASSERT(inherits(vm, info())); 61 61 }
Note:
See TracChangeset
for help on using the changeset viewer.