libv8-node 20.2.0.0-x86_64-linux → 21.7.2.0-x86_64-linux

Sign up to get free protection for your applications and to get access to all the features.
Files changed (45) hide show
  1. checksums.yaml +4 -4
  2. data/lib/libv8/node/version.rb +3 -3
  3. data/vendor/v8/include/cppgc/internal/api-constants.h +23 -4
  4. data/vendor/v8/include/cppgc/internal/caged-heap-local-data.h +16 -6
  5. data/vendor/v8/include/cppgc/internal/caged-heap.h +12 -5
  6. data/vendor/v8/include/cppgc/internal/gc-info.h +82 -91
  7. data/vendor/v8/include/cppgc/internal/member-storage.h +16 -8
  8. data/vendor/v8/include/cppgc/member.h +25 -0
  9. data/vendor/v8/include/cppgc/persistent.h +4 -0
  10. data/vendor/v8/include/cppgc/platform.h +6 -1
  11. data/vendor/v8/include/cppgc/sentinel-pointer.h +7 -0
  12. data/vendor/v8/include/cppgc/source-location.h +2 -78
  13. data/vendor/v8/include/cppgc/trace-trait.h +8 -0
  14. data/vendor/v8/include/cppgc/visitor.h +82 -4
  15. data/vendor/v8/include/libplatform/libplatform.h +7 -1
  16. data/vendor/v8/include/v8-callbacks.h +52 -8
  17. data/vendor/v8/include/v8-context.h +10 -13
  18. data/vendor/v8/include/v8-cppgc.h +5 -0
  19. data/vendor/v8/include/v8-embedder-heap.h +12 -0
  20. data/vendor/v8/include/v8-fast-api-calls.h +23 -5
  21. data/vendor/v8/include/v8-function-callback.h +11 -15
  22. data/vendor/v8/include/v8-function.h +6 -0
  23. data/vendor/v8/include/v8-handle-base.h +185 -0
  24. data/vendor/v8/include/v8-inspector.h +31 -1
  25. data/vendor/v8/include/v8-internal.h +109 -77
  26. data/vendor/v8/include/v8-isolate.h +130 -89
  27. data/vendor/v8/include/v8-local-handle.h +134 -89
  28. data/vendor/v8/include/v8-object.h +71 -52
  29. data/vendor/v8/include/v8-persistent-handle.h +65 -89
  30. data/vendor/v8/include/v8-platform.h +140 -9
  31. data/vendor/v8/include/v8-primitive.h +12 -8
  32. data/vendor/v8/include/v8-profiler.h +26 -2
  33. data/vendor/v8/include/v8-script.h +30 -7
  34. data/vendor/v8/include/v8-snapshot.h +4 -1
  35. data/vendor/v8/include/v8-source-location.h +92 -0
  36. data/vendor/v8/include/v8-statistics.h +36 -1
  37. data/vendor/v8/include/v8-traced-handle.h +37 -54
  38. data/vendor/v8/include/v8-unwinder.h +1 -1
  39. data/vendor/v8/include/v8-util.h +15 -13
  40. data/vendor/v8/include/v8-value-serializer.h +14 -0
  41. data/vendor/v8/include/v8-value.h +14 -0
  42. data/vendor/v8/include/v8-version.h +3 -3
  43. data/vendor/v8/include/v8config.h +19 -10
  44. data/vendor/v8/x86_64-linux/libv8/obj/libv8_monolith.a +0 -0
  45. metadata +4 -2
