[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: Jakob Gruber <jgruber@chromium.org>
Cr-Commit-Position: refs/heads/master@{#74805}
This commit is contained in:
Wenyu Zhao 2021-05-27 16:28:09 +10:00 committed by V8 LUCI CQ
parent 2f97241650
commit 2243a8632b
2 changed files with 5 additions and 1 deletions

View File

@ -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);

View File

@ -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));
}