Skip to content

Commit 5f90cfd

Browse files
sethbrenithCommit Bot
authored andcommitted
[torque] Move SourceTextModule flags definitions to Torque
This is a partial reland of https://crrev.com/c/v8/v8/+/2199640 . Change-Id: I244174446c52b05e70042d7f4d03eb67a0c725b7 Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2216304 Reviewed-by: Tobias Tebbi <tebbi@chromium.org> Commit-Queue: Seth Brenith <seth.brenith@microsoft.com> Cr-Commit-Position: refs/heads/master@{#68028}
1 parent d4b58fe commit 5f90cfd

File tree

3 files changed

+11
-5
lines changed

3 files changed

+11
-5
lines changed

src/objects/module-inl.h

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,8 +36,9 @@ ACCESSORS(Module, exception, Object, kExceptionOffset)
3636
SMI_ACCESSORS(Module, status, kStatusOffset)
3737
SMI_ACCESSORS(Module, hash, kHashOffset)
3838

39-
BOOL_ACCESSORS(SourceTextModule, flags, async, kAsyncBit)
40-
BOOL_ACCESSORS(SourceTextModule, flags, async_evaluating, kAsyncEvaluatingBit)
39+
BOOL_ACCESSORS(SourceTextModule, flags, async, AsyncBit::kShift)
40+
BOOL_ACCESSORS(SourceTextModule, flags, async_evaluating,
41+
AsyncEvaluatingBit::kShift)
4142
ACCESSORS(SourceTextModule, async_parent_modules, ArrayList,
4243
kAsyncParentModulesOffset)
4344
ACCESSORS(SourceTextModule, top_level_capability, HeapObject,

src/objects/source-text-module.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77

88
#include "src/objects/module.h"
99
#include "src/objects/promise.h"
10+
#include "torque-generated/bit-fields-tq.h"
1011

1112
// Has to be the last include (doesn't have include guards):
1213
#include "src/objects/object-macros.h"
@@ -91,8 +92,7 @@ class SourceTextModule
9192
inline void DecrementPendingAsyncDependencies();
9293

9394
// Bits for flags.
94-
static const int kAsyncBit = 0;
95-
static const int kAsyncEvaluatingBit = 1;
95+
DEFINE_TORQUE_GENERATED_SOURCE_TEXT_MODULE_FLAGS()
9696

9797
// async_evaluating, top_level_capability, pending_async_dependencies, and
9898
// async_parent_modules are used exclusively during evaluation of async

src/objects/source-text-module.tq

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,11 @@
44

55
type SourceTextModuleInfo extends FixedArray;
66

7+
bitfield struct SourceTextModuleFlags extends uint31 {
8+
async: bool: 1 bit;
9+
async_evaluating: bool: 1 bit;
10+
}
11+
712
@generateCppClass
813
extern class SourceTextModule extends Module {
914
// The code representing this module, or an abstraction thereof.
@@ -39,7 +44,7 @@ extern class SourceTextModule extends Module {
3944
// The number of currently evaluating async dependencies of this module.
4045
pending_async_dependencies: Smi;
4146

42-
flags: Smi;
47+
flags: SmiTagged<SourceTextModuleFlags>;
4348
}
4449

4550
@generateCppClass

0 commit comments

Comments
 (0)