mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
[JAEGER] Merge from fatval.
This commit is contained in:
commit
bd2dbde8d3
@ -3866,6 +3866,10 @@ ExtractStructField(JSContext* cx, jsval val, JSObject** typeObj)
|
||||
jsid id;
|
||||
if (!JS_NextProperty(cx, iter, &id))
|
||||
return NULL;
|
||||
if (JSID_IS_VOID(id)) {
|
||||
JS_ReportError(cx, "struct field descriptors require a valid name and type");
|
||||
return NULL;
|
||||
}
|
||||
|
||||
js::AutoValueRooter nameVal(cx);
|
||||
JS_IdToValue(cx, id, Jsvalify(nameVal.addr()));
|
||||
|
@ -107,7 +107,10 @@ IdToValue(jsid id)
|
||||
return StringTag(JSID_TO_STRING(id));
|
||||
if (JS_LIKELY(JSID_IS_INT(id)))
|
||||
return Int32Tag(JSID_TO_INT(id));
|
||||
return ObjectTag(*JSID_TO_OBJECT(id));
|
||||
if (JS_LIKELY(JSID_IS_OBJECT(id)))
|
||||
return ObjectTag(*JSID_TO_OBJECT(id));
|
||||
JS_ASSERT(JSID_IS_DEFAULT_XML_NAMESPACE(id) || JSID_IS_VOID(id));
|
||||
return UndefinedTag();
|
||||
}
|
||||
|
||||
static JS_ALWAYS_INLINE jsval
|
||||
|
@ -730,8 +730,10 @@ JS_REQUIRES_STACK LIns*
|
||||
TraceRecorder::slurpDoubleSlot(LIns* addr_ins, ptrdiff_t offset, Value* vp, VMSideExit* exit)
|
||||
{
|
||||
LIns *mask_ins = lir->insLoad(LIR_ldi, addr_ins, offset + sTagOffset, ACC_OTHER);
|
||||
guard(true, lir->ins2(LIR_ltui, mask_ins, INS_CONSTU(JSVAL_TAG_CLEAR)), exit);
|
||||
return lir->insLoad(LIR_ldd, addr_ins, offset + sPayloadOffset, ACC_OTHER);
|
||||
guard(true, lir->ins2(LIR_leui, mask_ins, INS_CONSTU(JSVAL_TAG_INT32)), exit);
|
||||
LIns *val_ins = lir->insLoad(LIR_ldi, addr_ins, offset + sPayloadOffset, ACC_OTHER);
|
||||
LIns* args[] = { val_ins, mask_ins };
|
||||
return lir->insCall(&js_UnboxDouble_ci, args);
|
||||
}
|
||||
|
||||
JS_REQUIRES_STACK LIns*
|
||||
|
@ -8247,8 +8247,10 @@ TraceRecorder::d2i(LIns* f, bool resultCanBeImpreciseIfFractional)
|
||||
const CallInfo* ci = f->callInfo();
|
||||
if (ci == &js_UnboxDouble_ci) {
|
||||
LIns *boxed = lir->insAlloc(sizeof(Value));
|
||||
lir->insStore(fcallarg(f, 1), boxed, 0, ACC_OTHER);
|
||||
lir->insStore(fcallarg(f, 0), boxed, sizeof(uint32), ACC_OTHER);
|
||||
LIns *tag_ins = fcallarg(f, 0);
|
||||
LIns *payload_ins = fcallarg(f, 1);
|
||||
lir->insStore(tag_ins, boxed, sTagOffset, ACC_OTHER);
|
||||
lir->insStore(payload_ins, boxed, sPayloadOffset, ACC_OTHER);
|
||||
LIns* args[] = { boxed };
|
||||
return lir->insCall(&js_UnboxInt32_ci, args);
|
||||
}
|
||||
@ -9383,9 +9385,7 @@ TraceRecorder::unbox_value(const Value &v, LIns *vaddr_ins, ptrdiff_t offset, VM
|
||||
LIns *mask_ins = lir->insLoad(LIR_ldi, vaddr_ins, offset + sTagOffset,
|
||||
accSet);
|
||||
if (v.isNumber() && force_double) {
|
||||
guard(false,
|
||||
lir->insEqI_0(lir->ins2(LIR_leui, mask_ins, INS_CONSTU(JSVAL_TAG_INT32))),
|
||||
exit);
|
||||
guard(true, lir->ins2(LIR_leui, mask_ins, INS_CONSTU(JSVAL_TAG_INT32)), exit);
|
||||
LIns *val_ins = lir->insLoad(LIR_ldi, vaddr_ins, offset + sPayloadOffset,
|
||||
accSet);
|
||||
LIns* args[] = { val_ins, mask_ins };
|
||||
@ -9484,7 +9484,13 @@ TraceRecorder::box_value(const Value &v, nanojit::LIns* v_ins,
|
||||
LIns *dstaddr_ins, ptrdiff_t offset, AccSet accSet)
|
||||
{
|
||||
if (v.isNumber()) {
|
||||
if (isPromoteInt(v_ins)) {
|
||||
JS_ASSERT(v_ins->isD());
|
||||
if (fcallinfo(v_ins) == &js_UnboxDouble_ci) {
|
||||
LIns *tag_ins = fcallarg(v_ins, 0);
|
||||
LIns *payload_ins = fcallarg(v_ins, 1);
|
||||
lir->insStore(tag_ins, dstaddr_ins, offset + sTagOffset, accSet);
|
||||
lir->insStore(payload_ins, dstaddr_ins, offset + sPayloadOffset, accSet);
|
||||
} else if (isPromoteInt(v_ins)) {
|
||||
LIns *int_ins = demote(lir, v_ins);
|
||||
lir->insStore(INS_CONSTU(JSVAL_TAG_INT32), dstaddr_ins,
|
||||
offset + sTagOffset, accSet);
|
||||
@ -12146,17 +12152,16 @@ TraceRecorder::initOrSetPropertyByName(LIns* obj_ins, Value* idvalp, Value* rval
|
||||
{
|
||||
CHECK_STATUS(primitiveToStringInPlace(idvalp));
|
||||
|
||||
LIns* rval_ins = box_value(*rvalp, get(rvalp));
|
||||
LIns* vp_ins = box_value(*rvalp, get(rvalp));
|
||||
enterDeepBailCall();
|
||||
|
||||
LIns* ok_ins;
|
||||
LIns* idvalp_ins = addName(addr(idvalp), "idvalp");
|
||||
if (init) {
|
||||
LIns* args[] = {rval_ins, idvalp_ins, obj_ins, cx_ins};
|
||||
LIns* args[] = {vp_ins, idvalp_ins, obj_ins, cx_ins};
|
||||
ok_ins = lir->insCall(&InitPropertyByName_ci, args);
|
||||
} else {
|
||||
// See note in getPropertyByName about vp.
|
||||
LIns* vp_ins = addName(lir->insAlloc(sizeof(Value)), "vp");
|
||||
LIns* args[] = {vp_ins, idvalp_ins, obj_ins, cx_ins};
|
||||
ok_ins = lir->insCall(&SetPropertyByName_ci, args);
|
||||
}
|
||||
@ -12383,8 +12388,10 @@ TraceRecorder::setElem(int lval_spindex, int idx_spindex, int v_spindex)
|
||||
if (v.isNumber()) {
|
||||
if (fcallinfo(v_ins) == &js_UnboxDouble_ci) {
|
||||
LIns *boxed = lir->insAlloc(sizeof(Value));
|
||||
lir->insStore(fcallarg(v_ins, 1), boxed, 0, ACC_OTHER);
|
||||
lir->insStore(fcallarg(v_ins, 0), boxed, sizeof(uint32), ACC_OTHER);
|
||||
LIns *tag_ins = fcallarg(v_ins, 0);
|
||||
LIns *payload_ins = fcallarg(v_ins, 1);
|
||||
lir->insStore(tag_ins, boxed, sTagOffset, ACC_OTHER);
|
||||
lir->insStore(payload_ins, boxed, sPayloadOffset, ACC_OTHER);
|
||||
args[0] = boxed;
|
||||
res_ins = lir->insCall(&js_Array_dense_setelem_ci, args);
|
||||
} else if (isPromoteInt(v_ins)) {
|
||||
|
@ -3,4 +3,4 @@ script 11.13.1-001.js
|
||||
script 11.13.1-002.js
|
||||
script 11.4.1-001.js
|
||||
script 11.4.1-002.js
|
||||
fails script order-01.js
|
||||
script order-01.js
|
||||
|
@ -63,14 +63,18 @@ function test()
|
||||
|
||||
var recursionDepth = 0;
|
||||
function err() {
|
||||
if (++recursionDepth == 128)
|
||||
return new Error();
|
||||
return err.apply(this, arguments);
|
||||
try {
|
||||
return err.apply(this, arguments);
|
||||
} catch (e) {
|
||||
if (!(e instanceof InternalError))
|
||||
throw e;
|
||||
}
|
||||
return new Error();
|
||||
}
|
||||
|
||||
// The full stack trace in error would include 128*2 copies of s exceeding
|
||||
// The full stack trace in error would include 64*4 copies of s exceeding
|
||||
// 2^23 * 256 or 2^31 in length
|
||||
var error = err(s,s);
|
||||
var error = err(s,s,s,s);
|
||||
|
||||
print(error.stack.length);
|
||||
|
||||
|
@ -79,7 +79,8 @@ XPCVariant::XPCVariant(XPCCallContext& ccx, jsval aJSVal)
|
||||
|
||||
XPCTraceableVariant::~XPCTraceableVariant()
|
||||
{
|
||||
NS_ASSERTION(JSVAL_IS_GCTHING(mJSVal), "Must be traceable or unlinked");
|
||||
NS_ASSERTION(JSVAL_IS_GCTHING(mJSVal) || JSVAL_IS_NULL(mJSVal),
|
||||
"Must be traceable or unlinked");
|
||||
|
||||
// If mJSVal is JSVAL_STRING, we don't need to clean anything up;
|
||||
// simply removing the string from the root set is good.
|
||||
|
@ -3306,13 +3306,13 @@ XPCWrappedNative::HandlePossibleNameCaseError(XPCCallContext& ccx,
|
||||
const char* badName = JS_GetStringBytes(oldJSStr);
|
||||
char* locationStr = nsnull;
|
||||
|
||||
nsIException* e = nsnull;
|
||||
nsXPCException::NewException("", NS_OK, nsnull, nsnull, &e);
|
||||
nsCOMPtr<nsIException> e;
|
||||
nsXPCException::NewException("", NS_OK, nsnull, nsnull, getter_AddRefs(e));
|
||||
|
||||
if(e)
|
||||
{
|
||||
nsresult rv;
|
||||
nsCOMPtr<nsIStackFrame> loc = nsnull;
|
||||
nsCOMPtr<nsIStackFrame> loc;
|
||||
rv = e->GetLocation(getter_AddRefs(loc));
|
||||
if(NS_SUCCEEDED(rv) && loc) {
|
||||
loc->ToString(&locationStr); // failure here leaves it nsnull.
|
||||
|
Loading…
Reference in New Issue
Block a user