Skip to content

Commit 50a12af

Browse files
author
Gavin Barraclough
committed
Introduce PropertyName class
https://bugs.webkit.org/show_bug.cgi?id=86241 Reviewed by Geoff Garen. Replace 'const Identifier&' arguments to functions accessing object properties with a new 'PropertyName' type. This change paves the way to allow for properties keyed by values that are not Identifiers. This change is largely a mechanical find & replace. It also changes JSFunction's constructor to take a UString& instead of an Identifier& (since in some cases we can no longer guarantee that we'lll have an Identifier), and unifies Identifier's methods to obtain array indices onto PropertyName. The new PropertyName class retains the ability to support .impl() and .ustring(), but in a future patch we may need to rework this, since not all PropertyNames should be equal based on their string representation. Source/JavaScriptCore: * API/JSCallbackFunction.cpp: (JSC::JSCallbackFunction::finishCreation): * API/JSCallbackFunction.h: (JSCallbackFunction): (JSC::JSCallbackFunction::create): * API/JSCallbackObject.h: (JSCallbackObject): * API/JSCallbackObjectFunctions.h: (JSC::::getOwnPropertySlot): (JSC::::getOwnPropertyDescriptor): (JSC::::put): (JSC::::deleteProperty): (JSC::::getStaticValue): (JSC::::staticFunctionGetter): (JSC::::callbackGetter): * API/JSObjectRef.cpp: (JSObjectMakeFunctionWithCallback): * JSCTypedArrayStubs.h: (JSC): * JavaScriptCore.xcodeproj/project.pbxproj: * debugger/DebuggerActivation.cpp: (JSC::DebuggerActivation::getOwnPropertySlot): (JSC::DebuggerActivation::put): (JSC::DebuggerActivation::putDirectVirtual): (JSC::DebuggerActivation::deleteProperty): (JSC::DebuggerActivation::getOwnPropertyDescriptor): (JSC::DebuggerActivation::defineOwnProperty): * debugger/DebuggerActivation.h: (DebuggerActivation): * jsc.cpp: (GlobalObject::addFunction): (GlobalObject::addConstructableFunction): * runtime/Arguments.cpp: (JSC::Arguments::getOwnPropertySlot): (JSC::Arguments::getOwnPropertyDescriptor): (JSC::Arguments::put): (JSC::Arguments::deleteProperty): (JSC::Arguments::defineOwnProperty): * runtime/Arguments.h: (Arguments): * runtime/ArrayConstructor.cpp: (JSC::ArrayConstructor::finishCreation): (JSC::ArrayConstructor::getOwnPropertySlot): (JSC::ArrayConstructor::getOwnPropertyDescriptor): * runtime/ArrayConstructor.h: (ArrayConstructor): * runtime/ArrayPrototype.cpp: (JSC::ArrayPrototype::getOwnPropertySlot): (JSC::ArrayPrototype::getOwnPropertyDescriptor): (JSC::putProperty): * runtime/ArrayPrototype.h: (ArrayPrototype): * runtime/BooleanConstructor.cpp: (JSC::BooleanConstructor::finishCreation): * runtime/BooleanPrototype.cpp: (JSC::BooleanPrototype::getOwnPropertySlot): (JSC::BooleanPrototype::getOwnPropertyDescriptor): * runtime/BooleanPrototype.h: (BooleanPrototype): * runtime/ClassInfo.h: (MethodTable): * runtime/DateConstructor.cpp: (JSC::DateConstructor::finishCreation): (JSC::DateConstructor::getOwnPropertySlot): (JSC::DateConstructor::getOwnPropertyDescriptor): * runtime/DateConstructor.h: (DateConstructor): * runtime/DatePrototype.cpp: (JSC::DatePrototype::getOwnPropertySlot): (JSC::DatePrototype::getOwnPropertyDescriptor): * runtime/DatePrototype.h: (DatePrototype): * runtime/Error.h: (JSC::StrictModeTypeErrorFunction::create): * runtime/ErrorConstructor.cpp: (JSC::ErrorConstructor::finishCreation): * runtime/ErrorPrototype.cpp: (JSC::ErrorPrototype::getOwnPropertySlot): (JSC::ErrorPrototype::getOwnPropertyDescriptor): * runtime/ErrorPrototype.h: (ErrorPrototype): * runtime/FunctionConstructor.cpp: (JSC::FunctionConstructor::finishCreation): * runtime/FunctionPrototype.cpp: (JSC::FunctionPrototype::finishCreation): (JSC::FunctionPrototype::addFunctionProperties): (JSC::functionProtoFuncBind): * runtime/FunctionPrototype.h: (JSC::FunctionPrototype::create): (FunctionPrototype): * runtime/Identifier.cpp: (JSC): * runtime/Identifier.h: (Identifier): * runtime/InternalFunction.cpp: (JSC::InternalFunction::finishCreation): * runtime/InternalFunction.h: (InternalFunction): * runtime/JSActivation.cpp: (JSC::JSActivation::symbolTableGet): (JSC::JSActivation::symbolTablePut): (JSC::JSActivation::symbolTablePutWithAttributes): (JSC::JSActivation::getOwnPropertySlot): (JSC::JSActivation::put): (JSC::JSActivation::putDirectVirtual): (JSC::JSActivation::deleteProperty): (JSC::JSActivation::argumentsGetter): * runtime/JSActivation.h: (JSActivation): * runtime/JSArray.cpp: (JSC::JSArray::defineOwnProperty): (JSC::JSArray::getOwnPropertySlot): (JSC::JSArray::getOwnPropertyDescriptor): (JSC::JSArray::put): (JSC::JSArray::deleteProperty): * runtime/JSArray.h: (JSArray): (JSC): * runtime/JSBoundFunction.cpp: (JSC::JSBoundFunction::create): (JSC::JSBoundFunction::finishCreation): * runtime/JSBoundFunction.h: (JSBoundFunction): * runtime/JSCell.cpp: (JSC::JSCell::getOwnPropertySlot): (JSC::JSCell::put): (JSC::JSCell::deleteProperty): (JSC::JSCell::putDirectVirtual): (JSC::JSCell::defineOwnProperty): (JSC::JSCell::getOwnPropertyDescriptor): * runtime/JSCell.h: (JSCell): * runtime/JSFunction.cpp: (JSC::JSFunction::create): (JSC::JSFunction::finishCreation): (JSC::JSFunction::argumentsGetter): (JSC::JSFunction::callerGetter): (JSC::JSFunction::lengthGetter): (JSC::JSFunction::getOwnPropertySlot): (JSC::JSFunction::getOwnPropertyDescriptor): (JSC::JSFunction::put): (JSC::JSFunction::deleteProperty): (JSC::JSFunction::defineOwnProperty): (JSC::getCalculatedDisplayName): * runtime/JSFunction.h: (JSFunction): * runtime/JSGlobalObject.cpp: (JSC::JSGlobalObject::put): (JSC::JSGlobalObject::putDirectVirtual): (JSC::JSGlobalObject::defineOwnProperty): (JSC::JSGlobalObject::reset): (JSC::JSGlobalObject::createThrowTypeError): (JSC::JSGlobalObject::getOwnPropertySlot): (JSC::JSGlobalObject::getOwnPropertyDescriptor): * runtime/JSGlobalObject.h: (JSGlobalObject): (JSC::JSGlobalObject::hasOwnPropertyForWrite): (JSC::JSGlobalObject::symbolTableHasProperty): * runtime/JSNotAnObject.cpp: (JSC::JSNotAnObject::getOwnPropertySlot): (JSC::JSNotAnObject::getOwnPropertyDescriptor): (JSC::JSNotAnObject::put): (JSC::JSNotAnObject::deleteProperty): * runtime/JSNotAnObject.h: (JSNotAnObject): * runtime/JSONObject.cpp: (JSC::JSONObject::getOwnPropertySlot): (JSC::JSONObject::getOwnPropertyDescriptor): * runtime/JSONObject.h: (JSONObject): * runtime/JSObject.cpp: (JSC::JSObject::put): (JSC::JSObject::putDirectVirtual): (JSC::JSObject::putDirectAccessor): (JSC::JSObject::hasProperty): (JSC::JSObject::deleteProperty): (JSC::JSObject::hasOwnProperty): (JSC::callDefaultValueFunction): (JSC::JSObject::findPropertyHashEntry): (JSC::JSObject::getPropertySpecificValue): (JSC::JSObject::removeDirect): (JSC::JSObject::getOwnPropertyDescriptor): (JSC::JSObject::getPropertyDescriptor): (JSC::putDescriptor): (JSC::JSObject::defineOwnProperty): * runtime/JSObject.h: (JSObject): (JSC::JSObject::getDirect): (JSC::JSObject::getDirectLocation): (JSC::JSObject::inlineGetOwnPropertySlot): (JSC::JSObject::getOwnPropertySlot): (JSC::JSCell::fastGetOwnPropertySlot): (JSC::JSObject::getPropertySlot): (JSC::JSObject::get): (JSC::JSObject::putDirectInternal): (JSC::JSObject::putOwnDataProperty): (JSC::JSObject::putDirect): (JSC::JSObject::putDirectWithoutTransition): (JSC::JSValue::get): (JSC::JSValue::put): * runtime/JSStaticScopeObject.cpp: (JSC::JSStaticScopeObject::put): (JSC::JSStaticScopeObject::putDirectVirtual): (JSC::JSStaticScopeObject::getOwnPropertySlot): * runtime/JSStaticScopeObject.h: (JSStaticScopeObject): * runtime/JSString.cpp: (JSC::JSString::getOwnPropertySlot): (JSC::JSString::getStringPropertyDescriptor): * runtime/JSString.h: (JSString): (JSC::JSString::getStringPropertySlot): * runtime/JSValue.cpp: (JSC::JSValue::putToPrimitive): * runtime/JSValue.h: (JSC): (JSValue): * runtime/JSVariableObject.cpp: (JSC::JSVariableObject::deleteProperty): (JSC::JSVariableObject::symbolTableGet): (JSC::JSVariableObject::putDirectVirtual): * runtime/JSVariableObject.h: (JSVariableObject): (JSC::JSVariableObject::symbolTableGet): (JSC::JSVariableObject::symbolTablePut): (JSC::JSVariableObject::symbolTablePutWithAttributes): * runtime/Lookup.cpp: (JSC::setUpStaticFunctionSlot): * runtime/Lookup.h: (JSC::HashTable::entry): (JSC): (JSC::getStaticPropertySlot): (JSC::getStaticPropertyDescriptor): (JSC::getStaticFunctionSlot): (JSC::getStaticFunctionDescriptor): (JSC::getStaticValueSlot): (JSC::getStaticValueDescriptor): (JSC::lookupPut): * runtime/MathObject.cpp: (JSC::MathObject::getOwnPropertySlot): (JSC::MathObject::getOwnPropertyDescriptor): * runtime/MathObject.h: (MathObject): * runtime/NativeErrorConstructor.h: (JSC::NativeErrorConstructor::finishCreation): * runtime/NumberConstructor.cpp: (JSC): (JSC::NumberConstructor::finishCreation): (JSC::NumberConstructor::getOwnPropertySlot): (JSC::NumberConstructor::getOwnPropertyDescriptor): (JSC::NumberConstructor::put): (JSC::numberConstructorNaNValue): (JSC::numberConstructorNegInfinity): (JSC::numberConstructorPosInfinity): (JSC::numberConstructorMaxValue): (JSC::numberConstructorMinValue): * runtime/NumberConstructor.h: (NumberConstructor): * runtime/NumberPrototype.cpp: (JSC::NumberPrototype::getOwnPropertySlot): (JSC::NumberPrototype::getOwnPropertyDescriptor): * runtime/NumberPrototype.h: (NumberPrototype): * runtime/ObjectConstructor.cpp: (JSC::ObjectConstructor::finishCreation): (JSC::ObjectConstructor::getOwnPropertySlot): (JSC::ObjectConstructor::getOwnPropertyDescriptor): * runtime/ObjectConstructor.h: (ObjectConstructor): * runtime/ObjectPrototype.cpp: (JSC::ObjectPrototype::put): (JSC::ObjectPrototype::defineOwnProperty): (JSC::ObjectPrototype::getOwnPropertySlot): (JSC::ObjectPrototype::getOwnPropertyDescriptor): * runtime/ObjectPrototype.h: (ObjectPrototype): * runtime/PropertySlot.h: (PropertySlot): (JSC::PropertySlot::getValue): * runtime/RegExpConstructor.cpp: (JSC): (JSC::RegExpConstructor::finishCreation): (JSC::RegExpConstructor::getOwnPropertySlot): (JSC::RegExpConstructor::getOwnPropertyDescriptor): (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::RegExpConstructor::put): * runtime/RegExpConstructor.h: (RegExpConstructor): * runtime/RegExpMatchesArray.h: (JSC::RegExpMatchesArray::getOwnPropertySlot): (JSC::RegExpMatchesArray::getOwnPropertyDescriptor): (JSC::RegExpMatchesArray::put): (JSC::RegExpMatchesArray::deleteProperty): (JSC::RegExpMatchesArray::defineOwnProperty): * runtime/RegExpObject.cpp: (JSC): (JSC::RegExpObject::getOwnPropertySlot): (JSC::RegExpObject::getOwnPropertyDescriptor): (JSC::RegExpObject::deleteProperty): (JSC::RegExpObject::defineOwnProperty): (JSC::regExpObjectGlobal): (JSC::regExpObjectIgnoreCase): (JSC::regExpObjectMultiline): (JSC::regExpObjectSource): (JSC::RegExpObject::put): * runtime/RegExpObject.h: (RegExpObject): * runtime/RegExpPrototype.cpp: (JSC::RegExpPrototype::getOwnPropertySlot): (JSC::RegExpPrototype::getOwnPropertyDescriptor): * runtime/RegExpPrototype.h: (RegExpPrototype): * runtime/StrictEvalActivation.cpp: (JSC::StrictEvalActivation::deleteProperty): * runtime/StrictEvalActivation.h: (StrictEvalActivation): * runtime/StringConstructor.cpp: (JSC::StringConstructor::finishCreation): (JSC::StringConstructor::getOwnPropertySlot): (JSC::StringConstructor::getOwnPropertyDescriptor): * runtime/StringConstructor.h: (StringConstructor): * runtime/StringObject.cpp: (JSC::StringObject::getOwnPropertySlot): (JSC::StringObject::getOwnPropertyDescriptor): (JSC::StringObject::put): (JSC::StringObject::defineOwnProperty): (JSC::StringObject::deleteProperty): * runtime/StringObject.h: (StringObject): * runtime/StringPrototype.cpp: (JSC::StringPrototype::getOwnPropertySlot): (JSC::StringPrototype::getOwnPropertyDescriptor): * runtime/StringPrototype.h: (StringPrototype): * runtime/Structure.cpp: (JSC::Structure::despecifyDictionaryFunction): (JSC::Structure::addPropertyTransitionToExistingStructure): (JSC::Structure::addPropertyTransition): (JSC::Structure::removePropertyTransition): (JSC::Structure::despecifyFunctionTransition): (JSC::Structure::attributeChangeTransition): (JSC::Structure::addPropertyWithoutTransition): (JSC::Structure::removePropertyWithoutTransition): (JSC::Structure::get): (JSC::Structure::despecifyFunction): (JSC::Structure::putSpecificValue): (JSC::Structure::remove): * runtime/Structure.h: (Structure): (JSC::Structure::get): Source/WebCore: * WebCore.exp.in: * bindings/js/JSCSSStyleDeclarationCustom.cpp: (WebCore::cssPropertyIDForJSCSSPropertyName): (WebCore::JSCSSStyleDeclaration::getOwnPropertySlotDelegate): (WebCore::JSCSSStyleDeclaration::getOwnPropertyDescriptorDelegate): (WebCore::JSCSSStyleDeclaration::putDelegate): * bindings/js/JSDOMBinding.cpp: (WebCore::findAtomicString): (WebCore::objectToStringFunctionGetter): * bindings/js/JSDOMBinding.h: (WebCore): (WebCore::propertyNameToString): (WebCore::propertyNameToAtomicString): * bindings/js/JSDOMMimeTypeArrayCustom.cpp: (WebCore::JSDOMMimeTypeArray::canGetItemsForName): (WebCore::JSDOMMimeTypeArray::nameGetter): * bindings/js/JSDOMPluginArrayCustom.cpp: (WebCore::JSDOMPluginArray::canGetItemsForName): (WebCore::JSDOMPluginArray::nameGetter): * bindings/js/JSDOMPluginCustom.cpp: (WebCore::JSDOMPlugin::canGetItemsForName): (WebCore::JSDOMPlugin::nameGetter): * bindings/js/JSDOMStringMapCustom.cpp: (WebCore::JSDOMStringMap::canGetItemsForName): (WebCore::JSDOMStringMap::nameGetter): (WebCore::JSDOMStringMap::deleteProperty): (WebCore::JSDOMStringMap::putDelegate): * bindings/js/JSDOMWindowCustom.cpp: (WebCore::nonCachingStaticFunctionGetter): (WebCore::childFrameGetter): (WebCore::namedItemGetter): (WebCore::JSDOMWindow::getOwnPropertySlot): (WebCore::JSDOMWindow::getOwnPropertyDescriptor): (WebCore::JSDOMWindow::put): (WebCore::JSDOMWindow::deleteProperty): (WebCore::JSDOMWindow::defineOwnProperty): * bindings/js/JSDOMWindowShell.cpp: (WebCore::JSDOMWindowShell::getOwnPropertySlot): (WebCore::JSDOMWindowShell::getOwnPropertyDescriptor): (WebCore::JSDOMWindowShell::put): (WebCore::JSDOMWindowShell::putDirectVirtual): (WebCore::JSDOMWindowShell::defineOwnProperty): (WebCore::JSDOMWindowShell::deleteProperty): * bindings/js/JSDOMWindowShell.h: (JSDOMWindowShell): * bindings/js/JSHTMLAllCollectionCustom.cpp: (WebCore::getNamedItems): (WebCore::callHTMLAllCollection): (WebCore::JSHTMLAllCollection::canGetItemsForName): (WebCore::JSHTMLAllCollection::nameGetter): (WebCore::JSHTMLAllCollection::item): * bindings/js/JSHTMLAppletElementCustom.cpp: (WebCore::JSHTMLAppletElement::getOwnPropertySlotDelegate): (WebCore::JSHTMLAppletElement::getOwnPropertyDescriptorDelegate): (WebCore::JSHTMLAppletElement::putDelegate): * bindings/js/JSHTMLCollectionCustom.cpp: (WebCore::getNamedItems): (WebCore::JSHTMLCollection::canGetItemsForName): (WebCore::JSHTMLCollection::nameGetter): * bindings/js/JSHTMLDocumentCustom.cpp: (WebCore::JSHTMLDocument::canGetItemsForName): (WebCore::JSHTMLDocument::nameGetter): * bindings/js/JSHTMLEmbedElementCustom.cpp: (WebCore::JSHTMLEmbedElement::getOwnPropertySlotDelegate): (WebCore::JSHTMLEmbedElement::getOwnPropertyDescriptorDelegate): (WebCore::JSHTMLEmbedElement::putDelegate): * bindings/js/JSHTMLFormElementCustom.cpp: (WebCore::JSHTMLFormElement::canGetItemsForName): (WebCore::JSHTMLFormElement::nameGetter): * bindings/js/JSHTMLFrameSetElementCustom.cpp: (WebCore::JSHTMLFrameSetElement::canGetItemsForName): (WebCore::JSHTMLFrameSetElement::nameGetter): * bindings/js/JSHTMLObjectElementCustom.cpp: (WebCore::JSHTMLObjectElement::getOwnPropertySlotDelegate): (WebCore::JSHTMLObjectElement::getOwnPropertyDescriptorDelegate): (WebCore::JSHTMLObjectElement::putDelegate): * bindings/js/JSHistoryCustom.cpp: (WebCore::nonCachingStaticBackFunctionGetter): (WebCore::nonCachingStaticForwardFunctionGetter): (WebCore::nonCachingStaticGoFunctionGetter): (WebCore::JSHistory::getOwnPropertySlotDelegate): (WebCore::JSHistory::getOwnPropertyDescriptorDelegate): (WebCore::JSHistory::putDelegate): (WebCore::JSHistory::deleteProperty): * bindings/js/JSLocationCustom.cpp: (WebCore::nonCachingStaticReplaceFunctionGetter): (WebCore::nonCachingStaticReloadFunctionGetter): (WebCore::nonCachingStaticAssignFunctionGetter): (WebCore::JSLocation::getOwnPropertySlotDelegate): (WebCore::JSLocation::getOwnPropertyDescriptorDelegate): (WebCore::JSLocation::putDelegate): (WebCore::JSLocation::deleteProperty): (WebCore::JSLocation::defineOwnProperty): (WebCore::JSLocationPrototype::putDelegate): (WebCore::JSLocationPrototype::defineOwnProperty): * bindings/js/JSNamedNodeMapCustom.cpp: (WebCore::JSNamedNodeMap::canGetItemsForName): (WebCore::JSNamedNodeMap::nameGetter): * bindings/js/JSNodeListCustom.cpp: (WebCore::JSNodeList::canGetItemsForName): (WebCore::JSNodeList::nameGetter): * bindings/js/JSPluginElementFunctions.cpp: (WebCore::runtimeObjectPropertyGetter): (WebCore::runtimeObjectCustomGetOwnPropertySlot): (WebCore::runtimeObjectCustomGetOwnPropertyDescriptor): (WebCore::runtimeObjectCustomPut): * bindings/js/JSPluginElementFunctions.h: (WebCore): * bindings/js/JSStorageCustom.cpp: (WebCore::JSStorage::canGetItemsForName): (WebCore::JSStorage::nameGetter): (WebCore::JSStorage::deleteProperty): (WebCore::JSStorage::putDelegate): * bindings/js/JSStyleSheetListCustom.cpp: (WebCore::JSStyleSheetList::canGetItemsForName): (WebCore::JSStyleSheetList::nameGetter): * bindings/js/JSWorkerContextCustom.cpp: (WebCore::JSWorkerContext::getOwnPropertySlotDelegate): (WebCore::JSWorkerContext::getOwnPropertyDescriptorDelegate): * bindings/scripts/CodeGeneratorJS.pm: (GenerateGetOwnPropertySlotBody): (GenerateGetOwnPropertyDescriptorBody): (GenerateHeader): (GenerateImplementation): (GenerateConstructorDeclaration): (GenerateConstructorDefinition): * bridge/c/c_class.cpp: (JSC::Bindings::CClass::methodsNamed): (JSC::Bindings::CClass::fieldNamed): * bridge/c/c_class.h: (CClass): * bridge/c/c_instance.cpp: (JSC::Bindings::CRuntimeMethod::create): (JSC::Bindings::CRuntimeMethod::finishCreation): (JSC::Bindings::CInstance::getMethod): * bridge/c/c_instance.h: (CInstance): * bridge/jni/jsc/JavaClassJSC.cpp: (JavaClass::methodsNamed): (JavaClass::fieldNamed): * bridge/jni/jsc/JavaClassJSC.h: (JavaClass): * bridge/jni/jsc/JavaInstanceJSC.cpp: (JavaRuntimeMethod::create): (JavaRuntimeMethod::finishCreation): * bridge/jni/jsc/JavaInstanceJSC.h: (JavaInstance): * bridge/jsc/BridgeJSC.h: (Class): (JSC::Bindings::Class::fallbackObject): (JSC::Bindings::Instance::setValueOfUndefinedField): (Instance): (JSC::Bindings::Instance::getOwnPropertySlot): (JSC::Bindings::Instance::getOwnPropertyDescriptor): (JSC::Bindings::Instance::put): * bridge/objc/objc_class.h: (ObjcClass): * bridge/objc/objc_class.mm: (JSC::Bindings::ObjcClass::methodsNamed): (JSC::Bindings::ObjcClass::fieldNamed): (JSC::Bindings::ObjcClass::fallbackObject): * bridge/objc/objc_instance.h: (ObjcInstance): * bridge/objc/objc_instance.mm: (ObjCRuntimeMethod::create): (ObjCRuntimeMethod::finishCreation): (ObjcInstance::setValueOfUndefinedField): (ObjcInstance::getValueOfUndefinedField): * bridge/objc/objc_runtime.h: (JSC::Bindings::ObjcFallbackObjectImp::create): (JSC::Bindings::ObjcFallbackObjectImp::propertyName): (ObjcFallbackObjectImp): * bridge/objc/objc_runtime.mm: (JSC::Bindings::ObjcFallbackObjectImp::ObjcFallbackObjectImp): (JSC::Bindings::ObjcFallbackObjectImp::getOwnPropertySlot): (JSC::Bindings::ObjcFallbackObjectImp::getOwnPropertyDescriptor): (JSC::Bindings::ObjcFallbackObjectImp::put): (JSC::Bindings::callObjCFallbackObject): (JSC::Bindings::ObjcFallbackObjectImp::deleteProperty): (JSC::Bindings::ObjcFallbackObjectImp::defaultValue): * bridge/runtime_array.cpp: (JSC::RuntimeArray::lengthGetter): (JSC::RuntimeArray::getOwnPropertySlot): (JSC::RuntimeArray::getOwnPropertyDescriptor): (JSC::RuntimeArray::put): (JSC::RuntimeArray::deleteProperty): * bridge/runtime_array.h: (RuntimeArray): * bridge/runtime_method.cpp: (JSC::RuntimeMethod::finishCreation): (JSC::RuntimeMethod::lengthGetter): (JSC::RuntimeMethod::getOwnPropertySlot): (JSC::RuntimeMethod::getOwnPropertyDescriptor): * bridge/runtime_method.h: (JSC::RuntimeMethod::create): (RuntimeMethod): * bridge/runtime_object.cpp: (JSC::Bindings::RuntimeObject::fallbackObjectGetter): (JSC::Bindings::RuntimeObject::fieldGetter): (JSC::Bindings::RuntimeObject::methodGetter): (JSC::Bindings::RuntimeObject::getOwnPropertySlot): (JSC::Bindings::RuntimeObject::getOwnPropertyDescriptor): (JSC::Bindings::RuntimeObject::put): (JSC::Bindings::RuntimeObject::deleteProperty): * bridge/runtime_object.h: (RuntimeObject): Source/WebKit/mac: * Plugins/Hosted/ProxyInstance.h: (ProxyInstance): * Plugins/Hosted/ProxyInstance.mm: (ProxyClass): (WebKit::ProxyClass::methodsNamed): (WebKit::ProxyClass::fieldNamed): (WebKit::ProxyRuntimeMethod::create): (WebKit::ProxyRuntimeMethod::finishCreation): (WebKit::ProxyInstance::getMethod): (WebKit::ProxyInstance::methodsNamed): (WebKit::ProxyInstance::fieldNamed): Source/WebKit2: * WebProcess/Plugins/Netscape/JSNPMethod.cpp: (WebKit::JSNPMethod::finishCreation): * WebProcess/Plugins/Netscape/JSNPMethod.h: (WebKit::JSNPMethod::create): (JSNPMethod): * WebProcess/Plugins/Netscape/JSNPObject.cpp: (WebKit::npIdentifierFromIdentifier): (WebKit::JSNPObject::getOwnPropertySlot): (WebKit::JSNPObject::getOwnPropertyDescriptor): (WebKit::JSNPObject::put): (WebKit::JSNPObject::deleteProperty): (WebKit::JSNPObject::propertyGetter): (WebKit::JSNPObject::methodGetter): * WebProcess/Plugins/Netscape/JSNPObject.h: (JSNPObject): Canonical link: https://commits.webkit.org/103861@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@116828 268f45cc-cd09-0410-ab3c-d52691b4dbfc
1 parent 62db8ba commit 50a12af

