Skip to content
This repository was archived by the owner on Jul 9, 2025. It is now read-only.

Commit 393e8a2

Browse files
committed
Backed out 9 changesets (bug 1602530) for SM bustage at /gdb-tests.cpp on a CLOSED TREE.
Backed out changeset f128305cb5c0 (bug 1602530) Backed out changeset 6e2c26f28375 (bug 1602530) Backed out changeset 0024aa0271c0 (bug 1602530) Backed out changeset ad18731b2f15 (bug 1602530) Backed out changeset 9b7d13e0fe06 (bug 1602530) Backed out changeset afac7a2e6a30 (bug 1602530) Backed out changeset 029e060da554 (bug 1602530) Backed out changeset 80922e1c6330 (bug 1602530) Backed out changeset d67d92c7d208 (bug 1602530)
1 parent 5f548f3 commit 393e8a2

9 files changed

Lines changed: 1850 additions & 2037 deletions

File tree

js/src/debugger/Script.cpp

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1708,6 +1708,11 @@ static bool BytecodeIsEffectful(JSOp op) {
17081708
case JSOP_RETSUB:
17091709
case JSOP_THROWMSG:
17101710
case JSOP_FORCEINTERPRETER:
1711+
case JSOP_UNUSED71:
1712+
case JSOP_UNUSED106:
1713+
case JSOP_UNUSED120:
1714+
case JSOP_UNUSED149:
1715+
case JSOP_UNUSED227:
17111716
case JSOP_LIMIT:
17121717
return false;
17131718
}

js/src/jit/BaselineCodeGen.cpp

Lines changed: 25 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -6719,18 +6719,6 @@ bool BaselineInterpreterCodeGen::emit_JSOP_INSTRUMENTATION_SCRIPT_ID() {
67196719
return true;
67206720
}
67216721

