De-virtualize JSObject::defineOwnProperty
https://bugs.webkit.org/show_bug.cgi?id=71429
Reviewed by Geoffrey Garen.
Source/JavaScriptCore:
Added defineOwnProperty to the MethodTable, changed all the virtual
implementations of defineOwnProperty to static ones, and replaced
all call sites with corresponding lookups in the MethodTable.
* JavaScriptCore.exp:
* JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def:
* runtime/Arguments.cpp:
(JSC::Arguments::createStrictModeCallerIfNecessary):
(JSC::Arguments::createStrictModeCalleeIfNecessary):
* runtime/ClassInfo.h:
* runtime/JSCell.cpp:
(JSC::JSCell::defineOwnProperty):
* runtime/JSCell.h:
* runtime/JSObject.cpp:
(JSC::JSObject::defineOwnProperty):
* runtime/JSObject.h:
* runtime/ObjectConstructor.cpp:
(JSC::objectConstructorDefineProperty):
(JSC::defineProperties):
Source/WebCore:
No new tests.
Added defineOwnProperty to the MethodTable, changed all the virtual
implementations of defineOwnProperty to static ones, and replaced
all call sites with corresponding lookups in the MethodTable.
* bindings/js/JSDOMWindowCustom.cpp:
(WebCore::JSDOMWindow::defineOwnProperty):
* bindings/js/JSDOMWindowShell.cpp:
(WebCore::JSDOMWindowShell::defineOwnProperty):
* bindings/js/JSDOMWindowShell.h:
* bindings/scripts/CodeGeneratorJS.pm:
(GenerateHeader):
git-svn-id: http://svn.webkit.org/repository/webkit/trunk@99675 268f45cc-cd09-0410-ab3c-d52691b4dbfc
diff --git a/Source/JavaScriptCore/runtime/Arguments.cpp b/Source/JavaScriptCore/runtime/Arguments.cpp
index ede6a90..3370127 100644
--- a/Source/JavaScriptCore/runtime/Arguments.cpp
+++ b/Source/JavaScriptCore/runtime/Arguments.cpp
@@ -168,7 +168,7 @@
PropertyDescriptor descriptor;
JSValue thrower = createTypeErrorFunction(exec, "Unable to access caller of strict mode function");
descriptor.setAccessorDescriptor(thrower, thrower, DontEnum | DontDelete | Getter | Setter);
- defineOwnProperty(exec, exec->propertyNames().caller, descriptor, false);
+ methodTable()->defineOwnProperty(this, exec, exec->propertyNames().caller, descriptor, false);
}
void Arguments::createStrictModeCalleeIfNecessary(ExecState* exec)
@@ -180,7 +180,7 @@
PropertyDescriptor descriptor;
JSValue thrower = createTypeErrorFunction(exec, "Unable to access callee of strict mode function");
descriptor.setAccessorDescriptor(thrower, thrower, DontEnum | DontDelete | Getter | Setter);
- defineOwnProperty(exec, exec->propertyNames().callee, descriptor, false);
+ methodTable()->defineOwnProperty(this, exec, exec->propertyNames().callee, descriptor, false);
}
bool Arguments::getOwnPropertySlot(JSCell* cell, ExecState* exec, const Identifier& propertyName, PropertySlot& slot)