Bug 1341061 - Rename GETXPROP to GETBOUNDNAME for clarity. (r=arai)

This commit is contained in:
Shu-yu Guo 2017-02-24 12:52:13 -08:00
parent 456932d2a6
commit 390589726c
7 changed files with 16 additions and 12 deletions

View File

@ -5872,7 +5872,7 @@ BytecodeEmitter::emitAssignment(ParseNode* lhs, JSOp op, ParseNode* rhs)
// 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))

View File

@ -2499,7 +2499,7 @@ BaselineCompiler::emit_JSOP_LENGTH()
}
bool
BaselineCompiler::emit_JSOP_GETXPROP()
BaselineCompiler::emit_JSOP_GETBOUNDNAME()
{
return emit_JSOP_GETPROP();
}

View File

@ -136,7 +136,7 @@ namespace jit {
_(JSOP_DELPROP) \
_(JSOP_STRICTDELPROP) \
_(JSOP_LENGTH) \
_(JSOP_GETXPROP) \
_(JSOP_GETBOUNDNAME) \
_(JSOP_GETALIASEDVAR) \
_(JSOP_SETALIASEDVAR) \
_(JSOP_GETNAME) \

View File

@ -267,7 +267,7 @@ IsCacheableNoProperty(JSContext* cx, JSObject* obj, JSObject* holder, Shape* sha
// 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);

View File

@ -1973,7 +1973,7 @@ ComputeGetPropResult(JSContext* cx, BaselineFrame* frame, JSOp op, HandlePropert
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))
@ -2002,7 +2002,10 @@ DoGetPropFallback(JSContext* cx, BaselineFrame* frame, ICGetProp_Fallback* stub_
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);

View File

@ -2680,7 +2680,7 @@ CASE(JSOP_GETPROP_SUPER)
}
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)));
@ -2691,7 +2691,7 @@ CASE(JSOP_GETXPROP)
TypeScript::Monitor(cx, script, REGS.pc, rval);
assertSameCompartmentDebugOnly(cx, rval);
}
END_CASE(JSOP_GETXPROP)
END_CASE(JSOP_GETBOUNDNAME)
CASE(JSOP_SETINTRINSIC)
{

View File

@ -1995,14 +1995,15 @@
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