From bed14ea2680d121f0cd575d5fc1138bee1b7045a Mon Sep 17 00:00:00 2001 From: Lars Knoll Date: Thu, 14 Feb 2013 11:53:23 +0100 Subject: [PATCH] Remove another virtual and de-inline a call method Change-Id: Ia7cc0bf9f4024a65020fef75666ae13d3691bc54 Reviewed-by: Simon Hausmann --- src/v4/debugging.cpp | 4 ++-- src/v4/qv4functionobject.cpp | 5 +++++ src/v4/qv4functionobject.h | 8 +------- 3 files changed, 8 insertions(+), 9 deletions(-) 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 { -- 2.7.4