Skip to content

Commit

Permalink
Update v8 version to 11.8.172.15 (#67)
Browse files Browse the repository at this point in the history
  • Loading branch information
MeirShpilraien authored Oct 16, 2023
1 parent edce515 commit b9c1240
Show file tree
Hide file tree
Showing 8 changed files with 85 additions and 38 deletions.
2 changes: 1 addition & 1 deletion build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ lazy_static::lazy_static! {

static ref PROFILE: String = env::var("PROFILE").expect("PROFILE env var was not given");

static ref V8_DEFAULT_VERSION: &'static str = "11.7.439.21";
static ref V8_DEFAULT_VERSION: &'static str = "11.8.172.15";
static ref V8_VERSION: String = env::var("V8_VERSION").map(|v| if v == "default" {V8_DEFAULT_VERSION.to_string()} else {v}).unwrap_or(V8_DEFAULT_VERSION.to_string());
static ref V8_HEADERS_PATH: String = env::var("V8_HEADERS_PATH").unwrap_or("v8_c_api/libv8.include.zip".into());
static ref V8_HEADERS_URL: String = env::var("V8_HEADERS_URL").unwrap_or(format!("http://redismodules.s3.amazonaws.com/redisgears/dependencies/libv8.{}.include.zip", *V8_VERSION));
Expand Down
39 changes: 39 additions & 0 deletions v8_c_api/src/v8include/v8-callbacks.h
Original file line number Diff line number Diff line change
Expand Up @@ -424,6 +424,45 @@ using PrepareStackTraceCallback = MaybeLocal<Value> (*)(Local<Context> context,
Local<Value> error,
Local<Array> sites);

#if defined(V8_OS_WIN)
/**
* Callback to selectively enable ETW tracing based on the document URL.
* Implemented by the embedder, it should never call back into V8.
*
* Windows allows passing additional data to the ETW EnableCallback:
* https://learn.microsoft.com/en-us/windows/win32/api/evntprov/nc-evntprov-penablecallback
*
* This data can be configured in a WPR (Windows Performance Recorder)
* profile, adding a CustomFilter to an EventProvider like the following:
*
* <EventProvider Id=".." Name="57277741-3638-4A4B-BDBA-0AC6E45DA56C" Level="5">
* <CustomFilter Type="0x80000000" Value="AQABAAAAAAA..." />
* </EventProvider>
*
* Where:
* - Name="57277741-3638-4A4B-BDBA-0AC6E45DA56C" is the GUID of the V8
* ETW provider, (see src/libplatform/etw/etw-provider-win.h),
* - Type="0x80000000" is EVENT_FILTER_TYPE_SCHEMATIZED,
* - Value="AQABAAAAAA..." is a base64-encoded byte array that is
* base64-decoded by Windows and passed to the ETW enable callback in
* the 'PEVENT_FILTER_DESCRIPTOR FilterData' argument; see:
* https://learn.microsoft.com/en-us/windows/win32/api/evntprov/ns-evntprov-event_filter_descriptor.
*
* This array contains a struct EVENT_FILTER_HEADER followed by a
* variable length payload, and as payload we pass a string in JSON format,
* with a list of regular expressions that should match the document URL
* in order to enable ETW tracing:
* {
* "version": "1.0",
* "filtered_urls": [
* "https:\/\/.*\.chromium\.org\/.*", "https://v8.dev/";, "..."
* ]
* }
*/
using FilterETWSessionByURLCallback =
bool (*)(Local<Context> context, const std::string& etw_filter_payload);
#endif // V8_OS_WIN

} // namespace v8

#endif // INCLUDE_V8_ISOLATE_CALLBACKS_H_
1 change: 1 addition & 0 deletions v8_c_api/src/v8include/v8-internal.h
Original file line number Diff line number Diff line change
Expand Up @@ -366,6 +366,7 @@ constexpr ExternalPointerHandle kNullExternalPointerHandle = 0;
// ExternalPointerTable.
constexpr uint64_t kExternalPointerMarkBit = 1ULL << 62;
constexpr uint64_t kExternalPointerTagMask = 0x40ff000000000000;
constexpr uint64_t kExternalPointerTagMaskWithoutMarkBit = 0xff000000000000;
constexpr uint64_t kExternalPointerTagShift = 48;

// All possible 8-bit type tags.
Expand Down
65 changes: 37 additions & 28 deletions v8_c_api/src/v8include/v8-isolate.h
Original file line number Diff line number Diff line change
Expand Up @@ -421,58 +421,59 @@ class V8_EXPORT Isolate {
enum UseCounterFeature {
kUseAsm = 0,
kBreakIterator = 1,
kLegacyConst = 2,
kMarkDequeOverflow = 3,
kStoreBufferOverflow = 4,
kSlotsBufferOverflow = 5,
kObjectObserve = 6,
kLegacyConst V8_DEPRECATE_SOON("unused") = 2,
kMarkDequeOverflow V8_DEPRECATE_SOON("unused") = 3,
kStoreBufferOverflow V8_DEPRECATE_SOON("unused") = 4,
kSlotsBufferOverflow V8_DEPRECATE_SOON("unused") = 5,
kObjectObserve V8_DEPRECATE_SOON("unused") = 6,
kForcedGC = 7,
kSloppyMode = 8,
kStrictMode = 9,
kStrongMode = 10,
kStrongMode V8_DEPRECATE_SOON("unused") = 10,
kRegExpPrototypeStickyGetter = 11,
kRegExpPrototypeToString = 12,
kRegExpPrototypeUnicodeGetter = 13,
kIntlV8Parse = 14,
kIntlPattern = 15,
kIntlResolved = 16,
kPromiseChain = 17,
kPromiseAccept = 18,
kPromiseDefer = 19,
kIntlV8Parse V8_DEPRECATE_SOON("unused") = 14,
kIntlPattern V8_DEPRECATE_SOON("unused") = 15,
kIntlResolved V8_DEPRECATE_SOON("unused") = 16,
kPromiseChain V8_DEPRECATE_SOON("unused") = 17,
kPromiseAccept V8_DEPRECATE_SOON("unused") = 18,
kPromiseDefer V8_DEPRECATE_SOON("unused") = 19,
kHtmlCommentInExternalScript = 20,
kHtmlComment = 21,
kSloppyModeBlockScopedFunctionRedefinition = 22,
kForInInitializer = 23,
kArrayProtectorDirtied = 24,
kArrayProtectorDirtied V8_DEPRECATE_SOON("unused") = 24,
kArraySpeciesModified = 25,
kArrayPrototypeConstructorModified = 26,
kArrayInstanceProtoModified = 27,
kArrayInstanceProtoModified V8_DEPRECATE_SOON("unused") = 27,
kArrayInstanceConstructorModified = 28,
kLegacyFunctionDeclaration = 29,
kRegExpPrototypeSourceGetter = 30, // Unused.
kRegExpPrototypeOldFlagGetter = 31, // Unused.
kLegacyFunctionDeclaration V8_DEPRECATE_SOON("unused") = 29,
kRegExpPrototypeSourceGetter V8_DEPRECATE_SOON("unused") = 30,
kRegExpPrototypeOldFlagGetter V8_DEPRECATE_SOON("unused") = 31,
kDecimalWithLeadingZeroInStrictMode = 32,
kLegacyDateParser = 33,
kDefineGetterOrSetterWouldThrow = 34,
kFunctionConstructorReturnedUndefined = 35,
kAssigmentExpressionLHSIsCallInSloppy = 36,
kAssigmentExpressionLHSIsCallInStrict = 37,
kPromiseConstructorReturnedUndefined = 38,
kConstructorNonUndefinedPrimitiveReturn = 39,
kLabeledExpressionStatement = 40,
kLineOrParagraphSeparatorAsLineTerminator = 41,
kConstructorNonUndefinedPrimitiveReturn V8_DEPRECATE_SOON("unused") = 39,
kLabeledExpressionStatement V8_DEPRECATE_SOON("unused") = 40,
kLineOrParagraphSeparatorAsLineTerminator V8_DEPRECATE_SOON("unused") = 41,
kIndexAccessor = 42,
kErrorCaptureStackTrace = 43,
kErrorPrepareStackTrace = 44,
kErrorStackTraceLimit = 45,
kWebAssemblyInstantiation = 46,
kDeoptimizerDisableSpeculation = 47,
kArrayPrototypeSortJSArrayModifiedPrototype = 48,
kArrayPrototypeSortJSArrayModifiedPrototype V8_DEPRECATE_SOON("unused") =
48,
kFunctionTokenOffsetTooLongForToString = 49,
kWasmSharedMemory = 50,
kWasmThreadOpcodes = 51,
kAtomicsNotify = 52, // Unused.
kAtomicsWake = 53, // Unused.
kAtomicsNotify V8_DEPRECATE_SOON("unused") = 52,
kAtomicsWake V8_DEPRECATE_SOON("unused") = 53,
kCollator = 54,
kNumberFormat = 55,
kDateTimeFormat = 56,
Expand All @@ -482,22 +483,22 @@ class V8_EXPORT Isolate {
kListFormat = 60,
kSegmenter = 61,
kStringLocaleCompare = 62,
kStringToLocaleUpperCase = 63,
kStringToLocaleUpperCase V8_DEPRECATE_SOON("unused") = 63,
kStringToLocaleLowerCase = 64,
kNumberToLocaleString = 65,
kDateToLocaleString = 66,
kDateToLocaleDateString = 67,
kDateToLocaleTimeString = 68,
kAttemptOverrideReadOnlyOnPrototypeSloppy = 69,
kAttemptOverrideReadOnlyOnPrototypeStrict = 70,
kOptimizedFunctionWithOneShotBytecode = 71, // Unused.
kOptimizedFunctionWithOneShotBytecode V8_DEPRECATE_SOON("unused") = 71,
kRegExpMatchIsTrueishOnNonJSRegExp = 72,
kRegExpMatchIsFalseishOnJSRegExp = 73,
kDateGetTimezoneOffset = 74, // Unused.
kDateGetTimezoneOffset V8_DEPRECATE_SOON("unused") = 74,
kStringNormalize = 75,
kCallSiteAPIGetFunctionSloppyCall = 76,
kCallSiteAPIGetThisSloppyCall = 77,
kRegExpMatchAllWithNonGlobalRegExp = 78,
kRegExpMatchAllWithNonGlobalRegExp V8_DEPRECATE_SOON("unused") = 78,
kRegExpExecCalledOnSlowRegExp = 79,
kRegExpReplaceCalledOnSlowRegExp = 80,
kDisplayNames = 81,
Expand Down Expand Up @@ -540,7 +541,8 @@ class V8_EXPORT Isolate {
kAsyncStackTaggingCreateTaskCall = 116,
kDurationFormat = 117,
kInvalidatedNumberStringNotRegexpLikeProtector = 118,
kRegExpUnicodeSetIncompatibilitiesWithUnicodeMode = 119, // Unused.
kRegExpUnicodeSetIncompatibilitiesWithUnicodeMode V8_DEPRECATE_SOON(
"unused") = 119,
kImportAssertionDeprecatedSyntax = 120,
kLocaleInfoObsoletedGetters = 121,
kLocaleInfoFunctions = 122,
Expand Down Expand Up @@ -677,6 +679,13 @@ class V8_EXPORT Isolate {
*/
void SetPrepareStackTraceCallback(PrepareStackTraceCallback callback);

#if defined(V8_OS_WIN)
/**
* This specifies the callback called when an ETW tracing session starts.
*/
void SetFilterETWSessionByURLCallback(FilterETWSessionByURLCallback callback);
#endif // V8_OS_WIN

/**
* Optional notification that the system is running low on memory.
* V8 uses these notifications to guide heuristics.
Expand Down
5 changes: 2 additions & 3 deletions v8_c_api/src/v8include/v8-object.h
Original file line number Diff line number Diff line change
Expand Up @@ -165,17 +165,16 @@ using AccessorNameSetterCallback =
/**
* Access control specifications.
*
* Some accessors should be accessible across contexts. These
* Some accessors should be accessible across contexts. These
* accessors have an explicit access control parameter which specifies
* the kind of cross-context access that should be allowed.
*
* TODO(dcarney): Remove PROHIBITS_OVERWRITING as it is now unused.
*/
enum AccessControl {
DEFAULT = 0,
ALL_CAN_READ = 1,
ALL_CAN_WRITE = 1 << 1,
PROHIBITS_OVERWRITING = 1 << 2
PROHIBITS_OVERWRITING V8_ENUM_DEPRECATE_SOON("unused") = 1 << 2
};

/**
Expand Down
1 change: 0 additions & 1 deletion v8_c_api/src/v8include/v8-profiler.h
Original file line number Diff line number Diff line change
Expand Up @@ -597,7 +597,6 @@ class V8_EXPORT HeapGraphNode {
kBigInt = 13, // BigInt.
kObjectShape = 14, // Internal data used for tracking the shapes (or
// "hidden classes") of JS objects.
kWasmObject = 15, // A WasmGC struct or array.
};

/** Returns node type (see HeapGraphNode::Type). */
Expand Down
4 changes: 2 additions & 2 deletions v8_c_api/src/v8include/v8-script.h
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ class V8_EXPORT ScriptOrModule {
/**
* A compiled JavaScript script, not yet tied to a Context.
*/
class V8_EXPORT UnboundScript {
class V8_EXPORT UnboundScript : public Data {
public:
/**
* Binds the script to the currently entered context.
Expand Down Expand Up @@ -320,7 +320,7 @@ class V8_EXPORT Module : public Data {
* A compiled JavaScript script, tied to a Context which was active when the
* script was compiled.
*/
class V8_EXPORT Script {
class V8_EXPORT Script : public Data {
public:
/**
* A shorthand for ScriptCompiler::Compile().
Expand Down
6 changes: 3 additions & 3 deletions v8_c_api/src/v8include/v8-version.h
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,9 @@
// NOTE these macros are used by some of the tool scripts and the build
// system so their names cannot be changed without changing the scripts.
#define V8_MAJOR_VERSION 11
#define V8_MINOR_VERSION 7
#define V8_BUILD_NUMBER 439
#define V8_PATCH_LEVEL 21
#define V8_MINOR_VERSION 8
#define V8_BUILD_NUMBER 172
#define V8_PATCH_LEVEL 15

// Use 1 for candidates and 0 otherwise.
// (Boolean macro values are not supported by all preprocessors.)
Expand Down

0 comments on commit b9c1240

Please sign in to comment.