From: Lars Knoll Date: Thu, 14 Feb 2013 10:53:23 +0000 (+0100) Subject: Remove another virtual and de-inline a call method X-Git-Tag: upstream/5.2.1~669^2~659^2~249 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=bed14ea2680d121f0cd575d5fc1138bee1b7045a;p=platform%2Fupstream%2Fqtdeclarative.git Remove another virtual and de-inline a call method Change-Id: Ia7cc0bf9f4024a65020fef75666ae13d3691bc54 Reviewed-by: Simon Hausmann --- diff --git a/src/v4/debugging.cpp b/src/v4/debugging.cpp index 61ae0e6..80afe01 100644 --- a/src/v4/debugging.cpp +++ b/src/v4/debugging.cpp @@ -114,8 +114,8 @@ FunctionDebugInfo *Debugger::debugInfo(VM::FunctionObject *function) const if (!function) return 0; - if (VM::ScriptFunction *sf = function->asScriptFunction()) - return _functionInfo[irFunction(sf->function)]; + if (function->function) + return _functionInfo[irFunction(function->function)]; else return 0; } diff --git a/src/v4/qv4functionobject.cpp b/src/v4/qv4functionobject.cpp index 2476d5c..991695c 100644 --- a/src/v4/qv4functionobject.cpp +++ b/src/v4/qv4functionobject.cpp @@ -462,6 +462,11 @@ BuiltinFunction::BuiltinFunction(ExecutionContext *scope, String *name, Value (* isBuiltinFunction = true; } +Value BuiltinFunction::call(ExecutionContext *context, Value thisObject, Value *args, int argc) +{ + return code(context, thisObject, args, argc); +} + Value BuiltinFunction::construct(ExecutionContext *ctx, Value *, int) { ctx->throwTypeError(); diff --git a/src/v4/qv4functionobject.h b/src/v4/qv4functionobject.h index ae8bd53..9d55944 100644 --- a/src/v4/qv4functionobject.h +++ b/src/v4/qv4functionobject.h @@ -159,8 +159,6 @@ struct Q_V4_EXPORT FunctionObject: Object { virtual Value construct(ExecutionContext *context, Value *args, int argc); virtual Value call(ExecutionContext *, Value, Value *, int); - virtual struct ScriptFunction *asScriptFunction() { return 0; } - protected: static const ManagedVTable static_vtbl; static void markObjects(Managed *that); @@ -198,9 +196,7 @@ struct BuiltinFunction: FunctionObject { Value (*code)(ExecutionContext *parentContext, Value thisObject, Value *args, int argc); BuiltinFunction(ExecutionContext *scope, String *name, Value (*code)(ExecutionContext *, Value, Value *, int)); - virtual Value call(ExecutionContext *context, Value thisObject, Value *args, int argc) { - return code(context, thisObject, args, argc); - } + virtual Value call(ExecutionContext *context, Value thisObject, Value *args, int argc); virtual Value construct(ExecutionContext *ctx, Value *, int); }; @@ -210,8 +206,6 @@ struct ScriptFunction: FunctionObject { virtual Value call(ExecutionContext *context, Value thisObject, Value *args, int argc); virtual Value construct(ExecutionContext *context, Value *args, int argc); - - virtual ScriptFunction *asScriptFunction() { return this; } }; struct BoundFunction: FunctionObject {