, function(0)
{
vtbl = &static_vtbl;
- name = engine()->id_undefined;
+ name = ic->engine->id_undefined;
type = Type_FunctionObject;
needsActivation = false;
vtbl = &static_vtbl;
name = n;
- Scope s(engine());
+ Scope s(internalClass->engine);
ScopedValue protectThis(s, this);
type = Type_FunctionObject;
ReturnedValue FunctionObject::newInstance()
{
- Scope scope(engine());
+ Scope scope(internalClass->engine);
ScopedCallData callData(scope, 0);
return construct(callData);
}
bool FunctionObject::hasInstance(Managed *that, const ValueRef value)
{
- Scope scope(that->engine());
+ Scope scope(that->internalClass->engine);
ScopedFunctionObject f(scope, static_cast<FunctionObject *>(that));
ScopedObject v(scope, value);
ReturnedValue FunctionObject::construct(Managed *that, CallData *)
{
- ExecutionEngine *v4 = that->engine();
+ ExecutionEngine *v4 = that->internalClass->engine;
Scope scope(v4);
Scoped<FunctionObject> f(scope, that, Scoped<FunctionObject>::Cast);
ReturnedValue FunctionCtor::construct(Managed *that, CallData *callData)
{
FunctionCtor *f = static_cast<FunctionCtor *>(that);
- ExecutionContext *ctx = f->engine()->current;
+ ExecutionEngine *v4 = f->internalClass->engine;
+ ExecutionContext *ctx = v4->current;
QString arguments;
QString body;
if (callData->argc > 0) {
const bool parsed = parser.parseExpression();
if (!parsed)
- return f->engine()->current->throwSyntaxError(QLatin1String("Parse error"));
+ return v4->current->throwSyntaxError(QLatin1String("Parse error"));
using namespace QQmlJS::AST;
FunctionExpression *fe = QQmlJS::AST::cast<FunctionExpression *>(parser.rootNode());
- ExecutionEngine *v4 = f->engine();
if (!fe)
- return f->engine()->current->throwSyntaxError(QLatin1String("Parse error"));
+ return v4->current->throwSyntaxError(QLatin1String("Parse error"));
QQmlJS::V4IR::Module module(v4->debugger != 0);
ReturnedValue ScriptFunction::construct(Managed *that, CallData *callData)
{
- ExecutionEngine *v4 = that->engine();
- Scope scope(v4);
- if (scope.hasException())
+ ExecutionEngine *v4 = that->internalClass->engine;
+ if (v4->hasException)
return Encode::undefined();
+ Scope scope(v4);
Scoped<ScriptFunction> f(scope, static_cast<ScriptFunction *>(that));
InternalClass *ic = v4->objectClass;
ReturnedValue ScriptFunction::call(Managed *that, CallData *callData)
{
ScriptFunction *f = static_cast<ScriptFunction *>(that);
- ExecutionContext *context = f->engine()->current;
- Scope scope(context);
- if (scope.hasException())
+ ExecutionEngine *v4 = f->internalClass->engine;
+ if (v4->hasException)
return Encode::undefined();
+ ExecutionContext *context = v4->current;
+ Scope scope(context);
+
CallContext *ctx = context->newCallContext(f, callData);
if (!f->strictMode && !callData->thisObject.isObject()) {
if (callData->thisObject.isNullOrUndefined()) {
- ctx->callData->thisObject = f->engine()->globalObject->asReturnedValue();
+ ctx->callData->thisObject = v4->globalObject->asReturnedValue();
} else {
ctx->callData->thisObject = callData->thisObject.toObject(context)->asReturnedValue();
}
ReturnedValue SimpleScriptFunction::construct(Managed *that, CallData *callData)
{
- ExecutionEngine *v4 = that->engine();
- Scope scope(v4);
- if (scope.hasException())
+ ExecutionEngine *v4 = that->internalClass->engine;
+ if (v4->hasException)
return Encode::undefined();
+ Scope scope(v4);
Scoped<SimpleScriptFunction> f(scope, static_cast<SimpleScriptFunction *>(that));
ReturnedValue SimpleScriptFunction::call(Managed *that, CallData *callData)
{
- ExecutionEngine *v4 = that->engine();
- Scope scope(v4);
- if (scope.hasException())
+ ExecutionEngine *v4 = that->internalClass->engine;
+ if (v4->hasException)
return Encode::undefined();
+ Scope scope(v4);
+
Scoped<SimpleScriptFunction> f(scope, static_cast<SimpleScriptFunction *>(that));
void *stackSpace = alloca(requiredMemoryForExecutionContectSimple(f));
if (!f->strictMode && !callData->thisObject.isObject()) {
if (callData->thisObject.isNullOrUndefined()) {
- ctx->callData->thisObject = f->engine()->globalObject->asReturnedValue();
+ ctx->callData->thisObject = v4->globalObject->asReturnedValue();
} else {
ctx->callData->thisObject = callData->thisObject.toObject(context)->asReturnedValue();
}
ReturnedValue BuiltinFunction::construct(Managed *f, CallData *)
{
- return f->engine()->current->throwTypeError();
+ return f->internalClass->engine->current->throwTypeError();
}
ReturnedValue BuiltinFunction::call(Managed *that, CallData *callData)
{
BuiltinFunction *f = static_cast<BuiltinFunction *>(that);
- ExecutionEngine *v4 = f->engine();
- Scope scope(v4);
- if (scope.hasException())
+ ExecutionEngine *v4 = f->internalClass->engine;
+ if (v4->hasException)
return Encode::undefined();
+ Scope scope(v4);
+
ExecutionContext *context = v4->current;
SimpleCallContext ctx;
ReturnedValue IndexedBuiltinFunction::call(Managed *that, CallData *callData)
{
IndexedBuiltinFunction *f = static_cast<IndexedBuiltinFunction *>(that);
- ExecutionEngine *v4 = f->engine();
+ ExecutionEngine *v4 = f->internalClass->engine;
+ if (v4->hasException)
+ return Encode::undefined();
ExecutionContext *context = v4->current;
Scope scope(v4);
- if (scope.hasException())
- return Encode::undefined();
SimpleCallContext ctx;
ctx.initSimpleCallContext(f->scope->engine);