Remove unused RelocInfo::Mode::DATA_EMBEDDED_OBJECT

The last use was removed in this CLs:
https://chromium-review.googlesource.com/c/v8/v8/+/3401585/

Bug: v8:12552, v8:13312
Change-Id: I72c639957ed3b1c2491eb43a54a54b8a96977b6f
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3905188
Reviewed-by: Dominik Inführ <dinfuehr@chromium.org>
Commit-Queue: Stephen Röttger <sroettger@google.com>
Reviewed-by: Igor Sheludko <ishell@chromium.org>
Cr-Commit-Position: refs/heads/main@{#83349}
This commit is contained in:
Stephen Roettger 2022-09-20 13:47:33 +02:00 committed by V8 LUCI CQ
parent 6a4ad69c64
commit d185bacc94
28 changed files with 61 additions and 183 deletions

View File

@ -91,11 +91,7 @@ Address RelocInfo::constant_pool_entry_address() {
int RelocInfo::target_address_size() { return kPointerSize; }
HeapObject RelocInfo::target_object(PtrComprCageBase cage_base) {
DCHECK(IsCodeTarget(rmode_) || IsFullEmbeddedObject(rmode_) ||
IsDataEmbeddedObject(rmode_));
if (IsDataEmbeddedObject(rmode_)) {
return HeapObject::cast(Object(ReadUnalignedValue<Address>(pc_)));
}
DCHECK(IsCodeTarget(rmode_) || IsFullEmbeddedObject(rmode_));
return HeapObject::cast(
Object(Assembler::target_address_at(pc_, constant_pool_)));
}
@ -104,8 +100,6 @@ Handle<HeapObject> RelocInfo::target_object_handle(Assembler* origin) {
if (IsCodeTarget(rmode_) || IsFullEmbeddedObject(rmode_)) {
return Handle<HeapObject>(reinterpret_cast<Address*>(
Assembler::target_address_at(pc_, constant_pool_)));
} else if (IsDataEmbeddedObject(rmode_)) {
return Handle<HeapObject>::cast(ReadUnalignedValue<Handle<Object>>(pc_));
}
DCHECK(IsRelativeCodeTarget(rmode_));
return origin->relative_code_target_object_handle_at(pc_);
@ -114,15 +108,9 @@ Handle<HeapObject> RelocInfo::target_object_handle(Assembler* origin) {
void RelocInfo::set_target_object(Heap* heap, HeapObject target,
WriteBarrierMode write_barrier_mode,
ICacheFlushMode icache_flush_mode) {
DCHECK(IsCodeTarget(rmode_) || IsFullEmbeddedObject(rmode_) ||
IsDataEmbeddedObject(rmode_));
if (IsDataEmbeddedObject(rmode_)) {
WriteUnalignedValue(pc_, target.ptr());
// No need to flush icache since no instructions were changed.
} else {
Assembler::set_target_address_at(pc_, constant_pool_, target.ptr(),
icache_flush_mode);
}
DCHECK(IsCodeTarget(rmode_) || IsFullEmbeddedObject(rmode_));
Assembler::set_target_address_at(pc_, constant_pool_, target.ptr(),
icache_flush_mode);
if (!host().is_null() && !v8_flags.disable_write_barriers) {
WriteBarrierForCode(host(), this, target, write_barrier_mode);
}

View File

@ -5218,8 +5218,7 @@ void Assembler::dd(uint32_t data, RelocInfo::Mode rmode) {
DCHECK(is_const_pool_blocked() || pending_32_bit_constants_.empty());
CheckBuffer();
if (!RelocInfo::IsNoInfo(rmode)) {
DCHECK(RelocInfo::IsDataEmbeddedObject(rmode) ||
RelocInfo::IsLiteralConstant(rmode));
DCHECK(RelocInfo::IsLiteralConstant(rmode));
RecordRelocInfo(rmode);
}
base::WriteUnalignedValue(reinterpret_cast<Address>(pc_), data);
@ -5232,8 +5231,7 @@ void Assembler::dq(uint64_t value, RelocInfo::Mode rmode) {
DCHECK(is_const_pool_blocked() || pending_32_bit_constants_.empty());
CheckBuffer();
if (!RelocInfo::IsNoInfo(rmode)) {
DCHECK(RelocInfo::IsDataEmbeddedObject(rmode) ||
RelocInfo::IsLiteralConstant(rmode));
DCHECK(RelocInfo::IsLiteralConstant(rmode));
RecordRelocInfo(rmode);
}
base::WriteUnalignedValue(reinterpret_cast<Address>(pc_), value);

View File

@ -655,9 +655,7 @@ Address RelocInfo::constant_pool_entry_address() {
HeapObject RelocInfo::target_object(PtrComprCageBase cage_base) {
DCHECK(IsCodeTarget(rmode_) || IsEmbeddedObjectMode(rmode_));
if (IsDataEmbeddedObject(rmode_)) {
return HeapObject::cast(Object(ReadUnalignedValue<Address>(pc_)));
} else if (IsCompressedEmbeddedObject(rmode_)) {
if (IsCompressedEmbeddedObject(rmode_)) {
Tagged_t compressed =
Assembler::target_compressed_address_at(pc_, constant_pool_);
DCHECK(!HAS_SMI_TAG(compressed));
@ -675,9 +673,7 @@ HeapObject RelocInfo::target_object(PtrComprCageBase cage_base) {
}
Handle<HeapObject> RelocInfo::target_object_handle(Assembler* origin) {
if (IsDataEmbeddedObject(rmode_)) {
return Handle<HeapObject>::cast(ReadUnalignedValue<Handle<Object>>(pc_));
} else if (IsEmbeddedObjectMode(rmode_)) {
if (IsEmbeddedObjectMode(rmode_)) {
return origin->target_object_handle_at(pc_);
} else {
DCHECK(IsCodeTarget(rmode_));
@ -689,10 +685,7 @@ void RelocInfo::set_target_object(Heap* heap, HeapObject target,
WriteBarrierMode write_barrier_mode,
ICacheFlushMode icache_flush_mode) {
DCHECK(IsCodeTarget(rmode_) || IsEmbeddedObjectMode(rmode_));
if (IsDataEmbeddedObject(rmode_)) {
WriteUnalignedValue(pc_, target.ptr());
// No need to flush icache since no instructions were changed.
} else if (IsCompressedEmbeddedObject(rmode_)) {
if (IsCompressedEmbeddedObject(rmode_)) {
Assembler::set_target_compressed_address_at(
pc_, constant_pool_,
V8HeapCompressionScheme::CompressTagged(target.ptr()),

View File

@ -4305,7 +4305,6 @@ void Assembler::GrowBuffer() {
void Assembler::RecordRelocInfo(RelocInfo::Mode rmode, intptr_t data,
ConstantPoolMode constant_pool_mode) {
if ((rmode == RelocInfo::INTERNAL_REFERENCE) ||
(rmode == RelocInfo::DATA_EMBEDDED_OBJECT) ||
(rmode == RelocInfo::CONST_POOL) || (rmode == RelocInfo::VENEER_POOL) ||
(rmode == RelocInfo::DEOPT_SCRIPT_OFFSET) ||
(rmode == RelocInfo::DEOPT_INLINING_ID) ||
@ -4317,7 +4316,6 @@ void Assembler::RecordRelocInfo(RelocInfo::Mode rmode, intptr_t data,
RelocInfo::IsDeoptNodeId(rmode) ||
RelocInfo::IsDeoptPosition(rmode) ||
RelocInfo::IsInternalReference(rmode) ||
RelocInfo::IsDataEmbeddedObject(rmode) ||
RelocInfo::IsLiteralConstant(rmode) ||
RelocInfo::IsConstPool(rmode) || RelocInfo::IsVeneerPool(rmode));
// These modes do not need an entry in the constant pool.

View File

@ -2062,8 +2062,7 @@ class V8_EXPORT_PRIVATE Assembler : public AssemblerBase {
void dd(uint32_t data, RelocInfo::Mode rmode = RelocInfo::NO_INFO) {
BlockPoolsScope no_pool_scope(this);
if (!RelocInfo::IsNoInfo(rmode)) {
DCHECK(RelocInfo::IsDataEmbeddedObject(rmode) ||
RelocInfo::IsLiteralConstant(rmode));
DCHECK(RelocInfo::IsLiteralConstant(rmode));
RecordRelocInfo(rmode);
}
dc32(data);
@ -2071,8 +2070,7 @@ class V8_EXPORT_PRIVATE Assembler : public AssemblerBase {
void dq(uint64_t data, RelocInfo::Mode rmode = RelocInfo::NO_INFO) {
BlockPoolsScope no_pool_scope(this);
if (!RelocInfo::IsNoInfo(rmode)) {
DCHECK(RelocInfo::IsDataEmbeddedObject(rmode) ||
RelocInfo::IsLiteralConstant(rmode));
DCHECK(RelocInfo::IsLiteralConstant(rmode));
RecordRelocInfo(rmode);
}
dc64(data);
@ -2080,8 +2078,7 @@ class V8_EXPORT_PRIVATE Assembler : public AssemblerBase {
void dp(uintptr_t data, RelocInfo::Mode rmode = RelocInfo::NO_INFO) {
BlockPoolsScope no_pool_scope(this);
if (!RelocInfo::IsNoInfo(rmode)) {
DCHECK(RelocInfo::IsDataEmbeddedObject(rmode) ||
RelocInfo::IsLiteralConstant(rmode));
DCHECK(RelocInfo::IsLiteralConstant(rmode));
RecordRelocInfo(rmode);
}
dc64(data);

View File

@ -79,22 +79,19 @@ Address RelocInfo::constant_pool_entry_address() { UNREACHABLE(); }
int RelocInfo::target_address_size() { return Assembler::kSpecialTargetSize; }
HeapObject RelocInfo::target_object(PtrComprCageBase cage_base) {
DCHECK(IsCodeTarget(rmode_) || IsFullEmbeddedObject(rmode_) ||
IsDataEmbeddedObject(rmode_));
DCHECK(IsCodeTarget(rmode_) || IsFullEmbeddedObject(rmode_));
return HeapObject::cast(Object(ReadUnalignedValue<Address>(pc_)));
}
Handle<HeapObject> RelocInfo::target_object_handle(Assembler* origin) {
DCHECK(IsCodeTarget(rmode_) || IsFullEmbeddedObject(rmode_) ||
IsDataEmbeddedObject(rmode_));
DCHECK(IsCodeTarget(rmode_) || IsFullEmbeddedObject(rmode_));
return Handle<HeapObject>::cast(ReadUnalignedValue<Handle<Object>>(pc_));
}
void RelocInfo::set_target_object(Heap* heap, HeapObject target,
WriteBarrierMode write_barrier_mode,
ICacheFlushMode icache_flush_mode) {
DCHECK(IsCodeTarget(rmode_) || IsFullEmbeddedObject(rmode_) ||
IsDataEmbeddedObject(rmode_));
DCHECK(IsCodeTarget(rmode_) || IsFullEmbeddedObject(rmode_));
WriteUnalignedValue(pc_, target.ptr());
if (icache_flush_mode != SKIP_ICACHE_FLUSH) {
FlushInstructionCache(pc_, sizeof(Address));

View File

@ -3386,8 +3386,7 @@ void Assembler::db(uint8_t data) {
void Assembler::dd(uint32_t data, RelocInfo::Mode rmode) {
EnsureSpace ensure_space(this);
if (!RelocInfo::IsNoInfo(rmode)) {
DCHECK(RelocInfo::IsDataEmbeddedObject(rmode) ||
RelocInfo::IsLiteralConstant(rmode));
DCHECK(RelocInfo::IsLiteralConstant(rmode));
RecordRelocInfo(rmode);
}
emit(data);
@ -3395,10 +3394,7 @@ void Assembler::dd(uint32_t data, RelocInfo::Mode rmode) {
void Assembler::dq(uint64_t data, RelocInfo::Mode rmode) {
EnsureSpace ensure_space(this);
if (!RelocInfo::IsNoInfo(rmode)) {
DCHECK(RelocInfo::IsDataEmbeddedObject(rmode));
RecordRelocInfo(rmode);
}
DCHECK(RelocInfo::IsNoInfo(rmode));
emit_q(data);
}

View File

@ -87,19 +87,13 @@ void Assembler::deserialization_set_target_internal_reference_at(
}
HeapObject RelocInfo::target_object(PtrComprCageBase cage_base) {
DCHECK(IsCodeTarget(rmode_) || IsFullEmbeddedObject(rmode_) ||
IsDataEmbeddedObject(rmode_));
if (IsDataEmbeddedObject(rmode_)) {
return HeapObject::cast(Object(ReadUnalignedValue<Address>(pc_)));
}
DCHECK(IsCodeTarget(rmode_) || IsFullEmbeddedObject(rmode_));
return HeapObject::cast(
Object(Assembler::target_address_at(pc_, constant_pool_)));
}
Handle<HeapObject> RelocInfo::target_object_handle(Assembler* origin) {
if (IsDataEmbeddedObject(rmode_)) {
return Handle<HeapObject>::cast(ReadUnalignedValue<Handle<Object>>(pc_));
} else if (IsCodeTarget(rmode_) || IsFullEmbeddedObject(rmode_)) {
if (IsCodeTarget(rmode_) || IsFullEmbeddedObject(rmode_)) {
return Handle<HeapObject>(reinterpret_cast<Address*>(
Assembler::target_address_at(pc_, constant_pool_)));
} else {
@ -111,15 +105,9 @@ Handle<HeapObject> RelocInfo::target_object_handle(Assembler* origin) {
void RelocInfo::set_target_object(Heap* heap, HeapObject target,
WriteBarrierMode write_barrier_mode,
ICacheFlushMode icache_flush_mode) {
DCHECK(IsCodeTarget(rmode_) || IsFullEmbeddedObject(rmode_) ||
IsDataEmbeddedObject(rmode_));
if (IsDataEmbeddedObject(rmode_)) {
WriteUnalignedValue(pc_, target.ptr());
// No need to flush icache since no instructions were changed.
} else {
Assembler::set_target_address_at(pc_, constant_pool_, target.ptr(),
icache_flush_mode);
}
DCHECK(IsCodeTarget(rmode_) || IsFullEmbeddedObject(rmode_));
Assembler::set_target_address_at(pc_, constant_pool_, target.ptr(),
icache_flush_mode);
if (!host().is_null() && !v8_flags.disable_write_barriers) {
WriteBarrierForCode(host(), this, target, write_barrier_mode);
}

View File

@ -2154,8 +2154,7 @@ void Assembler::dd(uint32_t data, RelocInfo::Mode rmode) {
CheckBuffer();
}
if (!RelocInfo::IsNoInfo(rmode)) {
DCHECK(RelocInfo::IsDataEmbeddedObject(rmode) ||
RelocInfo::IsLiteralConstant(rmode));
DCHECK(RelocInfo::IsLiteralConstant(rmode));
RecordRelocInfo(rmode);
}
*reinterpret_cast<uint32_t*>(pc_) = data;
@ -2167,8 +2166,7 @@ void Assembler::dq(uint64_t data, RelocInfo::Mode rmode) {
CheckBuffer();
}
if (!RelocInfo::IsNoInfo(rmode)) {
DCHECK(RelocInfo::IsDataEmbeddedObject(rmode) ||
RelocInfo::IsLiteralConstant(rmode));
DCHECK(RelocInfo::IsLiteralConstant(rmode));
RecordRelocInfo(rmode);
}
*reinterpret_cast<uint64_t*>(pc_) = data;

View File

@ -136,37 +136,23 @@ void Assembler::deserialization_set_target_internal_reference_at(
}
HeapObject RelocInfo::target_object(PtrComprCageBase cage_base) {
DCHECK(IsCodeTarget(rmode_) || IsFullEmbeddedObject(rmode_) ||
IsDataEmbeddedObject(rmode_));
if (IsDataEmbeddedObject(rmode_)) {
return HeapObject::cast(Object(ReadUnalignedValue<Address>(pc_)));
}
DCHECK(IsCodeTarget(rmode_) || IsFullEmbeddedObject(rmode_));
return HeapObject::cast(
Object(Assembler::target_address_at(pc_, constant_pool_)));
}
Handle<HeapObject> RelocInfo::target_object_handle(Assembler* origin) {
if (IsDataEmbeddedObject(rmode_)) {
return Handle<HeapObject>::cast(ReadUnalignedValue<Handle<Object>>(pc_));
} else {
DCHECK(IsCodeTarget(rmode_) || IsFullEmbeddedObject(rmode_));
return Handle<HeapObject>(reinterpret_cast<Address*>(
Assembler::target_address_at(pc_, constant_pool_)));
}
DCHECK(IsCodeTarget(rmode_) || IsFullEmbeddedObject(rmode_));
return Handle<HeapObject>(reinterpret_cast<Address*>(
Assembler::target_address_at(pc_, constant_pool_)));
}
void RelocInfo::set_target_object(Heap* heap, HeapObject target,
WriteBarrierMode write_barrier_mode,
ICacheFlushMode icache_flush_mode) {
DCHECK(IsCodeTarget(rmode_) || IsFullEmbeddedObject(rmode_) ||
IsDataEmbeddedObject(rmode_));
if (IsDataEmbeddedObject(rmode_)) {
WriteUnalignedValue(pc_, target.ptr());
// No need to flush icache since no instructions were changed.
} else {
Assembler::set_target_address_at(pc_, constant_pool_, target.ptr(),
icache_flush_mode);
}
DCHECK(IsCodeTarget(rmode_) || IsFullEmbeddedObject(rmode_));
Assembler::set_target_address_at(pc_, constant_pool_, target.ptr(),
icache_flush_mode);
if (!host().is_null() && !v8_flags.disable_write_barriers) {
WriteBarrierForCode(host(), this, target, write_barrier_mode);
}

View File

@ -3775,8 +3775,7 @@ void Assembler::db(uint8_t data) {
void Assembler::dd(uint32_t data, RelocInfo::Mode rmode) {
CheckForEmitInForbiddenSlot();
if (!RelocInfo::IsNoInfo(rmode)) {
DCHECK(RelocInfo::IsDataEmbeddedObject(rmode) ||
RelocInfo::IsLiteralConstant(rmode));
DCHECK(RelocInfo::IsLiteralConstant(rmode));
RecordRelocInfo(rmode);
}
*reinterpret_cast<uint32_t*>(pc_) = data;
@ -3786,8 +3785,7 @@ void Assembler::dd(uint32_t data, RelocInfo::Mode rmode) {
void Assembler::dq(uint64_t data, RelocInfo::Mode rmode) {
CheckForEmitInForbiddenSlot();
if (!RelocInfo::IsNoInfo(rmode)) {
DCHECK(RelocInfo::IsDataEmbeddedObject(rmode) ||
RelocInfo::IsLiteralConstant(rmode));
DCHECK(RelocInfo::IsLiteralConstant(rmode));
RecordRelocInfo(rmode);
}
*reinterpret_cast<uint64_t*>(pc_) = data;

View File

@ -147,9 +147,7 @@ Handle<Object> Assembler::code_target_object_handle_at(Address pc,
HeapObject RelocInfo::target_object(PtrComprCageBase cage_base) {
DCHECK(IsCodeTarget(rmode_) || IsEmbeddedObjectMode(rmode_));
if (IsDataEmbeddedObject(rmode_)) {
return HeapObject::cast(Object(ReadUnalignedValue<Address>(pc_)));
} else if (IsCompressedEmbeddedObject(rmode_)) {
if (IsCompressedEmbeddedObject(rmode_)) {
return HeapObject::cast(Object(V8HeapCompressionScheme::DecompressTaggedAny(
cage_base,
Assembler::target_compressed_address_at(pc_, constant_pool_))));
@ -166,9 +164,7 @@ Handle<HeapObject> Assembler::compressed_embedded_object_handle_at(
Handle<HeapObject> RelocInfo::target_object_handle(Assembler* origin) {
DCHECK(IsCodeTarget(rmode_) || IsEmbeddedObjectMode(rmode_));
if (IsDataEmbeddedObject(rmode_)) {
return Handle<HeapObject>::cast(ReadUnalignedValue<Handle<Object>>(pc_));
} else if (IsCodeTarget(rmode_)) {
if (IsCodeTarget(rmode_)) {
return Handle<HeapObject>::cast(
origin->code_target_object_handle_at(pc_, constant_pool_));
} else {
@ -184,10 +180,7 @@ void RelocInfo::set_target_object(Heap* heap, HeapObject target,
WriteBarrierMode write_barrier_mode,
ICacheFlushMode icache_flush_mode) {
DCHECK(IsCodeTarget(rmode_) || IsEmbeddedObjectMode(rmode_));
if (IsDataEmbeddedObject(rmode_)) {
WriteUnalignedValue(pc_, target.ptr());
// No need to flush icache since no instructions were changed.
} else if (IsCompressedEmbeddedObject(rmode_)) {
if (IsCompressedEmbeddedObject(rmode_)) {
Assembler::set_target_compressed_address_at(
pc_, constant_pool_,
V8HeapCompressionScheme::CompressTagged(target.ptr()),

View File

@ -2155,8 +2155,7 @@ void Assembler::db(uint8_t data) {
void Assembler::dd(uint32_t data, RelocInfo::Mode rmode) {
CheckBuffer();
if (!RelocInfo::IsNoInfo(rmode)) {
DCHECK(RelocInfo::IsDataEmbeddedObject(rmode) ||
RelocInfo::IsLiteralConstant(rmode));
DCHECK(RelocInfo::IsLiteralConstant(rmode));
RecordRelocInfo(rmode);
}
*reinterpret_cast<uint32_t*>(pc_) = data;
@ -2166,8 +2165,7 @@ void Assembler::dd(uint32_t data, RelocInfo::Mode rmode) {
void Assembler::dq(uint64_t value, RelocInfo::Mode rmode) {
CheckBuffer();
if (!RelocInfo::IsNoInfo(rmode)) {
DCHECK(RelocInfo::IsDataEmbeddedObject(rmode) ||
RelocInfo::IsLiteralConstant(rmode));
DCHECK(RelocInfo::IsLiteralConstant(rmode));
RecordRelocInfo(rmode);
}
*reinterpret_cast<uint64_t*>(pc_) = value;
@ -2177,8 +2175,7 @@ void Assembler::dq(uint64_t value, RelocInfo::Mode rmode) {
void Assembler::dp(uintptr_t data, RelocInfo::Mode rmode) {
CheckBuffer();
if (!RelocInfo::IsNoInfo(rmode)) {
DCHECK(RelocInfo::IsDataEmbeddedObject(rmode) ||
RelocInfo::IsLiteralConstant(rmode));
DCHECK(RelocInfo::IsLiteralConstant(rmode));
RecordRelocInfo(rmode);
}
*reinterpret_cast<uintptr_t*>(pc_) = data;

View File

@ -399,8 +399,6 @@ const char* RelocInfo::RelocModeName(RelocInfo::Mode rmode) {
return "compressed embedded object";
case FULL_EMBEDDED_OBJECT:
return "full embedded object";
case DATA_EMBEDDED_OBJECT:
return "data embedded object";
case CODE_TARGET:
return "code target";
case RELATIVE_CODE_TARGET:
@ -486,7 +484,6 @@ void RelocInfo::Verify(Isolate* isolate) {
Object::VerifyPointer(isolate, target_object(isolate));
break;
case FULL_EMBEDDED_OBJECT:
case DATA_EMBEDDED_OBJECT:
Object::VerifyAnyTagged(isolate, target_object(isolate));
break;
case CODE_TARGET:

View File

@ -59,8 +59,7 @@ class RelocInfo {
// TODO(ishell): rename to NEAR_CODE_TARGET.
RELATIVE_CODE_TARGET, // LAST_CODE_TARGET_MODE
COMPRESSED_EMBEDDED_OBJECT,
FULL_EMBEDDED_OBJECT,
DATA_EMBEDDED_OBJECT, // LAST_GCED_ENUM
FULL_EMBEDDED_OBJECT, // LAST_GCED_ENUM
WASM_CALL, // FIRST_SHAREABLE_RELOC_MODE
WASM_STUB_CALL,
@ -104,7 +103,7 @@ class RelocInfo {
FIRST_REAL_RELOC_MODE = CODE_TARGET,
LAST_REAL_RELOC_MODE = VENEER_POOL,
FIRST_EMBEDDED_OBJECT_RELOC_MODE = COMPRESSED_EMBEDDED_OBJECT,
LAST_EMBEDDED_OBJECT_RELOC_MODE = DATA_EMBEDDED_OBJECT,
LAST_EMBEDDED_OBJECT_RELOC_MODE = FULL_EMBEDDED_OBJECT,
LAST_GCED_ENUM = LAST_EMBEDDED_OBJECT_RELOC_MODE,
FIRST_BUILTIN_ENTRY_MODE = OFF_HEAP_TARGET,
LAST_BUILTIN_ENTRY_MODE = NEAR_BUILTIN_ENTRY,
@ -150,9 +149,6 @@ class RelocInfo {
static constexpr bool IsCompressedEmbeddedObject(Mode mode) {
return COMPRESS_POINTERS_BOOL && mode == COMPRESSED_EMBEDDED_OBJECT;
}
static constexpr bool IsDataEmbeddedObject(Mode mode) {
return mode == DATA_EMBEDDED_OBJECT;
}
static constexpr bool IsEmbeddedObjectMode(Mode mode) {
return base::IsInRange(mode, FIRST_EMBEDDED_OBJECT_RELOC_MODE,
LAST_EMBEDDED_OBJECT_RELOC_MODE);
@ -358,8 +354,7 @@ class RelocInfo {
static int EmbeddedObjectModeMask() {
return ModeMask(RelocInfo::FULL_EMBEDDED_OBJECT) |
ModeMask(RelocInfo::COMPRESSED_EMBEDDED_OBJECT) |
ModeMask(RelocInfo::DATA_EMBEDDED_OBJECT);
ModeMask(RelocInfo::COMPRESSED_EMBEDDED_OBJECT);
}
// In addition to modes covered by the apply mask (which is applied at GC
@ -369,7 +364,6 @@ class RelocInfo {
return ModeMask(RelocInfo::CODE_TARGET) |
ModeMask(RelocInfo::COMPRESSED_EMBEDDED_OBJECT) |
ModeMask(RelocInfo::FULL_EMBEDDED_OBJECT) |
ModeMask(RelocInfo::DATA_EMBEDDED_OBJECT) |
ModeMask(RelocInfo::NEAR_BUILTIN_ENTRY) |
ModeMask(RelocInfo::RELATIVE_CODE_TARGET) | kApplyMask;
}

View File

@ -161,9 +161,7 @@ void Assembler::deserialization_set_target_internal_reference_at(
HeapObject RelocInfo::target_object(PtrComprCageBase cage_base) {
DCHECK(IsCodeTarget(rmode_) || IsEmbeddedObjectMode(rmode_));
if (IsDataEmbeddedObject(rmode_)) {
return HeapObject::cast(Object(ReadUnalignedValue<Address>(pc_)));
} else if (IsCompressedEmbeddedObject(rmode_)) {
if (IsCompressedEmbeddedObject(rmode_)) {
return HeapObject::cast(Object(V8HeapCompressionScheme::DecompressTaggedAny(
cage_base,
Assembler::target_compressed_address_at(pc_, constant_pool_))));
@ -174,9 +172,7 @@ HeapObject RelocInfo::target_object(PtrComprCageBase cage_base) {
}
Handle<HeapObject> RelocInfo::target_object_handle(Assembler* origin) {
if (IsDataEmbeddedObject(rmode_)) {
return Handle<HeapObject>::cast(ReadUnalignedValue<Handle<Object>>(pc_));
} else if (IsCodeTarget(rmode_)) {
if (IsCodeTarget(rmode_)) {
return Handle<HeapObject>::cast(
origin->code_target_object_handle_at(pc_, constant_pool_));
} else if (IsCompressedEmbeddedObject(rmode_)) {
@ -194,10 +190,7 @@ void RelocInfo::set_target_object(Heap* heap, HeapObject target,
WriteBarrierMode write_barrier_mode,
ICacheFlushMode icache_flush_mode) {
DCHECK(IsCodeTarget(rmode_) || IsEmbeddedObjectMode(rmode_));
if (IsDataEmbeddedObject(rmode_)) {
WriteUnalignedValue(pc_, target.ptr());
// No need to flush icache since no instructions were changed.
} else if (IsCompressedEmbeddedObject(rmode_)) {
if (IsCompressedEmbeddedObject(rmode_)) {
Assembler::set_target_compressed_address_at(
pc_, constant_pool_,
V8HeapCompressionScheme::CompressTagged(target.ptr()),

View File

@ -1414,8 +1414,7 @@ void Assembler::db(uint8_t data) {
void Assembler::dd(uint32_t data, RelocInfo::Mode rmode) {
if (!RelocInfo::IsNoInfo(rmode)) {
DCHECK(RelocInfo::IsDataEmbeddedObject(rmode) ||
RelocInfo::IsLiteralConstant(rmode));
DCHECK(RelocInfo::IsLiteralConstant(rmode));
RecordRelocInfo(rmode);
}
if (!is_buffer_growth_blocked()) CheckBuffer();
@ -1425,8 +1424,7 @@ void Assembler::dd(uint32_t data, RelocInfo::Mode rmode) {
void Assembler::dq(uint64_t data, RelocInfo::Mode rmode) {
if (!RelocInfo::IsNoInfo(rmode)) {
DCHECK(RelocInfo::IsDataEmbeddedObject(rmode) ||
RelocInfo::IsLiteralConstant(rmode));
DCHECK(RelocInfo::IsLiteralConstant(rmode));
RecordRelocInfo(rmode);
}
if (!is_buffer_growth_blocked()) CheckBuffer();

View File

@ -141,9 +141,7 @@ Handle<Object> Assembler::code_target_object_handle_at(Address pc) {
HeapObject RelocInfo::target_object(PtrComprCageBase cage_base) {
DCHECK(IsCodeTarget(rmode_) || IsEmbeddedObjectMode(rmode_));
if (IsDataEmbeddedObject(rmode_)) {
return HeapObject::cast(Object(ReadUnalignedValue<Address>(pc_)));
} else if (IsCompressedEmbeddedObject(rmode_)) {
if (IsCompressedEmbeddedObject(rmode_)) {
return HeapObject::cast(Object(V8HeapCompressionScheme::DecompressTaggedAny(
cage_base,
Assembler::target_compressed_address_at(pc_, constant_pool_))));
@ -161,9 +159,7 @@ Handle<HeapObject> Assembler::compressed_embedded_object_handle_at(
Handle<HeapObject> RelocInfo::target_object_handle(Assembler* origin) {
DCHECK(IsRelativeCodeTarget(rmode_) || IsCodeTarget(rmode_) ||
IsEmbeddedObjectMode(rmode_));
if (IsDataEmbeddedObject(rmode_)) {
return Handle<HeapObject>::cast(ReadUnalignedValue<Handle<Object>>(pc_));
} else if (IsCodeTarget(rmode_) || IsRelativeCodeTarget(rmode_)) {
if (IsCodeTarget(rmode_) || IsRelativeCodeTarget(rmode_)) {
return Handle<HeapObject>::cast(origin->code_target_object_handle_at(pc_));
} else {
if (IsCompressedEmbeddedObject(rmode_)) {
@ -178,10 +174,7 @@ void RelocInfo::set_target_object(Heap* heap, HeapObject target,
WriteBarrierMode write_barrier_mode,
ICacheFlushMode icache_flush_mode) {
DCHECK(IsCodeTarget(rmode_) || IsEmbeddedObjectMode(rmode_));
if (IsDataEmbeddedObject(rmode_)) {
WriteUnalignedValue(pc_, target.ptr());
// No need to flush icache since no instructions were changed.
} else if (IsCompressedEmbeddedObject(rmode_)) {
if (IsCompressedEmbeddedObject(rmode_)) {
Assembler::set_target_compressed_address_at(
pc_, constant_pool_,
V8HeapCompressionScheme::CompressTagged(target.ptr()),

View File

@ -782,8 +782,7 @@ void Assembler::db(uint8_t data) {
void Assembler::dd(uint32_t data, RelocInfo::Mode rmode) {
CheckBuffer();
if (!RelocInfo::IsNoInfo(rmode)) {
DCHECK(RelocInfo::IsDataEmbeddedObject(rmode) ||
RelocInfo::IsLiteralConstant(rmode));
DCHECK(RelocInfo::IsLiteralConstant(rmode));
RecordRelocInfo(rmode);
}
*reinterpret_cast<uint32_t*>(pc_) = data;
@ -793,8 +792,7 @@ void Assembler::dd(uint32_t data, RelocInfo::Mode rmode) {
void Assembler::dq(uint64_t value, RelocInfo::Mode rmode) {
CheckBuffer();
if (!RelocInfo::IsNoInfo(rmode)) {
DCHECK(RelocInfo::IsDataEmbeddedObject(rmode) ||
RelocInfo::IsLiteralConstant(rmode));
DCHECK(RelocInfo::IsLiteralConstant(rmode));
RecordRelocInfo(rmode);
}
*reinterpret_cast<uint64_t*>(pc_) = value;
@ -804,8 +802,7 @@ void Assembler::dq(uint64_t value, RelocInfo::Mode rmode) {
void Assembler::dp(uintptr_t data, RelocInfo::Mode rmode) {
CheckBuffer();
if (!RelocInfo::IsNoInfo(rmode)) {
DCHECK(RelocInfo::IsDataEmbeddedObject(rmode) ||
RelocInfo::IsLiteralConstant(rmode));
DCHECK(RelocInfo::IsLiteralConstant(rmode));
RecordRelocInfo(rmode);
}
*reinterpret_cast<uintptr_t*>(pc_) = data;

View File

@ -320,7 +320,7 @@ HeapObject RelocInfo::target_object(PtrComprCageBase cage_base) {
!IsCodeSpaceObject(HeapObject::cast(obj)));
return HeapObject::cast(obj);
}
DCHECK(IsFullEmbeddedObject(rmode_) || IsDataEmbeddedObject(rmode_));
DCHECK(IsFullEmbeddedObject(rmode_));
return HeapObject::cast(Object(ReadUnalignedValue<Address>(pc_)));
}
@ -332,7 +332,7 @@ Handle<HeapObject> RelocInfo::target_object_handle(Assembler* origin) {
if (IsCompressedEmbeddedObject(rmode_)) {
return origin->compressed_embedded_object_handle_at(pc_);
}
DCHECK(IsFullEmbeddedObject(rmode_) || IsDataEmbeddedObject(rmode_));
DCHECK(IsFullEmbeddedObject(rmode_));
return Handle<HeapObject>::cast(ReadUnalignedValue<Handle<Object>>(pc_));
}
}
@ -370,7 +370,7 @@ void RelocInfo::set_target_object(Heap* heap, HeapObject target,
Tagged_t tagged = V8HeapCompressionScheme::CompressTagged(target.ptr());
WriteUnalignedValue(pc_, tagged);
} else {
DCHECK(IsFullEmbeddedObject(rmode_) || IsDataEmbeddedObject(rmode_));
DCHECK(IsFullEmbeddedObject(rmode_));
WriteUnalignedValue(pc_, target.ptr());
}
if (icache_flush_mode != SKIP_ICACHE_FLUSH) {

View File

@ -4399,8 +4399,7 @@ void Assembler::db(uint8_t data) {
void Assembler::dd(uint32_t data, RelocInfo::Mode rmode) {
EnsureSpace ensure_space(this);
if (!RelocInfo::IsNoInfo(rmode)) {
DCHECK(RelocInfo::IsDataEmbeddedObject(rmode) ||
RelocInfo::IsLiteralConstant(rmode));
DCHECK(RelocInfo::IsLiteralConstant(rmode));
RecordRelocInfo(rmode);
}
emitl(data);
@ -4409,8 +4408,7 @@ void Assembler::dd(uint32_t data, RelocInfo::Mode rmode) {
void Assembler::dq(uint64_t data, RelocInfo::Mode rmode) {
EnsureSpace ensure_space(this);
if (!RelocInfo::IsNoInfo(rmode)) {
DCHECK(RelocInfo::IsDataEmbeddedObject(rmode) ||
RelocInfo::IsLiteralConstant(rmode));
DCHECK(RelocInfo::IsLiteralConstant(rmode));
RecordRelocInfo(rmode);
}
emitq(data);

View File

@ -316,8 +316,7 @@ static int DecodeIt(Isolate* isolate, ExternalReferenceEncoder* ref_encoder,
} else if (!rit.done() &&
rit.rinfo()->pc() == reinterpret_cast<Address>(pc) &&
(rit.rinfo()->rmode() == RelocInfo::INTERNAL_REFERENCE ||
rit.rinfo()->rmode() == RelocInfo::LITERAL_CONSTANT ||
rit.rinfo()->rmode() == RelocInfo::DATA_EMBEDDED_OBJECT)) {
rit.rinfo()->rmode() == RelocInfo::LITERAL_CONSTANT)) {
// raw pointer embedded in code stream, e.g., jump table
byte* ptr =
base::ReadUnalignedValue<byte*>(reinterpret_cast<Address>(pc));

View File

@ -200,7 +200,6 @@ class SlotVerifyingVisitor : public ObjectVisitorWithCageBases {
if (ShouldHaveBeenRecorded(host, MaybeObject::FromObject(target))) {
CHECK(InTypedSet(SlotType::kEmbeddedObjectFull, rinfo->pc()) ||
InTypedSet(SlotType::kEmbeddedObjectCompressed, rinfo->pc()) ||
InTypedSet(SlotType::kEmbeddedObjectData, rinfo->pc()) ||
(rinfo->IsInConstantPool() &&
InTypedSet(SlotType::kConstPoolEmbeddedObjectCompressed,
rinfo->constant_pool_entry_address())) ||

View File

@ -3686,11 +3686,9 @@ MarkCompactCollector::ProcessRelocInfo(Code host, RelocInfo* rinfo,
slot_type = SlotType::kCodeEntry;
} else if (RelocInfo::IsFullEmbeddedObject(rmode)) {
slot_type = SlotType::kEmbeddedObjectFull;
} else if (RelocInfo::IsCompressedEmbeddedObject(rmode)) {
slot_type = SlotType::kEmbeddedObjectCompressed;
} else {
DCHECK(RelocInfo::IsDataEmbeddedObject(rmode));
slot_type = SlotType::kEmbeddedObjectData;
DCHECK(RelocInfo::IsCompressedEmbeddedObject(rmode));
slot_type = SlotType::kEmbeddedObjectCompressed;
}
}

View File

@ -34,10 +34,6 @@ SlotCallbackResult UpdateTypedSlotHelper::UpdateTypedSlot(Heap* heap,
RelocInfo rinfo(addr, RelocInfo::FULL_EMBEDDED_OBJECT, 0, Code());
return UpdateEmbeddedPointer(heap, &rinfo, callback);
}
case SlotType::kEmbeddedObjectData: {
RelocInfo rinfo(addr, RelocInfo::DATA_EMBEDDED_OBJECT, 0, Code());
return UpdateEmbeddedPointer(heap, &rinfo, callback);
}
case SlotType::kConstPoolEmbeddedObjectCompressed: {
HeapObject old_target =
HeapObject::cast(Object(V8HeapCompressionScheme::DecompressTaggedAny(
@ -79,10 +75,6 @@ HeapObject UpdateTypedSlotHelper::GetTargetObject(Heap* heap,
RelocInfo rinfo(addr, RelocInfo::FULL_EMBEDDED_OBJECT, 0, Code());
return rinfo.target_object(heap->isolate());
}
case SlotType::kEmbeddedObjectData: {
RelocInfo rinfo(addr, RelocInfo::DATA_EMBEDDED_OBJECT, 0, Code());
return rinfo.target_object(heap->isolate());
}
case SlotType::kConstPoolEmbeddedObjectCompressed: {
Address full = V8HeapCompressionScheme::DecompressTaggedAny(
heap->isolate(), base::Memory<Tagged_t>(addr));

View File

@ -614,11 +614,6 @@ enum class SlotType : uint8_t {
// accessing. Used when pointer is stored in the instruction stream.
kEmbeddedObjectCompressed,
// Full pointer sized slot storing an object start address.
// RelocInfo::target_object/RelocInfo::set_target_object methods are used for
// accessing. Used when pointer is stored in the instruction stream.
kEmbeddedObjectData,
// Full pointer sized slot storing instruction start of Code object.
// RelocInfo::target_address/RelocInfo::set_target_address methods are used
// for accessing. Used when pointer is stored in the instruction stream.

View File

@ -365,7 +365,6 @@ bool Code::IsIsolateIndependent(Isolate* isolate) {
RelocInfo::ModeMask(RelocInfo::RELATIVE_CODE_TARGET) |
RelocInfo::ModeMask(RelocInfo::COMPRESSED_EMBEDDED_OBJECT) |
RelocInfo::ModeMask(RelocInfo::FULL_EMBEDDED_OBJECT) |
RelocInfo::ModeMask(RelocInfo::DATA_EMBEDDED_OBJECT) |
RelocInfo::ModeMask(RelocInfo::EXTERNAL_REFERENCE) |
RelocInfo::ModeMask(RelocInfo::INTERNAL_REFERENCE) |
RelocInfo::ModeMask(RelocInfo::INTERNAL_REFERENCE_ENCODED) |

View File

@ -953,7 +953,6 @@ class Code::BodyDescriptor final : public BodyDescriptorBase {
RelocInfo::ModeMask(RelocInfo::RELATIVE_CODE_TARGET) |
RelocInfo::ModeMask(RelocInfo::FULL_EMBEDDED_OBJECT) |
RelocInfo::ModeMask(RelocInfo::COMPRESSED_EMBEDDED_OBJECT) |
RelocInfo::ModeMask(RelocInfo::DATA_EMBEDDED_OBJECT) |
RelocInfo::ModeMask(RelocInfo::EXTERNAL_REFERENCE) |
RelocInfo::ModeMask(RelocInfo::INTERNAL_REFERENCE) |
RelocInfo::ModeMask(RelocInfo::INTERNAL_REFERENCE_ENCODED) |