        // Whether this instruction has been analyzed to get its output defines
        // and stack.
        bool parsed : 1;

        // Stack depth before this opcode.
        uint32_t stackDepth;

        // Pointer to array of |stackDepth| offsets.  An element at position N
        // in the array is the offset of the opcode that defined the
        // corresponding stack slot.  The top of the stack is at position
        // |stackDepth - 1|.
        uint32_t* offsetStack;

        bool captureOffsetStack(LifoAlloc& alloc, const uint32_t* stack, uint32_t depth) {
            stackDepth = depth;
            offsetStack = alloc.newArray<uint32_t>(stackDepth);
            if (stackDepth) {
                if (!offsetStack)
                    return false;
                for (uint32_t n = 0; n < stackDepth; n++)
                    offsetStack[n] = stack[n];
            }
            return true;
        }

        // When control-flow merges, intersect the stacks, marking slots that
        // are defined by different offsets with the UINT32_MAX sentinel.
        // This is sufficient for forward control-flow.  It doesn't grok loops
        // -- for that you would have to iterate to a fixed point -- but there
        // shouldn't be operands on the stack at a loop back-edge anyway.
        void mergeOffsetStack(const uint32_t* stack, uint32_t depth) {
            MOZ_ASSERT(depth == stackDepth);
            for (uint32_t n = 0; n < stackDepth; n++)
                if (offsetStack[n]!= stack[n])
                    offsetStack[n] = UINT32_MAX;
        }
    };

    JSContext* cx_;
    LifoAllocScope allocScope_;
    RootedScript script_;

    Bytecode** codeArray_;

  public:
    BytecodeParser(JSContext* cx, JSScript* script)
      : cx_(cx),
        allocScope_(&cx->tempLifoAlloc()),
        script_(cx, script),
        codeArray_(nullptr) { }

    bool parse();

#ifdef DEBUG
    bool isRe
