diff options
author | Lars Knoll <lars.knoll@digia.com> | 2012-10-17 13:38:59 +0200 |
---|---|---|
committer | Simon Hausmann <simon.hausmann@digia.com> | 2012-10-17 14:52:41 +0200 |
commit | 52a30a1e6f39e607747463303ec3bf7724736172 (patch) | |
tree | 0be50a92175c89fea35866aae3d1729f31ddc346 | |
parent | 649c318d399b66593c3c6afced83d3265c7c3a39 (diff) |
Fixed more calling conventions
Implemented a few stubs for qmljs_inplace_op_member
Change-Id: I542a535862339285db7ec0b547754453545a3dc0
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
-rw-r--r-- | qmljs_runtime.cpp | 135 | ||||
-rw-r--r-- | qmljs_runtime.h | 46 | ||||
-rw-r--r-- | qv4isel_masm.cpp | 8 |
3 files changed, 109 insertions, 80 deletions
diff --git a/qmljs_runtime.cpp b/qmljs_runtime.cpp index 65ca1ae04c..0c4082f899 100644 --- a/qmljs_runtime.cpp +++ b/qmljs_runtime.cpp @@ -615,19 +615,19 @@ void __qmljs_inplace_ushr_name(const Value value, String *name, Context *ctx) ctx->throwReferenceError(Value::fromString(name)); } -void __qmljs_inplace_bit_and_element(Context *ctx, Value *base, Value *index, Value *value) +void __qmljs_inplace_bit_and_element(Value base, Value index, Value value, Context *ctx) { ctx->throwUnimplemented(QLatin1String(Q_FUNC_INFO)); } -void __qmljs_inplace_bit_or_element(Context *ctx, Value *base, Value *index, Value *value) +void __qmljs_inplace_bit_or_element(Value base, Value index, Value value, Context *ctx) { - Object *obj = base->toObject(ctx).objectValue(); + Object *obj = base.toObject(ctx).objectValue(); if (ArrayObject *a = obj->asArrayObject()) { - if (index->isNumber()) { - const quint32 idx = index->toUInt32(ctx); + if (index.isNumber()) { + const quint32 idx = index.toUInt32(ctx); Value v = a->value.at(idx); - v = __qmljs_bit_or(v, *value, ctx); + v = __qmljs_bit_or(v, value, ctx); a->value.assign(idx, v); return; } @@ -635,14 +635,14 @@ void __qmljs_inplace_bit_or_element(Context *ctx, Value *base, Value *index, Val ctx->throwUnimplemented(QLatin1String(Q_FUNC_INFO)); } -void __qmljs_inplace_bit_xor_element(Context *ctx, Value *base, Value *index, Value *value) +void __qmljs_inplace_bit_xor_element(Value base, Value index, Value value, Context *ctx) { - Object *obj = base->toObject(ctx).objectValue(); + Object *obj = base.toObject(ctx).objectValue(); if (ArrayObject *a = obj->asArrayObject()) { - if (index->isNumber()) { - const quint32 idx = index->toUInt32(ctx); + if (index.isNumber()) { + const quint32 idx = index.toUInt32(ctx); Value v = a->value.at(idx); - v = __qmljs_bit_xor(v, *value, ctx); + v = __qmljs_bit_xor(v, value, ctx); a->value.assign(idx, v); return; } @@ -650,14 +650,14 @@ void __qmljs_inplace_bit_xor_element(Context *ctx, Value *base, Value *index, Va ctx->throwUnimplemented(QLatin1String(Q_FUNC_INFO)); } -void __qmljs_inplace_add_element(Context *ctx, Value *base, Value *index, Value *value) +void __qmljs_inplace_add_element(Value base, Value index, Value value, Context *ctx) { - Object *obj = base->toObject(ctx).objectValue(); + Object *obj = base.toObject(ctx).objectValue(); if (ArrayObject *a = obj->asArrayObject()) { - if (index->isNumber()) { - const quint32 idx = index->toUInt32(ctx); + if (index.isNumber()) { + const quint32 idx = index.toUInt32(ctx); Value v = a->value.at(idx); - v = __qmljs_add(v, *value, ctx); + v = __qmljs_add(v, value, ctx); a->value.assign(idx, v); return; } @@ -665,14 +665,14 @@ void __qmljs_inplace_add_element(Context *ctx, Value *base, Value *index, Value ctx->throwUnimplemented(QLatin1String(Q_FUNC_INFO)); } -void __qmljs_inplace_sub_element(Context *ctx, Value *base, Value *index, Value *value) +void __qmljs_inplace_sub_element(Value base, Value index, Value value, Context *ctx) { - Object *obj = base->toObject(ctx).objectValue(); + Object *obj = base.toObject(ctx).objectValue(); if (ArrayObject *a = obj->asArrayObject()) { - if (index->isNumber()) { - const quint32 idx = index->toUInt32(ctx); + if (index.isNumber()) { + const quint32 idx = index.toUInt32(ctx); Value v = a->value.at(idx); - v = __qmljs_sub(v, *value, ctx); + v = __qmljs_sub(v, value, ctx); a->value.assign(idx, v); return; } @@ -680,93 +680,122 @@ void __qmljs_inplace_sub_element(Context *ctx, Value *base, Value *index, Value ctx->throwUnimplemented(QLatin1String(Q_FUNC_INFO)); } -void __qmljs_inplace_mul_element(Context *ctx, Value *base, Value *index, Value *value) +void __qmljs_inplace_mul_element(Value base, Value index, Value value, Context *ctx) { ctx->throwUnimplemented(QLatin1String(Q_FUNC_INFO)); } -void __qmljs_inplace_div_element(Context *ctx, Value *base, Value *index, Value *value) +void __qmljs_inplace_div_element(Value base, Value index, Value value, Context *ctx) { ctx->throwUnimplemented(QLatin1String(Q_FUNC_INFO)); } -void __qmljs_inplace_mod_element(Context *ctx, Value *base, Value *index, Value *value) +void __qmljs_inplace_mod_element(Value base, Value index, Value value, Context *ctx) { ctx->throwUnimplemented(QLatin1String(Q_FUNC_INFO)); } -void __qmljs_inplace_shl_element(Context *ctx, Value *base, Value *index, Value *value) +void __qmljs_inplace_shl_element(Value base, Value index, Value value, Context *ctx) { ctx->throwUnimplemented(QLatin1String(Q_FUNC_INFO)); } -void __qmljs_inplace_shr_element(Context *ctx, Value *base, Value *index, Value *value) +void __qmljs_inplace_shr_element(Value base, Value index, Value value, Context *ctx) { ctx->throwUnimplemented(QLatin1String(Q_FUNC_INFO)); } -void __qmljs_inplace_ushr_element(Context *ctx, Value *base, Value *index, Value *value) +void __qmljs_inplace_ushr_element(Value base, Value index, Value value, Context *ctx) { ctx->throwUnimplemented(QLatin1String(Q_FUNC_INFO)); } -void __qmljs_inplace_bit_and_member(Context *ctx, Value *base, String *name, Value *value) +void __qmljs_inplace_bit_and_member(Value value, Value base, String *name, Context *ctx) { - ctx->throwUnimplemented(QLatin1String(Q_FUNC_INFO)); + Object *o = base.objectValue(); + Value prop = o->getProperty(ctx, name); + prop = __qmljs_bit_and(prop, value, ctx); + o->setProperty(ctx, name, prop); } -void __qmljs_inplace_bit_or_member(Context *ctx, Value *base, String *name, Value *value) +void __qmljs_inplace_bit_or_member(Value value, Value base, String *name, Context *ctx) { - ctx->throwUnimplemented(QLatin1String(Q_FUNC_INFO)); + Object *o = base.objectValue(); + Value prop = o->getProperty(ctx, name); + prop = __qmljs_bit_or(prop, value, ctx); + o->setProperty(ctx, name, prop); } -void __qmljs_inplace_bit_xor_member(Context *ctx, Value *base, String *name, Value *value) +void __qmljs_inplace_bit_xor_member(Value value, Value base, String *name, Context *ctx) { - ctx->throwUnimplemented(QLatin1String(Q_FUNC_INFO)); + Object *o = base.objectValue(); + Value prop = o->getProperty(ctx, name); + prop = __qmljs_bit_xor(prop, value, ctx); + o->setProperty(ctx, name, prop); } -void __qmljs_inplace_add_member(Context *ctx, Value *base, String *name, Value *value) +void __qmljs_inplace_add_member(Value value, Value base, String *name, Context *ctx) { - Value prop = base->objectValue()->getProperty(ctx, name); - prop = __qmljs_add(prop, *value, ctx); - base->objectValue()->setProperty(ctx, name, prop); + Object *o = base.objectValue(); + Value prop = o->getProperty(ctx, name); + prop = __qmljs_add(prop, value, ctx); + o->setProperty(ctx, name, prop); } -void __qmljs_inplace_sub_member(Context *ctx, Value *base, String *name, Value *value) +void __qmljs_inplace_sub_member(Value value, Value base, String *name, Context *ctx) { - Value prop = base->objectValue()->getProperty(ctx, name); - prop = __qmljs_sub(prop, *value, ctx); - base->objectValue()->setProperty(ctx, name, prop); + Object *o = base.objectValue(); + Value prop = o->getProperty(ctx, name); + prop = __qmljs_sub(prop, value, ctx); + o->setProperty(ctx, name, prop); } -void __qmljs_inplace_mul_member(Context *ctx, Value *base, String *name, Value *value) +void __qmljs_inplace_mul_member(Value value, Value base, String *name, Context *ctx) { - ctx->throwUnimplemented(QLatin1String(Q_FUNC_INFO)); + Object *o = base.objectValue(); + Value prop = o->getProperty(ctx, name); + prop = __qmljs_mul(prop, value, ctx); + o->setProperty(ctx, name, prop); } -void __qmljs_inplace_div_member(Context *ctx, Value *base, String *name, Value *value) +void __qmljs_inplace_div_member(Value value, Value base, String *name, Context *ctx) { - ctx->throwUnimplemented(QLatin1String(Q_FUNC_INFO)); + Object *o = base.objectValue(); + Value prop = o->getProperty(ctx, name); + prop = __qmljs_div(prop, value, ctx); + o->setProperty(ctx, name, prop); } -void __qmljs_inplace_mod_member(Context *ctx, Value *base, String *name, Value *value) +void __qmljs_inplace_mod_member(Value value, Value base, String *name, Context *ctx) { - ctx->throwUnimplemented(QLatin1String(Q_FUNC_INFO)); + Object *o = base.objectValue(); + Value prop = o->getProperty(ctx, name); + prop = __qmljs_mod(prop, value, ctx); + o->setProperty(ctx, name, prop); } -void __qmljs_inplace_shl_member(Context *ctx, Value *base, String *name, Value *value) +void __qmljs_inplace_shl_member(Value value, Value base, String *name, Context *ctx) { - ctx->throwUnimplemented(QLatin1String(Q_FUNC_INFO)); + Object *o = base.objectValue(); + Value prop = o->getProperty(ctx, name); + prop = __qmljs_shl(prop, value, ctx); + o->setProperty(ctx, name, prop); } -void __qmljs_inplace_shr_member(Context *ctx, Value *base, String *name, Value *value) +void __qmljs_inplace_shr_member(Value value, Value base, String *name, Context *ctx) { - ctx->throwUnimplemented(QLatin1String(Q_FUNC_INFO)); + Object *o = base.objectValue(); + Value prop = o->getProperty(ctx, name); + prop = __qmljs_shr(prop, value, ctx); + o->setProperty(ctx, name, prop); } -void __qmljs_inplace_ushr_member(Context *ctx, Value *base, String *name, Value *value) +void __qmljs_inplace_ushr_member(Value value, Value base, String *name, Context *ctx) { - ctx->throwUnimplemented(QLatin1String(Q_FUNC_INFO)); + Object *o = base.objectValue(); + Value prop = o->getProperty(ctx, name); + prop = __qmljs_ushr(prop, value, ctx); + o->setProperty(ctx, name, prop); } String *__qmljs_string_from_utf8(Context *ctx, const char *s) diff --git a/qmljs_runtime.h b/qmljs_runtime.h index f1767a7c59..10f52e6a77 100644 --- a/qmljs_runtime.h +++ b/qmljs_runtime.h @@ -236,29 +236,29 @@ void __qmljs_inplace_shl_name(const Value value, String *name, Context *ctx); void __qmljs_inplace_shr_name(const Value value, String *name, Context *ctx); void __qmljs_inplace_ushr_name(const Value value, String *name, Context *ctx); -void __qmljs_inplace_bit_and_element(Context *ctx, Value *base, Value *index, Value *value); -void __qmljs_inplace_bit_or_element(Context *ctx, Value *base, Value *index, Value *value); -void __qmljs_inplace_bit_xor_element(Context *ctx, Value *base, Value *index, Value *value); -void __qmljs_inplace_add_element(Context *ctx, Value *base, Value *index, Value *value); -void __qmljs_inplace_sub_element(Context *ctx, Value *base, Value *index, Value *value); -void __qmljs_inplace_mul_element(Context *ctx, Value *base, Value *index, Value *value); -void __qmljs_inplace_div_element(Context *ctx, Value *base, Value *index, Value *value); -void __qmljs_inplace_mod_element(Context *ctx, Value *base, Value *index, Value *value); -void __qmljs_inplace_shl_element(Context *ctx, Value *base, Value *index, Value *value); -void __qmljs_inplace_shr_element(Context *ctx, Value *base, Value *index, Value *value); -void __qmljs_inplace_ushr_element(Context *ctx, Value *base, Value *index, Value *value); - -void __qmljs_inplace_bit_and_member(Context *ctx, Value *base, String *name, Value *value); -void __qmljs_inplace_bit_or_member(Context *ctx, Value *base, String *name, Value *value); -void __qmljs_inplace_bit_xor_member(Context *ctx, Value *base, String *name, Value *value); -void __qmljs_inplace_add_member(Context *ctx, Value *base, String *name, Value *value); -void __qmljs_inplace_sub_member(Context *ctx, Value *base, String *name, Value *value); -void __qmljs_inplace_mul_member(Context *ctx, Value *base, String *name, Value *value); -void __qmljs_inplace_div_member(Context *ctx, Value *base, String *name, Value *value); -void __qmljs_inplace_mod_member(Context *ctx, Value *base, String *name, Value *value); -void __qmljs_inplace_shl_member(Context *ctx, Value *base, String *name, Value *value); -void __qmljs_inplace_shr_member(Context *ctx, Value *base, String *name, Value *value); -void __qmljs_inplace_ushr_member(Context *ctx, Value *base, String *name, Value *value); +void __qmljs_inplace_bit_and_element(Value base, Value index, Value value, Context *ctx); +void __qmljs_inplace_bit_or_element(Value base, Value index, Value value, Context *ctx); +void __qmljs_inplace_bit_xor_element(Value base, Value index, Value value, Context *ctx); +void __qmljs_inplace_add_element(Value base, Value index, Value value, Context *ctx); +void __qmljs_inplace_sub_element(Value base, Value index, Value value, Context *ctx); +void __qmljs_inplace_mul_element(Value base, Value index, Value value, Context *ctx); +void __qmljs_inplace_div_element(Value base, Value index, Value value, Context *ctx); +void __qmljs_inplace_mod_element(Value base, Value index, Value value, Context *ctx); +void __qmljs_inplace_shl_element(Value base, Value index, Value value, Context *ctx); +void __qmljs_inplace_shr_element(Value base, Value index, Value value, Context *ctx); +void __qmljs_inplace_ushr_element(Value base, Value index, Value value, Context *ctx); + +void __qmljs_inplace_bit_and_member(Value value, Value base, String *name, Context *ctx); +void __qmljs_inplace_bit_or_member(Value value, Value base, String *name, Context *ctx); +void __qmljs_inplace_bit_xor_member(Value value, Value base, String *name, Context *ctx); +void __qmljs_inplace_add_member(Value value, Value base, String *name, Context *ctx); +void __qmljs_inplace_sub_member(Value value, Value base, String *name, Context *ctx); +void __qmljs_inplace_mul_member(Value value, Value base, String *name, Context *ctx); +void __qmljs_inplace_div_member(Value value, Value base, String *name, Context *ctx); +void __qmljs_inplace_mod_member(Value value, Value base, String *name, Context *ctx); +void __qmljs_inplace_shl_member(Value value, Value base, String *name, Context *ctx); +void __qmljs_inplace_shr_member(Value value, Value base, String *name, Context *ctx); +void __qmljs_inplace_ushr_member(Value value, Value base, String *name, Context *ctx); Bool __qmljs_cmp_gt(const Value left, const Value right, Context *ctx); Bool __qmljs_cmp_lt(const Value left, const Value right, Context *ctx); diff --git a/qv4isel_masm.cpp b/qv4isel_masm.cpp index 5cf6f5b21c..bd82f1ea0b 100644 --- a/qv4isel_masm.cpp +++ b/qv4isel_masm.cpp @@ -548,7 +548,7 @@ void InstructionSelection::visitMove(IR::Move *s) } } else if (IR::Subscript *ss = s->target->asSubscript()) { if (IR::Temp *t = s->source->asTemp()) { - void (*op)(Context *ctx, Value *base, Value *index, Value *value) = 0; + void (*op)(Value base, Value index, Value value, Context *ctx) = 0; const char *opName = 0; switch (s->op) { case IR::OpBitAnd: setOp(op, opName, __qmljs_inplace_bit_and_element); break; @@ -570,14 +570,14 @@ void InstructionSelection::visitMove(IR::Move *s) if (op) { IR::Temp* base = ss->base->asTemp(); IR::Temp* index = ss->index->asTemp(); - generateFunctionCallImp(opName, op, ContextRegister, base, index, t); + generateFunctionCallImp2(Void, opName, op, base, index, t, ContextRegister); checkExceptions(); } return; } } else if (IR::Member *m = s->target->asMember()) { if (IR::Temp *t = s->source->asTemp()) { - void (*op)(Context *ctx, Value *base, String *name, Value *value) = 0; + void (*op)(Value value, Value base, String *name, Context *ctx) = 0; const char *opName = 0; switch (s->op) { case IR::OpBitAnd: setOp(op, opName, __qmljs_inplace_bit_and_member); break; @@ -599,7 +599,7 @@ void InstructionSelection::visitMove(IR::Move *s) if (op) { IR::Temp* base = m->base->asTemp(); String* member = identifier(*m->name); - generateFunctionCallImp(opName, op, ContextRegister, base, member, t); + generateFunctionCallImp2(Void, opName, op, t, base, member, ContextRegister); checkExceptions(); } return; |