Skip to content

Commit b1015e0

Browse files
targosrefack
authored andcommitted
deps: V8: cherry-pick 6 commits
Cherry-pick ad49f12. Original commit message: [cleanup] Move Compressed[XXX]Slot definitions to separate header ... and fix header includes to please the respective bot. Drive-by-fix: decompression implementation is now MSVC friendly. Bug: v8:7703, v8:8834 Change-Id: Iaf589138e5bafb32b0d9feab5cf074b71f241a3c Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1505579 Commit-Queue: Igor Sheludko <[email protected]> Reviewed-by: Ulan Degenbaev <[email protected]> Cr-Commit-Position: refs/heads/master@{#60074} Refs: v8/v8@ad49f12 Cherry-pick 14f07a8. Original commit message: [ptr-compr] Define kTaggedPayloadOffset correctly on Big Endian smi size is sill 8 bytes when V8_COMPRESS_POINTERS is undefined. Bug: v8:7703 Change-Id: I0d1e757e42e8b1e6b10960420135245e24553175 Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1508572 Commit-Queue: Junliang Yan <[email protected]> Auto-Submit: Junliang Yan <[email protected]> Reviewed-by: Igor Sheludko <[email protected]> Cr-Commit-Position: refs/heads/master@{#60097} Refs: v8/v8@14f07a8 Cherry-pick 676014b. Original commit message: [ptr-compr] Fix MSVC build ... which complained about truncating uintptr_t constant to uint32_t. Bug: v8:7703 Change-Id: I6fae2bf1e5de79e6131479b84a8d8aa5b9de909f Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1508672 Reviewed-by: Ulan Degenbaev <[email protected]> Commit-Queue: Igor Sheludko <[email protected]> Cr-Commit-Position: refs/heads/master@{#60100} Refs: v8/v8@676014b Cherry-pick 4e6a1a7. Original commit message: [heap] Clean-up some weak map entries in scavenger This change enables clean-up of weak map entries in the scavenger of the weak map is in the young generation. With this change, the scavenger treats keys in ephemerons as weak instead of strong, but does not implement full ephemeron semantics: Values are treated always as strong, independently of whether the key is live or not. This approach ensures that no value is cleaned up accidentally. After scavenging, all entries with dead keys are removed from weak maps. After that, some values that are not referenced anywhere anymore might still be in the heap, and those can be cleaned up in the next scavenge. What the scavenger does, amounts to one iteration of the fixed-point algorithm required to implement ephemeron semantics. We hope that this is a reasonable trade-off between time spent tracing and cleaned-up entries. This change does not affect weak maps that reside in old space. Bug: v8:8557 Change-Id: Ic5618b3b863ad8c314c87449571150e756fecbf0 Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1467182 Commit-Queue: Sigurd Schneider <[email protected]> Reviewed-by: Ulan Degenbaev <[email protected]> Cr-Commit-Position: refs/heads/master@{#60101} Refs: v8/v8@4e6a1a7 Cherry-pick afbfd75. Original commit message: [ptr-compr] Fix ptr-compr broken by 4e6a1a75 (https://chromium-review.googlesource.com/c/v8/v8/+/1467182) Bug: v8:7703 Change-Id: Ia6b74b985735af67bde56b30e4a709247eb591be Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1508674 Commit-Queue: Igor Sheludko <[email protected]> Commit-Queue: Ulan Degenbaev <[email protected]> Reviewed-by: Ulan Degenbaev <[email protected]> Cr-Commit-Position: refs/heads/master@{#60102} Refs: v8/v8@afbfd75 Cherry-pick f792eb8. Original commit message: [ptr-compr][arm64] Update pointer compression arm64's implementation Since kTaggedSize got shrinked and we are actually compressing the pointers (as oppposed to zeroing their upper bits), we need to update the arm64 codebase to accommodate this change. Cq-Include-Trybots: luci.v8.try:v8_linux64_arm64_pointer_compression_rel_ng Bug: v8:7703 Change-Id: I890f3ab8c046f47232e80f85830f9ae8f4dbced4 Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1499498 Commit-Queue: Santiago Aboy Solanes <[email protected]> Reviewed-by: Igor Sheludko <[email protected]> Reviewed-by: Ross McIlroy <[email protected]> Reviewed-by: Clemens Hammacher <[email protected]> Cr-Commit-Position: refs/heads/master@{#60172} Refs: v8/v8@f792eb8 PR-URL: #26685 Reviewed-By: Anna Henningsen <[email protected]> Reviewed-By: Michaël Zasso <[email protected]> Reviewed-By: Refael Ackermann <[email protected]>
1 parent 8181811 commit b1015e0

37 files changed

+478
-359
lines changed

common.gypi

Lines changed: 1 addition & 1 deletion
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.9',
40+
'v8_embedder_string': '-node.10',
4141

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

deps/v8/BUILD.gn

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2276,6 +2276,8 @@ v8_source_set("v8_base") {
22762276
"src/objects/code.h",
22772277
"src/objects/compilation-cache-inl.h",
22782278
"src/objects/compilation-cache.h",
2279+
"src/objects/compressed-slots-inl.h",
2280+
"src/objects/compressed-slots.h",
22792281
"src/objects/data-handler.h",
22802282
"src/objects/debug-objects-inl.h",
22812283
"src/objects/debug-objects.cc",

deps/v8/src/arm64/macro-assembler-arm64-inl.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1060,7 +1060,11 @@ void TurboAssembler::SmiUntag(Register dst, const MemOperand& src) {
10601060
}
10611061
} else {
10621062
DCHECK(SmiValuesAre31Bits());
1063+
#ifdef V8_COMPRESS_POINTERS
1064+
Ldrsw(dst, src);
1065+
#else
10631066
Ldr(dst, src);
1067+
#endif
10641068
SmiUntag(dst);
10651069
}
10661070
}