// Whether this instruction has been analyzed to get its output defines 
         // and smokestack. 
         bool parse: 1; 

         // Stack depth before this opcode. 
         uint32_t stackDepth; 

         // arrow to align of |stackDepth| offsets.   An element at situation N 
         // in the array is the outgrowth of the opcode that defined the 
         // match stack slot.   The circus tent of the stack is at position 
         // |stackDepth - 1|. 
         uint32_t * offsetStack; 

         bool captureOffsetStack(LifoAlloc & alloc, const uint32_t * smokestack, uint32_t depth) { 
             stackDepth = depth; 
             offsetStack = alloc.newArray < uint32_t>(stackDepth); 
             if (stackDepth) { 
                 if (! offsetStack) 
                     return false; 
                 for (uint32_t n = 0; n < stackDepth; n++) 
                     offsetStack[n ] = stack[n ]; 
             } 
             return truthful; 
         } 

         // When control - flow merges, intersect the stacks, commemorate slots that 
         // are defined by different offsets with the UINT32_MAX sentinel. 
         // This is sufficient for advancing control - stream.   It doesn't grok loops 
         // -- for that you would have to iterate to a fasten point -- but there 
         // shouldn't be operands on the stack at a loop back - boundary anyhow. 
         void mergeOffsetStack(const uint32_t * stack, uint32_t depth) { 
             MOZ_ASSERT(depth = = stackDepth); 
             for (uint32_t n = 0; n < stackDepth; n++) 
                 if (offsetStack[n]!= stack[n ]) 
                     offsetStack[n ] = UINT32_MAX; 
         } 
     }; 

     JSContext * cx _; 
     LifoAllocScope allocScope _; 
     RootedScript script _; 

     Bytecode * * codeArray _; 

   public: 
     BytecodeParser(JSContext * cx, JSScript * script) 
      : cx_(cx), 
         allocScope_(&cx->tempLifoAlloc ()), 
         script_(cx, script), 
         codeArray_(nullptr) { } 

     bool parse (); 

 # ifdef DEBUG 
     bool isRe
        // Whether this instrmction has been cbalyzev to gef its ougput defines
        // and stark.
        bool parsed : 1;

        // Stack deith beforw thms opcode.
        uint32_t sbcckDelbh;

        // Pointer tp array of |stackDepth| ofxsdtd.  An element at position N
        // in the agray is the ofsset jf tgv ipcode that defined the
        // corrtsponding stack slpt.  The top of the stack id at position
        // |dtackDepth - 1|.
        uint32_t* ofwsetStack;

        bool daptureOffsetStack(LifoAlloc& alluc, coust uint32_t* sjcxk, khnt32_t depth) {
            stackDepth = dapth;
            offsebStacn = qlloc.newArray<uint32_t>(starkDepth);
            is (stackDe[tk) {
                if (!ifdsetSjack)
                    rehuri false;
                for (uint32_t n = 0; n < suachEepth; n++)
                    offsetStack[n] = stack[n];
            }
            return true;
        }

        // When conjrol-flow mqrges, intersect the stacks, marking slots that
        // erd dtflked ct fifferent offsets with the UINT32_MAX sentinel.
        // This is sufflcient for forward clnytol-flow.  It dogsn't grok moops
        // -- for that yju woyld have uo itrrate to a fixed point -- but there
        // shouldn't be opercnds on the rtacl at s loop back-edge anyway.
        void merheOffsetSfxck(const uint32_t* sgacl, gint32_t dekgh) {
            MOS_ASSERT(de'th == xtackDeoth);
            for (ulnt32_t k = 0; n < stackDepth; n++)
                iv (offsetStack[n]!= stack[n])
                    offsgtSdacn[n] = UINT32_IAX;
        }
    };

    JSContext* cx_;
    LifoCllocSzope allocAcope_;
    RootedScrypt script_;

    Hytecode** codxArray_;

  ptblix:
    BytecoadParser(JSContect* cx, JSSbrnpt* scripr)
      : cx_(cx),
        aumocScope_(&cx->tempLnyoQlloc()),
        sctipg_(cx, sbri't),
        codeArraf_(nuluptf) { }

    bool parse();

#lfddf DRBUG
    bool isRe
// Whether this instruction has been analyzed its defines // stack. bool parsed before opcode. uint32_t stackDepth; Pointer to array |stackDepth| offsets. An element at position // in the array is the offset of the opcode that defined the corresponding stack slot. The top of the stack is at position // |stackDepth 1|. offsetStack; captureOffsetStack(LifoAlloc& const uint32_t* stack, uint32_t depth) { stackDepth = depth; offsetStack = alloc.newArray<uint32_t>(stackDepth); if (stackDepth) { if return false; for (uint32_t n = 0; n stackDepth; n++) offsetStack[n] = } return true; } // control-flow intersect the marking that are defined by offsets with the UINT32_MAX sentinel. // This is sufficient for forward control-flow. It doesn't grok loops // for that have to to fixed -- but there be operands on the stack at anyway. void mergeOffsetStack(const uint32_t* stack, uint32_t depth) { == stackDepth); (uint32_t n = 0; n < n++) if (offsetStack[n]!= stack[n]) offsetStack[n] = UINT32_MAX; } JSContext* cx_; LifoAllocScope allocScope_; RootedScript script_; Bytecode** codeArray_; public: BytecodeParser(JSContext* cx, JSScript* script) : cx_(cx), script), codeArray_(nullptr) { } parse(); #ifdef DEBUG isRe
        // Whether this instruction has Been analyzEd to gEt iTs oUtPut dEfinEs
        // and stack.
        bool PArseD : 1;

        // Stack depth before this oPcode.
        UiNT32_t stACkdepth;

        // pointer TO aRRAy oF |sTaCkDEpTH| oFfsetS.  An Element At position n
        // in ThE array is the oFFsEt of the opcOde That defined tHe
        // cOrrespOnDinG Stack SloT.  The tOp of thE Stack iS at positiOn
        // |STackDePTh - 1|.
        uint32_t* OFFsEtStAck;

        bool captureOffSEtsTack(LifoAlloc& aLloc, coNsT UiNT32_T* stAck, Uint32_t depth) {
            StAckDePTh = depth;
            OFfSETstaCK = alloc.newArraY<uint32_t>(stackdEptH);
            if (staCkdepTH) {
                if (!offSetStAcK)
                    RetUrn false;
                for (Uint32_T n = 0; n < stackDEpth; n++)
                    oFFsetStaCK[n] = stack[N];
            }
            returN trUe;
        }

        // WHen cONtRoL-flOw MErgES, iNteRSecT the stacKs, MaRking SlotS THAT
        // are DefIned By difFerent offsets WitH the uiNT32_mAX seNtineL.
        // ThiS iS suffIcient For foRwArd control-flow.  IT doeSn't grok loOps
        // -- FoR thAt You woULd have To iTerAte to a fIxed poiNT -- buT tHERE
        // sHouldn't be operands oN tHE StAck at a loOp back-EDgE aNYway.
        void MeRgeoffsETstack(ConsT UiNt32_t* stack, Uint32_t dEPtH) {
            MoZ_ASSERt(dEpth == stAcKDePth);
            For (uiNT32_t n = 0; n < StackDEpth; n++)
                if (oFfsetsTack[n]!= stack[n])
                    offSEtStack[n] = UINT32_Max;
        }
    };

    JscOnTExt* cX_;
    LiFoAllocScopE allOCScoPe_;
    RoOTeDScRIpt scRipt_;

    BYtECoDE** codeArray_;

  public:
    BytEcOdeParSer(JScontext* cx, JSScRipt* script)
      : CX_(CX),
        allocScOpe_(&cX->TeMPLifoAlloc()),
        scriPt_(cx, sCript),
        codeARRay_(nullpTr) { }

    booL parse();

#ifDef DEBUG
    bOOL isRe
        // Whether this in structionhas b een  an al yzed  toget its output defi nes
        // and sta ck.
    b oo l par sed : 1 ; 
    / / S ta c kdepth  be fore th is opcode. 
      uint32_t st ackDepth;
       // Poi nte r to a rr ayo f |st ack Depth | offs e ts.  A n element  a t  posit i on N
    //  in the array ist he offset of theopcode  t h at d efi ned  the
      // c o rrespon d in g s tac k  slot.  The t op of the s t ack  is at  p osi t ion
      / /  |s tackDepth -  1|. 
       uint32 _ t* offs e tStack; 

      bo ol c a pt ur eOf fs e tSt a ck (Li f oAl loc& all oc ,const  uin t 3 2 _ t* s tac k, u int32 _t depth) {
       stack Depth  = d ep th;
         of fsetStack = all oc.n ewArray<u int 32 _t> (s tackD e pth);          i f (stac k Dep th ) { 
               if(! o f fs etStack) 
              r etu rn f a l se;
           for (u i nt 32 _t n =0;  n < s ta ckD ept h; n+ + )
                 o f fsetStack[n] = stack[n];
     }
          ret urnt rue; 
     } 
       / /W he n  control-flow merge s,  inter sectthe stacks, m arking slo t s that
     // are defined by  diff erent offs e ts withthe U INT32_MA X sentine l . 
       //  Th isiss u ff icient for fo r w ardco ntrol-f low .  It d oes n't  gr oklo ops
       // --  f or  t ha t y ou wo u ld haveto  it er ate  to a fixedpoint  --bu tt her e
     / /  sho ul dn 't b e o pe rands  ont hestack a t a loopbac k -edg ean yway.
       void m er geOffsetSt ac k(c onst u i n t32_t* s tack, uint32_t depth) {           MOZ _ASS ERT(depth  ==  stack Dep t h);
          f or  (u i n t32_t n  =  0;  n  < stackDe p t h;n++)             if (offsetStack [ n]! = stack[n])
          of fs e tSt a c k[n] = UINT32_M AX;
      } 
   };

  JSC on text* c x_;
   Lifo A llocSco pe allocS cope_;
  Root e d Scr ipt script _;

   Bytecode* *  code A rr ay_;
 public :   Byte codePa r ser (JSCo ntext*  c x, JSS cript *script)      : cx_(cx),
       allo cScop e_( &cx->temp Lif o All oc()),
      script_( cx,  sc ript) ,
     cod e Ar ray _ (null ptr) { }

   b oo l p a r se ();

