Bug 1619007 - Part 1: Remove unnecessary manual stack depth adjustment. r=cfallin

The preceding `JSOp::{Object,NewObject,NewObjectWithGroup,NewArrayCopyOnWrite}`
opcode already performs the correct stack depth adjustment.

Differential Revision: https://phabricator.services.mozilla.com/D65768

--HG--
extra : moz-landing-system : lando
This commit is contained in:
André Bargull 2020-03-06 20:31:00 +00:00
Родитель 9b9f2e2f0f
Коммит d5b122477c
1 изменённых файлов: 3 добавлений и 8 удалений

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

@ -8541,8 +8541,6 @@ bool BytecodeEmitter::emitPropertyList(ListNode* obj, PropertyEmitter& pe,
bool BytecodeEmitter::emitPropertyListObjLiteral(ListNode* obj,
PropListType type,
ObjLiteralFlags flags) {
int32_t stackDepth = bytecodeSection().stackDepth();
ObjLiteralCreationData data(cx);
data.writer().beginObject(flags);
bool noValues = flags.contains(ObjLiteralFlag::NoValues);
@ -8594,18 +8592,15 @@ bool BytecodeEmitter::emitPropertyListObjLiteral(ListNode* obj,
JSOp op = singleton
? JSOp::Object
: isInnerSingleton ? JSOp::NewObjectWithGroup : JSOp::NewObject;
bool success = emitIndexOp(op, gcThingIndex);
if (!success) {
if (!emitIndexOp(op, gcThingIndex)) {
// [stack] OBJ
return false;
}
bytecodeSection().setStackDepth(stackDepth + 1);
return true;
}
bool BytecodeEmitter::emitObjLiteralArray(ParseNode* arrayHead, bool isCow) {
int32_t stackDepth = bytecodeSection().stackDepth();
ObjLiteralCreationData data(cx);
ObjLiteralFlags flags(ObjLiteralFlag::Array);
if (isCow) {
@ -8628,10 +8623,10 @@ bool BytecodeEmitter::emitObjLiteralArray(ParseNode* arrayHead, bool isCow) {
JSOp op = isCow ? JSOp::NewArrayCopyOnWrite : JSOp::Object;
if (!emitIndexOp(op, gcThingIndex)) {
// [stack] OBJ
return false;
}
bytecodeSection().setStackDepth(stackDepth + 1);
return true;
}