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
PR-URL: #37973
Reviewed-By: Richard Lau <rlau@redhat.com>
  • Loading branch information
guybedford committed Apr 14, 2021
1 parent d56079a commit dd5da30
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 6 deletions.
2 changes: 1 addition & 1 deletion common.gypi
Expand Up @@ -36,7 +36,7 @@

# Reset this number to 0 on major V8 upgrades.
# Increment by one for each non-official patch applied to deps/v8.
'v8_embedder_string': '-node.27',
'v8_embedder_string': '-node.28',

##### V8 defaults for Node.js #####

Expand Down
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 dd5da30

Please sign in to comment.