Bug 1341061 - Rename GETXPROP to GETBOUNDNAME for clarity. (r=arai)
☠☠ backed out by 49187b2a8396 ☠ ☠
authorShu-yu Guo <shu@rfrn.org>
Fri, 24 Feb 2017 12:52:13 -0800
changeset 344888 76c74d43a9b0d19b0d5b229f3b7ae264edacc23b
parent 344887 2cb11cb340691f09880def000c04d6b498b72c54
child 344889 559f43c4336928f676bc2a35b196932984d2b498
push id37977
push userphilringnalda@gmail.com
push dateSat, 25 Feb 2017 21:34:46 +0000
treeherderautoland@10bfa931c92f [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersarai
bugs1341061
milestone54.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 1341061 - Rename GETXPROP to GETBOUNDNAME for clarity. (r=arai)
js/src/frontend/BytecodeEmitter.cpp
js/src/jit/BaselineCompiler.cpp
js/src/jit/BaselineCompiler.h
js/src/jit/CacheIR.cpp
js/src/jit/SharedIC.cpp
js/src/vm/Interpreter.cpp
js/src/vm/Opcodes.h
--- a/js/src/frontend/BytecodeEmitter.cpp
+++ b/js/src/frontend/BytecodeEmitter.cpp
@@ -5867,17 +5867,17 @@ BytecodeEmitter::emitAssignment(ParseNod
             if (op != JSOP_NOP) {
                 if (lhsLoc.kind() == NameLocation::Kind::Dynamic) {
                     // For dynamic accesses we can do better than a GETNAME
                     // since the assignment already emitted a BINDNAME on the
                     // top of the stack. As an optimization, use that to get
                     // the name.
                     if (!bce->emit1(JSOP_DUP))
                         return false;
-                    if (!bce->emitAtomOp(lhs, JSOP_GETXPROP))
+                    if (!bce->emitAtomOp(lhs, JSOP_GETBOUNDNAME))
                         return false;
                 } else {
                     if (!bce->emitGetNameAtLocation(lhs->name(), lhsLoc))
                         return false;
                 }
             }
 
             // Emit the RHS. If we emitted a BIND[G]NAME, then the scope is on
--- a/js/src/jit/BaselineCompiler.cpp
+++ b/js/src/jit/BaselineCompiler.cpp
@@ -2494,17 +2494,17 @@ BaselineCompiler::emit_JSOP_CALLPROP()
 
 bool
 BaselineCompiler::emit_JSOP_LENGTH()
 {
     return emit_JSOP_GETPROP();
 }
 
 bool
-BaselineCompiler::emit_JSOP_GETXPROP()
+BaselineCompiler::emit_JSOP_GETBOUNDNAME()
 {
     return emit_JSOP_GETPROP();
 }
 
 typedef bool (*DeletePropertyFn)(JSContext*, HandleValue, HandlePropertyName, bool*);
 static const VMFunction DeletePropertyStrictInfo =
     FunctionInfo<DeletePropertyFn>(DeletePropertyJit<true>, "DeletePropertyStrict");
 static const VMFunction DeletePropertyNonStrictInfo =
--- a/js/src/jit/BaselineCompiler.h
+++ b/js/src/jit/BaselineCompiler.h
@@ -131,17 +131,17 @@ namespace jit {
     _(JSOP_STRICTSETNAME)      \
     _(JSOP_GETPROP)            \
     _(JSOP_SETPROP)            \
     _(JSOP_STRICTSETPROP)      \
     _(JSOP_CALLPROP)           \
     _(JSOP_DELPROP)            \
     _(JSOP_STRICTDELPROP)      \
     _(JSOP_LENGTH)             \
-    _(JSOP_GETXPROP)           \
+    _(JSOP_GETBOUNDNAME)       \
     _(JSOP_GETALIASEDVAR)      \
     _(JSOP_SETALIASEDVAR)      \
     _(JSOP_GETNAME)            \
     _(JSOP_BINDNAME)           \
     _(JSOP_DELNAME)            \
     _(JSOP_GETIMPORT)          \
     _(JSOP_GETINTRINSIC)       \
     _(JSOP_BINDVAR)            \
--- a/js/src/jit/CacheIR.cpp
+++ b/js/src/jit/CacheIR.cpp
@@ -262,17 +262,17 @@ IsCacheableNoProperty(JSContext* cx, JSO
     if (!pc) {
         // This is an idempotent IC, don't attach a missing-property stub.
         // See tryAttachStub.
         return false;
     }
 
     // If we're doing a name lookup, we have to throw a ReferenceError. If
     // extra warnings are enabled, we may have to report a warning.
-    if (*pc == JSOP_GETXPROP || cx->compartment()->behaviors().extraWarnings(cx))
+    if (*pc == JSOP_GETBOUNDNAME || cx->compartment()->behaviors().extraWarnings(cx))
         return false;
 
     return CheckHasNoSuchProperty(cx, obj, id);
 }
 
 enum NativeGetPropCacheability {
     CanAttachNone,
     CanAttachReadSlot,
--- a/js/src/jit/SharedIC.cpp
+++ b/js/src/jit/SharedIC.cpp
@@ -1968,17 +1968,17 @@ ComputeGetPropResult(JSContext* cx, Base
         if (op == JSOP_LENGTH) {
             res.setInt32(frame->numActualArgs());
         } else {
             MOZ_ASSERT(name == cx->names().callee);
             MOZ_ASSERT(frame->script()->hasMappedArgsObj());
             res.setObject(*frame->callee());
         }
     } else {
-        if (op == JSOP_GETXPROP) {
+        if (op == JSOP_GETBOUNDNAME) {
             RootedObject obj(cx, &val.toObject());
             RootedId id(cx, NameToId(name));
             if (!GetPropertyForNameLookup(cx, obj, id, res))
                 return false;
         } else {
             MOZ_ASSERT(op == JSOP_GETPROP || op == JSOP_CALLPROP || op == JSOP_LENGTH);
             if (!GetProperty(cx, val, name, res))
                 return false;
@@ -1997,17 +1997,20 @@ DoGetPropFallback(JSContext* cx, Baselin
 
     // This fallback stub may trigger debug mode toggling.
     DebugModeOSRVolatileStub<ICGetProp_Fallback*> stub(frame, stub_);
 
     jsbytecode* pc = stub_->icEntry()->pc(script);
     JSOp op = JSOp(*pc);
     FallbackICSpew(cx, stub, "GetProp(%s)", CodeName[op]);
 
-    MOZ_ASSERT(op == JSOP_GETPROP || op == JSOP_CALLPROP || op == JSOP_LENGTH || op == JSOP_GETXPROP);
+    MOZ_ASSERT(op == JSOP_GETPROP ||
+               op == JSOP_CALLPROP ||
+               op == JSOP_LENGTH ||
+               op == JSOP_GETBOUNDNAME);
 
     // Grab our old shape before it goes away.
     RootedShape oldShape(cx);
     if (val.isObject())
         oldShape = val.toObject().maybeShape();
 
     bool attached = false;
     // There are some reasons we can fail to attach a stub that are temporary.
--- a/js/src/vm/Interpreter.cpp
+++ b/js/src/vm/Interpreter.cpp
@@ -2675,28 +2675,28 @@ CASE(JSOP_GETPROP_SUPER)
 
     if (!GetProperty(cx, obj, receiver, script->getName(REGS.pc), rref))
         goto error;
 
     REGS.sp--;
 }
 END_CASE(JSOP_GETPROP_SUPER)
 
-CASE(JSOP_GETXPROP)
+CASE(JSOP_GETBOUNDNAME)
 {
     ReservedRooted<JSObject*> obj(&rootObject0, &REGS.sp[-1].toObject());
     ReservedRooted<jsid> id(&rootId0, NameToId(script->getName(REGS.pc)));
     MutableHandleValue rval = REGS.stackHandleAt(-1);
     if (!GetPropertyForNameLookup(cx, obj, id, rval))
         goto error;
 
     TypeScript::Monitor(cx, script, REGS.pc, rval);
     assertSameCompartmentDebugOnly(cx, rval);
 }
-END_CASE(JSOP_GETXPROP)
+END_CASE(JSOP_GETBOUNDNAME)
 
 CASE(JSOP_SETINTRINSIC)
 {
     HandleValue value = REGS.stackHandleAt(-1);
 
     if (!SetIntrinsicOperation(cx, script, REGS.pc, value))
         goto error;
 }
--- a/js/src/vm/Opcodes.h
+++ b/js/src/vm/Opcodes.h
@@ -1990,24 +1990,25 @@ 1234567890123456789012345678901234567890
      *   Category: Literals
      *   Type: Object
      *   Operands:
      *   Stack: obj, newProto => succeeded
      */ \
     macro(JSOP_MUTATEPROTO,   194, "mutateproto",NULL,    1,  2,  1, JOF_BYTE) \
     \
     /*
-     * Pops the top of stack value, gets an extant property value of it,
-     * throwing ReferenceError if the identified property does not exist.
+     * Pops an environment, gets the value of a bound name on it. If the name
+     * is not bound to the environment, throw a ReferenceError. Used in
+     * conjunction with BINDNAME.
      *   Category: Literals
      *   Type: Object
      *   Operands: uint32_t nameIndex
-     *   Stack: obj => obj[name]
+     *   Stack: env => v
      */ \
-    macro(JSOP_GETXPROP,      195,"getxprop",    NULL,    5,  1,  1, JOF_ATOM|JOF_PROP|JOF_TYPESET) \
+    macro(JSOP_GETBOUNDNAME,  195,"getboundname",NULL,    5,  1,  1, JOF_ATOM|JOF_NAME|JOF_TYPESET) \
     \
     /*
      * Pops the top stack value as 'val' and pushes 'typeof val'.  Note that
      * this opcode isn't used when, in the original source code, 'val' is a
      * name -- see 'JSOP_TYPEOF' for that.
      * (This is because 'typeof undefinedName === "undefined"'.)
      *   Category: Operators
      *   Type: Special Operators