@@ -414,40 +414,43 @@ class V8_EXPORT Isolate {
414
414
  * Features reported via the SetUseCounterCallback callback. Do not change
415
415
  * assigned numbers of existing items; add new features to the end of this
416
416
  * list.
417
+ * Dead features can be marked `V8_DEPRECATE_SOON`, then `V8_DEPRECATED`, and
418
+ * then finally be renamed to `kOBSOLETE_...` to stop embedders from using
419
+ * them.
417
420
  */
418
421
  enum UseCounterFeature {
419
422
  kUseAsm = 0,
420
423
  kBreakIterator = 1,
421
- kLegacyConst = 2,
422
- kMarkDequeOverflow = 3,
423
- kStoreBufferOverflow = 4,
424
- kSlotsBufferOverflow = 5,
425
- kObjectObserve = 6,
424
+ kLegacyConst V8_DEPRECATE_SOON("unused") = 2,
425
+ kMarkDequeOverflow V8_DEPRECATE_SOON("unused") = 3,
426
+ kStoreBufferOverflow V8_DEPRECATE_SOON("unused") = 4,
427
+ kSlotsBufferOverflow V8_DEPRECATE_SOON("unused") = 5,
428
+ kObjectObserve V8_DEPRECATE_SOON("unused") = 6,
426
429
  kForcedGC = 7,
427
430
  kSloppyMode = 8,
428
431
  kStrictMode = 9,
429
- kStrongMode = 10,
432
+ kStrongMode V8_DEPRECATE_SOON("unused") = 10,
430
433
  kRegExpPrototypeStickyGetter = 11,
431
434
  kRegExpPrototypeToString = 12,
432
435
  kRegExpPrototypeUnicodeGetter = 13,
433
- kIntlV8Parse = 14,
434
- kIntlPattern = 15,
435
- kIntlResolved = 16,
436
- kPromiseChain = 17,
437
- kPromiseAccept = 18,
438
- kPromiseDefer = 19,
436
+ kIntlV8Parse V8_DEPRECATE_SOON("unused") = 14,
437
+ kIntlPattern V8_DEPRECATE_SOON("unused") = 15,
438
+ kIntlResolved V8_DEPRECATE_SOON("unused") = 16,
439
+ kPromiseChain V8_DEPRECATE_SOON("unused") = 17,
440
+ kPromiseAccept V8_DEPRECATE_SOON("unused") = 18,
441
+ kPromiseDefer V8_DEPRECATE_SOON("unused") = 19,
439
442
  kHtmlCommentInExternalScript = 20,
440
443
  kHtmlComment = 21,
441
444
  kSloppyModeBlockScopedFunctionRedefinition = 22,
442
445
  kForInInitializer = 23,
443
- kArrayProtectorDirtied = 24,
446
+ kArrayProtectorDirtied V8_DEPRECATE_SOON("unused") = 24,
444
447
  kArraySpeciesModified = 25,
445
448
  kArrayPrototypeConstructorModified = 26,
446
- kArrayInstanceProtoModified = 27,
449
+ kArrayInstanceProtoModified V8_DEPRECATE_SOON("unused") = 27,
447
450
  kArrayInstanceConstructorModified = 28,
448
- kLegacyFunctionDeclaration = 29,
449
- kRegExpPrototypeSourceGetter = 30, // Unused.
450
- kRegExpPrototypeOldFlagGetter = 31, // Unused.
451
+ kLegacyFunctionDeclaration V8_DEPRECATE_SOON("unused") = 29,
452
+ kRegExpPrototypeSourceGetter V8_DEPRECATE_SOON("unused") = 30,
453
+ kRegExpPrototypeOldFlagGetter V8_DEPRECATE_SOON("unused") = 31,
451
454
  kDecimalWithLeadingZeroInStrictMode = 32,
452
455
  kLegacyDateParser = 33,
453
456
  kDefineGetterOrSetterWouldThrow = 34,
@@ -455,21 +458,22 @@ class V8_EXPORT Isolate {
455
458
  kAssigmentExpressionLHSIsCallInSloppy = 36,
456
459
  kAssigmentExpressionLHSIsCallInStrict = 37,
457
460
  kPromiseConstructorReturnedUndefined = 38,
458
- kConstructorNonUndefinedPrimitiveReturn = 39,
459
- kLabeledExpressionStatement = 40,
460
- kLineOrParagraphSeparatorAsLineTerminator = 41,
461
+ kConstructorNonUndefinedPrimitiveReturn V8_DEPRECATE_SOON("unused") = 39,
462
+ kLabeledExpressionStatement V8_DEPRECATE_SOON("unused") = 40,
463
+ kLineOrParagraphSeparatorAsLineTerminator V8_DEPRECATE_SOON("unused") = 41,
461
464
  kIndexAccessor = 42,
462
465
  kErrorCaptureStackTrace = 43,
463
466
  kErrorPrepareStackTrace = 44,
464
467
  kErrorStackTraceLimit = 45,
465
468
  kWebAssemblyInstantiation = 46,
466
469
  kDeoptimizerDisableSpeculation = 47,
467
- kArrayPrototypeSortJSArrayModifiedPrototype = 48,
470
+ kArrayPrototypeSortJSArrayModifiedPrototype V8_DEPRECATE_SOON("unused") =
471
+ 48,
468
472
  kFunctionTokenOffsetTooLongForToString = 49,
469
473
  kWasmSharedMemory = 50,
470
474
  kWasmThreadOpcodes = 51,
471
- kAtomicsNotify = 52, // Unused.
472
- kAtomicsWake = 53, // Unused.
475
+ kAtomicsNotify V8_DEPRECATE_SOON("unused") = 52,
476
+ kAtomicsWake V8_DEPRECATE_SOON("unused") = 53,
473
477
  kCollator = 54,
474
478
  kNumberFormat = 55,
475
479
  kDateTimeFormat = 56,
@@ -479,7 +483,7 @@ class V8_EXPORT Isolate {
479
483
  kListFormat = 60,
480
484
  kSegmenter = 61,
481
485
  kStringLocaleCompare = 62,
482
- kStringToLocaleUpperCase = 63,
486
+ kStringToLocaleUpperCase V8_DEPRECATE_SOON("unused") = 63,
483
487
  kStringToLocaleLowerCase = 64,
484
488
  kNumberToLocaleString = 65,
485
489
  kDateToLocaleString = 66,
@@ -487,14 +491,14 @@ class V8_EXPORT Isolate {
487
491
  kDateToLocaleTimeString = 68,
488
492
  kAttemptOverrideReadOnlyOnPrototypeSloppy = 69,
489
493
  kAttemptOverrideReadOnlyOnPrototypeStrict = 70,
490
- kOptimizedFunctionWithOneShotBytecode = 71, // Unused.
494
+ kOptimizedFunctionWithOneShotBytecode V8_DEPRECATE_SOON("unused") = 71,
491
495
  kRegExpMatchIsTrueishOnNonJSRegExp = 72,
492
496
  kRegExpMatchIsFalseishOnJSRegExp = 73,
493
- kDateGetTimezoneOffset = 74, // Unused.
497
+ kDateGetTimezoneOffset V8_DEPRECATE_SOON("unused") = 74,
494
498
  kStringNormalize = 75,
495
499
  kCallSiteAPIGetFunctionSloppyCall = 76,
496
500
  kCallSiteAPIGetThisSloppyCall = 77,
497
- kRegExpMatchAllWithNonGlobalRegExp = 78,
501
+ kRegExpMatchAllWithNonGlobalRegExp V8_DEPRECATE_SOON("unused") = 78,
498
502
  kRegExpExecCalledOnSlowRegExp = 79,
499
503
  kRegExpReplaceCalledOnSlowRegExp = 80,
500
504
  kDisplayNames = 81,
@@ -525,8 +529,10 @@ class V8_EXPORT Isolate {
525
529
  kWasmSimdOpcodes = 106,
526
530
  kVarRedeclaredCatchBinding = 107,
527
531
  kWasmRefTypes = 108,
528
- kWasmBulkMemory = 109, // Unused.
529
- kWasmMultiValue = 110,
532
+ kWasmBulkMemory V8_DEPRECATE_SOON(
533
+ "Unused since 2021 (https://crrev.com/c/2622913)") = 109,
534
+ kWasmMultiValue V8_DEPRECATE_SOON(
535
+ "Unused since 2021 (https://crrev.com/c/2817790)") = 110,
530
536
  kWasmExceptionHandling = 111,
531
537
  kInvalidatedMegaDOMProtector = 112,
532
538
  kFunctionPrototypeArguments = 113,
@@ -534,8 +540,17 @@ class V8_EXPORT Isolate {
534
540
  kTurboFanOsrCompileStarted = 115,
535
541
  kAsyncStackTaggingCreateTaskCall = 116,
536
542
  kDurationFormat = 117,
537
- kInvalidatedNumberStringPrototypeNoReplaceProtector = 118,
538
- kRegExpUnicodeSetIncompatibilitiesWithUnicodeMode = 119, // Unused.
543
+ kInvalidatedNumberStringNotRegexpLikeProtector = 118,
544
+ kRegExpUnicodeSetIncompatibilitiesWithUnicodeMode V8_DEPRECATE_SOON(
545
+ "unused") = 119,
546
+ kImportAssertionDeprecatedSyntax = 120,
547
+ kLocaleInfoObsoletedGetters = 121,
548
+ kLocaleInfoFunctions = 122,
549
+ kCompileHintsMagicAll = 123,
550
+ kInvalidatedNoProfilingProtector = 124,
551
+ kWasmMemory64 = 125,
552
+ kWasmMultiMemory = 126,
553
+ kWasmGC = 127,
539
554
 
540
555
  // If you add new values here, you'll also need to update Chromium's:
541
556
  // web_feature.mojom, use_counter_callback.cc, and enums.xml. V8 changes to
@@ -664,6 +679,13 @@ class V8_EXPORT Isolate {
664
679
  */
665
680
  void SetPrepareStackTraceCallback(PrepareStackTraceCallback callback);
666
681
 
682
+ #if defined(V8_OS_WIN)
683
+ /**
684
+ * This specifies the callback called when an ETW tracing session starts.
685
+ */
686
+ void SetFilterETWSessionByURLCallback(FilterETWSessionByURLCallback callback);
687
+ #endif // V8_OS_WIN
688
+
667
689
  /**
668
690
  * Optional notification that the system is running low on memory.
669
691
  * V8 uses these notifications to guide heuristics.
@@ -904,25 +926,73 @@ class V8_EXPORT Isolate {
904
926
 
905
927
  /**
906
928
  * Enables the host application to receive a notification before a
907
- * garbage collection. Allocations are allowed in the callback function,
908
- * but the callback is not re-entrant: if the allocation inside it will
909
- * trigger the garbage collection, the callback won't be called again.
910
- * It is possible to specify the GCType filter for your callback. But it is
911
- * not possible to register the same callback function two times with
912
- * different GCType filters.
929
+ * garbage collection.
930
+ *
931
+ * \param callback The callback to be invoked. The callback is allowed to
932
+ * allocate but invocation is not re-entrant: a callback triggering
933
+ * garbage collection will not be called again. JS execution is prohibited
934
+ * from these callbacks. A single callback may only be registered once.
935
+ * \param gc_type_filter A filter in case it should be applied.
913
936
  */
914
- void AddGCPrologueCallback(GCCallbackWithData callback, void* data = nullptr,
915
- GCType gc_type_filter = kGCTypeAll);
916
937
  void AddGCPrologueCallback(GCCallback callback,
917
938
  GCType gc_type_filter = kGCTypeAll);
918
939
 
919
940
  /**
920
- * This function removes callback which was installed by
921
- * AddGCPrologueCallback function.
941
+ * \copydoc AddGCPrologueCallback(GCCallback, GCType)
942
+ *
943
+ * \param data Additional data that should be passed to the callback.
944
+ */
945
+ void AddGCPrologueCallback(GCCallbackWithData callback, void* data = nullptr,
946
+ GCType gc_type_filter = kGCTypeAll);
947
+
948
+ /**
949
+ * This function removes a callback which was added by
950
+ * `AddGCPrologueCallback`.
951
+ *
952
+ * \param callback the callback to remove.
922
953
  */
923
- void RemoveGCPrologueCallback(GCCallbackWithData, void* data = nullptr);
924
954
  void RemoveGCPrologueCallback(GCCallback callback);
925
955
 
956
+ /**
957
+ * \copydoc AddGCPrologueCallback(GCCallback)
958
+ *
959
+ * \param data Additional data that was used to install the callback.
960
+ */
961
+ void RemoveGCPrologueCallback(GCCallbackWithData, void* data = nullptr);
962
+
963
+ /**
964
+ * Enables the host application to receive a notification after a
965
+ * garbage collection.
966
+ *
967
+ * \copydetails AddGCPrologueCallback(GCCallback, GCType)
968
+ */
969
+ void AddGCEpilogueCallback(GCCallback callback,
970
+ GCType gc_type_filter = kGCTypeAll);
971
+
972
+ /**
973
+ * \copydoc AddGCEpilogueCallback(GCCallback, GCType)
974
+ *
975
+ * \param data Additional data that should be passed to the callback.
976
+ */
977
+ void AddGCEpilogueCallback(GCCallbackWithData callback, void* data = nullptr,
978
+ GCType gc_type_filter = kGCTypeAll);
979
+
980
+ /**
981
+ * This function removes a callback which was added by
982
+ * `AddGCEpilogueCallback`.
983
+ *
984
+ * \param callback the callback to remove.
985
+ */
986
+ void RemoveGCEpilogueCallback(GCCallback callback);
987
+
988
+ /**
989
+ * \copydoc RemoveGCEpilogueCallback(GCCallback)
990
+ *
991
+ * \param data Additional data that was used to install the callback.
992
+ */
993
+ void RemoveGCEpilogueCallback(GCCallbackWithData callback,
994
+ void* data = nullptr);
995
+
926
996
  /**
927
997
  * Sets an embedder roots handle that V8 should consider when performing
928
998
  * non-unified heap garbage collections. The intended use case is for setting
@@ -1032,28 +1102,6 @@ class V8_EXPORT Isolate {
1032
1102
  */
1033
1103
  void SetAtomicsWaitCallback(AtomicsWaitCallback callback, void* data);
1034
1104
 
1035
- /**
1036
- * Enables the host application to receive a notification after a
1037
- * garbage collection. Allocations are allowed in the callback function,
1038
- * but the callback is not re-entrant: if the allocation inside it will
1039
- * trigger the garbage collection, the callback won't be called again.
1040
- * It is possible to specify the GCType filter for your callback. But it is
1041
- * not possible to register the same callback function two times with
1042
- * different GCType filters.
1043
- */
1044
- void AddGCEpilogueCallback(GCCallbackWithData callback, void* data = nullptr,
1045
- GCType gc_type_filter = kGCTypeAll);
1046
- void AddGCEpilogueCallback(GCCallback callback,
1047
- GCType gc_type_filter = kGCTypeAll);
1048
-
1049
- /**
1050
- * This function removes callback which was installed by
1051
- * AddGCEpilogueCallback function.
1052
- */
1053
- void RemoveGCEpilogueCallback(GCCallbackWithData callback,
1054
- void* data = nullptr);
1055
- void RemoveGCEpilogueCallback(GCCallback callback);
1056
-
1057
1105
  using GetExternallyAllocatedMemoryInBytesCallback = size_t (*)();
1058
1106
 
1059
1107
  /**
@@ -1321,20 +1369,6 @@ class V8_EXPORT Isolate {
1321
1369
  */
1322
1370
  void IsolateInBackgroundNotification();
1323
1371
 
1324
- /**
1325
- * Optional notification which will enable the memory savings mode.
1326
- * V8 uses this notification to guide heuristics which may result in a
1327
- * smaller memory footprint at the cost of reduced runtime performance.
1328
- */
1329
- V8_DEPRECATED("Use IsolateInBackgroundNotification() instead")
1330
- void EnableMemorySavingsMode();
1331
-
1332
- /**
1333
- * Optional notification which will disable the memory savings mode.
1334
- */
1335
- V8_DEPRECATED("Use IsolateInBackgroundNotification() instead")
1336
- void DisableMemorySavingsMode();
1337
-
1338
1372
  /**
1339
1373
  * Optional notification to tell V8 the current performance requirements
1340
1374
  * of the embedder based on RAIL.
@@ -1506,22 +1540,26 @@ class V8_EXPORT Isolate {
1506
1540
 
1507
1541
  void SetWasmLoadSourceMapCallback(WasmLoadSourceMapCallback callback);
1508
1542
 
1509
- V8_DEPRECATED("Wasm SIMD is always enabled")
1510
- void SetWasmSimdEnabledCallback(WasmSimdEnabledCallback callback);
1511
-
1512
- V8_DEPRECATED("Wasm exceptions are always enabled")
1513
- void SetWasmExceptionsEnabledCallback(WasmExceptionsEnabledCallback callback);
1514
-
1515
1543
  /**
1516
- * Register callback to control whehter Wasm GC is enabled.
1544
+ * Register callback to control whether Wasm GC is enabled.
1517
1545
  * The callback overwrites the value of the flag.
1518
1546
  * If the callback returns true, it will also enable Wasm stringrefs.
1519
1547
  */
1520
1548
  void SetWasmGCEnabledCallback(WasmGCEnabledCallback callback);
1521
1549
 
1550
+ void SetWasmImportedStringsEnabledCallback(
1551
+ WasmImportedStringsEnabledCallback callback);
1552
+
1522
1553
  void SetSharedArrayBufferConstructorEnabledCallback(
1523
1554
  SharedArrayBufferConstructorEnabledCallback callback);
1524
1555
 
1556
+ /**
1557
+ * Register callback to control whether compile hints magic comments are
1558
+ * enabled.
1559
+ */
1560
+ void SetJavaScriptCompileHintsMagicEnabledCallback(
1561
+ JavaScriptCompileHintsMagicEnabledCallback callback);
1562
+
1525
1563
  /**
1526
1564
  * This function can be called by the embedder to signal V8 that the dynamic
1527
1565
  * enabling of features has finished. V8 can now set up dynamically added
@@ -1583,6 +1621,7 @@ class V8_EXPORT Isolate {
1583
1621
  * heap. GC is not invoked prior to iterating, therefore there is no
1584
1622
  * guarantee that visited objects are still alive.
1585
1623
  */
1624
+ V8_DEPRECATE_SOON("Will be removed without replacement. crbug.com/v8/14172")
1586
1625
  void VisitExternalResources(ExternalResourceVisitor* visitor);
1587
1626
 
1588
1627
  /**
@@ -1673,10 +1712,12 @@ uint32_t Isolate::GetNumberOfDataSlots() {
1673
1712
 
1674
1713
  template <class T>
1675
1714
  MaybeLocal<T> Isolate::GetDataFromSnapshotOnce(size_t index) {
1676
- T* data =
1677
- internal::ValueHelper::SlotAsValue<T>(GetDataFromSnapshotOnce(index));
1678
- if (data) internal::PerformCastCheck(data);
1679
- return Local<T>(data);
1715
+ auto slot = GetDataFromSnapshotOnce(index);
1716
+ if (slot) {
1717
+ internal::PerformCastCheck(
1718
+ internal::ValueHelper::SlotAsValue<T, false>(slot));
1719
+ }
1720
+ return Local<T>::FromSlot(slot);
1680
1721
  }
1681
1722
 
1682
1723
  } // namespace v8