object->objectValue->put(name, *value, /*flags*/ 0);
}
+void __qmljs_set_property_boolean(Context *ctx, Value *object, String *name, bool number)
+{
+ Value value;
+ __qmljs_init_boolean(ctx, &value, number);
+ object->objectValue->put(name, value, /*flag*/ 0);
+}
+
void __qmljs_set_property_number(Context *ctx, Value *object, String *name, double number)
{
Value value;
__qmljs_set_property(ctx, &ctx->activation, name, value);
}
+void __qmljs_set_activation_property_boolean(Context *ctx, String *name, bool value)
+{
+ __qmljs_set_property_boolean(ctx, &ctx->activation, name, value);
+}
+
void __qmljs_set_activation_property_number(Context *ctx, String *name, double value)
{
__qmljs_set_property_number(ctx, &ctx->activation, name, value);
void __qmljs_new_number_object(Context *ctx, Value *result, double n);
void __qmljs_new_string_object(Context *ctx, Value *result, String *string);
void __qmljs_set_property(Context *ctx, Value *object, String *name, Value *value);
+void __qmljs_set_property_boolean(Context *ctx, Value *object, String *name, bool value);
void __qmljs_set_property_number(Context *ctx, Value *object, String *name, double value);
void __qmljs_set_property_string(Context *ctx, Value *object, String *name, String *value);
void __qmljs_set_activation_property(Context *ctx, String *name, Value *value);
+void __qmljs_set_activation_property_boolean(Context *ctx, String *name, bool value);
void __qmljs_set_activation_property_number(Context *ctx, String *name, double value);
void __qmljs_set_activation_property_string(Context *ctx, String *name, String *value);
void __qmljs_get_property(Context *ctx, Value *result, Value *object, String *name);
if (IR::Const *c = s->source->asConst()) {
amd64_mov_reg_reg(_codePtr, AMD64_RDI, AMD64_R14, 8);
amd64_mov_reg_imm(_codePtr, AMD64_RSI, propertyName);
- amd64_mov_reg_imm(_codePtr, AMD64_RAX, &c->value);
- amd64_movsd_reg_regp(_codePtr, X86_XMM0, AMD64_RAX);
- amd64_call_code(_codePtr, __qmljs_set_activation_property_number);
+
+ switch (c->type) {
+ case IR::BoolType:
+ amd64_mov_reg_imm(_codePtr, AMD64_RDX, c->value != 0);
+ amd64_call_code(_codePtr, __qmljs_set_activation_property_boolean);
+ break;
+
+ case IR::NumberType:
+ amd64_mov_reg_imm(_codePtr, AMD64_RAX, &c->value);
+ amd64_movsd_reg_regp(_codePtr, X86_XMM0, AMD64_RAX);
+ amd64_call_code(_codePtr, __qmljs_set_activation_property_number);
+ break;
+
+ default:
+ Q_ASSERT(!"TODO");
+ }
return;
} else if (IR::String *str = s->source->asString()) {
amd64_mov_reg_reg(_codePtr, AMD64_RDI, AMD64_R14, 8);
} else if (IR::Const *c = s->source->asConst()) {
amd64_mov_reg_reg(_codePtr, AMD64_RDI, AMD64_R14, 8);
amd64_lea_membase(_codePtr, AMD64_RSI, AMD64_RSP, offset);
- amd64_mov_reg_imm(_codePtr, AMD64_RAX, &c->value);
- amd64_movsd_reg_regp(_codePtr, X86_XMM0, AMD64_RAX);
- amd64_call_code(_codePtr, __qmljs_init_number);
+
+ switch (c->type) {
+ case IR::BoolType:
+ amd64_mov_reg_imm(_codePtr, AMD64_RDX, c->value != 0);
+ amd64_call_code(_codePtr, __qmljs_init_boolean);
+ break;
+
+ case IR::NumberType:
+ amd64_mov_reg_imm(_codePtr, AMD64_RAX, &c->value);
+ amd64_movsd_reg_regp(_codePtr, X86_XMM0, AMD64_RAX);
+ amd64_call_code(_codePtr, __qmljs_init_number);
+ break;
+
+ default:
+ Q_ASSERT(!"TODO");
+ }
return;
} else if (IR::String *str = s->source->asString()) {
amd64_mov_reg_reg(_codePtr, AMD64_RDI, AMD64_R14, 8);