mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Merge.
This commit is contained in:
commit
44e0963c4e
@ -3777,12 +3777,15 @@ JS_INTERPRET(JSContext *cx, JSInterpreterState *state)
|
|||||||
guard_obj_is_xml(cx, regs, obj2)))) { \
|
guard_obj_is_xml(cx, regs, obj2)))) { \
|
||||||
JSXMLObjectOps *ops; \
|
JSXMLObjectOps *ops; \
|
||||||
\
|
\
|
||||||
|
ABORT_TRACE("operations involving XML not traced"); \
|
||||||
ops = (JSXMLObjectOps *) obj2->map->ops; \
|
ops = (JSXMLObjectOps *) obj2->map->ops; \
|
||||||
if (obj2 == JSVAL_TO_OBJECT(rval)) \
|
if (obj2 == JSVAL_TO_OBJECT(rval)) \
|
||||||
rval = lval; \
|
rval = lval; \
|
||||||
if (!ops->equality(cx, obj2, rval, &cond)) \
|
if (!ops->equality(cx, obj2, rval, &cond)) \
|
||||||
goto error; \
|
goto error; \
|
||||||
cond = cond OP JS_TRUE; \
|
i = (int)cond; \
|
||||||
|
prim_generate_int_constant(cx, 1, j); \
|
||||||
|
prim_icmp_##OP(cx, i, j, cond); \
|
||||||
} else
|
} else
|
||||||
|
|
||||||
#define EXTENDED_EQUALITY_OP(OP) \
|
#define EXTENDED_EQUALITY_OP(OP) \
|
||||||
@ -3791,10 +3794,13 @@ JS_INTERPRET(JSContext *cx, JSInterpreterState *state)
|
|||||||
((clasp = OBJ_GET_CLASS(cx, obj2))->flags & JSCLASS_IS_EXTENDED)) { \
|
((clasp = OBJ_GET_CLASS(cx, obj2))->flags & JSCLASS_IS_EXTENDED)) { \
|
||||||
JSExtendedClass *xclasp; \
|
JSExtendedClass *xclasp; \
|
||||||
\
|
\
|
||||||
|
ABORT_TRACE("extended equality comparison not traceable"); \
|
||||||
xclasp = (JSExtendedClass *) clasp; \
|
xclasp = (JSExtendedClass *) clasp; \
|
||||||
if (!xclasp->equality(cx, obj2, rval, &cond)) \
|
if (!xclasp->equality(cx, obj2, rval, &cond)) \
|
||||||
goto error; \
|
goto error; \
|
||||||
cond = cond OP JS_TRUE; \
|
i = (int)cond; \
|
||||||
|
prim_generate_int_constant(cx, 1, j); \
|
||||||
|
prim_icmp_##OP(cx, i, j, cond); \
|
||||||
} else
|
} else
|
||||||
#else
|
#else
|
||||||
#define XML_EQUALITY_OP(OP) /* nothing */
|
#define XML_EQUALITY_OP(OP) /* nothing */
|
||||||
@ -3810,23 +3816,34 @@ JS_INTERPRET(JSContext *cx, JSInterpreterState *state)
|
|||||||
XML_EQUALITY_OP(OP) \
|
XML_EQUALITY_OP(OP) \
|
||||||
if (ltmp == rtmp) { \
|
if (ltmp == rtmp) { \
|
||||||
if (ltmp == JSVAL_STRING) { \
|
if (ltmp == JSVAL_STRING) { \
|
||||||
str = JSVAL_TO_STRING(lval); \
|
prim_jsval_to_string(cx, lval, str); \
|
||||||
str2 = JSVAL_TO_STRING(rval); \
|
prim_jsval_to_string(cx, rval, str2); \
|
||||||
cond = js_EqualStrings(str, str2) OP JS_TRUE; \
|
call_CompareStrings(cx, str, str2, i); \
|
||||||
|
prim_generate_int_constant(cx, 0, j); \
|
||||||
|
prim_icmp_##OP(cx, i, j, cond); \
|
||||||
} else if (ltmp == JSVAL_DOUBLE) { \
|
} else if (ltmp == JSVAL_DOUBLE) { \
|
||||||
d = *JSVAL_TO_DOUBLE(lval); \
|
VALUE_TO_NUMBER(cx, -2, lval, d); \
|
||||||
d2 = *JSVAL_TO_DOUBLE(rval); \
|
VALUE_TO_NUMBER(cx, -1, rval, d2); \
|
||||||
cond = JSDOUBLE_COMPARE(d, OP, d2, IFNAN); \
|
prim_dcmp_##OP(cx, IFNAN, d, d2, cond); \
|
||||||
} else { \
|
} else { \
|
||||||
EXTENDED_EQUALITY_OP(OP) \
|
EXTENDED_EQUALITY_OP(OP) \
|
||||||
/* Handle all undefined (=>NaN) and int combinations. */ \
|
{ /* Else block for EXTENDED_EQUALITY_OP if defined */ \
|
||||||
cond = lval OP rval; \
|
/* Handle all undefined (=>NaN) and int combinations. */ \
|
||||||
|
i = (int)lval; \
|
||||||
|
j = (int)rval; \
|
||||||
|
prim_icmp_##OP(cx, i, j, cond); \
|
||||||
|
} \
|
||||||
} \
|
} \
|
||||||
} else { \
|
} else { \
|
||||||
|
ABORT_TRACE("comparison of mismatched types not traceable"); \
|
||||||
if (JSVAL_IS_NULL(lval) || JSVAL_IS_VOID(lval)) { \
|
if (JSVAL_IS_NULL(lval) || JSVAL_IS_VOID(lval)) { \
|
||||||
cond = (JSVAL_IS_NULL(rval) || JSVAL_IS_VOID(rval)) OP 1; \
|
i = JSVAL_IS_NULL(rval) || JSVAL_IS_VOID(rval); \
|
||||||
|
prim_generate_int_constant(cx, 1, j); \
|
||||||
|
prim_icmp_##OP(cx, i, j, cond); \
|
||||||
} else if (JSVAL_IS_NULL(rval) || JSVAL_IS_VOID(rval)) { \
|
} else if (JSVAL_IS_NULL(rval) || JSVAL_IS_VOID(rval)) { \
|
||||||
cond = 1 OP 0; \
|
prim_generate_int_constant(cx, 1, i); \
|
||||||
|
prim_generate_int_constant(cx, 0, j); \
|
||||||
|
prim_icmp_##OP(cx, i, j, cond); \
|
||||||
} else { \
|
} else { \
|
||||||
if (ltmp == JSVAL_OBJECT) { \
|
if (ltmp == JSVAL_OBJECT) { \
|
||||||
DEFAULT_VALUE(cx, -2, JSTYPE_VOID, lval); \
|
DEFAULT_VALUE(cx, -2, JSTYPE_VOID, lval); \
|
||||||
@ -3836,13 +3853,15 @@ JS_INTERPRET(JSContext *cx, JSInterpreterState *state)
|
|||||||
rtmp = JSVAL_TAG(rval); \
|
rtmp = JSVAL_TAG(rval); \
|
||||||
} \
|
} \
|
||||||
if (ltmp == JSVAL_STRING && rtmp == JSVAL_STRING) { \
|
if (ltmp == JSVAL_STRING && rtmp == JSVAL_STRING) { \
|
||||||
str = JSVAL_TO_STRING(lval); \
|
prim_jsval_to_string(cx, lval, str); \
|
||||||
str2 = JSVAL_TO_STRING(rval); \
|
prim_jsval_to_string(cx, rval, str2); \
|
||||||
cond = js_EqualStrings(str, str2) OP JS_TRUE; \
|
call_CompareStrings(cx, str, str2, i); \
|
||||||
|
prim_generate_int_constant(cx, 0, j); \
|
||||||
|
prim_icmp_##OP(cx, i, j, cond); \
|
||||||
} else { \
|
} else { \
|
||||||
VALUE_TO_NUMBER(cx, -2, lval, d); \
|
VALUE_TO_NUMBER(cx, -2, lval, d); \
|
||||||
VALUE_TO_NUMBER(cx, -1, rval, d2); \
|
VALUE_TO_NUMBER(cx, -1, rval, d2); \
|
||||||
cond = JSDOUBLE_COMPARE(d, OP, d2, IFNAN); \
|
prim_dcmp_##OP(cx, IFNAN, d, d2, cond); \
|
||||||
} \
|
} \
|
||||||
} \
|
} \
|
||||||
} \
|
} \
|
||||||
@ -3850,12 +3869,12 @@ JS_INTERPRET(JSContext *cx, JSInterpreterState *state)
|
|||||||
STORE_STACK_BOOLEAN(-1, cond); \
|
STORE_STACK_BOOLEAN(-1, cond); \
|
||||||
JS_END_MACRO
|
JS_END_MACRO
|
||||||
|
|
||||||
BEGIN_CASE(JSOP_EQ)
|
TRACE_CASE(JSOP_EQ)
|
||||||
EQUALITY_OP(==, JS_FALSE);
|
EQUALITY_OP(eq, JS_FALSE);
|
||||||
END_CASE(JSOP_EQ)
|
END_CASE(JSOP_EQ)
|
||||||
|
|
||||||
BEGIN_CASE(JSOP_NE)
|
BEGIN_CASE(JSOP_NE)
|
||||||
EQUALITY_OP(!=, JS_TRUE);
|
EQUALITY_OP(ne, JS_TRUE);
|
||||||
END_CASE(JSOP_NE)
|
END_CASE(JSOP_NE)
|
||||||
|
|
||||||
#define STRICT_EQUALITY_OP(OP) \
|
#define STRICT_EQUALITY_OP(OP) \
|
||||||
|
@ -373,6 +373,18 @@ PRIMITIVE(guard_boolean_is_true)(JSContext* cx, JSFrameRegs& regs, JSBool& cond)
|
|||||||
return cond;
|
return cond;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static inline void
|
||||||
|
PRIMITIVE(prim_icmp_eq)(JSContext* cx, jsint& a, jsint& b, JSBool& r)
|
||||||
|
{
|
||||||
|
r = a == b;
|
||||||
|
}
|
||||||
|
|
||||||
|
static inline void
|
||||||
|
PRIMITIVE(prim_icmp_ne)(JSContext* cx, jsint& a, jsint& b, JSBool& r)
|
||||||
|
{
|
||||||
|
r = a != b;
|
||||||
|
}
|
||||||
|
|
||||||
static inline void
|
static inline void
|
||||||
PRIMITIVE(prim_icmp_lt)(JSContext* cx, jsint& a, jsint& b, JSBool& r)
|
PRIMITIVE(prim_icmp_lt)(JSContext* cx, jsint& a, jsint& b, JSBool& r)
|
||||||
{
|
{
|
||||||
@ -397,6 +409,20 @@ PRIMITIVE(prim_icmp_ge)(JSContext* cx, jsint& a, jsint& b, JSBool& r)
|
|||||||
r = a >= b;
|
r = a >= b;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static inline void
|
||||||
|
PRIMITIVE(prim_dcmp_eq)(JSContext* cx, bool ifnan, jsdouble& a, jsdouble& b,
|
||||||
|
JSBool& r)
|
||||||
|
{
|
||||||
|
r = JSDOUBLE_COMPARE(a, ==, b, ifnan);
|
||||||
|
}
|
||||||
|
|
||||||
|
static inline void
|
||||||
|
PRIMITIVE(prim_dcmp_ne)(JSContext* cx, bool ifnan, jsdouble& a, jsdouble& b,
|
||||||
|
JSBool& r)
|
||||||
|
{
|
||||||
|
r = JSDOUBLE_COMPARE(a, !=, b, ifnan);
|
||||||
|
}
|
||||||
|
|
||||||
static inline void
|
static inline void
|
||||||
PRIMITIVE(prim_dcmp_lt)(JSContext* cx, bool ifnan, jsdouble& a, jsdouble& b, JSBool& r)
|
PRIMITIVE(prim_dcmp_lt)(JSContext* cx, bool ifnan, jsdouble& a, jsdouble& b, JSBool& r)
|
||||||
{
|
{
|
||||||
|
@ -377,6 +377,23 @@ guard_boolean_is_true(JSContext* cx, JSFrameRegs& regs, JSBool& cond)
|
|||||||
return ok;
|
return ok;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static inline void
|
||||||
|
prim_icmp_eq(JSContext* cx, jsint& a, jsint& b, JSBool& r)
|
||||||
|
{
|
||||||
|
interp_prim_icmp_eq(cx, a, b, r);
|
||||||
|
recorder(cx)->binary(LIR_eq, &a, &b, &r);
|
||||||
|
}
|
||||||
|
|
||||||
|
static inline void
|
||||||
|
prim_icmp_ne(JSContext* cx, jsint& a, jsint& b, JSBool& r)
|
||||||
|
{
|
||||||
|
interp_prim_icmp_ne(cx, a, b, r);
|
||||||
|
#if 0
|
||||||
|
// Need to synthesize LIR_ne here -- LIR_eq(sub(a, b), 0) ?
|
||||||
|
recorder(cx)->binary(LIR_ne, &a, &b, &r);
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
|
||||||
static inline void
|
static inline void
|
||||||
prim_icmp_lt(JSContext* cx, jsint& a, jsint& b, JSBool& r)
|
prim_icmp_lt(JSContext* cx, jsint& a, jsint& b, JSBool& r)
|
||||||
{
|
{
|
||||||
@ -405,6 +422,23 @@ prim_icmp_ge(JSContext* cx, jsint& a, jsint& b, JSBool& r)
|
|||||||
recorder(cx)->binary(LIR_ge, &a, &b, &r);
|
recorder(cx)->binary(LIR_ge, &a, &b, &r);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static inline void
|
||||||
|
prim_dcmp_eq(JSContext* cx, bool ifnan, jsdouble& a, jsdouble& b, JSBool& r)
|
||||||
|
{
|
||||||
|
interp_prim_dcmp_eq(cx, ifnan, a, b, r);
|
||||||
|
recorder(cx)->binary(LIR_eq, &a, &b, &r); // TODO: check ifnan handling
|
||||||
|
}
|
||||||
|
|
||||||
|
static inline void
|
||||||
|
prim_dcmp_ne(JSContext *cx, bool ifnan, jsdouble& a, jsdouble& b, JSBool& r)
|
||||||
|
{
|
||||||
|
interp_prim_dcmp_ne(cx, ifnan, a, b, r);
|
||||||
|
#if 0
|
||||||
|
// Need to synthesize LIR_ne here -- LIR_eq(sub(a, b), 0) ?
|
||||||
|
recorder(cx)->binary(LIR_ne, &a, &b, &r);
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
|
||||||
static inline void
|
static inline void
|
||||||
prim_dcmp_lt(JSContext* cx, bool ifnan, jsdouble& a, jsdouble& b, JSBool& r)
|
prim_dcmp_lt(JSContext* cx, bool ifnan, jsdouble& a, jsdouble& b, JSBool& r)
|
||||||
{
|
{
|
||||||
@ -499,6 +533,10 @@ guard_ops_are_xml(JSContext *cx, JSFrameRegs& regs, JSObjectOps*& ops)
|
|||||||
return ok;
|
return ok;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
* XXX want to move to an interp helper, but guard_ops_are_xml isn't visible
|
||||||
|
* except in jstracer.cpp mode, so it breaks compilation.
|
||||||
|
*/
|
||||||
static inline bool
|
static inline bool
|
||||||
guard_obj_is_xml(JSContext* cx, JSFrameRegs& regs, JSObject*& obj)
|
guard_obj_is_xml(JSContext* cx, JSFrameRegs& regs, JSObject*& obj)
|
||||||
{
|
{
|
||||||
|
Loading…
Reference in New Issue
Block a user