mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 838813 part 8 - Remove SRC_LABEL and SRC_LABELBRACE. r=njn.
--HG-- extra : rebase_source : 4d6e2c9c541e9021f28c1d689af5f074fa5b4b46
This commit is contained in:
parent
e71356e4f5
commit
8a32dcd7b5
@ -5317,8 +5317,7 @@ EmitLabel(JSContext *cx, BytecodeEmitter *bce, ParseNode *pn)
|
||||
{
|
||||
/*
|
||||
* Emit a JSOP_LABEL instruction. The argument is the offset to the statement
|
||||
* following the labeled statement. This op has either a SRC_LABEL or
|
||||
* SRC_LABELBRACE source note for the decompiler.
|
||||
* following the labeled statement.
|
||||
*/
|
||||
JSAtom *atom = pn->pn_atom;
|
||||
|
||||
@ -5326,16 +5325,6 @@ EmitLabel(JSContext *cx, BytecodeEmitter *bce, ParseNode *pn)
|
||||
if (!bce->makeAtomIndex(atom, &index))
|
||||
return false;
|
||||
|
||||
ParseNode *pn2 = pn->expr();
|
||||
SrcNoteType noteType = (pn2->isKind(PNK_STATEMENTLIST) ||
|
||||
(pn2->isKind(PNK_LEXICALSCOPE) &&
|
||||
pn2->expr()->isKind(PNK_STATEMENTLIST)))
|
||||
? SRC_LABELBRACE
|
||||
: SRC_LABEL;
|
||||
ptrdiff_t noteIndex = NewSrcNote2(cx, bce, noteType, ptrdiff_t(index));
|
||||
if (noteIndex < 0)
|
||||
return false;
|
||||
|
||||
ptrdiff_t top = EmitJump(cx, bce, JSOP_LABEL, 0);
|
||||
if (top < 0)
|
||||
return false;
|
||||
@ -5344,20 +5333,13 @@ EmitLabel(JSContext *cx, BytecodeEmitter *bce, ParseNode *pn)
|
||||
StmtInfoBCE stmtInfo(cx);
|
||||
PushStatementBCE(bce, &stmtInfo, STMT_LABEL, bce->offset());
|
||||
stmtInfo.label = atom;
|
||||
if (!EmitTree(cx, bce, pn2))
|
||||
if (!EmitTree(cx, bce, pn->expr()))
|
||||
return false;
|
||||
if (!PopStatementBCE(cx, bce))
|
||||
return false;
|
||||
|
||||
/* Patch the JSOP_LABEL offset. */
|
||||
SetJumpOffsetAt(bce, top);
|
||||
|
||||
/* If the statement was compound, emit a note for the end brace. */
|
||||
if (noteType == SRC_LABELBRACE) {
|
||||
if (NewSrcNote(cx, bce, SRC_ENDBRACE) < 0 || Emit1(cx, bce, JSOP_NOP) < 0)
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
|
@ -279,8 +279,6 @@ enum SrcNoteType {
|
||||
SRC_ASSIGNOP = 8, /* += or another assign-op follows */
|
||||
SRC_COND = 9, /* JSOP_IFEQ is from conditional ?: operator */
|
||||
SRC_HIDDEN = 11, /* opcode shouldn't be decompiled */
|
||||
SRC_LABEL = 13, /* JSOP_LABEL for label: with atomid immediate */
|
||||
SRC_LABELBRACE = 14, /* JSOP_LABEL for label: {...} begin brace */
|
||||
SRC_ENDBRACE = 15, /* JSOP_NOP for label: {...} end brace */
|
||||
SRC_BREAK2LABEL = 16, /* JSOP_GOTO for 'break label' with atomid */
|
||||
SRC_CONT2LABEL = 17, /* JSOP_GOTO for 'continue label' with atomid */
|
||||
|
@ -1718,11 +1718,6 @@ SrcNotes(JSContext *cx, HandleScript script, Sprinter *sp)
|
||||
offset += delta;
|
||||
SrcNoteType type = (SrcNoteType) SN_TYPE(sn);
|
||||
const char *name = js_SrcNoteSpec[type].name;
|
||||
if (type == SRC_LABEL) {
|
||||
/* Check if the source note is for a switch case. */
|
||||
if (switchTableStart <= offset && offset < switchTableEnd)
|
||||
name = "case";
|
||||
}
|
||||
Sprint(sp, "%3u: %4u %5u [%4u] %-8s", unsigned(sn - notes), lineno, offset, delta, name);
|
||||
switch (type) {
|
||||
case SRC_COLSPAN:
|
||||
@ -1754,8 +1749,6 @@ SrcNotes(JSContext *cx, HandleScript script, Sprinter *sp)
|
||||
case SRC_PCDELTA:
|
||||
Sprint(sp, " offset %u", unsigned(js_GetSrcNoteOffset(sn, 0)));
|
||||
break;
|
||||
case SRC_LABEL:
|
||||
case SRC_LABELBRACE:
|
||||
case SRC_BREAK2LABEL:
|
||||
case SRC_CONT2LABEL: {
|
||||
uint32_t index = js_GetSrcNoteOffset(sn, 0);
|
||||
|
Loading…
Reference in New Issue
Block a user