summaryrefslogtreecommitdiffstats
path: root/js/src/jit/MIR.h
diff options
context:
space:
mode:
authorwolfbeast <mcwerewolf@gmail.com>2018-04-06 13:24:25 -0400
committerwolfbeast <mcwerewolf@gmail.com>2018-06-07 04:02:17 +0200
commitff901dc5267903b165c53139ddcff5f31bbf6964 (patch)
treeab177a9db308073fc699417b857841f4ca6eebba /js/src/jit/MIR.h
parent12e3ee76966664ca0330738a07c7afb9fd754857 (diff)
downloadUXP-ff901dc5267903b165c53139ddcff5f31bbf6964.tar
UXP-ff901dc5267903b165c53139ddcff5f31bbf6964.tar.gz
UXP-ff901dc5267903b165c53139ddcff5f31bbf6964.tar.lz
UXP-ff901dc5267903b165c53139ddcff5f31bbf6964.tar.xz
UXP-ff901dc5267903b165c53139ddcff5f31bbf6964.zip
Change inlining of intrinsics.
Diffstat (limited to 'js/src/jit/MIR.h')
-rw-r--r--js/src/jit/MIR.h42
1 files changed, 42 insertions, 0 deletions
diff --git a/js/src/jit/MIR.h b/js/src/jit/MIR.h
index 2de91e2df..6ec05af76 100644
--- a/js/src/jit/MIR.h
+++ b/js/src/jit/MIR.h
@@ -13192,6 +13192,48 @@ class MHasClass
}
};
+class MGuardToClass
+ : public MUnaryInstruction,
+ public SingleObjectPolicy::Data
+{
+ const Class* class_;
+
+ MGuardToClass(MDefinition* object, const Class* clasp, MIRType resultType)
+ : MUnaryInstruction(object)
+ , class_(clasp)
+ {
+ MOZ_ASSERT(object->type() == MIRType::Object ||
+ (object->type() == MIRType::Value && object->mightBeType(MIRType::Object)));
+ MOZ_ASSERT(resultType == MIRType::Object || resultType == MIRType::ObjectOrNull);
+ setResultType(resultType);
+ setMovable();
+ if (resultType == MIRType::Object) {
+ // We will bail out if the class type is incorrect,
+ // so we need to ensure we don't eliminate this instruction
+ setGuard();
+ }
+ }
+
+ public:
+ INSTRUCTION_HEADER(GuardToClass)
+ TRIVIAL_NEW_WRAPPERS
+ NAMED_OPERANDS((0, object))
+
+ const Class* getClass() const {
+ return class_;
+ }
+ AliasSet getAliasSet() const override {
+ return AliasSet::None();
+ }
+ bool congruentTo(const MDefinition* ins) const override {
+ if (!ins->isGuardToClass())
+ return false;
+ if (getClass() != ins->toGuardToClass()->getClass())
+ return false;
+ return congruentIfOperandsEqual(ins);
+ }
+};
+
class MCheckReturn
: public MBinaryInstruction,
public BoxInputsPolicy::Data