Backed out changeset 76c74d43a9b0 (
bug 1341061)
--- a/js/src/frontend/BytecodeEmitter.cpp
+++ b/js/src/frontend/BytecodeEmitter.cpp
@@ -5896,17 +5896,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_GETBOUNDNAME))
+ if (!bce->emitAtomOp(lhs, JSOP_GETXPROP))
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_GETBOUNDNAME()
+BaselineCompiler::emit_JSOP_GETXPROP()
{
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_GETBOUNDNAME) \
+ _(JSOP_GETXPROP) \
_(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_GETBOUNDNAME || cx->compartment()->behaviors().extraWarnings(cx))
+ if (*pc == JSOP_GETXPROP || 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_GETBOUNDNAME) {
+ if (op == JSOP_GETXPROP) {
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,20 +1997,17 @@ 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_GETBOUNDNAME);
+ MOZ_ASSERT(op == JSOP_GETPROP || op == JSOP_CALLPROP || op == JSOP_LENGTH || op == JSOP_GETXPROP);
// 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_GETBOUNDNAME)
+CASE(JSOP_GETXPROP)
{
ReservedRooted<JSObject*> obj(&rootObject0, ®S.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_GETBOUNDNAME)
+END_CASE(JSOP_GETXPROP)
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,25 +1990,24 @@ 1234567890123456789012345678901234567890
* Category: Literals
* Type: Object
* Operands:
* Stack: obj, newProto => succeeded
*/ \
macro(JSOP_MUTATEPROTO, 194, "mutateproto",NULL, 1, 2, 1, JOF_BYTE) \
\
/*
- * 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.
+ * Pops the top of stack value, gets an extant property value of it,
+ * throwing ReferenceError if the identified property does not exist.
* Category: Literals
* Type: Object
* Operands: uint32_t nameIndex
- * Stack: env => v
+ * Stack: obj => obj[name]
*/ \
- macro(JSOP_GETBOUNDNAME, 195,"getboundname",NULL, 5, 1, 1, JOF_ATOM|JOF_NAME|JOF_TYPESET) \
+ macro(JSOP_GETXPROP, 195,"getxprop", NULL, 5, 1, 1, JOF_ATOM|JOF_PROP|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