From 8dd16259287f58f9273002717ec4d27e97127719 Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Wed, 12 Jun 2024 07:43:14 +0200 Subject: Merging upstream version 127.0. Signed-off-by: Daniel Baumann --- js/src/vm/BytecodeUtil.h | 16 ++++++---------- 1 file changed, 6 insertions(+), 10 deletions(-) (limited to 'js/src/vm/BytecodeUtil.h') diff --git a/js/src/vm/BytecodeUtil.h b/js/src/vm/BytecodeUtil.h index 09ff4387bb..3f0d4d07e4 100644 --- a/js/src/vm/BytecodeUtil.h +++ b/js/src/vm/BytecodeUtil.h @@ -39,10 +39,6 @@ class JS_PUBLIC_API StringPrinter; static inline uint32_t JOF_TYPE(uint32_t fmt) { return fmt & JOF_TYPEMASK; } -/* Shorthand for mode from format. */ - -static inline uint32_t JOF_MODE(uint32_t fmt) { return fmt & JOF_MODEMASK; } - /* * Immediate operand getters, setters, and bounds. */ @@ -462,8 +458,6 @@ inline bool IsCheckStrictOp(JSOp op) { return CodeSpec(op).format & JOF_CHECKSTRICT; } -inline bool IsNameOp(JSOp op) { return CodeSpec(op).format & JOF_NAME; } - #ifdef DEBUG inline bool IsCheckSloppyOp(JSOp op) { return CodeSpec(op).format & JOF_CHECKSLOPPY; @@ -510,10 +504,6 @@ inline bool IsSetElemOp(JSOp op) { inline bool IsSetElemPC(const jsbytecode* pc) { return IsSetElemOp(JSOp(*pc)); } -inline bool IsElemPC(const jsbytecode* pc) { - return CodeSpec(JSOp(*pc)).format & JOF_ELEM; -} - inline bool IsInvokeOp(JSOp op) { return CodeSpec(op).format & JOF_INVOKE; } inline bool IsInvokePC(jsbytecode* pc) { return IsInvokeOp(JSOp(*pc)); } @@ -534,6 +524,12 @@ inline bool IsSpreadOp(JSOp op) { return CodeSpec(op).format & JOF_SPREAD; } inline bool IsSpreadPC(const jsbytecode* pc) { return IsSpreadOp(JSOp(*pc)); } +// Returns true if the specified opcode is for `typeof name` where `name` is +// single identifier. +inline bool IsTypeOfNameOp(JSOp op) { + return op == JSOp::Typeof || op == JSOp::TypeofEq; +} + inline bool OpUsesEnvironmentChain(JSOp op) { return CodeSpec(op).format & JOF_USES_ENV; } -- cgit v1.2.3