Merge remote-tracking branch 'origin/tracking' into custom

This commit is contained in:
roytam1 2023-06-02 10:39:38 +08:00
commit 0c3fa71099
7 changed files with 52 additions and 7 deletions

View file

@ -1240,6 +1240,7 @@ static const JSFunctionSpec object_static_methods[] = {
JS_FN("seal", obj_seal, 1, 0),
JS_FN("isSealed", obj_isSealed, 1, 0),
JS_SELF_HOSTED_FN("fromEntries", "ObjectFromEntries", 1, 0),
JS_SELF_HOSTED_FN("hasOwn", "ObjectHasOwn", 2, 0),
JS_FS_END
};

View file

@ -220,3 +220,12 @@ function ObjectFromEntries(iter) {
return obj;
}
// Proposal https://github.com/tc39/proposal-accessible-object-hasownproperty
// Object.hasOwn (Object, Property)
function ObjectHasOwn(O, P) {
// Step 1.
var obj = ToObject(O);
// Step 2-3.
return callFunction(std_Object_hasOwnProperty, obj, P);
}

View file

@ -1803,6 +1803,14 @@ jit::FinishBailoutToBaseline(BaselineBailoutInfo* bailoutInfo)
MOZ_ASSERT(numFrames > 0);
BailoutKind bailoutKind = bailoutInfo->bailoutKind;
bool checkGlobalDeclarationConflicts = bailoutInfo->checkGlobalDeclarationConflicts;
uint8_t* incomingStack = bailoutInfo->incomingStack;
// We have to get rid of the rematerialized frame, whether it is
// restored or unwound.
auto guardRemoveRematerializedFramesFromDebugger = mozilla::MakeScopeExit([&] {
JitActivation* act = cx->activation()->asJit();
act->removeRematerializedFramesFromDebugger(cx, incomingStack);
});
// Free the bailout buffer.
js_free(bailoutInfo);
@ -1876,6 +1884,7 @@ jit::FinishBailoutToBaseline(BaselineBailoutInfo* bailoutInfo)
if (frameno == numFrames - 1) {
outerScript = frame->script();
outerFp = iter.fp();
MOZ_ASSERT(outerFp == incomingStack);
}
frameno++;
@ -1902,18 +1911,23 @@ jit::FinishBailoutToBaseline(BaselineBailoutInfo* bailoutInfo)
// We must attempt to copy all rematerialized frames over,
// even if earlier ones failed, to invoke the proper frame
// cleanup in the Debugger.
ok = CopyFromRematerializedFrame(cx, act, outerFp, --inlineDepth,
iter.baselineFrame());
if (!CopyFromRematerializedFrame(cx, act, outerFp, --inlineDepth,
iter.baselineFrame()))
{
ok = false;
}
}
++iter;
}
// After copying from all the rematerialized frames, remove them from
// the table to keep the table up to date.
act->removeRematerializedFrame(outerFp);
if (!ok)
return false;
// After copying from all the rematerialized frames, remove them from
// the table to keep the table up to date.
guardRemoveRematerializedFramesFromDebugger.release();
act->removeRematerializedFrame(outerFp);
}
JitSpew(JitSpew_BaselineBailouts,

View file

@ -888,7 +888,12 @@ HandleException(ResumeFromException* rfe)
++frames;
}
// Remove left-over state which might have been needed for bailout.
activation->removeIonFrameRecovery(iter.jsFrame());
activation->removeRematerializedFrame(iter.fp());
// If invalidated, decrement the number of frames remaining on the
// stack for the given IonScript.
if (invalidated)
ionScript->decrementInvalidationCount(cx->runtime()->defaultFreeOp());

View file

@ -1584,6 +1584,8 @@ jit::JitActivation::removeRematerializedFramesFromDebugger(JSContext* cx, uint8_
if (RematerializedFrameTable::Ptr p = rematerializedFrames_->lookup(top)) {
for (uint32_t i = 0; i < p->value().length(); i++)
Debugger::handleUnrecoverableIonBailoutError(cx, p->value()[i]);
RematerializedFrame::FreeInVector(p->value());
rematerializedFrames_->remove(p);
}
}