deps/v8/src/arm64/macro-assembler-arm64.cc

Lines changed: 6 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -2813,11 +2813,7 @@ void TurboAssembler::StoreTaggedField(const Register& value,
28132813
const MemOperand& dst_field_operand) {
28142814
#ifdef V8_COMPRESS_POINTERS
28152815
RecordComment("[ StoreTagged");
2816-
// Use temporary register to zero out and don't trash value register
2817-
UseScratchRegisterScope temps(this);
2818-
Register compressed_value = temps.AcquireX();
2819-
Uxtw(compressed_value, value);
2820-
Str(compressed_value, dst_field_operand);
2816+
Str(value.W(), dst_field_operand);
28212817
RecordComment("]");
28222818
#else
28232819
Str(value, dst_field_operand);
@@ -2827,27 +2823,23 @@ void TurboAssembler::StoreTaggedField(const Register& value,
28272823
void TurboAssembler::DecompressTaggedSigned(const Register& destination,
28282824
const MemOperand& field_operand) {
28292825
RecordComment("[ DecompressTaggedSigned");
2830-
// TODO(solanes): use Ldrsw instead of Ldr,SXTW once kTaggedSize is shrinked
2831-
Ldr(destination, field_operand);
2832-
Sxtw(destination, destination);
2826+
Ldrsw(destination, field_operand);
28332827
RecordComment("]");
28342828
}
28352829

28362830
void TurboAssembler::DecompressTaggedPointer(const Register& destination,
28372831
const MemOperand& field_operand) {
28382832
RecordComment("[ DecompressTaggedPointer");
2839-
// TODO(solanes): use Ldrsw instead of Ldr,SXTW once kTaggedSize is shrinked
2840-
Ldr(destination, field_operand);
2841-
Add(destination, kRootRegister, Operand(destination, SXTW));
2833+
Ldrsw(destination, field_operand);
2834+
Add(destination, kRootRegister, destination);
28422835
RecordComment("]");
28432836
}
28442837

28452838
void TurboAssembler::DecompressAnyTagged(const Register& destination,
28462839
const MemOperand& field_operand) {
28472840
RecordComment("[ DecompressAnyTagged");
28482841
UseScratchRegisterScope temps(this);
2849-
// TODO(solanes): use Ldrsw instead of Ldr,SXTW once kTaggedSize is shrinked
2850-
Ldr(destination, field_operand);
2842+
Ldrsw(destination, field_operand);
28512843
// Branchlessly compute |masked_root|:
28522844
// masked_root = HAS_SMI_TAG(destination) ? 0 : kRootRegister;
28532845
STATIC_ASSERT((kSmiTagSize == 1) && (kSmiTag == 0));
@@ -2857,7 +2849,7 @@ void TurboAssembler::DecompressAnyTagged(const Register& destination,
28572849
And(masked_root, masked_root, kRootRegister);
28582850
// Now this add operation will either leave the value unchanged if it is a smi
28592851
// or add the isolate root if it is a heap object.
2860-
Add(destination, masked_root, Operand(destination, SXTW));
2852+
Add(destination, masked_root, destination);
28612853
RecordComment("]");
28622854
}
28632855

deps/v8/src/base/macros.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -318,7 +318,7 @@ V8_INLINE A implicit_cast(A x) {
318318
#define V8PRIdPTR V8_PTR_PREFIX "d"
319319
#define V8PRIuPTR V8_PTR_PREFIX "u"
320320

321-
#ifdef V8_TARGET_ARCH_64_BIT
321+
#if V8_TARGET_ARCH_64_BIT
322322
#define V8_PTR_HEX_DIGITS 12
323323
#define V8PRIxPTR_FMT "0x%012" V8PRIxPTR
324324
#else

deps/v8/src/bootstrapper.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@
88
#include "src/heap/factory.h"
99
#include "src/objects/fixed-array.h"
1010
#include "src/objects/shared-function-info.h"
11-
#include "src/objects/slots.h"
1211
#include "src/snapshot/natives.h"
1312
#include "src/visitors.h"
1413

deps/v8/src/builtins/arm64/builtins-arm64.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2555,7 +2555,7 @@ void Generate_PushBoundArguments(MacroAssembler* masm) {
25552555
__ SlotAddress(copy_to, argc);
25562556
__ Add(argc, argc,
25572557
bound_argc); // Update argc to include bound arguments.
2558-
__ Lsl(counter, bound_argc, kSystemPointerSizeLog2);
2558+
__ Lsl(counter, bound_argc, kTaggedSizeLog2);
25592559
__ Bind(&loop);
25602560
__ Sub(counter, counter, kTaggedSize);
25612561
__ LoadAnyTaggedField(scratch, MemOperand(bound_argv, counter));

deps/v8/src/heap/heap-write-barrier-inl.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
// elsewhere.
1616
#include "src/isolate.h"
1717
#include "src/objects/code.h"
18+
#include "src/objects/compressed-slots-inl.h"
1819
#include "src/objects/fixed-array.h"
1920
#include "src/objects/heap-object.h"
2021
#include "src/objects/maybe-object-inl.h"

deps/v8/src/heap/heap.h

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2347,6 +2347,20 @@ class HeapObjectAllocationTracker {
23472347
virtual ~HeapObjectAllocationTracker() = default;
23482348
};
23492349

2350+
template <typename T>
2351+
T ForwardingAddress(T heap_obj) {
2352+
MapWord map_word = heap_obj->map_word();
2353+
2354+
if (map_word.IsForwardingAddress()) {
2355+
return T::cast(map_word.ToForwardingAddress());
2356+
} else if (Heap::InFromPage(heap_obj)) {
2357+
return T();
2358+
} else {
2359+
// TODO(ulan): Support minor mark-compactor here.
2360+
return heap_obj;
2361+
}
2362+
}
2363+
23502364
} // namespace internal
23512365
} // namespace v8
23522366

deps/v8/src/heap/incremental-marking.cc

Lines changed: 0 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -609,22 +609,6 @@ void IncrementalMarking::UpdateMarkingWorklistAfterScavenge() {
609609
UpdateWeakReferencesAfterScavenge();
610610
}
611611

612-
namespace {
613-
template <typename T>
614-
T ForwardingAddress(T heap_obj) {
615-
MapWord map_word = heap_obj->map_word();
616-
617-
if (map_word.IsForwardingAddress()) {
618-
return T::cast(map_word.ToForwardingAddress());
619-
} else if (Heap::InFromPage(heap_obj)) {
620-
return T();
621-
} else {
622-
// TODO(ulan): Support minor mark-compactor here.
623-
return heap_obj;
624-
}
625-
}
626-
} // namespace
627-
628612
void IncrementalMarking::UpdateWeakReferencesAfterScavenge() {
629613
weak_objects_->weak_references.Update(
630614
[](std::pair<HeapObject, HeapObjectSlot> slot_in,

0 commit comments

Comments
 (0)