Bug 1763103 - Part 4: Only initialise home object for private instance accessors when neeeded. r=arai

Private instance accessors were always initialising the home object, even when
`needsHomeObject()` was `false`.

Depends on D142931

Differential Revision: https://phabricator.services.mozilla.com/D142932
This commit is contained in:
André Bargull 2022-04-07 11:12:54 +00:00
Родитель 47c3eea2cb
Коммит 4d5a126c0f
1 изменённых файлов: 7 добавлений и 5 удалений

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

@ -9862,11 +9862,13 @@ bool BytecodeEmitter::emitPrivateMethodInitializers(ClassEmitter& ce,
}
// The private method body needs to access the home object,
// and the CE knows where that is on the stack.
if (!ce.emitMemberInitializerHomeObject(false)) {
// [stack] HOMEOBJ HERITAGE? ARRAY METHOD
// or:
// [stack] CTOR HOMEOBJ ARRAY METHOD
return false;
if (classMethod->method().funbox()->needsHomeObject()) {
if (!ce.emitMemberInitializerHomeObject(false)) {
// [stack] HOMEOBJ HERITAGE? ARRAY METHOD
// or:
// [stack] CTOR HOMEOBJ ARRAY METHOD
return false;
}
}
if (!emitLexicalInitialization(storedMethodAtom)) {
// [stack] HOMEOBJ HERITAGE? ARRAY METHOD