Commit b7e13e4e authored by andersca's avatar andersca
Browse files

Reviewed by Geoff.

        Make RuntimeMethod's method list a pointer so that the object size doesn't
        grow beyond 32 bytes when we later will replace MethodList with a Vector.
        
        * bindings/runtime_method.cpp:
        (RuntimeMethod::RuntimeMethod):
        (RuntimeMethod::lengthGetter):
        (RuntimeMethod::callAsFunction):
        * bindings/runtime_method.h:



git-svn-id: http://svn.webkit.org/repository/webkit/trunk@23478 268f45cc-cd09-0410-ab3c-d52691b4dbfc
parent 164cf009
2007-06-12 Anders Carlsson <andersca@apple.com>
Reviewed by Geoff.
Make RuntimeMethod's method list a pointer so that the object size doesn't
grow beyond 32 bytes when we later will replace MethodList with a Vector.
* bindings/runtime_method.cpp:
(RuntimeMethod::RuntimeMethod):
(RuntimeMethod::lengthGetter):
(RuntimeMethod::callAsFunction):
* bindings/runtime_method.h:
2007-06-12 Anders Carlsson <andersca@apple.com>
 
Reviewed by Geoff.
......
......@@ -35,8 +35,8 @@ using namespace KJS;
RuntimeMethod::RuntimeMethod(ExecState *exec, const Identifier &ident, Bindings::MethodList &m)
: InternalFunctionImp (static_cast<FunctionPrototype*>(exec->lexicalInterpreter()->builtinFunctionPrototype()), ident)
, _methodList(new MethodList(m))
{
_methodList = m;
}
RuntimeMethod::~RuntimeMethod()
......@@ -53,7 +53,7 @@ JSValue *RuntimeMethod::lengthGetter(ExecState*, JSObject*, const Identifier&, c
// Java does.
// FIXME: a better solution might be to give the maximum number of parameters
// of any method
return jsNumber(thisObj->_methodList.methodAt(0)->numParameters());
return jsNumber(thisObj->_methodList->methodAt(0)->numParameters());
}
bool RuntimeMethod::getOwnPropertySlot(ExecState* exec, const Identifier& propertyName, PropertySlot &slot)
......@@ -68,7 +68,7 @@ bool RuntimeMethod::getOwnPropertySlot(ExecState* exec, const Identifier& proper
JSValue *RuntimeMethod::callAsFunction(ExecState *exec, JSObject *thisObj, const List &args)
{
if (_methodList.length() > 0) {
if (_methodList->length() > 0) {
RuntimeObjectImp *imp = 0;
if (thisObj->classInfo() == &KJS::RuntimeObjectImp::info) {
......@@ -86,7 +86,7 @@ JSValue *RuntimeMethod::callAsFunction(ExecState *exec, JSObject *thisObj, const
Instance *instance = imp->getInternalInstance();
instance->begin();
JSValue *aValue = instance->invokeMethod(exec, _methodList, args);
JSValue *aValue = instance->invokeMethod(exec, *_methodList, args);
instance->end();
return aValue;
}
......
......@@ -51,7 +51,7 @@ public:
private:
static JSValue *lengthGetter(ExecState *, JSObject *, const Identifier&, const PropertySlot&);
Bindings::MethodList _methodList;
OwnPtr<Bindings::MethodList> _methodList;
};
} // namespace KJS
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment