From 9fdef3070f899e8bc451cb9ecaeb8a9b193431d8 Mon Sep 17 00:00:00 2001 From: Automatic Build System Date: Fri, 5 Jan 2024 21:14:32 +0100 Subject: [PATCH] automatic version update by autodist [release 110.0.5481.177-1mamba;Thu Mar 02 2023] --- ...the-Stack-object-from-ThreadLocalTop.patch | 205 ++++++++++++++++++ chromium.spec | 25 ++- 2 files changed, 221 insertions(+), 9 deletions(-) create mode 100644 chromium-110.0.5481.177-v8-move-the-Stack-object-from-ThreadLocalTop.patch diff --git a/chromium-110.0.5481.177-v8-move-the-Stack-object-from-ThreadLocalTop.patch b/chromium-110.0.5481.177-v8-move-the-Stack-object-from-ThreadLocalTop.patch new file mode 100644 index 0000000..a060448 --- /dev/null +++ b/chromium-110.0.5481.177-v8-move-the-Stack-object-from-ThreadLocalTop.patch @@ -0,0 +1,205 @@ +From 7b6fbcd0a6700db498ad55db046ecda92c8ee8c1 Mon Sep 17 00:00:00 2001 +From: Nikolaos Papaspyrou +Date: Sun, 29 Jan 2023 17:18:08 +0100 +Subject: [PATCH] Merge: [heap] Move the Stack object from ThreadLocalTop to + Isolate + +This is just for nodejs, do not backmerge to 11.0. +(cherry picked from commit 1e4b71d99fea5ea6bb4bf6420585a7819872bb0f) + +> Change-Id: I026a35af3bc6999a09b21f277756d4454c086343 +> Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/4152476 +> Reviewed-by: Michael Lippautz +> Reviewed-by: Omer Katz +> Commit-Queue: Nikolaos Papaspyrou +> Cr-Commit-Position: refs/heads/main@{#85445} + +Stack information is thread-specific and, until now, it was stored in a +field in ThreadLocalTop. This CL moves stack information to the isolate +and makes sure to update the stack start whenever a main thread enters +the isolate. At the same time, the Stack object is refactored and +simplified. + +As a side effect, after removing the Stack object, ThreadLocalTop +satisfies the std::standard_layout trait; this fixes some issues +observed with different C++ compilers. + +Bug: v8:13630 +Bug: v8:13257 +Change-Id: I4be1f04fe90699e1a6e456dad3e0dd623851acce +--- + src/execution/isolate.cc | 36 +++++++++++++++---------------- + src/execution/isolate.h | 6 ++++++ + src/execution/thread-local-top.cc | 2 -- + src/execution/thread-local-top.h | 6 +----- + src/heap/heap.cc | 4 +--- + 5 files changed, 25 insertions(+), 29 deletions(-) + +diff --git a/src/execution/isolate.cc b/src/execution/isolate.cc +index 4edf364e0a..be4fd400d2 100644 +--- a/src/execution/isolate.cc ++++ b/src/execution/isolate.cc +@@ -3074,22 +3074,23 @@ void Isolate::AddSharedWasmMemory(Handle memory_object) { + void Isolate::RecordStackSwitchForScanning() { + Object current = root(RootIndex::kActiveContinuation); + DCHECK(!current.IsUndefined()); +- thread_local_top()->stack_.ClearStackSegments(); +- wasm::StackMemory* stack = Managed::cast( +- WasmContinuationObject::cast(current).stack()) +- .get() +- .get(); ++ stack().ClearStackSegments(); ++ wasm::StackMemory* wasm_stack = ++ Managed::cast( ++ WasmContinuationObject::cast(current).stack()) ++ .get() ++ .get(); + current = WasmContinuationObject::cast(current).parent(); +- thread_local_top()->stack_.SetStackStart( +- reinterpret_cast(stack->base())); ++ heap()->SetStackStart(reinterpret_cast(wasm_stack->base())); + // We don't need to add all inactive stacks. Only the ones in the active chain + // may contain cpp heap pointers. + while (!current.IsUndefined()) { + auto cont = WasmContinuationObject::cast(current); +- auto* stack = Managed::cast(cont.stack()).get().get(); +- thread_local_top()->stack_.AddStackSegment( +- reinterpret_cast(stack->base()), +- reinterpret_cast(stack->jmpbuf()->sp)); ++ auto* wasm_stack = ++ Managed::cast(cont.stack()).get().get(); ++ stack().AddStackSegment( ++ reinterpret_cast(wasm_stack->base()), ++ reinterpret_cast(wasm_stack->jmpbuf()->sp)); + current = cont.parent(); + } + } +@@ -3377,20 +3378,13 @@ void Isolate::Delete(Isolate* isolate) { + Isolate* saved_isolate = isolate->TryGetCurrent(); + SetIsolateThreadLocals(isolate, nullptr); + isolate->set_thread_id(ThreadId::Current()); +- isolate->thread_local_top()->stack_ = +- saved_isolate ? std::move(saved_isolate->thread_local_top()->stack_) +- : ::heap::base::Stack(base::Stack::GetStackStart()); ++ isolate->heap()->SetStackStart(base::Stack::GetStackStart()); + + bool owns_shared_isolate = isolate->owns_shared_isolate_; + Isolate* maybe_shared_isolate = isolate->shared_isolate_; + + isolate->Deinit(); + +- // Restore the saved isolate's stack. +- if (saved_isolate) +- saved_isolate->thread_local_top()->stack_ = +- std::move(isolate->thread_local_top()->stack_); +- + #ifdef DEBUG + non_disposed_isolates_--; + #endif // DEBUG +@@ -4647,6 +4641,10 @@ bool Isolate::Init(SnapshotData* startup_snapshot_data, + void Isolate::Enter() { + Isolate* current_isolate = nullptr; + PerIsolateThreadData* current_data = CurrentPerIsolateThreadData(); ++ ++ // Set the stack start for the main thread that enters the isolate. ++ heap()->SetStackStart(base::Stack::GetStackStart()); ++ + if (current_data != nullptr) { + current_isolate = current_data->isolate_; + DCHECK_NOT_NULL(current_isolate); +diff --git a/src/execution/isolate.h b/src/execution/isolate.h +index a32f999fe5..1cb6e10661 100644 +--- a/src/execution/isolate.h ++++ b/src/execution/isolate.h +@@ -32,6 +32,7 @@ + #include "src/execution/stack-guard.h" + #include "src/handles/handles.h" + #include "src/handles/traced-handles.h" ++#include "src/heap/base/stack.h" + #include "src/heap/factory.h" + #include "src/heap/heap.h" + #include "src/heap/read-only-heap.h" +@@ -2022,6 +2023,8 @@ class V8_EXPORT_PRIVATE Isolate final : private HiddenFactory { + SimulatorData* simulator_data() { return simulator_data_; } + #endif + ++ ::heap::base::Stack& stack() { return stack_; } ++ + #ifdef V8_ENABLE_WEBASSEMBLY + wasm::StackMemory*& wasm_stacks() { return wasm_stacks_; } + // Update the thread local's Stack object so that it is aware of the new stack +@@ -2520,6 +2523,9 @@ class V8_EXPORT_PRIVATE Isolate final : private HiddenFactory { + // The mutex only guards adding pages, the retrieval is signal safe. + base::Mutex code_pages_mutex_; + ++ // Stack information for the main thread. ++ ::heap::base::Stack stack_; ++ + #ifdef V8_ENABLE_WEBASSEMBLY + wasm::StackMemory* wasm_stacks_; + #endif +diff --git a/src/execution/thread-local-top.cc b/src/execution/thread-local-top.cc +index 0d7071ddda..05cc20b8e4 100644 +--- a/src/execution/thread-local-top.cc ++++ b/src/execution/thread-local-top.cc +@@ -37,14 +37,12 @@ void ThreadLocalTop::Clear() { + current_embedder_state_ = nullptr; + failed_access_check_callback_ = nullptr; + thread_in_wasm_flag_address_ = kNullAddress; +- stack_ = ::heap::base::Stack(); + } + + void ThreadLocalTop::Initialize(Isolate* isolate) { + Clear(); + isolate_ = isolate; + thread_id_ = ThreadId::Current(); +- stack_.SetStackStart(base::Stack::GetStackStart()); + #if V8_ENABLE_WEBASSEMBLY + thread_in_wasm_flag_address_ = reinterpret_cast
( + trap_handler::GetThreadInWasmThreadLocalAddress()); +diff --git a/src/execution/thread-local-top.h b/src/execution/thread-local-top.h +index 43fec0a7df..989c817f31 100644 +--- a/src/execution/thread-local-top.h ++++ b/src/execution/thread-local-top.h +@@ -10,7 +10,6 @@ + #include "include/v8-unwinder.h" + #include "src/common/globals.h" + #include "src/execution/thread-id.h" +-#include "src/heap/base/stack.h" + #include "src/objects/contexts.h" + #include "src/utils/utils.h" + +@@ -30,7 +29,7 @@ class ThreadLocalTop { + // TODO(all): This is not particularly beautiful. We should probably + // refactor this to really consist of just Addresses and 32-bit + // integer fields. +- static constexpr uint32_t kSizeInBytes = 30 * kSystemPointerSize; ++ static constexpr uint32_t kSizeInBytes = 25 * kSystemPointerSize; + + // Does early low-level initialization that does not depend on the + // isolate being present. +@@ -147,9 +146,6 @@ class ThreadLocalTop { + + // Address of the thread-local "thread in wasm" flag. + Address thread_in_wasm_flag_address_; +- +- // Stack information. +- ::heap::base::Stack stack_; + }; + + } // namespace internal +diff --git a/src/heap/heap.cc b/src/heap/heap.cc +index 51a90ddcab..b5722ab6ec 100644 +--- a/src/heap/heap.cc ++++ b/src/heap/heap.cc +@@ -5851,9 +5851,7 @@ void Heap::SetStackStart(void* stack_start) { + stack().SetStackStart(stack_start); + } + +-::heap::base::Stack& Heap::stack() { +- return isolate_->thread_local_top()->stack_; +-} ++::heap::base::Stack& Heap::stack() { return isolate_->stack(); } + + void Heap::RegisterExternallyReferencedObject(Address* location) { + Object object = TracedHandles::Mark(location, TracedHandles::MarkMode::kAll); diff --git a/chromium.spec b/chromium.spec index 715c16e..da2a82e 100644 --- a/chromium.spec +++ b/chromium.spec @@ -2,7 +2,7 @@ %define gcc_patchset 1 Name: chromium Epoch: 3 -Version: 109.0.5414.119 +Version: 110.0.5481.177 Release: 1mamba Summary: An open-source browser project that aims to build a safer, faster, and more stable way to experience the web Group: Graphical Desktop/Applications/Internet @@ -55,6 +55,7 @@ Patch35: chromium-104.0.5112.79-remove-no-opaque-pointers-flag.patch Patch36: chromium-104.0.5112.79-tflite-system-zlib.patch Patch37: chromium-105.0.5195.102-angle-wayland-include-protocol.patch Patch38: chromium-109.0.5414.119-REVERT-roll-src-third_party-ffmpeg-m106.patch +Patch39: chromium-110.0.5481.177-v8-move-the-Stack-object-from-ThreadLocalTop.patch License: BSD ## AUTOBUILDREQ-BEGIN BuildRequires: glibc-devel @@ -70,7 +71,6 @@ BuildRequires: libat-spi2-core-devel BuildRequires: libatomic-devel BuildRequires: libavcodec-ffmpeg-devel BuildRequires: libavformat-ffmpeg-devel -BuildRequires: libavif-devel BuildRequires: libavutil-ffmpeg-devel BuildRequires: libbrotli-devel BuildRequires: libcairo-devel @@ -79,6 +79,7 @@ BuildRequires: libdav1d-devel BuildRequires: libdbus-devel BuildRequires: libdrm-devel BuildRequires: libexpat-devel +BuildRequires: libffi-devel BuildRequires: libflac-devel BuildRequires: libfontconfig-devel BuildRequires: libfreetype-devel @@ -99,7 +100,6 @@ BuildRequires: libpulseaudio-devel BuildRequires: libre2-devel BuildRequires: libsnappy-devel BuildRequires: libstdc++6-devel -BuildRequires: libwayland-devel BuildRequires: libwebp-devel BuildRequires: libwoff2-devel BuildRequires: libxcb-devel @@ -176,13 +176,16 @@ sed -i 's/OFFICIAL_BUILD/GOOGLE_CHROME_BUILD/' \ #%patch18 -Rp1 -b .use-ffile-compilation-dir #%patch36 -p1 -b .tflite-system-zlib %patch33 -Rp1 -b .roll-src-third_party-ffmpeg -%patch12 -p1 -b .sql-make-VirtualCursor-standard-layout-type +#%patch12 -p1 -b .sql-make-VirtualCursor-standard-layout-type %patch37 -p0 -b .angle-wayland-include-protocol %patch38 -Rp1 -b .REVERT-roll-src-third_party-ffmpeg-m106 +%patch39 -p1 -d v8 -b .v8-move-the-Stack-object-from-ThreadLocalTop # Fixes for building with libstdc++ instead of libc++ -#patch -Np1 -i patches/chromium-102-fenced_frame_utils-include.patch -#patch -Np1 -i patches/chromium-102-regex_pattern-array.patch +patch -Np1 -i patches/chromium-103-VirtualCursor-std-layout.patch +patch -Np1 -i patches/chromium-110-NativeThemeBase-fabs.patch +patch -Np1 -i patches/chromium-110-CredentialUIEntry-const.patch +patch -Np1 -i patches/chromium-110-DarkModeLABColorSpace-pow.patch # Force script incompatible with Python 3 to use /usr/bin/python2 sed -i '1s|python$|&2|' third_party/dom_distiller_js/protoc_plugins/*.py @@ -218,7 +221,7 @@ declare -rgA _system_libs=( [icu]=icu [jsoncpp]=jsoncpp [libaom]=aom - [libavif]=libavif + #[libavif]=libavif [libdrm]= [libjpeg]=libjpeg [libpng]=libpng @@ -274,7 +277,7 @@ sed -i "s|aarch64-linux-gnu|aarch64-openmamba-linux-gnu|" \ %endif %build -#:<< _EOF +#:<< ___EOF export CC=clang export CXX=clang++ export AR=llvm-ar @@ -315,7 +318,8 @@ chromium_conf=( 'use_sysroot=false' 'use_system_libwayland=true' 'use_system_wayland_scanner=true' - 'enable_hangout_services_extension=true' + 'use_system_libffi=true' + 'enable_hangout_services_extension=true' 'enable_widevine=true' 'enable_nacl=false' 'google_api_key="AIzaSyBT3wXwxmFuUQcyeMyp0MbHHhhFwNfWKTc"' @@ -456,6 +460,9 @@ ln -s %{_libdir}/chromium/chromedriver %{buildroot}%{_bindir}/chromedriver %{_mandir}/man1/chromium.1* %changelog +* Thu Mar 02 2023 Automatic Build System 110.0.5481.177-1mamba +- automatic version update by autodist + * Thu Jan 26 2023 Silvan Calarco 109.0.5414.119-1mamba - update to 109.0.5414.119