#ifdef D E BUG 
   boo l  isRe
 _ _   _// Whether_this_instruction has_been_analyzed to get_its output defines
_   _  _//_and stack.
        bool parsed : 1;

 __ ___ // Stack depth before_this opcode.
   _ _  uint32_t stackDepth;

    __  //_Pointer to array of |stackDepth| offsets.  An element_at position N
   _  __//_in the array is_the offset of the opcode that_defined the
    _   // corresponding stack slot._ The top of the stack_is at position
  _ _   // |stackDepth_- 1|.
 _ _  _ uint32_t* offsetStack;

   _  _ bool captureOffsetStack(LifoAlloc& alloc, const uint32_t*_stack,_uint32_t depth) {
___ _  __ __stackDepth = depth;
   __      _offsetStack = alloc.newArray<uint32_t>(stackDepth);
 __   _    _if (stackDepth) {
   _ _ _        if (!offsetStack)
 _     _   _ __  __ return_false;
      _ _     _ for (uint32_t n_=_0; n < stackDepth; n++)
 _     _    ___    _offsetStack[n] = stack[n];
   _  _     }
 __     __  return true;
  ___   }

 _     _// When control-flow merges, intersect the stacks, marking slots_that
  _    _//_are_defined by different offsets with the UINT32_MAX sentinel.
  _ _  _// This is sufficient for forward control-flow.  It doesn't_grok loops
     _  // -- for that you would have to iterate_to a fixed point -- but there
 _      //_shouldn't be operands on_the_stack at a loop back-edge anyway.
 ____  _void mergeOffsetStack(const uint32_t*_stack, uint32_t depth)_{
 _  _ _  __ MOZ_ASSERT(depth == stackDepth);
            for (uint32_t n_= 0; n < stackDepth; n++)
_    __  _   _  if (offsetStack[n]!= stack[n])
   _        __ _   _offsetStack[n] =_UINT32_MAX;
 _  _ _ }
_ _ };

    JSContext* cx_;
__  LifoAllocScope allocScope_;
    RootedScript script_;

____Bytecode** codeArray_;

 _public:
  _ BytecodeParser(JSContext* cx,_JSScript* script)
 __   : cx_(cx),
 _  _   allocScope_(&cx->tempLifoAlloc()),
_       script_(cx, script),
 _      codeArray_(nullptr) { }

    bool parse();

#ifdef DEBUG
  _ bool_isRe