Bug 1903324 - Ensure BytecodeOpCanHaveAllocSite returns true for all ops that can use InlinableNativeIRGenerator. r=iain

In `BytecodeOpCanHaveAllocSite` we were missing `JSOp::CallContent` used in self-hosted code.

Differential Revision: https://phabricator.services.mozilla.com/D214268
This commit is contained in:
Jan de Mooij 2024-06-20 07:37:16 +00:00
Родитель 7493831832
Коммит fd2a3f945a
3 изменённых файлов: 15 добавлений и 6 удалений

Просмотреть файл

@ -0,0 +1,3 @@
for (var i = 0; i < 15; i++) {
new Promise(function() { throw 1; }).catch(e => null).finally(Object);
}

Просмотреть файл

@ -11576,9 +11576,7 @@ AttachDecision CallIRGenerator::tryAttachInlinableNative(HandleFunction callee,
flags.getArgFormat() == CallFlags::Spread);
// Special case functions are only optimized for normal calls.
if (op_ != JSOp::Call && op_ != JSOp::CallContent && op_ != JSOp::New &&
op_ != JSOp::NewContent && op_ != JSOp::CallIgnoresRv &&
op_ != JSOp::SpreadCall) {
if (!BytecodeCallOpCanHaveInlinableNative(op_)) {
return AttachDecision::NoAction;
}
@ -11611,6 +11609,8 @@ AttachDecision InlinableNativeIRGenerator::tryAttachFuzzilliHash() {
#endif
AttachDecision InlinableNativeIRGenerator::tryAttachStub() {
MOZ_ASSERT(BytecodeCallOpCanHaveInlinableNative(generator_.op_));
if (!callee_->hasJitInfo() ||
callee_->jitInfo()->type() != JSJitInfo::InlinableNative) {
return AttachDecision::NoAction;

Просмотреть файл

@ -948,10 +948,16 @@ class MOZ_RAII NewObjectIRGenerator : public IRGenerator {
AttachDecision tryAttachPlainObject();
};
// Returns true for bytecode ops that can use InlinableNativeIRGenerator.
inline bool BytecodeCallOpCanHaveInlinableNative(JSOp op) {
return op == JSOp::Call || op == JSOp::CallContent || op == JSOp::New ||
op == JSOp::NewContent || op == JSOp::CallIgnoresRv ||
op == JSOp::SpreadCall;
}
inline bool BytecodeOpCanHaveAllocSite(JSOp op) {
return op == JSOp::Call || op == JSOp::CallIgnoresRv || op == JSOp::New ||
op == JSOp::NewArray || op == JSOp::NewObject || op == JSOp::NewInit ||
op == JSOp::NewContent;
return BytecodeCallOpCanHaveInlinableNative(op) || op == JSOp::NewArray ||
op == JSOp::NewObject || op == JSOp::NewInit;
}
class MOZ_RAII CloseIterIRGenerator : public IRGenerator {