[compiler][heap] Update IsInConstantPool for Arm64
It will now return true for 32-bit constants as well. When enabling this, two errors popped up: one in dissassembler where we might have null hosts, and one in remembered set where we should be compressing the address before storing. As a drive-by: make ppc use full objects until their pointer compression implementation is fully done. Bug: v8:7703 Change-Id: I70f05f952d4e1305fe1fe030755f01f74ea5e5dc Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2187622 Reviewed-by: Junliang Yan <jyan@ca.ibm.com> Reviewed-by: Ross McIlroy <rmcilroy@chromium.org> Reviewed-by: Ulan Degenbaev <ulan@chromium.org> Commit-Queue: Santiago Aboy Solanes <solanes@chromium.org> Cr-Commit-Position: refs/heads/master@{#67711}
This commit is contained in:
parent
d0b5b7d194
commit
1a6fe2a745
@ -660,6 +660,7 @@ Address RelocInfo::constant_pool_entry_address() {
|
||||
HeapObject RelocInfo::target_object() {
|
||||
DCHECK(IsCodeTarget(rmode_) || IsEmbeddedObjectMode(rmode_));
|
||||
if (IsCompressedEmbeddedObject(rmode_)) {
|
||||
CHECK(!host_.is_null());
|
||||
return HeapObject::cast(Object(DecompressTaggedAny(
|
||||
host_.address(),
|
||||
Assembler::target_compressed_address_at(pc_, constant_pool_))));
|
||||
|
@ -140,7 +140,9 @@ bool RelocInfo::IsCodedSpecially() {
|
||||
|
||||
bool RelocInfo::IsInConstantPool() {
|
||||
Instruction* instr = reinterpret_cast<Instruction*>(pc_);
|
||||
return instr->IsLdrLiteralX();
|
||||
DCHECK_IMPLIES(instr->IsLdrLiteralW(), COMPRESS_POINTERS_BOOL);
|
||||
return instr->IsLdrLiteralX() ||
|
||||
(COMPRESS_POINTERS_BOOL && instr->IsLdrLiteralW());
|
||||
}
|
||||
|
||||
uint32_t RelocInfo::wasm_call_tag() const {
|
||||
|
@ -2780,7 +2780,10 @@ void CodeGenerator::AssembleMove(InstructionOperand* source,
|
||||
if (IsMaterializableFromRoot(src_object, &index)) {
|
||||
__ LoadRoot(dst, index);
|
||||
} else {
|
||||
__ Move(dst, src_object, RelocInfo::COMPRESSED_EMBEDDED_OBJECT);
|
||||
// TODO(v8:7703, jyan@ca.ibm.com): Turn into a
|
||||
// COMPRESSED_EMBEDDED_OBJECT when the constant pool entry size is
|
||||
// tagged size.
|
||||
__ Move(dst, src_object, RelocInfo::FULL_EMBEDDED_OBJECT);
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
@ -222,7 +222,11 @@ static void PrintRelocInfo(StringBuilder* out, Isolate* isolate,
|
||||
} else if (RelocInfo::IsEmbeddedObjectMode(rmode)) {
|
||||
HeapStringAllocator allocator;
|
||||
StringStream accumulator(&allocator);
|
||||
relocinfo->target_object().ShortPrint(&accumulator);
|
||||
if (relocinfo->host().is_null()) {
|
||||
relocinfo->target_object_no_host(isolate).ShortPrint(&accumulator);
|
||||
} else {
|
||||
relocinfo->target_object().ShortPrint(&accumulator);
|
||||
}
|
||||
std::unique_ptr<char[]> obj_name = accumulator.ToCString();
|
||||
const bool is_compressed = RelocInfo::IsCompressedEmbeddedObject(rmode);
|
||||
out->AddFormatted(" ;; %sobject: %s",
|
||||
|
@ -317,13 +317,12 @@ class UpdateTypedSlotHelper {
|
||||
}
|
||||
case COMPRESSED_OBJECT_SLOT: {
|
||||
HeapObject old_target = HeapObject::cast(Object(DecompressTaggedAny(
|
||||
heap->isolate(),
|
||||
static_cast<Tagged_t>(base::Memory<Address>(addr)))));
|
||||
heap->isolate(), base::Memory<Tagged_t>(addr))));
|
||||
HeapObject new_target = old_target;
|
||||
SlotCallbackResult result = callback(FullMaybeObjectSlot(&new_target));
|
||||
DCHECK(!HasWeakHeapObjectTag(new_target));
|
||||
if (new_target != old_target) {
|
||||
base::Memory<Address>(addr) = new_target.ptr();
|
||||
base::Memory<Tagged_t>(addr) = CompressTagged(new_target.ptr());
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user