Bug 1397385 - Clarify use of JSOP_GIMPLICITTHIS. r=tcampbell, a=npotb
authorJim Blandy <jimb@mozilla.com>
Thu, 07 Sep 2017 14:37:30 -0700
changeset 431953 17a2791683e811faafe3841809bca916a2c98d6c
parent 431952 fe72a46992c1d2cdbf5bb84f67838c180e0202f5
child 431954 dabec7472928b6cfedce1a961b7a92387dcf0720
push id7846
push userryanvm@gmail.com
push dateThu, 28 Sep 2017 16:35:23 +0000
treeherdermozilla-beta@2429ebbd68a9 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerstcampbell, npotb
bugs1397385
milestone57.0
Bug 1397385 - Clarify use of JSOP_GIMPLICITTHIS. r=tcampbell, a=npotb
js/src/vm/Opcodes.h
--- a/js/src/vm/Opcodes.h
+++ b/js/src/vm/Opcodes.h
@@ -1621,18 +1621,24 @@ 1234567890123456789012345678901234567890
      *   Category: Variables and Scopes
      *   Type: Free Variables
      *   Operands: uint32_t nameIndex
      *   Stack: env, val => val
      */ \
     macro(JSOP_STRICTSETGNAME, 156, "strict-setgname",  NULL,       5,  2,  1, JOF_ATOM|JOF_NAME|JOF_PROPSET|JOF_DETECTING|JOF_GNAME|JOF_CHECKSTRICT) \
     /*
      * Pushes the implicit 'this' value for calls to the associated name onto
-     * the stack; only used when we know this implicit this will be our first
-     * non-syntactic scope.
+     * the stack; only used when the implicit this might be derived from a
+     * non-syntactic scope (instead of the global itself).
+     *
+     * Note that code evaluated via the Debugger API uses DebugEnvironmentProxy
+     * objects on its scope chain, which are non-syntactic environments that
+     * refer to syntactic environments. As a result, the binding we want may be
+     * held by a syntactic environments such as CallObject or
+     * VarEnvrionmentObject.
      *
      *   Category: Variables and Scopes
      *   Type: This
      *   Operands: uint32_t nameIndex
      *   Stack: => this
      */                                                                 \
     macro(JSOP_GIMPLICITTHIS, 157, "gimplicitthis", "",      5,  0,  1,  JOF_ATOM) \
     /*