return 0;
}
-void Context::throwError(const Value &value)
+void Context::throwError(Value value)
{
result = value;
hasUncaughtException = true;
throwError(Value::fromObject(engine->newErrorObject(v)));
}
-void Context::throwReferenceError(const Value &value)
+void Context::throwReferenceError(Value value)
{
String *s = value.toString(this);
QString msg = s->toQString() + QStringLiteral(" is not defined");
}
}
-void Context::initConstructorContext(ExecutionEngine *e, const Value *object, FunctionObject *f, Value *args, unsigned argc)
+void Context::initConstructorContext(ExecutionEngine *e, Value *object, FunctionObject *f, Value *args, unsigned argc)
{
initCallContext(e, object, f, args, argc);
calledAsConstructor = true;
return __qmljs_throw_type_error(ctx); // ### throw syntax error
}
-Value __qmljs_add_helper(const Value left, const Value right, Context *ctx)
+Value __qmljs_add_helper(Value left, Value right, Context *ctx)
{
Value pleft = __qmljs_to_primitive(left, ctx, PREFERREDTYPE_HINT);
Value pright = __qmljs_to_primitive(right, ctx, PREFERREDTYPE_HINT);
return Value::fromDouble(x + y);
}
-Value __qmljs_instanceof(const Value left, const Value right, Context *ctx)
+Value __qmljs_instanceof(Value left, Value right, Context *ctx)
{
if (FunctionObject *function = right.asFunctionObject()) {
bool r = function->hasInstance(ctx, left);
return __qmljs_throw_type_error(ctx);
}
-Value __qmljs_in(const Value left, const Value right, Context *ctx)
+Value __qmljs_in(Value left, Value right, Context *ctx)
{
if (right.isObject()) {
Value s = __qmljs_to_string(left, ctx);
}
}
-void __qmljs_inplace_bit_and_name(const Value value, String *name, Context *ctx)
+void __qmljs_inplace_bit_and_name(Value value, String *name, Context *ctx)
{
if (Value *prop = ctx->lookupPropertyDescriptor(name))
*prop = __qmljs_bit_and(*prop, value, ctx);
ctx->throwReferenceError(Value::fromString(name));
}
-void __qmljs_inplace_bit_or_name(const Value value, String *name, Context *ctx)
+void __qmljs_inplace_bit_or_name(Value value, String *name, Context *ctx)
{
if (Value *prop = ctx->lookupPropertyDescriptor(name))
*prop = __qmljs_bit_or(*prop, value, ctx);
ctx->throwReferenceError(Value::fromString(name));
}
-void __qmljs_inplace_bit_xor_name(const Value value, String *name, Context *ctx)
+void __qmljs_inplace_bit_xor_name(Value value, String *name, Context *ctx)
{
if (Value *prop = ctx->lookupPropertyDescriptor(name))
*prop = __qmljs_bit_xor(*prop, value, ctx);
ctx->throwReferenceError(Value::fromString(name));
}
-void __qmljs_inplace_add_name(const Value value, String *name, Context *ctx)
+void __qmljs_inplace_add_name(Value value, String *name, Context *ctx)
{
if (Value *prop = ctx->lookupPropertyDescriptor(name))
*prop = __qmljs_add(*prop, value, ctx);
ctx->throwReferenceError(Value::fromString(name));
}
-void __qmljs_inplace_sub_name(const Value value, String *name, Context *ctx)
+void __qmljs_inplace_sub_name(Value value, String *name, Context *ctx)
{
if (Value *prop = ctx->lookupPropertyDescriptor(name))
*prop = __qmljs_sub(*prop, value, ctx);
ctx->throwReferenceError(Value::fromString(name));
}
-void __qmljs_inplace_mul_name(const Value value, String *name, Context *ctx)
+void __qmljs_inplace_mul_name(Value value, String *name, Context *ctx)
{
if (Value *prop = ctx->lookupPropertyDescriptor(name))
*prop = __qmljs_mul(*prop, value, ctx);
ctx->throwReferenceError(Value::fromString(name));
}
-void __qmljs_inplace_div_name(const Value value, String *name, Context *ctx)
+void __qmljs_inplace_div_name(Value value, String *name, Context *ctx)
{
if (Value *prop = ctx->lookupPropertyDescriptor(name))
*prop = __qmljs_div(*prop, value, ctx);
ctx->throwReferenceError(Value::fromString(name));
}
-void __qmljs_inplace_mod_name(const Value value, String *name, Context *ctx)
+void __qmljs_inplace_mod_name(Value value, String *name, Context *ctx)
{
if (Value *prop = ctx->lookupPropertyDescriptor(name))
*prop = __qmljs_mod(*prop, value, ctx);
ctx->throwReferenceError(Value::fromString(name));
}
-void __qmljs_inplace_shl_name(const Value value, String *name, Context *ctx)
+void __qmljs_inplace_shl_name(Value value, String *name, Context *ctx)
{
if (Value *prop = ctx->lookupPropertyDescriptor(name))
*prop = __qmljs_shl(*prop, value, ctx);
ctx->throwReferenceError(Value::fromString(name));
}
-void __qmljs_inplace_shr_name(const Value value, String *name, Context *ctx)
+void __qmljs_inplace_shr_name(Value value, String *name, Context *ctx)
{
if (Value *prop = ctx->lookupPropertyDescriptor(name))
*prop = __qmljs_shr(*prop, value, ctx);
ctx->throwReferenceError(Value::fromString(name));
}
-void __qmljs_inplace_ushr_name(const Value value, String *name, Context *ctx)
+void __qmljs_inplace_ushr_name(Value value, String *name, Context *ctx)
{
if (Value *prop = ctx->lookupPropertyDescriptor(name))
*prop = __qmljs_ushr(*prop, value, ctx);
return ctx->engine->newString(first->toQString() + second->toQString());
}
-Bool __qmljs_is_function(const Value value)
+Bool __qmljs_is_function(Value value)
{
return value.objectValue()->asFunctionObject() != 0;
}
-Value __qmljs_object_default_value(Context *ctx, const Value object, int typeHint)
+Value __qmljs_object_default_value(Context *ctx, Value object, int typeHint)
{
if (typeHint == PREFERREDTYPE_HINT) {
if (object.isDateObject())
return ctx->engine->globalObject;
}
-Value __qmljs_compare(const Value x, const Value y, Context *ctx, bool leftFirst)
+Value __qmljs_compare(Value x, Value y, Context *ctx, bool leftFirst)
{
Value px, py;
}
}
-uint __qmljs_equal(const Value x, const Value y, Context *ctx)
+uint __qmljs_equal(Value x, Value y, Context *ctx)
{
if (x.type() == y.type()) {
switch (x.type()) {
return result;
}
-Value __qmljs_call_property(Context *context, const Value base, String *name, Value *args, int argc)
+Value __qmljs_call_property(Context *context, Value base, String *name, Value *args, int argc)
{
Value baseObject;
Value thisObject;
return result;
}
-Value __qmljs_call_value(Context *context, const Value thisObject, const Value func, Value *args, int argc)
+Value __qmljs_call_value(Context *context, Value thisObject, Value func, Value *args, int argc)
{
Value result;
if (FunctionObject *f = func.asFunctionObject()) {
return __qmljs_construct_value(context, *func, args, argc);
}
-Value __qmljs_construct_value(Context *context, const Value func, Value *args, int argc)
+Value __qmljs_construct_value(Context *context, Value func, Value *args, int argc)
{
if (FunctionObject *f = func.asFunctionObject()) {
Context k;
return Value::undefinedValue();
}
-Value __qmljs_construct_property(Context *context, const Value base, String *name, Value *args, int argc)
+Value __qmljs_construct_property(Context *context, Value base, String *name, Value *args, int argc)
{
Value thisObject = base;
if (!thisObject.isObject())
// context
Value __qmljs_call_activation_property(Context *, String *name, Value *args, int argc);
-Value __qmljs_call_property(Context *context, const Value base, String *name, Value *args, int argc);
-Value __qmljs_call_value(Context *context, const Value thisObject, const Value func, Value *args, int argc);
+Value __qmljs_call_property(Context *context, Value base, String *name, Value *args, int argc);
+Value __qmljs_call_value(Context *context, Value thisObject, Value func, Value *args, int argc);
Value __qmljs_construct_activation_property(Context *, String *name, Value *args, int argc);
-Value __qmljs_construct_property(Context *context, const Value base, String *name, Value *args, int argc);
-Value __qmljs_construct_value(Context *context, const Value func, Value *args, int argc);
+Value __qmljs_construct_property(Context *context, Value base, String *name, Value *args, int argc);
+Value __qmljs_construct_value(Context *context, Value func, Value *args, int argc);
Value __qmljs_builtin_typeof(Context *context, Value *args, int argc);
Value __qmljs_builtin_throw(Context *context, Value *args, int argc);
Value __qmljs_init_closure(IR::Function *clos, Context *ctx);
Value __qmljs_init_native_function(void (*code)(Context *), Context *ctx);
-Bool __qmljs_is_function(const Value value);
+Bool __qmljs_is_function(Value value);
// string literals
Value __qmljs_string_literal_undefined(Context *ctx);
String *__qmljs_identifier_from_utf8(Context *ctx, const char *s);
// objects
-Value __qmljs_object_default_value(Context *ctx, const Value object, int typeHint);
+Value __qmljs_object_default_value(Context *ctx, Value object, int typeHint);
Value __qmljs_throw_type_error(Context *ctx);
Value __qmljs_new_object(Context *ctx);
Value __qmljs_new_boolean_object(Context *ctx, bool boolean);
Value __qmljs_get_thisObject(Context *ctx);
// type conversion and testing
-Value __qmljs_to_primitive(const Value value, Context *ctx, int typeHint);
-Bool __qmljs_to_boolean(const Value value, Context *ctx);
-double __qmljs_to_number(const Value value, Context *ctx);
-double __qmljs_to_integer(const Value value, Context *ctx);
-int __qmljs_to_int32(const Value value, Context *ctx);
-unsigned __qmljs_to_uint32(const Value value, Context *ctx);
-unsigned short __qmljs_to_uint16(const Value value, Context *ctx);
-Value __qmljs_to_string(const Value value, Context *ctx);
-Value __qmljs_to_object(const Value value, Context *ctx);
-//uint __qmljs_check_object_coercible(Context *ctx, Value *result, const Value *value);
-Bool __qmljs_is_callable(const Value value, Context *ctx);
-Value __qmljs_default_value(const Value value, Context *ctx, int typeHint);
-
-Value __qmljs_compare(const Value left, const Value right, Context *ctx, bool leftFlag);
-Bool __qmljs_equal(const Value x, const Value y, Context *ctx);
-Bool __qmljs_strict_equal(const Value x, const Value y, Context *ctx);
+Value __qmljs_to_primitive(Value value, Context *ctx, int typeHint);
+Bool __qmljs_to_boolean(Value value, Context *ctx);
+double __qmljs_to_number(Value value, Context *ctx);
+double __qmljs_to_integer(Value value, Context *ctx);
+int __qmljs_to_int32(Value value, Context *ctx);
+unsigned __qmljs_to_uint32(Value value, Context *ctx);
+unsigned short __qmljs_to_uint16(Value value, Context *ctx);
+Value __qmljs_to_string(Value value, Context *ctx);
+Value __qmljs_to_object(Value value, Context *ctx);
+//uint __qmljs_check_object_coercible(Context *ctx, Value *result, Value *value);
+Bool __qmljs_is_callable(Value value, Context *ctx);
+Value __qmljs_default_value(Value value, Context *ctx, int typeHint);
+
+Value __qmljs_compare(Value left, Value right, Context *ctx, bool leftFlag);
+Bool __qmljs_equal(Value x, Value y, Context *ctx);
+Bool __qmljs_strict_equal(Value x, Value y, Context *ctx);
// unary operators
-Value __qmljs_uplus(const Value value, Context *ctx);
-Value __qmljs_uminus(const Value value, Context *ctx);
-Value __qmljs_compl(const Value value, Context *ctx);
-Value __qmljs_not(const Value value, Context *ctx);
+Value __qmljs_uplus(Value value, Context *ctx);
+Value __qmljs_uminus(Value value, Context *ctx);
+Value __qmljs_compl(Value value, Context *ctx);
+Value __qmljs_not(Value value, Context *ctx);
/* ### these 4 methods are apparently unused right now */
Value __qmljs_delete_subscript(Context *ctx, Value base, Value index);
Value __qmljs_delete_property(Context *ctx, String *name);
Value __qmljs_delete_value(Context *ctx, Value value);
-Value __qmljs_typeof(const Value value, Context *ctx);
+Value __qmljs_typeof(Value value, Context *ctx);
void __qmljs_throw(Value value, Context *context);
Value __qmljs_rethrow(Context *context);
// binary operators
-Value __qmljs_instanceof(const Value left, const Value right, Context *ctx);
-Value __qmljs_in(const Value left, const Value right, Context *ctx);
-Value __qmljs_bit_or(const Value left, const Value right, Context *ctx);
-Value __qmljs_bit_xor(const Value left, const Value right, Context *ctx);
-Value __qmljs_bit_and(const Value left, const Value right, Context *ctx);
-Value __qmljs_add(const Value left, const Value right, Context *ctx);
-Value __qmljs_sub(const Value left, const Value right, Context *ctx);
-Value __qmljs_mul(const Value left, const Value right, Context *ctx);
-Value __qmljs_div(const Value left, const Value right, Context *ctx);
-Value __qmljs_mod(const Value left, const Value right, Context *ctx);
-Value __qmljs_shl(const Value left, const Value right, Context *ctx);
-Value __qmljs_shr(const Value left, const Value right, Context *ctx);
-Value __qmljs_ushr(const Value left, const Value right, Context *ctx);
-Value __qmljs_gt(const Value left, const Value right, Context *ctx);
-Value __qmljs_lt(const Value left, const Value right, Context *ctx);
-Value __qmljs_ge(const Value left, const Value right, Context *ctx);
-Value __qmljs_le(const Value left, const Value right, Context *ctx);
-Value __qmljs_eq(const Value left, const Value right, Context *ctx);
-Value __qmljs_ne(const Value left, const Value right, Context *ctx);
-Value __qmljs_se(const Value left, const Value right, Context *ctx);
-Value __qmljs_sne(const Value left, const Value right, Context *ctx);
-
-Value __qmljs_add_helper(const Value left, const Value right, Context *ctx);
+Value __qmljs_instanceof(Value left, Value right, Context *ctx);
+Value __qmljs_in(Value left, Value right, Context *ctx);
+Value __qmljs_bit_or(Value left, Value right, Context *ctx);
+Value __qmljs_bit_xor(Value left, Value right, Context *ctx);
+Value __qmljs_bit_and(Value left, Value right, Context *ctx);
+Value __qmljs_add(Value left, Value right, Context *ctx);
+Value __qmljs_sub(Value left, Value right, Context *ctx);
+Value __qmljs_mul(Value left, Value right, Context *ctx);
+Value __qmljs_div(Value left, Value right, Context *ctx);
+Value __qmljs_mod(Value left, Value right, Context *ctx);
+Value __qmljs_shl(Value left, Value right, Context *ctx);
+Value __qmljs_shr(Value left, Value right, Context *ctx);
+Value __qmljs_ushr(Value left, Value right, Context *ctx);
+Value __qmljs_gt(Value left, Value right, Context *ctx);
+Value __qmljs_lt(Value left, Value right, Context *ctx);
+Value __qmljs_ge(Value left, Value right, Context *ctx);
+Value __qmljs_le(Value left, Value right, Context *ctx);
+Value __qmljs_eq(Value left, Value right, Context *ctx);
+Value __qmljs_ne(Value left, Value right, Context *ctx);
+Value __qmljs_se(Value left, Value right, Context *ctx);
+Value __qmljs_sne(Value left, Value right, Context *ctx);
+
+Value __qmljs_add_helper(Value left, Value right, Context *ctx);
/*
unused and probably don't make sense with the new calling convention
void __qmljs_inplace_ushr(Context *ctx, Value *result, Value *value);
*/
-void __qmljs_inplace_bit_and_name(const Value value, String *name, Context *ctx);
-void __qmljs_inplace_bit_or_name(const Value value, String *name, Context *ctx);
-void __qmljs_inplace_bit_xor_name(const Value value, String *name, Context *ctx);
-void __qmljs_inplace_add_name(const Value value, String *name, Context *ctx);
-void __qmljs_inplace_sub_name(const Value value, String *name, Context *ctx);
-void __qmljs_inplace_mul_name(const Value value, String *name, Context *ctx);
-void __qmljs_inplace_div_name(const Value value, String *name, Context *ctx);
-void __qmljs_inplace_mod_name(const Value value, String *name, Context *ctx);
-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_name(Value value, String *name, Context *ctx);
+void __qmljs_inplace_bit_or_name(Value value, String *name, Context *ctx);
+void __qmljs_inplace_bit_xor_name(Value value, String *name, Context *ctx);
+void __qmljs_inplace_add_name(Value value, String *name, Context *ctx);
+void __qmljs_inplace_sub_name(Value value, String *name, Context *ctx);
+void __qmljs_inplace_mul_name(Value value, String *name, Context *ctx);
+void __qmljs_inplace_div_name(Value value, String *name, Context *ctx);
+void __qmljs_inplace_mod_name(Value value, String *name, Context *ctx);
+void __qmljs_inplace_shl_name(Value value, String *name, Context *ctx);
+void __qmljs_inplace_shr_name(Value value, String *name, Context *ctx);
+void __qmljs_inplace_ushr_name(Value value, String *name, Context *ctx);
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_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);
-Bool __qmljs_cmp_ge(const Value left, const Value right, Context *ctx);
-Bool __qmljs_cmp_le(const Value left, const Value right, Context *ctx);
-Bool __qmljs_cmp_eq(const Value left, const Value right, Context *ctx);
-Bool __qmljs_cmp_ne(const Value left, const Value right, Context *ctx);
-Bool __qmljs_cmp_se(const Value left, const Value right, Context *ctx);
-Bool __qmljs_cmp_sne(const Value left, const Value right, Context *ctx);
-Bool __qmljs_cmp_instanceof(const Value left, const Value right, Context *ctx);
-Bool __qmljs_cmp_in(const Value left, const Value right, Context *ctx);
+Bool __qmljs_cmp_gt(Value left, Value right, Context *ctx);
+Bool __qmljs_cmp_lt(Value left, Value right, Context *ctx);
+Bool __qmljs_cmp_ge(Value left, Value right, Context *ctx);
+Bool __qmljs_cmp_le(Value left, Value right, Context *ctx);
+Bool __qmljs_cmp_eq(Value left, Value right, Context *ctx);
+Bool __qmljs_cmp_ne(Value left, Value right, Context *ctx);
+Bool __qmljs_cmp_se(Value left, Value right, Context *ctx);
+Bool __qmljs_cmp_sne(Value left, Value right, Context *ctx);
+Bool __qmljs_cmp_instanceof(Value left, Value right, Context *ctx);
+Bool __qmljs_cmp_in(Value left, Value right, Context *ctx);
} // extern "C"
void init(ExecutionEngine *eng);
- void throwError(const Value &value);
+ void throwError(Value value);
void throwTypeError();
- void throwReferenceError(const Value &value);
+ void throwReferenceError(Value value);
#ifndef QMLJS_LLVM_RUNTIME
void throwError(const QString &message);
void initCallContext(ExecutionEngine *e, const Value *object, FunctionObject *f, Value *args, unsigned argc);
void leaveCallContext(FunctionObject *f);
- void initConstructorContext(ExecutionEngine *e, const Value *object, FunctionObject *f, Value *args, unsigned argc);
+ void initConstructorContext(ExecutionEngine *e, Value *object, FunctionObject *f, Value *args, unsigned argc);
void leaveConstructorContext(FunctionObject *f);
};
}
// type conversion and testing
-inline Value __qmljs_to_primitive(const Value value, Context *ctx, int typeHint)
+inline Value __qmljs_to_primitive(Value value, Context *ctx, int typeHint)
{
if (!value.isObject())
return value;
return __qmljs_default_value(value, ctx, typeHint);
}
-inline Bool __qmljs_to_boolean(const Value value, Context *ctx)
+inline Bool __qmljs_to_boolean(Value value, Context *ctx)
{
switch (value.type()) {
case Value::Undefined_Type:
}
}
-inline double __qmljs_to_number(const Value value, Context *ctx)
+inline double __qmljs_to_number(Value value, Context *ctx)
{
switch (value.type()) {
case Value::Undefined_Type:
}
}
-inline double __qmljs_to_integer(const Value value, Context *ctx)
+inline double __qmljs_to_integer(Value value, Context *ctx)
{
if (value.isInteger())
return value.int_32;
return std::signbit(number) ? -v : v;
}
-inline int __qmljs_to_int32(const Value value, Context *ctx)
+inline int __qmljs_to_int32(Value value, Context *ctx)
{
if (value.isInteger())
return value.int_32;
return int(number);
}
-inline unsigned __qmljs_to_uint32(const Value value, Context *ctx)
+inline unsigned __qmljs_to_uint32(Value value, Context *ctx)
{
if (value.isInteger())
return (unsigned) value.int_32;
return unsigned(number);
}
-inline unsigned short __qmljs_to_uint16(const Value value, Context *ctx)
+inline unsigned short __qmljs_to_uint16(Value value, Context *ctx)
{
double number = __qmljs_to_number(value, ctx);
if (! number || qIsNaN(number) || std::isinf(number))
return (unsigned short)number;
}
-inline Value __qmljs_to_string(const Value value, Context *ctx)
+inline Value __qmljs_to_string(Value value, Context *ctx)
{
switch (value.type()) {
case Value::Undefined_Type:
} // switch
}
-inline Value __qmljs_to_object(const Value value, Context *ctx)
+inline Value __qmljs_to_object(Value value, Context *ctx)
{
switch (value.type()) {
case Value::Undefined_Type:
}
/*
-inline uint __qmljs_check_object_coercible(Context *ctx, Value *result, const Value *value)
+inline uint __qmljs_check_object_coercible(Context *ctx, Value *result, Value *value)
{
switch (value->type()) {
case Value::Undefined_Type:
}
*/
-inline Bool __qmljs_is_callable(const Value value, Context *ctx)
+inline Bool __qmljs_is_callable(Value value, Context *ctx)
{
if (value.isObject())
return __qmljs_is_function(value);
return false;
}
-inline Value __qmljs_default_value(const Value value, Context *ctx, int typeHint)
+inline Value __qmljs_default_value(Value value, Context *ctx, int typeHint)
{
if (value.isObject())
return __qmljs_object_default_value(ctx, value, typeHint);
// unary operators
-inline Value __qmljs_typeof(const Value value, Context *ctx)
+inline Value __qmljs_typeof(Value value, Context *ctx)
{
switch (value.type()) {
case Value::Undefined_Type:
}
}
-inline Value __qmljs_uplus(const Value value, Context *ctx)
+inline Value __qmljs_uplus(Value value, Context *ctx)
{
if (value.isInteger())
return value;
return Value::fromDouble(n);
}
-inline Value __qmljs_uminus(const Value value, Context *ctx)
+inline Value __qmljs_uminus(Value value, Context *ctx)
{
if (value.isInteger())
return Value::fromInt32(-value.integerValue());
return Value::fromDouble(-n);
}
-inline Value __qmljs_compl(const Value value, Context *ctx)
+inline Value __qmljs_compl(Value value, Context *ctx)
{
int n = __qmljs_to_int32(value, ctx);
return Value::fromInt32(~n);
}
-inline Value __qmljs_not(const Value value, Context *ctx)
+inline Value __qmljs_not(Value value, Context *ctx)
{
bool b = __qmljs_to_boolean(value, ctx);
return Value::fromBoolean(!b);
}
// binary operators
-inline Value __qmljs_bit_or(const Value left, const Value right, Context *ctx)
+inline Value __qmljs_bit_or(Value left, Value right, Context *ctx)
{
int lval = __qmljs_to_int32(left, ctx);
int rval = __qmljs_to_int32(right, ctx);
return Value::fromDouble(lval | rval);
}
-inline Value __qmljs_bit_xor(const Value left, const Value right, Context *ctx)
+inline Value __qmljs_bit_xor(Value left, Value right, Context *ctx)
{
int lval = __qmljs_to_int32(left, ctx);
int rval = __qmljs_to_int32(right, ctx);
return Value::fromInt32(lval ^ rval);
}
-inline Value __qmljs_bit_and(const Value left, const Value right, Context *ctx)
+inline Value __qmljs_bit_and(Value left, Value right, Context *ctx)
{
int lval = __qmljs_to_int32(left, ctx);
int rval = __qmljs_to_int32(right, ctx);
}
*/
-inline Value __qmljs_add(const Value left, const Value right, Context *ctx)
+inline Value __qmljs_add(Value left, Value right, Context *ctx)
{
if (left.isInteger() && right.isInteger())
return add_int32(left.integerValue(), right.integerValue());
return __qmljs_add_helper(left, right, ctx);
}
-inline Value __qmljs_sub(const Value left, const Value right, Context *ctx)
+inline Value __qmljs_sub(Value left, Value right, Context *ctx)
{
if (left.isInteger() && right.isInteger())
return sub_int32(left.integerValue(), right.integerValue());
return Value::fromDouble(lval - rval);
}
-inline Value __qmljs_mul(const Value left, const Value right, Context *ctx)
+inline Value __qmljs_mul(Value left, Value right, Context *ctx)
{
if (left.isInteger() && right.isInteger())
return mul_int32(left.integerValue(), right.integerValue());
return Value::fromDouble(lval * rval);
}
-inline Value __qmljs_div(const Value left, const Value right, Context *ctx)
+inline Value __qmljs_div(Value left, Value right, Context *ctx)
{
double lval = __qmljs_to_number(left, ctx);
double rval = __qmljs_to_number(right, ctx);
return Value::fromDouble(lval / rval);
}
-inline Value __qmljs_mod(const Value left, const Value right, Context *ctx)
+inline Value __qmljs_mod(Value left, Value right, Context *ctx)
{
double lval = __qmljs_to_number(left, ctx);
double rval = __qmljs_to_number(right, ctx);
// ### unsigned shl missing?
-inline Value __qmljs_shl(const Value left, const Value right, Context *ctx)
+inline Value __qmljs_shl(Value left, Value right, Context *ctx)
{
int lval = __qmljs_to_int32(left, ctx);
unsigned rval = __qmljs_to_uint32(right, ctx);
return Value::fromInt32(lval << rval);
}
-inline Value __qmljs_shr(const Value left, const Value right, Context *ctx)
+inline Value __qmljs_shr(Value left, Value right, Context *ctx)
{
int lval = __qmljs_to_int32(left, ctx);
unsigned rval = __qmljs_to_uint32(right, ctx);
return Value::fromInt32(lval >> rval);
}
-inline Value __qmljs_ushr(const Value left, const Value right, Context *ctx)
+inline Value __qmljs_ushr(Value left, Value right, Context *ctx)
{
unsigned lval = __qmljs_to_uint32(left, ctx);
unsigned rval = __qmljs_to_uint32(right, ctx);
return Value::fromInt32(lval >> rval);
}
-inline Value __qmljs_gt(const Value left, const Value right, Context *ctx)
+inline Value __qmljs_gt(Value left, Value right, Context *ctx)
{
if (left.isInteger() && right.isInteger())
return Value::fromBoolean(left.integerValue() > right.integerValue());
}
}
-inline Value __qmljs_lt(const Value left, const Value right, Context *ctx)
+inline Value __qmljs_lt(Value left, Value right, Context *ctx)
{
if (left.isInteger() && right.isInteger())
return Value::fromBoolean(left.integerValue() < right.integerValue());
}
}
-inline Value __qmljs_ge(const Value left, const Value right, Context *ctx)
+inline Value __qmljs_ge(Value left, Value right, Context *ctx)
{
if (left.isInteger() && right.isInteger())
return Value::fromBoolean(left.integerValue() >= right.integerValue());
}
}
-inline Value __qmljs_le(const Value left, const Value right, Context *ctx)
+inline Value __qmljs_le(Value left, Value right, Context *ctx)
{
if (left.isInteger() && right.isInteger())
return Value::fromBoolean(left.integerValue() <= right.integerValue());
}
}
-inline Value __qmljs_eq(const Value left, const Value right, Context *ctx)
+inline Value __qmljs_eq(Value left, Value right, Context *ctx)
{
if (left.val == right.val)
return Value::fromBoolean(true);
}
}
-inline Value __qmljs_ne(const Value left, const Value right, Context *ctx)
+inline Value __qmljs_ne(Value left, Value right, Context *ctx)
{
Value result = __qmljs_eq(left, right, ctx);
result.int_32 = !(bool)result.int_32;
return result;
}
-inline Value __qmljs_se(const Value left, const Value right, Context *ctx)
+inline Value __qmljs_se(Value left, Value right, Context *ctx)
{
bool r = __qmljs_strict_equal(left, right, ctx);
return Value::fromBoolean(r);
}
-inline Value __qmljs_sne(const Value left, const Value right, Context *ctx)
+inline Value __qmljs_sne(Value left, Value right, Context *ctx)
{
bool r = ! __qmljs_strict_equal(left, right, ctx);
return Value::fromBoolean(r);
}
-inline Bool __qmljs_cmp_gt(const Value left, const Value right, Context *ctx)
+inline Bool __qmljs_cmp_gt(Value left, Value right, Context *ctx)
{
Value v = __qmljs_gt(left, right, ctx);
return v.booleanValue();
}
-inline Bool __qmljs_cmp_lt(const Value left, const Value right, Context *ctx)
+inline Bool __qmljs_cmp_lt(Value left, Value right, Context *ctx)
{
Value v = __qmljs_lt(left, right, ctx);
return v.booleanValue();
}
-inline Bool __qmljs_cmp_ge(const Value left, const Value right, Context *ctx)
+inline Bool __qmljs_cmp_ge(Value left, Value right, Context *ctx)
{
Value v = __qmljs_ge(left, right, ctx);
return v.booleanValue();
}
-inline Bool __qmljs_cmp_le(const Value left, const Value right, Context *ctx)
+inline Bool __qmljs_cmp_le(Value left, Value right, Context *ctx)
{
Value v = __qmljs_le(left, right, ctx);
return v.booleanValue();
}
-inline Bool __qmljs_cmp_eq(const Value left, const Value right, Context *ctx)
+inline Bool __qmljs_cmp_eq(Value left, Value right, Context *ctx)
{
Value v = __qmljs_eq(left, right, ctx);
return v.booleanValue();
}
-inline Bool __qmljs_cmp_ne(const Value left, const Value right, Context *ctx)
+inline Bool __qmljs_cmp_ne(Value left, Value right, Context *ctx)
{
Value v = __qmljs_ne(left, right, ctx);
return v.booleanValue();
}
-inline Bool __qmljs_cmp_se(const Value left, const Value right, Context *ctx)
+inline Bool __qmljs_cmp_se(Value left, Value right, Context *ctx)
{
return __qmljs_strict_equal(left, right, ctx);
}
-inline Bool __qmljs_cmp_sne(const Value left, const Value right, Context *ctx)
+inline Bool __qmljs_cmp_sne(Value left, Value right, Context *ctx)
{
return ! __qmljs_strict_equal(left, right, ctx);
}
-inline Bool __qmljs_cmp_instanceof(const Value left, const Value right, Context *ctx)
+inline Bool __qmljs_cmp_instanceof(Value left, Value right, Context *ctx)
{
Value v = __qmljs_instanceof(left, right, ctx);
return v.booleanValue();
}
-inline uint __qmljs_cmp_in(const Value left, const Value right, Context *ctx)
+inline uint __qmljs_cmp_in(Value left, Value right, Context *ctx)
{
Value v = __qmljs_in(left, right, ctx);
return v.booleanValue();
}
-inline Bool __qmljs_strict_equal(const Value x, const Value y, Context *ctx)
+inline Bool __qmljs_strict_equal(Value x, Value y, Context *ctx)
{
if (x.rawValue() == y.rawValue())
return true;