update v8 patches

array_buffer patch upstreamed at https://chromium-review.googlesource.com/c/v8/v8/+/1462003
This commit is contained in:
Jeremy Apthorp 2019-02-26 13:19:53 -08:00 committed by Samuel Attard
parent 36abc0e547
commit 1650ca3699
10 changed files with 22 additions and 61 deletions

View file

@ -1,7 +1,6 @@
deps_backport_detailed_line_info_for_cpu_profiler.patch deps_backport_detailed_line_info_for_cpu_profiler.patch
add_realloc.patch add_realloc.patch
build_gn.patch build_gn.patch
array_buffer.patch
expose_mksnapshot.patch expose_mksnapshot.patch
build-torque-with-x64-toolchain-on-arm.patch build-torque-with-x64-toolchain-on-arm.patch
do_not_run_arm_arm64_mksnapshot_binaries.patch do_not_run_arm_arm64_mksnapshot_binaries.patch

View file

@ -12,7 +12,7 @@ when we override ReallocateBufferMemory, so we therefore need to implement
Realloc on the v8 side. Realloc on the v8 side.
diff --git a/include/v8.h b/include/v8.h diff --git a/include/v8.h b/include/v8.h
index dac45b4a645af14bf8cbfb0eb7e662e3fb62c089..da8beb3a50cd766fa77cab2396ed9ce889614b85 100644 index f9ef26bc3c323c7c706cdd8207be569a1a500829..7345f9d6fb374a0175d4c22d9d85c470ea04522d 100644
--- a/include/v8.h --- a/include/v8.h
+++ b/include/v8.h +++ b/include/v8.h
@@ -4694,6 +4694,13 @@ class V8_EXPORT ArrayBuffer : public Object { @@ -4694,6 +4694,13 @@ class V8_EXPORT ArrayBuffer : public Object {
@ -30,7 +30,7 @@ index dac45b4a645af14bf8cbfb0eb7e662e3fb62c089..da8beb3a50cd766fa77cab2396ed9ce8
* Free the memory block of size |length|, pointed to by |data|. * Free the memory block of size |length|, pointed to by |data|.
* That memory is guaranteed to be previously allocated by |Allocate|. * That memory is guaranteed to be previously allocated by |Allocate|.
diff --git a/src/api.cc b/src/api.cc diff --git a/src/api.cc b/src/api.cc
index 0457ffdcec0ab5b726eca0192f912ce1acc06ca1..970d4dc270a68076d5131085a13264bd42281809 100644 index 940cd268d329d1882abde36d6b9be2144fae6263..332211259a4f2a108c5734fc1b3048f2d635c692 100644
--- a/src/api.cc --- a/src/api.cc
+++ b/src/api.cc +++ b/src/api.cc
@@ -516,6 +516,10 @@ void V8::SetSnapshotDataBlob(StartupData* snapshot_blob) { @@ -516,6 +516,10 @@ void V8::SetSnapshotDataBlob(StartupData* snapshot_blob) {

View file

@ -1,38 +0,0 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Cheng Zhao <zcbenz@gmail.com>
Date: Mon, 22 Oct 2018 10:47:12 -0700
Subject: array_buffer.patch
diff --git a/include/v8.h b/include/v8.h
index da8beb3a50cd766fa77cab2396ed9ce889614b85..16a17739e5396dc7db5b5f483b2fe34cc4afbd39 100644
--- a/include/v8.h
+++ b/include/v8.h
@@ -7825,6 +7825,9 @@ class V8_EXPORT Isolate {
*/
void SetIdle(bool is_idle);
+ /** Returns the ArrayBuffer::Allocator used in this isolate. */
+ ArrayBuffer::Allocator* GetArrayBufferAllocator();
+
/** Returns true if this isolate has a current context. */
bool InContext();
diff --git a/src/api.cc b/src/api.cc
index 970d4dc270a68076d5131085a13264bd42281809..ddf751106d4e0b2fb6f3c46f065adc6d76eca781 100644
--- a/src/api.cc
+++ b/src/api.cc
@@ -7983,6 +7983,13 @@ void Isolate::SetIdle(bool is_idle) {
isolate->SetIdle(is_idle);
}
+
+ArrayBuffer::Allocator* Isolate::GetArrayBufferAllocator() {
+ i::Isolate* isolate = reinterpret_cast<i::Isolate*>(this);
+ return isolate->array_buffer_allocator();
+}
+
+
bool Isolate::InContext() {
i::Isolate* isolate = reinterpret_cast<i::Isolate*>(this);
return !isolate->context().is_null();

View file

@ -6,7 +6,7 @@ Subject: build-torque-with-x64-toolchain-on-arm.patch
torque binary has to be run during the build. torque binary has to be run during the build.
diff --git a/BUILD.gn b/BUILD.gn diff --git a/BUILD.gn b/BUILD.gn
index 7160d238f2f703bd1dac731d868120fb1f5aad9f..3daec405f90de60baa35001f2a58070689e8663a 100644 index f544888a6ee6f41e873b956c941a8d1ed3963128..4a36ec8d550688a258aea35dbc05666ba8ee7f82 100644
--- a/BUILD.gn --- a/BUILD.gn
+++ b/BUILD.gn +++ b/BUILD.gn
@@ -178,7 +178,9 @@ declare_args() { @@ -178,7 +178,9 @@ declare_args() {
@ -20,7 +20,7 @@ index 7160d238f2f703bd1dac731d868120fb1f5aad9f..3daec405f90de60baa35001f2a580706
v8_generator_toolchain = "//build/toolchain/linux:clang_x64" v8_generator_toolchain = "//build/toolchain/linux:clang_x64"
} }
@@ -3477,7 +3479,7 @@ if (v8_use_snapshot && current_toolchain == v8_snapshot_toolchain) { @@ -3497,7 +3499,7 @@ if (v8_use_snapshot && current_toolchain == v8_snapshot_toolchain) {
} }
} }

View file

@ -5,7 +5,7 @@ Subject: build_gn.patch
diff --git a/BUILD.gn b/BUILD.gn diff --git a/BUILD.gn b/BUILD.gn
index 8e96a8cf47b6549c014ea654998d32edd9000fc4..54528b4b419d52928bac3cab1c9f26f139035512 100644 index 8005b08007104b0d972eabc12587b9e1c56f0316..5c3b772c7b71c26b40ba7f69210bff57ed1198e6 100644
--- a/BUILD.gn --- a/BUILD.gn
+++ b/BUILD.gn +++ b/BUILD.gn
@@ -240,7 +240,7 @@ config("internal_config") { @@ -240,7 +240,7 @@ config("internal_config") {
@ -17,7 +17,7 @@ index 8e96a8cf47b6549c014ea654998d32edd9000fc4..54528b4b419d52928bac3cab1c9f26f1
defines += [ "BUILDING_V8_SHARED" ] defines += [ "BUILDING_V8_SHARED" ]
} }
} }
@@ -3462,6 +3462,8 @@ if (v8_use_snapshot && current_toolchain == v8_snapshot_toolchain) { @@ -3482,6 +3482,8 @@ if (v8_use_snapshot && current_toolchain == v8_snapshot_toolchain) {
configs = [ ":internal_config" ] configs = [ ":internal_config" ]

View file

@ -5,10 +5,10 @@ Subject: dcheck.patch
diff --git a/src/api.cc b/src/api.cc diff --git a/src/api.cc b/src/api.cc
index 8e80bbd773b568a05cc7d4a263484566dfe973c2..848a8086f09e8b03a00a467bd1b8b206a19054aa 100644 index c9310487d9b2a5dac5e1ea94fc72b5925d76fbbe..302156acabc0dc70190f0512874ac0722a00cda5 100644
--- a/src/api.cc --- a/src/api.cc
+++ b/src/api.cc +++ b/src/api.cc
@@ -8627,7 +8627,7 @@ void Isolate::SetPromiseRejectCallback(PromiseRejectCallback callback) { @@ -8624,7 +8624,7 @@ void Isolate::SetPromiseRejectCallback(PromiseRejectCallback callback) {
void Isolate::RunMicrotasks() { void Isolate::RunMicrotasks() {
@ -18,10 +18,10 @@ index 8e80bbd773b568a05cc7d4a263484566dfe973c2..848a8086f09e8b03a00a467bd1b8b206
isolate->default_microtask_queue()->RunMicrotasks(isolate); isolate->default_microtask_queue()->RunMicrotasks(isolate);
} }
diff --git a/src/heap/heap.cc b/src/heap/heap.cc diff --git a/src/heap/heap.cc b/src/heap/heap.cc
index af48ffb058a1bc923fa20ed36ef83ea5e6b3f2fc..553c341ee17919abfe26c3b6a1ef0fed91787d6f 100644 index 1b4c11179eeed05eb8db9286d41d46b310e36fa4..86a28087996001a0171f10f32fa7f3515db64e7b 100644
--- a/src/heap/heap.cc --- a/src/heap/heap.cc
+++ b/src/heap/heap.cc +++ b/src/heap/heap.cc
@@ -4829,9 +4829,9 @@ void Heap::TearDown() { @@ -4836,9 +4836,9 @@ void Heap::TearDown() {
void Heap::AddGCPrologueCallback(v8::Isolate::GCCallbackWithData callback, void Heap::AddGCPrologueCallback(v8::Isolate::GCCallbackWithData callback,
GCType gc_type, void* data) { GCType gc_type, void* data) {
DCHECK_NOT_NULL(callback); DCHECK_NOT_NULL(callback);

View file

@ -20,10 +20,10 @@ Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de> Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
diff --git a/src/flag-definitions.h b/src/flag-definitions.h diff --git a/src/flag-definitions.h b/src/flag-definitions.h
index 17c38553a08e9b30eeaefb61e92883477cc1d380..bede742b04022032f1b1afa22bb704b517a928e5 100644 index 09ef72d57b745d938e34e098d82e2fb3fe2f90ce..324e0759329d0e3b0c27d07bea6f97e4a2422f35 100644
--- a/src/flag-definitions.h --- a/src/flag-definitions.h
+++ b/src/flag-definitions.h +++ b/src/flag-definitions.h
@@ -1311,7 +1311,7 @@ DEFINE_BOOL(log_function_events, false, @@ -1320,7 +1320,7 @@ DEFINE_BOOL(log_function_events, false,
DEFINE_BOOL(prof, false, DEFINE_BOOL(prof, false,
"Log statistical profiling information (implies --log-code).") "Log statistical profiling information (implies --log-code).")

View file

@ -22,7 +22,7 @@ Reviewed-By: Yang Guo <yangguo@chromium.org>
Reviewed-By: Michaël Zasso <targos@protonmail.com> Reviewed-By: Michaël Zasso <targos@protonmail.com>
diff --git a/include/v8.h b/include/v8.h diff --git a/include/v8.h b/include/v8.h
index 16a17739e5396dc7db5b5f483b2fe34cc4afbd39..ccbf36c0cb69bdfc0c459eb182bd42beffdbe056 100644 index 7345f9d6fb374a0175d4c22d9d85c470ea04522d..133a3dba8519c344f6dc4229cc5d5d3241e6fecc 100644
--- a/include/v8.h --- a/include/v8.h
+++ b/include/v8.h +++ b/include/v8.h
@@ -1143,6 +1143,10 @@ class V8_EXPORT PrimitiveArray { @@ -1143,6 +1143,10 @@ class V8_EXPORT PrimitiveArray {
@ -143,7 +143,7 @@ index 16a17739e5396dc7db5b5f483b2fe34cc4afbd39..ccbf36c0cb69bdfc0c459eb182bd42be
Local<String> ValueOf() const; Local<String> ValueOf() const;
@@ -10367,6 +10408,30 @@ template <class T> Value* Value::Cast(T* value) { @@ -10368,6 +10409,30 @@ template <class T> Value* Value::Cast(T* value) {
} }
@ -175,7 +175,7 @@ index 16a17739e5396dc7db5b5f483b2fe34cc4afbd39..ccbf36c0cb69bdfc0c459eb182bd42be
#ifdef V8_ENABLE_CHECKS #ifdef V8_ENABLE_CHECKS
CheckCast(value); CheckCast(value);
diff --git a/src/api.cc b/src/api.cc diff --git a/src/api.cc b/src/api.cc
index ddf751106d4e0b2fb6f3c46f065adc6d76eca781..8e80bbd773b568a05cc7d4a263484566dfe973c2 100644 index 332211259a4f2a108c5734fc1b3048f2d635c692..c9310487d9b2a5dac5e1ea94fc72b5925d76fbbe 100644
--- a/src/api.cc --- a/src/api.cc
+++ b/src/api.cc +++ b/src/api.cc
@@ -2230,6 +2230,10 @@ int PrimitiveArray::Length() const { @@ -2230,6 +2230,10 @@ int PrimitiveArray::Length() const {
@ -318,7 +318,7 @@ index ddf751106d4e0b2fb6f3c46f065adc6d76eca781..8e80bbd773b568a05cc7d4a263484566
Local<String> v8::String::Concat(Isolate* v8_isolate, Local<String> left, Local<String> v8::String::Concat(Isolate* v8_isolate, Local<String> left,
Local<String> right) { Local<String> right) {
i::Isolate* isolate = reinterpret_cast<i::Isolate*>(v8_isolate); i::Isolate* isolate = reinterpret_cast<i::Isolate*>(v8_isolate);
@@ -6702,6 +6779,11 @@ bool v8::BooleanObject::ValueOf() const { @@ -6701,6 +6778,11 @@ bool v8::BooleanObject::ValueOf() const {
} }
@ -330,7 +330,7 @@ index ddf751106d4e0b2fb6f3c46f065adc6d76eca781..8e80bbd773b568a05cc7d4a263484566
Local<v8::Value> v8::StringObject::New(Isolate* v8_isolate, Local<v8::Value> v8::StringObject::New(Isolate* v8_isolate,
Local<String> value) { Local<String> value) {
i::Handle<i::String> string = Utils::OpenHandle(*value); i::Handle<i::String> string = Utils::OpenHandle(*value);
@@ -8934,6 +9016,9 @@ bool MicrotasksScope::IsRunningMicrotasks(Isolate* v8Isolate) { @@ -8931,6 +9013,9 @@ bool MicrotasksScope::IsRunningMicrotasks(Isolate* v8Isolate) {
return isolate->default_microtask_queue()->IsRunningMicrotasks(); return isolate->default_microtask_queue()->IsRunningMicrotasks();
} }
@ -340,7 +340,7 @@ index ddf751106d4e0b2fb6f3c46f065adc6d76eca781..8e80bbd773b568a05cc7d4a263484566
String::Utf8Value::Utf8Value(v8::Isolate* isolate, v8::Local<v8::Value> obj) String::Utf8Value::Utf8Value(v8::Isolate* isolate, v8::Local<v8::Value> obj)
: str_(nullptr), length_(0) { : str_(nullptr), length_(0) {
if (obj.IsEmpty()) return; if (obj.IsEmpty()) return;
@@ -8953,6 +9038,9 @@ String::Utf8Value::~Utf8Value() { @@ -8950,6 +9035,9 @@ String::Utf8Value::~Utf8Value() {
i::DeleteArray(str_); i::DeleteArray(str_);
} }

View file

@ -10,10 +10,10 @@ Electron does, so this patch makes sure that the build doesn't try to run
the mksnapshot binary if it was built for arm or arm64. the mksnapshot binary if it was built for arm or arm64.
diff --git a/BUILD.gn b/BUILD.gn diff --git a/BUILD.gn b/BUILD.gn
index 3daec405f90de60baa35001f2a58070689e8663a..737ca427c8ac595e36aa68ce831db155a9d08e1d 100644 index 4a36ec8d550688a258aea35dbc05666ba8ee7f82..49ace170a574cfa2b76be59db29c6f5436824711 100644
--- a/BUILD.gn --- a/BUILD.gn
+++ b/BUILD.gn +++ b/BUILD.gn
@@ -1301,9 +1301,19 @@ if (v8_use_snapshot && v8_use_external_startup_data) { @@ -1303,9 +1303,19 @@ if (v8_use_snapshot && v8_use_external_startup_data) {
] ]
public_deps = [ public_deps = [
":natives_blob", ":natives_blob",

View file

@ -6,10 +6,10 @@ Subject: expose_mksnapshot.patch
Needed in order to build mksnapshot on arm. Needed in order to build mksnapshot on arm.
diff --git a/BUILD.gn b/BUILD.gn diff --git a/BUILD.gn b/BUILD.gn
index 54528b4b419d52928bac3cab1c9f26f139035512..7160d238f2f703bd1dac731d868120fb1f5aad9f 100644 index 5c3b772c7b71c26b40ba7f69210bff57ed1198e6..f544888a6ee6f41e873b956c941a8d1ed3963128 100644
--- a/BUILD.gn --- a/BUILD.gn
+++ b/BUILD.gn +++ b/BUILD.gn
@@ -3452,8 +3452,6 @@ if (current_toolchain == v8_generator_toolchain) { @@ -3472,8 +3472,6 @@ if (current_toolchain == v8_generator_toolchain) {
if (v8_use_snapshot && current_toolchain == v8_snapshot_toolchain) { if (v8_use_snapshot && current_toolchain == v8_snapshot_toolchain) {
v8_executable("mksnapshot") { v8_executable("mksnapshot") {