Commit 5f90cfd7 authored by Seth Brenith's avatar Seth Brenith Committed by Commit Bot

[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/+/2216304Reviewed-by: 's avatarTobias Tebbi <tebbi@chromium.org>
Commit-Queue: Seth Brenith <seth.brenith@microsoft.com>
Cr-Commit-Position: refs/heads/master@{#68028}
parent d4b58fec
...@@ -36,8 +36,9 @@ ACCESSORS(Module, exception, Object, kExceptionOffset) ...@@ -36,8 +36,9 @@ ACCESSORS(Module, exception, Object, kExceptionOffset)
SMI_ACCESSORS(Module, status, kStatusOffset) SMI_ACCESSORS(Module, status, kStatusOffset)
SMI_ACCESSORS(Module, hash, kHashOffset) SMI_ACCESSORS(Module, hash, kHashOffset)
BOOL_ACCESSORS(SourceTextModule, flags, async, kAsyncBit) BOOL_ACCESSORS(SourceTextModule, flags, async, AsyncBit::kShift)
BOOL_ACCESSORS(SourceTextModule, flags, async_evaluating, kAsyncEvaluatingBit) BOOL_ACCESSORS(SourceTextModule, flags, async_evaluating,
AsyncEvaluatingBit::kShift)
ACCESSORS(SourceTextModule, async_parent_modules, ArrayList, ACCESSORS(SourceTextModule, async_parent_modules, ArrayList,
kAsyncParentModulesOffset) kAsyncParentModulesOffset)
ACCESSORS(SourceTextModule, top_level_capability, HeapObject, ACCESSORS(SourceTextModule, top_level_capability, HeapObject,
......
...@@ -7,6 +7,7 @@ ...@@ -7,6 +7,7 @@
#include "src/objects/module.h" #include "src/objects/module.h"
#include "src/objects/promise.h" #include "src/objects/promise.h"
#include "torque-generated/bit-fields-tq.h"
// Has to be the last include (doesn't have include guards): // Has to be the last include (doesn't have include guards):
#include "src/objects/object-macros.h" #include "src/objects/object-macros.h"
...@@ -91,8 +92,7 @@ class SourceTextModule ...@@ -91,8 +92,7 @@ class SourceTextModule
inline void DecrementPendingAsyncDependencies(); inline void DecrementPendingAsyncDependencies();
// Bits for flags. // Bits for flags.
static const int kAsyncBit = 0; DEFINE_TORQUE_GENERATED_SOURCE_TEXT_MODULE_FLAGS()
static const int kAsyncEvaluatingBit = 1;
// async_evaluating, top_level_capability, pending_async_dependencies, and // async_evaluating, top_level_capability, pending_async_dependencies, and
// async_parent_modules are used exclusively during evaluation of async // async_parent_modules are used exclusively during evaluation of async
......
...@@ -4,6 +4,11 @@ ...@@ -4,6 +4,11 @@
type SourceTextModuleInfo extends FixedArray; type SourceTextModuleInfo extends FixedArray;
bitfield struct SourceTextModuleFlags extends uint31 {
async: bool: 1 bit;
async_evaluating: bool: 1 bit;
}
@generateCppClass @generateCppClass
extern class SourceTextModule extends Module { extern class SourceTextModule extends Module {
// The code representing this module, or an abstraction thereof. // The code representing this module, or an abstraction thereof.
...@@ -39,7 +44,7 @@ extern class SourceTextModule extends Module { ...@@ -39,7 +44,7 @@ extern class SourceTextModule extends Module {
// The number of currently evaluating async dependencies of this module. // The number of currently evaluating async dependencies of this module.
pending_async_dependencies: Smi; pending_async_dependencies: Smi;
flags: Smi; flags: SmiTagged<SourceTextModuleFlags>;
} }
@generateCppClass @generateCppClass
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment