node-aix-ppc64 19.6.1 → 19.8.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -127,6 +127,8 @@ struct napi_module;
127
127
  // terminally confused when it's done in node_internals.h
128
128
  namespace node {
129
129
 
130
+ struct SnapshotData;
131
+
130
132
  namespace tracing {
131
133
 
132
134
  class TracingController;
@@ -274,6 +276,15 @@ enum Flags : uint64_t {
274
276
  // TODO(addaleax): Make this the canonical name, as it is more descriptive.
275
277
  namespace ProcessInitializationFlags = ProcessFlags;
276
278
 
279
+ namespace StopFlags {
280
+ enum Flags : uint32_t {
281
+ kNoFlags = 0,
282
+ // Do not explicitly terminate the Isolate
283
+ // when exiting the Environment.
284
+ kDoNotTerminateIsolate = 1 << 0,
285
+ };
286
+ } // namespace StopFlags
287
+
277
288
  class NODE_EXTERN InitializationResult {
278
289
  public:
279
290
  virtual ~InitializationResult();
@@ -310,6 +321,7 @@ NODE_EXTERN int Start(int argc, char* argv[]);
310
321
  // Tear down Node.js while it is running (there are active handles
311
322
  // in the loop and / or actively executing JavaScript code).
312
323
  NODE_EXTERN int Stop(Environment* env);
324
+ NODE_EXTERN int Stop(Environment* env, StopFlags::Flags flags);
313
325
 
314
326
  // Set up per-process state needed to run Node.js. This will consume arguments
315
327
  // from argv, fill exec_argv, and possibly add errors resulting from parsing
@@ -453,7 +465,8 @@ enum IsolateSettingsFlags {
453
465
  MESSAGE_LISTENER_WITH_ERROR_LEVEL = 1 << 0,
454
466
  DETAILED_SOURCE_POSITIONS_FOR_PROFILING = 1 << 1,
455
467
  SHOULD_NOT_SET_PROMISE_REJECTION_CALLBACK = 1 << 2,
456
- SHOULD_NOT_SET_PREPARE_STACK_TRACE_CALLBACK = 1 << 3
468
+ SHOULD_NOT_SET_PREPARE_STACK_TRACE_CALLBACK = 1 << 3,
469
+ ALLOW_MODIFY_CODE_GENERATION_FROM_STRINGS_CALLBACK = 1 << 4,
457
470
  };
458
471
 
459
472
  struct IsolateSettings {
@@ -471,6 +484,75 @@ struct IsolateSettings {
471
484
  v8::PromiseRejectCallback promise_reject_callback = nullptr;
472
485
  v8::AllowWasmCodeGenerationCallback
473
486
  allow_wasm_code_generation_callback = nullptr;
487
+ v8::ModifyCodeGenerationFromStringsCallback2
488
+ modify_code_generation_from_strings_callback = nullptr;
489
+ };
490
+
491
+ // Represents a startup snapshot blob, e.g. created by passing
492
+ // --node-snapshot-main=entry.js to the configure script at build time,
493
+ // or by running Node.js with the --build-snapshot option.
494
+ //
495
+ // If used, the snapshot *must* have been built with the same Node.js
496
+ // version and V8 flags as the version that is currently running, and will
497
+ // be rejected otherwise.
498
+ // The same EmbedderSnapshotData instance *must* be passed to both
499
+ // `NewIsolate()` and `CreateIsolateData()`. The first `Environment` instance
500
+ // should be created with an empty `context` argument and will then
501
+ // use the main context included in the snapshot blob. It can be retrieved
502
+ // using `GetMainContext()`. `LoadEnvironment` can receive an empty
503
+ // `StartExecutionCallback` in this case.
504
+ // If V8 was configured with the shared-readonly-heap option, it requires
505
+ // all snapshots used to create `Isolate` instances to be identical.
506
+ // This option *must* be unset by embedders who wish to use the startup
507
+ // feature during the build step by passing the --disable-shared-readonly-heap
508
+ // flag to the configure script.
509
+ //
510
+ // Snapshots are an *experimental* feature. In particular, the embedder API
511
+ // exposed through this class is subject to change or removal between Node.js
512
+ // versions, including possible API and ABI breakage.
513
+ class EmbedderSnapshotData {
514
+ public:
515
+ struct DeleteSnapshotData {
516
+ void operator()(const EmbedderSnapshotData*) const;
517
+ };
518
+ using Pointer =
519
+ std::unique_ptr<const EmbedderSnapshotData, DeleteSnapshotData>;
520
+
521
+ // Return an EmbedderSnapshotData object that refers to the built-in
522
+ // snapshot of Node.js. This can have been configured through e.g.
523
+ // --node-snapshot-main=entry.js.
524
+ static Pointer BuiltinSnapshotData();
525
+
526
+ // Return an EmbedderSnapshotData object that is based on an input file.
527
+ // Calling this method will consume but not close the FILE* handle.
528
+ // The FILE* handle can be closed immediately following this call.
529
+ // If the snapshot is invalid, this returns an empty pointer.
530
+ static Pointer FromFile(FILE* in);
531
+ static Pointer FromBlob(const std::vector<char>& in);
532
+
533
+ // Write this EmbedderSnapshotData object to an output file.
534
+ // Calling this method will not close the FILE* handle.
535
+ // The FILE* handle can be closed immediately following this call.
536
+ void ToFile(FILE* out) const;
537
+ std::vector<char> ToBlob() const;
538
+
539
+ // Returns whether custom snapshots can be used. Currently, this means
540
+ // that V8 was configured without the shared-readonly-heap feature.
541
+ static bool CanUseCustomSnapshotPerIsolate();
542
+
543
+ EmbedderSnapshotData(const EmbedderSnapshotData&) = delete;
544
+ EmbedderSnapshotData& operator=(const EmbedderSnapshotData&) = delete;
545
+ EmbedderSnapshotData(EmbedderSnapshotData&&) = delete;
546
+ EmbedderSnapshotData& operator=(EmbedderSnapshotData&&) = delete;
547
+
548
+ protected:
549
+ EmbedderSnapshotData(const SnapshotData* impl, bool owns_impl);
550
+
551
+ private:
552
+ const SnapshotData* impl_;
553
+ bool owns_impl_;
554
+ friend struct SnapshotData;
555
+ friend class CommonEnvironmentSetup;
474
556
  };
475
557
 
476
558
  // Overriding IsolateSettings may produce unexpected behavior
@@ -489,10 +571,23 @@ NODE_EXTERN void SetIsolateUpForNode(v8::Isolate* isolate);
489
571
  NODE_EXTERN v8::Isolate* NewIsolate(ArrayBufferAllocator* allocator,
490
572
  struct uv_loop_s* event_loop,
491
573
  MultiIsolatePlatform* platform = nullptr);
574
+ // TODO(addaleax): Merge with the function definition above.
575
+ NODE_EXTERN v8::Isolate* NewIsolate(ArrayBufferAllocator* allocator,
576
+ struct uv_loop_s* event_loop,
577
+ MultiIsolatePlatform* platform,
578
+ const EmbedderSnapshotData* snapshot_data,
579
+ const IsolateSettings& settings = {});
492
580
  NODE_EXTERN v8::Isolate* NewIsolate(
493
581
  std::shared_ptr<ArrayBufferAllocator> allocator,
494
582
  struct uv_loop_s* event_loop,
495
583
  MultiIsolatePlatform* platform);
584
+ // TODO(addaleax): Merge with the function definition above.
585
+ NODE_EXTERN v8::Isolate* NewIsolate(
586
+ std::shared_ptr<ArrayBufferAllocator> allocator,
587
+ struct uv_loop_s* event_loop,
588
+ MultiIsolatePlatform* platform,
589
+ const EmbedderSnapshotData* snapshot_data,
590
+ const IsolateSettings& settings = {});
496
591
 
497
592
  // Creates a new context with Node.js-specific tweaks.
498
593
  NODE_EXTERN v8::Local<v8::Context> NewContext(
@@ -512,6 +607,13 @@ NODE_EXTERN IsolateData* CreateIsolateData(
512
607
  struct uv_loop_s* loop,
513
608
  MultiIsolatePlatform* platform = nullptr,
514
609
  ArrayBufferAllocator* allocator = nullptr);
610
+ // TODO(addaleax): Merge with the function definition above.
611
+ NODE_EXTERN IsolateData* CreateIsolateData(
612
+ v8::Isolate* isolate,
613
+ struct uv_loop_s* loop,
614
+ MultiIsolatePlatform* platform,
615
+ ArrayBufferAllocator* allocator,
616
+ const EmbedderSnapshotData* snapshot_data);
515
617
  NODE_EXTERN void FreeIsolateData(IsolateData* isolate_data);
516
618
 
517
619
  struct ThreadId {
@@ -571,6 +673,8 @@ struct InspectorParentHandle {
571
673
  // TODO(addaleax): Maybe move per-Environment options parsing here.
572
674
  // Returns nullptr when the Environment cannot be created e.g. there are
573
675
  // pending JavaScript exceptions.
676
+ // `context` may be empty if an `EmbedderSnapshotData` instance was provided
677
+ // to `NewIsolate()` and `CreateIsolateData()`.
574
678
  NODE_EXTERN Environment* CreateEnvironment(
575
679
  IsolateData* isolate_data,
576
680
  v8::Local<v8::Context> context,
@@ -592,6 +696,12 @@ NODE_EXTERN std::unique_ptr<InspectorParentHandle> GetInspectorParentHandle(
592
696
  ThreadId child_thread_id,
593
697
  const char* child_url);
594
698
 
699
+ NODE_EXTERN std::unique_ptr<InspectorParentHandle> GetInspectorParentHandle(
700
+ Environment* parent_env,
701
+ ThreadId child_thread_id,
702
+ const char* child_url,
703
+ const char* name);
704
+
595
705
  struct StartExecutionCallbackInfo {
596
706
  v8::Local<v8::Object> process_object;
597
707
  v8::Local<v8::Function> native_require;
@@ -624,6 +734,9 @@ NODE_EXTERN void DefaultProcessExitHandler(Environment* env, int exit_code);
624
734
  NODE_EXTERN Environment* GetCurrentEnvironment(v8::Local<v8::Context> context);
625
735
  NODE_EXTERN IsolateData* GetEnvironmentIsolateData(Environment* env);
626
736
  NODE_EXTERN ArrayBufferAllocator* GetArrayBufferAllocator(IsolateData* data);
737
+ // This is mostly useful for Environment* instances that were created through
738
+ // a snapshot and have a main context that was read from that snapshot.
739
+ NODE_EXTERN v8::Local<v8::Context> GetMainContext(Environment* env);
627
740
 
628
741
  NODE_EXTERN void OnFatalError(const char* location, const char* message);
629
742
  NODE_EXTERN void PromiseRejectCallback(v8::PromiseRejectMessage message);
@@ -730,8 +843,36 @@ class NODE_EXTERN CommonEnvironmentSetup {
730
843
  MultiIsolatePlatform* platform,
731
844
  std::vector<std::string>* errors,
732
845
  EnvironmentArgs&&... env_args);
846
+ template <typename... EnvironmentArgs>
847
+ static std::unique_ptr<CommonEnvironmentSetup> CreateFromSnapshot(
848
+ MultiIsolatePlatform* platform,
849
+ std::vector<std::string>* errors,
850
+ const EmbedderSnapshotData* snapshot_data,
851
+ EnvironmentArgs&&... env_args);
852
+
853
+ // Create an embedding setup which will be used for creating a snapshot
854
+ // using CreateSnapshot().
855
+ //
856
+ // This will create and attach a v8::SnapshotCreator to this instance,
857
+ // and the same restrictions apply to this instance that also apply to
858
+ // other V8 snapshotting environments.
859
+ // Not all Node.js APIs are supported in this case. Currently, there is
860
+ // no support for native/host objects other than Node.js builtins
861
+ // in the snapshot.
862
+ //
863
+ // Snapshots are an *experimental* feature. In particular, the embedder API
864
+ // exposed through this class is subject to change or removal between Node.js
865
+ // versions, including possible API and ABI breakage.
866
+ static std::unique_ptr<CommonEnvironmentSetup> CreateForSnapshotting(
867
+ MultiIsolatePlatform* platform,
868
+ std::vector<std::string>* errors,
869
+ const std::vector<std::string>& args = {},
870
+ const std::vector<std::string>& exec_args = {});
871
+ EmbedderSnapshotData::Pointer CreateSnapshot();
733
872
 
734
873
  struct uv_loop_s* event_loop() const;
874
+ v8::SnapshotCreator* snapshot_creator();
875
+ // Empty for snapshotting environments.
735
876
  std::shared_ptr<ArrayBufferAllocator> array_buffer_allocator() const;
736
877
  v8::Isolate* isolate() const;
737
878
  IsolateData* isolate_data() const;
@@ -744,11 +885,23 @@ class NODE_EXTERN CommonEnvironmentSetup {
744
885
  CommonEnvironmentSetup& operator=(CommonEnvironmentSetup&&) = delete;
745
886
 
746
887
  private:
888
+ enum Flags : uint32_t {
889
+ kNoFlags = 0,
890
+ kIsForSnapshotting = 1,
891
+ };
892
+
747
893
  struct Impl;
748
894
  Impl* impl_;
895
+
896
+ CommonEnvironmentSetup(
897
+ MultiIsolatePlatform*,
898
+ std::vector<std::string>*,
899
+ std::function<Environment*(const CommonEnvironmentSetup*)>);
749
900
  CommonEnvironmentSetup(
750
901
  MultiIsolatePlatform*,
751
902
  std::vector<std::string>*,
903
+ const EmbedderSnapshotData*,
904
+ uint32_t flags,
752
905
  std::function<Environment*(const CommonEnvironmentSetup*)>);
753
906
  };
754
907
 
@@ -768,6 +921,28 @@ std::unique_ptr<CommonEnvironmentSetup> CommonEnvironmentSetup::Create(
768
921
  if (!errors->empty()) ret.reset();
769
922
  return ret;
770
923
  }
924
+ // Implementation for ::CreateFromSnapshot -- the ::Create() method
925
+ // could call this with a nullptr snapshot_data in a major version.
926
+ template <typename... EnvironmentArgs>
927
+ std::unique_ptr<CommonEnvironmentSetup>
928
+ CommonEnvironmentSetup::CreateFromSnapshot(
929
+ MultiIsolatePlatform* platform,
930
+ std::vector<std::string>* errors,
931
+ const EmbedderSnapshotData* snapshot_data,
932
+ EnvironmentArgs&&... env_args) {
933
+ auto ret = std::unique_ptr<CommonEnvironmentSetup>(new CommonEnvironmentSetup(
934
+ platform,
935
+ errors,
936
+ snapshot_data,
937
+ Flags::kNoFlags,
938
+ [&](const CommonEnvironmentSetup* setup) -> Environment* {
939
+ return CreateEnvironment(setup->isolate_data(),
940
+ setup->context(),
941
+ std::forward<EnvironmentArgs>(env_args)...);
942
+ }));
943
+ if (!errors->empty()) ret.reset();
944
+ return ret;
945
+ }
771
946
 
772
947
  /* Converts a unixtime to V8 Date */
773
948
  NODE_DEPRECATED("Use v8::Date::New() directly",
@@ -175,6 +175,7 @@ NAPI_EXTERN napi_status NAPI_CDECL napi_get_buffer_info(napi_env env,
175
175
  void** data,
176
176
  size_t* length);
177
177
 
178
+ #ifndef __wasm32__
178
179
  // Methods to manage simple async operations
179
180
  NAPI_EXTERN napi_status NAPI_CDECL
180
181
  napi_create_async_work(napi_env env,
@@ -190,6 +191,7 @@ NAPI_EXTERN napi_status NAPI_CDECL napi_queue_async_work(napi_env env,
190
191
  napi_async_work work);
191
192
  NAPI_EXTERN napi_status NAPI_CDECL napi_cancel_async_work(napi_env env,
192
193
  napi_async_work work);
194
+ #endif // __wasm32__
193
195
 
194
196
  // version management
195
197
  NAPI_EXTERN napi_status NAPI_CDECL
@@ -23,8 +23,8 @@
23
23
  #define SRC_NODE_VERSION_H_
24
24
 
25
25
  #define NODE_MAJOR_VERSION 19
26
- #define NODE_MINOR_VERSION 6
27
- #define NODE_PATCH_VERSION 1
26
+ #define NODE_MINOR_VERSION 8
27
+ #define NODE_PATCH_VERSION 0
28
28
 
29
29
  #define NODE_VERSION_IS_LTS 0
30
30
  #define NODE_VERSION_LTS_CODENAME ""
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "node-aix-ppc64",
3
- "version": "v19.6.1",
3
+ "version": "v19.8.0",
4
4
  "description": "node",
5
5
  "bin": {
6
6
  "node": "bin/node"
@@ -160,6 +160,9 @@ Use the specified file as a security policy.
160
160
  .It Fl -experimental-shadow-realm
161
161
  Use this flag to enable ShadowRealm support.
162
162
  .
163
+ .It Fl -experimental-test-coverage
164
+ Enable code coverage in the test runner.
165
+ .
163
166
  .It Fl -no-experimental-fetch
164
167
  Disable experimental support for the Fetch API.
165
168
  .
@@ -395,6 +398,12 @@ Starts the Node.js command line test runner.
395
398
  A regular expression that configures the test runner to only execute tests
396
399
  whose name matches the provided pattern.
397
400
  .
401
+ .It Fl -test-reporter
402
+ A test reporter to use when running tests.
403
+ .
404
+ .It Fl -test-reporter-destination
405
+ The destination for the corresponding test reporter.
406
+ .
398
407
  .It Fl -test-only
399
408
  Configures the test runner to only execute top level tests that have the `only`
400
409
  option set.