Commit 638efefb authored by Igor Sheludko's avatar Igor Sheludko Committed by V8 LUCI CQ

[ext-code-space] Use IsCodeSpaceObject(obj) predicate in DCHECKs

... instead of obj.IsCode() because it's not safe to use the latter
during GC which might have already moved the object.

Bug: v8:11880, chromium:1292688
Change-Id: Idbe973c0b1919a79c6aa66a8f490d952266aa66d
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3429209
Auto-Submit: Igor Sheludko <ishell@chromium.org>
Reviewed-by: 's avatarJakob Gruber <jgruber@chromium.org>
Commit-Queue: Igor Sheludko <ishell@chromium.org>
Cr-Commit-Position: refs/heads/main@{#78898}
parent 7d6deeb9
...@@ -666,7 +666,8 @@ HeapObject RelocInfo::target_object(PtrComprCageBase cage_base) { ...@@ -666,7 +666,8 @@ HeapObject RelocInfo::target_object(PtrComprCageBase cage_base) {
Object obj(DecompressTaggedPointer(cage_base, compressed)); Object obj(DecompressTaggedPointer(cage_base, compressed));
// Embedding of compressed Code objects must not happen when external code // Embedding of compressed Code objects must not happen when external code
// space is enabled, because CodeDataContainers must be used instead. // space is enabled, because CodeDataContainers must be used instead.
DCHECK_IMPLIES(V8_EXTERNAL_CODE_SPACE_BOOL, !obj.IsCode(cage_base)); DCHECK_IMPLIES(V8_EXTERNAL_CODE_SPACE_BOOL,
!IsCodeSpaceObject(HeapObject::cast(obj)));
return HeapObject::cast(obj); return HeapObject::cast(obj);
} else { } else {
return HeapObject::cast( return HeapObject::cast(
......
...@@ -322,7 +322,8 @@ HeapObject RelocInfo::target_object(PtrComprCageBase cage_base) { ...@@ -322,7 +322,8 @@ HeapObject RelocInfo::target_object(PtrComprCageBase cage_base) {
Object obj(DecompressTaggedPointer(cage_base, compressed)); Object obj(DecompressTaggedPointer(cage_base, compressed));
// Embedding of compressed Code objects must not happen when external code // Embedding of compressed Code objects must not happen when external code
// space is enabled, because CodeDataContainers must be used instead. // space is enabled, because CodeDataContainers must be used instead.
DCHECK_IMPLIES(V8_EXTERNAL_CODE_SPACE_BOOL, !obj.IsCode(cage_base)); DCHECK_IMPLIES(V8_EXTERNAL_CODE_SPACE_BOOL,
!IsCodeSpaceObject(HeapObject::cast(obj)));
return HeapObject::cast(obj); return HeapObject::cast(obj);
} }
DCHECK(IsFullEmbeddedObject(rmode_) || IsDataEmbeddedObject(rmode_)); DCHECK(IsFullEmbeddedObject(rmode_) || IsDataEmbeddedObject(rmode_));
......
...@@ -727,7 +727,7 @@ HeapObject MapWord::ToForwardingAddress() { ...@@ -727,7 +727,7 @@ HeapObject MapWord::ToForwardingAddress() {
HeapObject obj = HeapObject::FromAddress(value_); HeapObject obj = HeapObject::FromAddress(value_);
// For objects allocated outside of the main pointer compression cage the // For objects allocated outside of the main pointer compression cage the
// variant with explicit cage base must be used. // variant with explicit cage base must be used.
DCHECK_IMPLIES(V8_EXTERNAL_CODE_SPACE_BOOL, !obj.IsCode()); DCHECK_IMPLIES(V8_EXTERNAL_CODE_SPACE_BOOL, !IsCodeSpaceObject(obj));
return obj; return obj;
} }
......
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