Skip to content

Commit

Permalink
deps: backport v8 5f90cfd7
Browse files Browse the repository at this point in the history
[torque] Move SourceTextModule flags definitions to Torque

Refs: v8/v8@5f90cfd
  • Loading branch information
guybedford committed Mar 29, 2021
1 parent fe5e2e3 commit 7a2e80b
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 5 deletions.
5 changes: 3 additions & 2 deletions deps/v8/src/objects/module-inl.h
Expand Up @@ -36,8 +36,9 @@ ACCESSORS(Module, exception, Object, kExceptionOffset)
SMI_ACCESSORS(Module, status, kStatusOffset)
SMI_ACCESSORS(Module, hash, kHashOffset)

BOOL_ACCESSORS(SourceTextModule, flags, async, kAsyncBit)
BOOL_ACCESSORS(SourceTextModule, flags, async_evaluating, kAsyncEvaluatingBit)
BOOL_ACCESSORS(SourceTextModule, flags, async, AsyncBit::kShift)
BOOL_ACCESSORS(SourceTextModule, flags, async_evaluating,
AsyncEvaluatingBit::kShift)
ACCESSORS(SourceTextModule, async_parent_modules, ArrayList,
kAsyncParentModulesOffset)
ACCESSORS(SourceTextModule, top_level_capability, HeapObject,
Expand Down
4 changes: 2 additions & 2 deletions deps/v8/src/objects/source-text-module.h
Expand Up @@ -7,6 +7,7 @@

#include "src/objects/module.h"
#include "src/objects/promise.h"
#include "torque-generated/bit-fields-tq.h"

// Has to be the last include (doesn't have include guards):
#include "src/objects/object-macros.h"
Expand Down Expand Up @@ -94,8 +95,7 @@ class SourceTextModule
inline void DecrementPendingAsyncDependencies();

// Bits for flags.
static const int kAsyncBit = 0;
static const int kAsyncEvaluatingBit = 1;
DEFINE_TORQUE_GENERATED_SOURCE_TEXT_MODULE_FLAGS()

// async_evaluating, top_level_capability, pending_async_dependencies, and
// async_parent_modules are used exclusively during evaluation of async
Expand Down
7 changes: 6 additions & 1 deletion deps/v8/src/objects/source-text-module.tq
Expand Up @@ -4,6 +4,11 @@

type SourceTextModuleInfo extends FixedArray;

bitfield struct SourceTextModuleFlags extends uint31 {
async: bool: 1 bit;
async_evaluating: bool: 1 bit;
}

@generateCppClass
extern class SourceTextModule extends Module {
// The code representing this module, or an abstraction thereof.
Expand Down Expand Up @@ -44,7 +49,7 @@ extern class SourceTextModule extends Module {
// The number of currently evaluating async dependencies of this module.
pending_async_dependencies: Smi;

flags: Smi;
flags: SmiTagged<SourceTextModuleFlags>;
}

@generateCppClass
Expand Down

0 comments on commit 7a2e80b

Please sign in to comment.