Bug 1553958 - Make JumpTarget.offset default value to invalid offset. r=jorendorff

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

--HG--
extra : moz-landing-system : lando
This commit is contained in:
Tooru Fujisawa 2019-05-30 20:24:43 +00:00
Родитель 7b233f0619
Коммит 68db989149
5 изменённых файлов: 7 добавлений и 7 удалений

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

@ -121,14 +121,14 @@ class LoopControl : public BreakableControl {
JumpList entryJump_; JumpList entryJump_;
// The bytecode offset of JSOP_LOOPHEAD. // The bytecode offset of JSOP_LOOPHEAD.
JumpTarget head_ = {BytecodeOffset::invalidOffset()}; JumpTarget head_;
// The target of break statement jumps. // The target of break statement jumps.
JumpTarget breakTarget_ = {BytecodeOffset::invalidOffset()}; JumpTarget breakTarget_;
// The target of continue statement jumps, e.g., the update portion of a // The target of continue statement jumps, e.g., the update portion of a
// for(;;) loop. // for(;;) loop.
JumpTarget continueTarget_ = {BytecodeOffset::invalidOffset()}; JumpTarget continueTarget_;
// Stack depth when this loop was pushed on the control stack. // Stack depth when this loop was pushed on the control stack.
int32_t stackDepth_; int32_t stackDepth_;

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

@ -6580,7 +6580,7 @@ bool BytecodeEmitter::emitYieldStar(ParseNode* iter) {
{ {
// goto tryStart; // goto tryStart;
JumpList beq; JumpList beq;
JumpTarget breakTarget = {BytecodeOffset::invalidOffset()}; JumpTarget breakTarget;
if (!emitBackwardJump(JSOP_GOTO, tryStart, &beq, &breakTarget)) { if (!emitBackwardJump(JSOP_GOTO, tryStart, &beq, &breakTarget)) {
// [stack] NEXT ITER RESULT // [stack] NEXT ITER RESULT
return false; return false;

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

@ -252,7 +252,7 @@ class BytecodeSection {
// ---- Jump ---- // ---- Jump ----
// Last jump target emitted. // Last jump target emitted.
JumpTarget lastTarget_ = {BytecodeOffset::invalidOffset()}; JumpTarget lastTarget_;
// ---- Stack ---- // ---- Stack ----

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

@ -55,7 +55,7 @@ namespace frontend {
// Offset of a jump target instruction, used for patching jump instructions. // Offset of a jump target instruction, used for patching jump instructions.
struct JumpTarget { struct JumpTarget {
BytecodeOffset offset; BytecodeOffset offset = BytecodeOffset::invalidOffset();
}; };
struct JumpList { struct JumpList {

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

@ -318,7 +318,7 @@ class MOZ_STACK_CLASS SwitchEmitter {
BytecodeOffset lastCaseOffset_; BytecodeOffset lastCaseOffset_;
// Bytecode offset of the JSOP_JUMPTARGET for default body. // Bytecode offset of the JSOP_JUMPTARGET for default body.
JumpTarget defaultJumpTargetOffset_ = {BytecodeOffset::invalidOffset()}; JumpTarget defaultJumpTargetOffset_;
// Bytecode offset of the JSOP_DEFAULT. // Bytecode offset of the JSOP_DEFAULT.
JumpList condSwitchDefaultOffset_; JumpList condSwitchDefaultOffset_;