6722-
template <>
6723-
bool BaselineCompilerCodeGen::emit_JSOP_FORCEINTERPRETER() {
6724-
// Caller is responsible for checking script->hasForceInterpreterOp().
6725-
MOZ_CRASH("JSOP_FORCEINTERPRETER in baseline");
6726-
}
6727-
6728-
template <>
6729-
bool BaselineInterpreterCodeGen::emit_JSOP_FORCEINTERPRETER() {
6730-
masm.assumeUnreachable("JSOP_FORCEINTERPRETER");
6731-
return true;
6732-
}
6733-
67346722
template <typename Handler>
67356723
bool BaselineCodeGen<Handler>::emitPrologue() {
67366724
#ifdef JS_USE_LINK_REGISTER
@@ -6893,18 +6881,24 @@ MethodStatus BaselineCompiler::emitBody() {
68936881
return Method_Error;
68946882
}
68956883

6896-
#define EMIT_OP(OP, ...) \
6897-
case OP: \
6898-
if (MOZ_UNLIKELY(!this->emit_##OP())) return Method_Error; \
6899-
break;
6900-
69016884
switch (op) {
6902-
FOR_EACH_OPCODE(EMIT_OP)
6903-
default:
6885+
case JSOP_FORCEINTERPRETER:
6886+
// Caller must have checked script->hasForceInterpreterOp().
6887+
case JSOP_UNUSED71:
6888+
case JSOP_UNUSED106:
6889+
case JSOP_UNUSED120:
6890+
case JSOP_UNUSED149:
6891+
case JSOP_UNUSED227:
6892+
case JSOP_LIMIT:
69046893
MOZ_CRASH("Unexpected op");
6905-
}
69066894

6895+
#define EMIT_OP(OP) \
6896+
case OP: \
6897+
if (MOZ_UNLIKELY(!this->emit_##OP())) return Method_Error; \
6898+
break;
6899+
OPCODE_LIST(EMIT_OP)
69076900
#undef EMIT_OP
6901+
}
69086902

69096903
MOZ_ASSERT(masm.framePushed() == 0);
69106904

@@ -7011,7 +7005,7 @@ bool BaselineInterpreterGenerator::emitInterpreterLoop() {
70117005

70127006
// Emit code for each bytecode op.
70137007
Label opLabels[JSOP_LIMIT];
7014-
#define EMIT_OP(OP, ...) \
7008+
#define EMIT_OP(OP) \
70157009
{ \
70167010
masm.bind(&opLabels[OP]); \
70177011
handler.setCurrentOp(OP); \
@@ -7023,7 +7017,7 @@ bool BaselineInterpreterGenerator::emitInterpreterLoop() {
70237017
} \
70247018
handler.resetCurrentOp(); \
70257019
}
7026-
FOR_EACH_OPCODE(EMIT_OP)
7020+
OPCODE_LIST(EMIT_OP)
70277021
#undef EMIT_OP
70287022

70297023
// External entry point to start interpreting bytecode ops. This is used for
@@ -7059,6 +7053,11 @@ bool BaselineInterpreterGenerator::emitInterpreterLoop() {
70597053
masm.jump(handlerCode);
70607054
}
70617055

7056+
// Emit code for JSOP_UNUSED* ops.
7057+
Label invalidOp;
7058+
masm.bind(&invalidOp);
7059+
masm.assumeUnreachable("Invalid op");
7060+
70627061
// Emit the table.
70637062
masm.haltingAlign(sizeof(void*));
70647063

@@ -7070,11 +7069,13 @@ bool BaselineInterpreterGenerator::emitInterpreterLoop() {
70707069
tableOffset_ = masm.currentOffset();
70717070

70727071
for (size_t i = 0; i < JSOP_LIMIT; i++) {
7072+
// Store a pointer to the code for the current op. If the op's label is not
7073+
// bound it must be a JSOP_UNUSED* op and we use |invalidOp| instead.
70737074
const Label& opLabel = opLabels[i];
7074-
MOZ_ASSERT(opLabel.bound());
7075+
uint32_t opOffset = opLabel.bound() ? opLabel.offset() : invalidOp.offset();
70757076
CodeLabel cl;
70767077
masm.writeCodePointer(&cl);
7077-
cl.target()->bind(opLabel.offset());
7078+
cl.target()->bind(opOffset);
70787079
masm.addCodeLabel(cl);
70797080
}
70807081

js/src/jit/BaselineCodeGen.h

Lines changed: 241 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,245 @@ enum class GeneratorResumeKind;
1919

2020
namespace jit {
2121

22+
#define OPCODE_LIST(_) \
23+
_(JSOP_NOP) \
24+
_(JSOP_NOP_DESTRUCTURING) \
25+
_(JSOP_ITERNEXT) \
26+
_(JSOP_POP) \
27+
_(JSOP_POPN) \
28+
_(JSOP_DUPAT) \
29+
_(JSOP_ENTERWITH) \
30+
_(JSOP_LEAVEWITH) \
31+
_(JSOP_DUP) \
32+
_(JSOP_DUP2) \
33+
_(JSOP_SWAP) \
34+
_(JSOP_PICK) \
35+
_(JSOP_UNPICK) \
36+
_(JSOP_GOTO) \
37+
_(JSOP_IFEQ) \
38+
_(JSOP_IFNE) \
39+
_(JSOP_AND) \
40+
_(JSOP_OR) \
41+
_(JSOP_NOT) \
42+
_(JSOP_POS) \
43+
_(JSOP_TONUMERIC) \
44+
_(JSOP_LOOPHEAD) \
45+
_(JSOP_VOID) \
46+
_(JSOP_UNDEFINED) \
47+
_(JSOP_HOLE) \
48+
_(JSOP_NULL) \
49+
_(JSOP_TRUE) \
50+
_(JSOP_FALSE) \
51+
_(JSOP_ZERO) \
52+
_(JSOP_ONE) \
53+
_(JSOP_INT8) \
54+
_(JSOP_INT32) \
55+
_(JSOP_UINT16) \
56+
_(JSOP_UINT24) \
57+
_(JSOP_RESUMEINDEX) \
58+
_(JSOP_DOUBLE) \
59+
_(JSOP_BIGINT) \
60+
_(JSOP_STRING) \
61+
_(JSOP_SYMBOL) \
62+
_(JSOP_OBJECT) \
63+
_(JSOP_CALLSITEOBJ) \
64+
_(JSOP_REGEXP) \
65+
_(JSOP_LAMBDA) \
66+
_(JSOP_LAMBDA_ARROW) \
67+
_(JSOP_SETFUNNAME) \
68+
_(JSOP_BITOR) \
69+
_(JSOP_BITXOR) \
70+
_(JSOP_BITAND) \
71+
_(JSOP_LSH) \
72+
_(JSOP_RSH) \
73+
_(JSOP_URSH) \
74+
_(JSOP_ADD) \
75+
_(JSOP_SUB) \
76+
_(JSOP_MUL) \
77+
_(JSOP_DIV) \
78+
_(JSOP_MOD) \
79+
_(JSOP_POW) \
80+
_(JSOP_LT) \
81+
_(JSOP_LE) \
82+
_(JSOP_GT) \
83+
_(JSOP_GE) \
84+
_(JSOP_EQ) \
85+
_(JSOP_NE) \
86+
_(JSOP_STRICTEQ) \
87+
_(JSOP_STRICTNE) \
88+
_(JSOP_CASE) \
89+
_(JSOP_DEFAULT) \
90+
_(JSOP_LINENO) \
91+
_(JSOP_BITNOT) \
92+
_(JSOP_NEG) \
93+
_(JSOP_NEWARRAY) \
94+
_(JSOP_NEWARRAY_COPYONWRITE) \
95+
_(JSOP_INITELEM_ARRAY) \
96+
_(JSOP_NEWOBJECT) \
97+
_(JSOP_NEWOBJECT_WITHGROUP) \
98+
_(JSOP_NEWINIT) \
99+
_(JSOP_INITELEM) \
100+
_(JSOP_INITELEM_GETTER) \
101+
_(JSOP_INITELEM_SETTER) \
102+
_(JSOP_INITELEM_INC) \
103+
_(JSOP_MUTATEPROTO) \
104+
_(JSOP_INITPROP) \
105+
_(JSOP_INITLOCKEDPROP) \
106+
_(JSOP_INITHIDDENPROP) \
107+
_(JSOP_INITPROP_GETTER) \
108+
_(JSOP_INITPROP_SETTER) \
109+
_(JSOP_GETELEM) \
110+
_(JSOP_SETELEM) \
111+
_(JSOP_STRICTSETELEM) \
112+
_(JSOP_CALLELEM) \
113+
_(JSOP_DELELEM) \
114+
_(JSOP_STRICTDELELEM) \
115+
_(JSOP_GETELEM_SUPER) \
116+
_(JSOP_SETELEM_SUPER) \
117+
_(JSOP_STRICTSETELEM_SUPER) \
118+
_(JSOP_IN) \
119+
_(JSOP_HASOWN) \
120+
_(JSOP_GETGNAME) \
121+
_(JSOP_BINDGNAME) \
122+
_(JSOP_SETGNAME) \
123+
_(JSOP_STRICTSETGNAME) \
124+
_(JSOP_SETNAME) \
125+
_(JSOP_STRICTSETNAME) \
126+
_(JSOP_GETPROP) \
127+
_(JSOP_SETPROP) \
128+
_(JSOP_STRICTSETPROP) \
129+
_(JSOP_CALLPROP) \
130+
_(JSOP_DELPROP) \
131+
_(JSOP_STRICTDELPROP) \
132+
_(JSOP_GETPROP_SUPER) \
133+
_(JSOP_SETPROP_SUPER) \
134+
_(JSOP_STRICTSETPROP_SUPER) \
135+
_(JSOP_LENGTH) \
136+
_(JSOP_GETBOUNDNAME) \
137+
_(JSOP_GETALIASEDVAR) \
138+
_(JSOP_SETALIASEDVAR) \
139+
_(JSOP_GETNAME) \
140+
_(JSOP_BINDNAME) \
141+
_(JSOP_DELNAME) \
142+
_(JSOP_GETIMPORT) \
143+
_(JSOP_GETINTRINSIC) \
144+
_(JSOP_SETINTRINSIC) \
145+
_(JSOP_BINDVAR) \
146+
_(JSOP_DEFVAR) \
147+
_(JSOP_DEFCONST) \
148+
_(JSOP_DEFLET) \
149+
_(JSOP_DEFFUN) \
150+
_(JSOP_GETLOCAL) \
151+
_(JSOP_SETLOCAL) \
152+
_(JSOP_GETARG) \
153+
_(JSOP_SETARG) \
154+
_(JSOP_CHECKLEXICAL) \
155+
_(JSOP_INITLEXICAL) \
156+
_(JSOP_INITGLEXICAL) \
157+
_(JSOP_CHECKALIASEDLEXICAL) \
158+
_(JSOP_INITALIASEDLEXICAL) \
159+
_(JSOP_UNINITIALIZED) \
160+
_(JSOP_CALL) \
161+
_(JSOP_CALL_IGNORES_RV) \
162+
_(JSOP_CALLITER) \
163+
_(JSOP_FUNCALL) \
164+
_(JSOP_FUNAPPLY) \
165+
_(JSOP_NEW) \
166+
_(JSOP_EVAL) \
167+
_(JSOP_STRICTEVAL) \
168+
_(JSOP_SPREADCALL) \
169+
_(JSOP_SPREADNEW) \
170+
_(JSOP_SPREADEVAL) \
171+
_(JSOP_STRICTSPREADEVAL) \
172+
_(JSOP_OPTIMIZE_SPREADCALL) \
173+
_(JSOP_IMPLICITTHIS) \
174+
_(JSOP_GIMPLICITTHIS) \
175+
_(JSOP_INSTANCEOF) \
176+
_(JSOP_TYPEOF) \
177+
_(JSOP_TYPEOFEXPR) \
178+
_(JSOP_THROWMSG) \
179+
_(JSOP_THROW) \
180+
_(JSOP_TRY) \
181+
_(JSOP_FINALLY) \
182+
_(JSOP_GOSUB) \
183+
_(JSOP_RETSUB) \
184+
_(JSOP_PUSHLEXICALENV) \
185+
_(JSOP_POPLEXICALENV) \
186+
_(JSOP_FRESHENLEXICALENV) \
187+
_(JSOP_RECREATELEXICALENV) \
188+
_(JSOP_DEBUGLEAVELEXICALENV) \
189+
_(JSOP_PUSHVARENV) \
190+
_(JSOP_POPVARENV) \
191+
_(JSOP_EXCEPTION) \
192+
_(JSOP_DEBUGGER) \
193+
_(JSOP_ARGUMENTS) \
194+
_(JSOP_REST) \
195+
_(JSOP_TOASYNCITER) \
196+
_(JSOP_TOID) \
197+
_(JSOP_TOSTRING) \
198+
_(JSOP_TABLESWITCH) \
199+
_(JSOP_ITER) \
200+
_(JSOP_MOREITER) \
201+
_(JSOP_ISNOITER) \
202+
_(JSOP_ENDITER) \
203+
_(JSOP_ISGENCLOSING) \
204+
_(JSOP_GENERATOR) \
205+
_(JSOP_INITIALYIELD) \
206+
_(JSOP_YIELD) \
207+
_(JSOP_AWAIT) \
208+
_(JSOP_TRYSKIPAWAIT) \
209+
_(JSOP_AFTERYIELD) \
210+
_(JSOP_FINALYIELDRVAL) \
211+
_(JSOP_RESUME) \
212+
_(JSOP_ASYNCAWAIT) \
213+
_(JSOP_ASYNCRESOLVE) \
214+
_(JSOP_CALLEE) \
215+
_(JSOP_ENVCALLEE) \
216+
_(JSOP_SUPERBASE) \
217+
_(JSOP_SUPERFUN) \
218+
_(JSOP_GETRVAL) \
219+
_(JSOP_SETRVAL) \
220+
_(JSOP_RETRVAL) \
221+
_(JSOP_RETURN) \
222+
_(JSOP_FUNCTIONTHIS) \
223+
_(JSOP_GLOBALTHIS) \
224+
_(JSOP_CHECKISOBJ) \
225+
_(JSOP_CHECKISCALLABLE) \
226+
_(JSOP_CHECKTHIS) \
227+
_(JSOP_CHECKTHISREINIT) \
228+
_(JSOP_CHECKRETURN) \
229+
_(JSOP_NEWTARGET) \
230+
_(JSOP_SUPERCALL) \
231+
_(JSOP_SPREADSUPERCALL) \
232+
_(JSOP_THROWSETCONST) \
233+
_(JSOP_THROWSETALIASEDCONST) \
234+
_(JSOP_THROWSETCALLEE) \
235+
_(JSOP_INITHIDDENPROP_GETTER) \
236+
_(JSOP_INITHIDDENPROP_SETTER) \
237+
_(JSOP_INITHIDDENELEM) \
238+
_(JSOP_INITHIDDENELEM_GETTER) \
239+
_(JSOP_INITHIDDENELEM_SETTER) \
240+
_(JSOP_CHECKOBJCOERCIBLE) \
241+
_(JSOP_DEBUGCHECKSELFHOSTED) \
242+
_(JSOP_JUMPTARGET) \
243+
_(JSOP_IS_CONSTRUCTING) \
244+
_(JSOP_TRY_DESTRUCTURING) \
245+
_(JSOP_CHECKCLASSHERITAGE) \
246+
_(JSOP_INITHOMEOBJECT) \
247+
_(JSOP_BUILTINPROTO) \
248+
_(JSOP_OBJWITHPROTO) \
249+
_(JSOP_FUNWITHPROTO) \
250+
_(JSOP_CLASSCONSTRUCTOR) \
251+
_(JSOP_DERIVEDCONSTRUCTOR) \
252+
_(JSOP_IMPORTMETA) \
253+
_(JSOP_DYNAMIC_IMPORT) \
254+
_(JSOP_INC) \
255+
_(JSOP_DEC) \
256+
_(JSOP_INSTRUMENTATION_ACTIVE) \
257+
_(JSOP_INSTRUMENTATION_CALLBACK) \
258+
_(JSOP_INSTRUMENTATION_SCRIPT_ID) \
259+
_(JSOP_COALESCE)
260+
22261
enum class ScriptGCThingType { RegExp, Function, Scope, BigInt };
23262

24263
// Base class for BaselineCompiler and BaselineInterpreterGenerator. The Handler
@@ -189,8 +428,8 @@ class BaselineCodeGen {
189428
MOZ_MUST_USE bool emitTraceLoggerResume(Register script,
190429
AllocatableGeneralRegisterSet& regs);
191430

192-
#define EMIT_OP(op, ...) bool emit_##op();
193-
FOR_EACH_OPCODE(EMIT_OP)
431+
#define EMIT_OP(op) bool emit_##op();
432+
OPCODE_LIST(EMIT_OP)
194433
#undef EMIT_OP
195434

196435
// JSOP_NEG, JSOP_BITNOT, JSOP_INC, JSOP_DEC

js/src/jit/IonBuilder.cpp

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2573,6 +2573,11 @@ AbortReasonOr<Ok> IonBuilder::inspectOpcode(JSOp op, bool* restarted) {
25732573
// Intentionally not implemented.
25742574
break;
25752575

2576+
case JSOP_UNUSED71:
2577+
case JSOP_UNUSED106:
2578+
case JSOP_UNUSED120:
2579+
case JSOP_UNUSED149:
2580+
case JSOP_UNUSED227:
25762581
case JSOP_LIMIT:
25772582
break;
25782583
}

0 commit comments

Comments
 (0)