aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ports/v8/3f8dc4b.patch155
-rw-r--r--ports/v8/CONTROL2
-rw-r--r--ports/v8/V8Config-shared.cmake112
-rw-r--r--ports/v8/V8Config-static.cmake97
-rw-r--r--ports/v8/build.patch102
-rw-r--r--ports/v8/portfile.cmake19
-rw-r--r--ports/v8/v8.patch226
7 files changed, 480 insertions, 233 deletions
diff --git a/ports/v8/3f8dc4b.patch b/ports/v8/3f8dc4b.patch
deleted file mode 100644
index 6360a1d34..000000000
--- a/ports/v8/3f8dc4b.patch
+++ /dev/null
@@ -1,155 +0,0 @@
-diff --git a/src/objects/js-number-format.cc b/src/objects/js-number-format.cc
-index ad831c5..bcd4403 100644
---- a/src/objects/js-number-format.cc
-+++ b/src/objects/js-number-format.cc
-@@ -1241,44 +1241,33 @@
- }
-
- namespace {
--Maybe<icu::UnicodeString> IcuFormatNumber(
-+Maybe<bool> IcuFormatNumber(
- Isolate* isolate,
- const icu::number::LocalizedNumberFormatter& number_format,
-- Handle<Object> numeric_obj, icu::FieldPositionIterator* fp_iter) {
-+ Handle<Object> numeric_obj, icu::number::FormattedNumber* formatted) {
- // If it is BigInt, handle it differently.
- UErrorCode status = U_ZERO_ERROR;
-- icu::number::FormattedNumber formatted;
- if (numeric_obj->IsBigInt()) {
- Handle<BigInt> big_int = Handle<BigInt>::cast(numeric_obj);
- Handle<String> big_int_string;
- ASSIGN_RETURN_ON_EXCEPTION_VALUE(isolate, big_int_string,
- BigInt::ToString(isolate, big_int),
-- Nothing<icu::UnicodeString>());
-- formatted = number_format.formatDecimal(
-+ Nothing<bool>());
-+ *formatted = number_format.formatDecimal(
- {big_int_string->ToCString().get(), big_int_string->length()}, status);
- } else {
- double number = numeric_obj->IsNaN()
- ? std::numeric_limits<double>::quiet_NaN()
- : numeric_obj->Number();
-- formatted = number_format.formatDouble(number, status);
-+ *formatted = number_format.formatDouble(number, status);
- }
- if (U_FAILURE(status)) {
- // This happen because of icu data trimming trim out "unit".
- // See https://bugs.chromium.org/p/v8/issues/detail?id=8641
-- THROW_NEW_ERROR_RETURN_VALUE(isolate,
-- NewTypeError(MessageTemplate::kIcuError),
-- Nothing<icu::UnicodeString>());
-+ THROW_NEW_ERROR_RETURN_VALUE(
-+ isolate, NewTypeError(MessageTemplate::kIcuError), Nothing<bool>());
- }
-- if (fp_iter) {
-- formatted.getAllFieldPositions(*fp_iter, status);
-- }
-- icu::UnicodeString result = formatted.toString(status);
-- if (U_FAILURE(status)) {
-- THROW_NEW_ERROR_RETURN_VALUE(isolate,
-- NewTypeError(MessageTemplate::kIcuError),
-- Nothing<icu::UnicodeString>());
-- }
-- return Just(result);
-+ return Just(true);
- }
-
- } // namespace
-@@ -1289,10 +1278,16 @@
- Handle<Object> numeric_obj) {
- DCHECK(numeric_obj->IsNumeric());
-
-- Maybe<icu::UnicodeString> maybe_format =
-- IcuFormatNumber(isolate, number_format, numeric_obj, nullptr);
-+ icu::number::FormattedNumber formatted;
-+ Maybe<bool> maybe_format =
-+ IcuFormatNumber(isolate, number_format, numeric_obj, &formatted);
- MAYBE_RETURN(maybe_format, Handle<String>());
-- return Intl::ToString(isolate, maybe_format.FromJust());
-+ UErrorCode status = U_ZERO_ERROR;
-+ icu::UnicodeString result = formatted.toString(status);
-+ if (U_FAILURE(status)) {
-+ THROW_NEW_ERROR(isolate, NewTypeError(MessageTemplate::kIcuError), String);
-+ }
-+ return Intl::ToString(isolate, result);
- }
-
- namespace {
-@@ -1405,12 +1400,18 @@
- }
-
- namespace {
--Maybe<int> ConstructParts(Isolate* isolate, const icu::UnicodeString& formatted,
-- icu::FieldPositionIterator* fp_iter,
-+Maybe<int> ConstructParts(Isolate* isolate,
-+ icu::number::FormattedNumber* formatted,
- Handle<JSArray> result, int start_index,
- Handle<Object> numeric_obj, bool style_is_unit) {
-+ UErrorCode status = U_ZERO_ERROR;
-+ icu::UnicodeString formatted_text = formatted->toString(status);
-+ if (U_FAILURE(status)) {
-+ THROW_NEW_ERROR_RETURN_VALUE(
-+ isolate, NewTypeError(MessageTemplate::kIcuError), Nothing<int>());
-+ }
- DCHECK(numeric_obj->IsNumeric());
-- int32_t length = formatted.length();
-+ int32_t length = formatted_text.length();
- int index = start_index;
- if (length == 0) return Just(index);
-
-@@ -1419,13 +1420,14 @@
- // other region covers some part of the formatted string. It's possible
- // there's another field with exactly the same begin and end as this backdrop,
- // in which case the backdrop's field_id of -1 will give it lower priority.
-- regions.push_back(NumberFormatSpan(-1, 0, formatted.length()));
-+ regions.push_back(NumberFormatSpan(-1, 0, formatted_text.length()));
-
- {
-- icu::FieldPosition fp;
-- while (fp_iter->next(fp)) {
-- regions.push_back(NumberFormatSpan(fp.getField(), fp.getBeginIndex(),
-- fp.getEndIndex()));
-+ icu::ConstrainedFieldPosition cfp;
-+ cfp.constrainCategory(UFIELD_CATEGORY_NUMBER);
-+ while (formatted->nextPosition(cfp, status)) {
-+ regions.push_back(
-+ NumberFormatSpan(cfp.getField(), cfp.getStart(), cfp.getLimit()));
- }
- }
-
-@@ -1447,7 +1449,7 @@
- Handle<String> substring;
- ASSIGN_RETURN_ON_EXCEPTION_VALUE(
- isolate, substring,
-- Intl::ToString(isolate, formatted, part.begin_pos, part.end_pos),
-+ Intl::ToString(isolate, formatted_text, part.begin_pos, part.end_pos),
- Nothing<int>());
- Intl::AddElement(isolate, result, index, field_type_string, substring);
- ++index;
-@@ -1467,20 +1469,19 @@
- number_format->icu_number_formatter().raw();
- CHECK_NOT_NULL(fmt);
-
-- icu::FieldPositionIterator fp_iter;
-- Maybe<icu::UnicodeString> maybe_format =
-- IcuFormatNumber(isolate, *fmt, numeric_obj, &fp_iter);
-+ icu::number::FormattedNumber formatted;
-+ Maybe<bool> maybe_format =
-+ IcuFormatNumber(isolate, *fmt, numeric_obj, &formatted);
- MAYBE_RETURN(maybe_format, Handle<JSArray>());
--
- UErrorCode status = U_ZERO_ERROR;
-+
- bool style_is_unit =
- Style::UNIT == StyleFromSkeleton(fmt->toSkeleton(status));
- CHECK(U_SUCCESS(status));
-
- Handle<JSArray> result = factory->NewJSArray(0);
-- Maybe<int> maybe_format_to_parts =
-- ConstructParts(isolate, maybe_format.FromJust(), &fp_iter, result, 0,
-- numeric_obj, style_is_unit);
-+ Maybe<int> maybe_format_to_parts = ConstructParts(
-+ isolate, &formatted, result, 0, numeric_obj, style_is_unit);
- MAYBE_RETURN(maybe_format_to_parts, Handle<JSArray>());
-
- return result;
diff --git a/ports/v8/CONTROL b/ports/v8/CONTROL
index 604821739..dad60e5ee 100644
--- a/ports/v8/CONTROL
+++ b/ports/v8/CONTROL
@@ -1,5 +1,5 @@
Source: v8
-Version: 8.3.110.13
+Version: 8.6.395.17
Homepage: https://v8.dev
Description: Google Chrome's JavaScript engine
Build-Depends: icu, zlib, glib (linux), pthread (linux)
diff --git a/ports/v8/V8Config-shared.cmake b/ports/v8/V8Config-shared.cmake
new file mode 100644
index 000000000..a27074ea3
--- /dev/null
+++ b/ports/v8/V8Config-shared.cmake
@@ -0,0 +1,112 @@
+get_filename_component(_IMPORT_PREFIX "${CMAKE_CURRENT_LIST_FILE}" PATH)
+get_filename_component(_IMPORT_PREFIX "${_IMPORT_PREFIX}" PATH)
+get_filename_component(_IMPORT_PREFIX "${_IMPORT_PREFIX}" PATH)
+if(_IMPORT_PREFIX STREQUAL "/")
+ set(_IMPORT_PREFIX "")
+endif()
+
+include(SelectLibraryConfigurations)
+
+find_path(V8_INCLUDE_DIR NAMES v8.h PATH_SUFFIXES include)
+
+if(EXISTS ${_IMPORT_PREFIX}/bin/snapshot_blob.bin)
+ set(V8_SNAPSHOT_BLOB_RELEASE ${_IMPORT_PREFIX}/bin/snapshot_blob.bin CACHE FILEPATH "Release version of V8 snapshot blob location")
+endif()
+if(EXISTS ${_IMPORT_PREFIX}/debug/bin/snapshot_blob.bin)
+ set(V8_SNAPSHOT_BLOB_DEBUG ${_IMPORT_PREFIX}/debug/bin/snapshot_blob.bin CACHE FILEPATH "Debug version of V8 snapshot blob location")
+endif()
+string(TOUPPER ${CMAKE_BUILD_TYPE} BUILD_TYPE)
+set(V8_SNAPSHOT_BLOB ${V8_SNAPSHOT_BLOB_${BUILD_TYPE}})
+
+if(EXISTS "${_IMPORT_PREFIX}/lib/v8${CMAKE_SHARED_LIBRARY_SUFFIX}${CMAKE_STATIC_LIBRARY_SUFFIX}")
+ set(V8_LIBRARY_RELEASE "${_IMPORT_PREFIX}/lib/v8${CMAKE_SHARED_LIBRARY_SUFFIX}${CMAKE_STATIC_LIBRARY_SUFFIX}" CACHE FILEPATH "Release version of the V8 library location")
+endif()
+if(EXISTS "${_IMPORT_PREFIX}/debug/lib/v8${CMAKE_SHARED_LIBRARY_SUFFIX}${CMAKE_STATIC_LIBRARY_SUFFIX}")
+ set(V8_LIBRARY_DEBUG "${_IMPORT_PREFIX}/debug/lib/v8${CMAKE_SHARED_LIBRARY_SUFFIX}${CMAKE_STATIC_LIBRARY_SUFFIX}" CACHE FILEPATH "Debug version of the V8 library location")
+endif()
+select_library_configurations(V8)
+
+if(EXISTS "${_IMPORT_PREFIX}/lib/v8_libbase${CMAKE_SHARED_LIBRARY_SUFFIX}${CMAKE_STATIC_LIBRARY_SUFFIX}")
+ set(V8LIBBASE_LIBRARY_RELEASE "${_IMPORT_PREFIX}/lib/v8_libbase${CMAKE_SHARED_LIBRARY_SUFFIX}${CMAKE_STATIC_LIBRARY_SUFFIX}" CACHE FILEPATH "Release version of the V8 libbase library location")
+endif()
+if(EXISTS "${_IMPORT_PREFIX}/debug/lib/v8_libbase${CMAKE_SHARED_LIBRARY_SUFFIX}${CMAKE_STATIC_LIBRARY_SUFFIX}")
+ set(V8LIBBASE_LIBRARY_DEBUG "${_IMPORT_PREFIX}/debug/lib/v8_libbase${CMAKE_SHARED_LIBRARY_SUFFIX}${CMAKE_STATIC_LIBRARY_SUFFIX}" CACHE FILEPATH "Debug version of the V8 libbase library location")
+endif()
+select_library_configurations(V8LIBBASE)
+
+if(EXISTS "${_IMPORT_PREFIX}/lib/v8_libplatform${CMAKE_SHARED_LIBRARY_SUFFIX}${CMAKE_STATIC_LIBRARY_SUFFIX}")
+ set(V8LIBPLATFORM_LIBRARY_RELEASE "${_IMPORT_PREFIX}/lib/v8_libplatform${CMAKE_SHARED_LIBRARY_SUFFIX}${CMAKE_STATIC_LIBRARY_SUFFIX}" CACHE FILEPATH "Release version of the V8 libplatform library location")
+endif()
+if(EXISTS "${_IMPORT_PREFIX}/debug/lib/v8_libplatform${CMAKE_SHARED_LIBRARY_SUFFIX}${CMAKE_STATIC_LIBRARY_SUFFIX}")
+ set(V8LIBPLATFORM_LIBRARY_DEBUG "${_IMPORT_PREFIX}/debug/lib/v8_libplatform${CMAKE_SHARED_LIBRARY_SUFFIX}${CMAKE_STATIC_LIBRARY_SUFFIX}" CACHE FILEPATH "Delete version of the V8 libplatform library location")
+endif()
+select_library_configurations(V8LIBPLATFORM)
+
+mark_as_advanced(V8_INCLUDE_DIR)
+
+if(V8_INCLUDE_DIR AND EXISTS "${V8_INCLUDE_DIR}/v8-version.h")
+ file(STRINGS "${V8_INCLUDE_DIR}/v8-version.h" V8_MAJOR_VERSION REGEX "^#define V8_MAJOR_VERSION [0-9]+.*$")
+ string(REGEX REPLACE "^#define V8_MAJOR_VERSION ([0-9]+).*$" "\\1" V8_MAJOR_VERSION "${V8_MAJOR_VERSION}")
+ file(STRINGS "${V8_INCLUDE_DIR}/v8-version.h" V8_MINOR_VERSION REGEX "^#define V8_MINOR_VERSION [0-9]+.*$")
+ string(REGEX REPLACE "^#define V8_MINOR_VERSION ([0-9]+).*$" "\\1" V8_MINOR_VERSION "${V8_MINOR_VERSION}")
+ file(STRINGS "${V8_INCLUDE_DIR}/v8-version.h" V8_BUILD_NUMBER REGEX "^#define V8_BUILD_NUMBER [0-9]+.*$")
+ string(REGEX REPLACE "^#define V8_BUILD_NUMBER ([0-9]+).*$" "\\1" V8_BUILD_NUMBER "${V8_BUILD_NUMBER}")
+ file(STRINGS "${V8_INCLUDE_DIR}/v8-version.h" V8_PATCH_LEVEL REGEX "^#define V8_PATCH_LEVEL [0-9]+.*$")
+ string(REGEX REPLACE "^#define V8_PATCH_LEVEL ([0-9]+).*$" "\\1" V8_PATCH_LEVEL "${V8_PATCH_LEVEL}")
+ set(V8_VERSION_STRING "${V8_MAJOR_VERSION}.${V8_MINOR_VERSION}.${V8_BUILD_NUMBER}.${V8_PATCH_LEVEL}")
+endif()
+
+
+if(CMAKE_SIZEOF_VOID_P EQUAL 8)
+ set(V8_COMPILE_DEFINITIONS "V8_COMPRESS_POINTERS;V8_31BIT_SMIS_ON_64BIT_ARCH")
+elseif(CMAKE_SIZEOF_VOID_P EQUAL 4)
+ set(V8_COMPILE_DEFINITIONS " ")
+endif()
+
+mark_as_advanced(V8_COMPILE_DEFINITIONS)
+
+include(FindPackageHandleStandardArgs)
+
+FIND_PACKAGE_HANDLE_STANDARD_ARGS(V8 REQUIRED_VARS V8_LIBRARY V8LIBBASE_LIBRARY V8LIBPLATFORM_LIBRARY V8_INCLUDE_DIR V8_COMPILE_DEFINITIONS
+VERSION_VAR V8_VERSION_STRING)
+set(V8_LIBRARIES ${V8_LIBRARY} ${V8LIBBASE_LIBRARY} ${V8LIBPLATFORM_LIBRARY})
+
+mark_as_advanced(V8_LIBRARIES)
+
+if(NOT TARGET V8::V8)
+ add_library(V8::V8 SHARED IMPORTED)
+ set_target_properties(V8::V8 PROPERTIES
+ INTERFACE_INCLUDE_DIRECTORIES "${V8_INCLUDE_DIR}"
+ INTERFACE_COMPILE_DEFINITIONS "${V8_COMPILE_DEFINITIONS}")
+
+ if(V8_LIBRARY_RELEASE)
+ set_property(TARGET V8::V8 APPEND PROPERTY
+ IMPORTED_CONFIGURATIONS RELEASE)
+ set_target_properties(V8::V8 PROPERTIES
+ IMPORTED_LOCATION_RELEASE "${_IMPORT_PREFIX}/bin/v8${CMAKE_SHARED_LIBRARY_SUFFIX}${CMAKE_STATIC_LIBRARY_SUFFIX}"
+ IMPORTED_IMPLIB_RELEASE "${V8_LIBRARY_RELEASE}"
+ )
+ set_target_properties(V8::V8 PROPERTIES
+ IMPORTED_LINK_INTERFACE_LIBRARIES_RELEASE
+ "${V8LIBBASE_LIBRARY_RELEASE};${V8LIBPLATFORM_LIBRARY_RELEASE}")
+ endif()
+
+ if(V8_LIBRARY_DEBUG)
+ set_property(TARGET V8::V8 APPEND PROPERTY
+ IMPORTED_CONFIGURATIONS DEBUG)
+ set_target_properties(V8::V8 PROPERTIES
+ IMPORTED_LOCATION_DEBUG "${_IMPORT_PREFIX}/debug/bin/v8${CMAKE_SHARED_LIBRARY_SUFFIX}${CMAKE_STATIC_LIBRARY_SUFFIX}"
+ IMPORTED_IMPLIB_DEBUG "${V8_LIBRARY_DEBUG}")
+ set_target_properties(V8::V8 PROPERTIES
+ IMPORTED_LINK_INTERFACE_LIBRARIES_DEBUG
+ "${V8LIBBASE_LIBRARY_DEBUG};${V8LIBPLATFORM_LIBRARY_DEBUG}")
+ endif()
+
+ if(NOT V8_LIBRARY_RELEASE AND NOT V8_LIBRARY_DEBUG)
+ set_property(TARGET V8::V8 APPEND PROPERTY
+ IMPORTED_IMPLIB "${V8_LIBRARY}")
+ set_target_properties(V8::V8 PROPERTIES
+ IMPORTED_LINK_INTERFACE_LIBRARIES
+ "${V8LIBBASE_LIBRARY};${V8LIBPLATFORM_LIBRARY}")
+ endif()
+endif()
diff --git a/ports/v8/V8Config-static.cmake b/ports/v8/V8Config-static.cmake
new file mode 100644
index 000000000..305668216
--- /dev/null
+++ b/ports/v8/V8Config-static.cmake
@@ -0,0 +1,97 @@
+include(CMakeFindDependencyMacro)
+find_dependency(ICU REQUIRED COMPONENTS in uc dt)
+find_dependency(ZLIB REQUIRED)
+if(UNIX)
+ find_package(unofficial-glib CONFIG REQUIRED)
+ set(V8_IMPORTED_LINK_INTERFACE_LIBRARIES
+ "ICU::in;ICU::uc;ICU::dt;unofficial::glib::gmodule;unofficial::glib::gobject;unofficial::glib::gthread;ZLIB::ZLIB")
+elseif(WIN32)
+ set(V8_IMPORTED_LINK_INTERFACE_LIBRARIES
+ "Winmm;DbgHelp;ZLIB::ZLIB;ICU::in;ICU::uc;ICU::dt")
+endif()
+
+get_filename_component(_IMPORT_PREFIX "${CMAKE_CURRENT_LIST_FILE}" PATH)
+get_filename_component(_IMPORT_PREFIX "${_IMPORT_PREFIX}" PATH)
+get_filename_component(_IMPORT_PREFIX "${_IMPORT_PREFIX}" PATH)
+if(_IMPORT_PREFIX STREQUAL "/")
+ set(_IMPORT_PREFIX "")
+endif()
+
+include(SelectLibraryConfigurations)
+
+find_path(V8_INCLUDE_DIR NAMES v8.h PATH_SUFFIXES include)
+
+if(EXISTS "${_IMPORT_PREFIX}/lib/${CMAKE_STATIC_LIBRARY_PREFIX}v8_monolith${CMAKE_STATIC_LIBRARY_SUFFIX}")
+ set(V8_LIBRARY_RELEASE "${_IMPORT_PREFIX}/lib/${CMAKE_STATIC_LIBRARY_PREFIX}v8_monolith${CMAKE_STATIC_LIBRARY_SUFFIX}" CACHE FILEPATH "Release version of the V8 library location")
+endif()
+if(EXISTS "${_IMPORT_PREFIX}/debug/lib/${CMAKE_STATIC_LIBRARY_PREFIX}v8_monolith${CMAKE_STATIC_LIBRARY_SUFFIX}")
+ set(V8_LIBRARY_DEBUG "${_IMPORT_PREFIX}/debug/lib/${CMAKE_STATIC_LIBRARY_PREFIX}v8_monolith${CMAKE_STATIC_LIBRARY_SUFFIX}" CACHE FILEPATH "Debug version of the V8 library location")
+endif()
+select_library_configurations(V8)
+
+mark_as_advanced(V8_INCLUDE_DIR)
+
+if(V8_INCLUDE_DIR AND EXISTS "${V8_INCLUDE_DIR}/v8-version.h")
+ file(STRINGS "${V8_INCLUDE_DIR}/v8-version.h" V8_MAJOR_VERSION REGEX "^#define V8_MAJOR_VERSION [0-9]+.*$")
+ string(REGEX REPLACE "^#define V8_MAJOR_VERSION ([0-9]+).*$" "\\1" V8_MAJOR_VERSION "${V8_MAJOR_VERSION}")
+ file(STRINGS "${V8_INCLUDE_DIR}/v8-version.h" V8_MINOR_VERSION REGEX "^#define V8_MINOR_VERSION [0-9]+.*$")
+ string(REGEX REPLACE "^#define V8_MINOR_VERSION ([0-9]+).*$" "\\1" V8_MINOR_VERSION "${V8_MINOR_VERSION}")
+ file(STRINGS "${V8_INCLUDE_DIR}/v8-version.h" V8_BUILD_NUMBER REGEX "^#define V8_BUILD_NUMBER [0-9]+.*$")
+ string(REGEX REPLACE "^#define V8_BUILD_NUMBER ([0-9]+).*$" "\\1" V8_BUILD_NUMBER "${V8_BUILD_NUMBER}")
+ file(STRINGS "${V8_INCLUDE_DIR}/v8-version.h" V8_PATCH_LEVEL REGEX "^#define V8_PATCH_LEVEL [0-9]+.*$")
+ string(REGEX REPLACE "^#define V8_PATCH_LEVEL ([0-9]+).*$" "\\1" V8_PATCH_LEVEL "${V8_PATCH_LEVEL}")
+ set(V8_VERSION_STRING "${V8_MAJOR_VERSION}.${V8_MINOR_VERSION}.${V8_BUILD_NUMBER}.${V8_PATCH_LEVEL}")
+endif()
+
+
+if(CMAKE_SIZEOF_VOID_P EQUAL 8)
+ set(V8_COMPILE_DEFINITIONS "V8_COMPRESS_POINTERS;V8_31BIT_SMIS_ON_64BIT_ARCH")
+else()
+ set(V8_COMPILE_DEFINITIONS " ")
+endif()
+
+mark_as_advanced(V8_COMPILE_DEFINITIONS)
+
+include(FindPackageHandleStandardArgs)
+
+FIND_PACKAGE_HANDLE_STANDARD_ARGS(V8 REQUIRED_VARS V8_LIBRARY V8_INCLUDE_DIR V8_COMPILE_DEFINITIONS
+VERSION_VAR V8_VERSION_STRING)
+set(V8_LIBRARIES ${V8_LIBRARY})
+
+mark_as_advanced(V8_LIBRARIES)
+
+if(NOT TARGET V8::V8)
+ add_library(V8::V8 STATIC IMPORTED)
+ set_target_properties(V8::V8 PROPERTIES
+ INTERFACE_INCLUDE_DIRECTORIES "${V8_INCLUDE_DIR}"
+ INTERFACE_COMPILE_DEFINITIONS "${V8_COMPILE_DEFINITIONS}")
+ if(MSVC)
+ set_target_properties(V8::V8 PROPERTIES
+ INTERFACE_COMPILE_OPTIONS "/MT$<$<CONFIG:Debug>:d>")
+ endif()
+
+ if(V8_LIBRARY_RELEASE)
+ set_property(TARGET V8::V8 APPEND PROPERTY
+ IMPORTED_CONFIGURATIONS RELEASE)
+ set_target_properties(V8::V8 PROPERTIES
+ IMPORTED_LOCATION_RELEASE "${V8_LIBRARY_RELEASE}"
+ IMPORTED_LINK_INTERFACE_LIBRARIES_RELEASE
+ "${V8_IMPORTED_LINK_INTERFACE_LIBRARIES}")
+ endif()
+
+ if(V8_LIBRARY_DEBUG)
+ set_property(TARGET V8::V8 APPEND PROPERTY
+ IMPORTED_CONFIGURATIONS DEBUG)
+ set_target_properties(V8::V8 PROPERTIES
+ IMPORTED_LOCATION_DEBUG "${V8_LIBRARY_DEBUG}"
+ IMPORTED_LINK_INTERFACE_LIBRARIES_DEBUG
+ "${V8_IMPORTED_LINK_INTERFACE_LIBRARIES}")
+ endif()
+
+ if(NOT V8_LIBRARY_RELEASE AND NOT V8_LIBRARY_DEBUG)
+ set_property(TARGET V8::V8 APPEND PROPERTY
+ IMPORTED_LOCATION "${V8_LIBRARY}"
+ IMPORTED_LINK_INTERFACE_LIBRARIES
+ "${V8_IMPORTED_LINK_INTERFACE_LIBRARIES}")
+ endif()
+endif()
diff --git a/ports/v8/build.patch b/ports/v8/build.patch
index 7394c6591..cb6e285a6 100644
--- a/ports/v8/build.patch
+++ b/ports/v8/build.patch
@@ -1,62 +1,66 @@
diff --git a/config/compiler/BUILD.gn b/config/compiler/BUILD.gn
-index 5a0984f54..4f301517b 100644
+index 82474eee8..4b22319e3 100644
--- a/config/compiler/BUILD.gn
+++ b/config/compiler/BUILD.gn
-@@ -1473,6 +1473,8 @@ config("default_warnings") {
+@@ -12,7 +12,6 @@ import("//build/config/clang/clang.gni")
+ import("//build/config/compiler/compiler.gni")
+ import("//build/config/coverage/coverage.gni")
+ import("//build/config/dcheck_always_on.gni")
+-import("//build/config/gclient_args.gni")
+ import("//build/config/host_byteorder.gni")
+ import("//build/config/sanitizers/sanitizers.gni")
+ import("//build/config/ui.gni")
+@@ -1501,6 +1500,7 @@ config("default_warnings") {
# Disables.
"-Wno-missing-field-initializers", # "struct foo f = {0};"
"-Wno-unused-parameter", # Unused function parameters.
+ "-Wno-invalid-offsetof", # Use of "conditionally-supported" offsetof in c++17
-+ "-Wno-range-loop-construct",
]
}
-@@ -1887,11 +1889,21 @@ config("no_incompatible_pointer_warnings") {
+@@ -1924,8 +1924,17 @@ config("no_incompatible_pointer_warnings") {
# Shared settings for both "optimize" and "optimize_max" configs.
# IMPORTANT: On Windows "/O1" and "/O2" must go before the common flags.
if (is_win) {
- common_optimize_on_cflags = [
+- "/Ob2", # Both explicit and auto inlining.
+ common_optimize_on_cflags = []
+ if(is_clang) {
+ common_optimize_on_cflags += [
- "/Ob2", # Both explicit and auto inlining.
++ "/Ob2", # Both explicit and auto inlining.
+ ]
+ } else {
-+ common_optimize_on_cflags += [
-+ "/Ob3", # Both explicit and auto inlining.
++ common_optimize_on_cflags += [
++ "/Ob3", # Both explicit and auto inlining.
+ ]
+ }
+ common_optimize_on_cflags += [
"/Oy-", # Disable omitting frame pointers, must be after /O2.
"/Zc:inline", # Remove unreferenced COMDAT (faster links).
]
-+
- if (!is_asan) {
- common_optimize_on_cflags += [
- # Put data in separate COMDATs. This allows the linker
diff --git a/config/linux/pkg-config.py b/config/linux/pkg-config.py
-index 5adf70cc3..1438c365b 100644
+index 5adf70cc3..dab159f98 100644
--- a/config/linux/pkg-config.py
+++ b/config/linux/pkg-config.py
-@@ -41,7 +41,11 @@ from optparse import OptionParser
+@@ -41,6 +41,11 @@ from optparse import OptionParser
# Additionally, you can specify the option --atleast-version. This will skip
# the normal outputting of a dictionary and instead print true or false,
# depending on the return value of pkg-config for the given package.
--
+#
+# --pkg_config_libdir=<path> allows direct override
+# of the PKG_CONFIG_LIBDIR environment library.
+#
+# --full-path-libs causes lib names to include their full path.
+
def SetConfigPath(options):
- """Set the PKG_CONFIG_LIBDIR environment variable.
-@@ -105,11 +109,29 @@ def RewritePath(path, strip_prefix, sysroot):
+@@ -105,11 +110,32 @@ def RewritePath(path, strip_prefix, sysroot):
return path
+flag_regex = re.compile("(-.)(.+)")
+
++
+def FlagReplace(matchobj):
+ if matchobj.group(1) == '-I':
+ return matchobj.group(1) + subprocess.check_output([u'cygpath',u'-w',matchobj.group(2)]).strip().decode("utf-8")
@@ -66,9 +70,11 @@ index 5adf70cc3..1438c365b 100644
+ return matchobj.group(1) + matchobj.group(2) + '.lib'
+ return matchobj.group(0)
+
++
+def ConvertGCCToMSVC(flags):
+ """Rewrites GCC flags into MSVC flags."""
-+ if 'win32' not in sys.platform:
++ # need a better way to determine mingw vs msvc build
++ if 'win32' not in sys.platform or "GCC" in sys.version:
+ return flags
+ return [ flag_regex.sub(FlagReplace,flag) for flag in flags]
+
@@ -82,23 +88,17 @@ index 5adf70cc3..1438c365b 100644
print("[[],[],[],[],[]]")
return 0
-@@ -122,12 +144,15 @@ def main():
- parser.add_option('-a', action='store', dest='arch', type='string')
- parser.add_option('--system_libdir', action='store', dest='system_libdir',
- type='string', default='lib')
-+ parser.add_option('--pkg_config_libdir', action='store', dest='pkg_config_libdir',
-+ type='string')
- parser.add_option('--atleast-version', action='store',
- dest='atleast_version', type='string')
- parser.add_option('--libdir', action='store_true', dest='libdir')
+@@ -128,6 +154,9 @@ def main():
parser.add_option('--dridriverdir', action='store_true', dest='dridriverdir')
parser.add_option('--version-as-components', action='store_true',
dest='version_as_components')
++ parser.add_option('--pkg_config_libdir', action='store', dest='pkg_config_libdir',
++ type='string')
+ parser.add_option('--full-path-libs', action='store_true', dest='full_path_libs')
(options, args) = parser.parse_args()
# Make a list of regular expressions to strip out.
-@@ -144,6 +169,10 @@ def main():
+@@ -144,6 +173,10 @@ def main():
else:
prefix = ''
@@ -109,7 +109,7 @@ index 5adf70cc3..1438c365b 100644
if options.atleast_version:
# When asking for the return value, just run pkg-config and print the return
# value, no need to do other work.
-@@ -203,7 +232,7 @@ def main():
+@@ -203,7 +236,7 @@ def main():
# For now just split on spaces to get the args out. This will break if
# pkgconfig returns quoted things with spaces in them, but that doesn't seem
# to happen in practice.
@@ -118,7 +118,7 @@ index 5adf70cc3..1438c365b 100644
sysroot = options.sysroot
-@@ -220,7 +249,10 @@ def main():
+@@ -220,7 +253,10 @@ def main():
continue;
if flag[:2] == '-l':
@@ -130,7 +130,7 @@ index 5adf70cc3..1438c365b 100644
elif flag[:2] == '-L':
lib_dirs.append(RewritePath(flag[2:], prefix, sysroot))
elif flag[:2] == '-I':
-@@ -237,6 +269,14 @@ def main():
+@@ -237,6 +273,14 @@ def main():
else:
cflags.append(flag)
@@ -177,3 +177,45 @@ index 428e44ac0..a0d2175ee 100644
template("pkg_config") {
assert(defined(invoker.packages),
"Variable |packages| must be defined to be a list in pkg_config.")
+diff --git a/toolchain/win/tool_wrapper.py b/toolchain/win/tool_wrapper.py
+index 18986986c..cf409216c 100644
+--- a/toolchain/win/tool_wrapper.py
++++ b/toolchain/win/tool_wrapper.py
+@@ -141,9 +141,9 @@ class WinTool(object):
+ # Read output one line at a time as it shows up to avoid OOM failures when
+ # GBs of output is produced.
+ for line in link.stdout:
+- if (not line.startswith(' Creating library ') and
+- not line.startswith('Generating code') and
+- not line.startswith('Finished generating code')):
++ if (not line.startswith(b' Creating library ') and
++ not line.startswith(b'Generating code') and
++ not line.startswith(b'Finished generating code')):
+ print(line)
+ return link.wait()
+
+@@ -159,7 +159,7 @@ class WinTool(object):
+ stdout=subprocess.PIPE, stderr=subprocess.STDOUT)
+ out, _ = popen.communicate()
+ for line in out.splitlines():
+- if not line.startswith(' Assembling: '):
++ if not line.startswith(b' Assembling: '):
+ print(line)
+ return popen.returncode
+
+diff --git a/util/lastchange.py b/util/lastchange.py
+index 874870ad5..a4fc0be8d 100644
+--- a/util/lastchange.py
++++ b/util/lastchange.py
+@@ -191,7 +191,10 @@ def GetGitTopDirectory(source_dir):
+ Returns:
+ The output of "git rev-parse --show-toplevel" as a string
+ """
+- return _RunGitCommand(source_dir, ['rev-parse', '--show-toplevel'])
++ directory = _RunGitCommand(source_dir, ['rev-parse', '--show-toplevel'])
++ if "GCC" in sys.version and sys.platform=='win32':
++ return subprocess.check_output(["cygpath", "-w", directory]).strip(b"\n").decode()
++ return directory
+
+
+ def WriteIfChanged(file_name, contents):
diff --git a/ports/v8/portfile.cmake b/ports/v8/portfile.cmake
index e2bb45da9..8a215328a 100644
--- a/ports/v8/portfile.cmake
+++ b/ports/v8/portfile.cmake
@@ -1,5 +1,5 @@
-set(pkgver "8.3.110.13")
+set(pkgver "8.6.395.17")
set(ENV{DEPOT_TOOLS_WIN_TOOLCHAIN} 0)
@@ -71,15 +71,15 @@ endfunction()
vcpkg_from_git(
OUT_SOURCE_PATH SOURCE_PATH
URL https://chromium.googlesource.com/v8/v8.git
- REF 90904eb48b16b32f7edbf1f8a92ece561d05e738
- PATCHES ${CURRENT_PORT_DIR}/v8.patch ${CURRENT_PORT_DIR}/3f8dc4b.patch
+ REF 7565e93eb72cea4268028fc20186d415c22b1cff
+ PATCHES ${CURRENT_PORT_DIR}/v8.patch
)
message(STATUS "Fetching submodules")
v8_fetch(
DESTINATION build
URL https://chromium.googlesource.com/chromium/src/build.git
- REF 26e9d485d01d6e0eb9dadd21df767a63494c8fea
+ REF b6be94885f567b15bcb0961298b32cdb737ae2d6
SOURCE ${SOURCE_PATH}
PATCHES ${CURRENT_PORT_DIR}/build.patch)
v8_fetch(
@@ -156,27 +156,34 @@ vcpkg_install_gn(
TARGETS ${targets}
)
-set(CFLAGS "-DV8_COMPRESS_POINTERS")
if(VCPKG_TARGET_ARCHITECTURE STREQUAL "x64")
- set(CFLAGS "${CFLAGS} -DV8_31BIT_SMIS_ON_64BIT_ARCH")
+ set(CFLAGS "-DV8_COMPRESS_POINTERS -DV8_31BIT_SMIS_ON_64BIT_ARCH")
endif()
+
file(INSTALL ${SOURCE_PATH}/include DESTINATION ${CURRENT_PACKAGES_DIR}/include FILES_MATCHING PATTERN "*.h")
+
if(VCPKG_LIBRARY_LINKAGE STREQUAL dynamic)
set(PREFIX ${CURRENT_PACKAGES_DIR})
configure_file(${CURRENT_PORT_DIR}/v8.pc.in ${CURRENT_PACKAGES_DIR}/lib/pkgconfig/v8.pc @ONLY)
configure_file(${CURRENT_PORT_DIR}/v8_libbase.pc.in ${CURRENT_PACKAGES_DIR}/lib/pkgconfig/v8_libbase.pc @ONLY)
configure_file(${CURRENT_PORT_DIR}/v8_libplatform.pc.in ${CURRENT_PACKAGES_DIR}/lib/pkgconfig/v8_libplatform.pc @ONLY)
+ file(INSTALL ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-rel/snapshot_blob.bin DESTINATION ${CURRENT_PACKAGES_DIR}/bin)
+
set(PREFIX ${CURRENT_PACKAGES_DIR}/debug)
configure_file(${CURRENT_PORT_DIR}/v8.pc.in ${CURRENT_PACKAGES_DIR}/debug/lib/pkgconfig/v8.pc @ONLY)
configure_file(${CURRENT_PORT_DIR}/v8_libbase.pc.in ${CURRENT_PACKAGES_DIR}/debug/lib/pkgconfig/v8_libbase.pc @ONLY)
configure_file(${CURRENT_PORT_DIR}/v8_libplatform.pc.in ${CURRENT_PACKAGES_DIR}/debug/lib/pkgconfig/v8_libplatform.pc @ONLY)
+ configure_file(${CURRENT_PORT_DIR}/V8Config-shared.cmake ${CURRENT_PACKAGES_DIR}/share/v8/V8Config.cmake @ONLY)
+ file(INSTALL ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-dbg/snapshot_blob.bin DESTINATION ${CURRENT_PACKAGES_DIR}/debug/bin)
else()
set(PREFIX ${CURRENT_PACKAGES_DIR})
configure_file(${CURRENT_PORT_DIR}/v8_monolith.pc.in ${CURRENT_PACKAGES_DIR}/lib/pkgconfig/v8_monolith.pc @ONLY)
set(PREFIX ${CURRENT_PACKAGES_DIR}/debug)
configure_file(${CURRENT_PORT_DIR}/v8_monolith.pc.in ${CURRENT_PACKAGES_DIR}/debug/lib/pkgconfig/v8_monolith.pc @ONLY)
+ configure_file(${CURRENT_PORT_DIR}/V8Config-static.cmake ${CURRENT_PACKAGES_DIR}/share/v8/V8Config.cmake @ONLY)
endif()
+
vcpkg_copy_pdbs()
# v8 libraries are listed as SYSTEM_LIBRARIES because the pc files reference each other.
diff --git a/ports/v8/v8.patch b/ports/v8/v8.patch
index 8a58a50b9..ea939580f 100644
--- a/ports/v8/v8.patch
+++ b/ports/v8/v8.patch
@@ -1,3 +1,59 @@
+diff --git a/gni/v8.gni b/gni/v8.gni
+index 413b0d3810..8c17353120 100644
+--- a/gni/v8.gni
++++ b/gni/v8.gni
+@@ -2,7 +2,6 @@
+ # Use of this source code is governed by a BSD-style license that can be
+ # found in the LICENSE file.
+
+-import("//build/config/gclient_args.gni")
+ import("//build/config/sanitizers/sanitizers.gni")
+ import("//build/config/v8_target_cpu.gni")
+ import("split_static_library.gni")
+@@ -67,7 +66,7 @@ declare_args() {
+ # Add fuzzilli fuzzer support.
+ v8_fuzzilli = false
+
+- v8_enable_google_benchmark = checkout_google_benchmark
++ v8_enable_google_benchmark = false
+ }
+
+ if (v8_use_external_startup_data == "") {
+diff --git a/include/v8-cppgc.h b/include/v8-cppgc.h
+index e202293bcf..317bac7f17 100644
+--- a/include/v8-cppgc.h
++++ b/include/v8-cppgc.h
+@@ -90,7 +90,7 @@ void JSMemberBase::Reset() {
+ * method.
+ */
+ template <typename T>
+-class V8_EXPORT JSMember : public internal::JSMemberBase {
++class JSMember : public internal::JSMemberBase {
+ static_assert(std::is_base_of<v8::Value, T>::value,
+ "JSMember only supports references to v8::Value");
+
+diff --git a/src/common/globals.h b/src/common/globals.h
+index dbc6b9af9b..7634fc1a08 100644
+--- a/src/common/globals.h
++++ b/src/common/globals.h
+@@ -1356,7 +1356,7 @@ class BinaryOperationFeedback {
+ // This is distinct from BinaryOperationFeedback on purpose, because the
+ // feedback that matters differs greatly as well as the way it is consumed.
+ class CompareOperationFeedback {
+- enum {
++ enum : uint32_t {
+ kSignedSmallFlag = 1 << 0,
+ kOtherNumberFlag = 1 << 1,
+ kBooleanFlag = 1 << 2,
+@@ -1370,7 +1370,7 @@ class CompareOperationFeedback {
+ };
+
+ public:
+- enum Type {
++ enum Type : uint32_t {
+ kNone = 0,
+
+ kBoolean = kBooleanFlag,
diff --git a/src/compiler/node-cache.h b/src/compiler/node-cache.h
index 935e5778e3..d5dae22512 100644
--- a/src/compiler/node-cache.h
@@ -11,11 +67,37 @@ index 935e5778e3..d5dae22512 100644
public:
explicit NodeCache(Zone* zone) : map_(zone) {}
~NodeCache() = default;
+diff --git a/src/heap/paged-spaces-inl.h b/src/heap/paged-spaces-inl.h
+index e135e30efc..0c055247bc 100644
+--- a/src/heap/paged-spaces-inl.h
++++ b/src/heap/paged-spaces-inl.h
+@@ -19,7 +19,7 @@ namespace internal {
+ // -----------------------------------------------------------------------------
+ // PagedSpaceObjectIterator
+
+-HeapObject PagedSpaceObjectIterator::Next() {
++inline HeapObject PagedSpaceObjectIterator::Next() {
+ do {
+ HeapObject next_obj = FromCurrentPage();
+ if (!next_obj.is_null()) return next_obj;
+diff --git a/src/heap/paged-spaces.h b/src/heap/paged-spaces.h
+index 4af1b3013c..2489ad6a35 100644
+--- a/src/heap/paged-spaces.h
++++ b/src/heap/paged-spaces.h
+@@ -45,7 +45,7 @@ class V8_EXPORT_PRIVATE PagedSpaceObjectIterator : public ObjectIterator {
+ // Advance to the next object, skipping free spaces and other fillers and
+ // skipping the special garbage section of which there is one per space.
+ // Returns nullptr when the iteration has ended.
+- inline HeapObject Next() override;
++ HeapObject Next() override;
+
+ private:
+ // Fast (inlined) path of next().
diff --git a/src/objects/feedback-vector.cc b/src/objects/feedback-vector.cc
-index 929b312f22..7beff3395d 100644
+index cf1712b0f0..73eb5c0ec7 100644
--- a/src/objects/feedback-vector.cc
+++ b/src/objects/feedback-vector.cc
-@@ -114,9 +114,9 @@ Handle<FeedbackMetadata> FeedbackMetadata::New(LocalIsolate* isolate,
+@@ -115,9 +115,9 @@ Handle<FeedbackMetadata> FeedbackMetadata::New(LocalIsolate* isolate,
return metadata;
}
@@ -24,66 +106,128 @@ index 929b312f22..7beff3395d 100644
Isolate* isolate, const FeedbackVectorSpec* spec);
-template Handle<FeedbackMetadata> FeedbackMetadata::New(
+template V8_EXPORT Handle<FeedbackMetadata> FeedbackMetadata::New(
- OffThreadIsolate* isolate, const FeedbackVectorSpec* spec);
+ LocalIsolate* isolate, const FeedbackVectorSpec* spec);
bool FeedbackMetadata::SpecDiffersFrom(
-diff --git a/src/objects/ordered-hash-table.h b/src/objects/ordered-hash-table.h
-index b587960432..e80b5757e4 100644
---- a/src/objects/ordered-hash-table.h
-+++ b/src/objects/ordered-hash-table.h
-@@ -7,7 +7,11 @@
-
- #include "src/base/export-template.h"
- #include "src/common/globals.h"
-+#if defined(_M_IX86) && defined(_MSC_VER)
-+#include "src/objects/fixed-array-inl.h"
-+#else
- #include "src/objects/fixed-array.h"
-+#endif
- #include "src/objects/js-objects.h"
- #include "src/objects/smi.h"
- #include "src/roots/roots.h"
-diff --git a/src/snapshot/serializer-common.cc b/src/snapshot/serializer-common.cc
-index 9218d4eaa9..7b226de2f9 100644
---- a/src/snapshot/serializer-common.cc
-+++ b/src/snapshot/serializer-common.cc
-@@ -8,7 +8,7 @@
- #include "src/objects/foreign-inl.h"
- #include "src/objects/objects-inl.h"
- #include "src/objects/slots.h"
+diff --git a/src/objects/fixed-array-inl.h b/src/objects/fixed-array-inl.h
+index f6c52b8ed0..94f81d3e7d 100644
+--- a/src/objects/fixed-array-inl.h
++++ b/src/objects/fixed-array-inl.h
+@@ -88,7 +88,7 @@ bool FixedArray::is_the_hole(Isolate* isolate, int index) {
+ return get(isolate, index).IsTheHole(isolate);
+ }
+
+-void FixedArray::set(int index, Smi value) {
++inline V8_EXPORT_PRIVATE void FixedArray::set(int index, Smi value) {
+ DCHECK_NE(map(), GetReadOnlyRoots().fixed_cow_array_map());
+ DCHECK_LT(static_cast<unsigned>(index), static_cast<unsigned>(length()));
+ DCHECK(Object(value).IsSmi());
+diff --git a/src/objects/fixed-array.h b/src/objects/fixed-array.h
+index fea05b4001..90659c3867 100644
+--- a/src/objects/fixed-array.h
++++ b/src/objects/fixed-array.h
+@@ -122,7 +122,7 @@ class FixedArray
+ inline bool is_the_hole(Isolate* isolate, int index);
+
+ // Setter that doesn't need write barrier.
+- inline void set(int index, Smi value);
++ inline V8_EXPORT_PRIVATE void set(int index, Smi value);
+ // Setter with explicit barrier mode.
+ inline void set(int index, Object value, WriteBarrierMode mode);
+
+diff --git a/src/objects/string.h b/src/objects/string.h
+index 0b7bd55aee..c7fa7f49d9 100644
+--- a/src/objects/string.h
++++ b/src/objects/string.h
+@@ -293,7 +293,7 @@ class String : public TorqueGeneratedString<String, Name> {
+
+ V8_EXPORT_PRIVATE bool HasOneBytePrefix(Vector<const char> str);
+ V8_EXPORT_PRIVATE bool IsOneByteEqualTo(Vector<const uint8_t> str);
+- V8_EXPORT_PRIVATE bool IsOneByteEqualTo(Vector<const char> str) {
++ inline bool IsOneByteEqualTo(Vector<const char> str) {
+ return IsOneByteEqualTo(Vector<const uint8_t>::cast(str));
+ }
+ bool IsTwoByteEqualTo(Vector<const uc16> str);
+diff --git a/src/snapshot/snapshot-utils.cc b/src/snapshot/snapshot-utils.cc
+index 319b828446..64c974fcd8 100644
+--- a/src/snapshot/snapshot-utils.cc
++++ b/src/snapshot/snapshot-utils.cc
+@@ -5,7 +5,7 @@
+ #include "src/snapshot/snapshot-utils.h"
+
+ #include "src/sanitizer/msan.h"
-#include "third_party/zlib/zlib.h"
+#include "zlib.h"
namespace v8 {
namespace internal {
+diff --git a/src/wasm/function-body-decoder-impl.h b/src/wasm/function-body-decoder-impl.h
+index cb54e46d64..e12336950a 100644
+--- a/src/wasm/function-body-decoder-impl.h
++++ b/src/wasm/function-body-decoder-impl.h
+@@ -1748,7 +1748,7 @@ class WasmDecoder : public Decoder {
+ }
+
+ // TODO(clemensb): This is only used by the interpreter; move there.
+- V8_EXPORT_PRIVATE std::pair<uint32_t, uint32_t> StackEffect(const byte* pc) {
++ std::pair<uint32_t, uint32_t> StackEffect(const byte* pc) {
+ WasmOpcode opcode = static_cast<WasmOpcode>(*pc);
+ // Handle "simple" opcodes with a fixed signature first.
+ const FunctionSig* sig = WasmOpcodes::Signature(opcode);
+diff --git a/src/wasm/wasm-module-builder.h b/src/wasm/wasm-module-builder.h
+index 309d4bbb9f..1390d422a1 100644
+--- a/src/wasm/wasm-module-builder.h
++++ b/src/wasm/wasm-module-builder.h
+@@ -361,6 +361,7 @@ class V8_EXPORT_PRIVATE WasmModuleBuilder : public ZoneObject {
+ // Indirect functions must be allocated before adding extra tables.
+ bool allocating_indirect_functions_allowed_ = true;
+ #endif
++ DISALLOW_COPY_AND_ASSIGN(WasmModuleBuilder);
+ };
+
+ inline FunctionSig* WasmFunctionBuilder::signature() {
diff --git a/test/cctest/BUILD.gn b/test/cctest/BUILD.gn
-index 89fe36f65b..588950228b 100644
+index 35a22344fb..01a77268cc 100644
--- a/test/cctest/BUILD.gn
+++ b/test/cctest/BUILD.gn
-@@ -421,6 +421,9 @@ v8_source_set("cctest_sources") {
+@@ -444,6 +444,10 @@ v8_source_set("cctest_sources") {
# C4309: 'static_cast': truncation of constant value
cflags += [ "/wd4309" ]
-+ # Buffer overrun warning... intended?
-+ cflags += [ "/wd4789" ]
++ if(!is_clang) {
++ cflags += [ "/wd4789" ]
++ }
+
# MSVS wants this for gay-{precision,shortest}.cc.
cflags += [ "/bigobj" ]
+diff --git a/tools/debug_helper/BUILD.gn b/tools/debug_helper/BUILD.gn
+index 522a0e2270..bbe5809baa 100644
+--- a/tools/debug_helper/BUILD.gn
++++ b/tools/debug_helper/BUILD.gn
+@@ -92,10 +92,12 @@ v8_component("v8_debug_helper") {
+ "../..:run_torque",
+ "../..:v8_headers",
+ "../..:v8_libbase",
++ "../..:v8",
+ ]
+
+ configs = [ ":internal_config" ]
+ if (v8_enable_i18n_support) {
++ public_deps = [ "//third_party/icu" ]
+ configs += [ "//third_party/icu:icu_config" ]
+ }
+
diff --git a/tools/v8windbg/BUILD.gn b/tools/v8windbg/BUILD.gn
-index 10d06a127f..a269b81136 100644
+index 10d06a127f..d0deb7adca 100644
--- a/tools/v8windbg/BUILD.gn
+++ b/tools/v8windbg/BUILD.gn
-@@ -8,6 +8,12 @@ config("v8windbg_config") {
+@@ -6,7 +6,7 @@ import("../../gni/v8.gni")
+
+ config("v8windbg_config") {
# Required for successful compilation of SDK header file DbgModel.h.
- cflags_cc = [ "/Zc:twoPhase-" ]
+- cflags_cc = [ "/Zc:twoPhase-" ]
++ cflags_cc = [ "/Zc:twoPhase-", "/std:c++latest" ]
-+ if(is_win && !is_clang){
-+ # Avoid "The contents of <optional> are available only with C++17 or later."
-+ # warning from MSVC
-+ cflags_cc += [ "/std:c++latest" ]
-+ }
-+
include_dirs = [ "../.." ]
}
-