diff options
author | Lars Knoll <lars.knoll@qt.io> | 2017-05-19 12:39:52 +0200 |
---|---|---|
committer | Lars Knoll <lars.knoll@qt.io> | 2017-05-19 18:54:50 +0000 |
commit | 5bc38a50308665bdc185eb96dbcc9ba7948ab4e0 (patch) | |
tree | 4c4d5be3460a8c6a0550cd10c46330b5188e03d1 /src/qml/jsruntime/qv4functionobject.cpp | |
parent | cb70989c4fa2b8707ac59e25b3abe200ac7a5165 (diff) |
Get rid of the old way of defining builtin functions
The old calling convention used for builtin functions is very
inefficient. It was still being used in a few places. Clean
those up and convert them to the new and much more effiecient
calling convention.
Change-Id: I6b769c6185df7e9be1e80709330fc1ca868576c1
Reviewed-by: Robin Burchell <robin.burchell@crimson.no>
Diffstat (limited to 'src/qml/jsruntime/qv4functionobject.cpp')
-rw-r--r-- | src/qml/jsruntime/qv4functionobject.cpp | 36 |
1 files changed, 0 insertions, 36 deletions
diff --git a/src/qml/jsruntime/qv4functionobject.cpp b/src/qml/jsruntime/qv4functionobject.cpp index 4be14c09ba..bd6eb17bb4 100644 --- a/src/qml/jsruntime/qv4functionobject.cpp +++ b/src/qml/jsruntime/qv4functionobject.cpp @@ -460,42 +460,6 @@ InternalClass *ScriptFunction::classForConstructor() const } - -DEFINE_OBJECT_VTABLE(OldBuiltinFunction); - -void Heap::OldBuiltinFunction::init(QV4::ExecutionContext *scope, QV4::String *name, ReturnedValue (*code)(QV4::CallContext *)) -{ - Heap::FunctionObject::init(scope, name); - this->code = code; -} - -void OldBuiltinFunction::construct(const Managed *f, Scope &scope, CallData *) -{ - scope.result = static_cast<const OldBuiltinFunction *>(f)->internalClass()->engine->throwTypeError(); -} - -void OldBuiltinFunction::call(const Managed *that, Scope &scope, CallData *callData) -{ - const OldBuiltinFunction *f = static_cast<const OldBuiltinFunction *>(that); - ExecutionEngine *v4 = scope.engine; - if (v4->hasException) { - scope.result = Encode::undefined(); - return; - } - CHECK_STACK_LIMITS(v4, scope); - - ExecutionContextSaver ctxSaver(scope); - - CallContext::Data *ctx = v4->memoryManager->allocSimpleCallContext(v4); - ctx->strictMode = f->scope()->strictMode; // ### needed? scope or parent context? - ctx->callData = callData; - v4->pushContext(ctx); - Q_ASSERT(v4->current == ctx); - - scope.result = f->d()->code(static_cast<QV4::CallContext *>(v4->currentContext)); - v4->memoryManager->freeSimpleCallContext(); -} - DEFINE_OBJECT_VTABLE(BuiltinFunction); void Heap::BuiltinFunction::init(QV4::ExecutionContext *scope, QV4::String *name, void (*code)(const QV4::BuiltinFunction *, Scope &, CallData *)) |