summaryrefslogtreecommitdiffstats
path: root/js/src/vm/BytecodeUtil.h
diff options
context:
space:
mode:
Diffstat (limited to 'js/src/vm/BytecodeUtil.h')
-rw-r--r--js/src/vm/BytecodeUtil.h16
1 files changed, 6 insertions, 10 deletions
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;
}