Skip to content

Commit

Permalink
Update version to 12.0.267.8 (#81)
Browse files Browse the repository at this point in the history
  • Loading branch information
MeirShpilraien authored Dec 6, 2023
1 parent 3754c7c commit 82934fc
Show file tree
Hide file tree
Showing 14 changed files with 553 additions and 66 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.9.169.6";
static ref V8_DEFAULT_VERSION: &'static str = "12.0.267.8";
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
29 changes: 25 additions & 4 deletions v8_c_api/src/v8include/cppgc/type-traits.h
Original file line number Diff line number Diff line change
Expand Up @@ -128,13 +128,13 @@ struct IsSubclassOfBasicMemberTemplate {
private:
template <typename T, typename CheckingPolicy, typename StorageType>
static std::true_type SubclassCheck(
BasicMember<T, WeaknessTag, WriteBarrierPolicy, CheckingPolicy,
StorageType>*);
const BasicMember<T, WeaknessTag, WriteBarrierPolicy, CheckingPolicy,
StorageType>*);
static std::false_type SubclassCheck(...);

public:
static constexpr bool value =
decltype(SubclassCheck(std::declval<BasicMemberCandidate*>()))::value;
static constexpr bool value = decltype(SubclassCheck(
std::declval<std::decay_t<BasicMemberCandidate>*>()))::value;
};

template <typename T,
Expand Down Expand Up @@ -180,6 +180,14 @@ constexpr bool IsStrictlyBaseOfV =
std::is_base_of_v<std::decay_t<B>, std::decay_t<D>> &&
!IsDecayedSameV<B, D>;

template <typename T>
constexpr bool IsAnyMemberTypeV = false;

template <typename T, typename WeaknessTag, typename WriteBarrierPolicy,
typename CheckingPolicy, typename StorageType>
constexpr bool IsAnyMemberTypeV<internal::BasicMember<
T, WeaknessTag, WriteBarrierPolicy, CheckingPolicy, StorageType>> = true;

} // namespace internal

/**
Expand Down Expand Up @@ -245,6 +253,19 @@ constexpr bool IsWeakV = internal::IsWeak<T>::value;
template <typename T>
constexpr bool IsCompleteV = internal::IsComplete<T>::value;

/**
* Value is true for member types `Member<T>` and `WeakMember<T>`.
*/
template <typename T>
constexpr bool IsMemberOrWeakMemberTypeV =
IsMemberTypeV<T> || IsWeakMemberTypeV<T>;

/**
* Value is true for any member type.
*/
template <typename T>
constexpr bool IsAnyMemberTypeV = internal::IsAnyMemberTypeV<std::decay_t<T>>;

} // namespace cppgc

#endif // INCLUDE_CPPGC_TYPE_TRAITS_H_
21 changes: 20 additions & 1 deletion v8_c_api/src/v8include/v8-context.h
Original file line number Diff line number Diff line change
Expand Up @@ -181,8 +181,27 @@ class V8_EXPORT Context : public Data {
* also be considered for freezing should be added to the children_out
* parameter. Returns true if the operation completed successfully.
*/
V8_DEPRECATE_SOON("Please use the version that takes a LocalVector&")
virtual bool FreezeEmbedderObjectAndGetChildren(
Local<Object> obj, std::vector<Local<Object>>& children_out) = 0;
Local<Object> obj, std::vector<Local<Object>>& children_out) {
// TODO(chromium:1454114): This method is temporarily defined in order to
// smoothen the transition to the version that follows.
return true;
}
virtual bool FreezeEmbedderObjectAndGetChildren(
Local<Object> obj, LocalVector<Object>& children_out) {
// TODO(chromium:1454114): This method is temporarily defined and
// calls the previous version, soon to be deprecated, in order to
// smoothen the transition. When deprecation is completed, this
// will become an abstract method.
std::vector<Local<Object>> children;
START_ALLOW_USE_DEPRECATED()
// Temporarily use the old callback.
bool result = FreezeEmbedderObjectAndGetChildren(obj, children);
END_ALLOW_USE_DEPRECATED()
children_out.insert(children_out.end(), children.begin(), children.end());
return result;
}
};

/**
Expand Down
3 changes: 2 additions & 1 deletion v8_c_api/src/v8include/v8-fast-api-calls.h
Original file line number Diff line number Diff line change
Expand Up @@ -344,7 +344,8 @@ struct FastApiTypedArray : public FastApiTypedArrayBase {
ValidateIndex(index);
#endif // DEBUG
T tmp;
memcpy(&tmp, reinterpret_cast<T*>(data_) + index, sizeof(T));
memcpy(&tmp, static_cast<void*>(reinterpret_cast<T*>(data_) + index),
sizeof(T));
return tmp;
}

Expand Down
6 changes: 3 additions & 3 deletions v8_c_api/src/v8include/v8-handle-base.h
Original file line number Diff line number Diff line change
Expand Up @@ -129,9 +129,9 @@ class IndirectHandleBase {

// Returns the handler's "value" (direct or indirect pointer, depending on
// whether direct local support is enabled).
template <typename T>
template <typename T, bool check_null = false>
V8_INLINE T* value() const {
return internal::ValueHelper::SlotAsValue<T, false>(slot());
return internal::ValueHelper::SlotAsValue<T, check_null>(slot());
}

private:
Expand Down Expand Up @@ -169,7 +169,7 @@ class DirectHandleBase {

// Returns the handler's "value" (direct pointer, as direct local support
// is guaranteed to be enabled here).
template <typename T>
template <typename T, bool check_null = false>
V8_INLINE T* value() const {
return reinterpret_cast<T*>(ptr_);
}
Expand Down
Loading

0 comments on commit 82934fc

Please sign in to comment.