Skip to content

Commit 44d5401

Browse files
addaleaxtargos
authored andcommitted
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: #24875 Change-Id: I1f58606af294be65e74a1f107cd05fc21e032704 Reviewed-on: https://chromium-review.googlesource.com/c/1433778 Commit-Queue: Jakob Gruber <[email protected]> Reviewed-by: Jakob Gruber <[email protected]> Cr-Commit-Position: refs/heads/master@{#59058} Refs: v8/v8@fc0ddf5 PR-URL: #25852 Reviewed-By: Ujjwal Sharma <[email protected]> Reviewed-By: Matteo Collina <[email protected]> Reviewed-By: Ali Ijaz Sheikh <[email protected]>
1 parent cefb802 commit 44d5401

File tree

3 files changed

+6
-7
lines changed

3 files changed

+6
-7
lines changed

common.gypi

+1-1
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@
3737

3838
# Reset this number to 0 on major V8 upgrades.
3939
# Increment by one for each non-official patch applied to deps/v8.
40-
'v8_embedder_string': '-node.0',
40+
'v8_embedder_string': '-node.1',
4141

4242
##### V8 defaults for Node.js #####
4343

deps/v8/src/snapshot/embedded-file-writer.cc

+4-6
Original file line numberDiff line numberDiff line change
@@ -561,13 +561,11 @@ void PlatformDependentEmbeddedFileWriter::AlignToCodeAlignment() {
561561
}
562562

563563
void PlatformDependentEmbeddedFileWriter::AlignToDataAlignment() {
564-
#if defined(V8_OS_WIN) && defined(V8_TARGET_ARCH_ARM64)
565-
// On Windows ARM64, instruction "ldr xt,[xn,v8_Default_embedded_blob_]" is
566-
// generated by clang-cl to load elements in v8_Default_embedded_blob_.
567-
// The generated instruction has scale 3 which requires the load target to be
568-
// aligned at 8 bytes (2^3).
564+
// On Windows ARM64, s390, PPC and possibly more platforms, aligned load
565+
// instructions are used to retrieve v8_Default_embedded_blob_ and/or
566+
// v8_Default_embedded_blob_size_. The generated instructions require the
567+
// load target to be aligned at 8 bytes (2^3).
569568
fprintf(fp_, ".balign 8\n");
570-
#endif
571569
}
572570

573571
void PlatformDependentEmbeddedFileWriter::Comment(const char* string) {

deps/v8/src/snapshot/embedded-file-writer.h

+1
Original file line numberDiff line numberDiff line change
@@ -286,6 +286,7 @@ class EmbeddedFileWriter : public EmbeddedFileWriterInterface {
286286

287287
w->Comment("The size of the embedded blob in bytes.");
288288
w->SectionRoData();
289+
w->AlignToDataAlignment();
289290
w->DeclareUint32(embedded_blob_size_symbol, blob->size());
290291
w->Newline();
291292
}

0 commit comments

Comments
 (0)