summaryrefslogtreecommitdiff
path: root/Source/JavaScriptCore/runtime/JSFunction.cpp
diff options
context:
space:
mode:
authorSimon Hausmann <simon.hausmann@nokia.com>2012-05-18 14:03:11 +0200
committerSimon Hausmann <simon.hausmann@nokia.com>2012-05-18 14:03:11 +0200
commit8d473cf9743f1d30a16a27114e93bd5af5648d23 (patch)
treecdca40d0353886b3ca52f33a2d7b8f1c0011aafc /Source/JavaScriptCore/runtime/JSFunction.cpp
parent1b914638db989aaa98631a1c1e02c7b2d44805d8 (diff)
downloadqtwebkit-8d473cf9743f1d30a16a27114e93bd5af5648d23.tar.gz
Imported WebKit commit 1350e72f7345ced9da2bd9980deeeb5a8d62fab4 (http://svn.webkit.org/repository/webkit/trunk@117578)
Weekly snapshot
Diffstat (limited to 'Source/JavaScriptCore/runtime/JSFunction.cpp')
-rw-r--r--Source/JavaScriptCore/runtime/JSFunction.cpp28
1 files changed, 16 insertions, 12 deletions
diff --git a/Source/JavaScriptCore/runtime/JSFunction.cpp b/Source/JavaScriptCore/runtime/JSFunction.cpp
index 563325ab0..f2d9c81e2 100644
--- a/Source/JavaScriptCore/runtime/JSFunction.cpp
+++ b/Source/JavaScriptCore/runtime/JSFunction.cpp
@@ -59,7 +59,7 @@ bool JSFunction::isHostFunctionNonInline() const
return isHostFunction();
}
-JSFunction* JSFunction::create(ExecState* exec, JSGlobalObject* globalObject, int length, const Identifier& name, NativeFunction nativeFunction, Intrinsic intrinsic, NativeFunction nativeConstructor)
+JSFunction* JSFunction::create(ExecState* exec, JSGlobalObject* globalObject, int length, const UString& name, NativeFunction nativeFunction, Intrinsic intrinsic, NativeFunction nativeConstructor)
{
NativeExecutable* executable;
#if !ENABLE(JIT)
@@ -92,12 +92,12 @@ JSFunction::JSFunction(ExecState* exec, FunctionExecutable* executable, ScopeCha
{
}
-void JSFunction::finishCreation(ExecState* exec, NativeExecutable* executable, int length, const Identifier& name)
+void JSFunction::finishCreation(ExecState* exec, NativeExecutable* executable, int length, const UString& name)
{
Base::finishCreation(exec->globalData());
ASSERT(inherits(&s_info));
m_executable.set(exec->globalData(), this, executable);
- putDirect(exec->globalData(), exec->globalData().propertyNames->name, jsString(exec, name.isNull() ? "" : name.ustring()), DontDelete | ReadOnly | DontEnum);
+ putDirect(exec->globalData(), exec->globalData().propertyNames->name, jsString(exec, name.isNull() ? "" : name), DontDelete | ReadOnly | DontEnum);
putDirect(exec->globalData(), exec->propertyNames().length, jsNumber(length), DontDelete | ReadOnly | DontEnum);
}
@@ -183,14 +183,14 @@ CallType JSFunction::getCallData(JSCell* cell, CallData& callData)
return CallTypeJS;
}
-JSValue JSFunction::argumentsGetter(ExecState* exec, JSValue slotBase, const Identifier&)
+JSValue JSFunction::argumentsGetter(ExecState* exec, JSValue slotBase, PropertyName)
{
JSFunction* thisObj = jsCast<JSFunction*>(slotBase);
ASSERT(!thisObj->isHostFunction());
return exec->interpreter()->retrieveArgumentsFromVMCode(exec, thisObj);
}
-JSValue JSFunction::callerGetter(ExecState* exec, JSValue slotBase, const Identifier&)
+JSValue JSFunction::callerGetter(ExecState* exec, JSValue slotBase, PropertyName)
{
JSFunction* thisObj = jsCast<JSFunction*>(slotBase);
ASSERT(!thisObj->isHostFunction());
@@ -205,14 +205,14 @@ JSValue JSFunction::callerGetter(ExecState* exec, JSValue slotBase, const Identi
return throwTypeError(exec, "Function.caller used to retrieve strict caller");
}
-JSValue JSFunction::lengthGetter(ExecState*, JSValue slotBase, const Identifier&)
+JSValue JSFunction::lengthGetter(ExecState*, JSValue slotBase, PropertyName)
{
JSFunction* thisObj = jsCast<JSFunction*>(slotBase);
ASSERT(!thisObj->isHostFunction());
return jsNumber(thisObj->jsExecutable()->parameterCount());
}
-bool JSFunction::getOwnPropertySlot(JSCell* cell, ExecState* exec, const Identifier& propertyName, PropertySlot& slot)
+bool JSFunction::getOwnPropertySlot(JSCell* cell, ExecState* exec, PropertyName propertyName, PropertySlot& slot)
{
JSFunction* thisObject = jsCast<JSFunction*>(cell);
if (thisObject->isHostFunction())
@@ -267,7 +267,7 @@ bool JSFunction::getOwnPropertySlot(JSCell* cell, ExecState* exec, const Identif
return Base::getOwnPropertySlot(thisObject, exec, propertyName, slot);
}
-bool JSFunction::getOwnPropertyDescriptor(JSObject* object, ExecState* exec, const Identifier& propertyName, PropertyDescriptor& descriptor)
+bool JSFunction::getOwnPropertyDescriptor(JSObject* object, ExecState* exec, PropertyName propertyName, PropertyDescriptor& descriptor)
{
JSFunction* thisObject = jsCast<JSFunction*>(object);
if (thisObject->isHostFunction())
@@ -330,7 +330,7 @@ void JSFunction::getOwnPropertyNames(JSObject* object, ExecState* exec, Property
Base::getOwnPropertyNames(thisObject, exec, propertyNames, mode);
}
-void JSFunction::put(JSCell* cell, ExecState* exec, const Identifier& propertyName, JSValue value, PutPropertySlot& slot)
+void JSFunction::put(JSCell* cell, ExecState* exec, PropertyName propertyName, JSValue value, PutPropertySlot& slot)
{
JSFunction* thisObject = jsCast<JSFunction*>(cell);
if (thisObject->isHostFunction()) {
@@ -343,6 +343,10 @@ void JSFunction::put(JSCell* cell, ExecState* exec, const Identifier& propertyNa
PropertySlot slot;
thisObject->methodTable()->getOwnPropertySlot(thisObject, exec, propertyName, slot);
thisObject->m_cachedInheritorID.clear();
+ // Don't allow this to be cached, since a [[Put]] must clear m_cachedInheritorID.
+ PutPropertySlot dontCache;
+ Base::put(thisObject, exec, propertyName, value, dontCache);
+ return;
}
if (thisObject->jsExecutable()->isStrictMode() && (propertyName == exec->propertyNames().arguments || propertyName == exec->propertyNames().caller)) {
// This will trigger the property to be reified, if this is not already the case!
@@ -359,7 +363,7 @@ void JSFunction::put(JSCell* cell, ExecState* exec, const Identifier& propertyNa
Base::put(thisObject, exec, propertyName, value, slot);
}
-bool JSFunction::deleteProperty(JSCell* cell, ExecState* exec, const Identifier& propertyName)
+bool JSFunction::deleteProperty(JSCell* cell, ExecState* exec, PropertyName propertyName)
{
JSFunction* thisObject = jsCast<JSFunction*>(cell);
// For non-host functions, don't let these properties by deleted - except by DefineOwnProperty.
@@ -372,7 +376,7 @@ bool JSFunction::deleteProperty(JSCell* cell, ExecState* exec, const Identifier&
return Base::deleteProperty(thisObject, exec, propertyName);
}
-bool JSFunction::defineOwnProperty(JSObject* object, ExecState* exec, const Identifier& propertyName, PropertyDescriptor& descriptor, bool throwException)
+bool JSFunction::defineOwnProperty(JSObject* object, ExecState* exec, PropertyName propertyName, PropertyDescriptor& descriptor, bool throwException)
{
JSFunction* thisObject = jsCast<JSFunction*>(object);
if (thisObject->isHostFunction())
@@ -455,7 +459,7 @@ UString getCalculatedDisplayName(CallFrame* callFrame, JSObject* object)
return function->calculatedDisplayName(callFrame);
if (InternalFunction* function = jsDynamicCast<InternalFunction*>(object))
return function->calculatedDisplayName(callFrame);
- return callFrame->globalData().propertyNames->emptyIdentifier.ustring();
+ return "";
}
} // namespace JSC