Skip to content

Truly independent web browser

LibGC+LibJS: Shrink the heap region to 32 GiB on every target

Andreas Kling51d3e3ca242b
diff --git a/Libraries/LibGC/HeapRegion.h b/Libraries/LibGC/HeapRegion.h
index 22dfb5e9913..8781eacd573 100644
--- a/Libraries/LibGC/HeapRegion.h
+++ b/Libraries/LibGC/HeapRegion.h
@@ -13,23 +13,10 @@
namespace GC {
-#if AK_IS_ARCH_RISCV64()
-// Sv39 provides 256 GiB of user virtual address space after splitting the
-// address space between userspace and the kernel. Keep room for the second
-// region-sized reservation used to align the cage base.
-static constexpr size_t HEAP_REGION_SIZE = 64ull * GiB;
-#elif AK_IS_ARCH_AARCH64() && !defined(AK_OS_MACOS)
-// Some AArch64 systems provide only 39 or 42 bits of user virtual address
-// space. Keep the cage small enough to fit those systems, including the
-// second region-sized reservation used to align its base.
-static constexpr size_t HEAP_REGION_SIZE = 128ull * GiB;
-#elif defined(HAS_THREAD_SANITIZER)
-// ThreadSanitizer only lets the application map a few TiB of its own address space, not enough
-// for the region-sized reservation plus the second one used to align its base.
-static constexpr size_t HEAP_REGION_SIZE = 128ull * GiB;
-#else
-static constexpr size_t HEAP_REGION_SIZE = 4ull * TiB;
-#endif
+// 32 GiB is what a 32-bit cell offset in units of the 8-byte cell alignment can address. It is the same on every target,
+// and small enough for the second region-sized reservation used to align its base to fit in the user address space of
+// Sv39 RISC-V, 39-bit AArch64, and the application ranges of the sanitizers.
+static constexpr size_t HEAP_REGION_SIZE = 32ull * GiB;
static_assert(is_power_of_two(HEAP_REGION_SIZE));
static constexpr size_t HEAP_REGION_OFFSET_MASK = HEAP_REGION_SIZE - 1;
diff --git a/Libraries/LibJS/Flap/src/lib.rs b/Libraries/LibJS/Flap/src/lib.rs
index a4a277b4d61..fc375071d18 100644
--- a/Libraries/LibJS/Flap/src/lib.rs
+++ b/Libraries/LibJS/Flap/src/lib.rs
@@ -840,7 +840,7 @@ const INT32_TAG_SHIFTED = 0x7FFA000000000000
const NAN_BASE_TAG = 0x7FF8
const CANON_NAN_BITS = 0x7FF8000000000000
const VM_HEAP_REGION_BASE = 16664
-const HEAP_REGION_OFFSET_MASK = 0x3FFFFFFFFFF
+const HEAP_REGION_OFFSET_MASK = 0x7FFFFFFFF
"#;
fn compiler(architecture: Architecture) -> Compiler {
diff --git a/Libraries/LibJS/Flap/tests/interpreter-assembly/aarch64.S b/Libraries/LibJS/Flap/tests/interpreter-assembly/aarch64.S
index 7287dd05203..e6e467c3f87 100644
--- a/Libraries/LibJS/Flap/tests/interpreter-assembly/aarch64.S
+++ b/Libraries/LibJS/Flap/tests/interpreter-assembly/aarch64.S
@@ -1802,7 +1802,7 @@ asm_handler_JumpIf:
mov w9, #65529
cmp w1, w9
b.ne .Lasm_JumpIf.ssa_block_3
- and x0, x0, #0x3ffffffffff
+ and x0, x0, #0x7ffffffff
add x0, x0, x24
ldrh w0, [x0, #12]
tbnz x0, #13, .Lasm_JumpIf.ssa_block_1
@@ -1846,7 +1846,7 @@ asm_handler_JumpTrue:
mov w9, #65529
cmp w1, w9
b.ne .Lasm_JumpTrue.ssa_block_2
- and x0, x0, #0x3ffffffffff
+ and x0, x0, #0x7ffffffff
add x0, x0, x24
ldrh w0, [x0, #12]
tbz x0, #13, .Lasm_JumpTrue.ssa_block_1
@@ -1895,7 +1895,7 @@ asm_handler_JumpFalse:
mov w9, #65529
cmp w1, w9
b.ne .Lasm_JumpFalse.ssa_block_2
- and x0, x0, #0x3ffffffffff
+ and x0, x0, #0x7ffffffff
add x0, x0, x24
ldrh w0, [x0, #12]
tbnz x0, #13, .Lasm_JumpFalse.ssa_block_1
@@ -2486,7 +2486,7 @@ asm_handler_JumpIfLoop:
mov w9, #65529
cmp w1, w9
b.ne .Lasm_JumpIfLoop.ssa_block_3
- and x0, x0, #0x3ffffffffff
+ and x0, x0, #0x7ffffffff
add x0, x0, x24
ldrh w0, [x0, #12]
tbnz x0, #13, .Lasm_JumpIfLoop.ssa_block_1
@@ -2530,7 +2530,7 @@ asm_handler_JumpTrueLoop:
mov w9, #65529
cmp w1, w9
b.ne .Lasm_JumpTrueLoop.ssa_block_2
- and x0, x0, #0x3ffffffffff
+ and x0, x0, #0x7ffffffff
add x0, x0, x24
ldrh w0, [x0, #12]
tbz x0, #13, .Lasm_JumpTrueLoop.ssa_block_1
@@ -2579,7 +2579,7 @@ asm_handler_JumpFalseLoop:
mov w9, #65529
cmp w1, w9
b.ne .Lasm_JumpFalseLoop.ssa_block_2
- and x0, x0, #0x3ffffffffff
+ and x0, x0, #0x7ffffffff
add x0, x0, x24
ldrh w0, [x0, #12]
tbnz x0, #13, .Lasm_JumpFalseLoop.ssa_block_1
@@ -3175,7 +3175,7 @@ asm_handler_Not:
cbz x0, .Lasm_Not.ssa_block_1
b .Lasm_Not.ssa_block_2
.Lasm_Not.ssa_block_10:
- and x0, x0, #0x3ffffffffff
+ and x0, x0, #0x7ffffffff
add x0, x0, x24
ldrh w0, [x0, #12]
tbnz x0, #13, .Lasm_Not.ssa_block_1
@@ -3321,7 +3321,7 @@ asm_handler_End_hot_end:
asm_handler_GetLexicalEnvironment:
ldr x0, [x28, #32]
cbz x0, .Lasm_GetLexicalEnvironment.assert_predicate_failure_3
- and x0, x0, #0x3ffffffffff
+ and x0, x0, #0x7ffffffff
movz x1, #0xfff8, lsl #48
orr x0, x0, x1
ldr w9, [x21, #4]
@@ -3340,7 +3340,7 @@ asm_handler_SetLexicalEnvironment:
mov w9, #65528
cmp w1, w9
b.ne .Lasm_SetLexicalEnvironment.assert_predicate_failure_3
- and x0, x0, #0x3ffffffffff
+ and x0, x0, #0x7ffffffff
add x0, x0, x24
str x0, [x28, #32]
ldrb w9, [x21, #8]
@@ -4863,7 +4863,7 @@ asm_handler_PutByValue:
mov w10, #65529
cmp x9, x10
b.ne .Lasm_PutByValue.ssa_block_1
- and x3, x3, #0x3ffffffffff
+ and x3, x3, #0x7ffffffff
add x3, x3, x24
ldrh w2, [x3, #12]
mov w0, w1
@@ -5133,7 +5133,7 @@ asm_handler_PutByValue:
ldr x9, [x0, #48]
cmp x9, x1
b.ne .Lasm_PutByValue.ssa_block_3
- and x2, x2, #0x3ffffffffff
+ and x2, x2, #0x7ffffffff
add x2, x2, x24
ldr x1, [x2, #24]
cbz x1, .Lasm_PutByValue.assert_failure_2
@@ -5171,7 +5171,7 @@ asm_handler_GetById:
mov w10, #65529
cmp x9, x10
b.ne .Lasm_GetById.ssa_block_14
- and x3, x3, #0x3ffffffffff
+ and x3, x3, #0x7ffffffff
add x3, x3, x24
ldr x0, [x3, #24]
cbz x0, .Lasm_GetById.assert_failure_0
@@ -5268,7 +5268,7 @@ asm_handler_PutById:
mov w10, #65529
cmp x9, x10
b.ne .Lasm_PutById.ssa_block_2
- and x2, x2, #0x3ffffffffff
+ and x2, x2, #0x7ffffffff
add x2, x2, x24
ldr x1, [x2, #24]
cbz x1, .Lasm_PutById.assert_failure_0
@@ -5320,7 +5320,7 @@ asm_handler_GetByValue:
mov w9, #65529
cmp w0, w9
b.ne .Lasm_GetByValue.ssa_block_8
- and x3, x3, #0x3ffffffffff
+ and x3, x3, #0x7ffffffff
add x3, x3, x24
ldrh w1, [x3, #12]
mov w0, w2
@@ -5502,7 +5502,7 @@ asm_handler_GetByValue:
tbz w0, #31, 1f
b .Lasm_GetByValue.ssa_block_1
1:
- and x3, x3, #0x3ffffffffff
+ and x3, x3, #0x7ffffffff
add x3, x3, x24
ldrb w1, [x3, #11]
and w1, w1, #0x3
@@ -5566,7 +5566,7 @@ asm_handler_GetByValue:
cbz x3, .Lasm_GetByValue.assert_failure_2
ldr w4, [x21, #24]
ldr x3, [x3, x4, lsl #3]
- and x1, x1, #0x3ffffffffff
+ and x1, x1, #0x7ffffffff
add x1, x1, x24
cmp x3, #3
b.eq .Lasm_GetByValue.ssa_block_6
@@ -5619,7 +5619,7 @@ asm_handler_GetLength:
mov w9, #65529
cmp w0, w9
b.ne .Lasm_GetLength.ssa_block_2
- and x1, x1, #0x3ffffffffff
+ and x1, x1, #0x7ffffffff
add x1, x1, x24
ldrh w0, [x1, #12]
tbz x0, #2, .Lasm_GetLength.ssa_block_6
@@ -5674,7 +5674,7 @@ asm_handler_GetLength:
mov w9, #65530
cmp w0, w9
b.ne .Lasm_GetLength.ssa_block_1
- and x1, x1, #0x3ffffffffff
+ and x1, x1, #0x7ffffffff
add x1, x1, x24
ldr w0, [x1, #12]
tbz x0, #31, 1f
@@ -5888,7 +5888,7 @@ asm_handler_Call:
mov w10, #65529
cmp x9, x10
b.ne .Lasm_Call.ssa_block_1
- and x1, x1, #0x3ffffffffff
+ and x1, x1, #0x7ffffffff
add x1, x1, x24
ldrh w0, [x1, #12]
tbnz x0, #7, 1f
@@ -5920,7 +5920,7 @@ asm_handler_Call:
ldr x2, [x2, #32]
cbz x2, .Lasm_Call.assert_failure_3
ldr x6, [x2, #32]
- and x6, x6, #0x3ffffffffff
+ and x6, x6, #0x7ffffffff
movz x2, #0xfff9, lsl #48
orr x6, x6, x2
b .Lasm_Call.ssa_block_9
@@ -6248,7 +6248,7 @@ asm_handler_ObjectPropertyIteratorNext:
mov w10, #65529
cmp x9, x10
b.ne .Lasm_ObjectPropertyIteratorNext.ssa_block_1
- and x1, x1, #0x3ffffffffff
+ and x1, x1, #0x7ffffffff
add x1, x1, x24
ldr w0, [x21, #16]
ldr x0, [x27, x0, lsl #3]
@@ -6256,7 +6256,7 @@ asm_handler_ObjectPropertyIteratorNext:
mov w9, #65528
cmp w2, w9
b.ne .Lasm_ObjectPropertyIteratorNext.assert_predicate_failure_9
- and x0, x0, #0x3ffffffffff
+ and x0, x0, #0x7ffffffff
add x0, x0, x24
ldrb w3, [x0, #12]
cmp x3, #0
@@ -6387,7 +6387,7 @@ asm_handler_IteratorNextUnpack:
mov w10, #65529
cmp x9, x10
b.ne .Lasm_IteratorNextUnpack.ssa_block_1
- and x1, x1, #0x3ffffffffff
+ and x1, x1, #0x7ffffffff
add x1, x1, x24
ldrh w4, [x1, #12]
tbnz x4, #2, 1f
@@ -6451,7 +6451,7 @@ asm_handler_IsCallable:
mov w10, #65529
cmp x9, x10
b.ne .Lasm_IsCallable.ssa_block_1
- and x0, x0, #0x3ffffffffff
+ and x0, x0, #0x7ffffffff
add x0, x0, x24
ldrh w0, [x0, #12]
tbz x0, #7, .Lasm_IsCallable.ssa_block_1
@@ -9303,13 +9303,13 @@ asm_handler_JumpLooselyEquals_cold:
mov w9, #65530
cmp w3, w9
b.ne .Lasm_JumpLooselyEquals.ssa_block_1
- and x1, x0, #0x3ffffffffff
+ and x1, x0, #0x7ffffffff
add x1, x1, x24
ldrb w9, [x1, #11]
mov w10, #128
tst x9, x10
b.eq .Lasm_JumpLooselyEquals.ssa_block_1
- and x1, x2, #0x3ffffffffff
+ and x1, x2, #0x7ffffffff
add x1, x1, x24
ldrb w9, [x1, #11]
mov w10, #128
@@ -9364,13 +9364,13 @@ asm_handler_JumpLooselyInequals_cold:
mov w9, #65530
cmp w3, w9
b.ne .Lasm_JumpLooselyInequals.ssa_block_1
- and x1, x0, #0x3ffffffffff
+ and x1, x0, #0x7ffffffff
add x1, x1, x24
ldrb w9, [x1, #11]
mov w10, #128
tst x9, x10
b.eq .Lasm_JumpLooselyInequals.ssa_block_1
- and x1, x2, #0x3ffffffffff
+ and x1, x2, #0x7ffffffff
add x1, x1, x24
ldrb w9, [x1, #11]
mov w10, #128
@@ -9425,13 +9425,13 @@ asm_handler_JumpStrictlyEquals_cold:
mov w9, #65530
cmp w3, w9
b.ne .Lasm_JumpStrictlyEquals.ssa_block_1
- and x1, x0, #0x3ffffffffff
+ and x1, x0, #0x7ffffffff
add x1, x1, x24
ldrb w9, [x1, #11]
mov w10, #128
tst x9, x10
b.eq .Lasm_JumpStrictlyEquals.ssa_block_1
- and x1, x2, #0x3ffffffffff
+ and x1, x2, #0x7ffffffff
add x1, x1, x24
ldrb w9, [x1, #11]
mov w10, #128
@@ -9486,13 +9486,13 @@ asm_handler_JumpStrictlyInequals_cold:
mov w9, #65530
cmp w3, w9
b.ne .Lasm_JumpStrictlyInequals.ssa_block_1
- and x1, x0, #0x3ffffffffff
+ and x1, x0, #0x7ffffffff
add x1, x1, x24
ldrb w9, [x1, #11]
mov w10, #128
tst x9, x10
b.eq .Lasm_JumpStrictlyInequals.ssa_block_1
- and x1, x2, #0x3ffffffffff
+ and x1, x2, #0x7ffffffff
add x1, x1, x24
ldrb w9, [x1, #11]
mov w10, #128
@@ -9811,13 +9811,13 @@ asm_handler_JumpLooselyEqualsLoop_cold:
mov w9, #65530
cmp w3, w9
b.ne .Lasm_JumpLooselyEqualsLoop.ssa_block_1
- and x1, x0, #0x3ffffffffff
+ and x1, x0, #0x7ffffffff
add x1, x1, x24
ldrb w9, [x1, #11]
mov w10, #128
tst x9, x10
b.eq .Lasm_JumpLooselyEqualsLoop.ssa_block_1
- and x1, x2, #0x3ffffffffff
+ and x1, x2, #0x7ffffffff
add x1, x1, x24
ldrb w9, [x1, #11]
mov w10, #128
@@ -9872,13 +9872,13 @@ asm_handler_JumpLooselyInequalsLoop_cold:
mov w9, #65530
cmp w3, w9
b.ne .Lasm_JumpLooselyInequalsLoop.ssa_block_1
- and x1, x0, #0x3ffffffffff
+ and x1, x0, #0x7ffffffff
add x1, x1, x24
ldrb w9, [x1, #11]
mov w10, #128
tst x9, x10
b.eq .Lasm_JumpLooselyInequalsLoop.ssa_block_1
- and x1, x2, #0x3ffffffffff
+ and x1, x2, #0x7ffffffff
add x1, x1, x24
ldrb w9, [x1, #11]
mov w10, #128
@@ -9933,13 +9933,13 @@ asm_handler_JumpStrictlyEqualsLoop_cold:
mov w9, #65530
cmp w3, w9
b.ne .Lasm_JumpStrictlyEqualsLoop.ssa_block_1
- and x1, x0, #0x3ffffffffff
+ and x1, x0, #0x7ffffffff
add x1, x1, x24
ldrb w9, [x1, #11]
mov w10, #128
tst x9, x10
b.eq .Lasm_JumpStrictlyEqualsLoop.ssa_block_1
- and x1, x2, #0x3ffffffffff
+ and x1, x2, #0x7ffffffff
add x1, x1, x24
ldrb w9, [x1, #11]
mov w10, #128
@@ -9994,13 +9994,13 @@ asm_handler_JumpStrictlyInequalsLoop_cold:
mov w9, #65530
cmp w3, w9
b.ne .Lasm_JumpStrictlyInequalsLoop.ssa_block_1
- and x1, x0, #0x3ffffffffff
+ and x1, x0, #0x7ffffffff
add x1, x1, x24
ldrb w9, [x1, #11]
mov w10, #128
tst x9, x10
b.eq .Lasm_JumpStrictlyInequalsLoop.ssa_block_1
- and x1, x2, #0x3ffffffffff
+ and x1, x2, #0x7ffffffff
add x1, x1, x24
ldrb w9, [x1, #11]
mov w10, #128
@@ -13113,13 +13113,13 @@ asm_handler_StrictlyEquals_cold:
mov w9, #65530
cmp w3, w9
b.ne .Lasm_StrictlyEquals.ssa_block_1
- and x1, x0, #0x3ffffffffff
+ and x1, x0, #0x7ffffffff
add x1, x1, x24
ldrb w9, [x1, #11]
mov w10, #128
tst x9, x10
b.eq .Lasm_StrictlyEquals.ssa_block_1
- and x1, x2, #0x3ffffffffff
+ and x1, x2, #0x7ffffffff
add x1, x1, x24
ldrb w9, [x1, #11]
mov w10, #128
@@ -13190,13 +13190,13 @@ asm_handler_StrictlyInequals_cold:
mov w9, #65530
cmp w3, w9
b.ne .Lasm_StrictlyInequals.ssa_block_1
- and x1, x0, #0x3ffffffffff
+ and x1, x0, #0x7ffffffff
add x1, x1, x24
ldrb w9, [x1, #11]
mov w10, #128
tst x9, x10
b.eq .Lasm_StrictlyInequals.ssa_block_1
- and x1, x2, #0x3ffffffffff
+ and x1, x2, #0x7ffffffff
add x1, x1, x24
ldrb w9, [x1, #11]
mov w10, #128
@@ -13377,13 +13377,13 @@ asm_handler_LooselyEquals_cold:
mov w9, #65530
cmp w3, w9
b.ne .Lasm_LooselyEquals.ssa_block_1
- and x1, x0, #0x3ffffffffff
+ and x1, x0, #0x7ffffffff
add x1, x1, x24
ldrb w9, [x1, #11]
mov w10, #128
tst x9, x10
b.eq .Lasm_LooselyEquals.ssa_block_1
- and x1, x2, #0x3ffffffffff
+ and x1, x2, #0x7ffffffff
add x1, x1, x24
ldrb w9, [x1, #11]
mov w10, #128
@@ -13454,13 +13454,13 @@ asm_handler_LooselyInequals_cold:
mov w9, #65530
cmp w3, w9
b.ne .Lasm_LooselyInequals.ssa_block_1
- and x1, x0, #0x3ffffffffff
+ and x1, x0, #0x7ffffffff
add x1, x1, x24
ldrb w9, [x1, #11]
mov w10, #128
tst x9, x10
b.eq .Lasm_LooselyInequals.ssa_block_1
- and x1, x2, #0x3ffffffffff
+ and x1, x2, #0x7ffffffff
add x1, x1, x24
ldrb w9, [x1, #11]
mov w10, #128
@@ -13996,7 +13996,7 @@ asm_handler_GetById_cold:
tbz x1, #11, 1f
b .Lasm_GetById.ssa_block_3
1:
- and x0, x0, #0x3ffffffffff
+ and x0, x0, #0x7ffffffff
movz x1, #0xfff9, lsl #48
orr x0, x0, x1
.Lasm_GetById.ssa_block_51:
@@ -14049,7 +14049,7 @@ asm_handler_GetById_cold:
stp x1, x4, [x0, #32]
ldr x1, [x28, #48]
str x1, [x0, #48]
- and x3, x3, #0x3ffffffffff
+ and x3, x3, #0x7ffffffff
movz x1, #0xfff9, lsl #48
orr x3, x3, x1
str x3, [x0, #80]
@@ -14158,7 +14158,7 @@ asm_handler_GetById_cold:
cbz w9, .Lasm_GetById.ssa_block_1
b .Lasm_GetById.ssa_block_16
.Lasm_GetById.ssa_block_17:
- and x0, x0, #0x3ffffffffff
+ and x0, x0, #0x7ffffffff
add x0, x0, x24
ldr x1, [x0, #16]
cbz x1, .Lasm_GetById.ssa_block_5
@@ -14501,7 +14501,7 @@ asm_handler_PutByIdWithThis_cold_end:
asm_handler_GetByValue_cold:
// Cold paths for GetByValue
.Lasm_GetByValue.ssa_block_37:
- and x0, x0, #0x3ffffffffff
+ and x0, x0, #0x7ffffffff
add x0, x0, x24
ldr x3, [x0, #16]
ldr x2, [x1, #24]
@@ -19451,13 +19451,13 @@ asm_handler_StrictlyEqualsRhsInt32_cold:
mov w10, #65530
cmp x9, x10
b.ne .Lasm_StrictlyEqualsRhsInt32.ssa_block_1
- and x2, x0, #0x3ffffffffff
+ and x2, x0, #0x7ffffffff
add x2, x2, x24
ldrb w9, [x2, #11]
mov w10, #128
tst x9, x10
b.eq .Lasm_StrictlyEqualsRhsInt32.ssa_block_1
- and x2, x1, #0x3ffffffffff
+ and x2, x1, #0x7ffffffff
add x2, x2, x24
ldrb w9, [x2, #11]
mov w10, #128
@@ -19530,13 +19530,13 @@ asm_handler_StrictlyInequalsRhsInt32_cold:
mov w10, #65530
cmp x9, x10
b.ne .Lasm_StrictlyInequalsRhsInt32.ssa_block_1
- and x2, x0, #0x3ffffffffff
+ and x2, x0, #0x7ffffffff
add x2, x2, x24
ldrb w9, [x2, #11]
mov w10, #128
tst x9, x10
b.eq .Lasm_StrictlyInequalsRhsInt32.ssa_block_1
- and x2, x1, #0x3ffffffffff
+ and x2, x1, #0x7ffffffff
add x2, x2, x24
ldrb w9, [x2, #11]
mov w10, #128
@@ -19609,13 +19609,13 @@ asm_handler_LooselyEqualsRhsInt32_cold:
mov w10, #65530
cmp x9, x10
b.ne .Lasm_LooselyEqualsRhsInt32.ssa_block_1
- and x2, x0, #0x3ffffffffff
+ and x2, x0, #0x7ffffffff
add x2, x2, x24
ldrb w9, [x2, #11]
mov w10, #128
tst x9, x10
b.eq .Lasm_LooselyEqualsRhsInt32.ssa_block_1
- and x2, x1, #0x3ffffffffff
+ and x2, x1, #0x7ffffffff
add x2, x2, x24
ldrb w9, [x2, #11]
mov w10, #128
@@ -19688,13 +19688,13 @@ asm_handler_LooselyInequalsRhsInt32_cold:
mov w10, #65530
cmp x9, x10
b.ne .Lasm_LooselyInequalsRhsInt32.ssa_block_1
- and x2, x0, #0x3ffffffffff
+ and x2, x0, #0x7ffffffff
add x2, x2, x24
ldrb w9, [x2, #11]
mov w10, #128
tst x9, x10
b.eq .Lasm_LooselyInequalsRhsInt32.ssa_block_1
- and x2, x1, #0x3ffffffffff
+ and x2, x1, #0x7ffffffff
add x2, x2, x24
ldrb w9, [x2, #11]
mov w10, #128
@@ -19767,13 +19767,13 @@ asm_handler_JumpStrictlyEqualsRhsInt32_cold:
mov w10, #65530
cmp x9, x10
b.ne .Lasm_JumpStrictlyEqualsRhsInt32.ssa_block_1
- and x2, x0, #0x3ffffffffff
+ and x2, x0, #0x7ffffffff
add x2, x2, x24
ldrb w9, [x2, #11]
mov w10, #128
tst x9, x10
b.eq .Lasm_JumpStrictlyEqualsRhsInt32.ssa_block_1
- and x2, x1, #0x3ffffffffff
+ and x2, x1, #0x7ffffffff
add x2, x2, x24
ldrb w9, [x2, #11]
mov w10, #128
@@ -19830,13 +19830,13 @@ asm_handler_JumpStrictlyInequalsRhsInt32_cold:
mov w10, #65530
cmp x9, x10
b.ne .Lasm_JumpStrictlyInequalsRhsInt32.ssa_block_1
- and x2, x0, #0x3ffffffffff
+ and x2, x0, #0x7ffffffff
add x2, x2, x24
ldrb w9, [x2, #11]
mov w10, #128
tst x9, x10
b.eq .Lasm_JumpStrictlyInequalsRhsInt32.ssa_block_1
- and x2, x1, #0x3ffffffffff
+ and x2, x1, #0x7ffffffff
add x2, x2, x24
ldrb w9, [x2, #11]
mov w10, #128
@@ -19893,13 +19893,13 @@ asm_handler_JumpLooselyEqualsRhsInt32_cold:
mov w10, #65530
cmp x9, x10
b.ne .Lasm_JumpLooselyEqualsRhsInt32.ssa_block_1
- and x2, x0, #0x3ffffffffff
+ and x2, x0, #0x7ffffffff
add x2, x2, x24
ldrb w9, [x2, #11]
mov w10, #128
tst x9, x10
b.eq .Lasm_JumpLooselyEqualsRhsInt32.ssa_block_1
- and x2, x1, #0x3ffffffffff
+ and x2, x1, #0x7ffffffff
add x2, x2, x24
ldrb w9, [x2, #11]
mov w10, #128
@@ -19956,13 +19956,13 @@ asm_handler_JumpLooselyInequalsRhsInt32_cold:
mov w10, #65530
cmp x9, x10
b.ne .Lasm_JumpLooselyInequalsRhsInt32.ssa_block_1
- and x2, x0, #0x3ffffffffff
+ and x2, x0, #0x7ffffffff
add x2, x2, x24
ldrb w9, [x2, #11]
mov w10, #128
tst x9, x10
b.eq .Lasm_JumpLooselyInequalsRhsInt32.ssa_block_1
- and x2, x1, #0x3ffffffffff
+ and x2, x1, #0x7ffffffff
add x2, x2, x24
ldrb w9, [x2, #11]
mov w10, #128
@@ -20207,13 +20207,13 @@ asm_handler_JumpStrictlyEqualsLoopRhsInt32_cold:
mov w10, #65530
cmp x9, x10
b.ne .Lasm_JumpStrictlyEqualsLoopRhsInt32.ssa_block_1
- and x2, x0, #0x3ffffffffff
+ and x2, x0, #0x7ffffffff
add x2, x2, x24
ldrb w9, [x2, #11]
mov w10, #128
tst x9, x10
b.eq .Lasm_JumpStrictlyEqualsLoopRhsInt32.ssa_block_1
- and x2, x1, #0x3ffffffffff
+ and x2, x1, #0x7ffffffff
add x2, x2, x24
ldrb w9, [x2, #11]
mov w10, #128
@@ -20270,13 +20270,13 @@ asm_handler_JumpStrictlyInequalsLoopRhsInt32_cold:
mov w10, #65530
cmp x9, x10
b.ne .Lasm_JumpStrictlyInequalsLoopRhsInt32.ssa_block_1
- and x2, x0, #0x3ffffffffff
+ and x2, x0, #0x7ffffffff
add x2, x2, x24
ldrb w9, [x2, #11]
mov w10, #128
tst x9, x10
b.eq .Lasm_JumpStrictlyInequalsLoopRhsInt32.ssa_block_1
- and x2, x1, #0x3ffffffffff
+ and x2, x1, #0x7ffffffff
add x2, x2, x24
ldrb w9, [x2, #11]
mov w10, #128
@@ -20333,13 +20333,13 @@ asm_handler_JumpLooselyEqualsLoopRhsInt32_cold:
mov w10, #65530
cmp x9, x10
b.ne .Lasm_JumpLooselyEqualsLoopRhsInt32.ssa_block_1
- and x2, x0, #0x3ffffffffff
+ and x2, x0, #0x7ffffffff
add x2, x2, x24
ldrb w9, [x2, #11]
mov w10, #128
tst x9, x10
b.eq .Lasm_JumpLooselyEqualsLoopRhsInt32.ssa_block_1
- and x2, x1, #0x3ffffffffff
+ and x2, x1, #0x7ffffffff
add x2, x2, x24
ldrb w9, [x2, #11]
mov w10, #128
@@ -20396,13 +20396,13 @@ asm_handler_JumpLooselyInequalsLoopRhsInt32_cold:
mov w10, #65530
cmp x9, x10
b.ne .Lasm_JumpLooselyInequalsLoopRhsInt32.ssa_block_1
- and x2, x0, #0x3ffffffffff
+ and x2, x0, #0x7ffffffff
add x2, x2, x24
ldrb w9, [x2, #11]
mov w10, #128
tst x9, x10
b.eq .Lasm_JumpLooselyInequalsLoopRhsInt32.ssa_block_1
- and x2, x1, #0x3ffffffffff
+ and x2, x1, #0x7ffffffff
add x2, x2, x24
ldrb w9, [x2, #11]
mov w10, #128
diff --git a/Libraries/LibJS/Flap/tests/interpreter-assembly/x86_64.S b/Libraries/LibJS/Flap/tests/interpreter-assembly/x86_64.S
index 9e0ffd79027..903f86e7479 100644
--- a/Libraries/LibJS/Flap/tests/interpreter-assembly/x86_64.S
+++ b/Libraries/LibJS/Flap/tests/interpreter-assembly/x86_64.S
@@ -1788,7 +1788,7 @@ asm_handler_JumpIf:
je .Lasm_JumpIf.ssa_block_4
cmp ax, 65529
jne .Lasm_JumpIf.ssa_block_3
- movabs r11, 4398046511103
+ movabs r11, 34359738367
and rcx, r11
add rcx, r15
movzx eax, WORD PTR [rcx + 12]
@@ -1833,7 +1833,7 @@ asm_handler_JumpTrue:
je .Lasm_JumpTrue.ssa_block_3
cmp ax, 65529
jne .Lasm_JumpTrue.ssa_block_2
- movabs r11, 4398046511103
+ movabs r11, 34359738367
and rcx, r11
add rcx, r15
movzx eax, WORD PTR [rcx + 12]
@@ -1882,7 +1882,7 @@ asm_handler_JumpFalse:
je .Lasm_JumpFalse.ssa_block_3
cmp ax, 65529
jne .Lasm_JumpFalse.ssa_block_2
- movabs r11, 4398046511103
+ movabs r11, 34359738367
and rcx, r11
add rcx, r15
movzx eax, WORD PTR [rcx + 12]
@@ -2433,7 +2433,7 @@ asm_handler_JumpIfLoop:
je .Lasm_JumpIfLoop.ssa_block_4
cmp ax, 65529
jne .Lasm_JumpIfLoop.ssa_block_3
- movabs r11, 4398046511103
+ movabs r11, 34359738367
and rcx, r11
add rcx, r15
movzx eax, WORD PTR [rcx + 12]
@@ -2478,7 +2478,7 @@ asm_handler_JumpTrueLoop:
je .Lasm_JumpTrueLoop.ssa_block_3
cmp ax, 65529
jne .Lasm_JumpTrueLoop.ssa_block_2
- movabs r11, 4398046511103
+ movabs r11, 34359738367
and rcx, r11
add rcx, r15
movzx eax, WORD PTR [rcx + 12]
@@ -2527,7 +2527,7 @@ asm_handler_JumpFalseLoop:
je .Lasm_JumpFalseLoop.ssa_block_3
cmp ax, 65529
jne .Lasm_JumpFalseLoop.ssa_block_2
- movabs r11, 4398046511103
+ movabs r11, 34359738367
and rcx, r11
add rcx, r15
movzx eax, WORD PTR [rcx + 12]
@@ -3096,7 +3096,7 @@ asm_handler_Not:
jz .Lasm_Not.ssa_block_1
jmp .Lasm_Not.ssa_block_2
.Lasm_Not.ssa_block_10:
- movabs r11, 4398046511103
+ movabs r11, 34359738367
and rcx, r11
add rcx, r15
movzx eax, WORD PTR [rcx + 12]
@@ -3243,7 +3243,7 @@ asm_handler_GetLexicalEnvironment:
mov rax, QWORD PTR [rbx - 96]
test rax, rax
jz .Lasm_GetLexicalEnvironment.assert_predicate_failure_3
- movabs rcx, 4398046511103
+ movabs rcx, 34359738367
and rax, rcx
movabs rcx, -2251799813685248
or rax, rcx
@@ -3262,7 +3262,7 @@ asm_handler_SetLexicalEnvironment:
shr rcx, 48
cmp cx, 65528
jne .Lasm_SetLexicalEnvironment.assert_predicate_failure_3
- movabs r11, 4398046511103
+ movabs r11, 34359738367
and rax, r11
add rax, r15
mov QWORD PTR [rbx - 96], rax
@@ -4886,7 +4886,7 @@ asm_handler_PutByValue:
shr r11, 48
cmp r11w, 65529
jne .Lasm_PutByValue.ssa_block_1
- movabs r11, 4398046511103
+ movabs r11, 34359738367
and rcx, r11
add rcx, r15
movzx esi, WORD PTR [rcx + 12]
@@ -5167,7 +5167,7 @@ asm_handler_PutByValue:
jne .Lasm_PutByValue.ssa_block_1
cmp QWORD PTR [rax + 48], rdx
jne .Lasm_PutByValue.ssa_block_3
- movabs r11, 4398046511103
+ movabs r11, 34359738367
and rsi, r11
add rsi, r15
mov rcx, QWORD PTR [rsi + 24]
@@ -5209,7 +5209,7 @@ asm_handler_GetById:
shr r11, 48
cmp r11w, 65529
jne .Lasm_GetById.ssa_block_14
- movabs r11, 4398046511103
+ movabs r11, 34359738367
and rsi, r11
add rsi, r15
mov rax, QWORD PTR [rsi + 24]
@@ -5310,7 +5310,7 @@ asm_handler_PutById:
shr r11, 48
cmp r11w, 65529
jne .Lasm_PutById.ssa_block_2
- movabs r11, 4398046511103
+ movabs r11, 34359738367
and rdx, r11
add rdx, r15
mov rcx, QWORD PTR [rdx + 24]
@@ -5371,7 +5371,7 @@ asm_handler_GetByValue:
shr rax, 48
cmp ax, 65529
jne .Lasm_GetByValue.ssa_block_8
- movabs r11, 4398046511103
+ movabs r11, 34359738367
and rsi, r11
add rsi, r15
movzx ecx, WORD PTR [rsi + 12]
@@ -5564,7 +5564,7 @@ asm_handler_GetByValue:
movsxd rax, edx
test eax, eax
js .Lasm_GetByValue.ssa_block_1
- movabs r11, 4398046511103
+ movabs r11, 34359738367
and rsi, r11
add rsi, r15
movzx ecx, BYTE PTR [rsi + 11]
@@ -5634,7 +5634,7 @@ asm_handler_GetByValue:
jz .Lasm_GetByValue.assert_failure_2
mov edi, DWORD PTR [r14 + r13 + 24]
mov rsi, QWORD PTR [rsi + rdi * 8]
- movabs r11, 4398046511103
+ movabs r11, 34359738367
and rcx, r11
add rcx, r15
cmp rsi, 3
@@ -5692,7 +5692,7 @@ asm_handler_GetLength:
shr rax, 48
cmp ax, 65529
jne .Lasm_GetLength.ssa_block_2
- movabs r11, 4398046511103
+ movabs r11, 34359738367
and rcx, r11
add rcx, r15
movzx eax, WORD PTR [rcx + 12]
@@ -5754,7 +5754,7 @@ asm_handler_GetLength:
.Lasm_GetLength.ssa_block_2:
cmp ax, 65530
jne .Lasm_GetLength.ssa_block_1
- movabs r11, 4398046511103
+ movabs r11, 34359738367
and rcx, r11
add rcx, r15
mov eax, DWORD PTR [rcx + 12]
@@ -5974,7 +5974,7 @@ asm_handler_Call:
shr r11, 48
cmp r11w, 65529
jne .Lasm_Call.ssa_block_1
- movabs r11, 4398046511103
+ movabs r11, 34359738367
and rcx, r11
add rcx, r15
movzx eax, WORD PTR [rcx + 12]
@@ -6014,7 +6014,7 @@ asm_handler_Call:
test rdx, rdx
jz .Lasm_Call.assert_failure_3
mov r9, QWORD PTR [rdx + 32]
- movabs rdx, 4398046511103
+ movabs rdx, 34359738367
and r9, rdx
movabs rdx, -1970324836974592
or r9, rdx
@@ -6385,7 +6385,7 @@ asm_handler_ObjectPropertyIteratorNext:
shr r11, 48
cmp r11w, 65529
jne .Lasm_ObjectPropertyIteratorNext.ssa_block_1
- movabs r11, 4398046511103
+ movabs r11, 34359738367
and rcx, r11
add rcx, r15
mov eax, DWORD PTR [r14 + r13 + 16]
@@ -6394,7 +6394,7 @@ asm_handler_ObjectPropertyIteratorNext:
shr rdx, 48
cmp dx, 65528
jne .Lasm_ObjectPropertyIteratorNext.assert_predicate_failure_9
- movabs r11, 4398046511103
+ movabs r11, 34359738367
and rax, r11
add rax, r15
movzx esi, BYTE PTR [rax + 12]
@@ -6526,7 +6526,7 @@ asm_handler_IteratorNextUnpack:
shr r11, 48
cmp r11w, 65529
jne .Lasm_IteratorNextUnpack.ssa_block_1
- movabs r11, 4398046511103
+ movabs r11, 34359738367
and rax, r11
add rax, r15
movzx edi, WORD PTR [rax + 12]
@@ -6588,7 +6588,7 @@ asm_handler_IsCallable:
shr r11, 48
cmp r11w, 65529
jne .Lasm_IsCallable.ssa_block_1
- movabs r11, 4398046511103
+ movabs r11, 34359738367
and rax, r11
add rax, r15
movzx eax, WORD PTR [rax + 12]
@@ -9292,13 +9292,13 @@ asm_handler_JumpLooselyEquals_cold:
cmp si, 65530
jne .Lasm_JumpLooselyEquals.ssa_block_1
mov rax, rcx
- movabs r11, 4398046511103
+ movabs r11, 34359738367
and rax, r11
add rax, r15
test BYTE PTR [rax + 11], 128
jz .Lasm_JumpLooselyEquals.ssa_block_1
mov rax, rdx
- movabs r11, 4398046511103
+ movabs r11, 34359738367
and rax, r11
add rax, r15
test BYTE PTR [rax + 11], 128
@@ -9349,13 +9349,13 @@ asm_handler_JumpLooselyInequals_cold:
cmp si, 65530
jne .Lasm_JumpLooselyInequals.ssa_block_1
mov rax, rcx
- movabs r11, 4398046511103
+ movabs r11, 34359738367
and rax, r11
add rax, r15
test BYTE PTR [rax + 11], 128
jz .Lasm_JumpLooselyInequals.ssa_block_1
mov rax, rdx
- movabs r11, 4398046511103
+ movabs r11, 34359738367
and rax, r11
add rax, r15
test BYTE PTR [rax + 11], 128
@@ -9406,13 +9406,13 @@ asm_handler_JumpStrictlyEquals_cold:
cmp si, 65530
jne .Lasm_JumpStrictlyEquals.ssa_block_1
mov rax, rcx
- movabs r11, 4398046511103
+ movabs r11, 34359738367
and rax, r11
add rax, r15
test BYTE PTR [rax + 11], 128
jz .Lasm_JumpStrictlyEquals.ssa_block_1
mov rax, rdx
- movabs r11, 4398046511103
+ movabs r11, 34359738367
and rax, r11
add rax, r15
test BYTE PTR [rax + 11], 128
@@ -9463,13 +9463,13 @@ asm_handler_JumpStrictlyInequals_cold:
cmp si, 65530
jne .Lasm_JumpStrictlyInequals.ssa_block_1
mov rax, rcx
- movabs r11, 4398046511103
+ movabs r11, 34359738367
and rax, r11
add rax, r15
test BYTE PTR [rax + 11], 128
jz .Lasm_JumpStrictlyInequals.ssa_block_1
mov rax, rdx
- movabs r11, 4398046511103
+ movabs r11, 34359738367
and rax, r11
add rax, r15
test BYTE PTR [rax + 11], 128
@@ -9756,13 +9756,13 @@ asm_handler_JumpLooselyEqualsLoop_cold:
cmp si, 65530
jne .Lasm_JumpLooselyEqualsLoop.ssa_block_1
mov rax, rcx
- movabs r11, 4398046511103
+ movabs r11, 34359738367
and rax, r11
add rax, r15
test BYTE PTR [rax + 11], 128
jz .Lasm_JumpLooselyEqualsLoop.ssa_block_1
mov rax, rdx
- movabs r11, 4398046511103
+ movabs r11, 34359738367
and rax, r11
add rax, r15
test BYTE PTR [rax + 11], 128
@@ -9813,13 +9813,13 @@ asm_handler_JumpLooselyInequalsLoop_cold:
cmp si, 65530
jne .Lasm_JumpLooselyInequalsLoop.ssa_block_1
mov rax, rcx
- movabs r11, 4398046511103
+ movabs r11, 34359738367
and rax, r11
add rax, r15
test BYTE PTR [rax + 11], 128
jz .Lasm_JumpLooselyInequalsLoop.ssa_block_1
mov rax, rdx
- movabs r11, 4398046511103
+ movabs r11, 34359738367
and rax, r11
add rax, r15
test BYTE PTR [rax + 11], 128
@@ -9870,13 +9870,13 @@ asm_handler_JumpStrictlyEqualsLoop_cold:
cmp si, 65530
jne .Lasm_JumpStrictlyEqualsLoop.ssa_block_1
mov rax, rcx
- movabs r11, 4398046511103
+ movabs r11, 34359738367
and rax, r11
add rax, r15
test BYTE PTR [rax + 11], 128
jz .Lasm_JumpStrictlyEqualsLoop.ssa_block_1
mov rax, rdx
- movabs r11, 4398046511103
+ movabs r11, 34359738367
and rax, r11
add rax, r15
test BYTE PTR [rax + 11], 128
@@ -9927,13 +9927,13 @@ asm_handler_JumpStrictlyInequalsLoop_cold:
cmp si, 65530
jne .Lasm_JumpStrictlyInequalsLoop.ssa_block_1
mov rax, rcx
- movabs r11, 4398046511103
+ movabs r11, 34359738367
and rax, r11
add rax, r15
test BYTE PTR [rax + 11], 128
jz .Lasm_JumpStrictlyInequalsLoop.ssa_block_1
mov rax, rdx
- movabs r11, 4398046511103
+ movabs r11, 34359738367
and rax, r11
add rax, r15
test BYTE PTR [rax + 11], 128
@@ -12840,13 +12840,13 @@ asm_handler_StrictlyEquals_cold:
cmp si, 65530
jne .Lasm_StrictlyEquals.ssa_block_1
mov rax, rcx
- movabs r11, 4398046511103
+ movabs r11, 34359738367
and rax, r11
add rax, r15
test BYTE PTR [rax + 11], 128
jz .Lasm_StrictlyEquals.ssa_block_1
mov rax, rdx
- movabs r11, 4398046511103
+ movabs r11, 34359738367
and rax, r11
add rax, r15
test BYTE PTR [rax + 11], 128
@@ -12908,13 +12908,13 @@ asm_handler_StrictlyInequals_cold:
cmp si, 65530
jne .Lasm_StrictlyInequals.ssa_block_1
mov rax, rcx
- movabs r11, 4398046511103
+ movabs r11, 34359738367
and rax, r11
add rax, r15
test BYTE PTR [rax + 11], 128
jz .Lasm_StrictlyInequals.ssa_block_1
mov rax, rdx
- movabs r11, 4398046511103
+ movabs r11, 34359738367
and rax, r11
add rax, r15
test BYTE PTR [rax + 11], 128
@@ -13074,13 +13074,13 @@ asm_handler_LooselyEquals_cold:
cmp si, 65530
jne .Lasm_LooselyEquals.ssa_block_1
mov rax, rcx
- movabs r11, 4398046511103
+ movabs r11, 34359738367
and rax, r11
add rax, r15
test BYTE PTR [rax + 11], 128
jz .Lasm_LooselyEquals.ssa_block_1
mov rax, rdx
- movabs r11, 4398046511103
+ movabs r11, 34359738367
and rax, r11
add rax, r15
test BYTE PTR [rax + 11], 128
@@ -13142,13 +13142,13 @@ asm_handler_LooselyInequals_cold:
cmp si, 65530
jne .Lasm_LooselyInequals.ssa_block_1
mov rax, rcx
- movabs r11, 4398046511103
+ movabs r11, 34359738367
and rax, r11
add rax, r15
test BYTE PTR [rax + 11], 128
jz .Lasm_LooselyInequals.ssa_block_1
mov rax, rdx
- movabs r11, 4398046511103
+ movabs r11, 34359738367
and rax, r11
add rax, r15
test BYTE PTR [rax + 11], 128
@@ -13651,7 +13651,7 @@ asm_handler_GetById_cold:
movzx ecx, WORD PTR [rax + 12]
test ecx, 2048
jnz .Lasm_GetById.ssa_block_3
- movabs rcx, 4398046511103
+ movabs rcx, 34359738367
and rax, rcx
movabs rcx, -1970324836974592
or rax, rcx
@@ -13716,7 +13716,7 @@ asm_handler_GetById_cold:
mov QWORD PTR [rax + 40], rdi
mov rcx, QWORD PTR [rbx - 80]
mov QWORD PTR [rax + 48], rcx
- movabs rcx, 4398046511103
+ movabs rcx, 34359738367
and rsi, rcx
movabs rcx, -1970324836974592
or rsi, rcx
@@ -13825,7 +13825,7 @@ asm_handler_GetById_cold:
jz .Lasm_GetById.ssa_block_1
jmp .Lasm_GetById.ssa_block_16
.Lasm_GetById.ssa_block_17:
- movabs r11, 4398046511103
+ movabs r11, 34359738367
and rax, r11
add rax, r15
mov rcx, QWORD PTR [rax + 16]
@@ -14173,7 +14173,7 @@ asm_handler_PutByIdWithThis_cold_end:
asm_handler_GetByValue_cold:
# Cold paths for GetByValue
.Lasm_GetByValue.ssa_block_37:
- movabs r11, 4398046511103
+ movabs r11, 34359738367
and rax, r11
add rax, r15
mov rsi, QWORD PTR [rax + 16]
@@ -18954,13 +18954,13 @@ asm_handler_StrictlyEqualsRhsInt32_cold:
cmp r11w, 65530
jne .Lasm_StrictlyEqualsRhsInt32.ssa_block_1
mov rax, rcx
- movabs r11, 4398046511103
+ movabs r11, 34359738367
and rax, r11
add rax, r15
test BYTE PTR [rax + 11], 128
jz .Lasm_StrictlyEqualsRhsInt32.ssa_block_1
mov rax, rdx
- movabs r11, 4398046511103
+ movabs r11, 34359738367
and rax, r11
add rax, r15
test BYTE PTR [rax + 11], 128
@@ -19026,13 +19026,13 @@ asm_handler_StrictlyInequalsRhsInt32_cold:
cmp r11w, 65530
jne .Lasm_StrictlyInequalsRhsInt32.ssa_block_1
mov rax, rcx
- movabs r11, 4398046511103
+ movabs r11, 34359738367
and rax, r11
add rax, r15
test BYTE PTR [rax + 11], 128
jz .Lasm_StrictlyInequalsRhsInt32.ssa_block_1
mov rax, rdx
- movabs r11, 4398046511103
+ movabs r11, 34359738367
and rax, r11
add rax, r15
test BYTE PTR [rax + 11], 128
@@ -19098,13 +19098,13 @@ asm_handler_LooselyEqualsRhsInt32_cold:
cmp r11w, 65530
jne .Lasm_LooselyEqualsRhsInt32.ssa_block_1
mov rax, rcx
- movabs r11, 4398046511103
+ movabs r11, 34359738367
and rax, r11
add rax, r15
test BYTE PTR [rax + 11], 128
jz .Lasm_LooselyEqualsRhsInt32.ssa_block_1
mov rax, rdx
- movabs r11, 4398046511103
+ movabs r11, 34359738367
and rax, r11
add rax, r15
test BYTE PTR [rax + 11], 128
@@ -19170,13 +19170,13 @@ asm_handler_LooselyInequalsRhsInt32_cold:
cmp r11w, 65530
jne .Lasm_LooselyInequalsRhsInt32.ssa_block_1
mov rax, rcx
- movabs r11, 4398046511103
+ movabs r11, 34359738367
and rax, r11
add rax, r15
test BYTE PTR [rax + 11], 128
jz .Lasm_LooselyInequalsRhsInt32.ssa_block_1
mov rax, rdx
- movabs r11, 4398046511103
+ movabs r11, 34359738367
and rax, r11
add rax, r15
test BYTE PTR [rax + 11], 128
@@ -19242,13 +19242,13 @@ asm_handler_JumpStrictlyEqualsRhsInt32_cold:
cmp r11w, 65530
jne .Lasm_JumpStrictlyEqualsRhsInt32.ssa_block_1
mov rax, rcx
- movabs r11, 4398046511103
+ movabs r11, 34359738367
and rax, r11
add rax, r15
test BYTE PTR [rax + 11], 128
jz .Lasm_JumpStrictlyEqualsRhsInt32.ssa_block_1
mov rax, rdx
- movabs r11, 4398046511103
+ movabs r11, 34359738367
and rax, r11
add rax, r15
test BYTE PTR [rax + 11], 128
@@ -19303,13 +19303,13 @@ asm_handler_JumpStrictlyInequalsRhsInt32_cold:
cmp r11w, 65530
jne .Lasm_JumpStrictlyInequalsRhsInt32.ssa_block_1
mov rax, rcx
- movabs r11, 4398046511103
+ movabs r11, 34359738367
and rax, r11
add rax, r15
test BYTE PTR [rax + 11], 128
jz .Lasm_JumpStrictlyInequalsRhsInt32.ssa_block_1
mov rax, rdx
- movabs r11, 4398046511103
+ movabs r11, 34359738367
and rax, r11
add rax, r15
test BYTE PTR [rax + 11], 128
@@ -19364,13 +19364,13 @@ asm_handler_JumpLooselyEqualsRhsInt32_cold:
cmp r11w, 65530
jne .Lasm_JumpLooselyEqualsRhsInt32.ssa_block_1
mov rax, rcx
- movabs r11, 4398046511103
+ movabs r11, 34359738367
and rax, r11
add rax, r15
test BYTE PTR [rax + 11], 128
jz .Lasm_JumpLooselyEqualsRhsInt32.ssa_block_1
mov rax, rdx
- movabs r11, 4398046511103
+ movabs r11, 34359738367
and rax, r11
add rax, r15
test BYTE PTR [rax + 11], 128
@@ -19425,13 +19425,13 @@ asm_handler_JumpLooselyInequalsRhsInt32_cold:
cmp r11w, 65530
jne .Lasm_JumpLooselyInequalsRhsInt32.ssa_block_1
mov rax, rcx
- movabs r11, 4398046511103
+ movabs r11, 34359738367
and rax, r11
add rax, r15
test BYTE PTR [rax + 11], 128
jz .Lasm_JumpLooselyInequalsRhsInt32.ssa_block_1
mov rax, rdx
- movabs r11, 4398046511103
+ movabs r11, 34359738367
and rax, r11
add rax, r15
test BYTE PTR [rax + 11], 128
@@ -19666,13 +19666,13 @@ asm_handler_JumpStrictlyEqualsLoopRhsInt32_cold:
cmp r11w, 65530
jne .Lasm_JumpStrictlyEqualsLoopRhsInt32.ssa_block_1
mov rax, rcx
- movabs r11, 4398046511103
+ movabs r11, 34359738367
and rax, r11
add rax, r15
test BYTE PTR [rax + 11], 128
jz .Lasm_JumpStrictlyEqualsLoopRhsInt32.ssa_block_1
mov rax, rdx
- movabs r11, 4398046511103
+ movabs r11, 34359738367
and rax, r11
add rax, r15
test BYTE PTR [rax + 11], 128
@@ -19727,13 +19727,13 @@ asm_handler_JumpStrictlyInequalsLoopRhsInt32_cold:
cmp r11w, 65530
jne .Lasm_JumpStrictlyInequalsLoopRhsInt32.ssa_block_1
mov rax, rcx
- movabs r11, 4398046511103
+ movabs r11, 34359738367
and rax, r11
add rax, r15
test BYTE PTR [rax + 11], 128
jz .Lasm_JumpStrictlyInequalsLoopRhsInt32.ssa_block_1
mov rax, rdx
- movabs r11, 4398046511103
+ movabs r11, 34359738367
and rax, r11
add rax, r15
test BYTE PTR [rax + 11], 128
@@ -19788,13 +19788,13 @@ asm_handler_JumpLooselyEqualsLoopRhsInt32_cold:
cmp r11w, 65530
jne .Lasm_JumpLooselyEqualsLoopRhsInt32.ssa_block_1
mov rax, rcx
- movabs r11, 4398046511103
+ movabs r11, 34359738367
and rax, r11
add rax, r15
test BYTE PTR [rax + 11], 128
jz .Lasm_JumpLooselyEqualsLoopRhsInt32.ssa_block_1
mov rax, rdx
- movabs r11, 4398046511103
+ movabs r11, 34359738367
and rax, r11
add rax, r15
test BYTE PTR [rax + 11], 128
@@ -19849,13 +19849,13 @@ asm_handler_JumpLooselyInequalsLoopRhsInt32_cold:
cmp r11w, 65530
jne .Lasm_JumpLooselyInequalsLoopRhsInt32.ssa_block_1
mov rax, rcx
- movabs r11, 4398046511103
+ movabs r11, 34359738367
and rax, r11
add rax, r15
test BYTE PTR [rax + 11], 128
jz .Lasm_JumpLooselyInequalsLoopRhsInt32.ssa_block_1
mov rax, rdx
- movabs r11, 4398046511103
+ movabs r11, 34359738367
and rax, r11
add rax, r15
test BYTE PTR [rax + 11], 128
diff --git a/Libraries/LibJS/Flap/tests/interpreter-layout.conf b/Libraries/LibJS/Flap/tests/interpreter-layout.conf
index e1701c1b195..7fa4ee26595 100644
--- a/Libraries/LibJS/Flap/tests/interpreter-layout.conf
+++ b/Libraries/LibJS/Flap/tests/interpreter-layout.conf
@@ -476,7 +476,7 @@ field Object.typed_array_cached_data_offset u64 TYPED_ARRAY_CACHED_DATA_OFFSET n
const TYPED_ARRAY_CACHED_DATA_OFFSET_INVALID = 0xFFFFFFFFFFFFFFFF
const PRIMITIVE_STORAGE_CAGE_OFFSET_MASK = 0x3FFFFFFFFFF
const PRIMITIVE_STORAGE_CAGE_OFFSET_SHIFT = 22
-const HEAP_REGION_OFFSET_MASK = 0x3FFFFFFFFFF
+const HEAP_REGION_OFFSET_MASK = 0x7FFFFFFFF
# ByteLength layout
const BYTE_LENGTH_U32_INDEX = 2
diff --git a/Libraries/LibJS/Rust/build.rs b/Libraries/LibJS/Rust/build.rs
index 873b1f5c840..a594d911a0b 100644
--- a/Libraries/LibJS/Rust/build.rs
+++ b/Libraries/LibJS/Rust/build.rs
@@ -98,17 +98,8 @@ fn target() -> Target {
}
}
-/// Mirrors GC::HEAP_REGION_SIZE in Libraries/LibGC/HeapRegion.h, whose choice depends on the target and on whether
-/// LibGC is built with ThreadSanitizer, which Rust's own cfg cannot see.
-fn heap_region_size(target: &Target, thread_sanitizer: bool) -> u64 {
- let os = env::var("CARGO_CFG_TARGET_OS").expect("CARGO_CFG_TARGET_OS");
- let address_space_is_small = matches!(target.architecture, flapc::Architecture::Aarch64) && os != "macos";
- if address_space_is_small || thread_sanitizer {
- 128 * GIB
- } else {
- 4 * TIB
- }
-}
+/// Mirrors GC::HEAP_REGION_SIZE in Libraries/LibGC/HeapRegion.h.
+const HEAP_REGION_SIZE: u64 = 32 * GIB;
/// The 64-bit FNV-1a hash of `bytes`, which stays the same from build to build, unlike std's hashers.
fn fnv1a_64(bytes: &[u8]) -> u64 {
@@ -149,9 +140,8 @@ fn main() {
let target = target();
let address_sanitizer = env::var_os("CARGO_FEATURE_ADDRESS_SANITIZER").is_some();
- let thread_sanitizer = env::var_os("CARGO_FEATURE_THREAD_SANITIZER").is_some();
let configuration = layout_table::LayoutConfiguration {
- heap_region_offset_mask: heap_region_size(&target, thread_sanitizer) - 1,
+ heap_region_offset_mask: HEAP_REGION_SIZE - 1,
// Mirrors GC::PrimitiveStorage::default_cage_size.
primitive_storage_cage_offset_mask: 4 * TIB - 1,
// Instrumented frames need more room before the stack is considered exhausted.
diff --git a/Tests/LibGC/TestNanBoxedValue.cpp b/Tests/LibGC/TestNanBoxedValue.cpp
index 986fe8bbb91..398c31cc618 100644
--- a/Tests/LibGC/TestNanBoxedValue.cpp
+++ b/Tests/LibGC/TestNanBoxedValue.cpp
@@ -37,6 +37,9 @@ TEST_SETUP
GC::Heap::set_default_heap_for_testing(test_heap());
}
+// Every payload bit above the heap region offset.
+static constexpr u64 JUNK_PAYLOAD_BITS = 0x0000'ffff'ffff'ffffULL & ~static_cast<u64>(GC::HEAP_REGION_OFFSET_MASK);
+
class TestNanBox final : public GC::NanBoxedValue {
public:
static TestNanBox from_payload(u64 payload)
@@ -65,7 +68,7 @@ TEST_CASE(cell_payload_masks_junk_high_bits)
{
auto cell = test_heap().allocate<TestCell>();
auto offset = GC::NanBoxedValue::encode_pointer_bits(cell.ptr());
- auto value = TestNanBox::from_payload(offset | 0x0000'fc00'0000'0000ULL);
+ auto value = TestNanBox::from_payload(offset | JUNK_PAYLOAD_BITS);
auto decoded = value.extract_pointer<GC::Cell>();
auto base = js_heap_region_base;
@@ -85,7 +88,7 @@ TEST_CASE(conservative_scanner_decodes_caged_value)
weak_cell = cell.ptr();
boxed_value = GC::SHIFTED_IS_CELL_PATTERN
| GC::NanBoxedValue::encode_pointer_bits(cell.ptr())
- | 0x0000'fc00'0000'0000ULL;
+ | JUNK_PAYLOAD_BITS;
EXPECT(boxed_value != 0);
}