187 files changed

Lines changed: 2137 additions & 1420 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

‎Source/JavaScriptCore/API/JSCallbackFunction.cpp‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ JSCallbackFunction::JSCallbackFunction(JSGlobalObject* globalObject, JSObjectCal
4949
{
5050
}
5151

52-
void JSCallbackFunction::finishCreation(JSGlobalData& globalData, const Identifier& name)
52+
void JSCallbackFunction::finishCreation(JSGlobalData& globalData, const UString& name)
5353
{
5454
Base::finishCreation(globalData, name);
5555
ASSERT(inherits(&s_info));

‎Source/JavaScriptCore/API/JSCallbackFunction.h‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,12 +34,12 @@ namespace JSC {
3434
class JSCallbackFunction : public InternalFunction {
3535
protected:
3636
JSCallbackFunction(JSGlobalObject*, JSObjectCallAsFunctionCallback);
37-
void finishCreation(JSGlobalData&, const Identifier& name);
37+
void finishCreation(JSGlobalData&, const UString& name);
3838

3939
public:
4040
typedef InternalFunction Base;
4141

42-
static JSCallbackFunction* create(ExecState* exec, JSGlobalObject* globalObject, JSObjectCallAsFunctionCallback callback, const Identifier& name)
42+
static JSCallbackFunction* create(ExecState* exec, JSGlobalObject* globalObject, JSObjectCallAsFunctionCallback callback, const UString& name)
4343
{
4444
JSCallbackFunction* function = new (NotNull, allocateCell<JSCallbackFunction>(*exec->heap())) JSCallbackFunction(globalObject, callback);
4545
function->finishCreation(exec->globalData(), name);

‎Source/JavaScriptCore/API/JSCallbackObject.h‎

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -177,12 +177,12 @@ class JSCallbackObject : public Parent {
177177

178178
static JSValue defaultValue(const JSObject*, ExecState*, PreferredPrimitiveType);
179179

180-
static bool getOwnPropertySlot(JSCell*, ExecState*, const Identifier&, PropertySlot&);
181-
static bool getOwnPropertyDescriptor(JSObject*, ExecState*, const Identifier&, PropertyDescriptor&);
180+
static bool getOwnPropertySlot(JSCell*, ExecState*, PropertyName, PropertySlot&);
181+
static bool getOwnPropertyDescriptor(JSObject*, ExecState*, PropertyName, PropertyDescriptor&);
182182

183-
static void put(JSCell*, ExecState*, const Identifier&, JSValue, PutPropertySlot&);
183+
static void put(JSCell*, ExecState*, PropertyName, JSValue, PutPropertySlot&);
184184

185-
static bool deleteProperty(JSCell*, ExecState*, const Identifier&);
185+
static bool deleteProperty(JSCell*, ExecState*, PropertyName);
186186
static bool deletePropertyByIndex(JSCell*, ExecState*, unsigned);
187187

188188
static bool hasInstance(JSObject*, ExecState*, JSValue, JSValue proto);
@@ -209,9 +209,9 @@ class JSCallbackObject : public Parent {
209209
static EncodedJSValue JSC_HOST_CALL call(ExecState*);
210210
static EncodedJSValue JSC_HOST_CALL construct(ExecState*);
211211

212-
JSValue getStaticValue(ExecState*, const Identifier&);
213-
static JSValue staticFunctionGetter(ExecState*, JSValue, const Identifier&);
214-
static JSValue callbackGetter(ExecState*, JSValue, const Identifier&);
212+
JSValue getStaticValue(ExecState*, PropertyName);
213+
static JSValue staticFunctionGetter(ExecState*, JSValue, PropertyName);
214+
static JSValue callbackGetter(ExecState*, JSValue, PropertyName);
215215

216216
OwnPtr<JSCallbackObjectData> m_callbackObjectData;
217217
};

‎Source/JavaScriptCore/API/JSCallbackObjectFunctions.h‎

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,7 @@ UString JSCallbackObject<Parent>::className(const JSObject* object)
122122
}
123123

124124
template <class Parent>
125-
bool JSCallbackObject<Parent>::getOwnPropertySlot(JSCell* cell, ExecState* exec, const Identifier& propertyName, PropertySlot& slot)
125+
bool JSCallbackObject<Parent>::getOwnPropertySlot(JSCell* cell, ExecState* exec, PropertyName propertyName, PropertySlot& slot)
126126
{
127127
JSCallbackObject* thisObject = jsCast<JSCallbackObject*>(cell);
128128
JSContextRef ctx = toRef(exec);
@@ -205,7 +205,7 @@ JSValue JSCallbackObject<Parent>::defaultValue(const JSObject* object, ExecState
205205
}
206206

207207
template <class Parent>
208-
bool JSCallbackObject<Parent>::getOwnPropertyDescriptor(JSObject* object, ExecState* exec, const Identifier& propertyName, PropertyDescriptor& descriptor)
208+
bool JSCallbackObject<Parent>::getOwnPropertyDescriptor(JSObject* object, ExecState* exec, PropertyName propertyName, PropertyDescriptor& descriptor)
209209
{
210210
JSCallbackObject* thisObject = jsCast<JSCallbackObject*>(object);
211211
PropertySlot slot;
@@ -225,7 +225,7 @@ bool JSCallbackObject<Parent>::getOwnPropertyDescriptor(JSObject* object, ExecSt
225225
}
226226

227227
template <class Parent>
228-
void JSCallbackObject<Parent>::put(JSCell* cell, ExecState* exec, const Identifier& propertyName, JSValue value, PutPropertySlot& slot)
228+
void JSCallbackObject<Parent>::put(JSCell* cell, ExecState* exec, PropertyName propertyName, JSValue value, PutPropertySlot& slot)
229229
{
230230
JSCallbackObject* thisObject = jsCast<JSCallbackObject*>(cell);
231231
JSContextRef ctx = toRef(exec);
@@ -284,7 +284,7 @@ void JSCallbackObject<Parent>::put(JSCell* cell, ExecState* exec, const Identifi
284284
}
285285

286286
template <class Parent>
287-
bool JSCallbackObject<Parent>::deleteProperty(JSCell* cell, ExecState* exec, const Identifier& propertyName)
287+
bool JSCallbackObject<Parent>::deleteProperty(JSCell* cell, ExecState* exec, PropertyName propertyName)
288288
{
289289
JSCallbackObject* thisObject = jsCast<JSCallbackObject*>(cell);
290290
JSContextRef ctx = toRef(exec);
@@ -504,7 +504,7 @@ bool JSCallbackObject<Parent>::inherits(JSClassRef c) const
504504
}
505505

506506
template <class Parent>
507-
JSValue JSCallbackObject<Parent>::getStaticValue(ExecState* exec, const Identifier& propertyName)
507+
JSValue JSCallbackObject<Parent>::getStaticValue(ExecState* exec, PropertyName propertyName)
508508
{
509509
JSObjectRef thisRef = toRef(this);
510510
RefPtr<OpaqueJSString> propertyNameRef;
@@ -533,7 +533,7 @@ JSValue JSCallbackObject<Parent>::getStaticValue(ExecState* exec, const Identifi
533533
}
534534

535535
template <class Parent>
536-
JSValue JSCallbackObject<Parent>::staticFunctionGetter(ExecState* exec, JSValue slotParent, const Identifier& propertyName)
536+
JSValue JSCallbackObject<Parent>::staticFunctionGetter(ExecState* exec, JSValue slotParent, PropertyName propertyName)
537537
{
538538
JSCallbackObject* thisObj = asCallbackObject(slotParent);
539539

@@ -547,7 +547,7 @@ JSValue JSCallbackObject<Parent>::staticFunctionGetter(ExecState* exec, JSValue
547547
if (StaticFunctionEntry* entry = staticFunctions->get(propertyName.impl())) {
548548
if (JSObjectCallAsFunctionCallback callAsFunction = entry->callAsFunction) {
549549

550-
JSObject* o = JSCallbackFunction::create(exec, thisObj->globalObject(), callAsFunction, propertyName);
550+
JSObject* o = JSCallbackFunction::create(exec, thisObj->globalObject(), callAsFunction, propertyName.ustring());
551551
thisObj->putDirect(exec->globalData(), propertyName, o, entry->attributes);
552552
return o;
553553
}
@@ -559,7 +559,7 @@ JSValue JSCallbackObject<Parent>::staticFunctionGetter(ExecState* exec, JSValue
559559
}
560560

561561
template <class Parent>
562-
JSValue JSCallbackObject<Parent>::callbackGetter(ExecState* exec, JSValue slotParent, const Identifier& propertyName)
562+
JSValue JSCallbackObject<Parent>::callbackGetter(ExecState* exec, JSValue slotParent, PropertyName propertyName)
563563
{
564564
JSCallbackObject* thisObj = asCallbackObject(slotParent);
565565

‎Source/JavaScriptCore/API/JSObjectRef.cpp‎

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -92,10 +92,7 @@ JSObjectRef JSObjectMakeFunctionWithCallback(JSContextRef ctx, JSStringRef name,
9292
{
9393
ExecState* exec = toJS(ctx);
9494
APIEntryShim entryShim(exec);
95-
96-
Identifier nameID = name ? name->identifier(&exec->globalData()) : Identifier(exec, "anonymous");
97-
98-
return toRef(JSCallbackFunction::create(exec, exec->lexicalGlobalObject(), callAsFunction, nameID));
95+
return toRef(JSCallbackFunction::create(exec, exec->lexicalGlobalObject(), callAsFunction, name ? name->ustring() : "anonymous"));
9996
}
10097

10198
JSObjectRef JSObjectMakeConstructor(JSContextRef ctx, JSClassRef jsClass, JSObjectCallAsConstructorCallback callAsConstructor)

0 commit comments

Comments
 (0)