Skip to content

Commit

Permalink
Update version to 11.7.439.17 (#60)
Browse files Browse the repository at this point in the history
  • Loading branch information
MeirShpilraien authored Sep 17, 2023
1 parent 5126040 commit 01fdfa2
Show file tree
Hide file tree
Showing 20 changed files with 333 additions and 111 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.6.189.20";
static ref V8_DEFAULT_VERSION: &'static str = "11.7.439.17";
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
4 changes: 4 additions & 0 deletions v8_c_api/src/v8include/cppgc/persistent.h
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,7 @@ class BasicPersistent final : public PersistentBase,
template <typename U, typename OtherWeaknessPolicy,
typename OtherLocationPolicy, typename OtherCheckingPolicy,
typename = std::enable_if_t<std::is_base_of<T, U>::value>>
// NOLINTNEXTLINE
BasicPersistent(
const BasicPersistent<U, OtherWeaknessPolicy, OtherLocationPolicy,
OtherCheckingPolicy>& other,
Expand All @@ -116,6 +117,7 @@ class BasicPersistent final : public PersistentBase,
typename MemberWeaknessTag, typename MemberCheckingPolicy,
typename MemberStorageType,
typename = std::enable_if_t<std::is_base_of<T, U>::value>>
// NOLINTNEXTLINE
BasicPersistent(const internal::BasicMember<
U, MemberBarrierPolicy, MemberWeaknessTag,
MemberCheckingPolicy, MemberStorageType>& member,
Expand Down Expand Up @@ -180,6 +182,8 @@ class BasicPersistent final : public PersistentBase,
}

explicit operator bool() const { return Get(); }
// Historically we allow implicit conversions to T*.
// NOLINTNEXTLINE
operator T*() const { return Get(); }
T* operator->() const { return Get(); }
T& operator*() const { return *Get(); }
Expand Down
5 changes: 5 additions & 0 deletions v8_c_api/src/v8include/js_protocol.pdl
Original file line number Diff line number Diff line change
Expand Up @@ -1034,6 +1034,11 @@ domain Runtime
# Deep serialization depth. Default is full depth. Respected only in `deep` serialization mode.
optional integer maxDepth

# Embedder-specific parameters. For example if connected to V8 in Chrome these control DOM
# serialization via `maxNodeDepth: integer` and `includeShadowTree: "none" | "open" | "all"`.
# Values can be only of type string or integer.
optional object additionalParameters

# Represents deep serialized value.
type DeepSerializedValue extends object
properties
Expand Down
8 changes: 7 additions & 1 deletion v8_c_api/src/v8include/libplatform/libplatform.h
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,8 @@ enum class MessageLoopBehavior : bool {
kWaitForWork = true
};

enum class PriorityMode : bool { kDontApply, kApply };

/**
* Returns a new instance of the default v8::Platform implementation.
*
Expand All @@ -35,13 +37,17 @@ enum class MessageLoopBehavior : bool {
* calling v8::platform::RunIdleTasks to process the idle tasks.
* If |tracing_controller| is nullptr, the default platform will create a
* v8::platform::TracingController instance and use it.
* If |priority_mode| is PriorityMode::kApply, the default platform will use
* multiple task queues executed by threads different system-level priorities
* (where available) to schedule tasks.
*/
V8_PLATFORM_EXPORT std::unique_ptr<v8::Platform> NewDefaultPlatform(
int thread_pool_size = 0,
IdleTaskSupport idle_task_support = IdleTaskSupport::kDisabled,
InProcessStackDumping in_process_stack_dumping =
InProcessStackDumping::kDisabled,
std::unique_ptr<v8::TracingController> tracing_controller = {});
std::unique_ptr<v8::TracingController> tracing_controller = {},
PriorityMode priority_mode = PriorityMode::kDontApply);

/**
* The same as NewDefaultPlatform but disables the worker thread pool.
Expand Down
11 changes: 9 additions & 2 deletions v8_c_api/src/v8include/v8-callbacks.h
Original file line number Diff line number Diff line change
Expand Up @@ -147,14 +147,18 @@ using JitCodeEventHandler = void (*)(const JitCodeEvent* event);
* the callback functions, you therefore cannot manipulate objects (set or
* delete properties for example) since it is possible such operations will
* result in the allocation of objects.
* TODO(v8:12612): Deprecate kGCTypeMinorMarkSweep after updating blink.
*/
enum GCType {
kGCTypeScavenge = 1 << 0,
kGCTypeMinorMarkCompact = 1 << 1,
kGCTypeMinorMarkSweep = 1 << 1,
kGCTypeMinorMarkCompact V8_DEPRECATE_SOON(
"Use kGCTypeMinorMarkSweep instead of kGCTypeMinorMarkCompact.") =
kGCTypeMinorMarkSweep,
kGCTypeMarkSweepCompact = 1 << 2,
kGCTypeIncrementalMarking = 1 << 3,
kGCTypeProcessWeakCallbacks = 1 << 4,
kGCTypeAll = kGCTypeScavenge | kGCTypeMinorMarkCompact |
kGCTypeAll = kGCTypeScavenge | kGCTypeMinorMarkSweep |
kGCTypeMarkSweepCompact | kGCTypeIncrementalMarking |
kGCTypeProcessWeakCallbacks
};
Expand Down Expand Up @@ -327,6 +331,9 @@ using WasmLoadSourceMapCallback = Local<String> (*)(Isolate* isolate,
// If the callback returns true, it will also enable Wasm stringrefs.
using WasmGCEnabledCallback = bool (*)(Local<Context> context);

// --- Callback for checking if WebAssembly imported strings are enabled ---
using WasmImportedStringsEnabledCallback = bool (*)(Local<Context> context);

// --- Callback for checking if the SharedArrayBuffer constructor is enabled ---
using SharedArrayBufferConstructorEnabledCallback =
bool (*)(Local<Context> context);
Expand Down
3 changes: 2 additions & 1 deletion v8_c_api/src/v8include/v8-context.h
Original file line number Diff line number Diff line change
Expand Up @@ -438,7 +438,8 @@ template <class T>
MaybeLocal<T> Context::GetDataFromSnapshotOnce(size_t index) {
auto slot = GetDataFromSnapshotOnce(index);
if (slot) {
internal::PerformCastCheck(internal::ValueHelper::SlotAsValue<T>(slot));
internal::PerformCastCheck(
internal::ValueHelper::SlotAsValue<T, false>(slot));
}
return Local<T>::FromSlot(slot);
}
Expand Down
5 changes: 5 additions & 0 deletions v8_c_api/src/v8include/v8-cppgc.h
Original file line number Diff line number Diff line change
Expand Up @@ -177,6 +177,11 @@ class V8_EXPORT CppHeap {
void CollectGarbageInYoungGenerationForTesting(
cppgc::EmbedderStackState stack_state);

/**
* \returns the wrapper descriptor of this CppHeap.
*/
v8::WrapperDescriptor wrapper_descriptor() const;

private:
CppHeap() = default;

Expand Down
1 change: 0 additions & 1 deletion v8_c_api/src/v8include/v8-function-callback.h
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,6 @@ class FunctionCallbackInfo {
friend class internal::FunctionCallbackArguments;
friend class internal::CustomArguments<FunctionCallbackInfo>;
friend class debug::ConsoleCallArguments;
friend class internal::Builtins;

static constexpr int kHolderIndex = 0;
static constexpr int kIsolateIndex = 1;
Expand Down
6 changes: 6 additions & 0 deletions v8_c_api/src/v8include/v8-function.h
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,12 @@ class V8_EXPORT Function : public Object {
*/
int GetScriptColumnNumber() const;

/**
* Returns zero based start position (character offset) of function body and
* kLineOffsetNotFound if no information available.
*/
int GetScriptStartPosition() const;

/**
* Returns scriptId.
*/
Expand Down
11 changes: 8 additions & 3 deletions v8_c_api/src/v8include/v8-handle-base.h
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,11 @@ class ValueHelper final {
return reinterpret_cast<Address>(value);
}

template <typename T, typename S>
template <typename T, bool check_null = true, typename S>
V8_INLINE static T* SlotAsValue(S* slot) {
if (check_null && slot == nullptr) {
return reinterpret_cast<T*>(kTaggedNullAddress);
}
return *reinterpret_cast<T**>(slot);
}

Expand All @@ -56,7 +59,7 @@ class ValueHelper final {
return *reinterpret_cast<const Address*>(value);
}

template <typename T, typename S>
template <typename T, bool check_null = true, typename S>
V8_INLINE static T* SlotAsValue(S* slot) {
return reinterpret_cast<T*>(slot);
}
Expand Down Expand Up @@ -85,6 +88,8 @@ class HandleHelper final {
if (rhs.IsEmpty()) return false;
return lhs.ptr() == rhs.ptr();
}

static V8_EXPORT void VerifyOnStack(const void* ptr);
};

} // namespace internal
Expand Down Expand Up @@ -126,7 +131,7 @@ class IndirectHandleBase {
// whether direct local support is enabled).
template <typename T>
V8_INLINE T* value() const {
return internal::ValueHelper::SlotAsValue<T>(slot());
return internal::ValueHelper::SlotAsValue<T, false>(slot());
}

private:
Expand Down
30 changes: 30 additions & 0 deletions v8_c_api/src/v8include/v8-inspector.h
Original file line number Diff line number Diff line change
Expand Up @@ -217,6 +217,8 @@ class V8_EXPORT V8InspectorSession {
virtual void stop() = 0;
};

// Deprecated.
// TODO(crbug.com/1420968): remove.
class V8_EXPORT WebDriverValue {
public:
explicit WebDriverValue(std::unique_ptr<StringBuffer> type,
Expand All @@ -226,6 +228,27 @@ class V8_EXPORT WebDriverValue {
v8::MaybeLocal<v8::Value> value;
};

struct V8_EXPORT DeepSerializedValue {
explicit DeepSerializedValue(std::unique_ptr<StringBuffer> type,
v8::MaybeLocal<v8::Value> value = {})
: type(std::move(type)), value(value) {}
std::unique_ptr<StringBuffer> type;
v8::MaybeLocal<v8::Value> value;
};

struct V8_EXPORT DeepSerializationResult {
explicit DeepSerializationResult(
std::unique_ptr<DeepSerializedValue> serializedValue)
: serializedValue(std::move(serializedValue)), isSuccess(true) {}
explicit DeepSerializationResult(std::unique_ptr<StringBuffer> errorMessage)
: errorMessage(std::move(errorMessage)), isSuccess(false) {}

// Use std::variant when available.
std::unique_ptr<DeepSerializedValue> serializedValue;
std::unique_ptr<StringBuffer> errorMessage;
bool isSuccess;
};

class V8_EXPORT V8InspectorClient {
public:
virtual ~V8InspectorClient() = default;
Expand All @@ -243,10 +266,17 @@ class V8_EXPORT V8InspectorClient {
virtual void beginUserGesture() {}
virtual void endUserGesture() {}

// Deprecated. Use `deepSerialize` instead.
// TODO(crbug.com/1420968): remove.
virtual std::unique_ptr<WebDriverValue> serializeToWebDriverValue(
v8::Local<v8::Value> v8Value, int maxDepth) {
return nullptr;
}
virtual std::unique_ptr<DeepSerializationResult> deepSerialize(
v8::Local<v8::Value> v8Value, int maxDepth,
v8::Local<v8::Object> additionalParameters) {
return nullptr;
}
virtual std::unique_ptr<StringBuffer> valueSubtype(v8::Local<v8::Value>) {
return nullptr;
}
Expand Down
Loading

0 comments on commit 01fdfa2

Please sign in to comment.