Commit 467b7798 authored by oliver@apple.com's avatar oliver@apple.com

2010-03-01 Oliver Hunt <oliver@apple.com>

        Reviewed by Maciej Stachowiak.

        Refactor named getter function signature to be in line with indexing getter signature
        https://bugs.webkit.org/show_bug.cgi?id=35563

        This removes the PropertySlot argument from getter functions, and makes them directly
        pass the slot base.  This makes the semantics for the functions match that of the
        indexing getters.

        On the down side, this means that we can no longer simply use a proxy function for
        JS getters, so we now add another marker value to indicate that a getter is present
        and branch accordingly.

        Against all rationality sunspider reports this as a perf win, but i suspect it's just noise.

        * API/JSCallbackObject.h:
        * API/JSCallbackObjectFunctions.h:
        (JSC::::staticValueGetter):
        (JSC::::staticFunctionGetter):
        (JSC::::callbackGetter):
        * JavaScriptCore.exp:
        * runtime/JSActivation.cpp:
        (JSC::JSActivation::argumentsGetter):
        * runtime/JSActivation.h:
        * runtime/JSFunction.cpp:
        (JSC::JSFunction::argumentsGetter):
        (JSC::JSFunction::callerGetter):
        (JSC::JSFunction::lengthGetter):
        * runtime/JSFunction.h:
        * runtime/NumberConstructor.cpp:
        (JSC::numberConstructorNaNValue):
        (JSC::numberConstructorNegInfinity):
        (JSC::numberConstructorPosInfinity):
        (JSC::numberConstructorMaxValue):
        (JSC::numberConstructorMinValue):
        * runtime/PropertySlot.cpp:
        (JSC::PropertySlot::functionGetter):
        * runtime/PropertySlot.h:
        (JSC::PropertySlot::getValue):
        (JSC::PropertySlot::setGetterSlot):
        (JSC::PropertySlot::setCacheableGetterSlot):
        * runtime/RegExpConstructor.cpp:
        (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):
        * runtime/RegExpObject.cpp:
        (JSC::regExpObjectGlobal):
        (JSC::regExpObjectIgnoreCase):
        (JSC::regExpObjectMultiline):
        (JSC::regExpObjectSource):
        (JSC::regExpObjectLastIndex):
2010-03-01  Oliver Hunt  <oliver@apple.com>

        Reviewed by Maciej Stachowiak.

        Refactor named getter function signature to be in line with indexing getter signature
        https://bugs.webkit.org/show_bug.cgi?id=35563

        Fix method signature and update code as appropriate

        * UserObjectImp.cpp:
        (UserObjectImp::userObjectGetter):
        * UserObjectImp.h:
2010-03-01  Oliver Hunt  <oliver@apple.com>

        Reviewed by Maciej Stachowiak.

        Refactor named getter function signature to be in line with indexing getter signature
        https://bugs.webkit.org/show_bug.cgi?id=35563

        Fix up WebCore to use the new named getter function signature, update the
        codegenerator to the new calling convention, and fix the custom bindings.

        * bindings/js/JSCSSStyleDeclarationCustom.cpp:
        (WebCore::JSCSSStyleDeclaration::nameGetter):
        * bindings/js/JSDOMBinding.cpp:
        (WebCore::objectToStringFunctionGetter):
        * bindings/js/JSDOMBinding.h:
        * bindings/js/JSDOMWindowCustom.cpp:
        (WebCore::nonCachingStaticFunctionGetter):
        (WebCore::childFrameGetter):
        (WebCore::namedItemGetter):
        * bindings/js/JSDataGridColumnListCustom.cpp:
        (WebCore::JSDataGridColumnList::nameGetter):
        * bindings/js/JSHTMLAllCollectionCustom.cpp:
        (WebCore::JSHTMLAllCollection::nameGetter):
        * bindings/js/JSHTMLCollectionCustom.cpp:
        (WebCore::JSHTMLCollection::nameGetter):
        * bindings/js/JSHTMLDocumentCustom.cpp:
        (WebCore::JSHTMLDocument::nameGetter):
        * bindings/js/JSHTMLFormElementCustom.cpp:
        (WebCore::JSHTMLFormElement::nameGetter):
        * bindings/js/JSHTMLFrameSetElementCustom.cpp:
        (WebCore::JSHTMLFrameSetElement::nameGetter):
        * bindings/js/JSHistoryCustom.cpp:
        (WebCore::nonCachingStaticBackFunctionGetter):
        (WebCore::nonCachingStaticForwardFunctionGetter):
        (WebCore::nonCachingStaticGoFunctionGetter):
        * bindings/js/JSLocationCustom.cpp:
        (WebCore::nonCachingStaticReplaceFunctionGetter):
        (WebCore::nonCachingStaticReloadFunctionGetter):
        (WebCore::nonCachingStaticAssignFunctionGetter):
        * bindings/js/JSMimeTypeArrayCustom.cpp:
        (WebCore::JSMimeTypeArray::nameGetter):
        * bindings/js/JSNamedNodeMapCustom.cpp:
        (WebCore::JSNamedNodeMap::nameGetter):
        * bindings/js/JSNodeListCustom.cpp:
        (WebCore::JSNodeList::nameGetter):
        * bindings/js/JSPluginArrayCustom.cpp:
        (WebCore::JSPluginArray::nameGetter):
        * bindings/js/JSPluginCustom.cpp:
        (WebCore::JSPlugin::nameGetter):
        * bindings/js/JSPluginElementFunctions.cpp:
        (WebCore::runtimeObjectPropertyGetter):
        * bindings/js/JSPluginElementFunctions.h:
        * bindings/js/JSStorageCustom.cpp:
        (WebCore::JSStorage::nameGetter):
        * bindings/js/JSStyleSheetListCustom.cpp:
        (WebCore::JSStyleSheetList::nameGetter):
        * bindings/scripts/CodeGeneratorJS.pm:
        * bridge/runtime_array.cpp:
        (JSC::RuntimeArray::lengthGetter):
        * bridge/runtime_array.h:
        * bridge/runtime_method.cpp:
        (JSC::RuntimeMethod::lengthGetter):
        * bridge/runtime_method.h:
        * bridge/runtime_object.cpp:
        (JSC::Bindings::RuntimeObject::fallbackObjectGetter):
        (JSC::Bindings::RuntimeObject::fieldGetter):
        (JSC::Bindings::RuntimeObject::methodGetter):
        * bridge/runtime_object.h:

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@55401 268f45cc-cd09-0410-ab3c-d52691b4dbfc
parent b809dc82
......@@ -86,9 +86,9 @@ private:
static JSValue JSC_HOST_CALL call(ExecState*, JSObject* functionObject, JSValue thisValue, const ArgList&);
static JSObject* construct(ExecState*, JSObject* constructor, const ArgList&);
static JSValue staticValueGetter(ExecState*, const Identifier&, const PropertySlot&);
static JSValue staticFunctionGetter(ExecState*, const Identifier&, const PropertySlot&);
static JSValue callbackGetter(ExecState*, const Identifier&, const PropertySlot&);
static JSValue staticValueGetter(ExecState*, JSValue, const Identifier&);
static JSValue staticFunctionGetter(ExecState*, JSValue, const Identifier&);
static JSValue callbackGetter(ExecState*, JSValue, const Identifier&);
struct JSCallbackObjectData {
JSCallbackObjectData(void* privateData, JSClassRef jsClass)
......
......@@ -516,9 +516,9 @@ bool JSCallbackObject<Base>::inherits(JSClassRef c) const
}
template <class Base>
JSValue JSCallbackObject<Base>::staticValueGetter(ExecState* exec, const Identifier& propertyName, const PropertySlot& slot)
JSValue JSCallbackObject<Base>::staticValueGetter(ExecState* exec, JSValue slotBase, const Identifier& propertyName)
{
JSCallbackObject* thisObj = asCallbackObject(slot.slotBase());
JSCallbackObject* thisObj = asCallbackObject(slotBase);
JSObjectRef thisRef = toRef(thisObj);
RefPtr<OpaqueJSString> propertyNameRef;
......@@ -547,9 +547,9 @@ JSValue JSCallbackObject<Base>::staticValueGetter(ExecState* exec, const Identif
}
template <class Base>
JSValue JSCallbackObject<Base>::staticFunctionGetter(ExecState* exec, const Identifier& propertyName, const PropertySlot& slot)
JSValue JSCallbackObject<Base>::staticFunctionGetter(ExecState* exec, JSValue slotBase, const Identifier& propertyName)
{
JSCallbackObject* thisObj = asCallbackObject(slot.slotBase());
JSCallbackObject* thisObj = asCallbackObject(slotBase);
// Check for cached or override property.
PropertySlot slot2(thisObj);
......@@ -572,9 +572,9 @@ JSValue JSCallbackObject<Base>::staticFunctionGetter(ExecState* exec, const Iden
}
template <class Base>
JSValue JSCallbackObject<Base>::callbackGetter(ExecState* exec, const Identifier& propertyName, const PropertySlot& slot)
JSValue JSCallbackObject<Base>::callbackGetter(ExecState* exec, JSValue slotBase, const Identifier& propertyName)
{
JSCallbackObject* thisObj = asCallbackObject(slot.slotBase());
JSCallbackObject* thisObj = asCallbackObject(slotBase);
JSObjectRef thisRef = toRef(thisObj);
RefPtr<OpaqueJSString> propertyNameRef;
......
2010-03-01 Oliver Hunt <oliver@apple.com>
Reviewed by Maciej Stachowiak.
Refactor named getter function signature to be in line with indexing getter signature
https://bugs.webkit.org/show_bug.cgi?id=35563
This removes the PropertySlot argument from getter functions, and makes them directly
pass the slot base. This makes the semantics for the functions match that of the
indexing getters.
On the down side, this means that we can no longer simply use a proxy function for
JS getters, so we now add another marker value to indicate that a getter is present
and branch accordingly.
Against all rationality sunspider reports this as a perf win, but i suspect it's just noise.
* API/JSCallbackObject.h:
* API/JSCallbackObjectFunctions.h:
(JSC::::staticValueGetter):
(JSC::::staticFunctionGetter):
(JSC::::callbackGetter):
* JavaScriptCore.exp:
* runtime/JSActivation.cpp:
(JSC::JSActivation::argumentsGetter):
* runtime/JSActivation.h:
* runtime/JSFunction.cpp:
(JSC::JSFunction::argumentsGetter):
(JSC::JSFunction::callerGetter):
(JSC::JSFunction::lengthGetter):
* runtime/JSFunction.h:
* runtime/NumberConstructor.cpp:
(JSC::numberConstructorNaNValue):
(JSC::numberConstructorNegInfinity):
(JSC::numberConstructorPosInfinity):
(JSC::numberConstructorMaxValue):
(JSC::numberConstructorMinValue):
* runtime/PropertySlot.cpp:
(JSC::PropertySlot::functionGetter):
* runtime/PropertySlot.h:
(JSC::PropertySlot::getValue):
(JSC::PropertySlot::setGetterSlot):
(JSC::PropertySlot::setCacheableGetterSlot):
* runtime/RegExpConstructor.cpp:
(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):
* runtime/RegExpObject.cpp:
(JSC::regExpObjectGlobal):
(JSC::regExpObjectIgnoreCase):
(JSC::regExpObjectMultiline):
(JSC::regExpObjectSource):
(JSC::regExpObjectLastIndex):
2010-03-01 Oliver Hunt <oliver@apple.com>
Reviewed by Gavin Barraclough.
......
......@@ -358,6 +358,7 @@ __ZN3WTF9dayInYearEdi
__ZNK3JSC10JSFunction23isHostFunctionNonInlineEv
__ZNK3JSC11Interpreter14retrieveCallerEPNS_9ExecStateEPNS_16InternalFunctionE
__ZNK3JSC11Interpreter18retrieveLastCallerEPNS_9ExecStateERiRlRNS_7UStringERNS_7JSValueE
__ZNK3JSC12PropertySlot14functionGetterEPNS_9ExecStateE
__ZNK3JSC14JSGlobalObject14isDynamicScopeEv
__ZNK3JSC16InternalFunction9classInfoEv
__ZNK3JSC16JSVariableObject16isVariableObjectEv
......
......@@ -139,9 +139,9 @@ bool JSActivation::isDynamicScope() const
return d()->functionExecutable->usesEval();
}
JSValue JSActivation::argumentsGetter(ExecState* exec, const Identifier&, const PropertySlot& slot)
JSValue JSActivation::argumentsGetter(ExecState* exec, JSValue slotBase, const Identifier&)
{
JSActivation* activation = asActivation(slot.slotBase());
JSActivation* activation = asActivation(slotBase);
if (activation->d()->functionExecutable->usesArguments()) {
PropertySlot slot;
......
......@@ -89,7 +89,7 @@ namespace JSC {
RefPtr<FunctionExecutable> functionExecutable;
};
static JSValue argumentsGetter(ExecState*, const Identifier&, const PropertySlot&);
static JSValue argumentsGetter(ExecState*, JSValue, const Identifier&);
NEVER_INLINE PropertySlot::GetValueFunc getArgumentsGetter();
JSActivationData* d() const { return static_cast<JSActivationData*>(JSVariableObject::d); }
......
......@@ -122,23 +122,23 @@ JSValue JSFunction::call(ExecState* exec, JSValue thisValue, const ArgList& args
return exec->interpreter()->execute(jsExecutable(), exec, this, thisValue.toThisObject(exec), args, scopeChain().node(), exec->exceptionSlot());
}
JSValue JSFunction::argumentsGetter(ExecState* exec, const Identifier&, const PropertySlot& slot)
JSValue JSFunction::argumentsGetter(ExecState* exec, JSValue slotBase, const Identifier&)
{
JSFunction* thisObj = asFunction(slot.slotBase());
JSFunction* thisObj = asFunction(slotBase);
ASSERT(!thisObj->isHostFunction());
return exec->interpreter()->retrieveArguments(exec, thisObj);
}
JSValue JSFunction::callerGetter(ExecState* exec, const Identifier&, const PropertySlot& slot)
JSValue JSFunction::callerGetter(ExecState* exec, JSValue slotBase, const Identifier&)
{
JSFunction* thisObj = asFunction(slot.slotBase());
JSFunction* thisObj = asFunction(slotBase);
ASSERT(!thisObj->isHostFunction());
return exec->interpreter()->retrieveCaller(exec, thisObj);
}
JSValue JSFunction::lengthGetter(ExecState* exec, const Identifier&, const PropertySlot& slot)
JSValue JSFunction::lengthGetter(ExecState* exec, JSValue slotBase, const Identifier&)
{
JSFunction* thisObj = asFunction(slot.slotBase());
JSFunction* thisObj = asFunction(slotBase);
ASSERT(!thisObj->isHostFunction());
return jsNumber(exec, thisObj->jsExecutable()->parameterCount());
}
......
......@@ -90,9 +90,9 @@ namespace JSC {
virtual const ClassInfo* classInfo() const { return &info; }
static JSValue argumentsGetter(ExecState*, const Identifier&, const PropertySlot&);
static JSValue callerGetter(ExecState*, const Identifier&, const PropertySlot&);
static JSValue lengthGetter(ExecState*, const Identifier&, const PropertySlot&);
static JSValue argumentsGetter(ExecState*, JSValue, const Identifier&);
static JSValue callerGetter(ExecState*, JSValue, const Identifier&);
static JSValue lengthGetter(ExecState*, JSValue, const Identifier&);
RefPtr<ExecutableBase> m_executable;
ScopeChain& scopeChain()
......
......@@ -29,11 +29,11 @@ namespace JSC {
ASSERT_CLASS_FITS_IN_CELL(NumberConstructor);
static JSValue numberConstructorNaNValue(ExecState*, const Identifier&, const PropertySlot&);
static JSValue numberConstructorNegInfinity(ExecState*, const Identifier&, const PropertySlot&);
static JSValue numberConstructorPosInfinity(ExecState*, const Identifier&, const PropertySlot&);
static JSValue numberConstructorMaxValue(ExecState*, const Identifier&, const PropertySlot&);
static JSValue numberConstructorMinValue(ExecState*, const Identifier&, const PropertySlot&);
static JSValue numberConstructorNaNValue(ExecState*, JSValue, const Identifier&);
static JSValue numberConstructorNegInfinity(ExecState*, JSValue, const Identifier&);
static JSValue numberConstructorPosInfinity(ExecState*, JSValue, const Identifier&);
static JSValue numberConstructorMaxValue(ExecState*, JSValue, const Identifier&);
static JSValue numberConstructorMinValue(ExecState*, JSValue, const Identifier&);
} // namespace JSC
......@@ -73,27 +73,27 @@ bool NumberConstructor::getOwnPropertyDescriptor(ExecState* exec, const Identifi
return getStaticValueDescriptor<NumberConstructor, InternalFunction>(exec, ExecState::numberTable(exec), this, propertyName, descriptor);
}
static JSValue numberConstructorNaNValue(ExecState* exec, const Identifier&, const PropertySlot&)
static JSValue numberConstructorNaNValue(ExecState* exec, JSValue, const Identifier&)
{
return jsNaN(exec);
}
static JSValue numberConstructorNegInfinity(ExecState* exec, const Identifier&, const PropertySlot&)
static JSValue numberConstructorNegInfinity(ExecState* exec, JSValue, const Identifier&)
{
return jsNumber(exec, -Inf);
}
static JSValue numberConstructorPosInfinity(ExecState* exec, const Identifier&, const PropertySlot&)
static JSValue numberConstructorPosInfinity(ExecState* exec, JSValue, const Identifier&)
{
return jsNumber(exec, Inf);
}
static JSValue numberConstructorMaxValue(ExecState* exec, const Identifier&, const PropertySlot&)
static JSValue numberConstructorMaxValue(ExecState* exec, JSValue, const Identifier&)
{
return jsNumber(exec, 1.7976931348623157E+308);
}
static JSValue numberConstructorMinValue(ExecState* exec, const Identifier&, const PropertySlot&)
static JSValue numberConstructorMinValue(ExecState* exec, JSValue, const Identifier&)
{
return jsNumber(exec, 5E-324);
}
......
......@@ -26,19 +26,19 @@
namespace JSC {
JSValue PropertySlot::functionGetter(ExecState* exec, const Identifier&, const PropertySlot& slot)
JSValue PropertySlot::functionGetter(ExecState* exec) const
{
// Prevent getter functions from observing execution if an exception is pending.
if (exec->hadException())
return exec->exception();
CallData callData;
CallType callType = slot.m_data.getterFunc->getCallData(callData);
CallType callType = m_data.getterFunc->getCallData(callData);
if (callType == CallTypeHost)
return callData.native.function(exec, slot.m_data.getterFunc, slot.thisValue(), exec->emptyList());
return callData.native.function(exec, m_data.getterFunc, thisValue(), exec->emptyList());
ASSERT(callType == CallTypeJS);
// FIXME: Can this be done more efficiently using the callData?
return asFunction(slot.m_data.getterFunc)->call(exec, slot.thisValue(), exec->emptyList());
return asFunction(m_data.getterFunc)->call(exec, thisValue(), exec->emptyList());
}
} // namespace JSC
......@@ -35,6 +35,7 @@ namespace JSC {
#define JSC_VALUE_SLOT_MARKER 0
#define JSC_REGISTER_SLOT_MARKER reinterpret_cast<GetValueFunc>(1)
#define INDEX_GETTER_MARKER reinterpret_cast<GetValueFunc>(2)
#define GETTER_FUNCTION_MARKER reinterpret_cast<GetValueFunc>(3)
class PropertySlot {
public:
......@@ -52,7 +53,7 @@ namespace JSC {
clearValue();
}
typedef JSValue (*GetValueFunc)(ExecState*, const Identifier&, const PropertySlot&);
typedef JSValue (*GetValueFunc)(ExecState*, JSValue slotBase, const Identifier&);
typedef JSValue (*GetIndexValueFunc)(ExecState*, JSValue slotBase, unsigned);
JSValue getValue(ExecState* exec, const Identifier& propertyName) const
......@@ -63,7 +64,9 @@ namespace JSC {
return (*m_data.registerSlot).jsValue();
if (m_getValue == INDEX_GETTER_MARKER)
return m_getIndexValue(exec, slotBase(), index());
return m_getValue(exec, propertyName, *this);
if (m_getValue == GETTER_FUNCTION_MARKER)
return functionGetter(exec);
return m_getValue(exec, slotBase(), propertyName);
}
JSValue getValue(ExecState* exec, unsigned propertyName) const
......@@ -74,7 +77,9 @@ namespace JSC {
return (*m_data.registerSlot).jsValue();
if (m_getValue == INDEX_GETTER_MARKER)
return m_getIndexValue(exec, m_slotBase, m_data.index);
return m_getValue(exec, Identifier::from(exec, propertyName), *this);
if (m_getValue == GETTER_FUNCTION_MARKER)
return functionGetter(exec);
return m_getValue(exec, slotBase(), Identifier::from(exec, propertyName));
}
bool isGetter() const { return m_isGetter; }
......@@ -156,7 +161,7 @@ namespace JSC {
{
ASSERT(getterFunc);
m_thisValue = m_slotBase;
m_getValue = functionGetter;
m_getValue = GETTER_FUNCTION_MARKER;
m_data.getterFunc = getterFunc;
m_isGetter = true;
}
......@@ -164,7 +169,7 @@ namespace JSC {
void setCacheableGetterSlot(JSValue slotBase, JSObject* getterFunc, unsigned offset)
{
ASSERT(getterFunc);
m_getValue = functionGetter;
m_getValue = GETTER_FUNCTION_MARKER;
m_thisValue = m_slotBase;
m_slotBase = slotBase;
m_data.getterFunc = getterFunc;
......@@ -217,7 +222,7 @@ namespace JSC {
JSValue thisValue() const { return m_thisValue; }
private:
static JSValue functionGetter(ExecState*, const Identifier&, const PropertySlot&);
JSValue functionGetter(ExecState*) const;
GetValueFunc m_getValue;
GetIndexValueFunc m_getIndexValue;
......
......@@ -35,21 +35,21 @@
namespace JSC {
static JSValue regExpConstructorInput(ExecState*, const Identifier&, const PropertySlot&);
static JSValue regExpConstructorMultiline(ExecState*, const Identifier&, const PropertySlot&);
static JSValue regExpConstructorLastMatch(ExecState*, const Identifier&, const PropertySlot&);
static JSValue regExpConstructorLastParen(ExecState*, const Identifier&, const PropertySlot&);
static JSValue regExpConstructorLeftContext(ExecState*, const Identifier&, const PropertySlot&);
static JSValue regExpConstructorRightContext(ExecState*, const Identifier&, const PropertySlot&);
static JSValue regExpConstructorDollar1(ExecState*, const Identifier&, const PropertySlot&);
static JSValue regExpConstructorDollar2(ExecState*, const Identifier&, const PropertySlot&);
static JSValue regExpConstructorDollar3(ExecState*, const Identifier&, const PropertySlot&);
static JSValue regExpConstructorDollar4(ExecState*, const Identifier&, const PropertySlot&);
static JSValue regExpConstructorDollar5(ExecState*, const Identifier&, const PropertySlot&);
static JSValue regExpConstructorDollar6(ExecState*, const Identifier&, const PropertySlot&);
static JSValue regExpConstructorDollar7(ExecState*, const Identifier&, const PropertySlot&);
static JSValue regExpConstructorDollar8(ExecState*, const Identifier&, const PropertySlot&);
static JSValue regExpConstructorDollar9(ExecState*, const Identifier&, const PropertySlot&);
static JSValue regExpConstructorInput(ExecState*, JSValue, const Identifier&);
static JSValue regExpConstructorMultiline(ExecState*, JSValue, const Identifier&);
static JSValue regExpConstructorLastMatch(ExecState*, JSValue, const Identifier&);
static JSValue regExpConstructorLastParen(ExecState*, JSValue, const Identifier&);
static JSValue regExpConstructorLeftContext(ExecState*, JSValue, const Identifier&);
static JSValue regExpConstructorRightContext(ExecState*, JSValue, const Identifier&);
static JSValue regExpConstructorDollar1(ExecState*, JSValue, const Identifier&);
static JSValue regExpConstructorDollar2(ExecState*, JSValue, const Identifier&);
static JSValue regExpConstructorDollar3(ExecState*, JSValue, const Identifier&);
static JSValue regExpConstructorDollar4(ExecState*, JSValue, const Identifier&);
static JSValue regExpConstructorDollar5(ExecState*, JSValue, const Identifier&);
static JSValue regExpConstructorDollar6(ExecState*, JSValue, const Identifier&);
static JSValue regExpConstructorDollar7(ExecState*, JSValue, const Identifier&);
static JSValue regExpConstructorDollar8(ExecState*, JSValue, const Identifier&);
static JSValue regExpConstructorDollar9(ExecState*, JSValue, const Identifier&);
static void setRegExpConstructorInput(ExecState*, JSObject*, JSValue);
static void setRegExpConstructorMultiline(ExecState*, JSObject*, JSValue);
......@@ -195,79 +195,79 @@ bool RegExpConstructor::getOwnPropertyDescriptor(ExecState* exec, const Identifi
return getStaticValueDescriptor<RegExpConstructor, InternalFunction>(exec, ExecState::regExpConstructorTable(exec), this, propertyName, descriptor);
}
JSValue regExpConstructorDollar1(ExecState* exec, const Identifier&, const PropertySlot& slot)
JSValue regExpConstructorDollar1(ExecState* exec, JSValue slotBase, const Identifier&)
{
return asRegExpConstructor(slot.slotBase())->getBackref(exec, 1);
return asRegExpConstructor(slotBase)->getBackref(exec, 1);
}
JSValue regExpConstructorDollar2(ExecState* exec, const Identifier&, const PropertySlot& slot)
JSValue regExpConstructorDollar2(ExecState* exec, JSValue slotBase, const Identifier&)
{
return asRegExpConstructor(slot.slotBase())->getBackref(exec, 2);
return asRegExpConstructor(slotBase)->getBackref(exec, 2);
}
JSValue regExpConstructorDollar3(ExecState* exec, const Identifier&, const PropertySlot& slot)
JSValue regExpConstructorDollar3(ExecState* exec, JSValue slotBase, const Identifier&)
{
return asRegExpConstructor(slot.slotBase())->getBackref(exec, 3);
return asRegExpConstructor(slotBase)->getBackref(exec, 3);
}
JSValue regExpConstructorDollar4(ExecState* exec, const Identifier&, const PropertySlot& slot)
JSValue regExpConstructorDollar4(ExecState* exec, JSValue slotBase, const Identifier&)
{
return asRegExpConstructor(slot.slotBase())->getBackref(exec, 4);
return asRegExpConstructor(slotBase)->getBackref(exec, 4);
}
JSValue regExpConstructorDollar5(ExecState* exec, const Identifier&, const PropertySlot& slot)
JSValue regExpConstructorDollar5(ExecState* exec, JSValue slotBase, const Identifier&)
{
return asRegExpConstructor(slot.slotBase())->getBackref(exec, 5);
return asRegExpConstructor(slotBase)->getBackref(exec, 5);
}
JSValue regExpConstructorDollar6(ExecState* exec, const Identifier&, const PropertySlot& slot)
JSValue regExpConstructorDollar6(ExecState* exec, JSValue slotBase, const Identifier&)
{
return asRegExpConstructor(slot.slotBase())->getBackref(exec, 6);
return asRegExpConstructor(slotBase)->getBackref(exec, 6);
}
JSValue regExpConstructorDollar7(ExecState* exec, const Identifier&, const PropertySlot& slot)
JSValue regExpConstructorDollar7(ExecState* exec, JSValue slotBase, const Identifier&)
{
return asRegExpConstructor(slot.slotBase())->getBackref(exec, 7);
return asRegExpConstructor(slotBase)->getBackref(exec, 7);
}
JSValue regExpConstructorDollar8(ExecState* exec, const Identifier&, const PropertySlot& slot)
JSValue regExpConstructorDollar8(ExecState* exec, JSValue slotBase, const Identifier&)
{
return asRegExpConstructor(slot.slotBase())->getBackref(exec, 8);
return asRegExpConstructor(slotBase)->getBackref(exec, 8);
}
JSValue regExpConstructorDollar9(ExecState* exec, const Identifier&, const PropertySlot& slot)
JSValue regExpConstructorDollar9(ExecState* exec, JSValue slotBase, const Identifier&)
{
return asRegExpConstructor(slot.slotBase())->getBackref(exec, 9);
return asRegExpConstructor(slotBase)->getBackref(exec, 9);
}
JSValue regExpConstructorInput(ExecState* exec, const Identifier&, const PropertySlot& slot)
JSValue regExpConstructorInput(ExecState* exec, JSValue slotBase, const Identifier&)
{
return jsString(exec, asRegExpConstructor(slot.slotBase())->input());
return jsString(exec, asRegExpConstructor(slotBase)->input());
}
JSValue regExpConstructorMultiline(ExecState*, const Identifier&, const PropertySlot& slot)
JSValue regExpConstructorMultiline(ExecState*, JSValue slotBase, const Identifier&)
{
return jsBoolean(asRegExpConstructor(slot.slotBase())->multiline());
return jsBoolean(asRegExpConstructor(slotBase)->multiline());
}
JSValue regExpConstructorLastMatch(ExecState* exec, const Identifier&, const PropertySlot& slot)
JSValue regExpConstructorLastMatch(ExecState* exec, JSValue slotBase, const Identifier&)
{
return asRegExpConstructor(slot.slotBase())->getBackref(exec, 0);
return asRegExpConstructor(slotBase)->getBackref(exec, 0);
}
JSValue regExpConstructorLastParen(ExecState* exec, const Identifier&, const PropertySlot& slot)
JSValue regExpConstructorLastParen(ExecState* exec, JSValue slotBase, const Identifier&)
{
return asRegExpConstructor(slot.slotBase())->getLastParen(exec);
return asRegExpConstructor(slotBase)->getLastParen(exec);
}
JSValue regExpConstructorLeftContext(ExecState* exec, const Identifier&, const PropertySlot& slot)
JSValue regExpConstructorLeftContext(ExecState* exec, JSValue slotBase, const Identifier&)
{
return asRegExpConstructor(slot.slotBase())->getLeftContext(exec);
return asRegExpConstructor(slotBase)->getLeftContext(exec);
}
JSValue regExpConstructorRightContext(ExecState* exec, const Identifier&, const PropertySlot& slot)
JSValue regExpConstructorRightContext(ExecState* exec, JSValue slotBase, const Identifier&)
{
return asRegExpConstructor(slot.slotBase())->getRightContext(exec);
return asRegExpConstructor(slotBase)->getRightContext(exec);
}
void RegExpConstructor::put(ExecState* exec, const Identifier& propertyName, JSValue value, PutPropertySlot& slot)
......
......@@ -30,11 +30,11 @@
namespace JSC {
static JSValue regExpObjectGlobal(ExecState*, const Identifier&, const PropertySlot&);
static JSValue regExpObjectIgnoreCase(ExecState*, const Identifier&, const PropertySlot&);
static JSValue regExpObjectMultiline(ExecState*, const Identifier&, const PropertySlot&);
static JSValue regExpObjectSource(ExecState*, const Identifier&, const PropertySlot&);
static JSValue regExpObjectLastIndex(ExecState*, const Identifier&, const PropertySlot&);
static JSValue regExpObjectGlobal(ExecState*, JSValue, const Identifier&);
static JSValue regExpObjectIgnoreCase(ExecState*, JSValue, const Identifier&);
static JSValue regExpObjectMultiline(ExecState*, JSValue, const Identifier&);
static JSValue regExpObjectSource(ExecState*, JSValue, const Identifier&);
static JSValue regExpObjectLastIndex(ExecState*, JSValue, const Identifier&);
static void setRegExpObjectLastIndex(ExecState*, JSObject*, JSValue);
} // namespace JSC
......@@ -77,29 +77,29 @@ bool RegExpObject::getOwnPropertyDescriptor(ExecState* exec, const Identifier& p
return getStaticValueDescriptor<RegExpObject, JSObject>(exec, ExecState::regExpTable(exec), this, propertyName, descriptor);
}
JSValue regExpObjectGlobal(ExecState*, const Identifier&, const PropertySlot& slot)
JSValue regExpObjectGlobal(ExecState*, JSValue slotBase, const Identifier&)
{
return jsBoolean(asRegExpObject(slot.slotBase())->regExp()->global());
return jsBoolean(asRegExpObject(slotBase)->regExp()->global());
}
JSValue regExpObjectIgnoreCase(ExecState*, const Identifier&, const PropertySlot& slot)
JSValue regExpObjectIgnoreCase(ExecState*, JSValue slotBase, const Identifier&)
{
return jsBoolean(asRegExpObject(slot.slotBase())->regExp()->ignoreCase());
return jsBoolean(asRegExpObject(slotBase)->regExp()->ignoreCase());
}
JSValue regExpObjectMultiline(ExecState*, const Identifier&, const PropertySlot& slot)
JSValue regExpObjectMultiline(ExecState*, JSValue slotBase, const Identifier&)
{
return jsBoolean(asRegExpObject(slot.slotBase())->regExp()->multiline());
return jsBoolean(asRegExpObject(slotBase)->regExp()->multiline());
}
JSValue regExpObjectSource(ExecState* exec, const Identifier&, const PropertySlot& slot)
JSValue regExpObjectSource(ExecState* exec, JSValue slotBase, const Identifier&)
{
return jsString(exec, asRegExpObject(slot.slotBase())->regExp()->pattern());
return jsString(exec, asRegExpObject(slotBase)->regExp()->pattern());
}
JSValue regExpObjectLastIndex(ExecState* exec, const Identifier&, const PropertySlot& slot)
JSValue regExpObjectLastIndex(ExecState* exec, JSValue slotBase, const Identifier&)
{
return jsNumber(exec, asRegExpObject(slot.slotBase())->lastIndex());
return jsNumber(exec, asRegExpObject(slotBase)->lastIndex());
}
void RegExpObject::put(ExecState* exec, const Identifier& propertyName, JSValue value, PutPropertySlot& slot)
......
2010-03-01 Oliver Hunt <oliver@apple.com>
Reviewed by Maciej Stachowiak.
Refactor named getter function signature to be in line with indexing getter signature
https://bugs.webkit.org/show_bug.cgi?id=35563
Fix method signature and update code as appropriate
* UserObjectImp.cpp:
(UserObjectImp::userObjectGetter):
* UserObjectImp.h:
2010-02-09 Alexey Proskuryakov <ap@apple.com>
Reviewed by Geoffrey Garen.
......
......@@ -112,9 +112,9 @@ void UserObjectImp::getOwnPropertyNames(ExecState *exec, PropertyNameArray& prop
JSObject::getOwnPropertyNames(exec, propertyNames, mode);
}
JSValue UserObjectImp::userObjectGetter(ExecState*, const Identifier& propertyName, const PropertySlot& slot)
JSValue UserObjectImp::userObjectGetter(ExecState*, JSValue slotBase, const Identifier& propertyName)
{
UserObjectImp *thisObj = static_cast<UserObjectImp *>(asObject(slot.slotBase()));
UserObjectImp *thisObj = static_cast<UserObjectImp *>(asObject(slotBase));
// getOwnPropertySlot should have guarded against a null fJSUserObject.
assert(thisObj->fJSUserObject);