Commit 2243a863 authored by Wenyu Zhao's avatar Wenyu Zhao Committed by V8 LUCI CQ

[heap] Fix third-party-heap PageFromAddress check in CSA

Use compile-time DCHECK instead of Unreachable().

GenerateRecordWrite is disabled to prevent the use of PageFromAddress
when TPH is enabled.

Another user of PageFromAddress is TrapAllocationMemento, this will
be disabled in https://chromium-review.googlesource.com/c/v8/v8/+/2897326.

Bug: v8:11641
Change-Id: I1393d5ad52695a79750be00f2205648458f9c79d
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2909216
Commit-Queue: Wenyu Zhao <wenyu.zhao@anu.edu.au>
Reviewed-by: 's avatarJakob Gruber <jgruber@chromium.org>
Cr-Commit-Position: refs/heads/master@{#74805}
parent 2f972416
......@@ -345,6 +345,10 @@ class WriteBarrierCodeStubAssembler : public CodeStubAssembler {
void GenerateRecordWrite(RememberedSetAction rs_mode,
SaveFPRegsMode fp_mode) {
if (V8_DISABLE_WRITE_BARRIERS_BOOL) {
Return(TrueConstant());
return;
}
switch (rs_mode) {
case RememberedSetAction::kEmit:
GenerationalWriteBarrier(fp_mode);
......
......@@ -11236,7 +11236,7 @@ void CodeStubAssembler::TrapAllocationMemento(TNode<JSObject> object,
}
TNode<IntPtrT> CodeStubAssembler::PageFromAddress(TNode<IntPtrT> address) {
if (FLAG_enable_third_party_heap) Unreachable();
DCHECK(!V8_ENABLE_THIRD_PARTY_HEAP_BOOL);
return WordAnd(address, IntPtrConstant(~kPageAlignmentMask));
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment