summaryrefslogtreecommitdiffstats
path: root/js/src/vm/FunctionFlags.h
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-06-12 05:35:29 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-06-12 05:35:29 +0000
commit59203c63bb777a3bacec32fb8830fba33540e809 (patch)
tree58298e711c0ff0575818c30485b44a2f21bf28a0 /js/src/vm/FunctionFlags.h
parentAdding upstream version 126.0.1. (diff)
downloadfirefox-59203c63bb777a3bacec32fb8830fba33540e809.tar.xz
firefox-59203c63bb777a3bacec32fb8830fba33540e809.zip
Adding upstream version 127.0.upstream/127.0
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'js/src/vm/FunctionFlags.h')
-rw-r--r--js/src/vm/FunctionFlags.h28
1 files changed, 12 insertions, 16 deletions
diff --git a/js/src/vm/FunctionFlags.h b/js/src/vm/FunctionFlags.h
index 27d51c214a..558c71a6b7 100644
--- a/js/src/vm/FunctionFlags.h
+++ b/js/src/vm/FunctionFlags.h
@@ -94,6 +94,11 @@ class FunctionFlags {
BASESCRIPT = 1 << 5,
SELFHOSTLAZY = 1 << 6,
+ // This Native function has a JIT entry which emulates the
+ // js::BaseScript::jitCodeRaw mechanism. Used for Wasm functions and
+ // TrampolineNative builtins.
+ NATIVE_JIT_ENTRY = 1 << 7,
+
// Function may be called as a constructor. This corresponds in the spec as
// having a [[Construct]] internal method.
//
@@ -103,12 +108,7 @@ class FunctionFlags {
// This flag is used both by scripted functions and native functions.
//
// WARNING: This is independent from FunctionKind::ClassConstructor.
- CONSTRUCTOR = 1 << 7,
-
- // Function is either getter or setter, with "get " or "set " prefix,
- // but JSFunction::AtomSlot contains unprefixed name, and the function name
- // is lazily constructed on the first access.
- LAZY_ACCESSOR_NAME = 1 << 8,
+ CONSTRUCTOR = 1 << 8,
// Function comes from a FunctionExpression, ArrowFunction, or Function()
// call (not a FunctionDeclaration).
@@ -116,10 +116,10 @@ class FunctionFlags {
// This flag is used only by scripted functions and AsmJS.
LAMBDA = 1 << 9,
- // This Native function has a JIT entry which emulates the
- // js::BaseScript::jitCodeRaw mechanism. Used for Wasm functions and
- // TrampolineNative builtins.
- NATIVE_JIT_ENTRY = 1 << 10,
+ // Function is either getter or setter, with "get " or "set " prefix,
+ // but JSFunction::AtomSlot contains unprefixed name, and the function name
+ // is lazily constructed on the first access.
+ LAZY_ACCESSOR_NAME = 1 << 10,
// Function had no explicit name, but a name was set by SetFunctionName at
// compile time or SetFunctionName at runtime.
@@ -436,12 +436,8 @@ class FunctionFlags {
FunctionFlags& setIsGhost() { return setFlags(GHOST_FUNCTION); }
bool isGhost() const { return hasFlags(GHOST_FUNCTION); }
- static uint16_t HasJitEntryFlags(bool isConstructing) {
- uint16_t flags = BASESCRIPT | SELFHOSTLAZY;
- if (!isConstructing) {
- flags |= NATIVE_JIT_ENTRY;
- }
- return flags;
+ static constexpr uint16_t HasJitEntryFlags() {
+ return BASESCRIPT | SELFHOSTLAZY | NATIVE_JIT_ENTRY;
}
static FunctionFlags clearMutableflags(FunctionFlags flags) {