Bug 1143194 - Rename JSTRY_ITER to JSTRY_FOR_IN. (r=jorendorff)
authorShu-yu Guo <shu@rfrn.org>
Sat, 21 Mar 2015 14:11:14 -0700
changeset 263787 2f99a9eb19eecabe9c5be8fd943fc63be73bfc5a
parent 263786 117d8de21ad5fbf88a7270493cb822f03a7b7dcd
child 263788 8b1896147f4120c29fbdf541e55c2960bb6eae19
push id4718
push userraliiev@mozilla.com
push dateMon, 11 May 2015 18:39:53 +0000
treeherdermozilla-beta@c20c4ef55f08 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjorendorff
bugs1143194
milestone39.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1143194 - Rename JSTRY_ITER to JSTRY_FOR_IN. (r=jorendorff)
js/src/frontend/BytecodeEmitter.cpp
js/src/jit/BaselineBailouts.cpp
js/src/jit/BytecodeAnalysis.cpp
js/src/jit/JitFrames.cpp
js/src/jsopcode.cpp
js/src/jsscript.cpp
js/src/jsscript.h
js/src/shell/js.cpp
js/src/vm/Interpreter.cpp
js/src/vm/ObjectGroup.cpp
--- a/js/src/frontend/BytecodeEmitter.cpp
+++ b/js/src/frontend/BytecodeEmitter.cpp
@@ -5076,17 +5076,17 @@ BytecodeEmitter::emitForIn(ParseNode *pn
 
     // Fix up breaks and continues.
     popStatement();
 
     // Pop the enumeration value.
     if (!emit1(JSOP_POP))
         return false;
 
-    if (!tryNoteList.append(JSTRY_ITER, this->stackDepth, top, offset()))
+    if (!tryNoteList.append(JSTRY_FOR_IN, this->stackDepth, top, offset()))
         return false;
     if (!emit1(JSOP_ENDITER))
         return false;
 
     if (letDecl) {
         if (!LeaveNestedScope(cx, this, &letStmt))
             return false;
     }
--- a/js/src/jit/BaselineBailouts.cpp
+++ b/js/src/jit/BaselineBailouts.cpp
@@ -479,17 +479,17 @@ HasLiveIteratorAtStackDepth(JSScript *sc
     uint32_t pcOffset = uint32_t(pc - script->main());
     for (; tn != tnEnd; ++tn) {
         if (pcOffset < tn->start)
             continue;
         if (pcOffset >= tn->start + tn->length)
             continue;
 
         // For-in loops have only the iterator on stack.
-        if (tn->kind == JSTRY_ITER && stackDepth == tn->stackDepth)
+        if (tn->kind == JSTRY_FOR_IN && stackDepth == tn->stackDepth)
             return true;
 
         // For-of loops have both the iterator and the result on stack.
         if (tn->kind == JSTRY_FOR_OF &&
             (stackDepth == tn->stackDepth || stackDepth == tn->stackDepth - 1))
         {
             return true;
         }
--- a/js/src/jit/BytecodeAnalysis.cpp
+++ b/js/src/jit/BytecodeAnalysis.cpp
@@ -108,17 +108,17 @@ BytecodeAnalysis::init(TempAllocator &al
           case JSOP_TRY: {
             JSTryNote *tn = script_->trynotes()->vector;
             JSTryNote *tnlimit = tn + script_->trynotes()->length;
             for (; tn < tnlimit; tn++) {
                 unsigned startOffset = script_->mainOffset() + tn->start;
                 if (startOffset == offset + 1) {
                     unsigned catchOffset = startOffset + tn->length;
 
-                    if (tn->kind != JSTRY_ITER) {
+                    if (tn->kind != JSTRY_FOR_IN) {
                         infos_[catchOffset].init(stackDepth);
                         infos_[catchOffset].jumpTarget = true;
                     }
                 }
             }
 
             // Get the pc of the last instruction in the try block. It's a JSOP_GOTO to
             // jump over the catch/finally blocks.
--- a/js/src/jit/JitFrames.cpp
+++ b/js/src/jit/JitFrames.cpp
@@ -451,17 +451,17 @@ HandleExceptionIon(JSContext *cx, const 
     uint32_t pcOffset = uint32_t(pc - script->main());
     for (; tn != tnEnd; ++tn) {
         if (pcOffset < tn->start)
             continue;
         if (pcOffset >= tn->start + tn->length)
             continue;
 
         switch (tn->kind) {
-          case JSTRY_ITER: {
+          case JSTRY_FOR_IN: {
             MOZ_ASSERT(JSOp(*(script->main() + tn->start + tn->length)) == JSOP_ENDITER);
             MOZ_ASSERT(tn->stackDepth > 0);
 
             uint32_t localSlot = tn->stackDepth;
             CloseLiveIterator(cx, frame, localSlot);
             break;
           }
 
@@ -661,17 +661,17 @@ HandleExceptionBaseline(JSContext *cx, c
                 // Drop the exception instead of leaking cross compartment data.
                 if (!cx->getPendingException(MutableHandleValue::fromMarkedLocation(&rfe->exception)))
                     rfe->exception = UndefinedValue();
                 cx->clearPendingException();
                 return;
             }
             break;
 
-          case JSTRY_ITER: {
+          case JSTRY_FOR_IN: {
             Value iterValue(* (Value *) rfe->stackPointer);
             RootedObject iterObject(cx, &iterValue.toObject());
             if (cx->isExceptionPending())
                 UnwindIteratorForException(cx, iterObject);
             else
                 UnwindIteratorForUncatchableException(cx, iterObject);
             break;
           }
--- a/js/src/jsopcode.cpp
+++ b/js/src/jsopcode.cpp
@@ -642,17 +642,17 @@ BytecodeParser::parse()
             // exception but is not caught by a later handler in the same function:
             // no more code will execute, and it does not matter what is defined.
             JSTryNote *tn = script_->trynotes()->vector;
             JSTryNote *tnlimit = tn + script_->trynotes()->length;
             for (; tn < tnlimit; tn++) {
                 uint32_t startOffset = script_->mainOffset() + tn->start;
                 if (startOffset == offset + 1) {
                     uint32_t catchOffset = startOffset + tn->length;
-                    if (tn->kind != JSTRY_ITER && tn->kind != JSTRY_LOOP) {
+                    if (tn->kind != JSTRY_FOR_IN && tn->kind != JSTRY_LOOP) {
                         if (!addJump(catchOffset, &nextOffset, stackDepth, offsetStack))
                             return false;
                     }
                 }
             }
             break;
           }
 
--- a/js/src/jsscript.cpp
+++ b/js/src/jsscript.cpp
@@ -3918,17 +3918,17 @@ JSScript::updateBaselineOrIonRaw(JSConte
 bool
 JSScript::hasLoops()
 {
     if (!hasTrynotes())
         return false;
     JSTryNote *tn = trynotes()->vector;
     JSTryNote *tnlimit = tn + trynotes()->length;
     for (; tn < tnlimit; tn++) {
-        if (tn->kind == JSTRY_ITER || tn->kind == JSTRY_LOOP)
+        if (tn->kind == JSTRY_FOR_IN || tn->kind == JSTRY_LOOP)
             return true;
     }
     return false;
 }
 
 static inline void
 LazyScriptHash(uint32_t lineno, uint32_t column, uint32_t begin, uint32_t end,
                HashNumber hashes[3])
--- a/js/src/jsscript.h
+++ b/js/src/jsscript.h
@@ -61,17 +61,17 @@ namespace frontend {
  * Type of try note associated with each catch or finally block, and also with
  * for-in and other kinds of loops. Non-for-in loops do not need these notes
  * for exception unwinding, but storing their boundaries here is helpful for
  * heuristics that need to know whether a given op is inside a loop.
  */
 enum JSTryNoteKind {
     JSTRY_CATCH,
     JSTRY_FINALLY,
-    JSTRY_ITER,
+    JSTRY_FOR_IN,
     JSTRY_FOR_OF,
     JSTRY_LOOP
 };
 
 /*
  * Exception handling record.
  */
 struct JSTryNote {
--- a/js/src/shell/js.cpp
+++ b/js/src/shell/js.cpp
@@ -2177,19 +2177,19 @@ Notes(JSContext *cx, unsigned argc, jsva
     if (!str)
         return false;
     args.rval().setString(str);
     return true;
 }
 
 JS_STATIC_ASSERT(JSTRY_CATCH == 0);
 JS_STATIC_ASSERT(JSTRY_FINALLY == 1);
-JS_STATIC_ASSERT(JSTRY_ITER == 2);
-
-static const char* const TryNoteNames[] = { "catch", "finally", "iter", "for-of", "loop" };
+JS_STATIC_ASSERT(JSTRY_FOR_IN == 2);
+
+static const char* const TryNoteNames[] = { "catch", "finally", "for-in", "for-of", "loop" };
 
 static bool
 TryNotes(JSContext *cx, HandleScript script, Sprinter *sp)
 {
     JSTryNote *tn, *tnlimit;
 
     if (!script->hasTrynotes())
         return true;
--- a/js/src/vm/Interpreter.cpp
+++ b/js/src/vm/Interpreter.cpp
@@ -1012,17 +1012,17 @@ ForcedReturn(JSContext *cx, InterpreterR
 }
 
 void
 js::UnwindForUncatchableException(JSContext *cx, const InterpreterRegs &regs)
 {
     /* c.f. the regular (catchable) TryNoteIter loop in HandleError. */
     for (TryNoteIter tni(cx, regs); !tni.done(); ++tni) {
         JSTryNote *tn = *tni;
-        if (tn->kind == JSTRY_ITER) {
+        if (tn->kind == JSTRY_FOR_IN) {
             Value *sp = regs.spForStackDepth(tn->stackDepth);
             UnwindIteratorForUncatchableException(cx, &sp[-1].toObject());
         }
     }
 }
 
 TryNoteIter::TryNoteIter(JSContext *cx, const InterpreterRegs &regs)
   : regs(regs),
@@ -1146,17 +1146,17 @@ HandleError(JSContext *cx, InterpreterRe
                     return ErrorReturnContinuation;
                 if (exception.isMagic(JS_GENERATOR_CLOSING))
                     break;
                 return CatchContinuation;
 
               case JSTRY_FINALLY:
                 return FinallyContinuation;
 
-              case JSTRY_ITER: {
+              case JSTRY_FOR_IN: {
                 /* This is similar to JSOP_ENDITER in the interpreter loop. */
                 MOZ_ASSERT(JSOp(*regs.pc) == JSOP_ENDITER);
                 RootedObject obj(cx, &regs.sp[-1].toObject());
                 bool ok = UnwindIteratorForException(cx, obj);
                 regs.sp -= 1;
                 if (!ok)
                     goto again;
                 break;
--- a/js/src/vm/ObjectGroup.cpp
+++ b/js/src/vm/ObjectGroup.cpp
@@ -204,29 +204,29 @@ ObjectGroup::useSingletonForAllocationSi
     if (key != JSProto_Object &&
         !(key >= JSProto_Int8Array && key <= JSProto_Uint8ClampedArray) &&
         !(key >= JSProto_SharedInt8Array && key <= JSProto_SharedUint8ClampedArray))
     {
         return GenericObject;
     }
 
     /*
-     * All loops in the script will have a JSTRY_ITER or JSTRY_LOOP try note
+     * All loops in the script will have a JSTRY_FOR_IN or JSTRY_LOOP try note
      * indicating their boundary.
      */
 
     if (!script->hasTrynotes())
         return SingletonObject;
 
     unsigned offset = script->pcToOffset(pc);
 
     JSTryNote *tn = script->trynotes()->vector;
     JSTryNote *tnlimit = tn + script->trynotes()->length;
     for (; tn < tnlimit; tn++) {
-        if (tn->kind != JSTRY_ITER && tn->kind != JSTRY_LOOP)
+        if (tn->kind != JSTRY_FOR_IN && tn->kind != JSTRY_LOOP)
             continue;
 
         unsigned startOffset = script->mainOffset() + tn->start;
         unsigned endOffset = startOffset + tn->length;
 
         if (offset >= startOffset && offset < endOffset)
             return GenericObject;
     }