summaryrefslogtreecommitdiffstats
path: root/js/src/builtin/SelfHostingDefines.h
diff options
context:
space:
mode:
authorMoonchild <moonchild@palemoon.org>2020-07-08 14:12:57 +0000
committerMoonchild <moonchild@palemoon.org>2020-07-08 14:12:57 +0000
commit6e72707e0b72411df12827ae1ab882ab5177f983 (patch)
tree296f2fd0fe97a80606793010970d99e8ff88e66b /js/src/builtin/SelfHostingDefines.h
parent43e0632cd474265ef0660bf881f4472996c8ad5a (diff)
downloadUXP-6e72707e0b72411df12827ae1ab882ab5177f983.tar
UXP-6e72707e0b72411df12827ae1ab882ab5177f983.tar.gz
UXP-6e72707e0b72411df12827ae1ab882ab5177f983.tar.lz
UXP-6e72707e0b72411df12827ae1ab882ab5177f983.tar.xz
UXP-6e72707e0b72411df12827ae1ab882ab5177f983.zip
Issue #618 - Use a single slot for the module's environment object.
According to the spec this isn't created until the module is instantiated, but we create it when we compile the module. We stored this previously in InitialEnvironmentSlot and copied it to EnvironmentSlot when it was supposed to be created, but we can just store it in the latter slot straight away and check the module's status and return null if it shouldn't exist yet. This reduces the number of slots needed on a moduleObject to 17. Re: BZ 1420412 Part 1 We can't implement the second part to further reduce our number of slots, because it relies on SetProxyReservedSlot which in turn relies on rearchitecturing JS proxies to make reserved slots dynamic. That's a rabbit hole we really don't want to fall into. So, we'll end up being a bit slower because it can't be in-line allocated with having more than 16 slots, but so be it. I sincerely doubt it will make any practical difference.
Diffstat (limited to 'js/src/builtin/SelfHostingDefines.h')
-rw-r--r--js/src/builtin/SelfHostingDefines.h10
1 files changed, 5 insertions, 5 deletions
diff --git a/js/src/builtin/SelfHostingDefines.h b/js/src/builtin/SelfHostingDefines.h
index 6afa641b1..a3ba36804 100644
--- a/js/src/builtin/SelfHostingDefines.h
+++ b/js/src/builtin/SelfHostingDefines.h
@@ -97,11 +97,11 @@
#define REGEXP_STRING_ITERATOR_FLAGS_SLOT 2
#define REGEXP_STRING_ITERATOR_DONE_SLOT 3
-#define MODULE_OBJECT_ENVIRONMENT_SLOT 2
-#define MODULE_OBJECT_STATUS_SLOT 4
-#define MODULE_OBJECT_EVALUATION_ERROR_SLOT 5 // 4
-#define MODULE_OBJECT_DFS_INDEX_SLOT 16
-#define MODULE_OBJECT_DFS_ANCESTOR_INDEX_SLOT 17
+#define MODULE_OBJECT_ENVIRONMENT_SLOT 1
+#define MODULE_OBJECT_STATUS_SLOT 3
+#define MODULE_OBJECT_EVALUATION_ERROR_SLOT 4
+#define MODULE_OBJECT_DFS_INDEX_SLOT 15
+#define MODULE_OBJECT_DFS_ANCESTOR_INDEX_SLOT 16
#define MODULE_STATUS_UNINSTANTIATED 0
#define MODULE_STATUS_INSTANTIATING 1