diff options
author | Anna Henningsen <anna@addaleax.net> | 2019-01-24 17:27:53 +0100 |
---|---|---|
committer | Michaƫl Zasso <targos@protonmail.com> | 2019-03-14 18:50:02 +0100 |
commit | 44d5401b8d64161fb9d057c8ec47bbc917e87247 (patch) | |
tree | 70f912c90cecc93ba4a144ac388fe3a83d85f299 | |
parent | cefb8029cd43db87077384b36f3a9bd6d4555dad (diff) | |
download | android-node-v8-44d5401b8d64161fb9d057c8ec47bbc917e87247.tar.gz android-node-v8-44d5401b8d64161fb9d057c8ec47bbc917e87247.tar.bz2 android-node-v8-44d5401b8d64161fb9d057c8ec47bbc917e87247.zip |
deps: cherry-pick fc0ddf5 from upstream V8
Original commit message:
[snapshot] Always align embedded blob code pointer and size
Other platforms besides ARM64 Windows may also have alignment
requirements, e.g. PPC and s390. These requirements may affect
both the code pointer field and the size field, and so they
each need alignment directives because they are stored in
different sections.
Since aligning wastes a handful of bytes at most, not making
alignment conditional on the platform type seems like a good idea.
Refs: https://github.com/nodejs/node/pull/24875
Change-Id: I1f58606af294be65e74a1f107cd05fc21e032704
Reviewed-on: https://chromium-review.googlesource.com/c/1433778
Commit-Queue: Jakob Gruber <jgruber@chromium.org>
Reviewed-by: Jakob Gruber <jgruber@chromium.org>
Cr-Commit-Position: refs/heads/master@{#59058}
Refs: https://github.com/v8/v8/commit/fc0ddf551216761f5a9ecb07958fe92bbc8a9bc2
PR-URL: https://github.com/nodejs/node/pull/25852
Reviewed-By: Ujjwal Sharma <usharma1998@gmail.com>
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: Ali Ijaz Sheikh <ofrobots@google.com>
-rw-r--r-- | common.gypi | 2 | ||||
-rw-r--r-- | deps/v8/src/snapshot/embedded-file-writer.cc | 10 | ||||
-rw-r--r-- | deps/v8/src/snapshot/embedded-file-writer.h | 1 |
3 files changed, 6 insertions, 7 deletions
diff --git a/common.gypi b/common.gypi index 3b99d4a36e..a36737086c 100644 --- a/common.gypi +++ b/common.gypi @@ -37,7 +37,7 @@ # Reset this number to 0 on major V8 upgrades. # Increment by one for each non-official patch applied to deps/v8. - 'v8_embedder_string': '-node.0', + 'v8_embedder_string': '-node.1', ##### V8 defaults for Node.js ##### diff --git a/deps/v8/src/snapshot/embedded-file-writer.cc b/deps/v8/src/snapshot/embedded-file-writer.cc index 36a5f0e88b..2a08d05170 100644 --- a/deps/v8/src/snapshot/embedded-file-writer.cc +++ b/deps/v8/src/snapshot/embedded-file-writer.cc @@ -561,13 +561,11 @@ void PlatformDependentEmbeddedFileWriter::AlignToCodeAlignment() { } void PlatformDependentEmbeddedFileWriter::AlignToDataAlignment() { -#if defined(V8_OS_WIN) && defined(V8_TARGET_ARCH_ARM64) - // On Windows ARM64, instruction "ldr xt,[xn,v8_Default_embedded_blob_]" is - // generated by clang-cl to load elements in v8_Default_embedded_blob_. - // The generated instruction has scale 3 which requires the load target to be - // aligned at 8 bytes (2^3). + // On Windows ARM64, s390, PPC and possibly more platforms, aligned load + // instructions are used to retrieve v8_Default_embedded_blob_ and/or + // v8_Default_embedded_blob_size_. The generated instructions require the + // load target to be aligned at 8 bytes (2^3). fprintf(fp_, ".balign 8\n"); -#endif } void PlatformDependentEmbeddedFileWriter::Comment(const char* string) { diff --git a/deps/v8/src/snapshot/embedded-file-writer.h b/deps/v8/src/snapshot/embedded-file-writer.h index 55e134cd47..8323c4d53b 100644 --- a/deps/v8/src/snapshot/embedded-file-writer.h +++ b/deps/v8/src/snapshot/embedded-file-writer.h @@ -286,6 +286,7 @@ class EmbeddedFileWriter : public EmbeddedFileWriterInterface { w->Comment("The size of the embedded blob in bytes."); w->SectionRoData(); + w->AlignToDataAlignment(); w->DeclareUint32(embedded_blob_size_symbol, blob->size()); w->Newline(); } |