mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-11-28 23:31:56 +00:00
Bug 1825907 - Remove unnecessary property iterator in ArgumentsObject::setElement. r=jonco
This was leftover from TI when we needed this loop to look up the `PropertyKey`. Differential Revision: https://phabricator.services.mozilla.com/D174716
This commit is contained in:
parent
a3621a085f
commit
169e55791f
7
js/src/jit-test/tests/arguments/bug1825907.js
Normal file
7
js/src/jit-test/tests/arguments/bug1825907.js
Normal file
@ -0,0 +1,7 @@
|
||||
function f(arg) {
|
||||
eval(`var y = 1; function f() {return y}; f();`);
|
||||
delete y;
|
||||
arguments[0] = 5;
|
||||
assertEq(arg, 5);
|
||||
}
|
||||
f(0);
|
@ -30,19 +30,12 @@ inline void ArgumentsObject::setElement(uint32_t i, const Value& v) {
|
||||
MOZ_ASSERT(isElement(i));
|
||||
GCPtr<Value>& lhs = data()->args[i];
|
||||
if (IsMagicScopeSlotValue(lhs)) {
|
||||
uint32_t slot = SlotFromMagicScopeSlotValue(lhs);
|
||||
CallObject& callobj =
|
||||
getFixedSlot(MAYBE_CALL_SLOT).toObject().as<CallObject>();
|
||||
for (SharedShapePropertyIter<NoGC> iter(callobj.sharedShape());
|
||||
!iter.done(); iter++) {
|
||||
if (iter->slot() == slot) {
|
||||
callobj.setAliasedFormalFromArguments(lhs, v);
|
||||
return;
|
||||
}
|
||||
}
|
||||
MOZ_CRASH("Bad Arguments::setElement");
|
||||
callobj.setAliasedFormalFromArguments(lhs, v);
|
||||
} else {
|
||||
lhs = v;
|
||||
}
|
||||
lhs = v;
|
||||
}
|
||||
|
||||
inline bool ArgumentsObject::maybeGetElements(uint32_t start, uint32_t count,
|
||||
|
Loading…
Reference in New Issue
Block a user