Bug 1616535: MCheckClassHeritage can be effectful because the error case can invoke toSource. r=jandem

`CheckClassHeritageOperation` calls `ReportIsNotFunction` for non-callable
objects and `ReportIsNotFunction` can end up in `ValueToSource`, which in turn
can invoke a user-defined `toSource` function. That means MCheckClassHeritage
must be treated as an effectful operation.

When bug 1418769 is fixed, it should be possible to revert this change, because
then user-defined `toSource` functions are no longer called.

Differential Revision: https://phabricator.services.mozilla.com/D63316

--HG--
extra : moz-landing-system : lando
This commit is contained in:
André Bargull 2020-02-21 08:05:43 +00:00
parent 21d016d7a3
commit 7c1eb5dfdd
3 changed files with 4 additions and 3 deletions

View File

@ -0,0 +1,3 @@
// |jit-test| error:TypeError
class C extends (/x/) {}

View File

@ -9906,7 +9906,7 @@ AbortReasonOr<Ok> IonBuilder::jsop_checkclassheritage() {
auto* ins = MCheckClassHeritage::New(alloc(), current->pop());
current->add(ins);
current->push(ins);
return Ok();
return resumeAfter(ins);
}
AbortReasonOr<Ok> IonBuilder::jsop_checkthis() {

View File

@ -10973,8 +10973,6 @@ class MCheckClassHeritage : public MUnaryInstruction,
INSTRUCTION_HEADER(CheckClassHeritage)
TRIVIAL_NEW_WRAPPERS
NAMED_OPERANDS((0, heritage))
AliasSet getAliasSet() const override { return AliasSet::None(); }
};
class MDebugCheckSelfHosted : public MUnaryInstruction,