diff options
author | Lars Knoll <lars.knoll@qt.io> | 2017-08-16 16:30:15 +0200 |
---|---|---|
committer | Erik Verbruggen <erik.verbruggen@qt.io> | 2017-08-25 11:59:18 +0000 |
commit | 34280d266fe4bed0274b260c0091d50908acd087 (patch) | |
tree | c7a757587a33119c293b1c909d228f38f4179347 /src/qml/jsruntime/qv4runtime.cpp | |
parent | 69a1018c9737751c2cc7daae2c03882dc81bd104 (diff) |
Cleanup object construction instructions
Remove the unused Create/Construct instructions, and
rename the single remaining one to 'Construct'.
Change-Id: I10163a15681156f37e34d21a05d195d3c22adcff
Reviewed-by: Erik Verbruggen <erik.verbruggen@qt.io>
Diffstat (limited to 'src/qml/jsruntime/qv4runtime.cpp')
-rw-r--r-- | src/qml/jsruntime/qv4runtime.cpp | 59 |
1 files changed, 1 insertions, 58 deletions
diff --git a/src/qml/jsruntime/qv4runtime.cpp b/src/qml/jsruntime/qv4runtime.cpp index 8a630b451c..a1d480160f 100644 --- a/src/qml/jsruntime/qv4runtime.cpp +++ b/src/qml/jsruntime/qv4runtime.cpp @@ -1126,36 +1126,7 @@ ReturnedValue Runtime::method_callValue(ExecutionEngine *engine, const Value &fu } -ReturnedValue Runtime::method_constructGlobalLookup(ExecutionEngine *engine, uint index, CallData *callData) -{ - Scope scope(engine); - Q_ASSERT(callData->thisObject.isUndefined()); - - Lookup *l = engine->currentStackFrame->v4Function->compilationUnit->runtimeLookups + index; - ScopedObject f(scope, l->globalGetter(l, engine)); - if (f) - return f->construct(callData); - - return engine->throwTypeError(); -} - - -ReturnedValue Runtime::method_constructName(ExecutionEngine *engine, int nameIndex, CallData *callData) -{ - Scope scope(engine); - ScopedString name(scope, engine->currentStackFrame->v4Function->compilationUnit->runtimeStrings[nameIndex]); - ScopedValue func(scope, static_cast<ExecutionContext &>(engine->currentStackFrame->jsFrame->context).getProperty(name)); - if (scope.engine->hasException) - return Encode::undefined(); - - Object *f = func->as<Object>(); - if (!f) - return engine->throwTypeError(); - - return f->construct(callData); -} - -ReturnedValue Runtime::method_constructValue(ExecutionEngine *engine, const Value &func, CallData *callData) +ReturnedValue Runtime::method_construct(ExecutionEngine *engine, const Value &func, CallData *callData) { const Object *f = func.as<Object>(); if (!f) @@ -1164,34 +1135,6 @@ ReturnedValue Runtime::method_constructValue(ExecutionEngine *engine, const Valu return f->construct(callData); } -ReturnedValue Runtime::method_constructProperty(ExecutionEngine *engine, int nameIndex, CallData *callData) -{ - Scope scope(engine); - ScopedObject thisObject(scope, callData->thisObject.toObject(engine)); - ScopedString name(scope, engine->currentStackFrame->v4Function->compilationUnit->runtimeStrings[nameIndex]); - if (scope.engine->hasException) - return Encode::undefined(); - - ScopedObject f(scope, thisObject->get(name)); - if (f) - return f->construct(callData); - - return engine->throwTypeError(); -} - -ReturnedValue Runtime::method_constructPropertyLookup(ExecutionEngine *engine, uint index, CallData *callData) -{ - Lookup *l = engine->currentStackFrame->v4Function->compilationUnit->runtimeLookups + index; - Value v; - v = l->getter(l, engine, callData->thisObject); - Object *o = v.objectValue(); - if (Q_LIKELY(o)) - return o->construct(callData); - - return engine->throwTypeError(); -} - - void Runtime::method_throwException(ExecutionEngine *engine, const Value &value) { if (!value.isEmpty()) |